Search in sources :

Example 1 with BlazeAndroidBinaryRunConfigurationState

use of com.google.idea.blaze.android.run.binary.BlazeAndroidBinaryRunConfigurationState in project intellij by bazelbuild.

the class TestRecorderBlazeCommandRunConfigurationTest method testLaunchActivityClass.

@Test
public void testLaunchActivityClass() {
    BlazeCommandRunConfiguration blazeConfiguration = BlazeCommandRunConfigurationType.getInstance().getFactory().createTemplateConfiguration(getProject());
    blazeConfiguration.setTarget(Label.create("//label:android_binary_rule"));
    BlazeAndroidBinaryRunConfigurationState configurationState = ((BlazeAndroidBinaryRunConfigurationHandler) blazeConfiguration.getHandler()).getState();
    configurationState.setMode(BlazeAndroidBinaryRunConfigurationState.LAUNCH_SPECIFIC_ACTIVITY);
    configurationState.setActivityClass("MyAppMainActivity");
    TestRecorderRunConfigurationProxy proxy = TestRecorderRunConfigurationProxy.getInstance(blazeConfiguration);
    assertThat(proxy).isNotNull();
    assertThat(proxy.getLaunchActivityClass()).isEqualTo("MyAppMainActivity");
}
Also used : BlazeAndroidBinaryRunConfigurationHandler(com.google.idea.blaze.android.run.binary.BlazeAndroidBinaryRunConfigurationHandler) BlazeCommandRunConfiguration(com.google.idea.blaze.base.run.BlazeCommandRunConfiguration) BlazeAndroidBinaryRunConfigurationState(com.google.idea.blaze.android.run.binary.BlazeAndroidBinaryRunConfigurationState) TestRecorderRunConfigurationProxy(com.google.gct.testrecorder.run.TestRecorderRunConfigurationProxy) Test(org.junit.Test)

Aggregations

TestRecorderRunConfigurationProxy (com.google.gct.testrecorder.run.TestRecorderRunConfigurationProxy)1 BlazeAndroidBinaryRunConfigurationHandler (com.google.idea.blaze.android.run.binary.BlazeAndroidBinaryRunConfigurationHandler)1 BlazeAndroidBinaryRunConfigurationState (com.google.idea.blaze.android.run.binary.BlazeAndroidBinaryRunConfigurationState)1 BlazeCommandRunConfiguration (com.google.idea.blaze.base.run.BlazeCommandRunConfiguration)1 Test (org.junit.Test)1