2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
6 package com
.smartitengineering
.bookstore
.serviceimplementation
;
8 import com
.smartitengineering
.bookstore
.service
.impl
.PublicationHouseServiceImpl
;
9 import com
.smartitengineering
.bookstore
.domain
.PublicationHouse
;
10 import java
.util
.HashSet
;
11 import java
.util
.LinkedList
;
12 import java
.util
.List
;
14 import junit
.framework
.TestCase
;
20 public class PublicationHouseServiceImplTest
extends TestCase
{
21 private PublicationHouseServiceImpl publicationHouseServiceImpl
= new PublicationHouseServiceImpl();
22 public void testPublicationHouseServiceImpl(){
23 PublicationHouse publicationHouse
= new PublicationHouse();
24 publicationHouse
.setName("Smart Book House");
25 publicationHouse
.setAddress("Mohammadpur");
26 publicationHouse
.setContactEmailAddress("info@smartbookhouse.com");
27 publicationHouse
.setUniqueShortName("smart");
28 publicationHouseServiceImpl
.create(publicationHouse
);
29 Set
<PublicationHouse
> setPublicationHouse
= new HashSet
<PublicationHouse
>();
30 setPublicationHouse
= publicationHouseServiceImpl
.getAllPublicationHouse();
31 System
.out
.println("the number of publication houses in database = " + setPublicationHouse
.size());
32 List
<PublicationHouse
> list
= new LinkedList
<PublicationHouse
>(setPublicationHouse
);
33 System
.out
.println(list
.get(0).getName());
34 System
.out
.println(list
.get(0).getAddress());
35 System
.out
.println(list
.get(0).getContactEmailAddress());
36 System
.out
.println(list
.get(0).getUniqueShortName());