use of com.google.idea.blaze.base.sync.BlazeSyncParams in project intellij by bazelbuild.
the class JavascriptSyncTest method testSimpleTestSourcesIdentified.
@Test
public void testSimpleTestSourcesIdentified() {
TestUtils.setPlatformPrefix(getTestRootDisposable(), PlatformUtils.IDEA_PREFIX);
setProjectView("directories:", " common/jslayout/calendar", " common/jslayout/tests", "targets:", " //common/jslayout/...:all", "test_sources:", " common/jslayout/tests", "workspace_type: javascript");
VirtualFile rootFile = workspace.createDirectory(new WorkspacePath("common/jslayout/calendar"));
VirtualFile testFile = workspace.createFile(new WorkspacePath("common/jslayout/tests/date_formatter_test.js"));
BlazeSyncParams syncParams = new BlazeSyncParams.Builder("Full Sync", BlazeSyncParams.SyncMode.FULL).addProjectViewTargets(true).build();
runBlazeSync(syncParams);
errorCollector.assertNoIssues();
assertThat(getWorkspaceContentEntries()).hasSize(2);
ContentEntry sourceEntry = findContentEntry(rootFile);
assertThat(sourceEntry.getSourceFolders()).hasLength(1);
SourceFolder nonTestSource = findSourceFolder(sourceEntry, rootFile);
assertThat(nonTestSource.isTestSource()).isFalse();
ContentEntry testEntry = findContentEntry(testFile.getParent());
assertThat(testEntry.getSourceFolders()).hasLength(1);
SourceFolder testSource = findSourceFolder(testEntry, testFile.getParent());
assertThat(testSource.isTestSource()).isTrue();
}
use of com.google.idea.blaze.base.sync.BlazeSyncParams in project intellij by bazelbuild.
the class JavascriptSyncTest method testUsefulErrorMessageInCommunityEdition.
@Test
public void testUsefulErrorMessageInCommunityEdition() {
TestUtils.setPlatformPrefix(getTestRootDisposable(), PlatformUtils.IDEA_CE_PREFIX);
setProjectView("directories:", " common/jslayout", "targets:", " //common/jslayout/...:all", "workspace_type: javascript");
workspace.createDirectory(new WorkspacePath("common/jslayout"));
BlazeSyncParams syncParams = new BlazeSyncParams.Builder("Full Sync", BlazeSyncParams.SyncMode.FULL).addProjectViewTargets(true).build();
runBlazeSync(syncParams);
errorCollector.assertIssues("IntelliJ Ultimate needed for Javascript support.");
}
Aggregations