Package ch.powerunit.exception

Examples of ch.powerunit.exception.InternalError


import ch.powerunit.exception.InternalError;

public interface TestValidator {
    default void checkTestAnnotationForMethod(Method m) {
        if (Modifier.isStatic(m.getModifiers())) {
            throw new InternalError("@Test method is static " + m.toString());
        }
        if (!Modifier.isPublic(m.getModifiers())) {
            throw new InternalError("@Test method is not public "
                    + m.toString());
        }
        if (!Void.TYPE.equals(m.getReturnType())) {
            throw new InternalError("@Test method is not void " + m.toString());
        }
        if (m.getParameterCount() != 0) {
            throw new InternalError("@Test method is not 0-parameter "
                    + m.toString());
        }
    }
View Full Code Here


import ch.powerunit.exception.InternalError;

public interface ParameterValidator {
    default void checkParameterAnnotationForField(Field f) {
        if (Modifier.isStatic(f.getModifiers())) {
            throw new InternalError("@Parameter field is static "
                    + f.toString());
        }
        if (!Modifier.isPublic(f.getModifiers())) {
            throw new InternalError("@Parameter field is not public "
                    + f.toString());
        }
        int position = f.getAnnotation(Parameter.class).value();
        if (position < 0) {
            throw new InternalError("@Parameter can'be negative "
                    + f.toString());
        }
    }
View Full Code Here

TOP

Related Classes of ch.powerunit.exception.InternalError

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.