use of com.facebook.buck.httpserver.WebServerBuckEventListener in project buck by facebook.
the class WebServerBuckEventListenerTest method hasBuckTestStartedThenEventsCalled.
@Test
@Ignore
public void hasBuckTestStartedThenEventsCalled() throws IOException, InterruptedException {
final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "buck_events/test", tmp);
workspace.setUp();
WebServerBuckEventListener webServerBuckEventListener = createMock(WebServerBuckEventListener.class);
//Build started
webServerBuckEventListener.buildStarted(anyObject(BuildEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Build progress Event
webServerBuckEventListener.buildProgressUpdated(anyObject(ProgressEvent.BuildProgressUpdated.class));
EasyMock.expectLastCall().atLeastOnce();
//Build finished
webServerBuckEventListener.buildFinished(anyObject(BuildEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Parse started
webServerBuckEventListener.parseStarted(anyObject(ParseEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Parse progress Event
webServerBuckEventListener.parsingProgressUpdated(anyObject(ProgressEvent.ParsingProgressUpdated.class));
EasyMock.expectLastCall().atLeastOnce();
//Parse finished
webServerBuckEventListener.parseFinished(anyObject(ParseEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Individual test started
//This target has only 1 test
webServerBuckEventListener.testAwaitingResults(anyObject(IndividualTestEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Individual test finished
webServerBuckEventListener.testResultsAvailable(anyObject(IndividualTestEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Test started
webServerBuckEventListener.testRunStarted(anyObject(TestRunEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Test finished
webServerBuckEventListener.testRunCompleted(anyObject(TestRunEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Output trace
webServerBuckEventListener.outputTrace(anyObject(BuildId.class));
EasyMock.expectLastCall().times(1);
EasyMock.replay(webServerBuckEventListener);
ProjectWorkspace.ProcessResult build = workspace.runBuckdCommand(new TestContext(), "test", "//:simple_test");
build.assertSuccess();
verify(webServerBuckEventListener);
}
use of com.facebook.buck.httpserver.WebServerBuckEventListener in project buck by facebook.
the class WebServerBuckEventListenerTest method hasBuckCompilerErrorOccurredThenEventsCalled.
@Test
@Ignore
public void hasBuckCompilerErrorOccurredThenEventsCalled() throws IOException, InterruptedException {
final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "buck_events/compiler_error", tmp);
workspace.setUp();
WebServerBuckEventListener webServerBuckEventListener = createMock(WebServerBuckEventListener.class);
//Build started
webServerBuckEventListener.buildStarted(anyObject(BuildEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Build progress Event
webServerBuckEventListener.buildProgressUpdated(anyObject(ProgressEvent.BuildProgressUpdated.class));
EasyMock.expectLastCall().atLeastOnce();
//Build finished
webServerBuckEventListener.buildFinished(anyObject(BuildEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Parse started
webServerBuckEventListener.parseStarted(anyObject(ParseEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Parse progress Event
webServerBuckEventListener.parsingProgressUpdated(anyObject(ProgressEvent.ParsingProgressUpdated.class));
EasyMock.expectLastCall().atLeastOnce();
//Parse finished
webServerBuckEventListener.parseFinished(anyObject(ParseEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Compiler error
webServerBuckEventListener.compilerErrorEvent(anyObject(CompilerErrorEvent.class));
EasyMock.expectLastCall().times(1);
//Console event
webServerBuckEventListener.consoleEvent(anyObject(ConsoleEvent.class));
EasyMock.expectLastCall().times(1);
//Output trace
webServerBuckEventListener.outputTrace(anyObject(BuildId.class));
EasyMock.expectLastCall().times(1);
EasyMock.replay(webServerBuckEventListener);
ProjectWorkspace.ProcessResult build = workspace.runBuckdCommand(new TestContext(), "build", "//:broken");
build.assertFailure();
verify(webServerBuckEventListener);
}
use of com.facebook.buck.httpserver.WebServerBuckEventListener in project buck by facebook.
the class WebServerBuckEventListenerTest method hasBuckBuildStartedThenEventsCalled.
@Test
@Ignore
public void hasBuckBuildStartedThenEventsCalled() throws IOException, InterruptedException {
final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "buck_events", tmp);
workspace.setUp();
WebServerBuckEventListener webServerBuckEventListener = createMock(WebServerBuckEventListener.class);
//Build started
webServerBuckEventListener.buildStarted(anyObject(BuildEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Build progress Event
webServerBuckEventListener.buildProgressUpdated(anyObject(ProgressEvent.BuildProgressUpdated.class));
EasyMock.expectLastCall().atLeastOnce();
//Build finished
webServerBuckEventListener.buildFinished((BuildEvent.Finished) anyObject());
EasyMock.expectLastCall().times(1);
//Parse started
webServerBuckEventListener.parseStarted(anyObject(ParseEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Parse progress Event
webServerBuckEventListener.parsingProgressUpdated((ProgressEvent.ParsingProgressUpdated) anyObject());
EasyMock.expectLastCall().atLeastOnce();
//Parse finished
webServerBuckEventListener.parseFinished((ParseEvent.Finished) anyObject());
EasyMock.expectLastCall().times(1);
//Output trace
webServerBuckEventListener.outputTrace(anyObject(BuildId.class));
EasyMock.expectLastCall().times(1);
EasyMock.replay(webServerBuckEventListener);
ProjectWorkspace.ProcessResult build = workspace.runBuckdCommand(new TestContext(), "build", "//:foo");
build.assertSuccess();
verify(webServerBuckEventListener);
}
use of com.facebook.buck.httpserver.WebServerBuckEventListener in project buck by facebook.
the class WebServerBuckEventListenerTest method hasBuckProjectGenerationStartedThenEventsCalled.
@Test
@Ignore
public void hasBuckProjectGenerationStartedThenEventsCalled() throws IOException, InterruptedException {
final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "buck_events", tmp);
workspace.setUp();
WebServerBuckEventListener webServerBuckEventListener = createMock(WebServerBuckEventListener.class);
//Parse started
webServerBuckEventListener.parseStarted(anyObject(ParseEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Parse progress Event
webServerBuckEventListener.parsingProgressUpdated(anyObject(ProgressEvent.ParsingProgressUpdated.class));
EasyMock.expectLastCall().atLeastOnce();
//Parse finished
webServerBuckEventListener.parseFinished(anyObject(ParseEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Project generation started
webServerBuckEventListener.projectGenerationStarted(anyObject(ProjectGenerationEvent.Started.class));
EasyMock.expectLastCall().times(1);
//Project generation finished
webServerBuckEventListener.projectGenerationFinished(anyObject(ProjectGenerationEvent.Finished.class));
EasyMock.expectLastCall().times(1);
//Output trace
webServerBuckEventListener.outputTrace(anyObject(BuildId.class));
EasyMock.expectLastCall().times(1);
EasyMock.replay(webServerBuckEventListener);
ProjectWorkspace.ProcessResult build = workspace.runBuckdCommand(new TestContext(), "project", "//:foo");
build.assertSuccess();
verify(webServerBuckEventListener);
}
Aggregations