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:de.itsvs.cwtrpc.controller.config.RemoteServiceModuleConfigBeanDefinitionParserTest.java

@Test
public void test1() {
    RemoteServiceModuleConfig config;/*from   www .j a  v  a2 s  .com*/

    config = appContext.getBean("serviceModule101", RemoteServiceModuleConfig.class);
    Assert.assertEquals("myModule5", config.getName());
    Assert.assertNull(config.getResponseCompressionEnabled());
    Assert.assertNull(config.getRpcTokenProtectionEnabled());
    Assert.assertNull(config.getRpcTokenValidatorName());
    Assert.assertEquals(0, config.getServiceGroupConfig().getServiceConfigs().size());
    Assert.assertEquals(0, config.getServiceGroupConfig().getChildGroupConfigs().size());
}

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

@Test
public void testFromConfiguration() throws Exception {
    int connectionTo = TestUtils.getRandomPositiveInt(100000);
    int retrySleepDelay = TestUtils.getRandomPositiveInt(100000);
    int reconnectionDelay = TestUtils.getRandomPositiveInt(100000);
    int terminationTo = TestUtils.getRandomPositiveInt(100000);
    Configuration config = new BaseConfiguration();
    config.addProperty(KryoNetParameters.CONNECTION_TIMEOUT, connectionTo);
    config.addProperty(KryoNetParameters.RETRY_SLEEP_DELAY, retrySleepDelay);
    config.addProperty(KryoNetParameters.RECONNECTION_DELAY, reconnectionDelay);
    config.addProperty(KryoNetParameters.TERMINATION_TO, terminationTo);
    KryoNetParameters params = KryoNetParameters.from(config);
    Assert.assertEquals(connectionTo, params.getConnectionTimeout());
    Assert.assertEquals(retrySleepDelay, params.getRetrySleepDelay());
    Assert.assertEquals(reconnectionDelay, params.getReconnectionDelay());
    Assert.assertEquals(terminationTo, params.getTerminationTimeout());
}

From source file:org.jasig.schedassist.impl.oraclecalendar.OracleGUIDSourceImplTest.java

@Test
public void testKnownUser() throws Exception {
    OracleCalendarUserAccount user = new OracleCalendarUserAccount();
    user.setUsername("npblair");
    user.setCtcalxitemid("20000:01182");
    String guid = this.oracleGUIDSource.getOracleGUID(user);
    Assert.assertNotNull(guid);/* w  w w  .j  a  va  2s  . c  om*/
    Assert.assertEquals("200000118219869582153896", guid);
}

From source file:com.wxxr.nirvana.json.TestUtils.java

public static void assertEquals(URL source, String text) throws Exception {
    String writerString = TestUtils.normalize(text, true);
    String bufferString = TestUtils.normalize(readContent(source), true);
    Assert.assertEquals(bufferString, writerString);
}

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

@Test
public void testTransformModifiesIncomingValue() throws Exception {
    HttpAction<HttpGet> action = get("/constraint/ONE/TWO");
    Assert.assertEquals("ONE", action.getResponseHeaderValues("one").get(0));
    Assert.assertEquals("two", action.getResponseHeaderValues("two").get(0));
}

From source file:org.openmrs.module.printer.PrinterServiceComponentTest.java

@Test
public void testSavePrinter() {

    Printer printer = new Printer();
    printer.setName("Another Test Printer");
    printer.setIpAddress("192.1.1.8");
    printer.setType(PrinterType.ID_CARD);

    printerService.savePrinter(printer);

    List<Printer> printers = printerService.getAllPrinters();

    // there is already a test printer in the dataset, so there should be two printers now
    Assert.assertEquals(2, printers.size());

    // make sure the audit fields have been set
    Assert.assertNotNull(printer.getDateCreated());
    Assert.assertNotNull(printer.getCreator());
    Assert.assertNotNull(printer.getUuid());
}

From source file:org.ocpsoft.rewrite.cdi.bridge.CdiMultipleFeaturesTest.java

@Test
public void testRewriteRedirect301() throws Exception {
    HttpAction<HttpGet> action = get("/redirect-301");
    Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
    Assert.assertEquals("/outbound-rewritten", action.getCurrentContextRelativeURL());
}

From source file:com.netflix.simianarmy.conformity.TestSameZonesInElbAndAsg.java

@Test
public void testZoneMatch() {
    Cluster cluster = new Cluster("cluster2", "us-east-1", new AutoScalingGroup("asg2"));
    Conformity result = check(cluster);/*w  w w. ja v a 2s . com*/
    Assert.assertEquals(result.getRuleId(), getName());
    Assert.assertEquals(result.getFailedComponents().size(), 0);
}

From source file:com.currencyfair.minfraud.MinFraudImplTest.java

@Test
public void testRiskScoreResponseIsExtractedFromValidHttpResponse() throws Exception {
    StringEntity responseEntity = new StringEntity(VALID_RESPONSE, ContentType.TEXT_PLAIN);
    HttpMethodFactory methodFactory = expectCreateHttpPost();
    CloseableHttpResponse httpResponse = EasyMock.createMock(CloseableHttpResponse.class);
    expectHttpResponse(httpResponse, 200, responseEntity);
    expectClose(httpResponse, null);//  w w  w  .j a v a2 s. com
    HttpClient client = expectHttpInvocation(httpResponse);
    EasyMock.replay(httpResponse);
    minFraudImpl.setHttpClient(client);
    minFraudImpl.setMethodFactory(methodFactory);
    minFraudImpl.setEndpoint(ENDPOINT);
    RiskScoreResponse response = minFraudImpl.calculateRisk(newRiskScoreRequest());
    Assert.assertNotNull(response);
    Assert.assertEquals(new BigDecimal("23.2"), response.getRiskScore());
    Assert.assertTrue(response.getGeoIpDetails().isCountryMatch());
    Assert.assertFalse(response.getGeoIpDetails().isHighRiskCountry());
    Assert.assertEquals("IE", response.getGeoIpDetails().getIpCountryCode());
    Assert.assertEquals(Integer.valueOf(48), response.getGeoIpDetails().getDistance());
    EasyMock.verify(httpResponse);
}

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

@Test
public void testNullBinding1() throws Exception {
    HttpAction<HttpGet> action = get("/foo/");
    Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
}