id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
34793185_34 | {
"fields": [
{
"declarator": "ioService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private IOService ioService;",
"type": "IOService",
"var_name": "ioService"
},
{
"declarator": "dataModelerService",
"modifier": "@Mock\n private",
... | {
"body": "@Test\n public void sourceDataObjectIsNotPlanningSolution() {\n DataObject dataObject = new DataObjectImpl(\"test\", \"TestSource\");\n generationResult.setDataObject(dataObject);\n\n copyHelper.postProcess(sourcePath, destinationPath);\n\n verify(ioService, never()).exists(a... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(PlanningSolutionCopyHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(PlanningSolutionCopyHelper.class);",
"type": "Logger",
"var_name": ... | {
"body": "@Override\n public void postProcess(Path sourcePath,\n Path destinationPath) {\n String dataObjectSource = ioService.readAllString(Paths.convert(sourcePath));\n GenerationResult generationResult = dataModelerService.loadDataObject(sourcePath,\n ... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_135 | {
"fields": [
{
"declarator": "view",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private TerminationTreeItemContentView view;",
"type": "TerminationTreeItemContentView",
"var_name": "view"
},
{
"declarator": "translationService",
"modifier": ... | {
"body": "@Test\n public void setNewScoreCalculationCountLimitValue() {\n terminationTreeItemContent.setNewValue(TerminationConfigOption.SCORE_CALCULATION_COUNT_LIMIT);\n\n verify(view).setScoreCalculationCountLimit(0L);\n verify(terminationConfigModel).setScoreCalculationCountLimit(0L);\n ... | {
"fields": [
{
"declarator": "MINUTES_SPENT_DEFAULT_VALUE = 5L",
"modifier": "public static final",
"original_string": "public static final long MINUTES_SPENT_DEFAULT_VALUE = 5L;",
"type": "long",
"var_name": "MINUTES_SPENT_DEFAULT_VALUE"
},
{
"declarator": "UNIMPROVED... | {
"body": "public void setNewValue(TerminationConfigOption terminationConfigOption) {\n TerminationManager operation = terminationManagerMap.get(terminationConfigOption);\n if (operation != null) {\n operation.setNewValue();\n }\n }",
"class_method_signature": "TerminationTreeItem... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_22 | {
"fields": [
{
"declarator": "dataModelerService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private DataModelerService dataModelerService;",
"type": "DataModelerService",
"var_name": "dataModelerService"
},
{
"declarator": "ioService",
"mo... | {
"body": "@Test\n public void checkDataObjectIsAPlanningSolution() {\n DataObject dataObject = new DataObjectImpl(\"test\",\n \"Test\");\n dataObject.addAnnotation(new AnnotationImpl(DriverUtils.buildAnnotationDefinition(PlanningSolution.class)));\n\... | {
"fields": [
{
"declarator": "dataModelerService",
"modifier": "private",
"original_string": "private DataModelerService dataModelerService;",
"type": "DataModelerService",
"var_name": "dataModelerService"
},
{
"declarator": "ioService",
"modifier": "private",
... | {
"body": "@Override\n public Collection<ValidationMessage> validate(final Path dataObjectPath,\n final DataObject dataObject) {\n if (dataObject != null && dataObject.getAnnotation(PLANNING_SOLUTION_ANNOTATION) != null) {\n return Arrays.asList(ne... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_75 | {
"fields": [
{
"declarator": "extension = new HardConstraintMatchPersistenceExtension()",
"modifier": "private",
"original_string": "private HardConstraintMatchPersistenceExtension extension = new HardConstraintMatchPersistenceExtension();",
"type": "HardConstraintMatchPersistenceExtensio... | {
"body": "@Test\n public void unmarshalHardConstraintMatchNull() throws RuleModelDRLPersistenceException {\n String actionString = \"scoreHolder.addHardConstraintMatch(kcontext, null);\";\n\n IAction action = extension.unmarshal(actionString);\n\n assertTrue(action instanceof ActionHardConstr... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(HardConstraintMatchPersistenceExtension.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(HardConstraintMatchPersistenceExtension.class);",
"type": "L... | {
"body": "@Override\n public PluggableIAction unmarshal(final String iActionString) throws RuleModelDRLPersistenceException {\n List<String> parameters = StringUtils.splitArgumentsList(PersistenceExtensionUtils.unwrapParenthesis(iActionString));\n\n if (!parameters.isEmpty() && \"kcontext\".equals(p... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_119 | {
"fields": [
{
"declarator": "view",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private TerminationTreeItemContentView view;",
"type": "TerminationTreeItemContentView",
"var_name": "view"
},
{
"declarator": "translationService",
"modifier": ... | {
"body": "@Test\n public void setNestedTerminationConfigOption() {\n terminationTreeItemContent.setTerminationConfigOption(TerminationConfigOption.NESTED);\n verify(view,\n times(1)).setDropDownHelpContent(any());\n }",
"class_method_signature": "TerminationTreeItemContentTest.set... | {
"fields": [
{
"declarator": "MINUTES_SPENT_DEFAULT_VALUE = 5L",
"modifier": "public static final",
"original_string": "public static final long MINUTES_SPENT_DEFAULT_VALUE = 5L;",
"type": "long",
"var_name": "MINUTES_SPENT_DEFAULT_VALUE"
},
{
"declarator": "UNIMPROVED... | {
"body": "public void setTerminationConfigOption(TerminationConfigOption terminationConfigOption) {\n this.terminationConfigOption = terminationConfigOption;\n view.setNestedTreeItem(terminationConfigOption == NESTED);\n if (terminationConfigOption == NESTED) {\n view.setDropDownHelpC... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_59 | {
"fields": [
{
"declarator": "fieldPickerItemRow",
"modifier": "@Mock",
"original_string": "@Mock\n Div fieldPickerItemRow;",
"type": "Div",
"var_name": "fieldPickerItemRow"
},
{
"declarator": "fieldPickerItemLabelViewInstance",
"modifier": "@Mock\n private... | {
"body": "@Test\n public void addFieldItem() {\n ObjectProperty objectProperty = mock(ObjectProperty.class);\n when(objectProperty.getName()).thenReturn(\"testObjectProperty\");\n\n DataObjectFieldPickerItemLabelView labelView = mock(DataObjectFieldPickerItemLabelView.class);\n when(fi... | {
"fields": [
{
"declarator": "view",
"modifier": "@Inject\n @DataField(\"view\")",
"original_string": "@Inject\n @DataField(\"view\")\n Div view;",
"type": "Div",
"var_name": "view"
},
{
"declarator": "fieldPickerItemRow",
"modifier": "@Inject\n @Data... | {
"body": "@Override\n public void addFieldItem(ObjectProperty objectProperty) {\n createFieldPickerItemLabel(objectProperty.getName(),\n () -> presenter.onFieldRemoved(objectProperty));\n }",
"class_method_signature": "DataObjectFieldPickerItemViewImpl.addFieldItem(Ob... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_18 | {
"fields": [
{
"declarator": "deleteValidator",
"modifier": "private",
"original_string": "private PlanningScoreDeleteValidator deleteValidator;",
"type": "PlanningScoreDeleteValidator",
"var_name": "deleteValidator"
}
],
"file": "optaplanner-wb-screens/optaplanner-wb-domain... | {
"body": "@Test\n public void validateNullObject() {\n assertEquals(0, deleteValidator.validate(null, null).size());\n }",
"class_method_signature": "PlanningScoreDeleteValidatorTest.validateNullObject()",
"constructor": false,
"full_signature": "@Test public void validateNullObject()",
"identif... | {
"fields": [],
"file": "optaplanner-wb-screens/optaplanner-wb-domain-editor/optaplanner-wb-domain-editor-backend/src/main/java/org/optaplanner/workbench/screens/domaineditor/backend/server/validation/PlanningScoreDeleteValidator.java",
"identifier": "PlanningScoreDeleteValidator",
"interfaces": "implements Obj... | {
"body": "@Override\n public Collection<ValidationMessage> validate(final DataObject dataObject,\n final ObjectProperty objectProperty) {\n final boolean isGeneratedPlanningScoreField =\n dataObject != null\n && dataObje... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_80 | {
"fields": [
{
"declarator": "extension = new SoftConstraintMatchPersistenceExtension()",
"modifier": "private",
"original_string": "private SoftConstraintMatchPersistenceExtension extension = new SoftConstraintMatchPersistenceExtension();",
"type": "SoftConstraintMatchPersistenceExtensio... | {
"body": "@Test\n public void unmarshalActionBendableSoftConstraintMatch() throws RuleModelDRLPersistenceException {\n String actionString = \"scoreHolder.addSoftConstraintMatch(kcontext, 1, -1);\";\n\n IAction action = extension.unmarshal(actionString);\n\n assertTrue(action instanceof Actio... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SoftConstraintMatchPersistenceExtension.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SoftConstraintMatchPersistenceExtension.class);",
"type": "L... | {
"body": "@Override\n public PluggableIAction unmarshal(final String iActionString) throws RuleModelDRLPersistenceException {\n String[] parameters = PersistenceExtensionUtils.unwrapParenthesis(iActionString).split(\"\\\\s*,\\\\s*\");\n\n if (\"kcontext\".equals(parameters[0])) {\n if (pa... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_38 | {
"fields": [
{
"declarator": "ioService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private IOService ioService;",
"type": "IOService",
"var_name": "ioService"
},
{
"declarator": "comparatorDefinitionService",
"modifier": "@Mock\n privat... | {
"body": "@Test\n public void generationResultHasErrors() {\n generationResult.setErrors(Collections.singletonList(mock(DataModelerError.class)));\n DataObject dataObject = mock(DataObject.class);\n generationResult.setDataObject(dataObject);\n plannerDataModelerHelperUtils.updateDataO... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PlannerDataModelerHelperUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(PlannerDataModelerHelperUtils.class);",
"type": "Logger",
"var_n... | {
"body": "public void updateDataObject(Path dataObjectPath) {\n String dataObjectString = ioService.readAllString(Paths.convert(dataObjectPath));\n\n GenerationResult generationResult = dataModelerService.loadDataObject(dataObjectPath,\n ... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_139 | {
"fields": [
{
"declarator": "view",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private PhaseConfigFormView view;",
"type": "PhaseConfigFormView",
"var_name": "view"
},
{
"declarator": "constructionHeuristicFormProvider",
"modifier": "@Mock\... | {
"body": "@Test\n public void addConstructionHeuristic() {\n addConstructionHeuristic(true);\n }",
"class_method_signature": "PhaseConfigFormTest.addConstructionHeuristic()",
"constructor": false,
"full_signature": "@Test public void addConstructionHeuristic()",
"identifier": "addConstructionHeu... | {
"fields": [
{
"declarator": "model",
"modifier": "private",
"original_string": "private List<PhaseConfigModel> model;",
"type": "List<PhaseConfigModel>",
"var_name": "model"
},
{
"declarator": "phaseFormList = new ArrayList()",
"modifier": "private",
"orig... | {
"body": "public void addConstructionHeuristic() {\n ConstructionHeuristicPhaseConfigModel constructionHeuristicPhaseConfigModel = new ConstructionHeuristicPhaseConfigModel();\n model.add(constructionHeuristicPhaseConfigModel);\n addConstructionHeuristic(constructionHeuristicPhaseConfigModel);\n... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_0 | {
"fields": [
{
"declarator": "ROOT_CATEGORY = \"root\"",
"modifier": "private static final",
"original_string": "private static final String ROOT_CATEGORY = \"root\";",
"type": "String",
"var_name": "ROOT_CATEGORY"
},
{
"declarator": "appConfigService",
"modifier... | {
"body": "@Test\n public void setupMenu() {\n when(translationService.getTranslation(anyString())).thenReturn(\"translation\");\n when(translationService.getTranslation(AppConstants.OptaPlannerWorkbenchEntryPoint_Home)).thenReturn(\"Home\");\n when(translationService.getTranslation(AppConstan... | {
"fields": [
{
"declarator": "menusHelper",
"modifier": "protected",
"original_string": "protected DefaultWorkbenchFeaturesMenusHelper menusHelper;",
"type": "DefaultWorkbenchFeaturesMenusHelper",
"var_name": "menusHelper"
},
{
"declarator": "menuBar",
"modifier"... | {
"body": "@Override\n protected void setupMenu() {\n adminPage.addScreen(\"root\",\n translationService.getTranslation(AppConstants.OptaPlannerWorkbenchEntryPoint_Settings));\n adminPage.setDefaultScreen(\"root\");\n\n adminPage.addPreference(\"root\",\n ... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_96 | {
"fields": [],
"file": "optaplanner-wb-screens/optaplanner-wb-solver-editor/optaplanner-wb-solver-editor-backend/src/test/java/org/optaplanner/workbench/screens/solver/backend/server/ToSolverConfigModelTest.java",
"identifier": "ToSolverConfigModelTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void get() {\n ToSolverConfigModel toSolverConfigModel = new ToSolverConfigModel(getSolverConfig());\n SolverConfigModel solverConfigModel = toSolverConfigModel.get();\n\n TerminationConfigModel terminationConfigModel = solverConfigModel.getTermination();\n ass... | {
"fields": [
{
"declarator": "solverConfig",
"modifier": "private",
"original_string": "private SolverConfig solverConfig;",
"type": "SolverConfig",
"var_name": "solverConfig"
}
],
"file": "optaplanner-wb-screens/optaplanner-wb-solver-editor/optaplanner-wb-solver-editor-back... | {
"body": "public SolverConfigModel get() {\n SolverConfigModel model = new SolverConfigModel();\n model.setTerminationConfig(create(solverConfig.getTerminationConfig()));\n model.setScoreDirectorFactoryConfig(create(solverConfig.getScoreDirectorFactoryConfig()));\n model.setPhaseConfigLis... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_79 | {
"fields": [
{
"declarator": "extension = new SoftConstraintMatchPersistenceExtension()",
"modifier": "private",
"original_string": "private SoftConstraintMatchPersistenceExtension extension = new SoftConstraintMatchPersistenceExtension();",
"type": "SoftConstraintMatchPersistenceExtensio... | {
"body": "@Test\n public void unmarshalSoftConstraintMatchNull() throws RuleModelDRLPersistenceException {\n String actionString = \"scoreHolder.addSoftConstraintMatch(kcontext, null);\";\n\n IAction action = extension.unmarshal(actionString);\n\n assertTrue(action instanceof ActionSoftConstr... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SoftConstraintMatchPersistenceExtension.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SoftConstraintMatchPersistenceExtension.class);",
"type": "L... | {
"body": "@Override\n public PluggableIAction unmarshal(final String iActionString) throws RuleModelDRLPersistenceException {\n String[] parameters = PersistenceExtensionUtils.unwrapParenthesis(iActionString).split(\"\\\\s*,\\\\s*\");\n\n if (\"kcontext\".equals(parameters[0])) {\n if (pa... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_115 | {
"fields": [
{
"declarator": "view",
"modifier": "@Mock",
"original_string": "@Mock\n ScoreDirectorFactoryFormView view;",
"type": "ScoreDirectorFactoryFormView",
"var_name": "view"
},
{
"declarator": "path",
"modifier": "@Mock\n private",
"original_s... | {
"body": "@Test\n public void setEmptyKSession() throws Exception {\n ScoreDirectorFactoryConfigModel model = new ScoreDirectorFactoryConfigModel();\n form.setModel(model,\n path);\n\n verify(view).setKSession(null,\n path);\n }",
"cla... | {
"fields": [
{
"declarator": "view",
"modifier": "private",
"original_string": "private ScoreDirectorFactoryFormView view;",
"type": "ScoreDirectorFactoryFormView",
"var_name": "view"
},
{
"declarator": "model",
"modifier": "private",
"original_string": "pr... | {
"body": "public void setModel(final ScoreDirectorFactoryConfigModel model,\n final Path path) {\n this.model = model;\n\n view.setKSession(model.getKSessionName(),\n path);\n }",
"class_method_signature": "ScoreDirectorFactoryForm.setModel(final Sco... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_55 | {
"fields": [
{
"declarator": "view",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private PlannerDataObjectEditorView view;",
"type": "PlannerDataObjectEditorView",
"var_name": "view"
},
{
"declarator": "translationService",
"modifier": "@Mock... | {
"body": "@Test\n public void getFindClassUsagesCallbackObjectIsAPlanningSolution() {\n PlannerDataObjectEditor objectEditor = createObjectEditor();\n\n Path solutionPath = PathFactory.newPath(\"PlanningSolution.java\",\n \"default:///test/PlanningSolut... | {
"fields": [
{
"declarator": "view",
"modifier": "private",
"original_string": "private PlannerDataObjectEditorView view;",
"type": "PlannerDataObjectEditorView",
"var_name": "view"
},
{
"declarator": "translationService",
"modifier": "private",
"original_s... | {
"body": "RemoteCallback<List<Path>> getFindClassUsagesCallback() {\n return new RemoteCallback<List<Path>>() {\n @Override\n public void callback(List<Path> paths) {\n if (context != null) {\n // Remove current data object from the path list\n ... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_142 | {
"fields": [
{
"declarator": "view",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private PhaseConfigFormView view;",
"type": "PhaseConfigFormView",
"var_name": "view"
},
{
"declarator": "constructionHeuristicFormProvider",
"modifier": "@Mock\... | {
"body": "@Test\n public void addLocalSearch() {\n addLocalSearch(true);\n }",
"class_method_signature": "PhaseConfigFormTest.addLocalSearch()",
"constructor": false,
"full_signature": "@Test public void addLocalSearch()",
"identifier": "addLocalSearch",
"invocations": [
"addLocalSearch"
... | {
"fields": [
{
"declarator": "model",
"modifier": "private",
"original_string": "private List<PhaseConfigModel> model;",
"type": "List<PhaseConfigModel>",
"var_name": "model"
},
{
"declarator": "phaseFormList = new ArrayList()",
"modifier": "private",
"orig... | {
"body": "public void addLocalSearch() {\n LocalSearchPhaseConfigModel localSearchPhaseConfigModel = new LocalSearchPhaseConfigModel();\n model.add(localSearchPhaseConfigModel);\n addLocalSearch(localSearchPhaseConfigModel);\n }",
"class_method_signature": "PhaseConfigForm.addLocalSearch()"... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_43 | {
"fields": [
{
"declarator": "translationService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private TranslationService translationService;",
"type": "TranslationService",
"var_name": "translationService"
},
{
"declarator": "translator",
"m... | {
"body": "@Test\n public void acceptUnsupportedClass() {\n assertFalse(translator.accept(new UnsupportedMessage()));\n }",
"class_method_signature": "PlannerValidationMessageTranslatorTest.acceptUnsupportedClass()",
"constructor": false,
"full_signature": "@Test public void acceptUnsupportedClass(... | {
"fields": [
{
"declarator": "translationService",
"modifier": "private",
"original_string": "private TranslationService translationService;",
"type": "TranslationService",
"var_name": "translationService"
},
{
"declarator": "MESSAGE_CLASS_KEY_MAPPING",
"modifier... | {
"body": "@Override\n public boolean accept(final ValidationMessage message) {\n return MESSAGE_CLASS_KEY_MAPPING.containsKey(message.getClass().getName());\n }",
"class_method_signature": "PlannerValidationMessageTranslator.accept(final ValidationMessage message)",
"constructor": false,
"full_sig... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_14 | {
"fields": [
{
"declarator": "dataModelerService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private DataModelerService dataModelerService;",
"type": "DataModelerService",
"var_name": "dataModelerService"
},
{
"declarator": "assetsUsageService",
... | {
"body": "@Test\n public void notAPlanningSolution() {\n Path dataObjectPath = PathFactory.newPath(\"Test.java\",\n \"file:///dataObjects\");\n when(ioService.readAllString(Paths.convert(dataObjectPath))).thenReturn(\"testResult\");\n\n DataObj... | {
"fields": [
{
"declarator": "dataModelerService",
"modifier": "private",
"original_string": "private DataModelerService dataModelerService;",
"type": "DataModelerService",
"var_name": "dataModelerService"
},
{
"declarator": "ioService",
"modifier": "private",
... | {
"body": "@Override\n public Collection<ValidationMessage> validate(final Path dataObjectPath,\n final DataObject dataObject) {\n return validatePath(dataObjectPath);\n }",
"class_method_signature": "PlanningSolutionScoreHolderDeleteValidator.validate(f... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
34793185_103 | {
"fields": [],
"file": "optaplanner-wb-screens/optaplanner-wb-solver-editor/optaplanner-wb-solver-editor-backend/src/test/java/org/optaplanner/workbench/screens/solver/backend/server/ToSolverConfigTest.java",
"identifier": "ToSolverConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void get() {\n ToSolverConfig toSolverConfigModel = new ToSolverConfig(getSolverConfigModel());\n SolverConfig solverConfig = toSolverConfigModel.get();\n\n TerminationConfig terminationConfig = solverConfig.getTerminationConfig();\n assertEquals(Long.valueOf(1... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private SolverConfigModel config;",
"type": "SolverConfigModel",
"var_name": "config"
}
],
"file": "optaplanner-wb-screens/optaplanner-wb-solver-editor/optaplanner-wb-solver-editor-backend/src/... | {
"body": "public SolverConfig get() {\n\n SolverConfig solverConfig = new SolverConfig();\n\n solverConfig.setScanAnnotatedClassesConfig(new ScanAnnotatedClassesConfig());\n\n solverConfig.setTerminationConfig(create(config.getTermination()));\n solverConfig.setScoreDirectorFactoryConfig(... | {
"created": "4/29/2015 12:43:09 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 34793185,
"size": null,
"stargazer_count": null,
"stars": 16,
"updates": "2020-01-23T12:14:11+00:00",
"url": "https://github.com/kiegroup/optapla... |
145393952_0 | {
"fields": [],
"file": "java/EjemplosParteComun/src/us/lsi/recursivos/puntos/ListasDePuntosTest.java",
"identifier": "ListasDePuntosTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testParMasCercano() {\n\t\tList<Punto2D> lista = ListasDePuntos.getListaPuntosAleatoria(10000);\n\t\tParDePuntos p1 = ListasDePuntos.parMasCercano(lista);\n\t\tParDePuntos p2 = ListasDePuntos.parMasCercanoBase(0, lista.size(), lista);\n\t\tif(!p1.getDistancia().equals(p2.getDistancia()... | {
"fields": [],
"file": "java/EjemplosParteComun/src/us/lsi/recursivos/puntos/ListasDePuntos.java",
"identifier": "ListasDePuntos",
"interfaces": "",
"methods": [
{
"class_method_signature": "ListasDePuntos.puntosMaximales(List<Punto2D> lista)",
"constructor": false,
"full_signature": "p... | {
"body": "public static ParDePuntos parMasCercano(List<Punto2D> lista){\n\t\tParDePuntos p = null;\n\t\tList<Punto2D> puntosX;\n\t\tList<Punto2D> puntosY;\n\t\tComparator<Punto2D> ordX = new Comparator<Punto2D>(){\n\t\t\t@Override\n\t\t\tpublic int compare(Punto2D p1, Punto2D p2) {\n\t\t\t\treturn p1.getX().compareT... | {
"created": null,
"fork": null,
"fork_count": 10,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 145393952,
"size": 8872,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/migueltoro/adda2018"
} |
145393952_1 | {
"fields": [],
"file": "java/EjemplosParteComun/src/us/lsi/recursivos/puntos/ListasDePuntosTest.java",
"identifier": "ListasDePuntosTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPuntosMaximales() {\n\t\tList<Punto2D> lista = ListasDePuntos.getListaPuntosAleatoria(10000);\n\t\tSet<Punto2D> r1 = ListasDePuntos.puntosMaximales(lista);\n\t\tSet<Punto2D> r2 = ListasDePuntos.puntosMaximalesBase(0, lista.size(), lista);\n\t\tassertTrue(r1.equals(r2));\n\t}",
"c... | {
"fields": [],
"file": "java/EjemplosParteComun/src/us/lsi/recursivos/puntos/ListasDePuntos.java",
"identifier": "ListasDePuntos",
"interfaces": "",
"methods": [
{
"class_method_signature": "ListasDePuntos.puntosMaximales(List<Punto2D> lista)",
"constructor": false,
"full_signature": "p... | {
"body": "public static Set<Punto2D> puntosMaximales(List<Punto2D> lista){\n\t\tComparator<Punto2D> ord = new Comparator<Punto2D>(){\n\t\t\t@Override\n\t\t\tpublic int compare(Punto2D p1, Punto2D p2) {\n\t\t\t\treturn p1.getX().compareTo(p2.getX());\n\t\t\t}\n\t\t\t\n\t\t};\n\t\tCollections.sort(lista, ord);\n\t\tre... | {
"created": null,
"fork": null,
"fork_count": 10,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 145393952,
"size": 8872,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/migueltoro/adda2018"
} |
20501508_7 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test\n public void getSupportsStringKeyWithDefaultValue() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n final String ids = map.get(\"event-c|test\");\n assertThat(\"expected default value\", ids, is(\"test\"));\n }",
"class_method_signatu... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public String get(Object events) throws IllegalArgumentException {\n if (events instanceof Iterable) {\n return get((Iterable<String>) events, DEFAULT_VALUE);\n } else if (events instanceof String) {\n final String[] i... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_6 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test\n public void getSupportsStringKeyWithMultipleEvents() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n final String ids = map.get(\"event-a event-b,event-c\");\n for (String id : DEFAULT_DELEGATE.get(\"event-b\")) {\n assertThat(... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public String get(Object events) throws IllegalArgumentException {\n if (events instanceof Iterable) {\n return get((Iterable<String>) events, DEFAULT_VALUE);\n } else if (events instanceof String) {\n final String[] i... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_1 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test\n public void add() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n map.add(\"event-d event-e\", \":comp_1.1\", \":comp_1.2\");\n assertThat(\"unexpected ID\", map.getSeparate(\"event-d\"), containsInAnyOrder(\":comp_1.1\", \":comp_1.2\"));... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "public void add(String events, String...ids) {\n for (String event : EventDrivenUpdatesMap.parseEvents(events)) {\n Set<String> listenerIds = delegate.get(event);\n if (listenerIds == null) {\n listenerIds = new HashSet<>();\n delegate.put(event, l... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_0 | {
"fields": [
{
"declarator": "UPDATED_INT_VALUE = 1",
"modifier": "private static final",
"original_string": "private static final int UPDATED_INT_VALUE = 1;",
"type": "int",
"var_name": "UPDATED_INT_VALUE"
},
{
"declarator": "UPDATED_STRING_VALUE = \" (upd. \" + new S... | {
"body": "@Test\n public void testUpdateIntModel() throws Exception {\n final String initialStringValue = controller.getStringModel().getValue();\n final int initialIntValue = controller.getIntModel().getValue();\n\n controller.updateIntModel(mock(AjaxBehaviorEvent.class));\n assertTha... | {
"fields": [
{
"declarator": "serialVersionUID = -3977106738089852396L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -3977106738089852396L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INI... | {
"body": "public void updateIntModel(AjaxBehaviorEvent event) {\n intModel.setValue(intModel.getValue() + UPDATE_INT_VALUE);\n eduContext.update(\"int-model-changed\");\n }",
"class_method_signature": "DemoController.updateIntModel(AjaxBehaviorEvent event)",
"constructor": false,
"full_signatu... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_3 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void getFailsForNullKey() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n map.get(null);\n }",
"class_method_signature": "EventDrivenUpdatesMapTest.getFailsForNullKey()",
"constructor": fa... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public String get(Object events) throws IllegalArgumentException {\n if (events instanceof Iterable) {\n return get((Iterable<String>) events, DEFAULT_VALUE);\n } else if (events instanceof String) {\n final String[] i... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_2 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void getFailsForObjectKey() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n map.get(new Object());\n }",
"class_method_signature": "EventDrivenUpdatesMapTest.getFailsForObjectKey()",
"cons... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public String get(Object events) throws IllegalArgumentException {\n if (events instanceof Iterable) {\n return get((Iterable<String>) events, DEFAULT_VALUE);\n } else if (events instanceof String) {\n final String[] i... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_5 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test\n public void getSupportsStringKey() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n final String ids = map.get(\"event-a\");\n assertThat(\"unexpected ID\", ids, is(DEFAULT_DELEGATE.get(\"event-a\").iterator().next()));\n }",
"class_m... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public String get(Object events) throws IllegalArgumentException {\n if (events instanceof Iterable) {\n return get((Iterable<String>) events, DEFAULT_VALUE);\n } else if (events instanceof String) {\n final String[] i... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_4 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test\n public void getSupportsIterableKey() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n final String ids = map.get(DEFAULT_DELEGATE.keySet());\n for (String id : DEFAULT_DELEGATE.get(\"event-b\")) {\n assertThat(\"missing ID\", id... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public String get(Object events) throws IllegalArgumentException {\n if (events instanceof Iterable) {\n return get((Iterable<String>) events, DEFAULT_VALUE);\n } else if (events instanceof String) {\n final String[] i... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
20501508_8 | {
"fields": [
{
"declarator": "DEFAULT_DELEGATE = new HashMap<String, Set<String>>() {\n\n private static final long serialVersionUID = 1L;\n\n {\n put(\"event-a\", asSet(\":comp_1\"));\n put(\"event-b\", asSet(\":comp_1\", \":comp_2:comp_2.1\"));\n }\n }",
... | {
"body": "@Test\n public void getSeparateSupportsStringKeyWithDefaultValue() {\n final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE);\n final Set<String> ids = map.getSeparate(\"event-c|test\");\n assertThat(\"expected default value\", ids, contains(\"test\"));\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 2716308243361339413L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2716308243361339413L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAU... | {
"body": "Set<String> getSeparate(String events) {\n final String[] iter = parseEventsAndDefault(events);\n return getSeparate(iter[0], iter[1]);\n }",
"class_method_signature": "EventDrivenUpdatesMap.getSeparate(String events)",
"constructor": false,
"full_signature": " Set<String> getSeparat... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 20501508,
"size": 577,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/encoway/edu"
} |
53073438_0 | {
"fields": [
{
"declarator": "user",
"modifier": "private",
"original_string": "private User user;",
"type": "User",
"var_name": "user"
},
{
"declarator": "primaryDestination",
"modifier": "private",
"original_string": "private MessageLocation primaryDestin... | {
"body": "@Test\n public void testConstructor() {\n Spec.given(user)\n .expect(User::id, to().be(\"user\"))\n .expect(User::primaryDestination, to().be(primaryDestination))\n .expect(User::destinations, to().have(twoElements()))\n .expect(user -> user.destination(\"mychannel\"), to().... | {
"fields": [
{
"declarator": "serialVersionUID = 7185963234889976203L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 7185963234889976203L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "id",
... | {
"body": "@Override\n public MessageLocation destination(String channel) {\n if (this.destinations.containsKey(channel)) {\n return Destination.channel(channel).to(this.destinations.get(channel));\n }\n throw new InvalidDestinationException(\"User don't have the channel '\" + channel + \"' registered\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_1 | {
"fields": [
{
"declarator": "user",
"modifier": "private",
"original_string": "private User user;",
"type": "User",
"var_name": "user"
},
{
"declarator": "primaryDestination",
"modifier": "private",
"original_string": "private MessageLocation primaryDestin... | {
"body": "@Test\n public void testRemoveDestination() {\n Spec.given(user)\n .expect(removing(primaryDestination), to().raise(InvalidDestinationException.class))\n\n .when(removing(secondaryDestination))\n .expect(User::destinations, to().have(oneElement()));\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "serialVersionUID = 7185963234889976203L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 7185963234889976203L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "id",
... | {
"body": "@Override\n public void removeDestination(MessageLocation destination) {\n if (destination.channel().equals(this.primaryDestination)) {\n throw new InvalidDestinationException(\"Can't remove default destination\");\n }\n if (this.destinations.containsKey(destination.channel())) {\n this... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_6 | {
"fields": [
{
"declarator": "processor",
"modifier": "private",
"original_string": "private MessageProcessor processor;",
"type": "MessageProcessor",
"var_name": "processor"
}
],
"file": "plugins/boteco-plugin-redhat/src/test/java/tools/devnull/boteco/plugins/redhat/KBaseMe... | {
"body": "@Test\n public void testAcceptance() {\n Spec.given(processor)\n .expect(it(), to(process(message(\"https://access.redhat.com/solutions/46437\"))))\n .expect(it(), to(process(message(\"hey, I found this solution: https://access.redhat.com/solutions/46437\"))));\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(KBaseMessageProcessor.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(KBaseMessageProcessor.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "@Override\n public void process(IncomeMessage message) {\n Matcher matcher = pattern.matcher(message.content());\n while (matcher.find()) {\n String number = matcher.group(\"number\");\n fetch(message, number);\n }\n }",
"class_method_signature": "KBaseMessageProcessor.process(Income... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_7 | {
"fields": [],
"file": "plugins/boteco-plugin-xgh/src/test/java/tools/devnull/boteco/plugins/xgh/XGHTest.java",
"identifier": "XGHTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAxioms() {\n Spec.given(new XGH())\n .expect(doing(xgh -> xgh.axiom(1)), to().succeed())\n .expect(doing(xgh -> xgh.axiom(23)), to().fail())\n .expect(doing(xgh -> xgh.axiom(0)), to().fail());\n\n for (int i = 1 ; i <= 22 ; i++) {\n Spec.given(new XG... | {
"fields": [
{
"declarator": "axioms = new ArrayList<>(30)",
"modifier": "private final",
"original_string": "private final List<Axiom> axioms = new ArrayList<>(30);",
"type": "List<Axiom>",
"var_name": "axioms"
}
],
"file": "plugins/boteco-plugin-xgh/src/main/java/tools/dev... | {
"body": "public Axiom axiom(int number) {\n if (number < 1 || number > axioms.size()) {\n throw new IllegalArgumentException(String.format(\"Axiom %d is not defined\", number));\n }\n return axioms.get(number - 1);\n }",
"class_method_signature": "XGH.axiom(int number)",
"constructor": false,
"... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_11 | {
"fields": [
{
"declarator": "somethingTrue",
"modifier": "private",
"original_string": "private Predicate<IncomeMessage> somethingTrue;",
"type": "Predicate<IncomeMessage>",
"var_name": "somethingTrue"
},
{
"declarator": "incomeMessage",
"modifier": "private",
... | {
"body": "@Test\n public void testReject() {\n assertFalse(check(incomeMessage).reject(somethingTrue));\n verify(somethingTrue).test(incomeMessage);\n }",
"class_method_signature": "MessageCheckerTest.testReject()",
"constructor": false,
"full_signature": "@Test public void testReject()",
"identifier... | {
"fields": [
{
"declarator": "message",
"modifier": "private final",
"original_string": "private final IncomeMessage message;",
"type": "IncomeMessage",
"var_name": "message"
}
],
"file": "main/boteco/src/main/java/tools/devnull/boteco/message/MessageChecker.java",
"identi... | {
"body": "public boolean reject(Predicate<IncomeMessage> predicate) {\n return !predicate.test(message);\n }",
"class_method_signature": "MessageChecker.reject(Predicate<IncomeMessage> predicate)",
"constructor": false,
"full_signature": "public boolean reject(Predicate<IncomeMessage> predicate)",
"ident... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_4 | {
"fields": [
{
"declarator": "repository",
"modifier": "private",
"original_string": "private KarmaRepository repository;",
"type": "KarmaRepository",
"var_name": "repository"
},
{
"declarator": "processor",
"modifier": "private",
"original_string": "privat... | {
"body": "@Test\n public void testMultiple() {\n Karma testKarma = new Karma(\"test\");\n Karma otherKarma = new Karma(\"other\");\n\n when(repository.find(\"test\")).thenReturn(testKarma);\n when(repository.find(\"other\")).thenReturn(otherKarma);\n\n Spec.given(new KarmaMessageProcessor(repository)... | {
"fields": [
{
"declarator": "pattern =\n Pattern.compile(\"(?<term>\\\\S+)(?<operation>\\\\+\\\\+|--)(\\\\s|[,.:;!?]|$)\")",
"modifier": "private final",
"original_string": "private final Pattern pattern =\n Pattern.compile(\"(?<term>\\\\S+)(?<operation>\\\\+\\\\+|--)(\\\\s|[,.:;!?]|... | {
"body": "@Override\n public void process(IncomeMessage message) {\n Matcher matcher = pattern.matcher(message.content());\n StringBuilder replyMessage = new StringBuilder();\n Set<String> evaluated = new HashSet<>();\n while (matcher.find()) {\n String term = matcher.group(\"term\");\n String... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_8 | {
"fields": [
{
"declarator": "requestManager",
"modifier": "private",
"original_string": "private RequestManager requestManager;",
"type": "RequestManager",
"var_name": "requestManager"
},
{
"declarator": "validToken = \"validToken\"",
"modifier": "private",
... | {
"body": "@Test\n public void testValidToken() {\n IncomeMessage message = IncomeMessageMock.message(validToken,\n m -> m.withCommand(\"confirm\", validToken));\n\n Spec.given(new RequestMessageProcessor(requestManager))\n .when(process(message))\n .expect(the(message), to(receive(m -> m.... | {
"fields": [
{
"declarator": "requestManager",
"modifier": "private final",
"original_string": "private final RequestManager requestManager;",
"type": "RequestManager",
"var_name": "requestManager"
}
],
"file": "plugins/boteco-plugin-request/src/main/java/tools/devnull/botec... | {
"body": "@Override\n public void process(IncomeMessage message) {\n String token = message.command().as(String.class);\n if (this.requestManager.confirm(token)) {\n message.reply(\"Confirmation OK!\");\n } else {\n message.reply(\"[e]Invalid token[/e]\");\n }\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_9 | {
"fields": [
{
"declarator": "requestManager",
"modifier": "private",
"original_string": "private RequestManager requestManager;",
"type": "RequestManager",
"var_name": "requestManager"
},
{
"declarator": "validToken = \"validToken\"",
"modifier": "private",
... | {
"body": "@Test\n public void testInvalidToken() {\n IncomeMessage message = IncomeMessageMock.message(invalidToken,\n m -> m.withCommand(\"confirm\", invalidToken));\n\n Spec.given(new RequestMessageProcessor(requestManager))\n .when(process(message))\n .expect(the(message), to(receive(m... | {
"fields": [
{
"declarator": "requestManager",
"modifier": "private final",
"original_string": "private final RequestManager requestManager;",
"type": "RequestManager",
"var_name": "requestManager"
}
],
"file": "plugins/boteco-plugin-request/src/main/java/tools/devnull/botec... | {
"body": "@Override\n public void process(IncomeMessage message) {\n String token = message.command().as(String.class);\n if (this.requestManager.confirm(token)) {\n message.reply(\"Confirmation OK!\");\n } else {\n message.reply(\"[e]Invalid token[/e]\");\n }\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_5 | {
"fields": [
{
"declarator": "diceRoll",
"modifier": "private",
"original_string": "private DiceRoll diceRoll;",
"type": "DiceRoll",
"var_name": "diceRoll"
},
{
"declarator": "message",
"modifier": "private",
"original_string": "private IncomeMessage messag... | {
"body": "@Test\n public void testProcess() {\n Spec.given(new DiceRollMessageProcessor(diceRoll))\n .when(process(message))\n .expect(the(message), to(receive(IncomeMessage::command)))\n .expect(the(message), to(receive(reply(\"you got [v]%s[/v] points!\", expectedScore))));\n }",
"class... | {
"fields": [
{
"declarator": "diceRoll",
"modifier": "private final",
"original_string": "private final DiceRoll diceRoll;",
"type": "DiceRoll",
"var_name": "diceRoll"
}
],
"file": "plugins/boteco-plugin-diceroll/src/main/java/tools/devnull/boteco/plugins/diceroll/DiceRollMe... | {
"body": "@Override\n public void process(IncomeMessage message) {\n try {\n int points = diceRoll.roll(message.command().as(String.class));\n message.reply(\"you got [v]%s[/v] points!\", points);\n } catch (IllegalArgumentException e) {\n throw new MessageProcessingException(e.getMessage(), e)... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_10 | {
"fields": [
{
"declarator": "somethingTrue",
"modifier": "private",
"original_string": "private Predicate<IncomeMessage> somethingTrue;",
"type": "Predicate<IncomeMessage>",
"var_name": "somethingTrue"
},
{
"declarator": "incomeMessage",
"modifier": "private",
... | {
"body": "@Test\n public void testAccept() {\n assertTrue(check(incomeMessage).accept(somethingTrue));\n verify(somethingTrue).test(incomeMessage);\n }",
"class_method_signature": "MessageCheckerTest.testAccept()",
"constructor": false,
"full_signature": "@Test public void testAccept()",
"identifier"... | {
"fields": [
{
"declarator": "message",
"modifier": "private final",
"original_string": "private final IncomeMessage message;",
"type": "IncomeMessage",
"var_name": "message"
}
],
"file": "main/boteco/src/main/java/tools/devnull/boteco/message/MessageChecker.java",
"identi... | {
"body": "public boolean accept(Predicate<IncomeMessage> predicate) {\n return predicate.test(message);\n }",
"class_method_signature": "MessageChecker.accept(Predicate<IncomeMessage> predicate)",
"constructor": false,
"full_signature": "public boolean accept(Predicate<IncomeMessage> predicate)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_2 | {
"fields": [
{
"declarator": "repository",
"modifier": "private",
"original_string": "private KarmaRepository repository;",
"type": "KarmaRepository",
"var_name": "repository"
},
{
"declarator": "processor",
"modifier": "private",
"original_string": "privat... | {
"body": "@Test\n public void testRaise() {\n Karma testKarma = new Karma(\"test\");\n Karma otherKarma = new Karma(\"other\");\n\n when(repository.find(\"test\")).thenReturn(testKarma);\n when(repository.find(\"other\")).thenReturn(otherKarma);\n\n Spec.given(processor)\n .expect(the(testKarm... | {
"fields": [
{
"declarator": "pattern =\n Pattern.compile(\"(?<term>\\\\S+)(?<operation>\\\\+\\\\+|--)(\\\\s|[,.:;!?]|$)\")",
"modifier": "private final",
"original_string": "private final Pattern pattern =\n Pattern.compile(\"(?<term>\\\\S+)(?<operation>\\\\+\\\\+|--)(\\\\s|[,.:;!?]|... | {
"body": "@Override\n public void process(IncomeMessage message) {\n Matcher matcher = pattern.matcher(message.content());\n StringBuilder replyMessage = new StringBuilder();\n Set<String> evaluated = new HashSet<>();\n while (matcher.find()) {\n String term = matcher.group(\"term\");\n String... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
53073438_3 | {
"fields": [
{
"declarator": "repository",
"modifier": "private",
"original_string": "private KarmaRepository repository;",
"type": "KarmaRepository",
"var_name": "repository"
},
{
"declarator": "processor",
"modifier": "private",
"original_string": "privat... | {
"body": "@Test\n public void testLower() {\n Karma testKarma = new Karma(\"test\");\n Karma otherKarma = new Karma(\"other\");\n\n when(repository.find(\"test\")).thenReturn(testKarma);\n when(repository.find(\"other\")).thenReturn(otherKarma);\n\n Spec.given(processor)\n .expect(the(testKarm... | {
"fields": [
{
"declarator": "pattern =\n Pattern.compile(\"(?<term>\\\\S+)(?<operation>\\\\+\\\\+|--)(\\\\s|[,.:;!?]|$)\")",
"modifier": "private final",
"original_string": "private final Pattern pattern =\n Pattern.compile(\"(?<term>\\\\S+)(?<operation>\\\\+\\\\+|--)(\\\\s|[,.:;!?]|... | {
"body": "@Override\n public void process(IncomeMessage message) {\n Matcher matcher = pattern.matcher(message.content());\n StringBuilder replyMessage = new StringBuilder();\n Set<String> evaluated = new HashSet<>();\n while (matcher.find()) {\n String term = matcher.group(\"term\");\n String... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 53073438,
"size": 4283,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/devnull-tools/boteco"
} |
24478161_6 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/oauth/URLFetchUtilsTest.java",
"identifier": "URLFetchUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseDateSampleDate() {\n String printed = \"Tue, 22 Oct 2013 19:28:45 GMT\";\n Date date = URLFetchUtils.parseDate(printed);\n assertNotNull(date);\n\n DateTimeFormatter gcsFormat =\n DateTimeFormat.forPattern(\"EEE, dd MMM yyyy HH:mm:ss z\").withZoneUTC()\n ... | {
"fields": [
{
"declarator": "DATE_FORMAT =\n DateTimeFormat.forPattern(\"EEE, dd MMM yyyy HH:mm:ss 'GMT'\")\n .withZoneUTC().withLocale(Locale.US)",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final DateTimeFormatte... | {
"body": "static Date parseDate(String dateString) {\n try {\n return DATE_FORMAT.parseDateTime(dateString).toDate();\n } catch (IllegalArgumentException e) {\n return null;\n }\n }",
"class_method_signature": "URLFetchUtils.parseDate(String dateString)",
"constructor": false,
"full_signatu... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_7 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/oauth/URLFetchUtilsTest.java",
"identifier": "URLFetchUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDescribeRequestAndResponseF() throws Exception {\n HTTPRequest request = new HTTPRequest(new URL(\"http://ping/pong\"));\n request.setPayload(\"hello\".getBytes());\n request.addHeader(new HTTPHeader(\"k1\", \"v1\"));\n request.addHeader(new HTTPHeader(\"k2\", \"v2\"));... | {
"fields": [
{
"declarator": "DATE_FORMAT =\n DateTimeFormat.forPattern(\"EEE, dd MMM yyyy HH:mm:ss 'GMT'\")\n .withZoneUTC().withLocale(Locale.US)",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final DateTimeFormatte... | {
"body": "static String describeRequestAndResponse(HTTPRequestInfo req, HttpResponseException resp) {\n StringBuilder b = new StringBuilder(256).append(\"Request: \");\n req.appendToString(b);\n b.append(\"\\nResponse: \");\n appendResponse(resp, b);\n return b.toString();\n }",
"class_method_signa... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_0 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/RetryHelperTest.java",
"identifier": "RetryHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTriesNoMoreThanMaxTimes() {\n final int maxAttempts = 10;\n RetryParams params = new RetryParams.Builder().initialRetryDelayMillis(0)\n .totalRetryPeriodMillis(60000)\n .retryMinAttempts(0)\n .retryMaxAttempts(maxAttempts)\n .build();\n final At... | {
"fields": [
{
"declarator": "log = Logger.getLogger(RetryHelper.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.getLogger(RetryHelper.class.getName());",
"type": "Logger",
"var_name": "log"
},
{
"decl... | {
"body": "public static <V> V runWithRetries(Callable<V> callable) throws RetryHelperException {\n return runWithRetries(callable, RetryParams.getDefaultInstance(),\n ExceptionHandler.getDefaultInstance());\n }",
"class_method_signature": "RetryHelper.runWithRetries(Callable<V> callable)",
"constructo... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_12 | {
"fields": [
{
"declarator": "BUCKET = \"bucket\"",
"modifier": "private static final",
"original_string": "private static final String BUCKET = \"bucket\";",
"type": "String",
"var_name": "BUCKET"
},
{
"declarator": "FETCH_OPTIONS = FetchOptions.Builder\n .disa... | {
"body": "@Test\n public void makeRequestShouldHandleAPresentPayload() throws MalformedURLException {\n URL url = new URL(\"https://storage.googleapis.com/sample-bucket/sample-object\");\n byte[] payload = \"hello\".getBytes(UTF_8);\n HTTPRequest expected = new HTTPRequest(url, PUT, FETCH_OPTIONS);\n ex... | {
"fields": [
{
"declarator": "X_GOOG_PREFIX = \"x-goog-\"",
"modifier": "private static final",
"original_string": "private static final String X_GOOG_PREFIX = \"x-goog-\";",
"type": "String",
"var_name": "X_GOOG_PREFIX"
},
{
"declarator": "ACL = X_GOOG_PREFIX + \"acl\... | {
"body": "@VisibleForTesting\n HTTPRequest makeRequest(GcsFilename filename, @Nullable Map<String, String> queryStrings,\n HTTPMethod method, long timeoutMillis) {\n return makeRequest(filename, queryStrings, method, timeoutMillis, EMPTY_PAYLOAD);\n }",
"class_method_signature": "OauthRawGcsService.makeR... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_1 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/RetryHelperTest.java",
"identifier": "RetryHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTriesNoMoreLongerThanTotalRetryPeriod() {\n final FakeTicker ticker = new FakeTicker();\n Stopwatch stopwatch = Stopwatch.createUnstarted(ticker);\n RetryParams params = new RetryParams.Builder().initialRetryDelayMillis(0)\n .totalRetryPeriodMillis(999)\n .re... | {
"fields": [
{
"declarator": "log = Logger.getLogger(RetryHelper.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.getLogger(RetryHelper.class.getName());",
"type": "Logger",
"var_name": "log"
},
{
"decl... | {
"body": "public static <V> V runWithRetries(Callable<V> callable) throws RetryHelperException {\n return runWithRetries(callable, RetryParams.getDefaultInstance(),\n ExceptionHandler.getDefaultInstance());\n }",
"class_method_signature": "RetryHelper.runWithRetries(Callable<V> callable)",
"constructo... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_11 | {
"fields": [
{
"declarator": "BUCKET = \"bucket\"",
"modifier": "private static final",
"original_string": "private static final String BUCKET = \"bucket\";",
"type": "String",
"var_name": "BUCKET"
},
{
"declarator": "FETCH_OPTIONS = FetchOptions.Builder\n .disa... | {
"body": "@Test\n public void makeRequestShouldHandleAnEmptyPayload() throws MalformedURLException {\n URL url = new URL(\"https://storage.googleapis.com/sample-bucket/sample-object\");\n HTTPRequest expected = new HTTPRequest(url, PUT, FETCH_OPTIONS);\n expected.addHeader(new HTTPHeader(\"Content-Length\"... | {
"fields": [
{
"declarator": "X_GOOG_PREFIX = \"x-goog-\"",
"modifier": "private static final",
"original_string": "private static final String X_GOOG_PREFIX = \"x-goog-\";",
"type": "String",
"var_name": "X_GOOG_PREFIX"
},
{
"declarator": "ACL = X_GOOG_PREFIX + \"acl\... | {
"body": "@VisibleForTesting\n HTTPRequest makeRequest(GcsFilename filename, @Nullable Map<String, String> queryStrings,\n HTTPMethod method, long timeoutMillis) {\n return makeRequest(filename, queryStrings, method, timeoutMillis, EMPTY_PAYLOAD);\n }",
"class_method_signature": "OauthRawGcsService.makeR... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_2 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/RetryHelperTest.java",
"identifier": "RetryHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBackoffIsExponential() {\n RetryParams params = new RetryParams.Builder()\n .initialRetryDelayMillis(10)\n .maxRetryDelayMillis(10_000_000)\n .retryDelayBackoffFactor(2)\n .totalRetryPeriodMillis(60_000)\n .retryMinAttempts(0)\n .retryMa... | {
"fields": [
{
"declarator": "log = Logger.getLogger(RetryHelper.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = Logger.getLogger(RetryHelper.class.getName());",
"type": "Logger",
"var_name": "log"
},
{
"decl... | {
"body": "@VisibleForTesting\n static long getSleepDuration(RetryParams retryParams, int attemptsSoFar) {\n long initialDelay = retryParams.getInitialRetryDelayMillis();\n double backoff = retryParams.getRetryDelayBackoffFactor();\n long maxDelay = retryParams.getMaxRetryDelayMillis();\n long retryDelay... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_3 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/ExceptionHandlerTest.java",
"identifier": "ExceptionHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifyCaller() {\n class A implements Callable<Object> {\n @SuppressWarnings(\"unused\")\n @Override public Object call() throws IOException, InterruptedException {\n return null;\n }\n }\n\n class B extends A {\n }\n\n class C extends A {\n ... | {
"fields": [
{
"declarator": "serialVersionUID = -2460707015779532919L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2460707015779532919L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEF... | {
"body": "void verifyCaller(Callable<?> callable) {\n Method callMethod = getCallableMethod(callable.getClass());\n for (Class<?> exceptionOrError : callMethod.getExceptionTypes()) {\n Preconditions.checkArgument(Exception.class.isAssignableFrom(exceptionOrError),\n \"Callable method exceptions m... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_10 | {
"fields": [
{
"declarator": "BUCKET = \"bucket\"",
"modifier": "private static final",
"original_string": "private static final String BUCKET = \"bucket\";",
"type": "String",
"var_name": "BUCKET"
},
{
"declarator": "FETCH_OPTIONS = FetchOptions.Builder\n .disa... | {
"body": "@Test\n public void makeRequestShouldHandleAnAbsentPayload() throws MalformedURLException {\n URL url = new URL(\"https://storage.googleapis.com/sample-bucket/sample-object\");\n HTTPRequest expected = new HTTPRequest(url, PUT, FETCH_OPTIONS);\n expected.addHeader(new HTTPHeader(\"Content-Length\... | {
"fields": [
{
"declarator": "X_GOOG_PREFIX = \"x-goog-\"",
"modifier": "private static final",
"original_string": "private static final String X_GOOG_PREFIX = \"x-goog-\";",
"type": "String",
"var_name": "X_GOOG_PREFIX"
},
{
"declarator": "ACL = X_GOOG_PREFIX + \"acl\... | {
"body": "@VisibleForTesting\n HTTPRequest makeRequest(GcsFilename filename, @Nullable Map<String, String> queryStrings,\n HTTPMethod method, long timeoutMillis) {\n return makeRequest(filename, queryStrings, method, timeoutMillis, EMPTY_PAYLOAD);\n }",
"class_method_signature": "OauthRawGcsService.makeR... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_8 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/oauth/URLFetchUtilsTest.java",
"identifier": "URLFetchUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetSingleHeader() {\n HTTPResponse response = mock(HTTPResponse.class);\n try {\n URLFetchUtils.getSingleHeader(response, \"k1\");\n fail(\"NoSuchElementException expected\");\n } catch (NoSuchElementException expected) {\n }\n\n List<HTTPHeader> headers =\... | {
"fields": [
{
"declarator": "DATE_FORMAT =\n DateTimeFormat.forPattern(\"EEE, dd MMM yyyy HH:mm:ss 'GMT'\")\n .withZoneUTC().withLocale(Locale.US)",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final DateTimeFormatte... | {
"body": "static String getSingleHeader(HTTPResponse resp, String headerName) {\n return Iterables.getOnlyElement(getHeaders(resp, headerName)).getValue();\n }",
"class_method_signature": "URLFetchUtils.getSingleHeader(HTTPResponse resp, String headerName)",
"constructor": false,
"full_signature": "static ... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_4 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/ExceptionHandlerTest.java",
"identifier": "ExceptionHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldTry() {\n ExceptionHandler handler = new ExceptionHandler.Builder().retryOn(IOException.class).build();\n assertTrue(handler.shouldRetry(new IOException()));\n assertTrue(handler.shouldRetry(new ClosedByInterruptException()));\n assertFalse(handler.shouldRetry(new... | {
"fields": [
{
"declarator": "serialVersionUID = -2460707015779532919L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2460707015779532919L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEF... | {
"body": "boolean shouldRetry(Exception ex) {\n RetryInfo retryInfo = findMostSpecificRetryInfo(retryInfos, ex.getClass());\n return retryInfo == null ? false : retryInfo.retry;\n }",
"class_method_signature": "ExceptionHandler.shouldRetry(Exception ex)",
"constructor": false,
"full_signature": " boolea... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_5 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/oauth/URLFetchUtilsTest.java",
"identifier": "URLFetchUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseDateRoundtrip() {\n Date now = new Date((System.currentTimeMillis() / 1000) * 1000);\n String printed = URLFetchUtils.DATE_FORMAT.print(now.getTime());\n assertEquals(now.getTime(), URLFetchUtils.parseDate(printed).getTime());\n }",
"class_method_signature": "URLFe... | {
"fields": [
{
"declarator": "DATE_FORMAT =\n DateTimeFormat.forPattern(\"EEE, dd MMM yyyy HH:mm:ss 'GMT'\")\n .withZoneUTC().withLocale(Locale.US)",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final DateTimeFormatte... | {
"body": "static Date parseDate(String dateString) {\n try {\n return DATE_FORMAT.parseDateTime(dateString).toDate();\n } catch (IllegalArgumentException e) {\n return null;\n }\n }",
"class_method_signature": "URLFetchUtils.parseDate(String dateString)",
"constructor": false,
"full_signatu... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
24478161_9 | {
"fields": [],
"file": "java/src/test/java/com/google/appengine/tools/cloudstorage/oauth/URLFetchUtilsTest.java",
"identifier": "URLFetchUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCopyRequest() throws Exception {\n HTTPRequest request = new HTTPRequest(new URL(\"http://h1/v1\"), HTTPMethod.HEAD);\n request.setHeader(new HTTPHeader(\"k3\", \"v3\"));\n HTTPRequest copy = URLFetchUtils.copyRequest(request);\n assertEquals(\"http://h1/v1\", copy.getU... | {
"fields": [
{
"declarator": "DATE_FORMAT =\n DateTimeFormat.forPattern(\"EEE, dd MMM yyyy HH:mm:ss 'GMT'\")\n .withZoneUTC().withLocale(Locale.US)",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final DateTimeFormatte... | {
"body": "static HTTPRequest copyRequest(HTTPRequest in) {\n HTTPRequest out = new HTTPRequest(in.getURL(), in.getMethod(), in.getFetchOptions());\n for (HTTPHeader h : in.getHeaders()) {\n out.addHeader(h);\n }\n out.setPayload(in.getPayload());\n return out;\n }",
"class_method_signature": "... | {
"created": null,
"fork": null,
"fork_count": 108,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24478161,
"size": 4494,
"stargazer_count": 116,
"stars": null,
"updates": null,
"url": "https://github.com/GoogleCloudPlatform/appengine-gcs-client"
} |
71162914_17 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test(expected = UnexpectedTypeException.class)\n public void shouldRaiseExceptionAsDateIsNotAURL() {\n\n ItemServerConnection12 itemServer = new ItemServerConnection12(\"http://www.cdbookstore.com/book/123\", \"http://www.cdbookstore.com/book/1234\", \"ftp://www.cdbookstore.com:21\");\n itemServer.... | {
"fields": [
{
"declarator": "resourceURL",
"modifier": "@URL\n private",
"original_string": "@URL\n private String resourceURL;",
"type": "String",
"var_name": "resourceURL"
},
{
"declarator": "itemURL",
"modifier": "@NotNull\n @URL(protocol = \"http\", host ... | {
"body": "public void setLastConnectionDate(Date lastConnectionDate) {\n this.lastConnectionDate = lastConnectionDate;\n }",
"class_method_signature": "ItemServerConnection12.setLastConnectionDate(Date lastConnectionDate)",
"constructor": false,
"full_signature": "public void setLastConnectionDate(Date las... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_7 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex16/CardValidator16Test.java",
"identifier": "CardValidator16Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard16 creditCard = new CreditCard16(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator16 cardValidator = new CardValidator16();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex16/CardValidator16.java",
"identifier": "CardValidator16",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator16.validate(@WebParam(name = \"Credit-C... | {
"body": "@WebResult(name = \"IsValid\")\n @WebMethod(operationName = \"ValidateCreditCard\")\n public boolean validate(@WebParam(name = \"Credit-Card\", mode = IN) CreditCard16 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseIn... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_21 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseNoConstraintViolationWithGroupEvenWithNullTitleAndPrice() {\n\n CD21 cd = new CD21();\n cd.setDescription(\"Best Jazz CD ever\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd, PrintingCatalog.class);\n assertEquals(0, violations.size());\... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_36 | {
"fields": [
{
"declarator": "ORDER_XML = \"<html>\\n\" +\n \" <body>\\n\" +\n \" <h2>Sold Items</h2>\\n\" +\n \" <table border=\\\"1\\\">\\n\" +\n \" <tr>\\n\" +\n \" <th>Title</th>\\n\" +\n \" <th>Quantity</th... | {
"body": "@Test\n public void shouldTransformOrder() throws Exception {\n\n String orderXML = new XsltTransforming06().transformOrder();\n\n assertEquals(ORDER_XML, orderXML);\n\n }",
"class_method_signature": "XsltTransforming06Test.shouldTransformOrder()",
"constructor": false,
"full_signature": "@Te... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/main/java/org/agoncal/book/javaee7/chapter12/ex06/XsltTransforming06.java",
"identifier": "XsltTransforming06",
"interfaces": "",
"methods": [
{
"class_method_signature": "XsltTransforming06.main(String[] args)",
... | {
"body": "public String transformOrder() {\n\n StringWriter writer = new StringWriter();\n\n try {\n File xmlDocument = Paths.get(\"src/main/resources/order.xml\").toFile();\n File stylesheet = Paths.get(\"src/main/resources/order.xsl\").toFile();\n\n // Saxon Factory for using XSLT 2\n Tra... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_20 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseNoConstraintViolationWithGroup() {\n\n CD21 cd = new CD21(\"Kind of Blue\", 12.5f);\n cd.setDescription(\"Best Jazz CD ever\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd, PrintingCatalog.class);\n assertEquals(0, violations.size());\n ... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_6 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex12/CardValidator12Test.java",
"identifier": "CardValidator12Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard12 creditCard = new CreditCard12(\"12341234\", \"12/12\", 1234, \"VISA\");\n\n CardValidator12 cardValidator = new CardValidator12();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex12/CardValidator12.java",
"identifier": "CardValidator12",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator12.validate(@WebParam(name = \"Credit-C... | {
"body": "public boolean validate(@WebParam(name = \"Credit-Card\", mode = IN) CreditCard12 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return fals... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_16 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseConstraintsViolationCauseRegex() {\n\n Order11 order = new Order11();\n order.setOrderId(\"FA45678\");\n\n Set<ConstraintViolation<Order11>> violations = validator.validate(order);\n displayContraintViolations(violations);\n assertEquals(1, violations.size());... | {
"fields": [
{
"declarator": "orderId",
"modifier": "@Pattern.List({\n @Pattern(regexp = \"[C,D,M][A-Z][0-9]*\"),\n @Pattern(regexp = \".[A-Z].*?\")\n })\n private",
"original_string": "@Pattern.List({\n @Pattern(regexp = \"[C,D,M][A-Z][0-9]*\"),\n @Pattern... | {
"body": "public void setOrderId(String orderId) {\n this.orderId = orderId;\n }",
"class_method_signature": "Order11.setOrderId(String orderId)",
"constructor": false,
"full_signature": "public void setOrderId(String orderId)",
"identifier": "setOrderId",
"invocations": [],
"modifiers": "public",
... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_27 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseConstraintViolationWithGroupCauseSizeIsShort() {\n\n CD21 cd = new CD21(\"Kind of Blue\", 12.5f);\n cd.setDescription(\"Jazz\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd, PrintingCatalog.class);\n assertEquals(1, violations.size());\n... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_31 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/test/java/org/agoncal/book/javaee7/chapter12/ex05/DomParsing05Test.java",
"identifier": "DomParsing05Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldParseOrderLines() throws Exception {\n List<OrderLine05> parseOrderLines = new DomParsing05().parseOrderLines();\n assertEquals(2, parseOrderLines.size());\n OrderLine05 orderLine = parseOrderLines.get(0);\n assertEquals(\"H2G2\", orderLine.getItem());\n assertEqua... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/main/java/org/agoncal/book/javaee7/chapter12/ex05/DomParsing05.java",
"identifier": "DomParsing05",
"interfaces": "",
"methods": [
{
"class_method_signature": "DomParsing05.parseOrderLines()",
"constructor": f... | {
"body": "public List<OrderLine05> parseOrderLines() {\n\n List<OrderLine05> orderLines = new ArrayList<>();\n\n try {\n File xmlDocument = Paths.get(\"src/main/resources/order.xml\").toFile();\n\n // DOM Factory\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\n /... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_11 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21Test.java",
"identifier": "CardValidator21Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = CardValidatorRTException21.class)\n public void shouldThrowACardValidatorRTException() {\n\n CreditCard21 creditCard = new CreditCard21(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator21 cardValidator = new CardValidator21();\n assertTrue(\"Credit card should be valid\... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21.java",
"identifier": "CardValidator21",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator21.validate(CreditCard21 creditCard)",
... | {
"body": "public boolean validateWithRTException(CreditCard21 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n throw new CardValidatorRTException21();\n... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_1 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/CardValidatorTest.java",
"identifier": "CardValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard creditCard = new CreditCard(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator cardValidator = new CardValidator();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditCard.setN... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/CardValidator.java",
"identifier": "CardValidator",
"interfaces": "implements Validator",
"methods": [
{
"class_method_signature": "CardValidator.validate(CreditCard creditC... | {
"body": "public boolean validate(CreditCard creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n }",
"class_method_signature": "C... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_0 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex08/CardValidator08Test.java",
"identifier": "CardValidator08Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard08 creditCard = new CreditCard08(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator08 cardValidator = new CardValidator08();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex08/CardValidator08.java",
"identifier": "CardValidator08",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator08.validate(CreditCard08 creditCard)",
... | {
"body": "public boolean validate(CreditCard08 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n }",
"class_method_signature": ... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_10 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21Test.java",
"identifier": "CardValidator21Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = CardValidatorException21.class)\n public void shouldThrowACardValidatorException() throws Exception {\n\n CreditCard21 creditCard = new CreditCard21(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator21 cardValidator = new CardValidator21();\n assertTrue(\"Credit card sho... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21.java",
"identifier": "CardValidator21",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator21.validate(CreditCard21 creditCard)",
... | {
"body": "public boolean validateWithException(CreditCard21 creditCard) throws CardValidatorException21 {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n throw new C... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_30 | {
"fields": [
{
"declarator": "ORDER_XML = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\" +\n \"<order date=\\\"05/06/2013\\\" id=\\\"1234\\\">\\n\" +\n \" <content>\\n\" +\n \" <order_line item=\\\"H2G2\\\" quantity=\\\"1\\\">\\n\" +\n \" ... | {
"body": "@Test\n public void shouldBuildOrder() throws Exception {\n\n String orderXML = new DomBuilding05().buildOrder() ;\n\n assertEquals(ORDER_XML, orderXML);\n\n }",
"class_method_signature": "DomBuilding05Test.shouldBuildOrder()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/main/java/org/agoncal/book/javaee7/chapter12/ex05/DomBuilding05.java",
"identifier": "DomBuilding05",
"interfaces": "",
"methods": [
{
"class_method_signature": "DomBuilding05.main(String[] args)",
"constructo... | {
"body": "public String buildOrder() {\n\n StringWriter writer = new StringWriter();\n\n try {\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder = factory.newDocumentBuilder();\n Document document = builder.newDocument();\n\n Element order = ... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_26 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseConstraintViolationWithOneGroupCauseSize() {\n\n CD21 cd = new CD21();\n cd.setDescription(\"Too short\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd, PrintingCatalog.class);\n assertEquals(1, violations.size());\n }",
"class_method_... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_33 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/test/java/org/agoncal/book/javaee7/chapter12/ex16/OrderJsonParser16Test.java",
"identifier": "OrderJsonParser16Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldBuildPurchaseOrder() throws FileNotFoundException {\n\n assertEquals(\"j.rorri@me.com\", new OrderJsonParser16().parsePurchaseOrderAndReturnEmail().toString());\n\n }",
"class_method_signature": "OrderJsonParser16Test.shouldBuildPurchaseOrder()",
"constructor": false,
"... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/main/java/org/agoncal/book/javaee7/chapter12/ex16/OrderJsonParser16.java",
"identifier": "OrderJsonParser16",
"interfaces": "",
"methods": [
{
"class_method_signature": "OrderJsonParser16.main(String[] args)",
... | {
"body": "public String parsePurchaseOrderAndReturnEmail() throws FileNotFoundException {\n String email = null;\n\n JsonParser parser = Json.createParser(new FileReader(\"src/main/resources/order.json\"));\n while (parser.hasNext()) {\n JsonParser.Event event = parser.next();\n while (parser.hasN... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_25 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseConstraintViolationWithTwoGroupsCauseNullTitlePriceAndSize() {\n\n CD21 cd = new CD21();\n cd.setDescription(\"Jazz\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd, Default.class, PrintingCatalog.class);\n assertEquals(3, violations.size... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_3 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex14/CardValidator14Test.java",
"identifier": "CardValidator14Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard14 creditCard = new CreditCard14(\"12341234\", \"12/12\", 1234, \"VISA\");\n\n CardValidator14 cardValidator = new CardValidator14();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex14/CardValidator14.java",
"identifier": "CardValidator14",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator14.validate(CreditCard14 creditCard)",
... | {
"body": "public boolean validate(CreditCard14 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n }",
"class_method_signature": ... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_29 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/test/java/org/agoncal/book/javaee7/chapter12/ex05/DomParsingWithValidation05Test.java",
"identifier": "DomParsingWithValidation05Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = SAXParseException.class)\n public void shouldParseOrderLines() throws Exception {\n List<OrderLine05> parseOrderLines = new DomParsingWithValidation05().parseOrderLines();\n assertEquals(2, parseOrderLines.size());\n OrderLine05 orderLine = parseOrderLines.get(0);\n... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/main/java/org/agoncal/book/javaee7/chapter12/ex05/DomParsingWithValidation05.java",
"identifier": "DomParsingWithValidation05",
"interfaces": "",
"methods": [
{
"class_method_signature": "DomParsingWithValidation05.... | {
"body": "public List<OrderLine05> parseOrderLines() throws Exception {\n\n List<OrderLine05> orderLines = new ArrayList<>();\n File xmlDocument = Paths.get(\"src/main/resources/invalidOrder.xml\").toFile();\n File xmlSchema = Paths.get(\"src/main/resources/order.xsd\").toFile();\n\n // DOM Factory\n ... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_13 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-service/src/test/java/org/agoncal/book/javaee7/chapter14/CardValidatorTest.java",
"identifier": "CardValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CardValidator cardValidator = new CardValidator();\n\n CreditCard creditCard = new CreditCard(\"12341234\", \"10/10\", 1234, \"VISA\");\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n\n creditCard.se... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-service/src/main/java/org/agoncal/book/javaee7/chapter14/CardValidator.java",
"identifier": "CardValidator",
"interfaces": "implements Validator",
"methods": [
{
"class_method_signature": "CardValidator.validate(CreditCard cred... | {
"body": "public boolean validate(CreditCard creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n }",
"class_method_signature": "C... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_12 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21Test.java",
"identifier": "CardValidator21Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = CardValidatorSOAPFaultException21.class)\n public void shouldThrowACardValidatorSOAPFaultException22() throws SOAPException {\n\n CreditCard21 creditCard = new CreditCard21(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator21 cardValidator = new CardValidator21();\n asse... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21.java",
"identifier": "CardValidator21",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator21.validate(CreditCard21 creditCard)",
... | {
"body": "public boolean validateWithSOAPFaultException(CreditCard21 creditCard) throws SOAPException {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n SOAPFactory s... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_28 | {
"fields": [
{
"declarator": "orderJSon = \"{\\\"order\\\":{\\\"@id\\\":\\\"1234\\\",\\\"@date\\\":\\\"05/06/2013\\\",\\\"customer\\\":{\\\"@first_name\\\":\\\"James\\\",\\\"@last_name\\\":\\\"Rorrison\\\",\\\"email\\\":\\\"j.rorri@me.com\\\",\\\"phoneNumber\\\":\\\"+44 1234 1234\\\"},\\\"content\\\":{\\\"... | {
"body": "@Test\n public void shouldBuildPurchaseOrder() {\n\n assertEquals(orderJSon, new OrderJsonBuilder15().buildPurchaseOrder().toString());\n\n }",
"class_method_signature": "OrderJsonBuilder15Test.shouldBuildPurchaseOrder()",
"constructor": false,
"full_signature": "@Test public void shouldBuildPur... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/main/java/org/agoncal/book/javaee7/chapter12/ex15/OrderJsonBuilder15.java",
"identifier": "OrderJsonBuilder15",
"interfaces": "",
"methods": [
{
"class_method_signature": "OrderJsonBuilder15.main(String[] args)",
... | {
"body": "public JsonObject buildPurchaseOrder() {\n return Json.createObjectBuilder().add(\"order\", Json.createObjectBuilder()\n .add(\"@id\", \"1234\")\n .add(\"@date\", \"05/06/2013\")\n .add(\"customer\", Json.createObjectBuilder()\n .add(\"@first_name\", \... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_2 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex09/CardValidator09Test.java",
"identifier": "CardValidator09Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard09 creditCard = new CreditCard09(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator09 cardValidator = new CardValidator09();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex09/CardValidator09.java",
"identifier": "CardValidator09",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator09.validate(CreditCard09 creditCard)",
... | {
"body": "@WebMethod(operationName = \"ValidateCreditCard\")\n public boolean validate(CreditCard09 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n re... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_24 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseConstraintViolationWithDefaultGroupCauseNullTitleAndPrice() {\n\n CD21 cd = new CD21();\n cd.setDescription(\"Best Jazz CD ever\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd, Default.class);\n assertEquals(2, violations.size());\n }",... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_32 | {
"fields": [
{
"declarator": "orderJSon = \"{\\\"id\\\":\\\"1234\\\",\\\"date\\\":\\\"05/06/2013\\\",\\\"customer\\\":{\\\"first_name\\\":\\\"James\\\",\\\"last_name\\\":\\\"Rorrison\\\",\\\"email\\\":\\\"j.rorri@me.com\\\",\\\"phoneNumber\\\":\\\"+44 1234 1234\\\"},\\\"content\\\":[{\\\"item\\\":\\\"H2G2\... | {
"body": "@Test\n public void shouldGeneratePurchaseOrder() throws IOException {\n\n assertEquals(orderJSon, new OrderJsonGenerator17().generatePurchaseOrder().toString());\n\n }",
"class_method_signature": "OrderJsonGenerator17Test.shouldGeneratePurchaseOrder()",
"constructor": false,
"full_signature": "... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/main/java/org/agoncal/book/javaee7/chapter12/ex17/OrderJsonGenerator17.java",
"identifier": "OrderJsonGenerator17",
"interfaces": "",
"methods": [
{
"class_method_signature": "OrderJsonGenerator17.main(String[] args... | {
"body": "public StringWriter generatePurchaseOrder() throws IOException {\n StringWriter writer = new StringWriter();\n JsonGenerator generator = Json.createGenerator(writer);\n generator.writeStartObject()\n .write(\"id\", \"1234\")\n .write(\"date\", \"05/06/2013\")\n .wr... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_5 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex28/CardValidator28Test.java",
"identifier": "CardValidator28Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard28 creditCard = new CreditCard28(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator28 cardValidator = new CardValidator28();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex28/CardValidator28.java",
"identifier": "CardValidator28",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator28.validate(CreditCard28 creditCard)",
... | {
"body": "public boolean validate(CreditCard28 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n }",
"class_method_signature": ... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_15 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseNoConstraintsViolation() {\n\n Order11 order = new Order11();\n order.setOrderId(\"CA45678\");\n\n Set<ConstraintViolation<Order11>> violations = validator.validate(order);\n assertEquals(0, violations.size());\n }",
"class_method_signature": "Order11Test.shou... | {
"fields": [
{
"declarator": "orderId",
"modifier": "@Pattern.List({\n @Pattern(regexp = \"[C,D,M][A-Z][0-9]*\"),\n @Pattern(regexp = \".[A-Z].*?\")\n })\n private",
"original_string": "@Pattern.List({\n @Pattern(regexp = \"[C,D,M][A-Z][0-9]*\"),\n @Pattern... | {
"body": "public void setOrderId(String orderId) {\n this.orderId = orderId;\n }",
"class_method_signature": "Order11.setOrderId(String orderId)",
"constructor": false,
"full_signature": "public void setOrderId(String orderId)",
"identifier": "setOrderId",
"invocations": [],
"modifiers": "public",
... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_9 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21Test.java",
"identifier": "CardValidator21Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = NullPointerException.class)\n public void shouldThrowANumberFormatException() {\n\n new CardValidator21().validate(null);\n }",
"class_method_signature": "CardValidator21Test.shouldThrowANumberFormatException()",
"constructor": false,
"full_signature": "@Test(expected = NullPoin... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21.java",
"identifier": "CardValidator21",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator21.validate(CreditCard21 creditCard)",
... | {
"body": "public boolean validate(CreditCard21 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n }",
"class_method_signature": ... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_35 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/test/java/org/agoncal/book/javaee7/chapter12/ex04/SaxParsingWithValidation04Test.java",
"identifier": "SaxParsingWithValidation04Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = SAXException.class)\n public void shouldParseOutput() throws Exception {\n\n SaxParsingWithValidation04 saxParsing = new SaxParsingWithValidation04();\n saxParsing.parseOrderXML();\n }",
"class_method_signature": "SaxParsingWithValidation04Test.shouldParseOutput()",
... | {
"fields": [
{
"declarator": "elementName = \"\"",
"modifier": "private",
"original_string": "private String elementName = \"\";",
"type": "String",
"var_name": "elementName"
},
{
"declarator": "nbTabs",
"modifier": "private",
"original_string": "private in... | {
"body": "public void parseOrderXML() throws SAXException, IOException, ParserConfigurationException {\n\n File xmlDocument = Paths.get(\"src/main/resources/invalidOrder.xml\").toFile();\n File xmlSchema = Paths.get(\"src/main/resources/order.xsd\").toFile();\n DefaultHandler handler = new SaxParsingWithVal... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_23 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseConstraintViolationWithNoGroupsCauseNullTitleAndPrice() {\n\n CD21 cd = new CD21();\n cd.setDescription(\"Best Jazz CD ever\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd);\n assertEquals(2, violations.size());\n }",
"class_method_si... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_19 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test //@Ignore(\"Make sure your local is EN, if not use the following JVM parameters : -Duser.language=en -Duser.country=EN\")\n public void shouldRaiseConstraintViolationValidatingNumberOfCDsProperty() {\n\n CD21 cd = new CD21();\n cd.setNumberOfCDs(7);\n\n Set<ConstraintViolation<CD21>> violat... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setNumberOfCDs(Integer numberOfCDs) {\n this.numberOfCDs = numberOfCDs;\n }",
"class_method_signature": "CD21.setNumberOfCDs(Integer numberOfCDs)",
"constructor": false,
"full_signature": "public void setNumberOfCDs(Integer numberOfCDs)",
"identifier": "setNumberOfCDs",
"invocatio... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_18 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseNoConstraintViolationValidatingNumberOfCDsProperty() {\n\n CD21 cd = new CD21();\n cd.setNumberOfCDs(2);\n\n Set<ConstraintViolation<CD21>> violations = validator.validateProperty(cd, \"numberOfCDs\");\n assertEquals(0, violations.size());\n }",
"class_method_... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setNumberOfCDs(Integer numberOfCDs) {\n this.numberOfCDs = numberOfCDs;\n }",
"class_method_signature": "CD21.setNumberOfCDs(Integer numberOfCDs)",
"constructor": false,
"full_signature": "public void setNumberOfCDs(Integer numberOfCDs)",
"identifier": "setNumberOfCDs",
"invocatio... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_22 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldRaiseConstraintViolationWithTwoGroupsCauseNullTitleAndPrice() {\n\n CD21 cd = new CD21();\n cd.setDescription(\"Best Jazz CD ever\");\n\n Set<ConstraintViolation<CD21>> violations = validator.validate(cd, Default.class, PrintingCatalog.class);\n assertEquals(2, violat... | {
"fields": [
{
"declarator": "title",
"modifier": "@NotNull\n @Size(min = 4, max = 50)\n private",
"original_string": "@NotNull\n @Size(min = 4, max = 50)\n private String title;",
"type": "String",
"var_name": "title"
},
{
"declarator": "price",
"modifier": ... | {
"body": "public void setDescription(String description) {\n this.description = description;\n }",
"class_method_signature": "CD21.setDescription(String description)",
"constructor": false,
"full_signature": "public void setDescription(String description)",
"identifier": "setDescription",
"invocations"... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_34 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter12/chapter12-samples/src/test/java/org/agoncal/book/javaee7/chapter12/ex04/SaxParsing04Test.java",
"identifier": "SaxParsing04Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldParseOrderLines() throws Exception {\n List<OrderLine04> parseOrderLines = new SaxParsing04().parseOrderLines();\n assertEquals(2, parseOrderLines.size());\n OrderLine04 orderLine = parseOrderLines.get(0);\n assertEquals(\"H2G2\", orderLine.getItem()... | {
"fields": [
{
"declarator": "orderLines = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<OrderLine04> orderLines = new ArrayList<>();",
"type": "List<OrderLine04>",
"var_name": "orderLines"
},
{
"declarator": "orderLine",
"modifier":... | {
"body": "public List<OrderLine04> parseOrderLines() {\n\n try {\n File xmlDocument = Paths.get(\"src/main/resources/order.xml\").toFile();\n\n // SAX Factory\n SAXParserFactory factory = SAXParserFactory.newInstance();\n SAXParser saxParser = factory.newSAXParser();\n // Parsing the docu... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_8 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21Test.java",
"identifier": "CardValidator21Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard21 creditCard = new CreditCard21(\"12341234\", \"10/10\", 1234, \"VISA\");\n\n CardValidator21 cardValidator = new CardValidator21();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex21/CardValidator21.java",
"identifier": "CardValidator21",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator21.validate(CreditCard21 creditCard)",
... | {
"body": "public boolean validate(CreditCard21 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n }",
"class_method_signature": ... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_14 | {
"fields": [
{
"declarator": "vf",
"modifier": "protected static",
"original_string": "protected static ValidatorFactory vf;",
"type": "ValidatorFactory",
"var_name": "vf"
},
{
"declarator": "validator",
"modifier": "protected static",
"original_string": "p... | {
"body": "@Test\n public void shouldCheckAgeMessage() {\n\n // Creates a book\n Customer05 customer = new Customer05(\"John\", \"Smith\", \"jsmith@gmail.com\", \"recovery@gmail.com\", \"1234565\", new Date(), new Date());\n customer.setAge(10);\n\n // Validate the cd\n Set<ConstraintViolation<Custome... | {
"fields": [
{
"declarator": "userId",
"modifier": "@Email\n private",
"original_string": "@Email\n private String userId;",
"type": "String",
"var_name": "userId"
},
{
"declarator": "firstName",
"modifier": "@NotNull @Size(min = 4, max = 50, message = \"Firstn... | {
"body": "public void setAge(Integer age) {\n this.age = age;\n }",
"class_method_signature": "Customer05.setAge(Integer age)",
"constructor": false,
"full_signature": "public void setAge(Integer age)",
"identifier": "setAge",
"invocations": [],
"modifiers": "public",
"parameters": "(Integer age)",... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
71162914_4 | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/test/java/org/agoncal/book/javaee7/chapter14/ex11/CardValidator11Test.java",
"identifier": "CardValidator11Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCheckCreditCardValidity() {\n\n CreditCard11 creditCard = new CreditCard11(\"12341234\", \"12/12\", 1234, \"VISA\");\n\n CardValidator11 cardValidator = new CardValidator11();\n assertTrue(\"Credit card should be valid\", cardValidator.validate(creditCard));\n creditC... | {
"fields": [],
"file": "agoncal-book-javaee7-master/chapter14/chapter14-wsdl/src/main/java/org/agoncal/book/javaee7/chapter14/ex11/CardValidator11.java",
"identifier": "CardValidator11",
"interfaces": "",
"methods": [
{
"class_method_signature": "CardValidator11.validate(CreditCard11 creditCard)",
... | {
"body": "@WebResult(name = \"IsValid\")\n public boolean validate(CreditCard11 creditCard) {\n\n Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);\n\n if (Integer.parseInt(lastDigit.toString()) % 2 == 0) {\n return true;\n } else {\n return false;\n }\n... | {
"created": null,
"fork": null,
"fork_count": 22,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 71162914,
"size": 2864,
"stargazer_count": 18,
"stars": null,
"updates": null,
"url": "https://github.com/Apress/beg-java-ee-7"
} |
29748259_30 | {
"fields": [
{
"declarator": "POLL_INTERVAL = 100",
"modifier": "private static final",
"original_string": "private static final long POLL_INTERVAL = 100;",
"type": "long",
"var_name": "POLL_INTERVAL"
},
{
"declarator": "mockSpiService = mock(TsdrCollectorSpiService.cl... | {
"body": "@Test\n public void testCollectMetrics() {\n ListenableScheduledFuture<?> mockFuture = mock(ListenableScheduledFuture.class);\n doReturn(mockFuture).when(mockSchedulerService).scheduleTaskAtFixedRate(any(), anyLong(), anyLong());\n\n CpuDataCollector mockCPUCollector = mock(CpuDataC... | {
"fields": [
{
"declarator": "MACHINE_ID = \"Machine\"",
"modifier": "static final",
"original_string": "static final String MACHINE_ID = \"Machine\";",
"type": "String",
"var_name": "MACHINE_ID"
},
{
"declarator": "CONTROLLER_ID = \"Controller\"",
"modifier": "s... | {
"body": "@PostConstruct\n public void init() {\n scheduledFuture = schedulerService.scheduleTaskAtFixedRate(this::poll, pollInterval, pollInterval);\n LOG.info(\"Controller Metrics Collector started\");\n }",
"class_method_signature": "ControllerMetricCollector.init()",
"constructor": false,... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_88 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testStoreMetric() throws SQLException {\n TSDRMetricRecord metricRecord = HsqlDBStoreTest.createMetricRecord();\n impl.storeMetric(metricRecord);\n Mockito.verify(store, Mockito.atLeast(1)).store(metricRecord);\n }",
"class_method_signature": "TsdrHsqlDBPers... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public void storeMetric(TSDRMetricRecord metricRecord) {\n try {\n store.store(metricRecord);\n } catch (SQLException e) {\n LOG.error(\"Failed to store record to database\", e);\n }\n }",
"class_method_signature": "TsdrHsqlDBPersistenceService... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_67 | {
"fields": [
{
"declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)",
"modifier": "private final",
"original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);",
"type": "TsdrMetricDataService",
"var_n... | {
"body": "@Test\n public void testAddMetricsWithoutServiceInInput() {\n AddMetricInputBuilder input = new AddMetricInputBuilder();\n input.setMetricName(\"Test\");\n input.setMetricValue(new BigDecimal(10));\n input.setNodeID(\"Test\");\n input.setTimeStamp(System.currentTimeMil... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRNbiServiceImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public ListenableFuture<RpcResult<AddMetricOutput>> addMetric(AddMetricInput input) {\n TSDRMetricRecordBuilder builder = new TSDRMetricRecordBuilder();\n builder.setMetricName(input.getMetricName());\n builder.setMetricValue(input.getMetricValue());\n builder.set... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_71 | {
"fields": [
{
"declarator": "store = Mockito.mock(ElasticSearchStore.class)",
"modifier": "private final",
"original_string": "private final ElasticSearchStore store = Mockito.mock(ElasticSearchStore.class);",
"type": "ElasticSearchStore",
"var_name": "store"
},
{
"de... | {
"body": "@Test\n public void getTSDRLogRecords() throws Exception {\n long start = 0L;\n long end = 0L;\n int size = 1000;\n String key = DataCategory.EXTERNAL.name();\n ElasticSearchStore.RecordType type = ElasticSearchStore.RecordType.LOG;\n service.getTSDRLogRecords(k... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "@Override\n public List<TSDRLogRecord> getTSDRLogRecords(String key, long start, long end) {\n return getTSDRRecords(RecordType.LOG, key, start, end);\n }",
"class_method_signature": "TsdrElasticSearchPersistenceServiceImpl.getTSDRLogRecords(String key, long start, long end)",
"constructor... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_26 | {
"fields": [
{
"declarator": "contextService = new HBaseDataStoreContext()",
"modifier": "private final",
"original_string": "private final HBaseDataStoreContext contextService = new HBaseDataStoreContext();",
"type": "HBaseDataStoreContext",
"var_name": "contextService"
}
],
... | {
"body": "@Test\n public void testGetWriteBufferSize() {\n assertTrue(contextService.getWriteBufferSize() == 512);\n }",
"class_method_signature": "HBaseDataStoreContextTest.testGetWriteBufferSize()",
"constructor": false,
"full_signature": "@Test public void testGetWriteBufferSize()",
"identifi... | {
"fields": [
{
"declarator": "ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\"",
"modifier": "static final",
"original_string": "static final String ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\";",
"type": "String",
"var_name": "ZOO_KEEPER_QUORUM_PROP"
},
{
"declarator"... | {
"body": "public int getWriteBufferSize() {\n return writeBufferSize;\n }",
"class_method_signature": "HBaseDataStoreContext.getWriteBufferSize()",
"constructor": false,
"full_signature": "public int getWriteBufferSize()",
"identifier": "getWriteBufferSize",
"invocations": [],
"modifiers": "pub... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_84 | {
"fields": [
{
"declarator": "EMPTY_BULK_RESULT = new BulkResult(new Gson())",
"modifier": "private static final",
"original_string": "private static final BulkResult EMPTY_BULK_RESULT = new BulkResult(new Gson());",
"type": "BulkResult",
"var_name": "EMPTY_BULK_RESULT"
},
{... | {
"body": "@Test\n @SuppressWarnings(\"unchecked\")\n public void delete() throws Exception {\n store.delete(DataCategory.EXTERNAL, 0L);\n Mockito.verify(CLIENT, Mockito.atLeastOnce()).executeAsync(\n Mockito.any(DeleteByQuery.class),\n Mockito.any(JestResultHandler.c... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());",
"type": "Logger",
"var... | {
"body": "void delete(final DataCategory category, long timestamp) {\n checkNotNull(category);\n checkState(isRunning(), \"The service is not running\");\n\n String query = String.format(\n ElasticSearchStore.ELK_QUERY,\n category,\n 0,\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_92 | {
"fields": [
{
"declarator": "store = Mockito.mock(HsqlDBStore.class)",
"modifier": "private final",
"original_string": "private final HsqlDBStore store = Mockito.mock(HsqlDBStore.class);",
"type": "HsqlDBStore",
"var_name": "store"
},
{
"declarator": "impl = new TsdrH... | {
"body": "@Test\n public void testPurgeTSDRRecords() throws SQLException {\n impl.purge(DataCategory.QUEUESTATS,0L);\n Mockito.verify(store,Mockito.atLeast(1)).purge(DataCategory.QUEUESTATS,0L);\n }",
"class_method_signature": "TsdrHsqlDBPersistenceServiceImplTest.testPurgeTSDRRecords()",
"co... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TsdrHsqlDBPersistenceServiceImpl.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public void purge(DataCategory category, long retentionTime) {\n LOG.info(\"Execute Purge with Category {} and earlier than {}.\", category.name(), new Date(retentionTime));\n try {\n store.purge(category, retentionTime);\n } catch (SQLException e) {\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
29748259_51 | {
"fields": [
{
"declarator": "configObject = new TSDRRestconfCollectorConfig()",
"modifier": "private final",
"original_string": "private final TSDRRestconfCollectorConfig configObject = new TSDRRestconfCollectorConfig();",
"type": "TSDRRestconfCollectorConfig",
"var_name": "configO... | {
"body": "@Test(expected = ConfigurationException.class)\n public void testInvalidPathRegex() throws ConfigurationException {\n Dictionary<String, String> properties = new Hashtable<>();\n\n properties.put(PATHS_TO_LOG, \"(\");\n\n configObject.updated(properties);\n }",
"class_method_si... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRRestconfCollectorConfig.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n @SuppressFBWarnings(\"RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT\")\n @Override\n public synchronized void updated(Dictionary properties) throws ConfigurationException {\n parseProperties(properties);\n\n LOG.info(\"TSDRRestconfCollect... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29748259,
"size": 20662,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/opendaylight/tsdr"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.