private void insertData() { viajero = factory.manufacturePojo(ViajeroEntity.class); em.persist(viajero); for (int i = 0; i < 3; i++) { ItinerarioEntity entity = factory.manufacturePojo(ItinerarioEntity.class); entity.setViajero(viajero); em.persist(entity); data.add(entity); } for (int i = 0; i < 3; i++) { FotoEntity fotos = factory.manufacturePojo(FotoEntity.class); DiaEntity dias = factory.manufacturePojo(DiaEntity.class); fotos.setItinerario(data.get(0)); dias.setItinerario(data.get(0)); em.persist(dias); diaData.add(dias); em.persist(fotos); fotoData.add(fotos); } }
/** @generated */ private void insertData() { for (int i = 0; i < 3; i++) { PodamFactory factory = new PodamFactoryImpl(); AdminEntity entity = AdminConverter.basicDTO2Entity(factory.manufacturePojo(AdminDTO.class)); em.persist(entity); data.add(entity); } }
/** @generated */ private void insertData() { PodamFactory factory = new PodamFactoryImpl(); for (int i = 0; i < 3; i++) { ProjectSponsorEntity entity = factory.manufacturePojo(ProjectSponsorEntity.class); em.persist(entity); data.add(entity); } }
/** @generated */ @Test public void createEspecialidadTest() { PodamFactory factory = new PodamFactoryImpl(); EspecialidadDTO dto = factory.manufacturePojo(EspecialidadDTO.class); EspecialidadDTO result = especialidadLogic.createEspecialidad(dto); Assert.assertNotNull(result); EspecialidadEntity entity = em.find(EspecialidadEntity.class, result.getId()); Assert.assertEquals(dto.getNombre(), entity.getNombre()); Assert.assertEquals(dto.getRequerimientos(), entity.getRequerimientos()); }
/** @generated */ @Test public void createProjectSponsorTest() { PodamFactory factory = new PodamFactoryImpl(); ProjectSponsorEntity newEntity = factory.manufacturePojo(ProjectSponsorEntity.class); ProjectSponsorEntity result = projectSponsorPersistence.create(newEntity); Assert.assertNotNull(result); ProjectSponsorEntity entity = em.find(ProjectSponsorEntity.class, result.getId()); Assert.assertEquals(newEntity.getName(), entity.getName()); Assert.assertEquals(newEntity.getCompany(), entity.getCompany()); Assert.assertEquals(newEntity.getPicture(), entity.getPicture()); }
/** @generated */ @Test public void updateEspecialidadTest() { EspecialidadEntity entity = data.get(0); PodamFactory factory = new PodamFactoryImpl(); EspecialidadDTO dto = factory.manufacturePojo(EspecialidadDTO.class); dto.setId(entity.getId()); especialidadLogic.updateEspecialidad(dto); EspecialidadEntity resp = em.find(EspecialidadEntity.class, entity.getId()); Assert.assertEquals(dto.getNombre(), resp.getNombre()); Assert.assertEquals(dto.getRequerimientos(), resp.getRequerimientos()); }
private void insertData() { for (int i = 0; i < 3; i++) { ViajeroEntity viajeros = factory.manufacturePojo(ViajeroEntity.class); em.persist(viajeros); data.add(viajeros); } for (int i = 0; i < 3; i++) { ViajeEntity viajes = factory.manufacturePojo(ViajeEntity.class); em.persist(viajes); dataViajes.add(viajes); data.get(0).getViajes().add(viajes); } }
@Test public void testOrderSetup() { Order pojo = factory.manufacturePojo(Order.class); validateOrder(pojo); }
/** @generated */ @Test public void updateProjectSponsorTest() { ProjectSponsorEntity entity = data.get(0); PodamFactory factory = new PodamFactoryImpl(); ProjectSponsorEntity newEntity = factory.manufacturePojo(ProjectSponsorEntity.class); newEntity.setId(entity.getId()); projectSponsorPersistence.update(newEntity); ProjectSponsorEntity resp = em.find(ProjectSponsorEntity.class, entity.getId()); Assert.assertEquals(newEntity.getName(), resp.getName()); Assert.assertEquals(newEntity.getCompany(), resp.getCompany()); Assert.assertEquals(newEntity.getPicture(), resp.getPicture()); }
private void insertData() { for (int i = 0; i < 3; i++) { EventoEntity entity = factory.manufacturePojo(EventoEntity.class); em.persist(entity); data.add(entity); } }
@Test public void testAddressSetup() { Address pojo = factory.manufacturePojo(Address.class); validateAddress(pojo); }
@Test public void testOrderItemSetup() { OrderItem pojo = factory.manufacturePojo(OrderItem.class); validateOrderItem(pojo); }
/** @generated */ @Test public void createAdminTest() { PodamFactory factory = new PodamFactoryImpl(); AdminDTO dto = factory.manufacturePojo(AdminDTO.class); AdminDTO result = AdminLogic.createAdmin(dto); Assert.assertNotNull(result); AdminEntity entity = em.find(AdminEntity.class, result.getId()); Assert.assertEquals(dto.getNombre(), entity.getNombre()); Assert.assertEquals(dto.getApellido(), entity.getApellido()); Assert.assertEquals(dto.getTipoC(), entity.getTipoC()); Assert.assertEquals(dto.getNcedula(), entity.getNcedula()); Assert.assertEquals(dto.getGenero(), entity.getGenero()); Assert.assertEquals(dto.getFechaN(), entity.getFechan()); Assert.assertEquals(dto.getImagen(), entity.getImagen()); }
@Test public void addDaysTest() throws BusinessLogicException { ItinerarioEntity entity = data.get(0); DiaEntity diaEntity = factory.manufacturePojo(DiaEntity.class); DiaEntity response = itinerarioLogic.addDay(viajero.getId(), entity.getId(), diaEntity); Assert.assertNotNull(response); Assert.assertEquals(diaEntity.getId(), response.getId()); }
/** @generated */ @Test public void updateAdminTest() { AdminEntity entity = data.get(0); PodamFactory factory = new PodamFactoryImpl(); AdminDTO dto = factory.manufacturePojo(AdminDTO.class); dto.setId(entity.getId()); AdminLogic.updateAdmin(dto); AdminEntity resp = em.find(AdminEntity.class, entity.getId()); Assert.assertEquals(dto.getNombre(), resp.getNombre()); Assert.assertEquals(dto.getApellido(), resp.getApellido()); Assert.assertEquals(dto.getTipoC(), resp.getTipoC()); Assert.assertEquals(dto.getNcedula(), resp.getNcedula()); Assert.assertEquals(dto.getGenero(), resp.getGenero()); Assert.assertEquals(dto.getFechaN(), resp.getFechan()); Assert.assertEquals(dto.getImagen(), resp.getImagen()); }
@Test public void createEventoTest() { EventoEntity newEntity = factory.manufacturePojo(EventoEntity.class); EventoEntity result = eventoPersistence.create(newEntity); Assert.assertNotNull(result); EventoEntity entity = em.find(EventoEntity.class, result.getId()); Assert.assertEquals(newEntity.getName(), entity.getName()); }
@Test public void testClientSetup() { Client pojo = factory.manufacturePojo(Client.class); Assert.assertNotNull("The pojo cannot be null!", pojo); Assert.assertNotNull("The client's first name cannot be null!", pojo.getFirstName()); Assert.assertTrue("The client's first name cannot be empty!", pojo.getFirstName().length() > 0); String expectedFirstName = "Michael"; Assert.assertEquals( "The client's first name is not " + expectedFirstName, expectedFirstName, pojo.getFirstName()); Assert.assertNotNull("The client's last name cannot be null!", pojo.getLastName()); Assert.assertTrue("The client's last name cannot be empty!", pojo.getLastName().length() > 0); Assert.assertNotNull("The date created cannot be null!", pojo.getDateCreated()); List<Order> orders = pojo.getOrders(); Assert.assertNotNull("The orders cannot be null!", orders); int expectedOrdersNbr = 3; Assert.assertTrue( "The expected number of orders is " + expectedOrdersNbr, orders.size() == expectedOrdersNbr); for (Order order : orders) { validateOrder(order); } List<Address> addresses = pojo.getAddresses(); Assert.assertNotNull("The addresses cannot be null!", addresses); int expectedAddressesNbr = 2; Assert.assertTrue( "The expected number of addresses is " + expectedAddressesNbr, addresses.size() == expectedAddressesNbr); for (Address address : addresses) { validateAddress(address); } List<BankAccount> bankAccounts = pojo.getBankAccounts(); Assert.assertNotNull("The bank accounts cannot be null!", bankAccounts); int expectedBankAccountsNbr = strategy.getNumberOfCollectionElements(); Assert.assertTrue( "The expected number of addresses is " + expectedBankAccountsNbr, bankAccounts.size() == expectedBankAccountsNbr); for (BankAccount bankAccount : bankAccounts) { validateBankAccount(bankAccount); } }
@Test public void updateEventoTest() { EventoEntity entity = data.get(0); EventoEntity newEntity = factory.manufacturePojo(EventoEntity.class); newEntity.setId(entity.getId()); eventoPersistence.update(newEntity); EventoEntity resp = em.find(EventoEntity.class, entity.getId()); Assert.assertEquals(newEntity.getName(), resp.getName()); }
@Test public void createItinerarioTest() throws BusinessLogicException { ItinerarioEntity expected = factory.manufacturePojo(ItinerarioEntity.class); ItinerarioEntity created = itinerarioLogic.createItinerario(viajero.getId(), expected); ItinerarioEntity result = em.find(ItinerarioEntity.class, created.getId()); Assert.assertNotNull(result); Assert.assertNotNull(result); Assert.assertEquals(expected.getId(), result.getId()); Assert.assertEquals(expected.getName(), result.getName()); Assert.assertEquals(expected.getFechaInicio(), result.getFechaInicio()); Assert.assertEquals(expected.getFechaFin(), result.getFechaFin()); }
@Test public void updateItinerarioTest() throws BusinessLogicException { ItinerarioEntity entity = data.get(0); ItinerarioEntity expected = factory.manufacturePojo(ItinerarioEntity.class); expected.setId(entity.getId()); itinerarioLogic.updateItinerario(viajero.getId(), expected); ItinerarioEntity resp = em.find(ItinerarioEntity.class, entity.getId()); Assert.assertNotNull(expected); Assert.assertEquals(expected.getId(), resp.getId()); Assert.assertEquals(expected.getName(), resp.getName()); Assert.assertEquals(expected.getFechaInicio(), resp.getFechaInicio()); Assert.assertEquals(expected.getFechaFin(), resp.getFechaFin()); }
@Test public void testBankAccountSetup() { BankAccount pojo = factory.manufacturePojo(BankAccount.class); validateBankAccount(pojo); }
@Test public void testArticleSetup() { Article pojo = factory.manufacturePojo(Article.class); validateArticle(pojo); }
@Test public void testCountrySetup() { Country pojo = factory.manufacturePojo(Country.class); validateCountry(pojo); }
private PurchaseEntity createTestObject() { PodamFactory factory = new PodamFactoryImpl(); PurchaseEntity testObject = factory.manufacturePojo(PurchaseEntity.class); return testObject; }