id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47536480_118 | {
"fields": [
{
"declarator": "originalCharset",
"modifier": "static",
"original_string": "static String originalCharset;",
"type": "String",
"var_name": "originalCharset"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/upload/BlockRecordReaderTest.java",
... | {
"body": "@Test\n public void testRDConflictWithBom() throws Exception {\n\n // file content\n // bom head is consumed by bom detected, only 1 line in block\n {\n BlockInfo blockInfo = new BlockInfo(1L, new File(\"src/test/resources/file/reader/more_char_split_chinese_bom.txt\"), 0L, 54L);\n Bloc... | {
"fields": [
{
"declarator": "fieldDelimiter",
"modifier": "private",
"original_string": "private byte[] fieldDelimiter;",
"type": "byte[]",
"var_name": "fieldDelimiter"
},
{
"declarator": "recordDelimiter",
"modifier": "private",
"original_string": "privat... | {
"body": "public byte[][] readTextRecord() throws IOException {\n if (isLastLine) {\n return null;\n }\n currentLine = readLine();\n isLastLine = startPos + readBytes > blockInfo.getStartPos() + blockInfo.getLength();\n return splitLine(currentLine);\n }",
"class_method_signature": "BlockRecor... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_93 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOnLineModelNoModel() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc onlinemodel -p prj \";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleConstants.BAD_... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\", \"onlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\... | {
"body": "public static DescribeOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_50 | {
"fields": [
{
"declarator": "VOLUME_NAME = \"test_volume\"",
"modifier": "public static",
"original_string": "public static String VOLUME_NAME = \"test_volume\";",
"type": "String",
"var_name": "VOLUME_NAME"
},
{
"declarator": "odps",
"modifier": "private static... | {
"body": "@Test\n public void testAddResourceCommandParser() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"add archive file.zip /home/admin/alisatasknode/taskinfo//20150421/phoenix/201504... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n /*\n * !HACK: filter ADD <object type> <object name> TO PACKAGE <package name>\n * [WITH PRIVILEGES privileges];\n */\n if (isSecurityCommand(commandStrin... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_122 | {
"fields": [
{
"declarator": "gmt = TimeZone.getTimeZone(\"GMT+8\")",
"modifier": "",
"original_string": "TimeZone gmt = TimeZone.getTimeZone(\"GMT+8\");",
"type": "TimeZone",
"var_name": "gmt"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/common/Record... | {
"body": "@Test\n public void testBigint()throws Exception{\n TableSchema rs = new TableSchema();\n rs.addColumn(new Column(\"i1\", OdpsType.BIGINT));\n rs.addColumn(new Column(\"i2\", OdpsType.BIGINT));\n \n String[] l = new String[] {\"9223372036854775807\", \"-9223372036854775807\"};\n RecordCo... | {
"fields": [
{
"declarator": "ZEROS = \"000000000\"",
"modifier": "private static final",
"original_string": "private static final String ZEROS = \"000000000\";",
"type": "String",
"var_name": "ZEROS"
},
{
"declarator": "nullBytes",
"modifier": "private final",
... | {
"body": "public Record parse(byte[][] line) throws ParseException, UnsupportedEncodingException {\n\n if (line == null) {\n return null;\n }\n int cols = schema.getColumns().size();\n\n if (isStrictSchema && line.length != cols) {\n throw new ParseException(Constants.ERROR_INDICATOR + \"column... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_9 | {
"fields": [
{
"declarator": "createCommands = {\n \"crEate ExternalProject -name test1 -ref ref1 -nn \\\"11.12.13.14:3335,12.33.33.45:3829\\\" -hms \\\"1.1.1.1:8339\\\" -db default\",\n \"create ExternalProject -name test1 -comment test -ref ref1 -nn \\\"11.12.13.14:3335,12.33.33.45:3829... | {
"body": "@Test\n public void testNotExternalCommand() throws Exception {\n for (String cmd: nullCommands) {\n Assert.assertNull(ExternalProjectCommand.parse(cmd, ExecutionContext.init()));\n }\n }",
"class_method_signature": "ExternalProjectCommandTest.testNotExternalCommand()",
"constructor": fals... | {
"fields": [
{
"declarator": "NAME_OPTION = \"name\"",
"modifier": "private static final",
"original_string": "private static final String NAME_OPTION = \"name\";",
"type": "String",
"var_name": "NAME_OPTION"
},
{
"declarator": "COMMENT_OPTION = \"comment\"",
"mo... | {
"body": "public static AbstractCommand parse(String cmd, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n }\n\n String actionName = m.group(1);\n String input = m.gro... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_11 | {
"fields": [],
"file": "odps-console-basic/src/test/java/com/aliyun/openservices/odps/console/commands/UnSetCommandTest.java",
"identifier": "UnSetCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void negativeTest() throws ODPSConsoleException, OdpsException {\n UnSetCommand cmd = UnSetCommand.parse(\"unse testkey\", null);\n assertNull(cmd);\n\n cmd = UnSetCommand.parse(\"unset \", null);\n assertNull(cmd);\n\n cmd = UnSetCommand.parse(\"unalia testkey\\n\", null);\n... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"unset\", \"unalias\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"unset\", \"unalias\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
},
{
"de... | {
"body": "public static UnSetCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n if (StringUtils.isNullOrEmpty(commandString)) {\n return null;\n }\n\n String[] tokens = new AntlrObject(commandString).getTokenStringArray();\n\n if (tokens.len... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_46 | {
"fields": [
{
"declarator": "positive =\n {\"top instance \", \"toP instance \", \"TOP INSTANCE \", \"top instance -d\", \"top instance -d 10\",\n \"top instance -limit 2\", \"top instance -all\", \"top instance -p tt\",\n \"top instance -status running\",\n \"top instance -d -all -... | {
"body": "@Test\n public void testRun() throws OdpsException, ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n TopInstanceCommand test = TopInstanceCommand.parse(positive[0], ctx);\n test.run();\n }",
"class_method_signature": "TopInstanceCommandTest.testRun()",
"constructor"... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"top\", \"instance\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"top\", \"instance\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
},
{
"decl... | {
"body": "public void run() throws OdpsException, ODPSConsoleException {\n Odps odps = getCurrentOdps();\n if ((delay != null) && InPlaceUpdates.isUnixTerminal()) {\n autoRefreshQueue(odps);\n } else {\n printQueue(getQueue(odps));\n }\n }",
"class_method_signature": "TopInstanceCommand.run(... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_47 | {
"fields": [],
"file": "odps-console-resource/src/test/java/com/aliyun/openservices/odps/console/resource/GetResourceCommandTest.java",
"identifier": "GetResourceCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMultiSpaceAfterResourceName() throws ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n GetResourceCommand cmd = GetResourceCommand.parse(\"get resource foo ./bar\", ctx);\n Assert.assertEquals(cmd.resourceName, \"foo\");\n\n cmd = GetResourceCo... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"get\", \"resource\", \"download\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"get\", \"resource\", \"download\"};",
"type": "String[]",
"var_name": "HELP_TA... | {
"body": "public static GetResourceCommand parse(String cmd, ExecutionContext ctx) throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n \n Matcher prefix = PATTERN_PREFIX.matcher(cmd);\n \n boolean match = prefix.matches();\n\n if (!match) {\n return n... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_10 | {
"fields": [
{
"declarator": "createCommands = {\n \"crEate ExternalProject -name test1 -ref ref1 -nn \\\"11.12.13.14:3335,12.33.33.45:3829\\\" -hms \\\"1.1.1.1:8339\\\" -db default\",\n \"create ExternalProject -name test1 -comment test -ref ref1 -nn \\\"11.12.13.14:3335,12.33.33.45:3829... | {
"body": "@Test\n public void testInvalidCommand() {\n for (Map.Entry<String,String> cmd: invalidCommands.entrySet()) {\n try {\n ExternalProjectCommand.parse(cmd.getKey(), ExecutionContext.init());\n Assert.fail(\"Exception expected for command: \" + cmd.getKey());\n } catch (IllegalArgu... | {
"fields": [
{
"declarator": "NAME_OPTION = \"name\"",
"modifier": "private static final",
"original_string": "private static final String NAME_OPTION = \"name\";",
"type": "String",
"var_name": "NAME_OPTION"
},
{
"declarator": "COMMENT_OPTION = \"comment\"",
"mo... | {
"body": "public static AbstractCommand parse(String cmd, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n }\n\n String actionName = m.group(1);\n String input = m.gro... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_8 | {
"fields": [
{
"declarator": "positive = {\"alter\\t table \\rtbl_name compact major \\n \", \"alter\\t\\r\\n table tbl_name partition (dt='s') compact minor\"}",
"modifier": "private",
"original_string": "private String [] positive = {\"alter\\t table \\rtbl_name compact major \\n \", \... | {
"body": "@Test\n public void test() throws Exception {\n CompactCommand compactCommand = null;\n ExecutionContext context = ExecutionContext.init();\n\n for (String cmd : positive) {\n compactCommand = CompactCommand.parse(cmd, context);\n assertNotNull(compactCommand);\n }\n\n int errorCo... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"merge\", \"table\", \"alter\", \"compact\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"merge\", \"table\", \"alter\", \"compact\"};",
"type":... | {
"body": "public static CompactCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n String regstr = \"\\\\s*ALTER\\\\s+TABLE\\\\s+(.*)\\\\s+COMPACT\\\\s+(.*)\";\n\n Pattern p = Pattern.compile(regstr, Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(c... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_51 | {
"fields": [
{
"declarator": "VOLUME_NAME = \"test_volume\"",
"modifier": "public static",
"original_string": "public static String VOLUME_NAME = \"test_volume\";",
"type": "String",
"var_name": "VOLUME_NAME"
},
{
"declarator": "odps",
"modifier": "private static... | {
"body": "@Test\n public void testAddResourceVolumeArchive() throws ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n String commandText = null;\n AddResourceCommand command;\n\n commandText = \"add volumearchive /volumename/a/b.zip as file.zip\";\n // A warning will be o... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"add\", \"create\", \"resource\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
... | {
"body": "public static AddResourceCommand parse(String commandString, ExecutionContext sessionContext)\n throws ODPSConsoleException {\n\n /*\n * !HACK: filter ADD <object type> <object name> TO PACKAGE <package name>\n * [WITH PRIVILEGES privileges];\n */\n if (isSecurityCommand(commandStrin... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_123 | {
"fields": [],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/common/UtilTest.java",
"identifier": "UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetSessionBaseDir() {\n String path = Util.getSessionBaseDir();\n System.err.println(path);\n String sessionDir = path + \"/custom_session_dir\" + System.currentTimeMillis();\n DshipContext.INSTANCE.put(Constants.SESSION_DIR, sessionDir);\n assertEquals(\"custom_sess... | {
"fields": [],
"file": "odps-console-dship/src/main/java/com/aliyun/odps/ship/common/Util.java",
"identifier": "Util",
"interfaces": "",
"methods": [
{
"class_method_signature": "Util.getRootDir()",
"constructor": false,
"full_signature": "private static String getRootDir()",
"ide... | {
"body": "public static String getSessionBaseDir() throws IllegalArgumentException {\n\n String basePath = getAbsRootDir();\n\n if (DshipContext.INSTANCE.get(Constants.SESSION_DIR) != null) {\n try {\n basePath = URLDecoder.decode(DshipContext.INSTANCE.get(Constants.SESSION_DIR), \"UTF-8\");\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_92 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOnLineModelConflictPrjName() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc onlinemodel -p prj1 prj2.model\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSCo... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\", \"onlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"online\", \"model\... | {
"body": "public static DescribeOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_84 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testDescribeOffLineModelNoModel() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"desc offlinemodel -p prj \";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleConstants.BA... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[]\n HELP_TAGS =\n new String[]{\"describe\", \"desc\", \"offline\", \"mod... | {
"body": "public static DescribeOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_119 | {
"fields": [],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/DShipCommandTest.java",
"identifier": "DShipCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHelpCommand() throws OdpsException, ODPSConsoleException {\n ExecutionContext context = ExecutionContext.init();\n DShipCommand command = DShipCommand.parse(\"tunnel help upload\", context);\n String result = ODPSConsoleUtils.runCommand(command);\n System.out.println(re... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"tunnel\", \"dship\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"tunnel\", \"dship\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
}
],
"file": "od... | {
"body": "public static DShipCommand parse(String commandString, ExecutionContext sessionContext) {\n String readCommandString = commandString;\n if (\"TUNNEL\".equalsIgnoreCase(readCommandString.trim()) ||\n readCommandString.toUpperCase().matches(\"\\\\s*TUNNEL\\\\s+.*\")) {\n readCommandString =... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_4 | {
"fields": [
{
"declarator": "positive = {\"history\", \" HistoRY\", \"HISTORY\", \"\\t\\rhistory \\n\"}",
"modifier": "private",
"original_string": "private String [] positive = {\"history\", \" HistoRY\", \"HISTORY\", \"\\t\\rhistory \\n\"};",
"type": "String []",
"var_name": "pos... | {
"body": "@Test\n public void test() throws Exception {\n HistoryCommand historyCommand = null;\n ExecutionContext context = ExecutionContext.init();\n\n for (String cmd : positive) {\n historyCommand = HistoryCommand.parse(cmd, context);\n assertNotNull(historyCommand);\n }\n\n for (String... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"history\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"history\"};",
"type": "String[]",
"var_name": "HELP_TAGS"
}
],
"file": "odps-console-basic/src... | {
"body": "public static HistoryCommand parse(String cmd, ExecutionContext cxt) {\n if (cmd == null || cxt == null || ODPSConsoleUtils.isWindows()) {\n return null;\n }\n\n if (\"history\".equalsIgnoreCase(cmd.trim())) {\n return new HistoryCommand(cmd.trim(), cxt);\n }\n\n return null;\n }"... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_26 | {
"fields": [
{
"declarator": "positives = {\" SHOW PARTITIONS projectname.tablename\",\n \"\\r\\t\\nShoW\\t\\rPartitions\\n\\tprojectname.tablename\\r\\t\\n\",\n \" LS PARTITIONS projectname.tablename\",\n ... | {
"body": "@Test\n public void testNegative() throws ODPSConsoleException {\n ExecutionContext ctx = ExecutionContext.init();\n for (String cmd : negatives) {\n assertNull(ShowPartitionsCommand.parse(cmd, ctx));\n }\n }",
"class_method_signature": "ShowPartitionsCommandTest.testNegative()",
"const... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"partition\", \"partitions\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"show\", \"list\", \"ls\", \"partition\", \"partitions\"};",
"t... | {
"body": "public static ShowPartitionsCommand parse(String cmd, ExecutionContext cxt)\n throws ODPSConsoleException {\n if (cmd == null || cxt == null) {\n return null;\n }\n\n ShowPartitionsCommand r = null;\n\n Matcher m = PATTERN.matcher(cmd);\n Matcher pubMatcher = PUBLIC_PATTERN.matcher... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_71 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testCreateOfflineModelWithType() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"create offlinemodel t_offlinemodel \" +\n \"-modelPath oss://bucket/dir/?role_arn=xxx&host=yyy \" +\n \"-type... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"create\", \"offline\", \"model\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"create\", \"offline\", \"model\", \"offlinemodel\"};",
"type": "Str... | {
"body": "public static CreateOfflineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OfflineModelInfo modelInfo = CreateOfflineModelCommand.buildOfflineModelInfo(cmd, PATTERN, ctx);\n\n if (modelIn... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_103 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testShowOffLineModelsInvalidFilter() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"show offlinemodels prefix-error\";\n expectEx.expect(ODPSConsoleException.class);\n expectEx.expectMessage(ODPSConsoleCon... | {
"fields": [
{
"declarator": "HELP_TAGS =\n new String[]{\"show\", \"offline\", \"model\", \"offlinemodels\", \"offlinemodel\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS =\n new String[]{\"show\", \"offline\", \"model\", \"offlinem... | {
"body": "public static ShowOfflineModelsCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n Matcher matcher = PATTERN.matcher(cmd);\n\n if (!matcher.matches()) {\n return null;\n }\n\n String inpu... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_88 | {
"fields": [
{
"declarator": "expectEx = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectEx = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectEx"
}
],
"file": "odps-console-xflo... | {
"body": "@Test\n public void testUpdateOnLineModelParameterError2() throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n String cmd = \"update onlinemodel -p prj1 model1 \" +\n \"-target target1 \" +\n \"-libName lib1 \" +\n \"-... | {
"fields": [
{
"declarator": "HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"}",
"modifier": "public static final",
"original_string": "public static final String[] HELP_TAGS = new String[]{\"update\", \"model\", \"onlinemodel\", \"online\"};",
"type": "String[... | {
"body": "public static UpdateOnlineModelCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n OnlineModelInfo modelInfo = CreateOnlineModelCommand.buildOnlineModelInfo(cmd, PATTERN, ctx);\n if (modelInfo == nu... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_115 | {
"fields": [
{
"declarator": "originalCharset",
"modifier": "static",
"original_string": "static String originalCharset;",
"type": "String",
"var_name": "originalCharset"
}
],
"file": "odps-console-dship/src/test/java/com/aliyun/odps/ship/upload/BlockRecordReaderTest.java",
... | {
"body": "@Test\n public void testReadMultiBlocksWithMoreCharSplit() throws Exception {\n\n // file content :\n // 123||abc,,,234||bbb,,,333||ccc,,,\n // first block, read 2 record\n {\n BlockInfo blockInfo = new BlockInfo(1L, new File(\"src/test/resources/file/reader/more_char_split.txt\"), 0L, 16... | {
"fields": [
{
"declarator": "fieldDelimiter",
"modifier": "private",
"original_string": "private byte[] fieldDelimiter;",
"type": "byte[]",
"var_name": "fieldDelimiter"
},
{
"declarator": "recordDelimiter",
"modifier": "private",
"original_string": "privat... | {
"body": "public byte[][] readTextRecord() throws IOException {\n if (isLastLine) {\n return null;\n }\n currentLine = readLine();\n isLastLine = startPos + readBytes > blockInfo.getStartPos() + blockInfo.getLength();\n return splitLine(currentLine);\n }",
"class_method_signature": "BlockRecor... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_67 | {
"fields": [
{
"declarator": "context",
"modifier": "private static",
"original_string": "private static ExecutionContext context;",
"type": "ExecutionContext",
"var_name": "context"
},
{
"declarator": "odps",
"modifier": "private static",
"original_string"... | {
"body": "@Test\n public void postive() throws ODPSConsoleException, OdpsException {\n for (String cmd : positives) {\n cmd = cmd.replaceAll(\"\\\\*\", odps.getDefaultProject());\n System.out.println(cmd);\n AbstractCommand command = DescribeResourceCommand.parse(cmd, context);\n assertTrue(c... | {
"fields": [
{
"declarator": "projectName",
"modifier": "private",
"original_string": "private String projectName;",
"type": "String",
"var_name": "projectName"
},
{
"declarator": "resourceName",
"modifier": "private",
"original_string": "private String res... | {
"body": "public static DescribeResourceCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n\n if (cmd == null || ctx == null) {\n return null;\n }\n\n Matcher m = PATTERN.matcher(cmd);\n boolean match = m.matches();\n\n if (!match) {\n return null;\n }\n... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
47536480_30 | {
"fields": [],
"file": "odps-console-public/src/test/java/com/aliyun/openservices/odps/console/pub/DescribeProjectCommandTest.java",
"identifier": "DescribeProjectCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDescribeProjectExtendedCommand()\n throws ODPSConsoleException, OdpsException {\n ExecutionContext context = ExecutionContext.init();\n Odps odps = OdpsConnectionFactory.createOdps(context);\n AbstractCommand\n command =\n DescribeProjectCommand.parse(\"... | {
"fields": [
{
"declarator": "projectName",
"modifier": "private final",
"original_string": "private final String projectName;",
"type": "String",
"var_name": "projectName"
},
{
"declarator": "extended",
"modifier": "private",
"original_string": "private bo... | {
"body": "public static AbstractCommand parse(String cmd, ExecutionContext ctx)\n throws ODPSConsoleException {\n if (cmd == null || ctx == null) {\n return null;\n }\n\n String[] tokens = new AntlrObject(cmd).getTokenStringArray();\n\n if (tokens.length < 2) {\n return null;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 47536480,
"size": 16942,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/aliyun/aliyun-odps-console"
} |
158213242_1 | {
"fields": [],
"file": "ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleViewEngineTest.java",
"identifier": "PebbleViewEngineTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSupportOnlyFilesWithExtensionPeb() {\n PebbleViewEngine engine = new PebbleViewEngine(null);\n\n assertTrue(engine.supports(\"view.peb\"));\n assertFalse(engine.supports(\"view.txt\"));\n }",
"class_method_signature": "PebbleViewEngineTest.shouldSuppor... | {
"fields": [
{
"declarator": "pebbleEngine",
"modifier": "private",
"original_string": "private PebbleEngine pebbleEngine;",
"type": "PebbleEngine",
"var_name": "pebbleEngine"
}
],
"file": "ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleViewEngine.java",
"iden... | {
"body": "@Override\n public boolean supports(String view) {\n return view.endsWith(\".peb\");\n }",
"class_method_signature": "PebbleViewEngine.supports(String view)",
"constructor": false,
"full_signature": "@Override public boolean supports(String view)",
"identifier": "supports",
"invocati... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_61 | {
"fields": [],
"file": "core/src/test/java/org/eclipse/krazo/core/ViewableWriterTest.java",
"identifier": "ViewableWriterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsWriteable() {\n ViewableWriter writer = new ViewableWriter();\n assertFalse(writer.isWriteable(null, null, new Annotation[] {}, MediaType.WILDCARD_TYPE));\n assertTrue(writer.isWriteable(Viewable.class, null, new Annotation[] {}, MediaType.WILDCARD_TYPE));\... | {
"fields": [
{
"declarator": "modelsInstance",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private Instance<Models> modelsInstance;",
"type": "Instance<Models>",
"var_name": "modelsInstance"
},
{
"declarator": "injectedRequest",
"modifier... | {
"body": "@Override\n public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType) {\n return aClass == Viewable.class;\n }",
"class_method_signature": "ViewableWriter.isWriteable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType)",
"c... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_20 | {
"fields": [],
"file": "core/src/test/java/org/eclipse/krazo/util/CdiUtilsTest.java",
"identifier": "CdiUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNewBean() throws Exception {\n CdiUtils utils = new CdiUtils();\n\n Field bmField = utils.getClass().getDeclaredField(\"beanManager\");\n bmField.setAccessible(true);\n BeanManager bm = EasyMock.createMock(BeanManager.class);\n bmField.set(utils... | {
"fields": [
{
"declarator": "beanManager",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private BeanManager beanManager;",
"type": "BeanManager",
"var_name": "beanManager"
}
],
"file": "core/src/main/java/org/eclipse/krazo/util/CdiUtils.java",
"ide... | {
"body": "public <T> T newBean(Class<T> clazz) {\n return newBean(beanManager, clazz);\n }",
"class_method_signature": "CdiUtils.newBean(Class<T> clazz)",
"constructor": false,
"full_signature": "public T newBean(Class<T> clazz)",
"identifier": "newBean",
"invocations": [
"newBean"
],
"mo... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_57 | {
"fields": [],
"file": "core/src/test/java/org/eclipse/krazo/servlet/KrazoServletContextListenerTest.java",
"identifier": "KrazoServletContextListenerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void failIfControllerIsNoCdiBean() {\n\n BeanManager beanManager = createMock(BeanManager.class);\n ServletContextEvent event = createMock(ServletContextEvent.class);\n ServletContext context = createMock(ServletContext.class... | {
"fields": [
{
"declarator": "log = Logger.getLogger(KrazoServletContextListener.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.getLogger(KrazoServletContextListener.class.getName());",
"type": "Logger",
"var_name"... | {
"body": "@Override\n public void contextInitialized(ServletContextEvent sce) {\n\n ServletContext servletContext = sce.getServletContext();\n Set<Class<?>> controllerClasses = (Set<Class<?>>) servletContext.getAttribute(CONTROLLER_CLASSES);\n\n if (controllerClasses == null || controllerClas... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_41 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private DefaultFormEntityProvider underTest;",
"type": "DefaultFormEntityProvider",
"var_name": "underTest"
},
{
"declarator": "context",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testEmptyValue() throws IOException {\n EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream(\"foo=\".getBytes()));\n EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLICATION_FORM_URLENCODED_TYPE);\n context.setEntityStream... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = \"UTF-8\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CHARSET = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET"
}
],
"file": "core/src/main/java/org/eclipse/krazo/s... | {
"body": "@Override\n public Form getForm(ContainerRequestContext context) throws IOException {\n final InputStream is = context.getEntityStream();\n\n // Ensure stream can be restored for next interceptor\n InputStream bufferedStream;\n if (is.markSupported()) {\n bufferedS... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_40 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private DefaultFormEntityProvider underTest;",
"type": "DefaultFormEntityProvider",
"var_name": "underTest"
},
{
"declarator": "context",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testMultipleParamValues() throws IOException {\n EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream(\"foo=bar&foo=baz\".getBytes()));\n EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLICATION_FORM_URLENCODED_TYPE);\n con... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = \"UTF-8\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CHARSET = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET"
}
],
"file": "core/src/main/java/org/eclipse/krazo/s... | {
"body": "@Override\n public Form getForm(ContainerRequestContext context) throws IOException {\n final InputStream is = context.getEntityStream();\n\n // Ensure stream can be restored for next interceptor\n InputStream bufferedStream;\n if (is.markSupported()) {\n bufferedS... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_21 | {
"fields": [],
"file": "core/src/test/java/org/eclipse/krazo/util/BeanUtilsTest.java",
"identifier": "BeanUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldFindFieldsAndAccessors() {\n List<AnnotatedElement> fieldsAndAccessors = BeanUtils.getFieldsAndAccessors(SomeBean.class);\n assertThat(fieldsAndAccessors.size(), is(3));\n fieldsAndAccessors.forEach(fieldsAndAccessor ->\n assertThat(fieldsAndAcce... | {
"fields": [],
"file": "core/src/main/java/org/eclipse/krazo/util/BeanUtils.java",
"identifier": "BeanUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "BeanUtils.BeanUtils()",
"constructor": true,
"full_signature": "private BeanUtils()",
"identifier": "BeanUtils... | {
"body": "public static List<AnnotatedElement> getFieldsAndAccessors(Class<?> clazz) {\n final List<AnnotatedElement> properties = Arrays.stream(clazz.getDeclaredFields()).filter(f -> !f.isSynthetic()).collect(Collectors.toCollection(ArrayList::new));\n try {\n Arrays.asList(Introspector.get... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_60 | {
"fields": [
{
"declarator": "viewName",
"modifier": "private",
"original_string": "private String viewName;",
"type": "String",
"var_name": "viewName"
},
{
"declarator": "defaultExtension",
"modifier": "private",
"original_string": "private String defaultE... | {
"body": "@Test\n public void testAppendExtensionIfRequired() {\n String actualViewName = ViewResponseFilter.appendExtensionIfRequired(viewName, defaultExtension);\n assertEquals(expectedViewName, actualViewName);\n }",
"class_method_signature": "ViewResponseFilterTest.testAppendExtensionIfRequ... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ViewResponseFilter.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ViewResponseFilter.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "private String appendExtensionIfRequired(String viewName) {\n return appendExtensionIfRequired(viewName, krazoConfig.getDefaultViewFileExtension());\n }",
"class_method_signature": "ViewResponseFilter.appendExtensionIfRequired(String viewName)",
"constructor": false,
"full_signature": "priv... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_0 | {
"fields": [],
"file": "jersey/src/test/java/org/eclipse/krazo/jersey/model/KrazoModelProcessorTest.java",
"identifier": "KrazoModelProcessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void processResourceModel() {\n\t\tResourceModel.Builder rmb = new ResourceModel.Builder(false);\n\t\tResource resource = Resource.builder(SomeController.class).build();\n\t\trmb.addResource(resource);\n\t\tResourceModel processedModel = new KrazoModelProcessor().processResourceModel(rmb.bu... | {
"fields": [],
"file": "jersey/src/main/java/org/eclipse/krazo/jersey/model/KrazoModelProcessor.java",
"identifier": "KrazoModelProcessor",
"interfaces": "implements ModelProcessor",
"methods": [
{
"class_method_signature": "KrazoModelProcessor.processResourceModel(ResourceModel resourceModel, Conf... | {
"body": "@Override\n public ResourceModel processResourceModel(ResourceModel resourceModel, Configuration configuration) {\n ResourceModel.Builder rmb = new ResourceModel.Builder(false);\n resourceModel.getResources().forEach(r -> {\n rmb.addResource(processResource(r));\n });\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_10 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test\n public void shouldCorrectlySetExecutorService() {\n properties.put(PebbleProperty.EXECUTOR_SERVICE.key(), CustomExecutorService.class.getCanonicalName());\n\n assertTrue(pebbleEngineProducer.pebbleEngine().getExecutorService() instanceof CustomExecutorService);\n }",
"class_me... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_7 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test\n public void shouldUseServletContextLoader() {\n assertTrue(pebbleEngineProducer.pebbleEngine().getLoader() instanceof ServletLoader);\n }",
"class_method_signature": "PebbleEngineProducerTest.shouldUseServletContextLoader()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_31 | {
"fields": [],
"file": "core/src/test/java/org/eclipse/krazo/util/ControllerUtilsTest.java",
"identifier": "ControllerUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldIdentifyRequestMethods() throws NoSuchMethodException {\n assertThat(ControllerUtils.isRequestMethod(NoController.class.getMethod(\"foo\")), is(false));\n assertThat(ControllerUtils.isRequestMethod(NoController.class.getMethod(\"bar\")), is(true));\n assert... | {
"fields": [],
"file": "core/src/main/java/org/eclipse/krazo/util/ControllerUtils.java",
"identifier": "ControllerUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ControllerUtils.ControllerUtils()",
"constructor": true,
"full_signature": "private ControllerUtils()",
... | {
"body": "static boolean isRequestMethod(Method method) {\n if (hasDeclaredRequestMethodAnnotation(method)) {\n return true;\n }\n // inheritance disabled if other JAX-RS annotations found\n if (AnnotationUtils.hasJaxrsAnnotations(method)) {\n return false;\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_6 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test\n public void shouldCreateAnInstanceOfPebbleEngine() {\n assertNotNull(pebbleEngineProducer.pebbleEngine());\n }",
"class_method_signature": "PebbleEngineProducerTest.shouldCreateAnInstanceOfPebbleEngine()",
"constructor": false,
"full_signature": "@Test public void shouldCreateAnI... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_11 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void shouldThrowExceptionWhileSettingExecutorService() {\n properties.put(PebbleProperty.EXECUTOR_SERVICE.key(), \"org.dummy.DummyExecutorService\");\n\n pebbleEngineProducer.pebbleEngine();\n }",
"class_method_signature": "Peb... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_46 | {
"fields": [
{
"declarator": "encoders = new EncodersImpl()",
"modifier": "private final",
"original_string": "private final EncodersImpl encoders = new EncodersImpl();",
"type": "EncodersImpl",
"var_name": "encoders"
}
],
"file": "core/src/test/java/org/eclipse/krazo/securi... | {
"body": "@Test\n public void testEncoderJs() {\n assertEquals(\"\\\\b \\\\t \\\\n \\\\f \\\\r\", encoders.js(\"\\b \\t \\n \\f \\r\"));\n assertEquals(\"\\\\/ \\\\\\\\ \\\\x22 \\\\x26 \\\\x27\", encoders.js(\"/ \\\\ \\\" & '\"));\n assertEquals(\"\\\\x00 \\\\x0f \\\\x10 \\\\x1f\", encoders.j... | {
"fields": [],
"file": "core/src/main/java/org/eclipse/krazo/security/EncodersImpl.java",
"identifier": "EncodersImpl",
"interfaces": "implements Encoders",
"methods": [
{
"class_method_signature": "EncodersImpl.js(String s)",
"constructor": false,
"full_signature": "public String js(St... | {
"body": "public String js(String s) {\n if (s == null) {\n return null;\n }\n final int l = s.length();\n final StringBuffer sb = new StringBuffer(l);\n for (int i = 0; i < l; i++) {\n final char ch = s.charAt(i);\n switch (ch) {\n c... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_12 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test\n public void shouldCorrectlySetExtensions() {\n properties.put(PebbleProperty.EXTENSION.key(), String.format(\"%s,%s\", CustomExtensionOne.class.getCanonicalName(), CustomExtensionTwo.class.getCanonicalName()));\n\n pebbleEngineProducer.pebbleEngine();\n\n properties.put(Pebb... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_45 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private DefaultFormEntityProvider underTest;",
"type": "DefaultFormEntityProvider",
"var_name": "underTest"
},
{
"declarator": "context",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testWithNonBufferedStream() throws IOException {\n // A file input stream does not support reset\n // So let's write some content to a temp file and feed it to the form provider\n File temp = File.createTempFile(\"tempfile\", \".tmp\");\n try (FileWriter f... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = \"UTF-8\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CHARSET = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET"
}
],
"file": "core/src/main/java/org/eclipse/krazo/s... | {
"body": "@Override\n public Form getForm(ContainerRequestContext context) throws IOException {\n final InputStream is = context.getEntityStream();\n\n // Ensure stream can be restored for next interceptor\n InputStream bufferedStream;\n if (is.markSupported()) {\n bufferedS... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_9 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test\n public void shouldCorrectlySetStrictVariables() {\n properties.put(PebbleProperty.STRICT_VARIABLES.key(), \"true\");\n\n assertTrue(pebbleEngineProducer.pebbleEngine().isStrictVariables());\n\n properties.put(PebbleProperty.STRICT_VARIABLES.key(), \"false\");\n\n asse... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_49 | {
"fields": [
{
"declarator": "viewEngineBase = new ViewEngineBase() {\n\t\t@Override\n\t\tpublic boolean supports(String view) {\n\t\t\treturn false;\n\t\t}\n\t\t@Override\n\t\tpublic void processView(ViewEngineContext context) throws ViewEngineException {\n\n\t\t}\n\t}",
"modifier": "private final",... | {
"body": "@Test\n\tpublic void resolveViewCustomFolder() {\n\t\tViewEngineContext ctx = EasyMock.createMock(ViewEngineContext.class);\n\t\tConfiguration config = EasyMock.createMock(Configuration.class);\n\t\texpect(config.getProperty(eq(ViewEngine.VIEW_FOLDER))).andReturn(\"/somewhere/else\");\n\t\texpect(ctx.getCo... | {
"fields": [],
"file": "core/src/main/java/org/eclipse/krazo/engine/ViewEngineBase.java",
"identifier": "ViewEngineBase",
"interfaces": "implements ViewEngine",
"methods": [
{
"class_method_signature": "ViewEngineBase.resolveView(ViewEngineContext context)",
"constructor": false,
"full_... | {
"body": "protected String resolveView(ViewEngineContext context) {\n final String view = context.getView();\n if (!PathUtils.hasStartingSlash(view)) { // Relative?\n return PathUtils.ensureEndingSlash(getViewFolder(context)) + view;\n }\n return view;\n }",
"class_... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_4 | {
"fields": [
{
"declarator": "pebbleConfigurationProducer",
"modifier": "",
"original_string": "PebbleConfigurationProducer pebbleConfigurationProducer;",
"type": "PebbleConfigurationProducer",
"var_name": "pebbleConfigurationProducer"
}
],
"file": "ext/pebble/src/test/java/... | {
"body": "@Test\n public void shouldReturnPebbleConfiguration() {\n Properties pebbleConfiguration = pebbleConfigurationProducer.pebbleConfiguration();\n\n assertNotNull(pebbleConfiguration);\n assertEquals(pebbleConfiguration.getProperty(\"org.eclipse.krazo.ext.pebble.autoEscaping\"), \"true... | {
"fields": [],
"file": "ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducer.java",
"identifier": "PebbleConfigurationProducer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PebbleConfigurationProducer.pebbleConfiguration()",
"constructor": false,
... | {
"body": "@Produces\n public Properties pebbleConfiguration() {\n Properties pebbleProperties = loadFromFile(\"pebble.properties\");\n\n Stream.of(PebbleProperty.values())\n .forEach(property\n -> property.systemPropertyValue().ifPresent(value -> pebbleProperties.put(proper... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_48 | {
"fields": [
{
"declarator": "viewEngineBase = new ViewEngineBase() {\n\t\t@Override\n\t\tpublic boolean supports(String view) {\n\t\t\treturn false;\n\t\t}\n\t\t@Override\n\t\tpublic void processView(ViewEngineContext context) throws ViewEngineException {\n\n\t\t}\n\t}",
"modifier": "private final",... | {
"body": "@Test\n\tpublic void resolveView() {\n\t\tViewEngineContext ctx = EasyMock.createMock(ViewEngineContext.class);\n\t\tConfiguration config = EasyMock.createMock(Configuration.class);\n\t\texpect(config.getProperty(eq(ViewEngine.VIEW_FOLDER))).andReturn(null);\n\t\texpect(ctx.getConfiguration()).andReturn(co... | {
"fields": [],
"file": "core/src/main/java/org/eclipse/krazo/engine/ViewEngineBase.java",
"identifier": "ViewEngineBase",
"interfaces": "implements ViewEngine",
"methods": [
{
"class_method_signature": "ViewEngineBase.resolveView(ViewEngineContext context)",
"constructor": false,
"full_... | {
"body": "protected String resolveView(ViewEngineContext context) {\n final String view = context.getView();\n if (!PathUtils.hasStartingSlash(view)) { // Relative?\n return PathUtils.ensureEndingSlash(getViewFolder(context)) + view;\n }\n return view;\n }",
"class_... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_33 | {
"fields": [
{
"declarator": "BASE_PATH = \"/base-path\"",
"modifier": "private static final",
"original_string": "private static final String BASE_PATH = \"/base-path\";",
"type": "String",
"var_name": "BASE_PATH"
},
{
"declarator": "uriTemplateParser",
"modifie... | {
"body": "@Test\n public void shouldInitApplicationUris() {\n HashSet<Class<?>> controllers = new HashSet<>(Arrays.asList(UriBuilderTestControllers.SomeController.class, UriBuilderTestControllers.ParamsController.class));\n ApplicationUris uris = uriTemplateParser.init(controllers);\n assertT... | {
"fields": [
{
"declarator": "mvcContext",
"modifier": "@Inject",
"original_string": "@Inject\n MvcContext mvcContext;",
"type": "MvcContext",
"var_name": "mvcContext"
},
{
"declarator": "servletContext",
"modifier": "@Inject\n private",
"original_str... | {
"body": "@PostConstruct\n public void init() {\n\n Set<Class<?>> controllerClasses =\n (Set<Class<?>>) servletContext.getAttribute(KrazoContainerInitializer.CONTROLLER_CLASSES);\n\n applicationUris = init(controllerClasses != null ? controllerClasses : Collections.emptySet());\n\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_8 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test\n public void shouldSetCorrectLocale() {\n properties.put(PebbleProperty.DEFAULT_LOCALE.key(), \"de\");\n\n assertEquals(Locale.GERMAN, pebbleEngineProducer.pebbleEngine().getDefaultLocale());\n }",
"class_method_signature": "PebbleEngineProducerTest.shouldSetCorrectLocale()",
... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_44 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private DefaultFormEntityProvider underTest;",
"type": "DefaultFormEntityProvider",
"var_name": "underTest"
},
{
"declarator": "context",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testReadingGarbage() throws IOException {\n byte[] bytes = \"sj238snssKJSHUFDH8u290+!9@*32\".getBytes();\n\n EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream(bytes));\n EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLI... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = \"UTF-8\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CHARSET = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET"
}
],
"file": "core/src/main/java/org/eclipse/krazo/s... | {
"body": "@Override\n public Form getForm(ContainerRequestContext context) throws IOException {\n final InputStream is = context.getEntityStream();\n\n // Ensure stream can be restored for next interceptor\n InputStream bufferedStream;\n if (is.markSupported()) {\n bufferedS... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_13 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void shouldThrowExceptionWhileSettingExtensions() {\n properties.put(PebbleProperty.EXTENSION.key(), String.format(\"%s-%s\", CustomExtensionOne.class.getCanonicalName(), CustomExtensionTwo.class.getCanonicalName()));\n\n pebbleEngi... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_63 | {
"fields": [],
"file": "core/src/test/java/org/eclipse/krazo/core/ViewableWriterTest.java",
"identifier": "ViewableWriterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWriteTo() throws Exception {\n ViewableWriter writer = new ViewableWriter();\n\n Field mvcField = writer.getClass().getDeclaredField(\"mvc\");\n mvcField.setAccessible(true);\n mvcField.set(writer, new MvcContextImpl());\n\n ViewEngineFinder fin... | {
"fields": [
{
"declarator": "modelsInstance",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private Instance<Models> modelsInstance;",
"type": "Instance<Models>",
"var_name": "modelsInstance"
},
{
"declarator": "injectedRequest",
"modifier... | {
"body": "@Override\n public void writeTo(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType resolvedMediaType,\n MultivaluedMap<String, Object> headers, OutputStream out)\n throws IOException, WebApplicationException {\n\n // Find engine for th... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_3 | {
"fields": [
{
"declarator": "pebbleConfigurationProducer",
"modifier": "",
"original_string": "PebbleConfigurationProducer pebbleConfigurationProducer;",
"type": "PebbleConfigurationProducer",
"var_name": "pebbleConfigurationProducer"
}
],
"file": "ext/pebble/src/test/java/... | {
"body": "@Test\n public void shouldLoadPebbleConfigurationPropertiesFromFile() {\n Properties pebbleConfiguration = pebbleConfigurationProducer.loadFromFile(\"pebble.properties\");\n\n assertNotNull(pebbleConfiguration);\n assertEquals(pebbleConfiguration.getProperty(\"org.eclipse.krazo.ext.... | {
"fields": [],
"file": "ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducer.java",
"identifier": "PebbleConfigurationProducer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PebbleConfigurationProducer.pebbleConfiguration()",
"constructor": false,
... | {
"body": "public Properties loadFromFile(String fileName) {\n Properties props = new Properties();\n\n try (InputStream config = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName)) {\n if (Objects.nonNull(config)) {\n props.load(config);\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_14 | {
"fields": [
{
"declarator": "properties",
"modifier": "",
"original_string": "Properties properties;",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "pebbleEngineProducer",
"modifier": "",
"original_string": "PebbleEngineProducer pebble... | {
"body": "@Test\n public void shouldCorrectlySetEscapingStrategy() {\n properties.put(PebbleProperty.ESCAPING_STRATEGY.key(), CustomEscapingStrategy.class.getCanonicalName());\n\n PebbleEngine pebbleEngine = pebbleEngineProducer.pebbleEngine();\n EscapeFilter ef = (EscapeFilter) pebbleEngine.... | {
"fields": [
{
"declarator": "pebbleConfiguration",
"modifier": "protected",
"original_string": "protected Properties pebbleConfiguration;",
"type": "Properties",
"var_name": "pebbleConfiguration"
},
{
"declarator": "servletContext",
"modifier": "protected",
... | {
"body": "@Produces\n @ViewEngineConfig\n public PebbleEngine pebbleEngine() {\n PebbleEngine.Builder engine = new PebbleEngine.Builder();\n\n pebbleConfiguration\n .entrySet()\n .stream()\n .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)\n ... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_43 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private DefaultFormEntityProvider underTest;",
"type": "DefaultFormEntityProvider",
"var_name": "underTest"
},
{
"declarator": "context",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testReadingAnEmptyResponse() throws IOException {\n EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream(new byte[0]));\n EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLICATION_FORM_URLENCODED_TYPE);\n context.setEntitySt... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = \"UTF-8\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CHARSET = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET"
}
],
"file": "core/src/main/java/org/eclipse/krazo/s... | {
"body": "@Override\n public Form getForm(ContainerRequestContext context) throws IOException {\n final InputStream is = context.getEntityStream();\n\n // Ensure stream can be restored for next interceptor\n InputStream bufferedStream;\n if (is.markSupported()) {\n bufferedS... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_42 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private DefaultFormEntityProvider underTest;",
"type": "DefaultFormEntityProvider",
"var_name": "underTest"
},
{
"declarator": "context",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testURLEncodedValues() throws IOException {\n EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream(\"foo=bar%3Dbaz\".getBytes()));\n EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLICATION_FORM_URLENCODED_TYPE);\n context.... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = \"UTF-8\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CHARSET = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET"
}
],
"file": "core/src/main/java/org/eclipse/krazo/s... | {
"body": "@Override\n public Form getForm(ContainerRequestContext context) throws IOException {\n final InputStream is = context.getEntityStream();\n\n // Ensure stream can be restored for next interceptor\n InputStream bufferedStream;\n if (is.markSupported()) {\n bufferedS... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_39 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private DefaultFormEntityProvider underTest;",
"type": "DefaultFormEntityProvider",
"var_name": "underTest"
},
{
"declarator": "context",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testReadingForm() throws IOException {\n EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream(\"foo=bar\".getBytes()));\n EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLICATION_FORM_URLENCODED_TYPE);\n context.setEntitySt... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = \"UTF-8\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CHARSET = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET"
}
],
"file": "core/src/main/java/org/eclipse/krazo/s... | {
"body": "@Override\n public Form getForm(ContainerRequestContext context) throws IOException {\n final InputStream is = context.getEntityStream();\n\n // Ensure stream can be restored for next interceptor\n InputStream bufferedStream;\n if (is.markSupported()) {\n bufferedS... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
158213242_62 | {
"fields": [],
"file": "core/src/test/java/org/eclipse/krazo/core/ViewableWriterTest.java",
"identifier": "ViewableWriterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetSize() {\n ViewableWriter writer = new ViewableWriter();\n assertEquals(-1, writer.getSize(null, null, null, new Annotation[] {}, MediaType.WILDCARD_TYPE));\n }",
"class_method_signature": "ViewableWriterTest.testGetSize()",
"constructor": false,
"full_s... | {
"fields": [
{
"declarator": "modelsInstance",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private Instance<Models> modelsInstance;",
"type": "Instance<Models>",
"var_name": "modelsInstance"
},
{
"declarator": "injectedRequest",
"modifier... | {
"body": "@Override\n public long getSize(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType) {\n return -1;\n }",
"class_method_signature": "ViewableWriter.getSize(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType)",... | {
"created": "11/19/2018 11:48:35 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 158213242,
"size": null,
"stargazer_count": null,
"stars": 26,
"updates": "2020-01-23T16:39:50+00:00",
"url": "https://github.com/eclipse-ee4j/k... |
97029141_8 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test(expected = JwtAuthenticationException.class)\n public void whenValidateTokenCalledWithExpiredTokenThenExpectFailure() throws Exception {\n ReflectionTestUtils.setField(jwtUtils, \"allowedClockSkewInSecs\", 0L);\n ReflectionTestUtils.setField(jwtUtils, \"expirationInSecs\", 0L); // wi... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "public Claims validateTokenAndGetClaims(String token) {\n\n try {\n final Claims claims = getClaimsFromToken(token);\n final Date created = getIssuedAtDateFromTokenClaims(claims);\n final Date lastPasswordResetDate = getLastPasswordResetDateFromTokenClaims(claims);\n... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_11 | {
"fields": [
{
"declarator": "AUTHORIZATION_HEADER = \"Authorization\"",
"modifier": "private static final",
"original_string": "private static final String AUTHORIZATION_HEADER = \"Authorization\";",
"type": "String",
"var_name": "AUTHORIZATION_HEADER"
},
{
"declarato... | {
"body": "@Test\n public void whenFilterCalledWithoutAuthorizationHeaderThenCallNextFilterInChain() throws Exception {\n\n when(request.getHeader(AUTHORIZATION_HEADER)).thenReturn(null);\n\n jwtAuthenticationFilter.doFilterInternal(request, response, filterChain);\n\n verify(request, times(1)... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "AUTHORIZATION_HEADER = \"Authorizati... | {
"body": "@Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)\n throws ServletException, IOException {\n\n try {\n\n // Extract token after Bearer prefix if present\n String authorizationHeader = request.g... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_4 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test\n public void testExpirationDateCanBeExtractedFromTokenClaims() throws Exception {\n when(claims.getExpiration()).thenReturn(EXPIRATION_DATE);\n assertThat(jwtUtils.getExpirationDateFromTokenClaims(claims))\n .isCloseTo(EXPIRATION_DATE, GRADLE_FRIENDLY_TIME_TOLERANCE_I... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "Date getExpirationDateFromTokenClaims(Claims claims) throws JwtAuthenticationException {\n try {\n return claims.getExpiration();\n } catch (Exception e) {\n final String errorMsg = \"Failed to extract expiration claim from token!\";\n LOG.error(errorMsg, e);\... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_5 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test\n public void testRolesCanBeExtractedFromTokenClaims() throws Exception {\n when(claims.get(JwtUtils.CLAIM_KEY_ROLES)).thenReturn(ROLES);\n final List<GrantedAuthority> roles = jwtUtils.getRolesFromTokenClaims(claims);\n assertThat(roles.size()).isEqualTo(2);\n assertTh... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "public List<GrantedAuthority> getRolesFromTokenClaims(Claims claims) throws JwtAuthenticationException {\n final List<GrantedAuthority> roles = new ArrayList<>();\n try {\n @SuppressWarnings(\"unchecked\") final List<String> rolesFromClaim = (List<String>) claims.get(CLAIM_KEY_ROLE... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_10 | {
"fields": [
{
"declarator": "request",
"modifier": "@MockBean\n private",
"original_string": "@MockBean\n private HttpServletRequest request;",
"type": "HttpServletRequest",
"var_name": "request"
},
{
"declarator": "response",
"modifier": "@MockBean\n p... | {
"body": "@Test\n public void whenCommenceCalledThenExpectUnauthorizedResponse() throws Exception {\n\n final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint = new JwtAuthenticationEntryPoint();\n jwtAuthenticationEntryPoint.commence(request, response, authException);\n\n verify(respo... | {
"fields": [],
"file": "bxbot-ui-server-rest-api/src/main/java/com/gazbert/bxbot/ui/server/rest/security/jwt/JwtAuthenticationEntryPoint.java",
"identifier": "JwtAuthenticationEntryPoint",
"interfaces": "implements AuthenticationEntryPoint",
"methods": [
{
"class_method_signature": "JwtAuthenticati... | {
"body": "@Override\n public void commence(HttpServletRequest request, HttpServletResponse response,\n AuthenticationException authException) throws IOException {\n\n response.sendError(HttpServletResponse.SC_UNAUTHORIZED, \"Unauthorized\");\n }",
"class_method_signature": "Jwt... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_9 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test(expected = JwtAuthenticationException.class)\n public void whenValidateTokenCalledWithCreatedDateEarlierThanLastPasswordResetDateThenExpectFailure() throws Exception {\n final String token = createTokenWithInvalidCreationDate();\n jwtUtils.validateTokenAndGetClaims(token);\n }",
... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "public Claims validateTokenAndGetClaims(String token) {\n\n try {\n final Claims claims = getClaimsFromToken(token);\n final Date created = getIssuedAtDateFromTokenClaims(claims);\n final Date lastPasswordResetDate = getLastPasswordResetDateFromTokenClaims(claims);\n... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_17 | {
"fields": [
{
"declarator": "KNOWN_USERNAME = \"known-username\"",
"modifier": "private static final",
"original_string": "private static final String KNOWN_USERNAME = \"known-username\";",
"type": "String",
"var_name": "KNOWN_USERNAME"
},
{
"declarator": "UNKNOWN_USE... | {
"body": "@Test(expected = UsernameNotFoundException.class)\n public void whenLoadByUsernameCalledWithUnknownUsernameThenExpectUsernameNotFoundException() throws Exception {\n\n expect(userRepository.findByUsername(UNKNOWN_USERNAME)).andStubReturn(null);\n PowerMock.replayAll();\n\n final Jwt... | {
"fields": [
{
"declarator": "userRepository",
"modifier": "private final",
"original_string": "private final UserRepository userRepository;",
"type": "UserRepository",
"var_name": "userRepository"
}
],
"file": "bxbot-ui-server-rest-api/src/main/java/com/gazbert/bxbot/ui/ser... | {
"body": "@Override\n public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {\n\n final User user = userRepository.findByUsername(username);\n if (user == null) {\n throw new UsernameNotFoundException(String.format(\"No user found with username '%s'.\", u... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_2 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test(expected = JwtAuthenticationException.class)\n public void testExceptionThrownIfUsernameCannotBeExtractedFromTokenClaims() throws Exception {\n when(claims.getSubject()).thenReturn(null);\n jwtUtils.getUsernameFromTokenClaims(claims);\n verify(claims, times(1)).getSubject();\n... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "public String getUsernameFromTokenClaims(Claims claims) {\n try {\n final String username = claims.getSubject();\n if (username == null) {\n final String errorMsg = \"Failed to extract username claim from token!\";\n LOG.error(errorMsg);\n ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_21 | {
"fields": [
{
"declarator": "BUY_FEE_CONFIG_ITEM_KEY = \"buy-fee\"",
"modifier": "private static final",
"original_string": "private static final String BUY_FEE_CONFIG_ITEM_KEY = \"buy-fee\";",
"type": "String",
"var_name": "BUY_FEE_CONFIG_ITEM_KEY"
},
{
"declarator":... | {
"body": "@Test\n public void testAddingAndFetchingOptionalConfigItems() throws Exception {\n\n final OptionalConfig strategyConfig = new OptionalConfig();\n strategyConfig.getItems().put(BUY_FEE_CONFIG_ITEM_KEY, BUY_FEE_CONFIG_ITEM_VALUE);\n strategyConfig.getItems().put(SELL_FEE_CONFIG_ITEM... | {
"fields": [
{
"declarator": "items",
"modifier": "private",
"original_string": "private Map<String, String> items;",
"type": "Map<String, String>",
"var_name": "items"
}
],
"file": "bxbot-ui-server-domain-objects/src/main/java/com/gazbert/bxbot/ui/server/domain/exchange/Opt... | {
"body": "public Map<String, String> getItems() {\n return items;\n }",
"class_method_signature": "OptionalConfig.getItems()",
"constructor": false,
"full_signature": "public Map<String, String> getItems()",
"identifier": "getItems",
"invocations": [],
"modifiers": "public",
"parameters": "()... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_20 | {
"fields": [
{
"declarator": "STATUS_RESOURCE_PATH = \"/status\"",
"modifier": "private static final",
"original_string": "private static final String STATUS_RESOURCE_PATH = \"/status\";",
"type": "String",
"var_name": "STATUS_RESOURCE_PATH"
},
{
"declarator": "UNKNOWN... | {
"body": "@Test\n public void whenGetAllBotStatusCalledWhenUserIsAuthenticatedThenExpectSuccess() throws Exception {\n\n final List<BotStatus> allBotStatus = new ArrayList<>();\n allBotStatus.add(bot1Status);\n allBotStatus.add(bot2Status);\n\n given(botProcessService.getAllBotStatus()... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "STATUS_RESOURCE_PATH = \"/status\"",... | {
"body": "@PreAuthorize(\"hasRole('USER')\")\n @RequestMapping(value = STATUS_RESOURCE_PATH, method = RequestMethod.GET)\n public ResponseEntity<?> getAllBotStatus(@AuthenticationPrincipal User user) {\n\n LOG.info(\"GET \" + RUNTIME_ENDPOINT_BASE_URI + STATUS_RESOURCE_PATH + \" - getAllBotStatus()\"); ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_3 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test\n public void testIssuedAtDateCanBeExtractedFromTokenClaims() throws Exception {\n when(claims.getIssuedAt()).thenReturn(ISSUED_AT_DATE);\n assertThat(jwtUtils.getIssuedAtDateFromTokenClaims(claims))\n .isCloseTo(ISSUED_AT_DATE, GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "Date getIssuedAtDateFromTokenClaims(Claims claims) throws JwtAuthenticationException {\n try {\n return claims.getIssuedAt();\n } catch (Exception e) {\n final String errorMsg = \"Failed to extract iat claim from token!\";\n LOG.error(errorMsg, e);\n ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_16 | {
"fields": [
{
"declarator": "KNOWN_USERNAME = \"known-username\"",
"modifier": "private static final",
"original_string": "private static final String KNOWN_USERNAME = \"known-username\";",
"type": "String",
"var_name": "KNOWN_USERNAME"
},
{
"declarator": "UNKNOWN_USE... | {
"body": "@Test\n public void whenLoadByUsernameCalledWithKnownUsernameThenExpectUserDetailsToBeReturned() throws Exception {\n\n PowerMock.mockStatic(JwtUserFactory.class);\n final User user = PowerMock.createMock(User.class);\n final JwtUser jwtUser = EasyMock.createMock(JwtUser.class);\n\n... | {
"fields": [
{
"declarator": "userRepository",
"modifier": "private final",
"original_string": "private final UserRepository userRepository;",
"type": "UserRepository",
"var_name": "userRepository"
}
],
"file": "bxbot-ui-server-rest-api/src/main/java/com/gazbert/bxbot/ui/ser... | {
"body": "@Override\n public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {\n\n final User user = userRepository.findByUsername(username);\n if (user == null) {\n throw new UsernameNotFoundException(String.format(\"No user found with username '%s'.\", u... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_0 | {
"fields": [
{
"declarator": "ADMIN_ROLE_ID = new Long(\"213443242342\")",
"modifier": "private static final",
"original_string": "private static final Long ADMIN_ROLE_ID = new Long(\"213443242342\");",
"type": "Long",
"var_name": "ADMIN_ROLE_ID"
},
{
"declarator": "US... | {
"body": "@Test\n public void whenCreateCalledWithUserModelThenExpectJwtUserDetailsToBeReturned() throws Exception {\n\n final User user = new User();\n user.setId(USER_ID);\n user.setUsername(USERNAME);\n user.setPassword(PASSWORD);\n user.setFirstname(FIRSTNAME);\n user... | {
"fields": [],
"file": "bxbot-ui-server-rest-api/src/main/java/com/gazbert/bxbot/ui/server/rest/security/jwt/JwtUserFactory.java",
"identifier": "JwtUserFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "JwtUserFactory.JwtUserFactory()",
"constructor": true,
"full_sig... | {
"body": "public static JwtUser create(User user) {\n return new JwtUser(\n user.getId(),\n user.getUsername(),\n user.getFirstname(),\n user.getLastname(),\n user.getPassword(),\n user.getEmail(),\n user.... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_15 | {
"fields": [
{
"declarator": "AUTHORIZATION_HEADER = \"Authorization\"",
"modifier": "private static final",
"original_string": "private static final String AUTHORIZATION_HEADER = \"Authorization\";",
"type": "String",
"var_name": "AUTHORIZATION_HEADER"
},
{
"declarato... | {
"body": "@Test\n public void whenFilterCalledWithValidTokenThenExpectSuccessfulAuthenticationAndCallNextFilterInChain() throws Exception {\n\n when(request.getHeader(AUTHORIZATION_HEADER)).thenReturn(\"dummy-token\");\n when(jwtUtils.getUsernameFromTokenClaims((any()))).thenReturn(USERNAME);\n ... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "AUTHORIZATION_HEADER = \"Authorizati... | {
"body": "@Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)\n throws ServletException, IOException {\n\n try {\n\n // Extract token after Bearer prefix if present\n String authorizationHeader = request.g... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_19 | {
"fields": [
{
"declarator": "STATUS_RESOURCE_PATH = \"/status\"",
"modifier": "private static final",
"original_string": "private static final String STATUS_RESOURCE_PATH = \"/status\";",
"type": "String",
"var_name": "STATUS_RESOURCE_PATH"
},
{
"declarator": "UNKNOWN... | {
"body": "@Test\n public void whenGetBotStatusCalledWithUnknownBotIdThenExpectNotFoundResponse() throws Exception {\n\n given(botProcessService.getBotStatus(UNKNOWN_BOT_ID)).willReturn(null);\n\n mockMvc.perform(get(RUNTIME_ENDPOINT_BASE_URI + UNKNOWN_BOT_ID + STATUS_RESOURCE_PATH)\n ... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "STATUS_RESOURCE_PATH = \"/status\"",... | {
"body": "@PreAuthorize(\"hasRole('USER')\")\n @RequestMapping(value = \"/{botId}\" + STATUS_RESOURCE_PATH, method = RequestMethod.GET)\n public ResponseEntity<?> getBotStatus(@AuthenticationPrincipal User user, @PathVariable String botId) {\n\n LOG.info(\"GET \" + RUNTIME_ENDPOINT_BASE_URI + botId + ST... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_18 | {
"fields": [
{
"declarator": "STATUS_RESOURCE_PATH = \"/status\"",
"modifier": "private static final",
"original_string": "private static final String STATUS_RESOURCE_PATH = \"/status\";",
"type": "String",
"var_name": "STATUS_RESOURCE_PATH"
},
{
"declarator": "UNKNOWN... | {
"body": "@Test\n public void whenGetBotStatusCalledWhenUserIsAuthenticatedThenExpectSuccess() throws Exception {\n\n given(botProcessService.getBotStatus(BOT_1_ID)).willReturn(bot1Status);\n\n mockMvc.perform(get(RUNTIME_ENDPOINT_BASE_URI + BOT_1_ID + STATUS_RESOURCE_PATH)\n .header(... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "STATUS_RESOURCE_PATH = \"/status\"",... | {
"body": "@PreAuthorize(\"hasRole('USER')\")\n @RequestMapping(value = \"/{botId}\" + STATUS_RESOURCE_PATH, method = RequestMethod.GET)\n public ResponseEntity<?> getBotStatus(@AuthenticationPrincipal User user, @PathVariable String botId) {\n\n LOG.info(\"GET \" + RUNTIME_ENDPOINT_BASE_URI + botId + ST... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_14 | {
"fields": [
{
"declarator": "AUTHORIZATION_HEADER = \"Authorization\"",
"modifier": "private static final",
"original_string": "private static final String AUTHORIZATION_HEADER = \"Authorization\";",
"type": "String",
"var_name": "AUTHORIZATION_HEADER"
},
{
"declarato... | {
"body": "@Test\n public void whenFilterCalledWithInvalidTokenThenCallNextFilterInChain() throws Exception {\n\n when(request.getHeader(AUTHORIZATION_HEADER)).thenReturn(\"dummy-token\");\n when(jwtUtils.getUsernameFromTokenClaims((any()))).thenReturn(USERNAME);\n when(jwtUtils.validateTokenA... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "AUTHORIZATION_HEADER = \"Authorizati... | {
"body": "@Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)\n throws ServletException, IOException {\n\n try {\n\n // Extract token after Bearer prefix if present\n String authorizationHeader = request.g... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_1 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test\n public void testUsernameCanBeExtractedFromTokenClaims() throws Exception {\n when(claims.getSubject()).thenReturn(USERNAME);\n assertThat(jwtUtils.getUsernameFromTokenClaims(claims)).isEqualTo(USERNAME);\n verify(claims, times(1)).getSubject();\n }",
"class_method_signa... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "public String getUsernameFromTokenClaims(Claims claims) {\n try {\n final String username = claims.getSubject();\n if (username == null) {\n final String errorMsg = \"Failed to extract username claim from token!\";\n LOG.error(errorMsg);\n ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_6 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test\n public void testLastPasswordResetDateCanBeExtractedFromTokenClaims() throws Exception {\n when(claims.get(JwtUtils.CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE))\n .thenReturn(LAST_PASSWORD_RESET_DATE.getTime());\n assertThat(jwtUtils.getLastPasswordResetDateFromTokenClaims(c... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "Date getLastPasswordResetDateFromTokenClaims(Claims claims) {\n Date lastPasswordResetDate;\n try {\n lastPasswordResetDate = new Date((Long) claims.get(CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE));\n } catch (Exception e) {\n LOG.error(\"Failed to extract lastPasswordRe... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_13 | {
"fields": [
{
"declarator": "AUTHORIZATION_HEADER = \"Authorization\"",
"modifier": "private static final",
"original_string": "private static final String AUTHORIZATION_HEADER = \"Authorization\";",
"type": "String",
"var_name": "AUTHORIZATION_HEADER"
},
{
"declarato... | {
"body": "@Test\n public void whenFilterCalledWithTokenWithMissingUsernameThenCallNextFilterInChain() throws Exception {\n\n when(request.getHeader(AUTHORIZATION_HEADER)).thenReturn(\"dummy-token\");\n when(jwtUtils.getUsernameFromTokenClaims((any()))).thenReturn(null);\n\n jwtAuthenticationF... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "AUTHORIZATION_HEADER = \"Authorizati... | {
"body": "@Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)\n throws ServletException, IOException {\n\n try {\n\n // Extract token after Bearer prefix if present\n String authorizationHeader = request.g... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_12 | {
"fields": [
{
"declarator": "AUTHORIZATION_HEADER = \"Authorization\"",
"modifier": "private static final",
"original_string": "private static final String AUTHORIZATION_HEADER = \"Authorization\";",
"type": "String",
"var_name": "AUTHORIZATION_HEADER"
},
{
"declarato... | {
"body": "@Test\n public void whenFilterCalledWithBearerTokenWithMissingUsernameThenCallNextFilterInChain() throws Exception {\n\n when(request.getHeader(AUTHORIZATION_HEADER)).thenReturn(BEARER_PREFIX + \"dummy-token\");\n\n jwtAuthenticationFilter.doFilterInternal(request, response, filterChain);\... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "AUTHORIZATION_HEADER = \"Authorizati... | {
"body": "@Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)\n throws ServletException, IOException {\n\n try {\n\n // Extract token after Bearer prefix if present\n String authorizationHeader = request.g... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
97029141_7 | {
"fields": [
{
"declarator": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L",
"modifier": "private static final",
"original_string": "private static final long GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MILLIS = 10000L;",
"type": "long",
"var_name": "GRADLE_FRIENDLY_TIME_TOLERANCE_IN_MIL... | {
"body": "@Test\n public void whenValidateTokenCalledWithNonExpiredTokenThenExpectSuccess() throws Exception {\n final String token = createToken();\n assertThat(jwtUtils.validateTokenAndGetClaims(token)).isNotNull();\n }",
"class_method_signature": "TestJwtUtils.whenValidateTokenCalledWithNonE... | {
"fields": [
{
"declarator": "LOG = LogManager.getLogger()",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LogManager.getLogger();",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CLAIM_KEY_LAST_PASSWORD_CHANGE_DATE ... | {
"body": "public Claims validateTokenAndGetClaims(String token) {\n\n try {\n final Claims claims = getClaimsFromToken(token);\n final Date created = getIssuedAtDateFromTokenClaims(claims);\n final Date lastPasswordResetDate = getLastPasswordResetDateFromTokenClaims(claims);\n... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 97029141,
"size": 920,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/gazbert/bxbot-ui-server"
} |
49656131_73 | {
"fields": [
{
"declarator": "languageService",
"modifier": "private",
"original_string": "private LanguageService languageService;",
"type": "LanguageService",
"var_name": "languageService"
},
{
"declarator": "languagesImportUtility",
"modifier": "private",
... | {
"body": "@Test\n public void shouldReturnInvalidIsoCodeForEmptyLanguageName() throws Exception {\n assertEquals(LanguageService.INVALID_ISO_CODE, languageService.getIsoForLanguage(\"\"));\n }",
"class_method_signature": "LanguageServiceTest.shouldReturnInvalidIsoCodeForEmptyLanguageName()",
"constr... | {
"fields": [
{
"declarator": "languageMap",
"modifier": "private final",
"original_string": "private final Map<String, List<String>> languageMap;",
"type": "Map<String, List<String>>",
"var_name": "languageMap"
},
{
"declarator": "INVALID_ISO_CODE = \"xx\"",
"mod... | {
"body": "public String getIsoForLanguage(String label) {\n if (label != null) {\n for (String isoCode : languageMap.keySet()) {\n if (languageMap.get(isoCode).contains(getTitleCaseName(label.trim()))) {\n return isoCode;\n }\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_117 | {
"fields": [
{
"declarator": "chip",
"modifier": "private",
"original_string": "private Chip chip;",
"type": "Chip",
"var_name": "chip"
}
],
"file": "app/src/test/java/org/mercycorps/translationcards/view/ChipTest.java",
"identifier": "ChipTest",
"interfaces": "",
"sup... | {
"body": "@Test\n public void shouldSetChipText() {\n String chipText = \"Hot Chips!\";\n\n chip.setText(chipText);\n\n TextView chipTextView = (TextView) chip.findViewById(R.id.chip_text);\n assertEquals(chipText, chipTextView.getText().toString());\n }",
"class_method_signature"... | {
"fields": [
{
"declarator": "chipText",
"modifier": "@Bind(R.id.chip_text)",
"original_string": "@Bind(R.id.chip_text) TextView chipText;",
"type": "TextView",
"var_name": "chipText"
},
{
"declarator": "onDeleteListener = new OnDeleteListener() {\n @Override\n ... | {
"body": "public void setText(String text) {\n chipText.setText(text);\n }",
"class_method_signature": "Chip.setText(String text)",
"constructor": false,
"full_signature": "public void setText(String text)",
"identifier": "setText",
"invocations": [
"setText"
],
"modifiers": "public",
"... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_24 | {
"fields": [
{
"declarator": "A_LANGUAGE = \"a language\"",
"modifier": "private static final",
"original_string": "private static final String A_LANGUAGE = \"a language\";",
"type": "String",
"var_name": "A_LANGUAGE"
},
{
"declarator": "view",
"modifier": "priva... | {
"body": "@Test\n public void shouldStartEnterAuthorActivityWhenBackButtonIsClicked() {\n presenter.backButtonClicked();\n\n verify(view).startActivityWithClass(EnterAuthorActivity.class);\n }",
"class_method_signature": "ReviewAndSaveDeckPresenterTest.shouldStartEnterAuthorActivityWhenBackButt... | {
"fields": [
{
"declarator": "DELIMITER = \" \"",
"modifier": "private static final",
"original_string": "private static final String DELIMITER = \" \";",
"type": "String",
"var_name": "DELIMITER"
},
{
"declarator": "view",
"modifier": "private",
"origina... | {
"body": "public void backButtonClicked() {\n view.startActivityWithClass(EnterAuthorActivity.class);\n }",
"class_method_signature": "ReviewAndSaveDeckPresenter.backButtonClicked()",
"constructor": false,
"full_signature": "public void backButtonClicked()",
"identifier": "backButtonClicked",
"in... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_140 | {
"fields": [
{
"declarator": "TRANSLATION_LABEL = \"Test Translation\"",
"modifier": "public static final",
"original_string": "public static final String TRANSLATION_LABEL = \"Test Translation\";",
"type": "String",
"var_name": "TRANSLATION_LABEL"
},
{
"declarator": "... | {
"body": "@Test\n public void shouldUpdateTranslationCardStatesWhenListAdapterIsUpdatedWithDifferentNumberOfTranslations() {\n List<Translation> longerTranslations = Arrays.asList(firstTranslation, secondTranslation);\n when(mockTranslationService.getCurrentTranslations()).thenReturn(longerTranslati... | {
"fields": [
{
"declarator": "translationService",
"modifier": "private",
"original_string": "private TranslationService translationService;",
"type": "TranslationService",
"var_name": "translationService"
},
{
"declarator": "dictionaryService",
"modifier": "priv... | {
"body": "public void update() {\n updateTranslationCardStates();\n clear();\n addAll(translationService.getCurrentTranslations());\n notifyDataSetChanged();\n }",
"class_method_signature": "CardListAdapter.update()",
"constructor": false,
"full_signature": "public void update()"... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_32 | {
"fields": [
{
"declarator": "activity",
"modifier": "private",
"original_string": "private EnterAuthorView activity;",
"type": "EnterAuthorView",
"var_name": "activity"
},
{
"declarator": "presenter",
"modifier": "private",
"original_string": "private Ente... | {
"body": "@Test\n public void shouldInflateBitmaps() {\n presenter.inflateBitmaps();\n\n verify(activity).setActivityBitmap(R.id.deck_author_image, R.drawable.enter_phrase_image);\n }",
"class_method_signature": "EnterAuthorPresenterTest.shouldInflateBitmaps()",
"constructor": false,
"full_... | {
"fields": [
{
"declarator": "activity",
"modifier": "private",
"original_string": "private EnterAuthorView activity;",
"type": "EnterAuthorView",
"var_name": "activity"
},
{
"declarator": "newDeckContext",
"modifier": "private",
"original_string": "private... | {
"body": "public void inflateBitmaps() {\n activity.setActivityBitmap(R.id.deck_author_image, R.drawable.enter_phrase_image);\n }",
"class_method_signature": "EnterAuthorPresenter.inflateBitmaps()",
"constructor": false,
"full_signature": "public void inflateBitmaps()",
"identifier": "inflateBitmap... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_65 | {
"fields": [
{
"declarator": "mediaConfig",
"modifier": "private",
"original_string": "private MediaConfig mediaConfig;",
"type": "MediaConfig",
"var_name": "mediaConfig"
},
{
"declarator": "audioRecorderManager",
"modifier": "private",
"original_string": "... | {
"body": "@Test\n public void shouldStartRecordingAudioWhenRecording() throws RecordAudioException {\n audioRecorderManager.record(mediaConfig);\n verify(mediaRecorder).start();\n }",
"class_method_signature": "AudioRecorderManagerTest.shouldStartRecordingAudioWhenRecording()",
"constructor":... | {
"fields": [
{
"declarator": "mediaRecorder",
"modifier": "private",
"original_string": "private MediaRecorder mediaRecorder;",
"type": "MediaRecorder",
"var_name": "mediaRecorder"
},
{
"declarator": "isRecording",
"modifier": "private",
"original_string": ... | {
"body": "public boolean record(MediaConfig mediaConfig) throws RecordAudioException {\n mediaRecorder = ((MainApplication) MainApplication.getContextFromMainApp()).getMediaRecorder();\n setupMediaRecorder(mediaConfig);\n prepareMediaRecorder();\n try {\n mediaRecorder.start();... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_101 | {
"fields": [
{
"declarator": "inputStreamBuilder",
"modifier": "private",
"original_string": "private InputStreamBuilder inputStreamBuilder;",
"type": "InputStreamBuilder",
"var_name": "inputStreamBuilder"
},
{
"declarator": "fileInputStream",
"modifier": "privat... | {
"body": "@Test\n public void shouldRetrieveAssetAudioFilesFromAssetStream() throws Exception {\n String assetName = \"anAssetName\";\n when(fileInputStream.read(any(byte[].class))).thenReturn(-1);\n when(inputStreamBuilder.getAssetInputStream(assetName)).thenReturn(fileInputStream);\n ... | {
"fields": [
{
"declarator": "SPEC_FILENAME = \"card_deck.json\"",
"modifier": "static final",
"original_string": "static final String SPEC_FILENAME = \"card_deck.json\";",
"type": "String",
"var_name": "SPEC_FILENAME"
},
{
"declarator": "BUFFER_SIZE = 2048",
"mo... | {
"body": "protected void addAudioFilesToZip(Map<String, Boolean> filePaths, ZipOutputStream zipOutputStream) throws ExportException {\n try {\n for (Map.Entry<String, Boolean> entry : filePaths.entrySet()) {\n String baseFilename = new File(entry.getKey()).getName();\n ... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_49 | {
"fields": [
{
"declarator": "NO_DECK_TITLE = \"\"",
"modifier": "private static final",
"original_string": "private static final String NO_DECK_TITLE = \"\";",
"type": "String",
"var_name": "NO_DECK_TITLE"
},
{
"declarator": "A_DECK_TITLE = \"a deck title\"",
"m... | {
"body": "@Test\n public void shouldStartGetStartedDeckActivityWhenBackButtonClicked() {\n presenter.backButtonClicked();\n\n verify(activity).startActivityWithClass(GetStartedDeckActivity.class);\n }",
"class_method_signature": "EnterDeckTitlePresenterTest.shouldStartGetStartedDeckActivityWhen... | {
"fields": [
{
"declarator": "activity",
"modifier": "private",
"original_string": "private EnterDeckTitleView activity;",
"type": "EnterDeckTitleView",
"var_name": "activity"
},
{
"declarator": "newDeckContext",
"modifier": "private",
"original_string": "p... | {
"body": "public void backButtonClicked() {\n activity.startActivityWithClass(GetStartedDeckActivity.class);\n }",
"class_method_signature": "EnterDeckTitlePresenter.backButtonClicked()",
"constructor": false,
"full_signature": "public void backButtonClicked()",
"identifier": "backButtonClicked",
... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_90 | {
"fields": [
{
"declarator": "DECK_LABEL = \"label\"",
"modifier": "private static final",
"original_string": "private static final String DECK_LABEL = \"label\";",
"type": "String",
"var_name": "DECK_LABEL"
},
{
"declarator": "PUBLISHER = \"A Publisher\"",
"modi... | {
"body": "@Test\n public void shouldBuildImportSpecWithTimestampWhenPresent() throws ImportException, JSONException {\n jsonObjectToLoad.put(JsonKeys.DECK_LABEL, DECK_LABEL);\n jsonObjectToLoad.put(JsonKeys.TIMESTAMP, TIMESTAMP);\n TxcImportUtility.ImportSpec importSpec =\n txc... | {
"fields": [
{
"declarator": "INDEX_FILENAME = \"card_deck.csv\"",
"modifier": "private static final",
"original_string": "private static final String INDEX_FILENAME = \"card_deck.csv\";",
"type": "String",
"var_name": "INDEX_FILENAME"
},
{
"declarator": "ALT_INDEX_FIL... | {
"body": "@NonNull\n public ImportSpec buildImportSpec(File dir, String hash, JSONObject json) throws ImportException {\n ImportSpec spec;\n try {\n String deckLabel = json.getString(JsonKeys.DECK_LABEL);\n String publisher = json.optString(JsonKeys.PUBLISHER);\n Str... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_28 | {
"fields": [
{
"declarator": "A_LANGUAGE = \"a language\"",
"modifier": "private static final",
"original_string": "private static final String A_LANGUAGE = \"a language\";",
"type": "String",
"var_name": "A_LANGUAGE"
},
{
"declarator": "view",
"modifier": "priva... | {
"body": "@Test\n public void shouldFormatAndFillDestinationLanguagesWhenViewIsInitialized() {\n final String someLanguage = \"some other language\";\n HashSet<String> destinationLanguages = new HashSet<String>() {{\n add(someLanguage);\n add(A_LANGUAGE);\n }};\n ... | {
"fields": [
{
"declarator": "DELIMITER = \" \"",
"modifier": "private static final",
"original_string": "private static final String DELIMITER = \" \";",
"type": "String",
"var_name": "DELIMITER"
},
{
"declarator": "view",
"modifier": "private",
"origina... | {
"body": "public void initializeView() {\n view.setDeckItem(contextFromIntent.getDeck());\n fillLanguagesList();\n }",
"class_method_signature": "ReviewAndSaveDeckPresenter.initializeView()",
"constructor": false,
"full_signature": "public void initializeView()",
"identifier": "initializeVie... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_6 | {
"fields": [
{
"declarator": "NO_VALUE = \"\"",
"modifier": "private static final",
"original_string": "private static final String NO_VALUE = \"\";",
"type": "String",
"var_name": "NO_VALUE"
},
{
"declarator": "deck",
"modifier": "private",
"original_strin... | {
"body": "@Test\n public void getDeckInformation_shouldFormatDeckInformation() {\n assertThat(deck.getDeckInformation(), is(\"author, 02/08/16\"));\n }",
"class_method_signature": "DeckTest.getDeckInformation_shouldFormatDeckInformation()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "title",
"modifier": "private",
"original_string": "private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "author",
"modifier": "private",
"original_string": "private String author;",
"type": "St... | {
"body": "public String getDeckInformation() {\n return getAuthor() + \", \" + getCreationDateString();\n }",
"class_method_signature": "Deck.getDeckInformation()",
"constructor": false,
"full_signature": "public String getDeckInformation()",
"identifier": "getDeckInformation",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_69 | {
"fields": [
{
"declarator": "IS_NOT_ASSET = false",
"modifier": "private static final",
"original_string": "private static final boolean IS_NOT_ASSET = false;",
"type": "boolean",
"var_name": "IS_NOT_ASSET"
},
{
"declarator": "mediaPlayer",
"modifier": "private"... | {
"body": "@Test (expected = AudioFileException.class)\n public void shouldThrowExceptionWhenNoAudioFileIsFound() throws AudioFileException, IOException {\n audioPlayerManager.play(\"\", false);\n }",
"class_method_signature": "AudioPlayerManagerTest.shouldThrowExceptionWhenNoAudioFileIsFound()",
"co... | {
"fields": [
{
"declarator": "TAG = \"AudioPlayerManager\"",
"modifier": "private static final",
"original_string": "private static final String TAG = \"AudioPlayerManager\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "mediaPlayer",
"modifier": "pri... | {
"body": "public void play(String fileName, boolean isAsset) throws AudioFileException {\n if(fileName == null || fileName.isEmpty()) {\n throw new AudioFileException(MainApplication.getContextFromMainApp().getString(R.string.could_not_play_audio_message));\n }\n prepareMediaPlayer(fi... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_86 | {
"fields": [
{
"declarator": "languagesImportUtility",
"modifier": "private static",
"original_string": "private static LanguagesImportUtility languagesImportUtility;",
"type": "LanguagesImportUtility",
"var_name": "languagesImportUtility"
},
{
"declarator": "expectedV... | {
"body": "@Test\n public void shouldReturnEmptyMapIfInputStreamIsNull() {\n LanguagesImportUtility emptyLanguagesImportUtility = new LanguagesImportUtility(null);\n\n assertEquals(Collections.EMPTY_MAP, emptyLanguagesImportUtility.getLanguageMap());\n }",
"class_method_signature": "LanguagesImp... | {
"fields": [
{
"declarator": "TAG = LanguagesImportUtility.class.getName()",
"modifier": "private static final",
"original_string": "private static final String TAG = LanguagesImportUtility.class.getName();",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "lang... | {
"body": "public Map<String, List<String>> getLanguageMap() {\n return languageMap;\n }",
"class_method_signature": "LanguagesImportUtility.getLanguageMap()",
"constructor": false,
"full_signature": "public Map<String, List<String>> getLanguageMap()",
"identifier": "getLanguageMap",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_12 | {
"fields": [
{
"declarator": "A_LANGUAGE = \"A Language\"",
"modifier": "private static final",
"original_string": "private static final String A_LANGUAGE = \"A Language\";",
"type": "String",
"var_name": "A_LANGUAGE"
},
{
"declarator": "presenter",
"modifier": "... | {
"body": "@Test\n public void shouldSetNextButtonClickableWhenDestinationLanguagesExist() {\n HashSet<String> destinationLanguages = new HashSet<String>() {{\n add(A_LANGUAGE);\n }};\n when(newDeckContext.getDestinationLanguages()).thenReturn(destinationLanguages);\n\n prese... | {
"fields": [
{
"declarator": "REQUEST_CODE = 0",
"modifier": "private static final",
"original_string": "private static final int REQUEST_CODE = 0;",
"type": "int",
"var_name": "REQUEST_CODE"
},
{
"declarator": "view",
"modifier": "private final",
"original... | {
"body": "public void refreshView() {\n updateNextButtonState();\n populateLanguageChips();\n }",
"class_method_signature": "EnterDeckDestinationPresenter.refreshView()",
"constructor": false,
"full_signature": "public void refreshView()",
"identifier": "refreshView",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_121 | {
"fields": [
{
"declarator": "IS_NOT_CENTERED = 0",
"modifier": "private static final",
"original_string": "private static final int IS_NOT_CENTERED = 0;",
"type": "int",
"var_name": "IS_NOT_CENTERED"
},
{
"declarator": "IS_CENTERED = -1",
"modifier": "private st... | {
"body": "@Test\n public void shouldShowEmptyMyDecksViewWhenNoDecksArePresent() {\n MyDecksPresenter myDecksPresenter = new MyDecksPresenter(view, deckRepository);\n\n myDecksPresenter.refreshListFooter();\n\n verify(view).emptyViewState();\n verify(view).updateMyDeckListCentered(IS_CE... | {
"fields": [
{
"declarator": "IS_NOT_CENTERED = 0",
"modifier": "private static final",
"original_string": "private static final int IS_NOT_CENTERED = 0;",
"type": "int",
"var_name": "IS_NOT_CENTERED"
},
{
"declarator": "IS_CENTERED = RelativeLayout.TRUE",
"modif... | {
"body": "public void refreshListFooter() {\n if (decks.isEmpty()) {\n view.emptyViewState();\n view.updateMyDeckListCentered(IS_CENTERED);\n } else {\n view.nonEmptyViewState();\n view.updateMyDeckListCentered(IS_NOT_CENTERED);\n }\n }",
"class_m... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_45 | {
"fields": [
{
"declarator": "presenter",
"modifier": "private",
"original_string": "private EnterDeckSourceLanguagePresenter presenter;",
"type": "EnterDeckSourceLanguagePresenter",
"var_name": "presenter"
},
{
"declarator": "activity",
"modifier": "private",
... | {
"body": "@Test\n public void shouldStartEnterDeckTitleActivityWhenBackButtonClicked() {\n presenter.backButtonClicked();\n\n verify(activity).startActivityWithClass(EnterDeckTitleActivity.class);\n }",
"class_method_signature": "EnterDeckSourceLanguagePresenterTest.shouldStartEnterDeckTitleAct... | {
"fields": [
{
"declarator": "REQUEST_CODE = 0",
"modifier": "private final",
"original_string": "private final int REQUEST_CODE = 0;",
"type": "int",
"var_name": "REQUEST_CODE"
},
{
"declarator": "activity",
"modifier": "private",
"original_string": "priva... | {
"body": "public void backButtonClicked() {\n activity.startActivityWithClass(EnterDeckTitleActivity.class);\n }",
"class_method_signature": "EnterDeckSourceLanguagePresenter.backButtonClicked()",
"constructor": false,
"full_signature": "public void backButtonClicked()",
"identifier": "backButtonCl... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_137 | {
"fields": [
{
"declarator": "TRANSLATION_LABEL = \"Test Translation\"",
"modifier": "public static final",
"original_string": "public static final String TRANSLATION_LABEL = \"Test Translation\";",
"type": "String",
"var_name": "TRANSLATION_LABEL"
},
{
"declarator": "... | {
"body": "@Test\n public void shouldUseCorrectKeyWhenPassingDeckToIntentWhenEditTriggered() {\n View resultingView = cardListAdapter.getView(0, null, null);\n resultingView.findViewById(R.id.translation_card_edit).performClick();\n boolean hasExtra = shadowOf(shadowOf(activity).getNextStarted... | {
"fields": [
{
"declarator": "translationService",
"modifier": "private",
"original_string": "private TranslationService translationService;",
"type": "TranslationService",
"var_name": "translationService"
},
{
"declarator": "dictionaryService",
"modifier": "priv... | {
"body": "@Override\n public View getView(int position, View translationItemView, ViewGroup parent) {\n Translation item = getItem(position);\n TranslationCardItem cardItem;\n if (translationItemView == null) {\n cardItem = new TranslationCardItem(context);\n cardItem.se... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_53 | {
"fields": [
{
"declarator": "helper = new AddDeckActivityHelper<>(EnterDeckTitleActivity.class)",
"modifier": "private",
"original_string": "private AddDeckActivityHelper<EnterDeckTitleActivity> helper = new AddDeckActivityHelper<>(EnterDeckTitleActivity.class);",
"type": "AddDeckActivit... | {
"body": "@Test\n public void updateNextButton() {\n boolean buttonClickable = true;\n int buttonColor = R.color.primaryTextColor;\n int buttonArrow = R.drawable.forward_arrow;\n activity.updateNextButton(buttonClickable, buttonColor, buttonArrow);\n\n View nextButton = activity... | {
"fields": [
{
"declarator": "deckTitleInput",
"modifier": "@Bind(R.id.deck_title_input)",
"original_string": "@Bind(R.id.deck_title_input)TextView deckTitleInput;",
"type": "TextView",
"var_name": "deckTitleInput"
},
{
"declarator": "nextButton",
"modifier": "@B... | {
"body": "@Override\n public void updateNextButton(boolean buttonClickable, int buttonTextColor, int buttonArrow) {\n nextButton.setClickable(buttonClickable);\n nextButtonText.setTextColor(ContextCompat.getColor(this, buttonTextColor));\n nextButtonImage.setBackgroundResource(buttonArrow);\n... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_52 | {
"fields": [
{
"declarator": "NO_DECK_TITLE = \"\"",
"modifier": "private static final",
"original_string": "private static final String NO_DECK_TITLE = \"\";",
"type": "String",
"var_name": "NO_DECK_TITLE"
},
{
"declarator": "A_DECK_TITLE = \"a deck title\"",
"m... | {
"body": "@Test\n public void shouldUpdateDeckTitleWhenDeckTextChanges() {\n when(newDeckContext.getDeckTitle()).thenReturn(A_DECK_TITLE);\n\n presenter.deckTitleInputChanged(A_DECK_TITLE);\n\n verify(newDeckContext).setDeckTitle(A_DECK_TITLE);\n }",
"class_method_signature": "EnterDeckT... | {
"fields": [
{
"declarator": "activity",
"modifier": "private",
"original_string": "private EnterDeckTitleView activity;",
"type": "EnterDeckTitleView",
"var_name": "activity"
},
{
"declarator": "newDeckContext",
"modifier": "private",
"original_string": "p... | {
"body": "public void deckTitleInputChanged(String deckTitle) {\n newDeckContext.setDeckTitle(deckTitle);\n updateNextButton();\n }",
"class_method_signature": "EnterDeckTitlePresenter.deckTitleInputChanged(String deckTitle)",
"constructor": false,
"full_signature": "public void deckTitleInput... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_136 | {
"fields": [
{
"declarator": "TRANSLATION_LABEL = \"Test Translation\"",
"modifier": "public static final",
"original_string": "public static final String TRANSLATION_LABEL = \"Test Translation\";",
"type": "String",
"var_name": "TRANSLATION_LABEL"
},
{
"declarator": "... | {
"body": "@Test\n public void shouldUseCorrectKeyWhenPassingContextToIntentWhenEditTriggered() {\n\n View resultingView = cardListAdapter.getView(0, null, null);\n resultingView.findViewById(R.id.translation_card_edit).performClick();\n boolean hasExtra = shadowOf(shadowOf(activity).getNextSt... | {
"fields": [
{
"declarator": "translationService",
"modifier": "private",
"original_string": "private TranslationService translationService;",
"type": "TranslationService",
"var_name": "translationService"
},
{
"declarator": "dictionaryService",
"modifier": "priv... | {
"body": "@Override\n public View getView(int position, View translationItemView, ViewGroup parent) {\n Translation item = getItem(position);\n TranslationCardItem cardItem;\n if (translationItemView == null) {\n cardItem = new TranslationCardItem(context);\n cardItem.se... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_44 | {
"fields": [
{
"declarator": "presenter",
"modifier": "private",
"original_string": "private EnterDeckSourceLanguagePresenter presenter;",
"type": "EnterDeckSourceLanguagePresenter",
"var_name": "presenter"
},
{
"declarator": "activity",
"modifier": "private",
... | {
"body": "@Test\n public void shouldStartEnterDeckDestinationLanguagesActivityWhenNextButtonClicked() {\n presenter.nextButtonClicked();\n\n verify(activity).startActivityWithClass(EnterDeckDestinationLanguagesActivity.class);\n }",
"class_method_signature": "EnterDeckSourceLanguagePresenterTes... | {
"fields": [
{
"declarator": "REQUEST_CODE = 0",
"modifier": "private final",
"original_string": "private final int REQUEST_CODE = 0;",
"type": "int",
"var_name": "REQUEST_CODE"
},
{
"declarator": "activity",
"modifier": "private",
"original_string": "priva... | {
"body": "public void nextButtonClicked() {\n activity.startActivityWithClass(EnterDeckDestinationLanguagesActivity.class);\n }",
"class_method_signature": "EnterDeckSourceLanguagePresenter.nextButtonClicked()",
"constructor": false,
"full_signature": "public void nextButtonClicked()",
"identifier"... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_120 | {
"fields": [
{
"declarator": "deckItem",
"modifier": "private",
"original_string": "private DeckItem deckItem;",
"type": "DeckItem",
"var_name": "deckItem"
},
{
"declarator": "deckService",
"modifier": "@Inject",
"original_string": "@Inject DeckService deck... | {
"body": "@Test\n public void shouldStartTranslationsActivityWhenDeckItemIsClicked() {\n deckItem.deckClicked();\n\n verify(deckService).setCurrentDeck(deck);\n verify(dictionaryService).setCurrentDictionary(0);\n assertEquals(TranslationsActivity.class.getName(), shadowOf((Activity) d... | {
"fields": [
{
"declarator": "DELETE_DECK = \"Delete\"",
"modifier": "public static final",
"original_string": "public static final String DELETE_DECK = \"Delete\";",
"type": "String",
"var_name": "DELETE_DECK"
},
{
"declarator": "SHARE_DECK = \"Share\"",
"modifi... | {
"body": "@OnClick(R.id.deck_card)\n public void deckClicked() {\n Intent decksIntent = new Intent(getContext(), TranslationsActivity.class);\n deckService.setCurrentDeck(deck);\n dictionaryService.setCurrentDictionary(0);\n getContext().startActivity(decksIntent);\n }",
"class_me... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
49656131_13 | {
"fields": [
{
"declarator": "A_LANGUAGE = \"A Language\"",
"modifier": "private static final",
"original_string": "private static final String A_LANGUAGE = \"A Language\";",
"type": "String",
"var_name": "A_LANGUAGE"
},
{
"declarator": "presenter",
"modifier": "... | {
"body": "@Test\n public void shouldSetNextButtonToNotClickableWhenNoDestinationLanguagesArePresent() {\n when(newDeckContext.getDestinationLanguages()).thenReturn(new HashSet<String>());\n\n presenter.refreshView();\n\n verify(view).disableNextButton();\n }",
"class_method_signature": "... | {
"fields": [
{
"declarator": "REQUEST_CODE = 0",
"modifier": "private static final",
"original_string": "private static final int REQUEST_CODE = 0;",
"type": "int",
"var_name": "REQUEST_CODE"
},
{
"declarator": "view",
"modifier": "private final",
"original... | {
"body": "public void refreshView() {\n updateNextButtonState();\n populateLanguageChips();\n }",
"class_method_signature": "EnterDeckDestinationPresenter.refreshView()",
"constructor": false,
"full_signature": "public void refreshView()",
"identifier": "refreshView",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 49656131,
"size": 5658,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/translation-cards/translation-cards"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.