testng: use repository library when adding testng library via quickfix

This way users projects won't depend on specific JAR from IDEA's installation (IDEA-192234).
This commit is contained in:
nik
2018-05-22 17:49:56 +03:00
parent 1175d1f31e
commit 06080cb0e5
@@ -15,19 +15,14 @@
*/
package com.theoryinpractice.testng.intention;
import com.beust.jcommander.JCommander;
import com.intellij.codeInsight.daemon.quickFix.ExternalLibraryResolver;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.ExternalLibraryDescriptor;
import com.intellij.util.PathUtil;
import com.intellij.util.ThreeState;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
/**
@@ -38,13 +33,7 @@ public class TestNGExternalLibraryResolver extends ExternalLibraryResolver {
"Test", "BeforeClass", "BeforeGroups", "BeforeMethod", "BeforeSuite", "BeforeTest", "AfterClass", "AfterGroups", "AfterMethod",
"AfterSuite", "AfterTest", "Configuration"
);
public static final ExternalLibraryDescriptor TESTNG_DESCRIPTOR = new ExternalLibraryDescriptor("org.testng", "testng") {
@NotNull
@Override
public List<String> getLibraryClassesRoots() {
return Arrays.asList(PathUtil.getJarPathForClass(Test.class), PathUtil.getJarPathForClass(JCommander.class));
}
};
public static final ExternalLibraryDescriptor TESTNG_DESCRIPTOR = new ExternalLibraryDescriptor("org.testng", "testng");
@Nullable
@Override