Skip to content

Commit

Permalink
objectionary#2937 rename empty message
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed Mar 25, 2024
1 parent 5e624cb commit e83b03e
Show file tree
Hide file tree
Showing 56 changed files with 150 additions and 149 deletions.
Expand Up @@ -328,6 +328,7 @@ protected final ForeignTojos scopedTojos() {
* @throws ExecutionException If unexpected exception happened during execution
* @throws TimeoutException If timeout limit reached
*/
@SuppressWarnings("PMD.CloseResource")
private void execWithTimeout() throws ExecutionException, TimeoutException {
final ExecutorService service = Executors.newSingleThreadExecutor();
try {
Expand Down
Expand Up @@ -53,7 +53,7 @@ final class BinarizeMojoTest {
/**
* Empty message for JUnit Assertions.
*/
private static final String EMPTY_MSG = "EMPTY MESSAGE";
private static final String EMPTY_MSG = "TO ADD ASSERTION MESSAGE";

/**
* BinarizeMojo can binarize without errors.
Expand Down
Expand Up @@ -50,7 +50,7 @@ final class BinarizeParseTest {
/**
* Empty message for JUnit Assertions.
*/
private static final String EMPTY_MSG = "EMPTY MESSAGE";
private static final String EMPTY_MSG = "TO ADD ASSERTION MESSAGE";

@Test
void parsesSimpleEoProgram(@TempDir final Path temp) throws Exception {
Expand Down
Expand Up @@ -54,7 +54,7 @@ final class CatalogsTest {
void readsFromTojosConcurrently(@TempDir final Path tmp) {
final Tojos tojos = Catalogs.INSTANCE.make(tmp.resolve("foreign"), "json");
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new SumOf(
new Threads<>(
CatalogsTest.CORES,
Expand Down
Expand Up @@ -54,7 +54,7 @@ void cleansSuccessfully(@TempDir final Path temp) throws IOException {
.with("targetDir", dir.toFile())
.execute(CleanMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
!file.toFile().exists() && !small.toFile().exists(),
Matchers.is(true)
);
Expand All @@ -76,7 +76,7 @@ void makesFullCompilingLifecycleSuccessfully(@TempDir final Path temp) throws IO
.execute(AssembleMojo.class)
.execute(CleanMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
temp.resolve("target").toFile().exists(),
Matchers.is(false)
);
Expand Down
Expand Up @@ -57,12 +57,12 @@ void copiesSources(@TempDir final Path temp) throws Exception {
.execute(CopyMojo.class);
final Path out = classes.resolve("EO-SOURCES/foo/main.eo");
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new HmBase(classes).exists(classes.relativize(out)),
Matchers.is(true)
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new TextOf(new HmBase(classes).load(classes.relativize(out))).asString(),
Matchers.allOf(
Matchers.containsString("+rt foo:"),
Expand Down Expand Up @@ -90,7 +90,7 @@ void skipsCopyMojo(@TempDir final Path temp) throws IOException {
.execute(CopyMojo.class);
final Path out = classes.resolve("EO-SOURCES/foo/main.eo");
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new HmBase(classes).exists(classes.relativize(out)),
Matchers.is(false)
);
Expand Down
Expand Up @@ -47,12 +47,12 @@ void findsDirs(@TempDir final Path temp) throws IOException {
new HmBase(temp).save("", Paths.get("test/f.txt"));
new HmBase(temp).save("", Paths.get("a/g"));
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new DepDirs(temp),
Matchers.contains(String.format("a%sb%1$sc%1$sf", File.separator))
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new DepDirs(temp),
Matchers.iterableWithSize(1)
);
Expand Down
Expand Up @@ -89,12 +89,12 @@ void executesDiscoveryPhaseForCorrectEoPrograms(
);
final Map<String, String> first = json.removeFirst();
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
dependencies,
Matchers.equalTo(json.size())
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
String.valueOf(dependencies),
Matchers.equalTo(first.get("discovered"))
);
Expand Down
Expand Up @@ -66,7 +66,7 @@ void convertsXmirtoJavaSuccessfully(@TempDir final Path temp) throws Exception {
Paths.get("sum.xmir")
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new TextOf(
new InputOf(
new JavaFiles(
Expand All @@ -86,7 +86,7 @@ void convertsXmirtoJavaWithoutJavaClasses(@TempDir final Path temp) throws Excep
Paths.get("sum.xmir")
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new JavaFiles(
temp.resolve("xml").resolve("sum.xmir"),
temp.resolve("java")
Expand Down
Expand Up @@ -46,7 +46,7 @@ final class LatexMojoTest {
@Test
void generatesTexFile(@TempDir final Path temp) throws Exception {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new FakeMaven(temp)
.withHelloWorld()
.execute(new FakeMaven.Latex())
Expand All @@ -64,7 +64,7 @@ void generatesTexFile(@TempDir final Path temp) throws Exception {
@Test
void checksLastName() {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
LatexMojo.last("foo.bar.hello"),
Matchers.equalTo("hello")
);
Expand Down
Expand Up @@ -78,7 +78,7 @@ void printsFormattedMessage(final Logs out) {
@Test
void matchesCorrectly() {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
"16:02:08 [INFO] org.eolang.maven.LogFormatTest: Wake up, Neo...\n",
Matchers.matchesPattern(LogFormatTest.FORMAT)
);
Expand Down
Expand Up @@ -52,7 +52,7 @@ void extendsForeignWithNewObjects(@TempDir final Path temp) throws IOException {
final FakeMaven maven = new FakeMaven(temp);
maven.execute(MarkMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
maven.foreignTojos()
.all()
.iterator()
Expand All @@ -71,12 +71,12 @@ void updatesVersionIfItExists(@TempDir final Path temp) throws IOException {
.withVersion("*.*.*");
maven.execute(MarkMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
foreign.all().iterator().next().version(),
Matchers.equalTo(MarkMojoTest.VERSION)
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
foreign.size(),
Matchers.equalTo(1)
);
Expand Down
Expand Up @@ -66,7 +66,7 @@ void checksPacks(final String pack) throws IOException {
);
}
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
check.failures(),
Matchers.empty()
);
Expand All @@ -83,7 +83,7 @@ void skipsAlreadyOptimized(@TempDir final Path temp) throws IOException {
final long mtime = path.toFile().lastModified();
maven.execute(OptimizeMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
path.toFile().lastModified(),
Matchers.is(mtime)
);
Expand Down Expand Up @@ -145,7 +145,7 @@ void getsAlreadyOptimizedResultsFromCache(@TempDir final Path temp) throws Excep
.allTojosWithHash(() -> hash)
.execute(new FakeMaven.Optimize());
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new XMLDocument(
new HmBase(temp).load(
Paths.get(
Expand All @@ -171,7 +171,7 @@ void savesOptimizedResultsToCache(@TempDir final Path temp) throws IOException {
.allTojosWithHash(() -> hash)
.execute(new FakeMaven.Optimize());
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
cache.resolve(OptimizeMojo.OPTIMIZED)
.resolve(hash)
.resolve("foo/x/main.xmir").toFile(),
Expand All @@ -188,14 +188,14 @@ void optimizesSuccessfully(@TempDir final Path temp) throws IOException {
.execute(new FakeMaven.Optimize())
.result();
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
res,
Matchers.hasKey(
String.format("target/%s/foo/x/main/01-not-empty-atoms.xml", OptimizeMojo.STEPS)
)
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
res,
Matchers.hasKey(
String.format("target/%s/foo/x/main.%s", OptimizeMojo.DIR, TranspileMojo.EXT)
Expand All @@ -221,7 +221,7 @@ void optimizesConcurrentlyWithLotsOfPrograms(@TempDir final Path temp) throws IO
.result();
for (int program = 0; program < total; ++program) {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
res,
Matchers.hasKey(
String.format(
Expand All @@ -238,7 +238,7 @@ void optimizesConcurrentlyWithLotsOfPrograms(@TempDir final Path temp) throws IO
@Test
void doesNotCrashesOnError(@TempDir final Path temp) throws Exception {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new FakeMaven(temp)
.withProgram(
"+package f\n",
Expand All @@ -258,7 +258,7 @@ void doesNotCrashesOnError(@TempDir final Path temp) throws Exception {
@Test
void choosesTransformerFactoryOnce() {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
TransformerFactory.newInstance().getClass(),
Matchers.typeCompatibleWith(TransformerFactoryImpl.class)
);
Expand All @@ -270,7 +270,7 @@ void choosesTransformerFactoryInConcurrentEnvironment() {
.mapToObj(i -> TransformerFactory.newInstance().getClass())
.collect(Collectors.toList())) {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
clazz,
Matchers.typeCompatibleWith(TransformerFactoryImpl.class)
);
Expand Down
Expand Up @@ -59,7 +59,7 @@ final class ParseMojoTest {
void parsesSuccessfully(@TempDir final Path temp) throws Exception {
final FakeMaven maven = new FakeMaven(temp);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
maven.withHelloWorld()
.execute(new FakeMaven.Parse())
.result(),
Expand All @@ -68,7 +68,7 @@ void parsesSuccessfully(@TempDir final Path temp) throws Exception {
)
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
maven.foreign().getById("foo.x.main").exists("xmir"),
Matchers.is(true)
);
Expand Down Expand Up @@ -121,7 +121,7 @@ void parsesWithCache(@TempDir final Path temp) throws Exception {
@Test
void doesNotCrashesOnError(@TempDir final Path temp) throws Exception {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new FakeMaven(temp)
.withProgram("something < is wrong here")
.execute(new FakeMaven.Parse())
Expand Down Expand Up @@ -168,7 +168,7 @@ void parsesConcurrentlyWithLotsOfPrograms(@TempDir final Path temp) throws IOExc
final Map<String, Path> res = maven.execute(new FakeMaven.Parse()).result();
for (int program = 0; program < total; ++program) {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
res,
Matchers.hasKey(
String.format(
Expand Down
Expand Up @@ -52,7 +52,7 @@ final class PlaceMojoTest {
/**
* Empty message for JUnit Assertions.
*/
private static final String EMPTY_MSG = "EMPTY MESSAGE";
private static final String EMPTY_MSG = "TO ADD ASSERTION MESSAGE";

/**
* The default folder for placed binaries.
Expand Down
4 changes: 2 additions & 2 deletions eo-maven-plugin/src/test/java/org/eolang/maven/PlaceTest.java
Expand Up @@ -39,7 +39,7 @@ final class PlaceTest {
@Test
void makesPath() {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new Place("hello.foo.bar")
.make(Paths.get("/tmp/test"), TranspileMojo.EXT)
.toString()
Expand All @@ -51,7 +51,7 @@ void makesPath() {
@Test
void makesSimplePath() {
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new Place("hey")
.make(Paths.get("/tmp"), "xml")
.toString()
Expand Down
10 changes: 5 additions & 5 deletions eo-maven-plugin/src/test/java/org/eolang/maven/PullMojoTest.java
Expand Up @@ -80,7 +80,7 @@ void pullsSuccessfully(@TempDir final Path temp) throws IOException {
maven.with("skip", false)
.execute(PullMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
PullMojoTest.exists(temp, PullMojoTest.STDOUT),
Matchers.is(true)
);
Expand Down Expand Up @@ -110,7 +110,7 @@ void pullsFromProbes(@TempDir final Path temp) throws IOException {
)
.execute(new FakeMaven.Pull());
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
PullMojoTest.exists(temp, PullMojoTest.STDOUT),
Matchers.is(true)
);
Expand All @@ -133,7 +133,7 @@ void pullsUsingOfflineHashFile(@TempDir final Path temp) throws IOException {
)
.execute(PullMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new LinkedList<>(new MnCsv(maven.foreignPath()).read()).getFirst().get("hash"),
Matchers.equalTo("mmmmmmm")
);
Expand All @@ -157,7 +157,7 @@ void pullsUsingOfflineHash(@TempDir final Path temp) throws IOException {
)
.execute(PullMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
new LinkedList<>(new MnCsv(maven.foreignPath()).read()).getFirst().get("hash"),
Matchers.equalTo("abcdefg")
);
Expand All @@ -173,7 +173,7 @@ void skipsPullMojo(@TempDir final Path temp) throws IOException {
maven.with("skip", true)
.execute(PullMojo.class);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
PullMojoTest.exists(temp, PullMojoTest.STDOUT),
Matchers.is(false)
);
Expand Down
Expand Up @@ -60,7 +60,7 @@ void registersOkNames(@TempDir final Path temp) throws IOException {
.with(RegisterMojoTest.PARAM, temp.resolve(RegisterMojoTest.SOURCES).toFile())
.execute(new FakeMaven.Register());
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
maven.foreign().getById("org.eolang.maven.abc-def").exists("id"),
Matchers.is(true)
);
Expand All @@ -81,7 +81,7 @@ void failsWithDotNames(@TempDir final Path temp) throws IOException {
}
);
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
exception.getCause().getCause().getMessage(),
Matchers.containsString("Incorrect name found: '.abc.eo'")
);
Expand All @@ -98,7 +98,7 @@ void doesNotFailWhenNoStrictNames(@TempDir final Path temp) throws IOException {
.with("strictFileNames", false)
.execute(new FakeMaven.Register());
MatcherAssert.assertThat(
"EMPTY MESSAGE",
"TO ADD ASSERTION MESSAGE",
maven.foreign().getById("org.eolang.maven..abc").exists("id"),
Matchers.is(true)
);
Expand Down

0 comments on commit e83b03e

Please sign in to comment.