package creator;

import static org.junit.Assert.*;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;

import de.ust.skill.common.java.internal.SkillObject;

public class JSONReaderTest {

	@Test
	public void test() {
		Path path = Paths.get(System.getProperty("user.dir"), "src", "test", "resources");
		path = path.resolve("values.json");
		
		try {
			JSONArray currentJSON = JSONReader.readJSON(path.toFile());
			for (int i = 0; i < currentJSON.length(); i++) {
				JSONObject currentTest = currentJSON.getJSONObject(i);
				SkillObject obj = JSONReader.createSkillObjectFromJSON(currentTest);
				System.out.println(obj.prettyString());
				assertTrue(true);
			}
		} catch (JSONException e) {
			e.printStackTrace();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} finally {
			assertTrue(false);
		}
	}

}

@@ -944,32 +944,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (Malfo
@@ -1004,32 +1004,32 @@
 LException e) %7B%0A
-
 %09%09%09e.printStackT
@@ -1028,32 +1028,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (IOExc
@@ -1102,32 +1102,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (Class
@@ -1187,32 +1187,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (NoSuc
@@ -1271,32 +1271,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (Secur
@@ -1351,32 +1351,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (Insta
@@ -1436,32 +1436,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (Illeg
@@ -1521,32 +1521,54 @@
 ntStackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (Illeg
@@ -1612,24 +1612,46 @@
 ackTrace();%0A
+%09%09%09assertTrue(false);%0A
 %09%09%7D catch (I
@@ -1672,32 +1672,32 @@
 tException e) %7B%0A
+
 %09%09%09e.printStackT
@@ -1708,22 +1708,8 @@
 ();%0A
-%09%09%7D finally %7B%0A
 %09%09%09a

Move assert for exception cases into catch clauses