Resubmitted with source code synchronized. Added integration test for hosttracker... 64/264/3
authortaochang <taochang@cisco.com>
Mon, 29 Apr 2013 17:20:23 +0000 (10:20 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 30 Apr 2013 08:12:45 +0000 (08:12 +0000)
into api and implementation bundles.

Change-Id: I04d5d89562316cafa89a5ee46e08eb724733711a
Signed-off-by: taochang <taochang@cisco.com>
36 files changed:
opendaylight/arphandler/src/test/java/org/opendaylight/controller/arphandler/internal/ArphandlerTest.java
opendaylight/distribution/opendaylight/pom.xml
opendaylight/hosttracker/api/pom.xml [moved from opendaylight/hosttracker/pom.xml with 77% similarity]
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IfHostListener.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/IfHostListener.java with 100% similarity]
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IfIptoHost.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/IfIptoHost.java with 100% similarity]
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IfNewHostNotify.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/IfNewHostNotify.java with 100% similarity]
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java with 100% similarity]
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/IHostFinder.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/hostAware/IHostFinder.java with 94% similarity]
opendaylight/hosttracker/api/src/test/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnectorTest.java [moved from opendaylight/hosttracker/src/test/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnectorTest.java with 100% similarity]
opendaylight/hosttracker/implementation/pom.xml [new file with mode: 0644]
opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/Activator.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/internal/Activator.java with 98% similarity]
opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTracker.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java with 99% similarity]
opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java [moved from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTrackerCallable.java with 96% similarity]
opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/HostTrackerTest.java [moved from opendaylight/hosttracker/src/test/java/org/opendaylight/controller/hosttracker/HostTrackerTest.java with 93% similarity]
opendaylight/hosttracker/implementation/src/test/resources/logback.xml [new file with mode: 0644]
opendaylight/hosttracker/integrationtest/pom.xml [new file with mode: 0644]
opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIntegrationTest.java [new file with mode: 0644]
opendaylight/hosttracker/integrationtest/src/test/resources/logback.xml [new file with mode: 0644]
opendaylight/switchmanager/api/pom.xml [new file with mode: 0644]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/IInventoryListener.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/IInventoryListener.java with 100% similarity]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISpanAware.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/ISpanAware.java with 100% similarity]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java with 100% similarity, mode: 0644]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManagerAware.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManagerAware.java with 100% similarity]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SpanConfig.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/SpanConfig.java with 100% similarity]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java with 100% similarity]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SubnetConfig.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/SubnetConfig.java with 100% similarity]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Switch.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/Switch.java with 100% similarity, mode: 0644]
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java with 100% similarity]
opendaylight/switchmanager/api/src/test/java/org/openddaylight/controller/switchmanager/SubnetTest.java [moved from opendaylight/switchmanager/src/test/java/org/opendaylight/controller/switchmanager/SubnetTest.java with 100% similarity]
opendaylight/switchmanager/api/src/test/java/org/openddaylight/controller/switchmanager/SwitchTest.java [moved from opendaylight/switchmanager/src/test/java/org/opendaylight/controller/switchmanager/SwitchTest.java with 100% similarity]
opendaylight/switchmanager/implementation/pom.xml [new file with mode: 0644]
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/Activator.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/internal/Activator.java with 100% similarity]
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImpl.java [moved from opendaylight/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImpl.java with 100% similarity, mode: 0644]
opendaylight/switchmanager/implementation/src/test/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImplTest.java [moved from opendaylight/switchmanager/src/test/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImplTest.java with 100% similarity]
opendaylight/switchmanager/implementation/src/test/resources/logback.xml [new file with mode: 0644]
opendaylight/switchmanager/pom.xml [deleted file]

index b863d2b92383c7bd404773c76f5e15e7d4b444fc..e4e17cb2d64efa717f8348e8b2f94290609ab121 100644 (file)
@@ -15,11 +15,8 @@ import org.junit.Test;
 import junit.framework.TestCase;\r
 \r
 import org.opendaylight.controller.hosttracker.IfIptoHost;\r
-import org.opendaylight.controller.hosttracker.HostTracker;\r
 \r
 import org.opendaylight.controller.switchmanager.ISwitchManager;\r
-import org.opendaylight.controller.switchmanager.internal.SwitchManagerImpl;\r
-\r
 \r
 public class ArphandlerTest extends TestCase {\r
         \r
@@ -30,23 +27,6 @@ public class ArphandlerTest extends TestCase {
                ah = new ArpHandler();\r
                Assert.assertTrue(ah != null);\r
                        \r
-               HostTracker hostTracker = null;\r
-               hostTracker = new HostTracker();\r
-               ah.setHostTracker(hostTracker);\r
-               IfIptoHost ht= ah.getHostTracker();\r
-               Assert.assertTrue(ht.equals(hostTracker));\r
-               ah.unsetHostTracker(hostTracker);\r
-               ht= ah.getHostTracker();\r
-               Assert.assertTrue(ht == null);\r
-               \r
-               ah.setHostListener(hostTracker);\r
-               ah.unsetHostListener(hostTracker);\r
-               \r
-               ISwitchManager swManager = new SwitchManagerImpl();\r
-               ah.setSwitchManager(swManager);\r
-               ah.unsetSwitchManager(swManager);\r
-               \r
        }\r
 \r
-\r
 }\r
index f05c95bb8cabc7cf7cfe2e5dd60ae18cb7c6fb6b..cf481b7f4bf27a6b8102e04b713bb4854d701b00 100644 (file)
     <module>../../arphandler</module>
     <module>../../forwardingrulesmanager/api</module>
     <module>../../forwardingrulesmanager/implementation</module>
-    <module>../../hosttracker</module>
+    <module>../../hosttracker/api</module>
+    <module>../../hosttracker/implementation</module>
+    <module>../../hosttracker/integrationtest</module>
     <module>../../containermanager/api</module>
     <module>../../containermanager/implementation</module>
