Skip to content

Commit

Permalink
Some experimenting with #4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raffi Khatchadourian committed Aug 24, 2015
1 parent 9552de4 commit 5d3c41e
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Hashtable;
import java.util.logging.Logger;

import javax.swing.JList;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;

Expand Down Expand Up @@ -172,7 +179,18 @@ protected void helperPass(String[] methodNames, String[][] signatures) throws Ex
assertTrue("Precondition was supposed to pass.", initialStatus.isOK() && finalStatus.isOK());
performChange(refactoring, false);

String expected = getFileContents(getOutputTestFileName("A"));
String outputTestFileName = getOutputTestFileName("A");
String expected = getFileContents(outputTestFileName);

ASTParser parser = ASTParser.newParser(AST.JLS8);
char[] expectedCharArray = expected.toCharArray();
parser.setSource(expectedCharArray);
parser.setKind(ASTParser.K_COMPILATION_UNIT);

Hashtable options = JavaCore.getDefaultOptions();

ASTNode createAST = parser.createAST(new NullProgressMonitor());

String actual = cu.getSource();
assertEqualLines(expected, actual);
}
Expand Down

0 comments on commit 5d3c41e

Please sign in to comment.