01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.rewriter.test;
06:
07: import com.sun.portal.rewriter.AbsoluteJSFunctionSpec;
08: import com.sun.portal.rewriter.test.util.BasicTestCase;
09: import com.sun.portal.rewriter.util.uri.PageSpec;
10:
11: public class TestDefaultJSFunctionSpec extends BasicTestCase {
12: private PageSpec samplePageSpec;
13:
14: public TestDefaultJSFunctionSpec(String aName) {
15: super (aName);
16: }//constuctor
17:
18: public void setUp() throws Exception {
19: samplePageSpec = new PageSpec(
20: "http://rajanagendra.sun.com/Base/Raja/raja.html?name=raja",
21: "");
22: }//setUp()
23:
24: public void testReplacingOfFuncNameExpression() {
25: String func = AbsoluteJSFunctionSpec.getDefault()
26: .getExpressionFunctionDefination(samplePageSpec);
27: if (func
28: .indexOf(AbsoluteJSFunctionSpec.INSERT_EXPRESSION_FUNCTION_NAME_PATTERN) != -1) {
29: fail("Result was: " + func);
30: }
31:
32: assertTrue(true);
33: }//testReplacingOfFuncNameExpression()
34:
35: public void testReplacingOfFuncNameSystem() {
36: String func = AbsoluteJSFunctionSpec.getDefault()
37: .getSystemFunctionDefination(samplePageSpec);
38:
39: if (func
40: .indexOf(AbsoluteJSFunctionSpec.INSERT_SYSTEM_FUNCTION_NAME_PATTERN) != -1) {
41: fail("Result was: " + func);
42: }
43:
44: assertTrue(true);
45: }//testReplacingOfFuncNameSystem()
46:
47: public static void main(String[] args) {
48: BasicTestCase.run(TestDefaultJSFunctionSpec.class);
49: }//main()
50: }//class TestDefaultJSFunctionSpec
|