List of usage examples for java.util Collections EMPTY_MAP
Map EMPTY_MAP
To view the source code for java.util Collections EMPTY_MAP.
Click Source Link
From source file:com.adobe.ags.curly.test.ErrorBehaviorTest.java
@Test public void testActionRequireFailure() throws IOException, ParseException { ApplicationState.getInstance().errorBehaviorProperty().set(ErrorBehavior.HALT); Action fail1 = failureAction(); Action fail2 = failureAction(); fail1.setErrorBehavior(ErrorBehavior.SKIP_IF_SUCCESSFUL); fail2.setErrorBehavior(ErrorBehavior.SKIP_IF_SUCCESSFUL); List<Action> actions = Arrays.asList(fail1, fail2); ActionGroupRunner runner = new ActionGroupRunner("Action Require Failure Test", ignore -> client, actions, Collections.EMPTY_MAP, Collections.EMPTY_SET); runner.run();//from w ww. j a va 2 s.c o m assertResults(runner.getResult(), false, true); }
From source file:com.vuze.android.remote.fragment.TorrentInfoFragment.java
public void fillDisplay() { FragmentActivity activity = getActivity(); if (activity == null) { return;/*from ww w . ja v a 2 s . com*/ } Map<?, ?> mapTorrent = sessionInfo.getTorrent(torrentID); if (mapTorrent == null) { mapTorrent = Collections.EMPTY_MAP; } fillTimeline(activity, mapTorrent); fillContent(activity, mapTorrent); fillSharing(activity, mapTorrent); }
From source file:de.hybris.platform.flexiblesearch.performance.LimitStatementPerformanceTest.java
@SuppressWarnings("deprecation") private void executeQueryForRange(final int start, final int count) { final FlexibleSearch flexSearch = JaloSession.getCurrentSession().getFlexibleSearch(); final List<Title> res = flexSearch.search("SELECT {PK} FROM {Title} ORDER BY {PK}", Collections.EMPTY_MAP, Collections.singletonList(Title.class), false, true, start, count).getResult(); for (final Title title : res) { title.getCode();//w ww .ja v a 2 s .c om } }
From source file:de.hybris.platform.btgcockpit.service.BTGCockpitServiceTest.java
@Before public void setUp() throws Exception { LOG.info("Creating btg test data .."); initApplicationContext();/* www . j a va2 s .c o m*/ cockpitTypeService = (TypeService) applicationContex.getBean("cockpitTypeService"); createNumberSeries(BTGSegmentModel._TYPECODE); createNumberSeries(BTGRuleModel._TYPECODE); createNumberSeries(BTGAssignToGroupDefinitionModel._TYPECODE); createNumberSeries(BTGOutputActionDefinitionModel._TYPECODE); createNumberSeries(AbstractRestrictionModel._TYPECODE); createNumberSeries(AbstractPageModel._TYPECODE); JaloSession.getCurrentSession().setUser(UserManager.getInstance().getAdminEmployee()); final long startTime = System.currentTimeMillis(); new CoreBasicDataCreator().createEssentialData(Collections.EMPTY_MAP, null); Cms2Manager.getInstance().createEssentialData(Collections.EMPTY_MAP, null); importCsv("/test/btgCockpitTestData.csv", "utf-8"); LOG.info("Finished creating btg test data " + (System.currentTimeMillis() - startTime) + "ms"); btgCockpitService = (BTGCockpitService) applicationContex.getBean("btgCockpitService"); final CatalogVersionModel catalogVersionModel = getSampleCatalogVersion(); segmentModel = new BTGSegmentModel(); segmentModel.setCatalogVersion(catalogVersionModel); segmentModel.setName("BTG Sample Segment"); segmentModel.setUid(RandomStringUtils.randomAlphanumeric(10)); modelService.save(segmentModel); cmsAdminSiteService.setActiveCatalogVersion(catalogVersionModel); componentModel = cmsComponentService.getAbstractCMSComponent("test_component1", Collections.singletonList(catalogVersionModel)); altComponentModel = cmsComponentService.getAbstractCMSComponent("test_component2", Collections.singletonList(catalogVersionModel)); catalogService.setSessionCatalogVersions(Collections.singleton(catalogVersionModel)); pageModel = cmsPageService.getPageByLabelOrId("test_homepage_default"); }
From source file:org.apache.syncope.console.commons.StatusUtils.java
public String getAccountLink(final ConnObjectTO objectTO) { final String NAME = "__NAME__"; final Map<String, AttributeTO> attributeTOs = objectTO != null ? objectTO.getAttributeMap() : Collections.EMPTY_MAP; final AttributeTO name = attributeTOs.get(NAME); return name != null && name.getValues() != null && !name.getValues().isEmpty() ? (String) name.getValues().get(0) : null;/*from w w w. j av a 2 s . co m*/ }
From source file:org.apache.tapestry5.upload.internal.services.MultipartDecoderImplTest.java
@Test public void uploaded_file_stored() throws Exception { HttpServletRequest request = mockHttpServletRequest(); expect(request.getParameterMap()).andReturn(Collections.EMPTY_MAP); MultipartDecoderImpl decoder = new MultipartDecoderImpl(fileItemFactory, -1, -1, CHARSET); List<FileItem> fileItems = Arrays.asList(createFileItem("one", "first.txt"), createFileItem("two", "second.txt")); replay();//from ww w .j av a 2 s. c om decoder.processFileItems(request, fileItems); verify(); assertNotNull(decoder.getFileUpload("one")); assertEquals(decoder.getFileUpload("one").getFileName(), "first.txt"); assertNotNull(decoder.getFileUpload("two")); assertEquals(decoder.getFileUpload("two").getFileName(), "second.txt"); }
From source file:de.tud.inf.db.sparqlytics.bench.LDBCBenchmark.java
@Test public void testQ20() throws Exception { test("20", Collections.EMPTY_MAP); }
From source file:fr.inria.atlanmod.neoemf.graph.blueprints.datastore.BlueprintsPersistenceBackendFactoryTest.java
@Test public void testCreatePersistentEStoreNoOption() throws InvalidDataStoreException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { PersistenceBackend persistentBackend = persistenceBackendFactory.createPersistentBackend(testFile, Collections.EMPTY_MAP); SearcheableResourceEStore eStore = persistenceBackendFactory.createPersistentEStore(null, persistentBackend, Collections.EMPTY_MAP); assert eStore instanceof DirectWriteBlueprintsResourceEStoreImpl : "Invalid EStore created"; PersistenceBackend innerBackend = getInnerBackend(eStore); assert innerBackend == persistentBackend; }
From source file:org.hyperledger.fabric.sdk.transaction.ProposalBuilder.java
private FabricProposal.Proposal createFabricProposal(String channelID, Chaincode.ChaincodeID chaincodeID) { if (null == transientMap) { transientMap = Collections.emptyMap(); }// www. j a va 2s. c o m if (IS_DEBUG_LEVEL) { for (Entry<String, byte[]> tme : transientMap.entrySet()) { logger.debug(format("transientMap('%s', '%s'))", logString(tme.getKey()), logString(new String(tme.getValue(), UTF_8)))); } } ChaincodeHeaderExtension chaincodeHeaderExtension = ChaincodeHeaderExtension.newBuilder() .setChaincodeId(chaincodeID).build(); Common.ChannelHeader chainHeader = createChannelHeader(HeaderType.ENDORSER_TRANSACTION, context.getTxID(), channelID, context.getEpoch(), context.getFabricTimestamp(), chaincodeHeaderExtension, null); ChaincodeInvocationSpec chaincodeInvocationSpec = createChaincodeInvocationSpec(chaincodeID, ccType); //Convert to bytestring map. Map<String, ByteString> bsm = Collections.EMPTY_MAP; if (transientMap != null) { bsm = new HashMap<>(transientMap.size()); for (Entry<String, byte[]> tme : transientMap.entrySet()) { bsm.put(tme.getKey(), ByteString.copyFrom(tme.getValue())); } } ChaincodeProposalPayload payload = ChaincodeProposalPayload.newBuilder() .setInput(chaincodeInvocationSpec.toByteString()).putAllTransientMap(bsm).build(); Common.Header header = Common.Header.newBuilder() .setSignatureHeader(getSignatureHeaderAsByteString(context)) .setChannelHeader(chainHeader.toByteString()).build(); return FabricProposal.Proposal.newBuilder().setHeader(header.toByteString()) .setPayload(payload.toByteString()).build(); }
From source file:info.magnolia.cms.util.ConfigUtil.java
/** * Convert the string to an DOM Document. * @deprecated since 4.0 - not used//w ww .j a v a 2s . c om */ public static Document string2DOM(String xml) throws ParserConfigurationException, SAXException, IOException { return string2DOM(xml, Collections.EMPTY_MAP); }