Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable logs tests from DataizedTest #3173

Merged
merged 2 commits into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions eo-runtime/src/test/java/org/eolang/DataizedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,16 @@
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
* Test case for {@link Dataized}.
*
* @since 0.22
* @todo #2931:30min Enable the disabled tests. The tests were disabled after \rho attribute
* became immutable. Need to find out what's going on and resolve the tests.
*/
final class DataizedTest {

@Test
@Disabled
void logsCorrectly() {
final Logger log = Logger.getLogger("logsCorrectly");
final Level before = log.getLevel();
Expand All @@ -58,7 +54,7 @@ void logsCorrectly() {
log.setLevel(before);
log.removeHandler(hnd);
MatcherAssert.assertThat(
AtCompositeTest.TO_ADD_MESSAGE,
"Expected correct logs for object dataization",
logs.get(0).getMessage(),
Matchers.allOf(
Matchers.containsString("intν"),
Expand All @@ -68,7 +64,6 @@ void logsCorrectly() {
}

@Test
@Disabled
void logsWhenException() {
final Logger log = Logger.getLogger("logsWhenException");
final Level before = log.getLevel();
Expand All @@ -79,16 +74,16 @@ void logsWhenException() {
final Phi wrong = new PhIncorrect(Phi.Φ);
IntStream.range(0, 5).forEach(
i -> Assertions.assertThrows(
IllegalStateException.class,
ExFailure.class,
() -> new Dataized(wrong).take(),
AtCompositeTest.TO_ADD_MESSAGE
"Expected failure with ExFailure exception on incorrect object dataization"
)
);
new Dataized(new Data.ToPhi(1L), log).take();
log.setLevel(before);
log.removeHandler(hnd);
MatcherAssert.assertThat(
AtCompositeTest.TO_ADD_MESSAGE,
"Expected correct logs for object dataization",
logs.get(0).getMessage(),
Matchers.allOf(
Matchers.containsString("intν"),
Expand Down
Loading