List of usage examples for junit.framework Assert assertEquals
static public void assertEquals(int expected, int actual)
From source file:com.metamx.emitter.core.HttpEmitterConfigTest.java
@Test public void testDefaults() { final Properties props = new Properties(); props.put("com.metamx.emitter.http.url", "http://example.com/"); final ObjectMapper objectMapper = new ObjectMapper(); final HttpEmitterConfig config = objectMapper.convertValue(Emitters.makeHttpMap(props), HttpEmitterConfig.class); Assert.assertEquals(60000, config.getFlushMillis()); Assert.assertEquals(300, config.getFlushCount()); Assert.assertEquals("http://example.com/", config.getRecipientBaseUrl()); Assert.assertEquals(null, config.getBasicAuthentication()); Assert.assertEquals(BatchingStrategy.ARRAY, config.getBatchingStrategy()); Assert.assertEquals(5 * 1024 * 1024, config.getMaxBatchSize()); Assert.assertEquals(250 * 1024 * 1024, config.getMaxBufferSize()); }
From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.PatientsTest.ComaNGTest.java
@Test public void createComaPatients() { Assert.assertEquals(service.createComa().get(0).getBedNumber(), "45"); }
From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.MedicineTest.MedicineNGTest.java
@Test public void createMedicine() { Assert.assertEquals(service.createMedicine().get(0).getQuantity(), 5); }
From source file:com.sap.prd.mobile.ios.mios.FileUtilsTest.java
@Test public void testGetDelta() throws Exception { Assert.assertEquals("source/dir", FileUtils.getDelta(new File("/home/abc/def"), new File("/home/abc/def/source/dir"))); }
From source file:crawlercommons.fetcher.file.SimpleFileFetcherTest.java
@Test public void testSimpleFetching() throws Exception { URI uri = new File("src/test/resources/text-file.txt").toURI(); String url = uri.toURL().toExternalForm(); SimpleFileFetcher fetcher = new SimpleFileFetcher(); FetchedResult result = fetcher.get(url); Assert.assertEquals(0, result.getNumRedirects()); Assert.assertEquals(HttpStatus.SC_OK, result.getStatusCode()); String fetchedContent = new String(result.getContent(), "us-ascii"); Assert.assertEquals("Now is the time for all good men to come to the aid of their country.", fetchedContent);/*from w w w .j av a2s . co m*/ }
From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.MedicalAidTest.MedicalAidNGTest.java
@Test public void createMedicalAid() { Assert.assertEquals(service.createMedicalAid().get(0).getLastName(), "Shepard"); }
From source file:com.thinkberg.vfs.s3.tests.S3FileNameTest.java
public void testGetBucketFromUri() throws FileSystemException { String uriString = ROOT + "/junk.txt"; String bucketId = URI.create(uriString).getHost(); FileName fileName = S3FileNameParser.getInstance().parseUri(null, null, uriString); Assert.assertEquals(bucketId, ((S3FileName) fileName).getRootFile()); }
From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.EmployeesTest.CleaningStaffNGTest.java
@Test public void createCleaner() { Assert.assertEquals(service.createCleaner().get(0).getAge(), 24); }
From source file:com.karriem.tp2.immutable_domain_model_assignment.DomainTest.EquipmentTest.MedicalEquipmentNGTest.java
@Test public void createMedical() { Assert.assertEquals(service.createMedicalEquipment().get(0).getCondition(), "Used"); }
From source file:org.slc.sli.ingestion.util.spring.MessageSourceHelperTest.java
@Test public void testMessageSourceHelper() { StaticMessageSource ms = new StaticMessageSource(); ms.addMessage("MSG1", Locale.getDefault(), "This is message 1"); ms.addMessage("MSG2", Locale.getDefault(), "This is message 2 with param: {0}"); String actual = MessageSourceHelper.getMessage(ms, "MSG1"); Assert.assertEquals("This is message 1", actual); actual = MessageSourceHelper.getMessage(ms, "MSG1", "Test Param"); Assert.assertEquals("This is message 1", actual); actual = MessageSourceHelper.getMessage(ms, "MSG2", "Test Param"); Assert.assertEquals("This is message 2 with param: Test Param", actual); }