Ejemplo n.º 1
0
  @Override
  public boolean isLoggable(LogRecord record) {
    Object o = record.getParameters()[0];

    if (o instanceof Car) {
      Car tmpCar = (Car) o;
      if (className == "Car" && tmpCar.getId() == id) return true;
    } else if (o instanceof Pump) {
      Pump tmpPump = (Pump) o;
      if (className == "Pump" && tmpPump.getId() == id) return true;
    } else if (o instanceof Cashier) {
      Cashier tmpCashier = (Cashier) o;
      if (className == "Cashier" && tmpCashier.getId() == id) return true;
    } else if (o instanceof CoffeeHouse) {
      if (className == "CoffeeHouse" && id == 1) return true;
    } else if (o == null) {
      return true;
    }

    return false;
  }
Ejemplo n.º 2
0
 @Test
 public void testTransactionPropagation() {
   cashier.checkout("AA", Arrays.asList("1001", "1002"));
 }