List of usage examples for junit.framework Assert assertEquals
static public void assertEquals(int expected, int actual)
From source file:com.mirth.connect.plugins.datatypes.ncpdp.test.NCPDPSerializerTest.java
@Test public void test51RequestToXml() throws Exception { String input = FileUtils.readFileToString(new File("tests/test-ncpdp-51-request-input.txt")); String output = FileUtils.readFileToString(new File("tests/test-ncpdp-51-request-output.xml")); NCPDPSerializer serializer = new NCPDPSerializer(defaultProperties.getSerializerProperties()); Assert.assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input))); }
From source file:fr.mailjet.event.JsonParameterTest.java
@Test(timeout = 10000L) public void click() throws IOException { ClickMailjetEvent event = new ClickMailjetEvent("click", 1344859910L, "olivier.pitton@gmail.com", "390319834", "241755226", "custom", "82.229.159.100", "FR", "http://www.infoq.com/articles/azul_gc_in_detail", "Mozilla\5.0 (X11; Linux x86_64) AppleWebKit\537.1 (KHTML, like Gecko) Chrome\21.0.1180.75 Safari\537.1"); JsonNode node = toNode(event);/*from w ww. j a v a2 s. c o m*/ checkAMailjetEvent(event, node); checkACampaignEvent(event, node); Assert.assertEquals(getString(node, "ip"), event.getIp()); Assert.assertEquals(getString(node, "geo"), event.getGeo()); Assert.assertEquals(getString(node, "agent"), event.getAgent()); Assert.assertEquals(getString(node, "url"), event.getUrl()); }
From source file:org.codehaus.grepo.statistics.service.MethodStatisticsAspectTest.java
@Test public void testInvocations() { testInterface.statsMethod1(216L);/*from www . j a v a 2 s . c o m*/ testInterface.statsMethod1(430L); testInterface.statsMethod1(10L); Assert.assertEquals(1, collection.size()); StatisticsCollectionEntry entry = collection.get(TestStatisticsInterface.class.getName() + ".statsMethod1"); Assert.assertNotNull(entry); Assert.assertEquals(3, entry.getRecentStatisticsEntriesReadOnly().size()); for (StatisticsEntry e : entry.getRecentStatisticsEntriesReadOnly()) { logger.info(e.toString()); } }
From source file:com.collective.celos.ci.deploy.JScpWorkerTest.java
@Test public void getURIRespectingUsernameDoesntChange1() 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")); }
From source file:com.collective.celos.ci.testing.fixtures.compare.RecursiveFsObjectComparerTest.java
@Test public void testSubDirs() throws Exception { FixDir dir1 = createParentDir1();/*from www. j a v a 2 s. com*/ FixDir dir2 = createParentDir1(); FixObjectCompareResult compareResult = new RecursiveFsObjectComparer(Utils.wrap(dir2), Utils.wrap(dir1)) .check(null); Assert.assertEquals(compareResult.getStatus(), FixObjectCompareResult.Status.SUCCESS); }
From source file:com.liferay.mobile.push.DeviceRegistrationTest.java
@Test public void registerWithRegistrationId() throws Exception { final String registrationId = "123"; push.onSuccess(new Push.OnSuccess() { @Override//www . ja v a 2 s . c o m public void onSuccess(JSONObject device) { try { Assert.assertNotNull(device); Assert.assertEquals(Push.ANDROID, device.getString("platform")); Assert.assertEquals(registrationId, device.getString("token")); } catch (JSONException je) { Assert.fail(); } } }).onFailure(new Push.OnFailure() { @Override public void onFailure(Exception e) { Assert.fail(e.getMessage()); } }).register(registrationId); Robolectric.runBackgroundTasks(); }
From source file:loaders.LoadQueryTransformerTest.java
@Test public void testReplaceSingleCondition() throws Exception { String query = "select id as id from user where id = ${param1}"; HashMap<String, Object> params = new HashMap<String, Object>(); AbstractDbDataLoader.QueryPack queryPack = prepareQuery(query, new BandData(""), params); System.out.println(queryPack.getQuery()); Assert.assertFalse(queryPack.getQuery().contains("${")); writeParams(queryPack);// www . jav a 2s . c om params.put("param1", "param1"); queryPack = prepareQuery(query, new BandData(""), params); System.out.println(queryPack.getQuery()); Assert.assertEquals(1, StringUtils.countMatches(queryPack.getQuery(), "?")); writeParams(queryPack); }
From source file:com.connectsdk.service.google_cast.CastServiceChannelTest.java
@Test public void testGetNamespace() { Assert.assertEquals("urn:x-cast:com.connectsdk", channel.getNamespace()); }
From source file:org.ocpsoft.rewrite.cdi.resolver.CdiBeanNameResolverTest.java
@Test public void testCdiBeanNameResolver() throws Exception { HttpAction<HttpGet> action = get("/name/christian"); Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode()); Assert.assertEquals("/hello/CHRISTIAN", action.getCurrentContextRelativeURL()); }
From source file:org.openxdata.server.service.impl.PermissionServiceTest.java
@Test public void getPermissions_shouldReturnAllPermissions() throws Exception { List<Permission> permissions = permissionService.getPermissions(); Assert.assertNotNull(permissions);/*from w ww . j av a2 s . co m*/ Assert.assertEquals(75, permissions.size()); }