use of com.python.pydev.analysis.refactoring.refactorer.Refactorer in project Pydev by fabioz.
the class TddCodeGenerationQuickFixParticipantTest method setUp.
/*
* @see TestCase#setUp()
*/
@Override
public void setUp() throws Exception {
super.setUp();
AbstractPyRefactoring.setPyRefactoring(new Refactorer());
CompiledModule.COMPILED_MODULES_ENABLED = false;
this.restorePythonPath(TestDependent.getCompletePythonLib(true, isPython3Test()) + "|" + TestDependent.PYTHON2_PIL_PACKAGES + "|" + TestDependent.TEST_PYSRC_TESTING_LOC + "configobj-4.6.0-py2.6.egg", false);
this.restorePythonPath(false);
codeCompletion = new PyCodeCompletion();
TddCodeGenerationQuickFixParticipant.onGetTddPropsError = new ICallback<Boolean, Exception>() {
@Override
public Boolean call(Exception e) {
throw new RuntimeException("Error:" + org.python.pydev.shared_core.log.Log.getExceptionStr(e));
}
};
PyCodeCompletion.onCompletionRecursionException = new ICallback<Object, CompletionRecursionException>() {
@Override
public Object call(CompletionRecursionException e) {
throw new RuntimeException("Recursion error:" + org.python.pydev.shared_core.log.Log.getExceptionStr(e));
}
};
}
use of com.python.pydev.analysis.refactoring.refactorer.Refactorer in project Pydev by fabioz.
the class FindActualDefinitionTest method testOccurrencesForDefinition.
public void testOccurrencesForDefinition() throws Exception {
int usedGrammar = GRAMMAR_TO_USE_FOR_PARSING;
GRAMMAR_TO_USE_FOR_PARSING = PythonNature.LATEST_GRAMMAR_PY3_VERSION;
try {
File file = new File(TestDependent.TEST_PYSRC_TESTING_LOC + "occurrencesForDefinition/foo.py");
PySelection selection = new PySelection(new Document(FileUtils.getFileContents(file)), 0, 19, 4);
Refactorer.setPyRefactoring(new Refactorer());
RefactoringRequest req = new RefactoringRequest(file, selection, nature);
req.fillActivationTokenAndQualifier();
req.setAdditionalInfo(RefactoringRequest.FIND_DEFINITION_IN_ADDITIONAL_INFO, false);
req.setAdditionalInfo(RefactoringRequest.FIND_REFERENCES_ONLY_IN_LOCAL_SCOPE, true);
PyReferenceSearcher pyReferenceSearcher = new PyReferenceSearcher(req);
pyReferenceSearcher.prepareSearch(req);
pyReferenceSearcher.search(req);
HashSet<ASTEntry> ref = pyReferenceSearcher.getLocalReferences(req);
assertEquals(4, ref.size());
} finally {
GRAMMAR_TO_USE_FOR_PARSING = usedGrammar;
}
}
use of com.python.pydev.analysis.refactoring.refactorer.Refactorer in project Pydev by fabioz.
the class ClassHierarchySearchTest method setUp.
@Override
public void setUp() throws Exception {
CompiledModule.COMPILED_MODULES_ENABLED = true;
SourceModule.TESTING = true;
refactorer = new Refactorer();
if (baseDir != null && !baseDir.exists()) {
baseDir.mkdirs();
}
if (baseDir2 != null && !baseDir2.exists()) {
baseDir2.mkdirs();
}
super.setUp();
}
use of com.python.pydev.analysis.refactoring.refactorer.Refactorer in project Pydev by fabioz.
the class SearchTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
CompiledModule.COMPILED_MODULES_ENABLED = true;
this.restorePythonPath(false);
refactorer = new Refactorer();
}
use of com.python.pydev.analysis.refactoring.refactorer.Refactorer in project Pydev by fabioz.
the class RefactoringLocalTestBase method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
CompiledModule.COMPILED_MODULES_ENABLED = getCompiledModulesEnabled();
this.restorePythonPath(getForceRestorePythonPath());
AbstractPyRefactoring.setPyRefactoring(new Refactorer());
}
Aggregations