Merge "BUG-579: Remove ImmutableMap in favor of LinkedHashMap"
authorTony Tkacik <ttkacik@cisco.com>
Tue, 8 Apr 2014 16:11:26 +0000 (16:11 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 8 Apr 2014 16:11:26 +0000 (16:11 +0000)
opendaylight/config/config-module-archetype/README.txt [new file with mode: 0644]
opendaylight/config/config-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml
opendaylight/distribution/opendaylight/src/assemble/bin.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingBrokerTestFactory.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug02Test.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java

diff --git a/opendaylight/config/config-module-archetype/README.txt b/opendaylight/config/config-module-archetype/README.txt
new file mode 100644 (file)
index 0000000..8b1f29b
--- /dev/null
@@ -0,0 +1,12 @@
+Use
+GROUP_ID=com.mycompany.app
+ARTIFACT_ID=my-app
+mvn archetype:generate -DgroupId=$GROUP_ID -DartifactId=$ARTIFACT_ID \
+ -DarchetypeArtifactId=config-module-archetype -DarchetypeGroupId=org.opendaylight.controller  \
+ -DarchetypeVersion=0.2.5-SNAPSHOT
+
+Module name and prefix define yang module name and its java name prefix.
+For example when creating thread factory wrapper, yang name might be
+thread-factory
+and java prefix
+ThreadFactory
\ No newline at end of file
index fc30b4d..f7b8729 100644 (file)
@@ -15,7 +15,7 @@
             <defaultValue>2013-04-05</defaultValue>
         </requiredProperty>
         <requiredProperty key="config-api-version">
-            <defaultValue>0.2.4-SNAPSHOT</defaultValue>
+            <defaultValue>0.2.5-SNAPSHOT</defaultValue>
         </requiredProperty>
         <requiredProperty key="yang-maven-plugin-version">
             <defaultValue>0.6.2-SNAPSHOT</defaultValue>
index d1c371d..21b1a55 100644 (file)
@@ -9,8 +9,13 @@
 
     <properties>
         <jmxGeneratorPath>${project.build.directory}/generated-sources/config</jmxGeneratorPath>
+        <salGeneratorPath>${project.build.directory}/generated-sources/sal</salGeneratorPath>
         <config.version>${config-api-version}</config.version>
+        <yangtools.version>${yang-maven-plugin-version}</yangtools.version>
         <maven.bundle.version>${maven-bundle-plugin-version}</maven.bundle.version>
+        <java.version.source>1.7</java.version.source>
+        <java.version.target>1.7</java.version.target>
+        <maven.compile.plugin.version>2.5.1</maven.compile.plugin.version>
     </properties>
 
     <dependencies>
@@ -26,7 +31,7 @@
             <plugin>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>${yang-maven-plugin-version}</version>
+                <version>${yangtools.version}</version>
                 <executions>
                     <execution>
                         <id>config</id>
                                         </namespaceToPackage1>
                                     </additionalConfiguration>
                                 </generator>
+                                <generator>
+                                    <codeGeneratorClass>
+                                        org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
+                                    </codeGeneratorClass>
+                                    <outputBaseDir>
+                                        ${salGeneratorPath}
+                                    </outputBaseDir>
+                                </generator>
                             </codeGenerators>
                             <inspectDependencies>true</inspectDependencies>
                         </configuration>
                         <artifactId>yang-jmx-generator-plugin</artifactId>
                         <version>${config.version}</version>
                     </dependency>
+                    <dependency>
+                        <groupId>org.opendaylight.yangtools</groupId>
+                        <artifactId>maven-sal-api-gen-plugin</artifactId>
+                        <version>${yangtools.version}</version>
+                    </dependency>
                 </dependencies>
             </plugin>
 
                 <configuration>
                     <instructions>
                         <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                        <Export-Package>
-                            ${yang-namespace-mapping-to}.${module-name},
-                        </Export-Package>
-                        <Import-Package>
-                            *
-                        </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>
 
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven.compile.plugin.version}</version>
+                <configuration>
+                    <source>${java.version.source}</source>
+                    <target>${java.version.target}</target>
+                    <testSource>${java.version.source}</testSource>
+                    <testTarget>${java.version.target}</testTarget>
+                </configuration>
+            </plugin>
 
         </plugins>
     </build>
