?? searchclienttest.java
字號:
package com.yahoo.search;import java.io.IOException;public class SearchClientTest { private static final String SHORT_CONTENT = "This is some really short content"; private static final String LONG_CONTENT = "This is some really long content that " + "ought to force the RestClient to switch from GET to POST. That way I can " + "test to make sure it's doing that automagically like it ought to be. If " + "it's not doing what I want it to do, then I need to fix the bug. It would " + "be bad to let that get out to the users. They would probably have my head " + "if I screwed with them like that. So I'll just test it now and make sure it " + "works so there's no issues with them claiming my head. I think this is more " + "than 255 characters, so I'll stop typing right now."; public static void main(String[] args) throws IOException, SearchException { SearchClient client = new SearchClient("javasdktest"); ContextSearchRequest request = new ContextSearchRequest(SHORT_CONTENT); WebSearchResults results = client.contextWebSearch(request); System.out.println("results.getTotalResultsAvailable() = " + results.getTotalResultsAvailable()); request = new ContextSearchRequest(LONG_CONTENT); results = client.contextWebSearch(request); System.out.println("results.getTotalResultsAvailable() = " + results.getTotalResultsAvailable()); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -