[BAEL-9498] Fix failing context tests - part 2 (#7738)

* fixed Spring Context Test in spring-data-rest-querydsl module

* fixed spring-ejb/spring-ejb-client Context tests, removed ContextIntegrationTest and added a note to the ContextLiveTest. Plus, redefined spring-ejb-remote url in pom, it was not working properly'

* Fixed Context test in spring-remoting/remoting-jms/remoting-jms-server, added notes for Live Test

* Fixed Context test in spring-remoting/remoting-rmi\remoting-rmi-server, added notes for Live Test

* Fixed Context test in spring-rest-query-language, added note for ContextTest and deleter ContextIntegrationTest

* renamed SpringContextIntegrationTest to SpringContextTest, as per comment in BAEL-14304
This commit is contained in:
Ger Roza 2019-09-09 08:16:40 -03:00 committed by Josh Cummings
parent 27b5ddfb38
commit b6183e9315
13 changed files with 72 additions and 77 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId>
@ -44,6 +45,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@ -13,6 +13,9 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import javax.annotation.PostConstruct;
/**
* Note: In the IDE, remember to generate query type classes before running the Integration Test (e.g. in Eclipse right-click on the project > Run As > Maven generate sources)
*/
@SpringBootApplication
@EntityScan("com.baeldung.entity")
@EnableJpaRepositories("com.baeldung.controller.repository")

View File

@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -7,9 +7,13 @@ import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.Application;
/**
* Note: In the IDE, remember to generate query type classes before running the Integration Test (e.g. in Eclipse right-click on the project > Run As > Maven generate sources)
*
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SpringContextIntegrationTest {
public class SpringContextTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {

View File

@ -1,17 +0,0 @@
package org.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.Application;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SpringContextLiveTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -0,0 +1,11 @@
spring:
datasource:
url: jdbc:h2:mem:springcloud
username: sa
password:
jpa:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect

View File

@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -7,6 +7,11 @@ import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.springejbclient.SpringEjbClientApplication;
/**
* This Live Test requires:
* * run the `spring-ejb-remote` module with the following command: `mvn clean package cargo:run -Pwildfly-standalone`
*
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringEjbClientApplication.class)
public class SpringContextLiveTest {

View File

@ -1,17 +0,0 @@
package org.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.springejbclient.SpringEjbClientApplication;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringEjbClientApplication.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-ejb-remote</artifactId>
@ -46,7 +47,7 @@
<container>
<containerId>wildfly10x</containerId>
<zipUrlInstaller>
<url>http://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.zip</url>
<url>https://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.zip</url>
</zipUrlInstaller>
</container>

View File

@ -0,0 +1,23 @@
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.server.JmsServer;
/**
* This Live Test requires:
* * the `com.baeldung:remoting-http-api:jar:1.0-SNAPSHOT` artifact accessible. For that we can run `mvn clean install` in the 'spring-remoting/remoting-http/remoting-http-api' module.
* * an ActiveMQ instance running (e.g. `docker run -p 61616:61616 -p 8161:8161 --name bael-activemq rmohr/activemq`)
*
*/
@SpringBootTest(classes = JmsServer.class)
@RunWith(SpringRunner.class)
public class SpringContextLiveTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -1,17 +0,0 @@
package org.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.server.JmsServer;
@SpringBootTest(classes = JmsServer.class)
@RunWith(SpringRunner.class)
public class SpringContextManualTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -7,6 +7,12 @@ import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.client.RmiClient;
/**
* This Live Test requires:
* * the `com.baeldung:remoting-http-api:jar:1.0-SNAPSHOT` artifact accessible. For that we can run `mvn clean install` in the 'spring-remoting/remoting-http/remoting-http-api' module.
* * the 'spring-remoting\remoting-rmi\remoting-rmi-server' service running
*
*/
@SpringBootTest(classes = RmiClient.class)
@RunWith(SpringRunner.class)
public class SpringContextLiveTest {

View File

@ -1,17 +0,0 @@
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.spring.Application;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SpringContextIntegrationTest {
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}
}

View File

@ -7,6 +7,10 @@ import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.spring.Application;
/**
* Note: In the IDE, remember to generate query type classes before running the Integration Test (e.g. in Eclipse right-click on the project > Run As > Maven generate sources)
*
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SpringContextTest {