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:de.itsvs.cwtrpc.controller.config.RemoteServiceControllerConfigBeanDefinitionParserTest.java

@Test
public void test2() {
    RemoteServiceControllerConfig config;

    config = appContext.getBean("serviceController101", RemoteServiceControllerConfig.class);
    Assert.assertEquals(1, config.getServiceModuleConfigs().size());
    Assert.assertEquals("myModule701", config.getServiceModuleConfigs().iterator().next().getName());
    Assert.assertTrue(config.getResponseCompressionEnabled());
    Assert.assertFalse(config.getRpcTokenProtectionEnabled());
    Assert.assertEquals("rpcTokenService", config.getRpcTokenValidatorName());
    Assert.assertSame(appContext.getBean("serializationPolicyProvider"),
            config.getSerializationPolicyProvider());
}

From source file:org.geomajas.gwt2.client.map.layer.VectorLayerTest.java

@Test
public void testSelection() {
    VectorServerLayerImpl layer = new VectorServerLayerImpl(mapConfig, layerInfo, viewPort, eventBus);
    Assert.assertFalse(layer.isSelected());
    layer.setSelected(true);//from   ww w  .j  a va 2  s. com
    Assert.assertTrue(layer.isSelected());
    layer.setSelected(false);
    Assert.assertFalse(layer.isSelected());
}

From source file:com.google.api.ads.adwords.jaxws.extensions.report.model.definitions.ReportKeywordDefinitionTest.java

/**
 * @see com.google.api.ads.adwords.jaxws.extensions.report.model.definitions.
 * AbstractReportDefinitionTest#testFirstEntry(
 * com.google.api.ads.adwords.jaxws.extensions.report.model.entities.Report)
 *//*from   w  ww  .  j a  v a  2s. c  o m*/
@Override
protected void testFirstEntry(ReportKeyword first) {

    Assert.assertEquals(8661954824L, first.getAccountId().longValue());
    Assert.assertEquals("2013-05-01", first.getDay());
    Assert.assertEquals(0.00, first.getCostBigDecimal().doubleValue());
    Assert.assertEquals(0L, first.getClicks().longValue());
    Assert.assertEquals(20L, first.getImpressions().longValue());
    Assert.assertEquals(0L, first.getConversions().longValue());
    Assert.assertEquals(0.00, first.getCtrBigDecimal().doubleValue());
    Assert.assertEquals(0.00, first.getAvgCpmBigDecimal().doubleValue());
    Assert.assertEquals(0.00, first.getAvgCpcBigDecimal().doubleValue());
    Assert.assertEquals(4.50, first.getAvgPositionBigDecimal().doubleValue());
    Assert.assertEquals("EUR", first.getCurrencyCode());

    Assert.assertEquals(86352677L, first.getCampaignId().longValue());
    Assert.assertEquals(3398915357L, first.getAdGroupId().longValue());
    Assert.assertEquals(41933620L, first.getKeywordId().longValue());
    Assert.assertEquals("enabled", first.getStatus());
    Assert.assertEquals(10.00, first.getQualityScoreAsBigDecimal().doubleValue());
    Assert.assertEquals("Broad", first.getKeywordMatchType());
    Assert.assertEquals("achat fort", first.getKeywordText());
    Assert.assertEquals("", first.getDestinationUrl());
    Assert.assertFalse(first.isNegative());

}

From source file:com.buddycloud.mediaserver.delete.DeleteMediaTest.java

@Test
public void deleteMediaParamAuth() throws Exception {
    Base64 encoder = new Base64(true);
    String authStr = BASE_USER + ":" + BASE_TOKEN;

    ClientResource client = new ClientResource(URL + "?auth=" + new String(encoder.encode(authStr.getBytes())));

    client.delete();/*from  w  w  w .  j  ava2 s  . co  m*/

    Assert.assertFalse(fileToDelete.exists());
}

From source file:org.wso2.carbon.apimgt.handlers.AuthenticationHandlerTest.java

@Test(description = "Handle request with empty transport headers")
public void testHandleRequestWithEmptyTransportHeader() throws Exception {
    boolean response = this.handler.handleRequest(createSynapseMessageContext("<empty/>",
            this.synapseConfiguration, new HashMap<>(), "https://test.com/testservice"));
    Assert.assertFalse(response);
}

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

/**
 * Test save.//from   w ww.  java2s. c om
 * 
 * @throws Exception
 *             the exception
 */
