Search in sources :

Example 11 with TestContext

use of com.facebook.buck.testutil.integration.TestContext 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);
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) BuildId(com.facebook.buck.model.BuildId) TestContext(com.facebook.buck.testutil.integration.TestContext) WebServerBuckEventListener(com.facebook.buck.httpserver.WebServerBuckEventListener) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

TestContext (com.facebook.buck.testutil.integration.TestContext)11 Test (org.junit.Test)10 ProjectWorkspace (com.facebook.buck.testutil.integration.ProjectWorkspace)9 BuildId (com.facebook.buck.model.BuildId)5 WebServerBuckEventListener (com.facebook.buck.httpserver.WebServerBuckEventListener)4 ProcessResult (com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult)4 Ignore (org.junit.Ignore)4 CapturingPrintStream (com.facebook.buck.util.CapturingPrintStream)3 DelegatingInputStream (com.facebook.buck.testutil.integration.DelegatingInputStream)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 CompilerErrorEvent (com.facebook.buck.event.CompilerErrorEvent)1 ConsoleEvent (com.facebook.buck.event.ConsoleEvent)1 ProgressEvent (com.facebook.buck.event.ProgressEvent)1 ParseEvent (com.facebook.buck.parser.ParseEvent)1 BuildEvent (com.facebook.buck.rules.BuildEvent)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1