Merge "BUG-650: Split out CommitCoordinationTask"
[controller.git] / opendaylight / config / config-manager / src / test / java / org / opendaylight / controller / config / manager / impl / AbstractConfigTest.java
index c4a4192cba796340cc845d496060dba7d0f268d5..db1b794d300ef9552039e52591f3dd358a147971 100644 (file)
@@ -7,7 +7,26 @@
  */
 package org.opendaylight.controller.config.manager.impl;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Preconditions;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Dictionary;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.RuntimeMBeanException;
 import org.junit.After;
 import org.junit.Before;
 import org.mockito.Matchers;
@@ -29,26 +48,6 @@ import org.opendaylight.yangtools.yang.data.impl.codec.CodecRegistry;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.RuntimeMBeanException;
-import java.lang.management.ManagementFactory;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Dictionary;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.mock;
-
 /**
  * Each test that relies on
  * {@link org.opendaylight.controller.config.manager.impl.ConfigRegistryImpl}
@@ -199,7 +198,7 @@ public abstract class AbstractConfigTest extends
 
     public static interface BundleContextServiceRegistrationHandler {
 
-       void handleServiceRegistration(Class<?> clazz, Object serviceInstance, Dictionary<String, ?> props);
+        void handleServiceRegistration(Class<?> clazz, Object serviceInstance, Dictionary<String, ?> props);
 
     }
 
@@ -260,19 +259,20 @@ public abstract class AbstractConfigTest extends
 
         Object proxy = Proxy.newProxyInstance(innerObject.getClass().getClassLoader(),
                 innerObject.getClass().getInterfaces(), new InvocationHandler() {
-            @Override
-            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-                try {
-                    return method.invoke(innerObject, args);
-                } catch (InvocationTargetException e) {
-                    try {
-                        throw e.getTargetException();
-                    } catch (RuntimeMBeanException e2) {
-                        throw e2.getTargetException();
+                        @Override
+                        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+                            try {
+                                return method.invoke(innerObject, args);
+                            } catch (InvocationTargetException e) {
+                                try {
+                                    throw e.getTargetException();
+                                } catch (RuntimeMBeanException e2) {
+                                    throw e2.getTargetException();
+                                }
+                            }
+                        }
                     }
-                }
-            }
-        });
+        );
         return (T) proxy;
     }