sprint-1 renaming

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

Branch: refs/heads/ignite-160
Commit: 20d0d3f7fe055b60b3a00db0edb6780c87d04cda
Parents: 9f04e64
Author: Yakov Zhdanov <yzhda...@gridgain.com>
Authored: Wed Feb 4 11:36:36 2015 +0300
Committer: Yakov Zhdanov <yzhda...@gridgain.com>
Committed: Wed Feb 4 11:36:36 2015 +0300

----------------------------------------------------------------------
 .../fs/GridGgfsCommonAbstractTest.java          |   4 +-
 .../ipc/shmem/GgfsSharedMemoryTestServer.java   |   2 +-
 .../IpcSharedMemoryCrashDetectionSelfTest.java  |   2 +-
 .../IpcSharedMemoryBenchmarkReader.java         |   2 +-
 .../ignite/p2p/GridP2PUndeploySelfTest.java     |   2 +-
 .../GridAbstractCommunicationSelfTest.java      |   6 +-
 ...mmunicationSpiConcurrentConnectSelfTest.java |   6 +-
 .../tcp/GridTcpCommunicationSpiLanTest.java     |   6 +-
 ...cpCommunicationSpiMultithreadedSelfTest.java |   6 +-
 ...dTcpCommunicationSpiRecoveryAckSelfTest.java |   6 +-
 ...GridTcpCommunicationSpiRecoverySelfTest.java |   6 +-
 .../GridAbstractDiscoverySelfTest.java          |  12 +-
 .../testframework/junits/GridAbstractTest.java  |  10 +-
 .../testframework/junits/GridTestIgnite.java    | 230 -----------------
 .../testframework/junits/GridTestResources.java | 255 -------------------
 .../ignite/testframework/junits/IgniteMock.java | 230 +++++++++++++++++
 .../junits/IgniteTestResources.java             | 255 +++++++++++++++++++
 .../junits/spi/GridSpiAbstractTest.java         |   6 +-
 18 files changed, 523 insertions(+), 523 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsCommonAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsCommonAbstractTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsCommonAbstractTest.java
index c3f822e..0baa7bc 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsCommonAbstractTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsCommonAbstractTest.java
@@ -46,7 +46,7 @@ public class GridGgfsCommonAbstractTest extends 
GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(GridTestResources 
rsrcs) throws Exception {
+    @Override protected IgniteConfiguration 
getConfiguration(IgniteTestResources rsrcs) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(rsrcs);
 
         cfg.setPeerClassLoadingEnabled(false);
@@ -56,7 +56,7 @@ public class GridGgfsCommonAbstractTest extends 
GridCommonAbstractTest {
     }
 
     /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName, 
GridTestResources rsrcs) throws Exception {
+    @Override protected IgniteConfiguration getConfiguration(String gridName, 
IgniteTestResources rsrcs) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName, rsrcs);
 
         cfg.setPeerClassLoadingEnabled(false);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GgfsSharedMemoryTestServer.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GgfsSharedMemoryTestServer.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GgfsSharedMemoryTestServer.java
index b3d41b2..6e8a900 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GgfsSharedMemoryTestServer.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GgfsSharedMemoryTestServer.java
@@ -45,7 +45,7 @@ public class GgfsSharedMemoryTestServer {
         try {
             IpcServerEndpoint srv = new IpcSharedMemoryServerEndpoint();
 
-            new GridTestResources().inject(srv);
+            new IgniteTestResources().inject(srv);
 
             srv.start();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
index 94c1f75..f081acf 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
@@ -54,7 +54,7 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends 
GridCommonAbstractTes
         // Run server endpoint.
         IpcSharedMemoryServerEndpoint srv = new 
IpcSharedMemoryServerEndpoint();
 
-        new GridTestResources().inject(srv);
+        new IgniteTestResources().inject(srv);
 
         try {
             srv.start();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
index 0ac3ef7..28495af 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
@@ -77,7 +77,7 @@ public class IpcSharedMemoryBenchmarkReader implements 
IpcSharedMemoryBenchmarkP
         });
 
         try (IpcSharedMemoryServerEndpoint srv = new 
IpcSharedMemoryServerEndpoint()) {
-            new GridTestResources().inject(srv);
+            new IgniteTestResources().inject(srv);
 
             srv.start();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PUndeploySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PUndeploySelfTest.java 
b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PUndeploySelfTest.java
index 8a218ef..0407bee 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PUndeploySelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PUndeploySelfTest.java
@@ -46,7 +46,7 @@ public class GridP2PUndeploySelfTest extends 
GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName,
-        GridTestResources rsrcs) throws Exception {
+        IgniteTestResources rsrcs) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName, rsrcs);
 
         LocalDeploymentSpi spi = new LocalDeploymentSpi();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
