← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13545: add integration category to fred tests, run with new maven profile integration (mvn -Pintegration)

 

------------------------------------------------------------
revno: 13545
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-01-02 15:56:19 +0100
message:
  add integration category to fred tests, run with new maven profile integration (mvn -Pintegration)
added:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/IntegrationTest.java
modified:
  dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java
  dhis-2/pom.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/IntegrationTest.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/IntegrationTest.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/IntegrationTest.java	2014-01-02 14:56:19 +0000
@@ -0,0 +1,36 @@
+package org.hisp.dhis;
+
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public interface IntegrationTest
+{
+}

=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java	2013-11-12 09:04:21 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/controller/FacilityControllerTest.java	2014-01-02 14:56:19 +0000
@@ -29,13 +29,14 @@
  */
 
 import org.hamcrest.Matchers;
+import org.hisp.dhis.IntegrationTest;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.web.FredSpringWebTest;
 import org.hisp.dhis.web.webapi.v1.domain.Facility;
 import org.hisp.dhis.web.webapi.v1.utils.OrganisationUnitToFacilityConverter;
-import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
@@ -47,7 +48,7 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-@Ignore
+@Category( IntegrationTest.class )
 public class FacilityControllerTest extends FredSpringWebTest
 {
     @Autowired

=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml	2013-12-22 13:36:18 +0000
+++ dhis-2/pom.xml	2014-01-02 14:56:19 +0000
@@ -10,6 +10,10 @@
   <name>DHIS 2</name>
   <url>http://dhis2.org</url>
 
+  <prerequisites>
+    <maven>2.2.1</maven>
+  </prerequisites>
+
   <description>
     The District Health Information System deals with registering,
     aggregating and reporting statistical health data. The goal is to allow users to analyze
@@ -137,6 +141,57 @@
     </plugins>
   </reporting>
 
+
+  <profiles>
+    <profile>
+      <id>default</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <version>2.16</version>
+            <configuration>
+              <systemProperties>
+                <property>
+                  <name>org.hisp.dhis.test</name>
+                  <value>true</value>
+                </property>
+              </systemProperties>
+              <argLine>-Xmx256m</argLine>
+              <excludedGroups>org.hisp.dhis.IntegrationTest</excludedGroups>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>integration</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <version>2.16</version>
+            <configuration>
+              <systemProperties>
+                <property>
+                  <name>org.hisp.dhis.test</name>
+                  <value>true</value>
+                </property>
+              </systemProperties>
+              <argLine>-Xmx256m</argLine>
+              <groups>org.hisp.dhis.IntegrationTest</groups>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
   <build>
     <pluginManagement>
       <plugins>
@@ -154,21 +209,6 @@
 
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.12</version>
-          <configuration>
-            <systemProperties>
-              <property>
-                <name>org.hisp.dhis.test</name>
-                <value>true</value>
-              </property>
-            </systemProperties>
-            <argLine>-Xmx256m</argLine>
-          </configuration>
-        </plugin>
-
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-resources-plugin</artifactId>
           <version>2.5</version>
           <configuration>
@@ -219,7 +259,7 @@
           <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
           <artifactId>maven-java-formatter-plugin</artifactId>
           <version>0.3.1</version>
-            <configuration>
+          <configuration>
             <configFile>${rootDir}DHISFormatter.xml</configFile>
             <lineEnding>LF</lineEnding>
           </configuration>
@@ -286,7 +326,7 @@
         <artifactId>dhis-service-patient</artifactId>
         <version>${project.version}</version>
       </dependency>
-	  <dependency>
+      <dependency>
         <groupId>org.hisp.dhis</groupId>
         <artifactId>dhis-service-eventreporting</artifactId>
         <version>${project.version}</version>
@@ -635,7 +675,7 @@
         <artifactId>javacsv</artifactId>
         <version>2.0</version>
       </dependency>
-            
+
       <!--DBMS -->
       <dependency>
         <groupId>com.h2database</groupId>
@@ -929,9 +969,9 @@
       </dependency>
 
       <dependency>
-      	<groupId>com.google.guava</groupId>
-      	<artifactId>guava</artifactId>
-      	<version>14.0.1</version>
+        <groupId>com.google.guava</groupId>
+        <artifactId>guava</artifactId>
+        <version>14.0.1</version>
       </dependency>
 
     </dependencies>