List of usage examples for junit.framework Assert assertNull
static public void assertNull(Object object)
From source file:org.openxdata.server.service.impl.SettingServiceTest.java
@Test public void saveSettingGroup_shouldSaveSettingGroup() throws Exception { Assert.assertNull(getSettingGroup("Name")); settingService.saveSettingGroup(new SettingGroup("Name")); Assert.assertNotNull(getSettingGroup("Name")); }
From source file:ejportal.webapp.action.JournalkostenActionTest.java
/** * Test edit./*from w w w . ja v a 2s . co m*/ * * @throws Exception * the exception */ public void testEdit() throws Exception { this.log.debug("testing edit..."); this.action.setJournalkostenId(1L); this.action.setJournalId(1L); Assert.assertNull(this.action.getJournalkosten()); Assert.assertEquals("edit", this.action.edit()); Assert.assertNotNull(this.action.getJournalkosten()); Assert.assertFalse(this.action.hasActionErrors()); }
From source file:org.openxdata.server.service.impl.PermissionServiceTest.java
@Test public void deletePermission_shouldDeleteGivenPermission() throws Exception { final String permissionName = "Permission Name"; List<Permission> permissions = permissionService.getPermissions(); Assert.assertEquals(75, permissions.size()); Assert.assertNull(permissionService.getPermission(permissionName)); permissionService.savePermission(new Permission(permissionName)); permissions = permissionService.getPermissions(); Assert.assertEquals(76, permissions.size()); Permission permission = permissionService.getPermission(permissionName); Assert.assertNotNull(permission);/* w w w . ja v a2s .co m*/ permissionService.deletePermission(permission); permissions = permissionService.getPermissions(); Assert.assertEquals(75, permissions.size()); Assert.assertNull(permissionService.getPermission(permissionName)); }
From source file:alpha.portal.webapp.filter.LocaleFilterTest.java
/** * Test set locale in session when session is null. * /* w w w.ja v a 2 s . com*/ * @throws Exception * the exception */ public void testSetLocaleInSessionWhenSessionIsNull() throws Exception { final MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("locale", "es"); final MockHttpServletResponse response = new MockHttpServletResponse(); this.filter.doFilter(request, response, new MockFilterChain()); // no session, should result in null Assert.assertNull(request.getSession().getAttribute(Constants.PREFERRED_LOCALE_KEY)); // thread locale should always have it, regardless of session Assert.assertNotNull(LocaleContextHolder.getLocale()); }
From source file:ejportal.webapp.action.InteresseActionTest.java
/** * Test edit.//from ww w.j av a2 s . c o m * * @throws Exception * the exception */ public void testEdit() throws Exception { this.log.debug("testing edit..."); this.action.setInteresseId(1L); Assert.assertNull(this.action.getInteresse()); Assert.assertEquals("edit", this.action.edit()); Assert.assertNotNull(this.action.getInteresseBaseTO()); Assert.assertFalse(this.action.hasActionErrors()); }
From source file:ejportal.webapp.action.RechnungActionTest.java
/** * Test edit./*from w w w. java 2 s . c o m*/ * * @throws Exception * the exception */ public void testEdit() throws Exception { this.log.debug("testing edit..."); this.action.setRechnungId(1L); Assert.assertNull(this.action.getRechnung()); Assert.assertEquals("edit", this.action.edit()); Assert.assertNotNull(this.action.getRechnungBaseTO()); Assert.assertFalse(this.action.hasActionErrors()); }
From source file:philaman.cput.cardealer.test.repository.MechanicRepositoryTest.java
@Test(dependsOnMethods = "updateMechanic") public void deleteMechanic() { repo = ctx.getBean(MechanicRepository.class); Mechanic mechanic = repo.findOne(id); repo.delete(mechanic);/*from w ww .j av a 2s .c o m*/ Mechanic deleteMechanic = repo.findOne(id); Assert.assertNull(deleteMechanic); }
From source file:ejportal.webapp.action.ExemplarActionTest.java
/** * Test edit.//w w w . j a v a 2 s.c om * * @throws Exception * the exception */ public void testEdit() throws Exception { this.log.debug("testing edit..."); this.action.setExemplarId(1L); Assert.assertNull(this.action.getExemplar()); Assert.assertEquals("edit", this.action.edit()); Assert.assertNotNull(this.action.getExemplarBaseTO()); Assert.assertFalse(this.action.hasActionErrors()); }
From source file:ejportal.webapp.action.BestellerActionTest.java
/** * Test edit./*ww w . j a v a 2s . c o m*/ * * @throws Exception * the exception */ public void testEdit() throws Exception { this.log.debug("testing edit..."); this.action.setBestellerId(1L); Assert.assertNull(this.action.getBesteller()); Assert.assertEquals("edit", this.action.edit()); Assert.assertNotNull(this.action.getBestellerBaseTO()); Assert.assertFalse(this.action.hasActionErrors()); }
From source file:org.openmrs.module.webservices.rest19ext.web.v1_0.controller.ProviderAttributeControllerTest.java
@Test public void shouldGetAProviderAttribute() throws Exception { Object result = controller.retrieve(Rest19ExtTestConstants.PROVIDER_UUID, Rest19ExtTestConstants.PROVIDER_ATTRIBUTE_UUID, request); String rfc822Timezone = new SimpleDateFormat("Z").format(new Date()); Assert.assertNotNull(result);// w w w . j a v a 2 s. c o m Assert.assertEquals(Rest19ExtTestConstants.PROVIDER_ATTRIBUTE_UUID, PropertyUtils.getProperty(result, "uuid")); Assert.assertEquals("2011-04-25T00:00:00.000" + rfc822Timezone, PropertyUtils.getProperty(result, "value")); Assert.assertNull(PropertyUtils.getProperty(result, "auditInfo")); }