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:BQJDBC.QueryResultTest.BQResultSetFunctionTest.java

@Test
public void ChainedCursorFunctionTest() {
    this.logger.info("ChainedFunctionTest");
    try {/*from w  ww. j  a v a2 s . c  om*/
        BQResultSetFunctionTest.Result.beforeFirst();
        Assert.assertTrue(BQResultSetFunctionTest.Result.next());
        Assert.assertEquals("you", BQResultSetFunctionTest.Result.getString(1));

    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }
    try {
        Assert.assertTrue(BQResultSetFunctionTest.Result.absolute(10));
        Assert.assertEquals("word", BQResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertFalse(BQResultSetFunctionTest.Result.next());
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertEquals("", BQResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        boolean ct = e.toString().contains("Cursor is not in a valid Position");
        if (ct == true) {
            Assert.assertTrue(ct);
        } else {
            this.logger.error("SQLexception" + e.toString());
            Assert.fail("SQLException" + e.toString());
        }

    }

    try {
        Assert.assertTrue(BQResultSetFunctionTest.Result.first());
        Assert.assertEquals("you", BQResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertTrue(BQResultSetFunctionTest.Result.isFirst());
        Assert.assertFalse(BQResultSetFunctionTest.Result.previous());
        BQResultSetFunctionTest.Result.afterLast();
        Assert.assertTrue(BQResultSetFunctionTest.Result.isAfterLast());
        Assert.assertTrue(BQResultSetFunctionTest.Result.absolute(-1));
        Assert.assertEquals("word", BQResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertTrue(BQResultSetFunctionTest.Result.relative(-5));
        Assert.assertEquals("without", BQResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertFalse(BQResultSetFunctionTest.Result.relative(6));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertEquals("without", BQResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        boolean ct = e.toString().contains("Cursor is not in a valid Position");
        if (ct == true) {
            Assert.assertTrue(ct);
        } else {
            this.logger.error("SQLexception" + e.toString());
            Assert.fail("SQLException" + e.toString());
        }
    }
    this.logger.info("chainedfunctiontest end");
}

From source file:org.atemsource.atem.utility.snapshot.SnapshotBuilderTest.java

@Test
public void test() {
    EntityA entityA = new EntityA();
    entityA.setIntP(100);//from   ww  w .j a v a  2  s . co m
    entityA.setBooleanO(true);
    List<EntityB> list = new ArrayList<EntityB>();
    EntityB b1 = new EntityB();
    b1.setInteger(5);
    list.add(b1);
    entityA.setList(list);

    EntityType<EntityB> entityTypeB = entityTypeRepository.getEntityType(EntityB.class);
    SnapshotBuilder subBuilder = snapshotBuilderFactory.create(entityTypeB);
    subBuilder.include("integer");
    Transformation<?, ?> subTransformation = subBuilder.create();

    EntityType<EntityA> entityTypeA = entityTypeRepository.getEntityType(EntityA.class);
    SnapshotBuilder builder = snapshotBuilderFactory.create(entityTypeA);
    builder.include("intP");
    builder.include("list").cascade(subTransformation);

    Transformation<EntityA, DynamicEntity> snapshotting = (Transformation<EntityA, DynamicEntity>) builder
            .create();

    DynamicEntity snapshot = snapshotting.getAB().convert(entityA,
            new SimpleTransformationContext(entityTypeRepository));

    EntityA restored = snapshotting.getBA().convert(snapshot,
            new SimpleTransformationContext(entityTypeRepository));

    Assert.assertFalse(((List) snapshot.get("list")).get(0) instanceof EntityB);
    Assert.assertEquals(100, restored.getIntP());
    Assert.assertNotSame(entityA.getList(), restored.getList());
    Assert.assertEquals(5, restored.getList().get(0).getInteger());
    Assert.assertEquals(null, restored.getBooleanO());

}

From source file:BQJDBC.QueryResultTest.BQScrollableResultSetFunctionTest.java

@Test
public void ChainedCursorFunctionTest() {
    this.logger.info("ChainedFunctionTest");
    try {// www  .j  a v  a  2  s.c o m
        BQScrollableResultSetFunctionTest.Result.beforeFirst();
        Assert.assertTrue(BQScrollableResultSetFunctionTest.Result.next());
        Assert.assertEquals("you", BQScrollableResultSetFunctionTest.Result.getString(1));

    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }
    try {
        Assert.assertTrue(BQScrollableResultSetFunctionTest.Result.absolute(10));
        Assert.assertEquals("word", BQScrollableResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertFalse(BQScrollableResultSetFunctionTest.Result.next());
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertEquals("", BQScrollableResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        boolean ct = e.toString().contains("Cursor is not in a valid Position");
        if (ct == true) {
            Assert.assertTrue(ct);
        } else {
            this.logger.error("SQLexception" + e.toString());
            Assert.fail("SQLException" + e.toString());
        }

    }

    try {
        Assert.assertTrue(BQScrollableResultSetFunctionTest.Result.first());
        Assert.assertEquals("you", BQScrollableResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertTrue(BQScrollableResultSetFunctionTest.Result.isFirst());
        Assert.assertFalse(BQScrollableResultSetFunctionTest.Result.previous());
        BQScrollableResultSetFunctionTest.Result.afterLast();
        Assert.assertTrue(BQScrollableResultSetFunctionTest.Result.isAfterLast());
        Assert.assertTrue(BQScrollableResultSetFunctionTest.Result.absolute(-1));
        Assert.assertEquals("word", BQScrollableResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertTrue(BQScrollableResultSetFunctionTest.Result.relative(-5));
        Assert.assertEquals("without", BQScrollableResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertFalse(BQScrollableResultSetFunctionTest.Result.relative(6));
    } catch (SQLException e) {
        this.logger.error("SQLexception" + e.toString());
        Assert.fail("SQLException" + e.toString());
    }

    try {
        Assert.assertEquals("without", BQScrollableResultSetFunctionTest.Result.getString(1));
    } catch (SQLException e) {
        boolean ct = e.toString().contains("Cursor is not in a valid Position");
        if (ct == true) {
            Assert.assertTrue(ct);
        } else {
            this.logger.error("SQLexception" + e.toString());
            Assert.fail("SQLException" + e.toString());
        }
    }
    this.logger.info("chainedfunctiontest end");
}

From source file:io.cloudslang.worker.management.services.WorkerRecoveryManagerImplTest.java

@Test
public void testIsInRecovery() throws Exception {
    Assert.assertFalse(workerRecoveryManager.isInRecovery());
}

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

public void testMail() {
    Log.init(getContext());/*from  w ww.  j  av a  2s.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:de.hybris.platform.acceleratorservices.order.strategies.impl.ReminderUncollectedConsignmentStrategyTest.java

@Test
public void testProcessConsignmentOKBusinessProcessExists() {
    BDDMockito.given(consignmentModel.getShippingDate())
            .willReturn(DateUtils.addHours(referenceDate, 0 - timeThreshold.intValue() - 1));
    BDDMockito.given(businessProcessService.getProcess(Mockito.anyString())).willReturn(businessProcessModel);

    final boolean result = reminderUncollectedConsignmentStrategy.processConsignment(consignmentModel);

    Assert.assertFalse(result);
}

From source file:de.hybris.platform.acceleratorservices.order.strategies.impl.CustomerServiceUncollectedConsignmentStrategyTest.java

@Test
public void testProcessConsignmentOKBusinessProcessExists() {
    BDDMockito.given(consignmentModel.getShippingDate())
            .willReturn(DateUtils.addHours(referenceDate, 0 - timeThreshold.intValue() - 1));
    BDDMockito.given(businessProcessService.getProcess(Mockito.anyString())).willReturn(businessProcessModel);

    final boolean result = customerServiceUncollectedConsignmentStrategy.processConsignment(consignmentModel);

    Assert.assertFalse(result);
}

From source file:com.onesite.sdk.test.api.SessionApiTest.java

@Test
public void testCreateActive() {
    SessionApi api = new SessionApi();

    try {/*from   ww  w .  j av  a2 s. co m*/
        User testUser = new User();
        testUser.setId(userID);

        Session testSession = new Session();
        testSession.setUser(testUser);
        testSession.setIp(ip);
        testSession.setAgent(agent);

        Map<String, String> data = new HashMap<String, String>();
        data.put("alpha", "abc");
        data.put("numeric", "123");
        data.put("other", "#$%.-");
        testSession.setSessionData(data);

        Session session = api.create(testSession);

        System.out.println("Active Session");
        System.out.println("coreU: " + session.getCoreU());
        System.out.println("coreX: " + session.getCoreU());
        System.out.println("Data:  " + session.getSessionDataSize());

        Assert.assertFalse(StringUtils.isEmpty(session.getCoreU()));
    } catch (Exception e) {
        Assert.fail();
    }
}

From source file:com.google.api.ads.adwords.awreporting.model.definitions.ReportKeywordDefinitionTest.java

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

    Assert.assertEquals(8661954824L, first.getAccountId().longValue());
    Assert.assertEquals("2013-05-01", first.getDay());
    Assert.assertEquals(0.00, first.getCost().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.getAvgCpm().doubleValue());
    Assert.assertEquals(0.00, first.getAvgCpc().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.nomsic.randb.RandbTest.java

@Test
public void testGetNextCell() throws RandbException, FileNotFoundException, IOException {
    String name = "TEST";
    manager.createBlockGroup(name, 2, Arrays.asList(new Integer[] { 2, 4 }),
            Arrays.asList(new String[] { "A", "B" }));
    Cell nextCell = manager.getNextCell(name);

    provider.clearCache();//from ww w  .j  a va2s  .co m

    BlockGroup bg = manager.getBlockGroup(name);
    Cell cell = bg.getBlocks().get(0).getCell(0);
    Assert.assertFalse(cell.isUsed());
    Assert.assertEquals(cell.getUuid(), nextCell.getUuid());
}