1 package org.jacorb.test.idl; 2 3 22 23 import junit.framework.*; 24 import org.jacorb.test.common.*; 25 26 32 33 public class FloatTest 34 extends TestCase 35 { 36 private static String outdir = TestUtils.testHome() + "/src/generated"; 37 private static String testdir = TestUtils.testHome() + "/idl/compiler/"; 38 39 public FloatTest (String 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 57 public void testFloatParseGood () 58 { 59 String file[] = new String [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 71 public void testFloatParseFail1() 72 { 73 String file[] = new String [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 85 public void testFloatParseFail2() 86 { 87 String file[] = new String [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 |