Package org.junit.experimental.categories

Examples of org.junit.experimental.categories.Category


        private Collection<Class<?>> findSuperclassCategories( Class<?> clazz )
        {
            if ( clazz != null && clazz.getSuperclass() != null )
            {
                Category cat = clazz.getSuperclass().getAnnotation( Category.class );
                if ( cat != null )
                {
                    return new HashSet<Class<?>>( Arrays.asList( cat.value() ) );
                }
                else
                {
                    return findSuperclassCategories( clazz.getSuperclass() );
                }
View Full Code Here


            {
                return true;
            }

            Set<Class<?>> cats = new HashSet<Class<?>>();
            Category cat = description.getAnnotation( Category.class );
            if ( cat != null )
            {
                cats.addAll( Arrays.asList( cat.value() ) );
            }

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

            if ( parentClass != null )
            {
View Full Code Here

  public ClassTestFinder(Class<?> category) {
    super(new TestFileNameFilter(), new TestClassFilter(category));
  }

  public static Class<?>[] getCategoryAnnotations(Class<?> c) {
    Category category = c.getAnnotation(Category.class);
    if (category != null) {
      return category.value();
    }
    return new Class<?>[0];
  }
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

  public ClassTestFinder(Class<?> category) {
    super(new TestFileNameFilter(), new TestFileNameFilter(), new TestClassFilter(category));
  }

  public static Class<?>[] getCategoryAnnotations(Class<?> c) {
    Category category = c.getAnnotation(Category.class);
    if (category != null) {
      return category.value();
    }
    return new Class<?>[0];
  }
View Full Code Here

            // TODO: how heavy are we cringing?
            return Description.createSuiteDescription(description.getTestClass());
        }

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

        private Collection<Class<?>> findSuperclassCategories( Class<?> clazz )
        {
            if ( clazz != null && clazz.getSuperclass() != null )
            {
                Category cat = clazz.getSuperclass().getAnnotation( Category.class );
                if ( cat != null )
                {
                    return new HashSet<Class<?>>( Arrays.asList( cat.value() ) );
                }
                else
                {
                    return findSuperclassCategories( clazz.getSuperclass() );
                }
View Full Code Here

            {
                return true;
            }

            Set<Class<?>> cats = new HashSet<Class<?>>();
            Category cat = description.getAnnotation( Category.class );
            if ( cat != null )
            {
                cats.addAll( Arrays.asList( cat.value() ) );
            }

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

            if ( parentClass != null )
            {
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

  public ClassTestFinder(Class<?> category) {
    super(new TestFileNameFilter(), new TestFileNameFilter(), new TestClassFilter(category));
  }

  public static Class<?>[] getCategoryAnnotations(Class<?> c) {
    Category category = c.getAnnotation(Category.class);
    if (category != null) {
      return category.value();
    }
    return new Class<?>[0];
  }
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.