Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Value


            "values", "this is the text for field foo"));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
    Value v = p.nextValue();
    assertNotNull("property foo value missing", v);
    assertEquals("property foo", "this is the text for field foo",
        v.toString());
    assertNull(p.nextValue());
  }
View Full Code Here


            NotesItem.NUMBERS, "values", new Double(11)));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
    Value v = p.nextValue();
    assertNotNull("property foo value missing", v);
    assertEquals("property foo", "11.0", v.toString());
    assertNull(p.nextValue());
  }
View Full Code Here

            NotesItem.NUMBERS, "values", new NotesDateTimeMock(testDate)));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
    Value v = p.nextValue();
    assertNotNull("property foo value missing", v);
    assertEquals("property foo",
        Value.calendarToIso8601(testCalendar), v.toString());
    assertNull(p.nextValue());
  }
View Full Code Here

            "values", "foo text 1", "foo text 2", "foo text 3"));
    doc.crawlDoc = crawlDoc;
    doc.setMetaFields();
    Property p = doc.findProperty("foo");
    assertNotNull("property foo missing", p);
    Value v = p.nextValue();
    assertNotNull("property foo value missing", v);
    assertEquals("property foo 1", "foo text 1", v.toString());
    v = p.nextValue();
    assertEquals("property foo 2", "foo text 2", v.toString());
    v = p.nextValue();
    assertEquals("property foo 3", "foo text 3", v.toString());
    assertNull(p.nextValue());
  }
View Full Code Here

      throws Exception {
    Property p = document.findProperty(property);
    assertNotNull("Missing property " + property, p);

    int i = 0;
    Value v;
    while ((v = p.nextValue()) != null) {
      if (i == index) {
        if (v instanceof PrincipalValue) {
          assertEquals(expected, ((PrincipalValue) v).getPrincipal().getName());
        } else {
          assertEquals(expected, v.toString());
        }
        return;
      }
      i++;
    }
View Full Code Here

  private Principal getFirstPrincipal(NotesConnectorDocument document,
      String propertyName) throws Exception {
    Property property = document.findProperty(propertyName);
    assertNotNull("Missing " + propertyName, property);
    Value value = property.nextValue();
    assertNotNull("Missing value for " + propertyName, value);
    assertTrue("Not PrincipalValue: " + propertyName,
        value instanceof PrincipalValue);
    return ((PrincipalValue) value).getPrincipal();
  }
View Full Code Here

  private void getDocumentProperty(NotesConnectorDocument doc,
      Collection<String> readers, String propName) throws Exception {
    Property prop = doc.findProperty(propName);
    assertNotNull(prop);
    Value v;
    while ((v = prop.nextValue()) != null) {
      String decoded = URLDecoder.decode(v.toString(), "UTF-8");
      readers.add(decoded.replaceFirst("Domino/", ""));
    }
  }
View Full Code Here

  private static List<String> getValues(Document doc, String name)
      throws Exception {
    List<String> values = new ArrayList<String>();
    Property p = doc.findProperty(name);
    if (p != null) {
      Value v = p.nextValue();
      if (v != null) {
        values.add(v.toString());
      }
    }
    return values;
  }
View Full Code Here

    while ((map = (DctmSysobjectDocument) documentList.nextDocument()) != null) {
      String docId = map.findProperty(SpiConstants.PROPNAME_DOCID)
          .nextValue().toString();
      String expectedid = "090000018000015e";
      assertEquals(expectedid, docId);
      Value date =
          map.findProperty(SpiConstants.PROPNAME_LASTMODIFIED).nextValue();
      String modifyDate = date.toString();
      // TODO: may have to adjust the assertion for the date format returned by Value.toString()
      System.out.println("testResumeTraversalWithSimilarDate modifyDate = '" + modifyDate + "'");
      String expecterModifyDate = "2006-12-14 20:09:13";
      assertEquals(expecterModifyDate, modifyDate);
    }
View Full Code Here

    DctmSysobjectDocument dctmSpm = new DctmSysobjectDocument(
        traversalManager, session, DmInitialize.DM_ID2, null, lastModifDate,
        SpiConstants.ActionType.ADD, null);

    Property property = dctmSpm.findProperty("keywords");
    Value val = null;

    while ((val = property.nextValue()) != null) {
      // TOOD: compare val.toString() to expected keywords.
    }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.Value

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.