Search in sources :

Example 1 with LogSubject

use of com.google.copybara.util.console.testing.LogSubjects.LogSubject in project copybara by google.

the class TestingConsoleTest method assertFailsForPartialMatch.

@Test
public void assertFailsForPartialMatch() {
    console.error("jjj_asdf_mmm");
    final LogSubject logSubject = console.assertThat();
    expectAssertion(".*jjj_asdf_mmm.*", () -> logSubject.matchesNext(MessageType.ERROR, "asdf"));
}
Also used : LogSubject(com.google.copybara.util.console.testing.LogSubjects.LogSubject) Test(org.junit.Test)

Example 2 with LogSubject

use of com.google.copybara.util.console.testing.LogSubjects.LogSubject in project copybara by google.

the class TestingConsoleTest method testFailsForPartialMatch.

@Test
public void testFailsForPartialMatch() {
    console.error("jjj_asdf_mmm");
    LogSubject logSubject = console.assertThat();
    expectAssertion(".*jjj_asdf_mmm.*", () -> logSubject.matchesNext(MessageType.ERROR, "asdf"));
}
Also used : LogSubject(com.google.copybara.util.console.testing.LogSubjects.LogSubject) Test(org.junit.Test)

Example 3 with LogSubject

use of com.google.copybara.util.console.testing.LogSubjects.LogSubject in project copybara by google.

the class TestingConsoleTest method testFailsWhenNoMoreMessagesRemain.

@Test
public void testFailsWhenNoMoreMessagesRemain() {
    console.error("foo");
    LogSubject logSubject = console.assertThat().matchesNext(MessageType.ERROR, "foo");
    expectAssertion("no more log messages.*", () -> logSubject.matchesNext(MessageType.ERROR, "foo"));
}
Also used : LogSubject(com.google.copybara.util.console.testing.LogSubjects.LogSubject) Test(org.junit.Test)

Example 4 with LogSubject

use of com.google.copybara.util.console.testing.LogSubjects.LogSubject in project copybara by google.

the class TestingConsoleTest method assertFailsWhenNoMoreMessagesRemain.

@Test
public void assertFailsWhenNoMoreMessagesRemain() {
    console.error("foo");
    final LogSubject logSubject = console.assertThat().matchesNext(MessageType.ERROR, "foo");
    expectAssertion("no more log messages.*", () -> logSubject.matchesNext(MessageType.ERROR, "foo"));
}
Also used : LogSubject(com.google.copybara.util.console.testing.LogSubjects.LogSubject) Test(org.junit.Test)

Example 5 with LogSubject

use of com.google.copybara.util.console.testing.LogSubjects.LogSubject in project copybara by google.

the class TestingConsoleTest method assertMessageTypeWrong2.

@Test
public void assertMessageTypeWrong2() {
    console.info("bar");
    final LogSubject logSubject = console.assertThat();
    expectAssertion(".*bar.*", () -> logSubject.matchesNext(MessageType.PROGRESS, "bar"));
}
Also used : LogSubject(com.google.copybara.util.console.testing.LogSubjects.LogSubject) Test(org.junit.Test)

Aggregations

LogSubject (com.google.copybara.util.console.testing.LogSubjects.LogSubject)6 Test (org.junit.Test)6