Fix unit test failures
A couple tests in ShardTransactionTest are failing on jenkins builds:
java.lang.AssertionError: assertion failed: expected class
org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages$CommitTransactionReply,
found class akka.actor.Status$Failure
at scala.Predef$.assert(Predef.scala:179)
at
akka.testkit.TestKitBase$class.expectMsgClass_internal(TestKit.scala:424)
at
akka.testkit.TestKitBase$class.expectMsgClass(TestKit.scala:419)
at akka.testkit.TestKit.expectMsgClass(TestKit.scala:718)
at akka.testkit.JavaTestKit.expectMsgClass(JavaTestKit.java:408)
at
org.opendaylight.controller.cluster.datastore.ShardTransactionTest$14.<init>(ShardTransactionTest.java:474)
at
org.opendaylight.controller.cluster.datastore.ShardTransactionTest.testOnReceiveBatchedModificationsReadyWithImmediateCommit(ShardTransactionTest.java:454)
The tests use a "desc" leaf node but it's not defined in the test yang.
Nothing has changed in these tests so it appears there was a recent change
in yangtools to validate the node structure on put/merge.
I also fixed an intermittent timing failure in
PreLithiumShardTest#testHelium2VersionApplyStateLegacy that I see a
couple times.
Also, JsonToNnTest has been failing on merge builds:
org.junit.ComparisonFailure: expected:<...me cont wasn't found[].> but
was:<...me cont wasn't found[ under
(urn:ietf:params:xml:ns:netconf:base:1.0)data].>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at
org.opendaylight.controller.sal.restconf.impl.json.to.nn.test.JsonToNnTest.incorrectTopLevelElementsTest(JsonToNnTest.java:129)
Apparently a change elsewhere added more text to the error message. I
changed the test to use the containsString matcher instead of exact
match.
Change-Id: I33ef71bce50ff39e26dcf2b443679c8eb34dd0dd
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>