use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.
the class DependenciesTest method testJavaLibraryWithExports.
@Test
public void testJavaLibraryWithExports() throws Exception {
IntellijAspectTestFixture testFixture = loadTestFixture(":export_fixture");
TargetIdeInfo foo = findTarget(testFixture, ":foo");
TargetIdeInfo fooExporter = findTarget(testFixture, ":foo_exporter");
TargetIdeInfo exportConsumer = findTarget(testFixture, ":export_consumer");
assertThat(foo).isNotNull();
assertThat(dependenciesForTarget(fooExporter)).contains(dep(":foo"));
assertThat(dependenciesForTarget(exportConsumer)).containsAllOf(dep(":foo_exporter"), dep(":foo"));
assertThat(getOutputGroupFiles(testFixture, "intellij-info-java")).containsAllOf(testRelative("foo.java-manifest"), testRelative("foo.intellij-info.txt"), testRelative("foo_exporter.java-manifest"), testRelative("foo_exporter.intellij-info.txt"), testRelative("export_consumer.java-manifest"), testRelative("export_consumer.intellij-info.txt"));
assertThat(getOutputGroupFiles(testFixture, "intellij-resolve-java")).containsExactly(testRelative("libfoo.jar"), testRelative("libfoo-hjar.jar"), testRelative("libfoo-src.jar"), testRelative("libfoo_exporter.jar"), testRelative("libfoo_exporter-hjar.jar"), testRelative("libfoo_exporter-src.jar"), testRelative("libexport_consumer.jar"), testRelative("libexport_consumer-hjar.jar"), testRelative("libexport_consumer-src.jar"));
assertThat(getOutputGroupFiles(testFixture, "intellij-compile-java")).containsExactly(testRelative("libfoo.jar"), testRelative("libfoo_exporter.jar"), testRelative("libexport_consumer.jar"));
}
use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.
the class DependenciesTest method testJavaLibraryWithDependencies.
@Test
public void testJavaLibraryWithDependencies() throws Exception {
IntellijAspectTestFixture testFixture = loadTestFixture(":single_dep_fixture");
TargetIdeInfo fooTarget = findTarget(testFixture, ":foo");
assertThat(fooTarget).isNotNull();
TargetIdeInfo depTarget = findTarget(testFixture, ":single_dep");
assertThat(dependenciesForTarget(depTarget)).contains(dep(":foo"));
}
use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.
the class DependenciesTest method testJavaLibraryWithTransitiveExports.
@Test
public void testJavaLibraryWithTransitiveExports() throws Exception {
IntellijAspectTestFixture testFixture = loadTestFixture(":transitive_export_fixture");
TargetIdeInfo transitiveExportConsumer = findTarget(testFixture, ":transitive_export_consumer");
assertThat(dependenciesForTarget(transitiveExportConsumer)).containsAllOf(dep(":foo"), dep(":foo_exporter"), dep(":foo_exporter_exporter"));
}
use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.
the class PyLibraryTest method testPyLibrary.
@Test
public void testPyLibrary() throws Exception {
IntellijAspectTestFixture testFixture = loadTestFixture(":simple_fixture");
TargetIdeInfo target = findTarget(testFixture, ":simple");
assertThat(target.getKindString()).isEqualTo("py_library");
assertThat(target.hasPyIdeInfo()).isTrue();
assertThat(target.hasJavaIdeInfo()).isFalse();
assertThat(target.hasCIdeInfo()).isFalse();
assertThat(target.hasAndroidIdeInfo()).isFalse();
assertThat(target.hasProtoLibraryLegacyJavaIdeInfo()).isFalse();
assertThat(relativePathsForArtifacts(target.getPyIdeInfo().getSourcesList())).containsExactly(testRelative("simple.py"));
assertThat(getOutputGroupFiles(testFixture, "intellij-info-py")).containsExactly(testRelative("simple.intellij-info.txt"));
assertThat(getOutputGroupFiles(testFixture, "intellij-info-generic")).isEmpty();
}
use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.
the class ScalaBinaryTest method testScalaBinary.
@Test
public void testScalaBinary() throws Exception {
IntellijAspectTestFixture testFixture = loadTestFixture(":foo_fixture");
TargetIdeInfo binaryInfo = findTarget(testFixture, ":foo");
assertThat(binaryInfo.getKindString()).isEqualTo("scala_binary");
assertThat(relativePathsForArtifacts(binaryInfo.getJavaIdeInfo().getSourcesList())).containsExactly(testRelative("FooMain.scala"));
assertThat(dependenciesForTarget(binaryInfo)).contains(dep(":foolib"));
assertThat(binaryInfo.getJavaIdeInfo().getJarsList().stream().map(IntellijAspectTest::libraryArtifactToString).collect(Collectors.toList())).containsExactly(jarString(testRelative("foo.jar"), null, null));
assertThat(binaryInfo.getJavaIdeInfo().getMainClass()).isEqualTo("com.google.MyMainClass");
assertThat(getOutputGroupFiles(testFixture, "intellij-info-java")).containsAllOf(testRelative("foolib.intellij-info.txt"), testRelative("foo.intellij-info.txt"));
assertThat(getOutputGroupFiles(testFixture, "intellij-resolve-java")).containsAllOf(testRelative("foolib.jar"), testRelative("foo.jar"));
assertThat(getOutputGroupFiles(testFixture, "intellij-compile-java")).containsAllOf(testRelative("foolib.jar"), testRelative("foo.jar"));
assertThat(getOutputGroupFiles(testFixture, "intellij-info-generic")).isEmpty();
}
Aggregations