Package org.junit.experimental.categories

Examples of org.junit.experimental.categories.Category


        includeLongRunning = Boolean.parseBoolean(System.getProperty(INCLUDE_LONGRUNNING_PROPERTY, "" + includeLongRunning));
    }

    public static boolean isLongRunning(FrameworkMethod member){
        boolean isLongRunning = false;
        Category categoriesAnn = member.getAnnotation(Category.class);
        if(categoriesAnn != null){
            Class[] categories = categoriesAnn.value();
            for(Class category: categories){
                if(category.equals(LongRunning.class)){
                    isLongRunning = true;
                    break;
                }
View Full Code Here


    private static Class<?>[] directCategories(Description description) {
        if (description == null) {
            return new Class<?>[0];
        }

        Category annotation= description.getAnnotation(Category.class);
        return annotation == null ? new Class<?>[0] : annotation.value();
    }
View Full Code Here

            // System.out.println( "\n\nMatcher: " + matcher );
            // System.out.println( "Checking: " + description.getClassName()
            // + ( parent == null ? "" : "#" + description.getMethodName() ) );

            Set<Class<?>> cats = new HashSet<Class<?>>();
            Category cat = description.getAnnotation( Category.class );
            if ( cat != null )
            {
                // System.out.println( "Adding categories: " + Arrays.toString(
                // cat.value() ) );
                cats.addAll( Arrays.asList( cat.value() ) );
            }

            if ( parent != null )
            {
                cat = parent.getAnnotation( Category.class );
                if ( cat != null )
                {
                    // System.out.println( "Adding class-level categories: " +
                    // Arrays.toString( cat.value() ) );
                    cats.addAll( Arrays.asList( cat.value() ) );
                }
            }

            // System.out.println( "Checking " + cats.size() + " categories..."
            // );
View Full Code Here

            }
        }
    }

    protected boolean isIgnore(Class<?> clazz) {
        Category cat = clazz.getAnnotation(Category.class);
        if (cat != null) {
            Set<Class<?>> classes = new HashSet<Class<?>>(Arrays.asList(cat.value()));
            return classes.contains(IgnoreMultisuite.class);
        }
        return false;
    }
View Full Code Here

        return shouldRun(description, description.isSuite() ? null : Description.createSuiteDescription(description.getTestClass()));
    }

    private boolean shouldRun(final Description description, final Description parent) {
        final Set<Class<?>> categories = new HashSet<Class<?>>();
        Category annotation = description.getAnnotation(Category.class);
        if (annotation != null) {
            categories.addAll(Arrays.asList(annotation.value()));
        }

        if (parent != null) {
            annotation = parent.getAnnotation(Category.class);
            if (annotation != null) {
                categories.addAll(Arrays.asList(annotation.value()));
            }
        }

        boolean result = inclusions.isEmpty();
View Full Code Here

TOP

Related Classes of org.junit.experimental.categories.Category

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.