Example usage for junit.framework Assert assertNotNull

List of usage examples for junit.framework Assert assertNotNull

Introduction

In this page you can find the example usage for junit.framework Assert assertNotNull.

Prototype

static public void assertNotNull(Object object) 

Source Link

Document

Asserts that an object isn't null.

Usage

From source file:org.openxdata.server.service.impl.LocaleServiceTest.java

@Test
public void getForms_shouldReturnAllForms() throws Exception {
    List<Locale> locales = localeService.getLocales();

    Assert.assertNotNull(locales);
    Assert.assertEquals(1, locales.size());
    Assert.assertEquals("English", locales.get(0).getName());
}

From source file:org.openxdata.server.service.impl.StudyManagerServiceTest.java

@Test
public void getStudies_shouldReturnAllStudies() throws Exception {
    List<StudyDef> studies = studyManagerService.getStudies();

    Assert.assertNotNull(studies);
    Assert.assertEquals("There are 4 studies", 4, studies.size());
    Assert.assertNotNull(getStudy("Sample Study", studies));
}

From source file:com.cloudant.sync.datastore.BasicDBBodyTest.java

@Test(expected = IllegalArgumentException.class)
public void constructor_invalidInput_objectWithEmptyJsonShouldBeCreated() {
    DocumentBody body = new BasicDocumentBody("[]".getBytes());
    Assert.assertTrue(Arrays.equals("{}".getBytes(), body.asBytes()));
    Assert.assertNotNull(body.asMap());
    Assert.assertTrue(body.asMap().size() == 0);
}

From source file:org.codehaus.grepo.statistics.service.MethodStatisticsAspectTest.java

@Test
public void testInvocations() {
    testInterface.statsMethod1(216L);/* w w w  .j a v  a2 s  .  c o  m*/
    testInterface.statsMethod1(430L);
    testInterface.statsMethod1(10L);

    Assert.assertEquals(1, collection.size());

    StatisticsCollectionEntry entry = collection.get(TestStatisticsInterface.class.getName() + ".statsMethod1");
    Assert.assertNotNull(entry);
    Assert.assertEquals(3, entry.getRecentStatisticsEntriesReadOnly().size());

    for (StatisticsEntry e : entry.getRecentStatisticsEntriesReadOnly()) {
        logger.info(e.toString());
    }
}

From source file:org.openxdata.server.service.impl.MobileMenuTextServiceTest.java

@Test
public void getMobileMenuText_shouldReturnAllMobileMenuText() throws Exception {

    List<MobileMenuText> textList = utilityService.getMobileMenuText("en");

    Assert.assertNotNull(textList);
    Assert.assertEquals(1, textList.size());
    Assert.assertEquals("Login", textList.get(0).getMenuText());
}

From source file:org.web4thejob.orm.DataReaderServiceTest.java

@Test
public void findFirstByQuery() {
    final Master1 master1 = ContextUtil.getDRS().get(Master1.class, Long.valueOf(iterations));
    Assert.assertNotNull(master1);

    final Query query = ContextUtil.getEntityFactory().buildQuery(Master1.class);
    query.addOrderBy(new Path(ContextUtil.getMRS().getEntityMetadata(Master1.class).getIdentifierName()), true);

    Assert.assertEquals(master1, ContextUtil.getDRS().findFirstByQuery(query));
}

From source file:org.openxdata.server.service.impl.UserServiceTest.java

@Test
public void getUsers_shouldReturnAllUsers() throws Exception {

    List<User> users = userService.getUsers();

    Assert.assertNotNull(users);
    Assert.assertEquals("There are 5 users", 5, users.size());
}

From source file:com.ancientprogramming.fixedformat4j.format.impl.TestNullableFixedFormatManagerImpl.java

public void testLoadNullableRecord() {
    MyNullableRecord loadedRecord = manager.load(MyNullableRecord.class, MY_NULLABLE_RECORD_DATA);
    Assert.assertNotNull(loadedRecord);
    Assert.assertEquals(null, loadedRecord.getStringData());
    Assert.assertTrue(loadedRecord.isBooleanData());
}

From source file:org.jrecruiter.service.JobServiceTest.java

@Test
public void testDeleteJobForIdTest() throws Exception {
    final Job job = this.getJob();

    User user = this.getUser();
    User savedUser = userDao.save(user);
    job.setUser(savedUser);/*from   ww w. j  av a 2  s.  c o m*/
    Job savedJob = jobService.addJob(job);

    Job job2 = jobService.getJobForId(savedJob.getId());
    Assert.assertNotNull(job2);
    jobService.deleteJobForId(job2.getId());

    Assert.assertNull(jobService.getJobForId(savedJob.getId()));
}

From source file:com.tamnd.app.jpa.AccountJPATest.java

@Test
@Transactional
public void testFind() {
    Assert.assertNotNull(repo.findAccount(account.getUserId()));
    Assert.assertTrue(repo.findAccount(account.getUserId()).getUserRole().size() > 0);
}