Remove CSS features
[controller.git] / opendaylight / config / netty-event-executor-config / src / test / java / org / opendaylight / controller / config / yang / netty / eventexecutor / GlobalEventExecutorModuleTest.java
diff --git a/opendaylight/config/netty-event-executor-config/src/test/java/org/opendaylight/controller/config/yang/netty/eventexecutor/GlobalEventExecutorModuleTest.java b/opendaylight/config/netty-event-executor-config/src/test/java/org/opendaylight/controller/config/yang/netty/eventexecutor/GlobalEventExecutorModuleTest.java
deleted file mode 100644 (file)
index 2bf7149..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2013 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.controller.config.yang.netty.eventexecutor;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import io.netty.util.concurrent.EventExecutor;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.ObjectName;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.controller.config.api.ConflictingVersionException;
-import org.opendaylight.controller.config.api.ValidationException;
-import org.opendaylight.controller.config.api.jmx.CommitStatus;
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
-import org.osgi.framework.Filter;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-
-public class GlobalEventExecutorModuleTest extends AbstractConfigTest {
-
-    private GlobalEventExecutorModuleFactory factory;
-    private final String instanceName = GlobalEventExecutorModuleFactory.SINGLETON_NAME;
-
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    @Before
-    public void setUp() throws Exception {
-        factory = new GlobalEventExecutorModuleFactory();
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(mockedContext,factory));
-
-        Filter mockFilter = mock(Filter.class);
-        doReturn("mock").when(mockFilter).toString();
-        doReturn(mockFilter).when(mockedContext).createFilter(anyString());
-        doNothing().when(mockedContext).addServiceListener(any(ServiceListener.class), anyString());
-        ServiceReference mockServiceRef = mock(ServiceReference.class);
-        doReturn(new ServiceReference[]{mockServiceRef}).when(mockedContext).
-                getServiceReferences(anyString(), anyString());
-        doReturn(mock(EventExecutor.class)).when(mockedContext).getService(mockServiceRef);
-    }
-
-    @Test
-    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,
-            ConflictingVersionException {
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
-
-        createInstance(transaction, instanceName);
-
-        transaction.validateConfig();
-        CommitStatus status = transaction.commit();
-
-        assertBeanCount(1, factory.getImplementationName());
-        assertStatus(status, 1, 0, 0);
-    }
-
-    @Test
-    public void testConflictingName() throws Exception {
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
-        try {
-            createInstance(transaction, instanceName + "x");
-            fail();
-        }catch(final IllegalArgumentException e){
-            assertTrue(e.getMessage() + " failure", e.getMessage().contains("only allowed name is singleton"));
-        }
-    }
-
-    @Test
-    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,
-            ValidationException {
-
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
-        createInstance(transaction, instanceName);
-
-        transaction.commit();
-
-        transaction = configRegistryClient.createTransaction();
-        assertBeanCount(1, factory.getImplementationName());
-        CommitStatus status = transaction.commit();
-
-        assertBeanCount(1, factory.getImplementationName());
-        assertStatus(status, 0, 0, 1);
-    }
-
-    private ObjectName createInstance(final ConfigTransactionJMXClient transaction, final String instanceName)
-            throws InstanceAlreadyExistsException {
-        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);
-        transaction.newMXBeanProxy(nameCreated, GlobalEventExecutorModuleMXBean.class);
-        return nameCreated;
-    }
-
-}