KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > transcoder > image > URITest


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
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 org.apache.batik.transcoder.image;
18
19 import org.apache.batik.transcoder.TranscoderInput;
20
21 /**
22  * Test the ImageTranscoder input with a URI.
23  *
24  * @author <a HREF="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
25  * @version $Id: URITest.java,v 1.5 2005/04/01 02:28:16 deweese Exp $
26  */

27 public class URITest extends AbstractImageTranscoderTest {
28
29     /** The URI of the input image. */
30     protected String JavaDoc inputURI;
31
32     /** The URI of the reference image. */
33     protected String JavaDoc refImageURI;
34
35     /**
36      * Constructs a new <tt>URITest</tt>.
37      *
38      * @param inputURI the URI of the input image
39      * @param the URI of the reference image
40      */

41     public URITest(String JavaDoc inputURI, String JavaDoc refImageURI) {
42     this.inputURI = inputURI;
43     this.refImageURI = refImageURI;
44     }
45
46     /**
47      * Creates the <tt>TranscoderInput</tt>.
48      */

49     protected TranscoderInput createTranscoderInput() {
50     return new TranscoderInput(resolveURL(inputURI).toString());
51     }
52
53     /**
54      * Returns the reference image for this test.
55      */

56     protected byte [] getReferenceImageData() {
57     return createBufferedImageData(resolveURL(refImageURI));
58     }
59 }
60
Popular Tags