Examples of CDefinition


Examples of com.pardot.rhombus.cobject.CDefinition

    assertFalse(def1.equals(def2));
  }

  public void testNotEqualsFields() throws IOException {
    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition def1 = CDefinition.fromJsonString(json);
    CDefinition def2 = CDefinition.fromJsonString(json);
    Map<String, CField> fields = def2.getFields();
    fields.values().iterator().next().setName("Other name");
    assertFalse(def1.equals(def2));
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

    assertFalse(def1.equals(def2));
  }

  public void testGetMostSelectiveMatchingIndexMostSelective() throws IOException {
    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition definition = CDefinition.fromJsonString(json);
    SortedMap<String, Object> indexValues = new TreeMap<String, Object>();
    indexValues.put("type", "typeValue");
    indexValues.put("foreignid", 13);
    indexValues.put("instance", 11);

    CIndex matchingIndex = definition.getMostSelectiveMatchingIndex(indexValues);
    String expectedIndexKey = Joiner.on(":").join(indexValues.keySet());
    assertEquals(expectedIndexKey, matchingIndex.getKey());
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

    assertEquals(expectedIndexKey, matchingIndex.getKey());
  }

  public void testGetMostSelectiveMatchingIndexMiddle() throws IOException {
    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition definition = CDefinition.fromJsonString(json);
    SortedMap<String, Object> indexValues = new TreeMap<String, Object>();
    indexValues.put("type", "typeValue");
    indexValues.put("instance", 11);

    CIndex matchingIndex = definition.getMostSelectiveMatchingIndex(indexValues);
    String expectedIndexKey = Joiner.on(":").join(indexValues.keySet());
    assertEquals(expectedIndexKey, matchingIndex.getKey());
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

    assertEquals(expectedIndexKey, matchingIndex.getKey());
  }

  public void testGetMostSelectiveMatchingIndexLeastSelective() throws IOException {
    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition definition = CDefinition.fromJsonString(json);
    SortedMap<String, Object> indexValues = new TreeMap<String, Object>();
    indexValues.put("foreignid", 13);

    CIndex matchingIndex = definition.getMostSelectiveMatchingIndex(indexValues);
    String expectedIndexKey = Joiner.on(":").join(indexValues.keySet());
    assertEquals(expectedIndexKey, matchingIndex.getKey());
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

    assertEquals(expectedIndexKey, matchingIndex.getKey());
  }

  public void testIsFieldUsedInAnyIndexYes() throws IOException {
    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition definition = CDefinition.fromJsonString(json);
    assertTrue(definition.isFieldUsedInAnyIndex("foreignid"));
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

    assertTrue(definition.isFieldUsedInAnyIndex("foreignid"));
  }

  public void testIsFieldUsedInAnyIndexNo() throws IOException {
    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition definition = CDefinition.fromJsonString(json);
    assertFalse(definition.isFieldUsedInAnyIndex("filtered"));
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

public class FakeCIndexTest {
  @Test
  public void getMasterIteratorTest() throws Exception {

    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition def = CDefinition.fromJsonString(json);
    Long millistamp = System.currentTimeMillis();
    UUID startingUUID = UUIDs.startOf(millistamp);

    FakeCIndex subject = new FakeCIndex(
        def.getIndexes().get("instance:type"),
        def,
        startingUUID,
        100L,
        50L,
        10L );
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

  @Test
  public void getMasterIteratorTest() throws Exception {

    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition def = CDefinition.fromJsonString(json);

    FakeCDefinition subject = new FakeCDefinition(def,100L,50L, 10L);
    Iterator<Map<String,Object>> masterIt = subject.getMasterIterator(CObjectOrdering.DESCENDING);

    long counter = 0;
View Full Code Here

Examples of com.pardot.rhombus.cobject.CDefinition

  public void testGetListOfEffectedIndexes()throws IOException {
    //test for: protected List<CIndex> getListOfEffectedIndexes(CDefinition def, Map<String,Object> a, Map<String,Object> b)
    Subject subject = new Subject(null);
    String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
    CDefinition def = CDefinition.fromJsonString(json);
    //foreignid:type:instance
    Map<String,Object> a = Maps.newHashMap();
    Map<String,Object> b = Maps.newTreeMap();
    a.put("foreignid", 1L);
    List<CIndex> result = subject.TESTgetListOfEffectedIndexes(def,a,b);
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.