index e270192..1ceffb2 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
@@ -43,7 +43,7 @@ public abstract class GridAbstractCommunicationSelfTest<T 
extends CommunicationS
     private static long msgId = 1;
 
     /** */
-    private static final Collection<GridTestResources> spiRsrcs = new 
ArrayList<>();
+    private static final Collection<IgniteTestResources> spiRsrcs = new 
ArrayList<>();
 
     /** */
     private static final Map<UUID, Set<UUID>> msgDestMap = new HashMap<>();
@@ -281,7 +281,7 @@ public abstract class GridAbstractCommunicationSelfTest<T 
extends CommunicationS
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
-            GridTestResources rsrcs = new GridTestResources();
+            IgniteTestResources rsrcs = new IgniteTestResources();
 
             GridTestNode node = new GridTestNode(rsrcs.getNodeId());
 
@@ -332,7 +332,7 @@ public abstract class GridAbstractCommunicationSelfTest<T 
extends CommunicationS
             spi.spiStop();
         }
 
-        for (GridTestResources rsrcs : spiRsrcs)
+        for (IgniteTestResources rsrcs : spiRsrcs)
             rsrcs.stopThreads();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
index d1de99c..4892db0 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
@@ -49,7 +49,7 @@ public class 
GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
     private static final int ITERS = 50;
 
     /** */
-    private static final Collection<GridTestResources> spiRsrcs = new 
ArrayList<>();
+    private static final Collection<IgniteTestResources> spiRsrcs = new 
ArrayList<>();
 
     /** */
     protected static final 
List<CommunicationSpi<GridTcpCommunicationMessageAdapter>> spis = new 
ArrayList<>();
@@ -319,7 +319,7 @@ public class 
GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
-            GridTestResources rsrcs = new GridTestResources();
+            IgniteTestResources rsrcs = new IgniteTestResources();
 
             GridTestNode node = new GridTestNode(rsrcs.getNodeId());
 
@@ -400,7 +400,7 @@ public class 
GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
             spi.spiStop();
         }
 
-        for (GridTestResources rsrcs : spiRsrcs)
+        for (IgniteTestResources rsrcs : spiRsrcs)
             rsrcs.stopThreads();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
index ffdfa05..0e974b0 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
@@ -49,7 +49,7 @@ public class GridTcpCommunicationSpiLanTest extends 
GridSpiAbstractTest<TcpCommu
     private AtomicLong msgId = new AtomicLong();
 
     /** SPI resource. */
-    private GridTestResources spiRsrc;
+    private IgniteTestResources spiRsrc;
 
     /** SPI */
     private TcpCommunicationSpi spi;
@@ -209,7 +209,7 @@ public class GridTcpCommunicationSpiLanTest extends 
GridSpiAbstractTest<TcpCommu
     @Override protected void beforeTestsStarted() throws Exception {
         spi = createSpi();
 
-        spiRsrc = new GridTestResources(getMBeanServer());
+        spiRsrc = new IgniteTestResources(getMBeanServer());
 
         locNode = new GridTestNode(spiRsrc.getNodeId());
 
@@ -233,7 +233,7 @@ public class GridTcpCommunicationSpiLanTest extends 
GridSpiAbstractTest<TcpCommu
 
         spi.onContextInitialized(ctx);
 
-        GridTestResources remoteRsrc = new GridTestResources();
+        IgniteTestResources remoteRsrc = new IgniteTestResources();
 
         remoteNode = new GridTestNode(remoteRsrc.getNodeId());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
index ec7137a..6ba86f5 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
@@ -57,7 +57,7 @@ public abstract class 
GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
     private final boolean useShmem;
 
     /** SPI resources. */
-    private static final Collection<GridTestResources> spiRsrcs = new 
ArrayList<>();
+    private static final Collection<IgniteTestResources> spiRsrcs = new 
ArrayList<>();
 
     /** SPIs */
     private static final Map<UUID, 
CommunicationSpi<GridTcpCommunicationMessageAdapter>> spis =
@@ -449,7 +449,7 @@ public abstract class 
GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
-            GridTestResources rsrcs = new GridTestResources();
+            IgniteTestResources rsrcs = new IgniteTestResources();
 
             GridTestNode node = new GridTestNode(rsrcs.getNodeId());
 
@@ -528,7 +528,7 @@ public abstract class 
GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
             spi.spiStop();
         }
 
