use of com.google.copybara.testing.TestingEventMonitor in project copybara by google.
the class WorkflowTest method setup.
@Before
public void setup() throws Exception {
options = new OptionsBuilder();
authoring = "authoring.overwrite('" + DEFAULT_AUTHOR + "')";
includeReleaseNotes = false;
workdir = Files.createTempDirectory("workdir");
Files.createDirectories(workdir);
origin = new DummyOrigin().setAuthor(ORIGINAL_AUTHOR);
originFiles = "glob(['**'], exclude = ['copy.bara.sky', 'excluded/**'])";
destinationFiles = "glob(['**'])";
destination = new RecordsProcessCallDestination();
transformations = ImmutableList.of("" + " core.replace(\n" + " before = '${linestart}${number}',\n" + " after = '${linestart}" + PREFIX + "${number}',\n" + " regex_groups = {\n" + " 'number' : '[0-9]+',\n" + " 'linestart' : '^',\n" + " },\n" + " multiline = True," + " )");
TestingConsole console = new TestingConsole();
options.setConsole(console);
options.testingOptions.origin = origin;
options.testingOptions.destination = destination;
// Force by default unless we are testing the flag.
options.setForce(true);
skylark = new SkylarkParser(ImmutableSet.of(Core.class, Authoring.Module.class, TestingModule.class, MetadataModule.class, FolderModule.class, GitModule.class));
eventMonitor = new TestingEventMonitor();
options.general.withEventMonitor(eventMonitor);
transformWork = TransformWorks.of(workdir, "example", console);
}
use of com.google.copybara.testing.TestingEventMonitor 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");
}
Aggregations