List of usage examples for junit.framework Assert assertTrue
static public void assertTrue(boolean condition)
From source file:com.ibm.sbt.services.client.connections.activities.ActivitiesByTagTest.java
@Test @org.junit.Ignore("Issue with Mime Depdency") public void testGetActivitiesByTag() throws ClientServicesException, XMLException, UnsupportedEncodingException { List<String> tags = new ArrayList<String>(); tags.add("fethard"); tags.add("ibmsbt"); Activity activity = createActivity(createActivityTitle(), tags, true); this.activity = null; String orgid = TestEnvironment.getProperty("customerid"); orgid = StringUtil.isEmpty(orgid) ? "*" : orgid; activity.addMember(Member.TYPE_ORGANIZATION, orgid, Member.ROLE_READER); //String userid = System.getProperty("UserIdAlt"); //activity.addMember(Member.TYPE_PERSON, userid, Member.ROLE_READER); //System.out.println(activity.toXmlString()); Map<String, String> parameters = new HashMap<String, String>(); parameters.put("nodetype", "activity"); parameters.put("tag", "fethard"); parameters.put("priority", "all"); parameters.put("completed", "yes"); EntityList<Activity> activities = activityService.getMyActivities(parameters); Assert.assertTrue(activities.size() > 0); Assert.assertEquals(activity.getActivityUuid(), activities.get(0).getActivityUuid()); Assert.assertEquals(2, activities.get(0).getTags().size()); ActivityService activityServiceAlt = new ActivityService(getAltEndpoint()); EntityList<Activity> activitiesAlt = activityServiceAlt.getMyActivities(parameters); Assert.assertTrue(activitiesAlt.size() > 0); Assert.assertEquals(activity.getActivityUuid(), activitiesAlt.get(0).getActivityUuid()); Assert.assertEquals(2, activitiesAlt.get(0).getTags().size()); }
From source file:org.obiba.onyx.core.service.impl.DefaultUserPasswordServiceImplTest.java
@Test public void testGeneratePassword() { expect(iPasswordValidationStrategyMock.generatePassword(user)).andReturn("password"); replay(iPasswordValidationStrategyMock); String password = userPasswordService.generatePassword(user); verify(iPasswordValidationStrategyMock); Assert.assertTrue(password.equals("password")); }
From source file:com.connectsdk.service.sessions.WebOSWebAppSessionTest.java
@Test public void testPrevious() throws JSONException { ResponseListener<Object> listener = Mockito.mock(ResponseListener.class); session.previous(listener);/*from w w w . j a va 2 s . c o m*/ Robolectric.runUiThreadTasksIncludingDelayedTasks(); ArgumentCaptor<JSONObject> argPacket = ArgumentCaptor.forClass(JSONObject.class); ArgumentCaptor<JSONObject> argPayload = ArgumentCaptor.forClass(JSONObject.class); Mockito.verify(socket).sendMessage(argPacket.capture(), argPayload.capture()); Mockito.verify(listener).onSuccess(null); JSONObject packet = argPacket.getValue(); JSONObject payload = argPayload.getValue(); Assert.assertNull(payload); Assert.assertTrue(packet.has("payload")); Assert.assertEquals("playPrevious", packet.getJSONObject("payload").getJSONObject("mediaCommand").getString("type")); Assert.assertEquals("connectsdk.mediaCommand", packet.getJSONObject("payload").getString("contentType")); }
From source file:com.flipkart.bifrost.SampleUsageTest.java
@Test public void testSendReceive() throws Exception { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); Connection connection = new Connection(Lists.newArrayList("localhost"), "guest", "guest"); connection.start();/* www . j a v a2 s . co m*/ //Create executor BifrostExecutor<Map<String, Object>> executor = BifrostExecutor .<Map<String, Object>>builder(HttpCallCommand.class).connection(connection).objectMapper(mapper) .requestQueue("bifrost-send").responseQueue("bifrost-recv") .executorService(Executors.newFixedThreadPool(10)).responseWaitTimeout(20000).build(); //Create execution server BifrostRemoteCallExecutionServer<Map<String, Object>> executionServer = BifrostRemoteCallExecutionServer .<Map<String, Object>>builder(HttpCallCommand.class).objectMapper(mapper).connection(connection) .concurrency(10).requestQueue("bifrost-send").build(); executionServer.start(); //Start making calls RemoteCallable<Map<String, Object>> callable = HttpCallCommand.createGet("http://jsonip.com/"); Future<Map<String, Object>> result = executor.submit(callable); Map<String, Object> r = result.get(); //Shutdown exverything when done executor.shutdown(); executionServer.stop(); connection.stop(); Assert.assertTrue(r.containsKey("ip")); }
From source file:com.hybris.instore.widgets.listtracker.ListTrackerControllerTest.java
@Test public void testInitialState() { // make sure next/previous nav is not possible Assert.assertTrue( BooleanUtils.isNotTrue((Boolean) widgetModel.get(ListTrackerController.MODEL_NEXT_AVAILBLE))); Assert.assertTrue(/*from w ww. j av a 2 s.c o m*/ BooleanUtils.isNotTrue((Boolean) widgetModel.get(ListTrackerController.MODEL_PREVIOUS_AVAILBLE))); // make sure list is null or empty Assert.assertTrue(CollectionUtils.isEmpty((Collection) widgetModel.get(ListTrackerController.MODEL_LIST))); }
From source file:es.tekniker.framework.ktek.drugtreatment.mng.server.test.TestDrugTreatmentMngServer.java
@org.junit.Test public void testGetQuestionnaires4TypeMonitoringActivityFilter() { log.info("*************************************************************"); log.info("testGetQuestionnaireList4Status: START "); DrugTreatmentMngServer objMngServer = new DrugTreatmentMngServer(); String token = TestData.getLoginToken(); int idlang = 1; String codtelecareprogram = "TBP1"; boolean all = false; long datefrom = (long) 1421881200000.0; long dateto = (long) 1422572399000.0; int orderby = 1; List<KtekQuestionnaireItemFilterEntity> list = null; String result = TestDefines.RESULT_OK; try {/*from w w w . j a v a 2s . c o m*/ list = objMngServer.getQuestionnaires4TypeMonitoringActivityFilter(token, idlang, codtelecareprogram, all, datefrom, dateto, orderby); if (list != null) { log.info("testGetQuestionnaires4TypeMonitoringActivityFilter: list is not null "); Assert.assertTrue(true); } else { log.error("testGetQuestionnaires4TypeMonitoringActivityFilter: list is NULL "); Assert.assertTrue(true); result = TestDefines.RESULT_ERROR; } } catch (KtekExceptionEntity e) { e.printStackTrace(); log.error("testGetQuestionnaires4TypeMonitoringActivityFilter: Exception "); Assert.assertTrue(true); result = TestDefines.RESULT_ERROR; } log.info("testGetQuestionnaires4TypeMonitoringActivityFilter: RESULT " + result); log.info("testGetQuestionnaires4TypeMonitoringActivityFilter: END "); log.info("*************************************************************"); log.info(""); }
From source file:com.dare2date.domein.lastfm.LastfmDataTest.java
@Test public void testLastfmDataCompare() { LastfmData data1 = new LastfmData(); data1.addEvent(new LastfmEvent(1234, "GelijkFesti")); data1.addEvent(new LastfmEvent(561631, "SVDVDABC")); data1.addEvent(new LastfmEvent(48651465, "SKN LSfS")); data1.addEvent(new LastfmEvent(51206105, "Matchy Match")); data1.addEvent(new LastfmEvent(126521, "OLKMOPKM")); LastfmData data2 = new LastfmData(); data2.addEvent(new LastfmEvent(156198510, "SSFKN SKFLMS")); data2.addEvent(new LastfmEvent(51206105, "Matchy Match")); data2.addEvent(new LastfmEvent(51651051, "SKMNKSMC")); data2.addEvent(new LastfmEvent(84584879, "SVDVDABC")); data2.addEvent(new LastfmEvent(415154, "SVDVSMC MSCDABC")); data2.addEvent(new LastfmEvent(150515, "SCOSKPO")); data2.addEvent(new LastfmEvent(1234, "GelijkFesti")); Assert.assertEquals(2, data1.getMatchingEvents(data2).getEvents().size()); Assert.assertTrue(data1.getMatchingEvents(data2).getEvents().contains(new LastfmEvent(1234, ""))); Assert.assertTrue(data1.getMatchingEvents(data2).getEvents().contains(new LastfmEvent(51206105, ""))); }
From source file:com.cloudant.sync.datastore.BasicDatastoreTestBase.java
void validateNewlyCreatedDocument(BasicDocumentRevision rev) { Assert.assertNotNull(rev);//from ww w . j a va 2 s .c o m CouchUtils.validateDocumentId(rev.getId()); CouchUtils.validateRevisionId(rev.getRevision()); Assert.assertEquals(1, CouchUtils.generationFromRevId(rev.getRevision())); Assert.assertTrue(rev.isCurrent()); Assert.assertTrue(rev.getParent() == -1L); }
From source file:im.tym.wraop.both.SpringAOPWrapperFactorySpiTest.java
@Test public void testReconfigure() { Assert.assertTrue(factory.addAspect(new TrimTransformerAdvice())); Transformer<Object, String> transformer = factory.wrap(new ToStringTransformer(), this.getClass().getClassLoader()); Assert.assertEquals("test", transformer.transform(" test ")); Assert.assertTrue(factory.addAspect(new ConstantReturningAdvice("constant"))); Transformer<Object, String> transformer2 = factory.wrap(new ToStringTransformer(), this.getClass().getClassLoader()); Assert.assertEquals("test", transformer.transform(" test ")); Assert.assertEquals("constant", transformer2.transform(" test ")); }
From source file:com.kurento.kmf.media.HttpPostEndpointTest.java
/** * Checks that the getUrl method does not return an empty string *///from w w w.jav a2 s . c o m @Test public void testMethodGetUrl() { HttpPostEndpoint httpEP = pipeline.newHttpPostEndpoint().build(); Assert.assertTrue(!httpEP.getUrl().isEmpty()); }