Skip to content

Commit

Permalink
Remove some illegal args and npe's when running individual tests from…
Browse files Browse the repository at this point in the history
… within pde

Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
Rob Stryker authored and akurtakov committed Jul 16, 2024
1 parent 6f5b0a1 commit f68d698
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import java.util.List;
import java.util.Map;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
Expand Down Expand Up @@ -71,6 +68,9 @@
import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;

import junit.framework.Test;
import junit.framework.TestSuite;

/**
* Class to test DOM/AST nodes built for Javadoc comments.
*
Expand Down Expand Up @@ -147,11 +147,25 @@ public ASTConverterJavadocTest(String name, String support, String unix) {
this.unix = "true".equals(unix);
}
public ASTConverterJavadocTest(String name) {
this(name.substring(0, name.indexOf(" - ")),
name.substring(name.indexOf(" - Doc ") + 7, name.lastIndexOf("abled") + 5),
this(preHyphen(name), nameToSupport(name),
name.indexOf(" - Unix") != -1 ? "true" : "false");
}

private static String preHyphen(String name) {
int hyphenInd = name.indexOf(" - ");
String r = hyphenInd == -1 ? name : name.substring(0, hyphenInd);
return r;
}
private static String nameToSupport(String name) {
int ind1 = name.indexOf(" - Doc ");
int ind2 = name.lastIndexOf("abled");
if( ind1 == -1 || ind2 == -1 )
return name;
String s = name.substring(name.indexOf(" - Doc ") + 7, name.lastIndexOf("abled") + 5);
return s;
}


/* (non-Javadoc)
* @see junit.framework.TestCase#getName()
*/
Expand Down

0 comments on commit f68d698

Please sign in to comment.