-    <module>../../switchmanager</module>
+    <module>../../switchmanager/api</module>
+    <module>../../switchmanager/implementation</module>
     <module>../../statisticsmanager/api</module>
     <module>../../statisticsmanager/implementation</module>
-     <module>../../statisticsmanager/integrationtest</module>
+    <module>../../statisticsmanager/integrationtest</module>
     <module>../../topologymanager</module>
     <module>../../usermanager</module>
     <module>../../security</module>
similarity index 77%
rename from opendaylight/hosttracker/pom.xml
rename to opendaylight/hosttracker/api/pom.xml
index b7628dde207a2e04179bc4810aadbc30ce98a60e..59290efbd52cdf7c27c0f19bb9610ab14793811f 100644 (file)
@@ -1,80 +1,72 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-       xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-       <modelVersion>4.0.0</modelVersion>
-       <parent>
-               <groupId>org.opendaylight.controller</groupId>
-               <artifactId>commons.opendaylight</artifactId>
-               <version>1.4.0-SNAPSHOT</version>
-               <relativePath>../commons/opendaylight</relativePath>
-       </parent>
-       <groupId>org.opendaylight.controller</groupId>
-       <artifactId>hosttracker</artifactId>
-       <version>0.4.0-SNAPSHOT</version>
-       <packaging>bundle</packaging>
-
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <version>2.3.6</version>
-                               <extensions>true</extensions>
-                               <configuration>
-                                       <instructions>
-                                               <Export-Package>
-                                                       org.opendaylight.controller.hosttracker,
-                                                       org.opendaylight.controller.hosttracker.hostAware
-                                               </Export-Package>
-                                               <Import-Package>
-                                                       org.opendaylight.controller.sal.core,
-                                                       org.opendaylight.controller.sal.utils,
-                                                       org.opendaylight.controller.hosttracker,
-                                                       org.opendaylight.controller.hosttracker.hostAware,
-                                                       org.opendaylight.controller.topologymanager,
-                                                       org.opendaylight.controller.sal.packet.address,
-                                                       org.opendaylight.controller.switchmanager,
-                                                       org.opendaylight.controller.clustering.services,
-                                                       javax.xml.bind.annotation,
-                                                       javax.xml.bind,
-                                                       org.apache.felix.dm,
-                                                       org.apache.commons.lang3.builder,
-                                                       org.osgi.service.component,
-                                                       org.slf4j,
-                                                       org.eclipse.osgi.framework.console,
-                                                       org.osgi.framework
-                                               </Import-Package>
-                                               <Bundle-Activator>
-                                                       org.opendaylight.controller.hosttracker.internal.Activator
-                                               </Bundle-Activator>
-                                               <Service-Component>
-                                               </Service-Component>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <dependency>
-                       <groupId>org.opendaylight.controller</groupId>
-                       <artifactId>topologymanager</artifactId>
-                       <version>0.4.0-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.opendaylight.controller</groupId>
-                       <artifactId>switchmanager</artifactId>
-                       <version>0.4.0-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.opendaylight.controller</groupId>
-                       <artifactId>clustering.services</artifactId>
-                       <version>0.4.0-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.opendaylight.controller</groupId>
-                       <artifactId>sal</artifactId>
-                       <version>0.4.0-SNAPSHOT</version>
-               </dependency>
-       </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+  <modelVersion>4.0.0</modelVersion>\r
+       <parent>\r
+               <groupId>org.opendaylight.controller</groupId>\r
+               <artifactId>commons.opendaylight</artifactId>\r
+               <version>1.4.0-SNAPSHOT</version>\r
+               <relativePath>../../commons/opendaylight</relativePath>\r
+       </parent>\r
+       <groupId>org.opendaylight.controller</groupId>\r
+       <artifactId>hosttracker</artifactId>\r
+       <version>0.4.0-SNAPSHOT</version>\r
+       <packaging>bundle</packaging>\r
+\r
+       <build>\r
+               <plugins>\r
+                       <plugin>\r
+                               <groupId>org.apache.felix</groupId>\r
+                               <artifactId>maven-bundle-plugin</artifactId>\r
+                               <version>2.3.6</version>\r
+                               <extensions>true</extensions>\r
+                               <configuration>\r
+                                       <instructions>\r
+                                               <Export-Package>\r
+                                                       org.opendaylight.controller.hosttracker,\r
+                                                       org.opendaylight.controller.hosttracker.hostAware\r
+                                               </Export-Package>\r
+                                               <Import-Package>\r
+                                                       org.opendaylight.controller.sal.core,\r
+                                                       org.opendaylight.controller.sal.utils,\r
+                                                       org.opendaylight.controller.topologymanager,\r
+                                                       org.opendaylight.controller.sal.packet.address,\r
+                                                       org.opendaylight.controller.switchmanager,\r
+                                                       org.opendaylight.controller.clustering.services,\r
+                                                       javax.xml.bind.annotation,\r
+                                                       javax.xml.bind,\r
+                                                       org.apache.felix.dm,\r
+                                                       org.apache.commons.lang3.builder,\r
+                                                       org.osgi.service.component,\r
+                                                       org.slf4j,\r
+                                                       org.eclipse.osgi.framework.console,\r
+                                                       org.osgi.framework\r
+                                               </Import-Package>\r
+                                       </instructions>\r
+                               </configuration>\r
+                       </plugin>\r
+               </plugins>\r
+       </build>\r
+       <dependencies>\r
+               <dependency>\r
+                       <groupId>org.opendaylight.controller</groupId>\r
+                       <artifactId>topologymanager</artifactId>\r
+                       <version>0.4.0-SNAPSHOT</version>\r
+               </dependency>\r
+               <dependency>\r
+                       <groupId>org.opendaylight.controller</groupId>\r
+                       <artifactId>switchmanager</artifactId>\r
+                       <version>0.4.0-SNAPSHOT</version>\r
+               </dependency>\r
+               <dependency>\r
+                       <groupId>org.opendaylight.controller</groupId>\r
+                       <artifactId>clustering.services</artifactId>\r
+                       <version>0.4.0-SNAPSHOT</version>\r
+               </dependency>\r
+               <dependency>\r
+                       <groupId>org.opendaylight.controller</groupId>\r
+                       <artifactId>sal</artifactId>\r
+                       <version>0.4.0-SNAPSHOT</version>\r
+               </dependency>\r
+       </dependencies>\r
+</project>\r
similarity index 94%
rename from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/hostAware/IHostFinder.java
rename to opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/IHostFinder.java
index f7151f705e3344298e7e83b06e46f721549f2e24..5ea7fb0e49d2a7b7d87718df43c4ee52162334b3 100644 (file)
@@ -10,6 +10,8 @@
 package org.opendaylight.controller.hosttracker.hostAware;
 
 import java.net.InetAddress;
