Examples of EdmFacets


Examples of org.apache.olingo.odata2.api.edm.EdmFacets

  @Test
  public void serializeETagEncoding() throws IOException, XpathException, SAXException, XMLStreamException,
      FactoryConfigurationError, ODataException {
    Edm edm = MockFacade.getMockEdm();
    EdmTyped roomIdProperty = edm.getEntityType("RefScenario", "Room").getProperty("Id");
    EdmFacets facets = mock(EdmFacets.class);
    when(facets.getConcurrencyMode()).thenReturn(EdmConcurrencyMode.Fixed);
    when(facets.getMaxLength()).thenReturn(3);
    when(((EdmProperty) roomIdProperty).getFacets()).thenReturn(facets);

    roomData.put("Id", "<\">");
    AtomEntityProvider ser = createAtomEntityProvider();
    ODataResponse response =
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

    when(facets.isNullable()).thenReturn(nullable);
    return facets;
  }

  private EdmFacets getPrecisionScaleFacets(final Integer precision, final Integer scale) {
    EdmFacets facets = mock(EdmFacets.class);
    when(facets.getPrecision()).thenReturn(precision);
    when(facets.getScale()).thenReturn(scale);
    return facets;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

  }

  String getUpdatedString(final EntityInfoAggregator eia, final Map<String, Object> data)
      throws EdmSimpleTypeException {
    Object updateDate = null;
    EdmFacets updateFacets = null;
    EntityPropertyInfo updatedInfo = eia.getTargetPathInfo(EdmTargetPath.SYNDICATION_UPDATED);
    if (updatedInfo != null) {
      updateDate = data.get(updatedInfo.getName());
      if (updateDate != null) {
        updateFacets = updatedInfo.getFacets();
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

    when(facets.getScale()).thenReturn(scale);
    return facets;
  }

  private EdmFacets getUnicodeFacets(final Boolean unicode) {
    EdmFacets facets = mock(EdmFacets.class);
    when(facets.isUnicode()).thenReturn(unicode);
    when(facets.getMaxLength()).thenReturn(null);
    return facets;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

  @Test
  public void valueToStringDateTimeSpecial() throws Exception {

    for (int precision = 0; precision < 3; precision++) {
      final EdmSimpleType instance = EdmSimpleTypeKind.DateTime.getEdmSimpleTypeInstance();
      final EdmFacets facets = getPrecisionScaleFacets(precision, null);
      final Calendar date = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
      date.set(Calendar.MILLISECOND, 10 * precision + 1);

      date.set(1954, 7, 4);
      expectErrorInValueToString(instance, date, EdmLiteralKind.DEFAULT, facets,
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

      writer.writeEndElement();

      writer.writeStartElement(FormatXml.ATOM_UPDATED);

      Object updateDate = null;
      EdmFacets updateFacets = null;
      updateDate = new Date();
      writer.writeCharacters(EdmDateTimeOffset.getInstance().valueToString(updateDate, EdmLiteralKind.DEFAULT,
          updateFacets));
      writer.writeEndElement();
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

  @Test
  public void serializeETagEncoding() throws IOException, XpathException, SAXException, XMLStreamException,
      FactoryConfigurationError, ODataException {
    Edm edm = MockFacade.getMockEdm();
    EdmTyped roomIdProperty = edm.getEntityType("RefScenario", "Room").getProperty("Id");
    EdmFacets facets = mock(EdmFacets.class);
    when(facets.getConcurrencyMode()).thenReturn(EdmConcurrencyMode.Fixed);
    when(facets.getMaxLength()).thenReturn(3);
    when(((EdmProperty) roomIdProperty).getFacets()).thenReturn(facets);

    roomData.put("Id", "<\">");
    AtomEntityProvider ser = createAtomEntityProvider();
    ODataResponse response =
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

    }
    return mockedEdmProperty;
  }

  private EdmFacets getEdmFacetsMockedObj() {
    EdmFacets facets = EasyMock.createMock(EdmFacets.class);
    EasyMock.expect(facets.getConcurrencyMode()).andStubReturn(EdmConcurrencyMode.Fixed);

    EasyMock.replay(facets);
    return facets;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

  private void wrongProperty(final ODataHttpMethod method, final boolean ofComplex, final Boolean key)
      throws ODataException {
    EdmProperty property = (EdmProperty) (ofComplex ?
        edm.getComplexType("RefScenario", "c_Location").getProperty("Country") :
        edm.getEntityType("RefScenario", "Employee").getProperty("Age"));
    EdmFacets facets = mock(EdmFacets.class);
    when(facets.isNullable()).thenReturn(false);
    when(property.getFacets()).thenReturn(facets);

    List<String> pathSegments;
    if (ofComplex) {
      pathSegments = createPathSegments(UriType.URI4, false, true);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmFacets

  }

  @Test
  public void conditionalHandling() throws Exception {
    EdmProperty property = (EdmProperty) (edm.getEntityType("RefScenario", "Employee").getProperty("EmployeeId"));
    EdmFacets facets = mock(EdmFacets.class);
    when(facets.getConcurrencyMode()).thenReturn(EdmConcurrencyMode.Fixed);
    when(property.getFacets()).thenReturn(facets);

    executeAndValidateHeaderRequest(ODataHttpMethod.PUT, UriType.URI2, HttpHeaders.IF_MATCH, "W/\"1\"", null);
    executeAndValidateHeaderRequest(ODataHttpMethod.PATCH, UriType.URI2, HttpHeaders.IF_MATCH, "W/\"1\"", null);
    executeAndValidateHeaderRequest(ODataHttpMethod.MERGE, UriType.URI2, HttpHeaders.IF_MATCH, "W/\"1\"", null);
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.