]> git.uio.no Git - ifi-stolz-refaktor.git/blobdiff - software/no.uio.ifi.refaktor.tests/src/no/uio/ifi/refaktor/tests/SearchBasedExtractAndMoveMethodAnalyzerTest.java
ExtractAndMoveMethodAnalysisResult: renaming to ExtractAndMoveMethodCandidate
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor.tests / src / no / uio / ifi / refaktor / tests / SearchBasedExtractAndMoveMethodAnalyzerTest.java
index eb8b38593d30a59ba06c52147b2504e69704074a..8c30fe0e17880c9ed49221459f52ea85508e9ec9 100644 (file)
@@ -5,7 +5,7 @@ import static org.hamcrest.CoreMatchers.instanceOf;
 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;
@@ -49,7 +49,7 @@ public class SearchBasedExtractAndMoveMethodAnalyzerTest {
 
                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));
@@ -59,19 +59,19 @@ public class SearchBasedExtractAndMoveMethodAnalyzerTest {
 
                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));
@@ -81,7 +81,7 @@ public class SearchBasedExtractAndMoveMethodAnalyzerTest {
 
                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)