Skip to content

Commit

Permalink
Merge pull request #78 from vitruv-tools/junit-classpath
Browse files Browse the repository at this point in the history
Fix Xtend error
  • Loading branch information
Jan Wittler authored Dec 12, 2022
2 parents cf5d932 + 5db2461 commit a97ea31
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
package tools.vitruv.dsls.testutils;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Path;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.FluentIterable.from;
import static java.lang.System.lineSeparator;
import static java.lang.reflect.Modifier.isPublic;
import static java.nio.file.Files.readString;
import org.eclipse.jdt.core.compiler.CategorizedProblem;
import static java.nio.file.Files.walk;
import static org.eclipse.xtext.xbase.lib.IterableExtensions.join;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Path;
import java.util.Set;
import java.util.stream.Collectors;

import static java.nio.file.Files.walk;
import static com.google.common.collect.FluentIterable.from;

import org.eclipse.jdt.core.compiler.CategorizedProblem;
import org.eclipse.xtext.util.JavaVersion;
import org.eclipse.xtext.xbase.testing.InMemoryJavaCompiler;
import org.eclipse.xtext.xbase.testing.InMemoryJavaCompiler.Result;
import org.eclipse.xtext.xbase.testing.JavaSource;
import static java.lang.reflect.Modifier.isPublic;
import com.google.common.base.Predicate;

import static org.eclipse.xtext.xbase.lib.IterableExtensions.join;

import static com.google.common.base.Preconditions.checkState;
import com.google.common.base.Predicate;

/**
* Allows to compile all Java source files in a given folder at runtime and provides the compiled classes to use
Expand Down Expand Up @@ -50,7 +47,7 @@ public InMemoryClassesCompiler(Path javaSourcesFolder) {
*/
public InMemoryClassesCompiler compile() throws IOException {
checkState(compiledClasses == null, "classes have already been compiled");
this.compiledClasses = compileJavaFiles(from(walk(javaSourcesFolder).collect(Collectors.toList()))
this.compiledClasses = compileJavaFiles(from(walk(javaSourcesFolder).toList())
.filter(path -> path.toString().endsWith(".java")).transform(path -> new RelativeAndAbsolutePath(javaSourcesFolder, path)).toList());
return this;
}
Expand Down
1 change: 1 addition & 0 deletions tests/tools.vitruv.dsls.commonalities.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions tests/tools.vitruv.dsls.commonalities.ui.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="xtend-gen">
Expand Down
1 change: 1 addition & 0 deletions tests/tools.vitruv.dsls.reactions.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions tests/tools.vitruv.dsls.reactions.ui.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

0 comments on commit a97ea31

Please sign in to comment.