KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > j2biz > pencil > test > output > DotCallTestCase


1 /*
2  * Copyright 2004 Andreas Siebert (j2biz community)
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 com.j2biz.pencil.test.output;
18
19 import java.io.FileInputStream JavaDoc;
20 import java.io.FileOutputStream JavaDoc;
21 import java.io.PrintStream JavaDoc;
22 import java.util.Properties JavaDoc;
23
24 import junit.framework.TestCase;
25
26 import com.j2biz.pencil.test.stuff.DotCallTest;
27
28 /**
29  * @author Andreas Siebert
30  *
31  * (c) 2004 by Andreas Siebert / j2biz.com
32  */

33 public class DotCallTestCase extends TestCase {
34
35        public void testFields() throws Exception JavaDoc {
36            PrintStream JavaDoc oldOut = System.err;
37            FileOutputStream JavaDoc dropedOut = new FileOutputStream JavaDoc( "test_DotCallTestCase.out" );
38            PrintStream JavaDoc newOut = new PrintStream JavaDoc(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 JavaDoc props = new Properties JavaDoc();
48            props.load(new FileInputStream JavaDoc("test_DotCallTestCase.out"));
49            
50            // ----------- Test-Expressions ---------------------------
51
assertEquals(props.getProperty("static.callString"), "DotCallTestObj1::public.field1");
52        }
53 }
54
Popular Tags