Examples of DataCollection


Examples of org.apache.shindig.protocol.DataCollection

      totalResults = r.getTotalResults();
      itemsPerPage = r.getItemsPerPage();
      author = "?";
      link = new AtomLink("rel", "???");
    } else if ( obj instanceof DataCollection ) {
      DataCollection dc = (DataCollection) obj;
      entry = Lists.newArrayList();
      for ( Entry<String, Map<String,String>> o : dc.getEntry().entrySet()) {
        entry.add(new AtomEntry(o));
      }
      startIndex = 0;
      totalResults = entry.size();
      itemsPerPage = entry.size();
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

  }

  @Test
  public void getJohnDoeApplicationData() throws Exception {
    Future<DataCollection> results = this.appDataServiceDb.getPersonData(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, null, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    DataCollection data = results.get();
    assertEquals(1, data.getEntry().size());
    assertEquals("0", data.getEntry().get("john.doe").get("count"));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

  }

  @Test
  public void getJohnDoeApplicationDataWithCountField() throws Exception {
    Future<DataCollection> results = this.appDataServiceDb.getPersonData(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("count"), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    DataCollection data = results.get();
    assertEquals(1, data.getEntry().size());
    assertEquals("0", data.getEntry().get("john.doe").get("count"));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

  }

  @Test
  public void getJohnDoeApplicationDataWithInvalidField() throws Exception {
    Future<DataCollection> results = this.appDataServiceDb.getPersonData(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("peabody"), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    DataCollection data = results.get();
    assertEquals(1, data.getEntry().size());
    assertEquals(null, data.getEntry().get("john.doe").get("count"));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

  }

  @Test
  public void getJohnDoeFriendsApplicationDataWithCountField() throws Exception {
    Future<DataCollection> results = this.appDataServiceDb.getPersonData(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("count"), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    DataCollection data = results.get();
    assertEquals(3, data.getEntry().size());
    assertEquals("7", data.getEntry().get("jane.doe").get("count"));
    assertEquals("2", data.getEntry().get("george.doe").get("count"));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

    values.put("count", "5");
    this.appDataServiceDb.updatePersonData(new UserId(Type.userId, "john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("count"), values, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);

    // Verify that update succeeded
    Future<DataCollection> results = this.appDataServiceDb.getPersonData(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, null, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    DataCollection data = results.get();
    assertEquals(1, data.getEntry().size());
    assertEquals("5", data.getEntry().get("john.doe").get("count"));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

  public void deleteJohnDoeApplicationDataWithCountField() throws Exception {
    // Do delete
    this.appDataServiceDb.deletePersonData(new UserId(Type.userId, "john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("count"), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    // Verify that delete succeeded
    Future<DataCollection> results = this.appDataServiceDb.getPersonData(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("count"), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    DataCollection data = results.get();
    assertEquals(1, data.getEntry().size());
    assertEquals(null, data.getEntry().get("john.doe").get("count"));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

  public void deleteJohnDoeApplicationDataWithInvalidField() throws Exception {
    // Do delete with invalid field
    this.appDataServiceDb.deletePersonData(new UserId(Type.userId, "john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("peabody"), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    // Verify that delete did not occur
    Future<DataCollection> results = this.appDataServiceDb.getPersonData(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), DEFAULT_APPLICATION_ID, SpiTestUtil.asSet("count"), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    DataCollection data = results.get();
    assertEquals(1, data.getEntry().size());
    assertEquals("0", data.getEntry().get("john.doe").get("count"));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

   *      com.thoughtworks.xstream.converters.MarshallingContext)
   */
  @Override
  public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {

    DataCollection collection = (DataCollection) source;
    Map<String, Map<String, String>> internalMap = collection.getEntry();

    for (Entry<String, Map<String, String>> eo : internalMap.entrySet()) {
      writer.startNode("entry");
      writer.startNode("key");
      writer.setValue(eo.getKey());
View Full Code Here

Examples of org.apache.shindig.protocol.DataCollection

    } else {
      for (Entry<String, Object> e : m.entrySet()) {
        fm.put(e.getKey(), (Map<String, String>) e.getValue());
      }
    }
    return new DataCollection(fm);
  }
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.