List of usage examples for java.util List toString
public String toString()
From source file:net.bunselmeyer.mongo.maven.plugin.MigrateMojo.java
private URLClassLoader buildProjectClassLoader() throws MojoExecutionException { getLog().debug("adding all artifacts to classLoader"); List<URL> urls = new ArrayList<URL>(); for (Object artifact : getProject().getArtifacts()) { try {// www . ja v a 2 s . c o m urls.add(((Artifact) artifact).getFile().toURI().toURL()); } catch (MalformedURLException e) { throw new MojoExecutionException(e.getMessage(), e); } } urls.add(buildOutputDirectoryUrl()); getLog().debug("urls = \n" + urls.toString().replace(",", "\n")); return new URLClassLoader(urls.toArray(new URL[urls.size()]), getClass().getClassLoader()); }
From source file:com.serena.rlc.provider.jira.client.JiraClient.java
public List<Issue> getIssues(String projectId, List<String> statusFilters, String titleFilter, Integer resultLimit) throws JiraClientException { logger.debug("Using JIRA URL: " + this.jiraUrl); logger.debug("Using JIRA Credentials: " + this.jiraUsername + ":" + this.jiraPassword); logger.debug("Using JIRA Project: " + projectId); logger.debug("Using JIRA Status Filter: " + (statusFilters != null && !statusFilters.isEmpty() ? statusFilters.toString() : "none defined")); logger.debug("Using JIRA Title Filter: " + (titleFilter != null && !titleFilter.isEmpty() ? titleFilter : "none defined")); logger.debug("Limiting results to: " + resultLimit.toString()); String jqlQuery = "rest/api/latest/search?jql=project=" + projectId; if (titleFilter != null && !titleFilter.isEmpty()) { jqlQuery += "+AND+summary~" + titleFilter; }/*from w w w .jav a 2 s . co m*/ if (statusFilters != null && !statusFilters.isEmpty()) { jqlQuery += "+AND+status+in+("; for (String status : statusFilters) { jqlQuery += "%22" + status.replaceAll(" ", "%20") + "%22,"; } // remove last comma if it exists if (jqlQuery.endsWith(",")) jqlQuery = jqlQuery.substring(0, jqlQuery.length() - 1); jqlQuery += ")"; } logger.debug("Using JIRA JQL Query:" + jqlQuery); logger.debug("Retrieving JIRA Issues"); String issResponse = processGet(session, getJiraUrl(), jqlQuery); logger.debug(issResponse); List<Issue> issues = Issue.parse(issResponse); return issues; }
From source file:org.terasoluna.gfw.web.codelist.CodeListInterceptorTest.java
/** * [afterPropertiesSet] Case of define only one bean of codelist type. * <p>/*from w w w .j a v a2 s . c o m*/ * [Expected Result] * <ol> * <li>target is one.(don't occur error.)</li> * </ol> * </p> * @throws Exception */ @Test public void testAfterPropertiesSet_not_define_one_CodeList() throws Exception { // do setup. StaticApplicationContext mockApplicationContext = new StaticApplicationContext(); mockApplicationContext.registerSingleton("simpleMapCodeList", SimpleMapCodeList.class); testTarget.setApplicationContext(mockApplicationContext); // do test. testTarget.afterPropertiesSet(); // do assert. List<CodeList> expectedCodeLists = new ArrayList<CodeList>(); expectedCodeLists.add(mockApplicationContext.getBean("simpleMapCodeList", CodeList.class)); assertThat(testTarget.getCodeLists().toString(), is(expectedCodeLists.toString())); }
From source file:com.ponysdk.ui.server.basic.PListBox.java
public void addItemsInGroup(final String group, final List<String> items) { final ListItem groupItem = new ListGroupItem(group); this.items.add(groupItem); for (final String i : items) { this.items.add(new ListItem(i, i)); }/*from w w w . j a v a 2s . c o m*/ final Update update = new Update(getID()); update.put(PROPERTY.ITEM_ADD); final String s = items.toString(); update.put(PROPERTY.ITEM_TEXT, s.substring(1, s.length() - 1).replaceAll(",", ";").replaceAll(" ", "")); update.put(PROPERTY.ITEM_GROUP, group); Txn.get().getTxnContext().save(update); }
From source file:edu.berkeley.sparrow.daemon.scheduler.Scheduler.java
public List<TTaskLaunchSpec> getTask(String requestId, THostPort nodeMonitorAddress) { /* TODO: Consider making this synchronized to avoid the need for synchronization in * the task placers (although then we'd lose the ability to parallelize over task placers). */ LOG.debug(Logging.functionCall(requestId, nodeMonitorAddress)); TaskPlacer taskPlacer = requestTaskPlacers.get(requestId); if (taskPlacer == null) { LOG.debug("Received getTask() request for request " + requestId + ", which had no more " + "unplaced tasks"); return Lists.newArrayList(); }/*from w ww .jav a 2 s . co m*/ synchronized (taskPlacer) { List<TTaskLaunchSpec> taskLaunchSpecs = taskPlacer.assignTask(nodeMonitorAddress); if (taskLaunchSpecs == null || taskLaunchSpecs.size() > 1) { LOG.error("Received invalid task placement for request " + requestId + ": " + taskLaunchSpecs.toString()); return Lists.newArrayList(); } else if (taskLaunchSpecs.size() == 1) { AUDIT_LOG.info(Logging.auditEventString("scheduler_assigned_task", requestId, taskLaunchSpecs.get(0).taskId, nodeMonitorAddress.getHost())); } else { AUDIT_LOG.info(Logging.auditEventString("scheduler_get_task_no_task", requestId, nodeMonitorAddress.getHost())); } if (taskPlacer.allTasksPlaced()) { LOG.debug("All tasks placed for request " + requestId); requestTaskPlacers.remove(requestId); if (useCancellation) { Set<THostPort> outstandingNodeMonitors = taskPlacer.getOutstandingNodeMonitorsForCancellation(); for (THostPort nodeMonitorToCancel : outstandingNodeMonitors) { cancellationService.addCancellation(requestId, nodeMonitorToCancel); } } } return taskLaunchSpecs; } }
From source file:eu.europa.ec.fisheries.uvms.exchange.service.bean.ExchangeLogServiceBean.java
@Override public void resend(List<String> messageIdList, String username) throws ExchangeLogException { log.debug("resend in service layer:{} {}", messageIdList, username); List<UnsentMessageType> unsentMessageList; try {/*from www. j av a2 s. c o m*/ unsentMessageList = unsentModel.resend(messageIdList); sendAuditLogMessageForResendUnsentMessage(messageIdList.toString(), username); } catch (ExchangeModelException e) { log.error("Couldn't read unsent messages", e); throw new ExchangeLogException("Couldn't read unsent messages"); } if (unsentMessageList != null && !unsentMessageList.isEmpty()) { sendingQueueEvent.fire(new NotificationMessage("messageIds", messageIdList)); for (UnsentMessageType unsentMessage : unsentMessageList) { try { String unsentMessageId = producer.sendMessageOnQueue(unsentMessage.getMessage(), MessageQueue.EVENT); //TextMessage unsentResponse = consumer.getMessage(unsentMessageId, TextMessage.class); sendAuditLogMessageForCreateUnsentMessage(unsentMessageId, username); //ExchangeModuleResponseMapper.validateResponse(unsentResponse, unsentMessageId); } catch (ExchangeMessageException e) { log.error("Error when sending/receiving message {} {}", messageIdList, e); } } } }
From source file:org.apache.metamodel.neo4j.Neo4jDataContextTest.java
@Test public void testTableDetectionWithRelationships() throws Exception { if (!isConfigured()) { System.err.println(getInvalidConfigurationMessage()); return;//from w ww . j a v a 2s . c o m } // Insert nodes requestWrapper.executeCypherQuery("CREATE (n:JUnitPerson { name: 'Tomasz', age: 26})"); requestWrapper.executeCypherQuery("CREATE (n:JUnitPerson { name: 'Philomeena', age: 18})"); requestWrapper.executeCypherQuery("CREATE (n:JUnitBook { title: 'Introduction to algorithms'})"); requestWrapper.executeCypherQuery("MATCH (a:JUnitPerson),(b:JUnitBook)" + "WHERE a.name = 'Tomasz' AND b.title = 'Introduction to algorithms'" + "CREATE (a)-[r:HAS_READ { rating : 5 }]->(b)"); requestWrapper.executeCypherQuery("MATCH (a:JUnitPerson),(b:JUnitBook)" + "WHERE a.name = 'Philomeena' AND b.title = 'Introduction to algorithms'" + "CREATE (a)-[r:HAS_BROWSED]->(b)"); Neo4jDataContext strategy = new Neo4jDataContext(getHostname(), getPort(), getUsername(), getPassword()); Schema schema = strategy.getSchemaByName(strategy.getDefaultSchemaName()); // Do not check the precise count, Neo4j keeps labels forever, there are // probably many more than you imagine... List<String> tableNames = Arrays.asList(schema.getTableNames()); logger.info("Tables (labels) detected: " + tableNames); assertTrue(tableNames.contains("JUnitPerson")); assertTrue(tableNames.contains("JUnitBook")); Table tablePerson = schema.getTableByName("JUnitPerson"); List<String> personColumnNames = Arrays.asList(tablePerson.getColumnNames()); assertEquals("[_id, name, age, rel_HAS_READ, rel_HAS_READ#rating, rel_HAS_BROWSED]", personColumnNames.toString()); Table tableBook = schema.getTableByName("JUnitBook"); List<String> bookColumnNames = Arrays.asList(tableBook.getColumnNames()); assertEquals("[_id, title]", bookColumnNames.toString()); }
From source file:org.esupportail.ldapRestService.service.Ldap.java
public List<LdapUser> getMembers(LdapGroup group) throws LdapUserNotFoundException { List<LdapUser> users = new ArrayList<LdapUser>(); List<String> usersId = group.getAttributes(groupMemberAttribute); ArrayList<String> uids = new ArrayList<String>(); for (String userId : usersId) { Pattern p = Pattern.compile("uid=(.+?),"); Matcher m = p.matcher(userId); while (m.find()) { String uid = m.group(1); uids.add(uid);//from ww w . j av a 2 s .com } } users = this.getLdapUsersFromUids(uids); logger.info(users.toString()); return users; }
From source file:ca.unbsj.cbakerlab.owlexprmanager.ClassExpressionTreeGenerator.java
/** * Assign names of variables as vertex property 'nodeVariableName' for either Resource, Data value. * *///from w ww. j a v a 2s.c o m public void assignNodeVariableNames(List<Graph> existingGraph) { int numberOfVertices = 0; Integer currentDegree; for (Graph g : existingGraph) { // get the number of vertices Iterable<Vertex> vit = g.getVertices(); Iterator it = vit.iterator(); while (it.hasNext()) { numberOfVertices++; it.next(); } //System.out.println(" NUMOFVERTICES "+numberOfVertices); // get the sorted edges traversed in DFS order List<Edge> edgesListSorted = sortEdgesInDFS(g.getEdges()); List<Vertex> verticesListSorted = sortVerticesInDFS(edgesListSorted, numberOfVertices); System.out.println("Sorted Vertices: " + verticesListSorted.toString()); System.out.println("Sorted Edges: " + edgesListSorted.toString()); for (Vertex v : verticesListSorted) { // set the root node as input if (v.getId().equals("0")) v.setProperty("nodeVariableName", "input"); else { // assign empty content for each non-root node v.setProperty("nodeVariableName", ""); // if the vertex is NOT the root (i.e. Resource input) and common, set and increment the name // get the current degree as an Element object and cast it to int currentDegree = v.getProperty("degree"); if (currentDegree > 1) v.setProperty("nodeVariableName", "common" + "ResStmt" + (++commonNodeCounter)); // if (currentDegree == 1) { Edge e = getIncomingEdge(v, edgesListSorted); if (!e.getLabel().equals("")) v.setProperty("nodeVariableName", "ResStmt" + (++otherNodeCounter)); } // Assign nodeVariableName property to the leaf node(s) with degree = 0 if (currentDegree == 0) { // clean the node content of 'name' and, set and increment it v.setProperty("nodeVariableName", getSimpleName(v.getProperty("name").toString()) + "Node" + (++leafNodeCounter)); } } } // For each property edge that does not have a label, propagate the nodeVariableName // of the parent to the child for (Edge edge : edgesListSorted) { if (edge.getLabel().equals("")) //System.out.println("edge "+edge.getId()+ " is empty"); edge.getVertex(Direction.IN).setProperty("nodeVariableName", edge.getVertex(Direction.OUT).getProperty("nodeVariableName")); } } }
From source file:com.bmc.gibraltar.automation.dataprovider.RestDataProvider.java
/** * Returns list of Record Field names for a particular Record Definition name * * @param record record definition name//from w w w.ja va 2 s .c o m */ public List<String> getRecordFields(String record) { String response = getRecFields(record); List<String> output = JsonPath.from(response).getList("fieldDefinitions.name"); LOG.info("\n Record Definition: '" + record + "' has such [ALL] RecordFields: " + output.toString()); return output; }