Search in sources :

Example 81 with TestingConsole

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

the class ConsoleEventMonitorTest method setUp.

@Before
public void setUp() throws Exception {
    console = new TestingConsole();
    eventMonitor = new ConsoleEventMonitor(console, EventMonitor.EMPTY_MONITOR);
}
Also used : TestingConsole(com.google.copybara.util.console.testing.TestingConsole) Before(org.junit.Before)

Example 82 with TestingConsole

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

the class CopyOrMoveTest method testDotDot.

@Test
public void testDotDot() {
    for (String t : ImmutableList.of("move", "copy")) {
        options.setConsole(new TestingConsole());
        skylark.evalFails("core." + t + "(after = '../blablabla', before = 'other')\n", "path has unexpected [.] or [.][.] components.*[.][.]/blablabla");
    }
}
Also used : TestingConsole(com.google.copybara.util.console.testing.TestingConsole) Test(org.junit.Test)

Example 83 with TestingConsole

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

the class CopyOrMoveTest method setup.

@Before
public void setup() throws IOException {
    FileSystem fs = Jimfs.newFileSystem();
    checkoutDir = fs.getPath("/test-checkoutDir");
    Files.createDirectories(checkoutDir);
    console = new TestingConsole();
    options = new OptionsBuilder().setConsole(console);
    skylark = new SkylarkTestExecutor(options);
}
Also used : TestingConsole(com.google.copybara.util.console.testing.TestingConsole) FileSystem(java.nio.file.FileSystem) OptionsBuilder(com.google.copybara.testing.OptionsBuilder) SkylarkTestExecutor(com.google.copybara.testing.SkylarkTestExecutor) Before(org.junit.Before)

Example 84 with TestingConsole

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

the class CopyOrMoveTest method testAbsoluteBefore.

@Test
public void testAbsoluteBefore() {
    for (String t : ImmutableList.of("move", "copy")) {
        options.setConsole(new TestingConsole());
        skylark.evalFails("core." + t + "(before = '/blablabla', after = 'other')\n", "path must be relative.*/blablabla");
    }
}
Also used : TestingConsole(com.google.copybara.util.console.testing.TestingConsole) Test(org.junit.Test)

Example 85 with TestingConsole

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

the class SequenceTest method setup.

@Before
public void setup() throws IOException {
    FileSystem fs = Jimfs.newFileSystem();
    checkoutDir = fs.getPath("/test-checkoutDir");
    Files.createDirectories(checkoutDir);
    options = new OptionsBuilder();
    console = new TestingConsole();
    options.setConsole(console);
}
Also used : TestingConsole(com.google.copybara.util.console.testing.TestingConsole) FileSystem(java.nio.file.FileSystem) OptionsBuilder(com.google.copybara.testing.OptionsBuilder) Before(org.junit.Before)

Aggregations

TestingConsole (com.google.copybara.util.console.testing.TestingConsole)96 Before (org.junit.Before)57 OptionsBuilder (com.google.copybara.testing.OptionsBuilder)55 SkylarkTestExecutor (com.google.copybara.testing.SkylarkTestExecutor)54 Test (org.junit.Test)34 Path (java.nio.file.Path)15 GitTestUtil (com.google.copybara.testing.git.GitTestUtil)8 FileSystem (java.nio.file.FileSystem)8 IOException (java.io.IOException)7 LowLevelHttpRequest (com.google.api.client.http.LowLevelHttpRequest)6 DummyChecker (com.google.copybara.testing.DummyChecker)6 DummyOrigin (com.google.copybara.testing.DummyOrigin)6 Console (com.google.copybara.util.console.Console)6 MockHttpTransport (com.google.api.client.testing.http.MockHttpTransport)5 MockLowLevelHttpRequest (com.google.api.client.testing.http.MockLowLevelHttpRequest)5 MockLowLevelHttpResponse (com.google.api.client.testing.http.MockLowLevelHttpResponse)5 Truth.assertWithMessage (com.google.common.truth.Truth.assertWithMessage)5 GitRepository (com.google.copybara.git.GitRepository)5 LowLevelHttpResponse (com.google.api.client.http.LowLevelHttpResponse)4 RepoException (com.google.copybara.exception.RepoException)4