tail-f-systems / JNC

JNC (Java NETCONF Client) is the name of a Java library for communicating with NETCONF agents, and a plugin for pyang (http://code.google.com/p/pyang/) to generate Java classes from YANG models, to be used by the JNC library.
Other
77 stars 87 forks source link

`FramingTest.java` seems to use Java 11 features in "Java 8" declared JNC library #115

Closed jomiklos closed 1 year ago

jomiklos commented 2 years ago

Tests written for "new" functionality in PR #106 seem to be using features of Java usable only in Java11+, while JNC is currently set as v8 Java project...

When attempting to run tests with JDK 8 being only one installed on system, i run into following errors:

MACHINE:~/github/JNC$ ./gradlew test

Welcome to Gradle 7.4.2!

...

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :compileTestJava FAILED
~/github/JNC/src/test/java/com/tailf/jnc/framing/FramingTest.java:42: error: cannot find symbol
            Framing.END_OF_MESSAGE.newSessionFramer(null, InputStream.nullInputStream(), out);
                                                                     ^
  symbol:   method nullInputStream()
  location: class java.io.InputStream
~/github/JNC/src/test/java/com/tailf/jnc/framing/FramingTest.java:45: error: no suitable method found for toString(java.nio.charset.Charset)
                     FRAME + ENDMARK, out.toString(StandardCharsets.UTF_8));
                                         ^
    method java.io.ByteArrayOutputStream.toString(java.lang.String) is not applicable
      (argument mismatch; java.nio.charset.Charset cannot be converted to java.lang.String)
    method java.io.ByteArrayOutputStream.toString(int) is not applicable
      (argument mismatch; java.nio.charset.Charset cannot be converted to int)
~/github/JNC/src/test/java/com/tailf/jnc/framing/FramingTest.java:52: error: cannot find symbol
            Framing.CHUNKED.newSessionFramer(null, InputStream.nullInputStream(), out);
                                                              ^```

Also, vscode reports several errors on this manner for the above mentioned test source file.

jomiklos commented 1 year ago

fixed in 22ab6675d074982e921e4dd5968b9cb71b42e262