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 |
} |