Merge pull request #12234 from dkapil/task/JAVA-11489

Task/java 11489
This commit is contained in:
kwoyke 2022-05-20 08:49:22 +02:00 committed by GitHub
commit e7221c9b84
10 changed files with 103 additions and 24 deletions

View File

@ -1090,6 +1090,66 @@
</plugins>
</build>
</profile>
<profile>
<id>integration-lite-first</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<phase>none</phase>
</execution>
<execution>
<id>npm install</id>
<phase>none</phase>
</execution>
<execution>
<id>webpack build dev</id>
<phase>none</phase>
</execution>
<execution>
<id>webpack build test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-lite-second</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<phase>none</phase>
</execution>
<execution>
<id>npm install</id>
<phase>none</phase>
</execution>
<execution>
<id>webpack build dev</id>
<phase>none</phase>
</execution>
<execution>
<id>webpack build test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>

View File

@ -5,7 +5,6 @@ import com.google.common.flogger.LoggerConfig;
import com.google.common.flogger.StackSize;
import org.junit.Test;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.stream.IntStream;
@ -25,13 +24,6 @@ public class FloggerIntegrationTest {
});
}
@Test
public void givenATimeInterval_shouldLogAfterEveryTimeInterval() {
IntStream.range(0, 1_000_0000).forEach(value -> {
logger.atInfo().atMostEvery(10, TimeUnit.SECONDS).log("This log shows [every 10 seconds] => %d", value);
});
}
@Test
public void givenAnObject_shouldLogTheObject() {
User user = new User();

View File

@ -0,0 +1,25 @@
package com.baeldung.flogger;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
import org.junit.Test;
import com.google.common.flogger.FluentLogger;
public class FloggerManualTest {
static {
// System.setProperty("flogger.backend_factory", "com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance");
System.setProperty("flogger.backend_factory",
"com.google.common.flogger.backend.slf4j.Slf4jBackendFactory#getInstance");
}
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
@Test
public void givenATimeInterval_shouldLogAfterEveryTimeInterval() {
IntStream.range(0, 1_000_0000).forEach(value -> {
logger.atInfo().atMostEvery(10, TimeUnit.SECONDS).log("This log shows [every 10 seconds] => %d", value);
});
}
}

View File

@ -366,7 +366,7 @@
<module>atomix</module>
<module>aws-modules</module>
<module>axon</module>
<module>azure</module>
@ -836,7 +836,7 @@
<module>atomix</module>
<module>aws-modules</module>
<module>axon</module>
<module>azure</module>
@ -895,7 +895,7 @@
<module>helidon</module>
<module>apache-httpclient</module>
<module>httpclient-simple</module>
<module>hystrix</module>
<module>hystrix</module>
<module>jackson-modules</module>
<module>jackson-simple</module>
@ -1209,6 +1209,7 @@
<module>jenkins/plugins</module>
<module>jhipster</module>
<module>jhipster-5</module>
<module>jws</module>
<module>libraries</module> <!-- very long running -->
@ -1326,7 +1327,7 @@
<module>quarkus-vs-springboot</module>
<module>quarkus-jandex</module>
<module>spring-boot-modules/spring-boot-cassandre</module>
<module>spring-boot-modules/spring-boot-camel</module>
<module>spring-boot-modules/spring-boot-camel</module>
<module>testing-modules/testing-assertions</module>
<module>persistence-modules/fauna</module>
<module>lightrun</module>

View File

@ -1 +1,2 @@
app.name=restx-demo
app.name=restx-demo
restx.stats.share.enable=false

View File

@ -7,7 +7,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class Example1IntegrationTest {
public class Example1ManualTest {
@Test
public void test1a() {

View File

@ -7,7 +7,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class Example2IntegrationTest {
public class Example2ManualTest {
@Test
public void test1a() {

View File

@ -5,18 +5,18 @@ import org.junit.experimental.ParallelComputer;
import org.junit.runner.Computer;
import org.junit.runner.JUnitCore;
public class ParallelIntegrationTest {
public class ParallelManualTest {
@Test
public void runTests() {
final Class<?>[] classes = { Example1IntegrationTest.class, Example2IntegrationTest.class };
final Class<?>[] classes = { Example1ManualTest.class, Example2ManualTest.class };
JUnitCore.runClasses(new Computer(), classes);
}
@Test
public void runTestsInParallel() {
final Class<?>[] classes = { Example1IntegrationTest.class, Example2IntegrationTest.class };
final Class<?>[] classes = { Example1ManualTest.class, Example2ManualTest.class };
JUnitCore.runClasses(new ParallelComputer(true, true), classes);
}

View File

@ -1,24 +1,24 @@
package com.baeldung.jupiter;
import com.baeldung.Example1IntegrationTest;
import com.baeldung.Example2IntegrationTest;
import com.baeldung.Example1ManualTest;
import com.baeldung.Example2ManualTest;
import org.junit.experimental.ParallelComputer;
import org.junit.jupiter.api.Test;
import org.junit.runner.Computer;
import org.junit.runner.JUnitCore;
class Spring5JUnit5ParallelIntegrationTest {
class Spring5JUnit5ParallelManualTest {
@Test
void givenTwoTestClasses_whenJUnitRunParallel_thenTheTestsExecutingParallel() {
final Class<?>[] classes = { Example1IntegrationTest.class, Example2IntegrationTest.class };
final Class<?>[] classes = { Example1ManualTest.class, Example2ManualTest.class };
JUnitCore.runClasses(new ParallelComputer(true, true), classes);
}
@Test
void givenTwoTestClasses_whenJUnitRunParallel_thenTheTestsExecutingLinear() {
final Class<?>[] classes = { Example1IntegrationTest.class, Example2IntegrationTest.class };
final Class<?>[] classes = { Example1ManualTest.class, Example2ManualTest.class };
JUnitCore.runClasses(new Computer(), classes);
}

View File

@ -24,7 +24,7 @@ import org.springframework.web.context.WebApplicationContext;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = SpringBootPropertiesTestApplication.class)
public class PropertiesReloadIntegrationTest {
public class PropertiesReloadManualTest {
protected MockMvc mvc;