public static void baddabt(WorkflowControllerImpl wc) throws RemoteException, TransactionAbortedException, InvalidTransactionException { int xid = wc.start(); boolean returnValue = wc.addFlight(xid, "347", 100, 310); assert returnValue == true; returnValue = wc.addRooms(xid, "Stanford", 200, 150); assert returnValue == true; returnValue = wc.addCars(xid, "SFO", 300, 30); assert returnValue == true; returnValue = wc.newCustomer(xid, "John"); assert returnValue == true; wc.abort(xid); }
public static void Sitiabt(WorkflowControllerImpl wc) throws RemoteException, TransactionAbortedException, InvalidTransactionException { int xid = wc.start(); xid = wc.start(); boolean returnValue = wc.addFlight(xid, "347", 100, 310); assert returnValue == true; returnValue = wc.addFlight(xid, "3471", 1001, 3101); assert returnValue == true; returnValue = wc.addRooms(xid, "Stanford", 200, 150); assert returnValue == true; returnValue = wc.addCars(xid, "SFO", 300, 30); assert returnValue == true; returnValue = wc.newCustomer(xid, "John"); assert returnValue == true; wc.commit(xid); xid = wc.start(); List<String> FlightList = new ArrayList<String>(); FlightList.add("347"); FlightList.add("3471"); returnValue = wc.reserveItinerary(xid, "John", FlightList, "Stanford", false, true); assert returnValue == true; wc.abort(xid); xid = wc.start(); int flight = wc.queryFlight(xid, "347"); assert flight == 100; int flightPrice = wc.queryFlightPrice(xid, "347"); assert flightPrice == 310; flight = wc.queryFlight(xid, "3471"); assert flight == 1001; flightPrice = wc.queryFlightPrice(xid, "3471"); assert flightPrice == 3101; int noofrooms = wc.queryRooms(xid, "Stanford"); assert noofrooms == 200; int roomsPrice = wc.queryRoomsPrice(xid, "Stanford"); assert roomsPrice == 150; int noofcars = wc.queryCars(xid, "SFO"); assert noofcars == 300; int carsprice = wc.queryCarsPrice(xid, "SFO"); assert carsprice == 30; int customerbill = wc.queryCustomerBill(xid, "John"); assert customerbill == 0; }
public static void baddabtrd(WorkflowControllerImpl wc) throws RemoteException, TransactionAbortedException, InvalidTransactionException { int xid = wc.start(); boolean returnValue = wc.addFlight(xid, "347", 100, 310); assert returnValue == true; returnValue = wc.addRooms(xid, "Stanford", 200, 150); assert returnValue == true; returnValue = wc.addCars(xid, "SFO", 300, 30); assert returnValue == true; returnValue = wc.newCustomer(xid, "John"); assert returnValue == true; wc.commit(xid); int xid2 = wc.start(); returnValue = wc.addFlight(xid, "347", 100, 620); assert returnValue == true; returnValue = wc.addRooms(xid, "Stanford", 200, 300); assert returnValue == true; returnValue = wc.addCars(xid, "SFO", 300, 60); assert returnValue == true; wc.abort(xid2); int xid3 = wc.start(); int flight = wc.queryFlight(xid3, "347"); assert flight == 100; int flightPrice = wc.queryFlightPrice(xid3, "347"); assert flightPrice == 310; int rooms = wc.queryRooms(xid3, "SFO"); assert rooms == 200; int roomsPrice = wc.queryRoomsPrice(xid3, "SFO"); assert roomsPrice == 150; int cars = wc.queryCars(xid3, "SFO"); assert cars == 300; int carsprice = wc.queryCarsPrice(xid3, "SFO"); assert carsprice == 30; int customerbill = wc.queryCustomerBill(xid3, "John"); assert customerbill == 0; }
public static void bstabt(WorkflowControllerImpl wc) throws RemoteException, TransactionAbortedException, InvalidTransactionException { int xid = wc.start(); System.out.println(xid); wc.abort(xid); }