Search in sources :

Example 31 with OptionsBuilder

use of com.google.copybara.testing.OptionsBuilder 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, Core.class, CopyOrMove.class);
}
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) Core(com.google.copybara.Core) Before(org.junit.Before)

Example 32 with OptionsBuilder

use of com.google.copybara.testing.OptionsBuilder in project copybara by google.

the class FolderDestinationTest method setup.

@Before
public void setup() throws IOException, RepoException {
    workdir = Files.createTempDirectory("workdir");
    options = new OptionsBuilder().setWorkdirToRealTempDir().setHomeDir(StandardSystemProperty.USER_HOME.value());
    Files.createDirectory(workdir.resolve("dir"));
    Files.write(workdir.resolve("test.txt"), new byte[] {});
    Files.write(workdir.resolve("dir/file.txt"), new byte[] {});
    excludedPathsForDeletion = ImmutableList.of();
    skylark = new SkylarkTestExecutor(options, FolderModule.class);
}
Also used : OptionsBuilder(com.google.copybara.testing.OptionsBuilder) SkylarkTestExecutor(com.google.copybara.testing.SkylarkTestExecutor) Before(org.junit.Before)

Example 33 with OptionsBuilder

use of com.google.copybara.testing.OptionsBuilder in project copybara by google.

the class CopybaraTest method setUp.

@Before
public void setUp() throws Exception {
    optionsBuilder = new OptionsBuilder();
    console = new TestingConsole();
    eventMonitor = new TestingEventMonitor();
    optionsBuilder.setConsole(console);
    optionsBuilder.general.withEventMonitor(eventMonitor);
    migration = mock(Migration.class);
    config = new Config(ImmutableMap.of("workflow", migration), "foo/copy.bara.sky");
}
Also used : TestingConsole(com.google.copybara.util.console.testing.TestingConsole) Migration(com.google.copybara.config.Migration) Config(com.google.copybara.config.Config) OptionsBuilder(com.google.copybara.testing.OptionsBuilder) TestingEventMonitor(com.google.copybara.testing.TestingEventMonitor) Before(org.junit.Before)

Example 34 with OptionsBuilder

use of com.google.copybara.testing.OptionsBuilder in project copybara by google.

the class CoreReverseTest method setup.

@Before
public void setup() throws IOException {
    OptionsBuilder options = new OptionsBuilder();
    skylark = new SkylarkTestExecutor(options, Mock.class);
    console = new TestingConsole();
    options.setConsole(console);
}
Also used : TestingConsole(com.google.copybara.util.console.testing.TestingConsole) OptionsBuilder(com.google.copybara.testing.OptionsBuilder) SkylarkTestExecutor(com.google.copybara.testing.SkylarkTestExecutor) Before(org.junit.Before)

Aggregations

OptionsBuilder (com.google.copybara.testing.OptionsBuilder)34 Before (org.junit.Before)33 TestingConsole (com.google.copybara.util.console.testing.TestingConsole)28 SkylarkTestExecutor (com.google.copybara.testing.SkylarkTestExecutor)26 FileSystem (java.nio.file.FileSystem)7 Core (com.google.copybara.Core)5 SkylarkParser (com.google.copybara.config.SkylarkParser)5 DummyOrigin (com.google.copybara.testing.DummyOrigin)5 Path (java.nio.file.Path)5 Authoring (com.google.copybara.authoring.Authoring)4 RepoException (com.google.copybara.exception.RepoException)4 RecordsProcessCallDestination (com.google.copybara.testing.RecordsProcessCallDestination)4 TestGitOptions (com.google.copybara.testing.git.GitTestUtil.TestGitOptions)4 HttpTransport (com.google.api.client.http.HttpTransport)3 GitApiMockHttpTransport (com.google.copybara.testing.OptionsBuilder.GitApiMockHttpTransport)3 MockLowLevelHttpRequest (com.google.api.client.testing.http.MockLowLevelHttpRequest)2 GeneralOptions (com.google.copybara.GeneralOptions)2 GithubApi (com.google.copybara.git.github.api.GithubApi)2 TestingEventMonitor (com.google.copybara.testing.TestingEventMonitor)2 IOException (java.io.IOException)2