List of usage examples for org.apache.commons.lang3 StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang3 StringUtils EMPTY.
Click Source Link
From source file:models.CodeCommentThreadTest.java
@Test public void getCodeCommentThreadForPullRequestChanges() throws IOException, GitAPIException { addTestRepository();/*from ww w . jav a 2s . c o m*/ PullRequest pullRequest = new PullRequest(); pullRequest.mergedCommitIdFrom = baseCommit.getName(); pullRequest.mergedCommitIdTo = thirdCommit.getName(); pullRequest.toProject = project; CodeCommentThread threadOnCommit = new CodeCommentThread(); threadOnCommit.prevCommitId = StringUtils.EMPTY; threadOnCommit.commitId = secondCommit.getName(); threadOnCommit.codeRange = new CodeRange(); threadOnCommit.codeRange.path = "b.txt"; CodeCommentThread outdatedThread = new CodeCommentThread(); outdatedThread.prevCommitId = baseCommit.getName(); outdatedThread.commitId = secondCommit.getName(); outdatedThread.codeRange = new CodeRange(); outdatedThread.codeRange.path = "a.txt"; CodeCommentThread threadOnChanges = new CodeCommentThread(); threadOnChanges.prevCommitId = baseCommit.getName(); threadOnChanges.commitId = secondCommit.getName(); threadOnChanges.codeRange = new CodeRange(); threadOnChanges.codeRange.path = "b.txt"; SimpleCommentThread simpleThread = new SimpleCommentThread(); pullRequest.commentThreads.add(simpleThread); pullRequest.commentThreads.add(threadOnCommit); pullRequest.commentThreads.add(outdatedThread); pullRequest.commentThreads.add(threadOnChanges); List<CodeCommentThread> threads = pullRequest.getCodeCommentThreadsForChanges(null); assertThat(threads).describedAs("Exclude simple threads").excludes(simpleThread); assertThat(threads).describedAs("Exclude threads on commit").excludes(threadOnCommit); assertThat(threads).describedAs("Exclude outdated threads").excludes(outdatedThread); assertThat(threads).describedAs("Contain threads on changes").contains(threadOnChanges); }
From source file:com.aqnote.app.wifianalyzer.wifi.model.WiFiDetailTest.java
@Test public void testIsHidden() throws Exception { // setup//from w w w.j a va 2 s. com fixture = new WiFiDetail(StringUtils.EMPTY, BSSID, WPA, wiFiSignal); // execute & validate assertTrue(fixture.isHidden()); }
From source file:gov.nih.nci.caintegrator.web.biodbnet.BioDbNetSearchActionTest.java
/** * Tests expected behavior when no gene results are found. *//*from w w w . j a v a2 s. c o m*/ @Test public void searchGenesNoResults() { action.getSearchParameters().setSearchType(null); action.getSearchParameters().setInputValues(StringUtils.EMPTY); assertEquals(GENE_RESULT, action.search()); assertTrue(action.getGeneResults().isEmpty()); assertTrue(action.hasActionErrors()); assertEquals(1, action.getActionErrors().size()); assertEquals("bioDbNet.noGeneResultsFound", action.getActionErrors().iterator().next()); }
From source file:com.precioustech.fxtrading.oanda.restapi.instrument.OandaInstrumentDataProviderService.java
@Override public Collection<TradeableInstrument<String>> getInstruments() { Collection<TradeableInstrument<String>> instrumentsList = Lists.newArrayList(); CloseableHttpClient httpClient = getHttpClient(); try {// w w w .j av a 2 s .com HttpUriRequest httpGet = new HttpGet(getInstrumentsUrl()); httpGet.setHeader(authHeader); LOG.info(TradingUtils.executingRequestMsg(httpGet)); HttpResponse resp = httpClient.execute(httpGet); String strResp = TradingUtils.responseToString(resp); if (strResp != StringUtils.EMPTY) { Object obj = JSONValue.parse(strResp); JSONObject jsonResp = (JSONObject) obj; JSONArray instrumentArray = (JSONArray) jsonResp.get(instruments); for (Object o : instrumentArray) { JSONObject instrumentJson = (JSONObject) o; String instrument = (String) instrumentJson.get(OandaJsonKeys.instrument); String[] currencies = OandaUtils.splitCcyPair(instrument); Double pip = Double.parseDouble(instrumentJson.get(OandaJsonKeys.pip).toString()); JSONObject interestRates = (JSONObject) instrumentJson.get(interestRate); if (interestRates.size() != 2) { throw new IllegalArgumentException(); } JSONObject currency1Json = (JSONObject) interestRates.get(currencies[0]); JSONObject currency2Json = (JSONObject) interestRates.get(currencies[1]); final double baseCurrencyBidInterestRate = ((Number) currency1Json.get(bid)).doubleValue(); final double baseCurrencyAskInterestRate = ((Number) currency1Json.get(ask)).doubleValue(); final double quoteCurrencyBidInterestRate = ((Number) currency2Json.get(bid)).doubleValue(); final double quoteCurrencyAskInterestRate = ((Number) currency2Json.get(ask)).doubleValue(); InstrumentPairInterestRate instrumentPairInterestRate = new InstrumentPairInterestRate( baseCurrencyBidInterestRate, baseCurrencyAskInterestRate, quoteCurrencyBidInterestRate, quoteCurrencyAskInterestRate); TradeableInstrument<String> tradeableInstrument = new TradeableInstrument<String>(instrument, pip, instrumentPairInterestRate, null); instrumentsList.add(tradeableInstrument); } } else { TradingUtils.printErrorMsg(resp); } } catch (Exception e) { LOG.error("exception encountered whilst retrieving all instruments info", e); } finally { TradingUtils.closeSilently(httpClient); } return instrumentsList; }
From source file:com.msopentech.odatajclient.testservice.AbstractServices.java
/** * Provide sample services.//from w w w. jav a2 s .c o m * * @param accept Accept header. * @return OData services. */ @GET public Response getSevices(@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept) { try { final Accept acceptType = Accept.parse(accept, getVersion()); if (acceptType == Accept.ATOM) { throw new UnsupportedMediaTypeException("Unsupported media type"); } return xml.createResponse(FSManager.instance(getVersion()).readFile(SERVICES, acceptType), null, acceptType); } catch (Exception e) { return xml.createFaultResponse(accept, e); } }
From source file:bg.fourweb.android.rss.Image.java
public Image(String url, String title, String link) { this(url, title, link, DEFAULT_WIDTH, DEFAULT_HEIGHT, StringUtils.EMPTY); }
From source file:com.aqnote.app.wifianalyzer.wifi.model.WiFiDataTest.java
private List<WiFiDetail> withWiFiDetails() { WiFiDetail wiFiDetail1 = new WiFiDetail(SSID_1, BSSID_1, StringUtils.EMPTY, new WiFiSignal(FREQUENCY1, FREQUENCY1, WiFiWidth.MHZ_20, LEVEL1)); WiFiDetail wiFiDetail2 = new WiFiDetail(SSID_2, BSSID_2, StringUtils.EMPTY, new WiFiSignal(FREQUENCY2, FREQUENCY2, WiFiWidth.MHZ_20, LEVEL2)); WiFiDetail wiFiDetail3 = new WiFiDetail(SSID_3, BSSID_3, StringUtils.EMPTY, new WiFiSignal(FREQUENCY3, FREQUENCY3, WiFiWidth.MHZ_20, LEVEL0)); WiFiDetail wiFiDetail4 = new WiFiDetail(SSID_4, BSSID_4, StringUtils.EMPTY, new WiFiSignal(FREQUENCY4, FREQUENCY4, WiFiWidth.MHZ_20, LEVEL2)); WiFiDetail wiFiDetail_1 = new WiFiDetail(SSID_2, BSSID_2 + "_1", StringUtils.EMPTY, new WiFiSignal(FREQUENCY2, FREQUENCY2, WiFiWidth.MHZ_20, LEVEL2 - 3)); WiFiDetail wiFiDetail_2 = new WiFiDetail(SSID_2, BSSID_2 + "_2", StringUtils.EMPTY, new WiFiSignal(FREQUENCY2, FREQUENCY2, WiFiWidth.MHZ_20, LEVEL2 - 1)); WiFiDetail wiFiDetail_3 = new WiFiDetail(SSID_2, BSSID_2 + "_3", StringUtils.EMPTY, new WiFiSignal(FREQUENCY2, FREQUENCY2, WiFiWidth.MHZ_20, LEVEL2 - 2)); return Arrays.asList(wiFiDetail_3, wiFiDetail3, wiFiDetail_2, wiFiDetail1, wiFiDetail_1, wiFiDetail2, wiFiDetail4);/* w w w . java 2 s .com*/ }
From source file:cgeo.geocaching.connector.oc.OCApiConnector.java
public String getCS() { return StringUtils.EMPTY; }
From source file:com.navercorp.pinpoint.collector.cluster.zookeeper.PinpointServerRepository.java
private String getKey(PinpointServer pinpointServer) { Map<Object, Object> properties = pinpointServer.getChannelProperties(); final String applicationName = MapUtils.getString(properties, HandshakePropertyType.APPLICATION_NAME.getName()); final String agentId = MapUtils.getString(properties, HandshakePropertyType.AGENT_ID.getName()); final Long startTimeStamp = MapUtils.getLong(properties, HandshakePropertyType.START_TIMESTAMP.getName()); if (StringUtils.isBlank(applicationName) || StringUtils.isBlank(agentId) || startTimeStamp == null || startTimeStamp <= 0) { return StringUtils.EMPTY; }/* ww w.j a va2 s. co m*/ return applicationName + ":" + agentId + ":" + startTimeStamp; }
From source file:me.ineson.demo.app.MainController.java
/** * @param model/*from w w w .j a va 2 s . c om*/ * @return */ @RequestMapping(value = "/logout") public @ResponseBody String logout(HttpSession session) { log.info("User " + session.getAttribute(SecurityContext.ATTRIBUTE_NAME) + " is logging out"); session.invalidate(); return StringUtils.EMPTY; }