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:fragment.web.StaticPagesControllerTest.java

@Test
public void testhelp() {
    String help = controller.help(map);
    Assert.assertNotNull(map.get("tenant"));
    Assert.assertEquals(help, new String("main.help"));
}

From source file:it.geosolutions.tools.compress.file.test.CompressorTest.java

@Test
public void deflate() throws FileNotFoundException, IOException {
    Collector c = new Collector(FileFilterUtils.fileFileFilter());
    File compressed = Compressor.deflate(destinationFolder, "deflate_test",
            c.collect(folderCompare).toArray(new File[] {}));
    LOGGER.info("Compressed model: " + this.compressed + " length:" + this.compressed.length());
    LOGGER.info("Compressed to compare: " + compressed + " length:" + compressed.length());
    Assert.assertEquals(this.compressed.length(), compressed.length());
}

From source file:org.ocpsoft.rewrite.config.tuckey.TuckeyConfigurationProviderTest.java

@Test
public void testConfigurationIntegratesWithForwardFlow() throws Exception {
    HttpAction<HttpGet> action = get("/some/fordir/value");
    Assert.assertEquals("/very/newdir/value", action.getCurrentURL());
    Assert.assertEquals(404, action.getStatusCode());
}

From source file:org.openmrs.module.kenyarx.mapping.ObjectObsMarshallerTest.java

@Test
public void marshal_shouldConvertToObs() throws Exception {
    Patient patient = Context.getPatientService().getPatient(7);
    Concept aspirin = Context.getConceptService().getConcept(71617);
    Date date = new Date();

    Dispensing dispensing = new Dispensing();
    dispensing.setDispensedConcept(aspirin);
    dispensing.setDispensedQuantity(123.0);
    dispensing.setDispensedUnits("ml");

    Obs obs = objectObsMarshaller.marshal(dispensing, null, date, patient);
    Assert.assertNotNull(obs);/*  w  ww. j  av a  2s .c om*/
    Assert.assertEquals(patient, obs.getPerson());
    Assert.assertEquals(date, obs.getObsDatetime());

    Obs drugObs = objectObsMarshaller.findMember(obs, Context.getConceptService().getConcept(1282));
    Assert.assertNotNull(drugObs);
    Assert.assertEquals(patient, drugObs.getPerson());
    Assert.assertEquals(date, drugObs.getObsDatetime());
    Assert.assertEquals(aspirin, drugObs.getValueCoded());

    Obs quantityObs = objectObsMarshaller.findMember(obs, Context.getConceptService().getConcept(1443));
    Assert.assertNotNull(quantityObs);
    Assert.assertEquals(patient, quantityObs.getPerson());
    Assert.assertEquals(date, quantityObs.getObsDatetime());
    Assert.assertEquals(new Double(123.0), quantityObs.getValueNumeric());

    Obs unitsObs = objectObsMarshaller.findMember(obs, Context.getConceptService().getConcept(1444));
    Assert.assertNotNull(unitsObs);
    Assert.assertEquals(patient, unitsObs.getPerson());
    Assert.assertEquals(date, unitsObs.getObsDatetime());
    Assert.assertEquals("ml", unitsObs.getValueText());
}

From source file:org.apache.streams.config.test.ComponentConfiguratorTest.java

@Test
public void testDetectDefaults() throws Exception {

    Config config = ConfigFactory.load("componentTest");

    ComponentConfigurator<ComponentConfiguration> configurator = new ComponentConfigurator<>(
            ComponentConfiguration.class);

    ComponentConfiguration defaultPojo = configurator.detectConfiguration(config.getConfig("defaultComponent"));

    assert (defaultPojo != null);

    ComponentConfiguration configuredPojo = configurator
            .detectConfiguration(config.getConfig("configuredComponent"));

    assert (configuredPojo != null);

    Assert.assertEquals(configuredPojo, defaultPojo);

}

From source file:com.fluxcapacitor.edge.EdgeIntegrationTest.java

@Test
public void test1() throws Exception {
    ClientResponse response = get();/*from w ww  .j  a v a2s .  co  m*/
    Assert.assertEquals(200, response.getStatus());
    Assert.assertEquals("Fraggle Rock!", IOUtils.toString(response.getEntityInputStream(), Charsets.UTF_8));
}

From source file:org.openmrs.module.webservices.rest.web.v1_0.controller.ConceptNameControllerTest.java

@Test
public void shouldGetAConceptName() throws Exception {
    Object result = controller.retrieve(conceptUuid, nameUuid, request);
    Assert.assertNotNull(result);//from   w w w . j  av a 2s . c o m
    Assert.assertEquals("COUGH SYRUP", PropertyUtils.getProperty(result, "name"));
    Assert.assertNull(PropertyUtils.getProperty(result, "auditInfo"));
    Assert.assertNotNull(PropertyUtils.getProperty(result, "uuid"));
}

From source file:com.collective.celos.ci.testing.fixtures.convert.FixTableToJsonFileConverterTest.java

@Test
public void testFixTableToJsonFileConverter() throws Exception {
    FixTableToJsonFileConverter converter = new FixTableToJsonFileConverter();
    List<FixTable.FixRow> fixRows = Lists.newArrayList();

    Map<String, String> map = Maps.newHashMap();
    map.put("col1", "val1");
    map.put("col2", "val2");

    Map<String, String> map2 = Maps.newHashMap();
    map2.put("col1", "val11");
    map2.put("col2", "val22");

    FixTable.FixRow row1 = new FixTable.FixRow(map);
    FixTable.FixRow row2 = new FixTable.FixRow(map2);
    fixRows.add(row1);//from   www .  java2  s  . c  om
    fixRows.add(row2);
    FixTable fixTable = new FixTable(Lists.newArrayList("col1", "col2"), fixRows);
    FixFile fixFile = converter.convert(null, fixTable);

    String tableStr = IOUtils.toString(fixFile.getContent());
    String expectedStr = "{\"col1\":\"val1\",\"col2\":\"val2\"}\n" + "{\"col1\":\"val11\",\"col2\":\"val22\"}";

    Map<JsonElement, Integer> expected = Utils.fillMapWithJsonFromIS(IOUtils.toInputStream(expectedStr));
    Map<JsonElement, Integer> result = Utils.fillMapWithJsonFromIS(IOUtils.toInputStream(tableStr));
    Assert.assertEquals(expected, result);
}

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

@Test(dependsOnMethods = "readMechanic")
public void updateMechanic() {
    repo = ctx.getBean(MechanicRepository.class);
    Mechanic mechanic = repo.findOne(id);

    Mechanic updateMechanic = new Mechanic.Builder("Electricity Installation").mechanic(mechanic)
            .ratings("Expect").build();
    repo.save(updateMechanic);/* w w w .  ja v  a 2s.  c o m*/
    Assert.assertEquals("Expect", updateMechanic.getRatings());
}

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

@Test
public void testValidStatementWithSpaces() throws Exception {
    ListLoopStatement statement = (ListLoopStatement) transformer.transform("x in range(0, 9)")
            .getTransformedData();/*w w w  . j ava2  s. c o m*/
    Assert.assertEquals("x", statement.getVarName());
    Assert.assertEquals("range(0, 9)", statement.getExpression());
}