Refactor service implementation
[smart-bookstore.git] / ServiceImplementation / src / test / java / com / smartitengineering / bookstore / serviceimplementation / PublicationHouseServiceImplTest.java
blob83b31816c41ed02b21a495a1f19a489a818fc8c0
1 /*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
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;
13 import java.util.Set;
14 import junit.framework.TestCase;
16 /**
18 * @author modhu7
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());