View Javadoc
1   /*
2    * Copyright 2010 James Pether Sörling
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   *	$Id$
17   *  $HeadURL$
18  */
19  package com.hack23.cia.testfoundation;
20  
21  import org.junit.Test;
22  
23  /**
24   * The Class TestInstanceTest.
25   */
26  public final class TestInstanceTest extends AbstractUnitTest {
27  
28  	/** The order. */
29  	int order;
30  
31  	/**
32  	 * Test instance example test.
33  	 */
34  	@Test
35  	public void testInstanceExampleTest() {
36  		new AbstractTestInstance() {
37  
38  			@Override
39  			protected void setupExpectations() {
40  				order++;
41  				assertEquals(1,order);
42  			}
43  
44  			@Override
45  			protected void run() {
46  				order++;
47  				assertEquals(2,order);
48  			}
49  
50  			@Override
51  			protected void assertPostcondition() {
52  				order++;
53  				assertEquals(3,order);
54  			}
55  		}.executeTestPhases();
56  		assertEquals(3,order);
57  	}
58  
59  
60  }