RefactoringStatus result= performRefactoring(ref); assertNotNull("precondition was supposed to fail", result);
RefactoringStatus result= ref.checkActivation(new NullProgressMonitor()); ref.setFieldName(newName); ref.setDeclareFinal(declareFinal); ref.setDeclareStatic(declareStatic); ref.setInitializeIn(initializeIn); ref.setVisibility(accessModifier); result.merge(ref.checkInput(new NullProgressMonitor())); if (result.isOK()) result= null; assertNotNull("precondition was supposed to fail",result);
	private void failHelper(int startLine, int startColumn, int endLine, int endColumn, 						  String newName,						  boolean declareStatic,						  boolean declareFinal,						  int initializeIn,						  int accessModifier,						  int expectedSeverity) throws Exception{		ICompilationUnit cu= createCUfromTestFile(getPackageP(), false, true);						  			ISourceRange selection= TextRangeUtil.getSelection(cu, startLine, startColumn, endLine, endColumn);        PromoteTempToFieldRefactoring ref= getRefactoringObject(selection, cu, newName, declareStatic, declareFinal, initializeIn, accessModifier);				RefactoringStatus result= performRefactoring(ref);		assertNotNull("precondition was supposed to fail", result);		assertEquals("incorrect severity:", expectedSeverity, result.getSeverity());	}