id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
215950115_36 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void startTest() {\n\t\tList<ConsumerGroupEntity> consumerGroupEntities=new ArrayList<ConsumerGroupEntity>();\n\t\tConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setName(\"test\");\n\t\tconsumerGroupEntity.setId(1L);\n\t\tconsumerGroupEntities.ad... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic void start() {\n\t\tif (startFlag.compareAndSet(false, true)) {\n\t\t\tupdateCache();\n\t\t\texecutor.submit(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\twhile (isRunning) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tupdateCache();\n\t\t\t\t\t\t} catch (Exception e... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_143 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java",
"identifier": "HttpClientTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void postError1Test() throws IOException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"POST\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(200).withBody(\"1\"));\n\t\t\tHttpClient httpClien... | {
"fields": [
{
"declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")",
"modifier": "private static final",
"original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");",
"type": "MediaType",
"var_name": ... | {
"body": "public String post(String url, Object reqObj) throws IOException,BrokerException {\n\t\tString json = \"\";\n\t\tif (reqObj != null) { \n\t\t\tjson = JsonUtil.toJsonNull(reqObj);\n\t\t}\n\t\tResponse response = null;\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http\", url);\n\t\ttry {\n\t\t\t... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_114 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void checkChangedTest() {\n\t\tassertEquals(true, consumerGroupTopicServiceImpl.checkChanged());\n\t\tLastUpdateEntity lastUpdateEntity = new LastUpdateEntity();\n\t\tlastUpdateEntity.setCount(1);\n\t\tlastUpdateEntity.setMaxId(2L);\n\t\twhen(consumerGroupTopicRepository.getLastUpdate()).th... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "protected boolean checkChanged() {\t\t\n\t\tboolean flag= doCheckChanged();\n\t\tif(!flag){\n\t\t\tif(System.currentTimeMillis()-lastTime>soaConfig.getMqMetaRebuildMaxInterval()){\n\t\t\t\tlastTime=System.currentTimeMillis();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\tlastTime=System.currentTimeMill... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_61 | {
"fields": [
{
"declarator": "message01Repository",
"modifier": "private",
"original_string": "private Message01Repository message01Repository;",
"type": "Message01Repository",
"var_name": "message01Repository"
},
{
"declarator": "dbNodeService",
"modifier": "pri... | {
"body": "@Test\n\tpublic void getNearByMessageByIdTest() {\n\t\tmessage01ServiceImpl.getNearByMessageById(\"test\", 1L);\n\t\tverify(message01Repository).getNearByMessageById(anyString(), anyLong());\n\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Repository).getNearByMessageBy... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "publ... | {
"body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic Message01Entity getNearByMessageById(String tbName, long id) {\n\t\tMessage01Entity message01Entity = null;\n\t\tsetMaster(false);\n\t\ttry {\n\t\t\tmessage01Enti... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_77 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void pullData_checkVaildTest() {\n\t\tQueueEntity queueEntity = new QueueEntity();\n\t\tqueueEntity.setDbNodeId(1);\n\t\tqueueEntity.setIp(\"127.0.0.1\");\n\t\tqueueEntity.setId(1L);\n\t\tMap<Long, QueueEntity> data = new HashMap<Long, QueueEntity>();\n\t\tdata.put(queueEntity.getId(), queu... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public PullDataResponse pullData(PullDataRequest request) {\n PullDataResponse response = new PullDataResponse();\n response.setSuc(true);\n Map<Long, QueueEntity> data = queueService.getAllQueueMap();\n checkVaild(request, response, data);\n if (!response.... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_102 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void getFailTopicNamesTest() {\n\t\tconsumerGroupTopicServiceImpl.getFailTopicNames(1);\n\t\tverify(consumerGroupTopicRepository).getFailTopicNames(anyLong());\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImplTest.getFailTopicNamesTest()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic List<String> getFailTopicNames(long consumerGroupId) {\n\t\treturn consumerGroupTopicRepository.getFailTopicNames(consumerGroupId);\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImpl.getFailTopicNames(long consumerGroupId)",
"constructor": false,
"full_signature": "@O... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_98 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void getCacheTest() {\n\t\tassertEquals(0, consumerGroupTopicServiceImpl.getCache().size());\n\t\tList<ConsumerGroupTopicEntity> consumerGroupEntities = new ArrayList<ConsumerGroupTopicEntity>();\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity = new ConsumerGroupTopicEntity();\n\t\tc... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic Map<Long, Map<String, ConsumerGroupTopicEntity>> getCache() {\n\t\t// TODO Auto-generated method stub\n\t\t// return consumerGroupRefMap.get();\n\t\tMap<Long, Map<String, ConsumerGroupTopicEntity>> rs = consumerGroupTopicRefMap.get();\n\t\tif (rs.size() == 0) {\n\t\t\tcacheLock.lock();\... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_155 | {
"fields": [],
"file": "mq-client/mq-client-springboot/src/test/java/com/ppdai/infrastructure/mq/client/stat/MqFilterTest.java",
"identifier": "MqFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void doFilterErrorTest() throws IOException, ServletException {\n\t\tStatService statService=mock(StatService.class);\n\t\tMqFilter mqFilter=new MqFilter();\n\t\tReflectionTestUtils.setField(mqFilter, \"statService\", statService);\n\t\t\n\t\tServletRequest servletRequest=mock(ServletReques... | {
"fields": [
{
"declarator": "statService",
"modifier": "@Autowired\n\tprivate",
"original_string": "@Autowired\n\tprivate StatService statService;",
"type": "StatService",
"var_name": "statService"
}
],
"file": "mq-client/mq-client-springboot/src/main/java/com/ppdai/infrast... | {
"body": "@Override\n\tpublic void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)\n\t\t\tthrows IOException, ServletException {\n\t\ttry {\n\t\t\tchain.doFilter(request, response);\n\t\t} catch (Exception e) {\n\t\t\tstatService.start();\n\t\t\tthrow e;\n\t\t}\n\n\t}",
"class_method_... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_20 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void getTopicTest() {\n\t\tMap<String, ConsumerGroupEntity> consumerGroupRefMap = new HashMap<String, ConsumerGroupEntity>();\n\t\tconsumerGroupRefMap.put(\"test\", new ConsumerGroupEntity());\n\t\tconsumerGroupRefMap.get(\"test\").setId(1L);\n\t\tconsumerGroupServiceImpl.consumerGroupRefMa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic ConsumerGroupTopicEntity getTopic(String consumerGroupName, String topicName) {\n\t\tMap<String, ConsumerGroupEntity> cache = getCache();\n\t\tif (!cache.containsKey(consumerGroupName)) {\n\t\t\treturn null;\n\t\t}\n\t\tif (!consumerGroupTopicService.getCache().containsKey(cache.get(con... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_57 | {
"fields": [
{
"declarator": "message01Repository",
"modifier": "private",
"original_string": "private Message01Repository message01Repository;",
"type": "Message01Repository",
"var_name": "message01Repository"
},
{
"declarator": "dbNodeService",
"modifier": "pri... | {
"body": "@Test\n\tpublic void truncateTest() {\n\t\tmessage01ServiceImpl.truncate(\"test\");\n\t\tverify(message01Repository).truncate(anyString());\n\t\tmessage01ServiceImpl.setDbId(1L);\n\t\tdoThrow(new RuntimeException()).when(message01Repository).truncate(anyString());\n\t\tboolean rs = false;\n\t\ttry {\n\t\t\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "publ... | {
"body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW, value = \"msgTransactionManager\")\n\tpublic void truncate(String tbName) {\n\t\ttry {\n\t\t\tsetMaster(true);\n\t\t\tmessage01Repository.truncate(getDbName() + \".\" + tbName);\n\t\t} catch (Exception e) {\n... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_122 | {
"fields": [
{
"declarator": "consumerGroupService",
"modifier": "private",
"original_string": "private ConsumerGroupService consumerGroupService;",
"type": "ConsumerGroupService",
"var_name": "consumerGroupService"
},
{
"declarator": "consumerService",
"modifier... | {
"body": "@Test\n\tpublic void checkItemTest() {\n\t\tassertEquals(false, Util.isEmpty(consumerGroupConsumerCheckServiceImpl.checkItem()));\n\t}",
"class_method_signature": "ConsumerGroupConsumerCheckServiceImplTest.checkItemTest()",
"constructor": false,
"full_signature": "@Test public void checkItemTest()",
... | {
"fields": [
{
"declarator": "consumerGroupService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private ConsumerGroupService consumerGroupService;",
"type": "ConsumerGroupService",
"var_name": "consumerGroupService"
},
{
"declarator": "c... | {
"body": "@Override\n public String checkItem() {\n String field = \"ConsumerGroupConsumer下校验:\" + ConsumerGroupEntity.FdId + \",\" + ConsumerEntity.FdId;\n return field;\n }",
"class_method_signature": "ConsumerGroupConsumerCheckServiceImpl.checkItem()",
"constructor": false,
"full_signatu... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_175 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void addOpLogTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tmqResource.addOpLog(null);\n\t\tmqResource.addOpLog(new OpLogRequest());\n\t}",
"class_method_signature": "MqResourceTest.addOpL... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public void addOpLog(OpLogRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\texecutor1.submit(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString url = MqConstanst.TOOLPRE + \"/addOpLog\";\n\t\t\t\ttry {\n\t\t\t\t\tpost(request, url, 5, OpLogResponse.class, f... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_16 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void notifyMetaTest() {\n\t\tconsumerGroupServiceImpl.notifyMeta(null);\n\t\tverify(notifyMessageService,times(0)).insert(any(NotifyMessageEntity.class));\n\t\t\n\t\tconsumerGroupServiceImpl.notifyMeta(1L);\n\t\tverify(notifyMessageService).insert(any(NotifyMessageEntity.class));\n\n\t\tcon... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic void notifyMeta(long id) {\n\t\tupdateMetaVersion(Arrays.asList(id));\n\t\tNotifyMessageEntity notifyMessageEntity = new NotifyMessageEntity();\n\t\tnotifyMessageEntity.setConsumerGroupId(id);\n\t\tnotifyMessageEntity.setMessageType(MessageType.Meta);\n\t\tnotifyMessageService.insert(no... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_163 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void getGroupTopicNullTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tassertEquals(\"getGroupTopicNullTest error\", null, mqResource.getGroupTopic(null));\... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public GetGroupTopicResponse getGroupTopic(GetGroupTopicRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.METAPRE + \"/getGroupTopic\";\n\t\tGetGroupTopicResponse response = post(request, url, 2, GetGroupTopicResponse.class, false);\n\t\treturn response... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_134 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void isEmptyTest() {\n\t\tassertEquals(false, Util.isEmpty(\"fasdf\"));\n\t\tassertEquals(true, Util.isEmpty(\"\"));\n\t\tassertEquals(true, Util.isEmpty(null));\n\t}",
"class_method_signature": "UtilTest.isEmptyTest()",
"constructor": false,
"full_signature": "@Test public void isEmp... | {
"fields": [
{
"declarator": "DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\";",
"type": "String",
"var_name": "DEFAULT_FORMATE"
},
{
"declarator":... | {
"body": "public static boolean isEmpty(String str) {\n\t\treturn (str == null || \"\".equals(str)||str.trim().length()==0);\n\t}",
"class_method_signature": "Util.isEmpty(String str)",
"constructor": false,
"full_signature": "public static boolean isEmpty(String str)",
"identifier": "isEmpty",
"invocation... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_41 | {
"fields": [
{
"declarator": "dbNodeRepository",
"modifier": "private",
"original_string": "private DbNodeRepository dbNodeRepository;",
"type": "DbNodeRepository",
"var_name": "dbNodeRepository"
},
{
"declarator": "dbNodeServiceImpl",
"modifier": "private",
... | {
"body": "@Test\n\tpublic void stopTest() {\n\t\tdbNodeServiceImpl.stop();\n\t\tassertEquals(false, dbNodeServiceImpl.isRunning);\n\t}",
"class_method_signature": "DbNodeServiceImplTest.stopTest()",
"constructor": false,
"full_signature": "@Test public void stopTest()",
"identifier": "stopTest",
"invocatio... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "dbNodeRepo... | {
"body": "@PreDestroy\n\t@Override\n\tpublic void stop() {\n\t\tisRunning = false;\n\t}",
"class_method_signature": "DbNodeServiceImpl.stop()",
"constructor": false,
"full_signature": "@PreDestroy @Override public void stop()",
"identifier": "stop",
"invocations": [],
"modifiers": "@PreDestroy @Override ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_118 | {
"fields": [],
"file": "mq-biz/src/test/java/com/ppdai/infrastructure/mq/biz/service/impl/AuditLogServiceImplTest.java",
"identifier": "AuditLogServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void insertTest() {\n\t\tAuditLogServiceImpl auditLogServiceImpl=new AuditLogServiceImpl();\n\t\tUserInfoHolder userInfoHolder=mock(UserInfoHolder.class);\n\t\tAuditLogRepository auditLogRepository=mock(AuditLogRepository.class);\n\t\tReflectionTestUtils.setField(auditLogServiceImpl, \"user... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AuditLogServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AuditLogServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Override\n\tpublic long insert(AuditLogEntity entity) {\n\t\tlog.info(\"tbname_{}_refid_{},content is {},by {}\", entity.getTbName(), entity.getRefId(),\n\t\t\t\tentity.getContent().replaceAll(\" \", \"_\").replaceAll(\"\\\\|\", \"_\").replaceAll(\"\\\\.\", \"_\"),\n\t\t\t\tentity.getInsertBy());\n\t\ttry... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_82 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void deleteByConsumersTest() {\n\t\tconsumerServiceImpl.deleteByConsumers(null);\n\t\tverify(consumerGroupService, times(0)).deleteConsumerGroup(anyLong(), anyBoolean());\n\n\t\tList<ConsumerEntity> consumers = new ArrayList<ConsumerEntity>();\n\t\tConsumerEntity consumerEntity = new Consum... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public boolean deleteByConsumers(List<ConsumerEntity> consumers) {\n if (CollectionUtils.isEmpty(consumers))\n return true;\n//\t\tList<Long> consumerIds = new ArrayList<>();\n//\t\tfor (ConsumerEntity consumer : consumers) {\n//\t\t\tconsumerIds.add(consumer.getId());\n//\... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_94 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void saveAsynMsg_Partition2_Test() {\n\t\tPublishMessageRequest request=new PublishMessageRequest();\n\t\tPublishMessageResponse response=new PublishMessageResponse();\n\t\tList<QueueEntity> queueEntities=new ArrayList<QueueEntity>(2);\n\t\t\n\t\tinitQueueEntity(queueEntities);\t\t\n\t\t\n\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void saveSynMsg1(PublishMessageRequest request, PublishMessageResponse response,\n List<QueueEntity> queueEntities) {\n Map<Long, QueueEntity> queueMap = new HashMap<>();\n queueEntities.forEach(t1 -> {\n queueMap.put(t1.getId(), t1);\n ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_159 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void publishAndUpdateResultFailMsgNullTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\n\t\tmqResource.publishAndUpdateResultFailMsg(null);\n\t}",
"class_met... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public void publishAndUpdateResultFailMsg(FailMsgPublishAndUpdateResultRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/publishAndUpdateResultFailMsg\";\n\t\ttry {\n\t\t\tpost(request, url, 2, FailMsgPublishAndUpdateResultResponse.class, tr... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_158 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void registerNullTest() {\n\t\tMqResource mqResource = new MqResource(\"http://localhost\", 10000, 10000);\n\t\tassertEquals(\"registerNullTest error\", 0, mqResource.register(null));\n\t}",
"class_method_signature": "MqResourceTest.registerNullTest()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public long register(ConsumerRegisterRequest request) {\n\t\tif (request == null) {\n\t\t\treturn 0;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/register\";\n\t\tConsumerRegisterResponse response = null;\n\t\ttry {\n\t\t\tresponse = post(request, url, 10, ConsumerRegisterResponse.class, true);\n\... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_95 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void saveAsynMsg_Partition3_Test() {\n\t\tPublishMessageRequest request=new PublishMessageRequest();\n\t\tPublishMessageResponse response=new PublishMessageResponse();\n\t\tList<QueueEntity> queueEntities=new ArrayList<QueueEntity>(3);\n\t\t\n\t\tinitQueueEntity(queueEntities);\t\t\n\t\t\n\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void saveSynMsg1(PublishMessageRequest request, PublishMessageResponse response,\n List<QueueEntity> queueEntities) {\n Map<Long, QueueEntity> queueMap = new HashMap<>();\n queueEntities.forEach(t1 -> {\n queueMap.put(t1.getId(), t1);\n ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_119 | {
"fields": [],
"file": "mq-biz/src/test/java/com/ppdai/infrastructure/mq/biz/service/impl/AuditLogServiceImplTest.java",
"identifier": "AuditLogServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void getMindIdTest() {\n\t\tAuditLogServiceImpl auditLogServiceImpl=new AuditLogServiceImpl();\n\t\tUserInfoHolder userInfoHolder=mock(UserInfoHolder.class);\n\t\tAuditLogRepository auditLogRepository=mock(AuditLogRepository.class);\n\t\tReflectionTestUtils.setField(auditLogServiceImpl, \"u... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AuditLogServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AuditLogServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Override\n\tpublic long getMindId() {\n\t\tLong minId = auditLogRepository.getMinId();\n\t\tif (minId == null) {\n\t\t\treturn 0L;\n\t\t} else {\n\t\t\treturn minId;\n\t\t}\n\t}",
"class_method_signature": "AuditLogServiceImpl.getMindId()",
"constructor": false,
"full_signature": "@Override public l... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_83 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void getConsumerByConsumerGroupIdTest() {\n\t\tconsumerServiceImpl.getConsumerByConsumerGroupId(1L);\n\t\tverify(consumerRepository).getConsumerByConsumerGroupId(1L);\n\t}",
"class_method_signature": "ConsumerServiceImplTest.getConsumerByConsumerGroupIdTest()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public ConsumerEntity getConsumerByConsumerGroupId(Long consumerGroupId) {\n // TODO Auto-generated method stub\n return consumerRepository.getConsumerByConsumerGroupId(consumerGroupId);\n }",
"class_method_signature": "ConsumerServiceImpl.getConsumerByConsumerGroupId(Long... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_135 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/TopicUtilTest.java",
"identifier": "TopicUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void getFailTopicNameTest() {\n\t\tassertEquals(\"1_2_fail\", TopicUtil.getFailTopicName(\"1\", \"2\"));\n\t}",
"class_method_signature": "TopicUtilTest.getFailTopicNameTest()",
"constructor": false,
"full_signature": "@Test public void getFailTopicNameTest()",
"identifier": "getFai... | {
"fields": [],
"file": "mq-client/mq-core/src/main/java/com/ppdai/infrastructure/mq/biz/common/util/TopicUtil.java",
"identifier": "TopicUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "TopicUtil.getFailTopicName(String consumerGroupName, String topicName)",
"constructor": f... | {
"body": "public static String getFailTopicName(String consumerGroupName, String topicName) {\n\t\treturn String.format(\"%s_%s_fail\", consumerGroupName, topicName);\n\t}",
"class_method_signature": "TopicUtil.getFailTopicName(String consumerGroupName, String topicName)",
"constructor": false,
"full_signature... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_40 | {
"fields": [
{
"declarator": "dbNodeRepository",
"modifier": "private",
"original_string": "private DbNodeRepository dbNodeRepository;",
"type": "DbNodeRepository",
"var_name": "dbNodeRepository"
},
{
"declarator": "dbNodeServiceImpl",
"modifier": "private",
... | {
"body": "@Test\n\tpublic void checkChangedTest() {\n\t\tassertEquals(true, dbNodeServiceImpl.checkChanged());\n\t\tLastUpdateEntity lastUpdateEntity = new LastUpdateEntity();\n\t\tlastUpdateEntity.setCount(1);\n\t\tlastUpdateEntity.setMaxId(2L);\n\t\twhen(dbNodeRepository.getLastUpdate()).thenReturn(lastUpdateEntit... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "dbNodeRepo... | {
"body": "protected boolean checkChanged() {\n\t\tTransaction transaction = Tracer.newTransaction(\"Timer\", \"DbNode-checkChanged\");\n\t\tboolean flag = false;\n\t\ttry {\n\t\t\tLastUpdateEntity temp = dbNodeRepository.getLastUpdate();\n\t\t\tif ((lastUpdateEntity == null && temp != null) || (lastUpdateEntity != n... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_17 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void getByNamesTest() {\n\t\tassertEquals(true, consumerGroupServiceImpl.getByNames(null).size() == 0);\n\n\t\tList<ConsumerGroupEntity> consumerGroupEntities = new ArrayList<ConsumerGroupEntity>();\n\t\tConsumerGroupEntity consumerGroupEntity = new ConsumerGroupEntity();\n\t\tconsumerGroup... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic Map<String, ConsumerGroupEntity> getByNames(List<String> names) {\n\t\tif (CollectionUtils.isEmpty(names)) {\n\t\t\treturn new HashMap<>();\n\t\t}\n\t\tList<ConsumerGroupEntity> consumerGroupEntities = consumerGroupRepository.getByNames(names);\n\t\tMap<String, ConsumerGroupEntity> map ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_162 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void getTopicNullTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tassertEquals(\"getTopicNullTest error\", null, mqResource.getTopic(null));\n\t}",
"class... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public GetTopicResponse getTopic(GetTopicRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.METAPRE + \"/getTopic\";\n\t\tGetTopicResponse response = post(request, url, 2, GetTopicResponse.class, false);\n\t\treturn response;\n\t}",
"class_method_signa... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_174 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void addLogTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tmqResource.addLog(null);\n\t\tmqResource.addLog(new LogRequest());\n\t}",
"class_method_signature": "MqResourceTest.addLogTest()",... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public void addLog(LogRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\texecutor.execute(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString url = MqConstanst.TOOLPRE + \"/addLog\";\n\t\t\t\ttry {\n\t\t\t\t\tpost(request, url, 1, LogResponse.class, false);\n... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_56 | {
"fields": [
{
"declarator": "message01Repository",
"modifier": "private",
"original_string": "private Message01Repository message01Repository;",
"type": "Message01Repository",
"var_name": "message01Repository"
},
{
"declarator": "dbNodeService",
"modifier": "pri... | {
"body": "@Test\n\tpublic void getDbNameTest() {\n\t\tassertEquals(null, message01ServiceImpl.getDbName());\n\t\tMap<Long, DbNodeEntity> cache = new HashMap<Long, DbNodeEntity>();\n\t\tcache.put(1L, new DbNodeEntity());\n\t\tcache.get(1L).setDbName(\"test\");\n\t\twhen(dbNodeService.getCache()).thenReturn(cache);\n\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "publ... | {
"body": "@Override\n\tpublic String getDbName() {\n\t\tMap<Long, DbNodeEntity> cache = dbNodeService.getCache();\n\t\tlong id = dbId.get();\n\t\tif (cache.containsKey(id)) {\n\t\t\treturn cache.get(id).getDbName();\n\t\t}\n\t\tlog.error(\"dbName_is_null_and_id_is_\" + id + \",and Json is \" + JsonUtil.toJsonNull(ca... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_123 | {
"fields": [
{
"declarator": "consumerGroupService",
"modifier": "private",
"original_string": "private ConsumerGroupService consumerGroupService;",
"type": "ConsumerGroupService",
"var_name": "consumerGroupService"
},
{
"declarator": "consumerService",
"modifier... | {
"body": "@Test\n\tpublic void checkResultTest() {\n\t\tMap<Long, ConsumerGroupEntity> consumerGroupMap=new HashMap<Long, ConsumerGroupEntity>();\n\t\tconsumerGroupMap.put(2L, new ConsumerGroupEntity());\n\t\tList<ConsumerEntity> consumerList=new ArrayList<ConsumerEntity>();\n\t\tConsumerEntity consumerEntity=new C... | {
"fields": [
{
"declarator": "consumerGroupService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private ConsumerGroupService consumerGroupService;",
"type": "ConsumerGroupService",
"var_name": "consumerGroupService"
},
{
"declarator": "c... | {
"body": "@Override\n public String checkResult() {\n String result = null;\n Map<Long, ConsumerGroupEntity> consumerGroupMap = consumerGroupService.getIdCache();\n List<ConsumerEntity> consumerList =consumerService.getList();\n List<ConsumerGroupConsumerEntity> consumerGroupConsumerLi... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_154 | {
"fields": [],
"file": "mq-client/mq-client-springboot/src/test/java/com/ppdai/infrastructure/mq/client/stat/MqFilterTest.java",
"identifier": "MqFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void doFilterTest() throws IOException, ServletException {\n\t\tStatService statService=mock(StatService.class);\n\t\tMqFilter mqFilter=new MqFilter();\n\t\tReflectionTestUtils.setField(mqFilter, \"statService\", statService);\n\t\t\n\t\tServletRequest servletRequest=mock(ServletRequest.cla... | {
"fields": [
{
"declarator": "statService",
"modifier": "@Autowired\n\tprivate",
"original_string": "@Autowired\n\tprivate StatService statService;",
"type": "StatService",
"var_name": "statService"
}
],
"file": "mq-client/mq-client-springboot/src/main/java/com/ppdai/infrast... | {
"body": "@Override\n\tpublic void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)\n\t\t\tthrows IOException, ServletException {\n\t\ttry {\n\t\t\tchain.doFilter(request, response);\n\t\t} catch (Exception e) {\n\t\t\tstatService.start();\n\t\t\tthrow e;\n\t\t}\n\n\t}",
"class_method_... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_21 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void stopTest() {\n\t\tconsumerGroupServiceImpl.stop();\n\t\tassertEquals(false, consumerGroupServiceImpl.isRunning);\n\t}",
"class_method_signature": "ConsumerGroupServiceImplTest.stopTest()",
"constructor": false,
"full_signature": "@Test public void stopTest()",
"identifier": "st... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@PreDestroy\n\t@Override\n\tpublic void stop() {\n\t\tisRunning = false;\n\t}",
"class_method_signature": "ConsumerGroupServiceImpl.stop()",
"constructor": false,
"full_signature": "@PreDestroy @Override public void stop()",
"identifier": "stop",
"invocations": [],
"modifiers": "@PreDestroy @Ov... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_76 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void checkFailTimeTest() {\n\t\tQueueEntity queueEntity = new QueueEntity();\n\t\tqueueEntity.setDbNodeId(1);\n\t\tqueueEntity.setIp(\"127.0.0.1\");\n\t\tassertEquals(true, consumerServiceImpl.checkFailTime(\"test\", queueEntity, null));\n\n\t\tconsumerServiceImpl.dbFailMap.put(queueEntity.... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected boolean checkFailTime(String topicName, QueueEntity entity, List<String> logLst) {\n if (dbFailMap.containsKey(getFailDbUp(entity))\n && (System.currentTimeMillis() - dbFailMap.get(getFailDbUp(entity))) < soaConfig.getDbFailWaitTime()\n * 1000L) {\n ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_103 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void getCorrespondConsumerGroupTopicTest() {\n\t\tconsumerGroupTopicServiceImpl.getCorrespondConsumerGroupTopic(new HashMap<String, Object>());\n\t\tverify(consumerGroupTopicRepository).getCorrespondConsumerGroupTopic(anyMapOf(String.class, Object.class));\n\t}",
"class_method_signature":... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic ConsumerGroupTopicEntity getCorrespondConsumerGroupTopic(Map<String, Object> parameterMap) {\n\t\treturn consumerGroupTopicRepository.getCorrespondConsumerGroupTopic(parameterMap);\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImpl.getCorrespondConsumerGroupTopic(Map<Stri... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_99 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void getGroupTopicTest() {\n\t\tassertEquals(0, consumerGroupTopicServiceImpl.getGroupTopic().size());\n\t\tList<ConsumerGroupTopicEntity> consumerGroupEntities = new ArrayList<ConsumerGroupTopicEntity>();\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity = new ConsumerGroupTopicEntity... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic Map<String, ConsumerGroupTopicEntity> getGroupTopic() {\n\t\t// TODO Auto-generated method stub\n\t\t// return groupTopicRefMap.get();\n\n\t\tMap<String, ConsumerGroupTopicEntity> rs = groupTopicRefMap.get();\n\t\tif (rs.size() == 0) {\n\t\t\tcacheLock.lock();\n\t\t\ttry {\n\t\t\t\trs =... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_115 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void forceUpdateCacheTest() {\n\t\tList<ConsumerGroupTopicEntity> consumerGroupEntities = new ArrayList<ConsumerGroupTopicEntity>();\n\t\tConsumerGroupTopicEntity consumerGroupEntity = new ConsumerGroupTopicEntity();\n\t\tconsumerGroupEntity.setConsumerGroupName(\"test\");\n\t\tconsumerGrou... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic void forceUpdateCache() {\n\t\tTransaction transaction = Tracer.newTransaction(\"Timer\", \"ConsumerGroupTopic-updateCache\");\n\t\tTraceMessageItem traceMessageItem = new TraceMessageItem();\n\t\ttry {\n\t\t\tList<ConsumerGroupTopicEntity> consumerGroupEntities = getList();\n\t\t\tMqRe... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_60 | {
"fields": [
{
"declarator": "message01Repository",
"modifier": "private",
"original_string": "private Message01Repository message01Repository;",
"type": "Message01Repository",
"var_name": "message01Repository"
},
{
"declarator": "dbNodeService",
"modifier": "pri... | {
"body": "@Test\n\tpublic void getListByTimeTest() {\n\t\tmessage01ServiceImpl.getListByTime(\"test\", \"test\");\n\t\tverify(message01Repository).getListByTime(anyString(), anyString());\n\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Repository).getListByTime(anyString(), anyS... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "publ... | {
"body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic List<Message01Entity> getListByTime(String tbName, String insertTime) {\n\t\tList<Message01Entity> rs = new ArrayList<>();\n\t\ttry {\n\t\t\tsetMaster(false);\n\t... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_37 | {
"fields": [
{
"declarator": "emailServiceImpl",
"modifier": "private",
"original_string": "private EmailServiceImpl emailServiceImpl;",
"type": "EmailServiceImpl",
"var_name": "emailServiceImpl"
},
{
"declarator": "topicService",
"modifier": "private",
"or... | {
"body": "@Test\n\tpublic void sendConsumerMailTest() {\n\t\tSendMailRequest sendMailRequest=new SendMailRequest();\n\t\tsendMailRequest.setConsumerGroupName(\"test\");\n\t\tsendMailRequest.setTopicName(\"test\");\n\t\tsendMailRequest.setType(1);\n\t\tsendMailRequest.setSubject(\"test\");\n\t\t\n\t\t\n\t\t\n\t\tMap<... | {
"fields": [
{
"declarator": "topicService",
"modifier": "@Autowired\n\tprivate",
"original_string": "@Autowired\n\tprivate TopicService topicService;",
"type": "TopicService",
"var_name": "topicService"
},
{
"declarator": "consumerGroupService",
"modifier": "@Au... | {
"body": "@Override\n\tpublic void sendConsumerMail(SendMailRequest request) {\n\t\t// 使用以前的告警方式\n\t\tsendByConsumer(request);\n\t\taddLogMsg(request);\n\t}",
"class_method_signature": "EmailServiceImpl.sendConsumerMail(SendMailRequest request)",
"constructor": false,
"full_signature": "@Override public void s... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_142 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java",
"identifier": "HttpClientTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void postErrorTest() throws IOException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000); \n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"POST\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(700).withBody(\"1\"));\n\t\t\tHttpClient httpClien... | {
"fields": [
{
"declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")",
"modifier": "private static final",
"original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");",
"type": "MediaType",
"var_name": ... | {
"body": "public String post(String url, Object reqObj) throws IOException,BrokerException {\n\t\tString json = \"\";\n\t\tif (reqObj != null) { \n\t\t\tjson = JsonUtil.toJsonNull(reqObj);\n\t\t}\n\t\tResponse response = null;\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http\", url);\n\t\ttry {\n\t\t\t... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_139 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java",
"identifier": "HttpClientTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void getErrorTest() throws IOException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"GET\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(700).withBody(\"1\"));\n\t\t\tHttpClient httpClient =... | {
"fields": [
{
"declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")",
"modifier": "private static final",
"original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");",
"type": "MediaType",
"var_name": ... | {
"body": "public <T> T get(String url, Class<T> class1) throws IOException {\n\t\tString rs = get(url);\n\t\tif (rs == null || rs.length() == 0 || rs.trim().length() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn JsonUtil.parseJson(rs, class1);\n\t\t}\n\t}",
"class_method_signature": "HttpClient.get(Strin... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_181 | {
"fields": [
{
"declarator": "consumerError = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\r\\n\" + \"<messageQueue>\\r\\n\"\n\t\t\t+ \" <consumer1 groupName=\\\"testSub\\\">\\r\\n\" + \" <topics>\\r\\n\"\n\t\t\t+ \" <topic name=\\\"test\\\" receiverType=\\\"com.ppdai.infra... | {
"body": "@Test\n\tpublic void getConfigXmlTest() {\n\t\ttry {\n\t\t\tMap<String, ConsumerGroupVo> maps = ClientConfigHelper.getConfig(consumerError);\n\t\t\tassertEquals(\"consumerError 解析异常\", 1, maps.size());\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\ttry {\n\t\t\tMap<String, Consum... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ClientConfigHelper.class)",
"modifier": "private static",
"original_string": "private static Logger log = LoggerFactory.getLogger(ClientConfigHelper.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarat... | {
"body": "public Map<String, ConsumerGroupVo> getConfig() {\n\t\ttry {\n\t\t\tInputStream inputStream = getConfigFileStream();\n\t\t\treturn getConfig(inputStream);\n\t\t} catch (Exception ex) {\n\t\t\tlog.error(\"加载配置文件异常,异常信息:\" + ex.getMessage(), ex);\n\t\t\tthrow new RuntimeException(ex);\n\t\t}\n\n\t}",
"clas... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_178 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/config/ConsumerGroupVoTest.java",
"identifier": "ConsumerGroupVoTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void setGroupNameTest() {\n\t\tConsumerGroupVo consumerGroupVo = new ConsumerGroupVo(\"tttt\");\n\t\tboolean rs = false;\n\t\ttry {\n\t\t\tconsumerGroupVo = new ConsumerGroupVo();\n\t\t\tconsumerGroupVo.setGroupName(null);\n\t\t} catch (Exception e) {\n\t\t\trs = true;\n\t\t}\n\t\tassertEqu... | {
"fields": [
{
"declarator": "meta",
"modifier": "private",
"original_string": "private ConsumerGroupMetaVo meta;",
"type": "ConsumerGroupMetaVo",
"var_name": "meta"
},
{
"declarator": "topics",
"modifier": "private",
"original_string": "private Map<String,... | {
"body": "public void setGroupName(String name) {\n\t\tif (meta == null) {\n\t\t\tif (Util.isEmpty(name)) {\n\t\t\t\tthrow new IllegalArgumentException(\"参数不对,consumerGroupName不能为空!\");\n\t\t\t}\n\t\t\tmeta = new ConsumerGroupMetaVo();\n\t\t\tmeta.setName(name);\n\t\t}\n\t}",
"class_method_signature": "ConsumerGro... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_1 | {
"fields": [
{
"declarator": "consumerGroupCheckServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupCheckServiceImpl consumerGroupCheckServiceImpl;",
"type": "ConsumerGroupCheckServiceImpl",
"var_name": "consumerGroupCheckServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void checkResultTest() {\n\t\tMap<String, ConsumerGroupEntity> consumerGroupMap = new HashMap<>();//consumerGroupService.getCache();\n\t\tConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setName(\"test\");\n\t\tconsumerGroupEntity.setOriginName(\"t... | {
"fields": [
{
"declarator": "consumerGroupService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private ConsumerGroupService consumerGroupService;",
"type": "ConsumerGroupService",
"var_name": "consumerGroupService"
},
{
"declarator": "c... | {
"body": "@Override\n public String checkResult() {\n String result = null;\n Map<String, ConsumerGroupEntity> consumerGroupMap = consumerGroupService.getCache();\n Map<String, ConsumerGroupTopicEntity> consumerGroupTopicMap = consumerGroupTopicService.getGroupTopic();\n Map<String,Top... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_51 | {
"fields": [
{
"declarator": "message01Repository",
"modifier": "private",
"original_string": "private Message01Repository message01Repository;",
"type": "Message01Repository",
"var_name": "message01Repository"
},
{
"declarator": "dbNodeService",
"modifier": "pri... | {
"body": "@Test\n\tpublic void countByPageTest() {\n\t\tmessage01ServiceImpl.countByPage(new HashMap<String, Object>());\n\t\tverify(message01Repository).countByPage(anyMap());\n\t\tmessage01ServiceImpl.setDbId(1);\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Repository).countB... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "publ... | {
"body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic long countByPage(Map<String, Object> parameterMap) {\n\t\ttry {\n\t\t\tsetMaster(false);\n\t\t\treturn message01Repository.countByPage(parameterMap);\n\t\t} final... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_124 | {
"fields": [
{
"declarator": "consumerCommitServiceImpl = null",
"modifier": "",
"original_string": "ConsumerCommitServiceImpl consumerCommitServiceImpl = null;",
"type": "ConsumerCommitServiceImpl",
"var_name": "consumerCommitServiceImpl"
},
{
"declarator": "queueOffs... | {
"body": "@Test\n\tpublic void commitOffsetTest() {\n\t\tCommitOffsetRequest request = new CommitOffsetRequest();\n\t\trequest.setFlag(1);\n\t\tList<ConsumerQueueVersionDto> queueOffsets = buildQueueOffsets();\n\t\trequest.setQueueOffsets(queueOffsets);\n\t\t//init();\n\t\twhen(queueOffsetService.commitOffset(any(Qu... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerCommitService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ConsumerCommitService.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "protected void commitOffset() {\n\t\tlog.info(\"doSubmitOffset\");\n\t\twhile (isRunning) {\n\t\t\tdoCommit();\n\t\t\t// 通过随机的方式来避免数据库的洪峰压力\n\t\t\tUtil.sleep(soaConfig.getCommitSleepTime());\n\t\t}\n\t}",
"class_method_signature": "ConsumerCommitServiceImpl.commitOffset()",
"constructor": false,
"ful... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_173 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void getTopicQueueIdsNullTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tassertEquals(\"getTopicQueueIdsNullTest error\", null, mqResource.getTopicQueueIds(null));\n\t}",
"class_method_sign... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public GetTopicQueueIdsResponse getTopicQueueIds(GetTopicQueueIdsRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.METAPRE + \"/getTopicQueueIds\";\n\t\ttry {\n\t\t\treturn post(request, url, 2, GetTopicQueueIdsResponse.class, false);\n\t\t} catch (Exce... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_10 | {
"fields": [
{
"declarator": "consumerGroupService",
"modifier": "private",
"original_string": "private ConsumerGroupService consumerGroupService;",
"type": "ConsumerGroupService",
"var_name": "consumerGroupService"
},
{
"declarator": "auditLogService",
"modifier... | {
"body": "@Test\n\tpublic void addOpLogTest() {\n\t\tOpLogRequest logRequest=new OpLogRequest();\n\t\tlogServiceImpl.addOpLog(logRequest);\n\t\tverify(auditLogService,times(0)).insert(any(AuditLogEntity.class));\n\t\tlogServiceImpl.addOpLog(null);\n\t\tverify(auditLogService,times(0)).insert(any(AuditLogEntity.class... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(LogServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(LogServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "logType = new Ha... | {
"body": "@Override\n\tpublic void addOpLog(OpLogRequest request) {\n\t\tif (request == null || StringUtils.isEmpty(request.getConsumerGroupName())) {\n\t\t\treturn;\n\t\t}\n\t\tMap<String, ConsumerGroupEntity> cache = consumerGroupService.getCache();\n\t\tif (!cache.containsKey(request.getConsumerGroupName())) {\n\... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_165 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void addCatSucTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tmqResource.addCat(new CatRequest());\n\t}",
"class_method_signature": "MqResourceTest.addCa... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public void addCat(CatRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\texecutor1.submit(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString url = MqConstanst.TOOLPRE + \"/addCat\";\n\t\t\t\ttry {\n\t\t\t\t\tpost(request, url, 1, CatResponse.class, false);\n... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_132 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void sleepTest() {\n\t\tUtil.sleep(1);\n\t}",
"class_method_signature": "UtilTest.sleepTest()",
"constructor": false,
"full_signature": "@Test public void sleepTest()",
"identifier": "sleepTest",
"invocations": [
"sleep"
],
"modifiers": "@Test public",
"parameters": "()"... | {
"fields": [
{
"declarator": "DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\";",
"type": "String",
"var_name": "DEFAULT_FORMATE"
},
{
"declarator":... | {
"body": "public static void sleep(long millisecondes) {\n\t\ttry {\n\t\t\tTimeUnit.MILLISECONDS.sleep(millisecondes);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t// e.printStackTrace();\n\t\t}\n\t}",
"class_method_signature": "Util.sleep(long millisecondes)",
"constructor": fal... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_47 | {
"fields": [
{
"declarator": "message01Repository",
"modifier": "private",
"original_string": "private Message01Repository message01Repository;",
"type": "Message01Repository",
"var_name": "message01Repository"
},
{
"declarator": "dbNodeService",
"modifier": "pri... | {
"body": "@Test\n\tpublic void insertBatchDyTest() {\n\t\tList<Message01Entity> entities = new ArrayList<Message01Entity>();\n\t\tMessage01Entity message01Entity = new Message01Entity();\n\t\tentities.add(message01Entity);\n\t\tmessage01ServiceImpl.insertBatchDy(\"test\", \"test\", entities);\n\t\tverify(message01Re... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "publ... | {
"body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW, value = \"msgTransactionManager\")\n\tpublic void insertBatchDy(String topic, String tbName, List<Message01Entity> entities) {\n\t\tTimer.Context context = publishTimer.time();\n\t\t// Transaction transaction... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_149 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/ClassLoaderUtilTest.java",
"identifier": "ClassLoaderUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void getLoaderTest() {\n\t\tassertEquals(true, ClassLoaderUtil.getLoader() != null);\n\t}",
"class_method_signature": "ClassLoaderUtilTest.getLoaderTest()",
"constructor": false,
"full_signature": "@Test public void getLoaderTest()",
"identifier": "getLoaderTest",
"invocations": [... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ClassLoaderUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ClassLoaderUtil.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static ClassLoader getLoader() {\n\t\treturn loader;\n\t}",
"class_method_signature": "ClassLoaderUtil.getLoader()",
"constructor": false,
"full_signature": "public static ClassLoader getLoader()",
"identifier": "getLoader",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_84 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void countByTest() {\n\t\tconsumerServiceImpl.countBy(new HashMap<String, Object>());\n\t\tverify(consumerRepository).countBy(anyMapOf(String.class, Object.class));\n\t}",
"class_method_signature": "ConsumerServiceImplTest.countByTest()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public long countBy(Map<String, Object> conditionMap) {\n return consumerRepository.countBy(conditionMap);\n }",
"class_method_signature": "ConsumerServiceImpl.countBy(Map<String, Object> conditionMap)",
"constructor": false,
"full_signature": "@Override public long countBy(M... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_108 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void getTopicSubscribeMapTest() {\n\t\tassertEquals(0, consumerGroupTopicServiceImpl.getTopicSubscribeMap().size());\n\t\tList<ConsumerGroupTopicEntity> consumerGroupEntities = new ArrayList<ConsumerGroupTopicEntity>();\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity = new ConsumerGr... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic Map<String, List<ConsumerGroupTopicEntity>> getTopicSubscribeMap(){\n\t\treturn topicSubscribeRefMap.get();\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImpl.getTopicSubscribeMap()",
"constructor": false,
"full_signature": "@Override public Map<String, List<ConsumerG... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_92 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void saveAsynMsg_NoPartition_Test() {\n\t\tPublishMessageRequest request=new PublishMessageRequest();\n\t\tPublishMessageResponse response=new PublishMessageResponse();\n\t\tList<QueueEntity> queueEntities=new ArrayList<QueueEntity>(3);\t\t\n\t\tinitQueueEntity(queueEntities);\t\t\n\t\trequ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void saveSynMsg1(PublishMessageRequest request, PublishMessageResponse response,\n List<QueueEntity> queueEntities) {\n Map<Long, QueueEntity> queueMap = new HashMap<>();\n queueEntities.forEach(t1 -> {\n queueMap.put(t1.getId(), t1);\n ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_128 | {
"fields": [
{
"declarator": "consumerGroupTopicCheckServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicCheckServiceImpl consumerGroupTopicCheckServiceImpl;",
"type": "ConsumerGroupTopicCheckServiceImpl",
"var_name": "consumerGroupTopicCheckServiceImp... | {
"body": "@Test\n\tpublic void checkResult1Test() {\n\t\tMap<String, ConsumerGroupTopicEntity> consumerGroupTopicMap = new HashMap<String, ConsumerGroupTopicEntity>();\t\t\n\t\t//t1.getConsumerGroupName() + \"_\" + t1.getTopicName()\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity=new ConsumerGroupTopicEntity(... | {
"fields": [
{
"declarator": "consumerGroupTopicService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private ConsumerGroupTopicService consumerGroupTopicService;",
"type": "ConsumerGroupTopicService",
"var_name": "consumerGroupTopicService"
},
... | {
"body": "@Override\n public String checkResult() {\n String result = null;\n Map<String,ConsumerGroupTopicEntity> consumerGroupTopicMap = consumerGroupTopicService.getGroupTopic();\n Map<String,ConsumerGroupEntity> consumerGroupMap=consumerGroupService.getCache();\n Map<String, TopicE... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_6 | {
"fields": [
{
"declarator": "consumerGroupConsumerRepository",
"modifier": "private",
"original_string": "private ConsumerGroupConsumerRepository consumerGroupConsumerRepository;",
"type": "ConsumerGroupConsumerRepository",
"var_name": "consumerGroupConsumerRepository"
},
{... | {
"body": "@Test\n\tpublic void deleteByConsumerIdTest() {\n\t\t// consumerGroupConsumerRepository.deleteByConsumerId(consumerId);\n\t\tdoNothing().when(consumerGroupConsumerRepository).deleteByConsumerId(anyLong());\n\t\tconsumerGroupConsumerServiceImpl.deleteByConsumerId(1L);\n\t\tverify(consumerGroupConsumerReposi... | {
"fields": [
{
"declarator": "consumerGroupConsumerRepository",
"modifier": "@Autowired\n\tprivate",
"original_string": "@Autowired\n\tprivate ConsumerGroupConsumerRepository consumerGroupConsumerRepository;",
"type": "ConsumerGroupConsumerRepository",
"var_name": "consumerGroupCons... | {
"body": "@Override\n\tpublic void deleteByConsumerId(long consumerId) {\n\t\tconsumerGroupConsumerRepository.deleteByConsumerId(consumerId);\n\t}",
"class_method_signature": "ConsumerGroupConsumerServiceImpl.deleteByConsumerId(long consumerId)",
"constructor": false,
"full_signature": "@Override public void d... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_169 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void heartbeatNullTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tmqResource.heartbeat(null);\n\t}",
"class_method_signature": "MqResourceTest.heartbeatNullTest()",
"constructor": false,
... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public void heartbeat(HeartbeatRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/heartbeat\";\n\t\ttry {\n\t\t\tpost(request, url, 3, HeartbeatResponse.class, false);\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}"... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_30 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void updateMetaVersionTest() {\n\t\tconsumerGroupServiceImpl.updateMetaVersion(null);\n\t\tverify(consumerGroupRepository,times(0)).updateMetaVersion(anyListOf(Long.class));\n\t}",
"class_method_signature": "ConsumerGroupServiceImplTest.updateMetaVersionTest()",
"constructor": false,
... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "protected void updateMetaVersion(List<Long> ids) {\n\t\tif (CollectionUtils.isEmpty(ids))\n\t\t\treturn;\n\t\tconsumerGroupRepository.updateMetaVersion(ids);\n\t}",
"class_method_signature": "ConsumerGroupServiceImpl.updateMetaVersion(List<Long> ids)",
"constructor": false,
"full_signature": "protect... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_145 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java",
"identifier": "HttpClientTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void postError2Test() throws IOException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"POST\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(700).withBody(\"1\"));\n\t\t\tHttpClient httpClien... | {
"fields": [
{
"declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")",
"modifier": "private static final",
"original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");",
"type": "MediaType",
"var_name": ... | {
"body": "public String post(String url, Object reqObj) throws IOException,BrokerException {\n\t\tString json = \"\";\n\t\tif (reqObj != null) { \n\t\t\tjson = JsonUtil.toJsonNull(reqObj);\n\t\t}\n\t\tResponse response = null;\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http\", url);\n\t\ttry {\n\t\t\t... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_112 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void createConsumerGroupTopicTest() {\n\t\tConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest = new ConsumerGroupTopicCreateRequest();\n\t\tconsumerGroupTopicCreateRequest.setConsumerGroupId(1L);\n\t\tconsumerGroupTopicCreateRequest.setConsumerGroupName(\"test\");\n\t\tconsumer... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic ConsumerGroupTopicEntity createConsumerGroupTopic(\n\t\t\tConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest) {\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity = new ConsumerGroupTopicEntity();\n\t\tconsumerGroupTopicEntity.setConsumerGroupId(consumerGroupTopicCreate... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_67 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void getConsumerGroupByConsumerGroupIdsTest() {\n\t\tassertEquals(0, consumerServiceImpl.getConsumerGroupByConsumerGroupIds(null).size());\n\n\t\tconsumerServiceImpl.getConsumerGroupByConsumerGroupIds(Arrays.asList(1L));\n\n\t\tverify(consumerGroupConsumerService).getByConsumerGroupIds(anyL... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public List<ConsumerGroupConsumerEntity> getConsumerGroupByConsumerGroupIds(List<Long> consumerGroupIds) {\n if (CollectionUtils.isEmpty(consumerGroupIds)) {\n return new ArrayList<>();\n }\n // TODO Auto-generated method stub\n return consumerGroupCons... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_88 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void updateQueueCacheTest() {\n\t\tdoThrow(new RuntimeException()).when(queueService).updateCache();\n\t\tconsumerServiceImpl.updateQueueCache(\"test\");\n\t}",
"class_method_signature": "ConsumerServiceImplTest.updateQueueCacheTest()",
"constructor": false,
"full_signature": "@Test p... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void updateQueueCache(String topicName) {\n if (System.currentTimeMillis() - lastTime > 10 * 1000) {\n lastTime = System.currentTimeMillis();\n try {\n emailUtil.sendErrorMail(topicName + \"没有可用的队列请注意\", \"没有可用的队列,请注意!!\");\n queueService... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_71 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void publish1Test() {\n\t\t// 测试无可写队列,但是是非严格模式\n\t\tPublishMessageRequest request = new PublishMessageRequest();\n\t\trequest.setTopicName(\"test\");\n\t\trequest.setMsgs(Arrays.asList(new ProducerDataDto()));\n\t\tMap<String, TopicEntity> cacheData = new HashMap<String, TopicEntity>();\n\t... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public PublishMessageResponse publish(PublishMessageRequest request) {\n PublishMessageResponse response = new PublishMessageResponse();\n checkVaild(request, response);\n if (!response.isSuc()) {\n return response;\n }\n try {\n if (!... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_104 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void updateEmailByGroupNameTest() {\n\t\tconsumerGroupTopicServiceImpl.updateEmailByGroupName(\"1\", \"3\");\n\t\tverify(consumerGroupTopicRepository).updateEmailByGroupName(anyString(), anyString());\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImplTest.updateEmailByGroupNa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Override\n\tpublic void updateEmailByGroupName(String groupName, String alarmEmails) {\n\t\tconsumerGroupTopicRepository.updateEmailByGroupName(groupName, alarmEmails);\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImpl.updateEmailByGroupName(String groupName, String alarmEmails)",
"const... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_153 | {
"fields": [],
"file": "mq-client/mq-client-springboot/src/test/java/com/ppdai/infrastructure/mq/client/stat/MqHandlerTest.java",
"identifier": "MqHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void handleTest() throws IOException, ServletException {\n\t\tMqClientStatController mqClientStatController=new MqClientStatController();\n\t\tMqHandler mqHandler=new MqHandler();\n\t\tReflectionTestUtils.setField(mqHandler, \"mqClientStatController\", mqClientStatController);\n\t\t\n\t\tRe... | {
"fields": [
{
"declarator": "mqClientStatController",
"modifier": "private",
"original_string": "private MqClientStatController mqClientStatController;",
"type": "MqClientStatController",
"var_name": "mqClientStatController"
},
{
"declarator": "maps = new HashMap<>()"... | {
"body": "@Override\n\tpublic void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tif (maps.size() == 0) {\n\t\t\tsynchronized (this) {\n\t\t\t\tif (maps.size() == 0) {\n\t\t\t\t\tmqClientStatController=MqSpringUt... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_26 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void getCacheJsonTest() {\n\t\tassertEquals(\"{}\", consumerGroupServiceImpl.getCacheJson());\n\t}",
"class_method_signature": "ConsumerGroupServiceImplTest.getCacheJsonTest()",
"constructor": false,
"full_signature": "@Test public void getCacheJsonTest()",
"identifier": "getCacheJs... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic String getCacheJson() {\n\t\t// TODO Auto-generated method stub\n\t\treturn JsonUtil.toJsonNull(getCache());\n\t}",
"class_method_signature": "ConsumerGroupServiceImpl.getCacheJson()",
"constructor": false,
"full_signature": "@Override public String getCacheJson()",
"identifier"... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_152 | {
"fields": [],
"file": "mq-client/mq-client-springboot/src/test/java/com/ppdai/infrastructure/mq/client/MqBootstrapScanConfigTest.java",
"identifier": "MqBootstrapScanConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test() {\n\t\tMqBootstrapScanConfig mqBootstrapScanConfig=new MqBootstrapScanConfig();\n\t\tFilterRegistrationBean filterRegistrationBean=mqBootstrapScanConfig.clientMqFilter(new MqFilter());\n\t\tassertEquals(1, filterRegistrationBean.getUrlPatterns().size());\n\t}",
"class_method_s... | {
"fields": [],
"file": "mq-client/mq-client-springboot/src/main/java/com/ppdai/infrastructure/mq/client/MqBootstrapScanConfig.java",
"identifier": "MqBootstrapScanConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "MqBootstrapScanConfig.clientMqFilter(MqFilter mqFilter)",
"co... | {
"body": "@Bean(\"clientMqFilter\")\n\tpublic FilterRegistrationBean clientMqFilter(MqFilter mqFilter) {\n\t\tFilterRegistrationBean openApiFilter = new FilterRegistrationBean();\n\t\topenApiFilter.setFilter(mqFilter);\n\t\topenApiFilter.addUrlPatterns(\"/mq/client/*\");\n\t\treturn openApiFilter;\n\t}",
"class_me... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_27 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void deleteConsumerGroupImageTest() {\n\t\tConsumerGroupEntity consumerGroupEntity=buildConsumerGroupEntity();\n\t\tconsumerGroupEntity.setMode(2);\n\t\tconsumerGroupEntity.setOriginName(consumerGroupEntity.getName());\t\t\n\t\twhen(consumerGroupRepository.getById(anyLong())).thenReturn(con... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic ConsumerGroupDeleteResponse deleteConsumerGroup(long consumerGroupId, boolean checkOnline) {\n\t\tCacheUpdateHelper.updateCache();\n\t\t// 缓存数据\n\t\tMap<String, ConsumerGroupEntity> consumerGroupMap = getCache();\n\t\tConsumerGroupEntity consumerGroupEntity = get(consumerGroupId);\n\n\t... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_70 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void publishTest() {\n\t\tPublishMessageRequest request = new PublishMessageRequest();\n\t\trequest.setTopicName(\"test\");\n\t\trequest.setMsgs(Arrays.asList(new ProducerDataDto()));\n\t\tMap<String, TopicEntity> cacheData = new HashMap<String, TopicEntity>();\n\t\tcacheData.put(request.ge... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public PublishMessageResponse publish(PublishMessageRequest request) {\n PublishMessageResponse response = new PublishMessageResponse();\n checkVaild(request, response);\n if (!response.isSuc()) {\n return response;\n }\n try {\n if (!... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_105 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void stopTest() {\n\t\tconsumerGroupTopicServiceImpl.stop();\n\t\tassertEquals(false, consumerGroupTopicServiceImpl.isRunning);\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImplTest.stopTest()",
"constructor": false,
"full_signature": "@Test public void stopTest()",
"i... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@PreDestroy\n\t@Override\n\tpublic void stop() {\n\t\tisRunning = false;\n\t}",
"class_method_signature": "ConsumerGroupTopicServiceImpl.stop()",
"constructor": false,
"full_signature": "@PreDestroy @Override public void stop()",
"identifier": "stop",
"invocations": [],
"modifiers": "@PreDestro... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_113 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void deleteConsumerGroupTopicTest() {\n\t\tconsumerGroupTopicServiceImpl.deleteConsumerGroupTopic(1L);\n\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity = new ConsumerGroupTopicEntity();\n\t\tconsumerGroupTopicEntity.setId(1L);\n\t\tconsumerGroupTopicEntity.setConsumerGroupName(\"tes... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Transactional(rollbackFor = Exception.class)\n\t@Override\n\tpublic ConsumerGroupTopicDeleteResponse deleteConsumerGroupTopic(long consumerGroupTopicId) {\n\t\tCacheUpdateHelper.updateCache();\n\t\tTransaction catTransactionAll = Tracer.newTransaction(\"ConsumerGroupTopic\", \"deleteConsumerGroupTopic\");... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_66 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void getConsumerGroupByConsumerIdsTest() {\n\t\tassertEquals(0, consumerServiceImpl.getConsumerGroupByConsumerIds(null).size());\n\n\t\tconsumerServiceImpl.getConsumerGroupByConsumerIds(Arrays.asList(1L));\n\n\t\tverify(consumerGroupConsumerService).getByConsumerIds(anyListOf(Long.class));\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public List<ConsumerGroupConsumerEntity> getConsumerGroupByConsumerIds(List<Long> consumerIds) {\n if (CollectionUtils.isEmpty(consumerIds)) {\n return new ArrayList<>();\n }\n return consumerGroupConsumerService.getByConsumerIds(consumerIds);\n }",
"clas... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_89 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void registConsumerGroupConsumerTest() {\n\t\tdoThrow(new RuntimeException()).when(consumerGroupConsumerService)\n\t\t\t\t.insertBatch(anyListOf(ConsumerGroupConsumerEntity.class));\n\t\tList<ConsumerGroupConsumerEntity> consumerGroupConsumerEntities = new ArrayList<ConsumerGroupConsumerEnt... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void registConsumerGroupConsumer(List<ConsumerGroupConsumerEntity> consumerGroupConsumerEntities) {\n try {\n if (CollectionUtils.isEmpty(consumerGroupConsumerEntities)) {\n return;\n }\n consumerGroupConsumerService.insertBatch(consumerGroup... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_31 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void getIdCacheTest() {\n\t\tassertEquals(0, consumerGroupServiceImpl.getIdCache().size());\n\t}",
"class_method_signature": "ConsumerGroupServiceImplTest.getIdCacheTest()",
"constructor": false,
"full_signature": "@Test public void getIdCacheTest()",
"identifier": "getIdCacheTest",... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic Map<Long, ConsumerGroupEntity> getIdCache() {\n\t\t// TODO Auto-generated method stub\n\t\tMap<Long, ConsumerGroupEntity> rs = consumerGroupByIdRefMap.get();\n\t\tif (rs.size() == 0) {\n\t\t\tcacheLock.lock();\n\t\t\ttry {\n\t\t\t\trs = consumerGroupByIdRefMap.get();\n\t\t\t\tif (rs.siz... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_144 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java",
"identifier": "HttpClientTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void post1Test() throws IOException, BrokerException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"POST\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(200).withBody(\"{\\\"t\\\":1}\"));\n\t... | {
"fields": [
{
"declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")",
"modifier": "private static final",
"original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");",
"type": "MediaType",
"var_name": ... | {
"body": "public String post(String url, Object reqObj) throws IOException,BrokerException {\n\t\tString json = \"\";\n\t\tif (reqObj != null) { \n\t\t\tjson = JsonUtil.toJsonNull(reqObj);\n\t\t}\n\t\tResponse response = null;\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http\", url);\n\t\ttry {\n\t\t\t... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_168 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void registerConsumerGroupNullTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tassertEquals(\"registerConsumerGroupNullTest error\", null, mqResource.registerConsumerGroup(null));\n\t}",
"cl... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public ConsumerGroupRegisterResponse registerConsumerGroup(ConsumerGroupRegisterRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/registerConsumerGroup\";\n\t\ttry {\n\t\t\tConsumerGroupRegisterResponse response = post(request, url, 2, ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_7 | {
"fields": [
{
"declarator": "consumerGroupConsumerRepository",
"modifier": "private",
"original_string": "private ConsumerGroupConsumerRepository consumerGroupConsumerRepository;",
"type": "ConsumerGroupConsumerRepository",
"var_name": "consumerGroupConsumerRepository"
},
{... | {
"body": "@Test\n\tpublic void deleteByConsumerIdsTest() {\n\t\t//consumerGroupConsumerRepository.deleteByConsumerIds(consumerIds);\n\t\tdoNothing().when(consumerGroupConsumerRepository).deleteByConsumerIds(anyList());\n\t\tconsumerGroupConsumerServiceImpl.deleteByConsumerIds(Arrays.asList(1L));\n\t\tverify(consumer... | {
"fields": [
{
"declarator": "consumerGroupConsumerRepository",
"modifier": "@Autowired\n\tprivate",
"original_string": "@Autowired\n\tprivate ConsumerGroupConsumerRepository consumerGroupConsumerRepository;",
"type": "ConsumerGroupConsumerRepository",
"var_name": "consumerGroupCons... | {
"body": "@Override\n\tpublic void deleteByConsumerIds(List<Long> consumerIds) {\n\t\tconsumerGroupConsumerRepository.deleteByConsumerIds(consumerIds);\n\t}",
"class_method_signature": "ConsumerGroupConsumerServiceImpl.deleteByConsumerIds(List<Long> consumerIds)",
"constructor": false,
"full_signature": "@Over... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_129 | {
"fields": [
{
"declarator": "consumerGroupTopicCheckServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicCheckServiceImpl consumerGroupTopicCheckServiceImpl;",
"type": "ConsumerGroupTopicCheckServiceImpl",
"var_name": "consumerGroupTopicCheckServiceImp... | {
"body": "@Test\n\tpublic void checkResult2Test() {\n\t\tMap<String, ConsumerGroupTopicEntity> consumerGroupTopicMap = new HashMap<String, ConsumerGroupTopicEntity>();\t\t\n\t\t//t1.getConsumerGroupName() + \"_\" + t1.getTopicName()\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity=new ConsumerGroupTopicEntity(... | {
"fields": [
{
"declarator": "consumerGroupTopicService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private ConsumerGroupTopicService consumerGroupTopicService;",
"type": "ConsumerGroupTopicService",
"var_name": "consumerGroupTopicService"
},
... | {
"body": "@Override\n public String checkResult() {\n String result = null;\n Map<String,ConsumerGroupTopicEntity> consumerGroupTopicMap = consumerGroupTopicService.getGroupTopic();\n Map<String,ConsumerGroupEntity> consumerGroupMap=consumerGroupService.getCache();\n Map<String, TopicE... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_109 | {
"fields": [
{
"declarator": "consumerGroupTopicServiceImpl",
"modifier": "private",
"original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;",
"type": "ConsumerGroupTopicServiceImpl",
"var_name": "consumerGroupTopicServiceImpl"
},
{
"de... | {
"body": "@Test\n\tpublic void subscribeTest() {\n\t\tConsumerGroupEntity consumerGroupEntity = new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setMode(2);\n\t\tconsumerGroupEntity.setName(\"test\");\n\t\tconsumerGroupEntity.setOriginName(\"test\");\n\t\tconsumerGroupEntity.setId(1L);\n\t\tMap<String, ConsumerGr... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "@Transactional(rollbackFor = Exception.class)\n\t @Override\n\t public ConsumerGroupTopicCreateResponse subscribe(ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest) {\n\t return subscribe(consumerGroupTopicCreateRequest, consumerGroupService.getCache());\n\n }",
"class_method_signat... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_93 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void saveAsynMsg_Partition_Test() {\n\t\tPublishMessageRequest request=new PublishMessageRequest();\n\t\tPublishMessageResponse response=new PublishMessageResponse();\n\t\tList<QueueEntity> queueEntities=new ArrayList<QueueEntity>(3);\t\t\n\t\tinitQueueEntity(queueEntities);\t\t\t\t\n\t\tre... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void saveSynMsg1(PublishMessageRequest request, PublishMessageResponse response,\n List<QueueEntity> queueEntities) {\n Map<Long, QueueEntity> queueMap = new HashMap<>();\n queueEntities.forEach(t1 -> {\n queueMap.put(t1.getId(), t1);\n ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_85 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void getListByTest() {\n\t\tconsumerServiceImpl.getListBy(new HashMap<String, Object>());\n\t\tverify(consumerRepository).getListBy(anyMapOf(String.class, Object.class));\n\t}",
"class_method_signature": "ConsumerServiceImplTest.getListByTest()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public List<ConsumerEntity> getListBy(Map<String, Object> conditionMap) {\n return consumerRepository.getListBy(conditionMap);\n }",
"class_method_signature": "ConsumerServiceImpl.getListBy(Map<String, Object> conditionMap)",
"constructor": false,
"full_signature": "@Override... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_148 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/ConsumerGroupUtilTest.java",
"identifier": "ConsumerGroupUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void getOriginConsumerNameTest() {\n\t\tassertEquals(\"2_1\", ConsumerGroupUtil.getOriginConsumerName(\"2_1_2-3\"));\n\t\tassertEquals(\"2-3\", ConsumerGroupUtil.getOriginConsumerName(\"2-3\"));\n\t}",
"class_method_signature": "ConsumerGroupUtilTest.getOriginConsumerNameTest()",
"const... | {
"fields": [],
"file": "mq-client/mq-core/src/main/java/com/ppdai/infrastructure/mq/biz/common/util/ConsumerGroupUtil.java",
"identifier": "ConsumerGroupUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConsumerGroupUtil.getBroadcastConsumerName(String consumerGroupName, String ip,... | {
"body": "public static String getOriginConsumerName(String consumerGroupName) {\n\t\tif (consumerGroupName.indexOf(\"_\") == -1) {\n\t\t\treturn consumerGroupName;\n\t\t} else {\n\t\t\treturn consumerGroupName.substring(0, consumerGroupName.lastIndexOf(\"_\"));\n\t\t}\n\t}",
"class_method_signature": "ConsumerGro... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_133 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void splitTest() {\n\t\tList<Integer> data = Arrays.asList(1, 2, 3, 4, 5, 6);\n\t\tassertEquals(3, Util.split(data, 2).size());\n\t\tassertEquals(2, Util.split(data, 3).size());\n\t\tassertEquals(2, Util.split(data, 4).size());\n\t\tdata = new ArrayList<Integer>();\n\t\tassertEquals(0, Util... | {
"fields": [
{
"declarator": "DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\";",
"type": "String",
"var_name": "DEFAULT_FORMATE"
},
{
"declarator":... | {
"body": "public static <T> List<List<T>> split(List<T> lst, int count) {\n\t\tList<List<T>> lstRs = new ArrayList<>();\n\t\tList<T> countLst = new ArrayList<>(count);\n\t\tfor (T t : lst) {\n\t\t\tif (countLst.size() == count) {\n\t\t\t\tlstRs.add(countLst);\n\t\t\t\tcountLst = new ArrayList<>(count);\n\t\t\t}\n\t\... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_46 | {
"fields": [
{
"declarator": "dbNodeRepository",
"modifier": "private",
"original_string": "private DbNodeRepository dbNodeRepository;",
"type": "DbNodeRepository",
"var_name": "dbNodeRepository"
},
{
"declarator": "dbNodeServiceImpl",
"modifier": "private",
... | {
"body": "@Test\n\tpublic void forceUpdateCacheTest() {\n\t\tDruidDataSource dataSource = mock(DruidDataSource.class);\n\t\tDbNodeServiceImpl.DataSourceFactory dataSourceFactory = new DbNodeServiceImpl.DataSourceFactory() {\n\t\t\t@Override\n\t\t\tpublic DruidDataSource createDataSource() {\n\t\t\t\t// TODO Auto-gen... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "dbNodeRepo... | {
"body": "@Override\n\tpublic void forceUpdateCache() {\n\t\t// dbCreated.clear();\n\t\tdoForceUpdateCache();\n\t\tupdateQueueCache();\n\t}",
"class_method_signature": "DbNodeServiceImpl.forceUpdateCache()",
"constructor": false,
"full_signature": "@Override public void forceUpdateCache()",
"identifier": "fo... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_11 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void getLastMetaConsumerGroupTest() {\n\t\twhen(consumerGroupRepository.getLastConsumerGroup(anyLong(), anyLong(), anyInt()))\n\t\t\t\t.thenReturn(new ArrayList<ConsumerGroupEntity>());\n\t\tconsumerGroupServiceImpl.getLastMetaConsumerGroup(1L, 1L);\n\t\tverify(consumerGroupRepository).getL... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic List<ConsumerGroupEntity> getLastMetaConsumerGroup(long minMessageId, long maxMessageId) {\n\t\treturn consumerGroupRepository.getLastConsumerGroup(minMessageId, maxMessageId, MessageType.Meta);\n\t}",
"class_method_signature": "ConsumerGroupServiceImpl.getLastMetaConsumerGroup(long m... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_164 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void addCatNullTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tmqResource.addCat(null);\n\t}",
"class_method_signature": "MqResourceTest.addCatNullTest()... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public void addCat(CatRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\texecutor1.submit(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString url = MqConstanst.TOOLPRE + \"/addCat\";\n\t\t\t\ttry {\n\t\t\t\t\tpost(request, url, 1, CatResponse.class, false);\n... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_172 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void pullDataNullTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tassertEquals(\"pullDataNullTest error\", null, mqResource.pullData(null));\n\t}",
"class_method_signature": "MqResourceTest.... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public PullDataResponse pullData(PullDataRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/pullData\";\n\t\ttry {\n\t\t\treturn post(request, url, 2, PullDataResponse.class, true);\n\t\t} catch (Exception e) {\n\t\t\tCatRequest request2... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_50 | {
"fields": [
{
"declarator": "message01Repository",
"modifier": "private",
"original_string": "private Message01Repository message01Repository;",
"type": "Message01Repository",
"var_name": "message01Repository"
},
{
"declarator": "dbNodeService",
"modifier": "pri... | {
"body": "@Test\n\tpublic void getListByPageTest() {\n\t\tmessage01ServiceImpl.getListByPage(new HashMap<String, Object>());\n\t\tverify(message01Repository).getListByPageSize(anyMap());\n\t\tmessage01ServiceImpl.setDbId(1); \n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Reposit... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "publ... | {
"body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic List<Message01Entity> getListByPage(Map<String, Object> parameterMap) {\n\t\tList<Message01Entity> rs = new ArrayList<>();\n\t\tsetMaster(false);\n\t\tTimer.Conte... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_125 | {
"fields": [
{
"declarator": "consumerCommitServiceImpl = null",
"modifier": "",
"original_string": "ConsumerCommitServiceImpl consumerCommitServiceImpl = null;",
"type": "ConsumerCommitServiceImpl",
"var_name": "consumerCommitServiceImpl"
},
{
"declarator": "queueOffs... | {
"body": "@Test\n\tpublic void doCommitTest() {\t\t\n\t\t//init();\n\t\tMap<Long, OffsetVersionEntity> quMap=new HashMap<Long, OffsetVersionEntity>();\n\t\tOffsetVersionEntity offsetVersionEntity=buildOffsetVersionEntity();\n\t\tquMap.put(offsetVersionEntity.getId(), offsetVersionEntity);\t\t\n\t\twhen(queueOffsetSe... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerCommitService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ConsumerCommitService.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "protected void doCommit() {\n\t\tMap<Long, OffsetVersionEntity> offsetVersionMap = queueOffsetService.getOffsetVersion();\n\t\tMap<Long, ConsumerQueueVersionDto> map = new HashMap<>(mapAppPolling.get());\n\t\tif (map.size() > 0) {\n\t\t\tfinal int size = map.size();\n\t\t\tTransaction transaction = Tracer.... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_28 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void deleteConsumerGroupNoRightTest() {\n\t\tConsumerGroupEntity consumerGroupEntity=buildConsumerGroupEntity();\n\t\tconsumerGroupEntity.setMode(2);\n\t\tconsumerGroupEntity.setOriginName(consumerGroupEntity.getName());\t\t\n\t\twhen(consumerGroupRepository.getById(anyLong())).thenReturn(c... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic ConsumerGroupDeleteResponse deleteConsumerGroup(long consumerGroupId, boolean checkOnline) {\n\t\tCacheUpdateHelper.updateCache();\n\t\t// 缓存数据\n\t\tMap<String, ConsumerGroupEntity> consumerGroupMap = getCache();\n\t\tConsumerGroupEntity consumerGroupEntity = get(consumerGroupId);\n\n\t... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_90 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void registConsumer_checkVaild_Test() {\n\t\tConsumerRegisterResponse response = new ConsumerRegisterResponse();\n\t\tresponse.setSuc(true);\n\t\tconsumerServiceImpl.checkVaild(null, response);\n\t\tassertEquals(false, response.isSuc());\n\n\t\tresponse.setSuc(true);\n\t\tConsumerRegisterRe... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void checkVaild(ConsumerRegisterRequest request, ConsumerRegisterResponse response) {\n if (request == null) {\n response.setSuc(false);\n response.setMsg(\"ConsumerRegisterRequest不能为空!\");\n return;\n }\n if (StringUtils.isEmpty(request.getNa... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_86 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void publishAndUpdateResultFailMsgTest() {\n\t\tFailMsgPublishAndUpdateResultRequest request = new FailMsgPublishAndUpdateResultRequest();\n\t\trequest.setQueueId(1);\n\t\tList<Long> ids = Arrays.asList(1L, 2L);\n\t\trequest.setIds(ids);\n\t\tPublishMessageRequest failMsg = new PublishMessa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "@Override\n public FailMsgPublishAndUpdateResultResponse publishAndUpdateResultFailMsg(\n FailMsgPublishAndUpdateResultRequest request) {\n FailMsgPublishAndUpdateResultResponse response = new FailMsgPublishAndUpdateResultResponse();\n response.setSuc(true);\n QueueEntity... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_69 | {
"fields": [
{
"declarator": "consumerRepository",
"modifier": "private",
"original_string": "private ConsumerRepository consumerRepository;",
"type": "ConsumerRepository",
"var_name": "consumerRepository"
},
{
"declarator": "consumerGroupConsumerService",
"modif... | {
"body": "@Test\n\tpublic void checkBroadcastTest() {\n\t\tConsumerGroupRegisterRequest request = null;\n\t\tConsumerGroupRegisterResponse response = new ConsumerGroupRegisterResponse();\n\t\tconsumerServiceImpl.checkBroadcastAndSubEnv(request, response);\n\t\tassertEquals(false, response.isSuc());\n\t\trequest = ne... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "consum... | {
"body": "protected void checkBroadcastAndSubEnv(ConsumerGroupRegisterRequest request,\n ConsumerGroupRegisterResponse response) {\n Map<String, ConsumerGroupEntity> map = consumerGroupService.getCache();\n if (request == null) {\n response.setSuc(fa... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_130 | {
"fields": [],
"file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void getProcessIdTest() {\n\t\tassertEquals(true, Util.getProcessId() > 0);\n\t}",
"class_method_signature": "UtilTest.getProcessIdTest()",
"constructor": false,
"full_signature": "@Test public void getProcessIdTest()",
"identifier": "getProcessIdTest",
"invocations": [
"asser... | {
"fields": [
{
"declarator": "DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\";",
"type": "String",
"var_name": "DEFAULT_FORMATE"
},
{
"declarator":... | {
"body": "public static Integer getProcessId() {\n\t\tRuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();\n\t\tString name = runtime.getName();\n\t\treturn Integer.parseInt(name.substring(0, name.indexOf(\"@\")));\n\t}",
"class_method_signature": "Util.getProcessId()",
"constructor": false,
"full_sig... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_45 | {
"fields": [
{
"declarator": "dbNodeRepository",
"modifier": "private",
"original_string": "private DbNodeRepository dbNodeRepository;",
"type": "DbNodeRepository",
"var_name": "dbNodeRepository"
},
{
"declarator": "dbNodeServiceImpl",
"modifier": "private",
... | {
"body": "@Test\n\tpublic void getDataSourceTest() {\n\t\t//dbNodeServiceImpl.isPortal = true;\n\t\tsetProperty(\"mq.db.ip.cat\", \"1\"); \n\n\t\tMap<Long, DbNodeEntity> data = new HashMap<Long, DbNodeEntity>(); // cacheNodeMap.get();\n\t\tDbNodeEntity dbNodeEntity = new DbNodeEntity();\n\t\tdbNodeEntity.setIp(\"fas... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "dbNodeRepo... | {
"body": "@Override\n\tpublic DataSource getDataSource(long id, boolean isMaster) {\n\t\tMap<String, DataSource> cache = cacheDataMap.get();\n\t\tMap<Long, DbNodeEntity> data = cacheNodeMap.get();\n\t\t// 如果是broker,默认是禁止读写分离\n\t\t// 注意不是所示的portal 操作都是读取从库\n\t\tif (!isPortal) {\n\t\t\tisMaster = true;\n\t\t}\n\t\t// ... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_12 | {
"fields": [
{
"declarator": "consumerGroupRepository",
"modifier": "private",
"original_string": "private ConsumerGroupRepository consumerGroupRepository;",
"type": "ConsumerGroupRepository",
"var_name": "consumerGroupRepository"
},
{
"declarator": "notifyMessageServi... | {
"body": "@Test\n\tpublic void getLastRbConsumerGroupTest() {\n\t\twhen(consumerGroupRepository.getLastConsumerGroup(anyLong(), anyLong(), anyInt()))\n\t\t\t\t.thenReturn(new ArrayList<ConsumerGroupEntity>());\n\t\tconsumerGroupServiceImpl.getLastRbConsumerGroup(1L, 1L);\n\t\tverify(consumerGroupRepository).getLastC... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@Override\n\tpublic List<ConsumerGroupEntity> getLastRbConsumerGroup(long minMessageId, long maxMessageId) {\n\t\treturn consumerGroupRepository.getLastConsumerGroup(minMessageId, maxMessageId, MessageType.Rb);\n\t}",
"class_method_signature": "ConsumerGroupServiceImpl.getLastRbConsumerGroup(long minMess... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_167 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void commitOffsetNullTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tmqResource.commitOffset(null);\n//\t\tPublishMessageResponse response=new PublishMessa... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public void commitOffset(CommitOffsetRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/commitOffset\";\n\t\ttry {\n\t\t\tpost(request, url, 10, CommitOffsetResponse.class, false);\n\t\t} catch (Exception e) {\n\t\t\tCatRequest request2 = new... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_8 | {
"fields": [
{
"declarator": "consumerGroupService",
"modifier": "private",
"original_string": "private ConsumerGroupService consumerGroupService;",
"type": "ConsumerGroupService",
"var_name": "consumerGroupService"
},
{
"declarator": "auditLogService",
"modifier... | {
"body": "@Test\n\tpublic void addConsumerLogTest() {\n\t\tLogRequest request=new LogRequest();\n\t\tlogServiceImpl.addConsumerLog(null);\n\t\trequest.setConsumerGroupName(\"test\");\n\t\trequest.setType(1);\n\t\tlogServiceImpl.addConsumerLog(request);\n\t\t\n\t\trequest.setType(3);\n\t\tMap<String, ConsumerGroupEnt... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(LogServiceImpl.class)",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(LogServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "logType = new Ha... | {
"body": "@Override\n\tpublic void addConsumerLog(LogRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\tString logContent = getLog(request);\n\t\tif (request.getType() >= 3) {\n\t\t\tMap<String, ConsumerGroupEntity> cache = consumerGroupService.getCache();\n\t\t\tif (!StringUtils.isEmpty(reque... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
215950115_171 | {
"fields": [],
"file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java",
"identifier": "MqResourceTest",
"interfaces": "",
"superclass": "extends AbstractTest"
} | {
"body": "@Test\n\tpublic void getMessageCountNullTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tassertEquals(\"getMessageCountNullTest error\", null, mqResource.getMessageCount(null));\n\t}",
"class_method_signatu... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MqResource.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "htt... | {
"body": "public GetMessageCountResponse getMessageCount(GetMessageCountRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/getMessageCount\";\n\t\treturn post(request, url, 2, GetMessageCountResponse.class, true);\n\t}",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 90,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 215950115,
"size": 3696,
"stargazer_count": 223,
"stars": null,
"updates": null,
"url": "https://github.com/ppdaicorp/pmq"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.