Example usage for junit.framework Assert assertEquals

List of usage examples for junit.framework Assert assertEquals

Introduction

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

Prototype

static public void assertEquals(int expected, int actual) 

Source Link

Document

Asserts that two ints are equal.

Usage

From source file:com.milaboratory.core.io.sequence.fastq.RandomAccessFastqReaderTest.java

@Test
public void test1() throws Exception {
    File sample = new File(
            SingleFastqReaderTest.class.getClassLoader().getResource("sequences/sample_r1.fastq").toURI());
    SingleFastqReader reader = new SingleFastqReader(sample);

    SingleFastqIndexer indexer = new SingleFastqIndexer(reader, 3);
    while (indexer.take() != null)
        indexer.take();/*from  w ww.j a v  a 2 s  .  c om*/
    FileIndex index = indexer.createIndex();

    reader = new SingleFastqReader(sample);
    RandomAccessFastqReader rreader = new RandomAccessFastqReader(sample, index, false);
    SingleRead read;
    while ((read = reader.take()) != null) {
        SingleRead actual = rreader.take(read.getId());
        Assert.assertEquals(read.getId(), actual.getId());
        Assert.assertEquals(read.getData(), actual.getData());
        Assert.assertEquals(read.getDescription(), actual.getDescription());
    }
}

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

@Override
protected void testFirstEntry(ReportPlacement first) {
    Assert.assertEquals(1154812872L, first.getAdGroupId().longValue());
    Assert.assertEquals("Digital-TV", first.getAdGroupName());
    Assert.assertEquals("enabled", first.getAdGroupStatus());
    Assert.assertEquals(42344742L, first.getCampaignId().longValue());
    Assert.assertEquals("[Generic] Private", first.getCampaignName());
    Assert.assertEquals("www.common.se", first.getDisplayName());
    Assert.assertEquals(" --", first.getCriterionId());
    Assert.assertEquals(" --", first.getMaxCpm());
    Assert.assertEquals("www.common.se", first.getPlacementUrl());
    Assert.assertEquals("2014-03-01", first.getMonth());
    Assert.assertEquals(BigDecimalUtil.parseFromNumberString("1.61"),
            BigDecimalUtil.parseFromNumberString(first.getCost()));
    Assert.assertEquals(1, first.getClicks().longValue());
    Assert.assertEquals(1, first.getImpressions().longValue());
    Assert.assertEquals("100.00", first.getCtr());
    Assert.assertEquals("1610.00", first.getAvgCpm());
    Assert.assertEquals("1.61", first.getAvgCpc());
    Assert.assertEquals("Computers", first.getDevice());
    Assert.assertEquals("Headline", first.getClickType());
    Assert.assertEquals("Search Network", first.getAdNetwork());
    Assert.assertEquals("Search partners", first.getAdNetworkPartners());
}

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

@Test
public void getReports_shouldReturnAllReports() throws Exception {

    List<ReportGroup> reportGroups = reportsService.getReportGroups();

    Assert.assertNotNull(reportGroups);//from w  w w.ja v a 2s . c  om
    Assert.assertEquals(1, reportGroups.size());

    ReportGroup reportGroup = reportGroups.get(0);
    Assert.assertEquals("General", reportGroup.getName());

    List<Report> reports = reportGroup.getReports();
    Assert.assertNotNull(reports);
    Assert.assertEquals(1, reports.size());

    Report report = reports.get(0);
    Assert.assertEquals("Report Name", report.getName());
}

From source file:com.fabrefrederic.integrationTest.ITCommitService.java

@Test
@Transactional//from   ww  w . ja  v  a 2 s  . co  m
public void get_Commits_From_Start_To_End_Revision() {
    // given
    final int numberOfCommits = 5;
    final int startRevision = 1;
    final int endRevision = 5;
    final String repositoryPath = "/trunk/";

    // when
    List<Commit> commits = new ArrayList<Commit>();
    try {
        commits = commitService.getCommits(repositoryPath, startRevision, endRevision);
    } catch (final Exception exception) {
        LOGGER.error("Error during getting commits from the svn repository", exception);
        Assert.fail("Error during getting commits from the svn repository");
    }
    try {
        commitService.saveCommits(commits);
    } catch (final Exception exception) {
        LOGGER.error("Error during saving commits into the database", exception);
        Assert.fail("Error during saving commits into the database");
    }

    // then
    Assert.assertEquals(commits.size(), numberOfCommits);
}

From source file:org.jboss.spring.quickstarts.kitchensink.kitchensink_spring.test.MemberDaoTest.java

