2 * Copyright (c) 2014 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.sal.binding.test.util;
10 import com.google.common.annotations.Beta;
11 import com.google.common.base.Preconditions;
12 import com.google.common.util.concurrent.ListeningExecutorService;
13 import com.google.common.util.concurrent.MoreExecutors;
14 import java.util.concurrent.ExecutorService;
15 import javassist.ClassPool;
18 public class BindingBrokerTestFactory {
20 private static final ClassPool CLASS_POOL = ClassPool.getDefault();
21 private boolean startWithParsedSchema = true;
22 private ExecutorService executor;
23 private ClassPool classPool;
26 public boolean isStartWithParsedSchema() {
27 return startWithParsedSchema;
30 public void setStartWithParsedSchema(final boolean startWithParsedSchema) {
31 this.startWithParsedSchema = startWithParsedSchema;
34 public ExecutorService getExecutor() {
38 public void setExecutor(final ExecutorService executor) {
39 this.executor = executor;
42 public BindingTestContext getTestContext() {
43 Preconditions.checkState(executor != null, "Executor is not set.");
44 ListeningExecutorService listenableExecutor = MoreExecutors.listeningDecorator(executor);
45 return new BindingTestContext(listenableExecutor, startWithParsedSchema);
49 public ClassPool getClassPool() {
50 if (classPool == null) {
58 public void setClassPool(final ClassPool classPool) {
59 this.classPool = classPool;