Fix tests to work with JavaPluginInfo.
@@ -1167,77 +1167,6 @@ public class JavaStarlarkApiTest extends BuildViewTestCase {
((Depset) info.getValue("processor_data")).getSet(Artifact.class));
}
- /** Tests that java_plugin exposes plugin information to Starlark in JavaInfo provider. */
- @Test
- public void javaPlugin_javaInfoExposesPluginsToStarlark() throws Exception {
- scratch.file(
- "java/test/BUILD",
- "java_library(",
- " name = 'plugin_dep',",
- " srcs = ['ProcessorDep.java'],",
- " data = ['depfile.dat'],",
- ")",
- "java_plugin(",
- " name = 'plugin',",
- " srcs = ['AnnotationProcessor.java'],",
- " processor_class = 'com.google.process.stuff',",
- " deps = [':plugin_dep'],",
- " data = ['pluginfile.dat'],",
- ")");
-
- JavaPluginData pluginData =
- retrieveStarlarkPluginData(
- "//java/test:plugin", /* provider = */ "JavaInfo", /* apiGenerating = */ false);
- JavaPluginData apiPluginData =
- retrieveStarlarkPluginData(
- "//java/test:plugin", /* provider = */ "JavaInfo", /* apiGenerating = */ true);
-
- assertThat(pluginData.processorClasses().toList()).containsExactly("com.google.process.stuff");
- assertThat(pluginData.processorClasspath().toList().stream().map(Artifact::getFilename))
- .containsExactly("libplugin.jar", "libplugin_dep.jar");
- assertThat(pluginData.data().toList().stream().map(Artifact::getFilename))
- .containsExactly("pluginfile.dat");
- assertThat(apiPluginData).isEqualTo(JavaPluginData.empty());
- }
-
- /**
- * Tests that api generating java_plugin exposes plugin information to Starlark in JavaInfo
- * provider.
- */
- @Test
- public void apiGeneratingjavaPlugin_javaInfoExposesPluginsToStarlark() throws Exception {
- scratch.file(
- "java/test/BUILD",
- "java_library(",
- " name = 'plugin_dep',",
- " srcs = ['ProcessorDep.java'],",
- " data = ['depfile.dat'],",
- ")",
- "java_plugin(",
- " name = 'plugin',",
- " generates_api = True,",
- " srcs = ['AnnotationProcessor.java'],",
- " processor_class = 'com.google.process.stuff',",
- " deps = [':plugin_dep'],",
- " data = ['pluginfile.dat'],",
- ")");
-
- JavaPluginData pluginData =
- retrieveStarlarkPluginData(
- "//java/test:plugin", /* provider = */ "JavaInfo", /* apiGenerating = */ false);
- JavaPluginData apiPluginData =
- retrieveStarlarkPluginData(
- "//java/test:plugin", /* provider = */ "JavaInfo", /* apiGenerating = */ true);
-
- assertThat(apiPluginData.processorClasses().toList())
- .containsExactly("com.google.process.stuff");
- assertThat(apiPluginData.processorClasspath().toList().stream().map(Artifact::getFilename))
- .containsExactly("libplugin.jar", "libplugin_dep.jar");
- assertThat(apiPluginData.data().toList().stream().map(Artifact::getFilename))
- .containsExactly("pluginfile.dat");
- assertThat(apiPluginData).isEqualTo(pluginData);
- }
-
/** Tests that java_plugin exposes plugin information to Starlark. */
@Test
public void javaPlugin_exposesPluginsToStarlark() throws Exception {
