From a2c30f83a8d81c76c1d8eb66075b25ea8a3be0ba Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Mon, 28 May 2018 15:55:29 +0200 Subject: [PATCH] =?UTF-8?q?Tests=20anf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/asp/withWildcards/ProduceFC.java | 43 +++++++++++++++++++++++++++ test/parser/PackageNameTest.jav | 5 ++++ 2 files changed, 48 insertions(+) create mode 100644 test/asp/withWildcards/ProduceFC.java create mode 100644 test/parser/PackageNameTest.jav diff --git a/test/asp/withWildcards/ProduceFC.java b/test/asp/withWildcards/ProduceFC.java new file mode 100644 index 00000000..c6883921 --- /dev/null +++ b/test/asp/withWildcards/ProduceFC.java @@ -0,0 +1,43 @@ +package asp.withWildcards; + +import de.dhbwstuttgart.sat.asp.ASPUnifyWithoutWildcards; +import de.dhbwstuttgart.sat.asp.Clingo; +import de.dhbwstuttgart.sat.asp.writer.ASPFactory; +import de.dhbwstuttgart.syntaxtree.ClassOrInterface; +import de.dhbwstuttgart.syntaxtree.factory.ASTFactory; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; + +public class ProduceFC extends ASPFactory{ + public static final String tempDirectory = "/tmp/"; + + @Test + public void testInteger() throws InterruptedException, IOException, ClassNotFoundException { + Collection fc = new ArrayList<>(); + fc.add(ASTFactory.createClass(Integer.class)); + System.out.println(run(fc)); + } + + public String run(Collection fc) throws IOException, InterruptedException, ClassNotFoundException { + String content = ""; + this.convertFC(fc); + + content = writer.getASPFile(); + + PrintWriter writer = new PrintWriter(tempDirectory + "test.lp", "UTF-8"); + writer.println(content); + writer.close(); + Clingo clingo = new Clingo( + Arrays.asList(new File(tempDirectory + "test.lp"), + new File("/home/janulrich/Sync/HiwiJob/ResearchPapers/MasterarbeitStadelmeier/asp/finiteClosure/fc.pl"))); + String result = clingo.runClingo(); + + return result; + } +} diff --git a/test/parser/PackageNameTest.jav b/test/parser/PackageNameTest.jav new file mode 100644 index 00000000..c24f75b1 --- /dev/null +++ b/test/parser/PackageNameTest.jav @@ -0,0 +1,5 @@ +import java.lang.Integer; + +class ImportTest{ +java.lang.Integer test(a){return a;} +} \ No newline at end of file