Search in sources :

Example 6 with IntellijAspectTestFixture

use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.

the class FilteredGenJarTest method testFilteredGenJar.

@Test
public void testFilteredGenJar() throws Exception {
    IntellijAspectTestFixture testFixture = loadTestFixture(":mixed_fixture");
    TargetIdeInfo targetIdeInfo = findTarget(testFixture, ":mixed");
    assertThat(targetIdeInfo.getJavaIdeInfo().hasFilteredGenJar()).isTrue();
    assertThat(targetIdeInfo.getJavaIdeInfo().getFilteredGenJar().getJar().getRelativePath()).isEqualTo(testRelative("mixed-filtered-gen.jar"));
    assertThat(targetIdeInfo.getJavaIdeInfo().getFilteredGenJar().getSourceJar().getRelativePath()).isEqualTo(testRelative("mixed-filtered-gen-src.jar"));
}
Also used : TargetIdeInfo(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.TargetIdeInfo) IntellijAspectTestFixture(com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture) Test(org.junit.Test) BazelIntellijAspectTest(com.google.idea.blaze.BazelIntellijAspectTest)

Example 7 with IntellijAspectTestFixture

use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.

the class GenJarsTest method testFilteredGenJarNotCreatedForSourceOnlyRule.

@Test
public void testFilteredGenJarNotCreatedForSourceOnlyRule() throws Exception {
    IntellijAspectTestFixture testFixture = loadTestFixture(":no_plugin_fixture");
    TargetIdeInfo targetIdeInfo = findTarget(testFixture, ":no_plugin");
    assertThat(targetIdeInfo.getJavaIdeInfo().getGeneratedJarsList()).isEmpty();
}
Also used : TargetIdeInfo(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.TargetIdeInfo) IntellijAspectTestFixture(com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture) IntellijAspectTest(com.google.idea.blaze.aspect.IntellijAspectTest) Test(org.junit.Test) BazelIntellijAspectTest(com.google.idea.blaze.BazelIntellijAspectTest)

Example 8 with IntellijAspectTestFixture

use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.

the class GenJarsTest method testJavaLibraryWithGeneratedSourcesHasGenJars.

@Test
public void testJavaLibraryWithGeneratedSourcesHasGenJars() throws Exception {
    IntellijAspectTestFixture testFixture = loadTestFixture(":has_plugin_fixture");
    TargetIdeInfo targetIdeInfo = findTarget(testFixture, ":has_plugin");
    assertThat(targetIdeInfo.getJavaIdeInfo().getGeneratedJarsList().stream().map(IntellijAspectTest::libraryArtifactToString).collect(toList())).containsExactly(jarString(testRelative("libhas_plugin-gen.jar"), null, testRelative("libhas_plugin-gensrc.jar")));
    assertThat(getOutputGroupFiles(testFixture, "intellij-info-java")).containsAllOf(testRelative("has_plugin.java-manifest"), testRelative("has_plugin.intellij-info.txt"));
    assertThat(getOutputGroupFiles(testFixture, "intellij-resolve-java")).containsAllOf(testRelative("libhas_plugin-gen.jar"), testRelative("libhas_plugin-gensrc.jar"));
    assertThat(getOutputGroupFiles(testFixture, "intellij-compile-java")).containsAllOf(testRelative("libhas_plugin.jar"), testRelative("libhas_plugin-gen.jar"));
    assertThat(getOutputGroupFiles(testFixture, "intellij-info-generic")).isEmpty();
}
Also used : TargetIdeInfo(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.TargetIdeInfo) IntellijAspectTestFixture(com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture) IntellijAspectTest(com.google.idea.blaze.aspect.IntellijAspectTest) Test(org.junit.Test) BazelIntellijAspectTest(com.google.idea.blaze.BazelIntellijAspectTest)

Example 9 with IntellijAspectTestFixture

use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.

the class DependenciesTest method testJavaLibraryWithDiamondDependencies.

@Test
public void testJavaLibraryWithDiamondDependencies() throws Exception {
    IntellijAspectTestFixture testFixture = loadTestFixture(":diamond_dep_fixture");
    TargetIdeInfo target = findTarget(testFixture, ":diamond_dep");
    assertThat(dependenciesForTarget(target)).containsAllOf(dep(":single_dep"), dep(":single_dep_sibling"));
}
Also used : TargetIdeInfo(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.TargetIdeInfo) IntellijAspectTestFixture(com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture) Test(org.junit.Test) BazelIntellijAspectTest(com.google.idea.blaze.BazelIntellijAspectTest)

Example 10 with IntellijAspectTestFixture

use of com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture in project intellij by bazelbuild.

the class DependenciesTest method testJavaLibraryWithTransitiveDependencies.

@Test
public void testJavaLibraryWithTransitiveDependencies() throws Exception {
    IntellijAspectTestFixture testFixture = loadTestFixture(":transitive_dep_fixture");
    TargetIdeInfo target = findTarget(testFixture, ":transitive_dep");
    assertThat(dependenciesForTarget(target)).contains(dep(":single_dep"));
    assertThat(getOutputGroupFiles(testFixture, "intellij-info-java")).containsAllOf(testRelative("foo.java-manifest"), testRelative("foo.intellij-info.txt"), testRelative("single_dep.java-manifest"), testRelative("single_dep.intellij-info.txt"), testRelative("transitive_dep.java-manifest"), testRelative("transitive_dep.intellij-info.txt"));
    assertThat(getOutputGroupFiles(testFixture, "intellij-resolve-java")).containsExactly(testRelative("libfoo.jar"), testRelative("libfoo-hjar.jar"), testRelative("libfoo-src.jar"), testRelative("libsingle_dep.jar"), testRelative("libsingle_dep-hjar.jar"), testRelative("libsingle_dep-src.jar"), testRelative("libtransitive_dep.jar"), testRelative("libtransitive_dep-hjar.jar"), testRelative("libtransitive_dep-src.jar"));
    assertThat(getOutputGroupFiles(testFixture, "intellij-compile-java")).containsExactly(testRelative("libfoo.jar"), testRelative("libsingle_dep.jar"), testRelative("libtransitive_dep.jar"));
    assertThat(getOutputGroupFiles(testFixture, "intellij-info-generic")).isEmpty();
}
Also used : TargetIdeInfo(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.TargetIdeInfo) IntellijAspectTestFixture(com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture) Test(org.junit.Test) BazelIntellijAspectTest(com.google.idea.blaze.BazelIntellijAspectTest)

Aggregations

IntellijAspectTestFixture (com.google.devtools.intellij.IntellijAspectTestFixtureOuterClass.IntellijAspectTestFixture)34 BazelIntellijAspectTest (com.google.idea.blaze.BazelIntellijAspectTest)33 Test (org.junit.Test)33 TargetIdeInfo (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.TargetIdeInfo)32 IntellijAspectTest (com.google.idea.blaze.aspect.IntellijAspectTest)11 CIdeInfo (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.CIdeInfo)5 Iterables (com.google.common.collect.Iterables)1 Truth.assertThat (com.google.common.truth.Truth.assertThat)1 CToolchainIdeInfo (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.CToolchainIdeInfo)1 Dependency (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.Dependency)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 List (java.util.List)1 Objects (java.util.Objects)1 Collectors (java.util.stream.Collectors)1 Collectors.toList (java.util.stream.Collectors.toList)1 RunWith (org.junit.runner.RunWith)1 JUnit4 (org.junit.runners.JUnit4)1