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.generator.GeneratorRepositoryTest.java

@Test
public void testWithHQLGeneratorUsingDynParams() {
    Assert.assertNotNull(repo.getWithHQLGeneratorUsingDynParams());
}

From source file:gov.nih.nci.integration.transformer.XSLTTransformerTest.java

/**
 * Before Setup//  www.ja v a 2 s .c  o  m
 * 
 * @throws IntegrationException - IntegrationException
 */
@Before
public void intialize() throws IntegrationException {
    xsltTransformer.initTransformer(catissueParticipantXsl, baseXSLPath);
    Assert.assertNotNull(xsltTransformer);
}

From source file:org.atemsource.atem.impl.pojo.ArrayAttributeFactoryTest.java

@Test
public void testArray() {
    EntityType entityType = entityTypeRepository.getEntityType(EntityA.class);
    CollectionAttribute attribute = (CollectionAttribute) entityType.getAttribute("stringArray");
    Assert.assertNotNull(attribute);
    EntityA a = new EntityA();
    a.setStringArray(new String[] { "halo", "baba" });
    Assert.assertEquals(attribute.getSize(a), 2);
}

From source file:org.atemsource.atem.impl.pojo.PrimitiveAttributeFactoryTest.java

@Test
public void testIntegerProperty() {
    EntityType entityType = entityTypeRepository.getEntityType(EntityB.class);
    SingleAttribute attribute = (SingleAttribute) entityType.getAttribute("integer");
    Assert.assertNotNull(attribute);
    EntityB b = new EntityB();
    attribute.setValue(b, 1);//from ww  w  .  ja va  2s. c  om
    Assert.assertEquals(1, attribute.getValue(b));
}

From source file:org.atemsource.atem.impl.pojo.SingleAssociationAttributeFactoryTest.java

@Test
public void testSingleComposition() {
    EntityType entityType = entityTypeRepository.getEntityType(EntityB.class);
    SingleAssociationAttribute attribute = (SingleAssociationAttribute) entityType.getAttribute("singleA");
    Assert.assertNotNull(attribute);
    EntityA a = (EntityA) attribute.createEntity(attribute.getTargetType().getCode());
    Assert.assertNotNull(a);//from  w  w  w .java  2s.co  m
}

From source file:com.lemi.mario.download.utils.Proxy.java

/**
 * Return the proxy port set by the user.
 * /*  ww w  . j a  v a2  s  .c om*/
 * @param ctx A Context used to get the settings for the proxy port.
 * @return The port number to use or -1 if no proxy is to be used.
 */
static final public int getPort(Context ctx) {
    ContentResolver contentResolver = ctx.getContentResolver();
    Assert.assertNotNull(contentResolver);
    String host = Settings.Secure.getString(contentResolver, Settings.Secure.HTTP_PROXY);
    if (host != null) {
        int i = host.indexOf(':');
        if (i == -1) {
            if (DEBUG) {
                Assert.assertTrue(host.length() == 0);
            }
            return -1;
        }
        if (DEBUG) {
            Assert.assertTrue(i < host.length());
        }
        return Integer.parseInt(host.substring(i + 1));
    }
    return getDefaultPort();
}

From source file:net.bryansaunders.dl2.service.impl.InfoServiceImplIT.java

/**
 * Tests that the Correct Information was Returned from the Information Service.
 *///  w  ww .  j  av a2  s  . c  o  m
@Test
public void ifInformationCorrectThenPass() throws Exception {
    final String json = given().expect().statusCode(HttpStatus.SC_OK).when().get(RestApiTest.URL_ROOT + "/info")
            .asString();

    Assert.assertNotNull(json);

    final ObjectMapper objMapper = new ObjectMapper();
    final Information info = objMapper.readValue(json, new TypeReference<Information>() {
    });
    Assert.assertNotNull(info);

    Assert.assertEquals("DL2", info.getName());
    Assert.assertNotNull(info.getDescription());
    Assert.assertNotNull(info.getVersion());
}

From source file:com.google.api.ads.adwords.awreporting.model.persistence.sql.SqlAuthTokenPersisterTest.java

/**
 * Tests the persistence and retrieval of the token.
 *//*w  w w . j a v a 2s  .  c  om*/
@Test
public void testTokenPersistence() {

    AuthMcc authMcc = new AuthMcc("1234", "Name", "4321", "scope");
    this.authTokenPersister.persistAuthToken(authMcc);

    AuthMcc authToken = this.authTokenPersister.getAuthToken("1234");
    Assert.assertNotNull(authToken);
    Assert.assertEquals("4321", authToken.getAuthToken());

    authToken = this.authTokenPersister.getAuthToken("12345");
    Assert.assertNull(authToken);

    authMcc = new AuthMcc("1234", "Name", "54321", "scope");
    this.authTokenPersister.persistAuthToken(authMcc);

    authToken = this.authTokenPersister.getAuthToken("1234");
    Assert.assertNotNull(authToken);
    Assert.assertEquals("54321", authToken.getAuthToken());
}

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

@Test
public void getTasks_shouldReturnAllTasks() throws Exception {
    List<TaskDef> tasks = tasksService.getTasks();

    Assert.assertNotNull(tasks);
    Assert.assertEquals(3, tasks.size());

    for (TaskDef taskDef : tasks) {
        String name = taskDef.getName();
        Assert.assertTrue(/*  ww  w .  j  av  a2s .  co m*/
                name.equals("Forms Bluetooth") || name.equals("Data Export") || name.equals("Forms SMS"));
    }
}

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

@Test
public void getForms_shouldReturnAllForms() throws Exception {

    List<FormDef> forms = studyManagerService.getForms();

    Assert.assertNotNull(forms);
    Assert.assertEquals("The number of forms is 5", 5, forms.size());
    Assert.assertNotNull(getForm("Sample Form", forms));
}