List of usage examples for org.apache.commons.collections CollectionUtils EMPTY_COLLECTION
Collection EMPTY_COLLECTION
To view the source code for org.apache.commons.collections CollectionUtils EMPTY_COLLECTION.
Click Source Link
From source file:com.whymenu.resources.MenuItemPagedResources.java
@SuppressWarnings("unchecked") public MenuItemPagedResources(final Collection<MenuItem> content, final PageMetadata metadata) { super(content, metadata, CollectionUtils.EMPTY_COLLECTION); }
From source file:com.rmn.qa.aws.VmManagerTest.java
@Test // Tests that the terminate code works when no matching results are returned by the client public void testTerminateInstanceNoInstanceEmpty() { MockAmazonEc2Client client = new MockAmazonEc2Client(null); String instanceId = "foo"; TerminateInstancesResult terminateInstancesResult = new TerminateInstancesResult(); client.setTerminateInstancesResult(terminateInstancesResult); terminateInstancesResult.setTerminatingInstances(CollectionUtils.EMPTY_COLLECTION); Properties properties = new Properties(); String region = "east"; MockManageVm manageEC2 = new MockManageVm(client, properties, region); boolean success = manageEC2.terminateInstance(instanceId); TerminateInstancesRequest request = client.getTerminateInstancesRequest(); Assert.assertEquals("Instance id size should match", 1, request.getInstanceIds().size()); Assert.assertEquals("Instance ids should match", instanceId, request.getInstanceIds().get(0)); Assert.assertFalse("Termination call should have not been successful", success); }
From source file:org.alfresco.module.org_alfresco_module_rm.record.RecordServiceImplUnitTest.java
@SuppressWarnings("unchecked") @Before// ww w . j a v a 2 s .c o m @Override public void before() throws Exception { super.before(); nonStandardFilePlanComponent = generateNodeRef(TYPE_RECORD_CATEGORY); nonStandardFilePlan = generateNodeRef(TYPE_MY_FILE_PLAN); // set-up node service when(mockedNodeService.getProperty(nonStandardFilePlanComponent, PROP_ROOT_NODEREF)) .thenReturn(nonStandardFilePlan); // set-up dictionary service when(mockedDictionaryService.getAllAspects()).thenReturn(CollectionUtils.EMPTY_COLLECTION); // mock up getting behaviours when(recordService.getBehaviour(any(String.class))).thenReturn(mock(Behaviour.class)); }
From source file:org.apache.lens.server.query.collect.DefaultEstimatedQueryCollection.java
private Collection<QueryContext> getQueriesCollectionForDriver(final LensDriver driver) { final Collection<QueryContext> driverQueries = queriesByDriver.getCollection(driver); return driverQueries != null ? driverQueries : CollectionUtils.EMPTY_COLLECTION; }
From source file:org.apache.lens.server.query.collect.DefaultQueryCollection.java
private Collection<QueryContext> getQueriesCollectionForUser(final String user) { final Collection<QueryContext> userQueries = queriesByUser.getCollection(user); return userQueries != null ? userQueries : CollectionUtils.EMPTY_COLLECTION; }
From source file:org.apache.stratos.messaging.message.filter.MessageFilter.java
public Collection<String> getIncludedPropertyValues(String propertyName) { if (filterMap.containsKey(propertyName)) { return filterMap.get(propertyName).keySet(); }/*from w ww.j a va 2 s .c om*/ return CollectionUtils.EMPTY_COLLECTION; }
From source file:org.jenkinsci.plugins.drupal.beans.DrushInvocation.java
/** * Get a list of test classes available. *//*www . ja va2 s .c o m*/ public Collection<DrupalTest> getTests() { ArgumentListBuilder args = getArgumentListBuilder(); args.add("test-run").add("--format=json"); OutputStream json = new ByteArrayOutputStream(); try { execute(args, new StreamTaskListener(json)); } catch (IOException e1) { listener.getLogger().println(e1); return CollectionUtils.EMPTY_COLLECTION; } catch (InterruptedException e2) { listener.getLogger().println(e2); return CollectionUtils.EMPTY_COLLECTION; } Collection<DrupalTest> tests = new HashSet<DrupalTest>(); JSONArray entries = (JSONArray) JSONValue.parse(json.toString()); if (entries == null) { listener.getLogger().println("[DRUPAL] Could not list available tests"); return CollectionUtils.EMPTY_COLLECTION; } for (Object entry : entries) { JSONObject test = (JSONObject) entry; tests.add(new DrupalTest(test.get("group").toString(), test.get("class").toString())); } return tests; }
From source file:org.kuali.kfs.module.cg.businessobject.inquiry.AgencyInquirableImpl.java
/** * If the Contracts & Grants Billing (CGB) enhancement is disabled, we don't want to * process sections only related to CGB. * * @return Collection of section ids to ignore *///from www. j a v a 2 s.com protected Collection<?> getSectionIdsToIgnore() { if (!SpringContext.getBean(AccountsReceivableModuleBillingService.class) .isContractsGrantsBillingEnhancementActive()) { return SpringContext.getBean(ContractsAndGrantsBillingService.class) .getAgencyContractsGrantsBillingSectionIds(); } else { return CollectionUtils.EMPTY_COLLECTION; } }
From source file:org.kuali.kfs.module.cg.businessobject.inquiry.AwardInquirableImpl.java
/** * If the Contracts & Grants Billing (CGB) enhancement is disabled, we don't want to * process sections only related to CGB. * * @return Collection of section ids to ignore *//*www .ja v a2 s . com*/ protected Collection<?> getSectionIdsToIgnore() { if (!SpringContext.getBean(AccountsReceivableModuleBillingService.class) .isContractsGrantsBillingEnhancementActive()) { return SpringContext.getBean(ContractsAndGrantsBillingService.class) .getAwardContractsGrantsBillingSectionIds(); } else { return CollectionUtils.EMPTY_COLLECTION; } }
From source file:org.kuali.kfs.module.cg.document.AgencyMaintainableImpl.java
/** * If the Contracts & Grants Billing (CGB) enhancement is disabled, we don't want to * process sections only related to CGB. * * @return Collection of section ids to ignore *///from w ww . j a v a 2 s . c om @Override protected Collection<?> getSectionIdsToIgnore() { if (!getAccountsReceivableModuleBillingService().isContractsGrantsBillingEnhancementActive()) { return SpringContext.getBean(ContractsAndGrantsBillingService.class) .getAgencyContractsGrantsBillingSectionIds(); } else { return CollectionUtils.EMPTY_COLLECTION; } }