Skip to content

Commit 60fba0e

Browse files
authored
IGNITE-17053 Fix spring-data-ext examples (#158)
IGNITE-17053 Fixed spring-data-ext examples and documentation
1 parent 0fb51d9 commit 60fba0e

8 files changed

Lines changed: 79 additions & 17 deletions

File tree

docs/_docs/spring/spring-data.adoc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tab:pom.xml[]
3232
----
3333
<dependency>
3434
<groupId>org.apache.ignite</groupId>
35-
<artifactId>ignite-spring-data-2.2-ext</artifactId>
35+
<artifactId>ignite-spring-data-ext</artifactId>
3636
<version>${ignite-spring-data-ext.version}</version>
3737
</dependency>
3838
@@ -75,12 +75,6 @@ Apache Ignite each one is compatible with.
7575
| 1.0.0 | All versions since 2.8.0
7676
|===
7777

78-
[NOTE]
79-
====
80-
If your Spring Data version is earlier than Spring Data 2.2 then set `ignite-spring-data-2.0-ext`
81-
or `ignite-spring-data-ext` as an `artifactId` in the pom.xml configuration.
82-
====
83-
8478
== Apache Ignite Repository
8579

8680
Apache Ignite introduces a special `IgniteRepository` interface that extends default `CrudRepository`. This interface
@@ -287,7 +281,7 @@ System.out.println("\n>>> Top Person with surname 'Smith': " +
287281

288282
== Example
289283

290-
The complete example is available on link: https://github.com/apache/ignite-extensions/tree/master/modules/spring-data-2.0-ext/examples/main[GitHub, windows="_blank"]
284+
The complete example is available on link: https://github.com/apache/ignite-extensions/tree/master/modules/spring-data-ext/examples[GitHub, windows="_blank"]
291285

292286
== Tutorial
293287

modules/spring-data-ext/examples/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,20 @@
8585
</exclusion>
8686
</exclusions>
8787
</dependency>
88+
89+
<dependency>
90+
<groupId>org.apache.ignite</groupId>
91+
<artifactId>ignite-core</artifactId>
92+
<version>${ignite.version}</version>
93+
<type>test-jar</type>
94+
<scope>test</scope>
95+
</dependency>
96+
97+
<dependency>
98+
<groupId>org.apache.ignite</groupId>
99+
<artifactId>ignite-log4j2</artifactId>
100+
<version>${ignite.version}</version>
101+
<scope>test</scope>
102+
</dependency>
88103
</dependencies>
89104
</project>

modules/spring-data-ext/examples/src/main/java/org/apache/ignite/springdata/examples/SpringApplicationConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public class SpringApplicationConfiguration {
4848
*/
4949
@Bean
5050
public Ignite igniteInstance() {
51-
return Ignition.start("modules/spring-data-2.2-ext/examples/config/example-spring-data.xml");
51+
return Ignition.start("example-spring-data.xml");
5252
}
5353
}

modules/spring-data-ext/examples/src/main/java/org/apache/ignite/springdata/examples/SpringDataExample.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232

3333
/**
3434
* The example demonstrates how to interact with an Apache Ignite cluster by means of Spring Data API.
35-
*
36-
* Additional cluster nodes can be started with special configuration file which
37-
* enables P2P class loading: {@code 'ignite.{sh|bat} modules/spring-data-2.2/examples/config/example-spring-data.xml'}.
3835
*/
3936
public class SpringDataExample {
4037
/** Spring Application Context. */

modules/spring-data-ext/examples/config/example-default.xml renamed to modules/spring-data-ext/examples/src/main/resources/example-default.xml

File renamed without changes.

modules/spring-data-ext/examples/config/example-spring-data.xml renamed to modules/spring-data-ext/examples/src/main/resources/example-spring-data.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
2626
Use this configuration file when running Spring Data examples.
2727
28-
When starting a standalone node, you need to execute the following command:
29-
{IGNITE_HOME}/bin/ignite.{bat|sh} modules/spring-data-ext/examples/config/example-spring-data.xml
30-
3128
When starting Ignite from Java IDE, pass path to this file to Ignition:
32-
Ignition.start("modules/spring-data-ext/examples/config/example-spring-data.xml");
29+
Ignition.start("example-spring-data.xml");
3330
-->
3431
<beans xmlns="http://www.springframework.org/schema/beans"
3532
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -54,7 +51,7 @@
5451
<property name="indexedTypes">
5552
<list>
5653
<value>java.lang.Long</value>
57-
<value>org.apache.ignite.springdata22.examples.model.Person</value>
54+
<value>org.apache.ignite.springdata.examples.model.Person</value>
5855
</list>
5956
</property>
6057
</bean>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.ignite.springdata.examples;
19+
20+
import org.junit.runner.RunWith;
21+
import org.junit.runners.Suite;
22+
23+
/** */
24+
@RunWith(Suite.class)
25+
@Suite.SuiteClasses({
26+
SpringDataExampleTest.class
27+
})
28+
public class IgniteSpringDataExamplesTestSuite {
29+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.ignite.springdata.examples;
19+
20+
import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
21+
import org.junit.Test;
22+
23+
/** */
24+
public class SpringDataExampleTest extends GridAbstractExamplesTest {
25+
/** */
26+
@Test
27+
public void testExample() {
28+
SpringDataExample.main(EMPTY_ARGS);
29+
}
30+
}

0 commit comments

Comments
 (0)