Package org.veiset.coffew8.coffeepi

Source Code of org.veiset.coffew8.coffeepi.CoffeeStateRequiredAxioms

package org.veiset.coffew8.coffeepi;
import static jaxt.framework.Assert.*;

import org.veiset.coffew8.coffeepi.CoffeeState;
/**
* These axioms are required for class {@link org.veiset.coffew8.coffeepi.CoffeeState} and its subclasses.
*
* @note All axioms must be public static void methods
*/
public class CoffeeStateRequiredAxioms implements jaxt.framework.RequiredAxioms<org.veiset.coffew8.coffeepi.CoffeeState> {
 
  public static void transitiveAxiom(CoffeeState a, CoffeeState b, CoffeeState c){
    if(a.newerThan(b) && b.newerThan(c))
      assertTrue(a.newerThan(c));
  }
 
  public static void irreflexiveNewerThanAxiom(CoffeeState a) {
    assertFalse(a.newerThan(a));
  }

  public static void asymmetricNewerThanAxiom(CoffeeState a, CoffeeState b){
    if(a.newerThan(b))
      assertFalse(b.newerThan(a));
  }
 
  public static void shouldRelateIncreasingAxiom(){
    CoffeeState a = new CoffeeState(0);
    try {
      Thread.sleep(1);
    } catch (InterruptedException e) {
      fail("unable to sleep");
    }
    CoffeeState b = new CoffeeState(1);
    assertTrue(b.newerThan(a));
  }
}
TOP

Related Classes of org.veiset.coffew8.coffeepi.CoffeeStateRequiredAxioms

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.