id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
30044052_181 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static TextileMarkup markup;",
"type": "TextileMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-textile/src/test/java/com/twasyl/slideshowfx/markup/textile/TextileMarkupTe... | {
"body": "@Test\n public void generateH1() {\n final String result = markup.convertAsHtml(\"h1. A title\");\n\n assertEquals(\"<h1 id=\\\"Atitle\\\">A title</h1>\", result);\n }",
"class_method_signature": "TextileMarkupTest.generateH1()",
"constructor": false,
"full_signature": "@Test publ... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(TextileMarkup.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(TextileMarkup.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
... | {
"body": "@Override\n public String convertAsHtml(String markupString) {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n String result = null;\n\n try (final StringWriter writer = new String... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_119 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static HtmlMarkup markup;",
"type": "HtmlMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-html/src/test/java/com/twasyl/slideshowfx/markup/html/HtmlMarkupTest.java",
"id... | {
"body": "@Test\n public void generateCodeBloc() {\n final String result = markup.convertAsHtml(\"<pre><code>final String s;</code></pre>\");\n\n assertEquals(\"<pre><code>final String s;</code></pre>\", result);\n }",
"class_method_signature": "HtmlMarkupTest.generateCodeBloc()",
"constructo... | {
"fields": [],
"file": "slideshowfx-html/src/main/java/com/twasyl/slideshowfx/markup/html/HtmlMarkup.java",
"identifier": "HtmlMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "HtmlMarkup.HtmlMarkup()",
"constructor": true,
"full_signature": "public HtmlMarkup()",
... | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n return markupString;\n }",
"class_metho... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_52 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void givenClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"GroovyTest\");\n\n assertEquals(\"GroovyTest\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "GroovySnip... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "GroovySnipp... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_44 | {
"fields": [],
"file": "slideshowfx-icons/src/test/java/com/twasyl/slideshowfx/icons/FontAwesomeTest.java",
"identifier": "FontAwesomeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void obtainJavaScriptFileFromRelativePath() throws URISyntaxException {\n assertFontAwesomeUrl(FontAwesome.getFontAwesomeFile(\"js/all.min.js\"));\n }",
"class_method_signature": "FontAwesomeTest.obtainJavaScriptFileFromRelativePath()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(FontAwesome.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(FontAwesome.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "public static URL getFontAwesomeFile(final String relativePath) {\n return FontAwesome.class.getResource(FONTAWESOME_ROOT + relativePath);\n }",
"class_method_signature": "FontAwesome.getFontAwesomeFile(final String relativePath)",
"constructor": false,
"full_signature": "public static URL ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_158 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static AsciidoctorMarkup markup;",
"type": "AsciidoctorMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-asciidoctor/src/test/java/com/twasyl/slideshowfx/markup/asciidoctor... | {
"body": "@Test public void generateInlineCode() {\n final String result = markup.convertAsHtml(\"<code>public class Java { }</code>\");\n\n assertEquals(\"<code>public class Java { }</code>\", result);\n }",
"class_method_signature": "AsciidoctorMarkupTest.generateInlineCode()",
"constructor": ... | {
"fields": [
{
"declarator": "asciidoctor",
"modifier": "private final",
"original_string": "private final Asciidoctor asciidoctor;",
"type": "Asciidoctor",
"var_name": "asciidoctor"
}
],
"file": "slideshowfx-asciidoctor/src/main/java/com/twasyl/slideshowfx/markup/asciidocto... | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final AttributesBuilder attributes = Attribu... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_13 | {
"fields": [
{
"declarator": "snippetExecutor = new GoloSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoloSnippetExecutor snippetExecutor = new GoloSnippetExecutor();",
"type": "GoloSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"fi... | {
"body": "@Test\n public void noModuleName() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertEquals(\"slideshowfx.Snippet\", snippetExecutor.determineModuleName(snippet));\n }",
"class_method_signature": "GoloSnippetExecutorTest.noModuleName()",
"constructor": false,
"full_sign... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "protected String determineModuleName(final CodeSnippet codeSnippet) {\n String moduleName = codeSnippet.getProperties().get(MODULE_NAME_PROPERTY);\n if (moduleName == null || moduleName.isEmpty()) moduleName = \"slideshowfx.Snippet\";\n return moduleName;\n }",
"class_method_signa... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_174 | {
"fields": [],
"file": "slideshowfx-ui-controls/src/test/java/com/twasyl/slideshowfx/ui/controls/validators/ValidatorsTest.java",
"identifier": "ValidatorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isIntegerWithEmptyString() {\n assertFalse(isInteger().isValid(\"\"));\n }",
"class_method_signature": "ValidatorsTest.isIntegerWithEmptyString()",
"constructor": false,
"full_signature": "@Test public void isIntegerWithEmptyString()",
"identifier": "isIntegerWithEm... | {
"fields": [],
"file": "slideshowfx-ui-controls/src/main/java/com/twasyl/slideshowfx/ui/controls/validators/Validators.java",
"identifier": "Validators",
"interfaces": "",
"methods": [
{
"class_method_signature": "Validators.isNotEmpty()",
"constructor": false,
"full_signature": "public... | {
"body": "public static IValidator<String> isInteger() {\n return value -> {\n try {\n Integer.parseInt(value);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n };\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_68 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void buildSourceCodeAsScript() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"TestGroovy\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpackage\");\n s... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n boolean someImportsPresent = false;\n\n if (makeScript(codeSnippet)) {\n sourceCode.append(getScriptImport()).append(\"\\n\");\n ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_87 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void saveWithEmptyDocument() throws Exception {\n final String path = \"presentation.sfx\";\n final LocalDateTime openedDateTime = LocalDateTime.now();\n\n final RecentPresentation recentPresentation = new RecentPresentation(path, openedDateTime);\n final ByteA... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation) throws ContextFileException {\n final Document document = createDocumentFromInput(input);\n\n populat... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_123 | {
"fields": [
{
"declarator": "snippetExecutor = new KotlinSnippetExecutor()",
"modifier": "private final",
"original_string": "private final KotlinSnippetExecutor snippetExecutor = new KotlinSnippetExecutor();",
"type": "KotlinSnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void hasEmptyImports() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"\");\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "KotlinSnippetExecutorTest.hasEmptyImports()",
... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "KotlinSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_135 | {
"fields": [
{
"declarator": "snippetExecutor = new KotlinSnippetExecutor()",
"modifier": "private final",
"original_string": "private final KotlinSnippetExecutor snippetExecutor = new KotlinSnippetExecutor();",
"type": "KotlinSnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void buildSourceCodeWithoutWrapInMain() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(PACKAGE_NAME_PROPERTY, \"SlideshowFX\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpackage\")... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n if (hasPackage(codeSnippet)) {\n sourceCode.append(getPackage(codeSnippet)).append(\"\\n\\n\");\n }\n\n if (hasImports(code... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_29 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"fi... | {
"body": "@Test\n public void hasNoImports() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "JavaSnippetExecutorTest.hasNoImports()",
"constructor": false,
"full_signature": "@Test public void hasNoImp... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"co... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_162 | {
"fields": [
{
"declarator": "ENDPOINT_1 = \"endpoint.1\"",
"modifier": "public static final",
"original_string": "public static final String ENDPOINT_1 = \"endpoint.1\";",
"type": "String",
"var_name": "ENDPOINT_1"
},
{
"declarator": "ENDPOINT_2 = \"endpoint.2\"",
... | {
"body": "@Test\n public void unSubscribe() throws InterruptedException {\n EventBus.getInstance().unsubscribe(ENDPOINT_1, SUPPORT_MESSAGE_ACTOR_1);\n EventBus.getInstance().broadcast(ENDPOINT_1, \"Test\");\n Thread.sleep(10);\n\n assertFalse(SUPPORT_MESSAGE_ACTOR_1.gotMessage);\n }... | {
"fields": [
{
"declarator": "singleton = null",
"modifier": "private static volatile",
"original_string": "private static volatile EventBus singleton = null;",
"type": "EventBus",
"var_name": "singleton"
},
{
"declarator": "endPointsAndActorsMapping = new ConcurrentHa... | {
"body": "public synchronized EventBus unsubscribe(final String endPoint, final Actor actor) {\n checkActorIsValid(actor);\n checkEndPointIsValid(endPoint);\n\n final String trimmedEndPoint = endPoint.trim();\n if (endPointsAndActorsMapping.containsKey(trimmedEndPoint)) {\n end... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_91 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void readWithoutPath() {\n final ByteArrayInputStream input = new ByteArrayInputStream((\"<slideshowfx><recentPresentations><recentPresentation><id>presentation01</id><openedDateTime>\" + LocalDateTime.now() + \"</openedDateTime></recentPresentation></recentPresentations></slidesho... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input) {\n final Set<RecentPresentation> presentations = new TreeSet<>();\n\n try {\n final Document document = createDocumentFromInput(input);\n\n final Node recentPresentationsN... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_163 | {
"fields": [
{
"declarator": "ENDPOINT_1 = \"endpoint.1\"",
"modifier": "public static final",
"original_string": "public static final String ENDPOINT_1 = \"endpoint.1\";",
"type": "String",
"var_name": "ENDPOINT_1"
},
{
"declarator": "ENDPOINT_2 = \"endpoint.2\"",
... | {
"body": "@Test\n public void removeEndpoint() {\n EventBus.getInstance().subscribe(ENDPOINT_3, SUPPORT_MESSAGE_ACTOR_1);\n EventBus.getInstance().removeEndpoint(ENDPOINT_3);\n EventBus.getInstance().broadcast(ENDPOINT_3, \"Test\");\n assertFalse(SUPPORT_MESSAGE_ACTOR_1.gotMessage);\n ... | {
"fields": [
{
"declarator": "singleton = null",
"modifier": "private static volatile",
"original_string": "private static volatile EventBus singleton = null;",
"type": "EventBus",
"var_name": "singleton"
},
{
"declarator": "endPointsAndActorsMapping = new ConcurrentHa... | {
"body": "public synchronized EventBus removeEndpoint(final String endPoint) {\n checkEndPointIsValid(endPoint);\n\n final String trimmedEndPoint = endPoint.trim();\n endPointsAndActorsMapping.remove(trimmedEndPoint);\n\n return this;\n }",
"class_method_signature": "EventBus.removeE... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_90 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void readWithoutOpenedPresentationDate() {\n final ByteArrayInputStream input = new ByteArrayInputStream(\"<slideshowfx><recentPresentations><recentPresentation><id>presentation01</id><file>/presentation01.sfx</file></recentPresentation></recentPresentations></slideshowfx>\".getByt... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input) {\n final Set<RecentPresentation> presentations = new TreeSet<>();\n\n try {\n final Document document = createDocumentFromInput(input);\n\n final Node recentPresentationsN... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_134 | {
"fields": [
{
"declarator": "snippetExecutor = new KotlinSnippetExecutor()",
"modifier": "private final",
"original_string": "private final KotlinSnippetExecutor snippetExecutor = new KotlinSnippetExecutor();",
"type": "KotlinSnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void buildSourceCodeWithoutImportsAndWithoutWrapInMain() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(PACKAGE_NAME_PROPERTY, \"SlideshowFX\");\n\n snippet.setCode(\"fun main(args: Array<String>) {\\n\\tprintln(\\\... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n if (hasPackage(codeSnippet)) {\n sourceCode.append(getPackage(codeSnippet)).append(\"\\n\\n\");\n }\n\n if (hasImports(code... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_28 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"fi... | {
"body": "@Test\n public void givenClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"JavaTest\");\n\n assertEquals(\"JavaTest\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "JavaSnippetExe... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "JavaSnippet... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_122 | {
"fields": [
{
"declarator": "snippetExecutor = new KotlinSnippetExecutor()",
"modifier": "private final",
"original_string": "private final KotlinSnippetExecutor snippetExecutor = new KotlinSnippetExecutor();",
"type": "KotlinSnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void hasNoImports() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "KotlinSnippetExecutorTest.hasNoImports()",
"constructor": false,
"full_signature": "@Test public void hasNoI... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "KotlinSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_175 | {
"fields": [],
"file": "slideshowfx-ui-controls/src/test/java/com/twasyl/slideshowfx/ui/controls/validators/ValidatorsTest.java",
"identifier": "ValidatorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isIntegerWithText() {\n assertFalse(isInteger().isValid(\"Test\"));\n }",
"class_method_signature": "ValidatorsTest.isIntegerWithText()",
"constructor": false,
"full_signature": "@Test public void isIntegerWithText()",
"identifier": "isIntegerWithText",
"invocatio... | {
"fields": [],
"file": "slideshowfx-ui-controls/src/main/java/com/twasyl/slideshowfx/ui/controls/validators/Validators.java",
"identifier": "Validators",
"interfaces": "",
"methods": [
{
"class_method_signature": "Validators.isNotEmpty()",
"constructor": false,
"full_signature": "public... | {
"body": "public static IValidator<String> isInteger() {\n return value -> {\n try {\n Integer.parseInt(value);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n };\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_69 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/RecentPresentationTest.java",
"identifier": "RecentPresentationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @DisplayName(\"is equal to itself\")\n void isEqualToItself() {\n final RecentPresentation presentation = new RecentPresentation(\"presentation1.sfx\", null);\n assertTrue(presentation.equals(presentation));\n }",
"class_method_signature": "RecentPresentationTest.isEqualToI... | {
"fields": [
{
"declarator": "openedDateTime",
"modifier": "private",
"original_string": "private LocalDateTime openedDateTime;",
"type": "LocalDateTime",
"var_name": "openedDateTime"
},
{
"declarator": "normalizedPath",
"modifier": "private",
"original_str... | {
"body": "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n if (!super.equals(o)) return false;\n\n final RecentPresentation that = (RecentPresentation) o;\n\n return getNormalizedPath().equ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_86 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void recentPresentationsAreSortedByNormalizedPath() {\n final RecentPresentation recentPresentation1 = new RecentPresentation(\"presentation1.sfx\", LocalDateTime.now());\n final RecentPresentation recentPresentation2 = new RecentPresentation(\"presentation2.sfx\", recentPre... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input) {\n final Set<RecentPresentation> presentations = new TreeSet<>();\n\n try {\n final Document document = createDocumentFromInput(input);\n\n final Node recentPresentationsN... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_12 | {
"fields": [
{
"declarator": "file = new File(\"image.png\")",
"modifier": "",
"original_string": "File file = new File(\"image.png\");",
"type": "File",
"var_name": "file"
},
{
"declarator": "html = new HtmlMarkup()",
"modifier": "",
"original_string": "IM... | {
"body": "@TestFactory\n @DisplayName(\"should generate content\")\n Stream<DynamicTest> testingContentGeneration() {\n // @formatter:off\n return Stream.of(\n new ExpectedContent(html)\n .withDisplayName(\"without dimensions in HTML\")\n ... | {
"fields": [],
"file": "slideshowfx-image-extension/src/main/java/com/twasyl/slideshowfx/content/extension/image/ImageContentExtension.java",
"identifier": "ImageContentExtension",
"interfaces": "",
"methods": [
{
"class_method_signature": "ImageContentExtension.ImageContentExtension()",
"con... | {
"body": "@Override\n public String buildContentString(IMarkup markup) {\n final StringBuilder builder = new StringBuilder();\n\n if (this.getController().getSelectedFile() != null) {\n if (markup == null || \"HTML\".equals(markup.getCode())) {\n builder.append(this.buildDe... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_45 | {
"fields": [
{
"declarator": "FILE_LOCATION",
"modifier": "private static",
"original_string": "private static File FILE_LOCATION;",
"type": "File",
"var_name": "FILE_LOCATION"
},
{
"declarator": "MISSING_FILE",
"modifier": "private static",
"original_strin... | {
"body": "@Test\n public void fileSeemsInvalidWhenNullFile() {\n assertThrows(NullPointerException.class, () -> controller.fileSeemsValid(null));\n }",
"class_method_signature": "PluginCenterControllerTest.fileSeemsInvalidWhenNullFile()",
"constructor": false,
"full_signature": "@Test public void ... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(PluginCenterController.class.getName())",
"modifier": "private static",
"original_string": "private static Logger LOGGER = Logger.getLogger(PluginCenterController.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean fileSeemsValid(final PluginFile file) throws FileNotFoundException {\n if (file == null) throw new NullPointerException(\"The file to check can not be null\");\n if (!file.exists()) throw new FileNotFoundException(\"The file to check must exist\");\n\n final Registere... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_159 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static AsciidoctorMarkup markup;",
"type": "AsciidoctorMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-asciidoctor/src/test/java/com/twasyl/slideshowfx/markup/asciidoctor... | {
"body": "@Test public void generateCodeBloc() {\n final String result = markup.convertAsHtml(\"[source,java]\\n----\\nfinal String s;\\n----\\n\");\n System.out.println(result);\n assertEquals(\"<pre><code>final String s;</code></pre>\", result);\n }",
"class_method_signature": "Asciidocto... | {
"fields": [
{
"declarator": "asciidoctor",
"modifier": "private final",
"original_string": "private final Asciidoctor asciidoctor;",
"type": "Asciidoctor",
"var_name": "asciidoctor"
}
],
"file": "slideshowfx-asciidoctor/src/main/java/com/twasyl/slideshowfx/markup/asciidocto... | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final AttributesBuilder attributes = Attribu... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_53 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void noScript() {\n final CodeSnippet codeSnippet = new CodeSnippet();\n\n assertFalse(snippetExecutor.makeScript(codeSnippet));\n }",
"class_method_signature": "GroovySnippetExecutorTest.noScript()",
"constructor": false,
"full_signature": "@Test public void noScri... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected boolean makeScript(final CodeSnippet codeSnippet) {\n if (codeSnippet.getProperties().containsKey(MAKE_SCRIPT)) {\n return Boolean.parseBoolean(codeSnippet.getProperties().get(MAKE_SCRIPT));\n } else {\n return false;\n }\n }",
"class_method_signatu... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_118 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static HtmlMarkup markup;",
"type": "HtmlMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-html/src/test/java/com/twasyl/slideshowfx/markup/html/HtmlMarkupTest.java",
"id... | {
"body": "@Test\n public void generateInlineCode() {\n final String result = markup.convertAsHtml(\"<code>public class Java { }</code>\");\n\n assertEquals(\"<code>public class Java { }</code>\", result);\n }",
"class_method_signature": "HtmlMarkupTest.generateInlineCode()",
"constructor": fa... | {
"fields": [],
"file": "slideshowfx-html/src/main/java/com/twasyl/slideshowfx/markup/html/HtmlMarkup.java",
"identifier": "HtmlMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "HtmlMarkup.HtmlMarkup()",
"constructor": true,
"full_signature": "public HtmlMarkup()",
... | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n return markupString;\n }",
"class_metho... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_73 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/RecentPresentationTest.java",
"identifier": "RecentPresentationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @DisplayName(\"is greater than a null one\")\n void compareToNull() {\n final RecentPresentation presentation = new RecentPresentation(\"presentation1.sfx\", null);\n assertTrue(presentation.compareTo(null) > 0);\n }",
"class_method_signature": "RecentPresentationTest.compa... | {
"fields": [
{
"declarator": "openedDateTime",
"modifier": "private",
"original_string": "private LocalDateTime openedDateTime;",
"type": "LocalDateTime",
"var_name": "openedDateTime"
},
{
"declarator": "normalizedPath",
"modifier": "private",
"original_str... | {
"body": "@Override\n public int compareTo(File o) {\n if (o != null && o instanceof RecentPresentation) {\n final RecentPresentation other = (RecentPresentation) o;\n return this.getNormalizedPath().compareTo(other.getNormalizedPath());\n }\n\n return 1;\n }",
"cla... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_180 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static TextileMarkup markup;",
"type": "TextileMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-textile/src/test/java/com/twasyl/slideshowfx/markup/textile/TextileMarkupTe... | {
"body": "@Test\n public void generateWithNull() {\n assertThrows(IllegalArgumentException.class, () -> markup.convertAsHtml(null));\n }",
"class_method_signature": "TextileMarkupTest.generateWithNull()",
"constructor": false,
"full_signature": "@Test public void generateWithNull()",
"identifier... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(TextileMarkup.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(TextileMarkup.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
... | {
"body": "@Override\n public String convertAsHtml(String markupString) {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n String result = null;\n\n try (final StringWriter writer = new String... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_24 | {
"fields": [
{
"declarator": "snippetExecutor = new GoloSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoloSnippetExecutor snippetExecutor = new GoloSnippetExecutor();",
"type": "GoloSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"fi... | {
"body": "@Test\n public void buildSourceCodeWithoutWrapInMain() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(MODULE_NAME_PROPERTY, \"sfx.Golo\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpackage\");\n\... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n sourceCode.append(getStartModuleDefinition(codeSnippet)).append(\"\\n\\n\");\n\n if (hasImports(codeSnippet)) {\n sourceCode.appen... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_138 | {
"fields": [
{
"declarator": "snippetExecutor = new ScalaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final ScalaSnippetExecutor snippetExecutor = new ScalaSnippetExecutor();",
"type": "ScalaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
... | {
"body": "@Test\n public void emptyClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"\");\n\n assertEquals(\"Snippet\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "ScalaSnippetExecutorTes... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "ScalaSnippe... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_211 | {
"fields": [],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombinationTest.java",
"identifier": "SlideshowFXKeyCombinationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMetaA() {\n final SlideshowFXKeyCombination combination = SlideshowFXKeyCombination.valueOf(\"Meta+A\");\n assertCombination(UP, UP, UP, DOWN, UP, \"A\", combination);\n }",
"class_method_signature": "SlideshowFXKeyCombinationTest.testMetaA()",
"constructor":... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName())",
"modifier": "public static final",
"original_string": "public static final Logger LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName());",
"type": "Logger",
"var_name"... | {
"body": "public static SlideshowFXKeyCombination valueOf(String value) {\n if (value == null) throw new NullPointerException(\"The value can not be null\");\n if (value.isEmpty()) throw new IllegalArgumentException(\"The value can not be empty\");\n\n String determinedText = null;\n KeyC... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_32 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"fi... | {
"body": "@Test\n public void formatImportWithoutImportKeyword() {\n assertEquals(\"import mypackage;\", snippetExecutor.formatImportLine(\"mypackage\"));\n }",
"class_method_signature": "JavaSnippetExecutorTest.formatImportWithoutImportKeyword()",
"constructor": false,
"full_signature": "@Test pu... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "protected String formatImportLine(final String importLine) {\n final String importLineBeginning = \"import \";\n final String importLineEnding = \";\";\n\n String formattedImportLine;\n\n if (importLine.startsWith(importLineBeginning)) {\n formattedImportLine = import... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_207 | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ZipUtilsTest.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ZipUtilsTest.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Test\n public void zipSlipVulnerabilityManaged() throws IOException {\n final File zipFile = new File(testResultsDir, \"zipSlipVulnerability.zip\");\n zipFile.deleteOnExit();\n\n try (final FileOutputStream fileOutputStream = new FileOutputStream(zipFile);\n final ZipOu... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ZipUtils.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ZipUtils.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": ... | {
"body": "public static void unzip(File archive, File destination) throws IOException {\n if (archive == null) throw new NullPointerException(\"The ZIP file can not be null\");\n if (!archive.exists()) throw new FileNotFoundException(\"The ZIP file does not exist\");\n\n // Unzip\n LOGGER... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_65 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
... | {
"body": "@Test\n public void buildSourceCodeWithoutWrapInMethodRunner() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"TestGroovy\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpacka... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n boolean someImportsPresent = false;\n\n if (makeScript(codeSnippet)) {\n sourceCode.append(getScriptImport()).append(\"\\n\");\n ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_179 | {
"fields": [],
"file": "slideshowfx-ui-controls/src/test/java/com/twasyl/slideshowfx/ui/controls/validators/ValidatorsTest.java",
"identifier": "ValidatorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isIntegerWithInteger() {\n assertTrue(isInteger().isValid(\"10\"));\n }",
"class_method_signature": "ValidatorsTest.isIntegerWithInteger()",
"constructor": false,
"full_signature": "@Test public void isIntegerWithInteger()",
"identifier": "isIntegerWithInteger",
"... | {
"fields": [],
"file": "slideshowfx-ui-controls/src/main/java/com/twasyl/slideshowfx/ui/controls/validators/Validators.java",
"identifier": "Validators",
"interfaces": "",
"methods": [
{
"class_method_signature": "Validators.isNotEmpty()",
"constructor": false,
"full_signature": "public... | {
"body": "public static IValidator<String> isInteger() {\n return value -> {\n try {\n Integer.parseInt(value);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n };\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_196 | {
"fields": [
{
"declarator": "snippetExecutor = new GoSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoSnippetExecutor snippetExecutor = new GoSnippetExecutor();",
"type": "GoSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "sl... | {
"body": "@Test\n public void importsWithAndWithoutDoubleQuotes() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"\\\"mypackage\\\"\\nmysecondpackage\");\n\n assertEquals(\"import (\\n\\t\\\"mypackage\\\"\\n\\t\\\"mysecon... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "protected String getImports(final CodeSnippet codeSnippet) throws IOException {\n final StringJoiner imports = new StringJoiner(\"\\n\");\n\n try (final StringReader stringReader = new StringReader(codeSnippet.getProperties().get(IMPORTS_PROPERTY));\n final BufferedReader reader =... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_102 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static MarkdownMarkup markup;",
"type": "MarkdownMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-markdown/src/test/java/com/twasyl/slideshowfx/markup/markdown/MarkdownMar... | {
"body": "@Test\n void generateWithNull() {\n assertThrows(IllegalArgumentException.class, () -> markup.convertAsHtml(null));\n }",
"class_method_signature": "MarkdownMarkupTest.generateWithNull()",
"constructor": false,
"full_signature": "@Test void generateWithNull()",
"identifier": "generateW... | {
"fields": [
{
"declarator": "extensions",
"modifier": "private final",
"original_string": "private final List<Extension> extensions;",
"type": "List<Extension>",
"var_name": "extensions"
}
],
"file": "slideshowfx-markdown/src/main/java/com/twasyl/slideshowfx/markup/markdown... | {
"body": "@Override\n public String convertAsHtml(String markupString) {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final Parser parser = Parser.builder().extensions(extensions).build();\n ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_155 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static AsciidoctorMarkup markup;",
"type": "AsciidoctorMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-asciidoctor/src/test/java/com/twasyl/slideshowfx/markup/asciidoctor... | {
"body": "@Test\n public void generateWithNull() {\n assertThrows(IllegalArgumentException.class, () -> markup.convertAsHtml(null));\n }",
"class_method_signature": "AsciidoctorMarkupTest.generateWithNull()",
"constructor": false,
"full_signature": "@Test public void generateWithNull()",
"identi... | {
"fields": [
{
"declarator": "asciidoctor",
"modifier": "private final",
"original_string": "private final Asciidoctor asciidoctor;",
"type": "Asciidoctor",
"var_name": "asciidoctor"
}
],
"file": "slideshowfx-asciidoctor/src/main/java/com/twasyl/slideshowfx/markup/asciidocto... | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final AttributesBuilder attributes = Attribu... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_49 | {
"fields": [
{
"declarator": "FILE_LOCATION",
"modifier": "private static",
"original_string": "private static File FILE_LOCATION;",
"type": "File",
"var_name": "FILE_LOCATION"
},
{
"declarator": "MISSING_FILE",
"modifier": "private static",
"original_strin... | {
"body": "@Test\n public void isManifestAttributeInvalidWhenOnlySpaces() {\n assertFalse(controller.isValueValid(\" \"));\n }",
"class_method_signature": "PluginCenterControllerTest.isManifestAttributeInvalidWhenOnlySpaces()",
"constructor": false,
"full_signature": "@Test public void isManifes... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(PluginCenterController.class.getName())",
"modifier": "private static",
"original_string": "private static Logger LOGGER = Logger.getLogger(PluginCenterController.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean isValueValid(final String value) {\n return value != null && !value.trim().isEmpty();\n }",
"class_method_signature": "PluginCenterController.isValueValid(final String value)",
"constructor": false,
"full_signature": "protected boolean isValueValid(final String value)",
... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_143 | {
"fields": [
{
"declarator": "snippetExecutor = new ScalaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final ScalaSnippetExecutor snippetExecutor = new ScalaSnippetExecutor();",
"type": "ScalaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
... | {
"body": "@Test\n public void formatImportWithoutImportKeyword() {\n assertEquals(\"import mypackage\", snippetExecutor.formatImportLine(\"mypackage\"));\n }",
"class_method_signature": "ScalaSnippetExecutorTest.formatImportWithoutImportKeyword()",
"constructor": false,
"full_signature": "@Test pu... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "protected String formatImportLine(final String importLine) {\n final String importLineBeginning = \"import \";\n String formattedImportLine;\n\n if (importLine.startsWith(importLineBeginning)) {\n formattedImportLine = importLine;\n } else {\n formattedImpo... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_6 | {
"fields": [],
"file": "slideshowfx-plugin-manager/src/test/java/com/twasyl/slideshowfx/plugin/manager/internal/RegisteredPluginTest.java",
"identifier": "RegisteredPluginTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void getNameWhenNotUnzipped() throws IOException {\n final File plugin = PluginTestUtils.createDummyPlugin(\"my-plugin\", \"Awesome plugin\", \"1.0\");\n final RegisteredPlugin registeredPlugin = new RegisteredPlugin(new PluginFile(plugin));\n\n assertEquals(\"Awesome plugin... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(RegisteredPlugin.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(RegisteredPlugin.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "public String getName() {\n if (this.name == null) {\n final String defaultValue = this.file.getNameOnly();\n\n try (final Jar jar = this.file.getJar()) {\n if (jar != null) {\n this.name = jar.getManifestAttributeValue(\"Plugin-Name\", this.fi... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_114 | {
"fields": [],
"file": "slideshowfx-hosting-connector/src/test/java/com/twasyl/slideshowfx/hosting/connector/io/RemoteFileTest.java",
"identifier": "RemoteFileTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void isNotEmptyForParent() {\n final RemoteFile parent = new RemoteFile(\"parent\");\n final RemoteFile child = new RemoteFile(parent, \"child\");\n\n assertFalse(parent.isEmpty());\n }",
"class_method_signature": "RemoteFileTest.isNotEmptyForParent()",
"constructor... | {
"fields": [
{
"declarator": "empty = true",
"modifier": "protected",
"original_string": "protected boolean empty = true;",
"type": "boolean",
"var_name": "empty"
},
{
"declarator": "parent = null",
"modifier": "protected",
"original_string": "protected Rem... | {
"body": "public boolean isEmpty() { return this.empty; }",
"class_method_signature": "RemoteFile.isEmpty()",
"constructor": false,
"full_signature": "public boolean isEmpty()",
"identifier": "isEmpty",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": ... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
56258575_29 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusModuleTest.java",
"identifier": "StatusModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_not_report_compactions_when_disabled() throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n when(infoProvider.getCompactions()).thenReturn(getCompactions());\n PowerMockito.mockStatic(DiagnosticsAg... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatusModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatusModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "StatusModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trace",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_52 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void log_update_query_when_select_type_is_configured_for_logging() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"queryTypesToLog\", Arrays.asList(\"UPDATE\"));\n SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(option... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_13 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/api/HttpHandlerTest.java",
"identifier": "HttpHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void get_version_missing_api_key() {\n Configuration config = Configuration.getDefaultConfiguration();\n config.global.httpApiAuthEnabled = true;\n\n DiagnosticsApi mxBean = mock(DiagnosticsApi.class);\n HttpHandler httpApi = new HttpHandler(config, mxBean);\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HttpHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HttpHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"d... | {
"body": "@Override\n public Response serve(IHTTPSession session) {\n if (!apiAuthEnabled || hasValidCredentials(session)) {\n return respond(session);\n }\n\n return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, \"Invalid API key\\r\\n\");\n }",
"class_me... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_44 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/requestrate/RequestRateModuleTest.java",
"identifier": "RequestRateModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_load_default_configuration_and_initialize() throws ConfigurationException {\n final RequestRateModule module = new RequestRateModule(testConfiguration(1, Arrays.asList(\"*:*\")),\n testReporters(), GlobalConfiguration.getDefault());\n module.stop()... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(RequestRateModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(RequestRateModule.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping request rate module.\");\n timer.cancel();\n }",
"class_method_signature": "RequestRateModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_33 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/health/ClusterHealthModuleTest.java",
"identifier": "ClusterHealthModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_load_default_configuration_and_initialize() throws ConfigurationException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n when(infoProvider.getUnreachableNodes()).thenReturn(new ArrayList<String>());\n PowerMockito.mockStatic(DiagnosticsAgent.c... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ClusterHealthModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ClusterHealthModule.class);",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "ClusterHealthModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"tra... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_25 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusModuleTest.java",
"identifier": "StatusModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_load_default_configuration_and_initialize() throws ConfigurationException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n when(infoProvider.getCompactions()).thenReturn(new ArrayList<CompactionInfo>());\n when(infoProvider.getCompactionSettings... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatusModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatusModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "StatusModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trace",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_48 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void do_not_log_query_when_execution_below_configured_threshold() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"slowQueryThresholdInMilliseconds\", \"7\");\n SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(options);\... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_49 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void log_all_queries_when_threshold_is_zero() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"slowQueryThresholdInMilliseconds\", \"0\");\n SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(options);\n Query query... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_24 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusConfigurationTest.java",
"identifier": "StatusConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_values_provided() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"period\", 2);\n options.put(\"timeunit\", \"ERR\");\n options.put(\"compactionsEnabled\", \"123\");\n try {\n StatusConfiguration.cr... | {
"fields": [
{
"declarator": "values = new Values()",
"modifier": "private",
"original_string": "private Values values = new Values();",
"type": "Values",
"var_name": "values"
}
],
"file": "cassandra-diagnostics-core/src/main/java/io/smartcat/cassandra/diagnostics/module/sta... | {
"body": "public static StatusConfiguration create(Map<String, Object> options) throws ConfigurationException {\n StatusConfiguration conf = new StatusConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n conf.values = yaml.loadAs(str, StatusConfiguration.Va... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_32 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/health/ClusterHealthConfigurationTest.java",
"identifier": "ClusterHealthConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_values_provided() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"period\", 2);\n options.put(\"timeunit\", \"ERR\");\n options.put(\"numberOfUnreachableNodesEnabled\", \"123\");\n try {\n ClusterHe... | {
"fields": [
{
"declarator": "values = new Values()",
"modifier": "private",
"original_string": "private Values values = new Values();",
"type": "Values",
"var_name": "values"
}
],
"file": "cassandra-diagnostics-core/src/main/java/io/smartcat/cassandra/diagnostics/module/hea... | {
"body": "public static ClusterHealthConfiguration create(Map<String, Object> options) throws ConfigurationException {\n ClusterHealthConfiguration conf = new ClusterHealthConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n conf.values = yaml.loadAs(str, C... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_1 | {
"fields": [
{
"declarator": "reportedQuery",
"modifier": "private",
"original_string": "private Query reportedQuery;",
"type": "Query",
"var_name": "reportedQuery"
},
{
"declarator": "lock = new CountDownLatch(1)",
"modifier": "private",
"original_string":... | {
"body": "@Test\n public void connector_reporter_does_not_report_internal_query_with_all_data() throws Exception {\n QueryReporter queryReporter = new QueryReporter() {\n @Override\n public void report(Query query) {\n reportedQuery = query;\n lock.countD... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(QueryProcessorWrapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(QueryProcessorWrapper.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "public void processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options, long startTime,\n ResultMessage result, ConcurrentLinkedHashMap<MD5Digest, ParsedStatement.Prepared> preparedStatements) {\n final long execTime = System.currentTimeMillis() - startTime;\n ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_45 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/requestrate/RequestRateModuleTest.java",
"identifier": "RequestRateModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_request_rate_when_started() throws ConfigurationException, InterruptedException {\n final CountDownLatch latch = new CountDownLatch(1);\n final LatchTestReporter testReporter = new LatchTestReporter(null, GlobalConfiguration.getDefault(), latch);\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(RequestRateModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(RequestRateModule.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping request rate module.\");\n timer.cancel();\n }",
"class_method_signature": "RequestRateModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_12 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/api/HttpHandlerTest.java",
"identifier": "HttpHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void get_version_valid_api_key() {\n Configuration config = Configuration.getDefaultConfiguration();\n config.global.httpApiAuthEnabled = true;\n\n DiagnosticsApi mxBean = mock(DiagnosticsApi.class);\n when(mxBean.getVersion()).thenReturn(\"1.2.3\");\n\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HttpHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HttpHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"d... | {
"body": "@Override\n public Response serve(IHTTPSession session) {\n if (!apiAuthEnabled || hasValidCredentials(session)) {\n return respond(session);\n }\n\n return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, \"Invalid API key\\r\\n\");\n }",
"class_me... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_53 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void log_all_queries_when_all_types_are_configured_for_logging() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"queryTypesToLog\", Arrays.asList(\"ALL\"));\n SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(options);\n... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_28 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusModuleTest.java",
"identifier": "StatusModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_repair_info_when_started() throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n when(infoProvider.getRepairSessions()).thenReturn(getRepairSessions());\n PowerMockito.mockStatic(DiagnosticsA... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatusModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatusModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "StatusModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trace",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_6 | {
"fields": [
{
"declarator": "reportedQuery",
"modifier": "private",
"original_string": "private Query reportedQuery;",
"type": "Query",
"var_name": "reportedQuery"
},
{
"declarator": "lock = new CountDownLatch(1)",
"modifier": "private",
"original_string":... | {
"body": "@Test\n public void wrapper_intercepts_query_with_all_data() throws NoSuchFieldException, SecurityException, Exception {\n QueryReporter queryReporter = new QueryReporter() {\n @Override\n public void report(Query query) {\n reportedQuery = query;\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(QueryProcessorWrapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(QueryProcessorWrapper.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "public void processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options, long startTime,\n ResultMessage result, ConcurrentLinkedHashMap<MD5Digest, ParsedStatement.Prepared> preparedStatements) {\n final long execTime = System.currentTimeMillis() - startTime;\n ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_35 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/health/ClusterHealthModuleTest.java",
"identifier": "ClusterHealthModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_two_unreachable_nodes_when_started() throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n List<String> unreachableNodes = new ArrayList<>();\n unreachableNodes.add(\"127.0.0.1\");\n u... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ClusterHealthModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ClusterHealthModule.class);",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "ClusterHealthModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"tra... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_23 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/metrics/MetricsModuleTest.java",
"identifier": "MetricsModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_metrics_when_started() throws ConfigurationException, InterruptedException {\n final ModuleConfiguration config = testConfiguration();\n TestMXBeanImpl bean = (TestMXBeanImpl) initializeTestMBean(config);\n\n final CountDownLatch latch = new CountDo... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MetricsModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(MetricsModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping metrics module.\");\n timer.cancel();\n metricsCollector.close();\n }",
"class_method_signature": "MetricsModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_58 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/heartbeat/HeartbeatModuleTest.java",
"identifier": "HeartbeatModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_heartbeat_when_started() throws ConfigurationException, InterruptedException {\n final CountDownLatch latch = new CountDownLatch(1);\n final LatchTestReporter testReporter = new LatchTestReporter(null, GlobalConfiguration.getDefault(), latch);\n fin... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HeartbeatModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HeartbeatModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping heartbeat module.\");\n timer.cancel();\n }",
"class_method_signature": "HeartbeatModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trac... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_19 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/config/ConfigurationTest.java",
"identifier": "ConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void default_connector_configuration() {\n Configuration conf = Configuration.getDefaultConfiguration();\n assertThat(conf.connector.numWorkerThreads).isEqualTo(2);\n assertThat(conf.connector.queuedEventsOverflowThreshold).isEqualTo(1000);\n assertThat(conf.co... | {
"fields": [
{
"declarator": "connector = ConnectorConfiguration.getDefault()",
"modifier": "public",
"original_string": "public ConnectorConfiguration connector = ConnectorConfiguration.getDefault();",
"type": "ConnectorConfiguration",
"var_name": "connector"
},
{
"de... | {
"body": "public static Configuration getDefaultConfiguration() {\n return new Configuration() {\n {\n final ReporterConfiguration reporter = new ReporterConfiguration();\n reporter.reporter = LogReporter.class.getName();\n reporters.add(reporter);\n\n ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_39 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/hiccup/HiccupModuleTest.java",
"identifier": "HiccupModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_hiccup_when_started() throws ConfigurationException, InterruptedException {\n final CountDownLatch latch = new CountDownLatch(1);\n final LatchTestReporter testReporter = new LatchTestReporter(null, GlobalConfiguration.getDefault(), latch);\n final ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HiccupModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HiccupModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping hiccup module.\");\n try {\n thread.join(1000);\n } catch (InterruptedException e) {\n logger.error(\"Hiccup thread failed to stop\", e);\n }\n }",
"class_method_signature": "HiccupModule.st... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_54 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void log_query_when_statement_is_for_logged_table() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"tablesForLogging\", Arrays.asList(\"keyspace.table\", \"keyspace.table2\"));\n SlowQueryLogDecider slowQueryLogDecider = buildSlowLo... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_15 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/config/YamlConfigurationLoaderTest.java",
"identifier": "YamlConfigurationLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void loads_default_configuration() throws ConfigurationException {\n YamlConfigurationLoader loader = new YamlConfigurationLoader();\n Configuration configuration = loader.loadConfig();\n assertThat(configuration).isNotNull();\n }",
"class_method_signature": "Yam... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(YamlConfigurationLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(YamlConfigurationLoader.class);",
"type": "Logger",
"var_name": "logge... | {
"body": "@Override\n public Configuration loadConfig() throws ConfigurationException {\n return loadConfig(getStorageConfigUrl());\n }",
"class_method_signature": "YamlConfigurationLoader.loadConfig()",
"constructor": false,
"full_signature": "@Override public Configuration loadConfig()",
"iden... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_42 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/requestrate/RequestRateConfigurationTest.java",
"identifier": "RequestRateConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_statement_type() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"requestsToReport\", Arrays.asList(\"SOMETHING:LOCAL_ONE\"));\n try {\n RequestRateConfiguration.create(options);\n } catch (Exception e) {\n... | {
"fields": [
{
"declarator": "ALL_STATEMENT_TYPES = \"*\"",
"modifier": "public static final",
"original_string": "public static final String ALL_STATEMENT_TYPES = \"*\";",
"type": "String",
"var_name": "ALL_STATEMENT_TYPES"
},
{
"declarator": "ALL_CONSISTENCY_LEVELS =... | {
"body": "public static RequestRateConfiguration create(Map<String, Object> options) throws ConfigurationException {\n RequestRateConfiguration conf = new RequestRateConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n\n try {\n conf.values = yam... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_43 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/requestrate/RequestRateConfigurationTest.java",
"identifier": "RequestRateConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_consistency_level() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"requestsToReport\", Arrays.asList(\"SELECT:SOMETHING\"));\n try {\n RequestRateConfiguration.create(options);\n } catch (Exception e) {\n... | {
"fields": [
{
"declarator": "ALL_STATEMENT_TYPES = \"*\"",
"modifier": "public static final",
"original_string": "public static final String ALL_STATEMENT_TYPES = \"*\";",
"type": "String",
"var_name": "ALL_STATEMENT_TYPES"
},
{
"declarator": "ALL_CONSISTENCY_LEVELS =... | {
"body": "public static RequestRateConfiguration create(Map<String, Object> options) throws ConfigurationException {\n RequestRateConfiguration conf = new RequestRateConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n\n try {\n conf.values = yam... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_14 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/api/HttpHandlerTest.java",
"identifier": "HttpHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void get_version_invalid_api_key() {\n Configuration config = Configuration.getDefaultConfiguration();\n config.global.httpApiAuthEnabled = true;\n\n DiagnosticsApi mxBean = mock(DiagnosticsApi.class);\n HttpHandler httpApi = new HttpHandler(config, mxBean);\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HttpHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HttpHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"d... | {
"body": "@Override\n public Response serve(IHTTPSession session) {\n if (!apiAuthEnabled || hasValidCredentials(session)) {\n return respond(session);\n }\n\n return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, \"Invalid API key\\r\\n\");\n }",
"class_me... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_55 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void do_not_log_query_when_statement_is_not_for_logged_table() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"tablesForLogging\", Arrays.asList(\"keyspace.table\", \"keyspace.table2\"));\n SlowQueryLogDecider slowQueryLogDecider = ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_38 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/hiccup/HiccupModuleTest.java",
"identifier": "HiccupModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_initialize_module() throws ConfigurationException, InterruptedException {\n final HiccupModule module = new HiccupModule(testConfiguration(), testReporters(),\n GlobalConfiguration.getDefault());\n module.stop();\n }",
"class_method_signature"... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HiccupModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HiccupModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping hiccup module.\");\n try {\n thread.join(1000);\n } catch (InterruptedException e) {\n logger.error(\"Hiccup thread failed to stop\", e);\n }\n }",
"class_method_signature": "HiccupModule.st... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_18 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/config/YamlConfigurationLoaderTest.java",
"identifier": "YamlConfigurationLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void load_external_valid_configuration() throws ConfigurationException {\n System.setProperty(\"cassandra.diagnostics.config\", \"valid-cassandra-diagnostics.yml\");\n YamlConfigurationLoader loader = new YamlConfigurationLoader();\n Configuration configuration = load... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(YamlConfigurationLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(YamlConfigurationLoader.class);",
"type": "Logger",
"var_name": "logge... | {
"body": "@Override\n public Configuration loadConfig() throws ConfigurationException {\n return loadConfig(getStorageConfigUrl());\n }",
"class_method_signature": "YamlConfigurationLoader.loadConfig()",
"constructor": false,
"full_signature": "@Override public Configuration loadConfig()",
"iden... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_59 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/heartbeat/HeartbeatModuleTest.java",
"identifier": "HeartbeatModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_using_log_reporter() throws ConfigurationException, InterruptedException {\n final CountDownLatch latch = new CountDownLatch(1);\n final LatchTestReporter latchTestReporter = new LatchTestReporter(null, GlobalConfiguration.getDefault(),\n la... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HeartbeatModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HeartbeatModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping heartbeat module.\");\n timer.cancel();\n }",
"class_method_signature": "HeartbeatModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trac... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_22 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/metrics/MetricsModuleTest.java",
"identifier": "MetricsModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_load_default_configuration_and_initialize() throws ConfigurationException, InterruptedException {\n final ModuleConfiguration config = testConfiguration();\n initializeTestMBean(config);\n\n final MetricsModule module = new MetricsModule(config, testReport... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MetricsModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(MetricsModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping metrics module.\");\n timer.cancel();\n metricsCollector.close();\n }",
"class_method_signature": "MetricsModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_34 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/health/ClusterHealthModuleTest.java",
"identifier": "ClusterHealthModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_number_of_unreachable_nodes_when_started()\n throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n List<String> unreachableNodes = new ArrayList<>();\n unreachableNodes.add(\"127.0... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ClusterHealthModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ClusterHealthModule.class);",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "ClusterHealthModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"tra... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_21 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/metrics/MetricsConfigurationTest.java",
"identifier": "MetricsConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_values_provided() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"period\", 2);\n options.put(\"timeunit\", \"ERR\");\n try {\n MetricsConfiguration.create(options);\n } catch (Exception e) {\n ... | {
"fields": [
{
"declarator": "values = new Values()",
"modifier": "private",
"original_string": "private Values values = new Values();",
"type": "Values",
"var_name": "values"
}
],
"file": "cassandra-diagnostics-core/src/main/java/io/smartcat/cassandra/diagnostics/module/met... | {
"body": "public static MetricsConfiguration create(Map<String, Object> options) throws ConfigurationException {\n MetricsConfiguration conf = new MetricsConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n conf.values = yaml.loadAs(str, MetricsConfiguratio... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_60 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/heartbeat/HeartbeatConfigurationTest.java",
"identifier": "HeartbeatConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_values_provided() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"period\", 2);\n options.put(\"timeunit\", \"ERR\");\n try {\n HeartbeatConfiguration.create(options);\n } catch (Exception e) {\n ... | {
"fields": [
{
"declarator": "values = new Values()",
"modifier": "private",
"original_string": "private Values values = new Values();",
"type": "Values",
"var_name": "values"
}
],
"file": "cassandra-diagnostics-core/src/main/java/io/smartcat/cassandra/diagnostics/module/hea... | {
"body": "public static HeartbeatConfiguration create(Map<String, Object> options) throws ConfigurationException {\n HeartbeatConfiguration conf = new HeartbeatConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n conf.values = yaml.loadAs(str, HeartbeatConf... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_37 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/health/ClusterHealthModuleTest.java",
"identifier": "ClusterHealthModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_not_report_number_of_unreachable_nodes_if_not_enabled()\n throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n List<String> unreachableNodes = new ArrayList<>();\n unreachableNodes.add(\... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ClusterHealthModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ClusterHealthModule.class);",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "ClusterHealthModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"tra... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_4 | {
"fields": [
{
"declarator": "prometheusReporter",
"modifier": "private",
"original_string": "private PrometheusReporter prometheusReporter;",
"type": "PrometheusReporter",
"var_name": "prometheusReporter"
}
],
"file": "cassandra-diagnostics-reporter-prometheus/src/test/java... | {
"body": "@Test\n public void should_convert_complex_measurement() {\n Map<String, String> tags = new LinkedHashMap<>();\n tags.put(\"tag1\", \"tv1\");\n tags.put(\"tag2\", \"tv2\");\n\n Map<String, String> fields = new LinkedHashMap<>();\n fields.put(\"v2\", \"abc\");\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PrometheusReporter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(PrometheusReporter.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "@Override\n public void report(Measurement measurement) {\n if (measurement.isSimple()) {\n String name = measurement.name().replaceAll(ILLEGAL_CHARACTERS_REGEX, ALLOWED_DELIMITER);\n Gauge gauge = getOrCreateGaugeMeasurement(measurement, name);\n String[] tagValu... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_40 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/requestrate/RequestRateConfigurationTest.java",
"identifier": "RequestRateConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_values_provided() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"period\", 2);\n options.put(\"timeunit\", \"ERR\");\n try {\n RequestRateConfiguration.create(options);\n } catch (Exception e) {\n ... | {
"fields": [
{
"declarator": "ALL_STATEMENT_TYPES = \"*\"",
"modifier": "public static final",
"original_string": "public static final String ALL_STATEMENT_TYPES = \"*\";",
"type": "String",
"var_name": "ALL_STATEMENT_TYPES"
},
{
"declarator": "ALL_CONSISTENCY_LEVELS =... | {
"body": "public static RequestRateConfiguration create(Map<String, Object> options) throws ConfigurationException {\n RequestRateConfiguration conf = new RequestRateConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n\n try {\n conf.values = yam... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_17 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/config/YamlConfigurationLoaderTest.java",
"identifier": "YamlConfigurationLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void load_invalid_external_configuratio() {\n System.setProperty(\"cassandra.diagnostics.config\", \"invalid-cassandra-diagnostics.yml\");\n YamlConfigurationLoader loader = new YamlConfigurationLoader();\n ConfigurationException exception = null;\n try {\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(YamlConfigurationLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(YamlConfigurationLoader.class);",
"type": "Logger",
"var_name": "logge... | {
"body": "@Override\n public Configuration loadConfig() throws ConfigurationException {\n return loadConfig(getStorageConfigUrl());\n }",
"class_method_signature": "YamlConfigurationLoader.loadConfig()",
"constructor": false,
"full_signature": "@Override public Configuration loadConfig()",
"iden... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_56 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryConfigurationTest.java",
"identifier": "SlowQueryConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_values_provided() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"slowQueryThresholdInMilliseconds\", 11);\n options.put(\"tablesForLogging\", Arrays.asList(\"keyspace.table\"));\n options.put(\"extra\", \"value\");\... | {
"fields": [
{
"declarator": "values = new Values()",
"modifier": "private",
"original_string": "private Values values = new Values();",
"type": "Values",
"var_name": "values"
}
],
"file": "cassandra-diagnostics-core/src/main/java/io/smartcat/cassandra/diagnostics/module/slo... | {
"body": "public static SlowQueryConfiguration create(Map<String, Object> options) throws ConfigurationException {\n SlowQueryConfiguration conf = new SlowQueryConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n try {\n conf.values = yaml.loadAs... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_9 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/api/HttpHandlerTest.java",
"identifier": "HttpHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void not_found() {\n Configuration config = Configuration.getDefaultConfiguration();\n DiagnosticsApi mxBean = mock(DiagnosticsApi.class);\n HttpHandler httpApi = new HttpHandler(config, mxBean);\n IHTTPSession session = mock(IHTTPSession.class);\n when(... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HttpHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HttpHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"d... | {
"body": "@Override\n public Response serve(IHTTPSession session) {\n if (!apiAuthEnabled || hasValidCredentials(session)) {\n return respond(session);\n }\n\n return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, \"Invalid API key\\r\\n\");\n }",
"class_me... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_57 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/heartbeat/HeartbeatModuleTest.java",
"identifier": "HeartbeatModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_load_default_configuration_and_initialize() throws ConfigurationException {\n final HeartbeatModule module = new HeartbeatModule(testConfiguration(), testReporters(),\n GlobalConfiguration.getDefault());\n module.stop();\n }",
"class_method_si... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HeartbeatModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HeartbeatModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping heartbeat module.\");\n timer.cancel();\n }",
"class_method_signature": "HeartbeatModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trac... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_16 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/config/YamlConfigurationLoaderTest.java",
"identifier": "YamlConfigurationLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void load_invalid_external_configuratio_uri() {\n System.setProperty(\"cassandra.diagnostics.config\", \"invalid-cassandra-diagnostics-path.yml\");\n YamlConfigurationLoader loader = new YamlConfigurationLoader();\n ConfigurationException exception = null;\n tr... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(YamlConfigurationLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(YamlConfigurationLoader.class);",
"type": "Logger",
"var_name": "logge... | {
"body": "@Override\n public Configuration loadConfig() throws ConfigurationException {\n return loadConfig(getStorageConfigUrl());\n }",
"class_method_signature": "YamlConfigurationLoader.loadConfig()",
"constructor": false,
"full_signature": "@Override public Configuration loadConfig()",
"iden... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_41 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/requestrate/RequestRateConfigurationTest.java",
"identifier": "RequestRateConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fails_when_incorrect_requests_to_report() {\n Map<String, Object> options = new HashMap<>();\n options.put(\"requestsToReport\", Arrays.asList(\"SOMETHING\"));\n try {\n RequestRateConfiguration.create(options);\n } catch (Exception e) {\n ... | {
"fields": [
{
"declarator": "ALL_STATEMENT_TYPES = \"*\"",
"modifier": "public static final",
"original_string": "public static final String ALL_STATEMENT_TYPES = \"*\";",
"type": "String",
"var_name": "ALL_STATEMENT_TYPES"
},
{
"declarator": "ALL_CONSISTENCY_LEVELS =... | {
"body": "public static RequestRateConfiguration create(Map<String, Object> options) throws ConfigurationException {\n RequestRateConfiguration conf = new RequestRateConfiguration();\n Yaml yaml = new Yaml();\n String str = yaml.dumpAsMap(options);\n\n try {\n conf.values = yam... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_5 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(KafkaReporterTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(KafkaReporterTest.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "@Test\n public void send_measurements() {\n ReporterConfiguration config = new ReporterConfiguration();\n config.options.put(\"kafkaBootstrapServers\", HOST + \":\" + BROKER_PORT);\n config.options.put(\"kafkaTopic\", \"testTopic\");\n\n KafkaReporter reporter = new KafkaRepo... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(KafkaReporter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(KafkaReporter.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void report(Measurement measurement) {\n if (producer == null) {\n logger.warn(\"Kafka producer is not initialized.\");\n return;\n }\n\n producer.send(new ProducerRecord<>(topic, partitionKey, measurement.toJson()));\n }",
"class_method... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_36 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/health/ClusterHealthModuleTest.java",
"identifier": "ClusterHealthModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_zero_unreachable_nodes_when_started()\n throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n List<String> unreachableNodes = new ArrayList<>();\n\n when(infoProvider.getUnreachabl... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ClusterHealthModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ClusterHealthModule.class);",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "ClusterHealthModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"tra... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_61 | {
"fields": [],
"file": "cassandra-diagnostics-commons/src/test/java/io/smartcat/cassandra/diagnostics/MeasurementTest.java",
"identifier": "MeasurementTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void should_fail_building_simple_measurement_without_value() {\n Map<String, String> tags = new HashMap<>();\n tags.put(\"tag1\", \"tv1\");\n tags.put(\"tag2\", \"tv2\");\n\n Map<String, String> fields = new HashMap<>(... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final MeasurementType... | {
"body": "public static Measurement createSimple(final String name, final Double value, final long time,\n final TimeUnit timeUnit, final Map<String, String> tags, final Map<String, String> fields) {\n if (value == null) {\n throw new IllegalArgumentException(\"Simple measurement must ha... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_20 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/config/ConfigurationTest.java",
"identifier": "ConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void default_configuration() {\n Configuration conf = Configuration.getDefaultConfiguration();\n assertThat(conf.reporters.size()).isEqualTo(1);\n assertThat(conf.modules.size()).isEqualTo(1);\n assertThat(conf.global.httpApiEnabled).isTrue();\n assertTh... | {
"fields": [
{
"declarator": "connector = ConnectorConfiguration.getDefault()",
"modifier": "public",
"original_string": "public ConnectorConfiguration connector = ConnectorConfiguration.getDefault();",
"type": "ConnectorConfiguration",
"var_name": "connector"
},
{
"de... | {
"body": "public static Configuration getDefaultConfiguration() {\n return new Configuration() {\n {\n final ReporterConfiguration reporter = new ReporterConfiguration();\n reporter.reporter = LogReporter.class.getName();\n reporters.add(reporter);\n\n ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_46 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/requestrate/RequestRateModuleTest.java",
"identifier": "RequestRateModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_using_log_reporter() throws ConfigurationException, InterruptedException {\n final CountDownLatch latch = new CountDownLatch(1);\n final LatchTestReporter latchTestReporter = new LatchTestReporter(null, GlobalConfiguration.getDefault(),\n la... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(RequestRateModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(RequestRateModule.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping request rate module.\");\n timer.cancel();\n }",
"class_method_signature": "RequestRateModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_11 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/api/HttpHandlerTest.java",
"identifier": "HttpHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void reload() {\n Configuration config = Configuration.getDefaultConfiguration();\n DiagnosticsApi mxBean = mock(DiagnosticsApi.class);\n HttpHandler httpApi = new HttpHandler(config, mxBean);\n IHTTPSession session = mock(IHTTPSession.class);\n when(ses... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HttpHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(HttpHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"d... | {
"body": "@Override\n public Response serve(IHTTPSession session) {\n if (!apiAuthEnabled || hasValidCredentials(session)) {\n return respond(session);\n }\n\n return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, \"Invalid API key\\r\\n\");\n }",
"class_me... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_50 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void do_not_log_query_when_statement_type_is_not_for_reporting() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"queryTypesToLog\", Arrays.asList(\"UPDATE\"));\n SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(options)... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_27 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusModuleTest.java",
"identifier": "StatusModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_thread_pool_info_when_started() throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n when(infoProvider.getTPStats()).thenReturn(getTPStats());\n PowerMockito.mockStatic(DiagnosticsAgent.clas... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatusModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatusModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "StatusModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trace",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_31 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusModuleTest.java",
"identifier": "StatusModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_node_info_when_enabled()\n throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n NodeInfo nodeInfo = new NodeInfo(true, false, true, 10, 10);\n when(infoProvider.getNodeInfo()).the... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatusModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatusModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "StatusModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trace",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_2 | {
"fields": [
{
"declarator": "instrumentation",
"modifier": "private static",
"original_string": "private static Instrumentation instrumentation;",
"type": "Instrumentation",
"var_name": "instrumentation"
}
],
"file": "cassandra-diagnostics-connector21/src/test/java/io/smart... | {
"body": "@Test\n @SuppressWarnings(\"unchecked\")\n public void invokes_wrapper_when_query_processor_process_prepared_activates() throws Exception {\n ConnectorConfiguration configuration = new ConnectorConfiguration();\n Connector connector = new ConnectorImpl();\n connector.init(instrum... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ConnectorImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ConnectorImpl.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public void init(Instrumentation inst, QueryReporter queryReporter, ConnectorConfiguration configuration,\n GlobalConfiguration globalConfiguration) {\n ConnectorImpl.configuration = configuration;\n ConnectorImpl.globalConfiguration = globalConfiguration;\n queryProcessorWr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_3 | {
"fields": [
{
"declarator": "prometheusReporter",
"modifier": "private",
"original_string": "private PrometheusReporter prometheusReporter;",
"type": "PrometheusReporter",
"var_name": "prometheusReporter"
}
],
"file": "cassandra-diagnostics-reporter-prometheus/src/test/java... | {
"body": "@Test\n public void should_convert_simple_measurement() {\n Map<String, String> tags = new LinkedHashMap<>();\n tags.put(\"tag1\", \"tv1\");\n tags.put(\"tag2\", \"tv2\");\n\n Map<String, String> fields = new LinkedHashMap<>();\n fields.put(\"v2\", \"abc\");\n\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PrometheusReporter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(PrometheusReporter.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "@Override\n public void report(Measurement measurement) {\n if (measurement.isSimple()) {\n String name = measurement.name().replaceAll(ILLEGAL_CHARACTERS_REGEX, ALLOWED_DELIMITER);\n Gauge gauge = getOrCreateGaugeMeasurement(measurement, name);\n String[] tagValu... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_30 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusModuleTest.java",
"identifier": "StatusModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_not_report_node_info_when_disabled()\n throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n NodeInfo nodeInfo = new NodeInfo(false, false, false, 0, 0);\n when(infoProvider.getNodeInfo()... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatusModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatusModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "StatusModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trace",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_26 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/status/StatusModuleTest.java",
"identifier": "StatusModuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_report_compaction_info_when_started() throws ConfigurationException, InterruptedException {\n InfoProvider infoProvider = mock(InfoProvider.class);\n when(infoProvider.getCompactions()).thenReturn(getCompactions());\n when(infoProvider.getCompactionSetting... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatusModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatusModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public void stop() {\n logger.trace(\"Stopping status module.\");\n timer.cancel();\n }",
"class_method_signature": "StatusModule.stop()",
"constructor": false,
"full_signature": "@Override public void stop()",
"identifier": "stop",
"invocations": [
"trace",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
56258575_51 | {
"fields": [],
"file": "cassandra-diagnostics-core/src/test/java/io/smartcat/cassandra/diagnostics/module/slowquery/SlowQueryLogDeciderTest.java",
"identifier": "SlowQueryLogDeciderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void log_select_query_when_select_type_is_configured_for_logging() throws Exception {\n Map<String, Object> options = new HashMap<>();\n options.put(\"queryTypesToLog\", Arrays.asList(\"SELECT\"));\n SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(option... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(SlowQueryModule.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(SlowQueryModule.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean isForReporting(Query query) {\n if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query)\n && typeForLogging(query)) {\n return true;\n }\n\n return false;\n }",
"class_method_signature": "SlowQueryLogDecid... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56258575,
"size": 1233,
"stargazer_count": 52,
"stars": null,
"updates": null,
"url": "https://github.com/smartcat-labs/cassandra-diagnostics"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.