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:at.tugraz.ist.akm.test.webservice.handler.FileRequestHandlerTest.java

protected void setUp() throws Exception {
    registry = new HttpRequestHandlerRegistry();

    String xmlConfig = buildConfig();
    XmlReader reader = new XmlReader(xmlConfig);
    List<XmlNode> nodesList = reader.getNodes(WebServerConstants.XML.TAG_REQUEST_HANDLER);

    Assert.assertNotNull(nodesList);
    Assert.assertEquals(1, nodesList.size());

    testInstance = new FileRequestProcessor(getInstrumentation().getContext(), nodesList.get(0), registry);
}

From source file:com.streamreduce.datasource.BootstrapDatabaseDataPopulatorITCase.java

/**
 * Make sure the proper accounts and users have been bootstrapped.
 *
 * @throws Exception if anything goes wrong
 *//*w  w  w  .j av  a  2 s.c  o m*/
@Test
@Ignore
public void testAccountsAndUsersCreatedProperly() throws Exception {
    Assert.assertNotNull(rootAccount);
    Assert.assertNotNull(integrationsAccount);

    User rootUser = null;

    for (User user : userService.allUsersForAccount(rootAccount)) {
        if (user.getUsername().equals(Constants.NODEABLE_SUPER_USERNAME)) {
            rootUser = user;
        }
        if (rootUser != null) {
            break;
        }
    }

    Assert.assertNotNull(rootUser);
}

From source file:io.cloudslang.lang.runtime.navigations.NavigationsTest.java

@Test
public void errorNavigationTest() throws Exception {

    RunEnvironment runEnv = new RunEnvironment();
    Long nextStepId = 2L;//from   w w w  .j  av  a2s  .  c  o  m
    runEnv.putNextStepPosition(nextStepId);
    ExecutionRuntimeServices runtimeServices = new ExecutionRuntimeServices();
    runtimeServices.setStepErrorKey("Error");
    try {
        Long nextPosition = navigations.navigate(runEnv, runtimeServices);

    } catch (RuntimeException e) {
        Collection<ScoreEvent> events = runtimeServices.getEvents();

        Assert.assertFalse(events.isEmpty());
        ScoreEvent stepErrorEvent = null;
        for (ScoreEvent event : events) {
            if (event.getEventType().equals(ScoreLangConstants.SLANG_EXECUTION_EXCEPTION)) {
                stepErrorEvent = event;
            }
        }
        Assert.assertNotNull(stepErrorEvent);
    }

}

From source file:de.hybris.platform.b2b.services.impl.B2BCostCenterServiceTest.java

@Test
public void testFindCostCenters() throws Exception {
    final String userId = "IC CEO";
    final B2BCustomerModel customer = login(userId);
    final List<B2BCostCenterModel> costCenters = b2bCostCenterService.getCostCentersForUnitBranch(customer,
            commonI18NService.getCurrentCurrency());
    Assert.assertNotNull(costCenters);
    Assert.assertTrue(CollectionUtils.isNotEmpty(costCenters));
}

From source file:com.platform.middlewares.HTTPIndexMiddleware.java

@Override
public boolean handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request,
        HttpServletResponse response) {/*from   w w w  .  ja  v a  2 s  . c o m*/
    Log.i(TAG, "handling: " + target + " " + baseRequest.getMethod());
    String indexFile = MainActivity.app.getFilesDir() + "/" + BUNDLES + "/" + extractedFolder + "/index.html";

    File temp = new File(indexFile);
    if (!temp.exists()) {
        Log.e(TAG, "handle: FILE DOES NOT EXIST: " + temp.getAbsolutePath());
        return false;
    }

    try {
        byte[] body = FileUtils.readFileToByteArray(temp);
        Assert.assertNotNull(body);
        Assert.assertNotSame(body.length, 0);
        response.setHeader("Content-Length", String.valueOf(body.length));
        return BRHTTPHelper.handleSuccess(200, body, baseRequest, response, "text/html;charset=utf-8");
    } catch (IOException e) {
        e.printStackTrace();
        Log.d(TAG, "handle: error sending response: " + target + " " + baseRequest.getMethod());
        return BRHTTPHelper.handleError(500, null, baseRequest, response);
    }

}

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

/**
 * Test case for transforming Interim XML to XMLString
 * /*from   w w w.  j  a v  a 2s .  c  o m*/
 * @throws IntegrationException - IntegrationException
 */
// @Test
public void transformInterimToXMLStringTest() throws IntegrationException {
    xsltTransformer.initTransformer(catissueParticipantXsl, baseXSLPath);

    final String trnsfrmdMsg = transformToParticipantXML(getParticipantInterimXML());
    Assert.assertNotNull(trnsfrmdMsg);
}

From source file:org.codehaus.grepo.query.hibernate.repository.HibernateRepositoryTest.java

@Test
public void testWithNamedNativeQueryUsingNamedParams() {
    Assert.assertNotNull(repo.getByUsernameWithNamedNativeQueryUsingNamedParams("username"));
}

From source file:org.openmrs.module.webservices.rest.web.v1_0.controller.PersonNameControllerTest.java

@Test
public void shouldListNamesForPerson() throws Exception {
    SimpleObject result = controller.getAll(personUuid, request, response);
    Assert.assertNotNull(result);
    Assert.assertEquals(1, Util.getResultsSize(result));
}

From source file:org.openmrs.module.webservices.rest.web.v1_0.controller.ConceptDescriptionControllerTest.java

/**
 * @See {@link ConceptDescriptionResource#getByUniqueId(String)}
 * @throws Exception//from   w  w  w . jav  a  2  s  . com
 */
@Test
public void shouldGetAConceptDescriptionWhenRepresentationIsSetToRef() throws Exception {
    request.addParameter(RestConstants.REQUEST_PROPERTY_FOR_REPRESENTATION, RestConstants.REPRESENTATION_REF);
    Object result = controller.retrieve(conceptUuid, descriptionUuid, request);
    Assert.assertNotNull(result);
    Assert.assertNotNull(PropertyUtils.getProperty(result, "uuid"));
    Assert.assertEquals("Affirmative", PropertyUtils.getProperty(result, "display"));
}

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

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

    List<Entity> entities = new ArrayList<Entity>();
    for (Entity entity : ContextUtil.getDRS().getAll(Reference1.class)) {
        entities.add(entity);//from w  ww.  j  av  a  2  s .  c  o m
    }

    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final Result result = new StreamResult(out);
    marshaller.marshal(entities, result);
    System.out.println(out.toString("UTF-8"));

}