-1

我正在研究乐山(https://github.com/eclipse/leshan)。

我已经在命令行中运行了乐山项目,所以我使用这个命令来启动测试:

mvn test

我有错误:

 Results :
    
    Failed tests:
      BootstrapTest.bootstrap:59 expected:<1> but was:<0>
      SecurityTest.register_update_reregister_device_with_psk_to_server_with_psk:130 Values should be different. Actual: qtjLtAHNqi
    Tests in error:
      ObserveTest.can_observe_object:137 NullPointer
      WriteTest.can_write_string_resource_in_tlv:74->write_string_resource:90 NullPointer
    
    Tests run: 100, Failures: 2, Errors: 2, Skipped: 13
    
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] leshan ............................................. SUCCESS [0.092 s]
    [INFO] leshan - core ...................................... SUCCESS [9.903 s]
    [INFO] leshan - server core ............................... SUCCESS [1.666 s]
    [INFO] leshan - server californium ........................ SUCCESS [2.778 s]
    [INFO] leshan - client core ............................... SUCCESS [1.663 s]
    [INFO] leshan - client californium ........................ SUCCESS [0.260 s]
    [INFO] leshan - integration tests .........................FAILURE [33.324 s]
    [INFO] leshan - server demo ............................... SKIPPED
    [INFO] leshan - client demo ............................... SKIPPED
    [INFO] leshan - bootstrap server demo ..................... SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 51.197 s
    [INFO] Finished at: 2016-06-07T13:50:17+02:00
    [INFO] Final Memory: 29M/288M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project leshan-integration-tests: There are test failures.
    [ERROR]
    [ERROR] Please refer to C:\dvp_win\leshan-master\leshan-integration-tests\target\surefire-reports for the individual test results.
    [ERROR] -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    [ERROR]
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :leshan-integration-tests

请问你能帮我解决这个问题吗?

4

2 回答 2

0

不是一个好问题。但是您的答案在 Maven 输出中。

Failed tests:
  BootstrapTest.bootstrap:59 expected:<1> but was:<0>
  SecurityTest.register_update_reregister_device_with_psk_to_server_with_psk:130 Values should be different. Actual: qtjLtAHNqi
Tests in error:
  ObserveTest.can_observe_object:137 NullPointer
  WriteTest.can_write_string_resource_in_tlv:74->write_string_resource:90 NullPointer

查看 BootstrapTest 和 SecurityTest 。

于 2016-06-07T12:15:56.190 回答
0

如果您想顺利运行项目,最好跳过测试。命令——mvn clean install -DskipTests 参考github https://github.com/eclipse/leshan/issues/323

于 2019-03-19T07:40:45.407 回答