Bump mdsal to 5.0.2
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / services / AbstractRequestCallbackTest.java
index ca01864b3624a250a07eca0c712049155af72334..14952672a0e26eeed9554b92c74e0cfcd0c4d87e 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.openflowplugin.impl.services;
 
 import static org.junit.Assert.assertEquals;
@@ -15,15 +22,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessageBuilder;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class AbstractRequestCallbackTest {
 
     private static final Class<?> DUMMY_REQUEST_TYPE = String.class;
     private static final String DUMMY_DEVICE_ID = "DEVICE ID";
     private static final String DUMMY_EVENT_NAME = "EVENT NAME";
-    private static final EventIdentifier DUMMY_EVENT_IDENTIFIER = new EventIdentifier(DUMMY_EVENT_NAME, DUMMY_DEVICE_ID);
+    private static final EventIdentifier DUMMY_EVENT_IDENTIFIER =
+            new EventIdentifier(DUMMY_EVENT_NAME, DUMMY_DEVICE_ID);
     private static final String DUMMY_EXCEPTION_DESCRIPTION = "dummy exception description";
-    private static final Long DUMMY_XID = 100L;
+    private static final Uint32 DUMMY_XID = Uint32.valueOf(100L);
     private static final String DUMMY_MESSAGE_ILLEGAL_STATE_EXCEPTION = "dummy illegal state exception";
 
     AbstractRequestContext dummyRequestContext;
@@ -42,7 +51,7 @@ public class AbstractRequestCallbackTest {
                 DUMMY_REQUEST_TYPE, new MessageIntelligenceAgencyImpl(),
                 DUMMY_EVENT_IDENTIFIER) {
             @Override
-            public void onSuccess(Object o) {
+            public void onSuccess(final Object object) {
 
             }
 
@@ -53,7 +62,8 @@ public class AbstractRequestCallbackTest {
     @Test
     public void testOnFailureWithDeviceRequestFailedException() throws Exception {
         ErrorMessage dummyErrorMessage = new ErrorMessageBuilder().build();
-        abstractRequestCallback.onFailure(new DeviceRequestFailedException(DUMMY_EXCEPTION_DESCRIPTION, dummyErrorMessage));
+        abstractRequestCallback
+                .onFailure(new DeviceRequestFailedException(DUMMY_EXCEPTION_DESCRIPTION, dummyErrorMessage));
         final ListenableFuture futureResult = dummyRequestContext.getFuture();
 
         RpcError rpcError = provideRpcError(futureResult);
@@ -62,16 +72,15 @@ public class AbstractRequestCallbackTest {
 
     @Test
     public void testOnFailure() throws Exception {
-        ErrorMessage dummyErrorMessage = new ErrorMessageBuilder().build();
         abstractRequestCallback.onFailure(new IllegalStateException(DUMMY_MESSAGE_ILLEGAL_STATE_EXCEPTION));
         final ListenableFuture futureResult = dummyRequestContext.getFuture();
 
         RpcError rpcError = provideRpcError(futureResult);
         assertEquals(DUMMY_MESSAGE_ILLEGAL_STATE_EXCEPTION, rpcError.getMessage());
-
     }
 
-    private RpcError provideRpcError(ListenableFuture futureResult) throws InterruptedException, java.util.concurrent.ExecutionException {
+    private RpcError provideRpcError(final ListenableFuture futureResult) throws InterruptedException,
+                                                                           java.util.concurrent.ExecutionException {
         final Object result = futureResult.get();
         assertTrue(result instanceof RpcResult);
         RpcResult rpcResult = (RpcResult) result;
@@ -81,6 +90,4 @@ public class AbstractRequestCallbackTest {
         assertTrue(error instanceof RpcError);
         return (RpcError) error;
     }
-
-
-}
\ No newline at end of file
+}