KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > fortress > impl > role > test > FortressRoleManagerTestCase


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

17
18 package org.apache.avalon.fortress.impl.role.test;
19
20 import org.apache.avalon.fortress.impl.role.FortressRoleManager;
21 import org.apache.avalon.framework.logger.ConsoleLogger;
22
23 /**
24  * Configurable RoleManager implementation. It populates the RoleManager
25  * from a configuration hierarchy. This is based on the DefaultRoleManager
26  * in the org.apache.avalon.component package.
27  *
28  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
29  * @version CVS $Revision: 1.6 $ $Date: 2004/02/28 15:16:26 $
30  * @since 4.1
31  */

32 public class FortressRoleManagerTestCase
33     extends AbstractRoleManagerTestCase
34 {
35     public FortressRoleManagerTestCase( String JavaDoc name )
36     {
37         super( name );
38     }
39
40     /** Null test. */
41     public void testTest() {}
42
43     /**
44      * Test the shorthand return values.
45      * Comment this out until we get rid of FortressRoleManager
46      */

47     public void DONTtestShorthandReturnValues()
48         throws Exception JavaDoc
49     {
50         FortressRoleManager roles = new FortressRoleManager( null, this.getClass().getClassLoader() );
51         roles.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_INFO ) );
52         roles.initialize();
53
54         checkRole( roles,
55             "jdbc-datasource",
56             "org.apache.avalon.excalibur.datasource.DataSourceComponent",
57             "org.apache.avalon.excalibur.datasource.JdbcDataSource",
58             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
59         checkRole( roles,
60             "j2ee-datasource",
61             "org.apache.avalon.excalibur.datasource.DataSourceComponent",
62             "org.apache.avalon.excalibur.datasource.J2eeDataSource",
63             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
64         if ( isInformixClassExists() )
65         {
66             checkRole( roles,
67                 "informix-datasource",
68                 "org.apache.avalon.excalibur.datasource.DataSourceComponent",
69                 "org.apache.avalon.excalibur.datasource.InformixDataSource",
70                 "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
71         }
72         checkRole( roles,
73             "monitor",
74             "org.apache.avalon.excalibur.monitor.Monitor",
75             "org.apache.avalon.excalibur.monitor.ActiveMonitor",
76             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
77         checkRole( roles,
78             "passive-monitor",
79             "org.apache.avalon.excalibur.monitor.Monitor",
80             "org.apache.avalon.excalibur.monitor.PassiveMonitor",
81             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
82         checkRole( roles,
83             "xalan-xpath",
84             "org.apache.excalibur.xml.xpath.XPathProcessor",
85             "org.apache.excalibur.xml.xpath.XPathProcessorImpl",
86             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
87         checkRole( roles,
88             "jaxpath",
89             "org.apache.excalibur.xml.xpath.XPathProcessor",
90             "org.apache.excalibur.xml.xpath.JaxenProcessorImpl",
91             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
92         checkRole( roles,
93             "resolver",
94             "org.apache.excalibur.source.SourceResolver",
95             "org.apache.excalibur.source.impl.SourceResolverImpl",
96             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
97         checkRole( roles,
98             "parser",
99             "org.apache.excalibur.xml.dom.DOMParser",
100             "org.apache.excalibur.xml.impl.JaxpParser",
101             "org.apache.avalon.fortress.impl.handler.PerThreadComponentHandler" );
102         checkRole( roles,
103             "xerces-parser",
104             "org.apache.excalibur.xml.dom.DOMParser",
105             "org.apache.excalibur.xml.impl.XercesParser",
106             "org.apache.avalon.fortress.impl.handler.FactoryComponentHandler" );
107     }
108
109 }
110
111
Popular Tags