X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Futil%2FJolokiaHelper.java;fp=opendaylight%2Fconfig%2Fconfig-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Futil%2FJolokiaHelper.java;h=0000000000000000000000000000000000000000;hb=5e0aafd8aa4830a4d4df0f4768e6c85245875958;hp=c0a25861e909527d44647f949e6e5dd8f07b63b6;hpb=9f9188b4b31a8962b83527d03bec8a4c75e733ed;p=controller.git diff --git a/opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/JolokiaHelper.java b/opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/JolokiaHelper.java deleted file mode 100644 index c0a25861e9..0000000000 --- a/opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/JolokiaHelper.java +++ /dev/null @@ -1,54 +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.util; - -import org.jolokia.jvmagent.JolokiaServer; -import org.jolokia.jvmagent.JvmAgentConfig; - -public class JolokiaHelper { - private static JolokiaServer jolokiaServer; - - /** - * Bind to port 17777. By convention, ports above 10000 are used for testing - * and < 10000 for production - * - * @return url that can be passed to new J4pClient(url) - */ - public static String startTestingJolokia() { - return startJolokia("localhost", 17777); - } - - /** - * @return url that can be passed to new J4pClient(url) - * @throws IOException - */ - public static String startJolokia(String host, int port) { - String agentArgs = "host=" + host + ",port=" + port; - JvmAgentConfig config = new JvmAgentConfig(agentArgs); - Exception lastException = null; - for (int i = 0; i < 10; i++) { - try { - jolokiaServer = new JolokiaServer(config, false); - jolokiaServer.start(); - return "http://" + host + ":" + port + "/jolokia/"; - } catch (Exception e) { - lastException = e; - try { - Thread.sleep(100); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - } - throw new RuntimeException(lastException); - } - - public static void stopJolokia() { - jolokiaServer.stop(); - } -}