KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > TestVersion


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
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
17 package org.apache.taglibs.standard;
18
19 import junit.framework.*;
20
21 public class TestVersion
22     extends TestCase {
23     private Version version = null;
24
25     public TestVersion(String JavaDoc name) {
26         super(name);
27     }
28
29     protected void setUp() throws Exception JavaDoc {
30         super.setUp();
31         version = new Version();
32     }
33
34     protected void tearDown() throws Exception JavaDoc {
35         version = null;
36         super.tearDown();
37     }
38
39     public void testVersion() {
40         version = new Version();
41     }
42
43     public void testGetDevelopmentVersionNum() {
44         int expectedReturn = 0;
45         int actualReturn = version.getDevelopmentVersionNum();
46         assertEquals("return value", expectedReturn, actualReturn);
47     }
48
49     public void testGetMaintenanceVersionNum() {
50         int expectedReturn = 2;
51         int actualReturn = version.getMaintenanceVersionNum();
52         assertEquals("return value", expectedReturn, actualReturn);
53     }
54
55     public void testGetMajorVersionNum() {
56         int expectedReturn = 1;
57         int actualReturn = version.getMajorVersionNum();
58         assertEquals("return value", expectedReturn, actualReturn);
59     }
60
61     public void testGetProduct() {
62         String JavaDoc expectedReturn = "standard-taglib";
63         String JavaDoc actualReturn = version.getProduct();
64         assertEquals("return value", expectedReturn, actualReturn);
65     }
66
67     public void testGetReleaseVersionNum() {
68         int expectedReturn = 1;
69         int actualReturn = version.getReleaseVersionNum();
70         assertEquals("return value", expectedReturn, actualReturn);
71     }
72
73     public void testGetVersion() {
74         String JavaDoc expectedReturn = "standard-taglib 1.1.2";
75         String JavaDoc actualReturn = version.getVersion();
76         assertEquals("return value", expectedReturn, actualReturn);
77     }
78
79     public void testMain() {
80         String JavaDoc[] argv = null;
81         version.main(argv);
82     }
83
84 }
85
Popular Tags