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.ocpsoft.rewrite.servlet.config.JoinRequestBindingConfigurationTest.java

@Test
public void testWithRequestBinding() throws Exception {

    HttpAction<HttpGet> action = get("/rb/value");
    Assert.assertEquals(201, action.getResponse().getStatusLine().getStatusCode());
}

From source file:com.clover.sdk.v3.apps.AppNotificationTest.java

/**
 * Tests serializing to and from a {@code Parcel}.
 *///w  w w. j  a va2 s  . com
public void testParcelable() throws Exception {
    AppNotification expected = new AppNotification("sale", "Sunday");
    Parcel p = Parcel.obtain();
    expected.writeToParcel(p, 0);

    p.setDataPosition(0);
    AppNotification actual = AppNotification.CREATOR.createFromParcel(p);
    Assert.assertEquals(expected, actual);
}

From source file:org.ocpsoft.rewrite.servlet.config.EncodeQueryConfigurationTest.java

@Test
public void testQueryEncoding() throws Exception {
    HttpAction<HttpGet> action = get("/encodequery?foo=bar");
    Assert.assertEquals(210, action.getResponse().getStatusLine().getStatusCode());
    Assert.assertTrue(action.getCurrentContextRelativeURL().contains("/encodequery?c="));
}

From source file:org.ocpsoft.rewrite.servlet.config.ParameterConfigurationTest.java

@Test
public void testPathParameterRequestBinding() throws Exception {
    HttpAction<HttpGet> action = get("/lincoln/order/3");
    Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
    Assert.assertEquals("lincoln", action.getResponseHeaderValues("User-Name").get(0));
    Assert.assertEquals("3", action.getResponseHeaderValues("Order-ID").get(0));
}

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

@Test
public void testJsonExpandConverterNoConversion() throws Exception {
    JsonExpandConverter converter = new JsonExpandConverter(Sets.<String>newHashSet());
    String jsonExample = "{\"id\":\"134f50faa804d30\",\"change\":\"{\\\"daystamp\\\":\\\"20140901\\\",\\\"context\\\":\\\"none\\\"}\",\"origin\":\"dc\"}\n"
            + "{\"id\":\"134f50faa804d31\",\"change\":\"{\\\"daystamp\\\":\\\"20140902\\\",\\\"context\\\":\\\"none\\\"}\",\"origin\":\"dc\"}";

    InputStream inputStream = IOUtils.toInputStream(jsonExample);
    FixFile expanded = converter.convert(null, new FixFile(inputStream));
    String expandedStr = IOUtils.toString(expanded.getContent());

    Assert.assertEquals(jsonExample, expandedStr);
}

From source file:com.mirth.connect.model.converters.tests.NCPDPSerializerTest.java

@Test
public void test51RequestFromXml() throws Exception {
    String input = FileUtils.readFileToString(new File("tests/test-ncpdp-51-request-output.xml"));
    String output = FileUtils.readFileToString(new File("tests/test-ncpdp-51-request-input.txt"));
    NCPDPSerializer serializer = new NCPDPSerializer(defaultProperties);
    Assert.assertEquals(output, serializer.fromXML(input));
}

From source file:com.mirth.connect.plugins.datatypes.hl7v2.test.HL7SerializerTest.java

@Test
public void testToXmlDefault() throws Exception {
    String input = FileUtils.readFileToString(new File("tests/test-hl7-input.txt"));
    String output = FileUtils.readFileToString(new File("tests/test-hl7-output.xml"));
    ER7Serializer serializer = new ER7Serializer(defaultProperties.getSerializerProperties());
    Assert.assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
}

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

@Test
public void getTasks_shouldReturnAllTasks() throws Exception {
    List<TaskDef> tasks = tasksService.getTasks();

    Assert.assertNotNull(tasks);//from  w ww. ja v a 2 s  . c o  m
    Assert.assertEquals(3, tasks.size());

    for (TaskDef taskDef : tasks) {
        String name = taskDef.getName();
        Assert.assertTrue(
                name.equals("Forms Bluetooth") || name.equals("Data Export") || name.equals("Forms SMS"));
    }
}

From source file:org.ocpsoft.rewrite.servlet.config.JoinOtherwiseConfigurationTest.java

@Test
public void testNormalJoinConfigurationDefersToOtherwiseOnForward() throws Exception {
    HttpAction<HttpGet> action = get("/p/rewrite");
    Assert.assertEquals(420, action.getResponse().getStatusLine().getStatusCode());
}

From source file:com.google.api.ads.adwords.awreporting.model.persistence.sql.SqlAuthTokenPersisterTest.java

/**
 * Tests the persistence and retrieval of the token.
 *///from ww w  .j  av  a 2 s. com
@Test
public void testTokenPersistence() {

    AuthMcc authMcc = new AuthMcc("1234", "Name", "4321", "scope");
    this.authTokenPersister.persistAuthToken(authMcc);

    AuthMcc authToken = this.authTokenPersister.getAuthToken("1234");
    Assert.assertNotNull(authToken);
    Assert.assertEquals("4321", authToken.getAuthToken());

    authToken = this.authTokenPersister.getAuthToken("12345");
    Assert.assertNull(authToken);

    authMcc = new AuthMcc("1234", "Name", "54321", "scope");
    this.authTokenPersister.persistAuthToken(authMcc);

    authToken = this.authTokenPersister.getAuthToken("1234");
    Assert.assertNotNull(authToken);
    Assert.assertEquals("54321", authToken.getAuthToken());
}