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(String message, int expected, int actual) 

Source Link

Document

Asserts that two ints are equal.

Usage

From source file:net.sf.dynamicreports.test.jasper.AbstractJasperChartTest.java

protected void chartSeriesCountTest(String name, int index, int expectedNumberOfSeries) {
    Assert.assertEquals("chart series count " + name, expectedNumberOfSeries,
            getChart(name, index).getCategoryPlot().getDataset().getRowCount());
}

From source file:io.fabric8.fab.DuplicateDependencyTest.java

protected void assertDuplicates(DependencyTree tree, int expectedDuplicateCount) {
    List<DependencyTree.DuplicateDependency> duplicateDependencies = tree.checkForDuplicateDependencies();
    LOG.info(duplicateDependencies);//  w  w  w  . j  av  a  2 s .  co  m
    Assert.assertEquals("Expected duplicate dependencies: " + duplicateDependencies, expectedDuplicateCount,
            duplicateDependencies.size());
}

From source file:com.elasticgrid.amazon.boot.BootstrapperTest.java

@Test
public void testMonitorLaunch() throws IOException, EC2Exception {
    String data = "CLUSTER_NAME=test\n" + "AWS_ACCESS_ID=123456123456\n" + "AWS_SECRET_KEY=123456123456\n"
            + "AWS_EC2_AMI32=ami-bdcb2dd4\n" + "AWS_EC2_AMI64=ami-fdcb2d94\n" + "AWS_EC2_KEYPAIR=eg-keypair\n"
            + "AWS_SQS_SECURED=true\n" + "DROP_BUCKET=elastic-grid-drop-target";
    FileUtils.writeStringToFile(new File("/tmp/user-data"), data);
    FileUtils.writeStringToFile(new File("/tmp/security-groups"),
            "elastic-grid, elastic-grid-cluster-test, eg-monitor");
    System.setProperty("EG_HOME", System.getProperty("java.io.tmpdir"));
    new File(System.getProperty("java.io.tmpdir") + File.separatorChar + "config").mkdir();
    Bootstrapper bootstrapper = new Bootstrapper();

    Properties props = new Properties();
    props.load(new FileInputStream(System.getProperty("java.io.tmpdir") + "/config/eg.properties"));
    Assert.assertEquals("Wrong AWS Access ID", "123456123456",
            props.getProperty(EC2Configuration.AWS_ACCESS_ID));
    Assert.assertEquals("Wrong AWS Secret Key", "123456123456",
            props.getProperty(EC2Configuration.AWS_SECRET_KEY));
    Assert.assertEquals("Wrong AWS AMI for 32 bits", "ami-bdcb2dd4",
            props.getProperty(EC2Configuration.AWS_EC2_AMI32));
    Assert.assertEquals("Wrong AWS AMI for 64 bits", "ami-fdcb2d94",
            props.getProperty(EC2Configuration.AWS_EC2_AMI64));
    Assert.assertEquals("Wrong AWS KeyPair", "eg-keypair", props.getProperty(EC2Configuration.AWS_EC2_KEYPAIR));
    Assert.assertEquals("Wrong AWS SQS security setting", "true",
            props.getProperty(EC2Configuration.AWS_SQS_SECURED));
    Assert.assertEquals("Wrong EG Cluster name", "test", props.getProperty(EC2Configuration.EG_CLUSTER_NAME));
    Assert.assertEquals("Wrong EG Drop Bucket", "elastic-grid-drop-target",
            props.getProperty(EC2Configuration.EG_DROP_BUCKET));
}

From source file:com.metamx.common.parsers.JSONParserTest.java

@Test
public void testSimpleWithExclude() {
    final Parser<String, Object> jsonParser = new JSONParser(new ObjectMapper(), null,
            Lists.newArrayList("two"));
    final Map<String, Object> jsonMap = jsonParser.parse(json);
    Assert.assertEquals("jsonMap", ImmutableMap.of("one", "foo", "three", "qux"), jsonMap);
}

From source file:org.openspaces.eviction.test.LRUSingleOrderTest.java

@Test
public void readKeepsAnObjectTest() throws Exception {
    logger.info("write an object");
    gigaSpace.write(new SilverMedal(0));

    logger.info("fill the space with more than cache size object and red the original in the middle");
    for (int i = 1; i <= cacheSize + 10; i++) {
        if (i == (cacheSize / 2))
            gigaSpace.read(new SilverMedal(0));
        else/*from w  w w .  j  a  va2 s  .c om*/
            gigaSpace.write(new SilverMedal(i));
    }
    Assert.assertEquals("amount of objects in space is larger than cache size", gigaSpace.count(new Object()),
            cacheSize);

    logger.info("assert the original object is still in cache");
    Assert.assertNotNull("silver medal 0 is not in space", gigaSpace.read(new SilverMedal(0)));
    logger.info("Test Passed");
}

From source file:com.redblackit.web.controller.AdminControllerTest.java

/**
 * Helper method to run tests using about
 *///from www. j a v a 2s  .  c  o m
private void doTestAbout() {
    ExtendedModelMap model = new ExtendedModelMap();

    adminController.about(model);

    Object versionInfoObj = model.get("versionInfo");
    Assert.assertNotNull("versionInfo model attribute", versionInfoObj);
    Assert.assertTrue("versionInfo is of type CompositeVersionInfo:" + versionInfoObj.getClass(),
            versionInfoObj instanceof CompositeVersionInfo);

    CompositeVersionInfo returnedVersionInfo = (CompositeVersionInfo) versionInfoObj;
    Assert.assertEquals("returned versionInfo", getExpectedCompositeVersionInfo(), returnedVersionInfo);
}

From source file:com.vaadin.sass.AbstractTestBase.java

public void testParser(String file) throws CSSException, IOException, URISyntaxException {
    originalScss = getFileContent(file);
    ScssStylesheet sheet = getStyleSheet(file);
    parsedScss = sheet.toString();// ww  w.  j  a va2s.c  o m
    Assert.assertEquals("Original CSS and parsed CSS do not match", originalScss, parsedScss);
}