<artifactId>bgp-benchmark-app</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>bgp-benchmark-app</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>app-peer-benchmark-config</classifier>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.directory}/classes/initial/bgp-app-peer-benchmark.xml</file>
- <type>xml</type>
- <classifier>app-peer-benchmark-config</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
<scm>
<connection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</connection>
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</developerConnection>
+++ /dev/null
-/*
- * Copyright (c) 2016 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.yang.odl_bgp_benchmark_cfg;
-
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.JmxAttributeValidationException;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.protocol.bgp.benchmark.app.AppPeerBenchmark;
-
-public class AppPeerBenchmarkModule extends AbstractAppPeerBenchmarkModule {
- public AppPeerBenchmarkModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
- super(identifier, dependencyResolver);
- }
-
- public AppPeerBenchmarkModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver, final AppPeerBenchmarkModule oldModule, final java.lang.AutoCloseable oldInstance) {
- super(identifier, dependencyResolver, oldModule, oldInstance);
- }
-
- @Override
- public void customValidation() {
- JmxAttributeValidationException.checkNotNull(getAppRibId(), "value is not set.", appRibIdJmxAttribute);
- }
-
- @Override
- public java.lang.AutoCloseable createInstance() {
- return new AppPeerBenchmark(getBindingDataBrokerDependency(), getRpcRegistryDependency(), getAppRibId());
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 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.yang.odl_bgp_benchmark_cfg;
-
-public class AppPeerBenchmarkModuleFactory extends org.opendaylight.controller.config.yang.odl_bgp_benchmark_cfg.AbstractAppPeerBenchmarkModuleFactory {
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright (c) 2016 Cisco System 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
--->
-<snapshot>
- <required-capabilities>
- <capability>urn:opendaylight:params:xml:ns:yang:controller:odl-bgp-benchmark-cfg?module=odl-bgp-benchmark-cfg&revision=2016-03-09</capability>
- <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
- </required-capabilities>
- <configuration>
-
- <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
- <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:odl-bgp-benchmark-cfg">prefix:app-peer-benchmark</type>
- <name>bgp-app-peer-benchmark</name>
- <rpc-registry>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
- <name>binding-rpc-broker</name>
- </rpc-registry>
- <binding-data-broker>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
- <name>pingpong-binding-data-broker</name>
- </binding-data-broker>
- </module>
- </modules>
- </data>
- </configuration>
-</snapshot>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (c) 2016 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
+ -->
+
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
+ <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" odl:type="pingpong"/>
+ <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
+
+ <odl:clustered-app-config id="bgpBenchmarkConfig"
+ binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.app.peer.benchmark.config.rev161129.Config"/>
+
+ <bean id="bgpBenchmark" class="org.opendaylight.protocol.bgp.benchmark.app.AppPeerBenchmark"
+ destroy-method="close">
+ <argument ref="dataBroker"/>
+ <argument ref="rpcRegistry"/>
+ <argument>
+ <bean factory-ref="bgpBenchmarkConfig" factory-method="getAppPeerId"/>
+ </argument>
+ </bean>
+</blueprint>
\ No newline at end of file
--- /dev/null
+module odl-bgp-app-peer-benchmark-config {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config";
+ prefix bgp-benchmark-app-config;
+
+ description
+ "This module contains the base YANG definitions for
+ BGP Peer Acceptor Configuration.
+ Copyright (c)2016 Cisco Systems, Inc. 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";
+
+ revision "2016-11-29" {
+ description
+ "Initial revision.";
+ }
+
+ container config {
+ leaf app-peer-id {
+ type string;
+ default "192.0.2.6";
+ mandatory true;
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-// Contents of "odl-bgp-benchmark-cfg"
-module odl-bgp-benchmark-cfg {
- namespace "urn:opendaylight:params:xml:ns:yang:controller:odl-bgp-benchmark-cfg";
- prefix "bgp-bm-cfg";
-
- import config { prefix config; revision-date 2013-04-05; }
- import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
-
- organization "Cisco Systems, Inc.";
- contact "Milos Fabian <milfabia@cisco.com>";
-
- description
- "This module contains Configuration Yang Data Model for BGP Benchmark application.
-
- Copyright (c)2016 Cisco Systems, Inc. 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";
-
- revision 2016-03-09 {
- description "Initial revision";
- }
-
- identity app-peer-benchmark {
- base config:module-type;
- config:java-name-prefix AppPeerBenchmark;
- }
-
- augment "/config:modules/config:module/config:configuration" {
- case app-peer-benchmark {
- when "/config:modules/config:module/config:type = 'app-peer-benchmark'";
-
- container rpc-registry {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity mdsal:binding-rpc-registry;
- }
- }
- }
-
- container binding-data-broker {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity mdsal:binding-async-data-broker;
- }
- }
- }
-
- leaf app-rib-id {
- type string;
- default "example-app-rib";
- }
-
- }
- }
-
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2016 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.yang.odl_bgp_benchmark_cfg;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Matchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.JmxAttribute;
-import org.opendaylight.controller.config.api.JmxAttributeValidationException;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.test.AbstractDataBrokerTest;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.protocol.bgp.benchmark.app.AppPeerBenchmark;
-import org.osgi.framework.BundleContext;
-
-public class AppPeerBenchmarkModuleTest extends AbstractDataBrokerTest {
-
- private static final String INSTANCE_NAME = "instance";
-
- @Mock
- private DependencyResolver dependencyResolver;
- @Mock
- private BundleContext bundleContextON;
- @Mock
- private ObjectName bindingDataBrokerON;
- @Mock
- private ObjectName rpcRegistryON;
- @Mock
- private RpcProviderRegistry rpcRegistry;
-
- @Before
- public void setUp() throws MalformedObjectNameException {
- MockitoAnnotations.initMocks(this);
- Mockito.doReturn(this.rpcRegistry).when(this.dependencyResolver).resolveInstance(Matchers.eq(RpcProviderRegistry.class), Mockito.any(ObjectName.class), Mockito.any(JmxAttribute.class));
- Mockito.doReturn(getDataBroker()).when(this.dependencyResolver).resolveInstance(Matchers.eq(DataBroker.class), Mockito.any(ObjectName.class), Mockito.any(JmxAttribute.class));
- }
-
- @Test
- public void testCreateInstance() {
- final AppPeerBenchmarkModule module = (AppPeerBenchmarkModule) new AppPeerBenchmarkModuleFactory().createModule(INSTANCE_NAME,
- this.dependencyResolver, this.bundleContextON);
- module.setAppRibId("appRib");
- module.setBindingDataBroker(this.bindingDataBrokerON);
- module.setRpcRegistry(this.rpcRegistryON);
- module.resolveDependencies();
- module.customValidation();
- final AutoCloseable instance = module.createInstance();
- Assert.assertTrue(instance instanceof AppPeerBenchmark);
- }
-
- @Test(expected=JmxAttributeValidationException.class)
- public void testCustomValidation() {
- final AppPeerBenchmarkModule module = (AppPeerBenchmarkModule) new AppPeerBenchmarkModuleFactory().createModule(INSTANCE_NAME,
- this.dependencyResolver, this.bundleContextON);
- module.setAppRibId(null);
- module.customValidation();
- }
-
-}
<type>xml</type>
<classifier>network-topology-initial-config</classifier>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>bgp-benchmark-app</artifactId>
- <type>xml</type>
- <classifier>app-peer-benchmark-config</classifier>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>data-change-counter-controller-config</artifactId>
<feature version='${project.version}'>odl-bgpcep-bgp-inet</feature>
<feature version='${mdsal.version}'>odl-mdsal-broker</feature>
<bundle>mvn:org.opendaylight.bgpcep/bgp-benchmark-app/{{VERSION}}</bundle>
- <configfile finalname="etc/opendaylight/karaf/bgp-app-peer-benchmark.xml">mvn:org.opendaylight.bgpcep/bgp-benchmark-app/{{VERSION}}/xml/app-peer-benchmark-config</configfile>
</feature>
+
<feature name='odl-bgpcep-bgp-cli' version='${project.version}'>
<feature version='${project.version}'>odl-bgpcep-bgp-rib-impl</feature>
<bundle>mvn:org.opendaylight.bgpcep/bgp-cli/{{VERSION}}</bundle>