Merge "Add IfNewHostNotify to DeviceManager"
authorGiovanni Meo <gmeo@cisco.com>
Sat, 15 Jun 2013 09:14:15 +0000 (09:14 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 15 Jun 2013 09:14:15 +0000 (09:14 +0000)
147 files changed:
opendaylight/clustering/integrationtest/pom.xml
opendaylight/clustering/services_implementation/src/main/resources/config/infinispan-config.xml
opendaylight/commons/integrationtest/pom.xml
opendaylight/commons/opendaylight/logback.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/commons/opendaylight/sun_coding_style.xml
opendaylight/commons/parent/logback.xml
opendaylight/configuration/integrationtest/.gitignore [new file with mode: 0644]
opendaylight/configuration/integrationtest/pom.xml [new file with mode: 0644]
opendaylight/configuration/integrationtest/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationIT.java [new file with mode: 0644]
opendaylight/configuration/integrationtest/src/test/resources/logback.xml [new file with mode: 0644]
opendaylight/containermanager/implementation/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/distribution/opendaylight/src/assemble/bin.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-server.xml
opendaylight/distribution/opendaylight/src/main/resources/run.bat
opendaylight/distribution/p2site/pom.xml
opendaylight/distribution/parents/README [new file with mode: 0644]
opendaylight/distribution/parents/pom.xml [new file with mode: 0644]
opendaylight/distribution/sdk/pom.xml
opendaylight/distribution/sdk/src/assemble/bin.xml
opendaylight/forwarding/staticrouting/pom.xml
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java
opendaylight/northbound/commons/pom.xml
opendaylight/northbound/flowprogrammer/enunciate.xml
opendaylight/northbound/flowprogrammer/pom.xml
opendaylight/northbound/flowprogrammer/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/hosttracker/enunciate.xml
opendaylight/northbound/hosttracker/pom.xml
opendaylight/northbound/hosttracker/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/integrationtest/pom.xml
opendaylight/northbound/integrationtest/src/test/java/org/opendaylight/controller/northbound/integrationtest/NorthboundIT.java
opendaylight/northbound/integrationtest/src/test/resources/tomcat-server.xml
opendaylight/northbound/staticrouting/enunciate.xml
opendaylight/northbound/staticrouting/pom.xml
opendaylight/northbound/staticrouting/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/statistics/enunciate.xml
opendaylight/northbound/statistics/pom.xml
opendaylight/northbound/statistics/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/subnets/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/switchmanager/enunciate.xml
opendaylight/northbound/switchmanager/src/main/resources/WEB-INF/web.xml
opendaylight/northbound/topology/enunciate.xml
opendaylight/northbound/topology/src/main/resources/WEB-INF/web.xml
opendaylight/northboundtest/unit_test_suite/pom.xml
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/PriorityMessage.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6FlowMod.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6Match.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsRequest.java
opendaylight/protocol_plugins/stub/pom.xml
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/MacAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/address/DataLinkAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/address/EthernetAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/topology/TopoEdgeUpdate.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/BindingGeneratorImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/TypeProviderImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenEnumResolvingTest.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenTypesSubSetTest.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesTest.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/Types.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/GeneratedTOBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/ClassCodeGenerator.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/Constants.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/GeneratorUtil.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/java/org/opendaylight/controller/sal/java/api/generator/test/ClassCodeGeneratorTest.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/abstract-topology@2013-02-08.yang
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedTransferIdentityObject.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/WildcardType.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/GeneratedTOBuilder.java
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/AdditionalConfig/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/Correct/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest1/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest2/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/Generator/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/MissingYangInDep/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoGenerators/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoOutputDir/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoYangFiles/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/UnknownGenerator/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/YangRootNotExist/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/pom.xml
opendaylight/sal/yang-prototype/code-generator/maven-yang/pom.xml
opendaylight/sal/yang-prototype/code-generator/pom.xml
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/pom.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/sample.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-api/pom.xml
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/pom.xml
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/DataNodeContainerBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/UsesNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/AugmentationSchemaBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/LeafSchemaNodeBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ModuleBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/RpcDefinitionBuilder.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UsesNodeBuilderImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserListenerImpl.java
opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ParserUtils.java
opendaylight/sal/yang-prototype/yang/pom.xml
opendaylight/sal/yang-prototype/yang/yang-binding/pom.xml
opendaylight/sal/yang-prototype/yang/yang-binding/src/main/java/org/opendaylight/controller/yang/binding/BaseIdentity.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-common/pom.xml
opendaylight/sal/yang-prototype/yang/yang-data-api/pom.xml
opendaylight/sal/yang-prototype/yang/yang-data-util/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-api/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-util/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/DataNodeIterator.java
opendaylight/samples/northbound/loadbalancer/enunciate.xml
opendaylight/samples/northbound/loadbalancer/src/main/resources/WEB-INF/web.xml
opendaylight/statisticsmanager/api/pom.xml
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Switch.java
opendaylight/switchmanager/integrationtest/pom.xml
opendaylight/topologymanager/src/test/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImplTest.java
opendaylight/usermanager/api/pom.xml [moved from opendaylight/usermanager/pom.xml with 95% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/AuthResponse.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/AuthResponse.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/AuthorizationConfig.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/AuthorizationConfig.java with 89% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/IAAAProvider.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/IAAAProvider.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/ISessionManager.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/ISessionManager.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/IUserManager.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/IUserManager.java with 97% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/ODLUserLevel.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/ODLUserLevel.java with 100% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/ServerConfig.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/ServerConfig.java with 97% similarity]
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserConfig.java with 99% similarity]
opendaylight/usermanager/api/src/test/java/org/opendaylight/controller/usermanager/AuthResponseTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/AuthResponseTest.java with 100% similarity]
opendaylight/usermanager/api/src/test/java/org/opendaylight/controller/usermanager/AuthorizationUserConfigTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/AuthorizationUserConfigTest.java with 96% similarity]
opendaylight/usermanager/api/src/test/java/org/opendaylight/controller/usermanager/ServerConfigTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/ServerConfigTest.java with 85% similarity]
opendaylight/usermanager/implementation/pom.xml [new file with mode: 0644]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/Activator.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/Activator.java with 100% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUser.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUser.java with 100% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManagerImpl.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserManagerImpl.java with 99% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/security/SessionManager.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/security/SessionManager.java with 100% similarity]
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/security/UserSecurityContextRepository.java [moved from opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/security/UserSecurityContextRepository.java with 100% similarity]
opendaylight/usermanager/implementation/src/test/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUserTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUserTest.java with 100% similarity]
opendaylight/usermanager/implementation/src/test/java/org/opendaylight/controller/usermanager/internal/UserManagerImplTest.java [moved from opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/UserManagerImplTest.java with 97% similarity]
opendaylight/web/devices/src/main/resources/WEB-INF/Devices-servlet.xml
opendaylight/web/devices/src/main/resources/WEB-INF/web.xml
opendaylight/web/flows/src/main/resources/WEB-INF/Flows-servlet.xml
opendaylight/web/flows/src/main/resources/WEB-INF/web.xml
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java
opendaylight/web/root/src/main/resources/WEB-INF/RootGUI-servlet.xml
opendaylight/web/root/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/root/src/main/resources/WEB-INF/web.xml
opendaylight/web/topology/src/main/resources/WEB-INF/Topology-servlet.xml
opendaylight/web/topology/src/main/resources/WEB-INF/web.xml
opendaylight/web/troubleshoot/src/main/resources/WEB-INF/Troubleshoot-servlet.xml
opendaylight/web/troubleshoot/src/main/resources/WEB-INF/web.xml

index 460b09e..52c5682 100644 (file)
@@ -32,7 +32,7 @@
       <artifactId>sal.implementation</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
-       <dependency>
+    <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>clustering.services-implementation</artifactId>
       <version>0.4.0-SNAPSHOT</version>
index 03a9b4d..2aa3fdb 100644 (file)
@@ -19,7 +19,7 @@
     <!--
         Used to register JMX statistics in any available MBean server
     -->
-    <jmxStatistics enabled="true"/>    
+    <jmxStatistics enabled="true"/>
   </default>
   <!-- transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" -->
   <namedCache name="transactional-type">
index 1f4b442..4cd8582 100644 (file)
       <version>0.8.0.v201110170705</version>
     </dependency>
   </dependencies>
-  
+
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+        <configuration>
+          <skipTests>true</skipTests>
+        </configuration>
+      </plugin>
       <plugin>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>maven-paxexam-plugin</artifactId>
index 043ceef..05e6075 100644 (file)
@@ -1,11 +1,11 @@
 <configuration scan="true">
-  
+
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
       <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
     </encoder>
   </appender>
-  
+
   <root level="error">
     <appender-ref ref="STDOUT" />
   </root>
index 4062e18..c3c9a5c 100644 (file)
@@ -24,7 +24,8 @@
     <projectinfo>2.6</projectinfo>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <compiler.version>2.3.2</compiler.version>
-    <surefire.version>2.13</surefire.version>
+    <surefire.version>2.15</surefire.version>
+    <failsafe.version>2.15</failsafe.version>
     <exam.version>3.0.0</exam.version>
     <url.version>1.5.0</url.version>
     <enunciate.version>1.26.2</enunciate.version>
           <configLocation>${project.parent.basedir}/space_and_tabs_checks.xml</configLocation>
           <consoleOutput>true</consoleOutput>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
+          <sourceDirectory>${project.basedir}</sourceDirectory>
+          <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>
-        <version>2.14.1</version>
+        <version>${failsafe.version}</version>
         <executions>
           <execution>
             <goals>
               <goal>integration-test</goal>
-              <goal>verify</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
index f4516b9..cb2c2c8 100644 (file)
@@ -74,7 +74,7 @@
 <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
 <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
index 043ceef..05e6075 100644 (file)
@@ -1,11 +1,11 @@
 <configuration scan="true">
-  
+
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
       <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
     </encoder>
   </appender>
-  
+
   <root level="error">
     <appender-ref ref="STDOUT" />
   </root>
diff --git a/opendaylight/configuration/integrationtest/.gitignore b/opendaylight/configuration/integrationtest/.gitignore
new file mode 100644 (file)
index 0000000..f92f363
--- /dev/null
@@ -0,0 +1 @@
+configuration
diff --git a/opendaylight/configuration/integrationtest/pom.xml b/opendaylight/configuration/integrationtest/pom.xml
new file mode 100644 (file)
index 0000000..037b435
--- /dev/null
@@ -0,0 +1,91 @@
+<?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.integrationtest</artifactId>
+    <version>0.5.0-SNAPSHOT</version>
+    <relativePath>../../commons/integrationtest</relativePath>
+  </parent>
+  <artifactId>configuration.integrationtest</artifactId>
+  <version>0.4.0-SNAPSHOT</version>
+   <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>protocol_plugins.stub</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal</artifactId>
+      <version>0.5.0-SNAPSHOT</version>
+    </dependency>
+     <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.implementation</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>forwardingrulesmanager</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>clustering.services-implementation</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.stub</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager.implementation</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>switchmanager.implementation</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>configuration.implementation</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+      <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>topologymanager</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/configuration/integrationtest/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationIT.java b/opendaylight/configuration/integrationtest/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationIT.java
new file mode 100644 (file)
index 0000000..8e1f34e
--- /dev/null
@@ -0,0 +1,212 @@
+package org.opendaylight.controller.configuration.internal;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+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 java.io.File;
+
+import javax.inject.Inject;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.IConfigurationService;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.util.PathUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(PaxExam.class)
+public class ConfigurationIT {
+    private Logger logger = LoggerFactory
+            .getLogger(ConfigurationIT.class);
+    // get the OSGI bundle context
+    @Inject
+    private BundleContext bc;
+    private IClusterServices clusterService = null;
+    private IConfigurationService configService = null;
+
+    // Configure the OSGi container
+    @Configuration
+    public Option[] config() {
+        return options(
+                systemProperty("logback.configurationFile").value(
+                        "file:" + PathUtils.getBaseDir()
+                                + "/src/test/resources/logback.xml"),
+                // To start OSGi console for inspection remotely
+                systemProperty("osgi.console").value("2401"),
+                // Set the systemPackages (used by clustering)
+                systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
+                // List framework bundles
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",
+                        "1.0.0.v20120522-1841"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",
+                        "1.0.400.v20120522-2049"),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",
+                        "3.3.100.v20120522-1822"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",
+                        "1.4.0.v20120522-1841"),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",
+                        "0.8.0.v201108120515"),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",
+                        "0.8.0.v201108120515"),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",
+                        "0.8.0.v201110170705"),
+                // List logger bundles
+                mavenBundle("org.slf4j", "slf4j-api", "1.7.2"),
+                mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.2"),
+                mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),
+                mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),
+                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
+                mavenBundle("org.jboss.spec.javax.transaction",
+                        "jboss-transaction-api_1.1_spec", "1.0.1.Final"),
+                mavenBundle("org.apache.felix",
+                        "org.apache.felix.dependencymanager", "3.1.0"),
+                // List all the bundles on which the test case depends
+                mavenBundle("org.opendaylight.controller", "sal",
+                        "0.5.0-SNAPSHOT"), // SAL connects the protocols
+                                           // plug-ins to other stuff
+                mavenBundle("org.opendaylight.controller",
+                        "sal.implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "protocol_plugins.stub", "0.4.0-SNAPSHOT"),
+                // needed bundles by switchmanager
+                mavenBundle("org.opendaylight.controller", "containermanager",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "containermanager.implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "switchmanager",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "switchmanager.implementation", "0.4.0-SNAPSHOT"),
+                // needed bundles by configuration
+                mavenBundle("org.opendaylight.controller",
+                        "clustering.services", "0.4.0-SNAPSHOT"), // what are
+                                                                  // the
+                                                                  // clustering
+                                                                  // services
+                                                                  // for
+                mavenBundle("org.opendaylight.controller", "clustering.stub",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "clustering.services-implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "configuration",
+                        "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "configuration.implementation", "0.4.0-SNAPSHOT"),
+                junitBundles());
+    }
+
+    private String stateToString(int state) {
+        switch (state) {
+        case Bundle.ACTIVE:
+            return "ACTIVE";
+        case Bundle.INSTALLED:
+            return "INSTALLED";
+        case Bundle.RESOLVED:
+            return "RESOLVED";
+        case Bundle.UNINSTALLED:
+            return "UNINSTALLED";
+        default:
+            return "Not CONVERTED";
+        }
+    }
+
+    @Before
+    public void areWeReadyForClustering() {
+        assertNotNull(bc);
+        boolean debugit = false;
+        Bundle b[] = bc.getBundles();
+        for (int i = 0; i < b.length; i++) {
+            int state = b[i].getState();
+            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
+                logger.debug("Bundle:" + b[i].getSymbolicName() + " state:"
+                        + stateToString(state));
+                debugit = true;
+            }
+        }
+        if (debugit) {
+            logger.debug("Do some debugging because some bundle is unresolved");
+        }
+
+        // Assert if true, if false we are good to go!
+        assertFalse(debugit);
+        ServiceReference r = bc.getServiceReference(IClusterServices.class
+                .getName());
+        if (r != null) {
+            this.clusterService = (IClusterServices) bc.getService(r);
+        }
+        // If StatisticsManager is null, cannot run tests.
+        assertNotNull(this.clusterService);
+
+    }
+
+    @Before
+    public void areWeReadyForConfiguration() {
+        assertNotNull(bc);
+        boolean debugit = false;
+        Bundle b[] = bc.getBundles();
+        for (int i = 0; i < b.length; i++) {
+            int state = b[i].getState();
+            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
+                logger.debug("Bundle:" + b[i].getSymbolicName() + " state:"
+                        + stateToString(state));
+                debugit = true;
+            }
+        }
+        if (debugit) {
+            logger.debug("Do some debugging because some bundle is unresolved");
+        }
+
+        // Assert if true, if false we are good to go!
+        assertFalse(debugit);
+        ServiceReference r = bc.getServiceReference(IConfigurationService.class
+                .getName());
+        if (r != null) {
+            this.configService = (IConfigurationService) bc.getService(r);
+        }
+        // If StatisticsManager is null, cannot run tests.
+        assertNotNull(this.configService);
+
+    }
+
+    @Test
+    public void saveConfiguration() {
+        File f = new File(GlobalConstants.STARTUPHOME.toString());
+        boolean success = f.exists();
+        if (!success) {
+            success = f.mkdirs();
+        }
+        if(success){
+            Status status = new Status(StatusCode.SUCCESS, null);
+            if (this.configService != null) {
+                status = this.configService.saveConfigurations();
+            }
+            if (status.getCode().equals(StatusCode.SUCCESS)) {
+                Assert.assertTrue("Successfully saved config for "
+                        + configService.getClass().getSimpleName(), status
+                        .getCode().equals(StatusCode.SUCCESS));
+            } else {
+                Assert.assertFalse("Failed to save config for "
+                        + configService.getClass().getSimpleName(), status
+                        .getCode().equals(StatusCode.INTERNALERROR));
+            }
+        }
+    }
+
+}
diff --git a/opendaylight/configuration/integrationtest/src/test/resources/logback.xml b/opendaylight/configuration/integrationtest/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>
index 42ff338..a324fca 100644 (file)
       <artifactId>containermanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
-       <dependency>
+    <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
       <version>0.5.0-SNAPSHOT</version>
-       </dependency> 
+    </dependency>
   </dependencies>
 </project>
index 765dea5..50b34fa 100644 (file)
@@ -38,6 +38,7 @@
     <module>../../clustering/test</module>
     <module>../../configuration/api</module>
     <module>../../configuration/implementation</module>
+    <module>../../configuration/integrationtest</module>
     <module>../../routing/dijkstra_implementation</module>
     <module>../../arphandler</module>
     <module>../../forwardingrulesmanager/api</module>
@@ -57,7 +58,8 @@
     <module>../../statisticsmanager/implementation</module>
     <module>../../statisticsmanager/integrationtest</module>
     <module>../../topologymanager</module>
