01: package org.apache.turbine.services.xmlrpc.util;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
20: */
21:
22: import junit.framework.Test;
23: import junit.framework.TestCase;
24: import junit.framework.TestSuite;
25:
26: /**
27: * Test class for FileHandler.
28: *
29: * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
30: * @version $Id: FileHandlerTest.java 534527 2007-05-02 16:10:59Z tv $
31: */
32: public class FileHandlerTest extends TestCase {
33: /**
34: * Creates a new instance.
35: */
36: public FileHandlerTest(String name) {
37: super (name);
38: }
39:
40: /**
41: * Creates a test suite for this class.
42: *
43: * @return A test suite for this class.
44: */
45: public static Test suite() {
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 {
55: FileTransfer.send("http://localhost:9000/RPC2",
56: "test.location", "test.txt", "test.location",
57: "test.send");
58: }
59:
60: /**
61: * Test to make sure that the FileHandler is working
62: * correctly for files moving from the server to
63: * the client.
64: */
65: public void testGet() throws Exception {
66: FileTransfer.get("http://localhost:9000/RPC2", "test.location",
67: "test.txt", "test.location", "test.get");
68: }
69:
70: /**
71: * Test to make sure that the FileHandler is working
72: * correctly to remove files from the server.
73: */
74: public void testRemove() throws Exception {
75: FileTransfer.remove("http://localhost:9000/RPC2",
76: "test.location", "test.txt");
77: }
78:
79: }
|