X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2Futil%2FObjectNameUtilTest.java;fp=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2Futil%2FObjectNameUtilTest.java;h=0000000000000000000000000000000000000000;hb=ec74096b76d77a790eb9d6dfa03ac051594406c4;hp=fe322895ab64fd15923680635c77fe765aa651af;hpb=6b2f7dc6b79287e8cab191f2bba093e1e3fb2a22;p=controller.git diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/util/ObjectNameUtilTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/util/ObjectNameUtilTest.java deleted file mode 100644 index fe322895ab..0000000000 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/util/ObjectNameUtilTest.java +++ /dev/null @@ -1,65 +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.manager.impl.util; - -import com.google.common.base.Throwables; -import com.google.common.collect.Sets; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.config.api.jmx.ObjectNameUtil; -import org.opendaylight.controller.config.manager.impl.AbstractLockedPlatformMBeanServerTest; - -import javax.management.ObjectName; -import java.util.Set; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - -public class ObjectNameUtilTest extends AbstractLockedPlatformMBeanServerTest { - private Set unregisterONs; - - @Before - public void initUnregisterList() { - unregisterONs = Sets.newHashSet(); - } - - @After - public void unregisterONs() { - Exception lastException = null; - for (ObjectName on : unregisterONs) { - try { - platformMBeanServer.unregisterMBean(on); - } catch (Exception e) { - lastException = e; - } - } - if (lastException != null) { - throw Throwables.propagate(lastException); - } - } - - @Test - public void testQuotation() throws Exception { - String serviceQName = "(namespace?revision=r)qname"; - String refName = "refName"; - String transaction = "transaction"; - ObjectName serviceReferenceON = ObjectNameUtil.createTransactionServiceON(transaction, serviceQName, refName); - assertFalse(serviceReferenceON.isPattern()); - assertEquals(serviceQName, ObjectNameUtil.getServiceQName(serviceReferenceON)); - assertEquals(refName, ObjectNameUtil.getReferenceName(serviceReferenceON)); - assertEquals(transaction, ObjectNameUtil.getTransactionName(serviceReferenceON)); - - serviceReferenceON = ObjectNameUtil.createReadOnlyServiceON(serviceQName, refName); - assertFalse(serviceReferenceON.isPattern()); - assertEquals(serviceQName, ObjectNameUtil.getServiceQName(serviceReferenceON)); - assertEquals(refName, ObjectNameUtil.getReferenceName(serviceReferenceON)); - assertEquals(null, ObjectNameUtil.getTransactionName(serviceReferenceON)); - - } -}