| 1 16 17 package com.j2biz.pencil.test.output; 18 19 import java.io.FileInputStream ; 20 import java.io.FileOutputStream ; 21 import java.io.PrintStream ; 22 import java.util.Properties ; 23 24 import junit.framework.TestCase; 25 26 import com.j2biz.pencil.test.stuff.DotCallTest; 27 28 33 public class DotCallTestCase extends TestCase { 34 35 public void testFields() throws Exception { 36 PrintStream oldOut = System.err; 37 FileOutputStream dropedOut = new FileOutputStream ( "test_DotCallTestCase.out" ); 38 PrintStream newOut = new PrintStream (dropedOut); 39 System.setErr( newOut ); 40 41 DotCallTest myVar = new DotCallTest(); 42 43 System.setErr(oldOut); 44 newOut.flush(); 45 newOut.close(); 46 47 Properties props = new Properties (); 48 props.load(new FileInputStream ("test_DotCallTestCase.out")); 49 50 assertEquals(props.getProperty("static.callString"), "DotCallTestObj1::public.field1"); 52 } 53 } 54 | Popular Tags |