Fixed RESTCONF integration, added IT skeleton 29/2529/2
authorTony Tkacik <ttkacik@cisco.com>
Fri, 8 Nov 2013 00:37:56 +0000 (01:37 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 8 Nov 2013 12:09:02 +0000 (12:09 +0000)
Change-Id: I5fa91649afd6568362f5cc69dfbc142b0b95bd0c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/sal-rest-connector/pom.xml
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend
opendaylight/md-sal/sal-rest-connector/src/main/resources/WEB-INF/web.xml [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/XmlProvidersTest.java
opendaylight/md-sal/test/sal-rest-connector-it/pom.xml [new file with mode: 0644]
opendaylight/md-sal/test/sal-rest-connector-it/src/test/java/org/opendaylight/controller/test/restconf/it/ServiceProviderController.java [new file with mode: 0644]
opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/exam.properties [new file with mode: 0644]
opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/logback.xml [new file with mode: 0644]
opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/tomcat-server.xml [new file with mode: 0644]

index 8cc46dda9f12b4156ef0662d280a99349e9cf0b1..bdcb0bdd2bce239d65eac72f83432c1cff036a0e 100644 (file)
               org.eclipse.xtend.lib,
               org.eclipse.xtext.xbase.*
             </Private-Package>
+            <Import-Package>
+            *,
+            com.sun.jersey.spi.container.servlet
+            </Import-Package>
+            <Bundle-Activator>org.opendaylight.controller.sal.rest.impl.RestconfProvider</Bundle-Activator>
+            <Web-ContextPath>/restconf</Web-ContextPath>
           </instructions>
         </configuration>
       </plugin>
index 0f566f5df72e36bd9e401ec8613585cafc460e13..b8cb2292542b8da4ecf7f8573d6b578a47ff3810 100644 (file)
@@ -44,7 +44,7 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
  *         <li>/version (field)
  *     </ul>
  */
-@Path("restconf")
+@Path("/")
 public interface RestconfService {
 
     public static final String XML = "+xml";
@@ -59,17 +59,17 @@ public interface RestconfService {
     public Object readAllData();
 
     @GET
-    @Path("/datastore/{identifier}")
+    @Path("/datastore/{identifier:.+}")
     @Produces({API+JSON,API+XML})
     public StructuredData readData(@PathParam("identifier") String identifier);
 
     @PUT
-    @Path("/datastore/{identifier}")
+    @Path("/datastore/{identifier:.+}")
     @Produces({API+JSON,API+XML})
     public Object createConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
 
     @POST
-    @Path("/datastore/{identifier}")
+    @Path("/datastore/{identifier:.+}")
     @Produces({API+JSON,API+XML})
     public Object updateConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
 
diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java
new file mode 100644 (file)
index 0000000..35b751c
--- /dev/null
@@ -0,0 +1,41 @@
+package org.opendaylight.controller.sal.rest.impl;
+
+import org.opendaylight.controller.sal.core.api.AbstractProvider;
+import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
+import org.opendaylight.controller.sal.core.api.data.DataBrokerService;
+import org.opendaylight.controller.sal.core.api.data.DataProviderService;
+import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.controller.sal.core.api.model.SchemaServiceListener;
+import org.opendaylight.controller.sal.restconf.impl.BrokerFacade;
+import org.opendaylight.controller.sal.restconf.impl.ControllerContext;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.osgi.framework.BundleContext;
+
+public class RestconfProvider extends AbstractProvider {
+
+    private ListenerRegistration<SchemaServiceListener> listenerRegistration;
+
+    @Override
+    public void onSessionInitiated(ProviderSession session) {
+        DataBrokerService dataService = session.getService(DataBrokerService.class);
+
+        BrokerFacade.getInstance().setContext(session);
+        BrokerFacade.getInstance().setDataService(dataService);
+
+        SchemaService schemaService = session.getService(SchemaService.class);
+        listenerRegistration = schemaService.registerSchemaServiceListener(ControllerContext.getInstance());
+        ControllerContext.getInstance().setSchemas(schemaService.getGlobalContext());
+    }
+
+    @Override
+    protected void stopImpl(BundleContext context) {
+        super.stopImpl(context);
+        if (listenerRegistration != null) {
+            try {
+                listenerRegistration.close();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}
index 5057413a7a0710b8261e359340fca5b0820e4f2f..2b3a3042c2ce9119c9ee9d0176dcf88ed52807cb 100644 (file)
@@ -24,13 +24,14 @@ import org.opendaylight.yangtools.yang.model.api.ListSchemaNode
 import org.opendaylight.yangtools.yang.model.api.SchemaContext
 
 import static com.google.common.base.Preconditions.*
+import org.opendaylight.controller.sal.core.api.model.SchemaServiceListener
+
+class ControllerContext implements SchemaServiceListener {
 
-class ControllerContext {
-    
     val static ControllerContext INSTANCE = new ControllerContext
-    
+
     val static NULL_VALUE = "null"
-    
+
     @Property
     SchemaContext schemas;
 
@@ -208,6 +209,7 @@ class ControllerContext {
         if (targetNode instanceof ListSchemaNode) {
             val listNode = targetNode as ListSchemaNode;
             val keysSize = listNode.keyDefinition.size
+
             // every key has to be filled
             if ((strings.length - consumed) < keysSize) {
                 return null;
@@ -217,6 +219,7 @@ class ControllerContext {
             var i = 0;
             for (key : listNode.keyDefinition) {
                 val uriKeyValue = uriKeyValues.get(i);
+
                 // key value cannot be NULL
                 if (uriKeyValue.equals(NULL_VALUE)) {
                     return null
@@ -227,6 +230,7 @@ class ControllerContext {
             consumed = consumed + i;
             builder.nodeWithKey(targetNode.QName, keyValues);
         } else {
+
             // Only one instance of node is allowed
             builder.node(targetNode.QName);
         }
@@ -270,4 +274,9 @@ class ControllerContext {
 
     public def QName toRpcQName(String name) {
     }
+
+    override onGlobalContextUpdated(SchemaContext context) {
+        this.schemas = context;
+    }
+
 }
diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/resources/WEB-INF/web.xml b/opendaylight/md-sal/sal-rest-connector/src/main/resources/WEB-INF/web.xml
new file mode 100644 (file)
index 0000000..eb2b516
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+    version="3.0">
+
+    <servlet>
+        <servlet-name>JAXRSRestconf</servlet-name>
+        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.opendaylight.controller.sal.rest.impl.RestconfApplication</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>JAXRSRestconf</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
+
+    <filter>
+        <filter-name>CorsFilter</filter-name>
+        <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
+        <init-param>
+            <param-name>cors.allowed.origins</param-name>
+            <param-value>*</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.allowed.methods</param-name>
+            <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.allowed.headers</param-name>
+            <param-value>Content-Type,X-Requested-With,accept,authorization, 
+        origin,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.exposed.headers</param-name>
+            <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.support.credentials</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <init-param>
+            <param-name>cors.preflight.maxage</param-name>
+            <param-value>10</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>CorsFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>NB api</web-resource-name>
+            <url-pattern>/*</url-pattern>
+            <http-method>POST</http-method>
+            <http-method>GET</http-method>
+            <http-method>PUT</http-method>
+            <http-method>PATCH</http-method>
+            <http-method>DELETE</http-method>
+            <http-method>HEAD</http-method>
+        </web-resource-collection>
+    </security-constraint>
+
+</web-app>
index 3020824d3d97367374d53dd41c1242431a152090..0b8b5d48de1d6fe40bafaa5e82b61e854162fed6 100644 (file)
@@ -84,7 +84,7 @@ public class XmlProvidersTest extends JerseyTest {
     public void testStructuredDataToXmlProvider() throws FileNotFoundException {
         URI uri = null;
         try {
-            uri = new URI("/restconf/datastore/" + URLEncoder.encode("ietf-interfaces:interfaces/interface/eth0", Charsets.US_ASCII.name()).toString());
+            uri = new URI("/datastore/" + URLEncoder.encode("ietf-interfaces:interfaces/interface/eth0", Charsets.US_ASCII.name()).toString());
         } catch (UnsupportedEncodingException | URISyntaxException e) {
             e.printStackTrace();
         }
@@ -101,7 +101,7 @@ public class XmlProvidersTest extends JerseyTest {
     public void testXmlToCompositeNodeProvider() throws ParserConfigurationException, SAXException, IOException {
         URI uri = null;
         try {
-            uri = new URI("/restconf/operations/" + URLEncoder.encode("ietf-interfaces:interfaces/interface/eth0", Charsets.US_ASCII.name()).toString());
+            uri = new URI("/operations/" + URLEncoder.encode("ietf-interfaces:interfaces/interface/eth0", Charsets.US_ASCII.name()).toString());
         } catch (UnsupportedEncodingException | URISyntaxException e) {
             e.printStackTrace();
         }
@@ -138,7 +138,7 @@ public class XmlProvidersTest extends JerseyTest {
     public void testXmlToCompositeNodeProviderExceptions() {
         URI uri = null;
         try {
-            uri = new URI("/restconf/operations/" + URLEncoder.encode("ietf-interfaces:interfaces/interface/eth0", Charsets.US_ASCII.name()).toString());
+            uri = new URI("/operations/" + URLEncoder.encode("ietf-interfaces:interfaces/interface/eth0", Charsets.US_ASCII.name()).toString());
         } catch (UnsupportedEncodingException | URISyntaxException e) {
             e.printStackTrace();
         }
diff --git a/opendaylight/md-sal/test/sal-rest-connector-it/pom.xml b/opendaylight/md-sal/test/sal-rest-connector-it/pom.xml
new file mode 100644 (file)
index 0000000..b5b1642
--- /dev/null
@@ -0,0 +1,627 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>sal-test-parent</artifactId>
+        <groupId>org.opendaylight.controller.tests</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>sal-rest-connector-it</artifactId>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+    </scm>
+
+    <properties>
+        <exam.version>3.0.0</exam.version>
+        <url.version>1.5.0</url.version>
+        <geminiweb.version>2.2.0.RELEASE</geminiweb.version>
+        <virgo.version>3.6.0.RELEASE</virgo.version>
+        <spring.version>3.1.3.RELEASE</spring.version>
+        <jersey.version>1.17</jersey.version>
+        <spring-security.version>3.1.3.RELEASE</spring-security.version>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>maven-paxexam-plugin</artifactId>
+                <version>1.2.4</version>
+                <executions>
+                    <execution>
+                        <id>generate-config</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+        <pluginManagement>
+            <plugins>
+                <!--This plugin's configuration is used to store Eclipse 
+                    m2e settings only. It has no influence on the Maven build itself. -->
+                <plugin>
+                    <groupId>org.eclipse.m2e</groupId>
+                    <artifactId>lifecycle-mapping</artifactId>
+                    <version>1.0.0</version>
+                    <configuration>
+                        <lifecycleMappingMetadata>
+                            <pluginExecutions>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>
+                                            org.ops4j.pax.exam
+                                        </groupId>
+                                        <artifactId>
+                                            maven-paxexam-plugin
+                                        </artifactId>
+                                        <versionRange>
+                                            [1.2.4,)
+                                        </versionRange>
+                                        <goals>
+                                            <goal>
+                                                generate-depends-file
+                                            </goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore></ignore>
+                                    </action>
+                                </pluginExecution>
+                            </pluginExecutions>
+                        </lifecycleMappingMetadata>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>logging.bridge</artifactId>
+            <version>0.4.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
+            <artifactId>xtend-lib-osgi</artifactId>
+            <version>2.4.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>bundlescanner.implementation</artifactId>
+            <version>0.4.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-broker-impl</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-rest-connector</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-it</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.osgi</artifactId>
+            <version>3.8.1.v20120830-144521</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>log4j-over-slf4j</artifactId>
+            <version>1.7.2</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>1.0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>1.0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-api</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-common-util</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-core-api</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.model</groupId>
+            <artifactId>model-flow-service</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>config-manager</artifactId>
+            <version>0.2.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.model</groupId>
+            <artifactId>model-flow-management</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
+            <artifactId>antlr4-runtime-osgi-nohead</artifactId>
+            <version>4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-binding</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>commons.northbound</artifactId>
+            <version>0.4.1-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-common-util</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>1.7.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>log4j-over-slf4j</artifactId>
+            <version>1.7.2</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>1.0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>1.0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.8</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>javax.servlet</artifactId>
+            <version>3.0.0.v201112011016</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>javax.servlet.jsp</artifactId>
+            <version>2.2.0.v201112011158</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.equinox.ds</artifactId>
+            <version>1.4.0.v20120522-1841</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.equinox.util</artifactId>
+            <version>1.0.400.v20120522-2049</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.osgi.services</artifactId>
+            <version>3.3.100.v20120522-1822</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.osgi</artifactId>
+            <version>3.8.1.v20120830-144521</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.apache.felix.gogo.command</artifactId>
+            <version>0.8.0.v201108120515</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.apache.felix.gogo.runtime</artifactId>
+            <version>0.8.0.v201108120515</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.apache.felix.gogo.shell</artifactId>
+            <version>0.8.0.v201110170705</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.equinox.cm</artifactId>
+            <version>1.0.400.v20120522-1841</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.equinox.console</artifactId>
+            <version>1.0.0.v20120522-1841</version>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.equinox.launcher</artifactId>
+            <version>1.3.0.v20120522-1813</version>
+        </dependency>
+        <!-- Gemini Web -->
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.gemini.web.core</artifactId>
+            <version>${geminiweb.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.gemini.web.extender</artifactId>
+            <version>${geminiweb.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.gemini.web.tomcat</artifactId>
+            <version>${geminiweb.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.virgo.kernel.equinox.extensions</artifactId>
+            <version>${virgo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.virgo.util.common</artifactId>
+            <version>${virgo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.virgo.util.io</artifactId>
+            <version>${virgo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.virgo.util.math</artifactId>
+            <version>${virgo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.virgo.util.osgi</artifactId>
+            <version>${virgo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.virgo.util.osgi.manifest</artifactId>
+            <version>${virgo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geminiweb</groupId>
+            <artifactId>org.eclipse.virgo.util.parser.manifest</artifactId>
+            <version>${virgo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.dependencymanager</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.dependencymanager.shell</artifactId>
+            <version>3.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.spec.javax.transaction</groupId>
+            <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+            <version>1.0.1.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.fileinstall</artifactId>
+            <version>3.1.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>virgomirror</groupId>
+            <artifactId>org.eclipse.jdt.core.compiler.batch</artifactId>
+            <version>3.8.0.I20120518-2145</version>
+        </dependency>
+        <dependency>
+            <groupId>eclipselink</groupId>
+            <artifactId>javax.persistence</artifactId>
+            <version>2.0.4.v201112161009</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.activation</artifactId>
+            <version>1.1.0.v201211130549</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.annotation</artifactId>
+            <version>1.1.0.v201209060031</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.ejb</artifactId>
+            <version>3.1.1.v201204261316</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.el</artifactId>
+            <version>2.2.0.v201108011116</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.mail.glassfish</artifactId>
+            <version>1.4.1.v201108011116</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.xml.rpc</artifactId>
+            <version>1.1.0.v201005080400</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.catalina</artifactId>
+            <version>7.0.32.v201211201336</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.catalina.ha</artifactId>
+            <version>7.0.32.v201211201952</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.catalina.tribes</artifactId>
+            <version>7.0.32.v201211201952</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.coyote</artifactId>
+            <version>7.0.32.v201211201952</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.el</artifactId>
+            <version>7.0.32.v201211081135</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.jasper</artifactId>
+            <version>7.0.32.v201211201952</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.juli.extras</artifactId>
+            <version>7.0.32.v201211081135</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.tomcat.api</artifactId>
+            <version>7.0.32.v201211081135</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>org.apache.tomcat.util</artifactId>
+            <version>7.0.32.v201211201952</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.servlet.jsp.jstl</artifactId>
+            <version>1.2.0.v201105211821</version>
+        </dependency>
+        <dependency>
+            <groupId>orbit</groupId>
+            <artifactId>javax.servlet.jsp.jstl.impl</artifactId>
+            <version>1.2.0.v201210211230</version>
+        </dependency>
+        <!-- Add Pax Exam -->
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>${url.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ow2.asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <version>4.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.asm</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.aop</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.context</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.context.support</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.core</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.beans</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.expression</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.web</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.aopalliance</groupId>
+            <artifactId>com.springsource.org.aopalliance</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.web.servlet</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <!-- Spring security -->
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-config</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-web</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-taglibs</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>org.springframework.transaction</artifactId>
+            <version>${spring-security.version}</version>
+        </dependency>
+        <!-- Visual VM hook -->
+        <dependency>
+            <groupId>org.ow2.chameleon.management</groupId>
+            <artifactId>chameleon-mbeans</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+        <!-- Jersey for JAXRS -->
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-core</artifactId>
+            <version>${jersey.version}</version>
+        </dependency>
+        <!-- <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-servlet</artifactId> 
+            <version>${jersey.version}</version> </dependency> -->
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-server</artifactId>
+            <version>${jersey.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-client</artifactId>
+            <version>${jersey.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-json</artifactId>
+            <version>${jersey.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>eclipselink</groupId>
+            <artifactId>javax.resource</artifactId>
+            <version>1.5.0.v200906010428</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.thirdparty</groupId>
+            <artifactId>com.sun.jersey.jersey-servlet</artifactId>
+            <version>1.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.thirdparty</groupId>
+            <artifactId>org.apache.catalina.filters.CorsFilter</artifactId>
+            <version>7.0.42</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/opendaylight/md-sal/test/sal-rest-connector-it/src/test/java/org/opendaylight/controller/test/restconf/it/ServiceProviderController.java b/opendaylight/md-sal/test/sal-rest-connector-it/src/test/java/org/opendaylight/controller/test/restconf/it/ServiceProviderController.java
new file mode 100644 (file)
index 0000000..1087da2
--- /dev/null
@@ -0,0 +1,239 @@
+package org.opendaylight.controller.test.restconf.it;
+
+import static org.junit.Assert.*;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+
+import java.util.Collection;
+
+import javax.inject.Inject;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.controller.test.sal.binding.it.TestHelper;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.util.PathUtils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+import static org.opendaylight.controller.test.sal.binding.it.TestHelper.*;
+
+@RunWith(PaxExam.class)
+public class ServiceProviderController {
+
+    public static final String ODL = "org.opendaylight.controller";
+    public static final String YANG = "org.opendaylight.yangtools";
+    public static final String SAMPLE = "org.opendaylight.controller.samples";
+
+    @Test
+    public void properInitialized() throws Exception {
+
+        Thread.sleep(30*60*1000); // Waiting for services to get wired.
+        assertTrue(true);
+        // assertTrue(consumer.createToast(WhiteBread.class, 5));
+
+    }
+
+    // @Inject
+    // BindingAwareBroker broker;
+
+    // @Inject
+    // ToastConsumer consumer;
+
+    @Inject
+    BundleContext ctx;
+
+    @Configuration
+    public Option[] config() {
+        return options(
+                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), //
+                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
+                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
+                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
+
+                mdSalCoreBundles(),
+                baseModelBundles(),
+                flowCapableModelBundles(),
+
+                // mavenBundle(ODL,
+                // "sal-binding-broker-impl").versionAsInProject().update(), //
+                mavenBundle(ODL, "sal-common").versionAsInProject(), //
+                mavenBundle(ODL, "sal-common-api").versionAsInProject(),//
+                mavenBundle(ODL, "sal-common-impl").versionAsInProject(), //
+                mavenBundle(ODL, "sal-common-util").versionAsInProject(), //
+
+                mavenBundle(ODL, "sal-core-api").versionAsInProject().update(), //
+                mavenBundle(ODL, "sal-broker-impl").versionAsInProject(), //
+                mavenBundle(ODL, "sal-core-spi").versionAsInProject().update(), //
+
+                mavenBundle(ODL, "sal-connector-api").versionAsInProject(), //
+                // mavenBundle(SAMPLE,
+                // "zeromq-test-provider").versionAsInProject(), //
+                mavenBundle(ODL, "sal-rest-connector").versionAsInProject(), //
+
+                mavenBundle(YANG, "concepts").versionAsInProject(),
+                mavenBundle(YANG, "yang-binding").versionAsInProject(), //
+                mavenBundle(YANG, "yang-common").versionAsInProject(), //
+                mavenBundle(YANG, "yang-data-api").versionAsInProject(), //
+                mavenBundle(YANG, "yang-data-impl").versionAsInProject(), //
+                mavenBundle(YANG, "yang-model-api").versionAsInProject(), //
+                mavenBundle(YANG, "yang-model-util").versionAsInProject(), //
+                mavenBundle(YANG, "yang-parser-api").versionAsInProject(),
+                mavenBundle(YANG, "yang-parser-impl").versionAsInProject(),
+                mavenBundle(YANG + ".thirdparty", "xtend-lib-osgi").versionAsInProject(), //
+                mavenBundle(YANG + ".thirdparty", "antlr4-runtime-osgi-nohead").versionAsInProject(), //
+                mavenBundle("com.google.guava", "guava").versionAsInProject(), //
+
+                // systemProperty("logback.configurationFile").value(
+                // "file:" + PathUtils.getBaseDir() +
+                // "/src/test/resources/logback.xml"),
+                // To start OSGi console for inspection remotely
+                systemProperty("osgi.console").value("2401"),
+                systemProperty("org.eclipse.gemini.web.tomcat.config.path").value(
+                        PathUtils.getBaseDir() + "/src/test/resources/tomcat-server.xml"),
+
+                // setting default level. Jersey bundles will need to be started
+                // earlier.
+                systemProperty("osgi.bundles.defaultStartLevel").value("4"),
+
+                // Set the systemPackages (used by clustering)
+                systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
+                mavenBundle("org.slf4j", "jcl-over-slf4j").versionAsInProject(),
+                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
+                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.services").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(),
+                // List all the opendaylight modules
+                mavenBundle("org.opendaylight.controller", "configuration").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "usermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "logging.bridge").versionAsInProject(),
+                // mavenBundle("org.opendaylight.controller",
+                // "clustering.test").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "bundlescanner").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "bundlescanner.implementation").versionAsInProject(),
+
+                // Northbound bundles
+                mavenBundle("org.opendaylight.controller", "commons.northbound").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-mapper-asl").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-core-asl").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-jaxrs").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-xc").versionAsInProject(),
+                mavenBundle("org.codehaus.jettison", "jettison").versionAsInProject(),
+
+                mavenBundle("commons-io", "commons-io").versionAsInProject(),
+
+                // mavenBundle("commons-fileupload",
+                // "commons-fileupload").versionAsInProject(),
+
+                mavenBundle("equinoxSDK381", "javax.servlet").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "javax.servlet.jsp").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.cm").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.launcher").versionAsInProject(),
+
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.core").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.extender").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.tomcat").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.kernel.equinox.extensions").versionAsInProject().noStart(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.common").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.io").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.math").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi.manifest").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.parser.manifest").versionAsInProject(),
+
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager.shell").versionAsInProject(),
+
+                mavenBundle("com.google.code.gson", "gson").versionAsInProject(),
+                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.fileinstall").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("commons-codec", "commons-codec").versionAsInProject(),
+                mavenBundle("virgomirror", "org.eclipse.jdt.core.compiler.batch").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.persistence").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.resource").versionAsInProject(),
+
+                mavenBundle("orbit", "javax.activation").versionAsInProject(),
+                mavenBundle("orbit", "javax.annotation").versionAsInProject(),
+                mavenBundle("orbit", "javax.ejb").versionAsInProject(),
+                mavenBundle("orbit", "javax.el").versionAsInProject(),
+                mavenBundle("orbit", "javax.mail.glassfish").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.catalina").versionAsInProject(),
+                // these are bundle fragments that can't be started on its own
+                mavenBundle("orbit", "org.apache.catalina.ha").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.catalina.tribes").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.coyote").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.jasper").versionAsInProject().noStart(),
+
+                mavenBundle("orbit", "org.apache.el").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.juli.extras").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.api").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.util").versionAsInProject().noStart(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl").versionAsInProject(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl.impl").versionAsInProject(),
+
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-container-native").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-junit4").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-link-mvn").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.url", "pax-url-aether").versionAsInProject(),
+
+                mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
+
+                mavenBundle("org.springframework", "org.springframework.asm").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.aop").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context.support").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.core").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.beans").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.expression").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web").versionAsInProject(),
+
+                mavenBundle("org.aopalliance", "com.springsource.org.aopalliance").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web.servlet").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-config").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-core").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-web").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-taglibs").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.transaction").versionAsInProject(),
+
+                mavenBundle("org.ow2.chameleon.management", "chameleon-mbeans").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "com.sun.jersey.jersey-servlet")
+                        .versionAsInProject().startLevel(2),
+                mavenBundle("org.opendaylight.controller.thirdparty", "org.apache.catalina.filters.CorsFilter")
+                        .versionAsInProject().noStart(),
+
+                // Jersey needs to be started before the northbound application
+                // bundles, using a lower start level
+                mavenBundle("com.sun.jersey", "jersey-client").versionAsInProject(),
+                mavenBundle("com.sun.jersey", "jersey-server").versionAsInProject().startLevel(2),
+                mavenBundle("com.sun.jersey", "jersey-core").versionAsInProject().startLevel(2),
+                mavenBundle("com.sun.jersey", "jersey-json").versionAsInProject().startLevel(2),
+
+                junitBundles());
+    }
+
+}
diff --git a/opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/exam.properties b/opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/exam.properties
new file mode 100644 (file)
index 0000000..d5f9ae1
--- /dev/null
@@ -0,0 +1,4 @@
+#pax.exam.system = default
+pax.exam.logging = none
+pax.exam.service.timeout = 5000
+
diff --git a/opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/logback.xml b/opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/logback.xml
new file mode 100644 (file)
index 0000000..2d63ce5
--- /dev/null
@@ -0,0 +1,13 @@
+<configuration scan="true">
+
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+      </pattern>
+    </encoder>
+  </appender>
+
+  <root level="error">
+    <appender-ref ref="STDOUT" />
+  </root>
+</configuration>
diff --git a/opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/tomcat-server.xml b/opendaylight/md-sal/test/sal-rest-connector-it/src/test/resources/tomcat-server.xml
new file mode 100644 (file)
index 0000000..d6ef6ed
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    You under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
+    language governing permissions and limitations under the License. -->
+<Server>
+    <!--APR library loader. Documentation at /docs/apr.html -->
+    <Listener className="org.apache.catalina.core.AprLifecycleListener"
+        SSLEngine="on" />
+    <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+    <Listener className="org.apache.catalina.core.JasperListener" />
+    <!-- Prevent memory leaks due to use of particular java/javax APIs -->
+    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
+    <Listener
+        className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+    <Listener
+        className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
+
+    <Service name="Catalina">
+        <Connector port="8080" protocol="HTTP/1.1"
+            connectionTimeout="20000" redirectPort="8443" />
+
+        <!-- Please remove the comments around the following Connector tag 
+            to enable HTTPS Authentication support. Remember to add a valid keystore 
+            in the configuration folder. More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration -->
+
+        <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" 
+            maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" 
+            keystoreFile="configuration/keystore" keystorePass="changeit"/> -->
+
+        <Engine name="Catalina" defaultHost="localhost">
+            <Host name="localhost" appBase="" unpackWARs="false"
+                autoDeploy="false" deployOnStartup="false" createDirs="false">
+                <!-- Realm
+                    className="org.opendaylight.controller.security.ControllerCustomRealm" /> -->
+                <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+
+                <Valve className="org.apache.catalina.valves.AccessLogValve"
+                    directory="logs" prefix="web_access_log_" suffix=".txt"
+                    resolveHosts="false" rotatable="true"
+                    fileDateFormat="yyyy-MM"
+                    pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r" />
+
+            </Host>
+        </Engine>
+    </Service>
+</Server>