01: /**
02: * $Id: TestJSPRenderingContainerProvider.java,v 1.1 2004/04/14 19:24:00 gregz Exp $
03: * Copyright 2003 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.wireless.providers.containers.jsp.rendering;
14:
15: import junit.framework.TestCase;
16: import com.sun.portal.wireless.tests.Device;
17: import com.sun.portal.wireless.tests.ClientSession;
18: import com.sun.portal.wireless.tests.TestUtils;
19: import com.sun.portal.wireless.tests.Compare;
20: import com.sun.portal.wireless.tests.Configuration;
21: import com.sun.portal.wireless.tests.UPSDK41;
22:
23: import java.net.HttpURLConnection;
24:
25: public class TestJSPRenderingContainerProvider extends TestCase {
26:
27: private static final String BASEDIR = "src/com/sun/portal/wireless/providers/containers/jsp/rendering/";
28:
29: public void testMain() {
30:
31: try {
32: // get a sesison for a rendered device
33: Device device = new UPSDK41();
34: ClientSession session = new ClientSession(device);
35: session.login();
36: session.sendCredentials();
37: session.getDesktop();
38: HttpURLConnection connection = session.getConnection();
39:
40: session.doPost(Configuration.dtUrl, null);
41: assertEquals(200, connection.getResponseCode());
42:
43: // check the result against reference files
44: String result = TestUtils.getString(connection
45: .getInputStream());
46: String expected = BASEDIR
47: + "expected/TestJSPRenderingContainerProvider.testMain";
48: String unexpected = BASEDIR
49: + "unexpected/TestJSPRenderingContainerProvider.testMain";
50: Compare comp = new Compare(this );
51: comp.check(result, expected, unexpected);
52:
53: session.logout();
54:
55: } catch (Exception e) {
56: TestUtils.fail(this, e);
57: }
58:
59: }
60: }
|