Skip to content

Commit 6930b5a

Browse files
Isolated real life example tests
1 parent f4b4e4e commit 6930b5a

10 files changed

Lines changed: 111 additions & 22 deletions

File tree

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Article.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/Article.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

1818
import java.util.ArrayList;
1919
import java.util.Collections;

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/ArticleGroup.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/ArticleGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

1818
public class ArticleGroup
1919
{

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Invoice.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/Invoice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

1818
import java.util.List;
1919

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/InvoiceRepository.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/InvoiceRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

1818
import org.springframework.data.repository.CrudRepository;
1919

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Position.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/Position.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

1818
import java.util.List;
1919
import java.util.Optional;

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/PositionRepository.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/PositionRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

1818
import org.springframework.data.repository.ListCrudRepository;
1919

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/RealLifeTests.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/RealLifeExamplesTest.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.tests;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

18-
import static software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.Position.getPositionWithArticleWithName;
18+
import static software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.Position.getPositionWithArticleWithName;
1919

2020
import java.util.ArrayList;
2121
import java.util.Arrays;
@@ -25,22 +25,15 @@
2525
import org.junit.jupiter.api.Assertions;
2626
import org.junit.jupiter.api.Test;
2727
import org.springframework.beans.factory.annotation.Autowired;
28+
import org.springframework.test.context.ContextConfiguration;
2829

2930
import software.xdev.spring.data.eclipse.store.helper.TestUtil;
30-
import software.xdev.spring.data.eclipse.store.integration.shared.DefaultTestAnnotations;
31-
import software.xdev.spring.data.eclipse.store.integration.shared.SharedTestConfiguration;
32-
import software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.Article;
33-
import software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.ArticleGroup;
34-
import software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.Invoice;
35-
import software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.InvoiceRepository;
36-
import software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.Position;
37-
import software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.PositionRepository;
38-
import software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example.Warehouse;
31+
import software.xdev.spring.data.eclipse.store.integration.isolated.IsolatedTestAnnotations;
3932

4033

41-
@SuppressWarnings("OptionalGetWithoutIsPresent")
42-
@DefaultTestAnnotations
43-
class RealLifeTests
34+
@IsolatedTestAnnotations
35+
@ContextConfiguration(classes = {RealLifeExamplesTestConfiguration.class})
36+
class RealLifeExamplesTest
4437
{
4538
static final String STATIONERY = "Stationery";
4639
static final String BUILDING_MATERIAL = "Building Material";
@@ -56,8 +49,13 @@ class RealLifeTests
5649
InvoiceRepository invoiceRepository;
5750
@Autowired
5851
PositionRepository positionRepository;
52+
private final RealLifeExamplesTestConfiguration configuration;
53+
5954
@Autowired
60-
private SharedTestConfiguration configuration;
55+
public RealLifeExamplesTest(final RealLifeExamplesTestConfiguration configuration)
56+
{
57+
this.configuration = configuration;
58+
}
6159

6260
private Invoice buildDefaultModel()
6361
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright © 2024 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
17+
18+
import org.eclipse.serializer.reflect.ClassLoaderProvider;
19+
import org.eclipse.store.integrations.spring.boot.types.configuration.EclipseStoreProperties;
20+
import org.eclipse.store.integrations.spring.boot.types.factories.EmbeddedStorageFoundationFactory;
21+
import org.springframework.beans.factory.ObjectProvider;
22+
import org.springframework.beans.factory.annotation.Autowired;
23+
import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers;
24+
import org.springframework.context.annotation.Bean;
25+
import org.springframework.context.annotation.Configuration;
26+
import org.springframework.transaction.PlatformTransactionManager;
27+
28+
import software.xdev.spring.data.eclipse.store.integration.TestConfiguration;
29+
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
30+
31+
32+
@Configuration
33+
@EnableEclipseStoreRepositories
34+
public class RealLifeExamplesTestConfiguration extends TestConfiguration
35+
{
36+
@Autowired
37+
protected RealLifeExamplesTestConfiguration(
38+
final EclipseStoreProperties defaultEclipseStoreProperties,
39+
final EmbeddedStorageFoundationFactory defaultEclipseStoreProvider,
40+
final ClassLoaderProvider classLoaderProvider)
41+
{
42+
super(defaultEclipseStoreProperties, defaultEclipseStoreProvider, classLoaderProvider);
43+
}
44+
45+
@Bean
46+
@Override
47+
public PlatformTransactionManager transactionManager(
48+
final ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers
49+
)
50+
{
51+
return super.transactionManager(transactionManagerCustomizers);
52+
}
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright © 2024 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
17+
18+
import static software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.Position.getPositionWithArticleWithName;
19+
20+
import java.util.ArrayList;
21+
import java.util.Arrays;
22+
import java.util.List;
23+
import java.util.Optional;
24+
25+
import org.junit.jupiter.api.Assertions;
26+
import org.junit.jupiter.api.Test;
27+
import org.springframework.beans.factory.annotation.Autowired;
28+
29+
import software.xdev.spring.data.eclipse.store.helper.TestUtil;
30+
import software.xdev.spring.data.eclipse.store.integration.shared.DefaultTestAnnotations;
31+
import software.xdev.spring.data.eclipse.store.integration.shared.SharedTestConfiguration;
32+
33+
34+
@SuppressWarnings("OptionalGetWithoutIsPresent")
35+
@DefaultTestAnnotations
36+
class RealLifeTests
37+
{
38+
}

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Warehouse.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/Warehouse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.shared.repositories.real.life.example;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

1818
import java.util.HashSet;
1919
import java.util.Set;

0 commit comments

Comments
 (0)