forked from JavaTX/JavaCompilerCore
Tests anfügen
This commit is contained in:
parent
fc9b1a6bb1
commit
a2c30f83a8
43
test/asp/withWildcards/ProduceFC.java
Normal file
43
test/asp/withWildcards/ProduceFC.java
Normal file
@ -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<ClassOrInterface> fc = new ArrayList<>();
|
||||||
|
fc.add(ASTFactory.createClass(Integer.class));
|
||||||
|
System.out.println(run(fc));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String run(Collection<ClassOrInterface> 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;
|
||||||
|
}
|
||||||
|
}
|
5
test/parser/PackageNameTest.jav
Normal file
5
test/parser/PackageNameTest.jav
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
class ImportTest{
|
||||||
|
java.lang.Integer test(a){return a;}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user