KickJava   Java API By Example, From Geeks To Geeks.

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


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.fortress.impl.role.Role2MetaInfoManager;
22 import org.apache.avalon.framework.logger.ConsoleLogger;
23
24 /**
25  * Role2MetaInfoManagerTestCase does XYZ
26  *
27  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
28  * @version CVS Revision: 1.1 $
29  */

30 public class Role2MetaInfoManagerTestCase extends AbstractMetaInfoManagerTestCase
31 {
32     public Role2MetaInfoManagerTestCase( String JavaDoc name )
33     {
34         super( name );
35     }
36
37     public void setUp() throws Exception JavaDoc
38     {
39         FortressRoleManager roles = new FortressRoleManager( null, this.getClass().getClassLoader() );
40         roles.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_INFO ) );
41         roles.initialize();
42         m_manager = new Role2MetaInfoManager( roles );
43     }
44
45     /**
46      * Temporarily skip this step--we will be removing FortressRoleManager soon.
47      *
48      * @throws Exception
49      */

50     public void testRole2MetaInfoManager() throws Exception JavaDoc
51     {
52         /**
53         String[] roles = new String[]{"org.apache.avalon.excalibur.datasource.DataSourceComponent"};
54
55         checkRole( "jdbc-datasource", roles,
56             "org.apache.avalon.excalibur.datasource.JdbcDataSource",
57             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
58         checkRole( "j2ee-datasource", roles,
59             "org.apache.avalon.excalibur.datasource.J2eeDataSource",
60             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
61         if ( isInformixClassExists() )
62         {
63             checkRole( "informix-datasource", roles,
64                 "org.apache.avalon.excalibur.datasource.InformixDataSource",
65                 "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
66         }
67
68         roles[0] = "org.apache.avalon.excalibur.monitor.Monitor";
69
70         checkRole( "monitor", roles,
71             "org.apache.avalon.excalibur.monitor.ActiveMonitor",
72             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
73         checkRole( "passive-monitor", roles,
74             "org.apache.avalon.excalibur.monitor.PassiveMonitor",
75             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
76
77         roles[0] = "org.apache.excalibur.xml.xpath.XPathProcessor";
78
79         checkRole( "xalan-xpath", roles,
80             "org.apache.excalibur.xml.xpath.XPathProcessorImpl",
81             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
82         checkRole( "jaxpath", roles,
83             "org.apache.excalibur.xml.xpath.JaxenProcessorImpl",
84             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
85
86         roles[0] = "org.apache.excalibur.source.SourceResolver";
87
88         checkRole( "resolver", roles,
89             "org.apache.excalibur.source.impl.SourceResolverImpl",
90             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
91
92         roles[0] = "org.apache.excalibur.xml.dom.DOMParser";
93
94         checkRole( "parser", roles,
95             "org.apache.excalibur.xml.impl.JaxpParser",
96             "org.apache.avalon.fortress.impl.handler.PerThreadComponentHandler" );
97         checkRole( "xerces-parser", roles,
98             "org.apache.excalibur.xml.impl.XercesParser",
99             "org.apache.avalon.fortress.impl.handler.FactoryComponentHandler" );
100          */

101     }
102 }
103
Popular Tags