KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > idl > FloatTest


1 package org.jacorb.test.idl;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2001 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 import junit.framework.*;
24 import org.jacorb.test.common.*;
25
26 /**
27  * FloatTest.java
28  *
29  * IDL parse tests.
30  *
31  */

32
33 public class FloatTest
34     extends TestCase
35 {
36     private static String JavaDoc outdir = TestUtils.testHome() + "/src/generated";
37     private static String JavaDoc testdir = TestUtils.testHome() + "/idl/compiler/";
38
39     public FloatTest (String JavaDoc name)
40     {
41         super( name );
42     }
43
44
45    public static Test suite ()
46    {
47       TestSuite suite = new TestSuite("Float Tests");
48       suite.addTest( new FloatTest("testFloatParseGood"));
49       suite.addTest( new FloatTest("testFloatParseFail1"));
50       suite.addTest( new FloatTest("testFloatParseFail2"));
51       return suite;
52    }
53
54
55    /**
56     */

57    public void testFloatParseGood ()
58    {
59       String JavaDoc file[] = new String JavaDoc[3];
60       file[0] = "-d";
61       file[1] = outdir;
62       file[2] = testdir.concat( "succeed/Floats.idl");
63
64       assertTrue( "Compiled succeed/Floats.idl",
65                   org.jacorb.idl.parser.compileAndHandle( file ) );
66    }
67
68
69    /**
70     */

71    public void testFloatParseFail1()
72    {
73       String JavaDoc file[] = new String JavaDoc[3];
74       file[0] = "-d";
75       file[1] = outdir;
76       file[2] = testdir.concat("fail/Floats.idl");
77
78       assertFalse( "Compiled fail/Floats.idl",
79                    org.jacorb.idl.parser.compileAndHandle(file) );
80    }
81
82
83    /**
84     */

85    public void testFloatParseFail2()
86    {
87       String JavaDoc file[] = new String JavaDoc[3];
88       file[0] = "-d";
89       file[1] = outdir;
90       file[2] = testdir.concat ("fail/Floats.idl");
91
92       assertFalse( "Compiled fail/Floats.idl",
93                    org.jacorb.idl.parser.compileAndHandle(file) );
94    }
95 }
96
Popular Tags