id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
44525387_1 | {
"fields": [],
"file": "commands/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingConversionsTest.java",
"identifier": "PatchingConversionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void flattenAndEscapeEmptyListTest() {\n assertEquals(\"Empty collection should produce empty String\", \"\",\n PatchingConversions.flattenAndEscape(Collections.<String>emptyList()));\n }",
"class_method_signature": "PatchingConversionsTest.flattenAndEscapeEmpty... | {
"fields": [],
"file": "commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingConversions.java",
"identifier": "PatchingConversions",
"interfaces": "",
"methods": [
{
"class_method_signature": "PatchingConversions.PatchingConversions()",
"constructor": true,
"full_... | {
"body": "public static String flattenAndEscape(List<String> paths) {\n if (paths == null) {\n throw new IllegalArgumentException(\"Argument paths must be provided\");\n }\n StringBuilder sb = new StringBuilder();\n for (String p : paths) {\n if (sb.length() > 0) {\n... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_31 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void isReloadRequired() {\n ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_BOOLEAN);\n assertFalse(result.isReloadRequired());\n\n result = new ModelNodeResult(RELOAD_REQUIRED);\n assertTrue(result.isReloadRequired());\n\n result = new Model... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final boolean isReloadRequired() {\n ModelNode state = headers().get(Constants.PROCESS_STATE);\n return state.isDefined() && Constants.CONTROLLER_PROCESS_STATE_RELOAD_REQUIRED.equals(state.asString());\n }",
"class_method_signature": "ModelNodeResult.isReloadRequired()",
"constr... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_30 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void headers() {\n ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_BOOLEAN);\n assertFalse(result.headers().isDefined());\n\n result = new ModelNodeResult(RELOAD_REQUIRED);\n assertTrue(result.headers().isDefined());\n\n result = new ModelNod... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final ModelNode headers() {\n return this.get(Constants.RESPONSE_HEADERS);\n }",
"class_method_signature": "ModelNodeResult.headers()",
"constructor": false,
"full_signature": "public final ModelNode headers()",
"identifier": "headers",
"invocations": [
"get"
],
"modifier... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_0 | {
"fields": [],
"file": "commands/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingConversionsTest.java",
"identifier": "PatchingConversionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void flattenEmptyListTest() {\n assertEquals(\"Empty collection should produce empty String\", \"\",\n PatchingConversions.flatten(Collections.<String>emptyList()));\n }",
"class_method_signature": "PatchingConversionsTest.flattenEmptyListTest()",
"constructor... | {
"fields": [],
"file": "commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingConversions.java",
"identifier": "PatchingConversions",
"interfaces": "",
"methods": [
{
"class_method_signature": "PatchingConversions.PatchingConversions()",
"constructor": true,
"full_... | {
"body": "public static String flatten(List<String> list) {\n if (list == null) {\n throw new IllegalArgumentException(\"Argument list must be provided\");\n }\n StringBuilder sb = new StringBuilder();\n for (String p : list) {\n if (sb.length() > 0) {\n ... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_26 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void hasDefinedValue() {\n ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_BOOLEAN);\n result.assertSuccess();\n assertTrue(result.hasDefinedValue());\n\n result = new ModelNodeResult(NOT_DEFINED_RESULT);\n result.assertSuccess();\n as... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final boolean hasDefinedValue() {\n return this.hasDefined(Constants.RESULT);\n }",
"class_method_signature": "ModelNodeResult.hasDefinedValue()",
"constructor": false,
"full_signature": "public final boolean hasDefinedValue()",
"identifier": "hasDefinedValue",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_10 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/ModelNodeOperationToCliStringTest.java",
"identifier": "ModelNodeOperationToCliStringTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void whoami() {\n ModelNode op = new ModelNode();\n op.get(Constants.OP).set(Constants.WHOAMI);\n op.get(Constants.OP_ADDR).setEmptyList();\n assertEquals(\"/:whoami\", ModelNodeOperationToCliString.convert(op));\n }",
"class_method_signature": "ModelNodeO... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeOperationToCliString.java",
"identifier": "ModelNodeOperationToCliString",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeOperationToCliString.ModelNodeOperationToCliString()",
"co... | {
"body": "static String convert(ModelNode op) {\n try {\n String operation = op.get(Constants.OP).asString();\n\n if (!Constants.COMPOSITE.equals(operation)) {\n return convertSingleOperation(op);\n } else {\n StringBuilder result = new StringBuil... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_47 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java",
"identifier": "ServerVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void assertAtLeast() {\n ServerVersion.from(0, 0, 0).assertAtLeast(ServerVersion.from(0, 0, 0));\n ServerVersion.from(1, 0, 0).assertAtLeast(ServerVersion.from(1, 0, 0));\n ServerVersion.from(1, 1, 0).assertAtLeast(ServerVersion.from(1, 0, 0));\n ServerVersion.... | {
"fields": [
{
"declarator": "VERSION_0_0_0 = new ServerVersion(0, 0, 0)",
"modifier": "public static final",
"original_string": "public static final ServerVersion VERSION_0_0_0 = new ServerVersion(0, 0, 0);",
"type": "ServerVersion",
"var_name": "VERSION_0_0_0"
},
{
"... | {
"body": "public void assertAtLeast(ServerVersion minimum) {\n assertAtLeast(minimum, null);\n }",
"class_method_signature": "ServerVersion.assertAtLeast(ServerVersion minimum)",
"constructor": false,
"full_signature": "public void assertAtLeast(ServerVersion minimum)",
"identifier": "assertAtLeast... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_13 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/ModelNodeOperationToCliStringTest.java",
"identifier": "ModelNodeOperationToCliStringTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void deploy() {\n ModelNode op = ModelNode.fromString(\"{\\\"operation\\\" => \\\"composite\\\",\\\"address\\\" => [],\\\"steps\\\" => [{\\\"operation\\\" => \\\"add\\\",\\\"address\\\" => {\\\"deployment\\\" => \\\"CLIWebservicesWsdlIT.war\\\"},\\\"content\\\" => [{\\\"bytes\\\" =... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeOperationToCliString.java",
"identifier": "ModelNodeOperationToCliString",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeOperationToCliString.ModelNodeOperationToCliString()",
"co... | {
"body": "static String convert(ModelNode op) {\n try {\n String operation = op.get(Constants.OP).asString();\n\n if (!Constants.COMPOSITE.equals(operation)) {\n return convertSingleOperation(op);\n } else {\n StringBuilder result = new StringBuil... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_44 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java",
"identifier": "ServerVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void greaterThan() {\n assertTrue(ServerVersion.from(1, 0, 0).greaterThan(ServerVersion.from(0, 0, 0)));\n assertTrue(ServerVersion.from(2, 0, 0).greaterThan(ServerVersion.from(1, 0, 0)));\n assertTrue(ServerVersion.from(2, 1, 0).greaterThan(ServerVersion.from(2, 0, 0... | {
"fields": [
{
"declarator": "VERSION_0_0_0 = new ServerVersion(0, 0, 0)",
"modifier": "public static final",
"original_string": "public static final ServerVersion VERSION_0_0_0 = new ServerVersion(0, 0, 0);",
"type": "ServerVersion",
"var_name": "VERSION_0_0_0"
},
{
"... | {
"body": "public boolean greaterThan(ServerVersion that) {\n return !lessThanOrEqualTo(that);\n }",
"class_method_signature": "ServerVersion.greaterThan(ServerVersion that)",
"constructor": false,
"full_signature": "public boolean greaterThan(ServerVersion that)",
"identifier": "greaterThan",
"in... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_29 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void listValue() {\n ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_LIST_BOOLEAN);\n assertEquals(Collections.singletonList(true), result.booleanListValue());\n assertEquals(Collections.singletonList(true), result.booleanListValue(Collections.singletonLis... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final List<ModelNode> listValue() {\n return value().asList();\n }",
"class_method_signature": "ModelNodeResult.listValue()",
"constructor": false,
"full_signature": "public final List<ModelNode> listValue()",
"identifier": "listValue",
"invocations": [
"asList",
"value"
... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_33 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void isDomain() {\n ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_BOOLEAN);\n assertFalse(result.isFromDomain());\n\n result = new ModelNodeResult(RELOAD_REQUIRED);\n assertFalse(result.isFromDomain());\n\n result = new ModelNodeResult(REST... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final boolean isFromDomain() {\n return this.hasDefined(Constants.SERVER_GROUPS);\n }",
"class_method_signature": "ModelNodeResult.isFromDomain()",
"constructor": false,
"full_signature": "public final boolean isFromDomain()",
"identifier": "isFromDomain",
"invocations": [
"h... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_3 | {
"fields": [],
"file": "commands/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingConversionsTest.java",
"identifier": "PatchingConversionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void flattenSingleElementListWithBackslashesTest() {\n String[] singleElementList = new String[]{\"some\\\\text\"};\n assertEquals(\"Empty collection should produce empty String\", \"some\\\\text\",\n PatchingConversions.flatten(Arrays.asList(singleElementList... | {
"fields": [],
"file": "commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingConversions.java",
"identifier": "PatchingConversions",
"interfaces": "",
"methods": [
{
"class_method_signature": "PatchingConversions.PatchingConversions()",
"constructor": true,
"full_... | {
"body": "public static String flatten(List<String> list) {\n if (list == null) {\n throw new IllegalArgumentException(\"Argument list must be provided\");\n }\n StringBuilder sb = new StringBuilder();\n for (String p : list) {\n if (sb.length() > 0) {\n ... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_25 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void assertFailed() {\n ModelNodeResult result = new ModelNodeResult(FAILED);\n\n result.assertFailed();\n\n try {\n result.assertSuccess();\n } catch (AssertionError ignore) {\n }\n }",
"class_method_signature": "ModelNodeResultTest.asse... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final void assertFailed() {\n assertFailed(null);\n }",
"class_method_signature": "ModelNodeResult.assertFailed()",
"constructor": false,
"full_signature": "public final void assertFailed()",
"identifier": "assertFailed",
"invocations": [
"assertFailed"
],
"modifiers": "p... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_24 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void assertSuccess() {\n ModelNodeResult result = new ModelNodeResult(SUCCESS);\n\n result.assertSuccess();\n\n try {\n result.assertFailed();\n } catch (AssertionError ignored) {\n }\n }",
"class_method_signature": "ModelNodeResultTest.a... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final void assertSuccess() {\n assertSuccess(null);\n }",
"class_method_signature": "ModelNodeResult.assertSuccess()",
"constructor": false,
"full_signature": "public final void assertSuccess()",
"identifier": "assertSuccess",
"invocations": [
"assertSuccess"
],
"modifier... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_2 | {
"fields": [],
"file": "commands/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingConversionsTest.java",
"identifier": "PatchingConversionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void flattenSingleElementListTest() {\n String[] singleElementList = new String[]{\"sometext\"};\n assertEquals(\"Empty collection should produce empty String\", \"sometext\",\n PatchingConversions.flatten(Arrays.asList(singleElementList)));\n }",
"class_... | {
"fields": [],
"file": "commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingConversions.java",
"identifier": "PatchingConversions",
"interfaces": "",
"methods": [
{
"class_method_signature": "PatchingConversions.PatchingConversions()",
"constructor": true,
"full_... | {
"body": "public static String flatten(List<String> list) {\n if (list == null) {\n throw new IllegalArgumentException(\"Argument list must be provided\");\n }\n StringBuilder sb = new StringBuilder();\n for (String p : list) {\n if (sb.length() > 0) {\n ... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_32 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void isRestartRequired() {\n ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_BOOLEAN);\n assertFalse(result.isRestartRequired());\n\n result = new ModelNodeResult(RELOAD_REQUIRED);\n assertFalse(result.isRestartRequired());\n\n result = new M... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final boolean isRestartRequired() {\n ModelNode state = headers().get(Constants.PROCESS_STATE);\n return state.isDefined() && Constants.CONTROLLER_PROCESS_STATE_RESTART_REQUIRED.equals(state.asString());\n }",
"class_method_signature": "ModelNodeResult.isRestartRequired()",
"con... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_28 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void value() {\n ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_BOOLEAN);\n assertTrue(result.booleanValue());\n assertTrue(result.booleanValue(false));\n\n result = new ModelNodeResult(DEFINED_RESULT_NUMBER);\n assertEquals(13, result.intVa... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final ModelNode value() {\n return get(Constants.RESULT);\n }",
"class_method_signature": "ModelNodeResult.value()",
"constructor": false,
"full_signature": "public final ModelNode value()",
"identifier": "value",
"invocations": [
"get"
],
"modifiers": "public final",
"... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_45 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java",
"identifier": "ServerVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void greaterThanOrEqualTo() {\n assertTrue(ServerVersion.from(0, 0, 0).greaterThanOrEqualTo(ServerVersion.from(0, 0, 0)));\n assertTrue(ServerVersion.from(1, 0, 0).greaterThanOrEqualTo(ServerVersion.from(0, 0, 0)));\n assertTrue(ServerVersion.from(1, 0, 0).greaterThan... | {
"fields": [
{
"declarator": "VERSION_0_0_0 = new ServerVersion(0, 0, 0)",
"modifier": "public static final",
"original_string": "public static final ServerVersion VERSION_0_0_0 = new ServerVersion(0, 0, 0);",
"type": "ServerVersion",
"var_name": "VERSION_0_0_0"
},
{
"... | {
"body": "public boolean greaterThanOrEqualTo(ServerVersion that) {\n return !lessThan(that);\n }",
"class_method_signature": "ServerVersion.greaterThanOrEqualTo(ServerVersion that)",
"constructor": false,
"full_signature": "public boolean greaterThanOrEqualTo(ServerVersion that)",
"identifier": "g... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_12 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/ModelNodeOperationToCliStringTest.java",
"identifier": "ModelNodeOperationToCliStringTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void add() {\n ModelNode op = new ModelNode();\n op.get(Constants.OP).set(Constants.ADD);\n op.get(Constants.OP_ADDR).setEmptyList().add(\"foo\", \"bar\").add(\"baz\", \"quux\");\n op.get(Constants.NAME).set(\"abc\");\n op.get(Constants.OPERATION_HEADERS... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeOperationToCliString.java",
"identifier": "ModelNodeOperationToCliString",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeOperationToCliString.ModelNodeOperationToCliString()",
"co... | {
"body": "static String convert(ModelNode op) {\n try {\n String operation = op.get(Constants.OP).asString();\n\n if (!Constants.COMPOSITE.equals(operation)) {\n return convertSingleOperation(op);\n } else {\n StringBuilder result = new StringBuil... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_19 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/AdjustOperationForDomainTest.java",
"identifier": "AdjustOperationForDomainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void stringOperation_domain() {\n OnlineOptions options = OnlineOptions.domain().forHost(\"master\").forProfile(\"default\").build()\n .localDefault().build();\n AdjustOperationForDomain adjust = new AdjustOperationForDomain(options);\n\n assertEquals(\... | {
"fields": [
{
"declarator": "options",
"modifier": "private final",
"original_string": "private final OnlineOptions options;",
"type": "OnlineOptions",
"var_name": "options"
}
],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/AdjustOperationForDomain.jav... | {
"body": "ModelNode adjust(ModelNode operation) {\n if (!options.isDomain) {\n return operation;\n }\n\n if (Constants.COMPOSITE.equals(operation.get(Constants.OP).asString())) {\n ModelNode steps = operation.get(Constants.STEPS);\n if (steps.getType() != ModelTy... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_35 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionRangeTest.java",
"identifier": "ServerVersionRangeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void lowIncludedHighIncluded() {\n ServerVersionRange range = range(true, true);\n assertFalse(range.contains(ServerVersion.VERSION_0_0_0));\n assertTrue(range.contains(ServerVersion.VERSION_1_0_0));\n assertTrue(range.contains(ServerVersion.VERSION_1_5_0));\n ... | {
"fields": [
{
"declarator": "low",
"modifier": "private final",
"original_string": "private final ServerVersion low;",
"type": "ServerVersion",
"var_name": "low"
},
{
"declarator": "lowIncluded",
"modifier": "private final",
"original_string": "private fin... | {
"body": "boolean contains(ServerVersion version) {\n if (version.equals(low)) {\n return lowIncluded;\n } else if (version.equals(high)) {\n return highIncluded;\n } else {\n return low.lessThan(version) && high.greaterThan(version);\n }\n }",
"class... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_5 | {
"fields": [],
"file": "commands/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingConversionsTest.java",
"identifier": "PatchingConversionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void flattenMultipleElementListWithBackslashesTest() {\n String[] singleElementList = new String[]{\"some\\\\text\", \"another text\"};\n assertEquals(\"Empty collection should produce empty String\", \"some\\\\text,another text\",\n PatchingConversions.flatte... | {
"fields": [],
"file": "commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingConversions.java",
"identifier": "PatchingConversions",
"interfaces": "",
"methods": [
{
"class_method_signature": "PatchingConversions.PatchingConversions()",
"constructor": true,
"full_... | {
"body": "public static String flatten(List<String> list) {\n if (list == null) {\n throw new IllegalArgumentException(\"Argument list must be provided\");\n }\n StringBuilder sb = new StringBuilder();\n for (String p : list) {\n if (sb.length() > 0) {\n ... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_23 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void isFailed() {\n ModelNodeResult result = new ModelNodeResult(FAILED);\n\n assertFalse(result.isSuccess());\n assertTrue(result.isFailed());\n }",
"class_method_signature": "ModelNodeResultTest.isFailed()",
"constructor": false,
"full_signature": "@Test pu... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final boolean isFailed() {\n if (!this.hasDefined(Constants.OUTCOME)) {\n return false;\n }\n\n String outcome = this.get(Constants.OUTCOME).asString();\n return Constants.FAILED.equals(outcome);\n }",
"class_method_signature": "ModelNodeResult.isFailed()"... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_15 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/AdjustOperationForDomainTest.java",
"identifier": "AdjustOperationForDomainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void modelNodeOperation_standalone() {\n OnlineOptions options = OnlineOptions.standalone().localDefault().build();\n AdjustOperationForDomain adjust = new AdjustOperationForDomain(options);\n\n ModelNode op = new ModelNode();\n op.get(Constants.OP).set(Constan... | {
"fields": [
{
"declarator": "options",
"modifier": "private final",
"original_string": "private final OnlineOptions options;",
"type": "OnlineOptions",
"var_name": "options"
}
],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/AdjustOperationForDomain.jav... | {
"body": "ModelNode adjust(ModelNode operation) {\n if (!options.isDomain) {\n return operation;\n }\n\n if (Constants.COMPOSITE.equals(operation.get(Constants.OP).asString())) {\n ModelNode steps = operation.get(Constants.STEPS);\n if (steps.getType() != ModelTy... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_42 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java",
"identifier": "ServerVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void lessThan() {\n assertTrue(ServerVersion.from(0, 0, 0).lessThan(ServerVersion.from(1, 0, 0)));\n assertTrue(ServerVersion.from(1, 0, 0).lessThan(ServerVersion.from(2, 0, 0)));\n assertTrue(ServerVersion.from(2, 0, 0).lessThan(ServerVersion.from(2, 1, 0)));\n\n ... | {
"fields": [
{
"declarator": "VERSION_0_0_0 = new ServerVersion(0, 0, 0)",
"modifier": "public static final",
"original_string": "public static final ServerVersion VERSION_0_0_0 = new ServerVersion(0, 0, 0);",
"type": "ServerVersion",
"var_name": "VERSION_0_0_0"
},
{
"... | {
"body": "public boolean lessThan(ServerVersion that) {\n return (this.major < that.major)\n || (this.major == that.major && this.minor < that.minor)\n || (this.major == that.major && this.minor == that.minor && this.micro < that.micro);\n }",
"class_method_signature": "Serv... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_39 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java",
"identifier": "ServerVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void referenceEquality() {\n assertSame(ServerVersion.VERSION_0_0_0, ServerVersion.from(0, 0, 0));\n assertSame(ServerVersion.VERSION_1_0_0, ServerVersion.from(1, 0, 0));\n assertSame(ServerVersion.VERSION_1_1_0, ServerVersion.from(1, 1, 0));\n assertSame(Serve... | {
"fields": [
{
"declarator": "VERSION_0_0_0 = new ServerVersion(0, 0, 0)",
"modifier": "public static final",
"original_string": "public static final ServerVersion VERSION_0_0_0 = new ServerVersion(0, 0, 0);",
"type": "ServerVersion",
"var_name": "VERSION_0_0_0"
},
{
"... | {
"body": "public static ServerVersion from(int major, int minor, int micro) {\n for (ServerVersion knownVersion : KNOWN_VERSIONS) {\n if (knownVersion.major == major && knownVersion.minor == minor && knownVersion.micro == micro) {\n return knownVersion;\n }\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_9 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/OnlineServerVersionTest.java",
"identifier": "OnlineServerVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IOException.class)\n @SuppressWarnings(\"unchecked\")\n public void error() throws IOException {\n ModelControllerClient mock = mock(ModelControllerClient.class);\n when(mock.execute(any(ModelNode.class))).thenThrow(IOException.class);\n\n OnlineServerVersion.dis... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineServerVersion.java",
"identifier": "OnlineServerVersion",
"interfaces": "",
"methods": [
{
"class_method_signature": "OnlineServerVersion.OnlineServerVersion()",
"constructor": true,
"full_signature"... | {
"body": "static ServerVersion discover(ModelControllerClient client) throws IOException {\n ModelNode op = new ModelNode();\n op.get(Constants.OP).set(Constants.READ_RESOURCE_OPERATION);\n op.get(Constants.OP_ADDR).setEmptyList();\n // this would be preferrable, as it means transferring ... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_8 | {
"fields": [],
"file": "commands/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingConversionsTest.java",
"identifier": "PatchingConversionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void flattenAndEscapeListAsNull() {\n PatchingConversions.flatten(null);\n }",
"class_method_signature": "PatchingConversionsTest.flattenAndEscapeListAsNull()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgu... | {
"fields": [],
"file": "commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingConversions.java",
"identifier": "PatchingConversions",
"interfaces": "",
"methods": [
{
"class_method_signature": "PatchingConversions.PatchingConversions()",
"constructor": true,
"full_... | {
"body": "public static String flatten(List<String> list) {\n if (list == null) {\n throw new IllegalArgumentException(\"Argument list must be provided\");\n }\n StringBuilder sb = new StringBuilder();\n for (String p : list) {\n if (sb.length() > 0) {\n ... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_38 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionRangeTest.java",
"identifier": "ServerVersionRangeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void lowExcludedHighExcluded() {\n ServerVersionRange range = range(false, false);\n assertFalse(range.contains(ServerVersion.VERSION_0_0_0));\n assertFalse(range.contains(ServerVersion.VERSION_1_0_0));\n assertTrue(range.contains(ServerVersion.VERSION_1_5_0));... | {
"fields": [
{
"declarator": "low",
"modifier": "private final",
"original_string": "private final ServerVersion low;",
"type": "ServerVersion",
"var_name": "low"
},
{
"declarator": "lowIncluded",
"modifier": "private final",
"original_string": "private fin... | {
"body": "boolean contains(ServerVersion version) {\n if (version.equals(low)) {\n return lowIncluded;\n } else if (version.equals(high)) {\n return highIncluded;\n } else {\n return low.lessThan(version) && high.greaterThan(version);\n }\n }",
"class... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_43 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java",
"identifier": "ServerVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void lessThanOrEqualTo() {\n assertTrue(ServerVersion.from(0, 0, 0).lessThanOrEqualTo(ServerVersion.from(0, 0, 0)));\n assertTrue(ServerVersion.from(0, 0, 0).lessThanOrEqualTo(ServerVersion.from(1, 0, 0)));\n assertTrue(ServerVersion.from(1, 0, 0).lessThanOrEqualTo(Se... | {
"fields": [
{
"declarator": "VERSION_0_0_0 = new ServerVersion(0, 0, 0)",
"modifier": "public static final",
"original_string": "public static final ServerVersion VERSION_0_0_0 = new ServerVersion(0, 0, 0);",
"type": "ServerVersion",
"var_name": "VERSION_0_0_0"
},
{
"... | {
"body": "public boolean lessThanOrEqualTo(ServerVersion that) {\n return lessThan(that) || equalTo(that);\n }",
"class_method_signature": "ServerVersion.lessThanOrEqualTo(ServerVersion that)",
"constructor": false,
"full_signature": "public boolean lessThanOrEqualTo(ServerVersion that)",
"identifi... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_14 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/operations/ValuesTest.java",
"identifier": "ValuesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fromMap() {\n assertNull(Values.fromMap(null));\n assertNull(Values.fromMap(ImmutableMap.<String, String>of()));\n\n assertNotNull(Values.fromMap(ImmutableMap.of(\"foo\", \"bar\")));\n assertEquals(1, Values.fromMap(ImmutableMap.of(\"foo\", \"bar\")).size(... | {
"fields": [
{
"declarator": "EMPTY = new Values()",
"modifier": "private static final",
"original_string": "private static final Values EMPTY = new Values();",
"type": "Values",
"var_name": "EMPTY"
},
{
"declarator": "namedValues",
"modifier": "private final",
... | {
"body": "public static Values fromMap(Map<String, String> map) {\n if (map == null || map.isEmpty()) {\n return null;\n }\n\n List<Property> properties = new ArrayList<Property>(map.size());\n for (Map.Entry<String, String> entry : map.entrySet()) {\n properties.add... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_22 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void isSuccess() throws IOException {\n ModelNodeResult result = new ModelNodeResult(SUCCESS);\n\n assertTrue(result.isSuccess());\n assertFalse(result.isFailed());\n }",
"class_method_signature": "ModelNodeResultTest.isSuccess()",
"constructor": false,
"full... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final boolean isSuccess() {\n if (!this.hasDefined(Constants.OUTCOME)) {\n return false;\n }\n\n String outcome = this.get(Constants.OUTCOME).asString();\n return Constants.SUCCESS.equals(outcome);\n }",
"class_method_signature": "ModelNodeResult.isSuccess... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_4 | {
"fields": [],
"file": "commands/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingConversionsTest.java",
"identifier": "PatchingConversionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void flattenAndEscapeSingleElementListWithBackslashesTest() {\n String[] singleElementList = new String[]{\"some\\\\text\"};\n assertEquals(\"Empty collection should produce empty String\", \"some\\\\\\\\text\",\n PatchingConversions.flattenAndEscape(Arrays.as... | {
"fields": [],
"file": "commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingConversions.java",
"identifier": "PatchingConversions",
"interfaces": "",
"methods": [
{
"class_method_signature": "PatchingConversions.PatchingConversions()",
"constructor": true,
"full_... | {
"body": "public static String flattenAndEscape(List<String> paths) {\n if (paths == null) {\n throw new IllegalArgumentException(\"Argument paths must be provided\");\n }\n StringBuilder sb = new StringBuilder();\n for (String p : paths) {\n if (sb.length() > 0) {\n... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_34 | {
"fields": [
{
"declarator": "ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\"",
"modifier": "private static final",
"original_string": "private static final String ADDITIONAL_ASSERTION_MESSAGE = \"Additional assertion message\";",
"type": "String",
"var_name": "ADDIT... | {
"body": "@Test\n public void forServer() {\n ModelNodeResult result = new ModelNodeResult(RESTART_REQUIRED_IN_DOMAIN);\n ModelNodeResult server1 = result.forServer(\"master\", \"server-one\");\n ModelNodeResult server2 = result.forServer(\"master\", \"server-two\");\n\n assertTrue(ser... | {
"fields": [],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/ModelNodeResult.java",
"identifier": "ModelNodeResult",
"interfaces": "",
"methods": [
{
"class_method_signature": "ModelNodeResult.ModelNodeResult()",
"constructor": true,
"full_signature": "@Deprecated p... | {
"body": "public final ModelNodeResult forServer(String host, String server) {\n if (!isFromDomain()) {\n throw new IllegalArgumentException(\"Can't call forServer on a result that isn't from domain\");\n }\n\n List<Property> serverGroups = this.get(Constants.SERVER_GROUPS).asProperty... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
44525387_18 | {
"fields": [],
"file": "core/src/test/java/org/wildfly/extras/creaper/core/online/AdjustOperationForDomainTest.java",
"identifier": "AdjustOperationForDomainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void stringOperation_standalone() {\n OnlineOptions options = OnlineOptions.standalone().localDefault().build();\n AdjustOperationForDomain adjust = new AdjustOperationForDomain(options);\n\n assertEquals(\"/subsystem=web:read-resource\", adjust.adjust(\"/subsystem=we... | {
"fields": [
{
"declarator": "options",
"modifier": "private final",
"original_string": "private final OnlineOptions options;",
"type": "OnlineOptions",
"var_name": "options"
}
],
"file": "core/src/main/java/org/wildfly/extras/creaper/core/online/AdjustOperationForDomain.jav... | {
"body": "ModelNode adjust(ModelNode operation) {\n if (!options.isDomain) {\n return operation;\n }\n\n if (Constants.COMPOSITE.equals(operation.get(Constants.OP).asString())) {\n ModelNode steps = operation.get(Constants.STEPS);\n if (steps.getType() != ModelTy... | {
"created": null,
"fork": null,
"fork_count": 25,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 44525387,
"size": 1042,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/wildfly-extras/creaper"
} |
67262828_8 | {
"fields": [
{
"declarator": "descriptionBoldMarkdown",
"modifier": "private",
"original_string": "private String descriptionBoldMarkdown, descriptionLinkMarkdown, descriptionSubreddits;",
"type": "String",
"var_name": "descriptionBoldMarkdown"
},
{
"declarator": "enco... | {
"body": "@Test\n public void testConvertMarkdownToHtml_bold() {\n String output = encodingFixer.convertMarkdownToHtml(descriptionBoldMarkdown);\n assertEquals(\"New ingenious full feature Reddit client. <b>Read AMA in magazine\" +\n \"style QA format.</b> Add upcoming AMA to your cal... | {
"fields": [
{
"declarator": "URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))\")",
"modifier": "private static final",
"original_string": "private static final Pattern URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))... | {
"body": "public String convertMarkdownToHtml(String input) {\n input = urlMarkdownToHtml(input);\n input = boldMarkdownToHtml(input);\n\n return input;\n }",
"class_method_signature": "EncodingFixer.convertMarkdownToHtml(String input)",
"constructor": false,
"full_signature": "public S... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_4 | {
"fields": [
{
"declarator": "encodingFixer",
"modifier": "@Mock",
"original_string": "@Mock EncodingFixer encodingFixer;",
"type": "EncodingFixer",
"var_name": "encodingFixer"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n public void testParse_downloadTypes() throws IOException {\n //Google Play link\n String rawPlayDownload = \"[10000000](https://play.google.com/store/apps/details?id=com.eightyeightgames.tenmillion)\";\n Map<AppParser.Column, String> rawColumnMap = new HashMap<>();\n ... | {
"fields": [
{
"declarator": "NAME_PATTERN = Pattern.compile(\"^(?:\\\\[(.+)\\\\]\\\\((.+)\\\\))$\")",
"modifier": "static final",
"original_string": "static final Pattern NAME_PATTERN = Pattern.compile(\"^(?:\\\\[(.+)\\\\]\\\\((.+)\\\\))$\");",
"type": "Pattern",
"var_name": "NAME_... | {
"body": "@Override\n public void parse(AppInfo appInfo, Map<Column, String> rawColumns) {\n final String rawNameString = rawColumns.get(Column.NAME);\n\n String appName;\n String downloadUrl;\n Download.Type downloadType;\n\n Matcher matcher = NAME_PATTERN.matcher(rawNameString... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_5 | {
"fields": [
{
"declarator": "encodingFixer",
"modifier": "@Mock",
"original_string": "@Mock\n EncodingFixer encodingFixer;",
"type": "EncodingFixer",
"var_name": "encodingFixer"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "pri... | {
"body": "@Test\n public void testParse() throws IOException {\n String rawDescriptionData = \"This is a description\";\n Map<AppParser.Column, String> rawColumnMap = new HashMap<>();\n rawColumnMap.put(AppParser.Column.DESCRIPTION, rawDescriptionData);\n AppInfo appInfo = new AppInfo(... | {
"fields": [],
"file": "app/src/main/java/subreddit/android/appstore/backend/reddit/wiki/parser/DescriptionColumnParser.java",
"identifier": "DescriptionColumnParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "DescriptionColumnParser.DescriptionColumnParser(EncodingFixer encodingF... | {
"body": "@Override\n public void parse(AppInfo appInfo, Map<Column, String> rawColumns) {\n final String rawDescriptionString = rawColumns.get(Column.DESCRIPTION);\n\n String fixedDescription = fixEncoding(rawDescriptionString);\n fixedDescription = fixMarkdown(fixedDescription);\n fi... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_9 | {
"fields": [
{
"declarator": "descriptionBoldMarkdown",
"modifier": "private",
"original_string": "private String descriptionBoldMarkdown, descriptionLinkMarkdown, descriptionSubreddits;",
"type": "String",
"var_name": "descriptionBoldMarkdown"
},
{
"declarator": "enco... | {
"body": "@Test\n public void testConvertMarkdownToHtml_link() {\n String output = encodingFixer.convertMarkdownToHtml(descriptionLinkMarkdown);\n assertEquals(\"Tutorial screencast for \" +\n \"<a href=\\\"https://www.propellerheads.se/products/reason/\\\">\" +\n \"Pro... | {
"fields": [
{
"declarator": "URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))\")",
"modifier": "private static final",
"original_string": "private static final Pattern URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))... | {
"body": "public String convertMarkdownToHtml(String input) {\n input = urlMarkdownToHtml(input);\n input = boldMarkdownToHtml(input);\n\n return input;\n }",
"class_method_signature": "EncodingFixer.convertMarkdownToHtml(String input)",
"constructor": false,
"full_signature": "public S... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_2 | {
"fields": [
{
"declarator": "encodingFixer",
"modifier": "@Mock",
"original_string": "@Mock EncodingFixer encodingFixer;",
"type": "EncodingFixer",
"var_name": "encodingFixer"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n public void testParse() throws IOException {\n String rawContactData = \"/u/someuser1 thisismail1@gmail.com \" +\n \"Twitter: [@twitteraccount](https://twitter.com/twitteraccount) \" +\n \"Instagram: [@instagramaccount](http://instagram.com/instagramaccount) ... | {
"fields": [
{
"declarator": "EMAIL_PATTERN = Pattern.compile(\"(\\\\b[\\\\w._%+-]+@[\\\\w.-]+\\\\.[\\\\w]{2,}\\\\b)\")",
"modifier": "final static",
"original_string": "final static Pattern EMAIL_PATTERN = Pattern.compile(\"(\\\\b[\\\\w._%+-]+@[\\\\w.-]+\\\\.[\\\\w]{2,}\\\\b)\");",
"type... | {
"body": "@Override\n public void parse(AppInfo appInfo, Map<Column, String> rawColumns) {\n final String raw = rawColumns.get(Column.CONTACT);\n Matcher emailMatcher = EMAIL_PATTERN.matcher(raw);\n while (emailMatcher.find()) {\n Contact contact = new Contact(Contact.Type.EMAIL, e... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_10 | {
"fields": [
{
"declarator": "descriptionBoldMarkdown",
"modifier": "private",
"original_string": "private String descriptionBoldMarkdown, descriptionLinkMarkdown, descriptionSubreddits;",
"type": "String",
"var_name": "descriptionBoldMarkdown"
},
{
"declarator": "enco... | {
"body": "@Test\n public void testConvertSubredditsToLinks() {\n String output = encodingFixer.convertSubredditsToLinks(descriptionSubreddits);\n assertEquals(\"You can setup playlists, geofences, volume control, and share \" +\n \"playlists with others. Share playlists at \" +\n ... | {
"fields": [
{
"declarator": "URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))\")",
"modifier": "private static final",
"original_string": "private static final Pattern URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))... | {
"body": "public String convertSubredditsToLinks(String input) {\n // Converts subreddit mentions to links in HTML\n Matcher subredditMatcher = SUBREDDIT_PATTERN.matcher(input);\n while (subredditMatcher.find()) {\n String matchedSubreddit = subredditMatcher.group(1);\n\n S... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_3 | {
"fields": [
{
"declarator": "encodingFixer",
"modifier": "@Mock",
"original_string": "@Mock EncodingFixer encodingFixer;",
"type": "EncodingFixer",
"var_name": "encodingFixer"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n public void testParse_names() throws IOException {\n String rawNameData = \"[10000000](https://play.google.com/store/apps/details?id=com.eightyeightgames.tenmillion)\";\n Map<AppParser.Column, String> rawColumnMap = new HashMap<>();\n rawColumnMap.put(AppParser.Column.NAME, ... | {
"fields": [
{
"declarator": "NAME_PATTERN = Pattern.compile(\"^(?:\\\\[(.+)\\\\]\\\\((.+)\\\\))$\")",
"modifier": "static final",
"original_string": "static final Pattern NAME_PATTERN = Pattern.compile(\"^(?:\\\\[(.+)\\\\]\\\\((.+)\\\\))$\");",
"type": "Pattern",
"var_name": "NAME_... | {
"body": "@Override\n public void parse(AppInfo appInfo, Map<Column, String> rawColumns) {\n final String rawNameString = rawColumns.get(Column.NAME);\n\n String appName;\n String downloadUrl;\n Download.Type downloadType;\n\n Matcher matcher = NAME_PATTERN.matcher(rawNameString... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_0 | {
"fields": [
{
"declarator": "encodingFixer",
"modifier": "@Mock",
"original_string": "@Mock EncodingFixer encodingFixer;",
"type": "EncodingFixer",
"var_name": "encodingFixer"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n public void testParse() throws IOException {\n String rawDeviceData = \"Phone\";\n Map<AppParser.Column, String> rawColumnMap = new HashMap<>();\n rawColumnMap.put(AppParser.Column.DEVICE, rawDeviceData);\n AppInfo appInfo = new AppInfo();\n parser.parse(appInf... | {
"fields": [],
"file": "app/src/main/java/subreddit/android/appstore/backend/reddit/wiki/parser/DeviceColumnParser.java",
"identifier": "DeviceColumnParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "DeviceColumnParser.DeviceColumnParser(EncodingFixer encodingFixer)",
"const... | {
"body": "@Override\n public void parse(AppInfo appInfo, Map<Column, String> rawColumns) {\n final String rawDeviceString = rawColumns.get(Column.DEVICE);\n\n if (rawDeviceString.toLowerCase().contains(\"watch\")) appInfo.getTags().add(AppTags.WEAR);\n if (rawDeviceString.toLowerCase().contai... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_1 | {
"fields": [
{
"declarator": "encodingFixer",
"modifier": "@Mock",
"original_string": "@Mock EncodingFixer encodingFixer;",
"type": "EncodingFixer",
"var_name": "encodingFixer"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n public void testParse() throws IOException {\n String rawPriceData = \"Paid\";\n Map<AppParser.Column, String> rawColumnMap = new HashMap<>();\n rawColumnMap.put(AppParser.Column.PRICE, rawPriceData);\n AppInfo appInfo = new AppInfo();\n parser.parse(appInfo, r... | {
"fields": [],
"file": "app/src/main/java/subreddit/android/appstore/backend/reddit/wiki/parser/PriceColumnParser.java",
"identifier": "PriceColumnParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "PriceColumnParser.PriceColumnParser(EncodingFixer encodingFixer)",
"construct... | {
"body": "@Override\n public void parse(AppInfo appInfo, Map<Column, String> rawColumns) {\n final String rawPriceString = rawColumns.get(Column.PRICE);\n\n if (rawPriceString.toLowerCase().contains(\"free\")) appInfo.getTags().add(AppTags.FREE);\n if (rawPriceString.toLowerCase().contains(\"... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_6 | {
"fields": [
{
"declarator": "appParser",
"modifier": "@Mock",
"original_string": "@Mock AppParser appParser;",
"type": "AppParser",
"var_name": "appParser"
},
{
"declarator": "categoryParser",
"modifier": "@Mock",
"original_string": "@Mock CategoryParser c... | {
"body": "@Test\n public void testBodyParser() throws IOException {\n Collection<AppInfo> appInfos = bodyParser.parseBody(TestBody.HTMLBODY);\n assertFalse(appInfos.isEmpty());\n assertEquals(41, appInfos.size());\n }",
"class_method_signature": "BodyParserTest.testBodyParser()",
"cons... | {
"fields": [
{
"declarator": "appParsers",
"modifier": "",
"original_string": "Set<AppParser> appParsers;",
"type": "Set<AppParser>",
"var_name": "appParsers"
},
{
"declarator": "categoryParser",
"modifier": "",
"original_string": "CategoryParser categoryPa... | {
"body": "@Inject\n public BodyParser(CategoryParser categoryParser, Set<AppParser> appParsers) {\n this.appParsers = appParsers;\n this.categoryParser = categoryParser;\n }",
"class_method_signature": "BodyParser.BodyParser(CategoryParser categoryParser, Set<AppParser> appParsers)",
"constru... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
67262828_7 | {
"fields": [
{
"declarator": "descriptionBoldMarkdown",
"modifier": "private",
"original_string": "private String descriptionBoldMarkdown, descriptionLinkMarkdown, descriptionSubreddits;",
"type": "String",
"var_name": "descriptionBoldMarkdown"
},
{
"declarator": "enco... | {
"body": "@Test\n public void testConvertMarkdownToHtml() {\n String output = encodingFixer.convertMarkdownToHtml(\"\");\n assertEquals(\"\", output);\n\n output = encodingFixer.convertMarkdownToHtml(\"This description has no markdown\");\n assertEquals(\"This description has no markdo... | {
"fields": [
{
"declarator": "URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))\")",
"modifier": "private static final",
"original_string": "private static final Pattern URL_MARKDOWN_PATTERN = Pattern.compile(\"(\\\\[(.*?)\\\\]\\\\s{0,1}\\\\((http.*?)\\\\))... | {
"body": "public String convertMarkdownToHtml(String input) {\n input = urlMarkdownToHtml(input);\n input = boldMarkdownToHtml(input);\n\n return input;\n }",
"class_method_signature": "EncodingFixer.convertMarkdownToHtml(String input)",
"constructor": false,
"full_signature": "public S... | {
"created": null,
"fork": null,
"fork_count": 65,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67262828,
"size": 2060,
"stargazer_count": 266,
"stars": null,
"updates": null,
"url": "https://github.com/d4rken/reddit-android-appstore"
} |
159473524_0 | {
"fields": [
{
"declarator": "emailService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate EmailServiceImpl emailService;",
"type": "EmailServiceImpl",
"var_name": "emailService"
},
{
"declarator": "mailSender",
"modifier": "@... | {
"body": "@Test\n\tpublic void shouldSendBackupEmail() throws MessagingException, IOException {\n\n\t\tfinal String subject = \"subject\";\n\t\tfinal String text = \"text\";\n\t\tfinal String attachment = \"attachment.json\";\n\n\t\tRecipient recipient = new Recipient();\n\t\trecipient.setAccountName(\"test\");\n\t\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "mailSender",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic void send(NotificationType type, Recipient recipient, String attachment) throws MessagingException, IOException {\n\n\t\tfinal String subject = env.getProperty(type.getSubject());\n\t\tfinal String text = MessageFormat.format(env.getProperty(type.getText()), recipient.... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_1 | {
"fields": [
{
"declarator": "emailService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate EmailServiceImpl emailService;",
"type": "EmailServiceImpl",
"var_name": "emailService"
},
{
"declarator": "mailSender",
"modifier": "@... | {
"body": "@Test\n\tpublic void shouldSendRemindEmail() throws MessagingException, IOException {\n\n\t\tfinal String subject = \"subject\";\n\t\tfinal String text = \"text\";\n\n\t\tRecipient recipient = new Recipient();\n\t\trecipient.setAccountName(\"test\");\n\t\trecipient.setEmail(\"test@test.com\");\n\n\t\twhen(... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "mailSender",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic void send(NotificationType type, Recipient recipient, String attachment) throws MessagingException, IOException {\n\n\t\tfinal String subject = env.getProperty(type.getSubject());\n\t\tfinal String text = MessageFormat.format(env.getProperty(type.getText()), recipient.... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_16 | {
"fields": [
{
"declarator": "statisticsService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate StatisticsServiceImpl statisticsService;",
"type": "StatisticsServiceImpl",
"var_name": "statisticsService"
},
{
"declarator": "ratesSer... | {
"body": "@Test\n\tpublic void shouldSaveDataPoint() {\n\n\t\t/**\n\t\t * Given\n\t\t */\n\n\t\tItem salary = new Item();\n\t\tsalary.setTitle(\"Salary\");\n\t\tsalary.setAmount(new BigDecimal(9100));\n\t\tsalary.setCurrency(Currency.USD);\n\t\tsalary.setPeriod(TimePeriod.MONTH);\n\n\t\tItem grocery = new Item();\n\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic DataPoint save(String accountName, Account account) {\n\n\t\tInstant instant = LocalDate.now().atStartOfDay()\n\t\t\t\t.atZone(ZoneId.systemDefault()).toInstant();\n\n\t\tDataPointId pointId = new DataPointId(accountName, Date.from(instant));\n\n\t\tSet<ItemMetric> inc... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_6 | {
"fields": [
{
"declarator": "recipientService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate RecipientServiceImpl recipientService;",
"type": "RecipientServiceImpl",
"var_name": "recipientService"
},
{
"declarator": "repository",
... | {
"body": "@Test\n\tpublic void shouldFindReadyToNotifyWhenNotificationTypeIsRemind() {\n\t\tfinal List<Recipient> recipients = ImmutableList.of(new Recipient());\n\t\twhen(repository.findReadyForRemind()).thenReturn(recipients);\n\n\t\tList<Recipient> found = recipientService.findReadyToNotify(NotificationType.REMIN... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic List<Recipient> findReadyToNotify(NotificationType type) {\n\t\tswitch (type) {\n\t\t\tcase BACKUP:\n\n\t\t\t\treturn repository.findReadyForBackup();\n\t\t\t\t\n\t\t\tcase REMIND:\n\n\t\t\t\treturn repository.findReadyForRemind();\n\n\t\t\tdefault:\n\t\t\t\tthrow new ... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_11 | {
"fields": [
{
"declarator": "ratesService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate ExchangeRatesServiceImpl ratesService;",
"type": "ExchangeRatesServiceImpl",
"var_name": "ratesService"
},
{
"declarator": "client",
"m... | {
"body": "@Test\n\tpublic void shouldConvertCurrency() {\n\n\t\tExchangeRatesContainer container = new ExchangeRatesContainer();\n\t\tcontainer.setRates(ImmutableMap.of(\n\t\t\t\tCurrency.EUR.name(), new BigDecimal(\"0.8\"),\n\t\t\t\tCurrency.RUB.name(), new BigDecimal(\"80\")\n\t\t));\n\n\t\twhen(client.getRates(Cu... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic BigDecimal convert(Currency from, Currency to, BigDecimal amount) {\n\n\t\tAssert.notNull(amount);\n\n\t\tMap<Currency, BigDecimal> rates = getCurrentRates();\n\t\tBigDecimal ratio = rates.get(to).divide(rates.get(from), 4, RoundingMode.HALF_UP);\n\n\t\treturn amount.m... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_10 | {
"fields": [
{
"declarator": "ratesService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate ExchangeRatesServiceImpl ratesService;",
"type": "ExchangeRatesServiceImpl",
"var_name": "ratesService"
},
{
"declarator": "client",
"m... | {
"body": "@Test\n\tpublic void shouldNotRequestRatesWhenTodaysContainerAlreadyExists() {\n\n\t\tExchangeRatesContainer container = new ExchangeRatesContainer();\n\t\tcontainer.setRates(ImmutableMap.of(\n\t\t\t\tCurrency.EUR.name(), new BigDecimal(\"0.8\"),\n\t\t\t\tCurrency.RUB.name(), new BigDecimal(\"80\")\n\t\t))... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic Map<Currency, BigDecimal> getCurrentRates() {\n\n\t\tif (container == null || !container.getDate().equals(LocalDate.now())) {\n\t\t\t\n\t\t\tTransaction dbTransaction = Cat.newTransaction(CatConstants.TYPE_REMOTE_CALL, \"get_current_rates\");\n\n\t\t\ttry {\n\t\t\t\tco... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_7 | {
"fields": [
{
"declarator": "notificationService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate NotificationServiceImpl notificationService;",
"type": "NotificationServiceImpl",
"var_name": "notificationService"
},
{
"declarator":... | {
"body": "@Test\n\tpublic void shouldSendBackupNotificationsEvenWhenErrorsOccursForSomeRecipients() throws IOException, MessagingException, InterruptedException {\n\n\t\tfinal String attachment = \"json\";\n\n\t\tRecipient withError = new Recipient();\n\t\twithError.setAccountName(\"with-error\");\n\n\t\tRecipient w... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "client",
"modifier... | {
"body": "@Override\n\t@Scheduled(cron = \"${backup.cron}\")\n\t@CatAnnotation\n\tpublic void sendBackupNotifications() {\n\n\t\tfinal NotificationType type = NotificationType.BACKUP;\n\n\t\tList<Recipient> recipients = recipientService.findReadyToNotify(type);\n\t\tlog.info(\"found {} recipients for backup notifica... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_4 | {
"fields": [
{
"declarator": "recipientService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate RecipientServiceImpl recipientService;",
"type": "RecipientServiceImpl",
"var_name": "recipientService"
},
{
"declarator": "repository",
... | {
"body": "@Test\n\tpublic void shouldSaveRecipient() {\n\n\t\tNotificationSettings remind = new NotificationSettings();\n\t\tremind.setActive(true);\n\t\tremind.setFrequency(Frequency.WEEKLY);\n\t\tremind.setLastNotified(null);\n\n\t\tNotificationSettings backup = new NotificationSettings();\n\t\tbackup.setActive(fa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic Recipient save(String accountName, Recipient recipient) {\n\n\t\trecipient.setAccountName(accountName);\n\t\trecipient.getScheduledNotifications().values()\n\t\t\t\t.forEach(settings -> {\n\t\t\t\t\tif (settings.getLastNotified() == null) {\n\t\t\t\t\t\tsettings.setLas... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_13 | {
"fields": [
{
"declarator": "statisticsService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate StatisticsServiceImpl statisticsService;",
"type": "StatisticsServiceImpl",
"var_name": "statisticsService"
},
{
"declarator": "ratesSer... | {
"body": "@Test\n\tpublic void shouldFindDataPointListByAccountName() {\n\t\tfinal List<DataPoint> list = ImmutableList.of(new DataPoint());\n\t\twhen(repository.findByIdAccount(\"test\")).thenReturn(list);\n\n\t\tList<DataPoint> result = statisticsService.findByAccountName(\"test\");\n\t\tassertEquals(list, result)... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic List<DataPoint> findByAccountName(String accountName) {\n\t\tAssert.hasLength(accountName);\n\t\t\n\t\treturn repository.findByIdAccount(accountName);\n\t}",
"class_method_signature": "StatisticsServiceImpl.findByAccountName(String accountName)",
"constructor": fal... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_8 | {
"fields": [
{
"declarator": "notificationService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate NotificationServiceImpl notificationService;",
"type": "NotificationServiceImpl",
"var_name": "notificationService"
},
{
"declarator":... | {
"body": "@Test\n\tpublic void shouldSendRemindNotificationsEvenWhenErrorsOccursForSomeRecipients() throws IOException, MessagingException, InterruptedException {\n\n\t\tfinal String attachment = \"json\";\n\n\t\tRecipient withError = new Recipient();\n\t\twithError.setAccountName(\"with-error\");\n\n\t\tRecipient w... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "client",
"modifier... | {
"body": "@Override\n\t@Scheduled(cron = \"${remind.cron}\")\n\t@CatAnnotation\n\tpublic void sendRemindNotifications() {\n\n\t\tfinal NotificationType type = NotificationType.REMIND;\n\n\t\tList<Recipient> recipients = recipientService.findReadyToNotify(type);\n\t\tlog.info(\"found {} recipients for remind notifica... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_9 | {
"fields": [
{
"declarator": "ratesService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate ExchangeRatesServiceImpl ratesService;",
"type": "ExchangeRatesServiceImpl",
"var_name": "ratesService"
},
{
"declarator": "client",
"m... | {
"body": "@Test\n\tpublic void shouldReturnCurrentRatesWhenContainerIsEmptySoFar() {\n\n\t\tExchangeRatesContainer container = new ExchangeRatesContainer();\n\t\tcontainer.setRates(ImmutableMap.of(\n\t\t\t\tCurrency.EUR.name(), new BigDecimal(\"0.8\"),\n\t\t\t\tCurrency.RUB.name(), new BigDecimal(\"80\")\n\t\t));\n\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic Map<Currency, BigDecimal> getCurrentRates() {\n\n\t\tif (container == null || !container.getDate().equals(LocalDate.now())) {\n\t\t\t\n\t\t\tTransaction dbTransaction = Cat.newTransaction(CatConstants.TYPE_REMOTE_CALL, \"get_current_rates\");\n\n\t\t\ttry {\n\t\t\t\tco... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_12 | {
"fields": [
{
"declarator": "ratesService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate ExchangeRatesServiceImpl ratesService;",
"type": "ExchangeRatesServiceImpl",
"var_name": "ratesService"
},
{
"declarator": "client",
"m... | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void shouldFailToConvertWhenAmountIsNull() {\n\t\tratesService.convert(Currency.EUR, Currency.RUB, null);\n\t}",
"class_method_signature": "ExchangeRatesServiceImplTest.shouldFailToConvertWhenAmountIsNull()",
"constructor": false,
"full_signa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ExchangeRatesServiceImpl.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic BigDecimal convert(Currency from, Currency to, BigDecimal amount) {\n\n\t\tAssert.notNull(amount);\n\n\t\tMap<Currency, BigDecimal> rates = getCurrentRates();\n\t\tBigDecimal ratio = rates.get(to).divide(rates.get(from), 4, RoundingMode.HALF_UP);\n\n\t\treturn amount.m... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_5 | {
"fields": [
{
"declarator": "recipientService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate RecipientServiceImpl recipientService;",
"type": "RecipientServiceImpl",
"var_name": "recipientService"
},
{
"declarator": "repository",
... | {
"body": "@Test\n\tpublic void shouldFindReadyToNotifyWhenNotificationTypeIsBackup() {\n\t\tfinal List<Recipient> recipients = ImmutableList.of(new Recipient());\n\t\twhen(repository.findReadyForBackup()).thenReturn(recipients);\n\n\t\tList<Recipient> found = recipientService.findReadyToNotify(NotificationType.BACKU... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic List<Recipient> findReadyToNotify(NotificationType type) {\n\t\tswitch (type) {\n\t\t\tcase BACKUP:\n\n\t\t\t\treturn repository.findReadyForBackup();\n\t\t\t\t\n\t\t\tcase REMIND:\n\n\t\t\t\treturn repository.findReadyForRemind();\n\n\t\t\tdefault:\n\t\t\t\tthrow new ... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_15 | {
"fields": [
{
"declarator": "statisticsService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate StatisticsServiceImpl statisticsService;",
"type": "StatisticsServiceImpl",
"var_name": "statisticsService"
},
{
"declarator": "ratesSer... | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void shouldFailToFindDataPointWhenAccountNameIsEmpty() {\n\t\tstatisticsService.findByAccountName(\"\");\n\t}",
"class_method_signature": "StatisticsServiceImplTest.shouldFailToFindDataPointWhenAccountNameIsEmpty()",
"constructor": false,
"fu... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic List<DataPoint> findByAccountName(String accountName) {\n\t\tAssert.hasLength(accountName);\n\t\t\n\t\treturn repository.findByIdAccount(accountName);\n\t}",
"class_method_signature": "StatisticsServiceImpl.findByAccountName(String accountName)",
"constructor": fal... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_2 | {
"fields": [
{
"declarator": "recipientService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate RecipientServiceImpl recipientService;",
"type": "RecipientServiceImpl",
"var_name": "recipientService"
},
{
"declarator": "repository",
... | {
"body": "@Test\n\tpublic void shouldFindByAccountName() {\n\t\tRecipient recipient = new Recipient();\n\t\trecipient.setAccountName(\"test\");\n\n\t\twhen(repository.findByAccountName(recipient.getAccountName())).thenReturn(recipient);\n\t\tRecipient found = recipientService.findByAccountName(recipient.getAccountNa... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic Recipient findByAccountName(String accountName) {\n\t\tAssert.hasLength(accountName);\n\t\t\n\t\treturn repository.findByAccountName(accountName);\n\t}",
"class_method_signature": "RecipientServiceImpl.findByAccountName(String accountName)",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_3 | {
"fields": [
{
"declarator": "recipientService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate RecipientServiceImpl recipientService;",
"type": "RecipientServiceImpl",
"var_name": "recipientService"
},
{
"declarator": "repository",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void shouldFailToFindRecipientWhenAccountNameIsEmpty() {\n\t\trecipientService.findByAccountName(\"\");\n\t}",
"class_method_signature": "RecipientServiceImplTest.shouldFailToFindRecipientWhenAccountNameIsEmpty()",
"constructor": false,
"full... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic Recipient findByAccountName(String accountName) {\n\t\tAssert.hasLength(accountName);\n\t\t\n\t\treturn repository.findByAccountName(accountName);\n\t}",
"class_method_signature": "RecipientServiceImpl.findByAccountName(String accountName)",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
159473524_14 | {
"fields": [
{
"declarator": "statisticsService",
"modifier": "@InjectMocks\n\tprivate",
"original_string": "@InjectMocks\n\tprivate StatisticsServiceImpl statisticsService;",
"type": "StatisticsServiceImpl",
"var_name": "statisticsService"
},
{
"declarator": "ratesSer... | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void shouldFailToFindDataPointWhenAccountNameIsNull() {\n\t\tstatisticsService.findByAccountName(null);\n\t}",
"class_method_signature": "StatisticsServiceImplTest.shouldFailToFindDataPointWhenAccountNameIsNull()",
"constructor": false,
"full... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modi... | {
"body": "@Override\n\t@CatAnnotation\n\tpublic List<DataPoint> findByAccountName(String accountName) {\n\t\tAssert.hasLength(accountName);\n\t\t\n\t\treturn repository.findByIdAccount(accountName);\n\t}",
"class_method_signature": "StatisticsServiceImpl.findByAccountName(String accountName)",
"constructor": fal... | {
"created": null,
"fork": null,
"fork_count": 138,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 159473524,
"size": 1765,
"stargazer_count": 122,
"stars": null,
"updates": null,
"url": "https://github.com/spring2go/piggymetrics"
} |
36039997_0 | {
"fields": [],
"file": "rsm-core/src/test/java/com/crimsonhexagon/rsm/RedisSessionTest.java",
"identifier": "RedisSessionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRemoveAttribute() {\n RedisSession rs = session();\n\n rs.removeAttribute(\"foo\");\n Assert.assertTrue(rs.isDirty());\n\n rs.clearDirty();\n rs.removeAttribute(\"foo\");\n Assert.assertTrue(rs.isDirty());\n\n rs.removeAttribute(\"... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(RedisSession.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(RedisSession.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "serialVersio... | {
"body": "@Override\n public void removeAttribute(String name) {\n super.removeAttribute(name);\n if (!saveOnChange()) {\n this.dirty = true;\n if (log.isTraceEnabled()) {\n log.trace(\"Marking session as dirty. Attr [\" + name + \"] was removed\");\n ... | {
"created": null,
"fork": null,
"fork_count": 61,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 36039997,
"size": 124,
"stargazer_count": 94,
"stars": null,
"updates": null,
"url": "https://github.com/chexagon/redis-session-manager"
} |
95591183_4 | {
"fields": [
{
"declarator": "mockContext",
"modifier": "@Mock",
"original_string": "@Mock\n Context mockContext;",
"type": "Context",
"var_name": "mockContext"
}
],
"file": "falx/src/test/java/com/life360/falx/FalxApiTest.java",
"identifier": "FalxApiTest",
"interfac... | {
"body": "@Test\n public void testEnableLogging() {\n TestUtilComponent testUtilComponent = DaggerTestUtilComponent.builder()\n .appModule(new AppModule(mockContext))\n .fakeDateTimeModule(new FakeDateTimeModule())\n .build();\n\n FalxApi api = new FalxAp... | {
"fields": [
{
"declarator": "MONITOR_APP_STATE = 0x01",
"modifier": "public static final",
"original_string": "public static final int MONITOR_APP_STATE = 0x01;",
"type": "int",
"var_name": "MONITOR_APP_STATE"
},
{
"declarator": "MONITOR_NETWORK = 1 << 1",
"modi... | {
"body": "public void enableLogging(boolean enable) {\n logger.setEnabled(enable);\n if (falxInterceptor != null) {\n falxInterceptor.enableLogging(enable);\n }\n }",
"class_method_signature": "FalxApi.enableLogging(boolean enable)",
"constructor": false,
"full_signature": "p... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 95591183,
"size": 310,
"stargazer_count": 8,
"stars": null,
"updates": null,
"url": "https://github.com/life360/android-falx"
} |
95591183_3 | {
"fields": [
{
"declarator": "MONITOR_LABEL_GPS = \"GPS\"",
"modifier": "public static final",
"original_string": "public static final String MONITOR_LABEL_GPS = \"GPS\";",
"type": "String",
"var_name": "MONITOR_LABEL_GPS"
},
{
"declarator": "MONITOR_LABEL_ACTIVITY_DET... | {
"body": "@Test\n public void sessionTestErrorCase() throws Exception {\n TestUtilComponent testUtilComponent = DaggerTestUtilComponent.builder()\n .appModule(new AppModule(mockContext))\n .fakeDateTimeModule(new FakeDateTimeModule())\n .build();\n\n OnOf... | {
"fields": [
{
"declarator": "TAG = \"OnOffMonitor\"",
"modifier": "private final",
"original_string": "private final String TAG = \"OnOffMonitor\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "stateDisposable",
"modifier": "private",
"original... | {
"body": "@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)\n boolean turnedOff() {\n long endTime = clock.currentTimeMillis();\n if (endTime < startTime) {\n logger.e(TAG, label + \" Likely error in timer schedule to mark end of a GPS session\");\n\n endTime = startTim... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 95591183,
"size": 310,
"stargazer_count": 8,
"stars": null,
"updates": null,
"url": "https://github.com/life360/android-falx"
} |
95591183_2 | {
"fields": [
{
"declarator": "mockContext",
"modifier": "@Mock",
"original_string": "@Mock\n Context mockContext;",
"type": "Context",
"var_name": "mockContext"
}
],
"file": "falx/src/test/java/com/life360/falx/monitor/NetworkMonitorTest.java",
"identifier": "NetworkMon... | {
"body": "@Test\n public void testObservable() {\n TestUtilComponent testUtilComponent = DaggerTestUtilComponent.builder()\n .appModule(new AppModule(mockContext))\n .fakeDateTimeModule(new FakeDateTimeModule())\n .testLoggerModule(new TestLoggerModule())\n ... | {
"fields": [
{
"declarator": "TAG = \"NetworkMonitor\"",
"modifier": "private static final",
"original_string": "private static final String TAG = \"NetworkMonitor\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "networkActivityDisposable",
"modifier"... | {
"body": "@Override\n public void stop() {\n super.stop();\n\n if (!networkActivityDisposable.isDisposed()) {\n networkActivityDisposable.dispose();\n logger.d(TAG, \"stop: disposed networkActivityDisposable\");\n }\n }",
"class_method_signature": "NetworkMonitor.st... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 95591183,
"size": 310,
"stargazer_count": 8,
"stars": null,
"updates": null,
"url": "https://github.com/life360/android-falx"
} |
95591183_1 | {
"fields": [
{
"declarator": "mockContext",
"modifier": "@Mock",
"original_string": "@Mock\n Context mockContext;",
"type": "Context",
"var_name": "mockContext"
}
],
"file": "falx/src/test/java/com/life360/falx/monitor/RealtimeMessagingMonitorTest.java",
"identifier": "... | {
"body": "@Test\n public void testObservable() {\n TestUtilComponent testUtilComponent = DaggerTestUtilComponent.builder()\n .appModule(new AppModule(mockContext))\n .fakeDateTimeModule(new FakeDateTimeModule())\n .testLoggerModule(new TestLoggerModule())\n ... | {
"fields": [
{
"declarator": "TAG = \"RealTimeDataMonitor\"",
"modifier": "private static final",
"original_string": "private static final String TAG = \"RealTimeDataMonitor\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "rtMessagingDisposable",
"mod... | {
"body": "@Override\n public void stop() {\n super.stop();\n\n if (!rtMessagingDisposable.isDisposed()) {\n rtMessagingDisposable.dispose();\n logger.d(TAG, \"stop: disposed rtMessagingDisposable\");\n }\n if (!rtMessagingSessionDisposable.isDisposed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 95591183,
"size": 310,
"stargazer_count": 8,
"stars": null,
"updates": null,
"url": "https://github.com/life360/android-falx"
} |
95591183_0 | {
"fields": [
{
"declarator": "MONITOR_LABEL_WAKELOCK = \"Wakelock\"",
"modifier": "public static final",
"original_string": "public static final String MONITOR_LABEL_WAKELOCK = \"Wakelock\";",
"type": "String",
"var_name": "MONITOR_LABEL_WAKELOCK"
},
{
"declarator": "M... | {
"body": "@Test\n public void sessionTestErrorCase() throws Exception {\n TestUtilComponent testUtilComponent = DaggerTestUtilComponent.builder()\n .appModule(new AppModule(mockContext))\n .fakeDateTimeModule(new FakeDateTimeModule())\n .build();\n\n Wake... | {
"fields": [
{
"declarator": "TAG = \"WakelockMonitor\"",
"modifier": "private final",
"original_string": "private final String TAG = \"WakelockMonitor\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "stateDisposable",
"modifier": "private",
"or... | {
"body": "@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)\n boolean released() {\n long endTime = clock.currentTimeMillis();\n if (endTime < startTime) {\n logger.e(TAG, label + \" Likely error in timer schedule to mark end of a wakelock session\");\n\n endTime = star... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 95591183,
"size": 310,
"stargazer_count": 8,
"stars": null,
"updates": null,
"url": "https://github.com/life360/android-falx"
} |
28858344_36 | {
"fields": [
{
"declarator": "responseHandler",
"modifier": "private",
"original_string": "private DummyResponseHandler responseHandler;",
"type": "DummyResponseHandler",
"var_name": "responseHandler"
},
{
"declarator": "bindRequest",
"modifier": "private",
... | {
"body": "@Test(groups=\"checkintest\")\n public void testSucceedReject() {\n try {\n bindRequest.reject(-1);\n } catch (IllegalStateException e1) {\n fail(\"Should succes rejecting bind request\");\n } catch (IOException e1) {\n fail(\"Should succes rejecting... | {
"fields": [
{
"declarator": "lock = new ReentrantLock()",
"modifier": "private final",
"original_string": "private final Lock lock = new ReentrantLock();",
"type": "Lock",
"var_name": "lock"
},
{
"declarator": "condition = lock.newCondition()",
"modifier": "priv... | {
"body": "public void reject(int errorCode) throws IllegalStateException, IOException {\n lock.lock();\n try {\n if (done) {\n throw new IllegalStateException(\"Response already initiated\");\n } else {\n done = true;\n try {\n ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_77 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/GeneralDataCodingTest.java",
"identifier": "GeneralDataCodingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGeneralAlphabetJis() {\n DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_JIS);\n assertEquals(dataCoding.toByte(), (byte) 0x05);\n }",
"class_method_signature": "GeneralDataCodingTest.testGeneralAlphabetJis()",
"constructor": false,
"full_signature": "@Tes... | {
"fields": [
{
"declarator": "DEFAULT = new GeneralDataCoding()",
"modifier": "public static final",
"original_string": "public static final GeneralDataCoding DEFAULT = new GeneralDataCoding();",
"type": "GeneralDataCoding",
"var_name": "DEFAULT"
},
{
"declarator": "co... | {
"body": "public byte toByte() {\n byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0;\n value |= alphabet.value();\n if (messageClass != null) {\n value |= DataCodings.MASK_CONTAIN_MESSAGE_CLASS;\n value |= messageClass.value();\n }\n return ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_20 | {
"fields": [
{
"declarator": "relativeTimeFormatter",
"modifier": "private",
"original_string": "private RelativeTimeFormatter relativeTimeFormatter;",
"type": "RelativeTimeFormatter",
"var_name": "relativeTimeFormatter"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/util/Relat... | {
"body": "@Test(groups = \"checkintest\")\n public void formatRelativeDateDifferentTimeZone() {\n GregorianCalendar smscDate = new GregorianCalendar(TimeZone.getTimeZone(\"America/Denver\"));\n smscDate.set(2014, Calendar.JANUARY, 2, 23, 15, 16);\n GregorianCalendar date = new GregorianCalendar(TimeZone.ge... | {
"fields": [
{
"declarator": "utcTimeZone = TimeZone.getTimeZone(\"UTC\")",
"modifier": "private static",
"original_string": "private static TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");",
"type": "TimeZone",
"var_name": "utcTimeZone"
},
{
"declarator": "DATE_F... | {
"body": "public String format(Calendar calendar) {\n // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed\n Calendar smscCalendar = Calendar.getInstance();\n return format(calendar, smscCalendar);\n }",
"class_method_signature": "RelativeTimeFormatter.format... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_6 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/util/StringValidatorTest.java",
"identifier": "StringValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(groups=\"checkintest\")\n public void validateStringCOctetStringWithByteArrayAndWithoutARange() throws Exception {\n StringValidator.validateString(\"\".getBytes(\"UTF-8\"), StringParameter.SCHEDULE_DELIVERY_TIME);\n StringValidator.validateString(\"020610233429000R\".getBytes(\"UTF-... | {
"fields": [
{
"declarator": "ACTUAL_LENGTH_IS = \". Actual length is \"",
"modifier": "private static final",
"original_string": "private static final String ACTUAL_LENGTH_IS = \". Actual length is \";",
"type": "String",
"var_name": "ACTUAL_LENGTH_IS"
},
{
"declarato... | {
"body": "public static void validateString(String value, StringParameter param)\n throws PDUStringException {\n if (param.getType() == StringType.C_OCTET_STRING) {\n if (param.isRangeMinAndMax()) {\n if (!isCOctetStringValid(value, param.getMax())) {\n ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_82 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/GeneralDataCodingTest.java",
"identifier": "GeneralDataCodingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGeneralAlphabetIso2022JpMusicCodes() {\n DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_ISO_2022_JP_MUSIC_CODES);\n assertEquals(dataCoding.toByte(), (byte) 0x0a);\n }",
"class_method_signature": "GeneralDataCodingTest.testGeneralAlphabetIso2022JpMusicCodes()... | {
"fields": [
{
"declarator": "DEFAULT = new GeneralDataCoding()",
"modifier": "public static final",
"original_string": "public static final GeneralDataCoding DEFAULT = new GeneralDataCoding();",
"type": "GeneralDataCoding",
"var_name": "DEFAULT"
},
{
"declarator": "co... | {
"body": "public byte toByte() {\n byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0;\n value |= alphabet.value();\n if (messageClass != null) {\n value |= DataCodings.MASK_CONTAIN_MESSAGE_CLASS;\n value |= messageClass.value();\n }\n return ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_16 | {
"fields": [
{
"declarator": "relativeTimeFormatter",
"modifier": "private",
"original_string": "private RelativeTimeFormatter relativeTimeFormatter;",
"type": "RelativeTimeFormatter",
"var_name": "relativeTimeFormatter"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/util/Relat... | {
"body": "@Test(groups = \"checkintest\", expectedExceptions = IllegalArgumentException.class)\n public void formatRelativeDateWhenAlreadyPast() {\n // date in the past\n GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZone(\"Europe/Berlin\"));\n date.set(1998, Calendar.MARCH, 1, 13, 46, 59)... | {
"fields": [
{
"declarator": "utcTimeZone = TimeZone.getTimeZone(\"UTC\")",
"modifier": "private static",
"original_string": "private static TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");",
"type": "TimeZone",
"var_name": "utcTimeZone"
},
{
"declarator": "DATE_F... | {
"body": "public String format(Calendar calendar) {\n // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed\n Calendar smscCalendar = Calendar.getInstance();\n return format(calendar, smscCalendar);\n }",
"class_method_signature": "RelativeTimeFormatter.format... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_41 | {
"fields": [
{
"declarator": "requestReceiver",
"modifier": "private",
"original_string": "private BindRequestReceiver requestReceiver;",
"type": "BindRequestReceiver",
"var_name": "requestReceiver"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/session/BindRequestReceiverTest.... | {
"body": "@Test(groups=\"checkintest\")\n public void testNoSingleAccept() {\n \n try {\n requestReceiver.notifyAcceptBind(dummyBind());\n } catch (IllegalStateException e) {\n fail(\"Should not fail waitForRequest and success accepting request\");\n }\n \n... | {
"fields": [
{
"declarator": "lock = new ReentrantLock()",
"modifier": "private final",
"original_string": "private final Lock lock = new ReentrantLock();",
"type": "Lock",
"var_name": "lock"
},
{
"declarator": "requestCondition = lock.newCondition()",
"modifier"... | {
"body": "void notifyAcceptBind(Bind bindParameter) throws IllegalStateException {\n lock.lock();\n try {\n if (request == null) {\n request = new BindRequest(bindParameter, responseHandler);\n requestCondition.signal();\n } else {\n th... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_40 | {
"fields": [
{
"declarator": "requestReceiver",
"modifier": "private",
"original_string": "private BindRequestReceiver requestReceiver;",
"type": "BindRequestReceiver",
"var_name": "requestReceiver"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/session/BindRequestReceiverTest.... | {
"body": "@Test(groups=\"checkintest\")\n public void testWaitTimeout() {\n \n try {\n requestReceiver.waitForRequest(1000);\n fail(\"Should fail since no request for 1000 millis\");\n } catch (IllegalStateException e) {\n e.printStackTrace();\n fai... | {
"fields": [
{
"declarator": "lock = new ReentrantLock()",
"modifier": "private final",
"original_string": "private final Lock lock = new ReentrantLock();",
"type": "Lock",
"var_name": "lock"
},
{
"declarator": "requestCondition = lock.newCondition()",
"modifier"... | {
"body": "BindRequest waitForRequest(long timeout) throws IllegalStateException, TimeoutException {\n lock.lock();\n try {\n if (alreadyWaitForRequest) {\n throw new IllegalStateException(\"waitForRequest(long) method already invoked\");\n } else if (request == null... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_17 | {
"fields": [
{
"declarator": "relativeTimeFormatter",
"modifier": "private",
"original_string": "private RelativeTimeFormatter relativeTimeFormatter;",
"type": "RelativeTimeFormatter",
"var_name": "relativeTimeFormatter"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/util/Relat... | {
"body": "@Test(groups = \"checkintest\")\n public void formatRelativeDateIgnoreMilliSeconds() {\n // Set the SMSC date to some future datetime\n GregorianCalendar smscDate = new GregorianCalendar(TimeZone.getTimeZone(\"Europe/Berlin\"));\n smscDate.set(Calendar.YEAR, 2080);\n smscDate.set(Calendar.MONT... | {
"fields": [
{
"declarator": "utcTimeZone = TimeZone.getTimeZone(\"UTC\")",
"modifier": "private static",
"original_string": "private static TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");",
"type": "TimeZone",
"var_name": "utcTimeZone"
},
{
"declarator": "DATE_F... | {
"body": "public String format(Calendar calendar) {\n // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed\n Calendar smscCalendar = Calendar.getInstance();\n return format(calendar, smscCalendar);\n }",
"class_method_signature": "RelativeTimeFormatter.format... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_56 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/SimpleDataCodingTest.java",
"identifier": "SimpleDataCodingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefault() {\n // 11110001\n SimpleDataCoding dataCoding = new SimpleDataCoding();\n byte expected = (byte)0xf1;\n assertEquals(dataCoding.toByte(), expected);\n\n DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());\n ... | {
"fields": [
{
"declarator": "alphabet",
"modifier": "private final",
"original_string": "private final Alphabet alphabet;",
"type": "Alphabet",
"var_name": "alphabet"
},
{
"declarator": "messageClass",
"modifier": "private final",
"original_string": "priva... | {
"body": "public byte toByte() {\n // base byte is 11110xxx or 0xf0, others injected\n byte value = (byte)0xf0;\n value |= alphabet.value();\n value |= messageClass.value();\n return value;\n }",
"class_method_signature": "SimpleDataCoding.toByte()",
"constructor": false,
... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_83 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/GeneralDataCodingTest.java",
"identifier": "GeneralDataCodingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGeneralAlphabetJisX02121990() {\n DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_JIS_X_0212_1990);\n assertEquals(dataCoding.toByte(), (byte) 0x0d);\n }",
"class_method_signature": "GeneralDataCodingTest.testGeneralAlphabetJisX02121990()",
"constructor": fa... | {
"fields": [
{
"declarator": "DEFAULT = new GeneralDataCoding()",
"modifier": "public static final",
"original_string": "public static final GeneralDataCoding DEFAULT = new GeneralDataCoding();",
"type": "GeneralDataCoding",
"var_name": "DEFAULT"
},
{
"declarator": "co... | {
"body": "public byte toByte() {\n byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0;\n value |= alphabet.value();\n if (messageClass != null) {\n value |= DataCodings.MASK_CONTAIN_MESSAGE_CLASS;\n value |= messageClass.value();\n }\n return ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_7 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/util/OctetUtilTest.java",
"identifier": "OctetUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIntConversions() {\n assertEquals(OctetUtil.bytesToInt(new byte[]{(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00}), 0);\n assertEquals(OctetUtil.bytesToInt(new byte[]{(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01}), 1);\n assertEquals(OctetUtil.bytesToInt(ne... | {
"fields": [],
"file": "jsmpp/src/main/java/org/jsmpp/util/OctetUtil.java",
"identifier": "OctetUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "OctetUtil.OctetUtil()",
"constructor": true,
"full_signature": "private OctetUtil()",
"identifier": "OctetUtil",
... | {
"body": "public static int bytesToInt(byte[] bytes) {\n return bytesToInt(bytes, 0);\n }",
"class_method_signature": "OctetUtil.bytesToInt(byte[] bytes)",
"constructor": false,
"full_signature": "public static int bytesToInt(byte[] bytes)",
"identifier": "bytesToInt",
"invocations": [
"bytes... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_21 | {
"fields": [
{
"declarator": "relativeTimeFormatter",
"modifier": "private",
"original_string": "private RelativeTimeFormatter relativeTimeFormatter;",
"type": "RelativeTimeFormatter",
"var_name": "relativeTimeFormatter"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/util/Relat... | {
"body": "@Test(groups = \"checkintest\")\n public void formatRelativeDateMonthFebruary() {\n // for Java 8, the relative time could be calculated better\n GregorianCalendar smscDate = new GregorianCalendar(TimeZone.getTimeZone(\"Pacific/Midway\"));\n smscDate.set(2015, Calendar.FEBRUARY, 1, 0, 11, 22);\n\... | {
"fields": [
{
"declarator": "utcTimeZone = TimeZone.getTimeZone(\"UTC\")",
"modifier": "private static",
"original_string": "private static TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");",
"type": "TimeZone",
"var_name": "utcTimeZone"
},
{
"declarator": "DATE_F... | {
"body": "public String format(Calendar calendar) {\n // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed\n Calendar smscCalendar = Calendar.getInstance();\n return format(calendar, smscCalendar);\n }",
"class_method_signature": "RelativeTimeFormatter.format... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_76 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/GeneralDataCodingTest.java",
"identifier": "GeneralDataCodingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGeneralAlphabetBinary() {\n DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_8_BIT);\n assertEquals(dataCoding.toByte(), (byte) 0x04);\n }",
"class_method_signature": "GeneralDataCodingTest.testGeneralAlphabetBinary()",
"constructor": false,
"full_signature... | {
"fields": [
{
"declarator": "DEFAULT = new GeneralDataCoding()",
"modifier": "public static final",
"original_string": "public static final GeneralDataCoding DEFAULT = new GeneralDataCoding();",
"type": "GeneralDataCoding",
"var_name": "DEFAULT"
},
{
"declarator": "co... | {
"body": "public byte toByte() {\n byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0;\n value |= alphabet.value();\n if (messageClass != null) {\n value |= DataCodings.MASK_CONTAIN_MESSAGE_CLASS;\n value |= messageClass.value();\n }\n return ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_37 | {
"fields": [
{
"declarator": "responseHandler",
"modifier": "private",
"original_string": "private DummyResponseHandler responseHandler;",
"type": "DummyResponseHandler",
"var_name": "responseHandler"
},
{
"declarator": "bindRequest",
"modifier": "private",
... | {
"body": "@Test(groups=\"checkintest\")\n public void testFailedReject() {\n responseHandler.closeConnection();\n try {\n bindRequest.reject(-1);\n fail(\"Should throw IOException\");\n } catch (IllegalStateException e) {\n fail(\"Should throw IOException\");\... | {
"fields": [
{
"declarator": "lock = new ReentrantLock()",
"modifier": "private final",
"original_string": "private final Lock lock = new ReentrantLock();",
"type": "Lock",
"var_name": "lock"
},
{
"declarator": "condition = lock.newCondition()",
"modifier": "priv... | {
"body": "public void reject(int errorCode) throws IllegalStateException, IOException {\n lock.lock();\n try {\n if (done) {\n throw new IllegalStateException(\"Response already initiated\");\n } else {\n done = true;\n try {\n ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_84 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/GeneralDataCodingTest.java",
"identifier": "GeneralDataCodingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGeneralAlphabetKsC5601() {\n DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_KS_C_5601);\n assertEquals(dataCoding.toByte(), (byte) 0x0e);\n }",
"class_method_signature": "GeneralDataCodingTest.testGeneralAlphabetKsC5601()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "DEFAULT = new GeneralDataCoding()",
"modifier": "public static final",
"original_string": "public static final GeneralDataCoding DEFAULT = new GeneralDataCoding();",
"type": "GeneralDataCoding",
"var_name": "DEFAULT"
},
{
"declarator": "co... | {
"body": "public byte toByte() {\n byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0;\n value |= alphabet.value();\n if (messageClass != null) {\n value |= DataCodings.MASK_CONTAIN_MESSAGE_CLASS;\n value |= messageClass.value();\n }\n return ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_51 | {
"fields": [
{
"declarator": "factory",
"modifier": "",
"original_string": "DataCodingFactory00xx factory;",
"type": "DataCodingFactory00xx",
"var_name": "factory"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/bean/DataCodingFactory00xxTest.java",
"identifier": "DataCodingFa... | {
"body": "@Test\n public void testDataCodingFactory00xxStandardAlphabet() {\n byte expected = (byte) 0x00;\n DataCoding dataCoding = factory.newInstance(expected);\n\n assertEquals(dataCoding.toByte(), expected);\n assertEquals(Alphabet.parseDataCoding(dataCoding.toByte()), Alphabet.ALPHA_DEFAULT);\n }... | {
"fields": [
{
"declarator": "GROUP = 0x00",
"modifier": "public static final",
"original_string": "public static final byte GROUP = 0x00;",
"type": "byte",
"var_name": "GROUP"
},
{
"declarator": "MASK = (byte)0xc0",
"modifier": "public static final",
"orig... | {
"body": "public DataCoding newInstance(byte dataCoding) {\n boolean compressed = isCompressed(dataCoding);\n boolean containMessageClass = DataCodings.containsMessageClass(dataCoding);\n MessageClass messageClass = null;\n if (containMessageClass) {\n // ignore Message Class i... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_47 | {
"fields": [
{
"declarator": "factory",
"modifier": "",
"original_string": "DataCodingFactory1101 factory;",
"type": "DataCodingFactory1101",
"var_name": "factory"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/bean/DataCodingFactory1101Test.java",
"identifier": "DataCodingFa... | {
"body": "@Test\n public void testDataCodingVoicemailInactive() {\n byte dataCodingByte = (byte) 0xd0;\n DataCoding dataCoding = factory.newInstance(dataCodingByte);\n assertEquals(dataCoding.getClass(), MessageWaitingDataCoding.class);\n assertEquals(IndicationSense.parseDataCoding(dataCoding.toByte())... | {
"fields": [
{
"declarator": "MASK = (byte)0xf0",
"modifier": "public static final",
"original_string": "public static final byte MASK = (byte)0xf0;",
"type": "byte",
"var_name": "MASK"
},
{
"declarator": "GROUP = (byte)0xd0",
"modifier": "public static final",
... | {
"body": "public DataCoding newInstance(byte dataCoding) {\n /*\n * Mobile shall store the text message of the SMS in addition to setting\n * indication\n */\n IndicationSense indicationSense = IndicationSense.parseDataCoding(dataCoding);\n IndicationType indicationType =... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_30 | {
"fields": [
{
"declarator": "defaultPDUReader",
"modifier": "",
"original_string": "DefaultPDUReader defaultPDUReader;",
"type": "DefaultPDUReader",
"var_name": "defaultPDUReader"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/DefaultPDUReaderTest.java",
"identifier": "Defau... | {
"body": "@Test(groups = \"checkintest\", expectedExceptions = InvalidCommandLengthException.class)\n public void testInvalidPDUHeaderWithCommandLengthZero() throws Exception {\n\n DataInputStream in = new DataInputStream(\n new ByteArrayInputStream(\n new byte[]{ 0x00, 0x00, 0x00, 0x00 }));\n ... | {
"fields": [],
"file": "jsmpp/src/main/java/org/jsmpp/DefaultPDUReader.java",
"identifier": "DefaultPDUReader",
"interfaces": "implements PDUReader",
"methods": [
{
"class_method_signature": "DefaultPDUReader.readPDUHeader(DataInputStream in)",
"constructor": false,
"full_signature": "@... | {
"body": "@Override\n public Command readPDUHeader(DataInputStream in)\n throws InvalidCommandLengthException, IOException {\n Command header = new Command();\n header.setCommandLength(in.readInt());\n\n if (header.getCommandLength() < PDU_HEADER_LENGTH) {\n // command l... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_67 | {
"fields": [
{
"declarator": "factory",
"modifier": "",
"original_string": "DataCodingFactory1110 factory;",
"type": "DataCodingFactory1110",
"var_name": "factory"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/bean/DataCodingFactory1110Test.java",
"identifier": "DataCodingFa... | {
"body": "@Test\n public void testDataCodings1110() {\n for (byte dataCodingByte = (byte) 0xd0; dataCodingByte < (byte) 0xe0; dataCodingByte++) {\n DataCoding dataCoding = factory.newInstance(dataCodingByte);\n assertEquals(dataCoding.getClass(), MessageWaitingDataCoding.class);\n // assertEquals(... | {
"fields": [
{
"declarator": "MASK = (byte)0xf0",
"modifier": "public static final",
"original_string": "public static final byte MASK = (byte)0xf0;",
"type": "byte",
"var_name": "MASK"
},
{
"declarator": "GROUP = (byte)0xe0",
"modifier": "public static final",
... | {
"body": "public DataCoding newInstance(byte dataCoding) {\n // it's uncompressed UCS2\n IndicationSense indicationSense = IndicationSense.parseDataCoding(dataCoding);\n IndicationType indicationType = IndicationType.parseDataCoding(dataCoding);\n return new MessageWaitingDataCoding(indic... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_88 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/GeneralDataCodingTest.java",
"identifier": "GeneralDataCodingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGeneralTeSpecific() {\n DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_DEFAULT, MessageClass.CLASS3, false);\n assertEquals(dataCoding.toByte(), (byte) 0x13);\n }",
"class_method_signature": "GeneralDataCodingTest.testGeneralTeSpecific()",
"constructor": fa... | {
"fields": [
{
"declarator": "DEFAULT = new GeneralDataCoding()",
"modifier": "public static final",
"original_string": "public static final GeneralDataCoding DEFAULT = new GeneralDataCoding();",
"type": "GeneralDataCoding",
"var_name": "DEFAULT"
},
{
"declarator": "co... | {
"body": "public byte toByte() {\n byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0;\n value |= alphabet.value();\n if (messageClass != null) {\n value |= DataCodings.MASK_CONTAIN_MESSAGE_CLASS;\n value |= messageClass.value();\n }\n return ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_26 | {
"fields": [
{
"declarator": "relativeTimeFormatter",
"modifier": "private",
"original_string": "private RelativeTimeFormatter relativeTimeFormatter;",
"type": "RelativeTimeFormatter",
"var_name": "relativeTimeFormatter"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/util/Relat... | {
"body": "@Test(groups = \"checkintest\")\n public void formatRelativeTimeMonth() {\n GregorianCalendar smscDate = new GregorianCalendar(TimeZone.getTimeZone(\"America/Denver\"));\n smscDate.set(2001, Calendar.JANUARY, 31, 14, 15, 16);\n\n GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZone... | {
"fields": [
{
"declarator": "utcTimeZone = TimeZone.getTimeZone(\"UTC\")",
"modifier": "private static",
"original_string": "private static TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");",
"type": "TimeZone",
"var_name": "utcTimeZone"
},
{
"declarator": "DATE_F... | {
"body": "public String format(Calendar calendar) {\n // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed\n Calendar smscCalendar = Calendar.getInstance();\n return format(calendar, smscCalendar);\n }",
"class_method_signature": "RelativeTimeFormatter.format... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_0 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/util/StringValidatorTest.java",
"identifier": "StringValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(groups=\"checkintest\")\n public void testValidation() {\n try {\n StringValidator.validateString(\"\", StringParameter.SYSTEM_ID);\n } catch (PDUStringException e) {\n fail(\"Should be okay inserting empty string\");\n }\n \n try {\n ... | {
"fields": [
{
"declarator": "ACTUAL_LENGTH_IS = \". Actual length is \"",
"modifier": "private static final",
"original_string": "private static final String ACTUAL_LENGTH_IS = \". Actual length is \";",
"type": "String",
"var_name": "ACTUAL_LENGTH_IS"
},
{
"declarato... | {
"body": "public static void validateString(String value, StringParameter param)\n throws PDUStringException {\n if (param.getType() == StringType.C_OCTET_STRING) {\n if (param.isRangeMinAndMax()) {\n if (!isCOctetStringValid(value, param.getMax())) {\n ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_1 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/util/StringValidatorTest.java",
"identifier": "StringValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(groups=\"checkintest\")\n public void validateStringOctetStringWithString() throws Exception {\n StringValidator.validateString(\"\", StringParameter.SHORT_MESSAGE);\n StringValidator.validateString(\"short messages\", StringParameter.SHORT_MESSAGE);\n String shortMessage = \"... | {
"fields": [
{
"declarator": "ACTUAL_LENGTH_IS = \". Actual length is \"",
"modifier": "private static final",
"original_string": "private static final String ACTUAL_LENGTH_IS = \". Actual length is \";",
"type": "String",
"var_name": "ACTUAL_LENGTH_IS"
},
{
"declarato... | {
"body": "public static void validateString(String value, StringParameter param)\n throws PDUStringException {\n if (param.getType() == StringType.C_OCTET_STRING) {\n if (param.isRangeMinAndMax()) {\n if (!isCOctetStringValid(value, param.getMax())) {\n ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_27 | {
"fields": [
{
"declarator": "relativeTimeFormatter",
"modifier": "private",
"original_string": "private RelativeTimeFormatter relativeTimeFormatter;",
"type": "RelativeTimeFormatter",
"var_name": "relativeTimeFormatter"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/util/Relat... | {
"body": "@Test(groups = \"checkintest\")\n public void formatRelativeDateNewYear() {\n GregorianCalendar smscDate = new GregorianCalendar(TimeZone.getTimeZone(\"America/Denver\"));\n smscDate.set(2001, Calendar.DECEMBER, 31, 23, 59, 59);\n\n GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZ... | {
"fields": [
{
"declarator": "utcTimeZone = TimeZone.getTimeZone(\"UTC\")",
"modifier": "private static",
"original_string": "private static TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");",
"type": "TimeZone",
"var_name": "utcTimeZone"
},
{
"declarator": "DATE_F... | {
"body": "public String format(Calendar calendar) {\n // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed\n Calendar smscCalendar = Calendar.getInstance();\n return format(calendar, smscCalendar);\n }",
"class_method_signature": "RelativeTimeFormatter.format... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_66 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/DeliverSmTest.java",
"identifier": "DeliverSmTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDeliverSm() {\n DeliverSm deliverSm = new DeliverSm();\n deliverSm.sourceAddr = \"31612345678\";\n deliverSm.sourceAddrTon = TypeOfNumber.INTERNATIONAL.value();\n deliverSm.sourceAddrNpi = NumberingPlanIndicator.ISDN.value();\n deliverSm.destAddress = \"33600000000\"... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
}
],
"file": "jsmpp/src/main/java/org/jsmpp/bean/DeliverSm.java",
"identifier": "DeliverSm",
"interfaces": "",
"methods": [
{
... | {
"body": "public DeliverSm() {\n\t\tsuper();\n\t}",
"class_method_signature": "DeliverSm.DeliverSm()",
"constructor": true,
"full_signature": "public DeliverSm()",
"identifier": "DeliverSm",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DeliverSm()",
... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_89 | {
"fields": [],
"file": "jsmpp/src/test/java/org/jsmpp/bean/LongSMSTest.java",
"identifier": "LongSMSTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSplitMessage8Bit() throws Exception {\n\n final String message = \"Test sms gateway long smss, Test sms gateway long smss, Test sms gateway long smss, Test sms gateway long smss, Test sms gateway long smss, Test sms gateway long smss, Test sms gateway long smss, Test sms gateway... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LongSMS.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(LongSMS.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarato... | {
"body": "public static byte[][] splitMessage8Bit(byte[] aMessage) {\n // determine how many messages\n int segmentNum = aMessage.length / MAX_MESSAGE_SEGMENT_8BIT;\n int messageLength = aMessage.length;\n if (segmentNum > 255) {\n // this is too long, can't fit, so chop\n ... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_31 | {
"fields": [
{
"declarator": "defaultPDUReader",
"modifier": "",
"original_string": "DefaultPDUReader defaultPDUReader;",
"type": "DefaultPDUReader",
"var_name": "defaultPDUReader"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/DefaultPDUReaderTest.java",
"identifier": "Defau... | {
"body": "@Test(groups = \"checkintest\", expectedExceptions = InvalidCommandLengthException.class)\n public void testInvalidPDUHeaderWithCommandLengthFour() throws Exception {\n\n DataInputStream in = new DataInputStream(\n new ByteArrayInputStream(\n new byte[]{ 0x00, 0x00, 0x00, 0x04 }));\n\... | {
"fields": [],
"file": "jsmpp/src/main/java/org/jsmpp/DefaultPDUReader.java",
"identifier": "DefaultPDUReader",
"interfaces": "implements PDUReader",
"methods": [
{
"class_method_signature": "DefaultPDUReader.readPDUHeader(DataInputStream in)",
"constructor": false,
"full_signature": "@... | {
"body": "@Override\n public Command readPDUHeader(DataInputStream in)\n throws InvalidCommandLengthException, IOException {\n Command header = new Command();\n header.setCommandLength(in.readInt());\n\n if (header.getCommandLength() < PDU_HEADER_LENGTH) {\n // command l... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_46 | {
"fields": [
{
"declarator": "factory",
"modifier": "",
"original_string": "DataCodingFactory1101 factory;",
"type": "DataCodingFactory1101",
"var_name": "factory"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/bean/DataCodingFactory1101Test.java",
"identifier": "DataCodingFa... | {
"body": "@Test\n public void testDataCodings1101() {\n for (byte dataCodingByte = (byte) 0xd0; dataCodingByte < (byte) 0xe0; dataCodingByte++) {\n DataCoding dataCoding = factory.newInstance(dataCodingByte);\n assertEquals(dataCoding.getClass(), MessageWaitingDataCoding.class);\n // assertEquals(... | {
"fields": [
{
"declarator": "MASK = (byte)0xf0",
"modifier": "public static final",
"original_string": "public static final byte MASK = (byte)0xf0;",
"type": "byte",
"var_name": "MASK"
},
{
"declarator": "GROUP = (byte)0xd0",
"modifier": "public static final",
... | {
"body": "public DataCoding newInstance(byte dataCoding) {\n /*\n * Mobile shall store the text message of the SMS in addition to setting\n * indication\n */\n IndicationSense indicationSense = IndicationSense.parseDataCoding(dataCoding);\n IndicationType indicationType =... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_11 | {
"fields": [
{
"declarator": "CHARSET_US_ASCII = Charset.forName(\"US-ASCII\")",
"modifier": "private final static",
"original_string": "private final static Charset CHARSET_US_ASCII = Charset.forName(\"US-ASCII\");",
"type": "Charset",
"var_name": "CHARSET_US_ASCII"
},
{
... | {
"body": "@Test\n public void decompose_submit_sm() throws Exception {\n ByteArrayOutputStream data = new ByteArrayOutputStream();\n // command_length\n data.write(new byte[]{ 0x00, 0x00, 0x00, 0x46 });\n // command_id\n data.write(new byte[]{ 0x00, 0x00, 0x00, 0x04 });\n // command_status\n da... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DefaultDecomposer.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(DefaultDecomposer.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "public SubmitSm submitSm(byte[] b) throws PDUStringException {\n SubmitSm req = new SubmitSm();\n SequentialBytesReader reader = new SequentialBytesReader(b);\n assignHeader(req, reader);\n req.setServiceType(reader.readCString());\n StringValidator.validateString(req.get... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
28858344_50 | {
"fields": [
{
"declarator": "factory",
"modifier": "",
"original_string": "DataCodingFactory00xx factory;",
"type": "DataCodingFactory00xx",
"var_name": "factory"
}
],
"file": "jsmpp/src/test/java/org/jsmpp/bean/DataCodingFactory00xxTest.java",
"identifier": "DataCodingFa... | {
"body": "@Test\n public void testDataCodings00xx() {\n for (byte dataCodingByte = (byte) 0x00; dataCodingByte < (byte) 0xf0; dataCodingByte++) {\n DataCoding dataCoding = factory.newInstance(dataCodingByte);\n assertEquals(dataCoding.toByte(), dataCodingByte);\n assertEquals(dataCoding.getClass()... | {
"fields": [
{
"declarator": "GROUP = 0x00",
"modifier": "public static final",
"original_string": "public static final byte GROUP = 0x00;",
"type": "byte",
"var_name": "GROUP"
},
{
"declarator": "MASK = (byte)0xc0",
"modifier": "public static final",
"orig... | {
"body": "public DataCoding newInstance(byte dataCoding) {\n boolean compressed = isCompressed(dataCoding);\n boolean containMessageClass = DataCodings.containsMessageClass(dataCoding);\n MessageClass messageClass = null;\n if (containMessageClass) {\n // ignore Message Class i... | {
"created": "1/6/2015 10:29:43 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 28858344,
"size": null,
"stargazer_count": null,
"stars": 106,
"updates": "2020-01-19T23:01:52+00:00",
"url": "https://github.com/opentelecoms-org... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.