com.stratelia.webactiv.almanach.control
Class DisplayableEventOccurrenceTest

java.lang.Object
  extended by com.stratelia.webactiv.almanach.control.DisplayableEventOccurrenceTest

public class DisplayableEventOccurrenceTest
extends Object

Unit tests on the EventOccurrenceDTO. The tests are on the JSON encoding of the DTO.


Constructor Summary
DisplayableEventOccurrenceTest()
           
 
Method Summary
protected  void assertJSONEventMatchesEventDTO(DisplayableEventOccurrence occurrence, org.json.JSONObject jsonObject)
          Asserts the specified JSON object matches the specified event DTO.
 void emptyTest()
          For checking all is ok by default.
protected  DisplayableEventOccurrence getADisplaybleEventOccurrenceOf(EventDetail event)
           
protected  EventDetail getEventDetail()
          Gets the detail on an event.
 void setUp()
           
static void setUpClass()
           
 void tearDown()
           
static void tearDownClass()
           
 void testJSONRepresentationOfAListOfEvents()
          Check the JSON representation of a list of events is the expected one.
 void testJSONRepresentationOfAnEvent()
          Check the JSON representation of a given event is the expected one.
 void theCSSClassOfAnEventShouldBeTheAlmanachId()
          The CSS class of an event DTO should be the identifier of the almanach instance it belongs to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayableEventOccurrenceTest

public DisplayableEventOccurrenceTest()
Method Detail

setUpClass

public static void setUpClass()
                       throws Exception
Throws:
Exception

tearDownClass

public static void tearDownClass()
                          throws Exception
Throws:
Exception

setUp

public void setUp()

tearDown

public void tearDown()

emptyTest

public void emptyTest()
For checking all is ok by default.


theCSSClassOfAnEventShouldBeTheAlmanachId

public void theCSSClassOfAnEventShouldBeTheAlmanachId()
The CSS class of an event DTO should be the identifier of the almanach instance it belongs to.


testJSONRepresentationOfAnEvent

public void testJSONRepresentationOfAnEvent()
                                     throws Exception
Check the JSON representation of a given event is the expected one.

Throws:
Exception - if an error occurs during the test execution.

testJSONRepresentationOfAListOfEvents

public void testJSONRepresentationOfAListOfEvents()
                                           throws Exception
Check the JSON representation of a list of events is the expected one.

Throws:
Exception - if an error occurs during the test execution.

getEventDetail

protected EventDetail getEventDetail()
Gets the detail on an event.

Returns:
an event detail for testing pupose.

getADisplaybleEventOccurrenceOf

protected DisplayableEventOccurrence getADisplaybleEventOccurrenceOf(EventDetail event)

assertJSONEventMatchesEventDTO

protected void assertJSONEventMatchesEventDTO(DisplayableEventOccurrence occurrence,
                                              org.json.JSONObject jsonObject)
Asserts the specified JSON object matches the specified event DTO.

Parameters:
occurrence - the expected object to match.
jsonObject - the actual JSON object.


Copyright © 2016 Silverpeas. All Rights Reserved.