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:org.obiba.onyx.core.domain.participant.ParticipantAttributeReaderTest.java

@Test
public void testSizeOfAttributeList() {
    Assert.assertEquals(6, participantAttributes.size());
}

From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.EmployeesTest.CleaningStaffNGTest.java

@Test
public void updateCleaner() {

    Assert.assertEquals(service.createNewCleaner().get(0).getAge(), 23);
}

From source file:org.mayocat.theme.ThemeDefinitionTest.java

@Test
public void testParseTheme() throws Exception {
    String themeConfig = Resources.toString(Resources.getResource("theme.yml"), Charsets.UTF_8);
    ThemeDefinition theme = mapper.readValue(themeConfig, ThemeDefinition.class);

    Assert.assertEquals("Default theme", theme.getName());
    Assert.assertTrue(//from w  ww. j  ava  2 s  . c  o  m
            theme.getDescription().startsWith("Et harum quidem rerum facilis est et expedita distinctio."));
    Assert.assertEquals(2, theme.getAddons().size());

    Map<String, AddonGroupDefinition> addons = theme.getAddons();
    Assert.assertEquals(2, addons.keySet().size());

    AddonGroupDefinition group1 = addons.get("group1");
    Assert.assertEquals("Addon group 1", group1.getName());
    Assert.assertEquals("Short help text that is displayed under the addon group", group1.getText());
    List<String> entities = Lists.newArrayList("product", "page");
    Assert.assertEquals(Optional.of(entities), group1.getEntities());
    Map<String, AddonFieldDefinition> fields = group1.getFields();
    AddonFieldDefinition brand = fields.get("brand");
    Assert.assertEquals("Brand", brand.getName());
    Assert.assertEquals("string", brand.getType());

    AddonGroupDefinition group2 = addons.get("group2");
    Map<String, AddonFieldDefinition> fields2 = group2.getFields();
    Assert.assertEquals(2, fields2.keySet().size());
    AddonFieldDefinition field1 = fields2.get("field1");
    Assert.assertEquals("Field 1", field1.getName());
}

From source file:com.taobao.ad.jpa.test.RepeatAlarmTest.java

@Test
public void testGetReapeatAlermById() {
    RepeatAlarmDO r = repeatAlarmBO.getRepeatAlarmById(1);

    Assert.assertNotNull(r);//from   w  w w  .  j ava2 s .  com
    Assert.assertEquals(1, r.getId().intValue());
    Assert.assertEquals("11", r.getJobName());
    Assert.assertEquals("11", r.getJobGroup());
    Assert.assertEquals(1111, r.getSignTime());
    Assert.assertEquals(11, r.getRepeatAlarmNum());
    Assert.assertEquals(1, r.getStatus().intValue());
}

From source file:forum.test.UtilisateurServiceJUnitTest.java

@Test
public void utilisateur3isbbOk() {
    Assert.assertEquals("bb", service.find(4L).getLogin());
}

From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.MedicalAidTest.MedicalAidNGTest.java

@Test
public void updateMedicalAid() {

    Assert.assertEquals(service.createNewMedicalAid().get(0).getLastName(), "Sheperd");
}

From source file:fr.zcraft.zlib.components.rawtext.RawTextTest.java

static private void assertJSON(RawText part, String jsonMessage) {
    JSONObject obj;//from   w  w  w. ja  v a 2  s  . com
    try {
        obj = (JSONObject) new JSONParser().parse(jsonMessage);
    } catch (ParseException e) {
        throw new RuntimeException(e);
    }
    Assert.assertEquals(obj.toJSONString(), part.toJSONString());
}

From source file:com.compomics.cell_coord.computations.TrackSpotTest.java

@Test
public void test2DEuclideanDistance() {
    double euclideanDistanceTo = q.getGeometricPoint().euclideanDistanceTo(r.getGeometricPoint());
    Assert.assertEquals(6.158733636065128, euclideanDistanceTo);
    double zeroDistance = q.getGeometricPoint().euclideanDistanceTo(q.getGeometricPoint());
    Assert.assertEquals(0.0, zeroDistance);
}

From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.EquipmentTest.MedicalEquipmentNGTest.java

@Test
public void updateMedical() {

    Assert.assertEquals(service.createNewMedicalEquipment().get(0).getCondition(), "New");
}

From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.PaymentMethodTest.MonthlyPaymentNGTest.java

@Test
public void updateMonthly() {

    Assert.assertEquals(service.createNewMonthly().get(0).getPatientID(), "P1002");
}