22 lines
712 B
Java
22 lines
712 B
Java
package packages;
|
|
|
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
|
import org.junit.Test;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
public class ParsePackageName {
|
|
|
|
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/javFiles/packageTest/de/test/";
|
|
@Test
|
|
public void parsePackage() throws IOException, ClassNotFoundException {
|
|
JavaTXCompiler compiler = new JavaTXCompiler(new File(rootDirectory+"TestClass.jav"));
|
|
for(File f : compiler.sourceFiles.keySet()){
|
|
SourceFile sf = compiler.sourceFiles.get(f);
|
|
assert sf.getPkgName().equals("de.test");
|
|
}
|
|
}
|
|
}
|