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 org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
11 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPConfigMXBean;
12 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory;
13 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolConfigMXBean;
14 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
16 import javax.management.InstanceAlreadyExistsException;
17 import javax.management.ObjectName;
19 public abstract class AbstractParallelAPSPTest extends AbstractConfigTest {
20 protected final String fixed1 = "fixed1";
21 protected final String apsp1 = "apsp-parallel";
23 protected abstract String getThreadPoolImplementationName();
25 protected ObjectName createParallelAPSP(
26 ConfigTransactionJMXClient transaction, ObjectName threadPoolON)
27 throws InstanceAlreadyExistsException {
28 ObjectName apspName = transaction.createModule(
29 TestingParallelAPSPModuleFactory.NAME, apsp1);
30 TestingParallelAPSPConfigMXBean parallelAPSPConfigProxy = transaction
31 .newMXBeanProxy(apspName, TestingParallelAPSPConfigMXBean.class);
32 parallelAPSPConfigProxy.setSomeParam("ahoj");
33 parallelAPSPConfigProxy.setThreadPool(threadPoolON);
37 protected ObjectName createFixed1(ConfigTransactionJMXClient transaction,
38 int numberOfThreads) throws InstanceAlreadyExistsException {
40 ObjectName name = transaction.createModule(
41 getThreadPoolImplementationName(), fixed1);
43 TestingFixedThreadPoolConfigMXBean fixedConfigProxy = transaction
44 .newMXBeanProxy(name, TestingFixedThreadPoolConfigMXBean.class);
45 fixedConfigProxy.setThreadCount(numberOfThreads);