Package org.mantikhor.llapi

Examples of org.mantikhor.llapi.PropertyDefinition


    for (int index = propertyDefinitionImpls.size()-1; index > 0; index--)
    {
      assertTrue(propertyDefinitionImpls.get(index).compareTo(propertyDefinitionImpls.get(index-1)) > 0);
    }
   
    PropertyDefinition newOne = new PropertyDefinitionImpl(PropertyCategory.TYPEDEF, map.get(PropertyCategory.TYPEDEF));
    assertEquals(0, propertyDefinitionImpls.get(PropertyCategory.TYPEDEF.ordinal()).compareTo(newOne));

    // More tests not described above ...
    try
    {
      // This is a new DomainURI that we haven't used yet ...
      DomainURI domainURI = DomainURI.valueByString(uris[5]);

      // Make up a PropertyDefinition that matches propertyDefinitionImpls.get(0) in
      // PropertyCategory but not DomainURI.
      PropertyDefinition newPropDef =
        new PropertyDefinitionImpl(propertyDefinitionImpls.get(0).getCategory(), domainURI);
     
      // Calculate the result from a compareTo of this new PropertyDefinition (anotherOne) and the
      // pre-constructed one that has the same PropertyCategory.
      int result =
        newPropDef.compareTo(propertyDefinitionImpls.get(0));
     
      // The above result should be equal to the compareTo for the DomainURI
      assertTrue
      ( result ==
         (domainURI.compareTo(propertyDefinitionImpls.get(0).getTypedefURI()))
View Full Code Here


   * {@link org.mantikhor.llapi.impl.PropertyDefinitionImpl#equals(java.lang.Object)}.
   *
   */
  public void testEquals() 
  {
    PropertyDefinition propDef0 = propertyDefinitionImpls.get(0);
   
    // Different instance, but should be equal to propDef0 ...
    DomainURI uri = (DomainURI)map.get(PropertyCategory.TYPEDEF);
    PropertyDefinition sameAsPropDef0 =
      new PropertyDefinitionImpl(PropertyCategory.TYPEDEF, DomainURI.valueByString(uri.toString()));

    // Assert that propDef0 and sameAsPropDef0 are equal ... they are of the same category and same domain URI.
    assertTrue(propDef0.equals(sameAsPropDef0));

    // Test for symmetry
    if (sameAsPropDef0.equals(propDef0))
      assertTrue(propDef0.equals(sameAsPropDef0));
    if (!sameAsPropDef0.equals(propDef0))
      assertTrue(!propDef0.equals(sameAsPropDef0));
   
    // Contract for equals says if 'that' is null, then equals returns false
    assertFalse(propDef0.equals(null));
   
    // Reflexive?
    assertTrue(sameAsPropDef0.equals(sameAsPropDef0));
    assertTrue(propDef0.equals(propDef0));

    // All the sample pre-built PropertyDefinitionImpl(s) should be not equal to each other
    for (int index = 0; index < propertyDefinitionImpls.size()-1; index++)
    {
View Full Code Here

     * Test method for {@link org.mantikhor.logic.CardinalOr#getProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testGetPropertiesPropertyDefinition()
    {
        CardinalOr cardinalOr = new CardinalOr(3);
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        List<BaseProperty> definitionProperties = cardinalOr.getProperties(propDef);
        assertTrue(definitionProperties.size() == 0);
    }
View Full Code Here

     * Test method for {@link org.mantikhor.logic.CardinalOr#hasProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testHasPropertiesPropertyDefinition()
    {
        CardinalOr cardinalOr = new CardinalOr(3);
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        boolean b = cardinalOr.hasProperties(propDef);
        assertFalse(b);
    }
View Full Code Here

     * Test method for {@link org.mantikhor.logic.CardinalOr#countProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testCountPropertiesPropertyDefinition()
    {
        CardinalOr cardinalOr = new CardinalOr(3);
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        int count = cardinalOr.countProperties(propDef);
        assertTrue(count == 0);
    }
View Full Code Here

     * Test method for {@link org.mantikhor.logic.Or#getProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testGetPropertiesPropertyDefinition()
    {
        Or anOr = new Or();
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        List<BaseProperty> definitionProperties = anOr.getProperties(propDef);
        assertTrue(definitionProperties.size() == 0);
    }
View Full Code Here

     * Test method for {@link org.mantikhor.logic.Or#hasProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testHasPropertiesPropertyDefinition()
    {
        Or anOr = new Or();
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        boolean b = anOr.hasProperties(propDef);
        assertFalse(b);
    }
View Full Code Here

     * Test method for {@link org.mantikhor.logic.Or#countProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testCountPropertiesPropertyDefinition()
    {
        Or anOr = new Or();
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        int count = anOr.countProperties(propDef);
        assertTrue(count == 0);
    }
View Full Code Here

     * Test method for {@link org.mantikhor.logic.True#getProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testGetPropertiesPropertyDefinition()
    {
        True trueInstance = True.getInstance();
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        List<BaseProperty> definitionProperties = trueInstance.getProperties(propDef);
        assertTrue(definitionProperties.size() == 0);
    }
View Full Code Here

     * Test method for {@link org.mantikhor.logic.True#hasProperties(org.mantikhor.llapi.PropertyDefinition)}.
     */
    public void testHasPropertiesPropertyDefinition()
    {
        True trueInstance = True.getInstance();
        PropertyDefinition propDef =
            new PropertyDefinitionImpl(
                    PropertyCategory.LOGIC, DomainURI.valueByString("http://wijis.wisconsin.gov/names/operators/wijis/gateway/"));
        boolean b = trueInstance.hasProperties(propDef);
        assertFalse(b);
    }
View Full Code Here

TOP

Related Classes of org.mantikhor.llapi.PropertyDefinition

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.