ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [01/13] incubator-ignite git commit: #IGNITE-106: Remove grid from tests
Date Tue, 03 Feb 2015 17:10:05 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-106 d3b55e809 -> fc0faf956


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala b/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
index f7687ce..4054952 100644
--- a/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
+++ b/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
@@ -285,7 +285,7 @@ object scalar extends ScalarConversions {
      * @param cacheName Name of the cache to get.
      */
     @inline def cache$[K, V](@Nullable gridName: String, @Nullable cacheName: String): Option[GridCache[K,
V]] =
-        grid$(gridName) match {
+        ignite$(gridName) match {
             case Some(g) => Option(g.cache(cacheName))
             case None => None
         }
@@ -322,7 +322,7 @@ object scalar extends ScalarConversions {
      *
      * @param name Grid name.
      */
-    @inline def grid$(@Nullable name: String): Option[Ignite] =
+    @inline def ignite$(@Nullable name: String): Option[Ignite] =
         try {
             Option(Ignition.ignite(name))
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
index 51bb50a..a035550 100644
--- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
+++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarProjectionSpec.scala
@@ -72,78 +72,78 @@ class ScalarProjectionSpec extends FlatSpec with ShouldMatchers with BeforeAndAf
 
     it should "return all nodes" in scalar(gridConfig("node-scalar", true)) {
         assertResult(3) {
-            grid$("node-scalar").get.cluster().nodes().size
+            ignite$("node-scalar").get.cluster().nodes().size
         }
     }
 
     it should "return shown nodes" in  scalar(gridConfig("node-scalar", true)) {
-        assert(grid$("node-scalar").get.nodes$((node: ClusterNode) => node.attribute[Boolean]("shown")).size
== 2)
+        assert(ignite$("node-scalar").get.nodes$((node: ClusterNode) => node.attribute[Boolean]("shown")).size
== 2)
     }
 
     it should "return all remote nodes" in scalar(gridConfig("node-scalar", true)) {
         assertResult(2) {
-            grid$("node-scalar").get.remoteNodes$().size
+            ignite$("node-scalar").get.remoteNodes$().size
         }
     }
 
     it should "return shown remote nodes" in  scalar(gridConfig("node-scalar", true)) {
-        assert(grid$("node-scalar").get.remoteNodes$((node: ClusterNode) =>
+        assert(ignite$("node-scalar").get.remoteNodes$((node: ClusterNode) =>
             node.attribute[Boolean]("shown")).size == 1)
     }
 
     it should "correctly send messages" in scalar(gridConfig("node-scalar", true)) {
 
-        grid$("node-1").get.message().remoteListen(null, new MessagingListenActor[Any]()
{
+        ignite$("node-1").get.message().remoteListen(null, new MessagingListenActor[Any]()
{
             def receive(nodeId: UUID, msg: Any) {
                 println("node-1 received " + msg)
             }
         })
 
-        grid$("node-2").get.message().remoteListen(null, new MessagingListenActor[Any]()
{
+        ignite$("node-2").get.message().remoteListen(null, new MessagingListenActor[Any]()
{
             def receive(nodeId: UUID, msg: Any) {
                 println("node-2 received " + msg)
             }
         })
 
-        grid$("node-scalar").get !< ("Message", null)
-        grid$("node-scalar").get !< (Seq("Message1", "Message2"), null)
+        ignite$("node-scalar").get !< ("Message", null)
+        ignite$("node-scalar").get !< (Seq("Message1", "Message2"), null)
     }
 
     it should "correctly make calls" in scalar(gridConfig("node-scalar", true)) {
-        println("CALL RESULT: " + grid$("node-scalar").get #< (() => "Message", null))
+        println("CALL RESULT: " + ignite$("node-scalar").get #< (() => "Message", null))
 
-        println("ASYNC CALL RESULT: " + grid$("node-scalar").get.callAsync$[String](() =>
"Message", null).get)
+        println("ASYNC CALL RESULT: " + ignite$("node-scalar").get.callAsync$[String](()
=> "Message", null).get)
 
         val call1: () => String = () => "Message1"
         val call2: () => String = () => "Message2"
 
-        println("MULTIPLE CALL RESULT: " + grid$("node-scalar").get #< (Seq(call1, call2),
null))
+        println("MULTIPLE CALL RESULT: " + ignite$("node-scalar").get #< (Seq(call1, call2),
null))
 
         println("MULTIPLE ASYNC CALL RESULT: " +
-            (grid$("node-scalar").get #? (Seq(call1, call2), null)).get)
+            (ignite$("node-scalar").get #? (Seq(call1, call2), null)).get)
     }
 
     it should "correctly make runs" in scalar(gridConfig("node-scalar", true)) {
-        grid$("node-scalar").get *< (() => println("RUN RESULT: Message"), null)
+        ignite$("node-scalar").get *< (() => println("RUN RESULT: Message"), null)
 
-        (grid$("node-scalar").get *? (() => println("ASYNC RUN RESULT: Message"), null)).get
+        (ignite$("node-scalar").get *? (() => println("ASYNC RUN RESULT: Message"), null)).get
 
         val run1: () => Unit = () => println("RUN 1 RESULT: Message1")
         val run2: () => Unit = () => println("RUN 2 RESULT: Message2")
 
-        grid$("node-scalar").get *< (Seq(run1, run2), null)
+        ignite$("node-scalar").get *< (Seq(run1, run2), null)
 
         val runAsync1: () => Unit = () => println("ASYNC RUN 1 RESULT: Message1")
         val runAsync2: () => Unit = () => println("ASYNC RUN 2 RESULT: Message2")
 
-        (grid$("node-scalar").get *? (Seq(runAsync1, runAsync2), null)).get
+        (ignite$("node-scalar").get *? (Seq(runAsync1, runAsync2), null)).get
     }
 
     it should "correctly reduce" in scalar(gridConfig("node-scalar", true)) {
         val call1: () => Int = () => 15
         val call2: () => Int = () => 82
 
-        assert(grid$("node-scalar").get @< (Seq(call1, call2), (n: Seq[Int]) => n.sum,
null) == 97)
-        assert(grid$("node-scalar").get.reduceAsync$(Seq(call1, call2), (n: Seq[Int]) =>
n.sum, null).get == 97)
+        assert(ignite$("node-scalar").get @< (Seq(call1, call2), (n: Seq[Int]) => n.sum,
null) == 97)
+        assert(ignite$("node-scalar").get.reduceAsync$(Seq(call1, call2), (n: Seq[Int]) =>
n.sum, null).get == 97)
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
b/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
index 3ca08ee..73d99c2 100644
--- a/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
+++ b/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
@@ -48,7 +48,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
+        stopAllIgnites();
 
         super.afterTestsStopped();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
index c4ccf59..127e673 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
@@ -71,7 +71,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
         super(false);
 
         System.setProperty(IGNITE_OVERRIDE_MCAST_GRP,
-            GridTestUtils.getNextMulticastGroup(GridFactorySelfTest.class));
+            TestUtils.getNextMulticastGroup(GridFactorySelfTest.class));
     }
 
     /** {@inheritDoc} */
@@ -88,7 +88,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
 
         try {
             srv = GridEmbeddedHttpServer.startHttpServer().withFileDownloadingHandler(null,
-                GridTestUtils.resolveGridGainPath("/modules/core/src/test/config/default-spring-url-testing.xml"));
+                TestUtils.resolveGridGainPath("/modules/core/src/test/config/default-spring-url-testing.xml"));
 
             Ignite ignite = G.start(srv.getBaseUrl());
 
@@ -111,7 +111,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
 
         try {
             srv = GridEmbeddedHttpServer.startHttpServer().withFileDownloadingHandler(null,
-                GridTestUtils.resolveGridGainPath("modules/core/src/test/config/default-spring-url-testing.xml"));
+                TestUtils.resolveGridGainPath("modules/core/src/test/config/default-spring-url-testing.xml"));
 
             Ignite ignite = G.start(new URL(srv.getBaseUrl()));
 
@@ -178,9 +178,9 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
         List<String> gridNames = bean.getGridNames();
 
         assert evts.get(0) == LifecycleEventType.BEFORE_GRID_START : "Invalid lifecycle event:
" + evts.get(0);
-        assert evts.get(1) == LifecycleEventType.AFTER_GRID_START : "Invalid lifecycle event:
" + evts.get(1);
+        assert evts.get(1) == LifecycleEventType.AFTER_IGNITE_START : "Invalid lifecycle
event: " + evts.get(1);
         assert evts.get(2) == LifecycleEventType.BEFORE_GRID_STOP : "Invalid lifecycle event:
" + evts.get(2);
-        assert evts.get(3) == LifecycleEventType.AFTER_GRID_STOP : "Invalid lifecycle event:
" + evts.get(3);
+        assert evts.get(3) == LifecycleEventType.AFTER_IGNITE_STOP : "Invalid lifecycle event:
" + evts.get(3);
 
         checkGridNameEquals(gridNames.get(0), gridName);
         checkGridNameEquals(gridNames.get(1), gridName);
@@ -208,7 +208,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
     @SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter"})
     public void testStartMultipleGridsFromSpring() throws Exception {
         File cfgFile =
-            GridTestUtils.resolveGridGainPath(GridTestProperties.getProperty("loader.self.multipletest.config"));
+            TestUtils.resolveGridGainPath(GridTestProperties.getProperty("loader.self.multipletest.config"));
 
         assert cfgFile != null;
 
@@ -425,16 +425,19 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testGridStartRollback() throws Exception {
-        GridTestUtils.assertThrows(
+        TestUtils.assertThrows(
             log,
             new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
+                @Nullable
+                @Override
+                public Object call() throws Exception {
                     IgniteConfiguration cfg = new IgniteConfiguration();
 
                     cfg.setRestEnabled(false);
 
                     cfg.setDiscoverySpi(new TcpDiscoverySpi() {
-                        @Override public void spiStart(String gridName) throws IgniteSpiException
{
+                        @Override
+                        public void spiStart(String gridName) throws IgniteSpiException {
                             throw new IgniteSpiException("This SPI will never start.");
                         }
                     });
@@ -645,7 +648,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
 
             try {
                 checkState(ignite.name(),
-                    evt == LifecycleEventType.AFTER_GRID_START || evt == LifecycleEventType.BEFORE_GRID_STOP);
+                    evt == LifecycleEventType.AFTER_IGNITE_START || evt == LifecycleEventType.BEFORE_GRID_STOP);
             }
             catch (Throwable e) {
                 log.error("Lifecycle bean failed state check: " + this, e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java
index c243753..38b3ef5 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridLoggerInjectionSelfTest.java
@@ -39,7 +39,7 @@ public class GridLoggerInjectionSelfTest extends GridCommonAbstractTest
implemen
 
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
+        stopAllIgnites();
 
         super.afterTestsStopped();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java
index 29d7636..4f80bb2 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridResourceProcessorSelfTest.java
@@ -415,8 +415,9 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest
{
         ctx.start();
 
         try {
-            GridTestUtils.runMultiThreaded(new Runnable() {
-                @Override public void run() {
+            TestUtils.runMultiThreaded(new Runnable() {
+                @Override
+                public void run() {
                     try {
                         Test1 obj = new Test1();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
index 62b7f60..76865d2 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridServiceInjectionSelfTest.java
@@ -54,7 +54,7 @@ public class GridServiceInjectionSelfTest extends GridCommonAbstractTest
impleme
 
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
+        stopAllIgnites();
 
         super.afterTestsStopped();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
index 0c4d474..a284d4a 100644
--- a/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
@@ -302,8 +302,9 @@ public class GridP2PUserVersionChangeSelfTest extends GridCommonAbstractTest
{
             // The entry should propagate to grid2, because the
             // cache is REPLICATED. This happens asynchronously, we
             // need to use condition wait.
-            assert GridTestUtils.waitForCondition(new PAX() {
-                @Override public boolean applyx() throws IgniteCheckedException {
+            assert TestUtils.waitForCondition(new PAX() {
+                @Override
+                public boolean applyx() throws IgniteCheckedException {
                     return cache2.get(1L) != null;
                 }
             }, getConditionTimeout());
@@ -324,15 +325,16 @@ public class GridP2PUserVersionChangeSelfTest extends GridCommonAbstractTest
{
 
             // At this point, old version of test resource should be undeployed
             // and removed from cache asynchronously.
-            assert GridTestUtils.waitForCondition(new PAX() {
-                @Override public boolean applyx() throws IgniteCheckedException {
+            assert TestUtils.waitForCondition(new PAX() {
+                @Override
+                public boolean applyx() throws IgniteCheckedException {
                     return cache2.get(1L) == null;
                 }
             }, getConditionTimeout()) : "2nd condition failed [entries1=" + cache1.entrySet()
+
                 ", entries2=" + cache2.entrySet() + ']';
         }
         finally {
-            stopAllGrids();
+            stopAllIgnites();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringCacheManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringCacheManagerSelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringCacheManagerSelfTest.java
index 1d888c4..e51ae2c 100644
--- a/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringCacheManagerSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringCacheManagerSelfTest.java
@@ -70,7 +70,7 @@ public class GridSpringCacheManagerSelfTest extends GridCommonAbstractTest
{
 
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
+        stopAllIgnites();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringDynamicCacheManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringDynamicCacheManagerSelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringDynamicCacheManagerSelfTest.java
index febcaaf..b5d6b5b 100644
--- a/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringDynamicCacheManagerSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/GridSpringDynamicCacheManagerSelfTest.java
@@ -77,7 +77,7 @@ public class GridSpringDynamicCacheManagerSelfTest extends GridCommonAbstractTes
 
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
+        stopAllIgnites();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/urideploy/src/test/java/org/apache/ignite/internal/GridTaskUriDeploymentDeadlockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/urideploy/src/test/java/org/apache/ignite/internal/GridTaskUriDeploymentDeadlockSelfTest.java
b/modules/urideploy/src/test/java/org/apache/ignite/internal/GridTaskUriDeploymentDeadlockSelfTest.java
index b030d66..64407f5 100644
--- a/modules/urideploy/src/test/java/org/apache/ignite/internal/GridTaskUriDeploymentDeadlockSelfTest.java
+++ b/modules/urideploy/src/test/java/org/apache/ignite/internal/GridTaskUriDeploymentDeadlockSelfTest.java
@@ -104,7 +104,7 @@ public class GridTaskUriDeploymentDeadlockSelfTest extends GridCommonAbstractTes
             // System.exit(1);
         }
         finally {
-            stopAllGrids();
+            stopAllIgnites();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc0faf95/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
b/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
index e3b2224..9214da2 100644
--- a/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
+++ b/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
@@ -118,9 +118,10 @@ public class WebSessionSelfTest extends GridCommonAbstractTest {
 
         final AtomicBoolean stop = new AtomicBoolean();
 
-        IgniteInternalFuture<?> restarterFut = GridTestUtils.runMultiThreadedAsync(new
Callable<Object>() {
+        IgniteInternalFuture<?> restarterFut = TestUtils.runMultiThreadedAsync(new
Callable<Object>() {
             @SuppressWarnings("BusyWait")
-            @Override public Object call() throws Exception {
+            @Override
+            public Object call() throws Exception {
                 Random rnd = new Random();
 
                 for (int i = 0; i < 10; i++) {


Mime
View raw message