List of usage examples for junit.framework Assert assertEquals
static public void assertEquals(int expected, int actual)
From source file:org.ocpsoft.rewrite.faces.resolver.FacesBeanNameResolverTest.java
@Test public void testFacesBeanNameResolverFeatures() throws Exception { HttpAction<HttpGet> action = get("/name/christian"); Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode()); Assert.assertTrue(action.getResponseContent().contains("Name = [christian]")); Assert.assertTrue(action.getResponseContent().contains("Uppercase = [CHRISTIAN]")); }
From source file:org.atemsource.atem.impl.pojo.PrimitiveAttributeFactoryTest.java
@Test public void testIntegerProperty() { EntityType entityType = entityTypeRepository.getEntityType(EntityB.class); SingleAttribute attribute = (SingleAttribute) entityType.getAttribute("integer"); Assert.assertNotNull(attribute);//from ww w . j a va2 s . c o m EntityB b = new EntityB(); attribute.setValue(b, 1); Assert.assertEquals(1, attribute.getValue(b)); }
From source file:org.openxdata.server.service.impl.MobileMenuTextServiceTest.java
@Test public void getMobileMenuText_shouldReturnAllMobileMenuText() throws Exception { List<MobileMenuText> textList = utilityService.getMobileMenuText("en"); Assert.assertNotNull(textList);// ww w .j a va 2 s . c o m Assert.assertEquals(1, textList.size()); Assert.assertEquals("Login", textList.get(0).getMenuText()); }
From source file:com.google.api.ads.adwords.awreporting.model.definitions.ReportPlaceholderFeedItemTest.java
@Override protected void testFirstEntry(ReportPlaceholderFeedItem first) { Assert.assertEquals(128401167L, first.getCampaignId().longValue()); Assert.assertEquals(7788826047L, first.getAdGroupId().longValue()); Assert.assertEquals(421887, first.getFeedId().longValue()); Assert.assertEquals(1785447, first.getFeedItemId().longValue()); Assert.assertEquals(1, first.getFeedPlaceholderType()); Assert.assertEquals("Les Ecuries De Kerballan - Gommenech", first.getAccountDescriptiveName()); Assert.assertEquals(0.7, first.getCost().doubleValue()); Assert.assertEquals(9, first.getClicks().intValue()); Assert.assertEquals(74, first.getImpressions().intValue()); Assert.assertEquals(0, first.getConversions().intValue()); Assert.assertEquals(BigDecimalUtil.parseFromNumberString("12.16"), BigDecimalUtil.parseFromNumberString(first.getCtr())); Assert.assertEquals(9.46, first.getAvgCpm().doubleValue()); Assert.assertEquals(0.08, first.getAvgCpc().doubleValue()); Assert.assertEquals(BigDecimalUtil.parseFromNumberString("2.2"), BigDecimalUtil.parseFromNumberString(first.getAvgPosition())); Assert.assertEquals("Headline", first.getClickType()); Assert.assertEquals("Search Network", first.getAdNetwork()); }
From source file:philaman.cput.cardealer.test.repository.OfferedServiceRepositoryTest.java
@Test(dependsOnMethods = "createOfferedService") public void readOfferedService() { repo = ctx.getBean(OfferedServiceRepository.class); OfferedService offeredService = repo.findOne(id); Assert.assertEquals("30 min", offeredService.getDurationhr()); }
From source file:com.google.api.ads.adwords.awreporting.model.definitions.ReportAdDefinitionTest.java
/** * @see com.google.api.ads.adwords.awreporting.model.definitions. * AbstractReportDefinitionTest#testFirstEntry * (com.google.api.ads.adwords.awreporting.model.entities.Report) *///from w w w .ja v a2 s .com @Override protected void testFirstEntry(ReportAd first) { Assert.assertEquals(1001270004L, first.getAccountId().longValue()); Assert.assertEquals("2013-05-01", first.getDay()); Assert.assertEquals(9.39, first.getCost().doubleValue()); Assert.assertEquals(32L, first.getClicks().longValue()); Assert.assertEquals(1258L, first.getImpressions().longValue()); Assert.assertEquals(0L, first.getConversions().longValue()); Assert.assertEquals(2.54, first.getCtrBigDecimal().doubleValue()); Assert.assertEquals(7.46, first.getAvgCpm().doubleValue()); Assert.assertEquals(0.29, first.getAvgCpc().doubleValue()); Assert.assertEquals(2.12, first.getAvgPositionBigDecimal().doubleValue()); Assert.assertEquals("EUR", first.getCurrencyCode()); Assert.assertEquals(132958027L, first.getCampaignId().longValue()); Assert.assertEquals(6113972227L, first.getAdGroupId().longValue()); Assert.assertEquals(20549800987L, first.getAdId().longValue()); Assert.assertEquals("enabled", first.getAdState()); Assert.assertEquals("approved", first.getCreativeApprovalStatus()); Assert.assertEquals("CICAgICQ_qa2YBDIARjIASgBMggjtZBfNj2xLw", first.getImageAdUrl()); }
From source file:com.google.api.ads.adwords.awreporting.model.definitions.ReportUrlDefinitionTest.java
/** * @see com.google.api.ads.adwords.awreporting.model.definitions. * AbstractReportDefinitionTest#testFirstEntry( * com.google.api.ads.adwords.awreporting.model.entities.Report) *///from ww w. java 2s .com @Override protected void testFirstEntry(ReportUrl first) { Assert.assertEquals(6421165252L, first.getAdGroupId().longValue()); Assert.assertEquals(9572882832L, first.getAccountId().longValue()); // Assert.assertEquals("2013-05-01", first.getDay()); // Assert.assertEquals("9.39", first.getCost()); // Assert.assertEquals(32L, first.getClicks().longValue()); // Assert.assertEquals(1258L, first.getImpressions().longValue()); // Assert.assertEquals(0L, first.getConversions().longValue()); // Assert.assertEquals("2.54", first.getCtr()); // Assert.assertEquals("7.46", first.getAvgCpm()); // Assert.assertEquals("0.29", first.getAvgCpc()); // Assert.assertEquals("2.12", first.getAvgPosition()); // Assert.assertEquals("EUR", first.getCurrencyCode()); // // Assert.assertEquals(132958027L, first.getCampaignId().longValue()); // Assert.assertEquals(6113972227L, first.getAdGroupId().longValue()); }
From source file:org.ocpsoft.rewrite.servlet.config.RequestConstraintTransformTest.java
@Test public void testUnsatisfiedConstraintPreventsRuleExecution() throws Exception { HttpAction<HttpGet> action = get("/constraint/ONE/2"); Assert.assertEquals(404, action.getResponse().getStatusLine().getStatusCode()); }
From source file:com.liferay.mobile.push.ReceivePushNotificationTest.java
@Test public void isIntentRegistered() { ShadowApplication app = Robolectric.getShadowApplication(); Intent intent = new Intent("com.google.android.c2dm.intent.RECEIVE"); List<BroadcastReceiver> receivers = app.getReceiversForIntent(intent); Assert.assertEquals(1, receivers.size()); BroadcastReceiver receiver = receivers.get(0); receiver.onReceive(app.getApplicationContext(), intent); Intent startedIntent = app.peekNextStartedService(); String componentClassName = startedIntent.getComponent().getClassName(); Assert.assertEquals(PushNotificationsService.class.getCanonicalName(), componentClassName); }
From source file:org.deviceconnect.android.profile.restful.test.NormalProximityProfileTestCase.java
/** * ?????.//from w w w. j ava2 s. c o m * <pre> * ?HTTP * Method: PUT * Path: /proximity/ondeviceproximity?deviceid=xxxx&session_key=xxxx * </pre> * <pre> * ?? * result?0??????? * </pre> */ public void testOnDeviceProximity01() { try { JSONObject event = registerEventCallback(ProximityProfileConstants.ATTRIBUTE_ON_DEVICE_PROXIMITY); JSONObject proximity = event.getJSONObject(ProximityProfileConstants.PARAM_PROXIMITY); Assert.assertEquals(Double.valueOf(TestProximityProfileConstants.VALUE), proximity.getDouble(ProximityProfileConstants.PARAM_VALUE)); Assert.assertEquals(Double.valueOf(TestProximityProfileConstants.MIN), proximity.getDouble(ProximityProfileConstants.PARAM_MIN)); Assert.assertEquals(Double.valueOf(TestProximityProfileConstants.MAX), proximity.getDouble(ProximityProfileConstants.PARAM_MAX)); Assert.assertEquals(Double.valueOf(TestProximityProfileConstants.THRESHOLD), proximity.getDouble(ProximityProfileConstants.PARAM_THRESHOLD)); } catch (JSONException e) { fail("Exception in JSONObject." + e.getMessage()); } }