From 63ce34c6cdcfd03878c67c5bd59685e526692f2a Mon Sep 17 00:00:00 2001 From: Jan Wittler Date: Mon, 12 Dec 2022 17:00:01 +0100 Subject: [PATCH 1/2] add JUnit to classpath --- tests/tools.vitruv.dsls.commonalities.tests/.classpath | 1 + tests/tools.vitruv.dsls.commonalities.ui.tests/.classpath | 1 + tests/tools.vitruv.dsls.demo.familiespersons.tests/.classpath | 1 + tests/tools.vitruv.dsls.demo.insurancefamilies.tests/.classpath | 1 + tests/tools.vitruv.dsls.demo.insurancepersons.tests/.classpath | 1 + tests/tools.vitruv.dsls.reactions.tests/.classpath | 1 + tests/tools.vitruv.dsls.reactions.ui.tests/.classpath | 1 + 7 files changed, 7 insertions(+) diff --git a/tests/tools.vitruv.dsls.commonalities.tests/.classpath b/tests/tools.vitruv.dsls.commonalities.tests/.classpath index 1fbe59dc..447701e0 100644 --- a/tests/tools.vitruv.dsls.commonalities.tests/.classpath +++ b/tests/tools.vitruv.dsls.commonalities.tests/.classpath @@ -16,6 +16,7 @@ + diff --git a/tests/tools.vitruv.dsls.commonalities.ui.tests/.classpath b/tests/tools.vitruv.dsls.commonalities.ui.tests/.classpath index 1fbe59dc..447701e0 100644 --- a/tests/tools.vitruv.dsls.commonalities.ui.tests/.classpath +++ b/tests/tools.vitruv.dsls.commonalities.ui.tests/.classpath @@ -16,6 +16,7 @@ + diff --git a/tests/tools.vitruv.dsls.demo.familiespersons.tests/.classpath b/tests/tools.vitruv.dsls.demo.familiespersons.tests/.classpath index 79b55556..18a10202 100644 --- a/tests/tools.vitruv.dsls.demo.familiespersons.tests/.classpath +++ b/tests/tools.vitruv.dsls.demo.familiespersons.tests/.classpath @@ -11,6 +11,7 @@ + diff --git a/tests/tools.vitruv.dsls.demo.insurancefamilies.tests/.classpath b/tests/tools.vitruv.dsls.demo.insurancefamilies.tests/.classpath index 79b55556..18a10202 100644 --- a/tests/tools.vitruv.dsls.demo.insurancefamilies.tests/.classpath +++ b/tests/tools.vitruv.dsls.demo.insurancefamilies.tests/.classpath @@ -11,6 +11,7 @@ + diff --git a/tests/tools.vitruv.dsls.demo.insurancepersons.tests/.classpath b/tests/tools.vitruv.dsls.demo.insurancepersons.tests/.classpath index ef548cb9..b12d3470 100644 --- a/tests/tools.vitruv.dsls.demo.insurancepersons.tests/.classpath +++ b/tests/tools.vitruv.dsls.demo.insurancepersons.tests/.classpath @@ -5,6 +5,7 @@ + diff --git a/tests/tools.vitruv.dsls.reactions.tests/.classpath b/tests/tools.vitruv.dsls.reactions.tests/.classpath index 1fbe59dc..447701e0 100644 --- a/tests/tools.vitruv.dsls.reactions.tests/.classpath +++ b/tests/tools.vitruv.dsls.reactions.tests/.classpath @@ -16,6 +16,7 @@ + diff --git a/tests/tools.vitruv.dsls.reactions.ui.tests/.classpath b/tests/tools.vitruv.dsls.reactions.ui.tests/.classpath index 8a04cdec..23cb6d23 100644 --- a/tests/tools.vitruv.dsls.reactions.ui.tests/.classpath +++ b/tests/tools.vitruv.dsls.reactions.ui.tests/.classpath @@ -10,6 +10,7 @@ + From 5db2461cd35e25b8bcd20206942e7afd4e39fcf4 Mon Sep 17 00:00:00 2001 From: Jan Wittler Date: Mon, 12 Dec 2022 17:13:39 +0100 Subject: [PATCH 2/2] replace `collect(Collectors.toList()` with `Stream::toList` --- .../testutils/InMemoryClassesCompiler.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/bundles/tools.vitruv.dsls.testutils/src/tools/vitruv/dsls/testutils/InMemoryClassesCompiler.java b/bundles/tools.vitruv.dsls.testutils/src/tools/vitruv/dsls/testutils/InMemoryClassesCompiler.java index a929f055..f427fde7 100644 --- a/bundles/tools.vitruv.dsls.testutils/src/tools/vitruv/dsls/testutils/InMemoryClassesCompiler.java +++ b/bundles/tools.vitruv.dsls.testutils/src/tools/vitruv/dsls/testutils/InMemoryClassesCompiler.java @@ -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 @@ -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; }