KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > groboutils > mbtf > v1 > ant > TransitionTypeUTest


1 /*
2  * @(#)TransitionTypeUTest.java
3  *
4  * Copyright (C) 2002-2003 Matt Albrecht
5  * groboclown@users.sourceforge.net
6  * http://groboutils.sourceforge.net
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a
9  * copy of this software and associated documentation files (the "Software"),
10  * to deal in the Software without restriction, including without limitation
11  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12  * and/or sell copies of the Software, and to permit persons to whom the
13  * Software is furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included in
16  * all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24  * DEALINGS IN THE SOFTWARE.
25  */

26
27 package net.sourceforge.groboutils.mbtf.v1.ant;
28
29 import org.apache.tools.ant.Project;
30 import org.apache.tools.ant.Task;
31 import org.apache.tools.ant.TaskAdapter;
32 import org.apache.tools.ant.BuildException;
33 import org.apache.tools.ant.types.Reference;
34 import org.apache.tools.ant.types.DataType;
35 import org.apache.tools.ant.taskdefs.Definer;
36
37 import org.easymock.EasyMock;
38 import org.easymock.MockControl;
39 import junit.framework.Test;
40 import junit.framework.TestCase;
41 import junit.framework.TestSuite;
42
43 import net.sourceforge.groboutils.mbtf.v1.IValidate;
44 import net.sourceforge.groboutils.mbtf.v1.ISystem;
45 import net.sourceforge.groboutils.mbtf.v1.IErrors;
46 import net.sourceforge.groboutils.mbtf.v1.IAction;
47
48 /**
49  * Tests the TransitionType class.
50  *
51  * @author Matt Albrecht <a HREF="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
52  * @version $Date: 2003/02/10 22:52:27 $
53  * @since June 17, 2002
54  */

55 public class TransitionTypeUTest extends TestCase
56 {
57     //-------------------------------------------------------------------------
58
// Standard JUnit Class-specific declarations
59

60     private static final Class JavaDoc THIS_CLASS = TransitionTypeUTest.class;
61     
62     public TransitionTypeUTest( String JavaDoc name )
63     {
64         super( name );
65     }
66
67     
68     //-------------------------------------------------------------------------
69
// setup
70

71     /**
72      *
73      * @exception Exception thrown under any exceptional condition.
74      */

75     protected void setUp() throws Exception JavaDoc
76     {
77         super.setUp();
78         
79         // set ourself up
80
}
81
82
83     //-------------------------------------------------------------------------
84
// Tests
85

86     
87     public void testConstructor1()
88     {
89         createTransitionType();
90     }
91     
92     
93     public void testSetJavaActionRef1()
94     {
95         TransitionType tt = createTransitionType();
96         Reference r = new Reference( "javatype" );
97         TaskAdapter ta = new TaskAdapter();
98         ValidateJavaType vjt = new ValidateJavaType();
99         ta.setProxy( vjt );
100         this.project.addReference( "javatype", vjt );
101         
102         tt.setJavaActionRef( r );
103     }
104     
105     
106     //-------------------------------------------------------------------------
107
// Helpers
108

109     protected Project project;
110     protected TransitionType createTransitionType()
111     {
112         this.project = new Project();
113         TransitionType tt = new TransitionType();
114         tt.setProject( this.project );
115         return tt;
116     }
117     
118     //-------------------------------------------------------------------------
119
// Standard JUnit declarations
120

121     
122     public static Test suite()
123     {
124         TestSuite suite = new TestSuite( THIS_CLASS );
125         
126         // Test the implementation's interface conformity.
127
/*
128         suite.addTest( IxUTestI.suite(
129             new ImplementationCreator[] {
130                 new ImplementationCreator() {
131                     public Object createImplementedObject() {
132                         // XXXXXXXXXXXXXXXXXXXXXXXX
133                     }
134                 },
135             } ) );
136         */

137         return suite;
138     }
139     
140     public static void main( String JavaDoc[] args )
141     {
142         String JavaDoc[] name = { THIS_CLASS.getName() };
143         
144         // junit.textui.TestRunner.main( name );
145
// junit.swingui.TestRunner.main( name );
146

147         junit.textui.TestRunner.main( name );
148     }
149     
150     
151     /**
152      *
153      * @exception Exception thrown under any exceptional condition.
154      */

155     protected void tearDown() throws Exception JavaDoc
156     {
157         // tear ourself down
158

159         super.tearDown();
160     }
161 }
162
163
Popular Tags