Bug 1043: Create "integrationtests" build profile. 36/7236/1
authorShigeru Yasuda <s-yasuda@da.jp.nec.com>
Tue, 20 May 2014 10:37:29 +0000 (19:37 +0900)
committerShigeru Yasuda <s-yasuda@da.jp.nec.com>
Tue, 20 May 2014 10:37:29 +0000 (19:37 +0900)
Tests which take long time will be skipped unless "integrationtests"
profile is active.

Change-Id: I353c8a695fcc8145ad9cbaaf6a5c4c9422759ce0
Signed-off-by: Shigeru Yasuda <s-yasuda@da.jp.nec.com>
16 files changed:
common/pom.xml
coordinator/dist/pom.xml
manager/common/pom.xml
manager/dist/pom.xml
manager/implementation/pom.xml
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/ArpHandlerTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/ClusterFlowTaskTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/FlowTaskTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/LocalFlowTaskTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/MacAddressTableTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/SlowTest.java [new file with mode: 0644]
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/VTNManagerImplClusterTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/VTNManagerImplTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/VTNManagerImplWithNodesTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/cluster/FlowModResultEventTest.java
manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/cluster/VTNFlowTest.java

index e9b2ec76a4a9637419d54b332047358988e10e92..e4ce9b4fc42c53f7a99c085388008edf61cda795 100644 (file)
     </dependency>
   </dependencies>
 
+  <profiles>
+    <profile>
+      <id>viewbuild</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <properties>
+        <build.suffix>${project.version}</build.suffix>
+        <vtn.build.id />
+      </properties>
+    </profile>
+    <profile>
+      <id>jenkins</id>
+      <activation>
+        <property>
+          <name>BUILDSUFFIX</name>
+        </property>
+      </activation>
+      <properties>
+        <build.suffix>${BUILDSUFFIX}</build.suffix>
+        <vtn.build.id>${BUILDSUFFIX}</vtn.build.id>
+      </properties>
+    </profile>
+  </profiles>
+
 </project>
index 63719332c1874c0784842bb9dbbff12f74e999b8..39ed0ffdf42e7811c1a1e741f7f10c65f0a533f4 100644 (file)
 
   <profiles>
     <profile>
-      <id>viewbuild</id>
+      <id>integrationtests</id>
       <activation>
-        <activeByDefault>true</activeByDefault>
+        <activeByDefault>false</activeByDefault>
       </activation>
+      <!-- Run all tests. -->
       <properties>
-        <build.suffix>${project.version}</build.suffix>
-        <vtn.build.id />
-      </properties>
-    </profile>
-    <profile>
-      <id>jenkins</id>
-      <activation>
-        <property>
-          <name>BUILDSUFFIX</name>
-        </property>
-      </activation>
-      <properties>
-        <build.suffix>${BUILDSUFFIX}</build.suffix>
-        <vtn.build.id>${BUILDSUFFIX}</vtn.build.id>
+        <maven.test.skip>false</maven.test.skip>
       </properties>
     </profile>
   </profiles>
@@ -61,9 +49,9 @@
     <execplugin.version>1.1.1</execplugin.version>
     <buildhelper.version>1.8</buildhelper.version>
 
-    <!-- Run tests by default. -->
+    <!-- Skip tests entirely unless integrationtests profile is active. -->
     <skipTests>false</skipTests>
-    <maven.test.skip>false</maven.test.skip>
+    <maven.test.skip>true</maven.test.skip>
 
     <vtn.java.libdir>${basedir}/target/java</vtn.java.libdir>
     <vtn.gson.version>2.2.2</vtn.gson.version>
index b607550b3839ab6ddc0d43b3dec2ea2bcb72490a..d7789bd696e4e85118c517c80a7cd5f2a7857cb6 100644 (file)
     <javadoc.exclude>*.internal</javadoc.exclude>
   </properties>
 
