Hello guys,
I use the Netbeans 8.1 with Java v7 (which I indicate the complier version in the pom.xml). When I try to do the unit test/integration tests, it seems some issues happen in my configuration. The results show that the CDMI client didn't find the correct ROOT container, or the system even did not start the CDMI server. But I found there is a ServerContext.java class which should prepare the environment for such tests, is my understanding right?
The procedure I did as follows:
1. I compile the project with indicated Java v7 compiler without maven tests.
2. I "run" the project in netbeans IDE with glassfish 4.1.1, and I found it deployed via the server console. Though there is no "welcome" page like index.html presented.
3. I right-click the files in the "test package".
For example, I did the "Test File" with "CapabilityTest.java", and the following log occurs:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.snia.cdmiserver.CapabilityTests
org.apache.http.message.BasicHttpResponse@3d2fdcd7Tests run: 4, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 0.578 sec <<< FAILURE! - in org.snia.cdmiserver.CapabilityTests
shouldShowRootCapability(org.snia.cdmiserver.CapabilityTests) Time elapsed: 0.561 sec <<< FAILURE!
java.lang.AssertionError:
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
at org.junit.Assert.assertThat(Assert.java:778)
at org.junit.Assert.assertThat(Assert.java:736)
at org.snia.cdmiserver.CapabilityTests.shouldShowRootCapability(CapabilityTests.java:105)
shouldShowContainerCapability(org.snia.cdmiserver.CapabilityTests) Time elapsed: 0.003 sec <<< FAILURE!
java.lang.AssertionError:
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
at org.junit.Assert.assertThat(Assert.java:778)
at org.junit.Assert.assertThat(Assert.java:736)
at org.snia.cdmiserver.CapabilityTests.shouldShowContainerCapability(CapabilityTests.java:133)
shouldShowContainerDefaultCapability(org.snia.cdmiserver.CapabilityTests) Time elapsed: 0.005 sec <<< FAILURE!
java.lang.AssertionError:
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
at org.junit.Assert.assertThat(Assert.java:778)
at org.junit.Assert.assertThat(Assert.java:736)
at org.snia.cdmiserver.CapabilityTests.shouldShowContainerDefaultCapability(CapabilityTests.java:161)
shouldShowDataObjectCapability(org.snia.cdmiserver.CapabilityTests) Time elapsed: 0.005 sec <<< FAILURE!
java.lang.AssertionError:
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
at org.junit.Assert.assertThat(Assert.java:778)
at org.junit.Assert.assertThat(Assert.java:736)
at org.snia.cdmiserver.CapabilityTests.shouldShowDataObjectCapability(CapabilityTests.java:188)
Results :
Failed tests:
CapabilityTests.shouldShowContainerCapability:133
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
CapabilityTests.shouldShowContainerDefaultCapability:161
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
CapabilityTests.shouldShowDataObjectCapability:188
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
CapabilityTests.shouldShowRootCapability:105
Expected: status code 200
got: <HTTP/1.1 404 Not Found>
Tests run: 4, Failures: 4, Errors: 0, Skipped: 0
----------------------------------------------------end of my test log--
Thanks very much for any reply!!