aem-core-cif-components icon indicating copy to clipboard operation
aem-core-cif-components copied to clipboard

Windows | Build failing at junits

Open nishneo opened this issue 3 years ago • 2 comments

Expected Behaviour

Build should be successful

Actual Behaviour

Build fail at junits

Reproduce Scenario (including but not limited to)

mvn clean install at master branch for 2.7.1-SNAPSHOT

Steps to Reproduce

Checkout code and build using mvn clean install

Platform and Version

Windows

Logs taken while reproducing problem

ERROR] Errors: [ERROR] CommerceLinksTransformerTest.testTransformerDisabled:158 ▒ InvalidPath Illegal... [INFO] [ERROR] Tests run: 626, Failures: 0, Errors: 1, Skipped: 0 [INFO]

17:18:04.761 [main] INFO c.a.c.c.c.c.i.s.CommerceLinksTransformerFactory - Commerce links transformer enabled. 17:18:05.095 [main] INFO c.a.c.c.c.c.i.s.CommerceLinksTransformerFactory - Commerce links transformer disabled. [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.477 s <<< FAILURE! - in com.adobe.cq.commerce.core.components.internal.services.CommerceLinksTransformerTest [ERROR] testTransformerDisabled(com.adobe.cq.commerce.core.components.internal.services.CommerceLinksTransformerTest) Time elapsed: 0.22 s <<< ERROR! java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/anupatel/Desktop/Unilever/cif-core-components/aem-core-cif-components/bundles/core/target/test-classes/rewriter/ciflinks.html at com.adobe.cq.commerce.core.components.internal.services.CommerceLinksTransformerTest.testTransformerDisabled(CommerceLinksTransformerTest.java:158)

nishneo avatar Apr 07 '22 12:04 nishneo

This would require inlining the html from the ciflinks.html into the java class. Please feel free to provide a pull request for this.

buuhuu avatar Apr 12 '22 10:04 buuhuu

@Buuhuu I have gone through the code base of java. can you please help me with changes.. // verify transformed HTML String transformedHtml = writer.toString();

    Path filePath = Paths.get(classLoader.getResource(TEST_HTML).getPath());
	
    String originalHtml = Files.lines(filePath).collect(Collectors.joining(System.lineSeparator()));

    assertTrue(transformedHtml.endsWith(originalHtml));

Thanks,

kkaushik2002 avatar Aug 16 '22 16:08 kkaushik2002