List of usage examples for junit.framework Assert assertEquals
static public void assertEquals(int expected, int actual)
From source file:org.ocpsoft.rewrite.servlet.config.LifecycleControlTest.java
@Test public void testProceed() throws Exception { HttpAction<HttpGet> action = get("/proceedy"); Assert.assertEquals(402, action.getStatusCode()); action = get("/proceed"); Assert.assertEquals(402, action.getStatusCode()); }
From source file:de.odysseus.staxon.json.stream.jackson.JacksonStreamSourceTest.java
@Test public void testArrayValue() throws IOException { StringReader reader = new StringReader("[\"bob\"]"); JacksonStreamSource source = new JacksonStreamSource(new JsonFactory().createParser(reader)); Assert.assertEquals(JsonStreamToken.START_ARRAY, source.peek()); source.startArray();// w w w .ja va 2s . co m Assert.assertEquals(JsonStreamToken.VALUE, source.peek()); Assert.assertEquals("bob", source.value().text); Assert.assertEquals(JsonStreamToken.END_ARRAY, source.peek()); source.endArray(); Assert.assertEquals(JsonStreamToken.NONE, source.peek()); source.close(); }
From source file:org.openmrs.module.formfilter.web.controller.PersonFormFilterEntryPortletControllerTest.java
/** * @see {@link PersonFormFilterEntryPortletController#populateModel(HttpServletRequest, Map)} *//*w w w.ja v a 2s . c o m*/ @Test @Verifies(value = "should return FormList", method = "populateModel(HttpServletRequest, Map)") public void populateModel_shouldReturnFormList() { PersonFormFilterEntryPortletController controller = new PersonFormFilterEntryPortletController(); ModelMap model = new ModelMap(); MockHttpServletRequest request = new MockHttpServletRequest(); model.addAttribute("patient", Context.getPatientService().getPatient(2)); model.addAttribute("person", Context.getPersonService().getPerson(2)); controller.populateModel(request, model); //TODO return form list using PersonFormFilterEntryPortletController#populateModel Assert.assertEquals(0, ((Map<Form, FormEntryHandler>) model.get("formToEntryUrlMap")).size()); }
From source file:com.brienwheeler.lib.spring.beans.SmartXmlBeanDefinitionReaderTest.java
@Test public void testFileNotFound() { try {/* w w w . j a va2 s .co m*/ SmartXmlBeanDefinitionReader reader = new SmartXmlBeanDefinitionReader( new DefaultListableBeanFactory()); reader.loadBeanDefinitions("classpath:this/is/bad.xml"); Assert.fail(); } catch (BeanDefinitionStoreException e) { Assert.assertEquals(FileNotFoundException.class, e.getCause().getClass()); } }
From source file:org.opencastproject.remotetest.server.DistributionDownloadRestEndpointTest.java
@Test public void testDocs() throws Exception { HttpGet get = new HttpGet(BASE_URL + "/docs.html?path=/distribution/download"); HttpResponse response = client.execute(get); Assert.assertEquals(200, response.getStatusLine().getStatusCode()); }
From source file:gaderian.test.services.impl.ConstructorAccessImpl.java
public void verify() throws AssertionFailedError { Assert.assertEquals(expectedMessage, actualMessage); }
From source file:com.github.neoio.net.message.staging.file.TestFileMessageStaging.java
@Test public void test_tempWrite() { ByteBuffer buffer = ByteBuffer.allocate(1024); buffer.put("Hello World".getBytes()); buffer.flip();//from ww w. ja va2s. c o m staging.writeTempWriteBytes(buffer); Assert.assertTrue(staging.hasTempWriteBytes()); buffer.clear(); staging.readTempWriteBytes(buffer); Assert.assertEquals("Hello World", new String(ArrayUtils.subarray(buffer.array(), 0, "Hello World".getBytes().length))); staging.resetTempWriteBytes(); Assert.assertFalse(staging.hasTempWriteBytes()); }
From source file:com.thinkberg.vfs.s3.tests.S3FileProviderTest.java
public void testDoCreateFileSystem() throws FileSystemException { FileObject object = ROOT.resolveFile("/"); Assert.assertEquals(BUCKETID, ((S3FileName) object.getName()).getRootFile()); }
From source file:com.taobao.ad.es.common.test.DTHttpJobExecutorTest.java
@Test public void testExecute() { //JobExecutor executor = new DTHttpJobExecutor(dsContextPath); //JobResult result = HttpJobExecutor.getInstance().execute(jobData, executor); JobResult result = JobResult.succcessResult(); Assert.assertEquals(result.isSuccess(), true); }
From source file:org.ocpsoft.rewrite.annotation.visit.AnnotationConfigurationTest.java
@Test public void testTypeAnnotation() throws Exception { HttpAction<HttpGet> action = get("/annotation/type"); Assert.assertEquals(204, action.getResponse().getStatusLine().getStatusCode()); }