KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > aop > framework > autoproxy > metadata > CommonsAttributesMetadataAutoProxyTests


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

16
17 package org.springframework.aop.framework.autoproxy.metadata;
18
19 import java.io.IOException JavaDoc;
20
21 import org.springframework.beans.factory.BeanFactory;
22 import org.springframework.context.support.ClassPathXmlApplicationContext;
23 import org.springframework.metadata.commons.CommonsAttributeCompilerUtils;
24
25 /**
26  * Metadata auto proxy creator test that sources attributes
27  * using Jakarta Commons Attributes.
28  *
29  * <p><b>Requires source-level metadata compilation.</b>
30  * See the commonsBuild.xml Ant build script.
31  *
32  * @author Rod Johnson
33  * @since 13.03.2003
34  */

35 public class CommonsAttributesMetadataAutoProxyTests extends AbstractMetadataAutoProxyTests {
36     
37     static {
38         // If we're within an IDE, compile the attributes programmatically.
39
CommonsAttributeCompilerUtils.compileAttributesIfNecessary("**/autoproxy/metadata/*.java");
40     }
41
42     protected BeanFactory getBeanFactory() throws IOException JavaDoc {
43         // Load from class path, NOT a file path.
44
return new ClassPathXmlApplicationContext(
45                 new String JavaDoc[] {
46                     "/org/springframework/aop/framework/autoproxy/metadata/commonsAttributes.xml",
47                     "/org/springframework/aop/framework/autoproxy/metadata/enterpriseServices.xml"});
48     }
49     
50 }
51
Popular Tags