import static org.junit.Assert.assertTrue;
import no.uio.ifi.refaktor.analyze.analyzers.Analyzer;
import no.uio.ifi.refaktor.analyze.analyzers.SearchBasedExtractAndMoveMethodAnalyzer;
-import no.uio.ifi.refaktor.analyze.comparators.FavorNoUnfixesAnalysisResultComparator;
+import no.uio.ifi.refaktor.analyze.comparators.FavorNoUnfixesCandidateComparator;
import no.uio.ifi.refaktor.analyze.exceptions.NoTargetFoundException;
import no.uio.ifi.refaktor.examples.manager.ExampleCodeManager;
import no.uio.ifi.refaktor.prefix.Prefix;
int methodOffset = method.getSourceRange().getOffset();
CompilationUnitTextSelection textSelection = new CompilationUnitTextSelection(method.getCompilationUnit(), methodOffset + 69, 10);
- assertThat(textSelection.isEquivalentTo(analyzer.getResult().textSelection));
+ assertThat(textSelection.isEquivalentTo(analyzer.getCandidate().textSelection));
ASTNode coveredNode = textSelection.getCoveredNode();
assertThat(coveredNode, instanceOf(ExpressionStatement.class));
MethodInvocation methodInvocation = (MethodInvocation) expressionStatement.getExpression();
Prefix prefix = new Prefix(methodInvocation);
- assertTrue(prefix.getVariableBindingOfFirstExpression().isEqualTo(analyzer.getResult().calculateOriginalTarget()));
+ assertTrue(prefix.getVariableBindingOfFirstExpression().isEqualTo(analyzer.getCandidate().calculateOriginalTarget()));
}
@Test
public void testSearchableMethodFavorNoUnfixes() throws Exception {
IMethod method = getTestDataMethod("searchableMethod");
- SearchBasedExtractAndMoveMethodAnalyzer analyzer = new SearchBasedExtractAndMoveMethodAnalyzer(method, new FavorNoUnfixesAnalysisResultComparator());
+ SearchBasedExtractAndMoveMethodAnalyzer analyzer = new SearchBasedExtractAndMoveMethodAnalyzer(method, new FavorNoUnfixesCandidateComparator());
analyzer.analyze();
int methodOffset = method.getSourceRange().getOffset();
CompilationUnitTextSelection textSelection = new CompilationUnitTextSelection(method.getCompilationUnit(), methodOffset + 100, 31);
- assertThat(textSelection.isEquivalentTo(analyzer.getResult().textSelection));
+ assertThat(textSelection.isEquivalentTo(analyzer.getCandidate().textSelection));
ASTNode coveredNode = textSelection.getCoveredNode();
assertThat(coveredNode, instanceOf(ExpressionStatement.class));
MethodInvocation methodInvocation = (MethodInvocation) expressionStatement.getExpression();
Prefix prefix = new Prefix(methodInvocation);
- assertTrue(prefix.getVariableBindingOfFirstExpression().isEqualTo(analyzer.getResult().calculateOriginalTarget()));
+ assertTrue(prefix.getVariableBindingOfFirstExpression().isEqualTo(analyzer.getCandidate().calculateOriginalTarget()));
}
@Test(expected=NoTargetFoundException.class)