-  <profiles>
-    <profile>
-      <id>viewbuild</id>
-      <activation>
-        <activeByDefault>true</activeByDefault>
-      </activation>
-      <properties>
-        <build.suffix>${project.version}</build.suffix>
-      </properties>
-    </profile>
-
-    <profile>
-      <id>jenkins</id>
-      <activation>
-        <property>
-          <name>BUILDSUFFIX</name>
-        </property>
-      </activation>
-      <properties>
-        <build.suffix>${BUILDSUFFIX}</build.suffix>
-      </properties>
-    </profile>
-
-    <profile>
-      <id>fastreassembly</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-dependency-plugin</artifactId>
-            <version>${maven-dependency.version}</version>
-            <executions>
-              <execution>
-                <id>copyfastreassembly</id>
-                <phase>install</phase>
-                <goals>
-                  <goal>copy</goal>
-                </goals>
-                <configuration>
-                  <artifactItems>
-                    <artifactItem>
-                      <groupId>${project.groupId}</groupId>
-                      <artifactId>${project.artifactId}</artifactId>
-                      <version>${project.version}</version>
-                      <destFileName>${project.groupId}.${project.artifactId}-${project.version}.jar</destFileName>
-                    </artifactItem>
-                  </artifactItems>
-                  <outputDirectory>${fastreassembly.directory}</outputDirectory>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
   <repositories>
     <!-- OpenDayLight repository mirror -->
     <repository>
index adb590d883fd6adfa0ae68d0e99690aff843a2af..ff29249dad1b4542e02295994e283bb9adeed6be 100644 (file)
     <module>../neutron</module>
     <module>../northbound</module>
 
-    <!-- Tests -->
-    <module>../integrationtest</module>
-    <module>../northboundIT</module>
-
     <!-- Parents -->
     <module>../checkstyle</module>
     <module>../common</module>
-    <module>../common.it</module>
     <module>../../common</module>
   </modules>
 
       </plugin>
     </plugins>
   </build>
+
+  <profiles>
+    <profile>
+      <id>integrationtests</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <modules>
+        <!-- Run integration tests if integrationtests profile is active. -->
+        <module>../integrationtest</module>
+        <module>../northboundIT</module>
+        <module>../common.it</module>
+      </modules>
+    </profile>
+  </profiles>
 </project>
index a83c7e012c6e91aa48eccb54784fb7ba8b8be32f..b154c812b5b67e2c03fadc13bcbc115e75b1b9ad 100644 (file)
@@ -2,7 +2,7 @@
 
 <!--
 #
-# Copyright (c) 2013 NEC Corporation
+# Copyright (c) 2013-2014 NEC Corporation
 # All rights reserved.
 #
 # This program and the accompanying materials are made available under the
     <sonar.jacoco.Reportpath>target/jacoco.exec</sonar.jacoco.Reportpath>
     <sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath>
     <sonar.language>java</sonar.language>
+
+    <!-- Skip slow tests unless integrationtests profile is active. -->
+    <vtn.test.slowtest>
+      org.opendaylight.vtn.manager.internal.SlowTest
+    </vtn.test.slowtest>
   </properties>
 
+  <profiles>
+    <profile>
+      <id>integrationtests</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <properties>
+        <!-- Run all tests. -->
+        <vtn.test.slowtest />
+      </properties>
+    </profile>
+  </profiles>
+
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <argLine>${testvm.argLine}</argLine>
+          <excludedGroups>${vtn.test.slowtest}</excludedGroups>
+        </configuration>
+      </plugin>
+
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
index 2cd8e6cb5eeb4d0e1459034b7a15381a3c027310..1e8c008b090628967d06e263f6807903a44fc8f7 100644 (file)
@@ -18,6 +18,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
 import org.opendaylight.controller.sal.core.ConstructionException;
@@ -42,6 +43,7 @@ import org.opendaylight.vtn.manager.VBridgePath;
 /**
  * JUnit test for {@link ArpHandler}
  */
