diff options
author | Googler <noreply@google.com> | 2016-08-17 20:03:35 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-08-18 08:31:31 +0000 |
commit | 6c3fe26cbd07d3cb52739c1c296853f23332275d (patch) | |
tree | 42095e8606ca3d40cef7912cc35396bc3b7b09fa /src/test/java | |
parent | ff33193e8fcd24da29d377a0850b198a0a6c53d5 (diff) |
Fix NPE when aspect propagates over an alias.
--
MOS_MIGRATED_REVID=130553300
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java index c7e161b8e5..4f59705365 100644 --- a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java +++ b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java @@ -1620,6 +1620,35 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase assertThat(ruleIdeInfo.hasCRuleIdeInfo()).isFalse(); } + @Test + public void testAlias() throws Exception { + scratch.file( + "com/google/example/BUILD", + "java_library(", + " name = 'test',", + " srcs = ['Test.java'],", + " deps = [':alias']", + ")", + "alias(", + " name = 'alias',", + " actual = ':alias2',", + ")", + "alias(", + " name = 'alias2',", + " actual = ':real',", + ")", + "java_library(", + " name = 'real',", + " srcs = ['Real.java'],", + ")"); + Map<String, RuleIdeInfo> ruleIdeInfos = buildRuleIdeInfo("//com/google/example:test"); + RuleIdeInfo testInfo = getRuleInfoAndVerifyLabel( + "//com/google/example:test", ruleIdeInfos); + assertThat(testInfo.getDependenciesList()) + .contains("//com/google/example:real"); + assertThat(getRuleInfoAndVerifyLabel("//com/google/example:real", ruleIdeInfos)).isNotNull(); + } + /** * Returns true if we are testing the native aspect, not the Skylark one. * Eventually Skylark aspect will be equivalent to a native one, and this method |