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:azkaban.crypto.EncryptionTest.java

@Test
public void testEncryption() {
    String plainText = "test";
    String passphrase = "test1234";

    ICrypto crypto = new Crypto();

    for (Version ver : Version.values()) {
        String cipheredText = crypto.encrypt(plainText, passphrase, ver);
        Assert.assertEquals(plainText, crypto.decrypt(cipheredText, passphrase));
    }/*from w w  w. j a  va  2s  .co  m*/
}

From source file:EditorTest.java

@Test
public void creationTest() {
    editor.firstName("Michael").lastName("Louw").build();
    Assert.assertEquals(editor.build().getName(), "Michael");
}

From source file:Project6Test.java

@Test
public void integerTest() {
    Assert.assertEquals(service.add(40, 12), 52);
}

From source file:com.mirth.connect.plugins.datatypes.dicom.test.DICOMSerializerTest.java

@Test
public void testToXml1() throws Exception {
    String input = Base64//w  w  w . j av a2s.  co m
            .encodeBase64String(FileUtils.readFileToByteArray(new File("tests/test-dicom-input-1.dcm")));
    String output = FileUtils.readFileToString(new File("tests/test-dicom-output-1.xml"));
    DICOMSerializer serializer = new DICOMSerializer();
    Assert.assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
}

From source file:com.intuit.tank.http.json.JsonRequestTest.java

/**
 * /*from ww w  . j a va2  s  .co m*/
 */
@Test(groups = TestGroups.FUNCTIONAL)
public void testCreate() {

    JsonRequest req = new JsonRequest(null);
    req.setKey("/address/home", "123 street");
    String body = req.getBody();
    Assert.assertEquals("{\"address\":{\"home\":\"123 street\"}}", body);
    req.setKey("/address/employeeId", "123");
    body = req.getBody();
    Assert.assertEquals("{\"address\":{\"employeeId\":123,\"home\":\"123 street\"}}", body);
}

From source file:com.tracy.designprinciples.isp.violation.ISPViolationTest.java

@Test
public void ispViolaTest() {

    Assert.assertEquals(service.termMark(50, 75), 87.5);

    Assert.assertEquals(service.avgTerm(7, 567), 81.0);
    Assert.assertEquals(service.yearMark(567, 7), 81.0);
}

From source file:Project10Test.java

@Ignore
@Test
public void simpleAddition() {
    Assert.assertEquals(service.add(3, 6), 9);
}

From source file:com.tracy.designprinciples.polymorphism.PolyTest.java

@Test
public void polyTest() {

    Assert.assertEquals(service.payment(45), 57375.0);

}

From source file:com.comcast.viper.flume2storm.connection.KryoNetParametersTest.java

@Test
public void testEmpty() throws Exception {
    KryoNetParameters params = KryoNetParameters.from(new BaseConfiguration());
    Assert.assertEquals(KryoNetParameters.CONNECTION_TIMEOUT_DEFAULT, params.getConnectionTimeout());
    Assert.assertEquals(KryoNetParameters.RETRY_SLEEP_DELAY_DEFAULT, params.getRetrySleepDelay());
    Assert.assertEquals(KryoNetParameters.RECONNECTION_DELAY_DEFAULT, params.getReconnectionDelay());
    Assert.assertEquals(KryoNetParameters.TERMINATION_TO_DEFAULT, params.getTerminationTimeout());
}

From source file:com.metamx.emitter.core.LoggingEmitterConfigTest.java

@Test
public void testDefaults() {
    final Properties props = new Properties();
    final ObjectMapper objectMapper = new ObjectMapper();
    final LoggingEmitterConfig config = objectMapper.convertValue(Emitters.makeLoggingMap(props),
            LoggingEmitterConfig.class);

    Assert.assertEquals(LoggingEmitter.class.getName(), config.getLoggerClass());
    Assert.assertEquals("debug", config.getLogLevel());
}