Example usage for junit.framework Assert assertNull

List of usage examples for junit.framework Assert assertNull

Introduction

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

Prototype

static public void assertNull(Object object) 

Source Link

Document

Asserts that an object is null.

Usage

From source file:com.connectsdk.service.sessions.WebOSWebAppSessionTest.java

@Test
public void testNext() throws JSONException {
    ResponseListener<Object> listener = Mockito.mock(ResponseListener.class);
    session.next(listener);//ww  w .j a  v  a2  s  .  c  o  m

    Robolectric.runUiThreadTasksIncludingDelayedTasks();
    ArgumentCaptor<JSONObject> argPacket = ArgumentCaptor.forClass(JSONObject.class);
    ArgumentCaptor<JSONObject> argPayload = ArgumentCaptor.forClass(JSONObject.class);
    Mockito.verify(socket).sendMessage(argPacket.capture(), argPayload.capture());
    Mockito.verify(listener).onSuccess(null);

    JSONObject packet = argPacket.getValue();
    JSONObject payload = argPayload.getValue();
    Assert.assertNull(payload);
    Assert.assertTrue(packet.has("payload"));
    Assert.assertEquals("playNext",
            packet.getJSONObject("payload").getJSONObject("mediaCommand").getString("type"));
    Assert.assertEquals("connectsdk.mediaCommand", packet.getJSONObject("payload").getString("contentType"));
}

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

@Test
public void shouldGetDrugOrderAsRef() throws Exception {
    request.setParameter(RestConstants.REQUEST_PROPERTY_FOR_REPRESENTATION,
            Representation.REF.getRepresentation());
    Object o = controller.retrieve(DRUG_ORDER_UUID, request);
    Assert.assertEquals(DRUG_ORDER_UUID, PropertyUtils.getProperty(o, "uuid"));
    Assert.assertNotNull(PropertyUtils.getProperty(o, "display"));
    Assert.assertNull(PropertyUtils.getProperty(o, "concept"));
}

From source file:org.openscore.lang.compiler.modeller.transformers.ResultsTransformerTest.java

@Test
public void testNoExpressionResult() throws Exception {
    List<Result> results = resultsTransformer.transform(resultsMapOpWithData);
    Result result = results.get(2);
    Assert.assertEquals(ScoreLangConstants.FAILURE_RESULT, result.getName());
    Assert.assertNull(result.getExpression());
}

From source file:cz.fi.muni.pa165.dao.AlbumDaoImplementationTest.java

@Test
public void deleteAlbum() {
    albumDao.create(albumOne);//from www  .  j a v  a 2s.  c  om
    Assert.assertEquals(albumOne, albumDao.findById(albumOne.getId()));
    Assert.assertEquals(1, albumDao.findAll().size());

    albumDao.delete(albumOne);
    Assert.assertNull(albumDao.findById(albumOne.getId()));
    Assert.assertEquals(0, albumDao.findAll().size());
}

From source file:com.ibm.mobilefirstplatform.clientsdk.android.security.mca.internal.security.AuthorizationPreferencesTests.java

public void testTokenSavingWithNeverPolicy() throws Exception {

    preferences.persistencePolicy.set(MCAAuthorizationManager.PersistencePolicy.NEVER);

    preferences.accessToken.set(SAVE_STRING);
    preferences.idToken.set(SAVE_STRING);

    //check that the values are set in runtime
    Assert.assertEquals(SAVE_STRING, preferences.accessToken.get());
    Assert.assertEquals(SAVE_STRING, preferences.idToken.get());

    AuthorizationManagerPreferences preferences5 = new AuthorizationManagerPreferences(
            getInstrumentation().getTargetContext());

    //check that the values were not saved on local storage
    Assert.assertNull(preferences5.accessToken.get());
    Assert.assertNull(preferences5.idToken.get());
}

From source file:org.openmrs.web.controller.GlobalPropertyPortletControllerTest.java

/**
 * @see GlobalPropertyPortletController#setupModelForModule(Map)
 *///from w  w w  .  ja  v  a 2  s  . c om
@Test
@Verifies(value = "should not change mode if forModule is not present", method = "setupModelForModule(Map<String,Object>)")
public void setupModelForModule_shouldNotChangeModeIfForModuleIsNotPresent() throws Exception {
    //given
    GlobalPropertyPortletController portletController = new GlobalPropertyPortletController();
    Map<String, Object> model = new HashMap<String, Object>();

    //when

    //then
    portletController.setupModelForModule(model);
    Assert.assertNull(model.get("propertyPrefix"));
    Assert.assertNull(model.get("hidePrefix"));
    Assert.assertNull(model.get("excludePrefix"));
}

From source file:org.jasig.ssp.util.importer.job.BatchPartialUploadTest.java

@SuppressWarnings("unchecked")
@Test//from  w  w w.  j a  v a2  s  .  c  o m
public void testPartialUploadGuard() throws Exception {

    deleteDirectory(inputDirectoryPath);
    createFiles(inputDirectoryPath);

    Assert.assertTrue(directoryContainsFiles(inputDirectoryPath, 3, csvFilter));

    JobExecution jobExecution = jobLauncherTestUtils.launchJob();
    BatchStatus exitStatus = jobExecution.getStatus();

    Map<String, ReportEntry> report = (Map<String, ReportEntry>) jobExecution.getExecutionContext()
            .get("report");
    Assert.assertNull(report);

    Assert.assertEquals(BatchStatus.STOPPED, exitStatus);

    Assert.assertTrue(directoryExists(inputDirectoryPath));
    Assert.assertTrue(directoryContainsFiles(inputDirectoryPath, 3, csvFilter));

}

From source file:io.cloudslang.lang.compiler.modeller.transformers.ParallelLoopTransformerTest.java

@Test
public void testEmptyValue() throws Exception {
    LoopStatement statement = transformer.transform("").getTransformedData();
    Assert.assertNull(statement);
}

From source file:com.taobao.ad.jpa.test.UUserTest.java

@Test
public void testCheckLogin() {
    Assert.assertNull(userBO.checkLogin("1111", "2222"));
}