Skip to content

Commit

Permalink
#3797: log testing removed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jan 22, 2025
1 parent d8b1bc4 commit 5df2501
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 605 deletions.
6 changes: 6 additions & 0 deletions eo-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ SOFTWARE.
<groupId>org.eolang</groupId>
<artifactId>lints</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import java.io.IOException;
import java.nio.file.Path;
import java.util.Map;
import org.eolang.maven.log.CaptureLogs;
import org.eolang.maven.log.Logs;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -120,23 +118,6 @@ void assemblesNotFailWithFailOnError(@Mktmp final Path temp) throws IOException
);
}

@CaptureLogs
@Test
void assemblesSuccessfullyInOfflineMode(final Logs out,
@Mktmp final Path temp) throws IOException {
new FakeMaven(temp)
.withHelloWorld()
.with("offline", true)
.execute(AssembleMojo.class);
MatcherAssert.assertThat(
"While execution AssembleMojo log should have contained message about offline mode, but it didn't",
String.join("\n", out.captured()),
Matchers.containsString(
"No programs were pulled because eo.offline flag is set to TRUE"
)
);
}

@Test
void configuresChildParameters(@Mktmp final Path temp) throws IOException {
final Map<String, Path> res = new FakeMaven(temp)
Expand Down
82 changes: 0 additions & 82 deletions eo-maven-plugin/src/test/java/org/eolang/maven/LogFormatTest.java

This file was deleted.

28 changes: 0 additions & 28 deletions eo-maven-plugin/src/test/java/org/eolang/maven/PullMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@
import org.eolang.maven.hash.ChRemote;
import org.eolang.maven.hash.ChText;
import org.eolang.maven.hash.CommitHash;
import org.eolang.maven.log.CaptureLogs;
import org.eolang.maven.log.Logs;
import org.eolang.maven.util.HmBase;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.hamcrest.io.FileMatchers;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -183,31 +180,6 @@ void doesNotPullInOfflineMode(@Mktmp final Path tmp) throws IOException {
);
}

@Test
@CaptureLogs
void showsWhereNotFoundWasDiscoveredAt(@Mktmp final Path tmp, final Logs out)
throws IOException {
final FakeMaven mvn = new FakeMaven(tmp)
.withProgram(
"+package com.example\n",
"# No comments.",
"[] > main",
" org.eolang.org > @"
)
.with("objectionary", new OyRemote(new ChRemote("master")));
Assertions.assertThrows(
Exception.class,
() -> mvn.execute(new FakeMaven.Pull()),
"Pull mojo should fail, but it does not"
);
Assertions.assertTrue(
out.captured().stream().anyMatch(
line -> line.contains("Failed to pull 'org.eolang.org' earlier discovered at")
),
"Log should contain info where failed to pull object was discovered at, but it does not"
);
}

@Test
void skipsAlreadyPulled(@Mktmp final Path temp) throws IOException {
final FakeMaven maven = new FakeMaven(temp)
Expand Down
61 changes: 0 additions & 61 deletions eo-maven-plugin/src/test/java/org/eolang/maven/SafeMojoTest.java

This file was deleted.

Loading

0 comments on commit 5df2501

Please sign in to comment.