ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [07/20] ignite git commit: IGNITE-3978: Applied "IgniteIgnore" annotation to failing S3 tests. This closes #1123.
Date Thu, 29 Sep 2016 12:41:35 GMT
IGNITE-3978: Applied "IgniteIgnore" annotation to failing S3 tests. This closes #1123.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7f8281cd
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7f8281cd
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7f8281cd

Branch: refs/heads/ignite-comm-opts2
Commit: 7f8281cd191ea576a8d6358b53fb13e4344cb9d5
Parents: 5cffd3c
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Sep 27 16:37:40 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Sep 27 16:37:40 2016 +0300

----------------------------------------------------------------------
 .../s3/S3CheckpointManagerSelfTest.java         |  3 ++
 .../checkpoint/s3/S3CheckpointSpiSelfTest.java  |  4 ++
 .../s3/S3CheckpointSpiStartStopSelfTest.java    |  7 ++++
 .../s3/S3SessionCheckpointSelfTest.java         |  2 +
 .../s3/TcpDiscoveryS3IpFinderSelfTest.java      |  7 ++++
 .../ignite/testsuites/IgniteS3TestSuite.java    | 15 +++----
 .../ignite/testframework/IgniteTestSuite.java   | 41 ++++++++++++++++++--
 modules/ignored-tests/pom.xml                   | 14 +++++++
 .../testsuites/IgniteIgnoredTestSuite.java      | 21 ++++------
 9 files changed, 90 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
index db09e33..a90323e 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
@@ -21,6 +21,7 @@ import com.amazonaws.auth.AWSCredentials;
 import com.amazonaws.auth.BasicAWSCredentials;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.managers.checkpoint.GridCheckpointManagerAbstractSelfTest;
