aboutsummaryrefslogtreecommitdiffstats
path: root/tests/multiIncremental/PR157054/base/dash/obtain/ObtainStaticTest.java
blob: d257c2f0810cf427c1202b8a692035855505368d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Copyright (C) 2005  John D. Heintz
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Library General Public License for more details.
*
* John D. Heintz can be reached at: jheintz@pobox.com 
*/
package dash.obtain;


public class ObtainStaticTest {
	
	@Obtain static String bar2;
	
	public void testRegularFieldNull() throws Exception {
		try {
			ObtainStaticTestClass.baz.length();
			fail("should have null pointered");
		} catch (NullPointerException ex) {
			;// noop
		}
	}

 public void fail(String s) {}

	/**
	 * 
	 * @throws Exception
	 */
	public void testNullPointerException() throws Exception {
		try {
			String bar = ObtainStaticTestClass.bar;
			//System.out.println("bar2:"+ObtainStaticTest.bar2);
			fail(bar);
		} catch (NullPointerException ex) {
			;// noop
		}
	}	
	
	/**
	 * 
	 * @throws Exception
	 */
	public void testBasicObtain() throws Exception {
		// set @Obtain-able value to "foo" String
		//provider.setObtainableValue(ObtainStaticTestClass.class, "foo", "foo");
		
		assertEquals("foo", ObtainStaticTestClass.foo);
	}

public void assertEquals(Object a,Object b) {}
}