Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-814

Build fails on test using identifiers with unicode characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • ubuntu 22.04 

      On implementation of MDSAL-675 the generation of artifacts with unicode characters within identifiers were introduced. While jenkins build passes ok, some local environments cause failure on compilationTest in mdsal-binding-java-api-generator 

      Main issue is java compiler cannot properly map package with unicode character to local directory where the expected artifact is allocated, causing cannot find symbol error at import statement

      [ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.658 s <<< FAILURE! - in org.opendaylight.mdsal.binding.java.api.generator.CompilationTest
      [ERROR] org.opendaylight.mdsal.binding.java.api.generator.CompilationTest.yangDataCompilation  Time elapsed: 0.391 s  <<< FAILURE!
      java.lang.AssertionError: 
      Compilation failed with [target/test/src/yang-data-gen/org/opendaylight/yang/gen/v1/urn/test/yang/data/demo/rev220222/$ľaľaho$20$papľuhu.java:11: error: cannot find symbol
      import org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.$ľaľaho$20$papľuhu$.LatinNaming;
                                                                                               ^
        symbol:   class LatinNaming
        location: class org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.$ľaľaho$20$papľuhu$, target/test/src/yang-data-gen/org/opendaylight/yang/gen/v1/urn/test/yang/data/demo/rev220222/$ľaľaho$20$papľuhu.java:106: error: cannot find symbol
          LatinNaming getLatinNaming();
          ^
        symbol:   class LatinNaming
        location: interface org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.$ľaľaho$20$papľuhu, target/test/src/yang-data-gen/org/opendaylight/yang/gen/v1/urn/test/yang/data/demo/rev220222/$ľaľaho$20$papľuhu.java:114: error: cannot find symbol
          @NonNull LatinNaming nonnullLatinNaming();
                   ^
        symbol:   class LatinNaming
        location: interface org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.$ľaľaho$20$papľuhu, target/test/src/yang-data-gen/org/opendaylight/yang/gen/v1/urn/test/yang/data/demo/rev220222/привет.java:11: error: cannot find symbol
      import org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.привет$.CyrillicNaming;
                                                                                   ^
        symbol:   class CyrillicNaming
        location: class org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.привет$, target/test/src/yang-data-gen/org/opendaylight/yang/gen/v1/urn/test/yang/data/demo/rev220222/привет.java:106: error: cannot find symbol
          CyrillicNaming getCyrillicNaming();
          ^
        symbol:   class CyrillicNaming
        location: interface org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.привет, target/test/src/yang-data-gen/org/opendaylight/yang/gen/v1/urn/test/yang/data/demo/rev220222/привет.java:114: error: cannot find symbol
          @NonNull CyrillicNaming nonnullCyrillicNaming();
                   ^
        symbol:   class CyrillicNaming
        location: interface org.opendaylight.yang.gen.v1.urn.test.yang.data.demo.rev220222.привет]
              at org.junit.Assert.fail(Assert.java:89)
              at org.opendaylight.mdsal.binding.java.api.generator.CompilationTestUtils.testCompilation(CompilationTestUtils.java:329)
              at org.opendaylight.mdsal.binding.java.api.generator.CompilationTest.yangDataCompilation(CompilationTest.java:810)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:568)
              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
              at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
              at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
              at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
              at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
              at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
              at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
              at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
              at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
              at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
              at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
              at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
              at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
              at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
              at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
              at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
              at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:55)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:223)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:175)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:139)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
              at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
              at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
      
      
      

       

      Environment details:

      roolic@rkashapov-bf-laptop:~$ cat .config/plasma-localerc
      [Formats]
      LANG=en_US.UTF-8
      LC_MEASUREMENT=ru_UA.UTF-8
      LC_MONETARY=ru_UA.UTF-8
      LC_NUMERIC=ru_UA.UTF-8
      LC_TIME=ru_UA.UTF-8
      useDetailed=true
      
      roolic@rkashapov-bf-laptop:~$ locale
      LANG=en_US.UTF-8
      LANGUAGE=en_US.UTF-8
      LC_CTYPE="en_US.UTF-8"
      LC_NUMERIC=ru_UA.UTF-8
      LC_TIME=ru_UA.UTF-8
      LC_COLLATE="en_US.UTF-8"
      LC_MONETARY=ru_UA.UTF-8
      LC_MESSAGES="en_US.UTF-8"
      LC_PAPER=uk_UA.UTF-8
      LC_NAME=uk_UA.UTF-8
      LC_ADDRESS=uk_UA.UTF-8
      LC_TELEPHONE=uk_UA.UTF-8
      LC_MEASUREMENT=ru_UA.UTF-8
      LC_IDENTIFICATION=uk_UA.UTF-8
      LC_ALL=
      

            ivanhrasko Ivan Hrasko
            rkashapov Ruslan Kashapov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: