use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class LoadStatementAnnotatorTest method testWarningForDeprecatedFormat.
@Test
public void testWarningForDeprecatedFormat() {
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "load('/tools/ide/build_test.bzl', 'build_test')");
assertHasAnnotation(file, "Deprecated load syntax; loaded Skylark module should by in label format.", HighlightSeverity.WARNING);
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class LoadStatementAnnotatorTest method testNoWarningsInExternalLoad.
@Test
public void testNoWarningsInExternalLoad() {
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "load('@tools//ide:build_test.bzl', 'build_test')");
assertNoAnnotations(file);
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class LoadStatementAnnotatorTest method testNoWarningsInNormalLoad.
@Test
public void testNoWarningsInNormalLoad() {
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "load('//tools/ide/build_test.bzl', 'build_test')", "load(':local_file.bzl', 'symbol')");
assertNoAnnotations(file);
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class ProjectViewCompletionTest method testNonDirectoriesIncludedForSectionsAcceptingFiles.
@Test
public void testNonDirectoriesIncludedForSectionsAcceptingFiles() {
setInput("import java<caret>");
workspace.createFile(new WorkspacePath("java/.blazeproject"));
String[] completionItems = editorTest.getCompletionItemsAsStrings();
assertThat(completionItems).isNull();
assertResult("import java/.blazeproject<caret>");
}
use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.
the class ProjectViewSetTest method testProjectViewSetSerializable.
@Test
public void testProjectViewSetSerializable() throws Exception {
ProjectViewSet projectViewSet = ProjectViewSet.builder().add(ProjectView.builder().add(ListSection.builder(DirectorySection.KEY).add(DirectoryEntry.include(new WorkspacePath("test")))).add(ListSection.builder(TargetSection.KEY).add(TargetExpression.fromStringSafe("//test:all"))).add(ScalarSection.builder(ImportSection.KEY).set(new WorkspacePath("test"))).add(ListSection.builder(TestSourceSection.KEY).add(new Glob("javatests/*"))).add(ListSection.builder(ExcludedSourceSection.KEY).add(new Glob("*.java"))).add(ListSection.builder(BuildFlagsSection.KEY).add("--android_sdk=abcd")).add(ListSection.builder(SyncFlagsSection.KEY).add("--config=arm")).add(ListSection.builder(ImportTargetOutputSection.KEY).add(Label.create("//test:test"))).add(ListSection.builder(ExcludeTargetSection.KEY).add(Label.create("//test:test"))).add(ScalarSection.builder(WorkspaceTypeSection.KEY).set(WorkspaceType.JAVA)).add(ListSection.builder(AdditionalLanguagesSection.KEY).add(LanguageClass.JAVA)).add(TextBlockSection.of(TextBlock.newLine())).add(ListSection.builder(RunConfigurationsSection.KEY).add(new WorkspacePath("test"))).add(ScalarSection.builder(ShardBlazeBuildsSection.KEY).set(false)).add(ScalarSection.builder(TargetShardSizeSection.KEY).set(500)).build()).build();
// Assert we have all sections
assert projectViewSet.getTopLevelProjectViewFile() != null;
ProjectView projectView = projectViewSet.getTopLevelProjectViewFile().projectView;
for (SectionParser parser : Sections.getParsers()) {
ImmutableList<Section<?>> sections = projectView.getSections();
assertThat(sections.stream().anyMatch(section -> section.isSectionType(parser.getSectionKey()))).isTrue();
}
TestUtils.assertIsSerializable(projectViewSet);
}
Aggregations