X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fimpl%2Fosgi%2FNetconfImplActivatorTest.java;fp=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fimpl%2Fosgi%2FNetconfImplActivatorTest.java;h=0000000000000000000000000000000000000000;hb=4c0c091813aea131d32dc70c5121a450eb9b7291;hp=156c4d7ba9507e44d16c42dc03dfaf80f4b95ca9;hpb=a63cd90c78847178c8ab9a970b2189bdab572a80;p=netconf.git diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java deleted file mode 100644 index 156c4d7ba9..0000000000 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2014 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.netconf.impl.osgi; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.verify; - -import java.util.Arrays; -import java.util.Dictionary; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Filter; -import org.osgi.framework.ServiceListener; -import org.osgi.framework.ServiceReference; -import org.osgi.framework.ServiceRegistration; - -public class NetconfImplActivatorTest { - - @Mock - private BundleContext bundle; - @Mock - private Filter filter; - @Mock - private ServiceReference reference; - @Mock - private ServiceRegistration registration; - - @Before - public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - doReturn(filter).when(bundle).createFilter(anyString()); - doNothing().when(bundle).addServiceListener(any(ServiceListener.class), anyString()); - - ServiceReference[] refs = {}; - doReturn(refs).when(bundle).getServiceReferences(anyString(), anyString()); - doReturn(Arrays.asList(refs)).when(bundle).getServiceReferences(any(Class.class), anyString()); - doReturn("").when(bundle).getProperty(anyString()); - doReturn(registration).when(bundle).registerService(any(Class.class), any(AggregatedNetconfOperationServiceFactory.class), any(Dictionary.class)); - doNothing().when(registration).unregister(); - doNothing().when(bundle).removeServiceListener(any(ServiceListener.class)); - } - - @Test - public void testStart() throws Exception { - NetconfImplActivator activator = new NetconfImplActivator(); - activator.start(bundle); - verify(bundle).registerService(any(Class.class), any(AggregatedNetconfOperationServiceFactory.class), any(Dictionary.class)); - activator.stop(bundle); - } -}