vim /home/disk2/xx/du-rus/du_rus_offline/dict/sample/sample_variable.conf
注意配置文件不要用空的行
[work@gzns-bac-orp-dumi-sandbox-113483 conf]$ vim /home/disk2/xx/du-rus/du_rus_offline/conf/log.conf
重启服务
如果修改其他配置 最后一定重启rus服务
在
/home/disk2/xx/du-rus/du_rus_offline/bin 如果没有bin目录再执行 ./server_control stop 暂停服务
./server_control start 启动服务
先播放30s以上的音乐 有声(小王子小说)
测试rpc.log有short_memory_global_id
测试结果
自动化代码如下
package baiduapi.serverTest.rus;
import baiduapi.baseDeal.fileOperate.FileWrite; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class rusRespAssert { private static Logger logger = LoggerFactory.getLogger(rusRespAssert.class);
/** * @param count * @param request_RECOMMEND * @param response * @return 0 */
public static int responseToParse(int count, String dumisid, JSONObject request_RECOMMEND, JSONObject response) {
try {
// String baseParamPrint = "request_RECOMMEND==" + request_RECOMMEND + "";
String baseParamPrint = ""; String bug = "BUG BUG BUG " + (count + 1) + "id=" + dumisid + baseParamPrint; String pass = "PASS PASS PASS ~ ~ ~ " + (count + 1) + "id=" + dumisid + baseParamPrint; String notExist = "NotExist NotExist NotExist ~ ~ ~ " + (count + 1) + "" + baseParamPrint;
//
if (response != null) {
/** * request.recommends.subCategories.category"RECOMMEND"
* 2020914case */
// session
if (response.containsKey("session")) { String session = response.getString("session");
System.out.println("session==" + session); if (!session.equals("{}")) {
} else { }
}
System.err.println(bug + "session0" + session); System.out.println(pass + "session{}");
} else { System.err.println(notExist + "session");
// version
if (response.containsKey("version")) { String version = response.getString("version");
// System.out.println("version==" + version);
if (!version.equals("2.0.0")) { System.err.println(bug + "version2.0.0" + version);
} else { }
}
System.out.println(pass + "version2.0.0");
} else { System.err.println(notExist + "version");
// responserecommendItems
if (response.containsKey("response")) { JSONObject response_value = response.getJSONObject("response");
// System.out.println("response==" + response_value);
JSONArray resources = response_value.getJSONArray("resources"); if (!resources.isEmpty()) {
JSONArray recommendItems = resources.getJSONObject(0).getJSONObject("payload"). getJSONArray("recommendItems");
int size = recommendItems.size(); System.out.println("recommendItems JSONArray==" + size);
if (size < 100) {
System.err.println(bug + "recommendItems100" + size);
int count_RECOMMEND = 0; for (int i = 0; i < size; i++) {
String id = recommendItems.getJSONObject(i).getString("id"); String array = "" + count_RECOMMEND + ":";
if (!id.isEmpty()) { } else {
}
System.out.println(pass + array + "id==" + id); System.err.println(bug + array + "id");
JSONObject data = recommendItems.getJSONObject(i).getJSONObject("data"); String category = data.getString("category");
if (!category.isEmpty()) { } else {
System.out.println(pass + array + "category==" + category); System.err.println(bug + array + "category");
}
String title = data.getString("title"); System.out.println(pass + array + "debug-title==" + title);
// originLoglog // FileWrite.originLog(pass + array + "debug-title==" + title);
String clickUrl = recommendItems.getJSONObject(i).getJSONObject("data").getString("clickUrl"); if (clickUrl.contains("feed_global_short_memory_recaller") && dumisid.equals("507508")) {
// clickUrlclickUrl78 feed_global_short_memory_recaller2
// url short_memory
System.err.println(pass + array + "clickUrlfeed_global_short_memory_recaller"); FileWrite.originLog(pass + array + "clickUrlfeed_global_short_memory_recaller"); } else {
System.out.println(bug + array + "clickUrl feed_global_short_memory_recaller" + clickUrl);
}
// System.err.println("subCategory=RECOMMENDcount_RECOMMEND==" + count_RECOMMEND);
count_RECOMMEND++; }
//
} else { }
}
System.err.println(bug + "resources");
} else { System.err.println(notExist + "response");
}
// originLoglog
FileWrite.originLog(pass + "================================="); // FileWrite.originLog(" "); FileWrite.originLog(" ");
FileWrite.originLog(" "); System.err.println(pass + "=================================");
System.err.println("Finished~ RUSjsonvalue~"); System.err.println("----------------------------------------");
} else {
}
}
} }
System.err.println("FATAL FATAL FATAL" + (count + 1) + "" + "rec_type" + request_RECOMMEND + "");
} catch ( Exception e) {
e.printStackTrace(); return 0;
PASS PASS PASS ~ ~ ~ 1id=507507=================================
PASS PASS PASS ~ ~ ~ 2id=5075083:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=5075084:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=5075086:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=5075087:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=5075089:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750810:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750812:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750813:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750817:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750819:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750828:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750829:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750830:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750831:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750832:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750835:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750836:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=50750838:clickUrlfeed_global_short_memory_recaller PASS PASS PASS ~ ~ ~ 2id=507508=================================
PASS PASS PASS ~ ~ ~ 3id=507508_507013=================================
PASS PASS PASS ~ ~ ~ 4id= =================================
507507没有
507508有 507508_507013有 这三个ok就没问题了