Search in sources :

Example 1 with AllInPackageBlazeConfigurationProducer

use of com.google.idea.blaze.base.run.producers.AllInPackageBlazeConfigurationProducer in project intellij by bazelbuild.

the class AllInPackageBlazeConfigurationProducerTest method testDirectoryWithoutBlazePackageChildIsIgnored.

@Test
public void testDirectoryWithoutBlazePackageChildIsIgnored() {
    PsiDirectory directory = workspace.createPsiDirectory(new WorkspacePath("java/com/google/test"));
    ConfigurationContext context = createContextFromPsi(directory);
    AllInPackageBlazeConfigurationProducer producer = new AllInPackageBlazeConfigurationProducer();
    assertThat(producer.createConfigurationFromContext(context)).isNull();
    workspace.createPsiDirectory(new WorkspacePath("java/com/google/test/child_dir"));
    workspace.createPsiFile(new WorkspacePath("java/com/google/test/child_dir/BUILD"));
    assertThat(producer.createConfigurationFromContext(context)).isNotNull();
}
Also used : WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) ConfigurationContext(com.intellij.execution.actions.ConfigurationContext) AllInPackageBlazeConfigurationProducer(com.google.idea.blaze.base.run.producers.AllInPackageBlazeConfigurationProducer) PsiDirectory(com.intellij.psi.PsiDirectory) Test(org.junit.Test)

Aggregations

WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)1 AllInPackageBlazeConfigurationProducer (com.google.idea.blaze.base.run.producers.AllInPackageBlazeConfigurationProducer)1 ConfigurationContext (com.intellij.execution.actions.ConfigurationContext)1 PsiDirectory (com.intellij.psi.PsiDirectory)1 Test (org.junit.Test)1