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

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-htl-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a21b39  SLING-7581 - Using data-sly-use with two classes with same 
name will generate uncompilable code
5a21b39 is described below

commit 5a21b3956bb9da5cdd9f2dcdb34ba194d5bdf576
Author: Radu Cotescu <[email protected]>
AuthorDate: Fri Aug 3 17:31:13 2018 +0200

    SLING-7581 - Using data-sly-use with two classes with same name will 
generate uncompilable code
    
    * made the compiler generate FQCN in the Use-API context
    * removed import declarations since they're redundant now
---
 src/test/java/org/apache/sling/maven/htl/ValidateMojoTest.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/sling/maven/htl/ValidateMojoTest.java 
b/src/test/java/org/apache/sling/maven/htl/ValidateMojoTest.java
index 1b98f1a..4a8eb87 100644
--- a/src/test/java/org/apache/sling/maven/htl/ValidateMojoTest.java
+++ b/src/test/java/org/apache/sling/maven/htl/ValidateMojoTest.java
@@ -40,6 +40,7 @@ import org.junit.Test;
 import org.sonatype.plexus.build.incremental.DefaultBuildContext;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
@@ -135,7 +136,7 @@ public class ValidateMojoTest {
         assertEquals("Expected 2 files to process.", 2, processedFiles.size());
         assertTrue("Expected exclude.html to be one of the processed files.", 
processedFiles.contains(new File(baseDir, EXCLUDE_HTML)));
         assertTrue("Expected script.html to be one of the processed files.", 
processedFiles.contains(new File(baseDir, SCRIPT_HTML)));
-        assertEquals("Did not expect compilation warnings.", false, 
validateMojo.hasWarnings());
+        assertFalse("Did not expect compilation warnings.", 
validateMojo.hasWarnings());
     }
 
     @Test
@@ -150,8 +151,8 @@ public class ValidateMojoTest {
         String generatedSourceCode = FileUtils.readFileToString(new 
File(baseDir,
                 
"target/generated-sources/htl/apps/projects/script_html.java"), Charset
                 .forName("UTF-8"));
-        assertTrue(generatedSourceCode.contains("import 
org.apache.sling.settings.SlingSettingsService;"));
-        assertTrue(generatedSourceCode.contains("import apps.projects.Pojo;"));
+        
assertTrue(generatedSourceCode.contains("org.apache.sling.settings.SlingSettingsService"));
+        assertTrue(generatedSourceCode.contains("apps.projects.Pojo"));
     }
 
     private ValidateMojo getMojo(File baseDir, String pomFile) throws 
Exception {

Reply via email to