List of usage examples for java.util Collections EMPTY_LIST
List EMPTY_LIST
To view the source code for java.util Collections EMPTY_LIST.
Click Source Link
From source file:net.praqma.jenkins.rqm.collector.RqmTestSuiteExectionRecordCollectionStrategy.java
@Override public <T extends RqmObject> List<T> collect(BuildListener listener, AbstractBuild<?, ?> build) throws Exception { NameValuePair[] filterProperties = TestSuiteExecutionRecord.getFilteringProperties(executionRecordName, planName);//from w w w. j a va2 s. c om String request = TestSuiteExecutionRecord.getResourceFeedUrl(getHostName(), getPort(), getContextRoot(), projectName); listener.getLogger().println(String.format("Resource request feed is %s", request)); RqmParameterList list; if (!StringUtils.isBlank(credentialId) && !credentialId.equals("none")) { listener.getLogger().println("Using credentials"); StandardUsernameCredentials usrName = CredentialsProvider.findCredentialById(credentialId, StandardUsernameCredentials.class, build, Collections.EMPTY_LIST); UsernamePasswordCredentials userPasswordCreds = (UsernamePasswordCredentials) usrName; list = new RqmParameterList(getHostName(), getPort(), getContextRoot(), projectName, userPasswordCreds, request, filterProperties, "GET", null); } else { listener.getLogger().println("Using legacy"); list = new RqmParameterList(getHostName(), getPort(), getContextRoot(), projectName, getUsrName(), getPasswd(), request, filterProperties, "GET", null); } /* TODO: Get a list of all plans in the current project. We need to do this since the feed-url does NOT allow us to filter based on names of a test when looking for test suite execution records. */ RqmObjectCreator<TestSuiteExecutionRecord> object = new RqmObjectCreator<TestSuiteExecutionRecord>( TestSuiteExecutionRecord.class, list, listener); Future<List<TestSuiteExecutionRecord>> result = build.getWorkspace().actAsync(object); return (List<T>) result.get(20, TimeUnit.MINUTES); }
From source file:com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.distributed.kubernetes.v2.KubernetesV2Service.java
default List<String> getPreStopCommand(ServiceSettings settings) { return hasPreStopCommand() ? Arrays.asList("bash", shutdownScriptFile()) : Collections.EMPTY_LIST; }
From source file:com.sun.faces.context.FacesContextImpl.java
public Iterator getFacesEvents() { assertNotReleased();/* w ww . j av a 2 s . c o m*/ if (facesEvents != null) { return (facesEvents.cursor()); } else { return (Collections.EMPTY_LIST.iterator()); } }
From source file:deployer.publishers.openshift.OpenShiftThriftRunnerTest.java
private void testSingleInstance(int existing) throws DeploymentException, GitAPIException, IOException { String strExisting = Integer.toString(existing); File remoteTestDir = Files.resolve(GIT_TEST_DIR, strExisting, "thriftRunnerviaOpenshift.git"); File testDir = Files.resolve(GIT_TEST_DIR, strExisting, "thriftRunnerviaOpenshift"); System.out.println(testDir);//from w w w.java 2 s. c om Files.createDirectories(testDir); AppDirs[] theGits = makeNumberGits(existing, existing + "/thriftRunnerviaOpenshift"); Git.init().setBare(true).setDirectory(remoteTestDir).call(); Git git = Git.cloneRepository().setURI(remoteTestDir.toURI().toString()).setDirectory(testDir).call(); Rhc rhc = createMock(Rhc.class); IApplication instance = createMock(IApplication.class); IDomain domain = createMock(IDomain.class); IUser mockUser = createMock(IUser.class); EzReverseProxyRegister ezReverseProxyRegister = createMock(EzReverseProxyRegister.class); expect(instance.getName()).andReturn("UnitTestApplication").anyTimes(); expect(domain.getUser()).andReturn(mockUser).anyTimes(); expect(mockUser.getRhlogin()).andReturn("UnitTestuser").anyTimes(); if (existing == 0 || existing == 1) { expect(rhc.listApplicationInstances(TestUtils.getOpenShiftAppName(), TestUtils.getOpenShiftDomainName())).andReturn(Collections.EMPTY_LIST).once(); } else { expect(rhc.listApplicationInstances(TestUtils.getOpenShiftAppName(), TestUtils.getOpenShiftDomainName())).andReturn(getExistingInstances(theGits, instance, domain)) .once(); instance.stop(); expectLastCall().times(existing - 1); instance.destroy(); expectLastCall().times(existing - 1); } expect(rhc.getOrCreateApplication(TestUtils.buildOpenShiftAppName(0), TestUtils.getOpenShiftDomainName(), new StandaloneCartridge("java-thriftrunner"), ApplicationScale.NO_SCALE, GearProfile.SMALL)) .andReturn(new RhcApplication(git, instance, domain, testDir, null)).once(); expect(instance.getEnvironmentVariables()).andReturn(new HashMap<String, IEnvironmentVariable>()) .anyTimes(); expect(instance.addEnvironmentVariable("EZBAKE_APPLICATION_NAME", TestUtils.APP_NAME)) .andReturn(envVariableValue("EZBAKE_APPLICATION_NAME", TestUtils.APP_NAME)).anyTimes(); expect(instance.addEnvironmentVariable("EZBAKE_SERVICE_NAME", TestUtils.SERVICE_NAME)) .andReturn(envVariableValue("EZBAKE_SERVICE_NAME", TestUtils.SERVICE_NAME)).anyTimes(); expect(instance.getEmbeddedCartridges()).andReturn(new ArrayList<IEmbeddedCartridge>()).anyTimes(); IEmbeddedCartridge cart = createMock(IEmbeddedCartridge.class); expect(instance.addEmbeddableCartridge(new EmbeddableCartridge("logstash"))).andReturn(cart).anyTimes(); expect(instance.addEmbeddableCartridge(new EmbeddableCartridge("cron"))).andReturn(cart).anyTimes(); replay(instance, domain, mockUser, ezReverseProxyRegister, rhc); EzOpenShiftPublisher publisher = new EzOpenShiftPublisherMock(rhc, ezReverseProxyRegister); DeploymentArtifact deploymentArtifact = createSampleDeploymentArtifact(ArtifactType.Thrift); publisher.publish(deploymentArtifact, ThriftTestUtils.generateTestSecurityToken("U")); verify(instance, domain, mockUser, ezReverseProxyRegister, rhc); assertGitRepositoryFilesForUpdateGitRepoTest(testDir); }
From source file:io.seldon.general.ItemStorage.java
public FilteredItems retrieveRecentlyAddedItems(final String client, final int numItems, final int dimension) { String key = MemCacheKeys.getRecentItems(client, dimension, numItems); List<Long> retrievedItems = retrieveUsingJSON(key, numItems, new UpdateRetriever<List<Long>>() { @Override/*from www .j a v a2s. c o m*/ public List<Long> retrieve() throws Exception { return provider.getItemPersister(client).getRecentItemIds(dimension, numItems, null); } }, new TypeReference<List<Long>>() { }, RECENT_ITEMS_EXPIRE_TIME); return new FilteredItems(retrievedItems == null ? Collections.EMPTY_LIST : retrievedItems, SecurityHashPeer.md5(key)); }
From source file:corner.orm.gae.impl.PaginatedJpaEntityServiceTest.java
@Test public void test_paginate_with_order() { EntityManager entityManager = newMock(EntityManager.class); Query query = newMock(Query.class); Query query2 = newMock(Query.class); expect(entityManager.createQuery(/* w w w. j av a2s .c o m*/ "select root.id from corner.orm.gae.impl.TestAEntity as root where name=:1 order by id desc")) .andReturn(query); expect(entityManager .createQuery("select count(root) from corner.orm.gae.impl.TestAEntity as root where name=:1")) .andReturn(query2); expect(query.setParameter("1", "acai")).andReturn(query); expect(query2.setParameter("1", "acai")).andReturn(query2); expect(query.setFirstResult(0)).andReturn(query); expect(query.setMaxResults(10)).andReturn(query); List listValue = Collections.EMPTY_LIST; expect(query.getResultList()).andReturn(listValue); expect(query2.getSingleResult()).andReturn(new Integer(1234)); JpaTemplate jpaTemplate = GaeModule.buildJpaTemplate(entityManager); replay(); PaginatedJapEntityService pjes = new PaginatedJapEntityService(jpaTemplate, typeCoercer); PaginationOptions options = new PaginationOptions(); PaginationList pl = pjes.paginate(TestAEntity.class, new String[] { "name=:1", "acai" }, "id desc", options); assertFalse(((Iterator) pl.collectionObject()).hasNext()); PaginationOptions optionsR = pl.options(); assertEquals(1234, optionsR.getTotalRecord()); verify(); }
From source file:com.processpuzzle.persistence.domain.InMemoryPersistenceProvider.java
private List<?> find(Query query) { return Collections.EMPTY_LIST; }
From source file:hudson.widgets.HistoryWidget.java
private List<HistoryPageEntry<T>> toPageEntries(Iterable<T> historyItemList) { Iterator<T> iterator = historyItemList.iterator(); if (!iterator.hasNext()) { return Collections.EMPTY_LIST; }// w ww .ja v a2 s . c o m List<HistoryPageEntry<T>> pageEntries = new ArrayList<HistoryPageEntry<T>>(); while (iterator.hasNext()) { pageEntries.add(new HistoryPageEntry<T>(iterator.next())); } return pageEntries; }
From source file:edu.cmu.tetrad.cli.search.FgscCli.java
@Override public List<Option> getRequiredOptions() { return Collections.EMPTY_LIST; }
From source file:com.ineunet.knife.security.session.DefaultWebSessionManager.java
@SuppressWarnings("unchecked") protected Collection<Session> getActiveSessions() { if (this.sessionDAO == null) return Collections.EMPTY_LIST; else/*from w ww . j a va 2s .c om*/ return this.sessionDAO.getActiveSessions(); }