You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by av...@apache.org on 2015/08/05 17:52:28 UTC
[29/33] incubator-ignite git commit: IGNITE-1185 Locate configuration
in class path: Add tests.
IGNITE-1185 Locate configuration in class path: Add tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/79f27f4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/79f27f4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/79f27f4a
Branch: refs/heads/ignite-1093
Commit: 79f27f4a3a2238d8ec196aa92bb35c8d10ce5d36
Parents: 518b623
Author: sevdokimov <se...@gridgain.com>
Authored: Mon Aug 3 13:46:40 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon Aug 3 13:46:40 2015 +0300
----------------------------------------------------------------------
.../src/test/java/config/ignite-test-config.xml | 43 ++++++++++++++++++++
.../ignite/internal/GridFactorySelfTest.java | 9 ++++
2 files changed, 52 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/79f27f4a/modules/spring/src/test/java/config/ignite-test-config.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/config/ignite-test-config.xml b/modules/spring/src/test/java/config/ignite-test-config.xml
new file mode 100644
index 0000000..145d124
--- /dev/null
+++ b/modules/spring/src/test/java/config/ignite-test-config.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+
+<!--
+ Ignite configuration with all defaults and enabled p2p deployment and enabled events.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="localHost" value="127.0.0.1" />
+
+ <property name="gridName" value="config-in-classpath"/>
+
+ <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="ipFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+ <property name="shared" value="true"/>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/79f27f4a/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 ecc7fb7..fb8cbfe 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
@@ -824,6 +824,15 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
}
/**
+ * @throws Exception If failed.
+ */
+ public void testConfigInClassPath() throws Exception {
+ try (Ignite ignite = Ignition.start("config/ignite-test-config.xml")) {
+ assert "config-in-classpath".equals(ignite.name());
+ }
+ }
+
+ /**
* Test task.
*/
private static class TestTask extends ComputeTaskSplitAdapter<Void, Void> {