Package uk.org.woodcraft.bookings.datamodel

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


 
  @Test
  public void testCancellation(){
    CoCampPricingStrategy pricer = new CoCampPricingStrategy();
   
    Event cocamp = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
    Organisation testOrg = CannedQueries.orgByName(TestConstants.ORG1_NAME);
    Unit testUnit = CannedQueries.unitByName(TestConstants.UNIT1_NAME, testOrg);
   
    TestClock testClock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
   
View Full Code Here


 
  public String execute() {
   
    if(eventKey != null && eventKey.length() > 0)
    {
      Event currentEvent = (Event)sessionData.get(SessionConstants.CURRENT_EVENT);
      if (!currentEvent.getWebKey().equals(eventKey))
      {
        Event newEvent = CannedQueries.eventByKey(KeyFactory.stringToKey(eventKey));
        if(newEvent == null)
          throw new IllegalArgumentException("Event matching key "+eventKey+" not found");
       
        // Will throw if not permissioned
        SecurityModel.checkAllowed(Operation.READ, newEvent);
View Full Code Here

  @Test
  public void testRelevantBookings()
  {
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
    Event event = CannedQueries.eventByName( TestConstants.EVENT1_NAME);
    Map<String, Object> session = new HashMap<String, Object>();
    ApplyCoCampDiscountsAction action = createNewAction(clock, event, session);
   
    Organisation testOrg = CannedQueries.orgByName(TestConstants.ORG1_NAME);
    Unit testUnit = CannedQueries.unitByName(TestConstants.UNIT1_NAME, testOrg);
View Full Code Here

  @Test
  public void testRelevantTransactions()
  {
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
    Event event = CannedQueries.eventByName( TestConstants.EVENT1_NAME);
    Map<String, Object> session = new HashMap<String, Object>();
    ApplyCoCampDiscountsAction action = createNewAction(clock, event, session);
   
    Organisation testOrg = CannedQueries.orgByName(TestConstants.ORG1_NAME);
    Unit testUnit = CannedQueries.unitByName(TestConstants.UNIT1_NAME, testOrg);
View Full Code Here

 
  @Test
  public void testGenerateDiscounts()
  {
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
    Event event = CannedQueries.eventByName( TestConstants.EVENT1_NAME);
    Map<String, Object> session = new HashMap<String, Object>();
    ApplyCoCampDiscountsAction action = createNewAction(clock, event, session);
   
    action.generateDiscounts();
   
View Full Code Here

 
  @Test
  public void testConfirmDiscounts()
  {   
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
    Event event = CannedQueries.eventByName( TestConstants.EVENT1_NAME);
    Map<String, Object> session = new HashMap<String, Object>();
    ApplyCoCampDiscountsAction action = createNewAction(clock, event, session);
    action.generateDiscounts();
   
    ApplyCoCampDiscountsAction subsequentAction = createNewAction(clock, event, session);
View Full Code Here

  }

  @Test
  public void testEventByName() {
   
    Event event1 = CannedQueries.eventByName("Test event 1");
   
    assertEquals(TestConstants.EVENT1_NAME, event1.getName());
    assertDetached(event1);
  }
View Full Code Here

  }
 
  @Test
  public void testVillagesForEvent() {
   
    Event event1 = CannedQueries.eventByName("Test event 1");
   
    Collection<Village> villages = CannedQueries.villagesForEvent(event1);
    assertEquals(3, villages.size());
    assertDetached(villages);
  }
View Full Code Here

  }

  @Test
  public void testVillageByName() {
   
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);   
    Village village = CannedQueries.villageByName("Village 1", event1);
    assertEquals("Village 1", village.getName());
    assertDetached(village);
  }
View Full Code Here

  }
 
 
  @Test
  public void testUnitsForVillage() {
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);   
    Village village = CannedQueries.villageByName("Village 1", event1);
   
    Collection<Unit> units = CannedQueries.unitsForVillage(village);
    TestUtils.assertNames(units, "Unit 1");
    assertDetached(units);
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.