+import org.apache.ignite.testsuites.IgniteIgnore;
 import org.apache.ignite.testsuites.IgniteS3TestSuite;
 
 /**
@@ -50,6 +51,7 @@ public class S3CheckpointManagerSelfTest extends GridCheckpointManagerAbstractSe
     /**
      * @throws Exception Thrown if any exception occurs.
      */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
     public void testS3Based() throws Exception {
         retries = 6;
 
@@ -59,6 +61,7 @@ public class S3CheckpointManagerSelfTest extends GridCheckpointManagerAbstractSe
     /**
      * @throws Exception Thrown if any exception occurs.
      */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
     public void testMultiNodeS3Based() throws Exception {
         retries = 6;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
index 11e5bad..23abe06 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
@@ -34,6 +34,7 @@ import org.apache.ignite.spi.checkpoint.GridCheckpointTestState;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.spi.GridSpiAbstractTest;
 import org.apache.ignite.testframework.junits.spi.GridSpiTest;
+import org.apache.ignite.testsuites.IgniteIgnore;
 import org.apache.ignite.testsuites.IgniteS3TestSuite;
 
 /**
@@ -91,6 +92,7 @@ public class S3CheckpointSpiSelfTest extends GridSpiAbstractTest<S3CheckpointSpi
     /**
      * @throws Exception Thrown in case of any errors.
      */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
     public void testSaveLoadRemoveWithoutExpire() throws Exception {
         String dataPrefix = "Test check point data ";
 
@@ -149,6 +151,7 @@ public class S3CheckpointSpiSelfTest extends GridSpiAbstractTest<S3CheckpointSpi
     /**
      * @throws Exception Thrown in case of any errors.
      */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
     public void testSaveWithExpire() throws Exception {
         // Save states.
         for (int i = 0; i < CHECK_POINT_COUNT; i++) {
@@ -176,6 +179,7 @@ public class S3CheckpointSpiSelfTest extends GridSpiAbstractTest<S3CheckpointSpi
     /**
      * @throws Exception Thrown in case of any errors.
      */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
     public void testDuplicates() throws Exception {
         int idx1 = 1;
         int idx2 = 2;

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
index 3995b09..c26897f 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
@@ -21,6 +21,7 @@ import com.amazonaws.auth.AWSCredentials;
 import com.amazonaws.auth.BasicAWSCredentials;
 import org.apache.ignite.spi.GridSpiStartStopAbstractTest;
 import org.apache.ignite.testframework.junits.spi.GridSpiTest;
+import org.apache.ignite.testsuites.IgniteIgnore;
 import org.apache.ignite.testsuites.IgniteS3TestSuite;
 
 /**
@@ -39,4 +40,10 @@ public class S3CheckpointSpiStartStopSelfTest extends GridSpiStartStopAbstractTe
 
         super.spiConfigure(spi);
     }
+
+    /** {@inheritDoc} */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
+    @Override public void testStartStop() throws Exception {
+        super.testStartStop();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
index e5dd074..c1290a4 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
@@ -22,6 +22,7 @@ import com.amazonaws.auth.BasicAWSCredentials;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.session.GridSessionCheckpointAbstractSelfTest;
 import org.apache.ignite.session.GridSessionCheckpointSelfTest;
+import org.apache.ignite.testsuites.IgniteIgnore;
 import org.apache.ignite.testsuites.IgniteS3TestSuite;
 
 /**
@@ -31,6 +32,7 @@ public class S3SessionCheckpointSelfTest extends GridSessionCheckpointAbstractSe
     /**
      * @throws Exception If failed.
      */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
     public void testS3Checkpoint() throws Exception {
         IgniteConfiguration cfg = getConfiguration();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
index 73e8e55..a1ebc8f 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
@@ -23,6 +23,7 @@ import java.net.InetSocketAddress;
 import java.util.Collection;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAbstractSelfTest;
+import org.apache.ignite.testsuites.IgniteIgnore;
 import org.apache.ignite.testsuites.IgniteS3TestSuite;
 
 /**
@@ -69,4 +70,10 @@ public class TcpDiscoveryS3IpFinderSelfTest
 
         return finder;
     }
+
+    /** {@inheritDoc} */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
+    @Override public void testIpFinder() throws Exception {
+        super.testIpFinder();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
b/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
index 5c4ba97..86322e6 100644
--- a/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
+++ b/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
@@ -24,6 +24,7 @@ import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiSelfTest;
 import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiStartStopSelfTest;
 import org.apache.ignite.spi.checkpoint.s3.S3SessionCheckpointSelfTest;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinderSelfTest;
+import org.apache.ignite.testframework.IgniteTestSuite;
 
 /**
  * S3 integration tests.
@@ -34,17 +35,17 @@ public class IgniteS3TestSuite extends TestSuite {
      * @throws Exception Thrown in case of the failure.
      */
     public static TestSuite suite() throws Exception {
-        TestSuite suite = new TestSuite("S3 Integration Test Suite");
+        TestSuite suite = new IgniteTestSuite("S3 Integration Test Suite");
 
         // Checkpoint SPI.
-        suite.addTest(new TestSuite(S3CheckpointSpiConfigSelfTest.class));
-        suite.addTest(new TestSuite(S3CheckpointSpiSelfTest.class));
-        suite.addTest(new TestSuite(S3CheckpointSpiStartStopSelfTest.class));
-        suite.addTest(new TestSuite(S3CheckpointManagerSelfTest.class));
-        suite.addTest(new TestSuite(S3SessionCheckpointSelfTest.class));
+        suite.addTestSuite(S3CheckpointSpiConfigSelfTest.class);
+        suite.addTestSuite(S3CheckpointSpiSelfTest.class);
+        suite.addTestSuite(S3CheckpointSpiStartStopSelfTest.class);
+        suite.addTestSuite(S3CheckpointManagerSelfTest.class);
+        suite.addTestSuite(S3SessionCheckpointSelfTest.class);
 
         // S3 IP finder.
-        suite.addTest(new TestSuite(TcpDiscoveryS3IpFinderSelfTest.class));
+        suite.addTestSuite(TcpDiscoveryS3IpFinderSelfTest.class);
 
         return suite;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/core/src/test/java/org/apache/ignite/testframework/IgniteTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/IgniteTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testframework/IgniteTestSuite.java
index 4153600..6fc7917 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/IgniteTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/IgniteTestSuite.java
@@ -36,8 +36,15 @@ import java.util.List;
  * Test methods marked with @Ignored annotation won't be executed.
  */
 public class IgniteTestSuite extends TestSuite {
+    /** Ignore default flag thread local. */
+    private static final ThreadLocal<Boolean> IGNORE_DFLT = new ThreadLocal<Boolean>()
{
+        @Override protected Boolean initialValue() {
+            return false;
+        }
+    };
+
     /** Whether to execute only ignored tests. */
-    private final boolean ignoredOnly;
+    private boolean ignoredOnly;
 
     /**
      * Constructor.
@@ -54,7 +61,7 @@ public class IgniteTestSuite extends TestSuite {
      * @param theClass TestCase class
      */
     public IgniteTestSuite(Class<? extends TestCase> theClass) {
-        this(theClass, false);
+        this(theClass, ignoreDefault());
     }
 
     /**
@@ -74,7 +81,7 @@ public class IgniteTestSuite extends TestSuite {
      * @param name Test suite name.
      */
     public IgniteTestSuite(Class<? extends TestCase> theClass, String name) {
-        this(theClass, name, false);
+        this(theClass, name, ignoreDefault());
     }
 
     /**
@@ -94,6 +101,13 @@ public class IgniteTestSuite extends TestSuite {
             setName(name);
     }
 
+    /**
+     * Adds a test to the suite.
+     */
+    @Override public void addTest(Test test) {
+        super.addTest(test);
+    }
+
     /** {@inheritDoc} */
     @Override public void addTestSuite(Class<? extends TestCase> testClass) {
         addTest(new IgniteTestSuite(testClass, ignoredOnly));
@@ -122,6 +136,7 @@ public class IgniteTestSuite extends TestSuite {
             Class superCls = theClass;
 
             int testAdded = 0;
+            int testIgnored = 0;
 
             for(List<String> names = new ArrayList<>(); Test.class.isAssignableFrom(superCls);
                 superCls = superCls.getSuperclass()) {
@@ -131,10 +146,12 @@ public class IgniteTestSuite extends TestSuite {
                 for (Method each : methods) {
                     if (addTestMethod(each, names, theClass))
                         testAdded++;
+                    else
+                        testIgnored++;
                 }
             }
 
-            if(testAdded == 0)
+            if(testAdded == 0 && testIgnored == 0)
                 addTest(warning("No tests found in " + theClass.getName()));
         }
     }
@@ -222,6 +239,22 @@ public class IgniteTestSuite extends TestSuite {
     }
 
     /**
+     * @param val Default value of ignore flag.
+     */
+    public static void ignoreDefault(boolean val) {
+        IGNORE_DFLT.set(val);
+    }
+
+    /**
+     * @return Default value of ignore flag.
+     */
+    private static boolean ignoreDefault() {
+        Boolean res = IGNORE_DFLT.get();
+
+        return res != null && res;
+    }
+
+    /**
      * Test case simulating failure.
      */
     private static class ForcedFailure extends TestCase {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/ignored-tests/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ignored-tests/pom.xml b/modules/ignored-tests/pom.xml
index a82a5bb..cfeacb2 100644
--- a/modules/ignored-tests/pom.xml
+++ b/modules/ignored-tests/pom.xml
@@ -64,6 +64,20 @@
 
         <dependency>
             <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-aws</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-aws</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
             <artifactId>ignite-web</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f8281cd/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
b/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
index f6ce3e3..fa60721 100644
--- a/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
+++ b/modules/ignored-tests/src/test/java/org/apache/ignite/testsuites/IgniteIgnoredTestSuite.java
@@ -18,12 +18,7 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
-import org.apache.ignite.internal.websession.WebSessionReplicatedSelfTest;
-import org.apache.ignite.internal.websession.WebSessionReplicatedV1SelfTest;
-import org.apache.ignite.internal.websession.WebSessionSelfTest;
-import org.apache.ignite.internal.websession.WebSessionTransactionalSelfTest;
-import org.apache.ignite.internal.websession.WebSessionTransactionalV1SelfTest;
-import org.apache.ignite.internal.websession.WebSessionV1SelfTest;
+import org.apache.ignite.internal.websession.IgniteWebSessionSelfTestSuite;
 import org.apache.ignite.testframework.IgniteTestSuite;
 
 /**
@@ -35,15 +30,15 @@ public class IgniteIgnoredTestSuite extends TestSuite {
      * @throws Exception Thrown in case of the failure.
      */
     public static TestSuite suite() throws Exception {
-        IgniteTestSuite suite = new IgniteTestSuite(null, "Ignite Ignored Test Suite", true);
+        IgniteTestSuite.ignoreDefault(true);
+
+        IgniteTestSuite suite = new IgniteTestSuite(null, "Ignite Ignored Test Suite");
+
+        /* --- AWS --- */
+        suite.addTest(IgniteS3TestSuite.suite());
 
         /* --- WEB SESSIONS --- */
-        suite.addTestSuite(WebSessionSelfTest.class);
-        suite.addTestSuite(WebSessionTransactionalSelfTest.class);
-        suite.addTestSuite(WebSessionReplicatedSelfTest.class);
-        suite.addTestSuite(WebSessionV1SelfTest.class);
-        suite.addTestSuite(WebSessionTransactionalV1SelfTest.class);
-        suite.addTestSuite(WebSessionReplicatedV1SelfTest.class);
+        suite.addTest(IgniteWebSessionSelfTestSuite.suite());
 
         return suite;
     }


Mime
View raw message