Package org.apache.lucene.facet.index

Examples of org.apache.lucene.facet.index.DummyProperty


    assertNull("Attribute should be null", ca
        .getProperty(DummyProperty.class));
    assertNull("Attribute classes should be null", ca.getPropertyClasses());

    ca.addProperty(new DummyProperty());
    assertEquals("DummyProperty should be in properties",
        new DummyProperty(), ca.getProperty(DummyProperty.class));
    assertEquals("Attribute classes should contain 1 element", 1, ca
        .getPropertyClasses().size());

    boolean failed = false;
    try {
      ca.addProperty(new DummyProperty());
    } catch (UnsupportedOperationException e) {
      failed = true;
    }

    if (!failed) {
      fail("Two DummyAttributes added to the same CategoryAttribute");
    }

    ca.clearProperties();
    assertNull("Attribute classes should be null", ca.getPropertyClasses());

    ca.addProperty(new DummyProperty());
    assertEquals("DummyProperty should be in properties",
        new DummyProperty(), ca.getProperty(DummyProperty.class));
    ca.remove(DummyProperty.class);
    assertEquals("DummyProperty should not be in properties", null, ca
        .getProperty(DummyProperty.class));
    assertNull("Attribute classes should be null", ca.getPropertyClasses());

    ca.addProperty(new DummyProperty());
    List<Class<? extends CategoryProperty>> propertyClasses = new ArrayList<Class<? extends CategoryProperty>>();
    assertEquals("No property expected when no classes given", null, ca
        .getProperty(propertyClasses));
    propertyClasses.add(DummyProperty.class);
    assertEquals("DummyProperty should be in properties",
        new DummyProperty(), ca.getProperty(propertyClasses));
    propertyClasses.add(OrdinalProperty.class);
    assertEquals("DummyProperty should be in properties",
        new DummyProperty(), ca.getProperty(propertyClasses));
    propertyClasses.clear();
    propertyClasses.add(OrdinalProperty.class);
    assertEquals("No ordinal property expected", null, ca
        .getProperty(propertyClasses));
  }
View Full Code Here


  public void testCloneCopyToAndSet() throws FacetException {
    CategoryAttributeImpl ca1 = new CategoryAttributeImpl();

    CategoryPath cp = new CategoryPath("a", "b");
    ca1.setCategoryPath(cp);
    ca1.addProperty(new DummyProperty());

    CategoryAttribute ca2 = ca1.clone();
    assertEquals("Error in cloning", ca1, ca2);

    CategoryAttributeImpl ca3 = new CategoryAttributeImpl();
View Full Code Here

    new CategoryParentsStream(new CategoryAttributesStream(categoryContainer),
        taxonomyWriter, new DefaultFacetIndexingParams());

    // add DummyAttribute, but do not retain, only one expected
    categoryContainer.addCategory(initialCatgeories[0], new DummyProperty());

    CategoryParentsStream stream = new CategoryParentsStream(new CategoryAttributesStream(
        categoryContainer), taxonomyWriter,
        new DefaultFacetIndexingParams());
View Full Code Here

        categoryContainer), taxonomyWriter, indexingParams);

    // add DummyAttribute and retain it, three expected
    categoryContainer.clear();
    categoryContainer
        .addCategory(initialCatgeories[0], new DummyProperty());
    CategoryParentsStream stream = new CategoryParentsStream(
        new CategoryAttributesStream(categoryContainer),
        taxonomyWriter, new DefaultFacetIndexingParams());
    stream.addRetainableProperty(DummyProperty.class);
View Full Code Here

    new CategoryParentsStream(new CategoryAttributesStream(categoryContainer),
        taxonomyWriter, new DefaultFacetIndexingParams());

    // add DummyAttribute, but do not retain, only one expected
    categoryContainer.addCategory(initialCatgeories[0], new DummyProperty());

    CategoryParentsStream stream = new CategoryParentsStream(new CategoryAttributesStream(
        categoryContainer), taxonomyWriter,
        new DefaultFacetIndexingParams());
View Full Code Here

        categoryContainer), taxonomyWriter, indexingParams);

    // add DummyAttribute and retain it, three expected
    categoryContainer.clear();
    categoryContainer
        .addCategory(initialCatgeories[0], new DummyProperty());
    CategoryParentsStream stream = new CategoryParentsStream(
        new CategoryAttributesStream(categoryContainer),
        taxonomyWriter, new DefaultFacetIndexingParams());
    stream.addRetainableProperty(DummyProperty.class);
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.index.DummyProperty

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.