KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jester > tests > ConfigurationTest


1 package jester.tests;
2
3 import java.io.*;
4
5 import jester.Configuration;
6 import jester.RealConfiguration;
7 import junit.framework.*;
8
9 public class ConfigurationTest extends TestCase {
10     private static PrintStream NullErrorStream = new PrintStream(new ByteArrayOutputStream());
11     
12     public ConfigurationTest(String JavaDoc name) {
13         super(name);
14     }
15     public static void main(String JavaDoc args[]) {
16         junit.awtui.TestRunner.main(new String JavaDoc[] { "jester.tests.ConfigurationTest" });
17     }
18     public static Test suite() {
19         TestSuite suite = new TestSuite(ConfigurationTest.class);
20         return suite;
21     }
22
23     public void testDefaults() throws IOException {
24         Configuration config = new RealConfiguration("there must be no file called this", NullErrorStream); //there is no file called "there must be no file called this"
25

26         assertEquals("javac", config.compilationCommand());
27         assertTrue(!config.shouldReportEagerly());
28         assertEquals(".java", config.sourceFileExtension());
29         assertEquals("java jester.TestRunnerImpl", config.testRunningCommand());
30         assertEquals("PASSED", config.testsPassString());
31         
32         assertTrue(config.closeUIOnFinish());
33     }
34 }
Popular Tags