Class FixtureTypeWrapper


  • public class FixtureTypeWrapper
    extends java.lang.Object
    Wrapper used in a similar fashion as the FixtureWrapper. It encapsulates an IType object and provides methods required when accessing the type during autocompletion etc.
    Author:
    Rene Schneider - initial API and implementation
    • Constructor Detail

      • FixtureTypeWrapper

        public FixtureTypeWrapper​(org.eclipse.jdt.core.IType aFixtureType)
        Creates a new instance.
        Parameters:
        aFixtureType - the type to encapsulate
    • Method Detail

      • findMethod

        protected org.eclipse.jdt.core.IMethod findMethod​(java.lang.String aMethodName)
                                                   throws org.eclipse.jdt.core.JavaModelException
        Finds a method with a specific name in the encapsulated type.
        Parameters:
        aMethodName - the method name to find
        Returns:
        the method if found, null if not
        Throws:
        org.eclipse.jdt.core.JavaModelException
      • convertParameterValuesToFixtureDefinedTypes

        public void convertParameterValuesToFixtureDefinedTypes​(java.lang.String aFixtureMethodName,
                                                                java.util.Map<java.lang.String,​java.lang.Object> aParameterMap,
                                                                java.util.List<java.lang.String> aParameterPath,
                                                                boolean anIncludeArbitraryParametersFlag)
                                                         throws org.eclipse.jdt.core.JavaModelException,
                                                                ParameterUtil.UnresolvableVariableException,
                                                                UnexecutableException
        Replaces all values in the given parameter map with converted versions that match the types that are expected by the given fixture method.
        Parameters:
        aFixtureMethodName - the method name
        aParameterMap - the parameter map
        aParameterPath - the path inside a nested object, if applicable
        anIncludeArbitraryParametersFlag - whether arbitrary parameters shall be included
        Throws:
        org.eclipse.jdt.core.JavaModelException
        UnexecutableException
        ParameterUtil.UnresolvableVariableException
      • convertResultValueToFixtureDefinedType

        public java.lang.Object convertResultValueToFixtureDefinedType​(java.lang.String aFixtureMethodName,
                                                                       ResultName aResultName,
                                                                       ValueOrEnumValueOrOperationCollection aValue)
                                                                throws org.eclipse.jdt.core.JavaModelException
        Converts a given result value (collection) to a fixture-method-defined result type. This won't do any variable replacement, since it's designed to be used inside Eclipse!
        Parameters:
        aFixtureMethodName - the method name
        aResultName - the name of the result (may be null if the default result is meant)
        aValue - the value to convert
        Returns:
        the converted value
        Throws:
        org.eclipse.jdt.core.JavaModelException
      • isArbitraryParameterFixtureClass

        public boolean isArbitraryParameterFixtureClass()
        Checks whether the encapsulated type is an arbitrary parameter fixture class.
        Returns:
      • instantiateArbitraryParameterEnumerator

        public ArbitraryParameterEnumerator instantiateArbitraryParameterEnumerator()
        Determines the ArbitraryParameterEnumerator class to use for the encapsulated fixture type and instantiates it.
        Returns:
        the enumerator or null if the class isn't an arbitrary fixture class or if there is no matching enumerator class found in the workspace
      • isCustomProposalFixtureClass

        public boolean isCustomProposalFixtureClass()
        Checks whether the encapsulated type is a custom proposal fixture class.
        Returns:
      • instantiateCustomProposalProvider

        public CustomProposalProvider instantiateCustomProposalProvider()
        Determines the CustomProposalProvider class to use for the encapsulated fixture type and instantiates it.
        Returns:
        the custom proposal provider