View | Details | Raw Unified | Return to bug 110438 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java (+38 lines)
Lines 4416-4420 Link Here
4416
		expected1.append("}\n");
4416
		expected1.append("}\n");
4417
		assertExpectedExistInProposals(proposals, new String[] {expected1.toString()});	
4417
		assertExpectedExistInProposals(proposals, new String[] {expected1.toString()});	
4418
	}
4418
	}
4419
	
4420
	public void testSurroundWithRunnable30() throws Exception {
4421
		
4422
		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
4423
		StringBuffer buf= new StringBuffer();
4424
		buf.append("package test;\n");
4425
		buf.append("public class E {\n");
4426
		buf.append("    public void foo() {\n");
4427
		buf.append("        if (true) \n");
4428
		buf.append("            System.out.println(1);\n");
4429
		buf.append("    }\n");
4430
		buf.append("}\n");
4431
		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
4432
		
4433
		StringBuffer selection= new StringBuffer();
4434
		selection.append("            System.out.println(1);\n");
4435
		
4436
		AssistContext context= getCorrectionContext(cu, buf.toString().indexOf(selection.toString()), selection.toString().length());
4437
		List proposals= collectAssists(context, false);
4438
		
4439
		assertNumberOfProposals(proposals, 9);
4440
		assertCorrectLabels(proposals);
4441
4442
		StringBuffer expected1= new StringBuffer();
4443
		expected1.append("package test;\n");
4444
		expected1.append("public class E {\n");
4445
		expected1.append("    public void foo() {\n");
4446
		expected1.append("        if (true) {\n");
4447
		expected1.append("            Runnable runnable = new Runnable() {\n");
4448
		expected1.append("                public void run() {\n");
4449
		expected1.append("                    System.out.println(1);\n");
4450
		expected1.append("                }\n");
4451
		expected1.append("            };\n");
4452
		expected1.append("        }\n");
4453
		expected1.append("    }\n");
4454
		expected1.append("}\n");
4455
		assertExpectedExistInProposals(proposals, new String[] {expected1.toString()});	
4456
	}
4419
4457
4420
}
4458
}

Return to bug 110438