List of usage examples for junit.framework Assert assertNull
static public void assertNull(Object object)
From source file:azkaban.app.AzkabanApplicationTest.java
@Test public void testAddJobAndReload() throws Exception { String testJob = "testjob"; AzkabanApplication app = new AzkabanApplication(Arrays.asList(jobDir), logDir, tmpDir, false); Assert.assertEquals(0, app.getJobManager().loadJobDescriptors().size()); Assert.assertNull(app.getJobManager().getJobDescriptor(testJob)); File newJobDir = new File(jobDir, "test"); FileUtils.forceMkdir(newJobDir);/*ww w .j a v a2 s . com*/ File newJob = new File(newJobDir, testJob + ".job"); FileUtils.writeLines(newJob, Arrays.asList("type=command", "command=ls")); app.reloadJobsFromDisk(); Assert.assertEquals(1, app.getJobManager().loadJobDescriptors().size()); Job loadedJob = app.getJobManager().loadJob(testJob, true); Assert.assertEquals(testJob, loadedJob.getId()); Assert.assertTrue(loadedJob instanceof LoggingJob); Assert.assertTrue(((LoggingJob) loadedJob).getInnerJob() instanceof ProcessJob); }
From source file:de.r2soft.empires.framework.test.ObjectTreeTest.java
@Test public void testDelete() { tree.insert(new Vector2D(20, 20), new Object()); tree.delete(new Vector2D(20, 20)); Object obj = tree.search(new Vector2D(20, 20)); Assert.assertNull(obj); }
From source file:org.jasig.schedassist.impl.oraclecalendar.OracleGUIDSourceImplTest.java
@Test public void testNonexistent() throws Exception { OracleCalendarUserAccount user = new OracleCalendarUserAccount(); user.setUsername("fake"); user.setCtcalxitemid("20000:99999"); String guid = this.oracleGUIDSource.getOracleGUID(user); Assert.assertNull(guid); }
From source file:org.openxdata.server.service.impl.PermissionServiceTest.java
@Test public void savePermission_shouldSavePermission() 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, permissionService.getPermissions().size()); Assert.assertNotNull(permissionService.getPermission(permissionName)); }
From source file:com.hybris.backoffice.cockpitng.dataaccess.facades.DefaultPlatformObjectFacadeStrategyTest.java
@Test public void testLoad() throws ObjectNotFoundException { final ModelService modelService = Mockito.mock(ModelService.class); final UserModel user = new UserModel(); user.setName("Test User"); Mockito.when(modelService.get(PK.parse("1234"))).thenReturn(user); final LabelService labelService = Mockito.mock(LabelService.class); Mockito.when(labelService.getObjectLabel(Mockito.any())).thenReturn(StringUtils.EMPTY); final DefaultPlatformObjectFacadeStrategy strategy = new DefaultPlatformObjectFacadeStrategy(); strategy.setModelService(modelService); strategy.setLabelService(labelService); // Test we get the same user Assert.assertEquals(user, strategy.load("1234", null)); // Test that an unknown pk will return null Assert.assertNull(strategy.load("9999", null)); Assert.assertNull(strategy.load(null, null)); try {/*from w ww. ja va 2 s . c o m*/ strategy.load("", null); Assert.fail("load method should have thrown an exception"); } catch (final ObjectNotFoundException ex) // NOPMD { // expected behavior } }
From source file:com.karriem.tp.tddassignment.TDDTestNGTest.java
@Test public void nullValue() { Assert.assertNull(service.objectNull()); }
From source file:amqp.spring.camel.component.SpringAMQPProducerTest.java
@Test public void sendAsyncCallbackMessage() throws Exception { context().createProducerTemplate().asyncCallbackSendBody("direct:test.w", "HELLO WORLD", new Synchronization() { @Override//from ww w. ja v a 2 s .c o m public void onComplete(Exchange exchange) { Assert.assertNull(exchange.getException()); } @Override public void onFailure(Exchange exchange) { Assert.fail(exchange.getException() != null ? exchange.getException().getMessage() : "Failure on async callback"); } }); }
From source file:com.gisgraphy.helper.StringHelperTest.java
@Test public void normalizeForNullString() { Assert.assertNull(StringHelper.normalize(null)); }
From source file:com.taobao.ad.jpa.test.RepeatAlarmTest.java
@Test public void testDeleteIfNumIsZero_real_delete() { repeatAlarmBO.checkRepeatAlarm(4); RepeatAlarmDO r = repeatAlarmBO.getRepeatAlarmById(4); Assert.assertNull(r); }
From source file:org.openxdata.server.service.impl.UserServiceTest.java
@Test public void saveUser_shouldSaveUser() throws Exception { final String userName = "User Name"; List<User> users = userService.getUsers(); Assert.assertEquals("There are 5 users", 5, users.size()); Assert.assertNull(getUser(userName, users)); User user = new User(userName); user.setCreator(users.get(0));// w w w.ja va2 s.c o m user.setDateCreated(new Date()); userService.saveUser(user); users = userService.getUsers(); Assert.assertEquals("Added 1 user so now there are 6", 6, userService.getUsers().size()); Assert.assertNotNull(getUser(userName, users)); }