Dashboard > GreenPepper Demo > Home > PhoneBook
  GreenPepper Demo Log In View a printable version of the current page.  
  PhoneBook
Added by admin, last edited by Francois Denommee on Mar 17, 2009  (view change)
Labels: 
(None)

Begin Info
End Info
Begin Info

The PhoneBookSystemUnderDevelopment is a Fixture Factory that take care of :

  • Importing the com.greenpepper.confluence.demo.phonebook Java package. This way, no need to use the Import Table or the Import Macro on every specification
  • Registering the custom converter PhoneBookEntryTypeConverter. This way, no need to modify our domain object with the 'Self Conversion' methods parse or toString.
  • Manage our instance of the PhoneBookFixture to make sure the instance of PhoneBook is the same for all interpreters. This is really optional but provide a way to use the same instance (singleton) of the PhoneBook that contains a list of contact. A better approach would be to use Spring or Guice.
End Info

Setup Example

The contact column string value will be converted automagically to a PhoneBookEntry using our custom converter PhoneBookEntryTypeConverter.

setup phone book
contact
Fred, Flintstone, (123) 456-7890
Barney, Rubble, (123) 321-7666
Great, Gazoo, (123) 989-4455

List Of Example

We list all PhoneBookEntry found in the PhoneBook in the same order as it was added to the list.

list of phone book
First Name Last Name Number
Fred Flintstone (123) 456-7890
Barney Rubble (123) 321-7666
Great Gazoo (123) 989-4455

Do With Example

do with phone book

We verify the contact information of Fred Flintstone.

check that number of Fred   Flintstone is (123) 456-7890

We update the phone number of Fred Flintstone.

accept update number of Fred   Flintstone to (123) 567-8904

We verify that the update of the phone number of Fred Flintstone is correct.

check that number of Fred   Flintstone is (123) 567-8904

We verify that Wilma Flinstone is not already in the list of contact.

check that number of Wilma   Flintstone is nothing

We try to update the contact Wilma Flintstone that do not exist (the check confirms that Wilma Flintstone in not in the list).

reject update number of Wilma   Flintstone to (123) 567-8904

We inserts Wilma Flintstone in the list.

insert Wilma   Flintstone with number (123) 567-8904
end

Subset Of Example

We confirm using the subset of interpreter that Wilma Flintstone now belong to our list of contact.

subset of phone book entries
First Name Last Name Number
Wilma Flintstone (123) 567-8904

Source Code

Begin Info

PhoneBook.java


PhoneBookSystemUnderDevelopment.java
PhoneBookEntry.java
PhoneBookEntryTypeConverter.java
PhoneBookFixture.java

End Info
PhoneBook.java (GreenPepper Demo)
PhoneBookEntry.java (GreenPepper Demo)
PhoneBookEntryTypeConverter.java (GreenPepper Demo)
PhoneBookFixture.java (GreenPepper Demo)
PhoneBookSystemUnderDevelopment.java (GreenPepper Demo)

DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators