Examples of OntoSpreadRestriction


Examples of org.ontospread.restrictions.OntoSpreadRestriction

import junit.framework.TestCase;

public class OntoSpreadRestrictionMaxConceptsTest extends TestCase {

  public void testEval() {
    OntoSpreadRestriction maxRestriction = new OntoSpreadRestrictionMaxConcepts(10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    Set<String> spreadedConcepts= new HashSet<String>();
    ontoSpreadState.setSpreadedConcepts(spreadedConcepts);
    assertTrue(maxRestriction.eval(ontoSpreadState));
    for(int i = 0; i<=10;i++){
      ontoSpreadState.getSpreadedConcepts().add(String.valueOf(i));
    }
    assertFalse(maxRestriction.eval(ontoSpreadState));
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

import junit.framework.TestCase;

public class OntoSpreadRestrictionMinConceptsTest extends TestCase {

  public void testEval() {
    OntoSpreadRestriction minRestriction = new OntoSpreadRestrictionMinConcepts(10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    Set<String> spreadedConcepts= new HashSet<String>();
    ontoSpreadState.setSpreadedConcepts(spreadedConcepts);
    assertTrue(minRestriction.eval(ontoSpreadState));
    for(int i = 0; i<=10;i++){
      ontoSpreadState.getSpreadedConcepts().add(String.valueOf(i));
    }
    assertFalse(minRestriction.eval(ontoSpreadState));
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

public class OntoSpreadRestrictionMinActivationValueTest extends TestCase {


  public void testEval() {
    OntoSpreadRestriction valueRestriction = new OntoSpreadRestrictionMinActivationValue(10.0);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setCurrentScore(11.0);
    assertTrue(valueRestriction.eval(ontoSpreadState));
    ontoSpreadState.setCurrentScore(9.0);   
    assertFalse(valueRestriction.eval(ontoSpreadState));   
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

import junit.framework.TestCase;

public class OntoSpreadRestrictionContextTest extends TestCase {

  public void testTrueEval(){
    OntoSpreadRestriction contextRestriction = new OntoSpreadRestrictionContext("http://context",10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ConceptTO conceptToSpread = new ConceptTO("http://context#Concept");
    ontoSpreadState.setConceptToSpread(conceptToSpread );
    assertTrue(contextRestriction.eval(ontoSpreadState));
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

    ConceptTO conceptToSpread = new ConceptTO("http://context#Concept");
    ontoSpreadState.setConceptToSpread(conceptToSpread );
    assertTrue(contextRestriction.eval(ontoSpreadState));
  }
  public void testFalseEval(){
    OntoSpreadRestriction contextRestriction = new OntoSpreadRestrictionContext("http://context",10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ConceptTO conceptToSpread = new ConceptTO("http://contex1t#Concept");
    ontoSpreadState.setConceptToSpread(conceptToSpread );
    assertFalse(contextRestriction.eval(ontoSpreadState));
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

import junit.framework.TestCase;

public class OntoSpreadRestrictionNotMaxTimeTest extends TestCase {

  public void testMaxTime(){
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionNotMaxTime(2000);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setSpreadTime(0);
    assertTrue(restriction.eval(ontoSpreadState));
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

    ontoSpreadState.setSpreadTime(0);
    assertTrue(restriction.eval(ontoSpreadState));
  }
 
  public void testMaxTime1(){
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionNotMaxTime(2000);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setSpreadTime(1999);
    assertTrue(restriction.eval(ontoSpreadState));
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

    ontoSpreadState.setSpreadTime(1999);
    assertTrue(restriction.eval(ontoSpreadState));
  }
 
  public void testMaxTime2(){
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionNotMaxTime(2000);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setSpreadTime(2001);
    assertFalse(restriction.eval(ontoSpreadState));
  }
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadRestriction

    assertFalse(((Boolean)stop).booleanValue());
   
  }

  public void testVisitOntoSpreadSimpleRestriction() {
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionMinConcepts(2);
    OntoSpreadState state = new OntoSpreadState();
    OntoSpreadBooleanRestrictionVisitor visitor = new OntoSpreadBooleanRestrictionVisitor();
    visitor.setOntoSpreadState(state);
    Object stop = visitor.visit(restriction);
    assertEquals(stop.getClass(),Boolean.class);
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.