Package com.google.enterprise.connector.dctm.dctmmockwrap

Examples of com.google.enterprise.connector.dctm.dctmmockwrap.MockDmSession


  }

  /** This triggers a comparison using isSubTypeOf, which matches. */
  public void testPropertiesMap_grandtypeFirst() throws RepositoryException {
    Map<String, Set<String>> propertiesMap =
        builder.getPropertiesMap("Grandfoo,foo", new MockDmSession());
    Set<String> types = propertiesMap.get("Grandfoo_attr");
    assertEquals(setOf("Grandfoo"), types);
  }
View Full Code Here


  }

  /** This triggers a comparison using getSuperType, which fails. */
  public void testPropertiesMap_grandtypeSecond() throws RepositoryException {
    Map<String, Set<String>> propertiesMap =
        builder.getPropertiesMap("foo,Grandfoo", new MockDmSession());
    Set<String> types = propertiesMap.get("Grandfoo_attr");
    assertEquals(setOf("Grandfoo"), types);
  }
View Full Code Here

  }

  /** This triggers a comparison using getSuperType, which matches. */
  public void testPropertiesMap_supertypeSecond() throws RepositoryException {
    Map<String, Set<String>> propertiesMap =
        builder.getPropertiesMap("foo,Superfoo", new MockDmSession());
    Set<String> types = propertiesMap.get("Superfoo_attr");
    assertEquals(setOf("Superfoo"), types);
  }
View Full Code Here

  /** A subtype is properly eliminated. */
  public void testPropertiesMap_supertype()
      throws RepositoryException {
    Map<String, Set<String>> propertiesMap =
        builder.getPropertiesMap("Superfoo,foo", new MockDmSession());
    Set<String> types = propertiesMap.get("Super_sharedattr");
    assertEquals(setOf("Superfoo"), types);
  }
View Full Code Here

  /** Two unrelated types are retained. */
  public void testPropertiesMap_unrelatedType()
      throws RepositoryException {
    Map<String, Set<String>> propertiesMap =
        builder.getPropertiesMap("bar,Superfoo", new MockDmSession());
    Set<String> types = propertiesMap.get("Super_sharedattr");
    Set<String> expected = new HashSet<String>();
    expected.add("Superfoo");
    expected.add("bar");
    assertEquals(expected, types);
View Full Code Here

  /** The presence of the unrelated type incorrectly retains the subtype. */
  public void testPropertiesMap_supertypeWithUnrelatedType()
      throws RepositoryException {
    Map<String, Set<String>> propertiesMap =
        builder.getPropertiesMap("bar,Superfoo,foo", new MockDmSession());
    Set<String> types = propertiesMap.get("Super_sharedattr");
    Set<String> expected = new HashSet<String>();
    expected.add("Superfoo");
    expected.add("bar");
    assertEquals(expected, types);
View Full Code Here

  /** Tests a full list of related ancestors. */
  private void testPropertiesMap_oneBranch(String includedObjectType)
      throws RepositoryException {
    Map<String, Set<String>> propertiesMap = builder.getPropertiesMap(
        includedObjectType, new MockDmSession());
    Map<String, Set<String>> expected = new HashMap<String, Set<String>>();
    expected.put("foo_attr", setOf("foo"));
    expected.put("sharedattr", setOf("foo"));
    expected.put("Superfoo_attr", setOf("Superfoo"));
    expected.put("Super_sharedattr", setOf("Superfoo"));
View Full Code Here

  /** Tests a full list of unrelated ancestors. */
  private void testPropertiesMap_twoBranches(String includedObjectType)
      throws RepositoryException {
    Map<String, Set<String>> propertiesMap = builder.getPropertiesMap(
        includedObjectType, new MockDmSession());
    Map<String, Set<String>> expected = new HashMap<String, Set<String>>();
    expected.put("foo_attr", setOf("foo"));
    expected.put("bar_attr", setOf("bar"));
    expected.put("sharedattr", setOf("foo", "bar"));
    expected.put("Superfoo_attr", setOf("Superfoo"));
View Full Code Here

        "Grandfoo,Superfoo,foo,Grandbar,Superbar,bar");
  }

  public void testPropertiesMap_sysobject() throws RepositoryException {
    Map<String, Set<String>> propertiesMap = builder.getPropertiesMap(
        "foo,dm_sysobject", new MockDmSession());
    assertEquals(propertiesMap.toString(), 9, propertiesMap.size());
    for (Map.Entry<String, Set<String>> entry : propertiesMap.entrySet()) {
      if (entry.getKey().equals("dm_sysobject_attr") ||
          DctmSysobjectDocument.EXTENDED_PROPERTIES.contains(entry.getKey())) {
        assertEquals(setOf("dm_sysobject"), entry.getValue());
View Full Code Here

    }
  }

  public void testPropertiesMap_duplicates() throws RepositoryException {
    Map<String, Set<String>> expected = builder.getPropertiesMap(
        "foo", new MockDmSession());
    Map<String, Set<String>> propertiesMap = builder.getPropertiesMap(
        "foo,foo", new MockDmSession());
    assertEquals(expected, propertiesMap);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.dctm.dctmmockwrap.MockDmSession

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.