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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java (-2 / +32 lines)
Lines 46-52 Link Here
46
	}
46
	}
47
47
48
	static {
48
	static {
49
//		TESTS_NUMBERS = new int[] { 209 };
49
//		TESTS_NUMBERS = new int[] { 210 };
50
//		TESTS_NAMES = new String[] {"test0204"};
50
//		TESTS_NAMES = new String[] {"test0204"};
51
	}
51
	}
52
	public static Test suite() {
52
	public static Test suite() {
Lines 6358-6362 Link Here
6358
		IBinding binding = simpleName.resolveBinding();
6358
		IBinding binding = simpleName.resolveBinding();
6359
		assertNotNull("No binding", binding);
6359
		assertNotNull("No binding", binding);
6360
		assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind());
6360
		assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind());
6361
	}	
6361
	}
6362
	public void test0210() throws JavaModelException {
6363
		this.workingCopy = getWorkingCopy("/Converter15/src/X.java", false);
6364
		String contents =
6365
			"public class X {\n" + 
6366
			"	void foo(Object r) {\n" + 
6367
			"		if (r instanceof Future<?>) {\n" + 
6368
			"			System.out.println(\"TRUE\");\n" + 
6369
			"		} else {\n" + 
6370
			"			System.out.println(\"FALSE\");\n" + 
6371
			"		}\n" + 
6372
			"	}\n" + 
6373
			"}";
6374
		ASTNode node = buildAST(
6375
				contents,
6376
				this.workingCopy,
6377
				false);
6378
		assertNotNull("No node", node);
6379
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
6380
		CompilationUnit compilationUnit = (CompilationUnit) node;
6381
		assertProblemsSize(compilationUnit, 0);
6382
		node = getASTNode(compilationUnit, 0, 0, 0);
6383
		assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType());
6384
		IfStatement ifStatement = (IfStatement) node;
6385
		Expression expression = ifStatement.getExpression();
6386
		checkSourceRange(expression, "r instanceof Future<?>", contents);
6387
		assertEquals("Not an instanceof expression", ASTNode.INSTANCEOF_EXPRESSION, expression.getNodeType());
6388
		InstanceofExpression instanceofExpression = (InstanceofExpression) expression;
6389
		Type type = instanceofExpression.getRightOperand();
6390
		checkSourceRange(type, "Future<?>", contents);
6391
	}
6362
}
6392
}

Return to bug 128077