import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.controller.cluster.access.ABIVersion;
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestProxy;
import org.opendaylight.controller.cluster.access.concepts.AbstractRequestTest;
import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
import org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier;
}
@Test
- public void getMinVersion() throws Exception {
+ public void getMinVersionTest() throws Exception {
Assert.assertEquals(MIN_VERSION, OBJECT.getMinVersion());
}
@Test
- public void getMaxVersion() throws Exception {
+ public void getMaxVersionTest() throws Exception {
Assert.assertEquals(MAX_VERSION, OBJECT.getMaxVersion());
}
@Test
- public void toRequestFailure() throws Exception {
+ public void toRequestFailureTest() throws Exception {
final RequestException exception = new DeadTransactionException(0);
final ConnectClientFailure failure = OBJECT.toRequestFailure(exception);
Assert.assertNotNull(failure);
}
@Test
- public void externalizableProxy() throws Exception {
- final AbstractRequestProxy<ClientIdentifier, ConnectClientRequest> proxy = OBJECT.externalizableProxy(
- ABIVersion.current());
- Assert.assertNotNull(proxy);
- }
-
- @Test
- public void cloneAsVersion() throws Exception {
+ public void cloneAsVersionTest() throws Exception {
final ConnectClientRequest clone = OBJECT.cloneAsVersion(ABIVersion.BORON);
Assert.assertNotNull(clone);
Assert.assertEquals(ABIVersion.BORON, clone.getVersion());
}
@Test
- public void addToStringAttributes() throws Exception {
+ public void addToStringAttributesTest() throws Exception {
final MoreObjects.ToStringHelper result = OBJECT.addToStringAttributes(MoreObjects.toStringHelper(OBJECT));
Assert.assertTrue(result.toString().contains("minVersion=" + MIN_VERSION));
Assert.assertTrue(result.toString().contains("maxVersion=" + MAX_VERSION));
}
+
+ @Override
+ protected void doAdditionalAssertions(final Object deserialize) {
+ Assert.assertTrue(deserialize instanceof ConnectClientRequest);
+ final ConnectClientRequest casted = (ConnectClientRequest) deserialize;
+
+ Assert.assertEquals(OBJECT.getMaxVersion(), casted.getMaxVersion());
+ Assert.assertEquals(OBJECT.getMinVersion(), casted.getMinVersion());
+ Assert.assertEquals(OBJECT.getReplyTo(), casted.getReplyTo());
+ }
}
\ No newline at end of file