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.rproxy.rewriter.test;
06:
07: import com.sun.portal.rewriter.rom.RuleSetManager;
08: import com.sun.portal.log.common.PortalLogger;
09: import com.sun.portal.rewriter.test.util.BasicTestCase;
10: import com.sun.portal.rewriter.util.Resource;
11: import com.sun.portal.rproxy.rewriter.SRAPRewriterModule;
12: import junit.framework.TestCase;
13: import junit.framework.TestSuite;
14:
15: public class TestSRAPRewriterResourcesExistance extends TestCase {
16: public TestSRAPRewriterResourcesExistance(String aName) {
17: super (aName);
18: }//constuctor
19:
20: public void testJSResourcesExistance() {
21: String resource = Resource
22: .read(SRAPRewriterModule.RESOURCE_CONVERT_EXPRESSTION_FUNCTION_LOCATION);
23: validate(
24: resource,
25: SRAPRewriterModule.RESOURCE_CONVERT_EXPRESSTION_FUNCTION_LOCATION);
26:
27: resource = Resource
28: .read(SRAPRewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION);
29: validate(
30: resource,
31: SRAPRewriterModule.RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION);
32: }//testJSResourcesExistance()
33:
34: public void testRuleSetResources() throws Exception {
35: for (int i = 0; i < SRAPRewriterModule.SRAP_RULESET_SPEC.length; i++) {
36: String resource = Resource
37: .read(SRAPRewriterModule.SRAP_RULESET_SPEC[i][0]);
38: validate(resource,
39: SRAPRewriterModule.SRAP_RULESET_SPEC[i][0]);
40: assertEquals(RuleSetManager.create(resource).getID(),
41: SRAPRewriterModule.SRAP_RULESET_SPEC[i][1]);
42: }
43: }//testRuleSetResources()
44:
45: private void validate(String aResource, String aPath) {
46: assertTrue("Failed to locate the Resource: " + aPath,
47: (aResource.length() > 10));
48: }//validate()
49:
50: public static void main(String[] args) {
51: BasicTestCase.run(new TestSuite(
52: TestSRAPRewriterResourcesExistance.class));
53: }//main()
54: }//class TestSRAPRewriterResourcesExistance
|