本文整理了Java中org.springframework.test.context.ActiveProfiles
类的一些代码示例,展示了ActiveProfiles
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActiveProfiles
类的具体详情如下:
包路径:org.springframework.test.context.ActiveProfiles
类名称:ActiveProfiles
暂无
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Sam Brannen
* @since 4.3
*/
@ActiveProfiles("dev")
interface ActiveProfilesTestInterface {
}
代码示例来源:origin: spring-projects/spring-framework
Class<? extends ActiveProfilesResolver> resolverClass = annotation.resolver();
if (ActiveProfilesResolver.class == resolverClass) {
resolverClass = DefaultActiveProfilesResolver.class;
descriptor = (annotation.inheritProfiles() ? MetaAnnotationUtils.findAnnotationDescriptor(
rootDeclaringClass.getSuperclass(), annotationType) : null);
代码示例来源:origin: spring-projects/spring-framework
for (String profile : annotation.profiles()) {
if (StringUtils.hasText(profile)) {
activeProfiles.add(profile.trim());
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Michail Nikolaev
* @since 4.0
*/
@ActiveProfiles(resolver = DevProfileResolverAnnotationConfigTests.class, inheritProfiles = false)
public class DevProfileResolverAnnotationConfigTests extends DevProfileAnnotationConfigTests implements
ActiveProfilesResolver {
@Override
public String[] resolve(Class<?> testClass) {
return new String[] { "dev" };
}
}
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Michail Nikolaev
* @since 4.0
*/
@ActiveProfiles(resolver = DevProfileResolverAnnotationConfigTests.class, inheritProfiles = false)
public class DevProfileResolverAnnotationConfigTests extends DevProfileAnnotationConfigTests implements
ActiveProfilesResolver {
@Override
public String[] resolve(Class<?> testClass) {
return new String[] { "dev" };
}
}
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Michail Nikolaev
* @since 4.0
*/
@ActiveProfiles(resolver = DevProfileResolverXmlConfigTests.class, inheritProfiles = false)
public class DevProfileResolverXmlConfigTests extends DevProfileXmlConfigTests implements ActiveProfilesResolver {
@Override
public String[] resolve(Class<?> testClass) {
return new String[] { "dev" };
}
}
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Sam Brannen
* @since 3.1
*/
@ActiveProfiles("dev")
public class DevProfileXmlConfigTests extends DefaultProfileXmlConfigTests {
@Test
@Override
public void employee() {
assertNotNull("employee bean should be loaded for the 'dev' profile", employee);
assertEquals("John Smith", employee.getName());
}
}
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Juergen Hoeller
* @since 3.1
*/
@ActiveProfiles("dev")
public class DevProfileAnnotationConfigTests extends DefaultProfileAnnotationConfigTests {
@Test
@Override
public void employee() {
assertNotNull("employee bean should be loaded for the 'dev' profile", employee);
assertEquals("John Smith", employee.getName());
}
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(resolver = BarActiveProfilesResolver.class, inheritProfiles = false)
private static class OverridenInheritedFooActiveProfilesResolverTestCase extends
InheritedFooActiveProfilesResolverTestCase {
}
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Sam Brannen
* @since 3.1
*/
@ActiveProfiles("dev")
public class DevProfileAnnotationConfigTests extends DefaultProfileAnnotationConfigTests {
@Test
@Override
public void employee() {
assertNotNull("employee bean should be loaded for the 'dev' profile", employee);
assertEquals("John Smith", employee.getName());
}
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(resolver = BarActiveProfilesResolver.class)
private static class MergedInheritedFooActiveProfilesResolverTestCase extends
InheritedFooActiveProfilesResolverTestCase {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(resolver = NullActiveProfilesResolver.class)
private static class NullActiveProfilesResolverTestCase {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(resolver = NoDefaultConstructorActiveProfilesResolver.class)
private static class NoDefaultConstructorActiveProfilesResolverTestCase {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(resolver = BarActiveProfilesResolver.class, profiles = "ignored by custom resolver")
private static class ResolverAndProfilesTestCase {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(profiles = "default", resolver = ExtendedDefaultActiveProfilesResolver.class)
private static class ExtendedDefaultActiveProfilesResolverTestCase {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(profiles = "conflict 1", value = "conflict 2")
private static class ConflictingProfilesAndValueTestCase {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles({ " ", "\t" })
private static class EmptyProfiles {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles({ "foo", "bar", " foo", "bar ", "baz" })
private static class DuplicatedProfiles {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(profiles = { "dog", "cat" }, inheritProfiles = false)
private static class Animals extends LocationsBar {
}
代码示例来源:origin: spring-projects/spring-framework
@ActiveProfiles(resolver = BarActiveProfilesResolver.class, value = "ignored by custom resolver")
private static class ResolverAndValueTestCase {
}
内容来源于网络,如有侵权,请联系作者删除!