KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > turbine > services > xmlrpc > util > FileHandlerTest


1 package org.apache.turbine.services.xmlrpc.util;
2
3 /*
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License")
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import junit.framework.Test;
20 import junit.framework.TestCase;
21 import junit.framework.TestSuite;
22
23 /**
24  * Test class for FileHandler.
25  *
26  * @author <a HREF="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
27  * @version $Id: FileHandlerTest.java,v 1.2.4.2 2004/05/20 03:30:06 seade Exp $
28  */

29 public class FileHandlerTest extends TestCase
30 {
31     /**
32      * Creates a new instance.
33      */

34     public FileHandlerTest(String JavaDoc name)
35     {
36         super(name);
37     }
38
39     /**
40      * Creates a test suite for this class.
41      *
42      * @return A test suite for this class.
43      */

44     public static Test suite()
45     {
46         return new TestSuite(FileHandlerTest.class);
47     }
48
49     /**
50      * Test to make sure that the FileHandler is working
51      * correctly for files moving from the client to
52      * the server.
53      */

54     public void testSend() throws Exception JavaDoc
55     {
56         FileTransfer.send("http://localhost:9000/RPC2",
57                           "test.location",
58                           "test.txt",
59                           "test.location",
60                           "test.send");
61     }
62
63     /**
64      * Test to make sure that the FileHandler is working
65      * correctly for files moving from the server to
66      * the client.
67      */

68     public void testGet() throws Exception JavaDoc
69     {
70         FileTransfer.get("http://localhost:9000/RPC2",
71                          "test.location",
72                          "test.txt",
73                          "test.location",
74                          "test.get");
75     }
76
77     /**
78      * Test to make sure that the FileHandler is working
79      * correctly to remove files from the server.
80      */

81     public void testRemove() throws Exception JavaDoc
82     {
83         FileTransfer.remove("http://localhost:9000/RPC2",
84                             "test.location",
85                             "test.txt");
86     }
87
88
89 }
90
Popular Tags