ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/9] incubator-ignite git commit: IGNITE-35 Removed unnecessary injected resources.
Date Fri, 19 Dec 2014 13:32:53 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-35 [created] 80e8ba185


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55936e46/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceFieldInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceFieldInjectionSelfTest.java
b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceFieldInjectionSelfTest.java
index 6d56964..9f3a0de 100644
--- a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceFieldInjectionSelfTest.java
+++ b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceFieldInjectionSelfTest.java
@@ -410,38 +410,10 @@ public class GridResourceFieldInjectionSelfTest extends GridCommonAbstractTest
{
         private Ignite ignite;
 
         /** */
-        @IgniteLocalHostResource
-        private String locHost;
-
-        /** */
-        @IgniteLocalNodeIdResource
-        private UUID nodeId;
-
-        /** */
-        @IgniteMBeanServerResource
-        private MBeanServer mbeanSrv;
-
-        /** */
-        @IgniteExecutorServiceResource
-        private ExecutorService exec;
-
-        /** */
         @IgniteLoadBalancerResource
         private ComputeLoadBalancer balancer;
 
         /** */
-        @IgniteHomeResource
-        private String ggHome;
-
-        /** */
-        @IgniteNameResource
-        private String gridName;
-
-        /** */
-        @IgniteMarshallerResource
-        private IgniteMarshaller marshaller;
-
-        /** */
         @IgniteSpringApplicationContextResource
         private ApplicationContext springCtx;
 
@@ -469,13 +441,6 @@ public class GridResourceFieldInjectionSelfTest extends GridCommonAbstractTest
{
             assert rsrc4 != null;
             assert log != null;
             assert ignite != null;
-            assert nodeId != null;
-            assert locHost != null;
-            assert mbeanSrv != null;
-            assert exec != null;
-            assert ggHome != null;
-            assert gridName != null;
-            assert marshaller != null;
             assert springCtx != null;
             assert springBean != null;
             assert ses != null;
@@ -492,13 +457,6 @@ public class GridResourceFieldInjectionSelfTest extends GridCommonAbstractTest
{
             log.info("Injected shared resource4 into task: " + rsrc4);
             log.info("Injected log resource into task: " + log);
             log.info("Injected grid resource into task: " + ignite);
-            log.info("Injected nodeId resource into task: " + nodeId);
-            log.info("Injected local host resource into task: " + locHost);
-            log.info("Injected mbean server resource into task: " + mbeanSrv);
-            log.info("Injected executor service resource into task: " + exec);
-            log.info("Injected gridgain home resource into task: " + ggHome);
-            log.info("Injected grid name resource into task: " + gridName);
-            log.info("Injected marshaller resource into task: " + marshaller);
             log.info("Injected spring context resource into task: " + springCtx);
             log.info("Injected spring bean resource into task: " + springBean);
             log.info("Injected load balancer into task: " + balancer);
@@ -549,19 +507,12 @@ public class GridResourceFieldInjectionSelfTest extends GridCommonAbstractTest
{
                         assert rsrc4 != null;
                         assert log != null;
                         assert ignite != null;
-                        assert nodeId != null;
-                        assert mbeanSrv != null;
-                        assert exec != null;
-                        assert ggHome != null;
-                        assert gridName != null;
-                        assert marshaller != null;
                         assert springCtx != null;
                         assert springBean != null;
                         assert springBean2 != null;
                         assert ses != null;
                         assert jobCtx != null;
                         assert outerJobCtx == null;
-                        assert locHost != null;
 
                         assert rsrc5 != null;
                         assert rsrc6 != null;
@@ -582,13 +533,6 @@ public class GridResourceFieldInjectionSelfTest extends GridCommonAbstractTest
{
                         log.info("Injected shared resource10 into job: " + rsrc10);
                         log.info("Injected log resource into job: " + log);
                         log.info("Injected grid resource into job: " + ignite);
-                        log.info("Injected nodeId resource into job: " + nodeId);
-                        log.info("Injected localHost resource into job: " + locHost);
-                        log.info("Injected mbean server resource into job: " + mbeanSrv);
-                        log.info("Injected executor service resource into job: " + exec);
-                        log.info("Injected gridgain home resource into job: " + ggHome);
-                        log.info("Injected grid name resource into job: " + gridName);
-                        log.info("Injected marshaller resource into job: " + marshaller);
                         log.info("Injected spring context resource into job: " + springCtx);
                         log.info("Injected spring bean resource into job: " + springBean2);
                         log.info("Injected session resource into job: " + ses);
@@ -611,17 +555,10 @@ public class GridResourceFieldInjectionSelfTest extends GridCommonAbstractTest
{
             assert rsrc4 != null;
             assert log != null;
             assert ignite != null;
-            assert nodeId != null;
-            assert mbeanSrv != null;
-            assert exec != null;
-            assert ggHome != null;
-            assert gridName != null;
-            assert marshaller != null;
             assert springCtx != null;
             assert springBean != null;
             assert ses != null;
             assert balancer != null;
-            assert locHost != null;
 
             // Nothing to reduce.
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55936e46/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodInjectionSelfTest.java
b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodInjectionSelfTest.java
index 9f7a1c4..f5d7302 100644
--- a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodInjectionSelfTest.java
+++ b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodInjectionSelfTest.java
@@ -201,27 +201,12 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
         private Ignite ignite;
 
         /** */
-        private UUID nodeId;
-
-        /** */
-        private MBeanServer mbeanSrv;
-
-        /** */
-        private ExecutorService exec;
-
-        /** */
         private String ggHome;
 
         /** */
-        private String gridName;
-
-        /** */
         private String locHost;
 
         /** */
-        private IgniteMarshaller marshaller;
-
-        /** */
         private ApplicationContext springCtx;
 
         /** */
@@ -288,54 +273,6 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
         }
 
         /**
-         * @param nodeId Node ID.
-         */
-        @IgniteLocalNodeIdResource
-        public void setNodeId(UUID nodeId) {
-            this.nodeId = nodeId;
-        }
-
-        /**
-         * @param mbeanSrv MBean server.
-         */
-        @IgniteMBeanServerResource
-        public void setMbeanServer(MBeanServer mbeanSrv) {
-            this.mbeanSrv = mbeanSrv;
-        }
-
-        /**
-         * @param exec Executor.
-         */
-        @IgniteExecutorServiceResource
-        public void setExecutor(ExecutorService exec) {
-            this.exec = exec;
-        }
-
-        /**
-         * @param ggHome GridGain home.
-         */
-        @IgniteHomeResource
-        public void setGridgainHome(String ggHome) {
-            this.ggHome = ggHome;
-        }
-
-        /**
-         * @param gridName Grid name.
-         */
-        @IgniteNameResource
-        public void setGridName(String gridName) {
-            this.gridName = gridName;
-        }
-
-        /**
-         * @param marshaller Marshaller.
-         */
-        @IgniteMarshallerResource
-        public void setMarshaller(IgniteMarshaller marshaller) {
-            this.marshaller = marshaller;
-        }
-
-        /**
          * @param springCtx Spring context.
          */
         @IgniteSpringApplicationContextResource
@@ -352,14 +289,6 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
         }
 
         /**
-         * @param locHost Local host.
-         */
-        @IgniteLocalHostResource
-        public void setLocalHost(String locHost) {
-            this.locHost = locHost;
-        }
-
-        /**
          * @param balancer Load balancer.
          */
         @IgniteLoadBalancerResource
@@ -399,13 +328,8 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
             assert rsrc4 != null;
             assert log != null;
             assert ignite != null;
-            assert nodeId != null;
-            assert mbeanSrv != null;
-            assert exec != null;
             assert ggHome != null;
-            assert gridName != null;
             assert locHost != null;
-            assert marshaller != null;
             assert springCtx != null;
             assert ses != null;
             assert balancer != null;
@@ -421,13 +345,8 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
             log.info("Injected shared resource4 into task: " + rsrc4);
             log.info("Injected log resource into task: " + log);
             log.info("Injected grid resource into task: " + ignite);
-            log.info("Injected nodeId resource into task: " + nodeId);
-            log.info("Injected mbean server resource into task: " + mbeanSrv);
-            log.info("Injected executor service resource into task: " + exec);
             log.info("Injected gridgain home resource into task: " + ggHome);
-            log.info("Injected grid name resource into task: " + gridName);
             log.info("Injected local host resource into task: " + locHost);
-            log.info("Injected marshaller resource into task: " + marshaller);
             log.info("Injected spring context resource into task: " + springCtx);
             log.info("Injected session resource into task: " + ses);
             log.info("Injected load balancer into task: " + balancer);
@@ -527,13 +446,8 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
                         assert rsrc4 != null;
                         assert log != null;
                         assert ignite != null;
-                        assert nodeId != null;
-                        assert mbeanSrv != null;
-                        assert exec != null;
                         assert ggHome != null;
-                        assert gridName != null;
                         assert locHost != null;
-                        assert marshaller != null;
                         assert springCtx != null;
                         assert ses != null;
                         assert jobCtx != null;
@@ -559,13 +473,9 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
                         log.info("Injected shared resource10 into job: " + rsrc10);
                         log.info("Injected log resource into job: " + log);
                         log.info("Injected grid resource into job: " + ignite);
-                        log.info("Injected nodeId resource into job: " + nodeId);
                         log.info("Injected local Host resource into job: " + locHost);
-                        log.info("Injected mbean server resource into job: " + mbeanSrv);
-                        log.info("Injected executor service resource into job: " + exec);
                         log.info("Injected gridgain home resource into job: " + ggHome);
                         log.info("Injected grid name resource into job: " + ggHome);
-                        log.info("Injected marshaller resource into job: " + marshaller);
                         log.info("Injected spring context resource into job: " + springCtx);
                         log.info("Injected session resource into job: " + ses);
                         log.info("Injected job context resource into job: " + jobCtx);
@@ -587,12 +497,8 @@ public class GridResourceMethodInjectionSelfTest extends GridCommonAbstractTest
             assert rsrc4 != null;
             assert log != null;
             assert ignite != null;
-            assert nodeId != null;
             assert locHost != null;
-            assert mbeanSrv != null;
-            assert exec != null;
             assert ggHome != null;
-            assert marshaller != null;
             assert springCtx != null;
             assert ses != null;
             assert balancer != null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55936e46/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodOverrideInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodOverrideInjectionSelfTest.java
b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodOverrideInjectionSelfTest.java
index d69d7b6..5b8e2dc 100644
--- a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodOverrideInjectionSelfTest.java
+++ b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceMethodOverrideInjectionSelfTest.java
@@ -98,15 +98,6 @@ public class GridResourceMethodOverrideInjectionSelfTest extends GridCommonAbstr
         protected Ignite ignite;
 
         /** */
-        protected UUID nodeId;
-
-        /** */
-        protected MBeanServer mbeanSrv;
-
-        /** */
-        protected ExecutorService exec;
-
-        /** */
         protected String ggHome;
 
         /** */
@@ -175,44 +166,6 @@ public class GridResourceMethodOverrideInjectionSelfTest extends GridCommonAbstr
         void setIgnite(Ignite ignite) { this.ignite = ignite; }
 
         /**
-         * @param nodeId UUID.
-         */
-        @IgniteLocalNodeIdResource
-        public void setNodeId(UUID nodeId) {
-            this.nodeId = nodeId;
-        }
-
-        /**
-         * @param mbeanSrv MBeanServer.
-         */
-        @IgniteMBeanServerResource
-        @SuppressWarnings("unused")
-        protected void setMbeanServer(MBeanServer mbeanSrv) { this.mbeanSrv = mbeanSrv; }
-
-        /**
-         * @param exec ExecutorService.
-         */
-        @IgniteExecutorServiceResource
-        @SuppressWarnings("unused")
-        public void setExecutor(ExecutorService exec) {
-            this.exec = exec;
-        }
-
-        /**
-         * @param ggHome GridGain Home.
-         */
-        @SuppressWarnings({"UnusedDeclaration", "unused"})
-        @IgniteHomeResource
-        private void setGridGainHome(String ggHome) { this.ggHome = ggHome; }
-
-        /**
-         * @param gridName Grid name.
-         */
-        @SuppressWarnings({"UnusedDeclaration", "unused"})
-        @IgniteHomeResource
-        private void setGridName(String gridName) { this.gridName = gridName; }
-
-        /**
          * @param springCtx Spring Application Context.
          */
         @IgniteSpringApplicationContextResource
@@ -318,9 +271,6 @@ public class GridResourceMethodOverrideInjectionSelfTest extends GridCommonAbstr
             assert rsrc4 != null;
             assert log != null;
             assert ignite != null;
-            assert nodeId != null;
-            assert mbeanSrv != null;
-            assert exec != null;
             assert ggHome != null;
             assert gridName != null;
             assert springCtx != null;
@@ -337,9 +287,6 @@ public class GridResourceMethodOverrideInjectionSelfTest extends GridCommonAbstr
             log.info("Injected shared resource4 into task: " + rsrc4);
             log.info("Injected log resource into task: " + log);
             log.info("Injected grid resource into task: " + ignite);
-            log.info("Injected nodeId resource into task: " + nodeId);
-            log.info("Injected mbean server resource into task: " + mbeanSrv);
-            log.info("Injected executor service resource into task: " + exec);
             log.info("Injected gridgain home resource into task: " + ggHome);
             log.info("Injected grid name resource into task: " + gridName);
             log.info("Injected spring context resource into task: " + springCtx);
@@ -408,9 +355,6 @@ public class GridResourceMethodOverrideInjectionSelfTest extends GridCommonAbstr
                         assert rsrc4 != null;
                         assert log != null;
                         assert ignite != null;
-                        assert nodeId != null;
-                        assert mbeanSrv != null;
-                        assert exec != null;
                         assert ggHome != null;
                         assert gridName != null;
                         assert springCtx != null;
@@ -436,9 +380,6 @@ public class GridResourceMethodOverrideInjectionSelfTest extends GridCommonAbstr
                         log.info("Injected shared resource8 into job: " + rsrc8);
                         log.info("Injected log resource into job: " + log);
                         log.info("Injected grid resource into job: " + ignite);
-                        log.info("Injected nodeId resource into job: " + nodeId);
-                        log.info("Injected mbean server resource into job: " + mbeanSrv);
-                        log.info("Injected executor service resource into job: " + exec);
                         log.info("Injected gridgain home resource into job: " + ggHome);
                         log.info("Injected grid grid name resource into job: " + gridName);
                         log.info("Injected spring context resource into job: " + springCtx);
@@ -461,9 +402,6 @@ public class GridResourceMethodOverrideInjectionSelfTest extends GridCommonAbstr
             assert rsrc4 != null;
             assert log != null;
             assert ignite != null;
-            assert nodeId != null;
-            assert mbeanSrv != null;
-            assert exec != null;
             assert ggHome != null;
             assert gridName != null;
             assert springCtx != null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55936e46/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessorSelfTest.java
b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessorSelfTest.java
index f37aa6b..5cb5bbf 100644
--- a/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessorSelfTest.java
+++ b/modules/spring/src/test/java/org/gridgain/grid/kernal/processors/resource/GridResourceProcessorSelfTest.java
@@ -326,11 +326,13 @@ public class GridResourceProcessorSelfTest extends GridCommonAbstractTest
{
 
                 /** Runnable object nested inside callable. */
                 private Runnable run = new IgniteRunnable() {
-                    @IgniteHomeResource
-                    private String ggHomeDir;
+                    @IgniteInstanceResource
+                    private Ignite ignite;
 
                     @Override public void run() {
-                        assert ggHomeDir != null;
+                        assert ignite != null;
+                        assert ignite.configuration() != null;
+                        assert ignite.configuration().getGridGainHome() != null;
                     }
                 };
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55936e46/modules/spring/src/test/java/org/gridgain/grid/p2p/GridP2PAbstractUserResource.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/gridgain/grid/p2p/GridP2PAbstractUserResource.java
b/modules/spring/src/test/java/org/gridgain/grid/p2p/GridP2PAbstractUserResource.java
index 197be2c..8fb7442 100644
--- a/modules/spring/src/test/java/org/gridgain/grid/p2p/GridP2PAbstractUserResource.java
+++ b/modules/spring/src/test/java/org/gridgain/grid/p2p/GridP2PAbstractUserResource.java
@@ -39,22 +39,6 @@ abstract class GridP2PAbstractUserResource {
     private Ignite ignite;
 
     /** */
-    @IgniteLocalNodeIdResource
-    private UUID nodeId;
-
-    /** */
-    @IgniteMBeanServerResource
-    private MBeanServer mbeanSrv;
-
-    /** */
-    @IgniteExecutorServiceResource
-    private ExecutorService exec;
-
-    /** */
-    @IgniteHomeResource
-    private String ggHome;
-
-    /** */
     @IgniteSpringApplicationContextResource
     private ApplicationContext springCtx;
 
@@ -131,10 +115,6 @@ abstract class GridP2PAbstractUserResource {
 
         assert log != null;
         assert ignite != null;
-        assert nodeId != null;
-        assert mbeanSrv != null;
-        assert exec != null;
-        assert ggHome != null;
         assert springCtx != null;
 
         log.info("Deploying resource: " + this);
@@ -148,10 +128,6 @@ abstract class GridP2PAbstractUserResource {
 
         assert log != null;
         assert ignite != null;
-        assert nodeId != null;
-        assert mbeanSrv != null;
-        assert exec != null;
-        assert ggHome != null;
         assert springCtx != null;
 
         log.info("Undeploying resource: " + this);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55936e46/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSpi.java
----------------------------------------------------------------------
diff --git a/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSpi.java
b/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSpi.java
index ed5c1a7..f87d476 100644
--- a/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSpi.java
+++ b/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSpi.java
@@ -372,10 +372,6 @@ public class GridUriDeploymentSpi extends IgniteSpiAdapter implements
Deployment
     @IgniteLoggerResource
     private IgniteLogger log;
 
-    /** */
-    @IgniteLocalNodeIdResource
-    private UUID locNodeId;
-
     /** NOTE: flag for test purposes only. */
     @SuppressWarnings("UnusedDeclaration")
     private boolean delayOnNewOrUpdatedFile;
@@ -1079,7 +1075,8 @@ public class GridUriDeploymentSpi extends IgniteSpiAdapter implements
Deployment
         if (tmpDirPath == null)
             throw new IgniteSpiException("Error initializing temporary deployment directory.");
 
-        File dir = new File(tmpDirPath + File.separator + DEPLOY_TMP_ROOT_NAME + File.separator
+ locNodeId);
+        File dir = new File(tmpDirPath + File.separator + DEPLOY_TMP_ROOT_NAME + File.separator
+
+            ignite.configuration().getNodeId());
 
         if (!U.mkdirs(dir))
             throw new IgniteSpiException("Error initializing temporary deployment directory:
" + dir);


Mime
View raw message