+import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
+
 
 /**
  * This Interface  defines the methods to trigger the discovery of
diff --git a/opendaylight/hosttracker/implementation/pom.xml b/opendaylight/hosttracker/implementation/pom.xml
new file mode 100644 (file)
index 0000000..1f24e06
--- /dev/null
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+       xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.opendaylight.controller</groupId>
+               <artifactId>commons.opendaylight</artifactId>
+               <version>1.4.0-SNAPSHOT</version>
+               <relativePath>../../commons/opendaylight</relativePath>
+       </parent>
+       <groupId>org.opendaylight.controller</groupId>
+       <artifactId>hosttracker.implementation</artifactId>
+       <version>0.4.0-SNAPSHOT</version>
+       <packaging>bundle</packaging>
+
+       <properties>
+               <!-- Sonar properties using jacoco to retrieve integration test results -->
+               <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+               <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
+               <sonar.jacoco.Reportpath>target/jacobo.exec</sonar.jacoco.Reportpath>
+               <sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath>
+               <sonar.language>java</sonar.language>
+       </properties>
+       
+       <build>
+           <pluginManagement>
+                       <plugins>
+                               <plugin>
+                                       <groupId>org.jacoco</groupId>
+                                       <artifactId>jacoco-maven-plugin</artifactId>
+                                       <version>0.5.3.201107060350</version>
+                               </plugin>
+                       </plugins>
+               </pluginManagement>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.felix</groupId>
+                               <artifactId>maven-bundle-plugin</artifactId>
+                               <version>2.3.6</version>
+                               <extensions>true</extensions>
+                               <configuration>
+                                       <instructions>
+                                               <Export-Package>
+                                               </Export-Package>
+                                               <Import-Package>
+                                                       org.opendaylight.controller.sal.core,
+                                                       org.opendaylight.controller.sal.utils,
+                                                       org.opendaylight.controller.hosttracker,
+                                                       org.opendaylight.controller.topologymanager,
+                                                       org.opendaylight.controller.sal.packet.address,
+                                                       org.opendaylight.controller.switchmanager,
+                                                       org.opendaylight.controller.clustering.services,
+                                                       org.opendaylight.controller.hosttracker.hostAware,
+                                                       javax.xml.bind.annotation,
+                                                       javax.xml.bind,
+                                                       org.apache.felix.dm,
+                                                       org.apache.commons.lang3.builder,
+                                                       org.osgi.service.component,
+                                                       org.slf4j,
+                                                       org.eclipse.osgi.framework.console,
+                                                       org.osgi.framework
+                                               </Import-Package>
+                                               <Bundle-Activator>
+                                                       org.opendaylight.controller.hosttracker.internal.Activator
+                                               </Bundle-Activator>
+                                               <Service-Component>
+                                               </Service-Component>
+                                       </instructions>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.jacoco</groupId>
+                               <artifactId>jacoco-maven-plugin</artifactId>
+                           <configuration>
+                               <includes>org.opendaylight.controller.*</includes>
+                           </configuration>
+                           <executions>
+                               <execution>
+                                   <id>pre-test</id>
+                                   <goals>
+                                       <goal>prepare-agent</goal>
+                                   </goals>
+                               </execution>
+                               <execution>
+                                   <id>post-test</id>
+                                   <phase>test</phase>
+                                   <goals>
+                                       <goal>report</goal>
+                                   </goals>
+                               </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <dependency>
+                       <groupId>org.opendaylight.controller</groupId>
+                       <artifactId>topologymanager</artifactId>
+                       <version>0.4.0-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.opendaylight.controller</groupId>
+                       <artifactId>switchmanager</artifactId>
+                       <version>0.4.0-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.opendaylight.controller</groupId>
+                       <artifactId>clustering.services</artifactId>
+                       <version>0.4.0-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.opendaylight.controller</groupId>
+                       <artifactId>sal</artifactId>
+                       <version>0.4.0-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.opendaylight.controller</groupId>
+                       <artifactId>hosttracker</artifactId>
+                       <version>0.4.0-SNAPSHOT</version>
+               </dependency>
+       </dependencies>
+</project>
similarity index 98%
rename from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/internal/Activator.java
rename to opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/Activator.java
index 25fe1f24fb14b346dffa03c314361985f69d8293..ef88fa2e1660a2cf4f495c43f6a8c2fa8b0d86b7 100644 (file)
@@ -10,7 +10,7 @@
 package org.opendaylight.controller.hosttracker.internal;
 
 import org.apache.felix.dm.Component;
-import org.opendaylight.controller.hosttracker.HostTracker;
+import org.opendaylight.controller.hosttracker.internal.HostTracker;
 import org.opendaylight.controller.hosttracker.IfHostListener;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
 import org.opendaylight.controller.hosttracker.IfNewHostNotify;
similarity index 99%
rename from opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java
rename to opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTracker.java
index 45f3cedacbd8e5f6a0f10575820e479464965bcb..d0f8bb5736bce562619f3ab71a5a2596d7a81678 100644 (file)
@@ -7,7 +7,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.controller.hosttracker;
+package org.opendaylight.controller.hosttracker.internal;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -37,6 +37,9 @@ import org.opendaylight.controller.clustering.services.IClusterContainerServices
 import org.opendaylight.controller.clustering.services.IClusterServices;
 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
 import org.opendaylight.controller.hosttracker.hostAware.IHostFinder;
+import org.opendaylight.controller.hosttracker.IfHostListener;
+import org.opendaylight.controller.hosttracker.IfIptoHost;
+import org.opendaylight.controller.hosttracker.IfNewHostNotify;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Edge;
 import org.opendaylight.controller.sal.core.Host;
@@ -11,7 +11,7 @@
  * Provides a mechanism for applications to do an inline Host Discovery as opposed
  * to a delayed discovery
  */
