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.codehaus.grepo.query.hibernate.repository.HibernateRepositoryTest.java

@Test
public void testWithSpecifiedQueryName() {
    Assert.assertNotNull(repo.getByUsernameWithSpecifiedQueryName("username"));
}

From source file:com.couchbase.lite.BlobStoreTest.java

private void verifyRawBlob(BlobKey key, byte[] clearText) throws IOException {
    String path = store.getRawPathForKey(key);
    byte[] raw;//from   ww w.j a  va 2  s.  co  m
    InputStream is = new FileInputStream(path);
    try {
        raw = TextUtils.read(is);
    } finally {
        is.close();
    }
    Assert.assertNotNull(raw);
    if (store.getEncryptionKey() == null) {
        Assert.assertTrue(Arrays.equals(raw, clearText));
    } else {
        Assert.assertTrue(!Arrays.equals(raw, clearText));
    }
}

From source file:com.kmaismith.chunkclaim.Data.DataManagerTest.java

@Test
public void testDataManagerFindsAllRegisteredChunksWhenInitialized() {
    Location location = helpers.newLocation("world", 123, 321);

    ChunkData chunkIWant = helpers.newChunkData("player", new ArrayList<String>(), location);

    systemUnderTest.addChunk(chunkIWant);

    systemUnderTest = new DataManager(logger);

    Assert.assertNotNull(systemUnderTest.getChunkAt(location));
}

From source file:ejportal.webapp.action.ExemplarActionTest.java

/**
 * Test edit.// w  w w.  j ava  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:org.web4thejob.orm.TypeSerailizationTest.java

@Test
public void marshallingTest() throws XmlMappingException, IOException {
    final Marshaller marshaller = ContextUtil.getBean(Marshaller.class);
    Assert.assertNotNull(marshaller);

    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final Result result = new StreamResult(out);
    final Detail detail1 = ContextUtil.getDRS().getOne(Detail.class);
    marshaller.marshal(detail1, result);

    final Unmarshaller unmarshaller = ContextUtil.getBean(Unmarshaller.class);
    final Detail detail2 = (Detail) unmarshaller
            .unmarshal(new StreamSource(new ByteArrayInputStream(out.toByteArray())));

    Assert.assertEquals(detail1, detail2);
}

From source file:org.jboss.spring3_2.example.ControllerAdvice.test.MemberDaoTest.java

@Test
public void testRegister() {
    Member member = new Member();
    member.setEmail("jane.doe@mailinator.com");
    member.setName("Jane Doe");
    member.setPhoneNumber("2125552121");
    member.setDate(new Date());

    memberDao.register(member);//from w  w  w . ja va 2  s  .  c  o  m
    Long id = member.getId();
    Assert.assertNotNull(id);

    Assert.assertEquals(2, memberDao.findAllOrderedByName().size());
    Member newMember = memberDao.findById(id);

    Assert.assertEquals("Jane Doe", newMember.getName());
    Assert.assertEquals("jane.doe@mailinator.com", newMember.getEmail());
    Assert.assertEquals("2125552121", newMember.getPhoneNumber());
    return;
}

From source file:fi.vm.sade.organisaatio.business.impl.OrganisaatioBusinessServiceImplTest.java

@Test
public void processOrganisaatioSuhdeChangesNoNewChanges() {
    List<Organisaatio> results = service.processNewOrganisaatioSuhdeChanges();
    Assert.assertNotNull(results);
    Assert.assertTrue("Results should be empty!", results.isEmpty());
}

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

@Test
public void deleteTask_shouldDeleteGivenTask() throws Exception {

    final String taskName = "Forms Bluetooth";

    List<TaskDef> tasks = tasksService.getTasks();
    Assert.assertEquals(3, tasks.size());

    TaskDef taskDef = tasksService.getTask(taskName);
    Assert.assertNotNull(taskDef);

    tasksService.deleteTask(taskDef);//from  w  w w.ja v  a2  s. c om

    tasks = tasksService.getTasks();
    Assert.assertEquals(2, tasks.size());
    Assert.assertNull(tasksService.getTask(taskName));
}

From source file:ejportal.webapp.action.BestellerActionTest.java

/**
 * Test edit./*w ww . j ava2s  .com*/
 * 
 * @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:de.hybris.platform.integration.cis.tax.strategies.impl.DefaultCisCalculateExternalTaxesFallbackStrategyTest.java

@Test
public void shouldCalculateTaxesWithFallback() {

    final ExternalTaxDocument taxDocument = defaultCisCalculateExternalTaxesFallbackStrategy
            .calculateExternalTaxes(abstractOrder);
    Assert.assertNotNull(taxDocument);
    Assert.assertTrue(taxDocument.getAllTaxes().size() > 0);
    Assert.assertTrue(taxDocument.getShippingCostTaxes().size() > 0);

}