incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1161562 - in /sling/trunk/testing/samples: integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/sling/ sa...
Date Thu, 25 Aug 2011 13:32:00 GMT
Author: bdelacretaz
Date: Thu Aug 25 13:32:00 2011
New Revision: 1161562

URL: http://svn.apache.org/viewvc?rev=1161562&view=rev
Log:
ParametrizedJunit4Test added to verify that those work server-side

Added:
    sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/ParametrizedJunit4Test.java
  (with props)
Modified:
    sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java
    sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/sling/SlingServerSideTest.java

Modified: sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java?rev=1161562&r1=1161561&r2=1161562&view=diff
==============================================================================
--- sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java
(original)
+++ sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java
Thu Aug 25 13:32:00 2011
@@ -32,7 +32,7 @@ public class ServerSideSampleTest extend
 implements SlingRemoteTestParameters, SlingTestsCountChecker, RequestCustomizer {
     
     public static final String TEST_SELECTOR = "org.apache.sling.testing.samples.sampletests";
-    public static final int TESTS_AT_THIS_PATH = 5;
+    public static final int TESTS_AT_THIS_PATH = 8;
     private int customizeCalled;
     
     public void checkNumberOfTests(int numberOfTestsExecuted) {

Modified: sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/sling/SlingServerSideTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/sling/SlingServerSideTest.java?rev=1161562&r1=1161561&r2=1161562&view=diff
==============================================================================
--- sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/sling/SlingServerSideTest.java
(original)
+++ sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/sling/SlingServerSideTest.java
Thu Aug 25 13:32:00 2011
@@ -29,7 +29,7 @@ public class SlingServerSideTest extends
 implements SlingRemoteTestParameters, SlingTestsCountChecker {
     
     public static final String TEST_SELECTOR = "org.apache.sling.testing.samples.sampletests";
-    public static final int TESTS_AT_THIS_PATH = 5;
+    public static final int TESTS_AT_THIS_PATH = 8;
     
     public void checkNumberOfTests(int numberOfTestsExecuted) {
         assertEquals(TESTS_AT_THIS_PATH, numberOfTestsExecuted);

Added: sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/ParametrizedJunit4Test.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/ParametrizedJunit4Test.java?rev=1161562&view=auto
==============================================================================
--- sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/ParametrizedJunit4Test.java
(added)
+++ sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/ParametrizedJunit4Test.java
Thu Aug 25 13:32:00 2011
@@ -0,0 +1,49 @@
+package org.apache.sling.testing.samples.sampletests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+@RunWith(Parameterized.class)
+public class ParametrizedJunit4Test {
+    private static String buffer;
+    
+    private static final int [] TEST_DATA = { 1,2,3 };
+    
+    public ParametrizedJunit4Test(Integer value) {
+        buffer += value;
+    }
+
+    @BeforeClass
+    public static void clear() {
+        buffer = "";
+    }
+    
+    @AfterClass
+    public static void checkResult() {
+        assertEquals("123", buffer);
+    }
+    
+    @Test
+    public void testSequence() {
+        assertTrue(buffer.length() > 0);
+    }
+    
+    @Parameters
+    public static Collection<Object[]> data() {
+        final Collection<Object[]> data = new ArrayList<Object[]>();
+        for(int i : TEST_DATA) {
+            data.add(new Object[]{i});
+        }
+        return data;
+    }
+}
\ No newline at end of file

Propchange: sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/ParametrizedJunit4Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/ParametrizedJunit4Test.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL



Mime
View raw message