Update of
/var/cvs/speeltuin/ernst/tagfileparser/test/nl/vpro/tagfileparser/parser
In directory
james.mmbase.org:/tmp/cvs-serv1313/test/nl/vpro/tagfileparser/parser
Modified Files:
TestBase.java DirectiveParserTest.java
Log Message:
work in progress
See also:
http://cvs.mmbase.org/viewcvs/speeltuin/ernst/tagfileparser/test/nl/vpro/tagfileparser/parser
Index: TestBase.java
===================================================================
RCS file:
/var/cvs/speeltuin/ernst/tagfileparser/test/nl/vpro/tagfileparser/parser/TestBase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- TestBase.java 9 Jul 2008 10:07:45 -0000 1.2
+++ TestBase.java 15 Jul 2008 06:54:23 -0000 1.3
@@ -9,6 +9,8 @@
import java.util.Iterator;
import java.util.List;
+import java.io.*;
+
import junit.framework.TestCase;
/**
@@ -25,25 +27,27 @@
/**
* Reads a file as resource from the classpath, and creates a
BufferedReader for it.
- * @param name
+ * @param resourceName
* @return
*/
- protected BufferedReader loadFile(String name){
- InputStream is =
this.getClass().getClassLoader().getResourceAsStream(name);
+ protected BufferedReader loadFileAsReader(String resourceName){
+ InputStream is =
this.getClass().getClassLoader().getResourceAsStream(resourceName);
if(is == null){
- throw new RuntimeException("resource with name
'"+name+"' not found");
+ throw new RuntimeException("resource with name
'"+resourceName+"' not found");
}
BufferedReader r = new BufferedReader(new InputStreamReader(is,
Charset.forName("UTF-8")));
return r;
}
+
+
/**
* Reads the resource of given name, and creates a line iterator for it.
* @param filename
* @return
*/
protected Iterator<String> createFileIterator(String filename){
- BufferedReader br = loadFile(filename);
+ BufferedReader br = loadFileAsReader(filename);
List<String> result = new ArrayList<String>();
String l;
try {
Index: DirectiveParserTest.java
===================================================================
RCS file:
/var/cvs/speeltuin/ernst/tagfileparser/test/nl/vpro/tagfileparser/parser/DirectiveParserTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- DirectiveParserTest.java 23 Jun 2008 10:20:11 -0000 1.1
+++ DirectiveParserTest.java 15 Jul 2008 06:54:23 -0000 1.2
@@ -10,12 +10,6 @@
public class DirectiveParserTest extends TestCase {
- public void testCleanup(){
- String line ="<%@ test foo=\"bar\" %>";
- DirectiveParser tdp = createParser(null, null);
- assertEquals("test foo=\"bar\"", tdp.cleanup(line));
- }
-
public void testParser(){
String line ="<%@ test foo = \"bar\" name= \"disco\"
hi=\"ho \" empty=\"\" %>";
final List<Attribute> attributes = new ArrayList<Attribute>();
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs