Search in sources :

Example 16 with OptionsBuilder

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

the class ReplaceTest method setup.

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

Example 17 with OptionsBuilder

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

the class TodoReplaceTest method setup.

@Before
public void setup() throws IOException {
    FileSystem fs = Jimfs.newFileSystem();
    checkoutDir = fs.getPath("/");
    Files.createDirectories(checkoutDir);
    console = new TestingConsole();
    OptionsBuilder options = new OptionsBuilder().setConsole(console);
    skylark = new SkylarkTestExecutor(options, Core.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 18 with OptionsBuilder

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

the class RevisionMigratorTest method setUp.

@Before
public void setUp() throws Exception {
    FileSystem fs = Jimfs.newFileSystem();
    checkoutDir = fs.getPath("/test-checkoutDir");
    origin = new DummyOrigin();
    destinationReader = new MockReader();
    location = new Location(1, 2) {

        @Override
        public PathFragment getPath() {
            return null;
        }
    };
    referenceMigrator = ReferenceMigrator.create("http://internalReviews.com/${reference}", "http://externalreviews.com/view?${reference}", Pattern.compile("[0-9]+"), Pattern.compile("[0-9a-f]+"), ImmutableList.of(), location);
    OptionsBuilder options = new OptionsBuilder();
    console = new TestingConsole();
    options.setConsole(console);
    skylark = new SkylarkTestExecutor(options, MetadataModule.class);
}
Also used : DummyOrigin(com.google.copybara.testing.DummyOrigin) TestingConsole(com.google.copybara.util.console.testing.TestingConsole) FileSystem(java.nio.file.FileSystem) PathFragment(com.google.devtools.build.lib.vfs.PathFragment) OptionsBuilder(com.google.copybara.testing.OptionsBuilder) SkylarkTestExecutor(com.google.copybara.testing.SkylarkTestExecutor) Location(com.google.devtools.build.lib.events.Location) Before(org.junit.Before)

Example 19 with OptionsBuilder

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

the class GlobTest method setup.

@Before
public void setup() throws IOException, RepoException {
    workdir = Files.createTempDirectory("workdir");
    OptionsBuilder options = new OptionsBuilder().setWorkdirToRealTempDir().setConsole(new TestingConsole());
    skylark = new SkylarkTestExecutor(options);
}
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)

Example 20 with OptionsBuilder

use of com.google.copybara.testing.OptionsBuilder 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);
    OptionsBuilder options = new OptionsBuilder();
    console = new TestingConsole();
    options.setConsole(console);
    sequence = new Sequence(options.general.profiler(), /*joinTransformations*/
    true, ImmutableList.of(t1, t2));
}
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

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