Package org.apache.olingo.odata2.api.exception

Examples of org.apache.olingo.odata2.api.exception.ODataException


          dataSource.createData(relatedEntitySet, relatedData);
          dataSource.writeRelation(entitySet, data, relatedEntitySet, getStructuralTypeValueMap(relatedData,
              relatedEntityType));
          createInlinedEntities(relatedEntitySet, relatedData, relatedValueEntry);
        } else {
          throw new ODataException("Unexpected class for a related value: " + relatedValue.getClass().getSimpleName());
        }

      }
    }
  }
View Full Code Here


  }

  private <T> void setStructuralTypeValuesFromMap(final T data, final EdmStructuralType type,
      final Map<String, Object> valueMap, final boolean merge) throws ODataException {
    if(data == null) {
      throw new ODataException("Unable to set structural type values to NULL data.");
    }
    ODataContext context = getContext();
    final int timingHandle =
        context.startRuntimeMeasurement(getClass().getSimpleName(), "setStructuralTypeValuesFromMap");
View Full Code Here

  private Object createInstance(Class<?> complexClass) throws ODataException {
    try {
      return complexClass.newInstance();
    } catch (InstantiationException e) {
      throw new ODataException("Unable to create instance for complex data class '"
          + complexClass + "'.", e);
    } catch (IllegalAccessException e) {
      throw new ODataException("Unable to create instance for complex data class '"
          + complexClass + "'.", e);
    }
  }
View Full Code Here

      for (EntitySet entitySet : entitySets) {
        if (entitySet.getEntityType().equals(end.getType())) {
          return entitySet.getName();
        }
      }
      throw new ODataException("No entity set found for " + end.getType());
    }
View Full Code Here

          dataSource.createData(relatedEntitySet, relatedData);
          dataSource.writeRelation(entitySet, data, relatedEntitySet, getStructuralTypeValueMap(relatedData,
              relatedEntityType));
          createInlinedEntities(relatedEntitySet, relatedData, relatedValueEntry);
        } else {
          throw new ODataException("Unexpected class for a related value: " + relatedValue.getClass().getSimpleName());
        }

      }
    }
  }
View Full Code Here

*/
public class ODataExceptionTest extends BaseTest {

  @Test
  public void noCause() {
    ODataException exception = new ODataException("Some message.");
    assertFalse(exception.isCausedByHttpException());
  }
View Full Code Here

    assertFalse(exception.isCausedByHttpException());
  }

  @Test
  public void nullPointerExceptionCause() {
    ODataException exception = new ODataException("Some message.", new NullPointerException());
    assertFalse(exception.isCausedByHttpException());
  }
View Full Code Here

    assertEquals(commonMsg.getText(), odnie.getMessage());
  }

  @Test
  public void oDataContextedCause() {
    ODataException exception =
        new ODataException("Some message.", new ODataNotFoundException(ODataNotFoundException.ENTITY));
    assertTrue(exception.isCausedByHttpException());
  }
View Full Code Here

    assertTrue(exception.isCausedByHttpException());
  }

  @Test
  public void oDataContextedCauseLayer3() {
    ODataException exception = new ODataException("Some message.",
        new IllegalArgumentException(
            new ODataNotFoundException(ODataNotFoundException.ENTITY)));
    assertTrue(exception.isCausedByHttpException());
  }
View Full Code Here

        String entitySetName = ANNOTATION_HELPER.extractEntitySetName(clz);
        if (entitySetName != null) {
          DataStore<Object> dhs = (DataStore<Object>) DataStore.createInMemory(clz, persistInMemory);
          dataStores.put(entitySetName, dhs);
        } else if (!ANNOTATION_HELPER.isEdmAnnotated(clz)) {
          throw new ODataException("Found not annotated class during DataStore initilization of type: "
              + clz.getName());
        }
      }
    } catch (DataStore.DataStoreException e) {
      throw new ODataException("Error in DataStore initilization with message: " + e.getMessage(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.exception.ODataException

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.