+@Category(SlowTest.class)
 public class ArpHandlerTest extends VTNManagerImplTestCommon {
 
     /**
index fa5d88fd8a914d2f3c968454c2d3a68d3c5a7e64..3258d5cc8021a0d5e72c2839442ebb61a402e741 100644 (file)
@@ -1,11 +1,12 @@
 /*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
  * All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this
  * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
  */
+
 package org.opendaylight.vtn.manager.internal;
 
 import java.util.Set;
@@ -15,6 +16,8 @@ import java.util.TimerTask;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
@@ -29,6 +32,7 @@ import org.opendaylight.vtn.manager.internal.cluster.VTNFlow;
 /**
  * test for {@link ClusterFlowAddTask} and {@link ClusterFlowRemoveTask}.
  */
+@Category(SlowTest.class)
 public class ClusterFlowTaskTest extends FlowModTaskTestBase {
 
     @Before
index 5fa164679a518f134b2b223821fc61d90f8d21af..d751843e6053450fbdb44dd80d57f3c1a2e29439 100644 (file)
@@ -1,11 +1,12 @@
 /*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
  * All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this
  * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
  */
+
 package org.opendaylight.vtn.manager.internal;
 
 import java.util.ArrayList;
@@ -21,6 +22,8 @@ import org.apache.felix.dm.impl.ComponentImpl;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
@@ -37,6 +40,7 @@ import org.opendaylight.vtn.manager.internal.cluster.VTNFlow;
 /**
  * test for {@link FlowAddTask} and {@link FlowRemoveTask}.
  */
+@Category(SlowTest.class)
 public class FlowTaskTest extends FlowModTaskTestBase {
 
     @Before
index 332479185b34e40f9edc12b0379f0a2d4f61e8f4..cf4a7b0452a5e68d6101ff9e0dd5bce3a529fc4e 100644 (file)
@@ -1,11 +1,12 @@
 /*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
  * All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this
  * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
  */
+
 package org.opendaylight.vtn.manager.internal;
 
 import java.util.Set;
@@ -15,6 +16,8 @@ import java.util.TimerTask;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
@@ -29,6 +32,7 @@ import org.opendaylight.vtn.manager.internal.cluster.VTNFlow;
 /**
  * JUnit test for {@link LocalFlowAddTask} and {@link LocalFlowRemoveTask}.
  */
+@Category(SlowTest.class)
 public class LocalFlowTaskTest extends FlowModTaskTestBase {
 
     @Before
index fb7070681ee92ebb2a786cd71cc669f376f870b9..22717f3729287c34c96310e8143b1581e6e6f479 100644 (file)
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentMap;
 import org.apache.felix.dm.impl.ComponentImpl;
 
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Node;
@@ -43,6 +44,7 @@ import org.opendaylight.vtn.manager.internal.cluster.VlanMapPath;
 /**
  * JUnit test for {@link MacAddressTable}.
  */
+@Category(SlowTest.class)
 public class MacAddressTableTest extends TestUseVTNManagerBase {
 
     // The Test class which implemented DataLinkAddress class.
diff --git a/manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/SlowTest.java b/manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/SlowTest.java
new file mode 100644 (file)
index 0000000..fc8571b
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2014 NEC Corporation
+ * All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this
+ * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.vtn.manager.internal;
+
+/**
+ * An interface which indicates slow tests.
+ *
+ * <p>
+ *   This interface is used to categorize JUnit tests which takes long time.
+ * </p>
+ */
+public interface SlowTest {
+}
index bb59522e59bdb3f3a9d1e82e5f6419ff442f5184..c3d25dbb835478625ceaa6747c31aad435961ea8 100644 (file)
@@ -27,6 +27,7 @@ import org.apache.felix.dm.impl.ComponentImpl;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
 import org.opendaylight.controller.sal.connection.ConnectionLocality;
@@ -102,6 +103,7 @@ import org.opendaylight.vtn.manager.internal.cluster.VlanMapEvent;
  * on the environment some nodes exist in cluster mode.
  * </p>
  */
+@Category(SlowTest.class)
 public class VTNManagerImplClusterTest extends VTNManagerImplTestCommon {
     /**
      * Construct a new instance.
index ebeebf5127c4dd64dcb1f5f182df6737a77a3a87..6cb246bf06edab59c2d7954f9b75676eede5ffcf 100644 (file)
@@ -32,6 +32,7 @@ import org.apache.felix.dm.Component;
 import org.apache.felix.dm.impl.ComponentImpl;
 
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.opendaylight.vtn.manager.IVTNManagerAware;
 import org.opendaylight.vtn.manager.IVTNModeListener;
@@ -107,6 +108,7 @@ import org.opendaylight.controller.topologymanager.ITopologyManager;
  * {@link VlanMapImpl} are also implemented in this class.
  * </p>
  */
+@Category(SlowTest.class)
 public class VTNManagerImplTest extends VTNManagerImplTestCommon {
     /**
      * Construct a new instance.
index 228c3088b97590f61fbfb013bd6ff26480b16726..e57f1d873be14d00e6a0d4d0768459521803b907 100644 (file)
@@ -27,6 +27,7 @@ import org.apache.felix.dm.Component;
 import org.apache.felix.dm.impl.ComponentImpl;
 
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
@@ -91,6 +92,7 @@ import org.opendaylight.vtn.manager.internal.cluster.VlanMapImpl;
  * {@link VlanMapImpl} are also implemented in this class.
  * </p>
  */
+@Category(SlowTest.class)
 public class VTNManagerImplWithNodesTest extends VTNManagerImplTestCommon {
     /**
      * Construct a new instance.
index 0f08825e6994f08df065b1e8efadbfdb8d122e75..be9c11d9575b4f7629a5d0caa741e48878502fda 100644 (file)
@@ -1,11 +1,12 @@
 /*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
  * All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this
  * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
  */
+
 package org.opendaylight.vtn.manager.internal.cluster;
 
 import java.util.Hashtable;
@@ -16,6 +17,7 @@ import java.util.TimerTask;
 
 import org.apache.felix.dm.impl.ComponentImpl;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
@@ -33,9 +35,12 @@ import org.opendaylight.vtn.manager.internal.TestStubCluster;
 import org.opendaylight.vtn.manager.internal.VTNFlowDatabase;
 import org.opendaylight.vtn.manager.internal.VTNManagerImpl;
 
+import org.opendaylight.vtn.manager.internal.SlowTest;
+
 /**
  * JUnit test for {@link FlowModResultEvent}.
  */
+@Category(SlowTest.class)
 public class FlowModResultEventTest extends FlowModTaskTestBase {
 
     /**
index 7682c41a003f74508f1360dc69b20cc2390c39ac..19eef47069fcef5b4aab2d5b65b76ad111e836c8 100644 (file)
@@ -17,6 +17,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.opendaylight.vtn.manager.VBridgeIfPath;
 import org.opendaylight.vtn.manager.VBridgePath;
@@ -25,6 +26,8 @@ import org.opendaylight.vtn.manager.internal.ActionList;
 import org.opendaylight.vtn.manager.internal.FlowModTaskTestBase;
 import org.opendaylight.vtn.manager.internal.L2Host;
 
+import org.opendaylight.vtn.manager.internal.SlowTest;
+
 import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
 import org.opendaylight.controller.sal.action.Action;
 import org.opendaylight.controller.sal.action.SetDlDst;
@@ -44,6 +47,7 @@ import org.opendaylight.controller.sal.utils.NodeCreator;
 /**
  * JUnit Test for {@link VTNFlow}
  */
+@Category(SlowTest.class)
 public class VTNFlowTest extends FlowModTaskTestBase {
     /**
      * Test case for getter methods.