public void testSave() throws Exception {
    final MockHttpServletRequest request = new MockHttpServletRequest();
    ServletActionContext.setRequest(request);
    this.action.setSigelId(1L);
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getSigel());

    // update Sigelname and save
    this.action.getSigel().setName("Updated Name");
    Assert.assertEquals("success", this.action.save());
    Assert.assertEquals("Updated Name", this.action.getSigel().getName());
    Assert.assertFalse(this.action.hasActionErrors());
    Assert.assertFalse(this.action.hasFieldErrors());
    Assert.assertNotNull(request.getSession().getAttribute("messages"));
}

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

/**
 * Test save.// www  .  j  a  va  2s  . c o m
 * 
 * @throws Exception
 *             the exception
 */
public void testSave() throws Exception {
    final MockHttpServletRequest request = new MockHttpServletRequest();
    ServletActionContext.setRequest(request);
    this.action.setPaketId(1L);
    Assert.assertEquals("edit", this.action.edit());
    Assert.assertNotNull(this.action.getPaket());

    // update Paketname and save
    this.action.getPaket().setPaketName("Updated Name");
    Assert.assertEquals("success", this.action.save());
    Assert.assertEquals("Updated Name", this.action.getPaket().getPaketName());
    Assert.assertFalse(this.action.hasActionErrors());
    Assert.assertFalse(this.action.hasFieldErrors());
    Assert.assertNotNull(request.getSession().getAttribute("messages"));
}

From source file:de.akquinet.gomobile.androlog.test.PostReporterTest.java

public void testPost() {
    Log.init(getContext());/*from  w  ww  .ja v  a 2  s .c o  m*/
    String message = "This is a INFO test";
    String tag = "my.log.info";
    Log.d(tag, message);
    Log.i(tag, message);
    Log.w(tag, message);
    List<String> list = Log.getReportedEntries();
    Assert.assertNotNull(list);
    Assert.assertFalse(list.isEmpty());
    Assert.assertEquals(2, list.size()); // i + w

    Log.report();
    Log.report("this is a user message", null);
    Exception error = new MalformedChallengeException("error message", new NumberFormatException());
    Log.report(null, error);
}

From source file:com.buddycloud.mediaserver.delete.DeleteAvatarTest.java

@Test
public void deleteAvatarParamAuth() throws Exception {
    Base64 encoder = new Base64(true);
    String authStr = BASE_USER + ":" + BASE_TOKEN;

    ClientResource client = new ClientResource(URL + "?auth=" + new String(encoder.encode(authStr.getBytes())));

    client.delete();// w ww .  j  a  v a2  s.  c  o  m

    Assert.assertFalse(fileToDelete.exists());
}

From source file:de.hybris.basecommerce.SimpleSmtpServerUtilsTest.java

@Test
public void testFindNextPort() {
    SimpleSmtpServer server1 = null;/*from www  .ja  v a  2s  .com*/
    SimpleSmtpServer server2 = null;
    SimpleSmtpServer server3 = null;
    SimpleSmtpServer server4 = null;
    try {
        server1 = SimpleSmtpServerUtils.startServer(TEST_START_PORT, true);
        Assert.assertFalse(server1.isStopped());
        Assert.assertTrue(server1.getPort() > 0);

        server2 = SimpleSmtpServerUtils.startServer(TEST_START_PORT, true);
        Assert.assertFalse(server2.isStopped());
        Assert.assertTrue(server2.getPort() > 0);
        Assert.assertFalse(server1.getPort() == server2.getPort());

        server3 = SimpleSmtpServerUtils.startServer(TEST_START_PORT, true);
        Assert.assertFalse(server3.isStopped());
        Assert.assertTrue(server3.getPort() > 0);
        Assert.assertFalse(server1.getPort() == server3.getPort());
        Assert.assertFalse(server2.getPort() == server3.getPort());

        // stop server 1
        final int server1Port = server1.getPort();
        server1.stop();
        Assert.assertTrue(server1.isStopped());
        server1 = null;

        // now port from server 1 should be free again
        server4 = SimpleSmtpServerUtils.startServer(TEST_START_PORT, true);
        Assert.assertFalse(server4.isStopped());
        if (server1Port != server4.getPort()) {
            LOG.warn("unable to re-use port server1 port " + server1Port + " even though server1 was stopped");
        }
    } finally {
        if (server4 != null) {
            server4.stop();
        }
        if (server3 != null) {
            server3.stop();
        }
        if (server2 != null) {
            server2.stop();
        }
        if (server1 != null) {
            server1.stop();
        }
    }
}