Package org.constretto.spring.annotation

Examples of org.constretto.spring.annotation.Environment


     *
     * @param description
     * @return an array with the specified values or null
     */
    public static String[] extractEnvironmentValue(final Description description) {
        final Environment environment = description.getTestClass().getAnnotation(Environment.class);
        return environment == null ? null : environment.value();
    }
View Full Code Here


        for (String beanName : beanNames) {
            BeanDefinition beanDefinition = configurableListableBeanFactory.getBeanDefinition(beanName);
            if (beanDefinition.getBeanClassName() != null) {
                try {
                    Class beanClass = Class.forName(beanDefinition.getBeanClassName());
                    Environment environmentAnnotation = findEnvironmentAnnotation(beanClass);
                    if (environmentAnnotation != null) {
                        if (!assemblyContextResolver.getAssemblyContext().isEmpty()) {
                            boolean autowireCandidate = decideIfAutowireCandiate(beanName, environmentAnnotation);
                            beanDefinition.setAutowireCandidate(autowireCandidate);
                            if (autowireCandidate) {
View Full Code Here

            if (annotation instanceof Environment) {
                return (Environment) annotation;
            } else {
                if (!visited.contains(annotation)) {
                    visited.add(annotation);
                    Environment environment = findEnvironmentMetaAnnotation(visited, annotation.annotationType().getAnnotations());
                    if (environment != null) {
                        return environment;
                    }
                }
            }
View Full Code Here

        List<BeanDefinition> potentialMatches = new ArrayList<BeanDefinition>();
        for (String beanName : beanNames) {
            BeanDefinition beanDefinition = configurableListableBeanFactory.getBeanDefinition(beanName);
            Class beanClass = Class.forName(beanDefinition.getBeanClassName());
            beanDefinition.setAttribute(INCLUDE_IN_COLLECTIONS, new Class[]{beanClass});
            Environment environmentAnnotation = findEnvironmentAnnotation(beanClass);
            if (environmentAnnotation == null) {
                beanDefinition.setAutowireCandidate(false);
            } else {
                potentialMatches.add(beanDefinition);
            }
View Full Code Here

        return result;
    }

    @SuppressWarnings("unchecked")
    private int getAutowirePriority(Class beanClass) {
        Environment environmentAnnotation = findEnvironmentAnnotation(beanClass);
        if (environmentAnnotation != null) {
            List<String> environments = asList(environmentAnnotation.value());
            List<String> assemblyContext = assemblyContextResolver.getAssemblyContext();
            for (int i = 0; i < assemblyContext.size(); i++) {
                if (environments.contains(assemblyContext.get(i))) {
                    return i;
                }
View Full Code Here

        }
        return System.getProperty(DefaultConfigurationContextResolver.TAGS);
    }

    private String changeAssembleSystemProperty() {
        Environment environment = getTestClass().getJavaClass().getAnnotation(Environment.class);
        if (environment != null) {
            return System.setProperty(DefaultAssemblyContextResolver.ASSEMBLY_KEY, ConstrettoUtils.asCsv(environment.value()));
        }
        return System.getProperty(DefaultAssemblyContextResolver.ASSEMBLY_KEY);
    }
View Full Code Here

TOP

Related Classes of org.constretto.spring.annotation.Environment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.