-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring of min-level set tests for better naming
- Loading branch information
Showing
20 changed files
with
134 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...c/main/java/io/quarkus/it/logging/minlevel/set/promote/sub/LoggingMinLevelPromoteSub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.quarkus.it.logging.minlevel.set.promote.sub; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
import io.quarkus.it.logging.minlevel.set.LoggingWitness; | ||
|
||
@Path("/log/promote/sub") | ||
public class LoggingMinLevelPromoteSub { | ||
|
||
static final Logger LOG = Logger.getLogger(LoggingMinLevelPromoteSub.class); | ||
|
||
@GET | ||
@Path("/not-info") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public boolean isNotInfo() { | ||
return !LOG.isInfoEnabled() && !LoggingWitness.loggedInfo("should not print", LOG); | ||
} | ||
|
||
@GET | ||
@Path("/error") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public boolean isError() { | ||
return LoggingWitness.loggedError("error message", LOG); | ||
} | ||
|
||
} |
24 changes: 0 additions & 24 deletions
24
...t/src/main/java/io/quarkus/it/logging/minlevel/set/trace/sub/LoggingSubTraceResource.java
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
integration-tests/logging-min-level-set/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
quarkus.log.min-level=DEBUG | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.trace".min-level=TRACE | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.warn".min-level=INFO | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.min_level_error".min-level=ERROR | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.above".min-level=INFO | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.below".min-level=TRACE | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.promote".min-level=ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...el-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelByDefaultTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.quarkus.it.logging.minlevel.set; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
/** | ||
* Tests that verify that changes to the default min-level are applied correctly. | ||
* | ||
* If unset, the default is INFO, | ||
* so this test verifies that when the default min-level is changed, | ||
* say to DEBUG, the code works as expected. | ||
*/ | ||
@QuarkusTest | ||
@QuarkusTestResource(SetRuntimeLogLevels.class) | ||
public class LoggingMinLevelByDefaultTest { | ||
|
||
@Test | ||
public void testDebug() { | ||
given() | ||
.when().get("/log/bydefault/debug") | ||
.then() | ||
.statusCode(200) | ||
.body(is("true")); | ||
} | ||
|
||
@Test | ||
public void testNotTrace() { | ||
given() | ||
.when().get("/log/bydefault/not-trace") | ||
.then() | ||
.statusCode(200) | ||
.body(is("true")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
...-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingTraceResourceTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
...el-set/src/test/java/io/quarkus/it/logging/minlevel/set/NativeLoggingMinLevelErrorIT.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...t/src/test/java/io/quarkus/it/logging/minlevel/set/NativeLoggingMinLevelPromoteSubIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.quarkus.it.logging.minlevel.set; | ||
|
||
import io.quarkus.test.junit.NativeImageTest; | ||
|
||
@NativeImageTest | ||
public class NativeLoggingMinLevelPromoteSubIT extends LoggingMinLevelPromoteSubTest { | ||
|
||
// Execute the same tests but in native mode. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters