onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1435873 - in /incubator/onami/trunk/spi: pom.xml src/test/java/org/apache/onami/spi/FromSystemPropertiesTestCase.java
Date Sun, 20 Jan 2013 16:19:56 GMT
Author: simonetripodi
Date: Sun Jan 20 16:19:56 2013
New Revision: 1435873

URL: http://svn.apache.org/viewvc?rev=1435873&view=rev
Log:
Move test initialization from pom to code, in order to successfully run unit tests from IDE
and CLI, and it will clearly indicate to the code reader the preconditions and the aim of
the test - patch submitted by Eric Charles

Modified:
    incubator/onami/trunk/spi/pom.xml
    incubator/onami/trunk/spi/src/test/java/org/apache/onami/spi/FromSystemPropertiesTestCase.java

Modified: incubator/onami/trunk/spi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/spi/pom.xml?rev=1435873&r1=1435872&r2=1435873&view=diff
==============================================================================
--- incubator/onami/trunk/spi/pom.xml (original)
+++ incubator/onami/trunk/spi/pom.xml Sun Jan 20 16:19:56 2013
@@ -83,19 +83,6 @@
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <version>${surefire.version}</version>
-        <configuration>
-          <systemProperties>
-            <property>
-              <name>org.apache.onami.spi.FooService</name>
-              <value>org.apache.onami.spi.FooServiceImpl1,org.apache.onami.spi.FooServiceImpl2</value>
-            </property>
-          </systemProperties>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-site-plugin</artifactId>
         <configuration>
           <locales>en</locales>

Modified: incubator/onami/trunk/spi/src/test/java/org/apache/onami/spi/FromSystemPropertiesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/spi/src/test/java/org/apache/onami/spi/FromSystemPropertiesTestCase.java?rev=1435873&r1=1435872&r2=1435873&view=diff
==============================================================================
--- incubator/onami/trunk/spi/src/test/java/org/apache/onami/spi/FromSystemPropertiesTestCase.java
(original)
+++ incubator/onami/trunk/spi/src/test/java/org/apache/onami/spi/FromSystemPropertiesTestCase.java
Sun Jan 20 16:19:56 2013
@@ -32,6 +32,12 @@ public final class FromSystemPropertiesT
     @Before
     public void setUp()
     {
+        // This simulates the SPI specification via Java System Properties,
+        // equivalent to java -Dorg.apache.onami.spi.FooService=org.apac...
+        System.setProperty( "org.apache.onami.spi.FooService",
+                            "org.apache.onami.spi.FooServiceImpl1," +
+                            "org.apache.onami.spi.FooServiceImpl2");
+
         createInjector( new ServiceLoaderModule()
         {
 



Mime
View raw message