Search in sources :

Example 1 with BuildResultHelperProvider

use of com.google.idea.blaze.base.command.buildresult.BuildResultHelperProvider in project intellij by bazelbuild.

the class BlazeInstrumentationTestApkBuildStepIntegrationTest method setupBuildResultHelperProvider.

/**
 * Setup build result helper to return BEP output with test execroot by default.
 */
@Before
public void setupBuildResultHelperProvider() throws GetArtifactsException {
    mockBuildResultHelper = mock(BuildResultHelper.class);
    when(mockBuildResultHelper.getBuildOutput()).thenReturn(new ParsedBepOutput(null, getExecRoot(), null, null, 0, BuildResult.SUCCESS));
    registerExtension(BuildResultHelperProvider.EP_NAME, new BuildResultHelperProvider() {

        @Override
        public Optional<BuildResultHelper> doCreate(Project project, BlazeInfo blazeInfo) {
            return Optional.of(mockBuildResultHelper);
        }

        @Override
        public Optional<BuildResultHelper> doCreateForLocalBuild(Project project) {
            return Optional.of(mockBuildResultHelper);
        }
    });
}
Also used : Project(com.intellij.openapi.project.Project) BlazeInfo(com.google.idea.blaze.base.command.info.BlazeInfo) BuildResultHelper(com.google.idea.blaze.base.command.buildresult.BuildResultHelper) Optional(java.util.Optional) BuildResultHelperProvider(com.google.idea.blaze.base.command.buildresult.BuildResultHelperProvider) ParsedBepOutput(com.google.idea.blaze.base.command.buildresult.ParsedBepOutput) Before(org.junit.Before)

Example 2 with BuildResultHelperProvider

use of com.google.idea.blaze.base.command.buildresult.BuildResultHelperProvider in project intellij by bazelbuild.

the class MobileInstallBuildStepIntegrationTest method setupBuildResultHelperProvider.

/**
 * Setup build result helper to return BEP output with test execroot by default.
 */
@Before
public void setupBuildResultHelperProvider() throws GetArtifactsException {
    mockBuildResultHelper = mock(BuildResultHelper.class);
    when(mockBuildResultHelper.getBuildOutput()).thenReturn(new ParsedBepOutput(null, getExecRoot(), null, null, 0, BuildResult.SUCCESS));
    registerExtension(BuildResultHelperProvider.EP_NAME, new BuildResultHelperProvider() {

        @Override
        public Optional<BuildResultHelper> doCreate(Project project, BlazeInfo blazeInfo) {
            return Optional.of(mockBuildResultHelper);
        }

        @Override
        public Optional<BuildResultHelper> doCreateForLocalBuild(Project project) {
            return Optional.of(mockBuildResultHelper);
        }
    });
}
Also used : Project(com.intellij.openapi.project.Project) BlazeInfo(com.google.idea.blaze.base.command.info.BlazeInfo) BuildResultHelper(com.google.idea.blaze.base.command.buildresult.BuildResultHelper) Optional(java.util.Optional) BuildResultHelperProvider(com.google.idea.blaze.base.command.buildresult.BuildResultHelperProvider) ParsedBepOutput(com.google.idea.blaze.base.command.buildresult.ParsedBepOutput) Before(org.junit.Before)

Example 3 with BuildResultHelperProvider

use of com.google.idea.blaze.base.command.buildresult.BuildResultHelperProvider in project intellij by bazelbuild.

the class FullApkBuildStepIntegrationTest method setupBuildResultHelperProvider.

/**
 * Setup build result helper to return BEP output with test execroot by default.
 */
@Before
public void setupBuildResultHelperProvider() throws GetArtifactsException {
    mockBuildResultHelper = mock(BuildResultHelper.class);
    when(mockBuildResultHelper.getBuildOutput()).thenReturn(new ParsedBepOutput(null, getExecRoot(), null, null, 0, BuildResult.SUCCESS));
    registerExtension(BuildResultHelperProvider.EP_NAME, new BuildResultHelperProvider() {

        @Override
        public Optional<BuildResultHelper> doCreate(Project project, BlazeInfo blazeInfo) {
            return Optional.of(mockBuildResultHelper);
        }

        @Override
        public Optional<BuildResultHelper> doCreateForLocalBuild(Project project) {
            return Optional.of(mockBuildResultHelper);
        }
    });
}
Also used : Project(com.intellij.openapi.project.Project) BlazeInfo(com.google.idea.blaze.base.command.info.BlazeInfo) BuildResultHelper(com.google.idea.blaze.base.command.buildresult.BuildResultHelper) Optional(java.util.Optional) BuildResultHelperProvider(com.google.idea.blaze.base.command.buildresult.BuildResultHelperProvider) ParsedBepOutput(com.google.idea.blaze.base.command.buildresult.ParsedBepOutput) Before(org.junit.Before)

Aggregations

BuildResultHelper (com.google.idea.blaze.base.command.buildresult.BuildResultHelper)3 BuildResultHelperProvider (com.google.idea.blaze.base.command.buildresult.BuildResultHelperProvider)3 ParsedBepOutput (com.google.idea.blaze.base.command.buildresult.ParsedBepOutput)3 BlazeInfo (com.google.idea.blaze.base.command.info.BlazeInfo)3 Project (com.intellij.openapi.project.Project)3 Optional (java.util.Optional)3 Before (org.junit.Before)3