-    <module>../../usermanager</module>
+    <module>../../usermanager/api</module>
+    <module>../../usermanager/implementation</module>
     <module>../../security</module>
 
 
     <module>../../samples/northbound/loadbalancer</module>
     <module>../../commons/concepts</module>
     <module>../../commons/integrationtest</module>
-    
+
   </modules>
 
   <build>
index 8be21f6..67a4735 100644 (file)
@@ -1,6 +1,6 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
   <id>osgipackage</id>
   <formats>
     <format>dir</format>
@@ -12,9 +12,9 @@
       <excludes>
         <exclude>org.opendaylight.controller.thirdparty:org.openflow.openflowj</exclude>
         <exclude>org.opendaylight.controller:clustering.stub</exclude>
-               <exclude>org.opendaylight.controller:logging.bridge</exclude>
-               <exclude>org.opendaylight.controller:protocol_plugins.stub</exclude>
-               <exclude>org.opendaylight.controller:*.integrationtest</exclude>
+        <exclude>org.opendaylight.controller:logging.bridge</exclude>
+        <exclude>org.opendaylight.controller:protocol_plugins.stub</exclude>
+        <exclude>org.opendaylight.controller:*.integrationtest</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new.implementation</exclude>
       </excludes>
         <includeDependencies>false</includeDependencies>
       </binaries>
     </moduleSet>
-       <moduleSet>
-         <includes>
-               <include>org.opendaylight.controller:logging.bridge</include>
-         </includes>
-         <binaries>
-               <outputDirectory>opendaylight/lib</outputDirectory>
-               <outputFileNameMapping>
-                 ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
-               </outputFileNameMapping>
-               <unpack>false</unpack>
-               <includeDependencies>false</includeDependencies>
-         </binaries>
-       </moduleSet>
+    <moduleSet>
+      <includes>
+        <include>org.opendaylight.controller:logging.bridge</include>
+      </includes>
+      <binaries>
+        <outputDirectory>opendaylight/lib</outputDirectory>
+        <outputFileNameMapping>
+          ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
+        </outputFileNameMapping>
+        <unpack>false</unpack>
+        <includeDependencies>false</includeDependencies>
+      </binaries>
+    </moduleSet>
   </moduleSets>
   <dependencySets>
     <dependencySet>
         <exclude>virgomirror:org.eclipse.jdt.core.compiler.batch</exclude>
         <exclude>org.apache.felix:org.apache.felix.fileinstall</exclude>
         <exclude>geminiweb:org.eclipse.virgo.kernel.equinox.extensions</exclude>
-               <exclude>org.slf4j:slf4j-api</exclude>
-               <exclude>ch.qos.logback:logback-core</exclude>
-               <exclude>ch.qos.logback:logback-classic</exclude>
-               <exclude>com.sun.jersey:jersey-core</exclude>
-               <exclude>com.sun.jersey:jersey-json</exclude>
-               <exclude>com.sun.jersey:jersey-server</exclude>
+        <exclude>org.slf4j:slf4j-api</exclude>
+        <exclude>ch.qos.logback:logback-core</exclude>
+        <exclude>ch.qos.logback:logback-classic</exclude>
+        <exclude>com.sun.jersey:jersey-core</exclude>
+        <exclude>com.sun.jersey:jersey-json</exclude>
+        <exclude>com.sun.jersey:jersey-server</exclude>
       </excludes>
       <outputFileNameMapping>
-        ${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}      
+        ${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
       </outputFileNameMapping>
       <unpack>false</unpack>
       <scope>runtime</scope>
         <include>virgomirror:org.eclipse.jdt.core.compiler.batch</include>
         <include>org.apache.felix:org.apache.felix.fileinstall</include>
         <include>geminiweb:org.eclipse.virgo.kernel.equinox.extensions</include>
-               <include>org.slf4j:slf4j-api</include>
-               <include>ch.qos.logback:logback-core</include>
-               <include>ch.qos.logback:logback-classic</include>
-               <include>com.sun.jersey:jersey-core</include>
-               <include>com.sun.jersey:jersey-json</include>
-               <include>com.sun.jersey:jersey-server</include>
+        <include>org.slf4j:slf4j-api</include>
+        <include>ch.qos.logback:logback-core</include>
+        <include>ch.qos.logback:logback-classic</include>
+        <include>com.sun.jersey:jersey-core</include>
+        <include>com.sun.jersey:jersey-json</include>
+        <include>com.sun.jersey:jersey-server</include>
       </includes>
       <useTransitiveDependencies>false</useTransitiveDependencies>
       <outputFileNameMapping>
-        ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}      
+        ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
       </outputFileNameMapping>
       <unpack>false</unpack>
       <scope>runtime</scope>
index a8d7beb..460145e 100644 (file)
@@ -1,13 +1,13 @@
 osgi.bundles=\
-       reference\:file\:../lib/org.apache.felix.fileinstall-3.1.6.jar@1:start,\
-       reference\:file\:../lib/org.eclipse.jdt.core.compiler.batch-3.8.0.I20120518-2145.jar@1:start,\
-       reference\:file\:../lib/org.eclipse.equinox.ds-1.4.0.v20120522-1841.jar@2:start,\
-       reference\:file\:../lib/org.eclipse.equinox.util-1.0.400.v20120522-2049.jar@2:start,\
-       reference\:file\:../lib/org.eclipse.osgi.services-3.3.100.v20120522-1822@2:start,\
-       reference\:file\:../lib/org.eclipse.equinox.console-1.0.0.v20120522-1841.jar@start,\
-       reference\:file\:../lib/slf4j-api-1.7.2.jar@1:start,\
-       reference\:file\:../lib/logback-classic-1.0.9.jar@1:start,\
-       reference\:file\:../lib/logback-core-1.0.9.jar@1:start,\
+    reference\:file\:../lib/org.apache.felix.fileinstall-3.1.6.jar@1:start,\
+    reference\:file\:../lib/org.eclipse.jdt.core.compiler.batch-3.8.0.I20120518-2145.jar@1:start,\
+    reference\:file\:../lib/org.eclipse.equinox.ds-1.4.0.v20120522-1841.jar@2:start,\
+    reference\:file\:../lib/org.eclipse.equinox.util-1.0.400.v20120522-2049.jar@2:start,\
+    reference\:file\:../lib/org.eclipse.osgi.services-3.3.100.v20120522-1822@2:start,\
+    reference\:file\:../lib/org.eclipse.equinox.console-1.0.0.v20120522-1841.jar@start,\
+    reference\:file\:../lib/slf4j-api-1.7.2.jar@1:start,\
+    reference\:file\:../lib/logback-classic-1.0.9.jar@1:start,\
+    reference\:file\:../lib/logback-core-1.0.9.jar@1:start,\
     reference\:file\:../lib/logging.bridge-0.4.0-SNAPSHOT@1:start,\
     reference\:file\:../lib/jersey-core-1.17.jar@2:start,\
     reference\:file\:../lib/jersey-json-1.17.jar@2:start,\
@@ -19,7 +19,7 @@ osgi.bundles.defaultStartLevel=4
 org.osgi.framework.system.packages.extra=sun.reflect,sun.reflect.misc,sun.misc
 # This is not Eclipse App
 eclipse.ignoreApp=true
-# Don't shutdown equinox if the eclipse App has ended, 
+# Don't shutdown equinox if the eclipse App has ended,
 # which is our case because we are not running any eclipse application
 osgi.noShutdown=true
 # Clean any cached data on restart of the framework
@@ -33,7 +33,7 @@ felix.fileinstall.dir=./plugins
 felix.fileinstall.noInitialDelay=true
 # Auto start the bundles at level 4
 felix.fileinstall.start.level=4
-# Avoid to auto-install following bundles, that means those need 
+# Avoid to auto-install following bundles, that means those need
 # to be started manually or in other way like osgi.bundles
 felix.fileinstall.filter=^(?!org.apache.felix.fileinstall).*
 
@@ -69,7 +69,7 @@ org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml
 
 # TLS configuration
 # To enable TLS, set secureChannelEnabled=true and specify the location of controller Java KeyStore and TrustStore files.
-# The Java KeyStore contains controller's private key and certificate. The Java TrustStore contains the trusted certificate 
+# The Java KeyStore contains controller's private key and certificate. The Java TrustStore contains the trusted certificate
 # entries, including switches' Certification Authority (CA) certificates. For example,
 # secureChannelEnabled=true
 # controllerKeyStore=./configuration/ctlKeyStore
index a99d17d..de70a52 100644 (file)
@@ -54,5 +54,5 @@
   <logger name="org.opendaylight.controller.topologymanager" level="INFO"/>
   <logger name="org.opendaylight.controller.usermanager" level="INFO"/>
   <!-- Web modules -->
-  <logger name="org.opendaylight.controller.web" level="INFO"/>        
+  <logger name="org.opendaylight.controller.web" level="INFO"/>
 </configuration>
index 4be0754..56d469b 100644 (file)
                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 
+<!--
+        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"
             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.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"/>
-               
+                        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>
index 79a00f3..6fb9f06 100644 (file)
@@ -2,7 +2,7 @@
 SETLOCAL
 SETLOCAL ENABLEDELAYEDEXPANSION
 IF EXIST "%JAVA_HOME%" (
-               set basedir=%~dp0
+        set basedir=%~dp0
 REM       Now set the classpath:
                 set cp="!basedir!lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar;!basedir!lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar;!basedir!lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"
 
@@ -19,4 +19,4 @@ REM echo %JAVA_HOME%\bin\java.exe %* -Djava.io.tmpdir=!basedir!work\tmp -Dosgi.i
     ECHO JAVA_HOME environment variable is not set
     PAUSE
 )
-ENDLOCAL
\ No newline at end of file
+ENDLOCAL
index 2efb674..e7c7f49 100644 (file)
@@ -29,7 +29,7 @@
   <artifactId>distribution.p2site</artifactId>
   <version>0.1.0-SNAPSHOT</version>
   <packaging>pom</packaging>
-  
+
   <build>
     <plugins>
       <plugin>
diff --git a/opendaylight/distribution/parents/README b/opendaylight/distribution/parents/README
new file mode 100644 (file)
index 0000000..3d6e356
--- /dev/null
@@ -0,0 +1,14 @@
+OVERVIEW
+========
+This distribution is built to allow to deploy all the commons parents
+in one shot. This is needed because the way how maven works when a
+"mvn deploy" is called on a multi-module project, only the modules
+that are listed in there are deployed. All the opendaylight modules
+has a parent, those parents module will not be deployed when deploying
+a distribution hence if someone tries to compile a module without
+compiling the whole system it will run in missing parent errors.
+To address the issue this distribution will collect all the known
+parents and deploy them in one shot.
+
+The user of this distribution is one of the Jenkins jobs and not
+developers.
diff --git a/opendaylight/distribution/parents/pom.xml b/opendaylight/distribution/parents/pom.xml
new file mode 100644 (file)
index 0000000..5387717
--- /dev/null
@@ -0,0 +1,24 @@
+<?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>
+  <prerequisites>
+    <maven>3.0</maven>
+  </prerequisites>
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+  <artifactId>distribution.parents</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>../../commons/concepts</module>
+    <module>../../commons/integrationtest</module>
+    <module>../../commons/opendaylight</module>
+    <module>../../../third-party/commons/thirdparty</module>
+  </modules>
+</project>
index b4afa61..07ba376 100644 (file)
@@ -38,7 +38,7 @@
     <!-- Northbound common hooks -->
     <module>../../northbound/commons</module>
   </modules>
-  
+
   <build>
     <plugins>
       <plugin>
index bb3c673..b2f45c3 100644 (file)
@@ -1,4 +1,4 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
   <id>package</id>
index 80eea57..ea22c4f 100644 (file)
@@ -70,7 +70,7 @@
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration</artifactId>
       <version>0.4.0-SNAPSHOT</version>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
index 5d9a5e1..8345b5a 100644 (file)
@@ -18,7 +18,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Host;
 import org.opendaylight.controller.sal.core.Node;
