cziegeler 2003/10/15 13:54:43
Modified: src/test/org/apache/cocoon/components/resolver/test
ResolverImplTestCase.java
src/test/org/apache/cocoon/environment/mock
MockEnvironment.java MockRequest.java
src/test/org/apache/cocoon/components/source
SourceResolverAdapter.java
src/test/org/apache/cocoon AbstractCompositeTestCase.java
src/test/org/apache/cocoon/acting
RequestParamActionTestCase.java
src/test/org/apache/cocoon/transformation
AbstractTransformerTestCase.java
src/test/org/apache/cocoon/xml/dom
DOMBuilderStreamerTestCase.java
Log:
Tests compile again
Revision Changes Path
1.9 +3 -3
cocoon-2.2/src/test/org/apache/cocoon/components/resolver/test/ResolverImplTestCase.java
Index: ResolverImplTestCase.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/components/resolver/test/ResolverImplTestCase.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ResolverImplTestCase.java 9 Oct 2003 12:01:08 -0000 1.8
+++ ResolverImplTestCase.java 15 Oct 2003 20:54:43 -0000 1.9
@@ -230,7 +230,7 @@
"<!ENTITY nbsp \" \" ><!--=no break (required) space-->\n" +
"<!ENTITY shy \"­\" ><!--=soft hyphen-->\n" +
"";
- private DefaultContext context;
+ //private DefaultContext context;
private EntityResolver resolverImpl;
private File workDir;
private File commandlineContextDir;
@@ -434,7 +434,7 @@
* @since
*/
protected void addContext(DefaultContext context) {
- this.context = context;
+ //this.context = context;
context.put(Constants.CONTEXT_WORK_DIR, workDir);
1.6 +1 -42
cocoon-2.2/src/test/org/apache/cocoon/environment/mock/MockEnvironment.java
Index: MockEnvironment.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/environment/mock/MockEnvironment.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MockEnvironment.java 10 Jul 2003 00:36:48 -0000 1.5
+++ MockEnvironment.java 15 Oct 2003 20:54:43 -0000 1.6
@@ -53,7 +53,6 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.net.MalformedURLException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
@@ -63,15 +62,11 @@
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.environment.Environment;
-import org.apache.cocoon.environment.Source;
-import org.apache.excalibur.source.SourceResolver;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
public class MockEnvironment implements Environment {
- private SourceResolver resolver;
-
private String uri;
private String uriprefix;
private String rootcontext;
@@ -85,8 +80,7 @@
private HashMap objectmodel;
private Hashtable attributes = new Hashtable();
- public MockEnvironment(SourceResolver resolver) {
- this.resolver = resolver;
+ public MockEnvironment() {
}
public String getURI() {
@@ -208,12 +202,6 @@
}
- public Source resolve(String systemID)
- throws ProcessingException, SAXException, IOException {
-
- throw new AssertionFailedError("Not not use deprecated methods!");
- }
-
public void toSAX(org.apache.excalibur.source.Source source,
ContentHandler handler)
throws SAXException, IOException, ProcessingException {
@@ -221,35 +209,6 @@
throw new AssertionFailedError("Not not use deprecated methods!");
}
- public void toSAX(org.apache.excalibur.source.Source source,
- String mimeTypeHint,
- ContentHandler handler)
- throws SAXException, IOException, ProcessingException {
-
- throw new AssertionFailedError("Not not use deprecated methods!");
- }
-
- public org.apache.excalibur.source.Source resolveURI(String location)
- throws MalformedURLException, IOException,
org.apache.excalibur.source.SourceException {
-
- return resolver.resolveURI(location);
- }
-
- public org.apache.excalibur.source.Source resolveURI(String location,
- String base,
- Map parameters)
- throws MalformedURLException, IOException,
org.apache.excalibur.source.SourceException {
-
- return resolver.resolveURI(location, base, parameters);
- }
-
- /**
- * Releases a resolved resource
- */
- public void release(org.apache.excalibur.source.Source source) {
- resolver.release(source);
- }
-
/**
* Always return <code>true</code>.
*/
1.8 +0 -2
cocoon-2.2/src/test/org/apache/cocoon/environment/mock/MockRequest.java
Index: MockRequest.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/environment/mock/MockRequest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MockRequest.java 18 Jul 2003 20:58:06 -0000 1.7
+++ MockRequest.java 15 Oct 2003 20:54:43 -0000 1.8
@@ -73,7 +73,6 @@
private String scheme;
private String protocol = "HTTP/1.1";
private String requestURI;
- private String requestURL;
private String contextPath = "";
private String servletPath;
private String pathInfo;
@@ -345,7 +344,6 @@
scheme = null;
protocol = "HTTP/1.1";
requestURI = null;
- requestURL = null;
contextPath = null;
servletPath = null;
pathInfo = null;
1.9 +10 -24
cocoon-2.2/src/test/org/apache/cocoon/components/source/SourceResolverAdapter.java
Index: SourceResolverAdapter.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/components/source/SourceResolverAdapter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SourceResolverAdapter.java 26 Jul 2003 14:48:39 -0000 1.8
+++ SourceResolverAdapter.java 15 Oct 2003 20:54:43 -0000 1.9
@@ -56,10 +56,9 @@
import java.util.Map;
import org.apache.avalon.framework.component.ComponentManager;
-import org.apache.cocoon.ProcessingException;
-import org.apache.cocoon.environment.Source;
import org.apache.cocoon.environment.SourceResolver;
-import org.xml.sax.SAXException;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceException;
/**
* An adapter for the Excalibur SourceResolver.
@@ -69,11 +68,9 @@
public class SourceResolverAdapter implements SourceResolver
{
private org.apache.excalibur.source.SourceResolver resolver;
- private ComponentManager manager;
public SourceResolverAdapter(org.apache.excalibur.source.SourceResolver
resolver, ComponentManager manager) {
this.resolver = resolver;
- this.manager = manager;
}
/**
@@ -81,8 +78,8 @@
* This is a shortcut for <code>resolve(location, null, null)</code>
* @throws org.apache.excalibur.source.SourceException if the source
cannot be resolved
*/
- public org.apache.excalibur.source.Source resolveURI( String location )
- throws MalformedURLException, IOException,
org.apache.excalibur.source.SourceException {
+ public Source resolveURI( String location )
+ throws MalformedURLException, IOException, SourceException {
return this.resolver.resolveURI(location);
}
@@ -99,10 +96,10 @@
* are specific to the used protocol.
* @throws org.apache.excalibur.source.SourceException if the source
cannot be resolved
*/
- public org.apache.excalibur.source.Source resolveURI( String location,
- String base,
- Map parameters )
- throws MalformedURLException, IOException,
org.apache.excalibur.source.SourceException {
+ public Source resolveURI( String location,
+ String base,
+ Map parameters )
+ throws MalformedURLException, IOException, SourceException {
return this.resolver.resolveURI(location, base, parameters);
}
@@ -110,19 +107,8 @@
/**
* Releases a resolved resource
*/
- public void release( org.apache.excalibur.source.Source source ) {
+ public void release( Source source ) {
this.resolver.release(source);
}
- /**
- * Resolve the source.
- * @param systemID This is either a system identifier
- * (<code>java.net.URL</code> or a local file.
- * @deprecated Use the resolveURI methods instead
- */
- public Source resolve(String systemID)
- throws ProcessingException, SAXException, IOException {
-
- throw new RuntimeException("Method SourceResolver.resolve(String) is
deprecated");
- }
}
1.8 +2 -2
cocoon-2.2/src/test/org/apache/cocoon/AbstractCompositeTestCase.java
Index: AbstractCompositeTestCase.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/AbstractCompositeTestCase.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AbstractCompositeTestCase.java 2 Sep 2003 08:51:23 -0000 1.7
+++ AbstractCompositeTestCase.java 15 Oct 2003 20:54:43 -0000 1.8
@@ -409,7 +409,7 @@
}
public final void print(Document document) {
- TransformerFactory factory = (TransformerFactory)
TransformerFactory.newInstance();
+ TransformerFactory factory = TransformerFactory.newInstance();
try
{
javax.xml.transform.Transformer serializer =
factory.newTransformer();
1.2 +6 -6
cocoon-2.2/src/test/org/apache/cocoon/acting/RequestParamActionTestCase.java
Index: RequestParamActionTestCase.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/acting/RequestParamActionTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RequestParamActionTestCase.java 19 Apr 2003 16:11:17 -0000 1.1
+++ RequestParamActionTestCase.java 15 Oct 2003 20:54:43 -0000 1.2
@@ -80,10 +80,10 @@
Map result = act("request", null, parameters);
assertNotNull("Test if resource exists", result);
- assertEquals("Test for parameter", "test.xml?abc=def&ghi=jkl",
(String)result.get("requestURI"));
- assertEquals("Test for parameter", "?abc=def&ghi=jkl",
(String)result.get("requestQuery"));
- assertEquals("Test for parameter", "servlet",
(String)result.get("context"));
- assertEquals("Test for parameter", "def", (String)result.get("abc"));
- assertNull("Test for parameter", (String)result.get("ghi"));
+ assertEquals("Test for parameter", "test.xml?abc=def&ghi=jkl",
result.get("requestURI"));
+ assertEquals("Test for parameter", "?abc=def&ghi=jkl",
result.get("requestQuery"));
+ assertEquals("Test for parameter", "servlet", result.get("context"));
+ assertEquals("Test for parameter", "def", result.get("abc"));
+ assertNull("Test for parameter", result.get("ghi"));
}
}
1.8 +2 -2
cocoon-2.2/src/test/org/apache/cocoon/transformation/AbstractTransformerTestCase.java
Index: AbstractTransformerTestCase.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/transformation/AbstractTransformerTestCase.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AbstractTransformerTestCase.java 10 Jul 2003 00:25:25 -0000 1.7
+++ AbstractTransformerTestCase.java 15 Oct 2003 20:54:43 -0000 1.8
@@ -182,7 +182,7 @@
}
public final void print(Document document) {
- TransformerFactory factory = (TransformerFactory)
TransformerFactory.newInstance();
+ TransformerFactory factory = TransformerFactory.newInstance();
try
{
javax.xml.transform.Transformer serializer =
factory.newTransformer();
1.6 +2 -2
cocoon-2.2/src/test/org/apache/cocoon/xml/dom/DOMBuilderStreamerTestCase.java
Index: DOMBuilderStreamerTestCase.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/test/org/apache/cocoon/xml/dom/DOMBuilderStreamerTestCase.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DOMBuilderStreamerTestCase.java 10 Jul 2003 00:25:26 -0000 1.5
+++ DOMBuilderStreamerTestCase.java 15 Oct 2003 20:54:43 -0000 1.6
@@ -205,7 +205,7 @@
}
public final void print(Document document) {
- TransformerFactory factory = (TransformerFactory)
TransformerFactory.newInstance();
+ TransformerFactory factory = TransformerFactory.newInstance();
try
{
javax.xml.transform.Transformer serializer =
factory.newTransformer();