Examples of DataTypeEnum


Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

     * @throws AssertionError
     */
    private boolean validateField(Method method, Object actual, Object expected)
        throws AssertionError {

        DataTypeEnum type = ObjectUtil.resolveType(method.getReturnType());
        if (!type.equals(DataTypeEnum.JAVA_DOT_LANG_OBJECT) && !type.equals(DataTypeEnum.STRING)
            && !method.getReturnType().isPrimitive()) {

            return validateBeanField(method, actual, expected);
        }

View Full Code Here

Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

     */
    private boolean validateObject(Object actual, Object expected)
        throws AssertionError {

        // check if primitive or String or java lang object
        DataTypeEnum type = ObjectUtil.resolveType(actual.getClass());
        if (type.equals(DataTypeEnum.JAVA_DOT_LANG_OBJECT) || type.equals(DataTypeEnum.STRING)
            || actual.getClass().isPrimitive()) {
            return validatePrimitiveField(actual, expected);
        }


View Full Code Here

Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

        if (expArrayObject == null) {
                    AssertionUtils.jettAssertNull(assertionMessage + " Expected value is null, checking Actual value: ", actArrayObject);
          continue;
        }

        DataTypeEnum type = ObjectUtil.resolveType(actArrayObject);
        switch(type) {
        case JAVA_DOT_LANG_OBJECT:
        case STRING:
          Object castedExpArrayObject;
          try {
View Full Code Here

Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

            Object actualValue = beanMethod.invoke(actualBean, (Object[])null);

            if ((expectedValue==null) || (actualValue==null)) {
                            AssertionUtils.jettAssertEquals(compareString.toString(),expectedValue, actualValue);
            } else {
              DataTypeEnum type;
              type = ObjectUtil.resolveType(actualValue);
              switch(type) {
              case JAVA_DOT_LANG_OBJECT:
              case STRING:
                Object castedExpectedObj = Reflect.getWrappedValue(actualValue.getClass(), expectedValue);
View Full Code Here

Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

    public static void jettAssertEquals(String message, Object expected, Object actual) {
        if (actual == null) {
            assertNull(expected);
        }
        else {
            DataTypeEnum actualObjectType = ObjectUtil.resolveType(actual.getClass());
          IAssertion asserter = AssertionProcessorFactory.getAssertionProcessor(actualObjectType);
          asserter.execute(message, expected, actual, null);
        }
    }
View Full Code Here

Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

            } else {
              //Build expectedValue object based on actualValue class
                            AssertionUtils.actionPass(errorMessageBuffer.toString());
              AggregatedStepExpectedOutputMetaData expectedValueMetaData = new AggregatedStepExpectedOutputMetaData();
              expectedValueMetaData.addMetaData(expectedMetaData.getMetaDataAtIndex(rowCounter));
              DataTypeEnum actualValueDataType = ObjectUtil.resolveType(actualValue);
              IAssertion expectedValueAsserter = AssertionProcessorFactory.getAssertionProcessor(actualValueDataType);
              expectedValue = expectedValueAsserter.preProcess(actualValue, expectedValueMetaData);
              expectedValueAsserter.execute(message, expectedValue, actualValue, expectedValueMetaData);
            }
            rowCounter++;
View Full Code Here

Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

          }
        }
      }

      if ((actualArrayList != null) && (actualArrayList.size()!=0) && (allContainedObjectsTheSame)) {
        DataTypeEnum type = ObjectUtil.resolveType(actualArrayList.get(0));

        switch(type) {
        case JAVA_DOT_LANG_OBJECT:
        case STRING:
          for (StepMetaData stepMetaData: expectedObjectMetaData.getValues()) {
View Full Code Here

Examples of com.betfair.testing.utils.cougar.misc.DataTypeEnum

      String compareMessage = "Checking ArrayList Entry '" + assertionCoutner + "' ";

      if ((expectedListEntity==null) || (actualListEntity==null)) {
                AssertionUtils.jettAssertEquals(compareMessage + "value: ",expectedListEntity, actualListEntity);
      } else {
        DataTypeEnum type;
        type = ObjectUtil.resolveType(actualListEntity);
        switch(type) {
        case JAVA_DOT_LANG_OBJECT:
        case STRING:
          Object castedExpectedObj = Reflect.getWrappedValue(actualListEntity.getClass(), expectedListEntity);
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.defaults.DataTypeEnum

        return getValueFactory().createText(content);
    }

    @Override
    public Object createLiteral(String content, Locale language, URI type) {
        DataTypeEnum dataType = type == null ? null : DataTypeEnum.getDataType(type.toString());
        if(language != null){
            if(type != null && !(DataTypeEnum.String == dataType || DataTypeEnum.Text == dataType)){
                throw new IllegalArgumentException("Literals with a Lanugage MUST not have NULL,"+
                    DataTypeEnum.String.getShortName()+" or "+
                    DataTypeEnum.Text.getShortName()+" assigned as type!");
            } else {
                return getValueFactory().createText(content, language.getLanguage());
            }
        } else if(type != null){ //create a typed literal
            if(dataType == null){ //the parsed type is an unknown data type
                return content; //return an string
            } else {
                Object converted = valueConverter.convert(content, dataType.getUri(), getValueFactory());
                if(converted == null){
                    log.debug("Unable to convert content '{}' to dataType '{}'",converted,dataType);
                    return content;
                } else {
                    return converted;
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.defaults.DataTypeEnum

    private static Constraint parseConstraint(String filterString) {
        if(filterString.startsWith("d=")){
            String[] dataTypeStrings = filterString.substring(2).split(";");
            Set<String> dataTypes = new HashSet<String>();
            for(int i=0;i<dataTypeStrings.length;i++){
                DataTypeEnum dataType = DataTypeEnum.getDataTypeByShortName(dataTypeStrings[i]);
                if(dataType == null){
                    dataType = DataTypeEnum.getDataType(dataTypeStrings[i]);
                }
                if(dataType != null){
                    dataTypes.add(dataType.getUri());
                } else {
                    log.warn(String.format("DataType %s not supported! Datatype get not used by this Filter",
                        dataTypeStrings[i]));
                }
            }
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.