-        for (GridTestResources rsrcs : spiRsrcs)
+        for (IgniteTestResources rsrcs : spiRsrcs)
             rsrcs.stopThreads();
 
         lsnrs.clear();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
index bd6bd0b..641805d 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
@@ -40,7 +40,7 @@ import java.util.concurrent.atomic.*;
 @GridSpiTest(spi = TcpCommunicationSpi.class, group = "Communication SPI")
 public class GridTcpCommunicationSpiRecoveryAckSelfTest<T extends 
CommunicationSpi> extends GridSpiAbstractTest<T> {
     /** */
-    private static final Collection<GridTestResources> spiRsrcs = new 
ArrayList<>();
+    private static final Collection<IgniteTestResources> spiRsrcs = new 
ArrayList<>();
 
     /** */
     protected static final List<TcpCommunicationSpi> spis = new ArrayList<>();
@@ -345,7 +345,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T 
extends CommunicationS
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
-            GridTestResources rsrcs = new GridTestResources();
+            IgniteTestResources rsrcs = new IgniteTestResources();
 
             GridTestNode node = new GridTestNode(rsrcs.getNodeId());
 
@@ -424,7 +424,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T 
extends CommunicationS
             spi.spiStop();
         }
 
-        for (GridTestResources rsrcs : spiRsrcs)
+        for (IgniteTestResources rsrcs : spiRsrcs)
             rsrcs.stopThreads();
 
         spis.clear();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
index 9e18411..cdd6ef6 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
@@ -43,7 +43,7 @@ import java.util.concurrent.atomic.*;
 @GridSpiTest(spi = TcpCommunicationSpi.class, group = "Communication SPI")
 public class GridTcpCommunicationSpiRecoverySelfTest<T extends 
CommunicationSpi> extends GridSpiAbstractTest<T> {
     /** */
-    private static final Collection<GridTestResources> spiRsrcs = new 
ArrayList<>();
+    private static final Collection<IgniteTestResources> spiRsrcs = new 
ArrayList<>();
 
     /** */
     protected static final List<TcpCommunicationSpi> spis = new ArrayList<>();
@@ -633,7 +633,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T 
extends CommunicationSpi>
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
-            GridTestResources rsrcs = new GridTestResources();
+            IgniteTestResources rsrcs = new IgniteTestResources();
 
             GridTestNode node = new GridTestNode(rsrcs.getNodeId());
 
@@ -711,7 +711,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T 
extends CommunicationSpi>
             spi.spiStop();
         }
 
