• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SpringApplicationContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.unitils.spring.annotation.SpringApplicationContext的典型用法代码示例。如果您正苦于以下问题:Java SpringApplicationContext类的具体用法?Java SpringApplicationContext怎么用?Java SpringApplicationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SpringApplicationContext类属于org.unitils.spring.annotation包,在下文中一共展示了SpringApplicationContext类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkIfEverythingIsInPlace

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
/**
 * This method checks if the testclass contains a {@link SpringApplicationContext} and a {@link ConfigureProfile}.
 * 
 * @param testClass
 * @return boolean
 */
protected boolean checkIfEverythingIsInPlace(Class<?> testClass) {
    if (!testClass.isAnnotationPresent(ConfigureProfile.class)) {
        LOGGER.warn("The annotation 'ConfigureProfile' is not present.");
        return false;
    }
    ConfigureProfile configProfile = testClass.getAnnotation(ConfigureProfile.class);
    if (StringUtils.isEmpty(configProfile.value())) {
        throw new UnitilsException("The name of the profile should be filled in.");
    }

    //type of configuration is ApplicationContext
    if (configProfile.configuration().equals(TypeConfiguration.APPLICATIONCONTEXT)) {
        if (!testClass.isAnnotationPresent(SpringApplicationContext.class)) {
            throw new UnitilsException("The annotation 'SpringApplicationContext' is not present.");
        }
    } else {
        //type of the configuration is the annotation Configuration.
        if (StringUtils.isEmpty(configProfile.packageProfile())) {
            throw new UnitilsException("You should fill in the name of the package of the profile.");
        }
    }

    return true;
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:31,代码来源:ProfileModule.java


示例2: createMethod2

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
@SpringApplicationContext
protected ApplicationContext createMethod2(List<String> locations) {
    createMethod2Called = true;
    assertLenientEquals(asList("classpath:org/unitils/spring/services-config.xml"), locations);
    createMethod2Called = true;
    return new ClassPathXmlApplicationContext("classpath:org/unitils/spring/services-config.xml");
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:8,代码来源:SpringModuleApplicationContextInheritanceTest.java


示例3: setField

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
@SpringApplicationContext
public void setField(ApplicationContext setter) {
    this.setter = setter;
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:5,代码来源:SpringModuleInjectApplicationContextTest.java


示例4: setField

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
@SpringApplicationContext({"classpath:org/unitils/spring/services-config.xml", "classpath:org/unitils/spring/services-config.xml"})
public void setField(ApplicationContext field) {
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:4,代码来源:SpringModuleApplicationContextTest.java


示例5: createMethod

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
@SpringApplicationContext
protected ApplicationContext createMethod() {
    return new ClassPathXmlApplicationContext("classpath:org/unitils/spring/services-config.xml");
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:5,代码来源:SpringModuleApplicationContextTest.java


示例6: createMethod1

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
@SpringApplicationContext
protected ApplicationContext createMethod1(List<String> locations) {
    return null;
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:5,代码来源:SpringModuleApplicationContextTest.java


示例7: createMethod2

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
@SpringApplicationContext
protected ApplicationContext createMethod2(List<String> locations) {
    return null;
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:5,代码来源:SpringModuleApplicationContextTest.java


示例8: createMethod1

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
@SpringApplicationContext
protected ApplicationContext createMethod1(List<String> locations) {
    createMethod1Called = true;
    return new ClassPathXmlApplicationContext("classpath:org/unitils/spring/services-config.xml");
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:6,代码来源:SpringModuleApplicationContextInheritanceTest.java


示例9: ApplicationContextManager

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
/**
 * Creates a new instance, using the given {@link ApplicationContextFactory}. The given list of
 * <code>BeanPostProcessor</code>s will be registered on all <code>ApplicationContext</code>s that are
 * created.
 *
 * @param applicationContextFactory The factory for creating <code>ApplicationContext</code>s, not null.
 */
public ApplicationContextManager(ApplicationContextFactory applicationContextFactory) {
    super(ApplicationContext.class, SpringApplicationContext.class);
    this.applicationContextFactory = applicationContextFactory;
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:12,代码来源:ApplicationContextManager.java


示例10: getAnnotationValues

import org.unitils.spring.annotation.SpringApplicationContext; //导入依赖的package包/类
/**
 * Gets the locations that are specified for the given {@link SpringApplicationContext} annotation. An array with
 * 1 empty string should be considered to be empty and null should be returned.
 *
 * @param annotation The annotation, not null
 * @return The locations, null if no values were specified
 */
@Override
protected List<String> getAnnotationValues(SpringApplicationContext annotation) {
    String[] locations = annotation.value();
    return asList(locations);
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:13,代码来源:ApplicationContextManager.java



注:本文中的org.unitils.spring.annotation.SpringApplicationContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SpeedSearchComparator类代码示例发布时间:2022-05-22
下一篇:
Java R类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap