Example usage for junit.framework Assert assertFalse

List of usage examples for junit.framework Assert assertFalse

Introduction

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

Prototype

static public void assertFalse(boolean condition) 

Source Link

Document

Asserts that a condition is false.

Usage

From source file:org.openmrs.web.controller.provider.ProviderFormControllerTest.java

/**
 * @verifies not void or change attributeList if the attribute values are same
 * @see org.openmrs.web.controller.provider.ProviderFormController#onSubmit(javax.servlet.http.HttpServletRequest,
 *      String, String, String, String, org.openmrs.Provider,
 *      org.springframework.validation.BindingResult, org.springframework.ui.ModelMap)
 *//*from www. j av a2s .  com*/
@Test
public void onSubmit_shouldNotVoidOrChangeAttributeListIfTheAttributeValuesAreSame() throws Exception {
    executeDataSet(PROVIDERS_ATTRIBUTES_XML);
    Provider provider = Context.getProviderService().getProvider(1);
    ProviderAttributeType providerAttributeType = Context.getProviderService().getProviderAttributeType(1);
    providerAttributeType.setName("provider joined date");
    MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest();
    mockHttpServletRequest.setParameter("attribute." + providerAttributeType.getId(), "2011-04-25");
    BindException errors = new BindException(provider, "provider");
    ProviderFormController providerFormController = (ProviderFormController) applicationContext
            .getBean("providerFormController");
    providerFormController.onSubmit(mockHttpServletRequest, "save", null, null, null, provider, errors,
            createModelMap(providerAttributeType));
    Assert.assertFalse(((ProviderAttribute) (provider.getAttributes().toArray()[0])).getVoided());
    Assert.assertEquals(1, provider.getAttributes().size());

}

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

/**
 * Test edit.//from  w w w  .j a  v  a2 s.com
 * 
 * @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.ocpsoft.rewrite.servlet.config.EncodeQueryConfigurationTest.java

@Test
public void testQueryEncodingInclusions() throws Exception {
    HttpAction<HttpGet> action = get("/encodequeryspecific?encode1=value1&keep=this&encode2=value2");
    Assert.assertEquals(210, action.getResponse().getStatusLine().getStatusCode());
    Assert.assertTrue(action.getCurrentContextRelativeURL().contains("c="));
    Assert.assertTrue(action.getCurrentContextRelativeURL().contains("keep=this"));
    Assert.assertFalse(action.getCurrentContextRelativeURL().contains("encode1=value1"));
    Assert.assertFalse(action.getCurrentContextRelativeURL().contains("encode2=value2"));
}

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

/**
 * Test edit.//from   w w w . j  a v a  2  s.  co  m
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    this.log.debug("testing edit...");
    this.action.setJournalkostenId(1L);
    this.action.setJournalId(1L);
    Assert.assertNull(this.action.getJournalkosten());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getJournalkosten());
    Assert.assertFalse(this.action.hasActionErrors());
}

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

@Test
public void testTransformNoValue() throws Exception {
    Map doArgumentsMap = loadFirstTaskFromFile("/basic_flow.yaml");
    @SuppressWarnings("unchecked")
    List<Argument> arguments = doTransformer.transform(doArgumentsMap);
    Assert.assertFalse(arguments.isEmpty());
    Assert.assertEquals(2, arguments.size());
    Argument argument = arguments.get(1);
    Assert.assertEquals("port", argument.getName());
    Assert.assertEquals(true, argument.isOverridable());
}

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

/**
 * Test edit./* w  ww .j a va 2s.co  m*/
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    this.log.debug("testing edit...");
    this.action.setInteresseId(1L);
    Assert.assertNull(this.action.getInteresse());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getInteresseBaseTO());
    Assert.assertFalse(this.action.hasActionErrors());
}

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

/**
 * Test edit.//  ww w.  ja v  a 2  s.c om
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    this.log.debug("testing edit...");
    this.action.setRechnungId(1L);
    Assert.assertNull(this.action.getRechnung());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getRechnungBaseTO());
    Assert.assertFalse(this.action.hasActionErrors());
}

From source file:com.cubusmail.user.test.UserAccountDaoTest.java

/**
 * Compare test user account with the persistent one.
 *///  w ww .  ja v a2s.  co m
@Test
public void testGetUserAccountByUsername() {

    UserAccount userAccount = (UserAccount) this.context.getBean("testUserAccount");
    UserAccount savedUserAccount = this.userAccountDao.getUserAccountByUsername(userAccount.getUsername());
    Assert.assertNotNull(savedUserAccount);

    List<ContactFolder> contactFolders = this.userAccountDao.retrieveContactFolders(userAccount);

    Assert.assertNotNull(contactFolders);
    Assert.assertFalse(contactFolders.isEmpty());

    List<Contact> contactList = this.userAccountDao.retrieveContactList(contactFolders.get(0));
    Assert.assertNotNull(contactList);
    Assert.assertFalse(contactList.isEmpty());
    Assert.assertEquals(contactList.size(), userAccount.getContactFolders().get(0).getContactList().size());
}

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

/**
 * Test edit./*www  . j  a  v a2 s  . com*/
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    this.log.debug("testing edit...");
    this.action.setExemplarId(1L);
    Assert.assertNull(this.action.getExemplar());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getExemplarBaseTO());
    Assert.assertFalse(this.action.hasActionErrors());
}

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

/**
 * Test edit./*  w w  w .  j  a  va2s. c  om*/
 * 
 * @throws Exception
 *             the exception
 */
public void testEdit() throws Exception {
    this.log.debug("testing edit...");
    this.action.setBestellerId(1L);
    Assert.assertNull(this.action.getBesteller());
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getBestellerBaseTO());
    Assert.assertFalse(this.action.hasActionErrors());
}