-        for (GridTestResources rsrcs : spiRsrcs) {
+        for (IgniteTestResources rsrcs : spiRsrcs) {
             rsrcs.stopThreads();
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/spi/discovery/GridAbstractDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/discovery/GridAbstractDiscoverySelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/GridAbstractDiscoverySelfTest.java
index d75effb..32c06bf 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/spi/discovery/GridAbstractDiscoverySelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/GridAbstractDiscoverySelfTest.java
@@ -46,7 +46,7 @@ public abstract class GridAbstractDiscoverySelfTest<T extends 
IgniteSpi> extends
     private static final List<DiscoverySpi> spis = new ArrayList<>();
 
     /** */
-    private static final Collection<GridTestResources> spiRsrcs = new 
ArrayList<>();
+    private static final Collection<IgniteTestResources> spiRsrcs = new 
ArrayList<>();
 
     /** */
     private static long spiStartTime;
@@ -84,7 +84,7 @@ public abstract class GridAbstractDiscoverySelfTest<T extends 
IgniteSpi> extends
 
                 isAllDiscovered = true;
 
-                for (GridTestResources rscrs : spiRsrcs) {
+                for (IgniteTestResources rscrs : spiRsrcs) {
                     UUID nodeId = rscrs.getNodeId();
 
                     if (!nodeId.equals(spi.getLocalNode().id())) {
@@ -267,7 +267,7 @@ public abstract class GridAbstractDiscoverySelfTest<T 
extends IgniteSpi> extends
 
             Collection<UUID> nodeIds = new HashSet<>();
 
-            for (GridTestResources rsrc : spiRsrcs) {
+            for (IgniteTestResources rsrc : spiRsrcs) {
                 nodeIds.add(rsrc.getNodeId());
             }
 
@@ -299,7 +299,7 @@ public abstract class GridAbstractDiscoverySelfTest<T 
extends IgniteSpi> extends
      */
     public void testPing() {
         for (DiscoverySpi spi : spis) {
-            for (GridTestResources rscrs : spiRsrcs) {
+            for (IgniteTestResources rscrs : spiRsrcs) {
                 UUID nodeId = rscrs.getNodeId();
 
                 if (spi.pingNode(nodeId))
@@ -360,7 +360,7 @@ public abstract class GridAbstractDiscoverySelfTest<T 
extends IgniteSpi> extends
             for (int i = 0; i < getSpiCount(); i++) {
                 DiscoverySpi spi = getSpi(i);
 
-                GridTestResources rsrcMgr = new 
GridTestResources(getMBeanServer(i));
+                IgniteTestResources rsrcMgr = new 
IgniteTestResources(getMBeanServer(i));
 
                 rsrcMgr.inject(spi);
 
@@ -453,7 +453,7 @@ public abstract class GridAbstractDiscoverySelfTest<T 
extends IgniteSpi> extends
             spi.spiStop();
         }
 
-        for (GridTestResources rscrs : spiRsrcs) {
+        for (IgniteTestResources rscrs : spiRsrcs) {
             rscrs.stopThreads();
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index 0e54263..4c9285c 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -162,7 +162,7 @@ public abstract class GridAbstractTest extends TestCase {
     /**
      * @return Test resources.
      */
-    protected GridTestResources getTestResources() {
+    protected IgniteTestResources getTestResources() {
         return getTestCounters().getTestResources();
     }
 
@@ -976,7 +976,7 @@ public abstract class GridAbstractTest extends TestCase {
      * @param rsrcs Resources.
      * @throws Exception If failed.
      */
-    protected IgniteConfiguration getConfiguration(GridTestResources rsrcs) 
throws Exception {
+    protected IgniteConfiguration getConfiguration(IgniteTestResources rsrcs) 
throws Exception {
         return getConfiguration(getTestGridName(), rsrcs);
     }
 
@@ -1050,7 +1050,7 @@ public abstract class GridAbstractTest extends TestCase {
      * @throws Exception If failed.
      */
     @SuppressWarnings("deprecation")
-    protected IgniteConfiguration getConfiguration(String gridName, 
GridTestResources rsrcs) throws Exception {
+    protected IgniteConfiguration getConfiguration(String gridName, 
IgniteTestResources rsrcs) throws Exception {
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName(gridName);
@@ -1334,7 +1334,7 @@ public abstract class GridAbstractTest extends TestCase {
         private boolean reset;
 
         /** */
-        private GridTestResources rsrcs = new GridTestResources();
+        private IgniteTestResources rsrcs = new IgniteTestResources();
 
         /**
          * @return Reset flag.
@@ -1346,7 +1346,7 @@ public abstract class GridAbstractTest extends TestCase {
         /**
          * @return Test resources.
          */
-        public GridTestResources getTestResources() {
+        public IgniteTestResources getTestResources() {
             return rsrcs;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java
deleted file mode 100644
index 7b0ca2d..0000000
--- 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.apache.ignite.testframework.junits;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.hadoop.*;
-import org.apache.ignite.internal.product.*;
-import org.apache.ignite.marshaller.*;
-import org.apache.ignite.plugin.*;
-import org.apache.ignite.plugin.security.*;
-import org.jetbrains.annotations.*;
-
-import javax.management.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * Ignite mock.
- */
-public class GridTestIgnite implements Ignite {
-    /** Ignite name */
-    private final String name;
-
-    /** Local host. */
-    private final String locHost;
-
-    /** */
-    private final UUID nodeId;
-
-    /** */
-    private IgniteMarshaller marshaller;
-
-    /** */
-    private final MBeanServer jmx;
-
-    /** */
-    private final String home;
-
-    /**
-     * Mock values
-     *
-     * @param name Name.
-     * @param locHost Local host.
-     * @param nodeId Node ID.
-     * @param marshaller Marshaller.
-     * @param jmx Jmx Bean Server.
-     * @param home Ignite home.
-     */
-    public GridTestIgnite(
-        String name, String locHost, UUID nodeId, IgniteMarshaller marshaller, 
MBeanServer jmx, String home) {
-        this.locHost = locHost;
-        this.nodeId = nodeId;
-        this.marshaller = marshaller;
-        this.jmx = jmx;
-        this.home = home;
-        this.name = name;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String name() {
-        return name;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteLogger log() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteConfiguration configuration() {
-        IgniteConfiguration cfg = new IgniteConfiguration();
-
-        cfg.setMarshaller(marshaller);
-        cfg.setNodeId(nodeId);
-        cfg.setMBeanServer(jmx);
-        cfg.setGridGainHome(home);
-        cfg.setLocalHost(locHost);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteCluster cluster() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteCompute compute() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteCompute compute(ClusterGroup prj) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteMessaging message() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteMessaging message(ClusterGroup prj) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteEvents events() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteEvents events(ClusterGroup prj) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteManaged managed() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteManaged managed(ClusterGroup prj) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ExecutorService executorService() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ExecutorService executorService(ClusterGroup prj) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteProduct product() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteScheduler scheduler() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridSecurity security() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgnitePortables portables() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public <K, V> GridCache<K, V> cache(@Nullable String name) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<GridCache<?, ?>> caches() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public <K, V> IgniteCache<K, V> jcache(@Nullable String name) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteTransactions transactions() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public <K, V> IgniteDataLoader<K, V> dataLoader(@Nullable String 
cacheName) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteFs fileSystem(String name) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<IgniteFs> fileSystems() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridHadoop hadoop() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteStreamer streamer(@Nullable String name) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<IgniteStreamer> streamers() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public <T extends IgnitePlugin> T plugin(String name) throws 
PluginNotFoundException {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void close() throws IgniteCheckedException {}
-
-    /** {@inheritDoc} */
-    @Override public <K> CacheAffinity<K> affinity(String cacheName) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestResources.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestResources.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestResources.java
deleted file mode 100644
index 9799131..0000000
--- 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestResources.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.testframework.junits;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.processors.resource.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.marshaller.*;
-import org.apache.ignite.marshaller.optimized.*;
-import org.apache.ignite.resources.*;
-import org.apache.ignite.testframework.config.*;
-import org.apache.ignite.testframework.junits.logger.*;
-import org.apache.ignite.thread.*;
-import org.jetbrains.annotations.*;
-
-import javax.management.*;
-import java.io.*;
-import java.lang.management.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * Test resources for injection.
- */
-public class GridTestResources {
-    /** */
-    private static final IgniteLogger rootLog = new GridTestLog4jLogger(false);
-
-    /** */
-    private final IgniteLogger log;
-
-    /** Local host. */
-    private final String locHost;
-
-    /** */
-    private final UUID nodeId;
-
-    /** */
-    private IgniteMarshaller marshaller;
-
-    /** */
-    private final MBeanServer jmx;
-
-    /** */
-    private final String home;
-
-    /** */
-    private ThreadPoolExecutor execSvc;
-
-    /** */
-    private GridResourceProcessor rsrcProc;
-
-    /** */
-    public GridTestResources() {
-        log = rootLog.getLogger(getClass());
-        nodeId = UUID.randomUUID();
-        jmx = ManagementFactory.getPlatformMBeanServer();
-        home = U.getGridGainHome();
-        locHost = localHost();
-
-        GridTestKernalContext ctx = new GridTestKernalContext();
-
-        ctx.config().setGridLogger(log);
-
-        rsrcProc = new GridResourceProcessor(ctx);
-    }
-
-    /**
-     * @param jmx JMX server.
-     */
-    public GridTestResources(MBeanServer jmx) {
-        assert jmx != null;
-
-        this.jmx = jmx;
-
-        log = rootLog.getLogger(getClass());
-
-        nodeId = UUID.randomUUID();
-        home = U.getGridGainHome();
-        locHost = localHost();
-
-        GridTestKernalContext ctx = new GridTestKernalContext();
-
-        ctx.config().setGridLogger(log);
-
-        rsrcProc = new GridResourceProcessor(ctx);
-    }
-
-    /**
-     * @param log Logger.
-     */
-    public GridTestResources(IgniteLogger log) {
-        assert log != null;
-
-        this.log = log.getLogger(getClass());
-
-        nodeId = UUID.randomUUID();
-        jmx = ManagementFactory.getPlatformMBeanServer();
-        home = U.getGridGainHome();
-        locHost = localHost();
-
-        GridTestKernalContext ctx = new GridTestKernalContext();
-
-        ctx.config().setGridLogger(log);
-
-        rsrcProc = new GridResourceProcessor(ctx);
-    }
-
-    /**
-     * @return Resource processor.
-     */
-    public GridResourceProcessor resources() {
-        return rsrcProc;
-    }
-
-    /**
-     * @return Local host.
-     */
-    @Nullable private String localHost() {
-        try {
-            return U.getLocalHost().getHostAddress();
-        }
-        catch (IOException e) {
-            System.err.println("Failed to detect local host address.");
-
-            e.printStackTrace();
-
-            return null;
-        }
-    }
-
-    /**
-     * @param prestart Prestart flag.
-     */
-    public void startThreads(boolean prestart) {
-        execSvc = new IgniteThreadPoolExecutor(nodeId.toString(), 40, 40, 
Long.MAX_VALUE,
-            new LinkedBlockingQueue<Runnable>());
-
-        // Improve concurrency for testing.
-        if (prestart)
-            execSvc.prestartAllCoreThreads();
-    }
-
-    /** */
-    public void stopThreads() {
-        if (execSvc != null) {
-            U.shutdownNow(getClass(), execSvc, log);
-
-            execSvc = null;
-        }
-    }
-
-    /**
-     * @param target Target.
-     * @throws IgniteCheckedException If failed.
-     */
-    public void inject(Object target) throws IgniteCheckedException {
-        assert target != null;
-        assert getLogger() != null;
-
-        rsrcProc.injectBasicResource(target, IgniteLoggerResource.class, 
getLogger().getLogger(target.getClass()));
-        rsrcProc.injectBasicResource(target, IgniteInstanceResource.class,
-            new GridTestIgnite(null, locHost, nodeId, getMarshaller(), jmx, 
home));
-    }
-
-    /**
-     * @return Executor service.
-     */
-    public ExecutorService getExecutorService() {
-        return execSvc;
-    }
-
-    /**
-     * @return GridGain home.
-     */
-    public String getGridgainHome() {
-        return home;
-    }
-
-    /**
-     * @return MBean server.
-     */
-    public MBeanServer getMBeanServer() {
-        return jmx;
-    }
-
-    /**
-     * @return Logger for specified class.
-     */
-    public static IgniteLogger getLogger(Class<?> cls) {
-        return rootLog.getLogger(cls);
-    }
-
-    /**
-     * @return Logger.
-     */
-    public IgniteLogger getLogger() {
-        return log;
-    }
-
-    /**
-     * @return Node ID.
-     */
-    public UUID getNodeId() {
-        return nodeId;
-    }
-
-    /**
-     * @return Local host.
-     */
-    public String getLocalHost() {
-        return locHost;
-    }
-
-    /**
-     * @return Marshaller.
-     * @throws IgniteCheckedException If failed.
-     */
-    @SuppressWarnings("unchecked")
-    public synchronized IgniteMarshaller getMarshaller() throws 
IgniteCheckedException {
-        if (marshaller == null) {
-            String marshallerName = 
GridTestProperties.getProperty("marshaller.class");
-
-            if (marshallerName == null)
-                marshaller = new IgniteOptimizedMarshaller();
-            else {
-                try {
-                    Class<? extends IgniteMarshaller> cls = (Class<? extends 
IgniteMarshaller>)Class.forName(marshallerName);
-
-                    marshaller = cls.newInstance();
-                }
-                catch (ClassNotFoundException | IllegalAccessException | 
InstantiationException e) {
-                    throw new IgniteCheckedException("Failed to create test 
marshaller [marshaller=" + marshallerName + ']', e);
-                }
-            }
-        }
-
-        return marshaller;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
new file mode 100644
index 0000000..3e9c74d
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
@@ -0,0 +1,230 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.apache.ignite.testframework.junits;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.hadoop.*;
+import org.apache.ignite.internal.product.*;
+import org.apache.ignite.marshaller.*;
+import org.apache.ignite.plugin.*;
+import org.apache.ignite.plugin.security.*;
+import org.jetbrains.annotations.*;
+
+import javax.management.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Ignite mock.
+ */
+public class IgniteMock implements Ignite {
+    /** Ignite name */
+    private final String name;
+
+    /** Local host. */
+    private final String locHost;
+
+    /** */
+    private final UUID nodeId;
+
+    /** */
+    private IgniteMarshaller marshaller;
+
+    /** */
+    private final MBeanServer jmx;
+
+    /** */
+    private final String home;
+
+    /**
+     * Mock values
+     *
+     * @param name Name.
+     * @param locHost Local host.
+     * @param nodeId Node ID.
+     * @param marshaller Marshaller.
+     * @param jmx Jmx Bean Server.
+     * @param home Ignite home.
+     */
+    public IgniteMock(
+        String name, String locHost, UUID nodeId, IgniteMarshaller marshaller, 
MBeanServer jmx, String home) {
+        this.locHost = locHost;
+        this.nodeId = nodeId;
+        this.marshaller = marshaller;
+        this.jmx = jmx;
+        this.home = home;
+        this.name = name;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String name() {
+        return name;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteLogger log() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteConfiguration configuration() {
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setMarshaller(marshaller);
+        cfg.setNodeId(nodeId);
+        cfg.setMBeanServer(jmx);
+        cfg.setGridGainHome(home);
+        cfg.setLocalHost(locHost);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteCluster cluster() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteCompute compute() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteCompute compute(ClusterGroup prj) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteMessaging message() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteMessaging message(ClusterGroup prj) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteEvents events() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteEvents events(ClusterGroup prj) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteManaged managed() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteManaged managed(ClusterGroup prj) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public ExecutorService executorService() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public ExecutorService executorService(ClusterGroup prj) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteProduct product() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteScheduler scheduler() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public GridSecurity security() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgnitePortables portables() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public <K, V> GridCache<K, V> cache(@Nullable String name) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Collection<GridCache<?, ?>> caches() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public <K, V> IgniteCache<K, V> jcache(@Nullable String name) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteTransactions transactions() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public <K, V> IgniteDataLoader<K, V> dataLoader(@Nullable String 
cacheName) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteFs fileSystem(String name) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Collection<IgniteFs> fileSystems() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public GridHadoop hadoop() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public IgniteStreamer streamer(@Nullable String name) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Collection<IgniteStreamer> streamers() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public <T extends IgnitePlugin> T plugin(String name) throws 
PluginNotFoundException {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void close() throws IgniteCheckedException {}
+
+    /** {@inheritDoc} */
+    @Override public <K> CacheAffinity<K> affinity(String cacheName) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
new file mode 100644
index 0000000..3a271b0
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testframework.junits;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.resource.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.marshaller.*;
+import org.apache.ignite.marshaller.optimized.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.testframework.config.*;
+import org.apache.ignite.testframework.junits.logger.*;
+import org.apache.ignite.thread.*;
+import org.jetbrains.annotations.*;
+
+import javax.management.*;
+import java.io.*;
+import java.lang.management.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Test resources for injection.
+ */
+public class IgniteTestResources {
+    /** */
+    private static final IgniteLogger rootLog = new GridTestLog4jLogger(false);
+
+    /** */
+    private final IgniteLogger log;
+
+    /** Local host. */
+    private final String locHost;
+
+    /** */
+    private final UUID nodeId;
+
+    /** */
+    private IgniteMarshaller marshaller;
+
+    /** */
+    private final MBeanServer jmx;
+
+    /** */
+    private final String home;
+
+    /** */
+    private ThreadPoolExecutor execSvc;
+
+    /** */
+    private GridResourceProcessor rsrcProc;
+
+    /** */
+    public IgniteTestResources() {
+        log = rootLog.getLogger(getClass());
+        nodeId = UUID.randomUUID();
+        jmx = ManagementFactory.getPlatformMBeanServer();
+        home = U.getGridGainHome();
+        locHost = localHost();
+
+        GridTestKernalContext ctx = new GridTestKernalContext();
+
+        ctx.config().setGridLogger(log);
+
+        rsrcProc = new GridResourceProcessor(ctx);
+    }
+
+    /**
+     * @param jmx JMX server.
+     */
+    public IgniteTestResources(MBeanServer jmx) {
+        assert jmx != null;
+
+        this.jmx = jmx;
+
+        log = rootLog.getLogger(getClass());
+
+        nodeId = UUID.randomUUID();
+        home = U.getGridGainHome();
+        locHost = localHost();
+
+        GridTestKernalContext ctx = new GridTestKernalContext();
+
+        ctx.config().setGridLogger(log);
+
+        rsrcProc = new GridResourceProcessor(ctx);
+    }
+
+    /**
+     * @param log Logger.
+     */
+    public IgniteTestResources(IgniteLogger log) {
+        assert log != null;
+
+        this.log = log.getLogger(getClass());
+
+        nodeId = UUID.randomUUID();
+        jmx = ManagementFactory.getPlatformMBeanServer();
+        home = U.getGridGainHome();
+        locHost = localHost();
+
+        GridTestKernalContext ctx = new GridTestKernalContext();
+
+        ctx.config().setGridLogger(log);
+
+        rsrcProc = new GridResourceProcessor(ctx);
+    }
+
+    /**
+     * @return Resource processor.
+     */
+    public GridResourceProcessor resources() {
+        return rsrcProc;
+    }
+
+    /**
+     * @return Local host.
+     */
+    @Nullable private String localHost() {
+        try {
+            return U.getLocalHost().getHostAddress();
+        }
+        catch (IOException e) {
+            System.err.println("Failed to detect local host address.");
+
+            e.printStackTrace();
+
+            return null;
+        }
+    }
+
+    /**
+     * @param prestart Prestart flag.
+     */
+    public void startThreads(boolean prestart) {
+        execSvc = new IgniteThreadPoolExecutor(nodeId.toString(), 40, 40, 
Long.MAX_VALUE,
+            new LinkedBlockingQueue<Runnable>());
+
+        // Improve concurrency for testing.
+        if (prestart)
+            execSvc.prestartAllCoreThreads();
+    }
+
+    /** */
+    public void stopThreads() {
+        if (execSvc != null) {
+            U.shutdownNow(getClass(), execSvc, log);
+
+            execSvc = null;
+        }
+    }
+
+    /**
+     * @param target Target.
+     * @throws IgniteCheckedException If failed.
+     */
+    public void inject(Object target) throws IgniteCheckedException {
+        assert target != null;
+        assert getLogger() != null;
+
+        rsrcProc.injectBasicResource(target, IgniteLoggerResource.class, 
getLogger().getLogger(target.getClass()));
+        rsrcProc.injectBasicResource(target, IgniteInstanceResource.class,
+            new IgniteMock(null, locHost, nodeId, getMarshaller(), jmx, home));
+    }
+
+    /**
+     * @return Executor service.
+     */
+    public ExecutorService getExecutorService() {
+        return execSvc;
+    }
+
+    /**
+     * @return GridGain home.
+     */
+    public String getGridgainHome() {
+        return home;
+    }
+
+    /**
+     * @return MBean server.
+     */
+    public MBeanServer getMBeanServer() {
+        return jmx;
+    }
+
+    /**
+     * @return Logger for specified class.
+     */
+    public static IgniteLogger getLogger(Class<?> cls) {
+        return rootLog.getLogger(cls);
+    }
+
+    /**
+     * @return Logger.
+     */
+    public IgniteLogger getLogger() {
+        return log;
+    }
+
+    /**
+     * @return Node ID.
+     */
+    public UUID getNodeId() {
+        return nodeId;
+    }
+
+    /**
+     * @return Local host.
+     */
+    public String getLocalHost() {
+        return locHost;
+    }
+
+    /**
+     * @return Marshaller.
+     * @throws IgniteCheckedException If failed.
+     */
+    @SuppressWarnings("unchecked")
+    public synchronized IgniteMarshaller getMarshaller() throws 
IgniteCheckedException {
+        if (marshaller == null) {
+            String marshallerName = 
GridTestProperties.getProperty("marshaller.class");
+
+            if (marshallerName == null)
+                marshaller = new IgniteOptimizedMarshaller();
+            else {
+                try {
+                    Class<? extends IgniteMarshaller> cls = (Class<? extends 
IgniteMarshaller>)Class.forName(marshallerName);
+
+                    marshaller = cls.newInstance();
+                }
+                catch (ClassNotFoundException | IllegalAccessException | 
InstantiationException e) {
+                    throw new IgniteCheckedException("Failed to create test 
marshaller [marshaller=" + marshallerName + ']', e);
+                }
+            }
+        }
+
+        return marshaller;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d0d3f7/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
index 02bdf3a..462299d 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
@@ -143,7 +143,7 @@ public abstract class GridSpiAbstractTest<T extends 
IgniteSpi> extends GridAbstr
     }
 
     /** {@inheritDoc} */
-    @Override protected final GridTestResources getTestResources() {
+    @Override protected final IgniteTestResources getTestResources() {
         return getTestData().getTestResources();
     }
 
@@ -585,7 +585,7 @@ public abstract class GridSpiAbstractTest<T extends 
IgniteSpi> extends GridAbstr
         private Map<String, Object> allAttrs = new HashMap<>();
 
         /** */
-        private GridTestResources rsrcs = new GridTestResources();
+        private IgniteTestResources rsrcs = new IgniteTestResources();
 
         /**
          *
@@ -598,7 +598,7 @@ public abstract class GridSpiAbstractTest<T extends 
IgniteSpi> extends GridAbstr
          * @return Test resources.
          *
          */
-        public GridTestResources getTestResources() {
+        public IgniteTestResources getTestResources() {
             return rsrcs;
         }
 

Reply via email to