2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.manager.testingservices.parallelapsp.test;
10 import javax.management.InstanceAlreadyExistsException;
11 import javax.management.ObjectName;
12 import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
13 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPConfigMXBean;
14 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory;
15 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolConfigMXBean;
16 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
18 public abstract class AbstractParallelAPSPTest extends AbstractConfigTest {
19 protected final String fixed1 = "fixed1";
20 protected final String apsp1 = "apsp-parallel";
22 protected abstract String getThreadPoolImplementationName();
24 protected ObjectName createParallelAPSP(
25 final ConfigTransactionJMXClient transaction, final ObjectName threadPoolON)
26 throws InstanceAlreadyExistsException {
27 ObjectName apspName = transaction.createModule(
28 TestingParallelAPSPModuleFactory.NAME, apsp1);
29 TestingParallelAPSPConfigMXBean parallelAPSPConfigProxy = transaction
30 .newMXBeanProxy(apspName, TestingParallelAPSPConfigMXBean.class);
31 parallelAPSPConfigProxy.setSomeParam("ahoj");
32 parallelAPSPConfigProxy.setThreadPool(threadPoolON);
36 protected ObjectName createFixed1(final ConfigTransactionJMXClient transaction,
37 final int numberOfThreads) throws InstanceAlreadyExistsException {
39 ObjectName name = transaction.createModule(
40 getThreadPoolImplementationName(), fixed1);
42 TestingFixedThreadPoolConfigMXBean fixedConfigProxy = transaction
43 .newMXBeanProxy(name, TestingFixedThreadPoolConfigMXBean.class);
44 fixedConfigProxy.setThreadCount(numberOfThreads);