@@ -172,15 +171,10 @@ public class HostNodeConnector extends Host {
         return !Arrays.equals(emptyArray, macaddr);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see java.lang.Object#toString()
-     */
     @Override
     public String toString() {
-        return "HostNodeConnector[" + ReflectionToStringBuilder.toString(this)
-                + "]";
+        return "HostNodeConnector [nodeConnector=" + nodeConnector + ", vlan="
+                + vlan + ", staticHost=" + staticHost + "]";
     }
 
     public boolean isV4Host() {
index 7c0835a..56da363 100644 (file)
@@ -33,7 +33,7 @@
               org.opendaylight.controller.sal.authorization,
               org.opendaylight.controller.containermanager,
               org.opendaylight.controller.usermanager,
-              javax.servlet.http, 
+              javax.servlet.http,
               org.slf4j
             </Import-Package>
           </instructions>
index a49d9f8..90bf6de 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/flow"/>
   </services>
index 0a873ca..c7e9a77 100644 (file)
@@ -24,7 +24,7 @@
             <version>0.5.0-SNAPSHOT</version>
           </dependency>
         </dependencies>
-      </plugin>    
+      </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
@@ -43,7 +43,7 @@
               org.opendaylight.controller.northbound.commons.utils,
               org.opendaylight.controller.sal.authorization,
               org.opendaylight.controller.usermanager,
-                         com.sun.jersey.spi.container.servlet,                            
+                          com.sun.jersey.spi.container.servlet,
               javax.ws.rs,
               javax.ws.rs.core,
               javax.xml.bind.annotation,
@@ -70,7 +70,7 @@
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
       <version>${enunciate.version}</version>
     </dependency>
     <dependency>
-         <groupId>org.opendaylight.controller</groupId>
-         <artifactId>commons.northbound</artifactId>
-         <version>0.4.0-SNAPSHOT</version>
-       </dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>commons.northbound</artifactId>
+          <version>0.4.0-SNAPSHOT</version>
+        </dependency>
     <dependency>
       <groupId>org.opendaylight.controller.thirdparty</groupId>
       <artifactId>com.sun.jersey.jersey-servlet</artifactId>
index 83f7e4b..4cedf2d 100644 (file)
@@ -1,51 +1,51 @@
 <?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>JAXRSFlowProgrammer</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.flowprogrammer.northbound.FlowProgrammerNorthboundRSApplication</param-value>
-         </init-param>
-         <load-on-startup>1</load-on-startup>
-       </servlet>
-       
-       <servlet-mapping>
-         <servlet-name>JAXRSFlowProgrammer</servlet-name>
-         <url-pattern>/*</url-pattern>
-       </servlet-mapping>
+        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>JAXRSFlowProgrammer</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.flowprogrammer.northbound.FlowProgrammerNorthboundRSApplication</param-value>
+          </init-param>
+          <load-on-startup>1</load-on-startup>
+        </servlet>
+
+        <servlet-mapping>
+          <servlet-name>JAXRSFlowProgrammer</servlet-name>
+          <url-pattern>/*</url-pattern>
+        </servlet-mapping>
+
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
-    
     <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
-       
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
+
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index 8f0d7e6..e0c7dcd 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/host"/>
   </services>
index 853c54e..f0caa52 100644 (file)
@@ -24,7 +24,7 @@
             <version>0.5.0-SNAPSHOT</version>
           </dependency>
         </dependencies>
-      </plugin>    
+      </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
index 7eb9408..0fa8b95 100644 (file)
@@ -1,7 +1,7 @@
 <?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">
+        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>JAXRSHostTracker</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index aa4469e..90acc8c 100644 (file)
       <artifactId>jersey-core</artifactId>
       <version>${jersey.version}</version>
     </dependency>
-    <!-- <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-servlet</artifactId> 
+    <!-- <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-servlet</artifactId>
       <version>${jersey.version}</version> </dependency> -->
     <dependency>
       <groupId>com.sun.jersey</groupId>
 
   </dependencies>
 </project>
-
index 1127259..103a515 100644 (file)
@@ -41,11 +41,9 @@ import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
 import org.opendaylight.controller.usermanager.IUserManager;
 
-
 @RunWith(PaxExam.class)
 public class NorthboundIT {
-    private Logger log = LoggerFactory
-            .getLogger(NorthboundIT.class);
+    private Logger log = LoggerFactory.getLogger(NorthboundIT.class);
     // get the OSGI bundle context
     @Inject
     private BundleContext bc;
@@ -257,7 +255,157 @@ public class NorthboundIT {
     }
 
     @Test
-    public void testSwitchManager() {
+    public void testSubnetsNorthbound() throws JSONException {
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/subnet/";
+
+        String name1 = "testSubnet1";
+        String subnet1 = "1.1.1.1/24";
+        String name2 = "testSubnet2";
+        String subnet2 = "2.2.2.2/24";
+
+        // Test GET subnets in default container
+        String result = getJsonResult(baseURL + "default");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        Assert.assertEquals("{}", result);
+
+        // Test GET subnet1 expecting 404
+        result = getJsonResult(baseURL + "default/" + name1);
+        Assert.assertEquals(404, httpResponseCode.intValue());
+
+        // Test POST subnet1
+        String queryParameter = new QueryParameter("subnetName", name1).add(
+                "subnet", subnet1).getString();
+        result = getJsonResult(baseURL + "default/" + name1 + queryParameter,
+                "POST");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test GET subnet1
+        result = getJsonResult(baseURL + "default/" + name1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertEquals(200, httpResponseCode.intValue());
+        Assert.assertEquals(name1, json.getString("@name"));
+        Assert.assertEquals(subnet1, json.getString("@subnet"));
+
+        // Test POST subnet2
+        queryParameter = new QueryParameter("subnetName", name2).add("subnet",
+                subnet2).getString();
+        result = getJsonResult(baseURL + "default/" + name2 + queryParameter,
+                "POST");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test GET all subnets in default container
+        result = getJsonResult(baseURL + "default");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONArray subnetConfigArray = json.getJSONArray("subnetConfig");
+        JSONObject subnetConfig;
+        Assert.assertEquals(2, subnetConfigArray.length());
+        for (int i = 0; i < subnetConfigArray.length(); i++) {
+            subnetConfig = subnetConfigArray.getJSONObject(i);
+            if (subnetConfig.getString("@name").equals(name1)) {
+                Assert.assertEquals(subnet1, subnetConfig.getString("@subnet"));
+            } else if (subnetConfig.getString("@name").equals(name2)) {
+                Assert.assertEquals(subnet2, subnetConfig.getString("@subnet"));
+            } else {
+                // Unexpected config name
+                Assert.assertTrue(false);
+            }
+        }
+
+        // Test DELETE subnet1
+        result = getJsonResult(baseURL + "default/" + name1, "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        // Test GET deleted subnet1
+        result = getJsonResult(baseURL + "default/" + name1);
+        Assert.assertEquals(404, httpResponseCode.intValue());
+
+    }
+
+    @Test
+    public void testStaticRoutingNorthbound() throws JSONException {
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/staticroute/";
+
+        String name1 = "testRoute1";
+        String prefix1 = "192.168.1.1/24";
+        String nextHop1 = "0.0.0.0";
+        String name2 = "testRoute2";
+        String prefix2 = "192.168.1.1/16";
+        String nextHop2 = "1.1.1.1";
+
+        // Test GET static routes in default container, expecting no results
+        String result = getJsonResult(baseURL + "default");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        Assert.assertEquals("{}", result);
+
+        // Test insert static route
+        String requestBody = "{\"name\":\"" + name1 + "\", \"prefix\":\""
+                + prefix1 + "\", \"nextHop\":\"" + nextHop1 + "\"}";
+        result = getJsonResult(baseURL + "default/" + name1, "POST",
+                requestBody);
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        requestBody = "{\"name\":\"" + name2 + "\", \"prefix\":\"" + prefix2
+                + "\", \"nextHop\":\"" + nextHop2 + "\"}";
+        result = getJsonResult(baseURL + "default/" + name2, "POST",
+                requestBody);
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test Get all static routes
+        result = getJsonResult(baseURL + "default");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONArray staticRoutes = json.getJSONArray("staticRoute");
+        Assert.assertEquals(2, staticRoutes.length());
+        JSONObject route;
+        for (int i = 0; i < staticRoutes.length(); i++) {
+            route = staticRoutes.getJSONObject(i);
+            if (route.getString("name").equals(name1)) {
+                Assert.assertEquals(prefix1, route.getString("prefix"));
+                Assert.assertEquals(nextHop1, route.getString("nextHop"));
+            } else if (route.getString("name").equals(name2)) {
+                Assert.assertEquals(prefix2, route.getString("prefix"));
+                Assert.assertEquals(nextHop2, route.getString("nextHop"));
+            } else {
+                // static route has unknown name
+                Assert.assertTrue(false);
+            }
+        }
+
+        // Test get specific static route
+        result = getJsonResult(baseURL + "default/" + name1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertEquals(name1, json.getString("name"));
+        Assert.assertEquals(prefix1, json.getString("prefix"));
+        Assert.assertEquals(nextHop1, json.getString("nextHop"));
+
+        result = getJsonResult(baseURL + "default/" + name2);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertEquals(name2, json.getString("name"));
+        Assert.assertEquals(prefix2, json.getString("prefix"));
+        Assert.assertEquals(nextHop2, json.getString("nextHop"));
+
+        // Test delete static route
+        result = getJsonResult(baseURL + "default/" + name1, "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        result = getJsonResult(baseURL + "default");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONObject singleStaticRoute = json.getJSONObject("staticRoute");
+        Assert.assertEquals(name2, singleStaticRoute.getString("name"));
+
+    }
+
+    @Test
+    public void testSwitchManager() throws JSONException {
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/switch/default/";
 
         // define Node/NodeConnector attributes for test
@@ -280,203 +428,166 @@ public class NorthboundIT {
         int ncBandwidth = 1000000000;
 
         // Test GET all nodes
-        try {
-            String result = getJsonResult(baseURL + "nodes");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-
-            // Test for first node
-            JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_1, nodeType, timestamp_1,
-                    timestampName_1, actionsValue_1, capabilitiesValue_1,
-                    tablesValue_1, buffersValue_1);
-
-            // Test 2nd node, properties of 2nd node same as first node
-            node = getJsonInstance(json, "nodeProperties", nodeId_2);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
-                    timestampName_1, actionsValue_1, capabilitiesValue_1,
-                    tablesValue_1, buffersValue_1);
-
-            // Test 3rd node, properties of 3rd node same as first node
-            node = getJsonInstance(json, "nodeProperties", nodeId_3);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_3, nodeType, timestamp_1,
-                    timestampName_1, actionsValue_1, capabilitiesValue_1,
-                    tablesValue_1, buffersValue_1);
 
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        String result = getJsonResult(baseURL + "nodes");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+
+        // Test for first node
+        JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_1, nodeType, timestamp_1,
+                timestampName_1, actionsValue_1, capabilitiesValue_1,
+                tablesValue_1, buffersValue_1);
+
+        // Test 2nd node, properties of 2nd node same as first node
+        node = getJsonInstance(json, "nodeProperties", nodeId_2);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
+                timestampName_1, actionsValue_1, capabilitiesValue_1,
+                tablesValue_1, buffersValue_1);
+
+        // Test 3rd node, properties of 3rd node same as first node
+        node = getJsonInstance(json, "nodeProperties", nodeId_3);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_3, nodeType, timestamp_1,
+                timestampName_1, actionsValue_1, capabilitiesValue_1,
+                tablesValue_1, buffersValue_1);
 
         // Test GET nodeConnectors of a node
-        try {
-            //Test first node
-            String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_1, ncType, nodeId_1, nodeType, ncState,
-                    ncCapabilities, ncBandwidth);
-
-            //Test second node
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
-                    ncCapabilities, ncBandwidth);
-
-            //Test third node
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_3);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-
-            nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_3, ncType, nodeId_3, nodeType, ncState,
-                    ncCapabilities, ncBandwidth);
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        // Test first node
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONObject nodeConnectorProperties = json
+                .getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1,
+                ncType, nodeId_1, nodeType, ncState, ncCapabilities,
+                ncBandwidth);
+
+        // Test second node
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_2,
+                ncType, nodeId_2, nodeType, ncState, ncCapabilities,
+                ncBandwidth);
+
+        // Test third node
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_3);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_3,
+                ncType, nodeId_3, nodeType, ncState, ncCapabilities,
+                ncBandwidth);
 
         // Test delete node property
-        try {
-            // Delete timestamp property from node1
-            String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
-                    + "/property/timeStamp", "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            // Check node1
-            result = getJsonResult(baseURL + "nodes");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_1, nodeType, null, null,
-                    actionsValue_1, capabilitiesValue_1, tablesValue_1,
-                    buffersValue_1);
-
-            // Delete actions property from node2
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_2
-                    + "/property/actions", "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            // Check node2
-            result = getJsonResult(baseURL + "nodes");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            node = getJsonInstance(json, "nodeProperties", nodeId_2);
-            Assert.assertNotNull(node);
-            testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
-                    timestampName_1, null, capabilitiesValue_1, tablesValue_1,
-                    buffersValue_1);
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        // Delete timestamp property from node1
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
+                + "/property/timeStamp", "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        // Check node1
+        result = getJsonResult(baseURL + "nodes");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = getJsonInstance(json, "nodeProperties", nodeId_1);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_1, nodeType, null, null,
+                actionsValue_1, capabilitiesValue_1, tablesValue_1,
+                buffersValue_1);
+
+        // Delete actions property from node2
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_2
+                + "/property/actions", "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        // Check node2
+        result = getJsonResult(baseURL + "nodes");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = getJsonInstance(json, "nodeProperties", nodeId_2);
+        Assert.assertNotNull(node);
+        testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
+                timestampName_1, null, capabilitiesValue_1, tablesValue_1,
+                buffersValue_1);
 
         // Test add property to node
-        try {
-            // Add Tier and Bandwidth property to node1
-            String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
-                    + "/property/tier/1001", "PUT");
-            Assert.assertEquals(201, httpResponseCode.intValue());
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
-                    + "/property/bandwidth/1002", "PUT");
-            Assert.assertEquals(201, httpResponseCode.intValue());
-
-            // Test for first node
-            result = getJsonResult(baseURL + "nodes");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
-            Assert.assertNotNull(node);
-            Assert.assertEquals(1001, node.getJSONObject("properties")
-                    .getJSONObject("tier").getInt("tierValue"));
-            Assert.assertEquals(1002, node.getJSONObject("properties")
-                    .getJSONObject("bandwidth").getInt("bandwidthValue"));
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        // Add Tier and Bandwidth property to node1
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
+                + "/property/tier/1001", "PUT");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
+                + "/property/bandwidth/1002", "PUT");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        // Test for first node
+        result = getJsonResult(baseURL + "nodes");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = getJsonInstance(json, "nodeProperties", nodeId_1);
+        Assert.assertNotNull(node);
+        Assert.assertEquals(1001, node.getJSONObject("properties")
+                .getJSONObject("tier").getInt("tierValue"));
+        Assert.assertEquals(1002, node.getJSONObject("properties")
+                .getJSONObject("bandwidth").getInt("bandwidthValue"));
 
         // Test delete nodeConnector property
-        try {
-            // Delete state property of nodeconnector1
-            String result = getJsonResult(baseURL + "nodeconnector/STUB/"
-                    + nodeId_1 + "/STUB/" + nodeConnectorId_1
-                    + "/property/state", "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_1, ncType, nodeId_1, nodeType, null,
-                    ncCapabilities, ncBandwidth);
-
-            // Delete capabilities property of nodeconnector2
-            result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_2
-                    + "/STUB/" + nodeConnectorId_2 + "/property/capabilities",
-                    "DELETE");
-            Assert.assertEquals(200, httpResponseCode.intValue());
-
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
-                    null, ncBandwidth);
+        // Delete state property of nodeconnector1
+        result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_1
+                + "/STUB/" + nodeConnectorId_1 + "/property/state", "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
 
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1,
+                ncType, nodeId_1, nodeType, null, ncCapabilities, ncBandwidth);
+
+        // Delete capabilities property of nodeconnector2
+        result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_2
+                + "/STUB/" + nodeConnectorId_2 + "/property/capabilities",
+                "DELETE");
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_2,
+                ncType, nodeId_2, nodeType, ncState, null, ncBandwidth);
 
         // Test PUT nodeConnector property
-        try {
-            int newBandwidth = 1001;
-
-            // Add Name/Bandwidth property to nodeConnector1
-            String result = getJsonResult(baseURL + "nodeconnector/STUB/"
-                    + nodeId_1 + "/STUB/" + nodeConnectorId_1
-                    + "/property/bandwidth/" + newBandwidth, "PUT");
-            Assert.assertEquals(201, httpResponseCode.intValue());
-
-            result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject nodeConnectorProperties = json
-                    .getJSONObject("nodeConnectorProperties");
-
-            // Check for new bandwidth value, state value removed from previous
-            // test
-            testNodeConnectorProperties(nodeConnectorProperties,
-                    nodeConnectorId_1, ncType, nodeId_1, nodeType, null,
-                    ncCapabilities, newBandwidth);
+        int newBandwidth = 1001;
+
+        // Add Name/Bandwidth property to nodeConnector1
+        result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_1
+                + "/STUB/" + nodeConnectorId_1 + "/property/bandwidth/"
+                + newBandwidth, "PUT");
+        Assert.assertEquals(201, httpResponseCode.intValue());
+
+        result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        // Check for new bandwidth value, state value removed from previous
+        // test
+        testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1,
+                ncType, nodeId_1, nodeType, null, ncCapabilities, newBandwidth);
 
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
     }
 
     @Test
-    public void testStatistics() {
+    public void testStatistics() throws JSONException {
         String actionTypes[] = { "drop", "loopback", "flood", "floodAll",
                 "controller", "swPath", "hwPath", "output", "setDlSrc",
                 "setDlDst", "setDlType", "setVlanId", "setVlanPcp",
@@ -485,262 +596,247 @@ public class NorthboundIT {
         System.out.println("Starting Statistics JAXB client.");
 
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/statistics/default/";
-        try {
-            String result = getJsonResult(baseURL + "flowstats");
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            JSONObject flowStatistics = getJsonInstance(json, "flowStatistics",
-                    0xCAFE);
-            JSONObject node = flowStatistics.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node.getString("@type").equals("STUB"));
-
-            // test that flow statistics results are correct
-            JSONArray flowStats = flowStatistics.getJSONArray("flowStat");
-            for (int i = 0; i < flowStats.length(); i++) {
-
-                JSONObject flowStat = flowStats.getJSONObject(i);
-                testFlowStat(flowStat, actionTypes[i]);
 
-            }
+        String result = getJsonResult(baseURL + "flowstats");
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        JSONObject flowStatistics = getJsonInstance(json, "flowStatistics",
+                0xCAFE);
+        JSONObject node = flowStatistics.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node.getString("@type").equals("STUB"));
 
-            // for /controller/nb/v2/statistics/default/portstats
-            result = getJsonResult(baseURL + "portstats");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            JSONObject portStatistics = getJsonInstance(json, "portStatistics",
-                    0xCAFE);
-            JSONObject node2 = portStatistics.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node2.getString("@type").equals("STUB"));
-
-            // test that port statistic results are correct
-            JSONObject portStat = portStatistics.getJSONObject("portStat");
-            Assert.assertTrue(portStat.getInt("receivePackets") == 250);
-            Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
-            Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
-            Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
-            Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
-            Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
-            Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
-            Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
-            Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
-            Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
-            Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
-            Assert.assertTrue(portStat.getInt("collisionCount") == 4);
-
-            // test for getting one specific node's stats
-            result = getJsonResult(baseURL + "flowstats/STUB/51966");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            node = json.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node.getString("@type").equals("STUB"));
-
-            // test that flow statistics results are correct
-            flowStats = json.getJSONArray("flowStat");
-            for (int i = 0; i < flowStats.length(); i++) {
-                JSONObject flowStat = flowStats.getJSONObject(i);
-                testFlowStat(flowStat, actionTypes[i]);
-            }
+        // test that flow statistics results are correct
+        JSONArray flowStats = flowStatistics.getJSONArray("flowStat");
+        for (int i = 0; i < flowStats.length(); i++) {
 
-            result = getJsonResult(baseURL + "portstats/STUB/51966");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            node2 = json.getJSONObject("node");
-            // test that node was returned properly
-            Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
-            Assert.assertTrue(node2.getString("@type").equals("STUB"));
-
-            // test that port statistic results are correct
-            portStat = json.getJSONObject("portStat");
-            Assert.assertTrue(portStat.getInt("receivePackets") == 250);
-            Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
-            Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
-            Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
-            Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
-            Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
-            Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
-            Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
-            Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
-            Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
-            Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
-            Assert.assertTrue(portStat.getInt("collisionCount") == 4);
+            JSONObject flowStat = flowStats.getJSONObject(i);
+            testFlowStat(flowStat, actionTypes[i]);
 
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
+        }
 
+        // for /controller/nb/v2/statistics/default/portstats
+        result = getJsonResult(baseURL + "portstats");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        JSONObject portStatistics = getJsonInstance(json, "portStatistics",
+                0xCAFE);
+        JSONObject node2 = portStatistics.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node2.getString("@type").equals("STUB"));
+
+        // test that port statistic results are correct
+        JSONObject portStat = portStatistics.getJSONObject("portStat");
+        Assert.assertTrue(portStat.getInt("receivePackets") == 250);
+        Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
+        Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
+        Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
+        Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
+        Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
+        Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
+        Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
+        Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
+        Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
+        Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
+        Assert.assertTrue(portStat.getInt("collisionCount") == 4);
+
+        // test for getting one specific node's stats
+        result = getJsonResult(baseURL + "flowstats/STUB/51966");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node = json.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node.getString("@type").equals("STUB"));
+
+        // test that flow statistics results are correct
+        flowStats = json.getJSONArray("flowStat");
+        for (int i = 0; i < flowStats.length(); i++) {
+            JSONObject flowStat = flowStats.getJSONObject(i);
+            testFlowStat(flowStat, actionTypes[i]);
         }
+
+        result = getJsonResult(baseURL + "portstats/STUB/51966");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        node2 = json.getJSONObject("node");
+        // test that node was returned properly
+        Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
+        Assert.assertTrue(node2.getString("@type").equals("STUB"));
+
+        // test that port statistic results are correct
+        portStat = json.getJSONObject("portStat");
+        Assert.assertTrue(portStat.getInt("receivePackets") == 250);
+        Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
+        Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
+        Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
+        Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
+        Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
+        Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
+        Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
+        Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
+        Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
+        Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
+        Assert.assertTrue(portStat.getInt("collisionCount") == 4);
     }
 
-    private void testFlowStat(JSONObject flowStat, String actionType) {
-        try {
-            Assert.assertTrue(flowStat.getInt("tableId") == 1);
-            Assert.assertTrue(flowStat.getInt("durationSeconds") == 40);
-            Assert.assertTrue(flowStat.getInt("durationNanoseconds") == 400);
-            Assert.assertTrue(flowStat.getInt("packetCount") == 200);
-            Assert.assertTrue(flowStat.getInt("byteCount") == 100);
-
-            // test that flow information is correct
-            JSONObject flow = flowStat.getJSONObject("flow");
-            Assert.assertTrue(flow.getInt("priority") == 3500);
-            Assert.assertTrue(flow.getInt("idleTimeout") == 1000);
-            Assert.assertTrue(flow.getInt("hardTimeout") == 2000);
-            Assert.assertTrue(flow.getInt("id") == 12345);
-
-            JSONObject match = (flow.getJSONObject("match")
-                    .getJSONObject("matchField"));
-            Assert.assertTrue(match.getString("type").equals("NW_DST"));
-            Assert.assertTrue(match.getString("value").equals("1.1.1.1"));
-
-            JSONObject act = flow.getJSONObject("actions");
-            Assert.assertTrue(act.getString("@type").equals(actionType));
-
-            if (act.getString("@type").equals("output")) {
-                JSONObject port = act.getJSONObject("port");
-                JSONObject port_node = port.getJSONObject("node");
-                Assert.assertTrue(port.getInt("@id") == 51966);
-                Assert.assertTrue(port.getString("@type").equals("STUB"));
-                Assert.assertTrue(port_node.getInt("@id") == 51966);
-                Assert.assertTrue(port_node.getString("@type").equals("STUB"));
-            }
+    private void testFlowStat(JSONObject flowStat, String actionType)
+            throws JSONException {
+        Assert.assertTrue(flowStat.getInt("tableId") == 1);
+        Assert.assertTrue(flowStat.getInt("durationSeconds") == 40);
+        Assert.assertTrue(flowStat.getInt("durationNanoseconds") == 400);
+        Assert.assertTrue(flowStat.getInt("packetCount") == 200);
+        Assert.assertTrue(flowStat.getInt("byteCount") == 100);
+
+        // test that flow information is correct
+        JSONObject flow = flowStat.getJSONObject("flow");
+        Assert.assertTrue(flow.getInt("priority") == 3500);
+        Assert.assertTrue(flow.getInt("idleTimeout") == 1000);
+        Assert.assertTrue(flow.getInt("hardTimeout") == 2000);
+        Assert.assertTrue(flow.getInt("id") == 12345);
+
+        JSONObject match = (flow.getJSONObject("match")
+                .getJSONObject("matchField"));
+        Assert.assertTrue(match.getString("type").equals("NW_DST"));
+        Assert.assertTrue(match.getString("value").equals("1.1.1.1"));
+
+        JSONObject act = flow.getJSONObject("actions");
+        Assert.assertTrue(act.getString("@type").equals(actionType));
+
+        if (act.getString("@type").equals("output")) {
+            JSONObject port = act.getJSONObject("port");
+            JSONObject port_node = port.getJSONObject("node");
+            Assert.assertTrue(port.getInt("@id") == 51966);
+            Assert.assertTrue(port.getString("@type").equals("STUB"));
+            Assert.assertTrue(port_node.getInt("@id") == 51966);
+            Assert.assertTrue(port_node.getString("@type").equals("STUB"));
+        }
 
-            if (act.getString("@type").equals("setDlSrc")) {
-                byte srcMatch[] = { (byte) 5, (byte) 4, (byte) 3, (byte) 2,
-                        (byte) 1 };
-                String src = act.getString("address");
-                byte srcBytes[] = new byte[5];
-                srcBytes[0] = Byte.parseByte(src.substring(0, 2));
-                srcBytes[1] = Byte.parseByte(src.substring(2, 4));
-                srcBytes[2] = Byte.parseByte(src.substring(4, 6));
-                srcBytes[3] = Byte.parseByte(src.substring(6, 8));
-                srcBytes[4] = Byte.parseByte(src.substring(8, 10));
-                Assert.assertTrue(Arrays.equals(srcBytes, srcMatch));
-            }
+        if (act.getString("@type").equals("setDlSrc")) {
+            byte srcMatch[] = { (byte) 5, (byte) 4, (byte) 3, (byte) 2,
+                    (byte) 1 };
+            String src = act.getString("address");
+            byte srcBytes[] = new byte[5];
+            srcBytes[0] = Byte.parseByte(src.substring(0, 2));
+            srcBytes[1] = Byte.parseByte(src.substring(2, 4));
+            srcBytes[2] = Byte.parseByte(src.substring(4, 6));
+            srcBytes[3] = Byte.parseByte(src.substring(6, 8));
+            srcBytes[4] = Byte.parseByte(src.substring(8, 10));
+            Assert.assertTrue(Arrays.equals(srcBytes, srcMatch));
+        }
 
-            if (act.getString("@type").equals("setDlDst")) {
-                byte dstMatch[] = { (byte) 1, (byte) 2, (byte) 3, (byte) 4,
-                        (byte) 5 };
-                String dst = act.getString("address");
-                byte dstBytes[] = new byte[5];
-                dstBytes[0] = Byte.parseByte(dst.substring(0, 2));
-                dstBytes[1] = Byte.parseByte(dst.substring(2, 4));
-                dstBytes[2] = Byte.parseByte(dst.substring(4, 6));
-                dstBytes[3] = Byte.parseByte(dst.substring(6, 8));
-                dstBytes[4] = Byte.parseByte(dst.substring(8, 10));
-                Assert.assertTrue(Arrays.equals(dstBytes, dstMatch));
-            }
-            if (act.getString("@type").equals("setDlType"))
-                Assert.assertTrue(act.getInt("dlType") == 10);
-            if (act.getString("@type").equals("setVlanId"))
-                Assert.assertTrue(act.getInt("vlanId") == 2);
-            if (act.getString("@type").equals("setVlanPcp"))
-                Assert.assertTrue(act.getInt("pcp") == 3);
-            if (act.getString("@type").equals("setVlanCfi"))
-                Assert.assertTrue(act.getInt("cfi") == 1);
-
-            if (act.getString("@type").equals("setNwSrc"))
-                Assert.assertTrue(act.getString("address").equals("2.2.2.2"));
-            if (act.getString("@type").equals("setNwDst"))
-                Assert.assertTrue(act.getString("address").equals("1.1.1.1"));
-
-            if (act.getString("@type").equals("pushVlan")) {
-                int head = act.getInt("VlanHeader");
-                // parsing vlan header
-                int id = head & 0xfff;
-                int cfi = (head >> 12) & 0x1;
-                int pcp = (head >> 13) & 0x7;
-                int tag = (head >> 16) & 0xffff;
-                Assert.assertTrue(id == 1234);
-                Assert.assertTrue(cfi == 1);
-                Assert.assertTrue(pcp == 1);
-                Assert.assertTrue(tag == 0x8100);
-            }
-            if (act.getString("@type").equals("setNwTos"))
-                Assert.assertTrue(act.getInt("tos") == 16);
-            if (act.getString("@type").equals("setTpSrc"))
-                Assert.assertTrue(act.getInt("port") == 4201);
-            if (act.getString("@type").equals("setTpDst"))
-                Assert.assertTrue(act.getInt("port") == 8080);
-        } catch (Exception e) {
-            Assert.assertTrue(false);
+        if (act.getString("@type").equals("setDlDst")) {
+            byte dstMatch[] = { (byte) 1, (byte) 2, (byte) 3, (byte) 4,
+                    (byte) 5 };
+            String dst = act.getString("address");
+            byte dstBytes[] = new byte[5];
+            dstBytes[0] = Byte.parseByte(dst.substring(0, 2));
+            dstBytes[1] = Byte.parseByte(dst.substring(2, 4));
+            dstBytes[2] = Byte.parseByte(dst.substring(4, 6));
+            dstBytes[3] = Byte.parseByte(dst.substring(6, 8));
+            dstBytes[4] = Byte.parseByte(dst.substring(8, 10));
+            Assert.assertTrue(Arrays.equals(dstBytes, dstMatch));
+        }
+        if (act.getString("@type").equals("setDlType"))
+            Assert.assertTrue(act.getInt("dlType") == 10);
+        if (act.getString("@type").equals("setVlanId"))
+            Assert.assertTrue(act.getInt("vlanId") == 2);
+        if (act.getString("@type").equals("setVlanPcp"))
+            Assert.assertTrue(act.getInt("pcp") == 3);
+        if (act.getString("@type").equals("setVlanCfi"))
+            Assert.assertTrue(act.getInt("cfi") == 1);
+
+        if (act.getString("@type").equals("setNwSrc"))
+            Assert.assertTrue(act.getString("address").equals("2.2.2.2"));
+        if (act.getString("@type").equals("setNwDst"))
+            Assert.assertTrue(act.getString("address").equals("1.1.1.1"));
+
+        if (act.getString("@type").equals("pushVlan")) {
+            int head = act.getInt("VlanHeader");
+            // parsing vlan header
+            int id = head & 0xfff;
+            int cfi = (head >> 12) & 0x1;
+            int pcp = (head >> 13) & 0x7;
+            int tag = (head >> 16) & 0xffff;
+            Assert.assertTrue(id == 1234);
+            Assert.assertTrue(cfi == 1);
+            Assert.assertTrue(pcp == 1);
+            Assert.assertTrue(tag == 0x8100);
         }
+        if (act.getString("@type").equals("setNwTos"))
+            Assert.assertTrue(act.getInt("tos") == 16);
+        if (act.getString("@type").equals("setTpSrc"))
+            Assert.assertTrue(act.getInt("port") == 4201);
+        if (act.getString("@type").equals("setTpDst"))
+            Assert.assertTrue(act.getInt("port") == 8080);
     }
 
     @Test
-    public void testFlowProgrammer() {
-        try {
-            String baseURL = "http://127.0.0.1:8080/controller/nb/v2/flow/default/";
-            // Attempt to get a flow that doesn't exit. Should return 404
-            // status.
-            String result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
-            Assert.assertTrue(result.equals("404"));
-
-            // test add flow1
-            String fc = "{\"dynamic\":\"false\", \"name\":\"test1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-            result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
-            Assert.assertTrue(httpResponseCode == 201);
-
-            // test get returns flow that was added.
-            result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
-            // check that result came out fine.
-            Assert.assertTrue(httpResponseCode == 200);
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            Assert.assertTrue(json.getString("name").equals("test1"));
-            Assert.assertTrue(json.getString("actions").equals("DROP"));
-            Assert.assertTrue(json.getString("installInHw").equals("true"));
-            JSONObject node = json.getJSONObject("node");
-            Assert.assertTrue(node.getString("@type").equals("STUB"));
-            Assert.assertTrue(node.getString("@id").equals("51966"));
-            // test adding same flow again fails due to repeat name..return 409
-            // code
-            result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
-            Assert.assertTrue(result.equals("409"));
-
-            fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-            result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
-            // test should return 500 for error due to same flow being added.
-            Assert.assertTrue(result.equals("500"));
-
-            // add second flow that's different
-            fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-            result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
-            Assert.assertTrue(httpResponseCode == 201);
-
-            // check that request returns both flows given node.
-            result = getJsonResult(baseURL + "STUB/51966/", "GET");
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
-            JSONArray ja = json.getJSONArray("flowConfig");
-            Integer count = ja.length();
-            Assert.assertTrue(count == 2);
-
-            // check that request returns both flows given just container.
-            result = getJsonResult(baseURL);
-            jt = new JSONTokener(result);
-            json = new JSONObject(jt);
-            Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
-            ja = json.getJSONArray("flowConfig");
-            count = ja.length();
-            Assert.assertTrue(count == 2);
-
-            // delete a flow, check that it's no longer in list.
-            result = getJsonResult(baseURL + "STUB/51966/test2", "DELETE");
-            Assert.assertTrue(httpResponseCode == 200);
-
-            result = getJsonResult(baseURL + "STUB/51966/test2", "GET");
-            Assert.assertTrue(result.equals("404"));
-
-        } catch (Exception e) {
-            Assert.assertTrue(false);
-        }
-
+    public void testFlowProgrammer() throws JSONException {
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/flow/default/";
+        // Attempt to get a flow that doesn't exit. Should return 404
+        // status.
+        String result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
+        Assert.assertTrue(result.equals("404"));
+
+        // test add flow1
+        String fc = "{\"dynamic\":\"false\", \"name\":\"test1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
+        Assert.assertTrue(httpResponseCode == 201);
+
+        // test get returns flow that was added.
+        result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
+        // check that result came out fine.
+        Assert.assertTrue(httpResponseCode == 200);
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        Assert.assertTrue(json.getString("name").equals("test1"));
+        Assert.assertTrue(json.getString("actions").equals("DROP"));
+        Assert.assertTrue(json.getString("installInHw").equals("true"));
+        JSONObject node = json.getJSONObject("node");
+        Assert.assertTrue(node.getString("@type").equals("STUB"));
+        Assert.assertTrue(node.getString("@id").equals("51966"));
+        // test adding same flow again fails due to repeat name..return 409
+        // code
+        result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
+        Assert.assertTrue(result.equals("409"));
+
+        fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
+        // test should return 500 for error due to same flow being added.
+        Assert.assertTrue(result.equals("500"));
+
+        // add second flow that's different
+        fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
+        Assert.assertTrue(httpResponseCode == 201);
+
+        // check that request returns both flows given node.
+        result = getJsonResult(baseURL + "STUB/51966/", "GET");
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
+        JSONArray ja = json.getJSONArray("flowConfig");
+        Integer count = ja.length();
+        Assert.assertTrue(count == 2);
+
+        // check that request returns both flows given just container.
+        result = getJsonResult(baseURL);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
+        ja = json.getJSONArray("flowConfig");
+        count = ja.length();
+        Assert.assertTrue(count == 2);
+
+        // delete a flow, check that it's no longer in list.
+        result = getJsonResult(baseURL + "STUB/51966/test2", "DELETE");
+        Assert.assertTrue(httpResponseCode == 200);
+
+        result = getJsonResult(baseURL + "STUB/51966/test2", "GET");
+        Assert.assertTrue(result.equals("404"));
     }
 
     // method to extract a JSONObject with specified node ID from a JSONObject
@@ -792,7 +888,7 @@ public class NorthboundIT {
     }
 
     @Test
-    public void testHostTracker() {
+    public void testHostTracker() throws JSONException {
 
         System.out.println("Starting HostTracker JAXB client.");
 
@@ -818,34 +914,29 @@ public class NorthboundIT {
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/host/default";
 
         // test POST method: addHost()
-        try {
-            String queryParameter = new QueryParameter("dataLayerAddress",
-                    dataLayerAddress_1).add("nodeType", nodeType_1)
-                    .add("nodeId", nodeId_1.toString())
-                    .add("nodeConnectorType", nodeConnectorType_1)
-                    .add("nodeConnectorId", nodeConnectorId_1.toString())
-                    .add("vlan", vlan_1).getString();
-
-            String result = getJsonResult(baseURL + "/" + networkAddress_1
-                    + queryParameter, "POST");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
-
-            // vlan is not passed through query parameter but should be
-            // defaulted to "0"
-            queryParameter = new QueryParameter("dataLayerAddress",
-                    dataLayerAddress_2).add("nodeType", nodeType_2)
-                    .add("nodeId", nodeId_2.toString())
-                    .add("nodeConnectorType", nodeConnectorType_2)
-                    .add("nodeConnectorId", nodeConnectorId_2.toString())
-                    .getString();
-
-            result = getJsonResult(baseURL + "/" + networkAddress_2
-                    + queryParameter, "POST");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        String queryParameter = new QueryParameter("dataLayerAddress",
+                dataLayerAddress_1).add("nodeType", nodeType_1)
+                .add("nodeId", nodeId_1.toString())
+                .add("nodeConnectorType", nodeConnectorType_1)
+                .add("nodeConnectorId", nodeConnectorId_1.toString())
+                .add("vlan", vlan_1).getString();
+
+        String result = getJsonResult(baseURL + "/" + networkAddress_1
+                + queryParameter, "POST");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
+
+        // vlan is not passed through query parameter but should be
+        // defaulted to "0"
+        queryParameter = new QueryParameter("dataLayerAddress",
+                dataLayerAddress_2).add("nodeType", nodeType_2)
+                .add("nodeId", nodeId_2.toString())
+                .add("nodeConnectorType", nodeConnectorType_2)
+                .add("nodeConnectorId", nodeConnectorId_2.toString())
+                .getString();
+
+        result = getJsonResult(baseURL + "/" + networkAddress_2
+                + queryParameter, "POST");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
 
         // define variables for decoding returned strings
         String networkAddress;
@@ -853,69 +944,59 @@ public class NorthboundIT {
 
         // the two hosts should be in inactive host DB
         // test GET method: getInactiveHosts()
-        try {
-            String result = getJsonResult(baseURL + "/inactive", "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+        result = getJsonResult(baseURL + "/inactive", "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+
+        JSONTokener jt = new JSONTokener(result);
+        JSONObject json = new JSONObject(jt);
+        // there should be at least two hosts in the DB
+        Assert.assertTrue(json.get("host") instanceof JSONArray);
+        JSONArray ja = json.getJSONArray("host");
+        Integer count = ja.length();
+        Assert.assertTrue(count == 2);
+
+        for (int i = 0; i < count; i++) {
+            host_jo = ja.getJSONObject(i);
+            dl_jo = host_jo.getJSONObject("dataLayerAddress");
+            nc_jo = host_jo.getJSONObject("nodeConnector");
+            node_jo = nc_jo.getJSONObject("node");
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            // there should be at least two hosts in the DB
-            Assert.assertTrue(json.get("host") instanceof JSONArray);
-            JSONArray ja = json.getJSONArray("host");
-            Integer count = ja.length();
-            Assert.assertTrue(count == 2);
-
-            for (int i = 0; i < count; i++) {
-                host_jo = ja.getJSONObject(i);
-                dl_jo = host_jo.getJSONObject("dataLayerAddress");
-                nc_jo = host_jo.getJSONObject("nodeConnector");
-                node_jo = nc_jo.getJSONObject("node");
-
-                networkAddress = host_jo.getString("networkAddress");
-                if (networkAddress.equalsIgnoreCase(networkAddress_1)) {
-                    Assert.assertTrue(dl_jo.getString("macAddress")
-                            .equalsIgnoreCase(dataLayerAddress_1));
-                    Assert.assertTrue(nc_jo.getString("@type")
-                            .equalsIgnoreCase(nodeConnectorType_1));
-                    Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
-                    Assert.assertTrue(node_jo.getString("@type")
-                            .equalsIgnoreCase(nodeType_1));
-                    Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
-                    Assert.assertTrue(host_jo.getString("vlan")
-                            .equalsIgnoreCase(vlan_1));
-                } else if (networkAddress.equalsIgnoreCase(networkAddress_2)) {
-                    Assert.assertTrue(dl_jo.getString("macAddress")
-                            .equalsIgnoreCase(dataLayerAddress_2));
-                    Assert.assertTrue(nc_jo.getString("@type")
-                            .equalsIgnoreCase(nodeConnectorType_2));
-                    Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_2);
-                    Assert.assertTrue(node_jo.getString("@type")
-                            .equalsIgnoreCase(nodeType_2));
-                    Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_2);
-                    Assert.assertTrue(host_jo.getString("vlan")
-                            .equalsIgnoreCase(vlan_2));
-                } else {
-                    Assert.assertTrue(false);
-                }
+            networkAddress = host_jo.getString("networkAddress");
+            if (networkAddress.equalsIgnoreCase(networkAddress_1)) {
+                Assert.assertTrue(dl_jo.getString("macAddress")
+                        .equalsIgnoreCase(dataLayerAddress_1));
+                Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
+                        nodeConnectorType_1));
+                Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
+                Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
+                        nodeType_1));
+                Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
+                Assert.assertTrue(host_jo.getString("vlan").equalsIgnoreCase(
+                        vlan_1));
+            } else if (networkAddress.equalsIgnoreCase(networkAddress_2)) {
+                Assert.assertTrue(dl_jo.getString("macAddress")
+                        .equalsIgnoreCase(dataLayerAddress_2));
+                Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
+                        nodeConnectorType_2));
+                Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_2);
+                Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
+                        nodeType_2));
+                Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_2);
+                Assert.assertTrue(host_jo.getString("vlan").equalsIgnoreCase(
+                        vlan_2));
+            } else {
+                Assert.assertTrue(false);
             }
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
         }
 
         // test GET method: getActiveHosts() - no host expected
-        try {
-            String result = getJsonResult(baseURL, "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+        result = getJsonResult(baseURL, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
-            Assert.assertFalse(hostInJson(json, networkAddress_1));
-            Assert.assertFalse(hostInJson(json, networkAddress_2));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+        Assert.assertFalse(hostInJson(json, networkAddress_1));
+        Assert.assertFalse(hostInJson(json, networkAddress_2));
 
         // put the 1st host into active host DB
         Node nd;
@@ -931,75 +1012,57 @@ public class NorthboundIT {
         }
 
         // verify the host shows up in active host DB
-        try {
-            String result = getJsonResult(baseURL, "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
+        result = getJsonResult(baseURL, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            Assert.assertTrue(hostInJson(json, networkAddress_1));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertTrue(hostInJson(json, networkAddress_1));
 
         // test GET method for getHostDetails()
-        try {
-            String result = getJsonResult(baseURL + "/" + networkAddress_1,
-                    "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
+        result = getJsonResult(baseURL + "/" + networkAddress_1, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            Assert.assertFalse(json.length() == 0);
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
 
-            dl_jo = json.getJSONObject("dataLayerAddress");
-            nc_jo = json.getJSONObject("nodeConnector");
-            node_jo = nc_jo.getJSONObject("node");
+        Assert.assertFalse(json.length() == 0);
 
-            Assert.assertTrue(json.getString("networkAddress")
-                    .equalsIgnoreCase(networkAddress_1));
-            Assert.assertTrue(dl_jo.getString("macAddress").equalsIgnoreCase(
-                    dataLayerAddress_1));
-            Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
-                    nodeConnectorType_1));
-            Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
-            Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
-                    nodeType_1));
-            Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
-            Assert.assertTrue(json.getString("vlan").equalsIgnoreCase(vlan_1));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        dl_jo = json.getJSONObject("dataLayerAddress");
+        nc_jo = json.getJSONObject("nodeConnector");
+        node_jo = nc_jo.getJSONObject("node");
+
+        Assert.assertTrue(json.getString("networkAddress").equalsIgnoreCase(
+                networkAddress_1));
+        Assert.assertTrue(dl_jo.getString("macAddress").equalsIgnoreCase(
+                dataLayerAddress_1));
+        Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
+                nodeConnectorType_1));
+        Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
+        Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
+                nodeType_1));
+        Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
+        Assert.assertTrue(json.getString("vlan").equalsIgnoreCase(vlan_1));
 
         // test DELETE method for deleteFlow()
-        try {
-            String result = getJsonResult(baseURL + "/" + networkAddress_1,
-                    "DELETE");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
+        result = getJsonResult(baseURL + "/" + networkAddress_1, "DELETE");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
         // verify host_1 removed from active host DB
         // test GET method: getActiveHosts() - no host expected
-        try {
-            String result = getJsonResult(baseURL, "GET");
-            Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
 
-            JSONTokener jt = new JSONTokener(result);
-            JSONObject json = new JSONObject(jt);
+        result = getJsonResult(baseURL, "GET");
+        Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
+
+        jt = new JSONTokener(result);
+        json = new JSONObject(jt);
+
+        Assert.assertFalse(hostInJson(json, networkAddress_1));
 
-            Assert.assertFalse(hostInJson(json, networkAddress_1));
-        } catch (Exception e) {
-            // Got an unexpected exception
-            Assert.assertTrue(false);
-        }
     }
 
     private Boolean hostInJson(JSONObject json, String hostIp)
@@ -1104,6 +1167,8 @@ public class NorthboundIT {
 
                 mavenBundle("org.opendaylight.controller", "usermanager",
                         "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller",
+                        "usermanager.implementation", "0.4.0-SNAPSHOT"),
                 mavenBundle("org.opendaylight.controller", "logging.bridge",
                         "0.4.0-SNAPSHOT"),
                 mavenBundle("org.opendaylight.controller", "clustering.test",
@@ -1290,4 +1355,4 @@ public class NorthboundIT {
                 mavenBundle("com.sun.jersey", "jersey-json", "1.17")
                         .startLevel(2), junitBundles());
     }
-}
\ No newline at end of file
+}
index 4be0754..56d469b 100644 (file)
                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 
+<!--
+        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"
             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.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"/>
-               
+                        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>
index 4d6bed0..402b655 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/staticroute"/>
   </services>
index f656faf..bb88465 100644 (file)
@@ -91,6 +91,6 @@
       <groupId>org.opendaylight.controller.thirdparty</groupId>
       <artifactId>com.sun.jersey.jersey-servlet</artifactId>
       <version>1.17-SNAPSHOT</version>
-    </dependency>   
+    </dependency>
   </dependencies>
 </project>
index 37901a6..4a040c1 100644 (file)
@@ -1,7 +1,7 @@
 <?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">
+        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>JAXRSStaticRouting</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>
 
-       <servlet-mapping>
-               <servlet-name>JAXRSStaticRouting</servlet-name>
-               <url-pattern>/*</url-pattern>
-       </servlet-mapping>
+        <servlet-mapping>
+                <servlet-name>JAXRSStaticRouting</servlet-name>
+                <url-pattern>/*</url-pattern>
+        </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>  
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index 3f2759d..63ae439 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/statistics"/>
   </services>
index 7ce5c43..cad50e2 100644 (file)
@@ -24,7 +24,7 @@
             <version>0.5.0-SNAPSHOT</version>
           </dependency>
         </dependencies>
-      </plugin>        
+      </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
index 24242d3..f152aa7 100644 (file)
@@ -1,7 +1,7 @@
 <?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">
+        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>JAXRSStatistics</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index 1c201d3..f7eccef 100644 (file)
@@ -1,7 +1,7 @@
 <?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">  
+        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>JAXRSSubnets</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <servlet-name>JAXRSSubnets</servlet-name>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
index 9338b55..8a8bfdb 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/switch"/>
   </services>
index a16cdfa..188b21b 100644 (file)
@@ -1,7 +1,7 @@
 <?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">
+        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>JAXRSSwitchManager</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
\ No newline at end of file
index c955d8c..b7c451c 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-  
+
   <services>
     <rest defaultRestSubcontext="/controller/nb/v2/topology"/>
   </services>
index e40c5fb..a46e433 100644 (file)
@@ -1,7 +1,7 @@
 <?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">
+        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>JAXRSTopology</servlet-name>
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-       <security-constraint>
-               <web-resource-collection>
-                       <web-resource-name>NB api</web-resource-name>
-                       <url-pattern>/*</url-pattern>
-               </web-resource-collection>
-               <auth-constraint>
-                       <role-name>System-Admin</role-name>
-                       <role-name>Network-Admin</role-name>
-                       <role-name>Network-Operator</role-name>
-                       <role-name>Container-User</role-name>
-               </auth-constraint>
-       </security-constraint>
+        <security-constraint>
+                <web-resource-collection>
+                        <web-resource-name>NB api</web-resource-name>
+                        <url-pattern>/*</url-pattern>
+                </web-resource-collection>
+                <auth-constraint>
+                        <role-name>System-Admin</role-name>
+                        <role-name>Network-Admin</role-name>
+                        <role-name>Network-Operator</role-name>
+                        <role-name>Container-User</role-name>
+                </auth-constraint>
+        </security-constraint>
 
-       <security-role>
-               <role-name>System-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Admin</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Network-Operator</role-name>
-       </security-role>
-       <security-role>
-               <role-name>Container-User</role-name>
-       </security-role>
+        <security-role>
+                <role-name>System-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Admin</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Network-Operator</role-name>
+        </security-role>
+        <security-role>
+                <role-name>Container-User</role-name>
+        </security-role>
 
-       <login-config>
-               <auth-method>BASIC</auth-method>
-               <realm-name>opendaylight</realm-name>
-       </login-config>
+        <login-config>
+                <auth-method>BASIC</auth-method>
+                <realm-name>opendaylight</realm-name>
+        </login-config>
 </web-app>
index 0a22a57..ed4f330 100644 (file)
@@ -1,50 +1,50 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <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>
+        <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.opendaylight.controller</groupId>
     <artifactId>commons.opendaylight</artifactId>
     <version>1.4.0-SNAPSHOT</version>
     <relativePath>../../../opendaylight/commons/opendaylight</relativePath>
   </parent>
-  
-       <groupId>org.opendaylight.controller</groupId>
-       <artifactId>northboundtest</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>
-                                               <Import-Package>
-                                                       org.opendaylight.controller.sal.core,
-                                                       org.eclipse.osgi.framework.console,
-                                                       org.osgi.framework,
-                                       org.apache.felix.dm
-                                               </Import-Package>
-                                               <Export-Package>
-                                               </Export-Package>
-                                               <Bundle-Activator>
-                                         org.opendaylight.controller.northboundtest.unittestsuite.internal.Activator
-                                       </Bundle-Activator>
-                                               <Service-Component>
-                                               </Service-Component>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <dependency>
-                       <groupId>org.opendaylight.controller</groupId>
-                       <artifactId>sal</artifactId>
-                       <version>0.4.0-SNAPSHOT</version>
-               </dependency>    
-       </dependencies>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>northboundtest</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>
+                                                <Import-Package>
+                                                        org.opendaylight.controller.sal.core,
+                                                        org.eclipse.osgi.framework.console,
+                                                        org.osgi.framework,
+                                        org.apache.felix.dm
+                                                </Import-Package>
+                                                <Export-Package>
+                                                </Export-Package>
+                                                <Bundle-Activator>
+                                          org.opendaylight.controller.northboundtest.unittestsuite.internal.Activator
+                                        </Bundle-Activator>
+                                                <Service-Component>
+                                                </Service-Component>
+                                        </instructions>
+                                </configuration>
+                        </plugin>
+                </plugins>
+        </build>
+        <dependencies>
+                <dependency>
+                        <groupId>org.opendaylight.controller</groupId>
+                        <artifactId>sal</artifactId>
+                        <version>0.4.0-SNAPSHOT</version>
+                </dependency>
+        </dependencies>
 </project>
index 81ee6dc..f7edd30 100644 (file)
@@ -13,7 +13,6 @@ import java.nio.ByteBuffer;
 import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.openflow.protocol.OFPacketOut;
 import org.openflow.protocol.OFPort;
 import org.openflow.protocol.OFVendor;
@@ -229,12 +228,15 @@ public class V6FlowMod extends OFVendor implements Cloneable {
         }
     }
 
-    /**
-     * Prints the contents of V6FlowMod in a string format.
-     */
     @Override
     public String toString() {
-        return "V6FlowMod[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "V6FlowMod [match=" + match + ", cookie=" + cookie
+                + ", command=" + command + ", idleTimeout=" + idleTimeout
+                + ", hardTimeout=" + hardTimeout + ", priority=" + priority
+                + ", bufferId=" + bufferId + ", outPort=" + outPort
+                + ", flags=" + flags + ", actions=" + actions + ", match_len="
+                + match_len + ", actions_len=" + actions_len + ", pad_size="
+                + pad_size + "]";
     }
 
 }
index 0edcfea..f31e079 100644 (file)
@@ -9,18 +9,16 @@
 
 package org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6extension;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.openflow.protocol.OFMatch;
-import org.openflow.util.U16;
-import org.openflow.util.U8;
-
 import java.net.Inet6Address;
-import org.opendaylight.controller.sal.utils.HexEncode;
-
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 
+import org.opendaylight.controller.sal.utils.HexEncode;
+import org.openflow.protocol.OFMatch;
+import org.openflow.util.U16;
+import org.openflow.util.U8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -1013,7 +1011,31 @@ public class V6Match extends OFMatch implements Cloneable {
 
     @Override
     public String toString() {
-        return "V6Match[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "V6Match [nwSrc=" + nwSrc + ", nwDst=" + nwDst
+                + ", inputPortMask=" + inputPortMask + ", dataLayerSourceMask="
+                + HexEncode.bytesToHexStringFormat(dataLayerSourceMask)
+                + ", dataLayerDestinationMask="
+                + HexEncode.bytesToHexStringFormat(dataLayerDestinationMask)
+                + ", dataLayerVirtualLanMask=" + dataLayerVirtualLanMask
+                + ", dataLayerVirtualLanPriorityCodePointMask="
+                + dataLayerVirtualLanPriorityCodePointMask
+                + ", dataLayerTypeMask=" + dataLayerTypeMask
+                + ", networkTypeOfServiceMask=" + networkTypeOfServiceMask
+                + ", networkProtocolMask=" + networkProtocolMask
+                + ", networkSourceMask=" + networkSourceMask
+                + ", networkDestinationMask=" + networkDestinationMask
+                + ", transportSourceMask=" + transportSourceMask
+                + ", transportDestinationMask=" + transportDestinationMask
+                + ", srcIPv6SubnetMaskbits=" + srcIPv6SubnetMaskbits
+                + ", dstIPv6SubnetMaskbits=" + dstIPv6SubnetMaskbits
+                + ", inputPortState=" + inputPortState + ", dlSourceState="
+                + dlSourceState + ", dlDestState=" + dlDestState
+                + ", dlVlanState=" + dlVlanState + ", ethTypeState="
+                + ethTypeState + ", nwTosState=" + nwTosState
+                + ", nwProtoState=" + nwProtoState + ", nwSrcState="
+                + nwSrcState + ", nwDstState=" + nwDstState + ", tpSrcState="
+                + tpSrcState + ", tpDstState=" + tpDstState + ", match_len="
+                + match_len + ", pad_size=" + pad_size + "]";
     }
 
     /**
index c96419e..1644b11 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6e
 
 import java.nio.ByteBuffer;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.openflow.protocol.statistics.OFVendorStatistics;
 
 
@@ -150,7 +149,8 @@ public class V6StatsRequest extends OFVendorStatistics {
 
     @Override
     public String toString() {
-        return "V6StatsRequest[" + ReflectionToStringBuilder.toString(this)
+        return "V6StatsRequest [msgsubtype=" + msgsubtype + ", outPort="
+                + outPort + ", match_len=" + match_len + ", tableId=" + tableId
                 + "]";
     }
 
index faefe4c..750c395 100644 (file)
@@ -39,7 +39,7 @@
               org.opendaylight.controller.protocol_plugins.stub.internal
             </Export-Package>
             <Bundle-Activator>
-              org.opendaylight.controller.protocol_plugins.stub.internal.Activator 
+              org.opendaylight.controller.protocol_plugins.stub.internal.Activator
             </Bundle-Activator>
           </instructions>
           <manifestLocation>${project.basedir}/META-INF</manifestLocation>
@@ -60,4 +60,4 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>
index d5fbdbc..edb3537 100644 (file)
@@ -15,8 +15,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
+import org.opendaylight.controller.sal.utils.HexEncode;
 /**
  * The class contains MAC address property.
  */
@@ -92,6 +91,7 @@ public class MacAddress extends Property implements Cloneable {
 
     @Override
     public String toString() {
-        return "MacAddress[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "MacAddress [address=" +
+            HexEncode.bytesToHexStringFormat(address) + "]";
     }
 }
index 0c14517..96a992b 100644 (file)
@@ -14,8 +14,6 @@ import java.io.Serializable;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
 /**
  * @file   DataLinkAddress.java
  *
@@ -94,7 +92,6 @@ abstract public class DataLinkAddress implements Serializable {
 
     @Override
     public String toString() {
-        return "DataLinkAddress[" + ReflectionToStringBuilder.toString(this)
-                + "]";
+        return "DataLinkAddress [name=" + name + "]";
     }
 }
index 2afaea8..6cd14ea 100644 (file)
@@ -17,7 +17,6 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.utils.HexEncode;
 
@@ -117,7 +116,7 @@ public class EthernetAddress extends DataLinkAddress {
 
     @Override
     public String toString() {
-        return "EthernetAddress[" + ReflectionToStringBuilder.toString(this)
+        return "EthernetAddress [macAddress=" + HexEncode.bytesToHexStringFormat(macAddress)
                 + "]";
     }
 
index fff46ea..58bf350 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.sal.topology;
 
 import java.util.Set;
 
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.opendaylight.controller.sal.core.Edge;
 import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.controller.sal.core.UpdateType;
@@ -54,8 +53,8 @@ public class TopoEdgeUpdate {
 
     @Override
     public String toString() {
-        return "TopoEdgeUpdate[" + ReflectionToStringBuilder.toString(this)
-                + "]";
+        return "TopoEdgeUpdate [edge=" + edge + ", props=" + props + ", type="
+                + type + "]";
     }
 
     @Override
index 65d4b48..b89dbb4 100644 (file)
@@ -9,20 +9,25 @@ package org.opendaylight.controller.sal.binding.generator.impl;
 
 import org.opendaylight.controller.binding.generator.util.ReferencedTypeImpl;
 import org.opendaylight.controller.binding.generator.util.Types;
+import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTOBuilderImpl;
 import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTypeBuilderImpl;
 import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
 import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;
 import org.opendaylight.controller.sal.binding.model.api.*;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.*;
 import org.opendaylight.controller.sal.binding.yang.types.TypeProviderImpl;
+import org.opendaylight.controller.yang.binding.Notification;
 import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.common.RpcResult;
 import org.opendaylight.controller.yang.model.api.*;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition.EnumPair;
 import org.opendaylight.controller.yang.model.util.DataNodeIterator;
 import org.opendaylight.controller.yang.model.util.ExtendedType;
+import org.opendaylight.controller.yang.model.util.SchemaContextUtil;
 
 import java.util.*;
+import java.util.concurrent.Future;
 
 import static org.opendaylight.controller.binding.generator.util.BindingGeneratorUtil.*;
 import static org.opendaylight.controller.yang.model.util.SchemaContextUtil.findDataSchemaNode;
@@ -41,12 +46,12 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     @Override
     public List<Type> generateTypes(final SchemaContext context) {
         if (context == null) {
-            throw new IllegalArgumentException("Schema Context reference " +
-                    "cannot be NULL!");
+            throw new IllegalArgumentException("Schema Context reference "
+                    "cannot be NULL!");
         }
         if (context.getModules() == null) {
-            throw new IllegalStateException("Schema Context does not contain " +
-                    "defined modules!");
+            throw new IllegalStateException("Schema Context does not contain "
+                    "defined modules!");
         }
 
         final List<Type> generatedTypes = new ArrayList<>();
@@ -61,25 +66,27 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             generatedTypes.addAll(allListsToGenTypes(module));
             generatedTypes.addAll(allAugmentsToGenTypes(module));
             generatedTypes.addAll(allRPCMethodsToGenType(module));
-            generatedTypes.addAll(allNotifycationsToGenType(module));
+            generatedTypes.addAll(allNotificationsToGenType(module));
+            generatedTypes.addAll(allIdentitiesToGenTypes(module, context));
+            generatedTypes.addAll(allGroupingsToGenTypes(module));
         }
         return generatedTypes;
     }
 
     @Override
     public List<Type> generateTypes(final SchemaContext context,
-                                    final Set<Module> modules) {
+            final Set<Module> modules) {
         if (context == null) {
-            throw new IllegalArgumentException("Schema Context reference " +
-                    "cannot be NULL!");
+            throw new IllegalArgumentException("Schema Context reference "
+                    "cannot be NULL!");
         }
         if (context.getModules() == null) {
-            throw new IllegalStateException("Schema Context does not contain " +
-                    "defined modules!");
+            throw new IllegalStateException("Schema Context does not contain "
+                    "defined modules!");
         }
         if (modules == null) {
-            throw new IllegalArgumentException("Sef of Modules cannot be " +
-                    "NULL!");
+            throw new IllegalArgumentException("Sef of Modules cannot be "
+                    "NULL!");
         }
 
         final List<Type> filteredGenTypes = new ArrayList<>();
@@ -96,7 +103,10 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             generatedTypes.addAll(allListsToGenTypes(contextModule));
             generatedTypes.addAll(allAugmentsToGenTypes(contextModule));
             generatedTypes.addAll(allRPCMethodsToGenType(contextModule));
-            generatedTypes.addAll(allNotifycationsToGenType(contextModule));
+            generatedTypes.addAll(allNotificationsToGenType(contextModule));
+            generatedTypes.addAll(allIdentitiesToGenTypes(contextModule,
+                    context));
+            generatedTypes.addAll(allGroupingsToGenTypes(contextModule));
 
             if (modules.contains(contextModule)) {
                 filteredGenTypes.addAll(generatedTypes);
@@ -107,14 +117,15 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private List<Type> allTypeDefinitionsToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
         if (module.getName() == null) {
             throw new IllegalArgumentException("Module name cannot be NULL!");
         }
         if (module.getTypeDefinitions() == null) {
-            throw new IllegalArgumentException("Type Definitions for module " +
-                    module.getName() + " cannot be NULL!");
+            throw new IllegalArgumentException("Type Definitions for module "
+                    module.getName() + " cannot be NULL!");
         }
 
         final Set<TypeDefinition<?>> typeDefinitions = module
@@ -122,7 +133,7 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final List<Type> generatedTypes = new ArrayList<>();
         for (final TypeDefinition<?> typedef : typeDefinitions) {
             if (typedef != null) {
-                final Type type = ((TypeProviderImpl)typeProvider)
+                final Type type = ((TypeProviderImpl) typeProvider)
                         .generatedTypeForExtendedDefinitionType(typedef);
                 if ((type != null) && !generatedTypes.contains(type)) {
                     generatedTypes.add(type);
@@ -134,7 +145,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private List<Type> allContainersToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -142,26 +154,25 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Child " +
-                    "Nodes in module " + module.getName() + " cannot be " +
-                    "NULL!");
+            throw new IllegalArgumentException("Reference to Set of Child "
+                    + "Nodes in module " + module.getName() + " cannot be "
+                    "NULL!");
         }
 
         final List<Type> generatedTypes = new ArrayList<>();
-        final DataNodeIterator it = new DataNodeIterator(
-                module);
+        final DataNodeIterator it = new DataNodeIterator(module);
         final List<ContainerSchemaNode> schemaContainers = it.allContainers();
         final String basePackageName = moduleNamespaceToPackageName(module);
         for (final ContainerSchemaNode container : schemaContainers) {
-            generatedTypes.add(containerToGenType(basePackageName,
-                    container));
+            generatedTypes.add(containerToGenType(basePackageName, container));
         }
         return generatedTypes;
     }
 
     private List<Type> allListsToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -169,14 +180,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Child " +
-                    "Nodes in module " + module.getName() + " cannot be " +
-                    "NULL!");
+            throw new IllegalArgumentException("Reference to Set of Child "
+                    + "Nodes in module " + module.getName() + " cannot be "
+                    "NULL!");
         }
 
         final List<Type> generatedTypes = new ArrayList<>();
-        final DataNodeIterator it = new DataNodeIterator(
-                module);
+        final DataNodeIterator it = new DataNodeIterator(module);
         final List<ListSchemaNode> schemaLists = it.allLists();
         final String basePackageName = moduleNamespaceToPackageName(module);
         if (schemaLists != null) {
@@ -189,7 +199,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private List<Type> allAugmentsToGenTypes(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -197,8 +208,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of " +
-                    "Augmentation Definitions in module " + module.getName()
+            throw new IllegalArgumentException("Reference to Set of "
+                    "Augmentation Definitions in module " + module.getName()
                     + " cannot be NULL!");
         }
 
@@ -206,37 +217,35 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String basePackageName = moduleNamespaceToPackageName(module);
         final List<AugmentationSchema> augmentations = resolveAugmentations(module);
         for (final AugmentationSchema augment : augmentations) {
-            generatedTypes.addAll(augmentationToGenTypes(basePackageName, augment));
+            generatedTypes.addAll(augmentationToGenTypes(basePackageName,
+                    augment));
         }
         return generatedTypes;
     }
 
     private List<AugmentationSchema> resolveAugmentations(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
         if (module.getAugmentations() == null) {
             throw new IllegalStateException("Augmentations Set cannot be NULL!");
         }
 
-        final Set<AugmentationSchema> augmentations = module
-                .getAugmentations();
+        final Set<AugmentationSchema> augmentations = module.getAugmentations();
         final List<AugmentationSchema> sortedAugmentations = new ArrayList<>(
                 augmentations);
         Collections.sort(sortedAugmentations,
                 new Comparator<AugmentationSchema>() {
 
                     @Override
-                    public int compare(
-                            AugmentationSchema augSchema1,
+                    public int compare(AugmentationSchema augSchema1,
                             AugmentationSchema augSchema2) {
 
-                        if (augSchema1.getTargetPath().getPath()
-                                .size() > augSchema2
+                        if (augSchema1.getTargetPath().getPath().size() > augSchema2
                                 .getTargetPath().getPath().size()) {
                             return 1;
-                        } else if (augSchema1.getTargetPath()
-                                .getPath().size() < augSchema2
+                        } else if (augSchema1.getTargetPath().getPath().size() < augSchema2
                                 .getTargetPath().getPath().size()) {
                             return -1;
                         }
@@ -250,7 +259,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
     private GeneratedType moduleToDataType(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         final GeneratedTypeBuilder moduleDataTypeBuilder = moduleTypeBuilder(
@@ -259,14 +269,16 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String basePackageName = moduleNamespaceToPackageName(module);
         if (moduleDataTypeBuilder != null) {
             final Set<DataSchemaNode> dataNodes = module.getChildNodes();
-            resolveDataSchemaNodes(basePackageName, moduleDataTypeBuilder, dataNodes);
+            resolveDataSchemaNodes(basePackageName, moduleDataTypeBuilder,
+                    dataNodes);
         }
         return moduleDataTypeBuilder.toInstance();
     }
 
-    private List<GeneratedType> allRPCMethodsToGenType(final Module module) {
+    private List<Type> allRPCMethodsToGenType(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -274,37 +286,81 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of " +
-                    "RPC Method Definitions in module " + module.getName()
+            throw new IllegalArgumentException("Reference to Set of "
+                    "RPC Method Definitions in module " + module.getName()
                     + " cannot be NULL!");
         }
 
         final String basePackageName = moduleNamespaceToPackageName(module);
         final Set<RpcDefinition> rpcDefinitions = module.getRpcs();
-        final List<GeneratedType> genRPCTypes = new ArrayList<>();
-
+        final List<Type> genRPCTypes = new ArrayList<>();
+        final GeneratedTypeBuilder interfaceBuilder = moduleTypeBuilder(module,
+                "Service");
+        final Type future = Types.typeForClass(Future.class);
         for (final RpcDefinition rpc : rpcDefinitions) {
             if (rpc != null) {
+
+                String rpcName = parseToClassName(rpc.getQName()
+                        .getLocalName());
+                MethodSignatureBuilder method = interfaceBuilder
+                        .addMethod(rpcName);
+
                 final List<DataNodeIterator> rpcInOut = new ArrayList<>();
-                rpcInOut.add(new DataNodeIterator(rpc.getInput()));
-                rpcInOut.add(new DataNodeIterator(rpc.getOutput()));
 
+                ContainerSchemaNode input = rpc.getInput();
+                ContainerSchemaNode output = rpc.getOutput();
+
+                if (input != null) {
+                    rpcInOut.add(new DataNodeIterator(input));
+                    GeneratedTypeBuilder inType = addRawInterfaceDefinition(
+                            basePackageName, input, rpcName);
+                    resolveDataSchemaNodes(basePackageName, inType, input.getChildNodes());
+                    Type inTypeInstance = inType.toInstance();
+                    genRPCTypes.add(inTypeInstance);
+                    method.addParameter(inTypeInstance, "input");
+                }
+
+                Type outTypeInstance = Types.typeForClass(Void.class);
+                if (output != null) {
+                    rpcInOut.add(new DataNodeIterator(output));
+
+                    GeneratedTypeBuilder outType = addRawInterfaceDefinition(
+                            basePackageName, output, rpcName);
+                    resolveDataSchemaNodes(basePackageName, outType, output.getChildNodes());
+                    outTypeInstance = outType.toInstance();
+                    genRPCTypes.add(outTypeInstance);
+
+                }
+
+                final Type rpcRes = Types.parameterizedTypeFor(
+                        Types.typeForClass(RpcResult.class), outTypeInstance);
+                method.addReturnType(Types.parameterizedTypeFor(future, rpcRes));
                 for (DataNodeIterator it : rpcInOut) {
                     List<ContainerSchemaNode> nContainers = it.allContainers();
                     if ((nContainers != null) && !nContainers.isEmpty()) {
                         for (final ContainerSchemaNode container : nContainers) {
-                            genRPCTypes.add(containerToGenType(basePackageName, container));
+                            genRPCTypes.add(containerToGenType(basePackageName,
+                                    container));
+                        }
+                    }
+                    List<ListSchemaNode> nLists = it.allLists();
+                    if ((nLists != null) && !nLists.isEmpty()) {
+                        for (final ListSchemaNode list : nLists) {
+                            genRPCTypes.addAll(listToGenType(basePackageName,
+                                    list));
                         }
                     }
                 }
             }
         }
+        genRPCTypes.add(interfaceBuilder.toInstance());
         return genRPCTypes;
     }
 
-    private List<Type> allNotifycationsToGenType(final Module module) {
+    private List<Type> allNotificationsToGenType(final Module module) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
 
         if (module.getName() == null) {
@@ -312,8 +368,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         }
 
         if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of " +
-                    "Notification Definitions in module " + module.getName()
+            throw new IllegalArgumentException("Reference to Set of "
+                    "Notification Definitions in module " + module.getName()
                     + " cannot be NULL!");
         }
 
@@ -324,33 +380,108 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
         for (final NotificationDefinition notification : notifications) {
             if (notification != null) {
-                final List<DataNodeIterator> notifyChildren = new ArrayList<>();
+                DataNodeIterator it = new DataNodeIterator(notification);
 
-                for (DataSchemaNode childNode : notification.getChildNodes()) {
-                    if (childNode instanceof DataNodeContainer) {
-                        notifyChildren.add(new DataNodeIterator((DataNodeContainer) childNode));
-                    }
+                // Containers
+                for (ContainerSchemaNode node : it.allContainers()) {
+                    genNotifyTypes
+                            .add(containerToGenType(basePackageName, node));
                 }
-
-                for (DataNodeIterator it : notifyChildren) {
-                    List<ContainerSchemaNode> nContainers = it.allContainers();
-                    List<ListSchemaNode> nLists = it.allLists();
-                    if ((nContainers != null) && !nContainers.isEmpty()) {
-                        for (final ContainerSchemaNode container : nContainers) {
-                            genNotifyTypes.add(containerToGenType(basePackageName, container));
-                        }
-                    }
-                    if ((nLists != null) && !nLists.isEmpty()) {
-                        for (final ListSchemaNode list : nLists) {
-                            genNotifyTypes.addAll(listToGenType(basePackageName, list));
-                        }
-                    }
+                // Lists
+                for (ListSchemaNode node : it.allLists()) {
+                    genNotifyTypes.addAll(listToGenType(basePackageName, node));
                 }
+                final GeneratedTypeBuilder notificationTypeBuilder = addRawInterfaceDefinition(
+                        basePackageName, notification);
+                notificationTypeBuilder.addImplementsType(Types
+                        .typeForClass(Notification.class));
+                // Notification object
+                resolveDataSchemaNodes(basePackageName,
+                        notificationTypeBuilder, notification.getChildNodes());
+                genNotifyTypes.add(notificationTypeBuilder.toInstance());
             }
         }
         return genNotifyTypes;
     }
 
+    private List<Type> allIdentitiesToGenTypes(final Module module,
+            final SchemaContext context) {
+        List<Type> genTypes = new ArrayList<Type>();
+
+        final Set<IdentitySchemaNode> schemaIdentities = module.getIdentities();
+
+        final String basePackageName = moduleNamespaceToPackageName(module);
+
+        if (schemaIdentities != null && !schemaIdentities.isEmpty()) {
+            for (final IdentitySchemaNode identity : schemaIdentities) {
+                genTypes.add(identityToGenType(basePackageName, identity,
+                        context));
+            }
+        }
+        return genTypes;
+    }
+
+    private GeneratedType identityToGenType(final String basePackageName,
+            IdentitySchemaNode identity, SchemaContext context) {
+        if (identity == null) {
+            return null;
+        }
+
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                identity.getPath());
+
+        final String genTypeName = parseToClassName(identity.getQName()
+                .getLocalName());
+        final GeneratedTOBuilderImpl newType = new GeneratedTOBuilderImpl(
+                packageName, genTypeName);
+
+        IdentitySchemaNode baseIdentity = identity.getBaseIdentity();
+        if (baseIdentity != null) {
+            Module baseIdentityParentModule = SchemaContextUtil.findParentModule(
+                    context, baseIdentity);
+
+            final String returnTypePkgName = moduleNamespaceToPackageName(baseIdentityParentModule);
+            final String returnTypeName = parseToClassName(baseIdentity
+                    .getQName().getLocalName());
+
+            GeneratedTransferObject gto = new GeneratedTOBuilderImpl(
+                    returnTypePkgName, returnTypeName).toInstance();
+            newType.addExtendsType(gto);
+        } else {
+            newType.addExtendsType(Types.getBaseIdentityTO());
+        }
+
+        return newType.toIdentityInstance();
+    }
+
+    private List<Type> allGroupingsToGenTypes(Module module) {
+        final List<Type> genTypes = new ArrayList<Type>();
+        final String basePackageName = moduleNamespaceToPackageName(module);
+        Set<GroupingDefinition> groupings = module.getGroupings();
+        if (groupings != null && !groupings.isEmpty()) {
+            for (final GroupingDefinition grouping : groupings) {
+                genTypes.add(groupingToGenType(basePackageName, grouping));
+            }
+        }
+        return genTypes;
+    }
+
+    private GeneratedType groupingToGenType(final String basePackageName,
+            GroupingDefinition grouping) {
+        if (grouping == null) {
+            return null;
+        }
+
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                grouping.getPath());
+        final Set<DataSchemaNode> schemaNodes = grouping.getChildNodes();
+        final GeneratedTypeBuilder typeBuilder = addRawInterfaceDefinition(
+                packageName, grouping);
+
+        resolveDataSchemaNodes(basePackageName, typeBuilder, schemaNodes);
+        return typeBuilder.toInstance();
+    }
+
     private EnumTypeDefinition enumTypeDefFromExtendedType(
             final TypeDefinition<?> typeDefinition) {
         if (typeDefinition != null) {
@@ -399,20 +530,20 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private GeneratedTypeBuilder moduleTypeBuilder(final Module module,
-                                                   final String postfix) {
+            final String postfix) {
         if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
+            throw new IllegalArgumentException(
+                    "Module reference cannot be NULL!");
         }
         String packageName = moduleNamespaceToPackageName(module);
-        final String moduleName = parseToClassName(module.getName())
-                + postfix;
+        final String moduleName = parseToClassName(module.getName()) + postfix;
 
         return new GeneratedTypeBuilderImpl(packageName, moduleName);
 
     }
 
     private List<Type> augmentationToGenTypes(final String augmentPackageName,
-                                              final AugmentationSchema augSchema) {
+            final AugmentationSchema augSchema) {
         if (augmentPackageName == null) {
             throw new IllegalArgumentException("Package Name cannot be NULL!");
         }
@@ -430,23 +561,23 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         // EVERY augmented interface will extends Augmentation<T> interface
         // and DataObject interface!!!
         final SchemaPath targetPath = augSchema.getTargetPath();
-        final DataSchemaNode targetSchemaNode = findDataSchemaNode(schemaContext,
-                targetPath);
-        if ((targetSchemaNode != null) &&
-                (targetSchemaNode.getQName() != null) &&
-                (targetSchemaNode.getQName().getLocalName() != null)) {
+        final DataSchemaNode targetSchemaNode = findDataSchemaNode(
+                schemaContext, targetPath);
+        if ((targetSchemaNode != null) && (targetSchemaNode.getQName() != null)
+                && (targetSchemaNode.getQName().getLocalName() != null)) {
             final Module targetModule = findParentModule(schemaContext,
                     targetSchemaNode);
 
             final String targetBasePackage = moduleNamespaceToPackageName(targetModule);
-            final String targetPackageName = packageNameForGeneratedType(targetBasePackage,
-                    targetSchemaNode.getPath());
+            final String targetPackageName = packageNameForGeneratedType(
+                    targetBasePackage, targetSchemaNode.getPath());
 
-            final String targetSchemaNodeName = targetSchemaNode.getQName().getLocalName();
-            final Set<DataSchemaNode> augChildNodes = augSchema
-                    .getChildNodes();
+            final String targetSchemaNodeName = targetSchemaNode.getQName()
+                    .getLocalName();
+            final Set<DataSchemaNode> augChildNodes = augSchema.getChildNodes();
             final GeneratedTypeBuilder augTypeBuilder = addRawAugmentGenTypeDefinition(
-                    augmentPackageName, targetPackageName, targetSchemaNodeName, augSchema);
+                    augmentPackageName, targetPackageName,
+                    targetSchemaNodeName, augSchema);
             if (augTypeBuilder != null) {
                 genTypes.add(augTypeBuilder.toInstance());
             }
@@ -469,10 +600,11 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             genTypeBuilders.put(augmentPackageName, augmentBuilders);
         }
 
-        final String augTypeName = augGenTypeName(augmentBuilders, targetTypeName);
-        final Type targetTypeRef = new ReferencedTypeImpl(targetPackageName, targetTypeName);
-        final Set<DataSchemaNode> augChildNodes = augSchema
-                .getChildNodes();
+        final String augTypeName = augGenTypeName(augmentBuilders,
+                targetTypeName);
+        final Type targetTypeRef = new ReferencedTypeImpl(targetPackageName,
+                targetTypeName);
+        final Set<DataSchemaNode> augChildNodes = augSchema.getChildNodes();
 
         final GeneratedTypeBuilder augTypeBuilder = new GeneratedTypeBuilderImpl(
                 augmentPackageName, augTypeName);
@@ -481,13 +613,15 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         augTypeBuilder.addImplementsType(Types
                 .augmentationTypeFor(targetTypeRef));
 
-        augSchemaNodeToMethods(augmentPackageName, augTypeBuilder, augChildNodes);
+        augSchemaNodeToMethods(augmentPackageName, augTypeBuilder,
+                augChildNodes);
         augmentBuilders.put(augTypeName, augTypeBuilder);
         return augTypeBuilder;
     }
 
-    private List<Type> augmentationBodyToGenTypes(final String augBasePackageName,
-                                                  final Set<DataSchemaNode> augChildNodes) {
+    private List<Type> augmentationBodyToGenTypes(
+            final String augBasePackageName,
+            final Set<DataSchemaNode> augChildNodes) {
         final List<Type> genTypes = new ArrayList<>();
         final List<DataNodeIterator> augSchemaIts = new ArrayList<>();
         for (final DataSchemaNode childNode : augChildNodes) {
@@ -511,7 +645,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
 
             if ((augContainers != null) && !augContainers.isEmpty()) {
                 for (final ContainerSchemaNode container : augContainers) {
-                    genTypes.add(containerToGenType(augBasePackageName, container));
+                    genTypes.add(containerToGenType(augBasePackageName,
+                            container));
                 }
             }
             if ((augLists != null) && !augLists.isEmpty()) {
@@ -537,13 +672,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private GeneratedType containerToGenType(final String basePackageName,
-                                             ContainerSchemaNode containerNode) {
+            ContainerSchemaNode containerNode) {
         if (containerNode == null) {
             return null;
         }
 
-        final String packageName = packageNameForGeneratedType(
-                basePackageName, containerNode.getPath());
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                containerNode.getPath());
         final Set<DataSchemaNode> schemaNodes = containerNode.getChildNodes();
         final GeneratedTypeBuilder typeBuilder = addRawInterfaceDefinition(
                 packageName, containerNode);
@@ -562,7 +697,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
                 if (schemaNode.isAugmenting()) {
                     continue;
                 }
-                addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode, typeBuilder);
+                addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode,
+                        typeBuilder);
             }
         }
         return typeBuilder;
@@ -576,15 +712,15 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         if ((schemaNodes != null) && (typeBuilder != null)) {
             for (final DataSchemaNode schemaNode : schemaNodes) {
                 if (schemaNode.isAugmenting()) {
-                    addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode, typeBuilder);
+                    addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode,
+                            typeBuilder);
                 }
             }
         }
         return typeBuilder;
     }
 
-    private void addSchemaNodeToBuilderAsMethod(
-            final String basePackageName,
+    private void addSchemaNodeToBuilderAsMethod(final String basePackageName,
             final DataSchemaNode schemaNode,
             final GeneratedTypeBuilder typeBuilder) {
         if (schemaNode != null && typeBuilder != null) {
@@ -630,13 +766,14 @@ public final class BindingGeneratorImpl implements BindingGenerator {
                                 enumBuilder.getPackageName(),
                                 enumBuilder.getName());
                     }
-                    ((TypeProviderImpl)typeProvider).putReferencedType(leaf
-                            .getPath(), returnType);
+                    ((TypeProviderImpl) typeProvider).putReferencedType(
+                            leaf.getPath(), returnType);
                 }
                 if (returnType != null) {
                     constructGetter(typeBuilder, leafName, leafDesc, returnType);
                     if (!leaf.isConfiguration()) {
-                        constructSetter(typeBuilder, leafName, leafDesc, returnType);
+                        constructSetter(typeBuilder, leafName, leafDesc,
+                                returnType);
                     }
                     return true;
                 }
@@ -707,8 +844,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private boolean resolveContainerSchemaNode(final String basePackageName,
-                                               final GeneratedTypeBuilder typeBuilder,
-                                               final ContainerSchemaNode containerNode) {
+            final GeneratedTypeBuilder typeBuilder,
+            final ContainerSchemaNode containerNode) {
         if ((containerNode != null) && (typeBuilder != null)) {
             final String nodeName = containerNode.getQName().getLocalName();
 
@@ -727,8 +864,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private boolean resolveListSchemaNode(final String basePackageName,
-                                          final GeneratedTypeBuilder typeBuilder,
-                                          final ListSchemaNode schemaNode) {
+            final GeneratedTypeBuilder typeBuilder,
+            final ListSchemaNode schemaNode) {
         if ((schemaNode != null) && (typeBuilder != null)) {
             final String listName = schemaNode.getQName().getLocalName();
 
@@ -750,7 +887,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
     }
 
     private GeneratedTypeBuilder addRawInterfaceDefinition(
-            final String packageName, final DataSchemaNode schemaNode) {
+            final String packageName, final SchemaNode schemaNode) {
+        return addRawInterfaceDefinition(packageName, schemaNode, "");
+    }
+
+    private GeneratedTypeBuilder addRawInterfaceDefinition(
+            final String packageName, final SchemaNode schemaNode,
+            final String prefix) {
         if (schemaNode == null) {
             return null;
         }
@@ -758,7 +901,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String schemaNodeName = schemaNode.getQName().getLocalName();
 
         if ((packageName != null) && (schemaNodeName != null)) {
-            final String genTypeName = parseToClassName(schemaNodeName);
+            final String genTypeName = prefix + parseToClassName(schemaNodeName)
+                    ;
             final GeneratedTypeBuilder newType = new GeneratedTypeBuilderImpl(
                     packageName, genTypeName);
 
@@ -823,9 +967,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         return setMethod;
     }
 
-
     private List<Type> listToGenType(final String basePackageName,
-                                     final ListSchemaNode list) {
+            final ListSchemaNode list) {
         if (basePackageName == null) {
             throw new IllegalArgumentException(
                     "Package Name for Generated Type cannot be NULL!");
@@ -835,8 +978,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
                     "List Schema Node cannot be NULL!");
         }
 
-        final String packageName = packageNameForGeneratedType(
-                basePackageName, list.getPath());
+        final String packageName = packageNameForGeneratedType(basePackageName,
+                list.getPath());
         final GeneratedTypeBuilder typeBuilder = resolveListTypeBuilder(
                 packageName, list);
         final List<String> listKeys = listKeys(list);
@@ -849,17 +992,16 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             if (schemaNode.isAugmenting()) {
                 continue;
             }
-            addSchemaNodeToListBuilders(basePackageName, schemaNode, typeBuilder,
-                    genTOBuilder, listKeys);
+            addSchemaNodeToListBuilders(basePackageName, schemaNode,
+                    typeBuilder, genTOBuilder, listKeys);
         }
         return typeBuildersToGenTypes(typeBuilder, genTOBuilder);
     }
 
     private void addSchemaNodeToListBuilders(final String basePackageName,
-                                             final DataSchemaNode schemaNode,
-                                             final GeneratedTypeBuilder typeBuilder,
-                                             final GeneratedTOBuilder genTOBuilder,
-                                             final List<String> listKeys) {
+            final DataSchemaNode schemaNode,
+            final GeneratedTypeBuilder typeBuilder,
+            final GeneratedTOBuilder genTOBuilder, final List<String> listKeys) {
         if (schemaNode == null) {
             throw new IllegalArgumentException(
                     "Data Schema Node cannot be NULL!");
@@ -884,7 +1026,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
             resolveContainerSchemaNode(basePackageName, typeBuilder,
                     (ContainerSchemaNode) schemaNode);
         } else if (schemaNode instanceof ListSchemaNode) {
-            resolveListSchemaNode(basePackageName, typeBuilder, (ListSchemaNode) schemaNode);
+            resolveListSchemaNode(basePackageName, typeBuilder,
+                    (ListSchemaNode) schemaNode);
         }
     }
 
@@ -912,13 +1055,13 @@ public final class BindingGeneratorImpl implements BindingGenerator {
      * @return
      */
     private GeneratedTOBuilder resolveListKey(final String packageName,
-                                              final ListSchemaNode list) {
+            final ListSchemaNode list) {
         final String listName = list.getQName().getLocalName() + "Key";
         return schemaNodeToTransferObjectBuilder(packageName, list, listName);
     }
 
     private boolean isPartOfListKey(final LeafSchemaNode leaf,
-                                    final List<String> keys) {
+            final List<String> keys) {
         if ((leaf != null) && (keys != null) && (leaf.getQName() != null)) {
             final String leafName = leaf.getQName().getLocalName();
             if (keys.contains(leafName)) {
@@ -956,7 +1099,8 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         final String genTypeName = parseToClassName(schemaNodeName);
 
         GeneratedTypeBuilder typeBuilder = null;
-        final Map<String, GeneratedTypeBuilder> builders = genTypeBuilders.get(packageName);
+        final Map<String, GeneratedTypeBuilder> builders = genTypeBuilders
+                .get(packageName);
         if (builders != null) {
             typeBuilder = builders.get(genTypeName);
         }
index 03824ef..96069c2 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.controller.sal.binding.model.api.type.builder.EnumBuilde
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedPropertyBuilder;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTOBuilder;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTypeBuilder;
+import org.opendaylight.controller.yang.common.QName;
 import org.opendaylight.controller.yang.model.api.*;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition.EnumPair;
@@ -103,7 +104,8 @@ public final class TypeProviderImpl implements TypeProvider {
                 final LeafrefTypeDefinition leafref = (LeafrefTypeDefinition) baseTypeDef;
                 returnType = provideTypeForLeafref(leafref);
             } else if (baseTypeDef instanceof IdentityrefTypeDefinition) {
-
+                final IdentityrefTypeDefinition idref = (IdentityrefTypeDefinition)typeDefinition;
+                returnType = returnTypeForIdentityref(idref);
             } else if (baseTypeDef instanceof EnumTypeDefinition) {
                 final EnumTypeDefinition enumTypeDef = (EnumTypeDefinition) baseTypeDef;
                 returnType = resolveEnumFromTypeDefinition(enumTypeDef,
@@ -128,7 +130,8 @@ public final class TypeProviderImpl implements TypeProvider {
                 final LeafrefTypeDefinition leafref = (LeafrefTypeDefinition) typeDefinition;
                 returnType = provideTypeForLeafref(leafref);
             } else if (typeDefinition instanceof IdentityrefTypeDefinition) {
-
+                final IdentityrefTypeDefinition idref = (IdentityrefTypeDefinition)typeDefinition;
+                returnType = returnTypeForIdentityref(idref);
             } else {
                 returnType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER
                         .javaTypeForSchemaDefinitionType(typeDefinition);
@@ -142,6 +145,29 @@ public final class TypeProviderImpl implements TypeProvider {
 //        }
         return returnType;
     }
+    
+    private Type returnTypeForIdentityref(IdentityrefTypeDefinition idref) {
+        QName baseIdQName = idref.getIdentity();
+        Module module = schemaContext.findModuleByNamespace(baseIdQName.getNamespace());
+        IdentitySchemaNode identity = null;
+        for(IdentitySchemaNode id : module.getIdentities()) {
+            if(id.getQName().equals(baseIdQName)) {
+                identity = id;
+            }
+        }
+        if(identity == null) {
+            throw new IllegalArgumentException("Target identity '" + baseIdQName + "' do not exists");
+        }
+
+        final String basePackageName = moduleNamespaceToPackageName(module);
+        final String packageName = packageNameForGeneratedType(basePackageName, identity.getPath());
+        final String genTypeName = parseToClassName(identity.getQName().getLocalName());
+
+        Type baseType = Types.typeForClass(Class.class);
+        Type paramType = Types.wildcardTypeFor(packageName, genTypeName);
+        Type returnType = Types.parameterizedTypeFor(baseType, paramType);
+        return returnType;
+    }
 
     public Type generatedTypeForExtendedDefinitionType(
             final TypeDefinition<?> typeDefinition) {
index 6a0e114..a95eb07 100644 (file)
@@ -61,7 +61,7 @@ public class GenEnumResolvingTest {
         assertTrue(genTypes != null);
 
         assertEquals("Expected count of all Generated Types from yang models " +
-                "is 22", 22, genTypes.size());
+                "is 22", 25, genTypes.size());
 
         GeneratedType genInterface = null;
         for (final Type type : genTypes) {
@@ -135,7 +135,7 @@ public class GenEnumResolvingTest {
         final BindingGenerator bindingGen = new BindingGeneratorImpl();
         final List<Type> genTypes = bindingGen.generateTypes(context);
         assertTrue(genTypes != null);
-        assertEquals(2, genTypes.size());
+        assertEquals(3, genTypes.size());
 
         final Type type = genTypes.get(1);
         assertTrue(type instanceof Enumeration);
index c6d9a28..16eff0b 100644 (file)
@@ -63,7 +63,7 @@ public class GenTypesSubSetTest {
         assertNotNull("genTypes is null", genTypes);
         assertFalse("genTypes is empty", genTypes.isEmpty());
         assertEquals("Expected Generated Types from provided sub set of " +
-                "modules should be 23!", 23,
+                "modules should be 23!", 25,
                 genTypes.size());
     }
 
@@ -93,6 +93,6 @@ public class GenTypesSubSetTest {
         assertNotNull("genTypes is null", genTypes);
         assertFalse("genTypes is empty", genTypes.isEmpty());
         assertEquals("Expected Generated Types from provided sub set of "  +
-                "modules should be 25!", 25, genTypes.size());
+                "modules should be 25!", 28, genTypes.size());
     }
 }
index 0010733..b226252 100644 (file)
@@ -56,7 +56,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(27, genTypes.size());
+        assertEquals(29, genTypes.size());
     }
 
     @Test
@@ -93,7 +93,7 @@ public class GeneratedTypesTest {
         final BindingGenerator bindingGen = new BindingGeneratorImpl();
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
-        assertEquals(53, genTypes.size());
+        assertEquals(57, genTypes.size());
         assertTrue(genTypes != null);
 
         GeneratedTransferObject gtIfcKey = null;
@@ -261,7 +261,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(3, genTypes.size());
+        assertEquals(4, genTypes.size());
 
         final GeneratedType simpleContainer = (GeneratedType) genTypes.get(1);
         final GeneratedType nestedContainer = (GeneratedType) genTypes.get(2);
@@ -339,7 +339,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(3, genTypes.size());
+        assertEquals(4, genTypes.size());
 
         final GeneratedType simpleContainer = (GeneratedType) genTypes.get(1);
         final GeneratedType nestedContainer = (GeneratedType) genTypes.get(2);
@@ -412,7 +412,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(5, genTypes.size());
+        assertEquals(6, genTypes.size());
 
         int genTypesCount = 0;
         int genTOsCount = 0;
@@ -496,7 +496,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(7, genTypes.size());
+        assertEquals(8, genTypes.size());
 
         int genTypesCount = 0;
         int genTOsCount = 0;
@@ -529,7 +529,7 @@ public class GeneratedTypesTest {
             }
         }
 
-        assertEquals(5, genTypesCount);
+        assertEquals(6, genTypesCount);
         assertEquals(2, genTOsCount);
     }
 
@@ -544,7 +544,7 @@ public class GeneratedTypesTest {
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertTrue(genTypes != null);
-        assertEquals(14, genTypes.size());
+        assertEquals(15, genTypes.size());
 
         int genTypesCount = 0;
         int genTOsCount = 0;
@@ -557,7 +557,7 @@ public class GeneratedTypesTest {
             }
         }
 
-        assertEquals(11, genTypesCount);
+        assertEquals(12, genTypesCount);
         assertEquals(3, genTOsCount);
     }
 }
index 26be943..2e5bbf0 100644 (file)
@@ -11,11 +11,15 @@ import java.util.List;
 import java.util.Map;\r
 import java.util.Set;\r
 \r
+import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTOBuilderImpl;\r
 import org.opendaylight.controller.sal.binding.model.api.ConcreteType;\r
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;\r
 import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;\r
 import org.opendaylight.controller.sal.binding.model.api.Type;\r
+import org.opendaylight.controller.sal.binding.model.api.WildcardType;\r
 import org.opendaylight.controller.yang.binding.Augmentable;\r
 import org.opendaylight.controller.yang.binding.Augmentation;\r
+import org.opendaylight.controller.yang.binding.BaseIdentity;\r
 import org.opendaylight.controller.yang.binding.DataObject;\r
 \r
 public final class Types {\r
@@ -36,7 +40,7 @@ public final class Types {
 \r
     /**\r
      * Returns an instance of {@link ConcreteType} describing the class\r
-     * \r
+     *\r
      * @param cls\r
      *            Class to describe\r
      * @return Description of class\r
@@ -49,7 +53,7 @@ public final class Types {
     /**\r
      * Returns an instance of {@link ParameterizedType} describing the typed\r
      * {@link Map}<K,V>\r
-     * \r
+     *\r
      * @param keyType\r
      *            Key Type\r
      * @param valueType\r
@@ -63,7 +67,7 @@ public final class Types {
     /**\r
      * Returns an instance of {@link ParameterizedType} describing the typed\r
      * {@link Set}<V> with concrete type of value.\r
-     * \r
+     *\r
      * @param valueType\r
      *            Value Type\r
      * @return Description of generic type instance of Set\r
@@ -75,7 +79,7 @@ public final class Types {
     /**\r
      * Returns an instance of {@link ParameterizedType} describing the typed\r
      * {@link List}<V> with concrete type of value.\r
-     * \r
+     *\r
      * @param valueType\r
      *            Value Type\r
      * @return Description of type instance of List\r
@@ -84,8 +88,15 @@ public final class Types {
         return parameterizedTypeFor(LIST_TYPE, valueType);\r
     }\r
 \r
+    public static GeneratedTransferObject getBaseIdentityTO() {\r
+        Class<BaseIdentity> cls = BaseIdentity.class;\r
+        GeneratedTOBuilderImpl gto = new GeneratedTOBuilderImpl(cls.getPackage().getName(),\r
+                cls.getSimpleName());\r
+        return gto.toInstance();\r
+    }\r
+\r
     /**\r
-     * \r
+     *\r
      * @param type\r
      * @param parameters\r
      * @return\r
@@ -94,17 +105,21 @@ public final class Types {
             Type... parameters) {\r
         return new ParametrizedTypeImpl(type, parameters);\r
     }\r
-    \r
+\r
+    public static WildcardType wildcardTypeFor(String packageName, String typeName) {\r
+        return new WildcardTypeImpl(packageName, typeName);\r
+    }\r
+\r
     public static ParameterizedType augmentableTypeFor(Type valueType) {\r
         final Type augmentable = typeForClass(Augmentable.class);\r
         return parameterizedTypeFor(augmentable, valueType);\r
     }\r
-    \r
+\r
     public static ParameterizedType augmentationTypeFor(Type valueType) {\r
         final Type augmentation = typeForClass(Augmentation.class);\r
         return parameterizedTypeFor(augmentation, valueType);\r
     }\r
-    \r
+\r
     private static class ConcreteTypeImpl extends AbstractBaseType implements\r
             ConcreteType {\r
         private ConcreteTypeImpl(String pkName, String name) {\r
@@ -135,4 +150,12 @@ public final class Types {
         }\r
 \r
     }\r
+\r
+    private static class WildcardTypeImpl extends AbstractBaseType\r
+            implements WildcardType {\r
+        public WildcardTypeImpl(String packageName, String typeName) {\r
+            super(packageName, typeName);\r
+        }\r
+    }\r
+\r
 }\r
index 558fb43..f1683fd 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.controller.sal.binding.model.api.AnnotationType;
 import org.opendaylight.controller.sal.binding.model.api.Constant;
 import org.opendaylight.controller.sal.binding.model.api.Enumeration;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferIdentityObject;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
 import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
 import org.opendaylight.controller.sal.binding.model.api.Type;
@@ -26,11 +27,11 @@ import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedP
 import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTOBuilder;
 import org.opendaylight.controller.sal.binding.model.api.type.builder.MethodSignatureBuilder;
 
-public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
+public class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
     private String packageName;
     private final String name;
     private String comment = "";
-    
+
     private GeneratedTransferObject extendsType;
     private final List<Type> implementsTypes = new ArrayList<Type>();
     private final List<EnumBuilder> enumerations = new ArrayList<EnumBuilder>();
@@ -81,7 +82,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         }
         return null;
     }
-    
+
     @Override
     public boolean addImplementsType(final Type genType) {
         if (genType != null) {
@@ -98,7 +99,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         }
         return false;
     }
-    
+
     @Override
     public EnumBuilder addEnumeration(String name) {
         final String innerPackageName = packageName + "." + this.name;
@@ -149,10 +150,20 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
 
     @Override
     public GeneratedTransferObject toInstance() {
-        return new GeneratedTransferObjectImpl(packageName, name, comment, 
-                annotationBuilders, extendsType, implementsTypes, constantDefintions, enumerations,
-                methodDefinitions, properties, equalsProperties,
-                hashProperties, toStringProperties);
+        return new GeneratedTransferObjectImpl(packageName, name, comment,
+                annotationBuilders, extendsType, implementsTypes,
+                constantDefintions, enumerations, methodDefinitions,
+                properties, equalsProperties, hashProperties,
+                toStringProperties);
+    }
+
+    @Override
+    public GeneratedTransferObject toIdentityInstance() {
+        return new GeneratedTransferIdentityObjectImpl(packageName, name, comment,
+                annotationBuilders, extendsType, implementsTypes,
+                constantDefintions, enumerations, methodDefinitions,
+                properties, equalsProperties, hashProperties,
+                toStringProperties);
     }
 
     private static final class GeneratedPropertyBuilderImpl implements
@@ -227,8 +238,9 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
 
         @Override
         public GeneratedProperty toInstance(final Type definingType) {
-            return new GeneratedPropertyImpl(name, comment, annotationBuilders, definingType,
-                    returnType, isFinal, isReadOnly, parameters, accessModifier);
+            return new GeneratedPropertyImpl(name, comment, annotationBuilders,
+                    definingType, returnType, isFinal, isReadOnly, parameters,
+                    accessModifier);
         }
     }
 
@@ -244,9 +256,10 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         private final boolean isReadOnly;
         private final List<MethodSignature.Parameter> parameters;
         private final AccessModifier modifier;
-        
+
         public GeneratedPropertyImpl(final String name, final String comment,
-                final List<AnnotationTypeBuilder> annotationBuilders, final Type parent, final Type returnType,
+                final List<AnnotationTypeBuilder> annotationBuilders,
+                final Type parent, final Type returnType,
                 final boolean isFinal, final boolean isReadOnly,
                 final List<Parameter> parameters, final AccessModifier modifier) {
             super();
@@ -284,7 +297,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         public List<AnnotationType> getAnnotations() {
             return annotations;
         }
-        
+
         @Override
         public Type getReturnType() {
             return returnType;
@@ -310,8 +323,6 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
             return isFinal;
         }
 
-        
-
         @Override
         public int hashCode() {
             final int prime = 31;
@@ -354,7 +365,8 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
                 if (other.returnType != null) {
                     return false;
                 }
-            } else if (!returnType.getPackageName().equals(other.returnType.getPackageName())) {
+            } else if (!returnType.getPackageName().equals(
+                    other.returnType.getPackageName())) {
                 return false;
             } else if (!returnType.getName().equals(other.returnType.getName())) {
                 return false;
@@ -394,7 +406,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         }
     }
 
-    private static final class GeneratedTransferObjectImpl implements
+    private static class GeneratedTransferObjectImpl implements
             GeneratedTransferObject {
 
         private final String packageName;
@@ -412,8 +424,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         private final List<Type> implementsTypes;
 
         public GeneratedTransferObjectImpl(final String packageName,
-                final String name,
-                final String comment,
+                final String name, final String comment,
                 final List<AnnotationTypeBuilder> annotationBuilders,
                 final GeneratedTransferObject extendsType,
                 final List<Type> implementsTypes,
@@ -430,7 +441,8 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
             this.comment = comment;
             this.annotations = toUnmodifiableAnnotations(annotationBuilders);
             this.extendsType = extendsType;
-            this.implementsTypes = Collections.unmodifiableList(implementsTypes);
+            this.implementsTypes = Collections
+                    .unmodifiableList(implementsTypes);
             this.constants = toUnmodifiableConstant(constantBuilders);
             this.enumerations = toUnmodifiableEnumerations(enumBuilders);
             this.properties = toUnmodifiableProperties(propBuilers);
@@ -499,17 +511,17 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         public Type getParentType() {
             return null;
         }
-        
+
         @Override
         public String getComment() {
             return comment;
         }
-        
+
         @Override
         public List<AnnotationType> getAnnotations() {
             return annotations;
         }
-        
+
         @Override
         public List<Type> getImplements() {
             return implementsTypes;
@@ -519,7 +531,7 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
         public GeneratedTransferObject getExtends() {
             return extendsType;
         }
-        
+
         @Override
         public List<Enumeration> getEnumDefintions() {
             return enumerations;
@@ -623,4 +635,26 @@ public final class GeneratedTOBuilderImpl implements GeneratedTOBuilder {
             return builder.toString();
         }
     }
+
+    private static final class GeneratedTransferIdentityObjectImpl extends
+            GeneratedTransferObjectImpl implements
+            GeneratedTransferIdentityObject {
+        public GeneratedTransferIdentityObjectImpl(final String packageName,
+                final String name, final String comment,
+                final List<AnnotationTypeBuilder> annotationBuilders,
+                final GeneratedTransferObject extendsType,
+                final List<Type> implementsTypes,
+                final List<ConstantBuilder> constantBuilders,
+                final List<EnumBuilder> enumBuilders,
+                final List<MethodSignatureBuilder> methodBuilders,
+                final List<GeneratedPropertyBuilder> propBuilers,
+                final List<GeneratedPropertyBuilder> equalsBuilers,
+                final List<GeneratedPropertyBuilder> hashCodeBuilers,
+                final List<GeneratedPropertyBuilder> stringBuilers) {
+            super(packageName, name, comment, annotationBuilders, extendsType,
+                    implementsTypes, constantBuilders, enumBuilders,
+                    methodBuilders, propBuilers, equalsBuilers,
+                    hashCodeBuilers, stringBuilers);
+        }
+    }
 }
index 0dcaa71..aaeec40 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import org.opendaylight.controller.sal.binding.model.api.CodeGenerator;
 import org.opendaylight.controller.sal.binding.model.api.Enumeration;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferIdentityObject;
 import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
 import org.opendaylight.controller.sal.binding.model.api.Type;
 
@@ -29,6 +30,8 @@ public final class ClassCodeGenerator implements CodeGenerator {
     @Override
     public Writer generate(Type type) throws IOException {
         final Writer writer = new StringWriter();
+        boolean isIdentity = type instanceof GeneratedTransferIdentityObject;
+
         if (type instanceof GeneratedTransferObject) {
             GeneratedTransferObject genTO = (GeneratedTransferObject) type;            
             imports = GeneratorUtil.createImports(genTO);
@@ -47,7 +50,7 @@ public final class ClassCodeGenerator implements CodeGenerator {
             writer.write(NL);
 
             writer.write(GeneratorUtil.createClassDeclaration(genTO, "",
-                    imports));
+                    imports, isIdentity));
             writer.write(NL);
             writer.write(NL);
             
@@ -66,7 +69,7 @@ public final class ClassCodeGenerator implements CodeGenerator {
                 }
                 writer.write(NL);
                 writer.write(GeneratorUtil.createConstructor(genTO, TAB,
-                        imports) + NL);
+                        imports, isIdentity) + NL);
                 writer.write(NL);
                 for (GeneratedProperty field : fields) {
                     writer.write(GeneratorUtil.createGetter(field, TAB,
index bd94c20..e5cb97f 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.sal.java.api.generator;
 
 final class Constants {
-
     public static final String IFC = "interface";
     public static final String CLASS = "class";
     public static final String PKG = "package";
@@ -24,11 +23,13 @@ final class Constants {
     public static final String COMMA = ",";
     public static final String NL = "\n";
     public static final String SC = ";";
-    public static final String TAB = "\t";
+    public static final String TAB = "    ";
 
     public static final String PUBLIC = "public";
     public static final String PRIVATE = "private";
+    public static final String PROTECTED = "protected";
     public static final String STATIC = "static";
+    public static final String ABSTRACT = "abstract";
     public static final String FINAL = "final";
     public static final String EXTENDS = "extends";
     public static final String IMPLEMENTS = "implements";
index bb4bbba..5b3b17d 100644 (file)
@@ -26,670 +26,692 @@ import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
 import org.opendaylight.controller.sal.binding.model.api.MethodSignature.Parameter;
 import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;
 import org.opendaylight.controller.sal.binding.model.api.Type;
+import org.opendaylight.controller.sal.binding.model.api.WildcardType;
 
 public final class GeneratorUtil {
 
-       private GeneratorUtil() {
-       }
-
-       public static String createIfcDeclaration(final GeneratedType genType,
-                       final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports) {
-               return createFileDeclaration(IFC, genType, indent, availableImports);
-       }
-
-       public static String createClassDeclaration(
-                       final GeneratedTransferObject genTransferObject,
-                       final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports) {
-               return createFileDeclaration(CLASS, genTransferObject, indent,
-                               availableImports);
-       }
-
-       public static String createPackageDeclaration(final String packageName) {
-               return PKG + GAP + packageName + SC;
-       }
-
-       private static String createFileDeclaration(final String type,
-                       final GeneratedType genType, final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports) {
-               final StringBuilder builder = new StringBuilder();
-               final String currentPkg = genType.getPackageName();
-
-               createComment(builder, genType.getComment(), indent);
-
-               if (!genType.getAnnotations().isEmpty()) {
-                       final List<AnnotationType> annotations = genType.getAnnotations();
-                       appendAnnotations(builder, annotations);
-                       builder.append(NL);
-               }
-               builder.append(PUBLIC + GAP + type + GAP + genType.getName() + GAP);
-
-               if (genType instanceof GeneratedTransferObject) {
-                       GeneratedTransferObject genTO = (GeneratedTransferObject) genType;
-
-                       if (genTO.getExtends() != null) {
-                               builder.append(EXTENDS + GAP);
-                               builder.append(genTO.getExtends() + GAP);
-                       }
-               }
-
-               final List<Type> genImplements = genType.getImplements();
-               if (!genImplements.isEmpty()) {
-                       if (genType instanceof GeneratedTransferObject) {
-                               builder.append(IMPLEMENTS + GAP);
-                       } else {
-                               builder.append(EXTENDS + GAP);
-                       }
-                       builder.append(getExplicitType(genImplements.get(0),
-                                       availableImports, currentPkg));
-
-                       for (int i = 1; i < genImplements.size(); ++i) {
-                               builder.append(", ");
-                               builder.append(getExplicitType(genImplements.get(i),
-                                               availableImports, currentPkg));
-                       }
-               }
-
-               builder.append(GAP + LCB);
-               return builder.toString();
-       }
-
-       private static StringBuilder appendAnnotations(final StringBuilder builder,
-                       final List<AnnotationType> annotations) {
-               if ((builder != null) && (annotations != null)) {
-                       for (final AnnotationType annotation : annotations) {
-                               builder.append("@");
-                               builder.append(annotation.getPackageName());
-                               builder.append(".");
-                               builder.append(annotation.getName());
-
-                               if (annotation.containsParameters()) {
-                                       builder.append("(");
-                                       final List<AnnotationType.Parameter> parameters = annotation
-                                                       .getParameters();
-                                       appendAnnotationParams(builder, parameters);
-                                       builder.append(")");
-                               }
-                       }
-               }
-               return builder;
-       }
-
-       private static StringBuilder appendAnnotationParams(
-                       final StringBuilder builder,
-                       final List<AnnotationType.Parameter> parameters) {
-               if (parameters != null) {
-                       int i = 0;
-                       for (final AnnotationType.Parameter param : parameters) {
-                               if (param == null) {
-                                       continue;
-                               }
-                               if (i > 0) {
-                                       builder.append(", ");
-                               }
-                               final String paramName = param.getName();
-                               if (param.getValue() != null) {
-                                       builder.append(paramName);
-                                       builder.append(" = ");
-                                       builder.append(param.getValue());
-                               } else {
-                                       builder.append(paramName);
-                                       builder.append(" = {");
-                                       final List<String> values = param.getValues();
-                                       builder.append(values.get(0));
-                                       for (int j = 1; j < values.size(); ++j) {
-                                               builder.append(", ");
-                                               builder.append(values.get(j));
-                                       }
-                                       builder.append("}");
-                               }
-                               i++;
-                       }
-               }
-               return builder;
-       }
-
-       public static String createConstant(final Constant constant,
-                       final String indent,
-                       final Map<String, LinkedHashMap<String, Integer>> availableImports,
-                       final String&nb