This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to branch it_fix
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git

commit e7bfbb665c50e1fcc2ed051327b156c57439643b
Author: olivier lamy <ol...@apache.org>
AuthorDate: Mon Nov 19 20:53:46 2018 +1000

    this it reference some java10 directory sources but it was not therw
    
    Signed-off-by: olivier lamy <ol...@apache.org>
---
 .../src/main/java10/module-info.java               | 23 ++++++++++++++
 .../java/mr/ATest.java => main/java10/mr/A.java}   | 36 ++++++----------------
 .../src/test/java/mr/ATest.java                    | 10 ++++++
 .../maven/plugin/compiler/TestCompilerMojo.java    |  4 +--
 4 files changed, 45 insertions(+), 28 deletions(-)

diff --git 
a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java10/module-info.java
 
b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java10/module-info.java
new file mode 100644
index 0000000..2407e6b
--- /dev/null
+++ 
b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java10/module-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+module example.mrjar
+{
+  exports base;
+  exports mr;
+}
diff --git 
a/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java
 
b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java10/mr/A.java
similarity index 51%
copy from 
src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java
copy to 
src/it/multirelease-patterns/singleproject-toolchains/src/main/java10/mr/A.java
index 07a207c..8189e8c 100644
--- 
a/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java
+++ 
b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java10/mr/A.java
@@ -19,34 +19,18 @@ package mr;
  * under the License.
  */
 
-import static org.junit.Assert.assertThat;
-import static org.junit.Assume.assumeThat;
-import static org.hamcrest.CoreMatchers.is;
+import base.Base;
 
-import org.junit.Test;
+import java.util.Optional;
 
-public class ATest {
-    
-    private static final String javaVersion = System.getProperty( 
"java.version" );
-    
-    @Test
-    public void testGet8() throws Exception
-    {
-        assumeThat( javaVersion, is( "8" ) );
-        
-        assertThat( A.getString(),  is( "BASE -> 8" ) );
-
-        assertThat( new A().introducedClass().getName(),  is( 
"java.time.LocalDateTime" ) );
+public class A implements I
+{
+    public static String getString() {
+        return Base.get() + " -> " + Optional.of( "10" ).get();
     }
     
-    @Test
-    public void testGet9() throws Exception
-    {
-        assumeThat( javaVersion, is( "9" ) );
-
-        assertThat( A.getString(),  is( "BASE -> 9" ) );
-
-        assertThat( new A().introducedClass().getName(),  is( 
"java.lang.Module" ) );
+    @Override
+    public Class<?> introducedClass() {
+        return Module.class;
     }
-
-} 
\ No newline at end of file
+}
diff --git 
a/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java
 
b/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java
index 07a207c..88a99be 100644
--- 
a/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java
+++ 
b/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java
@@ -49,4 +49,14 @@ public class ATest {
         assertThat( new A().introducedClass().getName(),  is( 
"java.lang.Module" ) );
     }
 
+    @Test
+    public void testGet10() throws Exception
+    {
+        assumeThat( javaVersion, is( "10" ) );
+
+        assertThat( A.getString(),  is( "BASE -> 10" ) );
+
+        assertThat( new A().introducedClass().getName(),  is( 
"java.lang.Module" ) );
+    }
+
 } 
\ No newline at end of file
diff --git 
a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java 
b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
index f8b9ba1..adfdf2d 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
@@ -336,7 +336,7 @@ public class TestCompilerMojo
                 {
                     if ( compilerArgs == null )
                     {
-                        compilerArgs = new ArrayList<String>();
+                        compilerArgs = new ArrayList<>();
                     }
                     compilerArgs.add( "--patch-module" );
 
@@ -380,7 +380,7 @@ public class TestCompilerMojo
             {
                 if ( compilerArgs == null )
                 {
-                    compilerArgs = new ArrayList<String>();
+                    compilerArgs = new ArrayList<>();
                 }
                 compilerArgs.add( "--patch-module" );
                 

Reply via email to