KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > packtag > test > PackTestCase


1 /**
2  * Project pack:tag >> http://packtag.sf.net
3  *
4  * This software is published under the terms of the LGPL
5  * License version 2.1, a copy of which has been included with this
6  * distribution in the 'lgpl.txt' file.
7  *
8  * Creation date: 17.02.2007 - 23:49:17
9  * Last author: $Author: danielgalan $
10  * Last modified: $Date: 2007/04/22 19:04:23 $
11  * Revision: $Revision: 1.1 $
12  *
13  * $Log: PackTestCase.java,v $
14  * Revision 1.1 2007/04/22 19:04:23 danielgalan
15  * pack.tag moved from subversion to good old CVS
16  *
17  */

18 package net.sf.packtag.test;
19
20 import java.io.InputStream JavaDoc;
21
22 import net.sf.packtag.strategy.AbstractPackStrategy;
23 import net.sf.packtag.strategy.PackException;
24 import junit.framework.TestCase;
25
26
27
28 /**
29  * class desciption. Purpose, functionality, etc..
30  *
31  * @author Daniel Galán y Martins
32  * @version $Revision: 1.1 $
33  */

34 public class PackTestCase extends TestCase {
35
36     protected String JavaDoc resourceToString(InputStream JavaDoc resourceAsStream) throws PackException {
37         class MockStrategy extends AbstractPackStrategy {
38
39             public String JavaDoc pack(InputStream JavaDoc resourceAsStream) throws PackException {
40                 return null;
41             }
42
43             // Make it public
44
public String JavaDoc resourceToString(InputStream JavaDoc resourceAsStream) throws PackException {
45                 return super.resourceToString(resourceAsStream);
46             }
47         }
48         MockStrategy mock = new MockStrategy();
49         return mock.resourceToString(resourceAsStream);
50     }
51
52 }
53
Popular Tags