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:ru.org.linux.gallery.ImageDaoIntegrationTest.java

/**
 *  galleryDao.getGalleryItems()./*from  w  w  w.  j av  a  2s  . co  m*/
 * ???,    3  GalleryDto.
 */
@Test
public void getGalleryItemsTest() {
    List<GalleryItem> galleryDtoList = imageDao.getGalleryItems(3);
    Assert.assertEquals(3, galleryDtoList.size());
}

From source file:com.sap.prd.mobile.ios.mios.ForkerTest.java

@Test
public void testStraightForward() throws Exception {

    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final PrintStream log = new PrintStream(out, true);

    try {//  w w  w.j  av a2  s  . c om

        Forker.forkProcess(log, new File(".").getAbsoluteFile(), "echo", "Hello World");

    } finally {
        log.close();
    }

    Assert.assertEquals("Hello World\n", new String(out.toByteArray()));
}

From source file:com.mirth.connect.model.converters.tests.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);
    Assert.assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
}

From source file:be.eliwan.profiling.jmx.BindJmxTest.java

@Test
public void testJmx() throws Exception {
    ObjectName mbean = new ObjectName("bean:name=profilingTest");

    mBeanServer.invoke(mbean, "clear", new Object[] {}, new String[] {});

    service.doSomething(1);//from ww w .  j av  a 2 s .  c  o  m
    service.doSomething(2);
    service.doSomething(3);

    System.out.println("" + mBeanServer.getAttribute(mbean, "Total"));
    Assert.assertEquals(3, ((OneContainer) mBeanServer.getAttribute(mbean, "Total")).getInvocationCount());
    System.out.println("" + mBeanServer.getAttribute(mbean, "GroupData"));

    //Thread.sleep(1000000000); // use this to test whether you can connect using JConsole
}

From source file:org.wso2.carbon.ganalytics.publisher.GoogleAnalyticsDataPublisherTest.java

@Test
public void testQueryParamBuilderPageView() throws Exception {
    GoogleAnalyticsData data = new GoogleAnalyticsData.DataBuilder("trackingId", "1", "clientId",
            GoogleAnalyticsConstants.HIT_TYPE_PAGEVIEW).setDocumentPath("/")
                    .setDocumentHostName("localhost.com").setDocumentTitle("Home Page").build();

    Assert.assertEquals("v=1&tid=trackingId&cid=clientId&t=pageview&dh=localhost.com&dp=%2F&dt=Home+Page",
            GoogleAnalyticsDataPublisher.buildPayloadString(data));
}

From source file:com.fluke.parser.YahooIntradayParserTest.java

@Test
public void testGetData() {
    YahooIntradayParser parser = new YahooIntradayParser();
    IntradayDetails details = parser.getIntradayDetails("infy");
    Assert.assertEquals("INFOSYS LIMITED", details.getMeta().getCompanyName());
}

From source file:org.openmrs.module.dictionarypublishing.api.db.DictionaryPublishingDAOTest.java

/**
 * @see {@link DictionaryPublishingDAO#getConceptsToExport(Date)}
 *///from   w ww .j a  va  2s.c om
@Test
@Verifies(value = "should return all concept modified or created after the specified date", method = "getConceptsToExport(Date)")
public void getConceptsToExport_shouldReturnAllConceptModifiedOrCreatedAfterTheSpecifiedDate()
        throws Exception {
    Assert.assertEquals(22,
            dao.getConceptsToExport(
                    new SimpleDateFormat(MetadataSharingConsts.DATE_FORMAT).parse("2008-08-15 00:00:00"))
                    .size());
}

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

@Test
public void testToXml2() throws Exception {
    String input = Base64//from   www .ja  v  a 2  s  .  c  o  m
            .encodeBase64String(FileUtils.readFileToByteArray(new File("tests/test-dicom-input-2.dcm")));
    String output = FileUtils.readFileToString(new File("tests/test-dicom-output-2.xml"));
    DICOMSerializer serializer = new DICOMSerializer();
    Assert.assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
}

From source file:com.github.capone.protocol.crypto.VerifyKeyTest.java

@Test
public void keyFromValidStringSucceeds() throws VerifyKey.InvalidKeyException {
    key = VerifyKey.fromString(StringUtils.repeat("a", SigningKey.BYTES * 2));
    Assert.assertEquals(StringUtils.repeat("a", SigningKey.BYTES * 2), key.toString());
}

From source file:be.eliwan.profiling.jmx.BindAopTest.java

@Test
public void testAopJmx() throws Exception {
    ObjectName mbean = new ObjectName("bean:name=profilingAopTest");

    mBeanServer.invoke(mbean, "clear", new Object[] {}, new String[] {});

    service.doSomething(1);/*  w  ww. java  2 s .  c  om*/
    service.doSomething(2);
    service.doSomething(3);

    System.out.println("" + mBeanServer.getAttribute(mbean, "Total"));
    Assert.assertEquals(3, ((OneContainer) mBeanServer.getAttribute(mbean, "Total")).getInvocationCount());
    System.out.println("" + mBeanServer.getAttribute(mbean, "GroupData"));

    //Thread.sleep(1000000000); // use this to test whether you can connect using JConsole
}