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:com.taobao.ad.jpa.test.DataTrackingLogTest.java

@Test
public void testGetDataTrackingByGroupAndName() {
    DatatrackingLogDO d = new DatatrackingLogDO();
    d.setJobName("dtJustTest");
    d.setJobGroup("110");
    Assert.assertNotNull(dataTrackingLogBO.getDataTrackingByGroupAndName(d));

}

From source file:org.openspaces.itest.esb.mule.config.ConnectorConfigPropertiesFileTests.java

@Test
public void testConnectorConfig() throws Exception {
    ApplicationContext context = muleContext.getRegistry()
            .lookupObject(SpringRegistry.SPRING_APPLICATION_CONTEXT);
    OpenSpacesQueueConnector connector = (OpenSpacesQueueConnector) context.getBean("queueConnector");
    Assert.assertNotNull(connector);
    Assert.assertEquals(Integer.valueOf(100), connector.getBatchSize());
    Assert.assertEquals(60000L, connector.getTimeout());
    Assert.assertTrue(connector.isFifo());
    Assert.assertFalse(connector.isPersistent());
}

From source file:org.openspaces.itest.esb.mule.config.OpenSpacesQueueConnectorConfigTests.java

@Test
public void testBatchSizeConfig() throws Exception {
    ApplicationContext context = muleContext.getRegistry()
            .lookupObject(SpringRegistry.SPRING_APPLICATION_CONTEXT);
    OpenSpacesQueueConnector connector = (OpenSpacesQueueConnector) context.getBean("queueConnector");
    Assert.assertNotNull(connector);
    Assert.assertEquals(Integer.valueOf(10), connector.getBatchSize());
}

From source file:org.codehaus.grepo.query.jpa.generator.GeneratorRepositoryTest.java

@Test
public void testWithJPQLGenerator() {
    Assert.assertNotNull(repo.getWithJPQLGenerator("username"));
}

From source file:fulcrum.xml.ParserTest.java

private static void testFulcrumXml(String fileName) {
    long s = System.currentTimeMillis();
    getStartLine("Fulcrum", fileName);
    fulcrum.xml.Document d = null;
    try {/*from  w  w w  .j av  a 2s.c o  m*/
        d = new fulcrum.xml.Document(fileName);
        Assert.assertNotNull(d);
    } catch (ParseException pe) {
        pe.printStackTrace();
    } finally {
        d = null;
    }
    getEndLine("Fulcrum", fileName, s);
}

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

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

    List<Date> dates = new ArrayList<Date>();
    dates.add(new Date());
    dates.add(new Date());
    dates.add(new Date());

    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final Result result = new StreamResult(out);
    marshaller.marshal(dates, result);/*from  ww  w .j a v  a2 s. c  o m*/
    System.out.println(out.toString("UTF-8"));

}

From source file:com.googlecode.t7mp.steps.resources.CopySetenvScripStepTest.java

@Before
public void setUp() {
    catalinaBaseDir = Files.createTempDir();
    Assert.assertTrue(catalinaBaseDir.exists());
    Assert.assertNotNull(catalinaBaseDir);
    Assert.assertTrue(catalinaBaseDir.exists());

    Mockito.when(mojo.getCatalinaBase()).thenReturn(catalinaBaseDir);
    Mockito.when(mojo.getLog()).thenReturn(log);
}

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

@Test
public void getRoles_shouldReturnAllRoles() throws Exception {

    List<Role> roles = roleService.getRoles();

    Assert.assertNotNull(roles);
    Assert.assertEquals(2, roles.size());
    Assert.assertEquals("Role_Administrator", roles.get(0).getName());
}

From source file:com.chilmers.configbootstrapper.ConfigServletContextListenerTest.java

@Test
public void testDefault() {
    ServletContext contextMock = new MockServletContext();
    ConfigServletContextListener testee = new ConfigServletContextListener();
    testee.contextInitialized(new ServletContextEvent(contextMock));
    Assert.assertEquals("classpath:application.properties", System.getProperty("application.config.location"));
    Assert.assertNotNull(LogManager.exists("com.chilmers.configbootstrapper.test"));
}

From source file:beans.SerializableTest.java

/**
 * Test if @Serializable can apply on transactional proxies
 *///  ww  w. j  a v a 2s .c o  m
@Test
public void testTransactionalProxy() throws IOException {
    System.out.println(sbean.getTransactionalBean().toString());
    byte[] bytes = Serializer.serialize(sbean);
    SerializableBean deserialized = (SerializableBean) Serializer.deSerialize(bytes);
    Assert.assertNotNull(deserialized.getTransactionalBean());
}