From 178d185be418a9ed491201bd6a0e4d98efa9d820 Mon Sep 17 00:00:00 2001 From: Tony Tkacik Date: Thu, 19 Dec 2013 12:15:18 +0100 Subject: [PATCH] Fixed bug in discovering JVM loaded case classes during code generation - Added debug logging - routing table updates - rpc router creation, non-routed service registration proxy instantiation. Change-Id: Iab0ad7451382ab8179cff2febf17c19e96daf464 Signed-off-by: Tony Tkacik --- .../binding/impl/BindingBrokerImplModule.java | 2 +- .../binding/codegen/RuntimeCodeGenerator.java | 2 +- .../impl/RpcRouterCodegenInstance.java | 11 +++- .../codegen/impl/RpcRoutingTableImpl.java | 39 +++++++++--- .../codegen/impl/RuntimeCodeGenerator.xtend | 4 +- .../sal/binding/codegen/impl/XtendHelper.java | 5 -- .../impl/TransformerGenerator.xtend | 12 +++- .../binding/impl/BindingAwareBrokerImpl.xtend | 47 +++----------- .../binding/impl/RpcProviderRegistryImpl.java | 63 ++++++++++++++++--- .../test/RuntimeCodeGeneratorTest.java | 2 +- .../binding/test/util/BindingTestContext.java | 2 +- 11 files changed, 118 insertions(+), 71 deletions(-) diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/BindingBrokerImplModule.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/BindingBrokerImplModule.java index 48c33ad0fc..c46b0dd6b4 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/BindingBrokerImplModule.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/BindingBrokerImplModule.java @@ -36,7 +36,7 @@ public final class BindingBrokerImplModule extends org.opendaylight.controller.c @Override public java.lang.AutoCloseable createInstance() { - BindingAwareBrokerImpl broker = new BindingAwareBrokerImpl(getBundleContext()); + BindingAwareBrokerImpl broker = new BindingAwareBrokerImpl(getIdentifier().getInstanceName(),getBundleContext()); broker.setDataBroker(getDataBrokerDependency()); broker.setNotifyBroker(getNotificationServiceDependency()); broker.start(); diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeGenerator.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeGenerator.java index 6672d953a2..7789a06fe8 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeGenerator.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeGenerator.java @@ -86,7 +86,7 @@ public interface RuntimeCodeGenerator { * @return Instance of RpcService of provided serviceType which implements * also {@link RpcRouter} and {@link DelegateProxy} */ - RpcRouter getRouterFor(Class serviceType) throws IllegalArgumentException; + RpcRouter getRouterFor(Class serviceType,String name) throws IllegalArgumentException; NotificationInvokerFactory getInvokerFactory(); } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java index 780d0bd4c7..8b2db8b13c 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java @@ -45,16 +45,23 @@ public class RpcRouterCodegenInstance implements // private final Map, RpcRoutingTableImpl> routingTables; - public RpcRouterCodegenInstance(Class type, T routerImpl, Set> contexts, + private final String name; + + @SuppressWarnings("unchecked") + public RpcRouterCodegenInstance(String name,Class type, T routerImpl, Set> contexts, Set> inputs) { + this.name = name; this.listeners = ListenerRegistry.create(); this.serviceType = type; this.invocationProxy = routerImpl; this.contexts = ImmutableSet.copyOf(contexts); Map, RpcRoutingTableImpl> mutableRoutingTables = new HashMap<>(); for (Class ctx : contexts) { - RpcRoutingTableImpl table = new RpcRoutingTableImpl<>(ctx); + RpcRoutingTableImpl table = new RpcRoutingTableImpl<>(name,ctx,type); + + @SuppressWarnings("rawtypes") Map invokerView = table.getRoutes(); + setRoutingTable((RpcService) invocationProxy, ctx, invokerView); mutableRoutingTables.put(ctx, table); table.registerRouteChangeListener(this); diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java index f9592351f6..808358fb35 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java @@ -15,8 +15,11 @@ import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublishe import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; import org.opendaylight.controller.md.sal.common.impl.routing.RoutingUtils; import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; +import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.concepts.Mutable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class RpcRoutingTableImpl // implements // @@ -24,16 +27,22 @@ implements // RpcRoutingTable, // RouteChangePublisher, InstanceIdentifier> { - private final Class identifier; + private static final Logger LOGGER = LoggerFactory.getLogger(RpcRoutingTableImpl.class); + private final String routerName; + private final Class serviceType; + + private final Class contextType; private final ConcurrentMap, S> routes; private final Map, S> unmodifiableRoutes; private RouteChangeListener, InstanceIdentifier> listener; private S defaultRoute; - - public RpcRoutingTableImpl(Class identifier) { + + public RpcRoutingTableImpl(String routerName,Class contextType, Class serviceType) { super(); - this.identifier = identifier; + this.routerName = routerName; + this.serviceType = serviceType; + this.contextType = contextType; this.routes = new ConcurrentHashMap<>(); this.unmodifiableRoutes = Collections.unmodifiableMap(routes); } @@ -56,17 +65,19 @@ implements // @Override public Class getIdentifier() { - return identifier; + return contextType; } @Override @SuppressWarnings("unchecked") public void updateRoute(InstanceIdentifier path, S service) { S previous = this.routes.put(path, service); + + LOGGER.debug("Route {} updated to {} in routing table {}",path,service,this); @SuppressWarnings("rawtypes") RouteChangeListener listenerCapture = listener; if (previous == null && listenerCapture != null) { - listenerCapture.onRouteChange(RoutingUtils.announcementChange(identifier, path)); + listenerCapture.onRouteChange(RoutingUtils.announcementChange(contextType, path)); } } @@ -75,10 +86,11 @@ implements // @SuppressWarnings("unchecked") public void removeRoute(InstanceIdentifier path) { S previous = this.routes.remove(path); + LOGGER.debug("Route {} to {} removed in routing table {}",path,previous,this); @SuppressWarnings("rawtypes") RouteChangeListener listenerCapture = listener; if (previous != null && listenerCapture != null) { - listenerCapture.onRouteChange(RoutingUtils.removalChange(identifier, path)); + listenerCapture.onRouteChange(RoutingUtils.removalChange(contextType, path)); } } @@ -86,7 +98,8 @@ implements // @SuppressWarnings("rawtypes") RouteChangeListener listenerCapture = listener; if (routes.remove(path, service) && listenerCapture != null) { - listenerCapture.onRouteChange(RoutingUtils.removalChange(identifier, path)); + LOGGER.debug("Route {} to {} removed in routing table {}",path,service,this); + listenerCapture.onRouteChange(RoutingUtils.removalChange(contextType, path)); } } @@ -107,6 +120,16 @@ implements // protected void removeAllReferences(S service) { } + + + + @Override + public String toString() { + return "RpcRoutingTableImpl [router=" + routerName + ", service=" + serviceType.getSimpleName() + ", context=" + + contextType.getSimpleName() + "]"; + } + + private class SingletonListenerRegistration, InstanceIdentifier>> extends AbstractObjectRegistration diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend index 8b41552857..d9e0983cfa 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend @@ -91,7 +91,7 @@ class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.co return instance; } - override getRouterFor(Class iface) { + override getRouterFor(Class iface,String routerInstanceName) { val metadata = withClassLoader(iface.classLoader) [| val supertype = iface.asCtClass return supertype.rpcMetadata; @@ -148,7 +148,7 @@ class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.co return targetCls.toClass(iface.classLoader,iface.protectionDomain).newInstance as T ]; - return new RpcRouterCodegenInstance(iface, instance, metadata.contexts,metadata.supportedInputs); + return new RpcRouterCodegenInstance(routerInstanceName,iface, instance, metadata.contexts,metadata.supportedInputs); } private def RpcServiceMetadata getRpcMetadata(CtClass iface) { diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/XtendHelper.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/XtendHelper.java index 588bc789cf..ca1b6344e6 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/XtendHelper.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/XtendHelper.java @@ -9,11 +9,6 @@ import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition; public class XtendHelper { - public static RpcRoutingTableImpl createRoutingTable( - Class cls) { - return new RpcRoutingTableImpl<>(cls); - } - @SuppressWarnings({"rawtypes","unchecked"}) public static Iterable getTypes(UnionTypeDefinition definition) { return (Iterable) (List) definition.getTypes(); diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/dom/serializer/impl/TransformerGenerator.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/dom/serializer/impl/TransformerGenerator.xtend index e5bd3e7b9a..5bc2d70c6a 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/dom/serializer/impl/TransformerGenerator.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/dom/serializer/impl/TransformerGenerator.xtend @@ -145,9 +145,13 @@ class TransformerGenerator { if (typeSpecBuilder == null) { typeSpecBuilder = pathToType.get(node.path); } + var schemaNode = typeToSchemaNode.get(ref); + if(schemaNode === null) { + schemaNode = node; + } checkState(typeSpecBuilder !== null, "Could not find TypeDefinition for %s, $s", inputType.name, node); val typeSpec = typeSpecBuilder.toInstance(); - val newret = generateTransformerFor(inputType, typeSpec, node); + val newret = generateTransformerFor(inputType, typeSpec, schemaNode); listener.onClassProcessed(inputType); return newret as Class, Object>>; ] @@ -524,7 +528,7 @@ class TransformerGenerator { return null; } java.util.Map _compositeNode = (java.util.Map) $2; - ////System.out.println(_localQName + " " + _compositeNode); + System.out.println(_localQName + " " + _compositeNode); «type.builderName» _builder = new «type.builderName»(); boolean _is_empty = true; «FOR child : node.childNodes» @@ -672,6 +676,7 @@ class TransformerGenerator { return null; } java.util.Map _compositeNode = (java.util.Map) $2; + System.out.println(_localQName + " " + _compositeNode); «type.builderName» _builder = new «type.builderName»(); «deserializeKey(type, node)» «deserializeDataNodeContainerBody(type, node)» @@ -687,6 +692,7 @@ class TransformerGenerator { return null; } java.util.Map _compositeNode = (java.util.Map) $2; + System.out.println(_localQName + " " + _compositeNode); «type.builderName» _builder = new «type.builderName»(); «deserializeDataNodeContainerBody(type, node)» «deserializeAugmentations» @@ -702,7 +708,7 @@ class TransformerGenerator { return null; } java.util.Map _compositeNode = (java.util.Map) $2; - ////System.out.println(_localQName + " " + _compositeNode); + System.out.println(_localQName + " " + _compositeNode); «type.builderName» _builder = new «type.builderName»(); «deserializeDataNodeContainerBody(type, node)» «deserializeAugmentations» diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend index 8d3545fbbb..b4bf3f5a83 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend @@ -9,47 +9,16 @@ package org.opendaylight.controller.sal.binding.impl import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer import org.opendaylight.controller.sal.binding.api.BindingAwareProvider -import org.opendaylight.yangtools.yang.binding.RpcService -import javassist.ClassPool import org.osgi.framework.BundleContext -import java.util.Map -import javassist.LoaderClassPath import org.opendaylight.controller.sal.binding.api.BindingAwareBroker -import java.util.Hashtable -import static extension org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper.* - import org.opendaylight.controller.sal.binding.api.NotificationProviderService -import org.osgi.framework.ServiceRegistration -import static org.opendaylight.controller.sal.binding.impl.osgi.Constants.* -import static extension org.opendaylight.controller.sal.binding.impl.osgi.PropertiesUtils.* -import org.opendaylight.controller.sal.binding.api.NotificationService import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext - -import org.slf4j.LoggerFactory -import org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator import org.opendaylight.yangtools.yang.binding.InstanceIdentifier -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration -import org.opendaylight.controller.sal.binding.api.data.DataProviderService -import org.opendaylight.controller.sal.binding.api.data.DataBrokerService -import org.opendaylight.controller.sal.binding.spi.RpcRouter -import java.util.concurrent.ConcurrentHashMap -import static com.google.common.base.Preconditions.* -import org.opendaylight.yangtools.concepts.AbstractObjectRegistration -import org.opendaylight.yangtools.yang.binding.BaseIdentity -import com.google.common.collect.Multimap -import com.google.common.collect.HashMultimap -import static org.opendaylight.controller.sal.binding.impl.util.ClassLoaderUtils.* -import java.util.concurrent.Executors -import java.util.Collections import org.opendaylight.yangtools.yang.binding.DataObject -import java.util.concurrent.locks.ReentrantLock -import java.util.concurrent.Callable -import java.util.WeakHashMap -import javax.annotation.concurrent.GuardedBy -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry -import org.opendaylight.yangtools.concepts.ListenerRegistration -import org.opendaylight.yangtools.concepts.util.ListenerRegistry +import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener +import org.opendaylight.controller.sal.binding.spi.RpcContextIdentifier +import org.opendaylight.controller.sal.binding.api.data.DataProviderService +import org.slf4j.LoggerFactory class BindingAwareBrokerImpl extends RpcProviderRegistryImpl implements BindingAwareBroker, AutoCloseable { private static val log = LoggerFactory.getLogger(BindingAwareBrokerImpl) @@ -65,7 +34,8 @@ class BindingAwareBrokerImpl extends RpcProviderRegistryImpl implements BindingA @Property var BundleContext brokerBundleContext - public new(BundleContext bundleContext) { + public new(String name,BundleContext bundleContext) { + super(name); _brokerBundleContext = bundleContext; } @@ -95,9 +65,12 @@ class BindingAwareBrokerImpl extends RpcProviderRegistryImpl implements BindingA private def createContext(BindingAwareProvider provider, BundleContext providerCtx) { new OsgiProviderContext(providerCtx, this) } + + override >> registerRouteChangeListener(L listener) { + super.registerRouteChangeListener(listener) + } override close() throws Exception { } - } \ No newline at end of file diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java index bc862886d7..6a17007d22 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java @@ -27,6 +27,8 @@ import org.opendaylight.yangtools.concepts.util.ListenerRegistry; import org.opendaylight.yangtools.yang.binding.BaseIdentity; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.RpcService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static com.google.common.base.Preconditions.*; @@ -41,6 +43,19 @@ public class RpcProviderRegistryImpl implements // private final ListenerRegistry>> routeChangeListeners = ListenerRegistry .create(); + private final static Logger LOG = LoggerFactory.getLogger(RpcProviderRegistryImpl.class); + + private final String name; + + public String getName() { + return name; + } + + public RpcProviderRegistryImpl(String name) { + super(); + this.name = name; + } + @Override public final RoutedRpcRegistration addRoutedRpcImplementation(Class type, T implementation) throws IllegalStateException { @@ -50,6 +65,7 @@ public class RpcProviderRegistryImpl implements // @Override public final RpcRegistration addRpcImplementation(Class type, T implementation) throws IllegalStateException { + @SuppressWarnings("unchecked") RpcRouter potentialRouter = (RpcRouter) rpcRouters.get(type); if (potentialRouter != null) { checkState(potentialRouter.getDefaultService() == null, @@ -59,20 +75,35 @@ public class RpcProviderRegistryImpl implements // T publicProxy = getRpcService(type); RpcService currentDelegate = RuntimeCodeHelper.getDelegate(publicProxy); checkState(currentDelegate == null, "Rpc service is already registered"); + LOG.debug("Registering {} as global implementation of {} in {}",implementation,type.getSimpleName(),this); RuntimeCodeHelper.setDelegate(publicProxy, implementation); return new RpcProxyRegistration(type, implementation, this); } + @SuppressWarnings("unchecked") @Override public final T getRpcService(Class type) { - RpcService potentialProxy = publicProxies.get(type); + @SuppressWarnings("unchecked") + T potentialProxy = (T) publicProxies.get(type); if (potentialProxy != null) { - return (T) potentialProxy; + return potentialProxy; + } + synchronized(this) { + /** + * Potential proxy could be instantiated by other thread while we were + * waiting for the lock. + */ + + potentialProxy = (T) publicProxies.get(type); + if (potentialProxy != null) { + return (T) potentialProxy; + } + T proxy = rpcFactory.getDirectProxyFor(type); + LOG.debug("Created {} as public proxy for {} in {}",proxy,type.getSimpleName(),this); + publicProxies.put(type, proxy); + return proxy; } - T proxy = rpcFactory.getDirectProxyFor(type); - publicProxies.put(type, proxy); - return proxy; } private RpcRouter getRpcRouter(Class type) { @@ -80,13 +111,25 @@ public class RpcProviderRegistryImpl implements // if (potentialRouter != null) { return (RpcRouter) potentialRouter; } - RpcRouter router = rpcFactory.getRouterFor(type); - router.registerRouteChangeListener(new RouteChangeForwarder(type)); - RuntimeCodeHelper.setDelegate(getRpcService(type), router.getInvocationProxy()); - rpcRouters.put(type, router); - return router; + synchronized(this) { + /** + * Potential Router could be instantiated by other thread while we were + * waiting for the lock. + */ + potentialRouter = rpcRouters.get(type); + if (potentialRouter != null) { + return (RpcRouter) potentialRouter; + } + RpcRouter router = rpcFactory.getRouterFor(type,name); + router.registerRouteChangeListener(new RouteChangeForwarder(type)); + LOG.debug("Registering router {} as global implementation of {} in {}",router,type.getSimpleName(),this); + RuntimeCodeHelper.setDelegate(getRpcService(type), router.getInvocationProxy()); + rpcRouters.put(type, router); + return router; + } } + @Override public >> ListenerRegistration registerRouteChangeListener( L listener) { return (ListenerRegistration) routeChangeListeners.register(listener); diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/RuntimeCodeGeneratorTest.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/RuntimeCodeGeneratorTest.java index 9c9841a4a5..6f0db4cd8d 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/RuntimeCodeGeneratorTest.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/RuntimeCodeGeneratorTest.java @@ -61,7 +61,7 @@ public class RuntimeCodeGeneratorTest { @Test public void testGenerateRouter() throws Exception { - RpcRouter product = codeGenerator.getRouterFor(FooService.class); + RpcRouter product = codeGenerator.getRouterFor(FooService.class,"test"); assertNotNull(product); assertNotNull(product.getInvocationProxy()); diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java index 3217a31329..d4d27a14ec 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java @@ -110,7 +110,7 @@ public class BindingTestContext implements AutoCloseable { checkState(executor != null,"Executor needs to be set"); checkState(baDataImpl != null,"Binding Data Broker must be started"); checkState(baNotifyImpl != null, "Notification Service must be started"); - baBrokerImpl = new BindingAwareBrokerImpl(null); + baBrokerImpl = new BindingAwareBrokerImpl("test",null); baBrokerImpl.setDataBroker(baDataImpl); baBrokerImpl.setNotifyBroker(baNotifyImpl); -- 2.36.6