Package org.powermock.reflect.exceptions

Examples of org.powermock.reflect.exceptions.ConstructorNotFoundException


    } catch (RuntimeException e) {
      throw (RuntimeException) e;
    } catch (Error e) {
      throw (Error) e;
    } catch (Throwable e) {
      throw new ConstructorNotFoundException("Failed to lookup constructor.", e);
    }
  }
View Full Code Here


  }

  static void throwExceptionIfConstructorWasNotFound(Class<?> type, Constructor<?> potentialConstructor,
      Object... arguments) {
    if (potentialConstructor == null) {
      throw new ConstructorNotFoundException("No constructor found in class '" + getUnmockedType(type).getName()
          + "' with argument types: [ " + getArgumentsAsString(arguments) + " ]");
    }
  }
View Full Code Here

    Constructor<T> constructor = null;
    try {
      constructor = classThatContainsTheConstructorToTest.getDeclaredConstructor(parameterTypes);
    } catch (Exception e) {
      throw new ConstructorNotFoundException("Could not lookup the constructor", e);
    }

    return createInstance(constructor, arguments);
  }
View Full Code Here

    if (potentialContstructorPrimitive == null && potentialContstructorWrapped == null) {
      // Check if we can find a matching var args constructor.
      constructor = getPotentialVarArgsConstructor(classThatContainsTheConstructorToTest, arguments);
      if (constructor == null) {
        throw new ConstructorNotFoundException("Failed to find a constructor with argument types: ["
            + getArgumentsAsString(arguments) + "]");
      }
    } else if (potentialContstructorPrimitive == null && potentialContstructorWrapped != null) {
      constructor = potentialContstructorWrapped;
    } else if (potentialContstructorPrimitive != null && potentialContstructorWrapped == null) {
View Full Code Here

  public static Constructor<?> getFirstParentConstructor(Class<?> klass) {

    try {
      return getUnmockedType(klass).getSuperclass().getDeclaredConstructors()[0];
    } catch (Exception e) {
      throw new ConstructorNotFoundException("Failed to lookup constructor.", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.powermock.reflect.exceptions.ConstructorNotFoundException

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.