diff --git a/build.gradle b/build.gradle index 6ed6fc77c211fd4dbc7225884dc21a17dbff7a7a..df810bb7784a80dc560d9809546b4d2b80c97c2f 100644 --- a/build.gradle +++ b/build.gradle @@ -11,40 +11,15 @@ sourceCompatibility = 1.5 repositories { mavenCentral() - mavenRepo name: 'cobra_ext', url: "http://cobra.cs.uni-duesseldorf.de/artifactory/repo" + maven { + url "http://cobra.cs.uni-duesseldorf.de/artifactory/repo" + } } configurations { // configuration that holds jars to copy into lib releaseJars } - -jacoco { - toolVersion = "0.6.2.201302030002" - reportsDir = file("$buildDir/customJacocoReportDir") -} - -jacocoTestReport { - reports { - xml.enabled false - csv.enabled false - html.destination "${buildDir}/jacocoHtml" - } -} - -tasks.withType(FindBugs) { - reports { - xml.enabled = false - html.enabled = true - } - } - -findbugs { - ignoreFailures = true -} - - - def parser_version = '2.4.22-SNAPSHOT' dependencies { @@ -71,6 +46,31 @@ dependencies { releaseJars (group: 'de.prob', name: 'ltlparser', version: parser_version) } +jacoco { + toolVersion = "0.6.2.201302030002" + reportsDir = file("$buildDir/customJacocoReportDir") +} + +jacocoTestReport { + reports { + xml.enabled false + csv.enabled false + html.destination "${buildDir}/jacocoHtml" + } +} + +tasks.withType(FindBugs) { + reports { + xml.enabled = false + html.enabled = true + } +} + +findbugs { + ignoreFailures = true +} + + test { exclude('de/tlc4b/tlc/integration/probprivate') diff --git a/src/main/java/de/tlc4b/TLC4B.java b/src/main/java/de/tlc4b/TLC4B.java index 64e46258dc826663a1a045980e305fb376eb3d6e..43f2ad744dd81631b763e29f3f77d76b2d495379 100644 --- a/src/main/java/de/tlc4b/TLC4B.java +++ b/src/main/java/de/tlc4b/TLC4B.java @@ -409,27 +409,6 @@ public class TLC4B { } } -// try { -// out = new BufferedWriter(new OutputStreamWriter( -// new FileOutputStream(file), "UTF-8")); -// out.write(text); -// out.close(); -// // FileWriter fw; -// // fw = new FileWriter(file); -// // fw.write(text); -// // fw.close(); -// return file; -// } catch (IOException e) { -// e.printStackTrace(); -// throw new TLC4BIOException(e.getMessage()); -// } finally { -// try { -// out.close(); -// } catch (IOException e) { -// e.printStackTrace(); -// throw new TLC4BIOException(e.getMessage()); -// } -// } } } diff --git a/src/test/java/de/tlc4b/prettyprint/Tester.java b/src/test/java/de/tlc4b/prettyprint/Tester.java deleted file mode 100644 index 7b2fa16c8a83c126311f64ee0c998fdab9540029..0000000000000000000000000000000000000000 --- a/src/test/java/de/tlc4b/prettyprint/Tester.java +++ /dev/null @@ -1,54 +0,0 @@ -package de.tlc4b.prettyprint; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; - - -public class Tester { - - - - public Tester(String module, String config) { - File moduleFile; - moduleFile = new File("test.tla"); - try { - moduleFile.createNewFile(); - } catch (IOException e) { - System.err.println("Could not create File."); - return; - } - Writer fw = null; - try { - String res = module; - fw = new FileWriter(moduleFile); - fw.write(res); - fw.close(); - System.out.println("TLA Module test.tla created."); - } catch (IOException e) { - System.err.println("Error while creating file "); - } - - File configFile; - configFile = new File("test.cfg"); - try { - configFile.createNewFile(); - } catch (IOException e) { - System.err.println("Could not create File."); - return; - } - Writer fw2 = null; - try { - String res = config; - fw2 = new FileWriter(configFile); - fw2.write(res); - fw2.close(); - System.out.println("TLA Config test.cfg created."); - } catch (IOException e) { - System.err.println("Error while creating file "); - } - - } - -} diff --git a/src/test/java/de/tlc4b/util/TestUtil.java b/src/test/java/de/tlc4b/util/TestUtil.java index c3bb57a590776cd2ee1aba86b2e655d8000a02b7..67628882818b08d4666e92a35845f821fd45fa88 100644 --- a/src/test/java/de/tlc4b/util/TestUtil.java +++ b/src/test/java/de/tlc4b/util/TestUtil.java @@ -134,30 +134,6 @@ public class TestUtil { return translator.getModuleString(); } - public static void createTempfile(String dir, String fileName, - String moduleString) { - File d = new File(dir); - d.mkdirs(); - - File tempFile = new File(dir + fileName); - try { - tempFile.createNewFile(); - System.out - .println("Testfile:'" + tempFile.getName() + "' created."); - } catch (IOException e1) { - e1.printStackTrace(); - } - FileWriter fw; - try { - fw = new FileWriter(tempFile); - fw.write(moduleString); - fw.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static TLCResult test(String[] args) throws IOException { System.out.println("Starting JVM..."); final Process p = startJVM("", TLC4BTester.class.getCanonicalName(), args); @@ -230,14 +206,13 @@ class StreamGobbler extends Thread { public void run() { try { - InputStreamReader isr = new InputStreamReader(is); + InputStreamReader isr = new InputStreamReader(is, "UTF-8"); BufferedReader br = new BufferedReader(isr); String line = null; while ((line = br.readLine()) != null) { System.out.println("> " + line); log.add(line); } - } catch (IOException e) { e.printStackTrace(); } diff --git a/src/test/java/testing/CompoundScopeTest.java b/src/test/java/testing/CompoundScopeTest.java index e45baa8d2022aeb2a41d80f88fa56a36f88b9c12..97225f9625df1ac0c1b4159fa60313b8bf377290 100644 --- a/src/test/java/testing/CompoundScopeTest.java +++ b/src/test/java/testing/CompoundScopeTest.java @@ -50,7 +50,7 @@ public class CompoundScopeTest { ArrayList<String> list = new ArrayList<String>(map.keySet()); - Hashtable<String, MachineContext> machineContextsTable = new Hashtable<String, MachineContext>(); + //Hashtable<String, MachineContext> machineContextsTable = new Hashtable<String, MachineContext>(); //Hashtable<String, Typechecker> typecheckerTable = new Hashtable<String, Typechecker>(); for (int i = 0; i < list.size(); i++) { String name = list.get(i); diff --git a/src/test/java/testing/CompoundTest.java b/src/test/java/testing/CompoundTest.java index d008f86f8b12a8caaabfbae390ae8e8bd9142c04..4548075d6814cbc6966f9fbf4d0c7f083a43f9d5 100644 --- a/src/test/java/testing/CompoundTest.java +++ b/src/test/java/testing/CompoundTest.java @@ -35,7 +35,7 @@ public class CompoundTest { pragmas.addAll(parser.getPragmas()); r.loadAllMachines(machineFile, tree, parser.getSourcePositions(), parser.getDefinitions(), pragmas); - r.printAsProlog(new PrintWriter(System.out), false); + //r.printAsProlog(new PrintWriter(System.out), false); } } diff --git a/src/test/java/testing/Testing.java b/src/test/java/testing/Testing.java index 0bf941e1950772bd51b7c5e5ea299e9cc1b8dbf9..cf4fe083d022b67c76aba76e714df63deacea7e8 100644 --- a/src/test/java/testing/Testing.java +++ b/src/test/java/testing/Testing.java @@ -1,7 +1,6 @@ package testing; import static de.tlc4b.tlc.TLCResults.TLCResult.*; -import static org.junit.Assert.assertEquals; import java.io.File; import java.util.ArrayList; @@ -24,17 +23,15 @@ public class Testing extends AbstractParseMachineTest{ private final File machine; - private final TLCResult error; public Testing(File machine, TLCResult result) { this.machine = machine; - this.error = result; } @Test public void testRunTLC() throws Exception { String[] a = new String[] { machine.getPath()}; - //B2TLA.main(a); + TLC4B.main(a); //assertEquals(error, B2TLA.test(a,false)); }