Package org.apache.olingo.odata2.ref.model

Examples of org.apache.olingo.odata2.ref.model.DataContainer


      HttpContentType.APPLICATION_ATOM_XML_UTF8
      );

  @Override
  protected ODataService createService() throws ODataException {
    DataContainer dataContainer = new DataContainer();
    dataContainer.init();
    final ODataSingleProcessor processor = new ListsProcessor(new ScenarioDataSource(dataContainer));
    final EdmProvider provider = new ScenarioEdmProvider();
    return new ODataSingleProcessorService(provider, processor) {};
  }
View Full Code Here


  private ODataContext mockedContext;

  @BeforeClass
  public static void init() {
    dataContainer = new DataContainer();
    dataContainer.reset();
    dataSource = new ScenarioDataSource(dataContainer);
    processor = new ListsProcessor(dataSource, new BeanPropertyAccess());
  }
View Full Code Here

*/
public class ScenarioServiceFactory extends ODataServiceFactory {

  @Override
  public ODataService createService(final ODataContext context) throws ODataException {
    DataContainer dataContainer = new DataContainer();
    dataContainer.reset();

    return createODataSingleProcessorService(
        new ScenarioEdmProvider(),
        new ListsProcessor(new ScenarioDataSource(dataContainer)));
  }
View Full Code Here

  private ODataContext mockedContext;

  @BeforeClass
  public static void init() {
    dataContainer = new DataContainer();
    dataContainer.reset();
    dataSource = new ScenarioDataSource(dataContainer);
    processor = new ListsProcessor(dataSource);
  }
View Full Code Here

  protected static final String PHOTO_DEFAULT_IMAGE = Base64.encodeBase64String(new Photo(0, null, null).getImage());

  @Override
  protected ODataSingleProcessorService createService() {
    DataContainer dataContainer = new DataContainer();
    dataContainer.reset();
    ODataSingleProcessor processor = new ListsProcessor(new ScenarioDataSource(dataContainer));
    EdmProvider provider = new ScenarioEdmProvider();

    return new ODataSingleProcessorService(provider, processor) {};
  }
View Full Code Here

      HttpContentType.APPLICATION_ATOM_XML_UTF8
      );

  @Override
  protected ODataService createService() throws ODataException {
    DataContainer dataContainer = new DataContainer();
    dataContainer.init();
    final ODataSingleProcessor processor = new ListsProcessor(new ScenarioDataSource(dataContainer));
    final EdmProvider provider = new ScenarioEdmProvider();
    return new ODataSingleProcessorService(provider, processor) {};
  }
View Full Code Here

    Field field = getField(processor.getClass(), "dataSource");
    field.setAccessible(true);
    ScenarioDataSource dataSource = (ScenarioDataSource) field.get(processor);
    field = getField(dataSource.getClass(), "dataContainer");
    field.setAccessible(true);
    DataContainer dataContainer = (DataContainer) field.get(dataSource);
    // Add a new Photo where the "Type" property is set to, space-separated,
    // a literal percent character, all gen-delims, and all sub-delims
    // as specified by RFC 3986.
    dataContainer.getPhotos().add(new Photo(42, "strange Photo", "% :/?#[]@ !$&'()*+,;="));

    // Check that percent-decoding and -encoding works as expected.
    final String url =
        "Container2.Photos(Id=42,Type='%25%20%3A%2F%3F%23%5B%5D%40%20%21%24%26%27%28%29%2A%2B%2C%3B%3D')";
    final String expected = url.replace("%27", "''");
View Full Code Here

  protected static final String PHOTO_DEFAULT_IMAGE = Base64.encodeBase64String(new Photo(0, null, null).getImage());

  @Override
  protected ODataSingleProcessorService createService() {
    DataContainer dataContainer = new DataContainer();
    dataContainer.reset();
    ODataSingleProcessor processor = new ListsProcessor(new ScenarioDataSource(dataContainer));
    EdmProvider provider = new ScenarioEdmProvider();

    return new ODataSingleProcessorService(provider, processor) {};
  }
View Full Code Here

    Field field = processor.getClass().getDeclaredField("dataSource");
    field.setAccessible(true);
    ScenarioDataSource dataSource = (ScenarioDataSource) field.get(processor);
    field = dataSource.getClass().getDeclaredField("dataContainer");
    field.setAccessible(true);
    DataContainer dataContainer = (DataContainer) field.get(dataSource);
    // Add a new Photo where the "Type" property is set to, space-separated,
    // a literal percent character, all gen-delims, and all sub-delims
    // as specified by RFC 3986.
    dataContainer.getPhotos().add(new Photo(42, "strange Photo", "% :/?#[]@ !$&'()*+,;="));

    // Check that percent-decoding and -encoding works as expected.
    final String url =
        "Container2.Photos(Id=42,Type='%25%20%3A%2F%3F%23%5B%5D%40%20%21%24%26%27%28%29%2A%2B%2C%3B%3D')";
    final String expected = url.replace("%27", "''");
View Full Code Here

      HttpContentType.APPLICATION_ATOM_XML_UTF8
      );

  @Override
  protected ODataService createService() throws ODataException {
    DataContainer dataContainer = new DataContainer();
    dataContainer.init();
    final ODataSingleProcessor processor = new ListsProcessor(new ScenarioDataSource(dataContainer));
    final EdmProvider provider = new ScenarioEdmProvider();
    return new ODataSingleProcessorService(provider, processor) {};
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.ref.model.DataContainer

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.