Failed to build Eclipse Californium framework

179 views Asked by At

I am trying to build the Californium repository (https://github.com/eclipse/californium) using maven and OpenJDK-8; following the instruction I cloned the repository and used mvn clean install inside the directory to build Californium.

The building continues to fail during TEST phase of Californium.core and also trying with mvn tree:dependency did not help.

Reading the logs it seems an error related to surefire plugin

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (small-tests) on project californium-core: There are test failures.
[ERROR] 
[ERROR] Please refer to $HOME/californium/californium-core/target/surefire-reports for the individual test results.

I've read the file with errors in the aforementioned directory and the failure seems to depends on a particular exception in the ./californium-core/target/surefire-reports/TEST-org.eclipse.californium.core.coap.RequestTest.xml file

<testcase name="testSetURIRejectsUnresolvableHost" classname="org.eclipse.californium.core.coap.RequestTest" time="0.022">
    <failure message="Expected exception: java.lang.IllegalArgumentException" type="java.lang.AssertionError">java.lang.AssertionError: Expected exception: java.lang.IllegalArgumentException
</failure>
  </testcase>

I can't understand if I'm missing something about maven dependencies or it's not my fault Thanks in advance

3

There are 3 answers

0
David M. Karr On

From what I can see, the project is under active development. I assume you checked out the master branch. That will be changing quite often. The main README file clearly implies that the most recent builds will be volatile. The unit test probably failed because of very new changes that haven't been fully worked out yet.

If you want to use the library, you don't need to build it, just reference the Maven artifact. The README clearly states how to get it, in the "Using Californium in Maven Projects" section.

I tried cloning and building the project myself, and that unit test didn't fail for me, but that could simply be because someone fixed the test between when you cloned it and when I cloned it.

0
Kai Hudalla On

You can also check out the status of the master build on Californium's Jenkins CI sevrer. This should give you an indicating as to whether you can expect the build to succeed locally.

0
Achim Kraus On

A little late ..

Usually the master of Eclipse/Californium should build. AFAIK in the last 2 years, there where only very rare cases, when the master didn't build.

The test, which fails "on your machine" is:

@Test(expected = IllegalArgumentException.class)
public void testSetURIRejectsUnresolvableHost() {
    Request.newGet().setURI("coap://non-existing.host");
}

The test expects, that "your machine" is not able the resolve "non-existing.host".

InetAddress.getByName("non-existing.host");

Is intended to fail with an "UnknownHostException", which is the converted into a "IllegalArgumentException". That resulting exception is tested.

In order to help others, do you see a different error? Does

nslookup non-existing.host

report an address on "your machine"?