index 6f8878b..0ff4c9a 100644 (file)
@@ -69,6 +69,7 @@
       </directory>
       <excludes>
         <exclude>version.properties</exclude>
+        <exclude>configuration/config.ini</exclude>
       </excludes>
       <outputDirectory>
         opendaylight/
       <outputDirectory>opendaylight</outputDirectory>
       <filtered>true</filtered>
     </file>
+      <file>
+        <source>src/main/resources/configuration/config.ini</source>
+        <outputDirectory>opendaylight/configuration</outputDirectory>
+        <filtered>true</filtered>
+      </file>
   </files>
 </assembly>
index e91a13b..9df653c 100644 (file)
@@ -8,7 +8,7 @@ osgi.bundles=\
     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.2-SNAPSHOT@1:start,\
+    reference\:file\:../lib/logging.bridge-${controller.version}@1:start,\
     reference\:file\:../lib/jersey-core-1.17.jar@2:start,\
     reference\:file\:../lib/jersey-server-1.17.jar@2:start
 
index e5b57e3..08c5d06 100644 (file)
@@ -17,7 +17,7 @@ import com.google.common.util.concurrent.MoreExecutors;
 
 public class BindingBrokerTestFactory {
 
-    private static final ClassPool CLASS_POOL = new ClassPool();
+    private static final ClassPool CLASS_POOL = ClassPool.getDefault();
     private boolean startWithParsedSchema = true;
     private ExecutorService executor;
     private ClassPool classPool;
@@ -27,7 +27,7 @@ public class BindingBrokerTestFactory {
         return startWithParsedSchema;
     }
 
-    public void setStartWithParsedSchema(boolean startWithParsedSchema) {
+    public void setStartWithParsedSchema(final boolean startWithParsedSchema) {
         this.startWithParsedSchema = startWithParsedSchema;
     }
 
@@ -35,7 +35,7 @@ public class BindingBrokerTestFactory {
         return executor;
     }
 
-    public void setExecutor(ExecutorService executor) {
+    public void setExecutor(final ExecutorService executor) {
         this.executor = executor;
     }
 
@@ -54,7 +54,7 @@ public class BindingBrokerTestFactory {
         return classPool;
     }
 
-    public void setClassPool(ClassPool classPool) {
+    public void setClassPool(final ClassPool classPool) {
         this.classPool = classPool;
     }
 
index 6784c0c..bc6f567 100644 (file)
@@ -17,8 +17,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 
-import javassist.ClassPool;
-
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
@@ -77,7 +75,6 @@ public class DOMCodecBug02Test extends AbstractDataServiceTest {
         ListeningExecutorService executor = MoreExecutors.sameThreadExecutor();
         BindingBrokerTestFactory factory = new BindingBrokerTestFactory();
         factory.setExecutor(executor);
-        factory.setClassPool(new ClassPool());
         factory.setStartWithParsedSchema(getStartWithSchema());
         testContext = factory.getTestContext();
         testContext.start();
index 2e3100f..6b12a19 100644 (file)
@@ -8,8 +8,6 @@
 
 package org.opendaylight.controller.netconf.util.mapping;
 
-import java.util.Map;
-
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperation;
@@ -22,6 +20,8 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
+import java.util.Map;
+
 public abstract class AbstractNetconfOperation implements NetconfOperation {
     private final String netconfSessionIdForReporting;
 
@@ -118,8 +118,12 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
 
     @Override
     public String toString() {
-        final StringBuffer sb = new StringBuffer("AbstractConfigNetconfOperation{");
-        sb.append("name=").append(getOperationName());
+        final StringBuffer sb = new StringBuffer(getClass().getName());
+        try {
+            sb.append("{name=").append(getOperationName());
+        } catch(UnsupportedOperationException e) {
+            // no problem
+        }
         sb.append(", namespace=").append(getOperationNamespace());
         sb.append(", session=").append(netconfSessionIdForReporting);
         sb.append('}');

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.