Examples of InternalError


Examples of ch.powerunit.exception.InternalError

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

Examples of ch.powerunit.exception.InternalError

                : Arrays.toString(groups.toArray());

        try {
            targetObject = testClass.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            throw new InternalError("Unexpected error " + e.getMessage(), e);
        }

        if (testClass.isAnnotationPresent(Ignore.class)) {
            executableTests.put(setName, p -> {
                TestContextImpl<Object> ctx = new TestContextImpl<>(
View Full Code Here

Examples of ch.powerunit.exception.InternalError

        testIndex = 0;
        try (Stream<?> params = (Stream<?>) parameters.invoke(targetObject)) {
            params.forEach(this::runOneParameter);
        } catch (IllegalAccessException | IllegalArgumentException
                | InvocationTargetException e) {
            throw new InternalError("Unexpected error " + e.getMessage(), e);
        }
    }
View Full Code Here

Examples of ch.powerunit.exception.InternalError

        String name = MessageFormat.format(formatter, o);
        try {
            notifyStartParameter(setName, name);
            int pidx = 0;
            if (o.length != parameterFields.size()) {
                throw new InternalError(
                        "Parameter fields count doesn't match with array size returned by parameters");
            }
            for (Object p : o) {
                try {
                    Field f = parameterFields.get(pidx);
                    if (f == null) {
                        throw new InternalError("Field " + pidx
                                + " is not found");
                    }
                    f.set(targetObject, p);
                } catch (IllegalArgumentException | IllegalAccessException e) {
                    throw new InternalError("Unexpected error "
                            + e.getMessage(), e);
                }
                pidx++;
            }
            runOne(name, o);
View Full Code Here

Examples of com.sun.jdo.api.persistence.enhancer.util.InternalError

            case TC_OBJECT:
            case TC_INTERFACE:
                insn = insn.append(Insn.create(opc_aconst_null));
                break;
            default:
                throw new InternalError("Unexpected return type");//NOI18N
            }

            // put default value to field
            insn = insn.append(
                Insn.create(opc_putfield,
View Full Code Here

Examples of com.sun.jdo.api.persistence.enhancer.util.InternalError

                case TC_INTERFACE:
                    wrapperClassName = null;
                    wrapperSignature = null;
                    break;
                default:
                    throw new InternalError("Unexpected return type");//NOI18N
                }

                // fetch this object's field
                insn = insn.append(Insn.create(opc_aload_0));
                insn = insn.append(
                    Insn.create(
                        opc_getfield,
                        pool.addFieldRef(
                            theClass.asString(),
                            act.fieldName(),
                            act.typeDescriptor())));

                // wrap the field value if primitive
                switch(act.getMethodReturn()) {
                case T_DOUBLE:
                case T_LONG:
                case T_FLOAT:
                case T_BOOLEAN:
                case T_CHAR:
                case T_BYTE:
                case T_SHORT:
                case T_INT:
                    insn = insn.append(
                        Insn.create(
                            opc_invokespecial,
                            pool.addMethodRef(
                                wrapperClassName,
                                "<init>",//NOI18N
                                wrapperSignature)));
                    break;
                case TC_STRING:
                case TC_OBJECT:
                case TC_INTERFACE:
                    break;
                default:
                    throw new InternalError("Unexpected return type");//NOI18N
                }

                // return the object (break)
                insn = insn.append(Insn.create(opc_areturn));
            }
View Full Code Here

Examples of com.sun.jdo.api.persistence.enhancer.util.InternalError

                    insn = insn.append(
                        Insn.create(opc_checkcast,
                                    pool.addClass(act.typeName())));
                    break;
                default:
                    throw new InternalError("Unexpected return type");//NOI18N
                }

                // unwrap the object if primitive wrapper
                switch(act.getMethodReturn()) {
                case T_DOUBLE:
                case T_LONG:
                case T_FLOAT:
                case T_BOOLEAN:
                case T_CHAR:
                case T_BYTE:
                case T_SHORT:
                case T_INT:
                    insn = insn.append(
                        Insn.create(
                            opc_invokevirtual,
                            pool.addMethodRef(
                                wrapperClassName,
                                unwrapperName,
                                unwrapperSignature)));
                    break;
                case TC_STRING:
                case TC_OBJECT:
                case TC_INTERFACE:
                    break;
                default:
                    throw new InternalError("Unexpected return type");//NOI18N
                }

                // store argument value in field
                insn = insn.append(
                    Insn.create(
View Full Code Here

Examples of com.sun.jdo.api.persistence.enhancer.util.InternalError

        case TC_OBJECT:
            return "TC_OBJECT";//NOI18N
        case TC_INTERFACE:
            return "TC_INTERFACE";//NOI18N
        default:
            throw new InternalError("Unexpected return type");//NOI18N
        }
    }
View Full Code Here

Examples of com.sun.jdo.api.persistence.enhancer.util.InternalError

*/
                //@olsen: 4429769, disregard object and setField's return value
                insn = insn.append(Insn.create(opc_pop2));
                break;
            default:
                throw new InternalError("Unexpected field type");//NOI18N
            }

            insn = insn.append(afterFetchDirty);
        }

View Full Code Here

Examples of com.sun.jdo.api.persistence.enhancer.util.InternalError

                        return interfaceArrayInfo;
*/
                    return classArrayInfo;
                }
            default:
                throw new InternalError("Missing case");//NOI18N
            }

        default:
            throw new InternalError("Missing case");//NOI18N
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.