Package uk.org.woodcraft.bookings.datamodel

Examples of uk.org.woodcraft.bookings.datamodel.Event


    assertDetached(unapprovedUnits);
  }
 
  @Test
  public void testUnitsHomeless() {
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);   
   
    Collection<Unit> units = CannedQueries.unitsHomeless(event1);
    TestUtils.assertNames(units, "Unit 2", "Unapproved unit for wcf", "Unapproved unit", "Approved unit in other org");
    assertDetached(units);
  }
View Full Code Here


 
  @Test
  public void testBookingsForUnit() {
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Unit unit = CannedQueries.unitByName("Unit 1", org);
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
   
    Collection<Booking> bookings = CannedQueries.bookingsForUnit(unit, event1);
    TestUtils.assertNames(bookings, "Test person", "Test person 2","Person booked after earlybird");
    assertDetached(bookings);
  }
View Full Code Here

  }
 
  @Test
  public void testBookingsForOrg() {
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
   
    Collection<Booking> bookings = CannedQueries.bookingsForOrg(org, event1);
    TestUtils.assertNames(bookings, "Test person", "Test person 2","Person booked after earlybird", "Test person in unit 2", "Second person in unit 2");
    assertDetached(bookings);
  }
View Full Code Here

  }
 
  @Test
  public void testBookingsForLargeOrg() {
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
   
    List<Unit> testUnits = new ArrayList<Unit>(50);
    List<Booking> testBookings = new ArrayList<Booking>(50);
    List<String> testNames = new ArrayList<String>(52);
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
View Full Code Here

    assertDetached(bookings);
  }

  @Test
  public void testBookingsForVillage() {
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);   
    Village village = CannedQueries.villageByName("Village 1", event1);
   
    Collection<Booking> bookings = CannedQueries.bookingsForVillage(village);
   
    // FIXME: The last name shouldn't need to be there, but is due to unit bookings not existing, and so events not partitioning the bookings
View Full Code Here

    assertDetached(bookingsHomeless);
  }
 
  @Test
  public void testBookingsForEvent() {
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);   
 
   
    Collection<Booking> bookings = CannedQueries.bookingsForEvent(event1);
    TestUtils.assertNames(bookings, "Person in unapproved, homeless unit", "Test person", "Test person 2", "Person booked after earlybird", "Person in other org", "Test person in unit 2", "Second person in unit 2");
    assertDetached(bookings);
View Full Code Here

    assertDetached(users);
  }
 
  @Test
  public void testTransactionsForUnit() {
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME)
    Organisation org = CannedQueries.orgByName("Woodcraft Folk")
    Unit unit = CannedQueries.unitByName("Unit 1", org);
   
    Collection<Transaction> transactions = CannedQueries.transactionsForUnit(unit, event1);
    TestUtils.assertNames(transactions, "Payment 1", "Payment 2", "Payment 3", "Refund 1", "Payment after earlybird","Discount for early payment");
View Full Code Here

    TestUtils.assertNames(transactions, "Payment 1", "Payment 2", "Payment 3", "Refund 1", "Payment after earlybird","Discount for early payment");
  }

  @Test
  public void testTransactionsForEvent() {
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME)
   
    Collection<Transaction> transactions = CannedQueries.transactionsForEvent(event1);
    TestUtils.assertNames(transactions, "Payment 1", "Payment 2", "Payment 3","Refund 1", "Payment after earlybird","Discount for early payment", "Unit 2 payment");
  }
View Full Code Here

  }
 
  @Test
  public void testTransactionsForLargeOrg() {
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
   
    List<Unit> testUnits = new ArrayList<Unit>(50);
    List<Transaction> testTransactions = new ArrayList<Transaction>(100);
    List<String> testTransNames = new ArrayList<String>(103);
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
   
    for (int i = 0; i < 50; i++) {
      Unit testUnit = new Unit("Test Unit "+i, org, true);
      testUnits.add(testUnit);
    }
    CannedQueries.save(testUnits);
   
    int transNumber = 0;
    for(Unit unit : testUnits)
    {
      String transName = "Test Trans "+transNumber++;
      testTransactions.add(new Transaction(unit.getKeyCheckNotNull(), event1.getKeyCheckNotNull(), clock.getTime(),
                        TransactionType.Payment,  transName, null, 1.0d));
      testTransNames.add(transName);
    }
    CannedQueries.save(testTransactions);
   
View Full Code Here

  @WebMethod
  public MyVillageResponse myVillageSignup(String eventWebKey, String userEmailString, String userKey,
                        String externalUsername)
  {
    Key eventKey = KeyFactory.stringToKey(eventWebKey);
    Event event = CannedQueries.eventByKey(eventKey);
   
    if (event == null)
      return new MyVillageResponse("Event with key '"+eventWebKey+"' not found");
   
    Email userEmail = new Email(userEmailString);
View Full Code Here

TOP

Related Classes of uk.org.woodcraft.bookings.datamodel.Event

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.