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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (-3 / +41 lines)
Lines 106-112 Link Here
106
106
107
	static {
107
	static {
108
//		TESTS_NAMES = new String[] {"test0602"};
108
//		TESTS_NAMES = new String[] {"test0602"};
109
//		TESTS_NUMBERS =  new int[] { 619 };
109
//		TESTS_NUMBERS =  new int[] { 621 };
110
	}
110
	}
111
	public static Test suite() {
111
	public static Test suite() {
112
		return buildTestSuite(ASTConverterTestAST3_2.class);
112
		return buildTestSuite(ASTConverterTestAST3_2.class);
Lines 6746-6753 Link Here
6746
		ICompilationUnit workingCopy = null;
6746
		ICompilationUnit workingCopy = null;
6747
		try {
6747
		try {
6748
			String contents =
6748
			String contents =
6749
				"public class X {\r\n" + 
6749
				"public class X {\n" + 
6750
				"	String f = \"\" + \"\" - 1;\r\n" + 
6750
				"	String f = \"\" + \"\" - 1;\n" + 
6751
				"}";
6751
				"}";
6752
			workingCopy = getWorkingCopy("/Converter/src/X.java", false/*resolve*/);
6752
			workingCopy = getWorkingCopy("/Converter/src/X.java", false/*resolve*/);
6753
			ASTNode node = buildAST(
6753
			ASTNode node = buildAST(
Lines 6812-6815 Link Here
6812
		VariableDeclarationStatement declarationStatement = (VariableDeclarationStatement) statement2;
6812
		VariableDeclarationStatement declarationStatement = (VariableDeclarationStatement) statement2;
6813
		assertEquals("Wrong number of fragments", 4, declarationStatement.fragments().size());
6813
		assertEquals("Wrong number of fragments", 4, declarationStatement.fragments().size());
6814
	}
6814
	}
6815
	/**
6816
	 * http://dev.eclipse.org/bugs/show_bug.cgi?id=109646
6817
	 */
6818
	public void test0621() throws JavaModelException {
6819
		ICompilationUnit workingCopy = null;
6820
		try {
6821
			String contents =
6822
				"public class X {\n" + 
6823
				"	public void foo(int y) {\n" +
6824
				"		switch (y) {\n" +
6825
				"			case 1:\n" +
6826
				"				int i,j;\n" +
6827
				"		}\n" +
6828
				"	}\n" + 
6829
				"}";
6830
			workingCopy = getWorkingCopy("/Converter/src/X.java", false/*resolve*/);
6831
			ASTNode node = buildAST(
6832
				contents,
6833
				workingCopy,
6834
				false);
6835
			assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
6836
			CompilationUnit unit = (CompilationUnit) node;
6837
			assertProblemsSize(unit, 0);
6838
			node = getASTNode(unit, 0, 0, 0);
6839
			assertNotNull("No node", node);
6840
			assertEquals("Not a switch statement", ASTNode.SWITCH_STATEMENT, node.getNodeType());
6841
			SwitchStatement switchStatement = (SwitchStatement) node;
6842
			List statements = switchStatement.statements();
6843
			assertEquals("Wrong size", 2, statements.size());
6844
			Statement statement = (Statement) statements.get(1);
6845
			assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement.getNodeType());
6846
			VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement;
6847
			assertEquals("Wrong size", 2, variableDeclarationStatement.fragments().size());
6848
		} finally {
6849
			if (workingCopy != null)
6850
				workingCopy.discardWorkingCopy();
6851
		}
6852
	}
6815
}
6853
}

Return to bug 109963