List of usage examples for junit.framework Assert assertEquals
static public void assertEquals(int expected, int actual)
From source file:com.scaleunlimited.classify.vectors.WritableComparableVectorTest.java
private void compareVectors(Vector vector1, Vector vector2) { Assert.assertEquals(vector1.size(), vector2.size()); for (int i = 0; i < vector1.size(); i++) { Assert.assertEquals(vector1.getQuick(i), vector2.getQuick(i)); }/* ww w .java 2s . c o m*/ }
From source file:com.comcast.viper.flume2storm.connection.KryoNetConnectionParametersTest.java
/** * Test {@link KryoNetConnectionParameters} with empty configuration * /* ww w . jav a 2 s . c o m*/ * @throws F2SConfigurationException * If the configuration is invalid */ @Test public void testEmpty() throws F2SConfigurationException { KryoNetConnectionParameters params = KryoNetConnectionParameters.from(new BaseConfiguration()); String localAddress; try { localAddress = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { localAddress = KryoNetConnectionParameters.ADDRESS_DEFAULT; } Assert.assertEquals(localAddress, params.getAddress()); Assert.assertEquals(KryoNetConnectionParameters.PORT_DEFAULT, params.getPort()); Assert.assertEquals(KryoNetConnectionParameters.OBJECT_BUFFER_SIZE_DEFAULT, params.getObjectBufferSize()); Assert.assertEquals(KryoNetConnectionParameters.WRITE_BUFFER_SIZE_DEFAULT, params.getWriteBufferSize()); }
From source file:almira.weblogic.JndiInjectorTest.java
@Test public void bindsPairToJndiContext() throws NamingException { injector.bind(PROPERTIES);/*from w ww . j a v a 2 s . c om*/ Assert.assertEquals("v1", ic.lookup(JndiInjector.ROOT + "/p1")); Assert.assertEquals("v2", ic.lookup(JndiInjector.ROOT + "/p2")); Assert.assertEquals("v3", ic.lookup(JndiInjector.ROOT + "/p3")); }
From source file:org.jrecruiter.web.actions.BaseActionTest.java
public void testExecute() throws Exception { LogoutAction logoutAction = new LogoutAction(); JobService jobService = Mockito.mock(JobService.class); String ret = logoutAction.execute(); Assert.assertEquals("success", ret); }
From source file:org.ocpsoft.rewrite.gwt.config.HistoryRewriteConfigurationTest.java
@Test public void testContextPathServedFromHeadRequest() { HttpAction<HttpHead> action = head("/?org.ocpsoft.rewrite.gwt.history.contextPath"); Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode()); Assert.assertEquals(action.getContextPath(), action.getResponseHeaderValues("org.ocpsoft.rewrite.gwt.history.contextPath").get(0)); }
From source file:org.ocpsoft.rewrite.servlet.config.ParameterWildcardConfiguration2Test.java
@Test public void testWildcardParameterCrossesSlashBoundary() throws Exception { HttpAction<HttpGet> action = get("/test/next/path.txt"); Assert.assertEquals(200, action.getStatusCode()); }
From source file:net.bryansaunders.dl2.service.impl.InfoServiceImplIT.java
/** * Tests that the Correct Information was Returned from the Information Service. *//*w ww .j a v a 2 s. c om*/ @Test public void ifInformationCorrectThenPass() throws Exception { final String json = given().expect().statusCode(HttpStatus.SC_OK).when().get(RestApiTest.URL_ROOT + "/info") .asString(); Assert.assertNotNull(json); final ObjectMapper objMapper = new ObjectMapper(); final Information info = objMapper.readValue(json, new TypeReference<Information>() { }); Assert.assertNotNull(info); Assert.assertEquals("DL2", info.getName()); Assert.assertNotNull(info.getDescription()); Assert.assertNotNull(info.getVersion()); }
From source file:$.DummyDaoImplTest.java
@Test public void saveOrUpdate() { Dummy d = new Dummy(); d.setName("dummy"); dummyDao.save(d);// w w w .j a va 2 s .co m Assert.assertEquals(d, dummyDao.find(d.getId())); d.setName("otherDummy"); dummyDao.save(d); Assert.assertEquals("otherDummy", dummyDao.find(d.getId()).getName()); }
From source file:org.ocpsoft.rewrite.servlet.config.ParameterConfiguration2Test.java
@Test public void testParameterCanBeConfigured2() throws Exception { HttpAction<HttpGet> action = get("/badconfig"); Assert.assertEquals(404, action.getResponse().getStatusLine().getStatusCode()); }
From source file:com.collective.celos.ci.deploy.JScpWorkerTest.java
@Test public void getURIRespectingUsernameDoesntChange2() throws FileSystemException, URISyntaxException { JScpWorker worker = new JScpWorker("uname"); URI uri = worker.getURIRespectingUsername(URI.create("sftp://user@server/path1/path2")); Assert.assertEquals(uri, URI.create("sftp://user@server/path1/path2")); }