@Test
public void testFindById() {
    Member member = memberDao.findById(0l);

    Assert.assertEquals("John Smith", member.getName());
    Assert.assertEquals("john.smith@mailinator.com", member.getEmail());
    Assert.assertEquals("2125551212", member.getPhoneNumber());
    return;//  ww w. ja v  a  2 s  .  c  om
}

From source file:com.google.api.ads.adwords.jaxws.extensions.report.model.definitions.ReportCampaignDefinitionTest.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)
 *///w  w  w.ja v  a2  s . co  m
@Override
protected void testFirstEntry(ReportCampaign first) {

    Assert.assertEquals(1252422563L, first.getAccountId().longValue());
    Assert.assertEquals("2013-05-01", first.getDay());
    Assert.assertEquals(1.11, first.getCostBigDecimal().doubleValue());
    Assert.assertEquals(5L, first.getClicks().longValue());
    Assert.assertEquals(927L, first.getImpressions().longValue());
    Assert.assertEquals(0L, first.getConversions().longValue());
    Assert.assertEquals(0.54, first.getCtrBigDecimal().doubleValue());
    Assert.assertEquals(1.20, first.getAvgCpmBigDecimal().doubleValue());
    Assert.assertEquals(0.22, first.getAvgCpcBigDecimal().doubleValue());
    Assert.assertEquals(3.59, first.getAvgPositionBigDecimal().doubleValue());
    Assert.assertEquals("EUR", first.getCurrencyCode());

    Assert.assertEquals(132449648L, first.getCampaignId().longValue());
    Assert.assertEquals("active", first.getStatus());
    Assert.assertEquals(1.00, first.getBudgetBigDecimal().doubleValue());

}

From source file:philaman.cput.cardealer.test.repository.MechanicRepositoryTest.java

@Test(dependsOnMethods = "createMechanic")
public void readMechanic() {
    repo = ctx.getBean(MechanicRepository.class);
    Mechanic mechanic = repo.findOne(id);
    Assert.assertEquals("Electricity Installation", mechanic.getSpeciality());
}

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

/**
 * @see com.google.api.ads.adwords.awreporting.model.definitions.
 * AbstractReportDefinitionTest#testFirstEntry(
 * com.google.api.ads.adwords.awreporting.model.entities.Report)
 */// w  ww . jav a 2  s. c  o m
@Override
protected void testFirstEntry(ReportDestinationUrl row) {

    Assert.assertEquals("(GMT+01:00) Paris", row.getAccountTimeZoneId());
    Assert.assertEquals(3448007340L, row.getAdGroupId().longValue());
    Assert.assertEquals("Ad Group #1", row.getAdGroupName());
    Assert.assertEquals("enabled", row.getAdGroupStatus());
    Assert.assertEquals(84058260L, row.getCampaignId().longValue());
    Assert.assertEquals("CAMPAGNE", row.getCampaignName());
    Assert.assertEquals("active", row.getCampaignStatus());

    //Assert.assertEquals("0.00", row.getConversionRate());
    //Assert.assertEquals("0.00", row.getConversionRateManyPerClick());
    Assert.assertEquals(0L, row.getConversionsManyPerClick().longValue());
    //Assert.assertEquals(null, row.getConversionValue());
    //Assert.assertEquals("0.00", row.getCostPerConversion());
    //Assert.assertEquals("0.00", row.getCostPerConversionManyPerClick());

    Assert.assertEquals("", row.getCriteriaDestinationUrl());
    Assert.assertEquals("+immo +benodet", row.getCriteriaParameters());
    Assert.assertEquals("enabled", row.getCriteriaStatus());
    Assert.assertEquals("Broad", row.getCriteriaTypeName());
    Assert.assertEquals("Era Rouxelimmo - Plomelin", row.getCustomerDescriptiveName());
    Assert.assertEquals("Sunday", row.getDayOfWeek());
    Assert.assertEquals("http://www.era-immobilier-plomelin.fr", row.getEffectiveDestinationUrl());
    Assert.assertEquals("false", row.getIsNegative());
    Assert.assertEquals("September", row.getMonthOfYear());
    Assert.assertEquals("", row.getPrimaryCompanyName());
    Assert.assertEquals("2013-07-01", row.getQuarter());

}

From source file:org.ocpsoft.rewrite.servlet.wrapper.HttpForwardConfigurationTest.java

@Test
public void testForwardedParameterAddedToRequestParameterMap() throws Exception {
    HttpAction<HttpGet> action = get("/forward?foo=bar");
    Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
}

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   www.ja  v  a2 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.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());

}