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:org.openmrs.module.webservices.rest.web.v1_0.controller.ConceptNameControllerTest.java

@Test
public void shouldGetAConceptName() throws Exception {
    Object result = controller.retrieve(conceptUuid, nameUuid, request);
    Assert.assertNotNull(result);//from   w ww.ja v a  2 s .c  om
    Assert.assertEquals("COUGH SYRUP", PropertyUtils.getProperty(result, "name"));
    Assert.assertNull(PropertyUtils.getProperty(result, "auditInfo"));
    Assert.assertNotNull(PropertyUtils.getProperty(result, "uuid"));
}

From source file:org.ngrinder.agent.service.AgentManagerServiceTest.java

@Test
public void testSaveGetDeleteAgent() {
    AgentInfo agent = saveAgent("save");
    AgentInfo agent2 = agentManagerService.getOne(agent.getId());
    Assert.assertNotNull(agent2);//  w  w  w .j a v a  2s  .co  m

    List<AgentInfo> agentListDB = agentManagerService.getAllLocal();
    Assert.assertNotNull(agentListDB);

    agentManagerService.approve(agent.getId(), true);

    agentRepository.delete(agent.getId());
    agent2 = agentManagerService.getOne(agent.getId());
    Assert.assertNull(agent2);
}

From source file:de.itsvs.cwtrpc.controller.config.AutowiredRemoteServiceGroupConfigBeanDefinitionParserTest.java

@Test
public void test1() {
    AutowiredRemoteServiceGroupConfig config;

    config = appContext.getBean("autowiredServiceGroup101", AutowiredRemoteServiceGroupConfig.class);
    Assert.assertEquals(1, config.getBasePackages().size());
    Assert.assertEquals("de.itsvs.test.", config.getBasePackages().iterator().next());
    Assert.assertNull(config.getResponseCompressionEnabled());
    Assert.assertNull(config.getRpcTokenProtectionEnabled());
    Assert.assertNull(config.getRpcTokenValidatorName());
    Assert.assertEquals(0, config.getServiceConfigs().size());
    Assert.assertEquals(0, config.getChildGroupConfigs().size());
    Assert.assertEquals(0, config.getIncludeFilters().size());
    Assert.assertEquals(0, config.getExcludeFilters().size());
}

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

/**
 * Test edit./*from  ww w  .  ja v a  2  s .  c  om*/
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    // so request.getRequestURL() doesn't fail
    final MockHttpServletRequest request = new MockHttpServletRequest("GET", "/editUser.html");
    ServletActionContext.setRequest(request);

    this.action.setId("-1"); // regular user
    Assert.assertNull(this.action.getUser());
    Assert.assertEquals("success", this.action.edit());
    Assert.assertNotNull(this.action.getUser());
    Assert.assertFalse(this.action.hasActionErrors());
}

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

/**
 * Test edit./*from  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.setJournalId(1L);
    Assert.assertNull(this.action.getJournal());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getJournalBaseTO());
    Assert.assertFalse(this.action.hasActionErrors());
}

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

@Test
public void saveReportGroup_shouldSaveReport() throws Exception {
    final String reportName = "New Report";

    List<ReportGroup> reportGroups = reportsService.getReportGroups();
    Assert.assertNull(ReportGroup.getReport(reportName, reportGroups));

    ReportGroup reportGroup = reportGroups.get(0);
    Report report = new Report(reportName);
    report.setCreator(userService.getUsers().get(0));
    report.setDateCreated(new Date());
    report.setReportGroup(reportGroup);/*from  w  w w  .  ja v a 2s .  co  m*/
    reportsService.saveReport(report);

    reportGroups = reportsService.getReportGroups();
    Assert.assertNotNull(ReportGroup.getReport(reportName, reportGroups));
}

From source file:de.akquinet.chameria.activation.ActivationTest.java

@Test
public void startChameriaWithoutActivation() throws Exception {

    ChameRIA chameleon = new ChameRIA("target/core", true, null, null, null, null);
    Framework framework = chameleon.start(new String[0]);

    ServiceReference ref = framework.getBundleContext().getServiceReference(ActivationService.class.getName());
    Assert.assertNull(ref);

    chameleon.stop();/*from  w  w  w.ja  va2 s. c om*/
}

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

/**
 * Test edit./* w w w. j  ava2  s  . co m*/
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    this.log.debug("testing edit...");
    this.action.setKonsortiumId(1L);
    Assert.assertNull(this.action.getKonsortium());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getKonsortium());
    Assert.assertFalse(this.action.hasActionErrors());
}

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

/**
 * Test edit.//from w  w w.j  a  va 2s . c om
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    this.log.debug("testing edit...");
    this.action.setId(1L);
    Assert.assertNull(this.action.getInstitution());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getInstitutionBaseTO());
    Assert.assertFalse(this.action.hasActionErrors());
}

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

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

    deleteDirectory(inputDirectoryPath);

    Assert.assertTrue(!directoryExists(inputDirectoryPath));
    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.FAILED, exitStatus);

    Assert.assertTrue(!directoryExists(inputDirectoryPath));

}