KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > BatikSampleMimeTypesTestCase


1 /*
2  * Copyright 2005 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 package org.apache.cocoon;
17
18 /**
19  * Tests the basic functionality of the Batik samples by checking
20  * their content-type: if a sample gives an error instead of
21  * generating an image, its content-type will be text/html.
22  *
23  * @version $Id: $
24  */

25 public class BatikSampleMimeTypesTestCase
26     extends HtmlUnitTestCase
27 {
28     public void testHelloSVG()
29         throws Exception JavaDoc
30     {
31         loadResponse("/samples/hello-world/hello.svg");
32         assertEquals("Content type", "image/svg+xml", response.getContentType());
33     }
34
35     public void testHelloJPEG()
36         throws Exception JavaDoc
37     {
38         loadResponse("/samples/blocks/batik/hello.jpeg");
39         assertEquals("Content type", "image/jpeg", response.getContentType());
40     }
41
42     public void testHelloPNG()
43         throws Exception JavaDoc
44     {
45         loadResponse("/samples/blocks/batik/hello.png");
46         assertEquals("Content type", "image/png", response.getContentType());
47     }
48
49     public void testLogoSVG()
50         throws Exception JavaDoc
51     {
52         loadResponse("/samples/blocks/batik/batikLogo.svg");
53         assertEquals("Content type", "image/svg+xml", response.getContentType());
54     }
55
56     public void testLogoJPEG()
57         throws Exception JavaDoc
58     {
59         loadResponse("/samples/blocks/batik/batikLogo.jpeg");
60         assertEquals("Content type", "image/jpeg", response.getContentType());
61     }
62
63     public void testLogoPNG()
64         throws Exception JavaDoc
65     {
66         loadResponse("/samples/blocks/batik/batikLogo.png");
67         assertEquals("Content type", "image/png", response.getContentType());
68     }
69
70     public void testHenrySVG()
71         throws Exception JavaDoc
72     {
73         loadResponse("/samples/blocks/batik/henryV.svg");
74         assertEquals("Content type", "image/svg+xml", response.getContentType());
75     }
76
77     public void testHenryJPEG()
78         throws Exception JavaDoc
79     {
80         loadResponse("/samples/blocks/batik/henryV.jpeg");
81         assertEquals("Content type", "image/jpeg", response.getContentType());
82     }
83
84     public void testHenryPNG()
85         throws Exception JavaDoc
86     {
87         loadResponse("/samples/blocks/batik/henryV.png");
88         assertEquals("Content type", "image/png", response.getContentType());
89     }
90
91     public void testAnneSVG()
92         throws Exception JavaDoc
93     {
94         loadResponse("/samples/blocks/batik/anne.svg");
95         assertEquals("Content type", "image/svg+xml", response.getContentType());
96     }
97
98     public void testAnneJPEG()
99         throws Exception JavaDoc
100     {
101         loadResponse("/samples/blocks/batik/anne.jpeg");
102         assertEquals("Content type", "image/jpeg", response.getContentType());
103     }
104
105     public void testAnnePNG()
106         throws Exception JavaDoc
107     {
108         loadResponse("/samples/blocks/batik/anne.png");
109         assertEquals("Content type", "image/png", response.getContentType());
110     }
111 }
112
Popular Tags