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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java (+1 lines)
Lines 49-54 Link Here
49
	standardTests.add(UtilTest.class);
49
	standardTests.add(UtilTest.class);
50
	standardTests.add(XLargeTest.class);
50
	standardTests.add(XLargeTest.class);
51
	standardTests.add(InternalScannerTest.class);
51
	standardTests.add(InternalScannerTest.class);
52
	standardTests.add(ConditionalExpressionTest.class);
52
	// add all javadoc tests
53
	// add all javadoc tests
53
	for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i<l; i++) {
54
	for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i<l; i++) {
54
		standardTests.add(JavadocTest.ALL_CLASSES.get(i));
55
		standardTests.add(JavadocTest.ALL_CLASSES.get(i));
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java (+52 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.core.tests.compiler.regression;
12
13
import junit.framework.Test;
14
15
public class ConditionalExpressionTest extends AbstractRegressionTest {
16
17
	public ConditionalExpressionTest(String name) {
18
		super(name);
19
	}
20
21
	// Static initializer to specify tests subset using TESTS_* static variables
22
	// All specified tests which does not belong to the class are skipped...
23
//	static {
24
//		TESTS_NAMES = new String[] { "test000" };
25
//		TESTS_NUMBERS = new int[] { 65 };
26
//		TESTS_RANGE = new int[] { 11, -1 };
27
//	}
28
	public static Test suite() {
29
		return setupSuite(testClass());
30
	}
31
	
32
	public static Class testClass() {
33
		return ConditionalExpressionTest.class;
34
	}
35
36
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100162
37
	public void test001() {
38
		this.runConformTest(
39
			new String[] {
40
				"X.java",
41
				"public class X {\n" +
42
				"    final boolean isA = true;\n" +
43
				"    public static void main(String[] args) {\n" +
44
				"        X x = new X();\n" +
45
				"        System.out.print(x.isA ? \"SUCCESS\" : \"FAILURE\");\n" +
46
				"    }\n" +
47
				"}",
48
			},
49
			"SUCCESS"
50
		);
51
	}
52
}

Return to bug 100162