Examples of AtomInfo


Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testAtomServiceDocument() throws EntityProviderException {
    InputStream in = ClassLoader.class.getResourceAsStream("/svcExample.xml");
    ServiceDocument serviceDocument = EntityProvider.readServiceDocument(in, "application/atom+xml");
    assertNotNull(serviceDocument);
    AtomInfo atomInfo = serviceDocument.getAtomInfo();
    assertNotNull(atomInfo);
    for (Workspace workspace : atomInfo.getWorkspaces()) {
      assertEquals(10, workspace.getCollections().size());
      for (Collection collection : workspace.getCollections()) {
        assertNotNull(collection.getExtesionElements().get(0));
        assertEquals("member-title", collection.getExtesionElements().get(0).getName());
        assertEquals("foo", collection.getExtesionElements().get(0).getPrefix());
      }
    }
    for (ExtensionElement extElement : atomInfo.getExtesionElements()) {
      assertEquals(2, extElement.getAttributes().size());
    }
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testServiceDocument() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);
    assertNotNull(atomInfo.getWorkspaces());
    for (Workspace workspace : atomInfo.getWorkspaces()) {
      assertEquals("Data", workspace.getTitle().getText());
      assertEquals(10, workspace.getCollections().size());
      for (Collection collection : workspace.getCollections()) {
        assertNotNull(collection.getHref());
        if ("TypeOneEntityCollection".equals(collection.getHref())) {
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testExtensionsWithAttributes() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);
    assertNotNull(atomInfo.getExtesionElements());
    assertEquals(2, atomInfo.getExtesionElements().size());
    for (ExtensionElement extElement : atomInfo.getExtesionElements()) {
      assertEquals("link", extElement.getName());
      assertEquals("atom", extElement.getPrefix());
      assertEquals(2, extElement.getAttributes().size());
      assertEquals("rel", extElement.getAttributes().get(0).getName());
      assertEquals("http://localhost/odata/TEST_APPLICATION/", extElement.getAttributes().get(1).getText());
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testServiceDocument2() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcAtomExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);

    assertEquals(2, atomInfo.getWorkspaces().size());

    Workspace workspace = atomInfo.getWorkspaces().get(0);
    assertEquals("Main Site", workspace.getTitle().getText());
    assertEquals(2, workspace.getCollections().size());

    workspace = atomInfo.getWorkspaces().get(1);
    assertEquals("Sidebar Blog", workspace.getTitle().getText());
    assertEquals(1, workspace.getCollections().size());
    Collection collection = workspace.getCollections().get(0);
    assertEquals("Remaindered Links", collection.getTitle().getText());
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testCategories() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcAtomExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);

    assertEquals(2, atomInfo.getWorkspaces().size());

    Workspace workspace = atomInfo.getWorkspaces().get(0);
    assertEquals(2, workspace.getCollections().size());
    for (Collection collection : workspace.getCollections()) {
      for (Categories categories : collection.getCategories()) {
        assertEquals("http://example.com/cats/forMain.cats", categories.getHref());
      }
    }

    workspace = atomInfo.getWorkspaces().get(1);
    for (Collection collection : workspace.getCollections()) {
      for (Categories categories : collection.getCategories()) {
        assertEquals(Fixed.YES, categories.getFixed());
        for (Category category : categories.getCategoryList()) {
          assertEquals("http://example.org/extra-cats/", category.getScheme());
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testNestedExtensions() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcAtomExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);
    assertNotNull(atomInfo.getExtesionElements());
    for (ExtensionElement extElement : atomInfo.getExtesionElements()) {
      for (ExtensionElement nestedExtElement : extElement.getElements()) {
        if ("extension2".equals(nestedExtElement.getName())) {
          assertFalse(nestedExtElement.getAttributes().isEmpty());
          assertEquals("attributeValue", nestedExtElement.getAttributes().get(0).getText());
          assertEquals("attr", nestedExtElement.getAttributes().get(0).getName());
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testServiceDocument3() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/serviceDocExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);
    for (Workspace workspace : atomInfo.getWorkspaces()) {
      assertEquals("Data", workspace.getTitle().getText());
      assertEquals(9, workspace.getCollections().size());
      for (Collection collection : workspace.getCollections()) {
        assertNotNull(collection.getHref());
        if ("TravelagencyCollection".equals(collection.getHref())) {
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testServiceDocument() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);
    assertNotNull(atomInfo.getWorkspaces());
    for (Workspace workspace : atomInfo.getWorkspaces()) {
      assertEquals("Data", workspace.getTitle().getText());
      assertEquals(10, workspace.getCollections().size());
      for (Collection collection : workspace.getCollections()) {
        assertNotNull(collection.getHref());
        if ("TypeOneEntityCollection".equals(collection.getHref())) {
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testExtensionsWithAttributes() throws IOException, EntityProviderException {
    AtomServiceDocumentConsumer svcDocumentParser = new AtomServiceDocumentConsumer();
    ServiceDocument svcDocument = svcDocumentParser.readServiceDokument(createStreamReader("/svcExample.xml"));
    assertNotNull(svcDocument);
    AtomInfo atomInfo = svcDocument.getAtomInfo();
    assertNotNull(atomInfo);
    assertNotNull(atomInfo.getExtesionElements());
    assertEquals(2, atomInfo.getExtesionElements().size());
    for (ExtensionElement extElement : atomInfo.getExtesionElements()) {
      assertEquals("link", extElement.getName());
      assertEquals("atom", extElement.getPrefix());
      assertEquals(2, extElement.getAttributes().size());
      assertEquals("rel", extElement.getAttributes().get(0).getName());
      assertEquals("http://localhost/odata/TEST_APPLICATION/", extElement.getAttributes().get(1).getText());
View Full Code Here

Examples of org.apache.olingo.odata2.api.servicedocument.AtomInfo

  @Test
  public void testAtomServiceDocument() throws EntityProviderException {
    InputStream in = ClassLoader.class.getResourceAsStream("/svcExample.xml");
    ServiceDocument serviceDocument = EntityProvider.readServiceDocument(in, "application/atom+xml");
    assertNotNull(serviceDocument);
    AtomInfo atomInfo = serviceDocument.getAtomInfo();
    assertNotNull(atomInfo);
    for (Workspace workspace : atomInfo.getWorkspaces()) {
      assertEquals(10, workspace.getCollections().size());
      for (Collection collection : workspace.getCollections()) {
        assertNotNull(collection.getExtesionElements().get(0));
        assertEquals("member-title", collection.getExtesionElements().get(0).getName());
        assertEquals("foo", collection.getExtesionElements().get(0).getPrefix());
      }
    }
    for (ExtensionElement extElement : atomInfo.getExtesionElements()) {
      assertEquals(2, extElement.getAttributes().size());
    }
  }
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.