-package org.opendaylight.controller.hosttracker;
+package org.opendaylight.controller.hosttracker.internal;
 
 /**
  * This Class provides methods to discover Host through a blocking call
diff --git a/opendaylight/hosttracker/implementation/src/test/resources/logback.xml b/opendaylight/hosttracker/implementation/src/test/resources/logback.xml
new file mode 100644 (file)
index 0000000..5fa21fe
--- /dev/null
@@ -0,0 +1,13 @@
+<configuration scan="true">\r
+\r
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
+    <encoder>\r
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\r
+      </pattern>\r
+    </encoder>\r
+  </appender>\r
+\r
+  <root level="error">\r
+    <appender-ref ref="STDOUT" />\r
+  </root>\r
+</configuration>\r
diff --git a/opendaylight/hosttracker/integrationtest/pom.xml b/opendaylight/hosttracker/integrationtest/pom.xml
new file mode 100644 (file)
index 0000000..ff08cf3
--- /dev/null
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"\r
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <modelVersion>4.0.0</modelVersion>\r
+  <parent>\r
+    <groupId>org.opendaylight.controller</groupId>\r
+    <artifactId>commons.opendaylight</artifactId>\r
+    <version>1.4.0-SNAPSHOT</version>\r
+    <relativePath>../../../opendaylight/commons/opendaylight</relativePath>\r
+  </parent>\r
+\r
+  <groupId>org.opendaylight.controller</groupId>\r
+  <artifactId>hosttracker.integrationtest</artifactId>\r
+  <version>0.4.0-SNAPSHOT</version>\r
+  \r
+  <dependencies>\r
+    <dependency>\r
+         <groupId>org.opendaylight.controller</groupId>\r
+         <artifactId>hosttracker</artifactId>\r
+         <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+    <dependency>\r
+         <groupId>org.opendaylight.controller</groupId>\r
+         <artifactId>hosttracker.implementation</artifactId>\r
+         <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+      <dependency>\r
+      <groupId>org.opendaylight.controller</groupId>\r
+      <artifactId>sal</artifactId>\r
+      <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+     <dependency>\r
+      <groupId>org.opendaylight.controller</groupId>\r
+      <artifactId>sal.implementation</artifactId>\r
+      <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+    <dependency>\r
+      <groupId>org.opendaylight.controller</groupId>\r
+      <artifactId>containermanager</artifactId>\r
+      <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
\r
+    <dependency>\r
+      <groupId>org.opendaylight.controller</groupId>\r
+      <artifactId>containermanager.implementation</artifactId>\r
+      <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+\r
+     <dependency>\r
+      <groupId>org.opendaylight.controller</groupId>\r
+      <artifactId>arphandler</artifactId>\r
+      <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+       <dependency>\r
+      <groupId>org.opendaylight.controller</groupId>\r
+      <artifactId>clustering.services</artifactId>\r
+      <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
\r
+       <dependency>\r
+      <groupId>org.opendaylight.controller</groupId>\r
+      <artifactId>clustering.services-implementation</artifactId>\r
+      <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+\r
+     <dependency>\r
+         <groupId>org.opendaylight.controller</groupId>\r
+         <artifactId>switchmanager</artifactId>\r
+         <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+     <dependency>\r
+         <groupId>org.opendaylight.controller</groupId>\r
+         <artifactId>switchmanager.implementation</artifactId>\r
+         <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+     <dependency>\r
+         <groupId>org.opendaylight.controller</groupId>\r
+         <artifactId>configuration</artifactId>\r
+         <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+\r
+    <dependency>\r
+         <groupId>org.opendaylight.controller</groupId>\r
+         <artifactId>configuration.implementation</artifactId>\r
+         <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+\r
+     <dependency>\r
+         <groupId>org.opendaylight.controller</groupId>\r
+         <artifactId>topologymanager</artifactId>\r
+         <version>0.4.0-SNAPSHOT</version>\r
+    </dependency>\r
+  </dependencies>\r
+  <properties>\r
+       <!-- Sonar jacoco plugin to get integration test coverage info -->\r
+    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>\r
+    <sonar.jacoco.reportPath>../implementation/target/jacoco.exec</sonar.jacoco.reportPath>\r
+    <sonar.jacoco.itReportPath>../implementaiton/target/jacoco-it.exec</sonar.jacoco.itReportPath>\r
+    <sonar.language>java</sonar.language>\r
+  </properties>\r
+  \r
+  <build>\r
+    <pluginManagement>\r
+      <plugins>\r
+        <plugin>\r
+          <groupId>org.jacoco</groupId>\r
+          <artifactId>jacoco-maven-plugin</artifactId>\r
+          <version>0.5.3.201107060350</version>\r
+        </plugin>\r
+      </plugins>\r
+    </pluginManagement>\r
+    <plugins>\r
+      <plugin>\r
+        <groupId>org.jacoco</groupId>\r
+        <artifactId>jacoco-maven-plugin</artifactId>\r
+        <version>0.5.3.201107060350</version>\r
+        <configuration>\r
+          <destFile>../implementation/target/jacoco-it.exec</destFile>\r
+          <includes>org.opendaylight.controller.*</includes>\r
+        </configuration>\r
+        <executions>\r
+          <execution>\r
+            <id>pre-test</id>\r
+            <goals>\r
+              <goal>prepare-agent</goal>\r
+            </goals>\r
+          </execution>\r
+          <execution>\r
+            <id>post-test</id>\r
+            <configuration>\r
+              <skip>true</skip>\r
+            </configuration>\r
+          </execution>\r
+        </executions>\r
+      </plugin>\r
+    </plugins>\r
+  </build>\r
+\r
+</project>\r
diff --git a/opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIntegrationTest.java b/opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIntegrationTest.java
new file mode 100644 (file)
index 0000000..f351d1a
--- /dev/null
@@ -0,0 +1,323 @@
+\r
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.controller.hosttracker.internal;\r
+\r
+\r
+import java.net.InetAddress;\r
+import java.net.UnknownHostException;\r
+import java.util.ArrayList;\r
+import java.util.HashSet;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.Set;\r
+import java.util.Map.Entry;\r
+\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+import org.osgi.framework.ServiceReference;\r
+import org.osgi.framework.Bundle;\r
+import javax.inject.Inject;\r
+\r
+import org.eclipse.osgi.framework.console.CommandProvider;\r
+import org.junit.Assert;\r
+import org.junit.Test;\r
+import org.junit.Before;\r
+import org.junit.After;\r
+import org.junit.runner.RunWith;\r
+import org.opendaylight.controller.sal.core.Node;\r
+import org.opendaylight.controller.sal.core.NodeConnector;\r
+import org.opendaylight.controller.sal.core.UpdateType;\r
+import org.opendaylight.controller.sal.utils.NodeConnectorCreator;\r
+import org.opendaylight.controller.sal.utils.NodeCreator;\r
+import org.opendaylight.controller.sal.utils.Status;\r
+//import org.opendaylight.controller.hosttracker.*;\r
+import org.opendaylight.controller.hosttracker.IfIptoHost;\r
+import org.opendaylight.controller.hosttracker.IfHostListener;\r
+import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;\r
+import org.opendaylight.controller.switchmanager.IInventoryListener;\r
+import org.opendaylight.controller.switchmanager.ISwitchManager;\r
+import org.opendaylight.controller.switchmanager.ISwitchManagerAware;\r
+import org.opendaylight.controller.topologymanager.ITopologyManagerAware;\r
+\r
+import org.ops4j.pax.exam.junit.PaxExam;\r
+import org.ops4j.pax.exam.util.Filter;\r
+import org.osgi.framework.BundleContext;\r
+import static org.junit.Assert.*;\r
+import org.ops4j.pax.exam.junit.Configuration;\r
+import static org.ops4j.pax.exam.CoreOptions.*;\r
+\r
+import org.ops4j.pax.exam.Option;\r
+import org.ops4j.pax.exam.util.PathUtils;\r
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;\r
+import org.ops4j.pax.exam.spi.reactors.PerClass;\r
+\r
+@RunWith(PaxExam.class)\r
+public class HostTrackerIntegrationTest {\r
+    private Logger log = LoggerFactory\r
+            .getLogger(HostTrackerIntegrationTest.class);\r
+    // get the OSGI bundle context\r
+    @Inject\r
+    private BundleContext bc;\r
+    \r
+    private IfIptoHost hosttracker = null;\r
+    private ISwitchManagerAware switchManagerAware = null;\r
+    private IInventoryListener invtoryListener = null;\r
+    private IfHostListener hostListener = null;\r
+    private ITopologyManagerAware topologyManagerAware = null;\r
+    \r
+    // Configure the OSGi container\r
+    @Configuration\r
+    public Option[] config() {\r
+        return options(\r
+                //\r
+                systemProperty("logback.configurationFile").value(\r
+                        "file:" + PathUtils.getBaseDir()\r
+                                + "/src/test/resources/logback.xml"),\r
+                // To start OSGi console for inspection remotely\r
+                systemProperty("osgi.console").value("2401"),\r
+                // Set the systemPackages (used by clustering)\r
+                systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),\r
+                // List framework bundles\r
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",\r
+                        "1.0.0.v20120522-1841"),\r
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",\r
+                        "1.0.400.v20120522-2049"),\r
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",\r
+                        "3.3.100.v20120522-1822"),\r
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",\r
+                        "1.4.0.v20120522-1841"),\r
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",\r
+                        "0.8.0.v201108120515"),\r
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",\r
+                        "0.8.0.v201108120515"),\r
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",\r
+                        "0.8.0.v201110170705"),\r
+                // List logger bundles\r
+                mavenBundle("org.slf4j", "slf4j-api", "1.7.2"),\r
+                mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.2"),\r
+                mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),\r
+                mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),\r
+                \r
+                // List all the bundles on which the test case depends\r
+                mavenBundle("org.opendaylight.controller", "sal",\r
+                        "0.4.0-SNAPSHOT"),\r
+                mavenBundle("org.opendaylight.controller", "sal.implementation",\r
+                        "0.4.0-SNAPSHOT"),\r
+\r
+               // needed by statisticsmanager\r
+               mavenBundle("org.opendaylight.controller", "containermanager",\r
+                        "0.4.0-SNAPSHOT"),\r
+               mavenBundle("org.opendaylight.controller", "containermanager.implementation",\r
+                       "0.4.0-SNAPSHOT"),\r
+               \r
+               mavenBundle("org.opendaylight.controller",\r
+                        "clustering.services", "0.4.0-SNAPSHOT"),\r
+               mavenBundle("org.opendaylight.controller",\r
+                        "clustering.services-implementation", "0.4.0-SNAPSHOT"),\r
+\r
+                // needed by forwardingrulesmanager\r
+                mavenBundle("org.opendaylight.controller", "switchmanager",\r
+                        "0.4.0-SNAPSHOT"),\r
+                mavenBundle("org.opendaylight.controller", "switchmanager.implementation",\r
+                        "0.4.0-SNAPSHOT"),\r
+                mavenBundle("org.opendaylight.controller", "configuration",\r
+                        "0.4.0-SNAPSHOT"),\r
+                mavenBundle("org.opendaylight.controller",\r
+                        "configuration.implementation", "0.4.0-SNAPSHOT"),\r
+                mavenBundle("org.opendaylight.controller", "hosttracker",\r
+                        "0.4.0-SNAPSHOT"),\r
+                mavenBundle("org.opendaylight.controller", "hosttracker.implementation",\r
+                        "0.4.0-SNAPSHOT"),\r
+\r
+                // needed by hosttracker\r
+                mavenBundle("org.opendaylight.controller", "topologymanager",\r
+                        "0.4.0-SNAPSHOT"),\r
+                mavenBundle("org.opendaylight.controller", "arphandler",\r
+                        "0.4.0-SNAPSHOT"),\r
+\r
+\r
+                mavenBundle("org.jboss.spec.javax.transaction",\r
+                        "jboss-transaction-api_1.1_spec", "1.0.1.Final"),\r
+                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),\r
+                mavenBundle("org.apache.felix",\r
+                        "org.apache.felix.dependencymanager", "3.1.0"),\r
+                junitBundles());\r
+    }\r
+\r
+    private String stateToString(int state) {\r
+        switch (state) {\r
+        case Bundle.ACTIVE:\r
+            return "ACTIVE";\r
+        case Bundle.INSTALLED:\r
+            return "INSTALLED";\r
+        case Bundle.RESOLVED:\r
+            return "RESOLVED";\r
+        case Bundle.UNINSTALLED:\r
+            return "UNINSTALLED";\r
+        default:\r
+            return "Not CONVERTED";\r
+        }\r
+    }\r
+\r
+    @Before\r
+    public void areWeReady() {\r
+        assertNotNull(bc);\r
+        boolean debugit = false;\r
+        Bundle b[] = bc.getBundles();\r
+        for (int i = 0; i < b.length; i++) {\r
+            int state = b[i].getState();\r
+            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {\r
+                log.debug("Bundle:" + b[i].getSymbolicName() + " state:"\r
+                        + stateToString(state));\r
+                debugit = true;\r
+            }\r
+        }\r
+        if (debugit) {\r
+            log.debug("Do some debugging because some bundle is "\r
+                    + "unresolved");\r
+        }\r
+\r
+        // Assert if true, if false we are good to go!\r
+        assertFalse(debugit);\r
+\r
+         // Now lets create a hosttracker for testing purpose\r
+         ServiceReference s = bc\r
+             .getServiceReference(IfIptoHost.class.getName());\r
+         if (s != null) {\r
+                 this.hosttracker = (IfIptoHost)bc.getService(s);\r
+                 this.switchManagerAware = (ISwitchManagerAware) this.hosttracker;\r
+                 this.invtoryListener = (IInventoryListener) this.hosttracker;\r
+                 this.hostListener = (IfHostListener) this.hosttracker;\r
+                 this.topologyManagerAware = (ITopologyManagerAware) this.hosttracker;\r
+         }\r
+\r
+         // If StatisticsManager is null, cannot run tests.\r
+         assertNotNull(this.hosttracker);\r
+    }\r
+    \r
+    \r
+    @Test\r
+    public void testStaticHost() throws UnknownHostException {\r
+        String ip;\r
+        \r
+        assertNotNull(this.hosttracker);\r
+        \r
+        // create one node and two node connectors\r
+        Node node1 = NodeCreator.createOFNode(1L);\r
+        NodeConnector nc1_1 = NodeConnectorCreator.createOFNodeConnector((short) 1, node1);\r
+        NodeConnector nc1_2 = NodeConnectorCreator.createOFNodeConnector((short) 2, node1);\r
+        \r
+        // test addStaticHost(), store into inactive host DB \r
+        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66",\r
+                nc1_1, "0");\r
+        Assert.assertTrue(st.isSuccess());\r
+        st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77",\r
+                nc1_2, "0");\r
+        Assert.assertTrue(st.isSuccess());\r
+        \r
+        // check inactive DB\r
+        Iterator<HostNodeConnector> hnci = this.hosttracker.getInactiveStaticHosts().iterator();\r
+        while (hnci.hasNext()) {\r
+            ip = hnci.next().getNetworkAddressAsString();\r
+            Assert.assertTrue(ip.equals("192.168.0.8") || ip.equals("192.168.0.13"));\r
+        }\r
+        \r
+        // check active host DB\r
+        hnci = this.hosttracker.getActiveStaticHosts().iterator();\r
+        Assert.assertFalse(hnci.hasNext());\r
+        \r
+        // test removeStaticHost()\r
+        st = this.hosttracker.removeStaticHost("192.168.0.8");\r
+        Assert.assertTrue(st.isSuccess());\r
+\r
+        hnci = this.hosttracker.getInactiveStaticHosts().iterator();\r
+        while (hnci.hasNext()) {\r
+            ip = hnci.next().getNetworkAddressAsString();\r
+            Assert.assertTrue(ip.equals("192.168.0.13"));\r
+        }\r
+    }               \r
+            \r
+\r
+    \r
+    @Test\r
+    public void testNotifyNodeConnector() throws UnknownHostException {\r
+        String ip;\r
+        \r
+        assertNotNull(this.invtoryListener);\r
+\r
+        // create one node and two node connectors\r
+        Node node1 = NodeCreator.createOFNode(1L);\r
+        NodeConnector nc1_1 = NodeConnectorCreator.createOFNodeConnector((short) 1, node1);\r
+        NodeConnector nc1_2 = NodeConnectorCreator.createOFNodeConnector((short) 2, node1);\r
+        \r
+        // test addStaticHost(), put into inactive host DB if not verifiable\r
+        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66",\r
+                nc1_1, "0");\r
+        st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77",\r
+                nc1_2, "0");\r
+        \r
+        this.invtoryListener.notifyNodeConnector(nc1_1,\r
+                UpdateType.ADDED, null);\r
+\r
+        // check all host list\r
+        Iterator<HostNodeConnector> hnci = this.hosttracker\r
+                .getAllHosts().iterator();\r
+        while (hnci.hasNext()) {\r
+            ip = hnci.next().getNetworkAddressAsString();\r
+            Assert.assertTrue(ip.equals("192.168.0.8"));\r
+        }\r
+        \r
+        // check active host DB\r
+        hnci = this.hosttracker.getActiveStaticHosts().iterator();\r
+        while (hnci.hasNext()) {\r
+            ip = hnci.next().getNetworkAddressAsString();\r
+            Assert.assertTrue(ip.equals("192.168.0.8"));\r
+        }\r
+        \r
+        // check inactive host DB\r
+        hnci = this.hosttracker.getInactiveStaticHosts().iterator();\r
+        while (hnci.hasNext()) {\r
+            ip = hnci.next().getNetworkAddressAsString();\r
+            Assert.assertTrue(ip.equals("192.168.0.13"));\r
+        }\r
+    }\r
+    \r
+    \r
+    \r
+    @Test\r
+    public void testHostFind() throws UnknownHostException {\r
+        \r
+        assertNotNull(this.invtoryListener);\r
+\r
+        // create one node and two node connectors\r
+        Node node1 = NodeCreator.createOFNode(1L);\r
+        NodeConnector nc1_1 = NodeConnectorCreator.createOFNodeConnector((short) 1, node1);\r
+        NodeConnector nc1_2 = NodeConnectorCreator.createOFNodeConnector((short) 2, node1);\r
+        \r
+        // test addStaticHost(), put into inactive host DB if not verifiable\r
+        Status st = this.hosttracker.addStaticHost(\r
+                "192.168.0.8", "11:22:33:44:55:66", nc1_1, "0");\r
+        st = this.hosttracker.addStaticHost(\r
+                "192.168.0.13", "11:22:33:44:55:77", nc1_2, "0");\r
+        \r
+        HostNodeConnector hnc_1 = this.hosttracker\r
+                .hostFind(InetAddress.getByName("192.168.0.8"));\r
+        assertNull(hnc_1);\r
+        \r
+        this.invtoryListener.notifyNodeConnector(nc1_1,\r
+                UpdateType.ADDED, null);\r
+\r
+        hnc_1 = this.hosttracker.hostFind(InetAddress.getByName("192.168.0.8"));\r
+        assertNotNull(hnc_1);\r
+        \r
+    }\r
+    \r
+}\r
diff --git a/opendaylight/hosttracker/integrationtest/src/test/resources/logback.xml b/opendaylight/hosttracker/integrationtest/src/test/resources/logback.xml
new file mode 100644 (file)
index 0000000..5fa21fe
--- /dev/null
@@ -0,0 +1,13 @@
+<configuration scan="true">\r
+\r
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
+    <encoder>\r
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\r
+      </pattern>\r
+    </encoder>\r
+  </appender>\r
+\r
+  <root level="error">\r
+    <appender-ref ref="STDOUT" />\r
+  </root>\r
+</configuration>\r
diff --git a/opendaylight/switchmanager/api/pom.xml b/opendaylight/switchmanager/api/pom.xml
new file mode 100644 (file)
index 0000000..d57a2d4
--- /dev/null
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.controller</groupId>
+  <artifactId>switchmanager</artifactId>
+  <version>0.4.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <properties>
+    <!-- Sonar properties using jacoco to retrieve integration test results -->
+    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
+    <sonar.jacoco.Reportpath>target/jacobo.exec</sonar.jacoco.Reportpath>
+    <sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath>
+    <sonar.language>java</sonar.language>
+  </properties>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.jacoco</groupId>
+          <artifactId>jacoco-maven-plugin</artifactId>
+          <version>0.5.3.201107060350</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+           <groupId>org.apache.felix</groupId>
+           <artifactId>maven-bundle-plugin</artifactId>
+           <version>2.3.6</version>
+           <extensions>true</extensions>
+           <configuration>
+             <instructions>
+               <Export-Package>
+                 org.opendaylight.controller.switchmanager
+               </Export-Package>
+               <Import-Package>
+                 org.opendaylight.controller.clustering.services,
+              org.opendaylight.controller.configuration,               
+                 org.opendaylight.controller.sal.core,
+              org.opendaylight.controller.sal.utils,
+              org.opendaylight.controller.sal.packet,
+              org.opendaylight.controller.sal.inventory,
+              org.slf4j,
+              org.apache.felix.dm,
+              org.eclipse.osgi.framework.console,
+              org.osgi.framework,
+              javax.xml.bind.annotation,
+              org.apache.commons.lang3.builder
+            </Import-Package>
+             </instructions>
+           </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <configuration>
+          <includes>org.opendaylight.controller.*</includes>
+        </configuration>
+        <executions>
+          <execution>
+            <id>pre-test</id>
+            <goals>
+              <goal>prepare-agent</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>post-test</id>
+            <phase>test</phase>
+            <goals>
+              <goal>report</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+       <dependency>
+         <groupId>org.opendaylight.controller</groupId>
+         <artifactId>clustering.services</artifactId>
+         <version>0.4.0-SNAPSHOT</version>
+       </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>configuration</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>      
+       <dependency>
+               <groupId>org.opendaylight.controller</groupId>
+               <artifactId>sal</artifactId>
+               <version>0.4.0-SNAPSHOT</version>
+       </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/switchmanager/implementation/pom.xml b/opendaylight/switchmanager/implementation/pom.xml
new file mode 100644 (file)
index 0000000..5e9eb5f
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.controller</groupId>
+  <artifactId>switchmanager.implementation</artifactId>
+  <version>0.4.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <properties>
+    <!-- Sonar properties using jacoco to retrieve integration test results -->
+    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
+    <sonar.jacoco.Reportpath>target/jacobo.exec</sonar.jacoco.Reportpath>
+    <sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath>
+    <sonar.language>java</sonar.language>
+  </properties>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.jacoco</groupId>
+          <artifactId>jacoco-maven-plugin</artifactId>
+          <version>0.5.3.201107060350</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+           <groupId>org.apache.felix</groupId>
+           <artifactId>maven-bundle-plugin</artifactId>
+           <version>2.3.6</version>
+           <extensions>true</extensions>
+           <configuration>
+             <instructions>
+               <Export-Package>
+               </Export-Package>
+               <Import-Package>
+                 org.opendaylight.controller.switchmanager,
+                 org.opendaylight.controller.clustering.services,
+              org.opendaylight.controller.configuration,               
+                 org.opendaylight.controller.sal.core,
+              org.opendaylight.controller.sal.utils,
+              org.opendaylight.controller.sal.packet,
+              org.opendaylight.controller.sal.inventory,
+              org.slf4j,
+              org.apache.felix.dm,
+              org.eclipse.osgi.framework.console,
+              org.osgi.framework,
+              javax.xml.bind.annotation,
+              org.apache.commons.lang3.builder
+            </Import-Package>
+            <Bundle-Activator>
+                 org.opendaylight.controller.switchmanager.internal.Activator
+            </Bundle-Activator>
+             </instructions>
+           </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <configuration>
+          <includes>org.opendaylight.controller.*</includes>
+        </configuration>
+        <executions>
+          <execution>
+            <id>pre-test</id>
+            <goals>
+              <goal>prepare-agent</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>post-test</id>
+            <phase>test</phase>
+            <goals>
+              <goal>report</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+       <dependency>
+         <groupId>org.opendaylight.controller</groupId>
+         <artifactId>clustering.services</artifactId>
+         <version>0.4.0-SNAPSHOT</version>
+       </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>configuration</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>      
+       <dependency>
+               <groupId>org.opendaylight.controller</groupId>
+               <artifactId>sal</artifactId>
+               <version>0.4.0-SNAPSHOT</version>
+       </dependency>
+       <dependency>
+               <groupId>org.opendaylight.controller</groupId>
+               <artifactId>switchmanager</artifactId>
+               <version>0.4.0-SNAPSHOT</version>
+       </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/switchmanager/implementation/src/test/resources/logback.xml b/opendaylight/switchmanager/implementation/src/test/resources/logback.xml
new file mode 100644 (file)
index 0000000..5fa21fe
--- /dev/null
@@ -0,0 +1,13 @@
+<configuration scan="true">\r
+\r
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
+    <encoder>\r
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\r
+      </pattern>\r
+    </encoder>\r
+  </appender>\r
+\r
+  <root level="error">\r
+    <appender-ref ref="STDOUT" />\r
+  </root>\r
+</configuration>\r
diff --git a/opendaylight/switchmanager/pom.xml b/opendaylight/switchmanager/pom.xml
deleted file mode 100755 (executable)
index 1d6f2e1..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.opendaylight</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../commons/opendaylight</relativePath>
-  </parent>
-
-  <groupId>org.opendaylight.controller</groupId>
-  <artifactId>switchmanager</artifactId>
-  <version>0.4.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-
-  <build>
-    <plugins>
-      <plugin>
-       <groupId>org.apache.felix</groupId>
-       <artifactId>maven-bundle-plugin</artifactId>
-       <version>2.3.6</version>
-       <extensions>true</extensions>
-       <configuration>
-         <instructions>
-           <Export-Package>
-               org.opendaylight.controller.switchmanager
-           </Export-Package>
-           <Import-Package>
-               org.opendaylight.controller.clustering.services,
-            org.opendaylight.controller.configuration,         
-               org.opendaylight.controller.sal.core,
-            org.opendaylight.controller.sal.utils,
-            org.opendaylight.controller.sal.packet,
-            org.opendaylight.controller.sal.inventory,
-            org.slf4j,
-            org.apache.felix.dm,
-            org.eclipse.osgi.framework.console,
-            org.osgi.framework,
-            javax.xml.bind.annotation,
-            org.apache.commons.lang3.builder
-        </Import-Package>
-        <Bundle-Activator>
-               org.opendaylight.controller.switchmanager.internal.Activator
-        </Bundle-Activator>
-         </instructions>
-       </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-       <dependency>
-         <groupId>org.opendaylight.controller</groupId>
-         <artifactId>clustering.services</artifactId>
-         <version>0.4.0-SNAPSHOT</version>
-       </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>configuration</artifactId>
-      <version>0.4.0-SNAPSHOT</version>
-    </dependency>      
-       <dependency>
-               <groupId>org.opendaylight.controller</groupId>
-               <artifactId>sal</artifactId>
-               <version>0.4.0-SNAPSHOT</version>
-       </dependency>
-  </dependencies>
-</project>