Package org.powermock.core.classloader.annotations

Examples of org.powermock.core.classloader.annotations.PrepareOnlyThisForTest


    @Override
    protected String[] getClassesToModify(AnnotatedElement element) {
        Set<String> all = new LinkedHashSet<String>();
        addTestCase(all, element);
        PrepareForTest prepareForTestAnnotation = element.getAnnotation(PrepareForTest.class);
        PrepareOnlyThisForTest prepareOnlyThisForTestAnnotation = element.getAnnotation(PrepareOnlyThisForTest.class);
        final boolean prepareForTestAnnotationPresent = prepareForTestAnnotation != null;
        final boolean prepareOnlyThisForTestAnnotationPresent = prepareOnlyThisForTestAnnotation != null;

        if (!prepareForTestAnnotationPresent && !prepareOnlyThisForTestAnnotationPresent) {
            return null;
        }

        if (prepareForTestAnnotationPresent) {
            final Class<?>[] classesToMock = prepareForTestAnnotation.value();
            for (Class<?> classToMock : classesToMock) {
                if (!classToMock.equals(IndicateReloadClass.class)) {
                    addClassHierarchy(all, classToMock);
                }
            }

            addFullyQualifiedNames(all, prepareForTestAnnotation);
        }

        if (prepareOnlyThisForTestAnnotationPresent) {
            final Class<?>[] classesToMock = prepareOnlyThisForTestAnnotation.value();
            for (Class<?> classToMock : classesToMock) {
                if (!classToMock.equals(IndicateReloadClass.class)) {
                    all.add(classToMock.getName());
                }
            }
View Full Code Here

TOP

Related Classes of org.powermock.core.classloader.annotations.PrepareOnlyThisForTest

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.