id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
2389245_116 | {
"fields": [
{
"declarator": "projectService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProjectService projectService;",
"type": "ProjectService",
"var_name": "projectService"
},
{
"declarator": "securityService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SecurityService securityService;",
"type": "SecurityService",
"var_name": "securityService"
},
{
"declarator": "project",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractProject<?, ?> project;",
"type": "AbstractProject<?, ?>",
"var_name": "project"
},
{
"declarator": "build",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractBuild<?, ?> build;",
"type": "AbstractBuild<?, ?>",
"var_name": "build"
}
],
"file": "hudson-service/src/test/java/org/hudsonci/service/internal/BuildServiceImplTest.java",
"identifier": "BuildServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void deleteBuildNegativeBuildNumber() {\n getInst().deleteBuild(project, -1);\n }",
"class_method_signature": "BuildServiceImplTest.deleteBuildNegativeBuildNumber()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public void deleteBuildNegativeBuildNumber()",
"identifier": "deleteBuildNegativeBuildNumber",
"invocations": [
"deleteBuild",
"getInst"
],
"modifiers": "@Test(expected = IllegalArgumentException.class) public",
"parameters": "()",
"return": "void",
"signature": "void deleteBuildNegativeBuildNumber()",
"testcase": true
} | {
"fields": [
{
"declarator": "projects",
"modifier": "private final",
"original_string": "private final ProjectService projects;",
"type": "ProjectService",
"var_name": "projects"
},
{
"declarator": "security",
"modifier": "private final",
"original_string": "private final SecurityService security;",
"type": "SecurityService",
"var_name": "security"
}
],
"file": "hudson-service/src/main/java/org/hudsonci/service/internal/BuildServiceImpl.java",
"identifier": "BuildServiceImpl",
"interfaces": "implements BuildService",
"methods": [
{
"class_method_signature": "BuildServiceImpl.BuildServiceImpl(final ProjectService projects, SecurityService security)",
"constructor": true,
"full_signature": "@Inject BuildServiceImpl(final ProjectService projects, SecurityService security)",
"identifier": "BuildServiceImpl",
"modifiers": "@Inject",
"parameters": "(final ProjectService projects, SecurityService security)",
"return": "",
"signature": " BuildServiceImpl(final ProjectService projects, SecurityService security)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"constructor": false,
"full_signature": "public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"identifier": "keepBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"return": "void",
"signature": "void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "stopBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
}
],
"superclass": "extends ServiceSupport"
} | {
"body": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber) {\n AbstractBuild<?, ?> build = getBuild(project, buildNumber);\n this.security.checkPermission(build, Run.DELETE);\n log.debug(\"Deleting build: {} #{}\", project.getName(), buildNumber);\n try {\n build.delete();\n } catch (IOException e) {\n throw new ServiceRuntimeException(\"Delete failed for build \" + project.getName() + \" #\" + buildNumber, e);\n }\n }",
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"invocations": [
"getBuild",
"checkPermission",
"debug",
"getName",
"delete",
"getName"
],
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_141 | {
"fields": [
{
"declarator": "projectService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProjectService projectService;",
"type": "ProjectService",
"var_name": "projectService"
},
{
"declarator": "securityService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SecurityService securityService;",
"type": "SecurityService",
"var_name": "securityService"
},
{
"declarator": "project",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractProject<?, ?> project;",
"type": "AbstractProject<?, ?>",
"var_name": "project"
},
{
"declarator": "build",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractBuild<?, ?> build;",
"type": "AbstractBuild<?, ?>",
"var_name": "build"
}
],
"file": "hudson-service/src/test/java/org/hudsonci/service/internal/BuildServiceImplTest.java",
"identifier": "BuildServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = NullPointerException.class)\n public void stopBuildByProjectNameNullName() {\n getInst().stopBuild(null, 1);\n }",
"class_method_signature": "BuildServiceImplTest.stopBuildByProjectNameNullName()",
"constructor": false,
"full_signature": "@Test(expected = NullPointerException.class) public void stopBuildByProjectNameNullName()",
"identifier": "stopBuildByProjectNameNullName",
"invocations": [
"stopBuild",
"getInst"
],
"modifiers": "@Test(expected = NullPointerException.class) public",
"parameters": "()",
"return": "void",
"signature": "void stopBuildByProjectNameNullName()",
"testcase": true
} | {
"fields": [
{
"declarator": "projects",
"modifier": "private final",
"original_string": "private final ProjectService projects;",
"type": "ProjectService",
"var_name": "projects"
},
{
"declarator": "security",
"modifier": "private final",
"original_string": "private final SecurityService security;",
"type": "SecurityService",
"var_name": "security"
}
],
"file": "hudson-service/src/main/java/org/hudsonci/service/internal/BuildServiceImpl.java",
"identifier": "BuildServiceImpl",
"interfaces": "implements BuildService",
"methods": [
{
"class_method_signature": "BuildServiceImpl.BuildServiceImpl(final ProjectService projects, SecurityService security)",
"constructor": true,
"full_signature": "@Inject BuildServiceImpl(final ProjectService projects, SecurityService security)",
"identifier": "BuildServiceImpl",
"modifiers": "@Inject",
"parameters": "(final ProjectService projects, SecurityService security)",
"return": "",
"signature": " BuildServiceImpl(final ProjectService projects, SecurityService security)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"constructor": false,
"full_signature": "public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"identifier": "keepBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"return": "void",
"signature": "void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "stopBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
}
],
"superclass": "extends ServiceSupport"
} | {
"body": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber) {\n AbstractBuild<?, ?> build = getBuild(project, buildNumber);\n log.debug(\"Stopping build: {} #{}\", project.getName(), buildNumber);\n try {\n // Security: doStop eventually checks to see if the task owner has permission to abort the build\n build.doStop(DummyStaplerRequest.INSTANCE, DummyStaplerResponse.INSTANCE);\n } catch (IOException e) {\n throw new ServiceRuntimeException(\"Stop failed for \" + project.getName() + \" #\" + buildNumber, e);\n } catch (ServletException e) {\n throw new ServiceRuntimeException(\"Stop failed for \" + project.getName() + \" #\" + buildNumber, e);\n }\n }",
"class_method_signature": "BuildServiceImpl.stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "stopBuild",
"invocations": [
"getBuild",
"debug",
"getName",
"doStop",
"getName",
"getName"
],
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_140 | {
"fields": [
{
"declarator": "projectService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProjectService projectService;",
"type": "ProjectService",
"var_name": "projectService"
},
{
"declarator": "securityService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SecurityService securityService;",
"type": "SecurityService",
"var_name": "securityService"
},
{
"declarator": "project",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractProject<?, ?> project;",
"type": "AbstractProject<?, ?>",
"var_name": "project"
},
{
"declarator": "build",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractBuild<?, ?> build;",
"type": "AbstractBuild<?, ?>",
"var_name": "build"
}
],
"file": "hudson-service/src/test/java/org/hudsonci/service/internal/BuildServiceImplTest.java",
"identifier": "BuildServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void findBuildByProjectNameReturnNull() {\n assertNull(getInst().findBuild(\"projectName\", 1));\n }",
"class_method_signature": "BuildServiceImplTest.findBuildByProjectNameReturnNull()",
"constructor": false,
"full_signature": "@Test public void findBuildByProjectNameReturnNull()",
"identifier": "findBuildByProjectNameReturnNull",
"invocations": [
"assertNull",
"findBuild",
"getInst"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void findBuildByProjectNameReturnNull()",
"testcase": true
} | {
"fields": [
{
"declarator": "projects",
"modifier": "private final",
"original_string": "private final ProjectService projects;",
"type": "ProjectService",
"var_name": "projects"
},
{
"declarator": "security",
"modifier": "private final",
"original_string": "private final SecurityService security;",
"type": "SecurityService",
"var_name": "security"
}
],
"file": "hudson-service/src/main/java/org/hudsonci/service/internal/BuildServiceImpl.java",
"identifier": "BuildServiceImpl",
"interfaces": "implements BuildService",
"methods": [
{
"class_method_signature": "BuildServiceImpl.BuildServiceImpl(final ProjectService projects, SecurityService security)",
"constructor": true,
"full_signature": "@Inject BuildServiceImpl(final ProjectService projects, SecurityService security)",
"identifier": "BuildServiceImpl",
"modifiers": "@Inject",
"parameters": "(final ProjectService projects, SecurityService security)",
"return": "",
"signature": " BuildServiceImpl(final ProjectService projects, SecurityService security)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"constructor": false,
"full_signature": "public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"identifier": "keepBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"return": "void",
"signature": "void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "stopBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
}
],
"superclass": "extends ServiceSupport"
} | {
"body": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber) {\n checkProjectName(projectName);\n checkBuildNumber(buildNumber);\n\n AbstractProject<?, ?> project = projects.findProject(projectName);\n return project != null ? findBuild(project, buildNumber) : null;\n }",
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"invocations": [
"checkProjectName",
"checkBuildNumber",
"findProject",
"findBuild"
],
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_117 | {
"fields": [
{
"declarator": "projectService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProjectService projectService;",
"type": "ProjectService",
"var_name": "projectService"
},
{
"declarator": "securityService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SecurityService securityService;",
"type": "SecurityService",
"var_name": "securityService"
},
{
"declarator": "project",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractProject<?, ?> project;",
"type": "AbstractProject<?, ?>",
"var_name": "project"
},
{
"declarator": "build",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractBuild<?, ?> build;",
"type": "AbstractBuild<?, ?>",
"var_name": "build"
}
],
"file": "hudson-service/src/test/java/org/hudsonci/service/internal/BuildServiceImplTest.java",
"identifier": "BuildServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void deleteBuildZeroBuildNumber() {\n getInst().deleteBuild(project, 0);\n }",
"class_method_signature": "BuildServiceImplTest.deleteBuildZeroBuildNumber()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public void deleteBuildZeroBuildNumber()",
"identifier": "deleteBuildZeroBuildNumber",
"invocations": [
"deleteBuild",
"getInst"
],
"modifiers": "@Test(expected = IllegalArgumentException.class) public",
"parameters": "()",
"return": "void",
"signature": "void deleteBuildZeroBuildNumber()",
"testcase": true
} | {
"fields": [
{
"declarator": "projects",
"modifier": "private final",
"original_string": "private final ProjectService projects;",
"type": "ProjectService",
"var_name": "projects"
},
{
"declarator": "security",
"modifier": "private final",
"original_string": "private final SecurityService security;",
"type": "SecurityService",
"var_name": "security"
}
],
"file": "hudson-service/src/main/java/org/hudsonci/service/internal/BuildServiceImpl.java",
"identifier": "BuildServiceImpl",
"interfaces": "implements BuildService",
"methods": [
{
"class_method_signature": "BuildServiceImpl.BuildServiceImpl(final ProjectService projects, SecurityService security)",
"constructor": true,
"full_signature": "@Inject BuildServiceImpl(final ProjectService projects, SecurityService security)",
"identifier": "BuildServiceImpl",
"modifiers": "@Inject",
"parameters": "(final ProjectService projects, SecurityService security)",
"return": "",
"signature": " BuildServiceImpl(final ProjectService projects, SecurityService security)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"constructor": false,
"full_signature": "public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"identifier": "keepBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"return": "void",
"signature": "void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "stopBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
}
],
"superclass": "extends ServiceSupport"
} | {
"body": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber) {\n AbstractBuild<?, ?> build = getBuild(project, buildNumber);\n this.security.checkPermission(build, Run.DELETE);\n log.debug(\"Deleting build: {} #{}\", project.getName(), buildNumber);\n try {\n build.delete();\n } catch (IOException e) {\n throw new ServiceRuntimeException(\"Delete failed for build \" + project.getName() + \" #\" + buildNumber, e);\n }\n }",
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"invocations": [
"getBuild",
"checkPermission",
"debug",
"getName",
"delete",
"getName"
],
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_20 | {
"fields": [],
"file": "hudson-core/src/test/java/hudson/util/CascadingUtilTest.java",
"identifier": "CascadingUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRenameCascadingChildLinks() throws Exception {\n String oldName = \"oldCascadingProject\";\n String newName = \"newCascadingProject\";\n FreeStyleProject project1 = new FreeStyleProjectMock(\"project1\");\n FreeStyleProjectMock project2 = new FreeStyleProjectMock(\"project2\");\n FreeStyleProjectMock project3 = new FreeStyleProjectMock(oldName);\n project2.setCascadingProject(project1);\n CascadingUtil.linkCascadingProjectsToChild(project1, \"project2\");\n project3.setCascadingProject(project2);\n CascadingUtil.linkCascadingProjectsToChild(project2, oldName);\n assertTrue(project2.getCascadingChildrenNames().contains(oldName));\n assertTrue(project1.getCascadingChildrenNames().contains(oldName));\n\n CascadingUtil.renameCascadingChildLinks(project2, oldName, newName);\n\n assertTrue(project2.getCascadingChildrenNames().contains(newName));\n assertFalse(project2.getCascadingChildrenNames().contains(oldName));\n assertTrue(project1.getCascadingChildrenNames().contains(newName));\n assertFalse(project1.getCascadingChildrenNames().contains(oldName));\n }",
"class_method_signature": "CascadingUtilTest.testRenameCascadingChildLinks()",
"constructor": false,
"full_signature": "@Test public void testRenameCascadingChildLinks()",
"identifier": "testRenameCascadingChildLinks",
"invocations": [
"setCascadingProject",
"linkCascadingProjectsToChild",
"setCascadingProject",
"linkCascadingProjectsToChild",
"assertTrue",
"contains",
"getCascadingChildrenNames",
"assertTrue",
"contains",
"getCascadingChildrenNames",
"renameCascadingChildLinks",
"assertTrue",
"contains",
"getCascadingChildrenNames",
"assertFalse",
"contains",
"getCascadingChildrenNames",
"assertTrue",
"contains",
"getCascadingChildrenNames",
"assertFalse",
"contains",
"getCascadingChildrenNames"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testRenameCascadingChildLinks()",
"testcase": true
} | {
"fields": [],
"file": "hudson-core/src/main/java/hudson/util/CascadingUtil.java",
"identifier": "CascadingUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CascadingUtil.getProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static IProjectProperty getProjectProperty(Job currentJob, String key)",
"identifier": "getProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "IProjectProperty",
"signature": "IProjectProperty getProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getStringProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static StringProjectProperty getStringProjectProperty(Job currentJob, String key)",
"identifier": "getStringProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "StringProjectProperty",
"signature": "StringProjectProperty getStringProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getBaseProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static BaseProjectProperty getBaseProjectProperty(Job currentJob, String key)",
"identifier": "getBaseProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "BaseProjectProperty",
"signature": "BaseProjectProperty getBaseProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getExternalProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static ExternalProjectProperty getExternalProjectProperty(Job currentJob, String key)",
"identifier": "getExternalProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "ExternalProjectProperty",
"signature": "ExternalProjectProperty getExternalProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getCopyOnWriteListProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static CopyOnWriteListProjectProperty getCopyOnWriteListProjectProperty(Job currentJob, String key)",
"identifier": "getCopyOnWriteListProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "CopyOnWriteListProjectProperty",
"signature": "CopyOnWriteListProjectProperty getCopyOnWriteListProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getResultProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static ResultProjectProperty getResultProjectProperty(Job currentJob, String key)",
"identifier": "getResultProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "ResultProjectProperty",
"signature": "ResultProjectProperty getResultProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getBooleanProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static BooleanProjectProperty getBooleanProjectProperty(Job currentJob, String key)",
"identifier": "getBooleanProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "BooleanProjectProperty",
"signature": "BooleanProjectProperty getBooleanProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getIntegerProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static IntegerProjectProperty getIntegerProjectProperty(Job currentJob, String key)",
"identifier": "getIntegerProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "IntegerProjectProperty",
"signature": "IntegerProjectProperty getIntegerProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getLogRotatorProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static LogRotatorProjectProperty getLogRotatorProjectProperty(Job currentJob, String key)",
"identifier": "getLogRotatorProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "LogRotatorProjectProperty",
"signature": "LogRotatorProjectProperty getLogRotatorProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getDescribableListProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static DescribableListProjectProperty getDescribableListProjectProperty(Job currentJob, String key)",
"identifier": "getDescribableListProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "DescribableListProjectProperty",
"signature": "DescribableListProjectProperty getDescribableListProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getAxesListProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static AxisListProjectProperty getAxesListProjectProperty(Job currentJob, String key)",
"identifier": "getAxesListProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "AxisListProjectProperty",
"signature": "AxisListProjectProperty getAxesListProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getScmProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static SCMProjectProperty getScmProjectProperty(Job currentJob, String key)",
"identifier": "getScmProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "SCMProjectProperty",
"signature": "SCMProjectProperty getScmProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getTriggerProjectProperty(Job currentJob, String key)",
"constructor": false,
"full_signature": "public static TriggerProjectProperty getTriggerProjectProperty(Job currentJob, String key)",
"identifier": "getTriggerProjectProperty",
"modifiers": "public static",
"parameters": "(Job currentJob, String key)",
"return": "TriggerProjectProperty",
"signature": "TriggerProjectProperty getTriggerProjectProperty(Job currentJob, String key)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getProjectProperty(ICascadingJob currentJob, String key, Class<T> clazz)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static T getProjectProperty(ICascadingJob currentJob, String key, Class<T> clazz)",
"identifier": "getProjectProperty",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(ICascadingJob currentJob, String key, Class<T> clazz)",
"return": "T",
"signature": "T getProjectProperty(ICascadingJob currentJob, String key, Class<T> clazz)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.hasCyclicCascadingLink(Job cascadingCandidate, Set<String> cascadingChildren)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static boolean hasCyclicCascadingLink(Job cascadingCandidate, Set<String> cascadingChildren)",
"identifier": "hasCyclicCascadingLink",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(Job cascadingCandidate, Set<String> cascadingChildren)",
"return": "boolean",
"signature": "boolean hasCyclicCascadingLink(Job cascadingCandidate, Set<String> cascadingChildren)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.unlinkProjectFromCascadingParents(ICascadingJob cascadingProject, String projectToUnlink)",
"constructor": false,
"full_signature": "public static boolean unlinkProjectFromCascadingParents(ICascadingJob cascadingProject, String projectToUnlink)",
"identifier": "unlinkProjectFromCascadingParents",
"modifiers": "public static",
"parameters": "(ICascadingJob cascadingProject, String projectToUnlink)",
"return": "boolean",
"signature": "boolean unlinkProjectFromCascadingParents(ICascadingJob cascadingProject, String projectToUnlink)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.unlinkProjectFromCascadingParents(ICascadingJob cascadingProject, Set<String> projectsToUnlink)",
"constructor": false,
"full_signature": "private static boolean unlinkProjectFromCascadingParents(ICascadingJob cascadingProject, Set<String> projectsToUnlink)",
"identifier": "unlinkProjectFromCascadingParents",
"modifiers": "private static",
"parameters": "(ICascadingJob cascadingProject, Set<String> projectsToUnlink)",
"return": "boolean",
"signature": "boolean unlinkProjectFromCascadingParents(ICascadingJob cascadingProject, Set<String> projectsToUnlink)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.linkCascadingProjectsToChild(ICascadingJob cascadingProject, String childProjectName)",
"constructor": false,
"full_signature": "public static void linkCascadingProjectsToChild(ICascadingJob cascadingProject, String childProjectName)",
"identifier": "linkCascadingProjectsToChild",
"modifiers": "public static",
"parameters": "(ICascadingJob cascadingProject, String childProjectName)",
"return": "void",
"signature": "void linkCascadingProjectsToChild(ICascadingJob cascadingProject, String childProjectName)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName)",
"constructor": false,
"full_signature": "public static void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName)",
"identifier": "renameCascadingChildLinks",
"modifiers": "public static",
"parameters": "(ICascadingJob cascadingProject, String oldName, String newName)",
"return": "void",
"signature": "void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.renameCascadingParentLinks(final String oldName, final String newName)",
"constructor": false,
"full_signature": "public static void renameCascadingParentLinks(final String oldName, final String newName)",
"identifier": "renameCascadingParentLinks",
"modifiers": "public static",
"parameters": "(final String oldName, final String newName)",
"return": "void",
"signature": "void renameCascadingParentLinks(final String oldName, final String newName)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.getCascadingParents(Class<T> type, Job currentJob)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static List<Job> getCascadingParents(Class<T> type, Job currentJob)",
"identifier": "getCascadingParents",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(Class<T> type, Job currentJob)",
"return": "List<Job>",
"signature": "List<Job> getCascadingParents(Class<T> type, Job currentJob)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.buildExternalProperties(StaplerRequest req, JSONObject json,\n List<Descriptor<T>> descriptors, Job owner)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static void buildExternalProperties(StaplerRequest req, JSONObject json,\n List<Descriptor<T>> descriptors, Job owner)",
"identifier": "buildExternalProperties",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(StaplerRequest req, JSONObject json,\n List<Descriptor<T>> descriptors, Job owner)",
"return": "void",
"signature": "void buildExternalProperties(StaplerRequest req, JSONObject json,\n List<Descriptor<T>> descriptors, Job owner)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.setChildrenTrigger(Job job, TriggerDescriptor descriptor, String key, StaplerRequest req,\n JSONObject json)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static void setChildrenTrigger(Job job, TriggerDescriptor descriptor, String key, StaplerRequest req,\n JSONObject json)",
"identifier": "setChildrenTrigger",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(Job job, TriggerDescriptor descriptor, String key, StaplerRequest req,\n JSONObject json)",
"return": "void",
"signature": "void setChildrenTrigger(Job job, TriggerDescriptor descriptor, String key, StaplerRequest req,\n JSONObject json)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.findCascadingParentTrigger(Job parent, String propertyKey)",
"constructor": false,
"full_signature": "private static Trigger findCascadingParentTrigger(Job parent, String propertyKey)",
"identifier": "findCascadingParentTrigger",
"modifiers": "private static",
"parameters": "(Job parent, String propertyKey)",
"return": "Trigger",
"signature": "Trigger findCascadingParentTrigger(Job parent, String propertyKey)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.setParameterDefinitionProperties(Job job,\n String key,\n CopyOnWriteList<ParametersDefinitionProperty> parameterDefinitionProperties)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static void setParameterDefinitionProperties(Job job,\n String key,\n CopyOnWriteList<ParametersDefinitionProperty> parameterDefinitionProperties)",
"identifier": "setParameterDefinitionProperties",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(Job job,\n String key,\n CopyOnWriteList<ParametersDefinitionProperty> parameterDefinitionProperties)",
"return": "void",
"signature": "void setParameterDefinitionProperties(Job job,\n String key,\n CopyOnWriteList<ParametersDefinitionProperty> parameterDefinitionProperties)",
"testcase": false
},
{
"class_method_signature": "CascadingUtil.isCascadableJobProperty(JobPropertyDescriptor d)",
"constructor": false,
"full_signature": "public static boolean isCascadableJobProperty(JobPropertyDescriptor d)",
"identifier": "isCascadableJobProperty",
"modifiers": "public static",
"parameters": "(JobPropertyDescriptor d)",
"return": "boolean",
"signature": "boolean isCascadableJobProperty(JobPropertyDescriptor d)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName)\n throws IOException {\n if (cascadingProject != null) {\n cascadingProject.renameCascadingChildName(oldName, newName);\n if (cascadingProject.hasCascadingProject()) {\n renameCascadingChildLinks(cascadingProject.getCascadingProject(), oldName, newName);\n }\n }\n }",
"class_method_signature": "CascadingUtil.renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName)",
"constructor": false,
"full_signature": "public static void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName)",
"identifier": "renameCascadingChildLinks",
"invocations": [
"renameCascadingChildName",
"hasCascadingProject",
"renameCascadingChildLinks",
"getCascadingProject"
],
"modifiers": "public static",
"parameters": "(ICascadingJob cascadingProject, String oldName, String newName)",
"return": "void",
"signature": "void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_36 | {
"fields": [
{
"declarator": "publisher = new JUnitResultArchiver(null, false, null)",
"modifier": "private static",
"original_string": "private static JUnitResultArchiver publisher = new JUnitResultArchiver(null, false, null);",
"type": "JUnitResultArchiver",
"var_name": "publisher"
},
{
"declarator": "buildResult",
"modifier": "private",
"original_string": "private Result buildResult;",
"type": "Result",
"var_name": "buildResult"
},
{
"declarator": "expectedResult",
"modifier": "private",
"original_string": "private boolean expectedResult;",
"type": "boolean",
"var_name": "expectedResult"
}
],
"file": "hudson-core/src/test/java/hudson/tasks/junit/JUnitResultArchiverTest.java",
"identifier": "JUnitResultArchiverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Bug(4505)\n @Test\n public void testNeedsToRunAborted(){\n assertEquals(expectedResult, publisher.needsToRun(buildResult));\n }",
"class_method_signature": "JUnitResultArchiverTest.testNeedsToRunAborted()",
"constructor": false,
"full_signature": "@Bug(4505) @Test public void testNeedsToRunAborted()",
"identifier": "testNeedsToRunAborted",
"invocations": [
"assertEquals",
"needsToRun"
],
"modifiers": "@Bug(4505) @Test public",
"parameters": "()",
"return": "void",
"signature": "void testNeedsToRunAborted()",
"testcase": true
} | {
"fields": [
{
"declarator": "testResults",
"modifier": "private final",
"original_string": "private final String testResults;",
"type": "String",
"var_name": "testResults"
},
{
"declarator": "keepLongStdio",
"modifier": "private final",
"original_string": "private final boolean keepLongStdio;",
"type": "boolean",
"var_name": "keepLongStdio"
},
{
"declarator": "testDataPublishers",
"modifier": "private final",
"original_string": "private final DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers;",
"type": "DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>>",
"var_name": "testDataPublishers"
},
{
"declarator": "CHECKPOINT = new CheckPoint(\n \"JUnit result archiving\")",
"modifier": "private static final",
"original_string": "private static final CheckPoint CHECKPOINT = new CheckPoint(\n \"JUnit result archiving\");",
"type": "CheckPoint",
"var_name": "CHECKPOINT"
},
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "hudson-core/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java",
"identifier": "JUnitResultArchiver",
"interfaces": "implements Serializable,\n MatrixAggregatable",
"methods": [
{
"class_method_signature": "JUnitResultArchiver.JUnitResultArchiver(String testResults)",
"constructor": true,
"full_signature": "@Deprecated public JUnitResultArchiver(String testResults)",
"identifier": "JUnitResultArchiver",
"modifiers": "@Deprecated public",
"parameters": "(String testResults)",
"return": "",
"signature": " JUnitResultArchiver(String testResults)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.JUnitResultArchiver(String testResults,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"constructor": true,
"full_signature": "@Deprecated public JUnitResultArchiver(String testResults,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"identifier": "JUnitResultArchiver",
"modifiers": "@Deprecated public",
"parameters": "(String testResults,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"return": "",
"signature": " JUnitResultArchiver(String testResults,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.JUnitResultArchiver(\n String testResults,\n boolean keepLongStdio,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"constructor": true,
"full_signature": "@DataBoundConstructor public JUnitResultArchiver(\n String testResults,\n boolean keepLongStdio,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"identifier": "JUnitResultArchiver",
"modifiers": "@DataBoundConstructor public",
"parameters": "(\n String testResults,\n boolean keepLongStdio,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"return": "",
"signature": " JUnitResultArchiver(\n String testResults,\n boolean keepLongStdio,\n DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.needsToRun(Result buildResult)",
"constructor": false,
"full_signature": "@Override public boolean needsToRun(Result buildResult)",
"identifier": "needsToRun",
"modifiers": "@Override public",
"parameters": "(Result buildResult)",
"return": "boolean",
"signature": "boolean needsToRun(Result buildResult)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.parse(String expandedTestResults, AbstractBuild build, Launcher launcher, BuildListener listener)",
"constructor": false,
"full_signature": "protected TestResult parse(String expandedTestResults, AbstractBuild build, Launcher launcher, BuildListener listener)",
"identifier": "parse",
"modifiers": "protected",
"parameters": "(String expandedTestResults, AbstractBuild build, Launcher launcher, BuildListener listener)",
"return": "TestResult",
"signature": "TestResult parse(String expandedTestResults, AbstractBuild build, Launcher launcher, BuildListener listener)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.perform(AbstractBuild build, Launcher launcher,\n BuildListener listener)",
"constructor": false,
"full_signature": "@Override public boolean perform(AbstractBuild build, Launcher launcher,\n BuildListener listener)",
"identifier": "perform",
"modifiers": "@Override public",
"parameters": "(AbstractBuild build, Launcher launcher,\n BuildListener listener)",
"return": "boolean",
"signature": "boolean perform(AbstractBuild build, Launcher launcher,\n BuildListener listener)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.parseResult(DirectoryScanner ds, long buildTime)",
"constructor": false,
"full_signature": "protected TestResult parseResult(DirectoryScanner ds, long buildTime)",
"identifier": "parseResult",
"modifiers": "protected",
"parameters": "(DirectoryScanner ds, long buildTime)",
"return": "TestResult",
"signature": "TestResult parseResult(DirectoryScanner ds, long buildTime)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.getRequiredMonitorService()",
"constructor": false,
"full_signature": "public BuildStepMonitor getRequiredMonitorService()",
"identifier": "getRequiredMonitorService",
"modifiers": "public",
"parameters": "()",
"return": "BuildStepMonitor",
"signature": "BuildStepMonitor getRequiredMonitorService()",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.getTestResults()",
"constructor": false,
"full_signature": "public String getTestResults()",
"identifier": "getTestResults",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getTestResults()",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.getTestDataPublishers()",
"constructor": false,
"full_signature": "public DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> getTestDataPublishers()",
"identifier": "getTestDataPublishers",
"modifiers": "public",
"parameters": "()",
"return": "DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>>",
"signature": "DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> getTestDataPublishers()",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.getProjectActions(AbstractProject<?, ?> project)",
"constructor": false,
"full_signature": "@Override public Collection<Action> getProjectActions(AbstractProject<?, ?> project)",
"identifier": "getProjectActions",
"modifiers": "@Override public",
"parameters": "(AbstractProject<?, ?> project)",
"return": "Collection<Action>",
"signature": "Collection<Action> getProjectActions(AbstractProject<?, ?> project)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.createAggregator(MatrixBuild build,\n Launcher launcher, BuildListener listener)",
"constructor": false,
"full_signature": "public MatrixAggregator createAggregator(MatrixBuild build,\n Launcher launcher, BuildListener listener)",
"identifier": "createAggregator",
"modifiers": "public",
"parameters": "(MatrixBuild build,\n Launcher launcher, BuildListener listener)",
"return": "MatrixAggregator",
"signature": "MatrixAggregator createAggregator(MatrixBuild build,\n Launcher launcher, BuildListener listener)",
"testcase": false
},
{
"class_method_signature": "JUnitResultArchiver.isKeepLongStdio()",
"constructor": false,
"full_signature": "public boolean isKeepLongStdio()",
"identifier": "isKeepLongStdio",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isKeepLongStdio()",
"testcase": false
}
],
"superclass": "extends Recorder"
} | {
"body": "@Override\n public boolean needsToRun(Result buildResult) {\n //TODO it seems we shouldn't archive junit results if build result is worse than FAILURE, investigate this\n return buildResult.isBetterThan(Result.ABORTED);\n }",
"class_method_signature": "JUnitResultArchiver.needsToRun(Result buildResult)",
"constructor": false,
"full_signature": "@Override public boolean needsToRun(Result buildResult)",
"identifier": "needsToRun",
"invocations": [
"isBetterThan"
],
"modifiers": "@Override public",
"parameters": "(Result buildResult)",
"return": "boolean",
"signature": "boolean needsToRun(Result buildResult)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_1 | {
"fields": [
{
"declarator": "templateLog = FileUtil.getResourceAsFile( FileBeheaderTest.class, \"sample.log\" )",
"modifier": "private",
"original_string": "private File templateLog = FileUtil.getResourceAsFile( FileBeheaderTest.class, \"sample.log\" );",
"type": "File",
"var_name": "templateLog"
}
],
"file": "hudson-utils/src/test/java/org/hudsonci/utils/io/FileBeheaderTest.java",
"identifier": "FileBeheaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void originalFileIsReplacedWithChoppedFile()\n throws IOException\n {\n File originalLog = cloneFile( templateLog );\n\n File choppedLog = FileBeheader.chop( originalLog, originalLog.length() );\n\n assertThat( choppedLog.getName(), equalTo( originalLog.getName() ) );\n assertThat( choppedLog, sameInstance( originalLog ) );\n }",
"class_method_signature": "FileBeheaderTest.originalFileIsReplacedWithChoppedFile()",
"constructor": false,
"full_signature": "@Test public void originalFileIsReplacedWithChoppedFile()",
"identifier": "originalFileIsReplacedWithChoppedFile",
"invocations": [
"cloneFile",
"chop",
"length",
"assertThat",
"getName",
"equalTo",
"getName",
"assertThat",
"sameInstance"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void originalFileIsReplacedWithChoppedFile()",
"testcase": true
} | {
"fields": [],
"file": "hudson-utils/src/main/java/org/hudsonci/utils/io/FileBeheader.java",
"identifier": "FileBeheader",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileBeheader.chop(final File original, final long tailToKeep)",
"constructor": false,
"full_signature": "public static File chop(final File original, final long tailToKeep)",
"identifier": "chop",
"modifiers": "public static",
"parameters": "(final File original, final long tailToKeep)",
"return": "File",
"signature": "File chop(final File original, final long tailToKeep)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static File chop(final File original, final long tailToKeep) {\n if (!original.isFile()) {\n throw new IllegalArgumentException(\"Cannot behead directories: \" + original);\n }\n\n File truncatedFile = new File(original.getParentFile(), original.getName() + \".truncated\");\n\n FileChannel whole = null;\n FileChannel chopped = null;\n try {\n whole = new FileInputStream(original).getChannel();\n chopped = new FileOutputStream(truncatedFile).getChannel();\n\n long originalLength = original.length();\n long lengthToKeep = originalLength < tailToKeep ? 0 : originalLength - tailToKeep;\n whole.transferTo(lengthToKeep, originalLength, chopped);\n } catch (IOException e) {\n throw new IllegalStateException(\"Cannot behead file due to inconsistent internal state.\", e);\n } finally {\n Closer.close(whole, chopped);\n }\n\n // Replace original with chopped file.\n boolean isRenamed = truncatedFile.renameTo(original);\n if (!(isRenamed)) {\n IllegalStateException renameException =\n new IllegalStateException(\"Cannot replace original with chopped file to: \" + original);\n\n String originalPath = original.getAbsolutePath();\n boolean isDeleted = original.delete();\n if (isDeleted) {\n boolean isRenamedAgain = truncatedFile.renameTo(new File(originalPath));\n if (!isRenamedAgain) {\n throw renameException;\n }\n } else {\n throw renameException;\n }\n }\n\n return original;\n }",
"class_method_signature": "FileBeheader.chop(final File original, final long tailToKeep)",
"constructor": false,
"full_signature": "public static File chop(final File original, final long tailToKeep)",
"identifier": "chop",
"invocations": [
"isFile",
"getParentFile",
"getName",
"getChannel",
"getChannel",
"length",
"transferTo",
"close",
"renameTo",
"getAbsolutePath",
"delete",
"renameTo"
],
"modifiers": "public static",
"parameters": "(final File original, final long tailToKeep)",
"return": "File",
"signature": "File chop(final File original, final long tailToKeep)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_16 | {
"fields": [
{
"declarator": "job",
"modifier": "private",
"original_string": "private Job job;",
"type": "Job",
"var_name": "job"
}
],
"file": "hudson-core/src/test/java/hudson/util/DescribableListUtilTest.java",
"identifier": "DescribableListUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConvertToProjectProperties2() {\n prepareJob();\n DescribableList<Publisher, Descriptor<Publisher>> list\n = new DescribableList<Publisher, Descriptor<Publisher>>();\n Map<String, ExternalProjectProperty<Publisher>> map = DescribableListUtil.convertToProjectProperties(list, job);\n assertNotNull(map);\n assertTrue(map.isEmpty());\n }",
"class_method_signature": "DescribableListUtilTest.testConvertToProjectProperties2()",
"constructor": false,
"full_signature": "@Test public void testConvertToProjectProperties2()",
"identifier": "testConvertToProjectProperties2",
"invocations": [
"prepareJob",
"convertToProjectProperties",
"assertNotNull",
"assertTrue",
"isEmpty"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testConvertToProjectProperties2()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(DescribableListUtil.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(DescribableListUtil.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "hudson-core/src/main/java/hudson/util/DescribableListUtil.java",
"identifier": "DescribableListUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DescribableListUtil.DescribableListUtil()",
"constructor": true,
"full_signature": "private DescribableListUtil()",
"identifier": "DescribableListUtil",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " DescribableListUtil()",
"testcase": false
},
{
"class_method_signature": "DescribableListUtil.buildFromJson(\n Saveable owner,\n StaplerRequest req,\n JSONObject json,\n List<D> descriptors)",
"constructor": false,
"full_signature": "public static DescribableList<T, D> buildFromJson(\n Saveable owner,\n StaplerRequest req,\n JSONObject json,\n List<D> descriptors)",
"identifier": "buildFromJson",
"modifiers": "public static",
"parameters": "(\n Saveable owner,\n StaplerRequest req,\n JSONObject json,\n List<D> descriptors)",
"return": "DescribableList<T, D>",
"signature": "DescribableList<T, D> buildFromJson(\n Saveable owner,\n StaplerRequest req,\n JSONObject json,\n List<D> descriptors)",
"testcase": false
},
{
"class_method_signature": "DescribableListUtil.buildFromHetero(\n Saveable owner,\n StaplerRequest req, JSONObject formData,\n String key,\n Collection<D> descriptors)",
"constructor": false,
"full_signature": "public static DescribableList<T, D> buildFromHetero(\n Saveable owner,\n StaplerRequest req, JSONObject formData,\n String key,\n Collection<D> descriptors)",
"identifier": "buildFromHetero",
"modifiers": "public static",
"parameters": "(\n Saveable owner,\n StaplerRequest req, JSONObject formData,\n String key,\n Collection<D> descriptors)",
"return": "DescribableList<T, D>",
"signature": "DescribableList<T, D> buildFromHetero(\n Saveable owner,\n StaplerRequest req, JSONObject formData,\n String key,\n Collection<D> descriptors)",
"testcase": false
},
{
"class_method_signature": "DescribableListUtil.convertToProjectProperties(DescribableList<T, D> describableList, Job owner)",
"constructor": false,
"full_signature": "public static Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner)",
"identifier": "convertToProjectProperties",
"modifiers": "public static",
"parameters": "(DescribableList<T, D> describableList, Job owner)",
"return": "Map<String, ExternalProjectProperty<T>>",
"signature": "Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner)",
"testcase": false
},
{
"class_method_signature": "DescribableListUtil.convertToDescribableList(\n List<Descriptor<T>> descriptors, Job owner)",
"constructor": false,
"full_signature": "public static DescribableList<T, Descriptor<T>> convertToDescribableList(\n List<Descriptor<T>> descriptors, Job owner)",
"identifier": "convertToDescribableList",
"modifiers": "public static",
"parameters": "(\n List<Descriptor<T>> descriptors, Job owner)",
"return": "DescribableList<T, Descriptor<T>>",
"signature": "DescribableList<T, Descriptor<T>> convertToDescribableList(\n List<Descriptor<T>> descriptors, Job owner)",
"testcase": false
},
{
"class_method_signature": "DescribableListUtil.convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass)",
"identifier": "convertToDescribableList",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(List<D> descriptors, Job owner, Class<P> propertyClass)",
"return": "DescribableList<T, D>",
"signature": "DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static <T extends Describable<T>, D extends Descriptor<T>> Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner) {\n Map<String, ExternalProjectProperty<T>> result = Maps.newConcurrentMap();\n if (null != describableList) {\n for (Map.Entry<D, T> entry : describableList.toMap().entrySet()) {\n ExternalProjectProperty<T> property = new ExternalProjectProperty<T>(owner);\n String key = entry.getKey().getJsonSafeClassName();\n property.setKey(key);\n property.setValue(entry.getValue());\n result.put(key, property);\n }\n }\n return result;\n }",
"class_method_signature": "DescribableListUtil.convertToProjectProperties(DescribableList<T, D> describableList, Job owner)",
"constructor": false,
"full_signature": "public static Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner)",
"identifier": "convertToProjectProperties",
"invocations": [
"newConcurrentMap",
"entrySet",
"toMap",
"getJsonSafeClassName",
"getKey",
"setKey",
"setValue",
"getValue",
"put"
],
"modifiers": "public static",
"parameters": "(DescribableList<T, D> describableList, Job owner)",
"return": "Map<String, ExternalProjectProperty<T>>",
"signature": "Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_121 | {
"fields": [
{
"declarator": "projectService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProjectService projectService;",
"type": "ProjectService",
"var_name": "projectService"
},
{
"declarator": "securityService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SecurityService securityService;",
"type": "SecurityService",
"var_name": "securityService"
},
{
"declarator": "project",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractProject<?, ?> project;",
"type": "AbstractProject<?, ?>",
"var_name": "project"
},
{
"declarator": "build",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractBuild<?, ?> build;",
"type": "AbstractBuild<?, ?>",
"var_name": "build"
}
],
"file": "hudson-service/src/test/java/org/hudsonci/service/internal/BuildServiceImplTest.java",
"identifier": "BuildServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = NullPointerException.class)\n public void getBuildProjectNullProject() {\n getInst().getBuild((AbstractProject<?, ?>) null, 1);\n\n }",
"class_method_signature": "BuildServiceImplTest.getBuildProjectNullProject()",
"constructor": false,
"full_signature": "@Test(expected = NullPointerException.class) public void getBuildProjectNullProject()",
"identifier": "getBuildProjectNullProject",
"invocations": [
"getBuild",
"getInst"
],
"modifiers": "@Test(expected = NullPointerException.class) public",
"parameters": "()",
"return": "void",
"signature": "void getBuildProjectNullProject()",
"testcase": true
} | {
"fields": [
{
"declarator": "projects",
"modifier": "private final",
"original_string": "private final ProjectService projects;",
"type": "ProjectService",
"var_name": "projects"
},
{
"declarator": "security",
"modifier": "private final",
"original_string": "private final SecurityService security;",
"type": "SecurityService",
"var_name": "security"
}
],
"file": "hudson-service/src/main/java/org/hudsonci/service/internal/BuildServiceImpl.java",
"identifier": "BuildServiceImpl",
"interfaces": "implements BuildService",
"methods": [
{
"class_method_signature": "BuildServiceImpl.BuildServiceImpl(final ProjectService projects, SecurityService security)",
"constructor": true,
"full_signature": "@Inject BuildServiceImpl(final ProjectService projects, SecurityService security)",
"identifier": "BuildServiceImpl",
"modifiers": "@Inject",
"parameters": "(final ProjectService projects, SecurityService security)",
"return": "",
"signature": " BuildServiceImpl(final ProjectService projects, SecurityService security)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"constructor": false,
"full_signature": "public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"identifier": "keepBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"return": "void",
"signature": "void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "stopBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
}
],
"superclass": "extends ServiceSupport"
} | {
"body": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber) {\n checkProjectName(projectName);\n checkBuildNumber(buildNumber);\n\n AbstractProject<?, ?> project = projects.getProject(projectName);\n return getBuild(project, buildNumber);\n }",
"class_method_signature": "BuildServiceImpl.getBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"identifier": "getBuild",
"invocations": [
"checkProjectName",
"checkBuildNumber",
"getProject",
"getBuild"
],
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_41 | {
"fields": [
{
"declarator": "publisher = new ArtifactArchiver(null, null, false, null, false)",
"modifier": "private static",
"original_string": "private static ArtifactArchiver publisher = new ArtifactArchiver(null, null, false, null, false);",
"type": "ArtifactArchiver",
"var_name": "publisher"
},
{
"declarator": "buildResult",
"modifier": "private",
"original_string": "private Result buildResult;",
"type": "Result",
"var_name": "buildResult"
},
{
"declarator": "expectedResult",
"modifier": "private",
"original_string": "private boolean expectedResult;",
"type": "boolean",
"var_name": "expectedResult"
}
],
"file": "hudson-core/src/test/java/hudson/tasks/ArtifactArchiverTest.java",
"identifier": "ArtifactArchiverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Bug(4505)\n @Test\n public void testNeedsToRunAborted(){\n assertEquals(expectedResult, publisher.needsToRun(buildResult));\n }",
"class_method_signature": "ArtifactArchiverTest.testNeedsToRunAborted()",
"constructor": false,
"full_signature": "@Bug(4505) @Test public void testNeedsToRunAborted()",
"identifier": "testNeedsToRunAborted",
"invocations": [
"assertEquals",
"needsToRun"
],
"modifiers": "@Bug(4505) @Test public",
"parameters": "()",
"return": "void",
"signature": "void testNeedsToRunAborted()",
"testcase": true
} | {
"fields": [
{
"declarator": "artifacts",
"modifier": "private final",
"original_string": "private final String artifacts;",
"type": "String",
"var_name": "artifacts"
},
{
"declarator": "excludes",
"modifier": "private final",
"original_string": "private final String excludes;",
"type": "String",
"var_name": "excludes"
},
{
"declarator": "compressionType",
"modifier": "private",
"original_string": "private FilePath.TarCompression compressionType;",
"type": "FilePath.TarCompression",
"var_name": "compressionType"
},
{
"declarator": "latestOnly",
"modifier": "private final",
"original_string": "private final boolean latestOnly;",
"type": "boolean",
"var_name": "latestOnly"
},
{
"declarator": "autoValidateFileMask",
"modifier": "private final",
"original_string": "private final boolean autoValidateFileMask;",
"type": "boolean",
"var_name": "autoValidateFileMask"
},
{
"declarator": "allowEmptyArchive =\n Boolean.getBoolean(ArtifactArchiver.class.getName() + \".warnOnEmpty\")",
"modifier": "private static final",
"original_string": "private static final Boolean allowEmptyArchive =\n Boolean.getBoolean(ArtifactArchiver.class.getName() + \".warnOnEmpty\");",
"type": "Boolean",
"var_name": "allowEmptyArchive"
},
{
"declarator": "DESCRIPTOR",
"modifier": "public static volatile",
"original_string": "public static volatile DescriptorImpl DESCRIPTOR;",
"type": "DescriptorImpl",
"var_name": "DESCRIPTOR"
}
],
"file": "hudson-core/src/main/java/hudson/tasks/ArtifactArchiver.java",
"identifier": "ArtifactArchiver",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArtifactArchiver.ArtifactArchiver(String artifacts, String excludes, boolean latestOnly)",
"constructor": true,
"full_signature": "@Deprecated public ArtifactArchiver(String artifacts, String excludes, boolean latestOnly)",
"identifier": "ArtifactArchiver",
"modifiers": "@Deprecated public",
"parameters": "(String artifacts, String excludes, boolean latestOnly)",
"return": "",
"signature": " ArtifactArchiver(String artifacts, String excludes, boolean latestOnly)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, String compressionType)",
"constructor": true,
"full_signature": "@Deprecated public ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, String compressionType)",
"identifier": "ArtifactArchiver",
"modifiers": "@Deprecated public",
"parameters": "(String artifacts, String excludes, boolean latestOnly, String compressionType)",
"return": "",
"signature": " ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, String compressionType)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, String compressionType,\n boolean autoValidateFileMask)",
"constructor": true,
"full_signature": "@DataBoundConstructor public ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, String compressionType,\n boolean autoValidateFileMask)",
"identifier": "ArtifactArchiver",
"modifiers": "@DataBoundConstructor public",
"parameters": "(String artifacts, String excludes, boolean latestOnly, String compressionType,\n boolean autoValidateFileMask)",
"return": "",
"signature": " ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, String compressionType,\n boolean autoValidateFileMask)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.needsToRun(Result buildResult)",
"constructor": false,
"full_signature": "@Override public boolean needsToRun(Result buildResult)",
"identifier": "needsToRun",
"modifiers": "@Override public",
"parameters": "(Result buildResult)",
"return": "boolean",
"signature": "boolean needsToRun(Result buildResult)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.getArtifacts()",
"constructor": false,
"full_signature": "public String getArtifacts()",
"identifier": "getArtifacts",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getArtifacts()",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.getExcludes()",
"constructor": false,
"full_signature": "public String getExcludes()",
"identifier": "getExcludes",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getExcludes()",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.isLatestOnly()",
"constructor": false,
"full_signature": "public boolean isLatestOnly()",
"identifier": "isLatestOnly",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isLatestOnly()",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.isAutoValidateFileMask()",
"constructor": false,
"full_signature": "public boolean isAutoValidateFileMask()",
"identifier": "isAutoValidateFileMask",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isAutoValidateFileMask()",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.getCompressionType()",
"constructor": false,
"full_signature": "public FilePath.TarCompression getCompressionType()",
"identifier": "getCompressionType",
"modifiers": "public",
"parameters": "()",
"return": "FilePath.TarCompression",
"signature": "FilePath.TarCompression getCompressionType()",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.setCompressionType(String compression)",
"constructor": false,
"full_signature": "public void setCompressionType(String compression)",
"identifier": "setCompressionType",
"modifiers": "public",
"parameters": "(String compression)",
"return": "void",
"signature": "void setCompressionType(String compression)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.listenerWarnOrError(BuildListener listener, String message)",
"constructor": false,
"full_signature": "private void listenerWarnOrError(BuildListener listener, String message)",
"identifier": "listenerWarnOrError",
"modifiers": "private",
"parameters": "(BuildListener listener, String message)",
"return": "void",
"signature": "void listenerWarnOrError(BuildListener listener, String message)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)",
"constructor": false,
"full_signature": "@Override public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)",
"identifier": "perform",
"modifiers": "@Override public",
"parameters": "(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)",
"return": "boolean",
"signature": "boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.prebuild(AbstractBuild<?, ?> build, BuildListener listener)",
"constructor": false,
"full_signature": "@Override public boolean prebuild(AbstractBuild<?, ?> build, BuildListener listener)",
"identifier": "prebuild",
"modifiers": "@Override public",
"parameters": "(AbstractBuild<?, ?> build, BuildListener listener)",
"return": "boolean",
"signature": "boolean prebuild(AbstractBuild<?, ?> build, BuildListener listener)",
"testcase": false
},
{
"class_method_signature": "ArtifactArchiver.getRequiredMonitorService()",
"constructor": false,
"full_signature": "public BuildStepMonitor getRequiredMonitorService()",
"identifier": "getRequiredMonitorService",
"modifiers": "public",
"parameters": "()",
"return": "BuildStepMonitor",
"signature": "BuildStepMonitor getRequiredMonitorService()",
"testcase": false
}
],
"superclass": "extends Recorder"
} | {
"body": "@Override\n public boolean needsToRun(Result buildResult) {\n //TODO it seems we shouldn't archive if build result is worse than SUCCESS, investigate this\n return buildResult.isBetterThan(Result.ABORTED);\n }",
"class_method_signature": "ArtifactArchiver.needsToRun(Result buildResult)",
"constructor": false,
"full_signature": "@Override public boolean needsToRun(Result buildResult)",
"identifier": "needsToRun",
"invocations": [
"isBetterThan"
],
"modifiers": "@Override public",
"parameters": "(Result buildResult)",
"return": "boolean",
"signature": "boolean needsToRun(Result buildResult)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_57 | {
"fields": [
{
"declarator": "property",
"modifier": "private",
"original_string": "private TriggerProjectProperty property;",
"type": "TriggerProjectProperty",
"var_name": "property"
}
],
"file": "hudson-core/src/test/java/org/eclipse/hudson/model/project/property/TriggerProjectPropertyTest.java",
"identifier": "TriggerProjectPropertyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOnCascadingProjectRemoved() throws RecognitionException {\n Trigger trigger = new TimerTrigger(\"* * * * *\");\n property.setOriginalValue(trigger, false);\n assertTrue(trigger == property.getOriginalValue());\n assertFalse(property.isOverridden());\n property.onCascadingProjectRemoved();\n assertFalse(property.isOverridden());\n assertTrue(trigger == property.getOriginalValue());\n }",
"class_method_signature": "TriggerProjectPropertyTest.testOnCascadingProjectRemoved()",
"constructor": false,
"full_signature": "@Test public void testOnCascadingProjectRemoved()",
"identifier": "testOnCascadingProjectRemoved",
"invocations": [
"setOriginalValue",
"assertTrue",
"getOriginalValue",
"assertFalse",
"isOverridden",
"onCascadingProjectRemoved",
"assertFalse",
"isOverridden",
"assertTrue",
"getOriginalValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testOnCascadingProjectRemoved()",
"testcase": true
} | {
"fields": [],
"file": "hudson-core/src/main/java/org/eclipse/hudson/model/project/property/TriggerProjectProperty.java",
"identifier": "TriggerProjectProperty",
"interfaces": "",
"methods": [
{
"class_method_signature": "TriggerProjectProperty.TriggerProjectProperty(ICascadingJob job)",
"constructor": true,
"full_signature": "public TriggerProjectProperty(ICascadingJob job)",
"identifier": "TriggerProjectProperty",
"modifiers": "public",
"parameters": "(ICascadingJob job)",
"return": "",
"signature": " TriggerProjectProperty(ICascadingJob job)",
"testcase": false
},
{
"class_method_signature": "TriggerProjectProperty.clearOriginalValue(Trigger originalValue)",
"constructor": false,
"full_signature": "@Override protected void clearOriginalValue(Trigger originalValue)",
"identifier": "clearOriginalValue",
"modifiers": "@Override protected",
"parameters": "(Trigger originalValue)",
"return": "void",
"signature": "void clearOriginalValue(Trigger originalValue)",
"testcase": false
},
{
"class_method_signature": "TriggerProjectProperty.onCascadingProjectRemoved()",
"constructor": false,
"full_signature": "@Override protected void onCascadingProjectRemoved()",
"identifier": "onCascadingProjectRemoved",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onCascadingProjectRemoved()",
"testcase": false
}
],
"superclass": "extends BaseProjectProperty<Trigger>"
} | {
"body": "@Override\n protected void onCascadingProjectRemoved() {\n if (isOverridden() && null != getValue()) {\n getValue().stop();\n resetValue();\n }\n }",
"class_method_signature": "TriggerProjectProperty.onCascadingProjectRemoved()",
"constructor": false,
"full_signature": "@Override protected void onCascadingProjectRemoved()",
"identifier": "onCascadingProjectRemoved",
"invocations": [
"isOverridden",
"getValue",
"stop",
"getValue",
"resetValue"
],
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onCascadingProjectRemoved()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_137 | {
"fields": [
{
"declarator": "projectService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProjectService projectService;",
"type": "ProjectService",
"var_name": "projectService"
},
{
"declarator": "securityService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SecurityService securityService;",
"type": "SecurityService",
"var_name": "securityService"
},
{
"declarator": "project",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractProject<?, ?> project;",
"type": "AbstractProject<?, ?>",
"var_name": "project"
},
{
"declarator": "build",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private AbstractBuild<?, ?> build;",
"type": "AbstractBuild<?, ?>",
"var_name": "build"
}
],
"file": "hudson-service/src/test/java/org/hudsonci/service/internal/BuildServiceImplTest.java",
"identifier": "BuildServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void findBuildProjectNameNegativeBuildNumber() {\n getInst().findBuild(\"projectName\", -1);\n }",
"class_method_signature": "BuildServiceImplTest.findBuildProjectNameNegativeBuildNumber()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public void findBuildProjectNameNegativeBuildNumber()",
"identifier": "findBuildProjectNameNegativeBuildNumber",
"invocations": [
"findBuild",
"getInst"
],
"modifiers": "@Test(expected = IllegalArgumentException.class) public",
"parameters": "()",
"return": "void",
"signature": "void findBuildProjectNameNegativeBuildNumber()",
"testcase": true
} | {
"fields": [
{
"declarator": "projects",
"modifier": "private final",
"original_string": "private final ProjectService projects;",
"type": "ProjectService",
"var_name": "projects"
},
{
"declarator": "security",
"modifier": "private final",
"original_string": "private final SecurityService security;",
"type": "SecurityService",
"var_name": "security"
}
],
"file": "hudson-service/src/main/java/org/hudsonci/service/internal/BuildServiceImpl.java",
"identifier": "BuildServiceImpl",
"interfaces": "implements BuildService",
"methods": [
{
"class_method_signature": "BuildServiceImpl.BuildServiceImpl(final ProjectService projects, SecurityService security)",
"constructor": true,
"full_signature": "@Inject BuildServiceImpl(final ProjectService projects, SecurityService security)",
"identifier": "BuildServiceImpl",
"modifiers": "@Inject",
"parameters": "(final ProjectService projects, SecurityService security)",
"return": "",
"signature": " BuildServiceImpl(final ProjectService projects, SecurityService security)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "deleteBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"constructor": false,
"full_signature": "public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"identifier": "keepBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"return": "void",
"signature": "void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "getBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> getBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "findBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
},
{
"class_method_signature": "BuildServiceImpl.stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"constructor": false,
"full_signature": "public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"identifier": "stopBuild",
"modifiers": "public",
"parameters": "(final AbstractProject<?, ?> project, final int buildNumber)",
"return": "void",
"signature": "void stopBuild(final AbstractProject<?, ?> project, final int buildNumber)",
"testcase": false
}
],
"superclass": "extends ServiceSupport"
} | {
"body": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber) {\n checkProjectName(projectName);\n checkBuildNumber(buildNumber);\n\n AbstractProject<?, ?> project = projects.findProject(projectName);\n return project != null ? findBuild(project, buildNumber) : null;\n }",
"class_method_signature": "BuildServiceImpl.findBuild(final String projectName, final int buildNumber)",
"constructor": false,
"full_signature": "public AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"identifier": "findBuild",
"invocations": [
"checkProjectName",
"checkBuildNumber",
"findProject",
"findBuild"
],
"modifiers": "public",
"parameters": "(final String projectName, final int buildNumber)",
"return": "AbstractBuild<?, ?>",
"signature": "AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
2389245_82 | {
"fields": [
{
"declarator": "homeDir = FileUtils.getTempDirectory()",
"modifier": "private",
"original_string": "private File homeDir = FileUtils.getTempDirectory();",
"type": "File",
"var_name": "homeDir"
},
{
"declarator": "teamsFolder = new File(homeDir, \"teams\")",
"modifier": "private",
"original_string": "private File teamsFolder = new File(homeDir, \"teams\");",
"type": "File",
"var_name": "teamsFolder"
},
{
"declarator": "teamsConfigFileName = \"teams.xml\"",
"modifier": "private final",
"original_string": "private final String teamsConfigFileName = \"teams.xml\";",
"type": "String",
"var_name": "teamsConfigFileName"
},
{
"declarator": "teamsStore = new File(teamsFolder, teamsConfigFileName)",
"modifier": "private",
"original_string": "private File teamsStore = new File(teamsFolder, teamsConfigFileName);",
"type": "File",
"var_name": "teamsStore"
},
{
"declarator": "teamManager",
"modifier": "private",
"original_string": "private TeamManager teamManager;",
"type": "TeamManager",
"var_name": "teamManager"
}
],
"file": "hudson-core/src/test/java/org/eclipse/hudson/security/team/TeamManagerTest.java",
"identifier": "TeamManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateTeam() throws IOException, TeamManager.TeamAlreadyExistsException {\n String teamName = \"team1\";\n teamManager.createTeam(teamName);\n try {\n teamManager.addUser(teamName, \"chris\");\n teamManager.addUser(teamName, \"paul\");\n } catch (TeamNotFoundException ex) {\n fail(\"Team must exist\");\n }\n }",
"class_method_signature": "TeamManagerTest.testCreateTeam()",
"constructor": false,
"full_signature": "@Test public void testCreateTeam()",
"identifier": "testCreateTeam",
"invocations": [
"createTeam",
"addUser",
"addUser",
"fail"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testCreateTeam()",
"testcase": true
} | {
"fields": [
{
"declarator": "TEAM_SEPARATOR = \".\"",
"modifier": "public static final",
"original_string": "public static final String TEAM_SEPARATOR = \".\";",
"type": "String",
"var_name": "TEAM_SEPARATOR"
},
{
"declarator": "sysAdmins = new CopyOnWriteArrayList()",
"modifier": "private final",
"original_string": "private final List<String> sysAdmins = new CopyOnWriteArrayList();",
"type": "List<String>",
"var_name": "sysAdmins"
},
{
"declarator": "teams = new CopyOnWriteArrayList<Team>()",
"modifier": "private final",
"original_string": "private final List<Team> teams = new CopyOnWriteArrayList<Team>();",
"type": "List<Team>",
"var_name": "teams"
},
{
"declarator": "xstream = new XStream2()",
"modifier": "private transient final",
"original_string": "private transient final XStream xstream = new XStream2();",
"type": "XStream",
"var_name": "xstream"
},
{
"declarator": "logger = LoggerFactory.getLogger(TeamManager.class)",
"modifier": "private final transient",
"original_string": "private final transient Logger logger = LoggerFactory.getLogger(TeamManager.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "hudsonHomeDir",
"modifier": "private final transient",
"original_string": "private final transient File hudsonHomeDir;",
"type": "File",
"var_name": "hudsonHomeDir"
},
{
"declarator": "teamsFolder",
"modifier": "private final transient",
"original_string": "private final transient File teamsFolder;",
"type": "File",
"var_name": "teamsFolder"
},
{
"declarator": "teamsConfigFileName = \"teams.xml\"",
"modifier": "private transient final",
"original_string": "private transient final String teamsConfigFileName = \"teams.xml\";",
"type": "String",
"var_name": "teamsConfigFileName"
},
{
"declarator": "publicTeam",
"modifier": "private transient",
"original_string": "private transient PublicTeam publicTeam;",
"type": "PublicTeam",
"var_name": "publicTeam"
},
{
"declarator": "TEAMS_FOLDER_NAME = \"teams\"",
"modifier": "private transient final",
"original_string": "private transient final String TEAMS_FOLDER_NAME = \"teams\";",
"type": "String",
"var_name": "TEAMS_FOLDER_NAME"
},
{
"declarator": "ADMIN = \"Admin\"",
"modifier": "public static final",
"original_string": "public static final String ADMIN = \"Admin\";",
"type": "String",
"var_name": "ADMIN"
},
{
"declarator": "ALL_TEAM_PERMISSIONS = new String[]{\n ADMIN, // not a real permission, but needed to distinguish admins\n Item.BUILD.getName(),\n Item.CONFIGURE.getName(),\n Item.CREATE.getName(),\n Item.DELETE.getName(),\n Item.EXTENDED_READ.getName(),\n Item.READ.getName(),\n Item.WIPEOUT.getName(),\n Item.WORKSPACE.getName(),}",
"modifier": "public static",
"original_string": "public static String[] ALL_TEAM_PERMISSIONS = new String[]{\n ADMIN, // not a real permission, but needed to distinguish admins\n Item.BUILD.getName(),\n Item.CONFIGURE.getName(),\n Item.CREATE.getName(),\n Item.DELETE.getName(),\n Item.EXTENDED_READ.getName(),\n Item.READ.getName(),\n Item.WIPEOUT.getName(),\n Item.WORKSPACE.getName(),};",
"type": "String[]",
"var_name": "ALL_TEAM_PERMISSIONS"
},
{
"declarator": "useBulkSaveFlag = true",
"modifier": "private transient",
"original_string": "private transient boolean useBulkSaveFlag = true;",
"type": "boolean",
"var_name": "useBulkSaveFlag"
}
],
"file": "hudson-core/src/main/java/org/eclipse/hudson/security/team/TeamManager.java",
"identifier": "TeamManager",
"interfaces": "implements Saveable, AccessControlled",
"methods": [
{
"class_method_signature": "TeamManager.TeamManager(File homeDir)",
"constructor": true,
"full_signature": "public TeamManager(File homeDir)",
"identifier": "TeamManager",
"modifiers": "public",
"parameters": "(File homeDir)",
"return": "",
"signature": " TeamManager(File homeDir)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getACL()",
"constructor": false,
"full_signature": "@Override public ACL getACL()",
"identifier": "getACL",
"modifiers": "@Override public",
"parameters": "()",
"return": "ACL",
"signature": "ACL getACL()",
"testcase": false
},
{
"class_method_signature": "TeamManager.hasPermission(Permission permission)",
"constructor": false,
"full_signature": "@Override public boolean hasPermission(Permission permission)",
"identifier": "hasPermission",
"modifiers": "@Override public",
"parameters": "(Permission permission)",
"return": "boolean",
"signature": "boolean hasPermission(Permission permission)",
"testcase": false
},
{
"class_method_signature": "TeamManager.checkPermission(Permission permission)",
"constructor": false,
"full_signature": "@Override public void checkPermission(Permission permission)",
"identifier": "checkPermission",
"modifiers": "@Override public",
"parameters": "(Permission permission)",
"return": "void",
"signature": "void checkPermission(Permission permission)",
"testcase": false
},
{
"class_method_signature": "TeamManager.isTeamManagementEnabled()",
"constructor": false,
"full_signature": "public boolean isTeamManagementEnabled()",
"identifier": "isTeamManagementEnabled",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isTeamManagementEnabled()",
"testcase": false
},
{
"class_method_signature": "TeamManager.addSysAdmin(String adminName)",
"constructor": false,
"full_signature": "public void addSysAdmin(String adminName)",
"identifier": "addSysAdmin",
"modifiers": "public",
"parameters": "(String adminName)",
"return": "void",
"signature": "void addSysAdmin(String adminName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeSysAdmin(String adminName)",
"constructor": false,
"full_signature": "public void removeSysAdmin(String adminName)",
"identifier": "removeSysAdmin",
"modifiers": "public",
"parameters": "(String adminName)",
"return": "void",
"signature": "void removeSysAdmin(String adminName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getSysAdmins()",
"constructor": false,
"full_signature": "public List<String> getSysAdmins()",
"identifier": "getSysAdmins",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getSysAdmins()",
"testcase": false
},
{
"class_method_signature": "TeamManager.isSysAdmin(String userName)",
"constructor": false,
"full_signature": " boolean isSysAdmin(String userName)",
"identifier": "isSysAdmin",
"modifiers": "",
"parameters": "(String userName)",
"return": "boolean",
"signature": "boolean isSysAdmin(String userName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.isCurrentUserSysAdmin()",
"constructor": false,
"full_signature": "public boolean isCurrentUserSysAdmin()",
"identifier": "isCurrentUserSysAdmin",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isCurrentUserSysAdmin()",
"testcase": false
},
{
"class_method_signature": "TeamManager.isCurrentUserTeamAdmin(String teamName)",
"constructor": false,
"full_signature": "public boolean isCurrentUserTeamAdmin(String teamName)",
"identifier": "isCurrentUserTeamAdmin",
"modifiers": "public",
"parameters": "(String teamName)",
"return": "boolean",
"signature": "boolean isCurrentUserTeamAdmin(String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.isCurrentUserAnyTeamAdmin()",
"constructor": false,
"full_signature": "public boolean isCurrentUserAnyTeamAdmin()",
"identifier": "isCurrentUserAnyTeamAdmin",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isCurrentUserAnyTeamAdmin()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getTeams()",
"constructor": false,
"full_signature": "public Map<String, Team> getTeams()",
"identifier": "getTeams",
"modifiers": "public",
"parameters": "()",
"return": "Map<String, Team>",
"signature": "Map<String, Team> getTeams()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getTeamNames()",
"constructor": false,
"full_signature": "public List<String> getTeamNames()",
"identifier": "getTeamNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getTeamNames()",
"testcase": false
},
{
"class_method_signature": "TeamManager.createTeam(String teamName)",
"constructor": false,
"full_signature": "public Team createTeam(String teamName)",
"identifier": "createTeam",
"modifiers": "public",
"parameters": "(String teamName)",
"return": "Team",
"signature": "Team createTeam(String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.createTeam(String teamName, String description, String customFolder)",
"constructor": false,
"full_signature": "public Team createTeam(String teamName, String description, String customFolder)",
"identifier": "createTeam",
"modifiers": "public",
"parameters": "(String teamName, String description, String customFolder)",
"return": "Team",
"signature": "Team createTeam(String teamName, String description, String customFolder)",
"testcase": false
},
{
"class_method_signature": "TeamManager.internalCreateTeam(String teamName, String description, String customFolder)",
"constructor": false,
"full_signature": "private Team internalCreateTeam(String teamName, String description, String customFolder)",
"identifier": "internalCreateTeam",
"modifiers": "private",
"parameters": "(String teamName, String description, String customFolder)",
"return": "Team",
"signature": "Team internalCreateTeam(String teamName, String description, String customFolder)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addTeam(Team team)",
"constructor": false,
"full_signature": "private void addTeam(Team team)",
"identifier": "addTeam",
"modifiers": "private",
"parameters": "(Team team)",
"return": "void",
"signature": "void addTeam(Team team)",
"testcase": false
},
{
"class_method_signature": "TeamManager.deleteTeam(String teamName)",
"constructor": false,
"full_signature": "public void deleteTeam(String teamName)",
"identifier": "deleteTeam",
"modifiers": "public",
"parameters": "(String teamName)",
"return": "void",
"signature": "void deleteTeam(String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.deleteTeam(String teamName, boolean deleteJobs)",
"constructor": false,
"full_signature": "public void deleteTeam(String teamName, boolean deleteJobs)",
"identifier": "deleteTeam",
"modifiers": "public",
"parameters": "(String teamName, boolean deleteJobs)",
"return": "void",
"signature": "void deleteTeam(String teamName, boolean deleteJobs)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findTeam(String teamName)",
"constructor": false,
"full_signature": "public Team findTeam(String teamName)",
"identifier": "findTeam",
"modifiers": "public",
"parameters": "(String teamName)",
"return": "Team",
"signature": "Team findTeam(String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeTeam(String teamName)",
"constructor": false,
"full_signature": "public void removeTeam(String teamName)",
"identifier": "removeTeam",
"modifiers": "public",
"parameters": "(String teamName)",
"return": "void",
"signature": "void removeTeam(String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doCreateTeam(@QueryParameter String teamName, @QueryParameter String description, @QueryParameter String customFolder)",
"constructor": false,
"full_signature": "public HttpResponse doCreateTeam(@QueryParameter String teamName, @QueryParameter String description, @QueryParameter String customFolder)",
"identifier": "doCreateTeam",
"modifiers": "public",
"parameters": "(@QueryParameter String teamName, @QueryParameter String description, @QueryParameter String customFolder)",
"return": "HttpResponse",
"signature": "HttpResponse doCreateTeam(@QueryParameter String teamName, @QueryParameter String description, @QueryParameter String customFolder)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doDeleteTeam(@QueryParameter String teamName)",
"constructor": false,
"full_signature": "public HttpResponse doDeleteTeam(@QueryParameter String teamName)",
"identifier": "doDeleteTeam",
"modifiers": "public",
"parameters": "(@QueryParameter String teamName)",
"return": "HttpResponse",
"signature": "HttpResponse doDeleteTeam(@QueryParameter String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doAddTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView\n )",
"constructor": false,
"full_signature": "public HttpResponse doAddTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView\n )",
"identifier": "doAddTeamMember",
"modifiers": "public",
"parameters": "(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView\n )",
"return": "HttpResponse",
"signature": "HttpResponse doAddTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView\n )",
"testcase": false
},
{
"class_method_signature": "TeamManager.doUpdateTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView)",
"constructor": false,
"full_signature": "public HttpResponse doUpdateTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView)",
"identifier": "doUpdateTeamMember",
"modifiers": "public",
"parameters": "(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView)",
"return": "HttpResponse",
"signature": "HttpResponse doUpdateTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid,\n @QueryParameter boolean isTeamAdmin,\n @QueryParameter boolean canCreate,\n @QueryParameter boolean canDelete,\n @QueryParameter boolean canConfigure,\n @QueryParameter boolean canBuild,\n @QueryParameter boolean canCreateNode,\n @QueryParameter boolean canDeleteNode,\n @QueryParameter boolean canConfigureNode,\n @QueryParameter boolean canCreateView,\n @QueryParameter boolean canDeleteView,\n @QueryParameter boolean canConfigureView)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doRemoveTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid)",
"constructor": false,
"full_signature": "public HttpResponse doRemoveTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid)",
"identifier": "doRemoveTeamMember",
"modifiers": "public",
"parameters": "(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid)",
"return": "HttpResponse",
"signature": "HttpResponse doRemoveTeamMember(@QueryParameter String teamName,\n @QueryParameter String teamMemberSid)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doMoveJob(@QueryParameter String jobName, @QueryParameter String teamName)",
"constructor": false,
"full_signature": "public HttpResponse doMoveJob(@QueryParameter String jobName, @QueryParameter String teamName)",
"identifier": "doMoveJob",
"modifiers": "public",
"parameters": "(@QueryParameter String jobName, @QueryParameter String teamName)",
"return": "HttpResponse",
"signature": "HttpResponse doMoveJob(@QueryParameter String jobName, @QueryParameter String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doMoveView(@QueryParameter String viewName, @QueryParameter String teamName)",
"constructor": false,
"full_signature": "public HttpResponse doMoveView(@QueryParameter String viewName, @QueryParameter String teamName)",
"identifier": "doMoveView",
"modifiers": "public",
"parameters": "(@QueryParameter String viewName, @QueryParameter String teamName)",
"return": "HttpResponse",
"signature": "HttpResponse doMoveView(@QueryParameter String viewName, @QueryParameter String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.moveView(Team oldTeam, Team newTeam, String viewName)",
"constructor": false,
"full_signature": "public void moveView(Team oldTeam, Team newTeam, String viewName)",
"identifier": "moveView",
"modifiers": "public",
"parameters": "(Team oldTeam, Team newTeam, String viewName)",
"return": "void",
"signature": "void moveView(Team oldTeam, Team newTeam, String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doMoveNode(@QueryParameter String nodeName, @QueryParameter String teamName)",
"constructor": false,
"full_signature": "public HttpResponse doMoveNode(@QueryParameter String nodeName, @QueryParameter String teamName)",
"identifier": "doMoveNode",
"modifiers": "public",
"parameters": "(@QueryParameter String nodeName, @QueryParameter String teamName)",
"return": "HttpResponse",
"signature": "HttpResponse doMoveNode(@QueryParameter String nodeName, @QueryParameter String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.moveNode(Team oldTeam, Team newTeam, String nodeName)",
"constructor": false,
"full_signature": "public void moveNode(Team oldTeam, Team newTeam, String nodeName)",
"identifier": "moveNode",
"modifiers": "public",
"parameters": "(Team oldTeam, Team newTeam, String nodeName)",
"return": "void",
"signature": "void moveNode(Team oldTeam, Team newTeam, String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doSetJobVisibility(@QueryParameter String jobName, @QueryParameter String teamNames, @QueryParameter boolean canViewConfig)",
"constructor": false,
"full_signature": "public HttpResponse doSetJobVisibility(@QueryParameter String jobName, @QueryParameter String teamNames, @QueryParameter boolean canViewConfig)",
"identifier": "doSetJobVisibility",
"modifiers": "public",
"parameters": "(@QueryParameter String jobName, @QueryParameter String teamNames, @QueryParameter boolean canViewConfig)",
"return": "HttpResponse",
"signature": "HttpResponse doSetJobVisibility(@QueryParameter String jobName, @QueryParameter String teamNames, @QueryParameter boolean canViewConfig)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doSetViewVisibility(@QueryParameter String viewName, @QueryParameter String teamNames)",
"constructor": false,
"full_signature": "public HttpResponse doSetViewVisibility(@QueryParameter String viewName, @QueryParameter String teamNames)",
"identifier": "doSetViewVisibility",
"modifiers": "public",
"parameters": "(@QueryParameter String viewName, @QueryParameter String teamNames)",
"return": "HttpResponse",
"signature": "HttpResponse doSetViewVisibility(@QueryParameter String viewName, @QueryParameter String teamNames)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doSetPrimaryView(@QueryParameter String viewName, @QueryParameter String teamName)",
"constructor": false,
"full_signature": "public HttpResponse doSetPrimaryView(@QueryParameter String viewName, @QueryParameter String teamName)",
"identifier": "doSetPrimaryView",
"modifiers": "public",
"parameters": "(@QueryParameter String viewName, @QueryParameter String teamName)",
"return": "HttpResponse",
"signature": "HttpResponse doSetPrimaryView(@QueryParameter String viewName, @QueryParameter String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addViewVisibility(TeamView view, String teamName)",
"constructor": false,
"full_signature": "public void addViewVisibility(TeamView view, String teamName)",
"identifier": "addViewVisibility",
"modifiers": "public",
"parameters": "(TeamView view, String teamName)",
"return": "void",
"signature": "void addViewVisibility(TeamView view, String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doSetNodeVisibility(@QueryParameter String nodeName, @QueryParameter String teamNames)",
"constructor": false,
"full_signature": "public HttpResponse doSetNodeVisibility(@QueryParameter String nodeName, @QueryParameter String teamNames)",
"identifier": "doSetNodeVisibility",
"modifiers": "public",
"parameters": "(@QueryParameter String nodeName, @QueryParameter String teamNames)",
"return": "HttpResponse",
"signature": "HttpResponse doSetNodeVisibility(@QueryParameter String nodeName, @QueryParameter String teamNames)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doSetNodeEnabled(@QueryParameter String nodeName, @QueryParameter String teamName, @QueryParameter boolean enabled)",
"constructor": false,
"full_signature": "public HttpResponse doSetNodeEnabled(@QueryParameter String nodeName, @QueryParameter String teamName, @QueryParameter boolean enabled)",
"identifier": "doSetNodeEnabled",
"modifiers": "public",
"parameters": "(@QueryParameter String nodeName, @QueryParameter String teamName, @QueryParameter boolean enabled)",
"return": "HttpResponse",
"signature": "HttpResponse doSetNodeEnabled(@QueryParameter String nodeName, @QueryParameter String teamName, @QueryParameter boolean enabled)",
"testcase": false
},
{
"class_method_signature": "TeamManager.setNodeEnabled(String nodeName, Team team, boolean enabled)",
"constructor": false,
"full_signature": "public void setNodeEnabled(String nodeName, Team team, boolean enabled)",
"identifier": "setNodeEnabled",
"modifiers": "public",
"parameters": "(String nodeName, Team team, boolean enabled)",
"return": "void",
"signature": "void setNodeEnabled(String nodeName, Team team, boolean enabled)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addNodeVisibility(TeamNode node, String teamName)",
"constructor": false,
"full_signature": "public void addNodeVisibility(TeamNode node, String teamName)",
"identifier": "addNodeVisibility",
"modifiers": "public",
"parameters": "(TeamNode node, String teamName)",
"return": "void",
"signature": "void addNodeVisibility(TeamNode node, String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doCheckSid(@QueryParameter String sid)",
"constructor": false,
"full_signature": "public HttpResponse doCheckSid(@QueryParameter String sid)",
"identifier": "doCheckSid",
"modifiers": "public",
"parameters": "(@QueryParameter String sid)",
"return": "HttpResponse",
"signature": "HttpResponse doCheckSid(@QueryParameter String sid)",
"testcase": false
},
{
"class_method_signature": "TeamManager.moveJob(Job job, Team oldTeam, Team newTeam, String originalName)",
"constructor": false,
"full_signature": "private String moveJob(Job job, Team oldTeam, Team newTeam, String originalName)",
"identifier": "moveJob",
"modifiers": "private",
"parameters": "(Job job, Team oldTeam, Team newTeam, String originalName)",
"return": "String",
"signature": "String moveJob(Job job, Team oldTeam, Team newTeam, String originalName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addJob(String unqualifiedJobName, Team team)",
"constructor": false,
"full_signature": "public String addJob(String unqualifiedJobName, Team team)",
"identifier": "addJob",
"modifiers": "public",
"parameters": "(String unqualifiedJobName, Team team)",
"return": "String",
"signature": "String addJob(String unqualifiedJobName, Team team)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getUnqualifiedJobName(Team team, String jobName)",
"constructor": false,
"full_signature": "public String getUnqualifiedJobName(Team team, String jobName)",
"identifier": "getUnqualifiedJobName",
"modifiers": "public",
"parameters": "(Team team, String jobName)",
"return": "String",
"signature": "String getUnqualifiedJobName(Team team, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.doGetTeamsJson()",
"constructor": false,
"full_signature": "public HttpResponse doGetTeamsJson()",
"identifier": "doGetTeamsJson",
"modifiers": "public",
"parameters": "()",
"return": "HttpResponse",
"signature": "HttpResponse doGetTeamsJson()",
"testcase": false
},
{
"class_method_signature": "TeamManager.doGetAllTeamsJson()",
"constructor": false,
"full_signature": "public HttpResponse doGetAllTeamsJson()",
"identifier": "doGetAllTeamsJson",
"modifiers": "public",
"parameters": "()",
"return": "HttpResponse",
"signature": "HttpResponse doGetAllTeamsJson()",
"testcase": false
},
{
"class_method_signature": "TeamManager.doGetViewsJson(@QueryParameter final String teamName)",
"constructor": false,
"full_signature": "public HttpResponse doGetViewsJson(@QueryParameter final String teamName)",
"identifier": "doGetViewsJson",
"modifiers": "public",
"parameters": "(@QueryParameter final String teamName)",
"return": "HttpResponse",
"signature": "HttpResponse doGetViewsJson(@QueryParameter final String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.writeJson(StaplerResponse rsp, List<String> data)",
"constructor": false,
"full_signature": "private void writeJson(StaplerResponse rsp, List<String> data)",
"identifier": "writeJson",
"modifiers": "private",
"parameters": "(StaplerResponse rsp, List<String> data)",
"return": "void",
"signature": "void writeJson(StaplerResponse rsp, List<String> data)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addUser(String teamName, String userName)",
"constructor": false,
"full_signature": " void addUser(String teamName, String userName)",
"identifier": "addUser",
"modifiers": "",
"parameters": "(String teamName, String userName)",
"return": "void",
"signature": "void addUser(String teamName, String userName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.isCurrentUserHasAccessToTeam(String teamName)",
"constructor": false,
"full_signature": "public boolean isCurrentUserHasAccessToTeam(String teamName)",
"identifier": "isCurrentUserHasAccessToTeam",
"modifiers": "public",
"parameters": "(String teamName)",
"return": "boolean",
"signature": "boolean isCurrentUserHasAccessToTeam(String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUser()",
"constructor": false,
"full_signature": "private String getCurrentUser()",
"identifier": "getCurrentUser",
"modifiers": "private",
"parameters": "()",
"return": "String",
"signature": "String getCurrentUser()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserRoles()",
"constructor": false,
"full_signature": "private Collection<? extends GrantedAuthority> getCurrentUserRoles()",
"identifier": "getCurrentUserRoles",
"modifiers": "private",
"parameters": "()",
"return": "Collection<? extends GrantedAuthority>",
"signature": "Collection<? extends GrantedAuthority> getCurrentUserRoles()",
"testcase": false
},
{
"class_method_signature": "TeamManager.isCurrentUserAdminInSingleTeam()",
"constructor": false,
"full_signature": "public boolean isCurrentUserAdminInSingleTeam()",
"identifier": "isCurrentUserAdminInSingleTeam",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isCurrentUserAdminInSingleTeam()",
"testcase": false
},
{
"class_method_signature": "TeamManager.isCurrentUserAdminInMultipleTeams()",
"constructor": false,
"full_signature": "public boolean isCurrentUserAdminInMultipleTeams()",
"identifier": "isCurrentUserAdminInMultipleTeams",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isCurrentUserAdminInMultipleTeams()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserAdminTeam()",
"constructor": false,
"full_signature": "public String getCurrentUserAdminTeam()",
"identifier": "getCurrentUserAdminTeam",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getCurrentUserAdminTeam()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserAdminTeams()",
"constructor": false,
"full_signature": "public Collection<String> getCurrentUserAdminTeams()",
"identifier": "getCurrentUserAdminTeams",
"modifiers": "public",
"parameters": "()",
"return": "Collection<String>",
"signature": "Collection<String> getCurrentUserAdminTeams()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserAdminJobs()",
"constructor": false,
"full_signature": "public Collection<String> getCurrentUserAdminJobs()",
"identifier": "getCurrentUserAdminJobs",
"modifiers": "public",
"parameters": "()",
"return": "Collection<String>",
"signature": "Collection<String> getCurrentUserAdminJobs()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserAdminViews()",
"constructor": false,
"full_signature": "public Collection<String> getCurrentUserAdminViews()",
"identifier": "getCurrentUserAdminViews",
"modifiers": "public",
"parameters": "()",
"return": "Collection<String>",
"signature": "Collection<String> getCurrentUserAdminViews()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserAdminNodes()",
"constructor": false,
"full_signature": "public Collection<String> getCurrentUserAdminNodes()",
"identifier": "getCurrentUserAdminNodes",
"modifiers": "public",
"parameters": "()",
"return": "Collection<String>",
"signature": "Collection<String> getCurrentUserAdminNodes()",
"testcase": false
},
{
"class_method_signature": "TeamManager.isCurrentUserInMultipleTeams()",
"constructor": false,
"full_signature": "public boolean isCurrentUserInMultipleTeams()",
"identifier": "isCurrentUserInMultipleTeams",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isCurrentUserInMultipleTeams()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserTeams()",
"constructor": false,
"full_signature": "public Collection<String> getCurrentUserTeams()",
"identifier": "getCurrentUserTeams",
"modifiers": "public",
"parameters": "()",
"return": "Collection<String>",
"signature": "Collection<String> getCurrentUserTeams()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserTeamsWithCreatePermission()",
"constructor": false,
"full_signature": "public Collection<String> getCurrentUserTeamsWithCreatePermission()",
"identifier": "getCurrentUserTeamsWithCreatePermission",
"modifiers": "public",
"parameters": "()",
"return": "Collection<String>",
"signature": "Collection<String> getCurrentUserTeamsWithCreatePermission()",
"testcase": false
},
{
"class_method_signature": "TeamManager.findUserTeams(String userName)",
"constructor": false,
"full_signature": "public List<Team> findUserTeams(String userName)",
"identifier": "findUserTeams",
"modifiers": "public",
"parameters": "(String userName)",
"return": "List<Team>",
"signature": "List<Team> findUserTeams(String userName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findUserTeamForItem(String userName)",
"constructor": false,
"full_signature": "public Team findUserTeamForItem(String userName)",
"identifier": "findUserTeamForItem",
"modifiers": "public",
"parameters": "(String userName)",
"return": "Team",
"signature": "Team findUserTeamForItem(String userName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findUserTeamForJob(String userName)",
"constructor": false,
"full_signature": "public Team findUserTeamForJob(String userName)",
"identifier": "findUserTeamForJob",
"modifiers": "public",
"parameters": "(String userName)",
"return": "Team",
"signature": "Team findUserTeamForJob(String userName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findUserTeamForView(String userName)",
"constructor": false,
"full_signature": "public Team findUserTeamForView(String userName)",
"identifier": "findUserTeamForView",
"modifiers": "public",
"parameters": "(String userName)",
"return": "Team",
"signature": "Team findUserTeamForView(String userName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findUserTeamForNode(String userName)",
"constructor": false,
"full_signature": "public Team findUserTeamForNode(String userName)",
"identifier": "findUserTeamForNode",
"modifiers": "public",
"parameters": "(String userName)",
"return": "Team",
"signature": "Team findUserTeamForNode(String userName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getTeamAwareSecurityRealm()",
"constructor": false,
"full_signature": "private TeamAwareSecurityRealm getTeamAwareSecurityRealm()",
"identifier": "getTeamAwareSecurityRealm",
"modifiers": "private",
"parameters": "()",
"return": "TeamAwareSecurityRealm",
"signature": "TeamAwareSecurityRealm getTeamAwareSecurityRealm()",
"testcase": false
},
{
"class_method_signature": "TeamManager.findCurrentUserTeams()",
"constructor": false,
"full_signature": "public List<Team> findCurrentUserTeams()",
"identifier": "findCurrentUserTeams",
"modifiers": "public",
"parameters": "()",
"return": "List<Team>",
"signature": "List<Team> findCurrentUserTeams()",
"testcase": false
},
{
"class_method_signature": "TeamManager.findJobOwnerTeam(String jobName)",
"constructor": false,
"full_signature": "public Team findJobOwnerTeam(String jobName)",
"identifier": "findJobOwnerTeam",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "Team",
"signature": "Team findJobOwnerTeam(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findJob(String jobName)",
"constructor": false,
"full_signature": "public TeamJob findJob(String jobName)",
"identifier": "findJob",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "TeamJob",
"signature": "TeamJob findJob(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addJob(Team team, String jobName)",
"constructor": false,
"full_signature": "public void addJob(Team team, String jobName)",
"identifier": "addJob",
"modifiers": "public",
"parameters": "(Team team, String jobName)",
"return": "void",
"signature": "void addJob(Team team, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.renameJob(Team team, String oldJobName, String newJobName)",
"constructor": false,
"full_signature": "public void renameJob(Team team, String oldJobName, String newJobName)",
"identifier": "renameJob",
"modifiers": "public",
"parameters": "(Team team, String oldJobName, String newJobName)",
"return": "void",
"signature": "void renameJob(Team team, String oldJobName, String newJobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeJob(Team team, String jobName)",
"constructor": false,
"full_signature": "public void removeJob(Team team, String jobName)",
"identifier": "removeJob",
"modifiers": "public",
"parameters": "(Team team, String jobName)",
"return": "void",
"signature": "void removeJob(Team team, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeJob(String jobName)",
"constructor": false,
"full_signature": "public void removeJob(String jobName)",
"identifier": "removeJob",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "void",
"signature": "void removeJob(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addJobToUserTeam(String userName, String jobName)",
"constructor": false,
"full_signature": "public void addJobToUserTeam(String userName, String jobName)",
"identifier": "addJobToUserTeam",
"modifiers": "public",
"parameters": "(String userName, String jobName)",
"return": "void",
"signature": "void addJobToUserTeam(String userName, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addJobToCurrentUserTeam(String jobName)",
"constructor": false,
"full_signature": "public void addJobToCurrentUserTeam(String jobName)",
"identifier": "addJobToCurrentUserTeam",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "void",
"signature": "void addJobToCurrentUserTeam(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeJobFromUserTeam(String userName, String jobName)",
"constructor": false,
"full_signature": " void removeJobFromUserTeam(String userName, String jobName)",
"identifier": "removeJobFromUserTeam",
"modifiers": "",
"parameters": "(String userName, String jobName)",
"return": "void",
"signature": "void removeJobFromUserTeam(String userName, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.renameJobInUserTeam(String userName, String oldJobName, String newJobName)",
"constructor": false,
"full_signature": " void renameJobInUserTeam(String userName, String oldJobName, String newJobName)",
"identifier": "renameJobInUserTeam",
"modifiers": "",
"parameters": "(String userName, String oldJobName, String newJobName)",
"return": "void",
"signature": "void renameJobInUserTeam(String userName, String oldJobName, String newJobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findNodeOwnerTeam(String nodeName)",
"constructor": false,
"full_signature": "public Team findNodeOwnerTeam(String nodeName)",
"identifier": "findNodeOwnerTeam",
"modifiers": "public",
"parameters": "(String nodeName)",
"return": "Team",
"signature": "Team findNodeOwnerTeam(String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addNode(Team team, String nodeName)",
"constructor": false,
"full_signature": "public void addNode(Team team, String nodeName)",
"identifier": "addNode",
"modifiers": "public",
"parameters": "(Team team, String nodeName)",
"return": "void",
"signature": "void addNode(Team team, String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.renameNode(Team team, String oldNodeName, String newNodeName)",
"constructor": false,
"full_signature": "public void renameNode(Team team, String oldNodeName, String newNodeName)",
"identifier": "renameNode",
"modifiers": "public",
"parameters": "(Team team, String oldNodeName, String newNodeName)",
"return": "void",
"signature": "void renameNode(Team team, String oldNodeName, String newNodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeNode(Team team, String nodeName)",
"constructor": false,
"full_signature": "public void removeNode(Team team, String nodeName)",
"identifier": "removeNode",
"modifiers": "public",
"parameters": "(Team team, String nodeName)",
"return": "void",
"signature": "void removeNode(Team team, String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findNode(String nodeName)",
"constructor": false,
"full_signature": "public TeamNode findNode(String nodeName)",
"identifier": "findNode",
"modifiers": "public",
"parameters": "(String nodeName)",
"return": "TeamNode",
"signature": "TeamNode findNode(String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeNode(String nodeName)",
"constructor": false,
"full_signature": "public void removeNode(String nodeName)",
"identifier": "removeNode",
"modifiers": "public",
"parameters": "(String nodeName)",
"return": "void",
"signature": "void removeNode(String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addNodeToUserTeam(String userName, String nodeName)",
"constructor": false,
"full_signature": "public void addNodeToUserTeam(String userName, String nodeName)",
"identifier": "addNodeToUserTeam",
"modifiers": "public",
"parameters": "(String userName, String nodeName)",
"return": "void",
"signature": "void addNodeToUserTeam(String userName, String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addNodeToCurrentUserTeam(String nodeName)",
"constructor": false,
"full_signature": "public void addNodeToCurrentUserTeam(String nodeName)",
"identifier": "addNodeToCurrentUserTeam",
"modifiers": "public",
"parameters": "(String nodeName)",
"return": "void",
"signature": "void addNodeToCurrentUserTeam(String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeNodeFromUserTeam(String userName, String nodeName)",
"constructor": false,
"full_signature": " void removeNodeFromUserTeam(String userName, String nodeName)",
"identifier": "removeNodeFromUserTeam",
"modifiers": "",
"parameters": "(String userName, String nodeName)",
"return": "void",
"signature": "void removeNodeFromUserTeam(String userName, String nodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.renameNodeInUserTeam(String userName, String oldNodeName, String newNodeName)",
"constructor": false,
"full_signature": " void renameNodeInUserTeam(String userName, String oldNodeName, String newNodeName)",
"identifier": "renameNodeInUserTeam",
"modifiers": "",
"parameters": "(String userName, String oldNodeName, String newNodeName)",
"return": "void",
"signature": "void renameNodeInUserTeam(String userName, String oldNodeName, String newNodeName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findViewOwnerTeam(String viewName)",
"constructor": false,
"full_signature": "public Team findViewOwnerTeam(String viewName)",
"identifier": "findViewOwnerTeam",
"modifiers": "public",
"parameters": "(String viewName)",
"return": "Team",
"signature": "Team findViewOwnerTeam(String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findView(String viewName)",
"constructor": false,
"full_signature": "public TeamView findView(String viewName)",
"identifier": "findView",
"modifiers": "public",
"parameters": "(String viewName)",
"return": "TeamView",
"signature": "TeamView findView(String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addView(Team team, String viewName)",
"constructor": false,
"full_signature": "public void addView(Team team, String viewName)",
"identifier": "addView",
"modifiers": "public",
"parameters": "(Team team, String viewName)",
"return": "void",
"signature": "void addView(Team team, String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.renameView(Team team, String oldViewName, String newViewName)",
"constructor": false,
"full_signature": "public void renameView(Team team, String oldViewName, String newViewName)",
"identifier": "renameView",
"modifiers": "public",
"parameters": "(Team team, String oldViewName, String newViewName)",
"return": "void",
"signature": "void renameView(Team team, String oldViewName, String newViewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeView(Team team, String viewName)",
"constructor": false,
"full_signature": "public void removeView(Team team, String viewName)",
"identifier": "removeView",
"modifiers": "public",
"parameters": "(Team team, String viewName)",
"return": "void",
"signature": "void removeView(Team team, String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeView(String viewName)",
"constructor": false,
"full_signature": "public void removeView(String viewName)",
"identifier": "removeView",
"modifiers": "public",
"parameters": "(String viewName)",
"return": "void",
"signature": "void removeView(String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addViewToUserTeam(String userName, String viewName)",
"constructor": false,
"full_signature": "public void addViewToUserTeam(String userName, String viewName)",
"identifier": "addViewToUserTeam",
"modifiers": "public",
"parameters": "(String userName, String viewName)",
"return": "void",
"signature": "void addViewToUserTeam(String userName, String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.addViewToCurrentUserTeam(String viewName)",
"constructor": false,
"full_signature": "public void addViewToCurrentUserTeam(String viewName)",
"identifier": "addViewToCurrentUserTeam",
"modifiers": "public",
"parameters": "(String viewName)",
"return": "void",
"signature": "void addViewToCurrentUserTeam(String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.removeViewFromUserTeam(String userName, String viewName)",
"constructor": false,
"full_signature": " void removeViewFromUserTeam(String userName, String viewName)",
"identifier": "removeViewFromUserTeam",
"modifiers": "",
"parameters": "(String userName, String viewName)",
"return": "void",
"signature": "void removeViewFromUserTeam(String userName, String viewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.renameViewInUserTeam(String userName, String oldViewName, String newViewName)",
"constructor": false,
"full_signature": " void renameViewInUserTeam(String userName, String oldViewName, String newViewName)",
"identifier": "renameViewInUserTeam",
"modifiers": "",
"parameters": "(String userName, String oldViewName, String newViewName)",
"return": "void",
"signature": "void renameViewInUserTeam(String userName, String oldViewName, String newViewName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.save()",
"constructor": false,
"full_signature": "@Override public synchronized void save()",
"identifier": "save",
"modifiers": "@Override public synchronized",
"parameters": "()",
"return": "void",
"signature": "void save()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getTeamQualifiedJobName(String jobName)",
"constructor": false,
"full_signature": "public String getTeamQualifiedJobName(String jobName)",
"identifier": "getTeamQualifiedJobName",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "String",
"signature": "String getTeamQualifiedJobName(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getRawTeamQualifiedJobName(String jobName)",
"constructor": false,
"full_signature": "public String getRawTeamQualifiedJobName(String jobName)",
"identifier": "getRawTeamQualifiedJobName",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "String",
"signature": "String getRawTeamQualifiedJobName(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getRawTeamQualifiedJobName(Team team, String jobName)",
"constructor": false,
"full_signature": "public String getRawTeamQualifiedJobName(Team team, String jobName)",
"identifier": "getRawTeamQualifiedJobName",
"modifiers": "public",
"parameters": "(Team team, String jobName)",
"return": "String",
"signature": "String getRawTeamQualifiedJobName(Team team, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.findCurrentUserTeamForNewJob()",
"constructor": false,
"full_signature": "public Team findCurrentUserTeamForNewJob()",
"identifier": "findCurrentUserTeamForNewJob",
"modifiers": "public",
"parameters": "()",
"return": "Team",
"signature": "Team findCurrentUserTeamForNewJob()",
"testcase": false
},
{
"class_method_signature": "TeamManager.findCurrentUserTeamForNewView()",
"constructor": false,
"full_signature": "public Team findCurrentUserTeamForNewView()",
"identifier": "findCurrentUserTeamForNewView",
"modifiers": "public",
"parameters": "()",
"return": "Team",
"signature": "Team findCurrentUserTeamForNewView()",
"testcase": false
},
{
"class_method_signature": "TeamManager.findCurrentUserTeamForNewNode()",
"constructor": false,
"full_signature": "public Team findCurrentUserTeamForNewNode()",
"identifier": "findCurrentUserTeamForNewNode",
"modifiers": "public",
"parameters": "()",
"return": "Team",
"signature": "Team findCurrentUserTeamForNewNode()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserPrimaryView()",
"constructor": false,
"full_signature": "public String getCurrentUserPrimaryView()",
"identifier": "getCurrentUserPrimaryView",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getCurrentUserPrimaryView()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getTeamQualifiedJobName(Team team, String jobName)",
"constructor": false,
"full_signature": "public String getTeamQualifiedJobName(Team team, String jobName)",
"identifier": "getTeamQualifiedJobName",
"modifiers": "public",
"parameters": "(Team team, String jobName)",
"return": "String",
"signature": "String getTeamQualifiedJobName(Team team, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.isQualifiedJobName(Team team, String jobName)",
"constructor": false,
"full_signature": "public boolean isQualifiedJobName(Team team, String jobName)",
"identifier": "isQualifiedJobName",
"modifiers": "public",
"parameters": "(Team team, String jobName)",
"return": "boolean",
"signature": "boolean isQualifiedJobName(Team team, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getUnqualifiedJobName(String jobName)",
"constructor": false,
"full_signature": "public String getUnqualifiedJobName(String jobName)",
"identifier": "getUnqualifiedJobName",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "String",
"signature": "String getUnqualifiedJobName(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getRootFolderForJob(String jobName)",
"constructor": false,
"full_signature": "public File getRootFolderForJob(String jobName)",
"identifier": "getRootFolderForJob",
"modifiers": "public",
"parameters": "(String jobName)",
"return": "File",
"signature": "File getRootFolderForJob(String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getJobsRootFolders()",
"constructor": false,
"full_signature": "public File[] getJobsRootFolders()",
"identifier": "getJobsRootFolders",
"modifiers": "public",
"parameters": "()",
"return": "File[]",
"signature": "File[] getJobsRootFolders()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserTeamsWithPermission(Permission permission)",
"constructor": false,
"full_signature": " List<Team> getCurrentUserTeamsWithPermission(Permission permission)",
"identifier": "getCurrentUserTeamsWithPermission",
"modifiers": "",
"parameters": "(Permission permission)",
"return": "List<Team>",
"signature": "List<Team> getCurrentUserTeamsWithPermission(Permission permission)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserVisibleTeams()",
"constructor": false,
"full_signature": "public List<String> getCurrentUserVisibleTeams()",
"identifier": "getCurrentUserVisibleTeams",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getCurrentUserVisibleTeams()",
"testcase": false
},
{
"class_method_signature": "TeamManager.isUserHasAccessToTeam(String user, String team)",
"constructor": false,
"full_signature": "public boolean isUserHasAccessToTeam(String user, String team)",
"identifier": "isUserHasAccessToTeam",
"modifiers": "public",
"parameters": "(String user, String team)",
"return": "boolean",
"signature": "boolean isUserHasAccessToTeam(String user, String team)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserAdminUsers()",
"constructor": false,
"full_signature": "public Collection<String> getCurrentUserAdminUsers()",
"identifier": "getCurrentUserAdminUsers",
"modifiers": "public",
"parameters": "()",
"return": "Collection<String>",
"signature": "Collection<String> getCurrentUserAdminUsers()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getUserTeamPermissions(String user, String teamName)",
"constructor": false,
"full_signature": "public String[] getUserTeamPermissions(String user, String teamName)",
"identifier": "getUserTeamPermissions",
"modifiers": "public",
"parameters": "(String user, String teamName)",
"return": "String[]",
"signature": "String[] getUserTeamPermissions(String user, String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getCurrentUserTeamPermissions(String teamName)",
"constructor": false,
"full_signature": "public String[] getCurrentUserTeamPermissions(String teamName)",
"identifier": "getCurrentUserTeamPermissions",
"modifiers": "public",
"parameters": "(String teamName)",
"return": "String[]",
"signature": "String[] getCurrentUserTeamPermissions(String teamName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.canNodeExecuteJob(String nodeName, String jobName)",
"constructor": false,
"full_signature": "public boolean canNodeExecuteJob(String nodeName, String jobName)",
"identifier": "canNodeExecuteJob",
"modifiers": "public",
"parameters": "(String nodeName, String jobName)",
"return": "boolean",
"signature": "boolean canNodeExecuteJob(String nodeName, String jobName)",
"testcase": false
},
{
"class_method_signature": "TeamManager.setUseBulkSaveFlag(boolean flag)",
"constructor": false,
"full_signature": " void setUseBulkSaveFlag(boolean flag)",
"identifier": "setUseBulkSaveFlag",
"modifiers": "",
"parameters": "(boolean flag)",
"return": "void",
"signature": "void setUseBulkSaveFlag(boolean flag)",
"testcase": false
},
{
"class_method_signature": "TeamManager.getPublicTeam()",
"constructor": false,
"full_signature": " Team getPublicTeam()",
"identifier": "getPublicTeam",
"modifiers": "",
"parameters": "()",
"return": "Team",
"signature": "Team getPublicTeam()",
"testcase": false
},
{
"class_method_signature": "TeamManager.getConfigFile()",
"constructor": false,
"full_signature": "private XmlFile getConfigFile()",
"identifier": "getConfigFile",
"modifiers": "private",
"parameters": "()",
"return": "XmlFile",
"signature": "XmlFile getConfigFile()",
"testcase": false
},
{
"class_method_signature": "TeamManager.load()",
"constructor": false,
"full_signature": "private void load()",
"identifier": "load",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void load()",
"testcase": false
},
{
"class_method_signature": "TeamManager.ensureCustomFolders()",
"constructor": false,
"full_signature": "private void ensureCustomFolders()",
"identifier": "ensureCustomFolders",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void ensureCustomFolders()",
"testcase": false
},
{
"class_method_signature": "TeamManager.ensurePublicTeam()",
"constructor": false,
"full_signature": "private void ensurePublicTeam()",
"identifier": "ensurePublicTeam",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void ensurePublicTeam()",
"testcase": false
},
{
"class_method_signature": "TeamManager.isPublicTeam(Team team)",
"constructor": false,
"full_signature": " boolean isPublicTeam(Team team)",
"identifier": "isPublicTeam",
"modifiers": "",
"parameters": "(Team team)",
"return": "boolean",
"signature": "boolean isPublicTeam(Team team)",
"testcase": false
},
{
"class_method_signature": "TeamManager.initializeXstream()",
"constructor": false,
"full_signature": "private void initializeXstream()",
"identifier": "initializeXstream",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void initializeXstream()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Team createTeam(String teamName) throws IOException, TeamAlreadyExistsException {\n return createTeam(teamName, teamName, null);\n }",
"class_method_signature": "TeamManager.createTeam(String teamName)",
"constructor": false,
"full_signature": "public Team createTeam(String teamName)",
"identifier": "createTeam",
"invocations": [
"createTeam"
],
"modifiers": "public",
"parameters": "(String teamName)",
"return": "Team",
"signature": "Team createTeam(String teamName)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 2389245,
"size": 20115,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/eclipse/hudson.core"
} |
15751803_27 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game",
"var_name": "game"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/GameTest.java",
"identifier": "GameTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void nonStartingPlayerShouldHaveStartingHandOfFourCardsFromHisDeck() {\n game = anyGame();\n\n assertThat(game.getOpponentPlayer().getNumberOfHandCards(), is(equalTo(4)));\n assertThat(game.getOpponentPlayer().getNumberOfDeckCards(), is(equalTo(16)));\n }",
"class_method_signature": "GameTest.nonStartingPlayerShouldHaveStartingHandOfFourCardsFromHisDeck()",
"constructor": false,
"full_signature": "@Test public void nonStartingPlayerShouldHaveStartingHandOfFourCardsFromHisDeck()",
"identifier": "nonStartingPlayerShouldHaveStartingHandOfFourCardsFromHisDeck",
"invocations": [
"anyGame",
"assertThat",
"getNumberOfHandCards",
"getOpponentPlayer",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCards",
"getOpponentPlayer",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void nonStartingPlayerShouldHaveStartingHandOfFourCardsFromHisDeck()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "activePlayer",
"modifier": "private",
"original_string": "private Player activePlayer;",
"type": "Player",
"var_name": "activePlayer"
},
{
"declarator": "opponentPlayer",
"modifier": "private",
"original_string": "private Player opponentPlayer;",
"type": "Player",
"var_name": "opponentPlayer"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Game.java",
"identifier": "Game",
"interfaces": "",
"methods": [
{
"class_method_signature": "Game.Game(Player player1, Player player2)",
"constructor": true,
"full_signature": "public Game(Player player1, Player player2)",
"identifier": "Game",
"modifiers": "public",
"parameters": "(Player player1, Player player2)",
"return": "",
"signature": " Game(Player player1, Player player2)",
"testcase": false
},
{
"class_method_signature": "Game.Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"constructor": true,
"full_signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"identifier": "Game",
"modifiers": "",
"parameters": "(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"return": "",
"signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"testcase": false
},
{
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
},
{
"class_method_signature": "Game.switchPlayer()",
"constructor": false,
"full_signature": " void switchPlayer()",
"identifier": "switchPlayer",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void switchPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.endTurn()",
"constructor": false,
"full_signature": "public void endTurn()",
"identifier": "endTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void endTurn()",
"testcase": false
},
{
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
},
{
"class_method_signature": "Game.run()",
"constructor": false,
"full_signature": "public void run()",
"identifier": "run",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
},
{
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.main(String... args)",
"constructor": false,
"full_signature": "public static void main(String... args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String... args)",
"return": "void",
"signature": "void main(String... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Player getOpponentPlayer() {\n return opponentPlayer;\n }",
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_31 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game",
"var_name": "game"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/GameTest.java",
"identifier": "GameTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void opponentLoosesWhenHealthIsZero() {\n Player player1 = aPlayer().withMana(10).withCardsInHand(4, 6).build();\n Player player2 = aPlayer().withHealth(10).build();\n game = aGame().withActivePlayer(player1).withOpponentPlayer(player2).build();\n\n player1.playCard(aCardWithValue(6), player2, DAMAGE);\n player1.playCard(aCardWithValue(4), player2, DAMAGE);\n\n assertThat(game.getWinner(), is(player1));\n }",
"class_method_signature": "GameTest.opponentLoosesWhenHealthIsZero()",
"constructor": false,
"full_signature": "@Test public void opponentLoosesWhenHealthIsZero()",
"identifier": "opponentLoosesWhenHealthIsZero",
"invocations": [
"build",
"withCardsInHand",
"withMana",
"aPlayer",
"build",
"withHealth",
"aPlayer",
"build",
"withOpponentPlayer",
"withActivePlayer",
"aGame",
"playCard",
"aCardWithValue",
"playCard",
"aCardWithValue",
"assertThat",
"getWinner",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void opponentLoosesWhenHealthIsZero()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "activePlayer",
"modifier": "private",
"original_string": "private Player activePlayer;",
"type": "Player",
"var_name": "activePlayer"
},
{
"declarator": "opponentPlayer",
"modifier": "private",
"original_string": "private Player opponentPlayer;",
"type": "Player",
"var_name": "opponentPlayer"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Game.java",
"identifier": "Game",
"interfaces": "",
"methods": [
{
"class_method_signature": "Game.Game(Player player1, Player player2)",
"constructor": true,
"full_signature": "public Game(Player player1, Player player2)",
"identifier": "Game",
"modifiers": "public",
"parameters": "(Player player1, Player player2)",
"return": "",
"signature": " Game(Player player1, Player player2)",
"testcase": false
},
{
"class_method_signature": "Game.Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"constructor": true,
"full_signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"identifier": "Game",
"modifiers": "",
"parameters": "(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"return": "",
"signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"testcase": false
},
{
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
},
{
"class_method_signature": "Game.switchPlayer()",
"constructor": false,
"full_signature": " void switchPlayer()",
"identifier": "switchPlayer",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void switchPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.endTurn()",
"constructor": false,
"full_signature": "public void endTurn()",
"identifier": "endTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void endTurn()",
"testcase": false
},
{
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
},
{
"class_method_signature": "Game.run()",
"constructor": false,
"full_signature": "public void run()",
"identifier": "run",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
},
{
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.main(String... args)",
"constructor": false,
"full_signature": "public static void main(String... args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String... args)",
"return": "void",
"signature": "void main(String... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Player getWinner() {\n if (activePlayer.getHealth() < 1) {\n return opponentPlayer;\n } else if (opponentPlayer.getHealth() < 1) {\n return activePlayer;\n } else {\n return null;\n }\n }",
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"invocations": [
"getHealth",
"getHealth"
],
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_11 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/CautiousStrategyTest.java",
"identifier": "CautiousStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNoCardIfInsufficientManaForAnyHandCard() {\n assertThat(strategy.nextMove(withMana(1), andHealth(30), fromCards(2, 3, 8)), is(noMove()));\n }",
"class_method_signature": "CautiousStrategyTest.shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"constructor": false,
"full_signature": "@Test public void shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"identifier": "shouldReturnNoCardIfInsufficientManaForAnyHandCard",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"noMove"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/CautiousStrategy.java",
"identifier": "CautiousStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 20) {\n return new Move(lowestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(highestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"lowestCard",
"highestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_3 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "consoleInput = emptyStandardInputStream()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TextFromStandardInputStream consoleInput = emptyStandardInputStream();",
"type": "TextFromStandardInputStream",
"var_name": "consoleInput"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategyTest.java",
"identifier": "ConsoleInputStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldPlayCardsSelectedOnSystemConsole() {\n player().enters(\"2\").finished();\n\n assertThat(strategy.nextMove(withMana(10), andHealth(30), fromCards(0, 2, 3)), isAttackingWithCard(2));\n }",
"class_method_signature": "ConsoleInputStrategyTest.shouldPlayCardsSelectedOnSystemConsole()",
"constructor": false,
"full_signature": "@Test public void shouldPlayCardsSelectedOnSystemConsole()",
"identifier": "shouldPlayCardsSelectedOnSystemConsole",
"invocations": [
"finished",
"enters",
"player",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldPlayCardsSelectedOnSystemConsole()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(ConsoleInputStrategy.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(ConsoleInputStrategy.class.getName());",
"type": "Logger",
"var_name": "logger"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategy.java",
"identifier": "ConsoleInputStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in, Charset.defaultCharset()));\n Integer card = -1;\n Action action = Action.DAMAGE;\n while (card < 0 || card > 8 || card > availableMana || !availableCards.contains(new Card(card))) {\n try {\n String input = br.readLine();\n if (input.endsWith(\"h\")) {\n action = Action.HEALING;\n input = input.replace(\"h\", \"\");\n }\n card = Integer.decode(input);\n } catch (NumberFormatException e) {\n logger.warning(\"Invalid input: \" + e.getMessage());\n }\n }\n return new Move(Optional.of(new Card(card)), action);\n } catch (IOException e) {\n logger.severe(\"Could not read console input: \" + e.getMessage());\n e.printStackTrace();\n }\n return new Move(Optional.empty(), null);\n }",
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"defaultCharset",
"contains",
"readLine",
"endsWith",
"replace",
"decode",
"warning",
"getMessage",
"of",
"severe",
"getMessage",
"printStackTrace",
"empty"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_10 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/CautiousStrategyTest.java",
"identifier": "CautiousStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldPlayHighCostCardsFirstWhenHealing() {\n assertThat(strategy.nextMove(withMana(10), andHealth(1), fromCards(1, 2, 3, 8, 9)), is(move(card(1), HEALING)));\n assertThat(strategy.nextMove(withMana(9), andHealth(2), fromCards(2, 3, 8, 9)), is(move(card(2), HEALING)));\n assertThat(strategy.nextMove(withMana(7), andHealth(4), fromCards(3, 8, 9)), is(move(card(3), HEALING)));\n }",
"class_method_signature": "CautiousStrategyTest.shouldPlayHighCostCardsFirstWhenHealing()",
"constructor": false,
"full_signature": "@Test public void shouldPlayHighCostCardsFirstWhenHealing()",
"identifier": "shouldPlayHighCostCardsFirstWhenHealing",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"move",
"card",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"move",
"card",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"move",
"card"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldPlayHighCostCardsFirstWhenHealing()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/CautiousStrategy.java",
"identifier": "CautiousStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 20) {\n return new Move(lowestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(highestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"lowestCard",
"highestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_2 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/KamikazeStrategyTest.java",
"identifier": "KamikazeStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNoCardIfInsufficientManaForAnyHandCard() {\n assertThat(strategy.nextMove(withMana(1), andHealth(30), fromCards(2, 3, 8)), is(noMove()));\n }",
"class_method_signature": "KamikazeStrategyTest.shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"constructor": false,
"full_signature": "@Test public void shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"identifier": "shouldReturnNoCardIfInsufficientManaForAnyHandCard",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"noMove"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/KamikazeStrategy.java",
"identifier": "KamikazeStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "KamikazeStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n return new Move(highestCard(availableMana, availableCards), Action.DAMAGE);\n }",
"class_method_signature": "KamikazeStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_30 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game",
"var_name": "game"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/GameTest.java",
"identifier": "GameTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void activePlayerShouldDrawCardOnBeginningOfTurn() {\n Player player1 = anyPlayer();\n game = aGame().withActivePlayer(player1).build();\n int numberOfInitialHandCards = player1.getNumberOfHandCards();\n\n game.beginTurn();\n\n assertThat(player1.getNumberOfHandCards(), is(equalTo(numberOfInitialHandCards + 1)));\n }",
"class_method_signature": "GameTest.activePlayerShouldDrawCardOnBeginningOfTurn()",
"constructor": false,
"full_signature": "@Test public void activePlayerShouldDrawCardOnBeginningOfTurn()",
"identifier": "activePlayerShouldDrawCardOnBeginningOfTurn",
"invocations": [
"anyPlayer",
"build",
"withActivePlayer",
"aGame",
"getNumberOfHandCards",
"beginTurn",
"assertThat",
"getNumberOfHandCards",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void activePlayerShouldDrawCardOnBeginningOfTurn()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "activePlayer",
"modifier": "private",
"original_string": "private Player activePlayer;",
"type": "Player",
"var_name": "activePlayer"
},
{
"declarator": "opponentPlayer",
"modifier": "private",
"original_string": "private Player opponentPlayer;",
"type": "Player",
"var_name": "opponentPlayer"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Game.java",
"identifier": "Game",
"interfaces": "",
"methods": [
{
"class_method_signature": "Game.Game(Player player1, Player player2)",
"constructor": true,
"full_signature": "public Game(Player player1, Player player2)",
"identifier": "Game",
"modifiers": "public",
"parameters": "(Player player1, Player player2)",
"return": "",
"signature": " Game(Player player1, Player player2)",
"testcase": false
},
{
"class_method_signature": "Game.Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"constructor": true,
"full_signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"identifier": "Game",
"modifiers": "",
"parameters": "(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"return": "",
"signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"testcase": false
},
{
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
},
{
"class_method_signature": "Game.switchPlayer()",
"constructor": false,
"full_signature": " void switchPlayer()",
"identifier": "switchPlayer",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void switchPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.endTurn()",
"constructor": false,
"full_signature": "public void endTurn()",
"identifier": "endTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void endTurn()",
"testcase": false
},
{
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
},
{
"class_method_signature": "Game.run()",
"constructor": false,
"full_signature": "public void run()",
"identifier": "run",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
},
{
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.main(String... args)",
"constructor": false,
"full_signature": "public static void main(String... args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String... args)",
"return": "void",
"signature": "void main(String... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void beginTurn() {\n activePlayer.giveManaSlot();\n activePlayer.refillMana();\n activePlayer.drawCard();\n logger.info(activePlayer + \" plays turn...\");\n }",
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"invocations": [
"giveManaSlot",
"refillMana",
"drawCard",
"info"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_26 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game",
"var_name": "game"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/GameTest.java",
"identifier": "GameTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void startingPlayerShouldHaveStartingHandOfThreeCardsFromHisDeck() {\n game = anyGame();\n\n assertThat(game.getActivePlayer().getNumberOfHandCards(), is(equalTo(3)));\n assertThat(game.getActivePlayer().getNumberOfDeckCards(), is(equalTo(17)));\n }",
"class_method_signature": "GameTest.startingPlayerShouldHaveStartingHandOfThreeCardsFromHisDeck()",
"constructor": false,
"full_signature": "@Test public void startingPlayerShouldHaveStartingHandOfThreeCardsFromHisDeck()",
"identifier": "startingPlayerShouldHaveStartingHandOfThreeCardsFromHisDeck",
"invocations": [
"anyGame",
"assertThat",
"getNumberOfHandCards",
"getActivePlayer",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCards",
"getActivePlayer",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void startingPlayerShouldHaveStartingHandOfThreeCardsFromHisDeck()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "activePlayer",
"modifier": "private",
"original_string": "private Player activePlayer;",
"type": "Player",
"var_name": "activePlayer"
},
{
"declarator": "opponentPlayer",
"modifier": "private",
"original_string": "private Player opponentPlayer;",
"type": "Player",
"var_name": "opponentPlayer"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Game.java",
"identifier": "Game",
"interfaces": "",
"methods": [
{
"class_method_signature": "Game.Game(Player player1, Player player2)",
"constructor": true,
"full_signature": "public Game(Player player1, Player player2)",
"identifier": "Game",
"modifiers": "public",
"parameters": "(Player player1, Player player2)",
"return": "",
"signature": " Game(Player player1, Player player2)",
"testcase": false
},
{
"class_method_signature": "Game.Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"constructor": true,
"full_signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"identifier": "Game",
"modifiers": "",
"parameters": "(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"return": "",
"signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"testcase": false
},
{
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
},
{
"class_method_signature": "Game.switchPlayer()",
"constructor": false,
"full_signature": " void switchPlayer()",
"identifier": "switchPlayer",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void switchPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.endTurn()",
"constructor": false,
"full_signature": "public void endTurn()",
"identifier": "endTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void endTurn()",
"testcase": false
},
{
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
},
{
"class_method_signature": "Game.run()",
"constructor": false,
"full_signature": "public void run()",
"identifier": "run",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
},
{
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.main(String... args)",
"constructor": false,
"full_signature": "public static void main(String... args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String... args)",
"return": "void",
"signature": "void main(String... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Player getActivePlayer() {\n return activePlayer;\n }",
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_17 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void playerShouldHave30InitialHealth() {\n assertThat(player.getHealth(), is(equalTo(30)));\n }",
"class_method_signature": "PlayerTest.playerShouldHave30InitialHealth()",
"constructor": false,
"full_signature": "@Test public void playerShouldHave30InitialHealth()",
"identifier": "playerShouldHave30InitialHealth",
"invocations": [
"assertThat",
"getHealth",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void playerShouldHave30InitialHealth()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public int getHealth() {\n return health;\n }",
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_5 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "consoleInput = emptyStandardInputStream()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TextFromStandardInputStream consoleInput = emptyStandardInputStream();",
"type": "TextFromStandardInputStream",
"var_name": "consoleInput"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategyTest.java",
"identifier": "ConsoleInputStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void willRejectCardsNotPresentInHandUntilHandCardIsChosen() {\n player().enters(\"1\").enters(\"2\").enters(\"3\").finished();\n\n assertThat(strategy.nextMove(withMana(5), andHealth(30), fromCards(3, 4, 5)), isAttackingWithCard(3));\n }",
"class_method_signature": "ConsoleInputStrategyTest.willRejectCardsNotPresentInHandUntilHandCardIsChosen()",
"constructor": false,
"full_signature": "@Test public void willRejectCardsNotPresentInHandUntilHandCardIsChosen()",
"identifier": "willRejectCardsNotPresentInHandUntilHandCardIsChosen",
"invocations": [
"finished",
"enters",
"enters",
"enters",
"player",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void willRejectCardsNotPresentInHandUntilHandCardIsChosen()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(ConsoleInputStrategy.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(ConsoleInputStrategy.class.getName());",
"type": "Logger",
"var_name": "logger"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategy.java",
"identifier": "ConsoleInputStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in, Charset.defaultCharset()));\n Integer card = -1;\n Action action = Action.DAMAGE;\n while (card < 0 || card > 8 || card > availableMana || !availableCards.contains(new Card(card))) {\n try {\n String input = br.readLine();\n if (input.endsWith(\"h\")) {\n action = Action.HEALING;\n input = input.replace(\"h\", \"\");\n }\n card = Integer.decode(input);\n } catch (NumberFormatException e) {\n logger.warning(\"Invalid input: \" + e.getMessage());\n }\n }\n return new Move(Optional.of(new Card(card)), action);\n } catch (IOException e) {\n logger.severe(\"Could not read console input: \" + e.getMessage());\n e.printStackTrace();\n }\n return new Move(Optional.empty(), null);\n }",
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"defaultCharset",
"contains",
"readLine",
"endsWith",
"replace",
"decode",
"warning",
"getMessage",
"of",
"severe",
"getMessage",
"printStackTrace",
"empty"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_9 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/CautiousStrategyTest.java",
"identifier": "CautiousStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldPlayHighCostCardsFirstWhenAttacking() {\n assertThat(strategy.nextMove(withMana(10), andHealth(30), fromCards(0, 2, 3, 8, 9)), is(move(card(9), DAMAGE)));\n assertThat(strategy.nextMove(withMana(1), andHealth(30), fromCards(0, 2, 3, 8)), is(move(card(0), DAMAGE)));\n }",
"class_method_signature": "CautiousStrategyTest.shouldPlayHighCostCardsFirstWhenAttacking()",
"constructor": false,
"full_signature": "@Test public void shouldPlayHighCostCardsFirstWhenAttacking()",
"identifier": "shouldPlayHighCostCardsFirstWhenAttacking",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"move",
"card",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"move",
"card"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldPlayHighCostCardsFirstWhenAttacking()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/CautiousStrategy.java",
"identifier": "CautiousStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 20) {\n return new Move(lowestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(highestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"lowestCard",
"highestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_21 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalMoveException.class)\n public void playingCardWithInsufficientManaShouldFail() {\n player = aPlayer().withMana(3).withCardsInHand(4, 4, 4).build();\n\n player.playCard(aCardWithValue(4), anyPlayer(), DAMAGE);\n }",
"class_method_signature": "PlayerTest.playingCardWithInsufficientManaShouldFail()",
"constructor": false,
"full_signature": "@Test(expected = IllegalMoveException.class) public void playingCardWithInsufficientManaShouldFail()",
"identifier": "playingCardWithInsufficientManaShouldFail",
"invocations": [
"build",
"withCardsInHand",
"withMana",
"aPlayer",
"playCard",
"aCardWithValue",
"anyPlayer"
],
"modifiers": "@Test(expected = IllegalMoveException.class) public",
"parameters": "()",
"return": "void",
"signature": "void playingCardWithInsufficientManaShouldFail()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void playCard(Player opponent) {\n Move move = strategy.nextMove(mana, health, hand);\n Optional<Card> card = move.getCard();\n if (card.isPresent()) {\n playCard(card.get(), opponent, move.getAction());\n } else {\n throw new IllegalMoveException(\"No card can be played from hand \" + hand + \" with (\" + mana + \") mana.\");\n }\n }",
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"invocations": [
"nextMove",
"getCard",
"isPresent",
"playCard",
"get",
"getAction"
],
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_20 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void playerStartsWithEmptyHand() {\n assertThat(player.getNumberOfHandCards(), is(equalTo(0)));\n }",
"class_method_signature": "PlayerTest.playerStartsWithEmptyHand()",
"constructor": false,
"full_signature": "@Test public void playerStartsWithEmptyHand()",
"identifier": "playerStartsWithEmptyHand",
"invocations": [
"assertThat",
"getNumberOfHandCards",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void playerStartsWithEmptyHand()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public int getNumberOfHandCards() {\n return hand.size();\n }",
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"invocations": [
"size"
],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_8 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/CautiousStrategyTest.java",
"identifier": "CautiousStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldUseHealingUntilHealthIsAbove20() {\n assertThat(strategy.nextMove(withMana(10), andHealth(17), fromCards(2, 3, 4)), isHealingWithCard(2));\n assertThat(strategy.nextMove(withMana(7), andHealth(19), fromCards(3, 4)), isHealingWithCard(3));\n assertThat(strategy.nextMove(withMana(4), andHealth(22), fromCards(4)), isAttackingWithCard(4));\n }",
"class_method_signature": "CautiousStrategyTest.shouldUseHealingUntilHealthIsAbove20()",
"constructor": false,
"full_signature": "@Test public void shouldUseHealingUntilHealthIsAbove20()",
"identifier": "shouldUseHealingUntilHealthIsAbove20",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isHealingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isHealingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldUseHealingUntilHealthIsAbove20()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/CautiousStrategy.java",
"identifier": "CautiousStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 20) {\n return new Move(lowestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(highestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"lowestCard",
"highestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_16 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/AiStrategyTest.java",
"identifier": "AiStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNoCardIfInsufficientManaForAnyHandCard() {\n assertThat(strategy.nextMove(withMana(1), andHealth(30), fromCards(2, 3, 8)), is(noMove()));\n }",
"class_method_signature": "AiStrategyTest.shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"constructor": false,
"full_signature": "@Test public void shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"identifier": "shouldReturnNoCardIfInsufficientManaForAnyHandCard",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"is",
"noMove"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldReturnNoCardIfInsufficientManaForAnyHandCard()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/AiStrategy.java",
"identifier": "AiStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.bestCard(int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"identifier": "bestCard",
"modifiers": "private",
"parameters": "(int availableMana, List<Card> availableCards)",
"return": "Optional<Card>",
"signature": "Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"identifier": "collectMaxDamageCardCombo",
"modifiers": "private",
"parameters": "(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"return": "void",
"signature": "void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 10) {\n return new Move(highestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(bestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard",
"bestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_4 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "consoleInput = emptyStandardInputStream()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TextFromStandardInputStream consoleInput = emptyStandardInputStream();",
"type": "TextFromStandardInputStream",
"var_name": "consoleInput"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategyTest.java",
"identifier": "ConsoleInputStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void willRejectTooExpensiveCardsUntilAffordableCardIsChosen() {\n player().enters(\"8\").enters(\"7\").enters(\"6\").finished();\n\n assertThat(strategy.nextMove(withMana(6), andHealth(30), fromCards(6, 7, 8)), isAttackingWithCard(6));\n }",
"class_method_signature": "ConsoleInputStrategyTest.willRejectTooExpensiveCardsUntilAffordableCardIsChosen()",
"constructor": false,
"full_signature": "@Test public void willRejectTooExpensiveCardsUntilAffordableCardIsChosen()",
"identifier": "willRejectTooExpensiveCardsUntilAffordableCardIsChosen",
"invocations": [
"finished",
"enters",
"enters",
"enters",
"player",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void willRejectTooExpensiveCardsUntilAffordableCardIsChosen()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(ConsoleInputStrategy.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(ConsoleInputStrategy.class.getName());",
"type": "Logger",
"var_name": "logger"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategy.java",
"identifier": "ConsoleInputStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in, Charset.defaultCharset()));\n Integer card = -1;\n Action action = Action.DAMAGE;\n while (card < 0 || card > 8 || card > availableMana || !availableCards.contains(new Card(card))) {\n try {\n String input = br.readLine();\n if (input.endsWith(\"h\")) {\n action = Action.HEALING;\n input = input.replace(\"h\", \"\");\n }\n card = Integer.decode(input);\n } catch (NumberFormatException e) {\n logger.warning(\"Invalid input: \" + e.getMessage());\n }\n }\n return new Move(Optional.of(new Card(card)), action);\n } catch (IOException e) {\n logger.severe(\"Could not read console input: \" + e.getMessage());\n e.printStackTrace();\n }\n return new Move(Optional.empty(), null);\n }",
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"defaultCharset",
"contains",
"readLine",
"endsWith",
"replace",
"decode",
"warning",
"getMessage",
"of",
"severe",
"getMessage",
"printStackTrace",
"empty"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_7 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "consoleInput = emptyStandardInputStream()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TextFromStandardInputStream consoleInput = emptyStandardInputStream();",
"type": "TextFromStandardInputStream",
"var_name": "consoleInput"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategyTest.java",
"identifier": "ConsoleInputStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void invalidInputWillBeRejectedUntilValidChoiceIsMade() {\n player().enters(\"xxx\").enters(\"§$%\").enters(\"2\").finished();\n\n assertThat(strategy.nextMove(withMana(10), andHealth(30), fromCards(2)), isAttackingWithCard(2));\n }",
"class_method_signature": "ConsoleInputStrategyTest.invalidInputWillBeRejectedUntilValidChoiceIsMade()",
"constructor": false,
"full_signature": "@Test public void invalidInputWillBeRejectedUntilValidChoiceIsMade()",
"identifier": "invalidInputWillBeRejectedUntilValidChoiceIsMade",
"invocations": [
"inished(",
"nters(",
"enters",
"enters",
"player",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void invalidInputWillBeRejectedUntilValidChoiceIsMade()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(ConsoleInputStrategy.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(ConsoleInputStrategy.class.getName());",
"type": "Logger",
"var_name": "logger"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategy.java",
"identifier": "ConsoleInputStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in, Charset.defaultCharset()));\n Integer card = -1;\n Action action = Action.DAMAGE;\n while (card < 0 || card > 8 || card > availableMana || !availableCards.contains(new Card(card))) {\n try {\n String input = br.readLine();\n if (input.endsWith(\"h\")) {\n action = Action.HEALING;\n input = input.replace(\"h\", \"\");\n }\n card = Integer.decode(input);\n } catch (NumberFormatException e) {\n logger.warning(\"Invalid input: \" + e.getMessage());\n }\n }\n return new Move(Optional.of(new Card(card)), action);\n } catch (IOException e) {\n logger.severe(\"Could not read console input: \" + e.getMessage());\n e.printStackTrace();\n }\n return new Move(Optional.empty(), null);\n }",
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"defaultCharset",
"contains",
"readLine",
"endsWith",
"replace",
"decode",
"warning",
"getMessage",
"of",
"severe",
"getMessage",
"printStackTrace",
"empty"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_15 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/AiStrategyTest.java",
"identifier": "AiStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldUseHealingUntilHealthIsAtLeast10() {\n assertThat(strategy.nextMove(withMana(3), andHealth(8), fromCards(1, 1, 1)), isHealingWithCard(1));\n assertThat(strategy.nextMove(withMana(2), andHealth(9), fromCards(1, 1)), isHealingWithCard(1));\n assertThat(strategy.nextMove(withMana(1), andHealth(10), fromCards(1)), isAttackingWithCard(1));\n }",
"class_method_signature": "AiStrategyTest.shouldUseHealingUntilHealthIsAtLeast10()",
"constructor": false,
"full_signature": "@Test public void shouldUseHealingUntilHealthIsAtLeast10()",
"identifier": "shouldUseHealingUntilHealthIsAtLeast10",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isHealingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isHealingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldUseHealingUntilHealthIsAtLeast10()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/AiStrategy.java",
"identifier": "AiStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.bestCard(int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"identifier": "bestCard",
"modifiers": "private",
"parameters": "(int availableMana, List<Card> availableCards)",
"return": "Optional<Card>",
"signature": "Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"identifier": "collectMaxDamageCardCombo",
"modifiers": "private",
"parameters": "(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"return": "void",
"signature": "void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 10) {\n return new Move(highestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(bestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard",
"bestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_23 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void playerWithInsufficientManaCannotPlayCards() {\n player = aPlayer().withMana(1).withCardsInHand(3, 2).build();\n\n assertThat(player.canPlayCards(), is(false));\n }",
"class_method_signature": "PlayerTest.playerWithInsufficientManaCannotPlayCards()",
"constructor": false,
"full_signature": "@Test public void playerWithInsufficientManaCannotPlayCards()",
"identifier": "playerWithInsufficientManaCannotPlayCards",
"invocations": [
"build",
"withCardsInHand",
"withMana",
"aPlayer",
"assertThat",
"canPlayCards",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void playerWithInsufficientManaCannotPlayCards()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean canPlayCards() {\n return hand.stream().filter(card -> card.getValue() <= mana).count() > 0;\n }",
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"invocations": [
"count",
"filter",
"stream",
"getValue"
],
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_19 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void cardDeckShouldContainInitialCards() {\n assertThat(player.getNumberOfDeckCardsWithManaCost(0), is(equalTo(2)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(1), is(equalTo(2)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(2), is(equalTo(3)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(3), is(equalTo(4)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(4), is(equalTo(3)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(5), is(equalTo(2)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(6), is(equalTo(2)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(7), is(equalTo(1)));\n assertThat(player.getNumberOfDeckCardsWithManaCost(8), is(equalTo(1)));\n }",
"class_method_signature": "PlayerTest.cardDeckShouldContainInitialCards()",
"constructor": false,
"full_signature": "@Test public void cardDeckShouldContainInitialCards()",
"identifier": "cardDeckShouldContainInitialCards",
"invocations": [
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo",
"assertThat",
"getNumberOfDeckCardsWithManaCost",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void cardDeckShouldContainInitialCards()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public int getNumberOfDeckCardsWithManaCost(int manaCost) {\n return (int) deck.stream().filter(card -> card.getValue() == manaCost).count();\n }",
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"invocations": [
"count",
"filter",
"stream",
"getValue"
],
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_18 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void playerShouldHaveZeroInitialMana() {\n assertThat(player.getMana(), is(equalTo(0)));\n }",
"class_method_signature": "PlayerTest.playerShouldHaveZeroInitialMana()",
"constructor": false,
"full_signature": "@Test public void playerShouldHaveZeroInitialMana()",
"identifier": "playerShouldHaveZeroInitialMana",
"invocations": [
"assertThat",
"getMana",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void playerShouldHaveZeroInitialMana()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public int getMana() {\n return mana;\n }",
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_22 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void playerWithSufficientManaCanPlayCards() {\n player = aPlayer().withMana(2).withCardsInHand(3, 2).build();\n\n assertThat(player.canPlayCards(), is(true));\n }",
"class_method_signature": "PlayerTest.playerWithSufficientManaCanPlayCards()",
"constructor": false,
"full_signature": "@Test public void playerWithSufficientManaCanPlayCards()",
"identifier": "playerWithSufficientManaCanPlayCards",
"invocations": [
"build",
"withCardsInHand",
"withMana",
"aPlayer",
"assertThat",
"canPlayCards",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void playerWithSufficientManaCanPlayCards()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean canPlayCards() {\n return hand.stream().filter(card -> card.getValue() <= mana).count() > 0;\n }",
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"invocations": [
"count",
"filter",
"stream",
"getValue"
],
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_6 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "consoleInput = emptyStandardInputStream()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TextFromStandardInputStream consoleInput = emptyStandardInputStream();",
"type": "TextFromStandardInputStream",
"var_name": "consoleInput"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategyTest.java",
"identifier": "ConsoleInputStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void willUseChosenCardForHealingWhenInputIsSuffixedWithLetterH() {\n player().enters(\"5h\").finished();\n\n assertThat(strategy.nextMove(withMana(10), andHealth(30), fromCards(5)), isHealingWithCard(5));\n }",
"class_method_signature": "ConsoleInputStrategyTest.willUseChosenCardForHealingWhenInputIsSuffixedWithLetterH()",
"constructor": false,
"full_signature": "@Test public void willUseChosenCardForHealingWhenInputIsSuffixedWithLetterH()",
"identifier": "willUseChosenCardForHealingWhenInputIsSuffixedWithLetterH",
"invocations": [
"finished",
"enters",
"player",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isHealingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void willUseChosenCardForHealingWhenInputIsSuffixedWithLetterH()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(ConsoleInputStrategy.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(ConsoleInputStrategy.class.getName());",
"type": "Logger",
"var_name": "logger"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/ConsoleInputStrategy.java",
"identifier": "ConsoleInputStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in, Charset.defaultCharset()));\n Integer card = -1;\n Action action = Action.DAMAGE;\n while (card < 0 || card > 8 || card > availableMana || !availableCards.contains(new Card(card))) {\n try {\n String input = br.readLine();\n if (input.endsWith(\"h\")) {\n action = Action.HEALING;\n input = input.replace(\"h\", \"\");\n }\n card = Integer.decode(input);\n } catch (NumberFormatException e) {\n logger.warning(\"Invalid input: \" + e.getMessage());\n }\n }\n return new Move(Optional.of(new Card(card)), action);\n } catch (IOException e) {\n logger.severe(\"Could not read console input: \" + e.getMessage());\n e.printStackTrace();\n }\n return new Move(Optional.empty(), null);\n }",
"class_method_signature": "ConsoleInputStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"defaultCharset",
"contains",
"readLine",
"endsWith",
"replace",
"decode",
"warning",
"getMessage",
"of",
"severe",
"getMessage",
"printStackTrace",
"empty"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_14 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/AiStrategyTest.java",
"identifier": "AiStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldPickHighestAffordableCardWhenNoComboIsPossible() {\n assertThat(strategy.nextMove(withMana(2), andHealth(30), fromCards(1, 2, 3)), isAttackingWithCard(2));\n }",
"class_method_signature": "AiStrategyTest.shouldPickHighestAffordableCardWhenNoComboIsPossible()",
"constructor": false,
"full_signature": "@Test public void shouldPickHighestAffordableCardWhenNoComboIsPossible()",
"identifier": "shouldPickHighestAffordableCardWhenNoComboIsPossible",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldPickHighestAffordableCardWhenNoComboIsPossible()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/AiStrategy.java",
"identifier": "AiStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.bestCard(int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"identifier": "bestCard",
"modifiers": "private",
"parameters": "(int availableMana, List<Card> availableCards)",
"return": "Optional<Card>",
"signature": "Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"identifier": "collectMaxDamageCardCombo",
"modifiers": "private",
"parameters": "(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"return": "void",
"signature": "void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 10) {\n return new Move(highestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(bestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard",
"bestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_25 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalMoveException.class)\n public void playingCardShouldFailWhenStrategyCannotChooseCard() {\n given(strategy.nextMove(anyInt(), anyInt(), anyListOf(Card.class))).willReturn(noMove());\n player.playCard(anyPlayer());\n }",
"class_method_signature": "PlayerTest.playingCardShouldFailWhenStrategyCannotChooseCard()",
"constructor": false,
"full_signature": "@Test(expected = IllegalMoveException.class) public void playingCardShouldFailWhenStrategyCannotChooseCard()",
"identifier": "playingCardShouldFailWhenStrategyCannotChooseCard",
"invocations": [
"willReturn",
"given",
"nextMove",
"anyInt",
"anyInt",
"anyListOf",
"noMove",
"playCard",
"anyPlayer"
],
"modifiers": "@Test(expected = IllegalMoveException.class) public",
"parameters": "()",
"return": "void",
"signature": "void playingCardShouldFailWhenStrategyCannotChooseCard()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void playCard(Player opponent) {\n Move move = strategy.nextMove(mana, health, hand);\n Optional<Card> card = move.getCard();\n if (card.isPresent()) {\n playCard(card.get(), opponent, move.getAction());\n } else {\n throw new IllegalMoveException(\"No card can be played from hand \" + hand + \" with (\" + mana + \") mana.\");\n }\n }",
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"invocations": [
"nextMove",
"getCard",
"isPresent",
"playCard",
"get",
"getAction"
],
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_29 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game",
"var_name": "game"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/GameTest.java",
"identifier": "GameTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void activePlayerShouldRefillManaOnBeginningOfTurn() {\n Player player1 = aPlayer().withManaSlots(3).withMana(0).build();\n game = aGame().withActivePlayer(player1).build();\n\n game.beginTurn();\n\n assertThat(player1.getMana(), is(equalTo(player1.getManaSlots())));\n }",
"class_method_signature": "GameTest.activePlayerShouldRefillManaOnBeginningOfTurn()",
"constructor": false,
"full_signature": "@Test public void activePlayerShouldRefillManaOnBeginningOfTurn()",
"identifier": "activePlayerShouldRefillManaOnBeginningOfTurn",
"invocations": [
"build",
"withMana",
"withManaSlots",
"aPlayer",
"build",
"withActivePlayer",
"aGame",
"beginTurn",
"assertThat",
"getMana",
"is",
"equalTo",
"getManaSlots"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void activePlayerShouldRefillManaOnBeginningOfTurn()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "activePlayer",
"modifier": "private",
"original_string": "private Player activePlayer;",
"type": "Player",
"var_name": "activePlayer"
},
{
"declarator": "opponentPlayer",
"modifier": "private",
"original_string": "private Player opponentPlayer;",
"type": "Player",
"var_name": "opponentPlayer"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Game.java",
"identifier": "Game",
"interfaces": "",
"methods": [
{
"class_method_signature": "Game.Game(Player player1, Player player2)",
"constructor": true,
"full_signature": "public Game(Player player1, Player player2)",
"identifier": "Game",
"modifiers": "public",
"parameters": "(Player player1, Player player2)",
"return": "",
"signature": " Game(Player player1, Player player2)",
"testcase": false
},
{
"class_method_signature": "Game.Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"constructor": true,
"full_signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"identifier": "Game",
"modifiers": "",
"parameters": "(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"return": "",
"signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"testcase": false
},
{
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
},
{
"class_method_signature": "Game.switchPlayer()",
"constructor": false,
"full_signature": " void switchPlayer()",
"identifier": "switchPlayer",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void switchPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.endTurn()",
"constructor": false,
"full_signature": "public void endTurn()",
"identifier": "endTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void endTurn()",
"testcase": false
},
{
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
},
{
"class_method_signature": "Game.run()",
"constructor": false,
"full_signature": "public void run()",
"identifier": "run",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
},
{
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.main(String... args)",
"constructor": false,
"full_signature": "public static void main(String... args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String... args)",
"return": "void",
"signature": "void main(String... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void beginTurn() {\n activePlayer.giveManaSlot();\n activePlayer.refillMana();\n activePlayer.drawCard();\n logger.info(activePlayer + \" plays turn...\");\n }",
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"invocations": [
"giveManaSlot",
"refillMana",
"drawCard",
"info"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_1 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/KamikazeStrategyTest.java",
"identifier": "KamikazeStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNeverUseHealing() {\n assertThat(strategy.nextMove(withMana(10), andHealth(20), fromCards(10)), isAttackingWithCard(10));\n assertThat(strategy.nextMove(withMana(10), andHealth(10), fromCards(10)), isAttackingWithCard(10));\n assertThat(strategy.nextMove(withMana(10), andHealth(5), fromCards(10)), isAttackingWithCard(10));\n assertThat(strategy.nextMove(withMana(10), andHealth(1), fromCards(10)), isAttackingWithCard(10));\n }",
"class_method_signature": "KamikazeStrategyTest.shouldNeverUseHealing()",
"constructor": false,
"full_signature": "@Test public void shouldNeverUseHealing()",
"identifier": "shouldNeverUseHealing",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldNeverUseHealing()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/KamikazeStrategy.java",
"identifier": "KamikazeStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "KamikazeStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n return new Move(highestCard(availableMana, availableCards), Action.DAMAGE);\n }",
"class_method_signature": "KamikazeStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_13 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/AiStrategyTest.java",
"identifier": "AiStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldPlayAsManyCardsAsPossibleForMaximumDamage() {\n assertThat(strategy.nextMove(withMana(3), andHealth(30), fromCards(1, 2, 3)), either(is(isAttackingWithCard(1))).or(is(isAttackingWithCard(2))));\n }",
"class_method_signature": "AiStrategyTest.shouldPlayAsManyCardsAsPossibleForMaximumDamage()",
"constructor": false,
"full_signature": "@Test public void shouldPlayAsManyCardsAsPossibleForMaximumDamage()",
"identifier": "shouldPlayAsManyCardsAsPossibleForMaximumDamage",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"or",
"either",
"is",
"isAttackingWithCard",
"is",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldPlayAsManyCardsAsPossibleForMaximumDamage()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/AiStrategy.java",
"identifier": "AiStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.bestCard(int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"identifier": "bestCard",
"modifiers": "private",
"parameters": "(int availableMana, List<Card> availableCards)",
"return": "Optional<Card>",
"signature": "Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"identifier": "collectMaxDamageCardCombo",
"modifiers": "private",
"parameters": "(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"return": "void",
"signature": "void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 10) {\n return new Move(highestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(bestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard",
"bestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_0 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/KamikazeStrategyTest.java",
"identifier": "KamikazeStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldPlayHighCostCardsFirst() {\n assertThat(strategy.nextMove(withMana(10), andHealth(30), fromCards(0, 1, 2, 3, 8)), isAttackingWithCard(8));\n assertThat(strategy.nextMove(withMana(2), andHealth(30), fromCards(0, 1, 2, 3)), isAttackingWithCard(2));\n assertThat(strategy.nextMove(withMana(0), andHealth(30), fromCards(0, 1, 3)), isAttackingWithCard(0));\n }",
"class_method_signature": "KamikazeStrategyTest.shouldPlayHighCostCardsFirst()",
"constructor": false,
"full_signature": "@Test public void shouldPlayHighCostCardsFirst()",
"identifier": "shouldPlayHighCostCardsFirst",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard",
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldPlayHighCostCardsFirst()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/KamikazeStrategy.java",
"identifier": "KamikazeStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "KamikazeStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n return new Move(highestCard(availableMana, availableCards), Action.DAMAGE);\n }",
"class_method_signature": "KamikazeStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_12 | {
"fields": [
{
"declarator": "strategy",
"modifier": "",
"original_string": "Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/strategy/AiStrategyTest.java",
"identifier": "AiStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldMaximizeDamageOutputInCurrentTurn() {\n assertThat(strategy.nextMove(withMana(8), andHealth(30), fromCards(7, 6, 4, 3, 2)), either(is(isAttackingWithCard(2))).or(is(isAttackingWithCard(6))));\n }",
"class_method_signature": "AiStrategyTest.shouldMaximizeDamageOutputInCurrentTurn()",
"constructor": false,
"full_signature": "@Test public void shouldMaximizeDamageOutputInCurrentTurn()",
"identifier": "shouldMaximizeDamageOutputInCurrentTurn",
"invocations": [
"assertThat",
"nextMove",
"withMana",
"andHealth",
"fromCards",
"or",
"either",
"is",
"isAttackingWithCard",
"is",
"isAttackingWithCard"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldMaximizeDamageOutputInCurrentTurn()",
"testcase": true
} | {
"fields": [],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/strategy/AiStrategy.java",
"identifier": "AiStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.bestCard(int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"identifier": "bestCard",
"modifiers": "private",
"parameters": "(int availableMana, List<Card> availableCards)",
"return": "Optional<Card>",
"signature": "Optional<Card> bestCard(int availableMana, List<Card> availableCards)",
"testcase": false
},
{
"class_method_signature": "AiStrategy.collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"constructor": false,
"full_signature": "private void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"identifier": "collectMaxDamageCardCombo",
"modifiers": "private",
"parameters": "(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"return": "void",
"signature": "void collectMaxDamageCardCombo(List<Card> selectedCards, int availableMana, List<Card> availableCards)",
"testcase": false
}
],
"superclass": "extends Strategy"
} | {
"body": "@Override\n public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {\n if (currentHealth < 10) {\n return new Move(highestCard(availableMana, availableCards), Action.HEALING);\n } else {\n return new Move(bestCard(availableMana, availableCards), Action.DAMAGE);\n }\n }",
"class_method_signature": "AiStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"constructor": false,
"full_signature": "@Override public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"identifier": "nextMove",
"invocations": [
"highestCard",
"bestCard"
],
"modifiers": "@Override public",
"parameters": "(int availableMana, int currentHealth, List<Card> availableCards)",
"return": "Move",
"signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_28 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game",
"var_name": "game"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/GameTest.java",
"identifier": "GameTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void activePlayerShouldReceiveOneManaSlotOnBeginningOfTurn() {\n Player player1 = aPlayer().withManaSlots(0).build();\n game = aGame().withActivePlayer(player1).build();\n\n game.beginTurn();\n\n assertThat(player1.getManaSlots(), is(equalTo(1)));\n }",
"class_method_signature": "GameTest.activePlayerShouldReceiveOneManaSlotOnBeginningOfTurn()",
"constructor": false,
"full_signature": "@Test public void activePlayerShouldReceiveOneManaSlotOnBeginningOfTurn()",
"identifier": "activePlayerShouldReceiveOneManaSlotOnBeginningOfTurn",
"invocations": [
"build",
"withManaSlots",
"aPlayer",
"build",
"withActivePlayer",
"aGame",
"beginTurn",
"assertThat",
"getManaSlots",
"is",
"equalTo"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void activePlayerShouldReceiveOneManaSlotOnBeginningOfTurn()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "activePlayer",
"modifier": "private",
"original_string": "private Player activePlayer;",
"type": "Player",
"var_name": "activePlayer"
},
{
"declarator": "opponentPlayer",
"modifier": "private",
"original_string": "private Player opponentPlayer;",
"type": "Player",
"var_name": "opponentPlayer"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Game.java",
"identifier": "Game",
"interfaces": "",
"methods": [
{
"class_method_signature": "Game.Game(Player player1, Player player2)",
"constructor": true,
"full_signature": "public Game(Player player1, Player player2)",
"identifier": "Game",
"modifiers": "public",
"parameters": "(Player player1, Player player2)",
"return": "",
"signature": " Game(Player player1, Player player2)",
"testcase": false
},
{
"class_method_signature": "Game.Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"constructor": true,
"full_signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"identifier": "Game",
"modifiers": "",
"parameters": "(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"return": "",
"signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"testcase": false
},
{
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
},
{
"class_method_signature": "Game.switchPlayer()",
"constructor": false,
"full_signature": " void switchPlayer()",
"identifier": "switchPlayer",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void switchPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.endTurn()",
"constructor": false,
"full_signature": "public void endTurn()",
"identifier": "endTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void endTurn()",
"testcase": false
},
{
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
},
{
"class_method_signature": "Game.run()",
"constructor": false,
"full_signature": "public void run()",
"identifier": "run",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
},
{
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.main(String... args)",
"constructor": false,
"full_signature": "public static void main(String... args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String... args)",
"return": "void",
"signature": "void main(String... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void beginTurn() {\n activePlayer.giveManaSlot();\n activePlayer.refillMana();\n activePlayer.drawCard();\n logger.info(activePlayer + \" plays turn...\");\n }",
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"invocations": [
"giveManaSlot",
"refillMana",
"drawCard",
"info"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_24 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "strategy",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/PlayerTest.java",
"identifier": "PlayerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void playerWithEmptyHandCannotPlayCards() {\n player = aPlayer().withNoCardsInHand().build();\n\n assertThat(player.canPlayCards(), is(false));\n }",
"class_method_signature": "PlayerTest.playerWithEmptyHandCannotPlayCards()",
"constructor": false,
"full_signature": "@Test public void playerWithEmptyHandCannotPlayCards()",
"identifier": "playerWithEmptyHandCannotPlayCards",
"invocations": [
"build",
"withNoCardsInHand",
"aPlayer",
"assertThat",
"canPlayCards",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void playerWithEmptyHandCannotPlayCards()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "random = new Random()",
"modifier": "",
"original_string": "Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "STARTING_HAND_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int STARTING_HAND_SIZE = 3;",
"type": "int",
"var_name": "STARTING_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HAND_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HAND_SIZE = 5;",
"type": "int",
"var_name": "MAXIMUM_HAND_SIZE"
},
{
"declarator": "MAXIMUM_HEALTH = 30",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_HEALTH = 30;",
"type": "int",
"var_name": "MAXIMUM_HEALTH"
},
{
"declarator": "MAXIMUM_MANA_SLOTS = 10",
"modifier": "private static final",
"original_string": "private static final int MAXIMUM_MANA_SLOTS = 10;",
"type": "int",
"var_name": "MAXIMUM_MANA_SLOTS"
},
{
"declarator": "health = MAXIMUM_HEALTH",
"modifier": "private",
"original_string": "private int health = MAXIMUM_HEALTH;",
"type": "int",
"var_name": "health"
},
{
"declarator": "manaSlots = 0",
"modifier": "private",
"original_string": "private int manaSlots = 0;",
"type": "int",
"var_name": "manaSlots"
},
{
"declarator": "mana = 0",
"modifier": "private",
"original_string": "private int mana = 0;",
"type": "int",
"var_name": "mana"
},
{
"declarator": "deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8)",
"modifier": "private",
"original_string": "private List<Card> deck = Card.list(0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8);",
"type": "List<Card>",
"var_name": "deck"
},
{
"declarator": "hand = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Card> hand = new ArrayList<>();",
"type": "List<Card>",
"var_name": "hand"
},
{
"declarator": "strategy",
"modifier": "private final",
"original_string": "private final Strategy strategy;",
"type": "Strategy",
"var_name": "strategy"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Player.java",
"identifier": "Player",
"interfaces": "",
"methods": [
{
"class_method_signature": "Player.Player(String name, Strategy strategy)",
"constructor": true,
"full_signature": "public Player(String name, Strategy strategy)",
"identifier": "Player",
"modifiers": "public",
"parameters": "(String name, Strategy strategy)",
"return": "",
"signature": " Player(String name, Strategy strategy)",
"testcase": false
},
{
"class_method_signature": "Player.Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"constructor": true,
"full_signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"identifier": "Player",
"modifiers": "",
"parameters": "(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"return": "",
"signature": " Player(String name, Strategy strategy, int health, int manaSlots, int mana, List<Card> deck, List<Card> hand)",
"testcase": false
},
{
"class_method_signature": "Player.getHealth()",
"constructor": false,
"full_signature": "public int getHealth()",
"identifier": "getHealth",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getHealth()",
"testcase": false
},
{
"class_method_signature": "Player.getMana()",
"constructor": false,
"full_signature": "public int getMana()",
"identifier": "getMana",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getMana()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public int getNumberOfDeckCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfDeckCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "int",
"signature": "int getNumberOfDeckCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfDeckCards()",
"constructor": false,
"full_signature": "public int getNumberOfDeckCards()",
"identifier": "getNumberOfDeckCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfDeckCards()",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCardsWithManaCost(int manaCost)",
"constructor": false,
"full_signature": "public Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"identifier": "getNumberOfHandCardsWithManaCost",
"modifiers": "public",
"parameters": "(int manaCost)",
"return": "Integer",
"signature": "Integer getNumberOfHandCardsWithManaCost(int manaCost)",
"testcase": false
},
{
"class_method_signature": "Player.getNumberOfHandCards()",
"constructor": false,
"full_signature": "public int getNumberOfHandCards()",
"identifier": "getNumberOfHandCards",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getNumberOfHandCards()",
"testcase": false
},
{
"class_method_signature": "Player.drawCard()",
"constructor": false,
"full_signature": "public void drawCard()",
"identifier": "drawCard",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawCard()",
"testcase": false
},
{
"class_method_signature": "Player.getManaSlots()",
"constructor": false,
"full_signature": "public int getManaSlots()",
"identifier": "getManaSlots",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getManaSlots()",
"testcase": false
},
{
"class_method_signature": "Player.giveManaSlot()",
"constructor": false,
"full_signature": "public void giveManaSlot()",
"identifier": "giveManaSlot",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void giveManaSlot()",
"testcase": false
},
{
"class_method_signature": "Player.refillMana()",
"constructor": false,
"full_signature": "public void refillMana()",
"identifier": "refillMana",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void refillMana()",
"testcase": false
},
{
"class_method_signature": "Player.drawStartingHand()",
"constructor": false,
"full_signature": "public void drawStartingHand()",
"identifier": "drawStartingHand",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void drawStartingHand()",
"testcase": false
},
{
"class_method_signature": "Player.heal(int amount)",
"constructor": false,
"full_signature": "private void heal(int amount)",
"identifier": "heal",
"modifiers": "private",
"parameters": "(int amount)",
"return": "void",
"signature": "void heal(int amount)",
"testcase": false
},
{
"class_method_signature": "Player.receiveDamage(int damage)",
"constructor": false,
"full_signature": "private void receiveDamage(int damage)",
"identifier": "receiveDamage",
"modifiers": "private",
"parameters": "(int damage)",
"return": "void",
"signature": "void receiveDamage(int damage)",
"testcase": false
},
{
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Player opponent)",
"constructor": false,
"full_signature": "public void playCard(Player opponent)",
"identifier": "playCard",
"modifiers": "public",
"parameters": "(Player opponent)",
"return": "void",
"signature": "void playCard(Player opponent)",
"testcase": false
},
{
"class_method_signature": "Player.playCard(Card card, Player opponent, Action action)",
"constructor": false,
"full_signature": " void playCard(Card card, Player opponent, Action action)",
"identifier": "playCard",
"modifiers": "",
"parameters": "(Card card, Player opponent, Action action)",
"return": "void",
"signature": "void playCard(Card card, Player opponent, Action action)",
"testcase": false
},
{
"class_method_signature": "Player.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean canPlayCards() {\n return hand.stream().filter(card -> card.getValue() <= mana).count() > 0;\n }",
"class_method_signature": "Player.canPlayCards()",
"constructor": false,
"full_signature": "public boolean canPlayCards()",
"identifier": "canPlayCards",
"invocations": [
"count",
"filter",
"stream",
"getValue"
],
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean canPlayCards()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
15751803_32 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game",
"var_name": "game"
}
],
"file": "tcg-java/src/test/java/de/kimminich/kata/tcg/GameTest.java",
"identifier": "GameTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ongoingGameHasNoWinner() {\n Player player1 = aPlayer().withMana(10).withCardsInHand(4, 6).build();\n Player player2 = aPlayer().withHealth(30).build();\n game = aGame().withActivePlayer(player1).withOpponentPlayer(player2).build();\n\n player1.playCard(aCardWithValue(4), player2, DAMAGE);\n\n assertThat(game.getWinner(), is(nullValue()));\n }",
"class_method_signature": "GameTest.ongoingGameHasNoWinner()",
"constructor": false,
"full_signature": "@Test public void ongoingGameHasNoWinner()",
"identifier": "ongoingGameHasNoWinner",
"invocations": [
"build",
"withCardsInHand",
"withMana",
"aPlayer",
"build",
"withHealth",
"aPlayer",
"build",
"withOpponentPlayer",
"withActivePlayer",
"aGame",
"playCard",
"aCardWithValue",
"assertThat",
"getWinner",
"is",
"nullValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void ongoingGameHasNoWinner()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = Logger.getLogger(Game.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(Game.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "activePlayer",
"modifier": "private",
"original_string": "private Player activePlayer;",
"type": "Player",
"var_name": "activePlayer"
},
{
"declarator": "opponentPlayer",
"modifier": "private",
"original_string": "private Player opponentPlayer;",
"type": "Player",
"var_name": "opponentPlayer"
}
],
"file": "tcg-java/src/main/java/de/kimminich/kata/tcg/Game.java",
"identifier": "Game",
"interfaces": "",
"methods": [
{
"class_method_signature": "Game.Game(Player player1, Player player2)",
"constructor": true,
"full_signature": "public Game(Player player1, Player player2)",
"identifier": "Game",
"modifiers": "public",
"parameters": "(Player player1, Player player2)",
"return": "",
"signature": " Game(Player player1, Player player2)",
"testcase": false
},
{
"class_method_signature": "Game.Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"constructor": true,
"full_signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"identifier": "Game",
"modifiers": "",
"parameters": "(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"return": "",
"signature": " Game(Player player1, Player player2, StartingPlayerChooser startingPlayerChooser)",
"testcase": false
},
{
"class_method_signature": "Game.beginTurn()",
"constructor": false,
"full_signature": "public void beginTurn()",
"identifier": "beginTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void beginTurn()",
"testcase": false
},
{
"class_method_signature": "Game.switchPlayer()",
"constructor": false,
"full_signature": " void switchPlayer()",
"identifier": "switchPlayer",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void switchPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.endTurn()",
"constructor": false,
"full_signature": "public void endTurn()",
"identifier": "endTurn",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void endTurn()",
"testcase": false
},
{
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
},
{
"class_method_signature": "Game.run()",
"constructor": false,
"full_signature": "public void run()",
"identifier": "run",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "Game.getActivePlayer()",
"constructor": false,
"full_signature": "public Player getActivePlayer()",
"identifier": "getActivePlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getActivePlayer()",
"testcase": false
},
{
"class_method_signature": "Game.getOpponentPlayer()",
"constructor": false,
"full_signature": "public Player getOpponentPlayer()",
"identifier": "getOpponentPlayer",
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getOpponentPlayer()",
"testcase": false
},
{
"class_method_signature": "Game.main(String... args)",
"constructor": false,
"full_signature": "public static void main(String... args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String... args)",
"return": "void",
"signature": "void main(String... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Player getWinner() {\n if (activePlayer.getHealth() < 1) {\n return opponentPlayer;\n } else if (opponentPlayer.getHealth() < 1) {\n return activePlayer;\n } else {\n return null;\n }\n }",
"class_method_signature": "Game.getWinner()",
"constructor": false,
"full_signature": "public Player getWinner()",
"identifier": "getWinner",
"invocations": [
"getHealth",
"getHealth"
],
"modifiers": "public",
"parameters": "()",
"return": "Player",
"signature": "Player getWinner()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 15751803,
"size": 11558,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/bkimminich/kata-tcg"
} |
96331237_38 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void createFolder() {\n String folder = \"some-folder/some-subfolder/some-subsubfolder\";\n access.createDirectories(folder);\n File expectedFolder = new File(targetDir, folder);\n assertTrue(expectedFolder.exists());\n }",
"class_method_signature": "PluginFileAccessTest.createFolder()",
"constructor": false,
"full_signature": "@Test public void createFolder()",
"identifier": "createFolder",
"invocations": [
"createDirectories",
"assertTrue",
"exists"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void createFolder()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void createDirectories(String relativePath) {\n File targetFolder = new File(targetDir, relativePath);\n targetFolder.mkdirs();\n }",
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"invocations": [
"mkdirs"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_3 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void testGetOutputsEmptyOutputs() throws Exception {\n List<Transformation> transformations = preInitNonCreationTests();\n Transformation t = transformations.get(0);\n when(t.getState()).thenReturn(TransformationState.DONE);\n when(t.getOutputs()).thenReturn(new ArrayList<>());\n mvc.perform(get(GET_OUTPUT_URL))\n .andDo(print())\n .andExpect(status().is(200))\n .andExpect(jsonPath(\"$.outputs\").isArray())\n .andExpect(jsonPath(\"$.links[0].href\").value(\"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/outputs\"))\n .andReturn();\n }",
"class_method_signature": "TransformationControllerTest.testGetOutputsEmptyOutputs()",
"constructor": false,
"full_signature": "@Test public void testGetOutputsEmptyOutputs()",
"identifier": "testGetOutputsEmptyOutputs",
"invocations": [
"preInitNonCreationTests",
"get",
"thenReturn",
"when",
"getState",
"thenReturn",
"when",
"getOutputs",
"andReturn",
"andExpect",
"andExpect",
"andExpect",
"andDo",
"perform",
"get",
"print",
"is",
"status",
"isArray",
"jsonPath",
"value",
"jsonPath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetOutputsEmptyOutputs()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@ApiOperation(\n value = \"Retrieve the outputs and their values\",\n tags = {\"transformations\"},\n notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" +\n \"if the transformation (including deployment) is not done yet\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\",\n response = GetOutputsResponse.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a transformation for the specified platform\",\n response = RestErrorResponse.class\n ),\n @ApiResponse(\n code = 400,\n message = \"The state of the transformation is invalid (not ERROR or DONE)\",\n response = RestErrorResponse.class\n )\n })\n @RequestMapping(\n path = \"/{platform}/outputs\",\n method = {RequestMethod.GET},\n produces = \"application/hal+json\"\n )\n public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n ) {\n Csar csar = findByCsarId(csarId);\n Transformation transformation = findTransformationByPlatform(csar, platformId);\n if (transformation.getState() != TransformationState.DONE && transformation.getState() != TransformationState.ERROR) {\n throw new IllegalTransformationStateException(\"The Transformation has not finished yet!\");\n }\n List<OutputProperty> outputs = transformation.getOutputs();\n List<OutputWrap> wrappedOutputs = outputs.stream()\n .map(OutputWrap::new)\n .collect(Collectors.toList());\n return ResponseEntity.ok(new GetOutputsResponse(csarId, platformId, wrappedOutputs));\n }",
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"invocations": [
"findByCsarId",
"findTransformationByPlatform",
"getState",
"getState",
"getOutputs",
"collect",
"map",
"stream",
"toList",
"ok"
],
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_55 | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private",
"original_string": "private TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "platformService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
},
{
"declarator": "transformation",
"modifier": "private",
"original_string": "private Transformation transformation;",
"type": "Transformation",
"var_name": "transformation"
},
{
"declarator": "transformationRootDir",
"modifier": "private",
"original_string": "private File transformationRootDir;",
"type": "File",
"var_name": "transformationRootDir"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDaoTest.java",
"identifier": "TransformationFilesystemDaoTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void findFromSpecificCsar() {\n when(csarDao.getTransformationsDir(csar)).thenReturn(tmpdir);\n createRandomFiles(new File(tmpdir, PLATFORM1.id));\n createRandomFiles(new File(tmpdir, PLATFORM2.id));\n createRandomFiles(new File(tmpdir, PLATFORM_NOT_SUPPORTED.id));\n when(platformService.findPlatformById(PLATFORM1.id)).thenReturn(Optional.of(PLATFORM1));\n when(platformService.findPlatformById(PLATFORM2.id)).thenReturn(Optional.of(PLATFORM2));\n List<Transformation> transformations = transformationDao.find(csar);\n\n assertEquals(2, transformations.size());\n }",
"class_method_signature": "TransformationFilesystemDaoTest.findFromSpecificCsar()",
"constructor": false,
"full_signature": "@Test public void findFromSpecificCsar()",
"identifier": "findFromSpecificCsar",
"invocations": [
"thenReturn",
"when",
"getTransformationsDir",
"createRandomFiles",
"createRandomFiles",
"createRandomFiles",
"thenReturn",
"when",
"findPlatformById",
"of",
"thenReturn",
"when",
"findPlatformById",
"of",
"find",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void findFromSpecificCsar()",
"testcase": true
} | {
"fields": [
{
"declarator": "ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_FAILED_REGEX"
},
{
"declarator": "ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_SUCCESSFUL_REGEX"
},
{
"declarator": "CONTENT_DIR = \"content\"",
"modifier": "public final static",
"original_string": "public final static String CONTENT_DIR = \"content\";",
"type": "String",
"var_name": "CONTENT_DIR"
},
{
"declarator": "FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\")",
"modifier": "private final static",
"original_string": "private final static SimpleDateFormat FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\");",
"type": "SimpleDateFormat",
"var_name": "FORMAT"
},
{
"declarator": "FAILED = \"_failed\"",
"modifier": "private final static",
"original_string": "private final static String FAILED = \"_failed\";",
"type": "String",
"var_name": "FAILED"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationFilesystemDao.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(TransformationFilesystemDao.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "effectiveModelFactory",
"modifier": "private final",
"original_string": "private final EffectiveModelFactory effectiveModelFactory;",
"type": "EffectiveModelFactory",
"var_name": "effectiveModelFactory"
},
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDao.java",
"identifier": "TransformationFilesystemDao",
"interfaces": "implements TransformationDao",
"methods": [
{
"class_method_signature": "TransformationFilesystemDao.TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"constructor": true,
"full_signature": "@Autowired public TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"identifier": "TransformationFilesystemDao",
"modifiers": "@Autowired public",
"parameters": "(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"return": "",
"signature": " TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.create(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Transformation create(Csar csar, Platform platform)",
"identifier": "create",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation create(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTransformation(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Transformation createTransformation(Csar csar, Platform platform)",
"identifier": "createTransformation",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public void delete(Transformation transformation)",
"identifier": "delete",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void delete(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(File transformationDir)",
"constructor": false,
"full_signature": "private void delete(File transformationDir)",
"identifier": "delete",
"modifiers": "private",
"parameters": "(File transformationDir)",
"return": "void",
"signature": "void delete(File transformationDir)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Optional<Transformation> find(Csar csar, Platform platform)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Optional<Transformation>",
"signature": "Optional<Transformation> find(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar)",
"constructor": false,
"full_signature": "@Override public List<Transformation> find(Csar csar)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "List<Transformation>",
"signature": "List<Transformation> find(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readFromDisk(Csar csar)",
"constructor": false,
"full_signature": "private Set<Transformation> readFromDisk(Csar csar)",
"identifier": "readFromDisk",
"modifiers": "private",
"parameters": "(Csar csar)",
"return": "Set<Transformation>",
"signature": "Set<Transformation> readFromDisk(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readTargetArtifactFromDisk(Transformation transformation)",
"constructor": false,
"full_signature": "private void readTargetArtifactFromDisk(Transformation transformation)",
"identifier": "readTargetArtifactFromDisk",
"modifiers": "private",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void readTargetArtifactFromDisk(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTargetArtifact(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public TargetArtifact createTargetArtifact(Transformation transformation)",
"identifier": "createTargetArtifact",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "TargetArtifact",
"signature": "TargetArtifact createTargetArtifact(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getRootDir(Transformation transformation)",
"identifier": "getRootDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getRootDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getRootDir(Csar csar, Platform platform)",
"identifier": "getRootDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getRootDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getContentDir(Transformation transformation)",
"identifier": "getContentDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getContentDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getContentDir(Csar csar, Platform platform)",
"identifier": "getContentDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getContentDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.setCsarDao(CsarDao csarDao)",
"constructor": false,
"full_signature": "@Override public void setCsarDao(CsarDao csarDao)",
"identifier": "setCsarDao",
"modifiers": "@Override public",
"parameters": "(CsarDao csarDao)",
"return": "void",
"signature": "void setCsarDao(CsarDao csarDao)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getLog(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Log getLog(Csar csar, Platform platform)",
"identifier": "getLog",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Log",
"signature": "Log getLog(Csar csar, Platform platform)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Optional<Transformation> find(Csar csar, Platform platform) {\n Set<Transformation> transformations = readFromDisk(csar);\n return Optional.ofNullable(transformations.stream()\n .filter(transformation -> transformation.getCsar().equals(csar) && transformation.getPlatform().equals(platform))\n .findFirst().orElse(null));\n }",
"class_method_signature": "TransformationFilesystemDao.find(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Optional<Transformation> find(Csar csar, Platform platform)",
"identifier": "find",
"invocations": [
"readFromDisk",
"ofNullable",
"orElse",
"findFirst",
"filter",
"stream",
"equals",
"getCsar",
"equals",
"getPlatform"
],
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Optional<Transformation>",
"signature": "Optional<Transformation> find(Csar csar, Platform platform)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_14 | {
"fields": [
{
"declarator": "entityId = new EntityId(Lists.newArrayList(\"my\", \"id\"))",
"modifier": "private static",
"original_string": "private static EntityId entityId = new EntityId(Lists.newArrayList(\"my\", \"id\"));",
"type": "EntityId",
"var_name": "entityId"
},
{
"declarator": "entity",
"modifier": "private static",
"original_string": "private static MappingEntity entity;",
"type": "MappingEntity",
"var_name": "entity"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/kubernetes/docker/mapper/MapperUtilsTest.java",
"identifier": "MapperUtilsTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void testNoneSet() {\n assertFalse(anythingSet(new OsCapability(entity)));\n }",
"class_method_signature": "MapperUtilsTest.testNoneSet()",
"constructor": false,
"full_signature": "@Test public void testNoneSet()",
"identifier": "testNoneSet",
"invocations": [
"assertFalse",
"anythingSet"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testNoneSet()",
"testcase": true
} | {
"fields": [
{
"declarator": "TAG_COMPARATOR_MINOR_VERSION =\n Comparator.comparing(DockerImageTag::toVersion)",
"modifier": "public static final",
"original_string": "public static final Comparator<DockerImageTag> TAG_COMPARATOR_MINOR_VERSION =\n Comparator.comparing(DockerImageTag::toVersion);",
"type": "Comparator<DockerImageTag>",
"var_name": "TAG_COMPARATOR_MINOR_VERSION"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/kubernetes/docker/mapper/MapperUtils.java",
"identifier": "MapperUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MapperUtils.anythingSet(OsCapability capability)",
"constructor": false,
"full_signature": "public static boolean anythingSet(OsCapability capability)",
"identifier": "anythingSet",
"modifiers": "public static",
"parameters": "(OsCapability capability)",
"return": "boolean",
"signature": "boolean anythingSet(OsCapability capability)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static boolean anythingSet(OsCapability capability) {\n Optional[] optionals = {\n capability.getDistribution(),\n capability.getArchitecture(),\n capability.getType(),\n capability.getVersion()\n };\n return Arrays.stream(optionals).anyMatch(Optional::isPresent);\n }",
"class_method_signature": "MapperUtils.anythingSet(OsCapability capability)",
"constructor": false,
"full_signature": "public static boolean anythingSet(OsCapability capability)",
"identifier": "anythingSet",
"invocations": [
"getDistribution",
"getArchitecture",
"getType",
"getVersion",
"anyMatch",
"stream"
],
"modifiers": "public static",
"parameters": "(OsCapability capability)",
"return": "boolean",
"signature": "boolean anythingSet(OsCapability capability)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_43 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LogImplTest.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(LogImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "log",
"modifier": "private",
"original_string": "private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logfile",
"modifier": "private",
"original_string": "private File logfile;",
"type": "File",
"var_name": "logfile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/logging/LogImplTest.java",
"identifier": "LogImplTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void getLogEntriesWithInvalidBounds() throws Exception {\n logger.info(\"Trying to log from index 0 to 10\");\n log.getLogEntries(100, 10);\n }",
"class_method_signature": "LogImplTest.getLogEntriesWithInvalidBounds()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public void getLogEntriesWithInvalidBounds()",
"identifier": "getLogEntriesWithInvalidBounds",
"invocations": [
"info",
"getLogEntries"
],
"modifiers": "@Test(expected = IllegalArgumentException.class) public",
"parameters": "()",
"return": "void",
"signature": "void getLogEntriesWithInvalidBounds()",
"testcase": true
} | {
"fields": [
{
"declarator": "exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class)",
"modifier": "private final static",
"original_string": "private final static org.slf4j.Logger exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "exceptionHandlingLogger"
},
{
"declarator": "logEntries = Collections.synchronizedList(new LinkedList<>())",
"modifier": "private final",
"original_string": "private final List<LogEntry> logEntries = Collections.synchronizedList(new LinkedList<>());",
"type": "List<LogEntry>",
"var_name": "logEntries"
},
{
"declarator": "index = new AtomicLong(0)",
"modifier": "private final",
"original_string": "private final AtomicLong index = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "index"
},
{
"declarator": "memoryAppender = new MemoryAppender(this)",
"modifier": "private final",
"original_string": "private final MemoryAppender memoryAppender = new MemoryAppender(this);",
"type": "MemoryAppender",
"var_name": "memoryAppender"
},
{
"declarator": "persistentAppender",
"modifier": "private final",
"original_string": "private final PersistentAppender persistentAppender;",
"type": "PersistentAppender",
"var_name": "persistentAppender"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/logging/LogImpl.java",
"identifier": "LogImpl",
"interfaces": "implements Log",
"methods": [
{
"class_method_signature": "LogImpl.LogImpl(File logFile)",
"constructor": true,
"full_signature": "public LogImpl(File logFile)",
"identifier": "LogImpl",
"modifiers": "public",
"parameters": "(File logFile)",
"return": "",
"signature": " LogImpl(File logFile)",
"testcase": false
},
{
"class_method_signature": "LogImpl.readLogFromFile(File file)",
"constructor": false,
"full_signature": "private void readLogFromFile(File file)",
"identifier": "readLogFromFile",
"modifiers": "private",
"parameters": "(File file)",
"return": "void",
"signature": "void readLogFromFile(File file)",
"testcase": false
},
{
"class_method_signature": "LogImpl.addLogEntry(LogEntry e)",
"constructor": false,
"full_signature": "@Override public void addLogEntry(LogEntry e)",
"identifier": "addLogEntry",
"modifiers": "@Override public",
"parameters": "(LogEntry e)",
"return": "void",
"signature": "void addLogEntry(LogEntry e)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last, boolean checkUpperBound)",
"constructor": false,
"full_signature": "private List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"identifier": "getLogEntries",
"modifiers": "private",
"parameters": "(int first, int last, boolean checkUpperBound)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int firstIndex)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int firstIndex)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int firstIndex)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int firstIndex)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(String context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(String context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(String context)",
"return": "Logger",
"signature": "Logger getLogger(String context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(Class context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(Class context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(Class context)",
"return": "Logger",
"signature": "Logger getLogger(Class context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public List<LogEntry> getLogEntries(int first, int last) {\n return getLogEntries(first, last, true);\n }",
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"invocations": [
"getLogEntries"
],
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_34 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test(expected = IOException.class)\n public void readFileNotExists() throws IOException {\n String path = \"nonexistent-file\";\n access.read(path);\n }",
"class_method_signature": "PluginFileAccessTest.readFileNotExists()",
"constructor": false,
"full_signature": "@Test(expected = IOException.class) public void readFileNotExists()",
"identifier": "readFileNotExists",
"invocations": [
"read"
],
"modifiers": "@Test(expected = IOException.class) public",
"parameters": "()",
"return": "void",
"signature": "void readFileNotExists()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String read(String relativePath) throws IOException {\n File source = new File(sourceDir, relativePath);\n try {\n return FileUtils.readFileToString(source);\n } catch (IOException e) {\n logger.error(\"Failed to read content from file '{}'\", source);\n throw e;\n }\n }",
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"invocations": [
"readFileToString",
"error"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_63 | {
"fields": [
{
"declarator": "graphMap = new HashMap<>()",
"modifier": "private final static",
"original_string": "private final static Map<File, ServiceGraph> graphMap = new HashMap<>();",
"type": "Map<File, ServiceGraph>",
"var_name": "graphMap"
},
{
"declarator": "currentFile",
"modifier": "private",
"original_string": "private File currentFile;",
"type": "File",
"var_name": "currentFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/parse/model/ServiceGraphTest.java",
"identifier": "ServiceGraphTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void allInputsSetTest() {\n currentFile = INPUT_NO_VALUE;\n ServiceGraph graph = getGraph();\n assertFalse(graph.inputsValid());\n currentFile = INPUT;\n graph = getGraph();\n assertTrue(graph.inputsValid());\n }",
"class_method_signature": "ServiceGraphTest.allInputsSetTest()",
"constructor": false,
"full_signature": "@Test public void allInputsSetTest()",
"identifier": "allInputsSetTest",
"invocations": [
"getGraph",
"assertFalse",
"inputsValid",
"getGraph",
"assertTrue",
"inputsValid"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void allInputsSetTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "private final",
"original_string": "private final MappingEntity root;",
"type": "MappingEntity",
"var_name": "root"
},
{
"declarator": "log",
"modifier": "private final",
"original_string": "private final Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "finalized = false",
"modifier": "private",
"original_string": "private boolean finalized = false;",
"type": "boolean",
"var_name": "finalized"
},
{
"declarator": "inputs",
"modifier": "private",
"original_string": "private Map<String, InputProperty> inputs;",
"type": "Map<String, InputProperty>",
"var_name": "inputs"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/parse/model/ServiceGraph.java",
"identifier": "ServiceGraph",
"interfaces": "",
"methods": [
{
"class_method_signature": "ServiceGraph.ServiceGraph(Log log)",
"constructor": true,
"full_signature": "public ServiceGraph(Log log)",
"identifier": "ServiceGraph",
"modifiers": "public",
"parameters": "(Log log)",
"return": "",
"signature": " ServiceGraph(Log log)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.ServiceGraph(File template, Log log)",
"constructor": true,
"full_signature": "public ServiceGraph(File template, Log log)",
"identifier": "ServiceGraph",
"modifiers": "public",
"parameters": "(File template, Log log)",
"return": "",
"signature": " ServiceGraph(File template, Log log)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.populateGraph(Node node, EntityId id)",
"constructor": false,
"full_signature": "private void populateGraph(Node node, EntityId id)",
"identifier": "populateGraph",
"modifiers": "private",
"parameters": "(Node node, EntityId id)",
"return": "void",
"signature": "void populateGraph(Node node, EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.finalizeGraph()",
"constructor": false,
"full_signature": "public void finalizeGraph()",
"identifier": "finalizeGraph",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void finalizeGraph()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.inputsValid()",
"constructor": false,
"full_signature": "public boolean inputsValid()",
"identifier": "inputsValid",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean inputsValid()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getInputs()",
"constructor": false,
"full_signature": "public Map<String, InputProperty> getInputs()",
"identifier": "getInputs",
"modifiers": "public",
"parameters": "()",
"return": "Map<String, InputProperty>",
"signature": "Map<String, InputProperty> getInputs()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getOutputs()",
"constructor": false,
"full_signature": "public Map<String, OutputProperty> getOutputs()",
"identifier": "getOutputs",
"modifiers": "public",
"parameters": "()",
"return": "Map<String, OutputProperty>",
"signature": "Map<String, OutputProperty> getOutputs()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.addEntity(Entity entity)",
"constructor": false,
"full_signature": "public void addEntity(Entity entity)",
"identifier": "addEntity",
"modifiers": "public",
"parameters": "(Entity entity)",
"return": "void",
"signature": "void addEntity(Entity entity)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getEntity(List<String> path)",
"constructor": false,
"full_signature": "public Optional<Entity> getEntity(List<String> path)",
"identifier": "getEntity",
"modifiers": "public",
"parameters": "(List<String> path)",
"return": "Optional<Entity>",
"signature": "Optional<Entity> getEntity(List<String> path)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getEntity(EntityId id)",
"constructor": false,
"full_signature": "public Optional<Entity> getEntity(EntityId id)",
"identifier": "getEntity",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Optional<Entity>",
"signature": "Optional<Entity> getEntity(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getEntityOrThrow(EntityId id)",
"constructor": false,
"full_signature": "public Entity getEntityOrThrow(EntityId id)",
"identifier": "getEntityOrThrow",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Entity",
"signature": "Entity getEntityOrThrow(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.iterator(EntityId id)",
"constructor": false,
"full_signature": "public Iterator<Entity> iterator(EntityId id)",
"identifier": "iterator",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Iterator<Entity>",
"signature": "Iterator<Entity> iterator(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.replaceEntity(Entity source, Entity target)",
"constructor": false,
"full_signature": "public void replaceEntity(Entity source, Entity target)",
"identifier": "replaceEntity",
"modifiers": "public",
"parameters": "(Entity source, Entity target)",
"return": "void",
"signature": "void replaceEntity(Entity source, Entity target)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.addConnection(Entity source, Entity target, String connectionName)",
"constructor": false,
"full_signature": "public void addConnection(Entity source, Entity target, String connectionName)",
"identifier": "addConnection",
"modifiers": "public",
"parameters": "(Entity source, Entity target, String connectionName)",
"return": "void",
"signature": "void addConnection(Entity source, Entity target, String connectionName)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getChildren(EntityId id)",
"constructor": false,
"full_signature": "public Collection<Entity> getChildren(EntityId id)",
"identifier": "getChildren",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Collection<Entity>",
"signature": "Collection<Entity> getChildren(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getLogger()",
"constructor": false,
"full_signature": "public Logger getLogger()",
"identifier": "getLogger",
"modifiers": "public",
"parameters": "()",
"return": "Logger",
"signature": "Logger getLogger()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getLog()",
"constructor": false,
"full_signature": "public Log getLog()",
"identifier": "getLog",
"modifiers": "public",
"parameters": "()",
"return": "Log",
"signature": "Log getLog()",
"testcase": false
}
],
"superclass": "extends SimpleDirectedGraph<Entity, Connection>"
} | {
"body": "public boolean inputsValid() {\n Map<String, InputProperty> inputs = getInputs();\n return inputs.values().stream()\n .allMatch(InputProperty::isValid);\n }",
"class_method_signature": "ServiceGraph.inputsValid()",
"constructor": false,
"full_signature": "public boolean inputsValid()",
"identifier": "inputsValid",
"invocations": [
"getInputs",
"allMatch",
"stream",
"values"
],
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean inputsValid()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_22 | {
"fields": [
{
"declarator": "fileCreator",
"modifier": "private",
"original_string": "private CloudFormationFileCreator fileCreator;",
"type": "CloudFormationFileCreator",
"var_name": "fileCreator"
},
{
"declarator": "cfnModule",
"modifier": "private",
"original_string": "private CloudFormationModule cfnModule;",
"type": "CloudFormationModule",
"var_name": "cfnModule"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "FILEPATH_SOURCE_TEST_FILE",
"modifier": "private",
"original_string": "private File FILEPATH_SOURCE_TEST_FILE;",
"type": "File",
"var_name": "FILEPATH_SOURCE_TEST_FILE"
},
{
"declarator": "FILEPATH_TARGET_TEST_FILE",
"modifier": "private",
"original_string": "private File FILEPATH_TARGET_TEST_FILE;",
"type": "File",
"var_name": "FILEPATH_TARGET_TEST_FILE"
},
{
"declarator": "FILEPATH_TARGET_TEST_FILE_LOCAL",
"modifier": "private",
"original_string": "private String FILEPATH_TARGET_TEST_FILE_LOCAL;",
"type": "String",
"var_name": "FILEPATH_TARGET_TEST_FILE_LOCAL"
},
{
"declarator": "BASH_FILE_ENDING = \".sh\"",
"modifier": "private final",
"original_string": "private final String BASH_FILE_ENDING = \".sh\";",
"type": "String",
"var_name": "BASH_FILE_ENDING"
},
{
"declarator": "FILENAME_CREATE_BUCKET = \"create-bucket\"",
"modifier": "private final",
"original_string": "private final String FILENAME_CREATE_BUCKET = \"create-bucket\";",
"type": "String",
"var_name": "FILENAME_CREATE_BUCKET"
},
{
"declarator": "FILENAME_UPLOAD_FILE = \"upload-file\"",
"modifier": "private final",
"original_string": "private final String FILENAME_UPLOAD_FILE = \"upload-file\";",
"type": "String",
"var_name": "FILENAME_UPLOAD_FILE"
},
{
"declarator": "FILENAME_TEST_FILE = \"test-text-file.txt\"",
"modifier": "private static final",
"original_string": "private static final String FILENAME_TEST_FILE = \"test-text-file.txt\";",
"type": "String",
"var_name": "FILENAME_TEST_FILE"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/cloudformation/CloudFormationFileCreatorTest.java",
"identifier": "CloudFormationFileCreatorTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void copyFiles() {\n cfnModule.addFileUpload(new FileUpload(FILENAME_TEST_FILE, FROM_CSAR));\n fileCreator.copyFiles();\n assertTrue(FILEPATH_TARGET_TEST_FILE.exists());\n }",
"class_method_signature": "CloudFormationFileCreatorTest.copyFiles()",
"constructor": false,
"full_signature": "@Test public void copyFiles()",
"identifier": "copyFiles",
"invocations": [
"addFileUpload",
"copyFiles",
"assertTrue",
"exists"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void copyFiles()",
"testcase": true
} | {
"fields": [
{
"declarator": "CLI_COMMAND_CREATESTACK = \"aws cloudformation deploy \"",
"modifier": "public static final",
"original_string": "public static final String CLI_COMMAND_CREATESTACK = \"aws cloudformation deploy \";",
"type": "String",
"var_name": "CLI_COMMAND_CREATESTACK"
},
{
"declarator": "CLI_COMMAND_DELETESTACK = \"aws cloudformation delete-stack \"",
"modifier": "public static final",
"original_string": "public static final String CLI_COMMAND_DELETESTACK = \"aws cloudformation delete-stack \";",
"type": "String",
"var_name": "CLI_COMMAND_DELETESTACK"
},
{
"declarator": "CLI_COMMAND_DELETEBUCKET = \"aws s3 rb s3://\"",
"modifier": "public static final",
"original_string": "public static final String CLI_COMMAND_DELETEBUCKET = \"aws s3 rb s3://\";",
"type": "String",
"var_name": "CLI_COMMAND_DELETEBUCKET"
},
{
"declarator": "COMMAND_ECHO = \"echo \"",
"modifier": "public static final",
"original_string": "public static final String COMMAND_ECHO = \"echo \";",
"type": "String",
"var_name": "COMMAND_ECHO"
},
{
"declarator": "STRING_DELETESTACK = \"delete stack: \"",
"modifier": "public static final",
"original_string": "public static final String STRING_DELETESTACK = \"delete stack: \";",
"type": "String",
"var_name": "STRING_DELETESTACK"
},
{
"declarator": "CLI_PARAM_STACKNAME = \"--stack-name \"",
"modifier": "public static final",
"original_string": "public static final String CLI_PARAM_STACKNAME = \"--stack-name \";",
"type": "String",
"var_name": "CLI_PARAM_STACKNAME"
},
{
"declarator": "CLI_PARAM_TEMPLATEFILE = \"--template-file \"",
"modifier": "public static final",
"original_string": "public static final String CLI_PARAM_TEMPLATEFILE = \"--template-file \";",
"type": "String",
"var_name": "CLI_PARAM_TEMPLATEFILE"
},
{
"declarator": "CLI_PARAM_PARAMOVERRIDES = \"--parameter-overrides\"",
"modifier": "public static final",
"original_string": "public static final String CLI_PARAM_PARAMOVERRIDES = \"--parameter-overrides\";",
"type": "String",
"var_name": "CLI_PARAM_PARAMOVERRIDES"
},
{
"declarator": "CLI_PARAM_CAPABILITIES = \"--capabilities\"",
"modifier": "public static final",
"original_string": "public static final String CLI_PARAM_CAPABILITIES = \"--capabilities\";",
"type": "String",
"var_name": "CLI_PARAM_CAPABILITIES"
},
{
"declarator": "CLI_PARAM_BUCKET = \"--bucket \"",
"modifier": "public static final",
"original_string": "public static final String CLI_PARAM_BUCKET = \"--bucket \";",
"type": "String",
"var_name": "CLI_PARAM_BUCKET"
},
{
"declarator": "CLI_PARAM_FORCE = \"--force\"",
"modifier": "public static final",
"original_string": "public static final String CLI_PARAM_FORCE = \"--force\";",
"type": "String",
"var_name": "CLI_PARAM_FORCE"
},
{
"declarator": "CAPABILITY_IAM = \"CAPABILITY_IAM\"",
"modifier": "public static final",
"original_string": "public static final String CAPABILITY_IAM = \"CAPABILITY_IAM\";",
"type": "String",
"var_name": "CAPABILITY_IAM"
},
{
"declarator": "FILENAME_DEPLOY = \"deploy\"",
"modifier": "public static final",
"original_string": "public static final String FILENAME_DEPLOY = \"deploy\";",
"type": "String",
"var_name": "FILENAME_DEPLOY"
},
{
"declarator": "FILENAME_UPLOAD = \"file-upload\"",
"modifier": "public static final",
"original_string": "public static final String FILENAME_UPLOAD = \"file-upload\";",
"type": "String",
"var_name": "FILENAME_UPLOAD"
},
{
"declarator": "FILENAME_CREATE_STACK = \"create-stack\"",
"modifier": "public static final",
"original_string": "public static final String FILENAME_CREATE_STACK = \"create-stack\";",
"type": "String",
"var_name": "FILENAME_CREATE_STACK"
},
{
"declarator": "FILENAME_CLEANUP = \"cleanup\"",
"modifier": "public static final",
"original_string": "public static final String FILENAME_CLEANUP = \"cleanup\";",
"type": "String",
"var_name": "FILENAME_CLEANUP"
},
{
"declarator": "TEMPLATE_YAML = \"template.yaml\"",
"modifier": "public static final",
"original_string": "public static final String TEMPLATE_YAML = \"template.yaml\";",
"type": "String",
"var_name": "TEMPLATE_YAML"
},
{
"declarator": "CHANGE_TO_PARENT_DIRECTORY = \"cd ..\"",
"modifier": "public static final",
"original_string": "public static final String CHANGE_TO_PARENT_DIRECTORY = \"cd ..\";",
"type": "String",
"var_name": "CHANGE_TO_PARENT_DIRECTORY"
},
{
"declarator": "RELATIVE_DIRECTORY_PREFIX = \"../files/\"",
"modifier": "public static final",
"original_string": "public static final String RELATIVE_DIRECTORY_PREFIX = \"../files/\";",
"type": "String",
"var_name": "RELATIVE_DIRECTORY_PREFIX"
},
{
"declarator": "FILEPATH_CLOUDFORMATION = \"/cloudformation/\"",
"modifier": "public static final",
"original_string": "public static final String FILEPATH_CLOUDFORMATION = \"/cloudformation/\";",
"type": "String",
"var_name": "FILEPATH_CLOUDFORMATION"
},
{
"declarator": "FILEPATH_SCRIPTS_UTIL = FILEPATH_CLOUDFORMATION + \"scripts/util/\"",
"modifier": "public static final",
"original_string": "public static final String FILEPATH_SCRIPTS_UTIL = FILEPATH_CLOUDFORMATION + \"scripts/util/\";",
"type": "String",
"var_name": "FILEPATH_SCRIPTS_UTIL"
},
{
"declarator": "FILEPATH_FILES_UTIL = FILEPATH_CLOUDFORMATION + \"files/util/\"",
"modifier": "public static final",
"original_string": "public static final String FILEPATH_FILES_UTIL = FILEPATH_CLOUDFORMATION + \"files/util/\";",
"type": "String",
"var_name": "FILEPATH_FILES_UTIL"
},
{
"declarator": "CLOUDFORMATION_README_TITLE = \"TOSCAna - CloudFormation Transformation - Readme\"",
"modifier": "private static final",
"original_string": "private static final String CLOUDFORMATION_README_TITLE = \"TOSCAna - CloudFormation Transformation - Readme\";",
"type": "String",
"var_name": "CLOUDFORMATION_README_TITLE"
},
{
"declarator": "CLOUDFORMATION_README_PATH = \"/cloudformation/cloudformation-readme.md\"",
"modifier": "private static final",
"original_string": "private static final String CLOUDFORMATION_README_PATH = \"/cloudformation/cloudformation-readme.md\";",
"type": "String",
"var_name": "CLOUDFORMATION_README_PATH"
},
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "cfnModule",
"modifier": "private",
"original_string": "private CloudFormationModule cfnModule;",
"type": "CloudFormationModule",
"var_name": "cfnModule"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/cloudformation/CloudFormationFileCreator.java",
"identifier": "CloudFormationFileCreator",
"interfaces": "",
"methods": [
{
"class_method_signature": "CloudFormationFileCreator.CloudFormationFileCreator(TransformationContext context, CloudFormationModule cfnModule)",
"constructor": true,
"full_signature": "public CloudFormationFileCreator(TransformationContext context, CloudFormationModule cfnModule)",
"identifier": "CloudFormationFileCreator",
"modifiers": "public",
"parameters": "(TransformationContext context, CloudFormationModule cfnModule)",
"return": "",
"signature": " CloudFormationFileCreator(TransformationContext context, CloudFormationModule cfnModule)",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.copyFiles()",
"constructor": false,
"full_signature": "public void copyFiles()",
"identifier": "copyFiles",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void copyFiles()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.writeScripts()",
"constructor": false,
"full_signature": "public void writeScripts()",
"identifier": "writeScripts",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void writeScripts()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.writeDeployScript()",
"constructor": false,
"full_signature": "private void writeDeployScript()",
"identifier": "writeDeployScript",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void writeDeployScript()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.writeFileUploadScript()",
"constructor": false,
"full_signature": "private void writeFileUploadScript()",
"identifier": "writeFileUploadScript",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void writeFileUploadScript()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.writeStackCreationScript()",
"constructor": false,
"full_signature": "private void writeStackCreationScript()",
"identifier": "writeStackCreationScript",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void writeStackCreationScript()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.writeCleanUpScript()",
"constructor": false,
"full_signature": "private void writeCleanUpScript()",
"identifier": "writeCleanUpScript",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void writeCleanUpScript()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.createBucket()",
"constructor": false,
"full_signature": "private String createBucket()",
"identifier": "createBucket",
"modifiers": "private",
"parameters": "()",
"return": "String",
"signature": "String createBucket()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.uploadFile(String objectKey, String filePath)",
"constructor": false,
"full_signature": "private String uploadFile(String objectKey, String filePath)",
"identifier": "uploadFile",
"modifiers": "private",
"parameters": "(String objectKey, String filePath)",
"return": "String",
"signature": "String uploadFile(String objectKey, String filePath)",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.copyUtilScripts()",
"constructor": false,
"full_signature": "public void copyUtilScripts()",
"identifier": "copyUtilScripts",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void copyUtilScripts()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.copyUtilDependencies()",
"constructor": false,
"full_signature": "public void copyUtilDependencies()",
"identifier": "copyUtilDependencies",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void copyUtilDependencies()",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.writeReadme(TransformationContext context)",
"constructor": false,
"full_signature": "public void writeReadme(TransformationContext context)",
"identifier": "writeReadme",
"modifiers": "public",
"parameters": "(TransformationContext context)",
"return": "void",
"signature": "void writeReadme(TransformationContext context)",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.addFileUploadsToScript(List<String> files, BashScript script)",
"constructor": false,
"full_signature": "private void addFileUploadsToScript(List<String> files, BashScript script)",
"identifier": "addFileUploadsToScript",
"modifiers": "private",
"parameters": "(List<String> files, BashScript script)",
"return": "void",
"signature": "void addFileUploadsToScript(List<String> files, BashScript script)",
"testcase": false
},
{
"class_method_signature": "CloudFormationFileCreator.copyUtilFile(List<String> files, String resourcePath, String outputPath)",
"constructor": false,
"full_signature": "private void copyUtilFile(List<String> files, String resourcePath, String outputPath)",
"identifier": "copyUtilFile",
"modifiers": "private",
"parameters": "(List<String> files, String resourcePath, String outputPath)",
"return": "void",
"signature": "void copyUtilFile(List<String> files, String resourcePath, String outputPath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void copyFiles() {\n List<String> fileUploadList = getFilePaths(getFileUploadByType(cfnModule.getFileUploadList(), FROM_CSAR));\n\n logger.debug(\"Checking if files need to be copied.\");\n if (!fileUploadList.isEmpty()) {\n logger.debug(\"Files to be copied found. Attempting to copy files to the target artifact.\");\n fileUploadList.forEach((filePath) -> {\n String targetPath = FILEPATH_TARGET + filePath;\n try {\n cfnModule.getFileAccess().copy(filePath, targetPath);\n } catch (IOException e) {\n throw new TransformationFailureException(\"Copying of files to the target artifact failed.\", e);\n }\n });\n } else {\n logger.debug(\"No files to be copied found. Skipping copying of files.\");\n }\n }",
"class_method_signature": "CloudFormationFileCreator.copyFiles()",
"constructor": false,
"full_signature": "public void copyFiles()",
"identifier": "copyFiles",
"invocations": [
"getFilePaths",
"getFileUploadByType",
"getFileUploadList",
"debug",
"isEmpty",
"debug",
"forEach",
"copy",
"getFileAccess",
"debug"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void copyFiles()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_59 | {
"fields": [
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarFilesystemDao csarDao;",
"type": "CsarFilesystemDao",
"var_name": "csarDao"
},
{
"declarator": "transformationDao",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "preferences",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Preferences preferences;",
"type": "Preferences",
"var_name": "preferences"
},
{
"declarator": "generalCsarsDir",
"modifier": "private",
"original_string": "private File generalCsarsDir;",
"type": "File",
"var_name": "generalCsarsDir"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/csar/CsarFilesystemDaoTest.java",
"identifier": "CsarFilesystemDaoTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void deleteCsarRemovesDataOnDisk() throws Exception {\n String identifier = createFakeCsarDirectories(1)[0];\n csarDao.delete(identifier);\n File csarDir = new File(generalCsarsDir, identifier);\n assertFalse(csarDir.exists());\n }",
"class_method_signature": "CsarFilesystemDaoTest.deleteCsarRemovesDataOnDisk()",
"constructor": false,
"full_signature": "@Test public void deleteCsarRemovesDataOnDisk()",
"identifier": "deleteCsarRemovesDataOnDisk",
"invocations": [
"createFakeCsarDirectories",
"delete",
"assertFalse",
"exists"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void deleteCsarRemovesDataOnDisk()",
"testcase": true
} | {
"fields": [
{
"declarator": "CSARS_DIR = \"csars\"",
"modifier": "public final static",
"original_string": "public final static String CSARS_DIR = \"csars\";",
"type": "String",
"var_name": "CSARS_DIR"
},
{
"declarator": "TRANSFORMATION_DIR = \"transformations\"",
"modifier": "public final static",
"original_string": "public final static String TRANSFORMATION_DIR = \"transformations\";",
"type": "String",
"var_name": "TRANSFORMATION_DIR"
},
{
"declarator": "logger = LoggerFactory.getLogger(CsarFilesystemDao.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(CsarFilesystemDao.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "dataDir",
"modifier": "private final",
"original_string": "private final File dataDir;",
"type": "File",
"var_name": "dataDir"
},
{
"declarator": "csarMap = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, Csar> csarMap = new HashMap<>();",
"type": "Map<String, Csar>",
"var_name": "csarMap"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/csar/CsarFilesystemDao.java",
"identifier": "CsarFilesystemDao",
"interfaces": "implements CsarDao",
"methods": [
{
"class_method_signature": "CsarFilesystemDao.CsarFilesystemDao(Preferences preferences, @Lazy TransformationDao transformationDao)",
"constructor": true,
"full_signature": "@Autowired public CsarFilesystemDao(Preferences preferences, @Lazy TransformationDao transformationDao)",
"identifier": "CsarFilesystemDao",
"modifiers": "@Autowired public",
"parameters": "(Preferences preferences, @Lazy TransformationDao transformationDao)",
"return": "",
"signature": " CsarFilesystemDao(Preferences preferences, @Lazy TransformationDao transformationDao)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.init()",
"constructor": false,
"full_signature": "@PostConstruct public void init()",
"identifier": "init",
"modifiers": "@PostConstruct public",
"parameters": "()",
"return": "void",
"signature": "void init()",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.create(String identifier, InputStream inputStream)",
"constructor": false,
"full_signature": "@Override public Csar create(String identifier, InputStream inputStream)",
"identifier": "create",
"modifiers": "@Override public",
"parameters": "(String identifier, InputStream inputStream)",
"return": "Csar",
"signature": "Csar create(String identifier, InputStream inputStream)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.unzip(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"constructor": false,
"full_signature": "private void unzip(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"identifier": "unzip",
"modifiers": "private",
"parameters": "(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"return": "void",
"signature": "void unzip(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.setupDir(String identifier)",
"constructor": false,
"full_signature": "private File setupDir(String identifier)",
"identifier": "setupDir",
"modifiers": "private",
"parameters": "(String identifier)",
"return": "File",
"signature": "File setupDir(String identifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.delete(String identifier)",
"constructor": false,
"full_signature": "@Override public void delete(String identifier)",
"identifier": "delete",
"modifiers": "@Override public",
"parameters": "(String identifier)",
"return": "void",
"signature": "void delete(String identifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.find(String identifier)",
"constructor": false,
"full_signature": "@Override public Optional<Csar> find(String identifier)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(String identifier)",
"return": "Optional<Csar>",
"signature": "Optional<Csar> find(String identifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.findAll()",
"constructor": false,
"full_signature": "@Override public List<Csar> findAll()",
"identifier": "findAll",
"modifiers": "@Override public",
"parameters": "()",
"return": "List<Csar>",
"signature": "List<Csar> findAll()",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getRootDir(Csar csar)",
"constructor": false,
"full_signature": "@Override public File getRootDir(Csar csar)",
"identifier": "getRootDir",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "File",
"signature": "File getRootDir(Csar csar)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getRootDir(String csarIdentifier)",
"constructor": false,
"full_signature": "private File getRootDir(String csarIdentifier)",
"identifier": "getRootDir",
"modifiers": "private",
"parameters": "(String csarIdentifier)",
"return": "File",
"signature": "File getRootDir(String csarIdentifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getContentDir(Csar csar)",
"constructor": false,
"full_signature": "@Override public File getContentDir(Csar csar)",
"identifier": "getContentDir",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "File",
"signature": "File getContentDir(Csar csar)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getTransformationsDir(Csar csar)",
"constructor": false,
"full_signature": "@Override public File getTransformationsDir(Csar csar)",
"identifier": "getTransformationsDir",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "File",
"signature": "File getTransformationsDir(Csar csar)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.readFromDisk()",
"constructor": false,
"full_signature": "private void readFromDisk()",
"identifier": "readFromDisk",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void readFromDisk()",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.isCsarDir(File file)",
"constructor": false,
"full_signature": "private boolean isCsarDir(File file)",
"identifier": "isCsarDir",
"modifiers": "private",
"parameters": "(File file)",
"return": "boolean",
"signature": "boolean isCsarDir(File file)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getLog(String identifier)",
"constructor": false,
"full_signature": "private Log getLog(String identifier)",
"identifier": "getLog",
"modifiers": "private",
"parameters": "(String identifier)",
"return": "Log",
"signature": "Log getLog(String identifier)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void delete(String identifier) {\n File csarDir = new File(dataDir, identifier);\n try {\n FileUtils.deleteDirectory(csarDir);\n csarMap.remove(identifier);\n logger.info(\"Deleted csar directory '{}'\", csarDir);\n } catch (IOException e) {\n logger.error(\"Failed to delete csar directory with identifier '{}'\", identifier, e);\n }\n }",
"class_method_signature": "CsarFilesystemDao.delete(String identifier)",
"constructor": false,
"full_signature": "@Override public void delete(String identifier)",
"identifier": "delete",
"invocations": [
"deleteDirectory",
"remove",
"info",
"error"
],
"modifiers": "@Override public",
"parameters": "(String identifier)",
"return": "void",
"signature": "void delete(String identifier)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_18 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(CapabilityMapperTest.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(CapabilityMapperTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "expectedEC2",
"modifier": "private",
"original_string": "private String expectedEC2;",
"type": "String",
"var_name": "expectedEC2"
},
{
"declarator": "expectedRDS",
"modifier": "private",
"original_string": "private String expectedRDS;",
"type": "String",
"var_name": "expectedRDS"
},
{
"declarator": "expectedDiskSize",
"modifier": "private",
"original_string": "private int expectedDiskSize;",
"type": "int",
"var_name": "expectedDiskSize"
},
{
"declarator": "capabilityMapper",
"modifier": "private",
"original_string": "private CapabilityMapper capabilityMapper;",
"type": "CapabilityMapper",
"var_name": "capabilityMapper"
},
{
"declarator": "containerCapability",
"modifier": "private",
"original_string": "private ContainerCapability containerCapability;",
"type": "ContainerCapability",
"var_name": "containerCapability"
},
{
"declarator": "osCapability",
"modifier": "private",
"original_string": "private OsCapability osCapability;",
"type": "OsCapability",
"var_name": "osCapability"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/cloudformation/mapper/CapabilityMapperTest.java",
"identifier": "CapabilityMapperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMapComputeCapabilityToInstanceTypeRDS() {\n String instanceType = capabilityMapper.mapComputeCapabilityToInstanceType(containerCapability, RDS_DISTINCTION);\n Assert.assertEquals(instanceType, expectedRDS);\n }",
"class_method_signature": "CapabilityMapperTest.testMapComputeCapabilityToInstanceTypeRDS()",
"constructor": false,
"full_signature": "@Test public void testMapComputeCapabilityToInstanceTypeRDS()",
"identifier": "testMapComputeCapabilityToInstanceTypeRDS",
"invocations": [
"mapComputeCapabilityToInstanceType",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMapComputeCapabilityToInstanceTypeRDS()",
"testcase": true
} | {
"fields": [
{
"declarator": "EC2_DISTINCTION = \"EC2\"",
"modifier": "public static final",
"original_string": "public static final String EC2_DISTINCTION = \"EC2\";",
"type": "String",
"var_name": "EC2_DISTINCTION"
},
{
"declarator": "RDS_DISTINCTION = \"RDS\"",
"modifier": "public static final",
"original_string": "public static final String RDS_DISTINCTION = \"RDS\";",
"type": "String",
"var_name": "RDS_DISTINCTION"
},
{
"declarator": "ARCH_x86_32 = \"i386\"",
"modifier": "private static final",
"original_string": "private static final String ARCH_x86_32 = \"i386\";",
"type": "String",
"var_name": "ARCH_x86_32"
},
{
"declarator": "ARCH_x86_64 = \"x86_64\"",
"modifier": "private static final",
"original_string": "private static final String ARCH_x86_64 = \"x86_64\";",
"type": "String",
"var_name": "ARCH_x86_64"
},
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "EC2_INSTANCE_TYPES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"t2.nano\", 1, 512))\n .add(new InstanceType(\"t2.micro\", 1, 1024))\n .add(new InstanceType(\"t2.small\", 1, 2048))\n .add(new InstanceType(\"t2.medium\", 2, 4096))\n .add(new InstanceType(\"t2.large\", 2, 8192))\n .add(new InstanceType(\"t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"t2.2xlarge\", 8, 32768))\n .build()",
"modifier": "private final",
"original_string": "private final ImmutableList<InstanceType> EC2_INSTANCE_TYPES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"t2.nano\", 1, 512))\n .add(new InstanceType(\"t2.micro\", 1, 1024))\n .add(new InstanceType(\"t2.small\", 1, 2048))\n .add(new InstanceType(\"t2.medium\", 2, 4096))\n .add(new InstanceType(\"t2.large\", 2, 8192))\n .add(new InstanceType(\"t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"t2.2xlarge\", 8, 32768))\n .build();",
"type": "ImmutableList<InstanceType>",
"var_name": "EC2_INSTANCE_TYPES"
},
{
"declarator": "RDS_INSTANCE_CLASSES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"db.t2.micro\", 1, 1024))\n .add(new InstanceType(\"db.t2.small\", 1, 2048))\n .add(new InstanceType(\"db.t2.medium\", 2, 4096))\n .add(new InstanceType(\"db.t2.large\", 2, 8192))\n .add(new InstanceType(\"db.t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"db.t2.2xlarge\", 8, 32768))\n .add(new InstanceType(\"db.m4.4xlarge\", 16, 65536))\n .add(new InstanceType(\"db.m4.10xlarge\", 40, 163840))\n .add(new InstanceType(\"db.m4.16xlarge\", 64, 262144))\n .build()",
"modifier": "private final",
"original_string": "private final ImmutableList<InstanceType> RDS_INSTANCE_CLASSES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"db.t2.micro\", 1, 1024))\n .add(new InstanceType(\"db.t2.small\", 1, 2048))\n .add(new InstanceType(\"db.t2.medium\", 2, 4096))\n .add(new InstanceType(\"db.t2.large\", 2, 8192))\n .add(new InstanceType(\"db.t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"db.t2.2xlarge\", 8, 32768))\n .add(new InstanceType(\"db.m4.4xlarge\", 16, 65536))\n .add(new InstanceType(\"db.m4.10xlarge\", 40, 163840))\n .add(new InstanceType(\"db.m4.16xlarge\", 64, 262144))\n .build();",
"type": "ImmutableList<InstanceType>",
"var_name": "RDS_INSTANCE_CLASSES"
},
{
"declarator": "awsRegion",
"modifier": "private",
"original_string": "private String awsRegion;",
"type": "String",
"var_name": "awsRegion"
},
{
"declarator": "awsCredentials",
"modifier": "private",
"original_string": "private AWSCredentials awsCredentials;",
"type": "AWSCredentials",
"var_name": "awsCredentials"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/cloudformation/mapper/CapabilityMapper.java",
"identifier": "CapabilityMapper",
"interfaces": "",
"methods": [
{
"class_method_signature": "CapabilityMapper.CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"constructor": true,
"full_signature": "public CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"identifier": "CapabilityMapper",
"modifiers": "public",
"parameters": "(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"return": "",
"signature": " CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapOsCapabilityToImageId(OsCapability osCapability)",
"constructor": false,
"full_signature": "public String mapOsCapabilityToImageId(OsCapability osCapability)",
"identifier": "mapOsCapabilityToImageId",
"modifiers": "public",
"parameters": "(OsCapability osCapability)",
"return": "String",
"signature": "String mapOsCapabilityToImageId(OsCapability osCapability)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.processResult(DescribeImagesResult describeImagesResult)",
"constructor": false,
"full_signature": "private String processResult(DescribeImagesResult describeImagesResult)",
"identifier": "processResult",
"modifiers": "private",
"parameters": "(DescribeImagesResult describeImagesResult)",
"return": "String",
"signature": "String processResult(DescribeImagesResult describeImagesResult)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"constructor": false,
"full_signature": "public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"identifier": "mapComputeCapabilityToInstanceType",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability, String distinction)",
"return": "String",
"signature": "String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"constructor": false,
"full_signature": "public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"identifier": "mapComputeCapabilityToRDSAllocatedStorage",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability)",
"return": "Integer",
"signature": "Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"constructor": false,
"full_signature": "public void mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"identifier": "mapDiskSize",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"return": "void",
"signature": "void mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"constructor": false,
"full_signature": "private String findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"identifier": "findCombination",
"modifiers": "private",
"parameters": "(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"return": "String",
"signature": "String findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws\n IllegalArgumentException {\n Integer numCpus = computeCapability.getNumCpus().orElse(0);\n Integer memSize = computeCapability.getMemSizeInMb().orElse(0);\n //default type the smallest\n final ImmutableList<InstanceType> instanceTypes;\n if (EC2_DISTINCTION.equals(distinction)) {\n instanceTypes = EC2_INSTANCE_TYPES;\n } else if (RDS_DISTINCTION.equals(distinction)) {\n instanceTypes = RDS_INSTANCE_CLASSES;\n } else {\n throw new IllegalArgumentException(\"Distinction not supported: \" + distinction);\n }\n List<Integer> allNumCpus = instanceTypes.stream()\n .map(InstanceType::getNumCpus)\n .sorted()\n .collect(Collectors.toList());\n List<Integer> allMemSizes = instanceTypes.stream()\n .map(InstanceType::getMemSize)\n .sorted()\n .collect(Collectors.toList());\n // scale numCpus and memSize upwards if they are not represented in the lists\n try {\n logger.debug(\"Check numCpus: '{}'\", numCpus);\n numCpus = checkValue(numCpus, allNumCpus);\n logger.debug(\"Check memSize: '{}'\", memSize);\n memSize = checkValue(memSize, allMemSizes);\n } catch (IllegalArgumentException ie) {\n logger.error(\"Values numCpus: '{}' and/or memSize: are too big. No InstanceType found\", numCpus, memSize);\n throw ie;\n }\n //get instanceType from combination\n String instanceType = findCombination(numCpus, memSize, instanceTypes, allNumCpus, allMemSizes);\n logger.debug(\"InstanceType is: '{}'\", instanceType);\n return instanceType;\n }",
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"constructor": false,
"full_signature": "public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"identifier": "mapComputeCapabilityToInstanceType",
"invocations": [
"orElse",
"getNumCpus",
"orElse",
"getMemSizeInMb",
"equals",
"equals",
"collect",
"sorted",
"map",
"stream",
"toList",
"collect",
"sorted",
"map",
"stream",
"toList",
"debug",
"checkValue",
"debug",
"checkValue",
"error",
"findCombination",
"debug"
],
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability, String distinction)",
"return": "String",
"signature": "String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_19 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(CapabilityMapperTest.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(CapabilityMapperTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "expectedEC2",
"modifier": "private",
"original_string": "private String expectedEC2;",
"type": "String",
"var_name": "expectedEC2"
},
{
"declarator": "expectedRDS",
"modifier": "private",
"original_string": "private String expectedRDS;",
"type": "String",
"var_name": "expectedRDS"
},
{
"declarator": "expectedDiskSize",
"modifier": "private",
"original_string": "private int expectedDiskSize;",
"type": "int",
"var_name": "expectedDiskSize"
},
{
"declarator": "capabilityMapper",
"modifier": "private",
"original_string": "private CapabilityMapper capabilityMapper;",
"type": "CapabilityMapper",
"var_name": "capabilityMapper"
},
{
"declarator": "containerCapability",
"modifier": "private",
"original_string": "private ContainerCapability containerCapability;",
"type": "ContainerCapability",
"var_name": "containerCapability"
},
{
"declarator": "osCapability",
"modifier": "private",
"original_string": "private OsCapability osCapability;",
"type": "OsCapability",
"var_name": "osCapability"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/cloudformation/mapper/CapabilityMapperTest.java",
"identifier": "CapabilityMapperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMapComputeCapabilityToRDSAllocatedStorage() {\n int newDiskSize = capabilityMapper.mapComputeCapabilityToRDSAllocatedStorage(containerCapability);\n Assert.assertEquals(newDiskSize, expectedDiskSize);\n }",
"class_method_signature": "CapabilityMapperTest.testMapComputeCapabilityToRDSAllocatedStorage()",
"constructor": false,
"full_signature": "@Test public void testMapComputeCapabilityToRDSAllocatedStorage()",
"identifier": "testMapComputeCapabilityToRDSAllocatedStorage",
"invocations": [
"mapComputeCapabilityToRDSAllocatedStorage",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMapComputeCapabilityToRDSAllocatedStorage()",
"testcase": true
} | {
"fields": [
{
"declarator": "EC2_DISTINCTION = \"EC2\"",
"modifier": "public static final",
"original_string": "public static final String EC2_DISTINCTION = \"EC2\";",
"type": "String",
"var_name": "EC2_DISTINCTION"
},
{
"declarator": "RDS_DISTINCTION = \"RDS\"",
"modifier": "public static final",
"original_string": "public static final String RDS_DISTINCTION = \"RDS\";",
"type": "String",
"var_name": "RDS_DISTINCTION"
},
{
"declarator": "ARCH_x86_32 = \"i386\"",
"modifier": "private static final",
"original_string": "private static final String ARCH_x86_32 = \"i386\";",
"type": "String",
"var_name": "ARCH_x86_32"
},
{
"declarator": "ARCH_x86_64 = \"x86_64\"",
"modifier": "private static final",
"original_string": "private static final String ARCH_x86_64 = \"x86_64\";",
"type": "String",
"var_name": "ARCH_x86_64"
},
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "EC2_INSTANCE_TYPES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"t2.nano\", 1, 512))\n .add(new InstanceType(\"t2.micro\", 1, 1024))\n .add(new InstanceType(\"t2.small\", 1, 2048))\n .add(new InstanceType(\"t2.medium\", 2, 4096))\n .add(new InstanceType(\"t2.large\", 2, 8192))\n .add(new InstanceType(\"t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"t2.2xlarge\", 8, 32768))\n .build()",
"modifier": "private final",
"original_string": "private final ImmutableList<InstanceType> EC2_INSTANCE_TYPES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"t2.nano\", 1, 512))\n .add(new InstanceType(\"t2.micro\", 1, 1024))\n .add(new InstanceType(\"t2.small\", 1, 2048))\n .add(new InstanceType(\"t2.medium\", 2, 4096))\n .add(new InstanceType(\"t2.large\", 2, 8192))\n .add(new InstanceType(\"t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"t2.2xlarge\", 8, 32768))\n .build();",
"type": "ImmutableList<InstanceType>",
"var_name": "EC2_INSTANCE_TYPES"
},
{
"declarator": "RDS_INSTANCE_CLASSES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"db.t2.micro\", 1, 1024))\n .add(new InstanceType(\"db.t2.small\", 1, 2048))\n .add(new InstanceType(\"db.t2.medium\", 2, 4096))\n .add(new InstanceType(\"db.t2.large\", 2, 8192))\n .add(new InstanceType(\"db.t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"db.t2.2xlarge\", 8, 32768))\n .add(new InstanceType(\"db.m4.4xlarge\", 16, 65536))\n .add(new InstanceType(\"db.m4.10xlarge\", 40, 163840))\n .add(new InstanceType(\"db.m4.16xlarge\", 64, 262144))\n .build()",
"modifier": "private final",
"original_string": "private final ImmutableList<InstanceType> RDS_INSTANCE_CLASSES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"db.t2.micro\", 1, 1024))\n .add(new InstanceType(\"db.t2.small\", 1, 2048))\n .add(new InstanceType(\"db.t2.medium\", 2, 4096))\n .add(new InstanceType(\"db.t2.large\", 2, 8192))\n .add(new InstanceType(\"db.t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"db.t2.2xlarge\", 8, 32768))\n .add(new InstanceType(\"db.m4.4xlarge\", 16, 65536))\n .add(new InstanceType(\"db.m4.10xlarge\", 40, 163840))\n .add(new InstanceType(\"db.m4.16xlarge\", 64, 262144))\n .build();",
"type": "ImmutableList<InstanceType>",
"var_name": "RDS_INSTANCE_CLASSES"
},
{
"declarator": "awsRegion",
"modifier": "private",
"original_string": "private String awsRegion;",
"type": "String",
"var_name": "awsRegion"
},
{
"declarator": "awsCredentials",
"modifier": "private",
"original_string": "private AWSCredentials awsCredentials;",
"type": "AWSCredentials",
"var_name": "awsCredentials"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/cloudformation/mapper/CapabilityMapper.java",
"identifier": "CapabilityMapper",
"interfaces": "",
"methods": [
{
"class_method_signature": "CapabilityMapper.CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"constructor": true,
"full_signature": "public CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"identifier": "CapabilityMapper",
"modifiers": "public",
"parameters": "(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"return": "",
"signature": " CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapOsCapabilityToImageId(OsCapability osCapability)",
"constructor": false,
"full_signature": "public String mapOsCapabilityToImageId(OsCapability osCapability)",
"identifier": "mapOsCapabilityToImageId",
"modifiers": "public",
"parameters": "(OsCapability osCapability)",
"return": "String",
"signature": "String mapOsCapabilityToImageId(OsCapability osCapability)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.processResult(DescribeImagesResult describeImagesResult)",
"constructor": false,
"full_signature": "private String processResult(DescribeImagesResult describeImagesResult)",
"identifier": "processResult",
"modifiers": "private",
"parameters": "(DescribeImagesResult describeImagesResult)",
"return": "String",
"signature": "String processResult(DescribeImagesResult describeImagesResult)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"constructor": false,
"full_signature": "public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"identifier": "mapComputeCapabilityToInstanceType",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability, String distinction)",
"return": "String",
"signature": "String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"constructor": false,
"full_signature": "public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"identifier": "mapComputeCapabilityToRDSAllocatedStorage",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability)",
"return": "Integer",
"signature": "Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"constructor": false,
"full_signature": "public void mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"identifier": "mapDiskSize",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"return": "void",
"signature": "void mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"constructor": false,
"full_signature": "private String findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"identifier": "findCombination",
"modifiers": "private",
"parameters": "(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"return": "String",
"signature": "String findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability) {\n final Integer minSize = 20;\n final Integer maxSize = 6144;\n Integer diskSize = computeCapability.getDiskSizeInMb().orElse(minSize * 1000);\n diskSize = diskSize / 1000;\n if (diskSize > maxSize) {\n logger.debug(\"Disk size: '{}'\", maxSize);\n return maxSize;\n }\n if (diskSize < minSize) {\n logger.debug(\"Disk size: '{}'\", minSize);\n return minSize;\n }\n logger.debug(\"Disk size: '{}'\", diskSize);\n return diskSize;\n }",
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"constructor": false,
"full_signature": "public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"identifier": "mapComputeCapabilityToRDSAllocatedStorage",
"invocations": [
"orElse",
"getDiskSizeInMb",
"debug",
"debug",
"debug"
],
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability)",
"return": "Integer",
"signature": "Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_58 | {
"fields": [
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarFilesystemDao csarDao;",
"type": "CsarFilesystemDao",
"var_name": "csarDao"
},
{
"declarator": "transformationDao",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "preferences",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Preferences preferences;",
"type": "Preferences",
"var_name": "preferences"
},
{
"declarator": "generalCsarsDir",
"modifier": "private",
"original_string": "private File generalCsarsDir;",
"type": "File",
"var_name": "generalCsarsDir"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/csar/CsarFilesystemDaoTest.java",
"identifier": "CsarFilesystemDaoTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void create() throws Exception {\n String identifier = \"my-csar-checkStateNoPropsSet\";\n File csarFile = TestCsars.VALID_MINIMAL_DOCKER;\n InputStream csarStream = new FileInputStream(csarFile);\n csarDao.create(identifier, csarStream);\n File csarFolder = new File(generalCsarsDir, identifier);\n File contentFolder = new File(csarFolder, CsarImpl.CONTENT_DIR);\n File transformationFolder = new File(csarFolder, CsarFilesystemDao.TRANSFORMATION_DIR);\n assertTrue(contentFolder.isDirectory());\n assertTrue(transformationFolder.isDirectory());\n assertTrue(contentFolder.list().length == 1); // not elegant but lazy..\n }",
"class_method_signature": "CsarFilesystemDaoTest.create()",
"constructor": false,
"full_signature": "@Test public void create()",
"identifier": "create",
"invocations": [
"create",
"assertTrue",
"isDirectory",
"assertTrue",
"isDirectory",
"assertTrue",
"list"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void create()",
"testcase": true
} | {
"fields": [
{
"declarator": "CSARS_DIR = \"csars\"",
"modifier": "public final static",
"original_string": "public final static String CSARS_DIR = \"csars\";",
"type": "String",
"var_name": "CSARS_DIR"
},
{
"declarator": "TRANSFORMATION_DIR = \"transformations\"",
"modifier": "public final static",
"original_string": "public final static String TRANSFORMATION_DIR = \"transformations\";",
"type": "String",
"var_name": "TRANSFORMATION_DIR"
},
{
"declarator": "logger = LoggerFactory.getLogger(CsarFilesystemDao.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(CsarFilesystemDao.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "dataDir",
"modifier": "private final",
"original_string": "private final File dataDir;",
"type": "File",
"var_name": "dataDir"
},
{
"declarator": "csarMap = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, Csar> csarMap = new HashMap<>();",
"type": "Map<String, Csar>",
"var_name": "csarMap"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/csar/CsarFilesystemDao.java",
"identifier": "CsarFilesystemDao",
"interfaces": "implements CsarDao",
"methods": [
{
"class_method_signature": "CsarFilesystemDao.CsarFilesystemDao(Preferences preferences, @Lazy TransformationDao transformationDao)",
"constructor": true,
"full_signature": "@Autowired public CsarFilesystemDao(Preferences preferences, @Lazy TransformationDao transformationDao)",
"identifier": "CsarFilesystemDao",
"modifiers": "@Autowired public",
"parameters": "(Preferences preferences, @Lazy TransformationDao transformationDao)",
"return": "",
"signature": " CsarFilesystemDao(Preferences preferences, @Lazy TransformationDao transformationDao)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.init()",
"constructor": false,
"full_signature": "@PostConstruct public void init()",
"identifier": "init",
"modifiers": "@PostConstruct public",
"parameters": "()",
"return": "void",
"signature": "void init()",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.create(String identifier, InputStream inputStream)",
"constructor": false,
"full_signature": "@Override public Csar create(String identifier, InputStream inputStream)",
"identifier": "create",
"modifiers": "@Override public",
"parameters": "(String identifier, InputStream inputStream)",
"return": "Csar",
"signature": "Csar create(String identifier, InputStream inputStream)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.unzip(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"constructor": false,
"full_signature": "private void unzip(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"identifier": "unzip",
"modifiers": "private",
"parameters": "(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"return": "void",
"signature": "void unzip(String identifier, InputStream inputStream, Csar csar, File csarDir)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.setupDir(String identifier)",
"constructor": false,
"full_signature": "private File setupDir(String identifier)",
"identifier": "setupDir",
"modifiers": "private",
"parameters": "(String identifier)",
"return": "File",
"signature": "File setupDir(String identifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.delete(String identifier)",
"constructor": false,
"full_signature": "@Override public void delete(String identifier)",
"identifier": "delete",
"modifiers": "@Override public",
"parameters": "(String identifier)",
"return": "void",
"signature": "void delete(String identifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.find(String identifier)",
"constructor": false,
"full_signature": "@Override public Optional<Csar> find(String identifier)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(String identifier)",
"return": "Optional<Csar>",
"signature": "Optional<Csar> find(String identifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.findAll()",
"constructor": false,
"full_signature": "@Override public List<Csar> findAll()",
"identifier": "findAll",
"modifiers": "@Override public",
"parameters": "()",
"return": "List<Csar>",
"signature": "List<Csar> findAll()",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getRootDir(Csar csar)",
"constructor": false,
"full_signature": "@Override public File getRootDir(Csar csar)",
"identifier": "getRootDir",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "File",
"signature": "File getRootDir(Csar csar)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getRootDir(String csarIdentifier)",
"constructor": false,
"full_signature": "private File getRootDir(String csarIdentifier)",
"identifier": "getRootDir",
"modifiers": "private",
"parameters": "(String csarIdentifier)",
"return": "File",
"signature": "File getRootDir(String csarIdentifier)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getContentDir(Csar csar)",
"constructor": false,
"full_signature": "@Override public File getContentDir(Csar csar)",
"identifier": "getContentDir",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "File",
"signature": "File getContentDir(Csar csar)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getTransformationsDir(Csar csar)",
"constructor": false,
"full_signature": "@Override public File getTransformationsDir(Csar csar)",
"identifier": "getTransformationsDir",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "File",
"signature": "File getTransformationsDir(Csar csar)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.readFromDisk()",
"constructor": false,
"full_signature": "private void readFromDisk()",
"identifier": "readFromDisk",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void readFromDisk()",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.isCsarDir(File file)",
"constructor": false,
"full_signature": "private boolean isCsarDir(File file)",
"identifier": "isCsarDir",
"modifiers": "private",
"parameters": "(File file)",
"return": "boolean",
"signature": "boolean isCsarDir(File file)",
"testcase": false
},
{
"class_method_signature": "CsarFilesystemDao.getLog(String identifier)",
"constructor": false,
"full_signature": "private Log getLog(String identifier)",
"identifier": "getLog",
"modifiers": "private",
"parameters": "(String identifier)",
"return": "Log",
"signature": "Log getLog(String identifier)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Csar create(String identifier, InputStream inputStream) {\n csarMap.remove(identifier);\n File csarDir = setupDir(identifier);\n Csar csar = new CsarImpl(getRootDir(identifier), identifier, getLog(identifier));\n File transformationDir = new File(csarDir, TRANSFORMATION_DIR);\n transformationDir.mkdir();\n unzip(identifier, inputStream, csar, csarDir);\n csarMap.put(identifier, csar);\n return csar;\n }",
"class_method_signature": "CsarFilesystemDao.create(String identifier, InputStream inputStream)",
"constructor": false,
"full_signature": "@Override public Csar create(String identifier, InputStream inputStream)",
"identifier": "create",
"invocations": [
"remove",
"setupDir",
"getRootDir",
"getLog",
"mkdir",
"unzip",
"put"
],
"modifiers": "@Override public",
"parameters": "(String identifier, InputStream inputStream)",
"return": "Csar",
"signature": "Csar create(String identifier, InputStream inputStream)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_23 | {
"fields": [
{
"declarator": "bashScript",
"modifier": "private",
"original_string": "private BashScript bashScript;",
"type": "BashScript",
"var_name": "bashScript"
},
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "targetScriptFolder",
"modifier": "private",
"original_string": "private File targetScriptFolder;",
"type": "File",
"var_name": "targetScriptFolder"
},
{
"declarator": "fileName",
"modifier": "private",
"original_string": "private String fileName;",
"type": "String",
"var_name": "fileName"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/scripts/BashScriptTest.java",
"identifier": "BashScriptTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void appendTest() throws IOException {\n String string = UUID.randomUUID().toString();\n bashScript.append(string);\n File expectedGeneratedScript = new File(targetScriptFolder, fileName + \".sh\");\n List<String> result = IOUtils.readLines(new FileInputStream(expectedGeneratedScript));\n assertEquals(string, result.get(result.size() - 1));\n }",
"class_method_signature": "BashScriptTest.appendTest()",
"constructor": false,
"full_signature": "@Test public void appendTest()",
"identifier": "appendTest",
"invocations": [
"toString",
"randomUUID",
"append",
"readLines",
"assertEquals",
"get",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void appendTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "SHEBANG = \"#!/bin/bash\"",
"modifier": "public static final",
"original_string": "public static final String SHEBANG = \"#!/bin/bash\";",
"type": "String",
"var_name": "SHEBANG"
},
{
"declarator": "SOURCE_UTIL_ALL = \"for file in $(ls util); do source util/$file; done\"",
"modifier": "public static final",
"original_string": "public static final String SOURCE_UTIL_ALL = \"for file in $(ls util); do source util/$file; done\";",
"type": "String",
"var_name": "SOURCE_UTIL_ALL"
},
{
"declarator": "SUBCOMMAND_EXIT = \"set -e\"",
"modifier": "public static final",
"original_string": "public static final String SUBCOMMAND_EXIT = \"set -e\";",
"type": "String",
"var_name": "SUBCOMMAND_EXIT"
},
{
"declarator": "logger = LoggerFactory.getLogger(BashScript.class)",
"modifier": "protected final static",
"original_string": "protected final static Logger logger = LoggerFactory.getLogger(BashScript.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "name",
"modifier": "protected",
"original_string": "protected String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "access",
"modifier": "protected",
"original_string": "protected PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "scriptPath",
"modifier": "protected",
"original_string": "protected String scriptPath;",
"type": "String",
"var_name": "scriptPath"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/scripts/BashScript.java",
"identifier": "BashScript",
"interfaces": "",
"methods": [
{
"class_method_signature": "BashScript.BashScript(PluginFileAccess access, String name)",
"constructor": true,
"full_signature": "public BashScript(PluginFileAccess access, String name)",
"identifier": "BashScript",
"modifiers": "public",
"parameters": "(PluginFileAccess access, String name)",
"return": "",
"signature": " BashScript(PluginFileAccess access, String name)",
"testcase": false
},
{
"class_method_signature": "BashScript.setUpScript()",
"constructor": false,
"full_signature": "protected void setUpScript()",
"identifier": "setUpScript",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void setUpScript()",
"testcase": false
},
{
"class_method_signature": "BashScript.append(String string)",
"constructor": false,
"full_signature": "public void append(String string)",
"identifier": "append",
"modifiers": "public",
"parameters": "(String string)",
"return": "void",
"signature": "void append(String string)",
"testcase": false
},
{
"class_method_signature": "BashScript.checkEnvironment(String command)",
"constructor": false,
"full_signature": "public void checkEnvironment(String command)",
"identifier": "checkEnvironment",
"modifiers": "public",
"parameters": "(String command)",
"return": "void",
"signature": "void checkEnvironment(String command)",
"testcase": false
},
{
"class_method_signature": "BashScript.getScriptPath()",
"constructor": false,
"full_signature": "public String getScriptPath()",
"identifier": "getScriptPath",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getScriptPath()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void append(String string) throws IOException {\n logger.debug(\"Appending {} to {}.sh\", string, name);\n access.access(scriptPath).appendln(string).close();\n }",
"class_method_signature": "BashScript.append(String string)",
"constructor": false,
"full_signature": "public void append(String string)",
"identifier": "append",
"invocations": [
"debug",
"close",
"appendln",
"access"
],
"modifiers": "public",
"parameters": "(String string)",
"return": "void",
"signature": "void append(String string)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_62 | {
"fields": [
{
"declarator": "graphMap = new HashMap<>()",
"modifier": "private final static",
"original_string": "private final static Map<File, ServiceGraph> graphMap = new HashMap<>();",
"type": "Map<File, ServiceGraph>",
"var_name": "graphMap"
},
{
"declarator": "currentFile",
"modifier": "private",
"original_string": "private File currentFile;",
"type": "File",
"var_name": "currentFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/parse/model/ServiceGraphTest.java",
"identifier": "ServiceGraphTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void requirementTest() {\n currentFile = REQUIREMENT;\n Optional<Entity> fulfiller = getGraph().getEntity(Lists.newArrayList(\"topology_template\",\n \"node_templates\", \"test-node\", \"requirements\", \"test-requirement1\", \"node\"));\n assertTrue(fulfiller.isPresent());\n Optional<Entity> fulfiller2 = getGraph().getEntity(Lists.newArrayList(\"topology_template\",\n \"node_templates\", \"test-node\", \"requirements\", \"test-requirement2\", \"node\"));\n assertTrue(fulfiller2.isPresent());\n MappingEntity capabilityEntity = (MappingEntity) getGraph().getEntity(new EntityId(Lists.newArrayList(\n \"topology_template\", \"node_templates\", \"test-node\", \"requirements\", \n \"test-requirement2\", \"capability\"))).get();\n DatabaseEndpointCapability capability = TypeWrapper.wrapTypedElement(capabilityEntity);\n assertNotNull(capability);\n MappingEntity relationshipEntity = (MappingEntity) getGraph().getEntity(new EntityId(Lists.newArrayList(\n \"topology_template\", \"node_templates\", \"test-node\", \"requirements\",\n \"test-requirement2\", \"relationship\"))).get();\n ConnectsTo relationship = TypeWrapper.wrapTypedElement(relationshipEntity);\n assertNotNull(relationship);\n assertEquals(Lists.newArrayList(\"1\", \"2\"), getList(\"topology_template\", \"node_templates\", \"test-node\", \"requirements\",\n \"test-requirement2\", \"occurrences\"));\n }",
"class_method_signature": "ServiceGraphTest.requirementTest()",
"constructor": false,
"full_signature": "@Test public void requirementTest()",
"identifier": "requirementTest",
"invocations": [
"getEntity",
"getGraph",
"newArrayList",
"assertTrue",
"isPresent",
"getEntity",
"getGraph",
"newArrayList",
"assertTrue",
"isPresent",
"get",
"getEntity",
"getGraph",
"newArrayList",
"wrapTypedElement",
"assertNotNull",
"get",
"getEntity",
"getGraph",
"newArrayList",
"wrapTypedElement",
"assertNotNull",
"assertEquals",
"newArrayList",
"getList"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void requirementTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "private final",
"original_string": "private final MappingEntity root;",
"type": "MappingEntity",
"var_name": "root"
},
{
"declarator": "log",
"modifier": "private final",
"original_string": "private final Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "finalized = false",
"modifier": "private",
"original_string": "private boolean finalized = false;",
"type": "boolean",
"var_name": "finalized"
},
{
"declarator": "inputs",
"modifier": "private",
"original_string": "private Map<String, InputProperty> inputs;",
"type": "Map<String, InputProperty>",
"var_name": "inputs"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/parse/model/ServiceGraph.java",
"identifier": "ServiceGraph",
"interfaces": "",
"methods": [
{
"class_method_signature": "ServiceGraph.ServiceGraph(Log log)",
"constructor": true,
"full_signature": "public ServiceGraph(Log log)",
"identifier": "ServiceGraph",
"modifiers": "public",
"parameters": "(Log log)",
"return": "",
"signature": " ServiceGraph(Log log)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.ServiceGraph(File template, Log log)",
"constructor": true,
"full_signature": "public ServiceGraph(File template, Log log)",
"identifier": "ServiceGraph",
"modifiers": "public",
"parameters": "(File template, Log log)",
"return": "",
"signature": " ServiceGraph(File template, Log log)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.populateGraph(Node node, EntityId id)",
"constructor": false,
"full_signature": "private void populateGraph(Node node, EntityId id)",
"identifier": "populateGraph",
"modifiers": "private",
"parameters": "(Node node, EntityId id)",
"return": "void",
"signature": "void populateGraph(Node node, EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.finalizeGraph()",
"constructor": false,
"full_signature": "public void finalizeGraph()",
"identifier": "finalizeGraph",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void finalizeGraph()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.inputsValid()",
"constructor": false,
"full_signature": "public boolean inputsValid()",
"identifier": "inputsValid",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean inputsValid()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getInputs()",
"constructor": false,
"full_signature": "public Map<String, InputProperty> getInputs()",
"identifier": "getInputs",
"modifiers": "public",
"parameters": "()",
"return": "Map<String, InputProperty>",
"signature": "Map<String, InputProperty> getInputs()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getOutputs()",
"constructor": false,
"full_signature": "public Map<String, OutputProperty> getOutputs()",
"identifier": "getOutputs",
"modifiers": "public",
"parameters": "()",
"return": "Map<String, OutputProperty>",
"signature": "Map<String, OutputProperty> getOutputs()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.addEntity(Entity entity)",
"constructor": false,
"full_signature": "public void addEntity(Entity entity)",
"identifier": "addEntity",
"modifiers": "public",
"parameters": "(Entity entity)",
"return": "void",
"signature": "void addEntity(Entity entity)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getEntity(List<String> path)",
"constructor": false,
"full_signature": "public Optional<Entity> getEntity(List<String> path)",
"identifier": "getEntity",
"modifiers": "public",
"parameters": "(List<String> path)",
"return": "Optional<Entity>",
"signature": "Optional<Entity> getEntity(List<String> path)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getEntity(EntityId id)",
"constructor": false,
"full_signature": "public Optional<Entity> getEntity(EntityId id)",
"identifier": "getEntity",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Optional<Entity>",
"signature": "Optional<Entity> getEntity(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getEntityOrThrow(EntityId id)",
"constructor": false,
"full_signature": "public Entity getEntityOrThrow(EntityId id)",
"identifier": "getEntityOrThrow",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Entity",
"signature": "Entity getEntityOrThrow(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.iterator(EntityId id)",
"constructor": false,
"full_signature": "public Iterator<Entity> iterator(EntityId id)",
"identifier": "iterator",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Iterator<Entity>",
"signature": "Iterator<Entity> iterator(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.replaceEntity(Entity source, Entity target)",
"constructor": false,
"full_signature": "public void replaceEntity(Entity source, Entity target)",
"identifier": "replaceEntity",
"modifiers": "public",
"parameters": "(Entity source, Entity target)",
"return": "void",
"signature": "void replaceEntity(Entity source, Entity target)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.addConnection(Entity source, Entity target, String connectionName)",
"constructor": false,
"full_signature": "public void addConnection(Entity source, Entity target, String connectionName)",
"identifier": "addConnection",
"modifiers": "public",
"parameters": "(Entity source, Entity target, String connectionName)",
"return": "void",
"signature": "void addConnection(Entity source, Entity target, String connectionName)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getChildren(EntityId id)",
"constructor": false,
"full_signature": "public Collection<Entity> getChildren(EntityId id)",
"identifier": "getChildren",
"modifiers": "public",
"parameters": "(EntityId id)",
"return": "Collection<Entity>",
"signature": "Collection<Entity> getChildren(EntityId id)",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getLogger()",
"constructor": false,
"full_signature": "public Logger getLogger()",
"identifier": "getLogger",
"modifiers": "public",
"parameters": "()",
"return": "Logger",
"signature": "Logger getLogger()",
"testcase": false
},
{
"class_method_signature": "ServiceGraph.getLog()",
"constructor": false,
"full_signature": "public Log getLog()",
"identifier": "getLog",
"modifiers": "public",
"parameters": "()",
"return": "Log",
"signature": "Log getLog()",
"testcase": false
}
],
"superclass": "extends SimpleDirectedGraph<Entity, Connection>"
} | {
"body": "public Optional<Entity> getEntity(List<String> path) {\n Entity current = root;\n for (String segment : path) {\n Optional<Entity> child = current.getChild(segment);\n if (child.isPresent()) {\n current = child.get();\n } else {\n return Optional.empty();\n }\n }\n return Optional.of(current);\n }",
"class_method_signature": "ServiceGraph.getEntity(List<String> path)",
"constructor": false,
"full_signature": "public Optional<Entity> getEntity(List<String> path)",
"identifier": "getEntity",
"invocations": [
"getChild",
"isPresent",
"get",
"empty",
"of"
],
"modifiers": "public",
"parameters": "(List<String> path)",
"return": "Optional<Entity>",
"signature": "Optional<Entity> getEntity(List<String> path)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_35 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void getAbsolutePathSuccess() throws IOException {\n String filename = \"some-source-file\";\n File sourceFile = new File(targetDir, filename);\n sourceFile.createNewFile();\n\n String result = access.getAbsolutePath(filename);\n assertEquals(sourceFile.getAbsolutePath(), result);\n }",
"class_method_signature": "PluginFileAccessTest.getAbsolutePathSuccess()",
"constructor": false,
"full_signature": "@Test public void getAbsolutePathSuccess()",
"identifier": "getAbsolutePathSuccess",
"invocations": [
"createNewFile",
"getAbsolutePath",
"assertEquals",
"getAbsolutePath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getAbsolutePathSuccess()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String getAbsolutePath(String relativePath) throws FileNotFoundException {\n File targetFile = new File(targetDir, relativePath);\n if (targetFile.exists()) {\n return targetFile.getAbsolutePath();\n } else {\n throw new FileNotFoundException(String.format(\"File '%s' not found\", targetFile));\n }\n }",
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"invocations": [
"exists",
"getAbsolutePath",
"format"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_42 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LogImplTest.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(LogImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "log",
"modifier": "private",
"original_string": "private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logfile",
"modifier": "private",
"original_string": "private File logfile;",
"type": "File",
"var_name": "logfile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/logging/LogImplTest.java",
"identifier": "LogImplTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void getFirstTenLogEntries() throws Exception {\n logger.info(\"Trying to log from index 0 to 10\");\n List<LogEntry> logs = log.getLogEntries(0, 9);\n logger.info(\"Checking length\");\n assertSame(10, logs.size());\n logger.info(\"Checking data\");\n for (int i = 0; i < logs.size(); i++) {\n LogEntry e = logs.get(i);\n assertEquals(String.format(\"Log-Message-%d\", i), e.getMessage());\n }\n logger.info(\"Done\");\n }",
"class_method_signature": "LogImplTest.getFirstTenLogEntries()",
"constructor": false,
"full_signature": "@Test public void getFirstTenLogEntries()",
"identifier": "getFirstTenLogEntries",
"invocations": [
"info",
"getLogEntries",
"info",
"assertSame",
"size",
"info",
"size",
"get",
"assertEquals",
"format",
"getMessage",
"info"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getFirstTenLogEntries()",
"testcase": true
} | {
"fields": [
{
"declarator": "exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class)",
"modifier": "private final static",
"original_string": "private final static org.slf4j.Logger exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "exceptionHandlingLogger"
},
{
"declarator": "logEntries = Collections.synchronizedList(new LinkedList<>())",
"modifier": "private final",
"original_string": "private final List<LogEntry> logEntries = Collections.synchronizedList(new LinkedList<>());",
"type": "List<LogEntry>",
"var_name": "logEntries"
},
{
"declarator": "index = new AtomicLong(0)",
"modifier": "private final",
"original_string": "private final AtomicLong index = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "index"
},
{
"declarator": "memoryAppender = new MemoryAppender(this)",
"modifier": "private final",
"original_string": "private final MemoryAppender memoryAppender = new MemoryAppender(this);",
"type": "MemoryAppender",
"var_name": "memoryAppender"
},
{
"declarator": "persistentAppender",
"modifier": "private final",
"original_string": "private final PersistentAppender persistentAppender;",
"type": "PersistentAppender",
"var_name": "persistentAppender"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/logging/LogImpl.java",
"identifier": "LogImpl",
"interfaces": "implements Log",
"methods": [
{
"class_method_signature": "LogImpl.LogImpl(File logFile)",
"constructor": true,
"full_signature": "public LogImpl(File logFile)",
"identifier": "LogImpl",
"modifiers": "public",
"parameters": "(File logFile)",
"return": "",
"signature": " LogImpl(File logFile)",
"testcase": false
},
{
"class_method_signature": "LogImpl.readLogFromFile(File file)",
"constructor": false,
"full_signature": "private void readLogFromFile(File file)",
"identifier": "readLogFromFile",
"modifiers": "private",
"parameters": "(File file)",
"return": "void",
"signature": "void readLogFromFile(File file)",
"testcase": false
},
{
"class_method_signature": "LogImpl.addLogEntry(LogEntry e)",
"constructor": false,
"full_signature": "@Override public void addLogEntry(LogEntry e)",
"identifier": "addLogEntry",
"modifiers": "@Override public",
"parameters": "(LogEntry e)",
"return": "void",
"signature": "void addLogEntry(LogEntry e)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last, boolean checkUpperBound)",
"constructor": false,
"full_signature": "private List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"identifier": "getLogEntries",
"modifiers": "private",
"parameters": "(int first, int last, boolean checkUpperBound)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int firstIndex)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int firstIndex)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int firstIndex)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int firstIndex)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(String context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(String context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(String context)",
"return": "Logger",
"signature": "Logger getLogger(String context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(Class context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(Class context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(Class context)",
"return": "Logger",
"signature": "Logger getLogger(Class context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public List<LogEntry> getLogEntries(int first, int last) {\n return getLogEntries(first, last, true);\n }",
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"invocations": [
"getLogEntries"
],
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_15 | {
"fields": [
{
"declarator": "entityId = new EntityId(Lists.newArrayList(\"my\", \"id\"))",
"modifier": "private static",
"original_string": "private static EntityId entityId = new EntityId(Lists.newArrayList(\"my\", \"id\"));",
"type": "EntityId",
"var_name": "entityId"
},
{
"declarator": "entity",
"modifier": "private static",
"original_string": "private static MappingEntity entity;",
"type": "MappingEntity",
"var_name": "entity"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/kubernetes/docker/mapper/MapperUtilsTest.java",
"identifier": "MapperUtilsTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void testOneSet() {\n assertTrue(anythingSet(new OsCapability(entity).setType(Type.LINUX)));\n }",
"class_method_signature": "MapperUtilsTest.testOneSet()",
"constructor": false,
"full_signature": "@Test public void testOneSet()",
"identifier": "testOneSet",
"invocations": [
"assertTrue",
"anythingSet",
"setType"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testOneSet()",
"testcase": true
} | {
"fields": [
{
"declarator": "TAG_COMPARATOR_MINOR_VERSION =\n Comparator.comparing(DockerImageTag::toVersion)",
"modifier": "public static final",
"original_string": "public static final Comparator<DockerImageTag> TAG_COMPARATOR_MINOR_VERSION =\n Comparator.comparing(DockerImageTag::toVersion);",
"type": "Comparator<DockerImageTag>",
"var_name": "TAG_COMPARATOR_MINOR_VERSION"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/kubernetes/docker/mapper/MapperUtils.java",
"identifier": "MapperUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MapperUtils.anythingSet(OsCapability capability)",
"constructor": false,
"full_signature": "public static boolean anythingSet(OsCapability capability)",
"identifier": "anythingSet",
"modifiers": "public static",
"parameters": "(OsCapability capability)",
"return": "boolean",
"signature": "boolean anythingSet(OsCapability capability)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static boolean anythingSet(OsCapability capability) {\n Optional[] optionals = {\n capability.getDistribution(),\n capability.getArchitecture(),\n capability.getType(),\n capability.getVersion()\n };\n return Arrays.stream(optionals).anyMatch(Optional::isPresent);\n }",
"class_method_signature": "MapperUtils.anythingSet(OsCapability capability)",
"constructor": false,
"full_signature": "public static boolean anythingSet(OsCapability capability)",
"identifier": "anythingSet",
"invocations": [
"getDistribution",
"getArchitecture",
"getType",
"getVersion",
"anyMatch",
"stream"
],
"modifiers": "public static",
"parameters": "(OsCapability capability)",
"return": "boolean",
"signature": "boolean anythingSet(OsCapability capability)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_54 | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private",
"original_string": "private TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "platformService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
},
{
"declarator": "transformation",
"modifier": "private",
"original_string": "private Transformation transformation;",
"type": "Transformation",
"var_name": "transformation"
},
{
"declarator": "transformationRootDir",
"modifier": "private",
"original_string": "private File transformationRootDir;",
"type": "File",
"var_name": "transformationRootDir"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDaoTest.java",
"identifier": "TransformationFilesystemDaoTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void delete() {\n // create some random files in transformation1 dir of csar1\n createRandomFiles(transformationRootDir);\n\n transformationDao.delete(transformation);\n // check if all files got deleted \n assertFalse(transformationRootDir.exists());\n }",
"class_method_signature": "TransformationFilesystemDaoTest.delete()",
"constructor": false,
"full_signature": "@Test public void delete()",
"identifier": "delete",
"invocations": [
"createRandomFiles",
"delete",
"assertFalse",
"exists"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void delete()",
"testcase": true
} | {
"fields": [
{
"declarator": "ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_FAILED_REGEX"
},
{
"declarator": "ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_SUCCESSFUL_REGEX"
},
{
"declarator": "CONTENT_DIR = \"content\"",
"modifier": "public final static",
"original_string": "public final static String CONTENT_DIR = \"content\";",
"type": "String",
"var_name": "CONTENT_DIR"
},
{
"declarator": "FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\")",
"modifier": "private final static",
"original_string": "private final static SimpleDateFormat FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\");",
"type": "SimpleDateFormat",
"var_name": "FORMAT"
},
{
"declarator": "FAILED = \"_failed\"",
"modifier": "private final static",
"original_string": "private final static String FAILED = \"_failed\";",
"type": "String",
"var_name": "FAILED"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationFilesystemDao.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(TransformationFilesystemDao.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "effectiveModelFactory",
"modifier": "private final",
"original_string": "private final EffectiveModelFactory effectiveModelFactory;",
"type": "EffectiveModelFactory",
"var_name": "effectiveModelFactory"
},
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDao.java",
"identifier": "TransformationFilesystemDao",
"interfaces": "implements TransformationDao",
"methods": [
{
"class_method_signature": "TransformationFilesystemDao.TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"constructor": true,
"full_signature": "@Autowired public TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"identifier": "TransformationFilesystemDao",
"modifiers": "@Autowired public",
"parameters": "(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"return": "",
"signature": " TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.create(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Transformation create(Csar csar, Platform platform)",
"identifier": "create",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation create(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTransformation(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Transformation createTransformation(Csar csar, Platform platform)",
"identifier": "createTransformation",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public void delete(Transformation transformation)",
"identifier": "delete",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void delete(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(File transformationDir)",
"constructor": false,
"full_signature": "private void delete(File transformationDir)",
"identifier": "delete",
"modifiers": "private",
"parameters": "(File transformationDir)",
"return": "void",
"signature": "void delete(File transformationDir)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Optional<Transformation> find(Csar csar, Platform platform)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Optional<Transformation>",
"signature": "Optional<Transformation> find(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar)",
"constructor": false,
"full_signature": "@Override public List<Transformation> find(Csar csar)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "List<Transformation>",
"signature": "List<Transformation> find(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readFromDisk(Csar csar)",
"constructor": false,
"full_signature": "private Set<Transformation> readFromDisk(Csar csar)",
"identifier": "readFromDisk",
"modifiers": "private",
"parameters": "(Csar csar)",
"return": "Set<Transformation>",
"signature": "Set<Transformation> readFromDisk(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readTargetArtifactFromDisk(Transformation transformation)",
"constructor": false,
"full_signature": "private void readTargetArtifactFromDisk(Transformation transformation)",
"identifier": "readTargetArtifactFromDisk",
"modifiers": "private",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void readTargetArtifactFromDisk(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTargetArtifact(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public TargetArtifact createTargetArtifact(Transformation transformation)",
"identifier": "createTargetArtifact",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "TargetArtifact",
"signature": "TargetArtifact createTargetArtifact(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getRootDir(Transformation transformation)",
"identifier": "getRootDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getRootDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getRootDir(Csar csar, Platform platform)",
"identifier": "getRootDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getRootDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getContentDir(Transformation transformation)",
"identifier": "getContentDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getContentDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getContentDir(Csar csar, Platform platform)",
"identifier": "getContentDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getContentDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.setCsarDao(CsarDao csarDao)",
"constructor": false,
"full_signature": "@Override public void setCsarDao(CsarDao csarDao)",
"identifier": "setCsarDao",
"modifiers": "@Override public",
"parameters": "(CsarDao csarDao)",
"return": "void",
"signature": "void setCsarDao(CsarDao csarDao)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getLog(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Log getLog(Csar csar, Platform platform)",
"identifier": "getLog",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Log",
"signature": "Log getLog(Csar csar, Platform platform)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void delete(Transformation transformation) {\n transformation.getCsar().getTransformations().remove(transformation.getPlatform().id);\n File transformationDir = getRootDir(transformation);\n delete(transformationDir);\n }",
"class_method_signature": "TransformationFilesystemDao.delete(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public void delete(Transformation transformation)",
"identifier": "delete",
"invocations": [
"remove",
"getTransformations",
"getCsar",
"getPlatform",
"getRootDir",
"delete"
],
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void delete(Transformation transformation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_2 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void testGetOutputs() throws Exception {\n List<Transformation> transformations = preInitNonCreationTests();\n Transformation t = transformations.get(0);\n when(t.getState()).thenReturn(TransformationState.DONE);\n String outputKey = \"test_output\";\n List<OutputProperty> outputs = Lists.newArrayList(new PlatformInput(\n outputKey,\n PropertyType.TEXT,\n \"\",\n true,\n \"some value\"\n ));\n when(t.getOutputs()).thenReturn(outputs);\n mvc.perform(get(GET_OUTPUT_URL))\n .andDo(print())\n .andExpect(status().is(200))\n .andExpect(jsonPath(\"$.outputs\").isArray())\n .andExpect(jsonPath(\"$.links[0].href\").value(\"http://localhost\" + GET_OUTPUT_URL))\n .andExpect(jsonPath(\"$.outputs[0].key\").value(outputKey))\n .andReturn();\n }",
"class_method_signature": "TransformationControllerTest.testGetOutputs()",
"constructor": false,
"full_signature": "@Test public void testGetOutputs()",
"identifier": "testGetOutputs",
"invocations": [
"preInitNonCreationTests",
"get",
"thenReturn",
"when",
"getState",
"newArrayList",
"thenReturn",
"when",
"getOutputs",
"andReturn",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andDo",
"perform",
"get",
"print",
"is",
"status",
"isArray",
"jsonPath",
"value",
"jsonPath",
"value",
"jsonPath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetOutputs()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@ApiOperation(\n value = \"Retrieve the outputs and their values\",\n tags = {\"transformations\"},\n notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" +\n \"if the transformation (including deployment) is not done yet\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\",\n response = GetOutputsResponse.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a transformation for the specified platform\",\n response = RestErrorResponse.class\n ),\n @ApiResponse(\n code = 400,\n message = \"The state of the transformation is invalid (not ERROR or DONE)\",\n response = RestErrorResponse.class\n )\n })\n @RequestMapping(\n path = \"/{platform}/outputs\",\n method = {RequestMethod.GET},\n produces = \"application/hal+json\"\n )\n public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n ) {\n Csar csar = findByCsarId(csarId);\n Transformation transformation = findTransformationByPlatform(csar, platformId);\n if (transformation.getState() != TransformationState.DONE && transformation.getState() != TransformationState.ERROR) {\n throw new IllegalTransformationStateException(\"The Transformation has not finished yet!\");\n }\n List<OutputProperty> outputs = transformation.getOutputs();\n List<OutputWrap> wrappedOutputs = outputs.stream()\n .map(OutputWrap::new)\n .collect(Collectors.toList());\n return ResponseEntity.ok(new GetOutputsResponse(csarId, platformId, wrappedOutputs));\n }",
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"invocations": [
"findByCsarId",
"findTransformationByPlatform",
"getState",
"getState",
"getOutputs",
"collect",
"map",
"stream",
"toList",
"ok"
],
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_39 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LogImplTest.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(LogImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "log",
"modifier": "private",
"original_string": "private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logfile",
"modifier": "private",
"original_string": "private File logfile;",
"type": "File",
"var_name": "logfile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/logging/LogImplTest.java",
"identifier": "LogImplTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void getAllLogEntries() throws Exception {\n logger.info(\"Trying to retrieve complete log\");\n List<LogEntry> logs = log.getLogEntries(0);\n logger.info(\"Checking length\");\n assertTrue(logs.size() == 100);\n logger.info(\"Checking data\");\n for (int i = 0; i < logs.size(); i++) {\n LogEntry e = logs.get(i);\n assertEquals((String.format(\"Log-Message-%d\", i)), e.getMessage());\n }\n logger.info(\"Done\");\n }",
"class_method_signature": "LogImplTest.getAllLogEntries()",
"constructor": false,
"full_signature": "@Test public void getAllLogEntries()",
"identifier": "getAllLogEntries",
"invocations": [
"info",
"getLogEntries",
"info",
"assertTrue",
"size",
"info",
"size",
"get",
"assertEquals",
"format",
"getMessage",
"info"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getAllLogEntries()",
"testcase": true
} | {
"fields": [
{
"declarator": "exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class)",
"modifier": "private final static",
"original_string": "private final static org.slf4j.Logger exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "exceptionHandlingLogger"
},
{
"declarator": "logEntries = Collections.synchronizedList(new LinkedList<>())",
"modifier": "private final",
"original_string": "private final List<LogEntry> logEntries = Collections.synchronizedList(new LinkedList<>());",
"type": "List<LogEntry>",
"var_name": "logEntries"
},
{
"declarator": "index = new AtomicLong(0)",
"modifier": "private final",
"original_string": "private final AtomicLong index = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "index"
},
{
"declarator": "memoryAppender = new MemoryAppender(this)",
"modifier": "private final",
"original_string": "private final MemoryAppender memoryAppender = new MemoryAppender(this);",
"type": "MemoryAppender",
"var_name": "memoryAppender"
},
{
"declarator": "persistentAppender",
"modifier": "private final",
"original_string": "private final PersistentAppender persistentAppender;",
"type": "PersistentAppender",
"var_name": "persistentAppender"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/logging/LogImpl.java",
"identifier": "LogImpl",
"interfaces": "implements Log",
"methods": [
{
"class_method_signature": "LogImpl.LogImpl(File logFile)",
"constructor": true,
"full_signature": "public LogImpl(File logFile)",
"identifier": "LogImpl",
"modifiers": "public",
"parameters": "(File logFile)",
"return": "",
"signature": " LogImpl(File logFile)",
"testcase": false
},
{
"class_method_signature": "LogImpl.readLogFromFile(File file)",
"constructor": false,
"full_signature": "private void readLogFromFile(File file)",
"identifier": "readLogFromFile",
"modifiers": "private",
"parameters": "(File file)",
"return": "void",
"signature": "void readLogFromFile(File file)",
"testcase": false
},
{
"class_method_signature": "LogImpl.addLogEntry(LogEntry e)",
"constructor": false,
"full_signature": "@Override public void addLogEntry(LogEntry e)",
"identifier": "addLogEntry",
"modifiers": "@Override public",
"parameters": "(LogEntry e)",
"return": "void",
"signature": "void addLogEntry(LogEntry e)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last, boolean checkUpperBound)",
"constructor": false,
"full_signature": "private List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"identifier": "getLogEntries",
"modifiers": "private",
"parameters": "(int first, int last, boolean checkUpperBound)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int firstIndex)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int firstIndex)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int firstIndex)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int firstIndex)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(String context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(String context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(String context)",
"return": "Logger",
"signature": "Logger getLogger(String context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(Class context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(Class context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(Class context)",
"return": "Logger",
"signature": "Logger getLogger(Class context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public List<LogEntry> getLogEntries(int first, int last) {\n return getLogEntries(first, last, true);\n }",
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"invocations": [
"getLogEntries"
],
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_32 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void writeSubDirectoriesGetAutomaticallyCreated() throws IOException {\n String path = \"test/some/subdirs/filename\";\n access.access(path).append(fileContent).close();\n File targetFile = new File(targetDir, path);\n assertTrue(targetFile.isFile());\n assertEquals(fileContent, FileUtils.readFileToString(targetFile));\n }",
"class_method_signature": "PluginFileAccessTest.writeSubDirectoriesGetAutomaticallyCreated()",
"constructor": false,
"full_signature": "@Test public void writeSubDirectoriesGetAutomaticallyCreated()",
"identifier": "writeSubDirectoriesGetAutomaticallyCreated",
"invocations": [
"close",
"append",
"access",
"assertTrue",
"isFile",
"assertEquals",
"readFileToString"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void writeSubDirectoriesGetAutomaticallyCreated()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public BufferedLineWriter access(String relativePath) throws IOException {\n File target = new File(targetDir, relativePath);\n target.getParentFile().mkdirs();\n try {\n return new BufferedLineWriter(new FileWriter(target, true));\n } catch (FileNotFoundException e) {\n logger.error(\"Failed to create OutputStream for file '{}'\", target);\n throw e;\n }\n }",
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"invocations": [
"mkdirs",
"getParentFile",
"error"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_9 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void deleteTransformationStillRunning() throws Exception {\n preInitNonCreationTests();\n //Set the return value of the delete method\n when(transformationService.deleteTransformation(any(Transformation.class))).thenReturn(false);\n //Execute Request\n mvc.perform(\n delete(DELETE_TRANSFORMATION_VALID_URL)\n ).andDo(print())\n .andExpect(status().is(400))\n .andReturn();\n }",
"class_method_signature": "TransformationControllerTest.deleteTransformationStillRunning()",
"constructor": false,
"full_signature": "@Test public void deleteTransformationStillRunning()",
"identifier": "deleteTransformationStillRunning",
"invocations": [
"preInitNonCreationTests",
"thenReturn",
"when",
"deleteTransformation",
"any",
"andReturn",
"andExpect",
"andDo",
"perform",
"delete",
"print",
"is",
"status"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void deleteTransformationStillRunning()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@RequestMapping(\n path = \"/{platform}/delete\",\n method = RequestMethod.DELETE,\n produces = \"application/hal+json\"\n )\n @ApiOperation(\n value = \"Delete a transformation\",\n tags = {\"transformations\"},\n notes = \"Deletes a transformation and all the coresponding artifacts\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\"\n ),\n @ApiResponse(\n code = 400,\n message = \"The Deletion of the csar failed\",\n response = Void.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a Transformation for the specified platform.\",\n response = RestErrorResponse.class\n )\n })\n public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n ) {\n Csar csar = findByCsarId(name);\n Transformation transformation = findTransformationByPlatform(csar, platform);\n\n if (transformationService.deleteTransformation(transformation)) {\n // return 200 if the deletion was successful\n return ResponseEntity.ok().build();\n } else {\n // return 400 if the deletion failed\n return ResponseEntity.status(400).build();\n }\n }",
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"invocations": [
"findByCsarId",
"findTransformationByPlatform",
"deleteTransformation",
"build",
"ok",
"build",
"status"
],
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_24 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ZipUtilityTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ZipUtilityTest.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "FILE_SIZE = 1024",
"modifier": "private static final",
"original_string": "private static final int FILE_SIZE = 1024;",
"type": "int",
"var_name": "FILE_SIZE"
},
{
"declarator": "original",
"modifier": "private",
"original_string": "private File original;",
"type": "File",
"var_name": "original"
},
{
"declarator": "unzipped",
"modifier": "private",
"original_string": "private File unzipped;",
"type": "File",
"var_name": "unzipped"
},
{
"declarator": "rnd = new Random(123456)",
"modifier": "private final",
"original_string": "private final Random rnd = new Random(123456);",
"type": "Random",
"var_name": "rnd"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/util/ZipUtilityTest.java",
"identifier": "ZipUtilityTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void unzipFile() throws IOException {\n ZipInputStream is = new ZipInputStream(new FileInputStream(TestCsars.VALID_LAMP_INPUT));\n boolean result = ZipUtility.unzip(is, tmpdir.toString());\n assertTrue(result);\n }",
"class_method_signature": "ZipUtilityTest.unzipFile()",
"constructor": false,
"full_signature": "@Test public void unzipFile()",
"identifier": "unzipFile",
"invocations": [
"unzip",
"toString",
"assertTrue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void unzipFile()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ZipUtility.class.getName())",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(ZipUtility.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "BUFFER_SIZE = 4096",
"modifier": "private static final",
"original_string": "private static final int BUFFER_SIZE = 4096;",
"type": "int",
"var_name": "BUFFER_SIZE"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/util/ZipUtility.java",
"identifier": "ZipUtility",
"interfaces": "",
"methods": [
{
"class_method_signature": "ZipUtility.unzip(ZipInputStream zipIn, String destDirectory)",
"constructor": false,
"full_signature": "public static boolean unzip(ZipInputStream zipIn, String destDirectory)",
"identifier": "unzip",
"modifiers": "public static",
"parameters": "(ZipInputStream zipIn, String destDirectory)",
"return": "boolean",
"signature": "boolean unzip(ZipInputStream zipIn, String destDirectory)",
"testcase": false
},
{
"class_method_signature": "ZipUtility.extractFile(ZipInputStream zipIn, String filePath)",
"constructor": false,
"full_signature": "private static void extractFile(ZipInputStream zipIn, String filePath)",
"identifier": "extractFile",
"modifiers": "private static",
"parameters": "(ZipInputStream zipIn, String filePath)",
"return": "void",
"signature": "void extractFile(ZipInputStream zipIn, String filePath)",
"testcase": false
},
{
"class_method_signature": "ZipUtility.compressDirectory(File directory, OutputStream output)",
"constructor": false,
"full_signature": "public static void compressDirectory(File directory, OutputStream output)",
"identifier": "compressDirectory",
"modifiers": "public static",
"parameters": "(File directory, OutputStream output)",
"return": "void",
"signature": "void compressDirectory(File directory, OutputStream output)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static boolean unzip(ZipInputStream zipIn, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipEntry entry = zipIn.getNextEntry();\n if (entry == null) {\n return false;\n }\n while (entry != null) {\n String filePath = destDirectory + File.separator + entry.getName();\n if (!entry.isDirectory()) {\n extractFile(zipIn, filePath);\n } else {\n logger.trace(\"Creating directory: {}\", filePath);\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n return true;\n }",
"class_method_signature": "ZipUtility.unzip(ZipInputStream zipIn, String destDirectory)",
"constructor": false,
"full_signature": "public static boolean unzip(ZipInputStream zipIn, String destDirectory)",
"identifier": "unzip",
"invocations": [
"exists",
"mkdir",
"getNextEntry",
"getName",
"isDirectory",
"extractFile",
"trace",
"mkdir",
"closeEntry",
"getNextEntry",
"close"
],
"modifiers": "public static",
"parameters": "(ZipInputStream zipIn, String destDirectory)",
"return": "boolean",
"signature": "boolean unzip(ZipInputStream zipIn, String destDirectory)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_49 | {
"fields": [
{
"declarator": "WAIT_DELAY_MS = 100",
"modifier": "private static final",
"original_string": "private static final int WAIT_DELAY_MS = 100;",
"type": "int",
"var_name": "WAIT_DELAY_MS"
},
{
"declarator": "TEST_EXECUTION_TIMEOUT_MS = 10000",
"modifier": "private static final",
"original_string": "private static final int TEST_EXECUTION_TIMEOUT_MS = 10000;",
"type": "int",
"var_name": "TEST_EXECUTION_TIMEOUT_MS"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationServiceImplTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TransformationServiceImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "service",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TransformationService service;",
"type": "TransformationService",
"var_name": "service"
},
{
"declarator": "testCsars",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TestCsars testCsars;",
"type": "TestCsars",
"var_name": "testCsars"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationServiceImplTest.java",
"identifier": "TransformationServiceImplTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS)\n public void startTransformation() throws Exception {\n Transformation t = startTransformationInternal(TransformationState.DONE, PASSING_DUMMY.getPlatform());\n assertNotNull(t);\n }",
"class_method_signature": "TransformationServiceImplTest.startTransformation()",
"constructor": false,
"full_signature": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public void startTransformation()",
"identifier": "startTransformation",
"invocations": [
"startTransformationInternal",
"getPlatform",
"assertNotNull"
],
"modifiers": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public",
"parameters": "()",
"return": "void",
"signature": "void startTransformation()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "private final",
"original_string": "private final CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "pluginService",
"modifier": "private final",
"original_string": "private final PluginService pluginService;",
"type": "PluginService",
"var_name": "pluginService"
},
{
"declarator": "artifactService",
"modifier": "private final",
"original_string": "private final ArtifactService artifactService;",
"type": "ArtifactService",
"var_name": "artifactService"
},
{
"declarator": "tasks = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Transformation, Future<?>> tasks = new HashMap<>();",
"type": "Map<Transformation, Future<?>>",
"var_name": "tasks"
},
{
"declarator": "executor = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executor = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationServiceImpl.java",
"identifier": "TransformationServiceImpl",
"interfaces": "implements TransformationService",
"methods": [
{
"class_method_signature": "TransformationServiceImpl.TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"constructor": true,
"full_signature": "@Autowired public TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"identifier": "TransformationServiceImpl",
"modifiers": "@Autowired public",
"parameters": "(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"return": "",
"signature": " TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public boolean startTransformation(Transformation transformation) {\n //Only start the transformation if the input has been validated or the \n //transformation does not need any additional properties\n if (transformation.getState() == TransformationState.READY) {\n Future<?> taskFuture = executor.submit(\n new ExecutionTask(\n transformation,\n artifactService,\n pluginService,\n csarDao.getContentDir(transformation.getCsar()),\n transformationDao.getContentDir(transformation)\n )\n );\n tasks.put(transformation, taskFuture);\n return true;\n }\n return false;\n }",
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"invocations": [
"getState",
"submit",
"getContentDir",
"getCsar",
"getContentDir",
"put"
],
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_5 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void testStartTransformationFail() throws Exception {\n preInitNonCreationTests();\n when(transformationService.startTransformation(any(Transformation.class))).thenReturn(false);\n mvc.perform(\n post(START_TRANSFORMATION_VALID_URL)\n .contentType(MediaType.APPLICATION_JSON)\n .content(INPUTS_VALID)\n ).andDo(print())\n .andExpect(status().is(400))\n .andExpect(content().bytes(new byte[0]))\n .andReturn();\n assertNotEquals(TransformationState.TRANSFORMING,\n csarService.getCsar(VALID_CSAR_NAME).get().getTransformation(VALID_PLATFORM_NAME).get().getState());\n }",
"class_method_signature": "TransformationControllerTest.testStartTransformationFail()",
"constructor": false,
"full_signature": "@Test public void testStartTransformationFail()",
"identifier": "testStartTransformationFail",
"invocations": [
"preInitNonCreationTests",
"thenReturn",
"when",
"startTransformation",
"any",
"andReturn",
"andExpect",
"andExpect",
"andDo",
"perform",
"content",
"contentType",
"post",
"print",
"is",
"status",
"bytes",
"content",
"assertNotEquals",
"getState",
"get",
"getTransformation",
"get",
"getCsar"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testStartTransformationFail()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@RequestMapping(\n path = \"/{platform}/start\",\n method = RequestMethod.POST,\n produces = \"application/hal+json\"\n )\n @ApiOperation(\n value = \"Start a Transformation\",\n tags = {\"transformations\"},\n notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" +\n \"Transformation has to be in the state READY otherwise the transformation cannot start.\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\"\n ),\n @ApiResponse(\n code = 400,\n message = \"The state of the transformation is illegal. This means that the transformation is not in the\" +\n \"READY state. Therefore starting it is not possible\",\n response = RestErrorResponse.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a Transformation for the specified platform.\",\n response = RestErrorResponse.class\n )\n })\n public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n ) {\n logger.info(\"Starting transformation for csar '{}' on '{}'\", name, platform);\n Csar csar = findByCsarId(name);\n Transformation transformation = findTransformationByPlatform(csar, platform);\n if (transformationService.startTransformation(transformation)) {\n return ResponseEntity.ok().build();\n } else {\n throw new IllegalTransformationStateException(\"Transformation could not start because\" +\n \" its not in a valid state to start.\");\n }\n }",
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"invocations": [
"info",
"findByCsarId",
"findTransformationByPlatform",
"startTransformation",
"build",
"ok"
],
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_28 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test(expected = FileNotFoundException.class)\n public void copyInvalidPathThrowsException() throws IOException {\n String file = \"nonexistent_file\";\n access.copy(file);\n }",
"class_method_signature": "PluginFileAccessTest.copyInvalidPathThrowsException()",
"constructor": false,
"full_signature": "@Test(expected = FileNotFoundException.class) public void copyInvalidPathThrowsException()",
"identifier": "copyInvalidPathThrowsException",
"invocations": [
"copy"
],
"modifiers": "@Test(expected = FileNotFoundException.class) public",
"parameters": "()",
"return": "void",
"signature": "void copyInvalidPathThrowsException()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void copy(String relativePath) throws IOException {\n copy(relativePath, relativePath);\n }",
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"invocations": [
"copy"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_53 | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private",
"original_string": "private TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "platformService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
},
{
"declarator": "transformation",
"modifier": "private",
"original_string": "private Transformation transformation;",
"type": "Transformation",
"var_name": "transformation"
},
{
"declarator": "transformationRootDir",
"modifier": "private",
"original_string": "private File transformationRootDir;",
"type": "File",
"var_name": "transformationRootDir"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDaoTest.java",
"identifier": "TransformationFilesystemDaoTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void createDeletesOldFilesAndCreatesBlankDir() {\n List<File> files = createRandomFiles(transformationRootDir);\n\n assertNotEquals(0, transformationRootDir.list().length);\n when(platformService.isSupported(PLATFORM1)).thenReturn(true);\n transformationDao.create(csar, PLATFORM1);\n\n for (File file : files) {\n assertFalse(file.exists());\n }\n assertTrue(transformationRootDir.exists());\n File[] result = transformationRootDir.listFiles();\n assertEquals(1, result.length); // old files deleted, empty content dir got created\n assertEquals(TransformationFilesystemDao.CONTENT_DIR, result[0].getName());\n // only logfile must exist\n assertEquals(1, result[0].list().length);\n }",
"class_method_signature": "TransformationFilesystemDaoTest.createDeletesOldFilesAndCreatesBlankDir()",
"constructor": false,
"full_signature": "@Test public void createDeletesOldFilesAndCreatesBlankDir()",
"identifier": "createDeletesOldFilesAndCreatesBlankDir",
"invocations": [
"createRandomFiles",
"assertNotEquals",
"list",
"thenReturn",
"when",
"isSupported",
"create",
"assertFalse",
"exists",
"assertTrue",
"exists",
"listFiles",
"assertEquals",
"assertEquals",
"getName",
"assertEquals",
"list"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void createDeletesOldFilesAndCreatesBlankDir()",
"testcase": true
} | {
"fields": [
{
"declarator": "ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_FAILED_REGEX"
},
{
"declarator": "ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_SUCCESSFUL_REGEX"
},
{
"declarator": "CONTENT_DIR = \"content\"",
"modifier": "public final static",
"original_string": "public final static String CONTENT_DIR = \"content\";",
"type": "String",
"var_name": "CONTENT_DIR"
},
{
"declarator": "FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\")",
"modifier": "private final static",
"original_string": "private final static SimpleDateFormat FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\");",
"type": "SimpleDateFormat",
"var_name": "FORMAT"
},
{
"declarator": "FAILED = \"_failed\"",
"modifier": "private final static",
"original_string": "private final static String FAILED = \"_failed\";",
"type": "String",
"var_name": "FAILED"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationFilesystemDao.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(TransformationFilesystemDao.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "effectiveModelFactory",
"modifier": "private final",
"original_string": "private final EffectiveModelFactory effectiveModelFactory;",
"type": "EffectiveModelFactory",
"var_name": "effectiveModelFactory"
},
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDao.java",
"identifier": "TransformationFilesystemDao",
"interfaces": "implements TransformationDao",
"methods": [
{
"class_method_signature": "TransformationFilesystemDao.TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"constructor": true,
"full_signature": "@Autowired public TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"identifier": "TransformationFilesystemDao",
"modifiers": "@Autowired public",
"parameters": "(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"return": "",
"signature": " TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.create(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Transformation create(Csar csar, Platform platform)",
"identifier": "create",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation create(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTransformation(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Transformation createTransformation(Csar csar, Platform platform)",
"identifier": "createTransformation",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public void delete(Transformation transformation)",
"identifier": "delete",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void delete(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(File transformationDir)",
"constructor": false,
"full_signature": "private void delete(File transformationDir)",
"identifier": "delete",
"modifiers": "private",
"parameters": "(File transformationDir)",
"return": "void",
"signature": "void delete(File transformationDir)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Optional<Transformation> find(Csar csar, Platform platform)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Optional<Transformation>",
"signature": "Optional<Transformation> find(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar)",
"constructor": false,
"full_signature": "@Override public List<Transformation> find(Csar csar)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "List<Transformation>",
"signature": "List<Transformation> find(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readFromDisk(Csar csar)",
"constructor": false,
"full_signature": "private Set<Transformation> readFromDisk(Csar csar)",
"identifier": "readFromDisk",
"modifiers": "private",
"parameters": "(Csar csar)",
"return": "Set<Transformation>",
"signature": "Set<Transformation> readFromDisk(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readTargetArtifactFromDisk(Transformation transformation)",
"constructor": false,
"full_signature": "private void readTargetArtifactFromDisk(Transformation transformation)",
"identifier": "readTargetArtifactFromDisk",
"modifiers": "private",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void readTargetArtifactFromDisk(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTargetArtifact(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public TargetArtifact createTargetArtifact(Transformation transformation)",
"identifier": "createTargetArtifact",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "TargetArtifact",
"signature": "TargetArtifact createTargetArtifact(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getRootDir(Transformation transformation)",
"identifier": "getRootDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getRootDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getRootDir(Csar csar, Platform platform)",
"identifier": "getRootDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getRootDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getContentDir(Transformation transformation)",
"identifier": "getContentDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getContentDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getContentDir(Csar csar, Platform platform)",
"identifier": "getContentDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getContentDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.setCsarDao(CsarDao csarDao)",
"constructor": false,
"full_signature": "@Override public void setCsarDao(CsarDao csarDao)",
"identifier": "setCsarDao",
"modifiers": "@Override public",
"parameters": "(CsarDao csarDao)",
"return": "void",
"signature": "void setCsarDao(CsarDao csarDao)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getLog(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Log getLog(Csar csar, Platform platform)",
"identifier": "getLog",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Log",
"signature": "Log getLog(Csar csar, Platform platform)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Transformation create(Csar csar, Platform platform) throws PlatformNotFoundException {\n if (!platformService.isSupported(platform)) {\n throw new PlatformNotFoundException();\n }\n Optional<Transformation> oldTransformation = csar.getTransformation(platform.id);\n if (oldTransformation.isPresent()) {\n delete(oldTransformation.get());\n } else {\n delete(getRootDir(csar, platform));\n }\n Transformation transformation = createTransformation(csar, platform);\n csar.getTransformations().put(platform.id, transformation);\n getContentDir(transformation).mkdirs();\n return transformation;\n }",
"class_method_signature": "TransformationFilesystemDao.create(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Transformation create(Csar csar, Platform platform)",
"identifier": "create",
"invocations": [
"isSupported",
"getTransformation",
"isPresent",
"delete",
"get",
"delete",
"getRootDir",
"createTransformation",
"put",
"getTransformations",
"mkdirs",
"getContentDir"
],
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation create(Csar csar, Platform platform)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_12 | {
"fields": [
{
"declarator": "DEBIAN_INSTALL_CMD = \"apt-get update && apt-get install -y sudo\"",
"modifier": "private static final",
"original_string": "private static final String DEBIAN_INSTALL_CMD = \"apt-get update && apt-get install -y sudo\";",
"type": "String",
"var_name": "DEBIAN_INSTALL_CMD"
},
{
"declarator": "ALPINE_INSTALL_CMD = \"apk add --update --no-cache sudo\"",
"modifier": "private static final",
"original_string": "private static final String ALPINE_INSTALL_CMD = \"apk add --update --no-cache sudo\";",
"type": "String",
"var_name": "ALPINE_INSTALL_CMD"
},
{
"declarator": "CENTOS_INSTALL_CMD = \"yum install -y sudo\"",
"modifier": "private static final",
"original_string": "private static final String CENTOS_INSTALL_CMD = \"yum install -y sudo\";",
"type": "String",
"var_name": "CENTOS_INSTALL_CMD"
},
{
"declarator": "input",
"modifier": "private",
"original_string": "private String input;",
"type": "String",
"var_name": "input"
},
{
"declarator": "expected",
"modifier": "private",
"original_string": "private String expected;",
"type": "String",
"var_name": "expected"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/kubernetes/util/SudoUtilsTest.java",
"identifier": "SudoUtilsTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void validate() {\n Optional<String> result = SudoUtils.getSudoInstallCommand(input);\n if (expected == null) {\n assertTrue(!result.isPresent());\n return;\n }\n String r = result.get();\n assertEquals(r, expected);\n }",
"class_method_signature": "SudoUtilsTest.validate()",
"constructor": false,
"full_signature": "@Test public void validate()",
"identifier": "validate",
"invocations": [
"getSudoInstallCommand",
"assertTrue",
"isPresent",
"get",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void validate()",
"testcase": true
} | {
"fields": [
{
"declarator": "IMAGE_MAP = new HashMap<>()",
"modifier": "private static final",
"original_string": "private static final Map<String, String> IMAGE_MAP = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "IMAGE_MAP"
},
{
"declarator": "SUDO_COMMANDS_MAP_FILE_PATH = \"/kubernetes/docker/sudo-commands\"",
"modifier": "private static final",
"original_string": "private static final String SUDO_COMMANDS_MAP_FILE_PATH = \"/kubernetes/docker/sudo-commands\";",
"type": "String",
"var_name": "SUDO_COMMANDS_MAP_FILE_PATH"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/kubernetes/util/SudoUtils.java",
"identifier": "SudoUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SudoUtils.getSudoInstallCommand(String baseImage)",
"constructor": false,
"full_signature": "public static Optional<String> getSudoInstallCommand(String baseImage)",
"identifier": "getSudoInstallCommand",
"modifiers": "public static",
"parameters": "(String baseImage)",
"return": "Optional<String>",
"signature": "Optional<String> getSudoInstallCommand(String baseImage)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Optional<String> getSudoInstallCommand(String baseImage) {\n String imageName = baseImage.split(\":\")[0];\n return Optional.ofNullable(IMAGE_MAP.get(imageName));\n }",
"class_method_signature": "SudoUtils.getSudoInstallCommand(String baseImage)",
"constructor": false,
"full_signature": "public static Optional<String> getSudoInstallCommand(String baseImage)",
"identifier": "getSudoInstallCommand",
"invocations": [
"split",
"ofNullable",
"get"
],
"modifiers": "public static",
"parameters": "(String baseImage)",
"return": "Optional<String>",
"signature": "Optional<String> getSudoInstallCommand(String baseImage)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_45 | {
"fields": [
{
"declarator": "WAIT_DELAY_MS = 100",
"modifier": "private static final",
"original_string": "private static final int WAIT_DELAY_MS = 100;",
"type": "int",
"var_name": "WAIT_DELAY_MS"
},
{
"declarator": "TEST_EXECUTION_TIMEOUT_MS = 10000",
"modifier": "private static final",
"original_string": "private static final int TEST_EXECUTION_TIMEOUT_MS = 10000;",
"type": "int",
"var_name": "TEST_EXECUTION_TIMEOUT_MS"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationServiceImplTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TransformationServiceImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "service",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TransformationService service;",
"type": "TransformationService",
"var_name": "service"
},
{
"declarator": "testCsars",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TestCsars testCsars;",
"type": "TestCsars",
"var_name": "testCsars"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationServiceImplTest.java",
"identifier": "TransformationServiceImplTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS)\n public void createTransformation() throws Exception {\n Transformation expected = new TransformationImpl(csar, PLATFORM1, log, modelMock());\n Transformation transformation = service.createTransformation(csar, PLATFORM1);\n assertTrue(csar.getTransformation(PLATFORM1.id).isPresent());\n assertEquals(expected, transformation);\n }",
"class_method_signature": "TransformationServiceImplTest.createTransformation()",
"constructor": false,
"full_signature": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public void createTransformation()",
"identifier": "createTransformation",
"invocations": [
"modelMock",
"createTransformation",
"assertTrue",
"isPresent",
"getTransformation",
"assertEquals"
],
"modifiers": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public",
"parameters": "()",
"return": "void",
"signature": "void createTransformation()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "private final",
"original_string": "private final CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "pluginService",
"modifier": "private final",
"original_string": "private final PluginService pluginService;",
"type": "PluginService",
"var_name": "pluginService"
},
{
"declarator": "artifactService",
"modifier": "private final",
"original_string": "private final ArtifactService artifactService;",
"type": "ArtifactService",
"var_name": "artifactService"
},
{
"declarator": "tasks = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Transformation, Future<?>> tasks = new HashMap<>();",
"type": "Map<Transformation, Future<?>>",
"var_name": "tasks"
},
{
"declarator": "executor = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executor = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationServiceImpl.java",
"identifier": "TransformationServiceImpl",
"interfaces": "implements TransformationService",
"methods": [
{
"class_method_signature": "TransformationServiceImpl.TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"constructor": true,
"full_signature": "@Autowired public TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"identifier": "TransformationServiceImpl",
"modifiers": "@Autowired public",
"parameters": "(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"return": "",
"signature": " TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Transformation createTransformation(Csar csar, Platform targetPlatform) throws PlatformNotFoundException {\n return transformationDao.create(csar, targetPlatform);\n }",
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"invocations": [
"create"
],
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_44 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LogImplTest.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(LogImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "log",
"modifier": "private",
"original_string": "private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logfile",
"modifier": "private",
"original_string": "private File logfile;",
"type": "File",
"var_name": "logfile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/logging/LogImplTest.java",
"identifier": "LogImplTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void logReadsLogfileWithIllegalLogsAndIgnoresThem() throws IOException {\n PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(logfile)));\n pw.write(\"log level which does not adhere to logging format\");\n log = new LogImpl(logfile);\n List<LogEntry> entries = log.getLogEntries(0);\n assertEquals(0, entries.size());\n }",
"class_method_signature": "LogImplTest.logReadsLogfileWithIllegalLogsAndIgnoresThem()",
"constructor": false,
"full_signature": "@Test public void logReadsLogfileWithIllegalLogsAndIgnoresThem()",
"identifier": "logReadsLogfileWithIllegalLogsAndIgnoresThem",
"invocations": [
"write",
"getLogEntries",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void logReadsLogfileWithIllegalLogsAndIgnoresThem()",
"testcase": true
} | {
"fields": [
{
"declarator": "exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class)",
"modifier": "private final static",
"original_string": "private final static org.slf4j.Logger exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "exceptionHandlingLogger"
},
{
"declarator": "logEntries = Collections.synchronizedList(new LinkedList<>())",
"modifier": "private final",
"original_string": "private final List<LogEntry> logEntries = Collections.synchronizedList(new LinkedList<>());",
"type": "List<LogEntry>",
"var_name": "logEntries"
},
{
"declarator": "index = new AtomicLong(0)",
"modifier": "private final",
"original_string": "private final AtomicLong index = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "index"
},
{
"declarator": "memoryAppender = new MemoryAppender(this)",
"modifier": "private final",
"original_string": "private final MemoryAppender memoryAppender = new MemoryAppender(this);",
"type": "MemoryAppender",
"var_name": "memoryAppender"
},
{
"declarator": "persistentAppender",
"modifier": "private final",
"original_string": "private final PersistentAppender persistentAppender;",
"type": "PersistentAppender",
"var_name": "persistentAppender"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/logging/LogImpl.java",
"identifier": "LogImpl",
"interfaces": "implements Log",
"methods": [
{
"class_method_signature": "LogImpl.LogImpl(File logFile)",
"constructor": true,
"full_signature": "public LogImpl(File logFile)",
"identifier": "LogImpl",
"modifiers": "public",
"parameters": "(File logFile)",
"return": "",
"signature": " LogImpl(File logFile)",
"testcase": false
},
{
"class_method_signature": "LogImpl.readLogFromFile(File file)",
"constructor": false,
"full_signature": "private void readLogFromFile(File file)",
"identifier": "readLogFromFile",
"modifiers": "private",
"parameters": "(File file)",
"return": "void",
"signature": "void readLogFromFile(File file)",
"testcase": false
},
{
"class_method_signature": "LogImpl.addLogEntry(LogEntry e)",
"constructor": false,
"full_signature": "@Override public void addLogEntry(LogEntry e)",
"identifier": "addLogEntry",
"modifiers": "@Override public",
"parameters": "(LogEntry e)",
"return": "void",
"signature": "void addLogEntry(LogEntry e)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last, boolean checkUpperBound)",
"constructor": false,
"full_signature": "private List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"identifier": "getLogEntries",
"modifiers": "private",
"parameters": "(int first, int last, boolean checkUpperBound)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int firstIndex)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int firstIndex)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int firstIndex)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int firstIndex)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(String context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(String context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(String context)",
"return": "Logger",
"signature": "Logger getLogger(String context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(Class context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(Class context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(Class context)",
"return": "Logger",
"signature": "Logger getLogger(Class context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public List<LogEntry> getLogEntries(int first, int last) {\n return getLogEntries(first, last, true);\n }",
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"invocations": [
"getLogEntries"
],
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_13 | {
"fields": [
{
"declarator": "appName = \"my-app\"",
"modifier": "private",
"original_string": "private String appName = \"my-app\";",
"type": "String",
"var_name": "appName"
},
{
"declarator": "appServiceName = \"my-app-service\"",
"modifier": "private",
"original_string": "private String appServiceName = \"my-app-service\";",
"type": "String",
"var_name": "appServiceName"
},
{
"declarator": "appDeploymentName = \"my-app-deployment\"",
"modifier": "private",
"original_string": "private String appDeploymentName = \"my-app-deployment\";",
"type": "String",
"var_name": "appDeploymentName"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/kubernetes/ResourceFileCreatorTest.java",
"identifier": "ResourceFileCreatorTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void testReplicationControllerCreation() {\n ResourceFileCreator resourceFileCreator = new ResourceFileCreator(Pod.getPods(TestNodeStacks.getLampNodeStacks(logMock())));\n\n HashMap<String, String> result = null;\n try {\n result = resourceFileCreator.getResourceYaml();\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n fail();\n }\n\n String service = result.get(appServiceName);\n String deployment = result.get(appDeploymentName);\n Yaml yaml = new Yaml();\n deploymentTest((Map) yaml.load(deployment));\n }",
"class_method_signature": "ResourceFileCreatorTest.testReplicationControllerCreation()",
"constructor": false,
"full_signature": "@Test public void testReplicationControllerCreation()",
"identifier": "testReplicationControllerCreation",
"invocations": [
"getPods",
"getLampNodeStacks",
"logMock",
"getResourceYaml",
"printStackTrace",
"fail",
"get",
"get",
"deploymentTest",
"load"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testReplicationControllerCreation()",
"testcase": true
} | {
"fields": [
{
"declarator": "resources = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<IKubernetesResource<?>> resources = new ArrayList<>();",
"type": "List<IKubernetesResource<?>>",
"var_name": "resources"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/kubernetes/ResourceFileCreator.java",
"identifier": "ResourceFileCreator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ResourceFileCreator.ResourceFileCreator(Collection<Pod> pods)",
"constructor": true,
"full_signature": "public ResourceFileCreator(Collection<Pod> pods)",
"identifier": "ResourceFileCreator",
"modifiers": "public",
"parameters": "(Collection<Pod> pods)",
"return": "",
"signature": " ResourceFileCreator(Collection<Pod> pods)",
"testcase": false
},
{
"class_method_signature": "ResourceFileCreator.getResourceYaml()",
"constructor": false,
"full_signature": "public HashMap<String, String> getResourceYaml()",
"identifier": "getResourceYaml",
"modifiers": "public",
"parameters": "()",
"return": "HashMap<String, String>",
"signature": "HashMap<String, String> getResourceYaml()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public HashMap<String, String> getResourceYaml() throws JsonProcessingException {\n HashMap<String, String> result = new HashMap<>();\n for (IKubernetesResource<?> resource : resources) {\n result.put(resource.getName(), resource.toYaml());\n }\n return result;\n }",
"class_method_signature": "ResourceFileCreator.getResourceYaml()",
"constructor": false,
"full_signature": "public HashMap<String, String> getResourceYaml()",
"identifier": "getResourceYaml",
"invocations": [
"put",
"getName",
"toYaml"
],
"modifiers": "public",
"parameters": "()",
"return": "HashMap<String, String>",
"signature": "HashMap<String, String> getResourceYaml()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_52 | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private",
"original_string": "private TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "platformService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
},
{
"declarator": "transformation",
"modifier": "private",
"original_string": "private Transformation transformation;",
"type": "Transformation",
"var_name": "transformation"
},
{
"declarator": "transformationRootDir",
"modifier": "private",
"original_string": "private File transformationRootDir;",
"type": "File",
"var_name": "transformationRootDir"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDaoTest.java",
"identifier": "TransformationFilesystemDaoTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void getRootDir() {\n doReturn(new File(new File(tmpdir, csar.getIdentifier()),\n CsarFilesystemDao.TRANSFORMATION_DIR)).when(csarDao).getTransformationsDir(csar);\n doReturn(new File(tmpdir, csar.getIdentifier())).when(csarDao).getRootDir(csar);\n File expectedParent = new File(csarDao.getRootDir(csar), CsarFilesystemDao.TRANSFORMATION_DIR);\n File expected = new File(expectedParent, PLATFORM1.id);\n File actual = transformationDao.getRootDir(transformation);\n\n assertEquals(expected, actual);\n }",
"class_method_signature": "TransformationFilesystemDaoTest.getRootDir()",
"constructor": false,
"full_signature": "@Test public void getRootDir()",
"identifier": "getRootDir",
"invocations": [
"getTransformationsDir",
"when",
"doReturn",
"getIdentifier",
"getRootDir",
"when",
"doReturn",
"getIdentifier",
"getRootDir",
"getRootDir",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getRootDir()",
"testcase": true
} | {
"fields": [
{
"declarator": "ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_FAILED_REGEX"
},
{
"declarator": "ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_SUCCESSFUL_REGEX = \".+-.+_.+\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_SUCCESSFUL_REGEX"
},
{
"declarator": "CONTENT_DIR = \"content\"",
"modifier": "public final static",
"original_string": "public final static String CONTENT_DIR = \"content\";",
"type": "String",
"var_name": "CONTENT_DIR"
},
{
"declarator": "FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\")",
"modifier": "private final static",
"original_string": "private final static SimpleDateFormat FORMAT = new SimpleDateFormat(\"dd-MM-yy_hh-mm\");",
"type": "SimpleDateFormat",
"var_name": "FORMAT"
},
{
"declarator": "FAILED = \"_failed\"",
"modifier": "private final static",
"original_string": "private final static String FAILED = \"_failed\";",
"type": "String",
"var_name": "FAILED"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationFilesystemDao.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(TransformationFilesystemDao.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "effectiveModelFactory",
"modifier": "private final",
"original_string": "private final EffectiveModelFactory effectiveModelFactory;",
"type": "EffectiveModelFactory",
"var_name": "effectiveModelFactory"
},
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationFilesystemDao.java",
"identifier": "TransformationFilesystemDao",
"interfaces": "implements TransformationDao",
"methods": [
{
"class_method_signature": "TransformationFilesystemDao.TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"constructor": true,
"full_signature": "@Autowired public TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"identifier": "TransformationFilesystemDao",
"modifiers": "@Autowired public",
"parameters": "(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"return": "",
"signature": " TransformationFilesystemDao(PlatformService platformService, EffectiveModelFactory effectiveModelFactory)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.create(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Transformation create(Csar csar, Platform platform)",
"identifier": "create",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation create(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTransformation(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Transformation createTransformation(Csar csar, Platform platform)",
"identifier": "createTransformation",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public void delete(Transformation transformation)",
"identifier": "delete",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void delete(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.delete(File transformationDir)",
"constructor": false,
"full_signature": "private void delete(File transformationDir)",
"identifier": "delete",
"modifiers": "private",
"parameters": "(File transformationDir)",
"return": "void",
"signature": "void delete(File transformationDir)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "@Override public Optional<Transformation> find(Csar csar, Platform platform)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform platform)",
"return": "Optional<Transformation>",
"signature": "Optional<Transformation> find(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.find(Csar csar)",
"constructor": false,
"full_signature": "@Override public List<Transformation> find(Csar csar)",
"identifier": "find",
"modifiers": "@Override public",
"parameters": "(Csar csar)",
"return": "List<Transformation>",
"signature": "List<Transformation> find(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readFromDisk(Csar csar)",
"constructor": false,
"full_signature": "private Set<Transformation> readFromDisk(Csar csar)",
"identifier": "readFromDisk",
"modifiers": "private",
"parameters": "(Csar csar)",
"return": "Set<Transformation>",
"signature": "Set<Transformation> readFromDisk(Csar csar)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.readTargetArtifactFromDisk(Transformation transformation)",
"constructor": false,
"full_signature": "private void readTargetArtifactFromDisk(Transformation transformation)",
"identifier": "readTargetArtifactFromDisk",
"modifiers": "private",
"parameters": "(Transformation transformation)",
"return": "void",
"signature": "void readTargetArtifactFromDisk(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.createTargetArtifact(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public TargetArtifact createTargetArtifact(Transformation transformation)",
"identifier": "createTargetArtifact",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "TargetArtifact",
"signature": "TargetArtifact createTargetArtifact(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getRootDir(Transformation transformation)",
"identifier": "getRootDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getRootDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getRootDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getRootDir(Csar csar, Platform platform)",
"identifier": "getRootDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getRootDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getContentDir(Transformation transformation)",
"identifier": "getContentDir",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getContentDir(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getContentDir(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private File getContentDir(Csar csar, Platform platform)",
"identifier": "getContentDir",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "File",
"signature": "File getContentDir(Csar csar, Platform platform)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.setCsarDao(CsarDao csarDao)",
"constructor": false,
"full_signature": "@Override public void setCsarDao(CsarDao csarDao)",
"identifier": "setCsarDao",
"modifiers": "@Override public",
"parameters": "(CsarDao csarDao)",
"return": "void",
"signature": "void setCsarDao(CsarDao csarDao)",
"testcase": false
},
{
"class_method_signature": "TransformationFilesystemDao.getLog(Csar csar, Platform platform)",
"constructor": false,
"full_signature": "private Log getLog(Csar csar, Platform platform)",
"identifier": "getLog",
"modifiers": "private",
"parameters": "(Csar csar, Platform platform)",
"return": "Log",
"signature": "Log getLog(Csar csar, Platform platform)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public File getRootDir(Transformation transformation) {\n return getRootDir(transformation.getCsar(), transformation.getPlatform());\n }",
"class_method_signature": "TransformationFilesystemDao.getRootDir(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public File getRootDir(Transformation transformation)",
"identifier": "getRootDir",
"invocations": [
"getRootDir",
"getCsar",
"getPlatform"
],
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "File",
"signature": "File getRootDir(Transformation transformation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_29 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void copySourceToGivenTargetSuccessful() throws IOException {\n String filename = \"some-file\";\n File file = new File(sourceDir, filename);\n file.createNewFile();\n String alternativeDirName = \"some-dir/nested/even-deeper\";\n File alternateDirectory = new File(targetDir, alternativeDirName);\n File targetFile = new File(alternateDirectory, filename);\n\n String relativeTargetPath = String.format(\"%s/%s\", alternativeDirName, filename);\n access.copy(filename, relativeTargetPath);\n\n assertTrue(targetFile.exists());\n }",
"class_method_signature": "PluginFileAccessTest.copySourceToGivenTargetSuccessful()",
"constructor": false,
"full_signature": "@Test public void copySourceToGivenTargetSuccessful()",
"identifier": "copySourceToGivenTargetSuccessful",
"invocations": [
"createNewFile",
"format",
"copy",
"assertTrue",
"exists"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void copySourceToGivenTargetSuccessful()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void copy(String relativePath) throws IOException {\n copy(relativePath, relativePath);\n }",
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"invocations": [
"copy"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_4 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void testStartTransformationSuccess() throws Exception {\n preInitNonCreationTests();\n\n when(transformationService.startTransformation(any(Transformation.class))).thenReturn(true);\n\n mvc.perform(\n post(START_TRANSFORMATION_VALID_URL)\n .contentType(MediaType.APPLICATION_JSON)\n .content(INPUTS_VALID)\n ).andDo(print())\n .andExpect(status().is(200))\n .andExpect(content().bytes(new byte[0]))\n .andReturn();\n }",
"class_method_signature": "TransformationControllerTest.testStartTransformationSuccess()",
"constructor": false,
"full_signature": "@Test public void testStartTransformationSuccess()",
"identifier": "testStartTransformationSuccess",
"invocations": [
"preInitNonCreationTests",
"thenReturn",
"when",
"startTransformation",
"any",
"andReturn",
"andExpect",
"andExpect",
"andDo",
"perform",
"content",
"contentType",
"post",
"print",
"is",
"status",
"bytes",
"content"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testStartTransformationSuccess()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@RequestMapping(\n path = \"/{platform}/start\",\n method = RequestMethod.POST,\n produces = \"application/hal+json\"\n )\n @ApiOperation(\n value = \"Start a Transformation\",\n tags = {\"transformations\"},\n notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" +\n \"Transformation has to be in the state READY otherwise the transformation cannot start.\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\"\n ),\n @ApiResponse(\n code = 400,\n message = \"The state of the transformation is illegal. This means that the transformation is not in the\" +\n \"READY state. Therefore starting it is not possible\",\n response = RestErrorResponse.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a Transformation for the specified platform.\",\n response = RestErrorResponse.class\n )\n })\n public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n ) {\n logger.info(\"Starting transformation for csar '{}' on '{}'\", name, platform);\n Csar csar = findByCsarId(name);\n Transformation transformation = findTransformationByPlatform(csar, platform);\n if (transformationService.startTransformation(transformation)) {\n return ResponseEntity.ok().build();\n } else {\n throw new IllegalTransformationStateException(\"Transformation could not start because\" +\n \" its not in a valid state to start.\");\n }\n }",
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"invocations": [
"info",
"findByCsarId",
"findTransformationByPlatform",
"startTransformation",
"build",
"ok"
],
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_48 | {
"fields": [
{
"declarator": "WAIT_DELAY_MS = 100",
"modifier": "private static final",
"original_string": "private static final int WAIT_DELAY_MS = 100;",
"type": "int",
"var_name": "WAIT_DELAY_MS"
},
{
"declarator": "TEST_EXECUTION_TIMEOUT_MS = 10000",
"modifier": "private static final",
"original_string": "private static final int TEST_EXECUTION_TIMEOUT_MS = 10000;",
"type": "int",
"var_name": "TEST_EXECUTION_TIMEOUT_MS"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationServiceImplTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TransformationServiceImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "service",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TransformationService service;",
"type": "TransformationService",
"var_name": "service"
},
{
"declarator": "testCsars",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TestCsars testCsars;",
"type": "TestCsars",
"var_name": "testCsars"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationServiceImplTest.java",
"identifier": "TransformationServiceImplTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS)\n public void transformationCreationInputNeeded() throws Exception {\n Transformation t = service.createTransformation(csar, PLATFORM_PASSING_INPUT_REQUIRED_DUMMY);\n assertTrue(csar.getTransformation(PLATFORM_PASSING_INPUT_REQUIRED_DUMMY.id).isPresent());\n assertNotNull(t);\n assertEquals(TransformationState.INPUT_REQUIRED, t.getState());\n }",
"class_method_signature": "TransformationServiceImplTest.transformationCreationInputNeeded()",
"constructor": false,
"full_signature": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public void transformationCreationInputNeeded()",
"identifier": "transformationCreationInputNeeded",
"invocations": [
"createTransformation",
"assertTrue",
"isPresent",
"getTransformation",
"assertNotNull",
"assertEquals",
"getState"
],
"modifiers": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public",
"parameters": "()",
"return": "void",
"signature": "void transformationCreationInputNeeded()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "private final",
"original_string": "private final CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "pluginService",
"modifier": "private final",
"original_string": "private final PluginService pluginService;",
"type": "PluginService",
"var_name": "pluginService"
},
{
"declarator": "artifactService",
"modifier": "private final",
"original_string": "private final ArtifactService artifactService;",
"type": "ArtifactService",
"var_name": "artifactService"
},
{
"declarator": "tasks = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Transformation, Future<?>> tasks = new HashMap<>();",
"type": "Map<Transformation, Future<?>>",
"var_name": "tasks"
},
{
"declarator": "executor = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executor = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationServiceImpl.java",
"identifier": "TransformationServiceImpl",
"interfaces": "implements TransformationService",
"methods": [
{
"class_method_signature": "TransformationServiceImpl.TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"constructor": true,
"full_signature": "@Autowired public TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"identifier": "TransformationServiceImpl",
"modifiers": "@Autowired public",
"parameters": "(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"return": "",
"signature": " TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Transformation createTransformation(Csar csar, Platform targetPlatform) throws PlatformNotFoundException {\n return transformationDao.create(csar, targetPlatform);\n }",
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"invocations": [
"create"
],
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_25 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ZipUtilityTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ZipUtilityTest.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "FILE_SIZE = 1024",
"modifier": "private static final",
"original_string": "private static final int FILE_SIZE = 1024;",
"type": "int",
"var_name": "FILE_SIZE"
},
{
"declarator": "original",
"modifier": "private",
"original_string": "private File original;",
"type": "File",
"var_name": "original"
},
{
"declarator": "unzipped",
"modifier": "private",
"original_string": "private File unzipped;",
"type": "File",
"var_name": "unzipped"
},
{
"declarator": "rnd = new Random(123456)",
"modifier": "private final",
"original_string": "private final Random rnd = new Random(123456);",
"type": "Random",
"var_name": "rnd"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/util/ZipUtilityTest.java",
"identifier": "ZipUtilityTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void unzipNotAFile() throws IOException {\n ZipInputStream is = new ZipInputStream(new FileInputStream(TestCsars.VALID_LAMP_INPUT_TEMPLATE));\n boolean result = ZipUtility.unzip(is, tmpdir.toString());\n assertFalse(result);\n }",
"class_method_signature": "ZipUtilityTest.unzipNotAFile()",
"constructor": false,
"full_signature": "@Test public void unzipNotAFile()",
"identifier": "unzipNotAFile",
"invocations": [
"unzip",
"toString",
"assertFalse"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void unzipNotAFile()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ZipUtility.class.getName())",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(ZipUtility.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "BUFFER_SIZE = 4096",
"modifier": "private static final",
"original_string": "private static final int BUFFER_SIZE = 4096;",
"type": "int",
"var_name": "BUFFER_SIZE"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/util/ZipUtility.java",
"identifier": "ZipUtility",
"interfaces": "",
"methods": [
{
"class_method_signature": "ZipUtility.unzip(ZipInputStream zipIn, String destDirectory)",
"constructor": false,
"full_signature": "public static boolean unzip(ZipInputStream zipIn, String destDirectory)",
"identifier": "unzip",
"modifiers": "public static",
"parameters": "(ZipInputStream zipIn, String destDirectory)",
"return": "boolean",
"signature": "boolean unzip(ZipInputStream zipIn, String destDirectory)",
"testcase": false
},
{
"class_method_signature": "ZipUtility.extractFile(ZipInputStream zipIn, String filePath)",
"constructor": false,
"full_signature": "private static void extractFile(ZipInputStream zipIn, String filePath)",
"identifier": "extractFile",
"modifiers": "private static",
"parameters": "(ZipInputStream zipIn, String filePath)",
"return": "void",
"signature": "void extractFile(ZipInputStream zipIn, String filePath)",
"testcase": false
},
{
"class_method_signature": "ZipUtility.compressDirectory(File directory, OutputStream output)",
"constructor": false,
"full_signature": "public static void compressDirectory(File directory, OutputStream output)",
"identifier": "compressDirectory",
"modifiers": "public static",
"parameters": "(File directory, OutputStream output)",
"return": "void",
"signature": "void compressDirectory(File directory, OutputStream output)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static boolean unzip(ZipInputStream zipIn, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipEntry entry = zipIn.getNextEntry();\n if (entry == null) {\n return false;\n }\n while (entry != null) {\n String filePath = destDirectory + File.separator + entry.getName();\n if (!entry.isDirectory()) {\n extractFile(zipIn, filePath);\n } else {\n logger.trace(\"Creating directory: {}\", filePath);\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n return true;\n }",
"class_method_signature": "ZipUtility.unzip(ZipInputStream zipIn, String destDirectory)",
"constructor": false,
"full_signature": "public static boolean unzip(ZipInputStream zipIn, String destDirectory)",
"identifier": "unzip",
"invocations": [
"exists",
"mkdir",
"getNextEntry",
"getName",
"isDirectory",
"extractFile",
"trace",
"mkdir",
"closeEntry",
"getNextEntry",
"close"
],
"modifiers": "public static",
"parameters": "(ZipInputStream zipIn, String destDirectory)",
"return": "boolean",
"signature": "boolean unzip(ZipInputStream zipIn, String destDirectory)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_8 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void deleteTransformation() throws Exception {\n preInitNonCreationTests();\n //Set the return value of the delete method\n when(transformationService.deleteTransformation(any(Transformation.class))).thenReturn(true);\n //Execute Request\n mvc.perform(\n delete(DELETE_TRANSFORMATION_VALID_URL)\n ).andDo(print())\n .andExpect(status().is(200))\n .andReturn();\n }",
"class_method_signature": "TransformationControllerTest.deleteTransformation()",
"constructor": false,
"full_signature": "@Test public void deleteTransformation()",
"identifier": "deleteTransformation",
"invocations": [
"preInitNonCreationTests",
"thenReturn",
"when",
"deleteTransformation",
"any",
"andReturn",
"andExpect",
"andDo",
"perform",
"delete",
"print",
"is",
"status"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void deleteTransformation()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@RequestMapping(\n path = \"/{platform}/delete\",\n method = RequestMethod.DELETE,\n produces = \"application/hal+json\"\n )\n @ApiOperation(\n value = \"Delete a transformation\",\n tags = {\"transformations\"},\n notes = \"Deletes a transformation and all the coresponding artifacts\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\"\n ),\n @ApiResponse(\n code = 400,\n message = \"The Deletion of the csar failed\",\n response = Void.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a Transformation for the specified platform.\",\n response = RestErrorResponse.class\n )\n })\n public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n ) {\n Csar csar = findByCsarId(name);\n Transformation transformation = findTransformationByPlatform(csar, platform);\n\n if (transformationService.deleteTransformation(transformation)) {\n // return 200 if the deletion was successful\n return ResponseEntity.ok().build();\n } else {\n // return 400 if the deletion failed\n return ResponseEntity.status(400).build();\n }\n }",
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"invocations": [
"findByCsarId",
"findTransformationByPlatform",
"deleteTransformation",
"build",
"ok",
"build",
"status"
],
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_33 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void readSuccessful() throws IOException {\n String path = \"file\";\n File file = new File(sourceDir, path);\n InputStream inputStream = IOUtils.toInputStream(fileContent, \"UTF-8\");\n FileUtils.copyInputStreamToFile(inputStream, file);\n String result = access.read(path);\n\n assertNotNull(result);\n\n assertEquals(fileContent, result);\n }",
"class_method_signature": "PluginFileAccessTest.readSuccessful()",
"constructor": false,
"full_signature": "@Test public void readSuccessful()",
"identifier": "readSuccessful",
"invocations": [
"toInputStream",
"copyInputStreamToFile",
"read",
"assertNotNull",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void readSuccessful()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String read(String relativePath) throws IOException {\n File source = new File(sourceDir, relativePath);\n try {\n return FileUtils.readFileToString(source);\n } catch (IOException e) {\n logger.error(\"Failed to read content from file '{}'\", source);\n throw e;\n }\n }",
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"invocations": [
"readFileToString",
"error"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_26 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void copyFile() throws Exception {\n String filename = \"testFile\";\n File file = new File(sourceDir, \"testFile\");\n file.createNewFile();\n File expectedFile = new File(targetDir, filename);\n\n assertFalse(expectedFile.exists());\n access.copy(filename);\n assertTrue(expectedFile.exists());\n }",
"class_method_signature": "PluginFileAccessTest.copyFile()",
"constructor": false,
"full_signature": "@Test public void copyFile()",
"identifier": "copyFile",
"invocations": [
"createNewFile",
"assertFalse",
"exists",
"copy",
"assertTrue",
"exists"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void copyFile()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void copy(String relativePath) throws IOException {\n copy(relativePath, relativePath);\n }",
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"invocations": [
"copy"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_30 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void write() throws Exception {\n String secondString = \"second_test_string\";\n access.access(targetFileName).appendln(fileContent).close();\n access.access(targetFileName).append(secondString).close();\n assertTrue(targetFile.isFile());\n List<String> result = IOUtils.readLines(new FileInputStream(targetFile));\n assertEquals(fileContent, result.get(result.size() - 2));\n assertEquals(secondString, result.get(result.size() - 1));\n }",
"class_method_signature": "PluginFileAccessTest.write()",
"constructor": false,
"full_signature": "@Test public void write()",
"identifier": "write",
"invocations": [
"close",
"appendln",
"access",
"close",
"append",
"access",
"assertTrue",
"isFile",
"readLines",
"assertEquals",
"get",
"size",
"assertEquals",
"get",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void write()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public BufferedLineWriter access(String relativePath) throws IOException {\n File target = new File(targetDir, relativePath);\n target.getParentFile().mkdirs();\n try {\n return new BufferedLineWriter(new FileWriter(target, true));\n } catch (FileNotFoundException e) {\n logger.error(\"Failed to create OutputStream for file '{}'\", target);\n throw e;\n }\n }",
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"invocations": [
"mkdirs",
"getParentFile",
"error"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_47 | {
"fields": [
{
"declarator": "WAIT_DELAY_MS = 100",
"modifier": "private static final",
"original_string": "private static final int WAIT_DELAY_MS = 100;",
"type": "int",
"var_name": "WAIT_DELAY_MS"
},
{
"declarator": "TEST_EXECUTION_TIMEOUT_MS = 10000",
"modifier": "private static final",
"original_string": "private static final int TEST_EXECUTION_TIMEOUT_MS = 10000;",
"type": "int",
"var_name": "TEST_EXECUTION_TIMEOUT_MS"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationServiceImplTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TransformationServiceImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "service",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TransformationService service;",
"type": "TransformationService",
"var_name": "service"
},
{
"declarator": "testCsars",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TestCsars testCsars;",
"type": "TestCsars",
"var_name": "testCsars"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationServiceImplTest.java",
"identifier": "TransformationServiceImplTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test(expected = PlatformNotFoundException.class)\n public void transformationCreationPlatformNotFound() throws PlatformNotFoundException {\n service.createTransformation(csar, PLATFORM_NOT_SUPPORTED);\n }",
"class_method_signature": "TransformationServiceImplTest.transformationCreationPlatformNotFound()",
"constructor": false,
"full_signature": "@Test(expected = PlatformNotFoundException.class) public void transformationCreationPlatformNotFound()",
"identifier": "transformationCreationPlatformNotFound",
"invocations": [
"createTransformation"
],
"modifiers": "@Test(expected = PlatformNotFoundException.class) public",
"parameters": "()",
"return": "void",
"signature": "void transformationCreationPlatformNotFound()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "private final",
"original_string": "private final CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "pluginService",
"modifier": "private final",
"original_string": "private final PluginService pluginService;",
"type": "PluginService",
"var_name": "pluginService"
},
{
"declarator": "artifactService",
"modifier": "private final",
"original_string": "private final ArtifactService artifactService;",
"type": "ArtifactService",
"var_name": "artifactService"
},
{
"declarator": "tasks = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Transformation, Future<?>> tasks = new HashMap<>();",
"type": "Map<Transformation, Future<?>>",
"var_name": "tasks"
},
{
"declarator": "executor = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executor = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationServiceImpl.java",
"identifier": "TransformationServiceImpl",
"interfaces": "implements TransformationService",
"methods": [
{
"class_method_signature": "TransformationServiceImpl.TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"constructor": true,
"full_signature": "@Autowired public TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"identifier": "TransformationServiceImpl",
"modifiers": "@Autowired public",
"parameters": "(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"return": "",
"signature": " TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Transformation createTransformation(Csar csar, Platform targetPlatform) throws PlatformNotFoundException {\n return transformationDao.create(csar, targetPlatform);\n }",
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"invocations": [
"create"
],
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_10 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ReadmeBuilderTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ReadmeBuilderTest.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/util/ReadmeBuilderTest.java",
"identifier": "ReadmeBuilderTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void testBuilderWithMarkdownString() {\n logger.info(\"Initilaizing Readme Builder\");\n ReadmeBuilder builder = new ReadmeBuilder(\"# Hello World\", \"Hello\");\n logger.info(\"Rendering\");\n String result = builder.toString();\n logger.info(\"Rendered: {}\", result);\n assertTrue(result.contains(\"<h1>Hello World</h1>\"));\n assertTrue(result.contains(\"<title>Hello</title>\"));\n }",
"class_method_signature": "ReadmeBuilderTest.testBuilderWithMarkdownString()",
"constructor": false,
"full_signature": "@Test public void testBuilderWithMarkdownString()",
"identifier": "testBuilderWithMarkdownString",
"invocations": [
"info",
"info",
"toString",
"info",
"assertTrue",
"contains",
"assertTrue",
"contains"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testBuilderWithMarkdownString()",
"testcase": true
} | {
"fields": [
{
"declarator": "README_TEMPLATE_PATH = \"/readme-builder/template.html\"",
"modifier": "private static final",
"original_string": "private static final String README_TEMPLATE_PATH = \"/readme-builder/template.html\";",
"type": "String",
"var_name": "README_TEMPLATE_PATH"
},
{
"declarator": "README_TEMPLATE_TITLE_KEY = \"#PAGETITLE#\"",
"modifier": "private static final",
"original_string": "private static final String README_TEMPLATE_TITLE_KEY = \"#PAGETITLE#\";",
"type": "String",
"var_name": "README_TEMPLATE_TITLE_KEY"
},
{
"declarator": "README_TEMPLATE_BODY_KEY = \"#PAGEBODY#\"",
"modifier": "private static final",
"original_string": "private static final String README_TEMPLATE_BODY_KEY = \"#PAGEBODY#\";",
"type": "String",
"var_name": "README_TEMPLATE_BODY_KEY"
},
{
"declarator": "logger = LoggerFactory.getLogger(ReadmeBuilder.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ReadmeBuilder.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "TEMPLATE",
"modifier": "private static",
"original_string": "private static String TEMPLATE;",
"type": "String",
"var_name": "TEMPLATE"
},
{
"declarator": "markdownText",
"modifier": "private",
"original_string": "private String markdownText;",
"type": "String",
"var_name": "markdownText"
},
{
"declarator": "pageTitle",
"modifier": "private",
"original_string": "private String pageTitle;",
"type": "String",
"var_name": "pageTitle"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/util/ReadmeBuilder.java",
"identifier": "ReadmeBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "ReadmeBuilder.ReadmeBuilder(String markdownText, String pageTitle)",
"constructor": true,
"full_signature": "public ReadmeBuilder(String markdownText, String pageTitle)",
"identifier": "ReadmeBuilder",
"modifiers": "public",
"parameters": "(String markdownText, String pageTitle)",
"return": "",
"signature": " ReadmeBuilder(String markdownText, String pageTitle)",
"testcase": false
},
{
"class_method_signature": "ReadmeBuilder.fromMarkdownResource(String title, String path, TransformationContext context)",
"constructor": false,
"full_signature": "public static ReadmeBuilder fromMarkdownResource(String title, String path, TransformationContext context)",
"identifier": "fromMarkdownResource",
"modifiers": "public static",
"parameters": "(String title, String path, TransformationContext context)",
"return": "ReadmeBuilder",
"signature": "ReadmeBuilder fromMarkdownResource(String title, String path, TransformationContext context)",
"testcase": false
},
{
"class_method_signature": "ReadmeBuilder.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public String toString() {\n Parser markdownParser = Parser.builder().build();\n Node markdownDocument = markdownParser.parse(this.markdownText);\n HtmlRenderer renderer = HtmlRenderer.builder().build();\n\n return TEMPLATE.replace(README_TEMPLATE_TITLE_KEY, this.pageTitle)\n .replace(README_TEMPLATE_BODY_KEY, renderer.render(markdownDocument));\n }",
"class_method_signature": "ReadmeBuilder.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
"build",
"builder",
"parse",
"build",
"builder",
"replace",
"replace",
"render"
],
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_51 | {
"fields": [
{
"declarator": "WAIT_DELAY_MS = 100",
"modifier": "private static final",
"original_string": "private static final int WAIT_DELAY_MS = 100;",
"type": "int",
"var_name": "WAIT_DELAY_MS"
},
{
"declarator": "TEST_EXECUTION_TIMEOUT_MS = 10000",
"modifier": "private static final",
"original_string": "private static final int TEST_EXECUTION_TIMEOUT_MS = 10000;",
"type": "int",
"var_name": "TEST_EXECUTION_TIMEOUT_MS"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationServiceImplTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TransformationServiceImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "service",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TransformationService service;",
"type": "TransformationService",
"var_name": "service"
},
{
"declarator": "testCsars",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TestCsars testCsars;",
"type": "TestCsars",
"var_name": "testCsars"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationServiceImplTest.java",
"identifier": "TransformationServiceImplTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS)\n public void deleteTransformation() throws Exception {\n Transformation transformation = new TransformationImpl(csar, PLATFORM1, log, modelMock());\n csar.getTransformations().put(PLATFORM1.id, transformation);\n service.deleteTransformation(transformation);\n\n assertFalse(csar.getTransformations().containsValue(transformation));\n }",
"class_method_signature": "TransformationServiceImplTest.deleteTransformation()",
"constructor": false,
"full_signature": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public void deleteTransformation()",
"identifier": "deleteTransformation",
"invocations": [
"modelMock",
"put",
"getTransformations",
"deleteTransformation",
"assertFalse",
"containsValue",
"getTransformations"
],
"modifiers": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public",
"parameters": "()",
"return": "void",
"signature": "void deleteTransformation()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "private final",
"original_string": "private final CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "pluginService",
"modifier": "private final",
"original_string": "private final PluginService pluginService;",
"type": "PluginService",
"var_name": "pluginService"
},
{
"declarator": "artifactService",
"modifier": "private final",
"original_string": "private final ArtifactService artifactService;",
"type": "ArtifactService",
"var_name": "artifactService"
},
{
"declarator": "tasks = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Transformation, Future<?>> tasks = new HashMap<>();",
"type": "Map<Transformation, Future<?>>",
"var_name": "tasks"
},
{
"declarator": "executor = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executor = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationServiceImpl.java",
"identifier": "TransformationServiceImpl",
"interfaces": "implements TransformationService",
"methods": [
{
"class_method_signature": "TransformationServiceImpl.TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"constructor": true,
"full_signature": "@Autowired public TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"identifier": "TransformationServiceImpl",
"modifiers": "@Autowired public",
"parameters": "(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"return": "",
"signature": " TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public boolean deleteTransformation(Transformation transformation) {\n if (transformation.getState() == TransformationState.TRANSFORMING) {\n return false;\n }\n transformationDao.delete(transformation);\n tasks.remove(transformation);\n return true;\n }",
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"invocations": [
"getState",
"delete",
"remove"
],
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_7 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void getInputsTest2() throws Exception {\n preInitNonCreationTests();\n //Set a SimpleProperty value\n String inputKey = \"secret_input\";\n String inputValue = \"geheim\";\n csarService.getCsar(VALID_CSAR_NAME)\n .get().getTransformation(VALID_PLATFORM_NAME).get()\n .getInputs().set(inputKey, inputValue);\n //Perform a request\n MvcResult result = mvc.perform(\n get(INPUTS_VALID_URL)\n ).andDo(print())\n .andExpect(status().is(200))\n .andExpect(content().contentType(DEFAULT_CHARSET_HAL_JSON))\n .andReturn();\n // Check if only one value is set (the one that has been set above) and the others are not!\n JSONArray obj = new JSONObject(result.getResponse().getContentAsString()).getJSONArray(\"inputs\");\n boolean valueFound = false;\n boolean restNull = true;\n for (int i = 0; i < obj.length(); i++) {\n JSONObject content = obj.getJSONObject(i);\n if (content.getString(\"key\").equals(inputKey)) {\n valueFound = content.getString(\"value\").equals(inputValue);\n } else {\n restNull = restNull && (content.isNull(\"value\")\n || content.getString(\"value\").equals(INPUT_TEST_DEFAULT_VALUE));\n }\n }\n assertTrue(\"Could not find valid value in property list\", valueFound);\n assertTrue(\"Not all other values in property list are null or equal to the default value\", restNull);\n }",
"class_method_signature": "TransformationControllerTest.getInputsTest2()",
"constructor": false,
"full_signature": "@Test public void getInputsTest2()",
"identifier": "getInputsTest2",
"invocations": [
"preInitNonCreationTests",
"set",
"getInputs",
"get",
"getTransformation",
"get",
"getCsar",
"andReturn",
"andExpect",
"andExpect",
"andDo",
"perform",
"get",
"print",
"is",
"status",
"contentType",
"content",
"getJSONArray",
"getContentAsString",
"getResponse",
"length",
"getJSONObject",
"equals",
"getString",
"equals",
"getString",
"isNull",
"equals",
"getString",
"assertTrue",
"assertTrue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getInputsTest2()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@RequestMapping(\n path = \"/{platform}/inputs\",\n method = RequestMethod.GET,\n produces = \"application/hal+json\"\n )\n @ApiOperation(\n value = \"Retrieve the inputs of this transformation\",\n tags = {\"transformations\"},\n notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" +\n \"If the input is invalid it has to be set in order to proceed with \" +\n \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" +\n \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" +\n \"is returned\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\",\n response = GetInputsResponse.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a Transformation for the specified platform.\",\n response = RestErrorResponse.class\n )\n })\n public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n ) {\n Csar csar = findByCsarId(csarId);\n Transformation transformation = findTransformationByPlatform(csar, platformId);\n List<InputWrap> inputWrapList = toPropertyWrapList(transformation.getInputs(), null);\n GetInputsResponse response = new GetInputsResponse(csarId, platformId, inputWrapList);\n return ResponseEntity.ok(response);\n }",
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"invocations": [
"findByCsarId",
"findTransformationByPlatform",
"toPropertyWrapList",
"getInputs",
"ok"
],
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_6 | {
"fields": [
{
"declarator": "INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"name_input\\\",\\n\" +\n \" \\\"type\\\": \\\"name\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"myname\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_VALID"
},
{
"declarator": "INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_INVALID = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"Hallo\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"type\\\": \\\"unsigned_integer\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" \\\"value\\\": \\\"-111\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_INVALID"
},
{
"declarator": "INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_MISSING_VALUE = \"{\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"key\\\": \\\"text_input\\\",\\n\" +\n \" \\\"type\\\": \\\"text\\\",\\n\" +\n \" \\\"required\\\": true,\\n\" +\n \" \\\"description\\\": \\\"\\\",\\n\" +\n \" },\\n\" +\n \" ],\\n\" +\n \" \\\"_links\\\": {\\n\" +\n \" \\\"self\\\": {\\n\" +\n \" \\\"href\\\": \\\"http://localhost:8080/csars/mongo-db/transformations/p-a/inputs\\\"\\n\" +\n \" }\\n\" +\n \" } \" +\n \"}\";",
"type": "String",
"var_name": "INPUTS_MISSING_VALUE"
},
{
"declarator": "VALID_CSAR_NAME = \"kubernetes-cluster\"",
"modifier": "private final static",
"original_string": "private final static String VALID_CSAR_NAME = \"kubernetes-cluster\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "VALID_PLATFORM_NAME = \"p-a\"",
"modifier": "private final static",
"original_string": "private final static String VALID_PLATFORM_NAME = \"p-a\";",
"type": "String",
"var_name": "VALID_PLATFORM_NAME"
},
{
"declarator": "START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\"",
"modifier": "private final static",
"original_string": "private final static String START_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/start\";",
"type": "String",
"var_name": "START_TRANSFORMATION_VALID_URL"
},
{
"declarator": "INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\"",
"modifier": "private final static",
"original_string": "private final static String INPUTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/inputs\";",
"type": "String",
"var_name": "INPUTS_VALID_URL"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String ARTIFACT_RESPONSE_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "ARTIFACT_RESPONSE_EXPECTED_URL"
},
{
"declarator": "GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\"",
"modifier": "private final static",
"original_string": "private final static String GET_ARTIFACTS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/artifact\";",
"type": "String",
"var_name": "GET_ARTIFACTS_VALID_URL"
},
{
"declarator": "GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_AT_START_ZERO_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=0\";",
"type": "String",
"var_name": "GET_LOGS_AT_START_ZERO_VALID_URL"
},
{
"declarator": "GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\"",
"modifier": "private final static",
"original_string": "private final static String GET_LOGS_NEGATIVE_START_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/logs?start=-1\";",
"type": "String",
"var_name": "GET_LOGS_NEGATIVE_START_URL"
},
{
"declarator": "DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\"",
"modifier": "private final static",
"original_string": "private final static String DELETE_TRANSFORMATION_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/delete\";",
"type": "String",
"var_name": "DELETE_TRANSFORMATION_VALID_URL"
},
{
"declarator": "TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\"",
"modifier": "private final static",
"original_string": "private final static String TRANSFORMATION_DETAILS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a\";",
"type": "String",
"var_name": "TRANSFORMATION_DETAILS_VALID_URL"
},
{
"declarator": "APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\"",
"modifier": "private final static",
"original_string": "private final static String APPLICATION_HAL_JSON_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "APPLICATION_HAL_JSON_MIME_TYPE"
},
{
"declarator": "LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_VALID_URL"
},
{
"declarator": "LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\"",
"modifier": "private final static",
"original_string": "private final static String LIST_TRANSFORMATIONS_EXPECTED_URL = \"http://localhost/api/csars/kubernetes-cluster/transformations/\";",
"type": "String",
"var_name": "LIST_TRANSFORMATIONS_EXPECTED_URL"
},
{
"declarator": "CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\"",
"modifier": "private final static",
"original_string": "private final static String CREATE_CSAR_VALID_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/create\";",
"type": "String",
"var_name": "CREATE_CSAR_VALID_URL"
},
{
"declarator": "PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\"",
"modifier": "private final static",
"original_string": "private final static String PLATFORM_NOT_FOUND_URL = \"/api/csars/kubernetes-cluster/transformations/p-z\";",
"type": "String",
"var_name": "PLATFORM_NOT_FOUND_URL"
},
{
"declarator": "GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\"",
"modifier": "private final static",
"original_string": "private final static String GET_OUTPUT_URL = \"/api/csars/kubernetes-cluster/transformations/p-a/outputs\";",
"type": "String",
"var_name": "GET_OUTPUT_URL"
},
{
"declarator": "CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\"",
"modifier": "private final static",
"original_string": "private final static String CSAR_NOT_FOUND_URL = \"/api/csars/keinechtescsar/transformations\";",
"type": "String",
"var_name": "CSAR_NOT_FOUND_URL"
},
{
"declarator": "CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"}",
"modifier": "private static final",
"original_string": "private static final String[] CSAR_NAMES = new String[]{\"kubernetes-cluster\", \"apache-test\", \"mongo-db\"};",
"type": "String[]",
"var_name": "CSAR_NAMES"
},
{
"declarator": "SECOND_VALID_PLATFORM_NAME = \"p-b\"",
"modifier": "private static final",
"original_string": "private static final String SECOND_VALID_PLATFORM_NAME = \"p-b\";",
"type": "String",
"var_name": "SECOND_VALID_PLATFORM_NAME"
},
{
"declarator": "INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_TEST_DEFAULT_VALUE = \"Test-Default-Value\";",
"type": "String",
"var_name": "INPUT_TEST_DEFAULT_VALUE"
},
{
"declarator": "PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_TEST_DEFAULT_VALUE_KEY = \"default_value_property\";",
"type": "String",
"var_name": "PROPERTY_TEST_DEFAULT_VALUE_KEY"
},
{
"declarator": "csarService",
"modifier": "private",
"original_string": "private CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private",
"original_string": "private TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private",
"original_string": "private PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/TransformationControllerTest.java",
"identifier": "TransformationControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void getInputsTest() throws Exception {\n preInitNonCreationTests();\n MvcResult result = mvc.perform(\n get(INPUTS_VALID_URL)\n ).andDo(print())\n .andExpect(status().is(200))\n .andExpect(content().contentType(DEFAULT_CHARSET_HAL_JSON))\n .andExpect(jsonPath(\"$.inputs\").isArray())\n .andExpect(jsonPath(\"$.inputs\").isNotEmpty())\n .andExpect(jsonPath(\"$.inputs[0].key\").isString())\n .andExpect(jsonPath(\"$.inputs[0].type\").isString())\n .andExpect(jsonPath(\"$.inputs[0].description\").isString())\n .andExpect(jsonPath(\"$.inputs[0].required\").isBoolean())\n .andExpect(jsonPath(\"$.links[0].rel\").value(\"self\"))\n .andExpect(jsonPath(\"$.links[0].href\")\n .value(\"http://localhost/api/csars/kubernetes-cluster/transformations/p-a/inputs\"))\n .andReturn();\n\n MockHttpServletResponse response = result.getResponse();\n String responseJson = new String(response.getContentAsByteArray());\n String[] values = JsonPath.parse(responseJson).read(\"$.inputs[*].value\", String[].class);\n long nullCount = Arrays.asList(values).stream().filter(Objects::isNull).count();\n long testCount = Arrays.asList(values).stream().filter(e -> e != null && e.equals(INPUT_TEST_DEFAULT_VALUE)).count();\n assertEquals(8, nullCount);\n assertEquals(1, testCount);\n }",
"class_method_signature": "TransformationControllerTest.getInputsTest()",
"constructor": false,
"full_signature": "@Test public void getInputsTest()",
"identifier": "getInputsTest",
"invocations": [
"preInitNonCreationTests",
"andReturn",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andExpect",
"andDo",
"perform",
"get",
"print",
"is",
"status",
"contentType",
"content",
"isArray",
"jsonPath",
"isNotEmpty",
"jsonPath",
"isString",
"jsonPath",
"isString",
"jsonPath",
"isString",
"jsonPath",
"isBoolean",
"jsonPath",
"value",
"jsonPath",
"value",
"jsonPath",
"getResponse",
"getContentAsByteArray",
"read",
"parse",
"count",
"filter",
"stream",
"asList",
"count",
"filter",
"stream",
"asList",
"equals",
"assertEquals",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getInputsTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
},
{
"declarator": "transformationService",
"modifier": "private final",
"original_string": "private final TransformationService transformationService;",
"type": "TransformationService",
"var_name": "transformationService"
},
{
"declarator": "platformService",
"modifier": "private final",
"original_string": "private final PlatformService platformService;",
"type": "PlatformService",
"var_name": "platformService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/TransformationController.java",
"identifier": "TransformationController",
"interfaces": "",
"methods": [
{
"class_method_signature": "TransformationController.TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"constructor": true,
"full_signature": "@Autowired public TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"identifier": "TransformationController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"return": "",
"signature": " TransformationController(CsarService csarService,\n TransformationService transformationService,\n PlatformService platformService)",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"identifier": "getCSARTransformations",
"modifiers": "@RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"List all transformations of a CSAR\", tags = {\"transformations\", \"csars\"}, notes = \"Returns a HAL-Resources list containing all Transformations for a specific CSAR\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = TransformationResources.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"return": "ResponseEntity<Resources<TransformationResponse>>",
"signature": "ResponseEntity<Resources<TransformationResponse>> getCSARTransformations(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "getCSARTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get details for a specific transformation\", tags = {\"transformations\"}, notes = \"Returns a HAL-Resource Containing the details for the transformation with the given parameters\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<TransformationResponse>",
"signature": "ResponseEntity<TransformationResponse> getCSARTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "addTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/create\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/hal+json\" ) @ApiOperation( value = \"Create a new Transformation\", tags = {\"transformations\"}, notes = \"Creates a new transformation for the given CSAR and Platform \" + \"(If the platform does not exist and there is no other transformation with the same CSAR and Platform, \" + \"you have to delete the old transformation in this case)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The transfomation could not get created because there already is a Transformation\" + \" of this CSAR on the given Platform\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the platform is not known.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> addTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "startTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/start\", method = RequestMethod.POST, produces = \"application/hal+json\" ) @ApiOperation( value = \"Start a Transformation\", tags = {\"transformations\"}, notes = \"Starts a transformation that has been created and is ready to get started. To start a transformation, the \" + \"Transformation has to be in the state READY otherwise the transformation cannot start.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The state of the transformation is illegal. This means that the transformation is not in the\" + \"READY state. Therefore starting it is not possible\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity",
"signature": "ResponseEntity startTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"identifier": "deleteTransformation",
"modifiers": "@RequestMapping( path = \"/{platform}/delete\", method = RequestMethod.DELETE, produces = \"application/hal+json\" ) @ApiOperation( value = \"Delete a transformation\", tags = {\"transformations\"}, notes = \"Deletes a transformation and all the coresponding artifacts\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"The Deletion of the csar failed\", response = Void.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteTransformation(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String name,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getTransformationLogs",
"modifiers": "@RequestMapping( path = \"/{platform}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs for a Transformation\", tags = {\"transformations\"}, notes = \"Returns the logs for a transformation, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getTransformationLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"identifier": "getTransformationArtifact",
"modifiers": "@RequestMapping( path = \"/{platform}/artifact\", method = RequestMethod.GET, produces = \"application/octet-stream\" ) @ApiOperation( value = \"Download the target artifact archive\", tags = {\"transformations\"}, notes = \"Once the transformation is done (in the state DONE) or it has encountered a error (state ERROR). \" + \"It is possible to download a archive (ZIP format) of all the files generated while the transformation was \" + \"running.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\" ), @ApiResponse( code = 400, message = \"There is nothing to download yet because the execution of the transformation has not yet started \" + \"or is not finished (With or without errors)\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> getTransformationArtifact(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarName,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platform,\n HttpServletResponse response\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"identifier": "setInputs",
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = {RequestMethod.POST, RequestMethod.PUT}, produces = \"application/json\" ) @ApiOperation( value = \"Set the value of inputs\", tags = {\"transformations\"}, notes = \"With this method it is possible to set the value of an input or multiple inputs at once. The values \" + \"of inputs can be set as long as they are in the READY or INPUT_REQUIRED state. The transformation changes its state \" + \"to ready once all required inputs have a valid value assigned to them.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = Void.class ), @ApiResponse( code = 400, message = \"Inputs cannot get set once the transformation has been started.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform.\", response = RestErrorResponse.class ), @ApiResponse( code = 406, message = \"At least one of the inputs could not get set because either the key does not exist or the \" + \"syntax validation of the value has failed.\", response = InputsResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"return": "ResponseEntity<InputsResponse>",
"signature": "ResponseEntity<InputsResponse> setInputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId,\n @RequestBody InputsResponse propertiesRequest\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getOutputs",
"modifiers": "@ApiOperation( value = \"Retrieve the outputs and their values\", tags = {\"transformations\"}, notes = \"This operation returns the outputs of a deployment. Retrieval of the outputs is not possible \" + \"if the transformation (including deployment) is not done yet\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetOutputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a transformation for the specified platform\", response = RestErrorResponse.class ), @ApiResponse( code = 400, message = \"The state of the transformation is invalid (not ERROR or DONE)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{platform}/outputs\", method = {RequestMethod.GET}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetOutputsResponse>",
"signature": "ResponseEntity<GetOutputsResponse> getOutputs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
},
{
"class_method_signature": "TransformationController.handleLogIndexLessThanZero()",
"constructor": false,
"full_signature": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public void handleLogIndexLessThanZero()",
"identifier": "handleLogIndexLessThanZero",
"modifiers": "@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = \"Cannot delete csar with running transformations\") @ExceptionHandler(IndexOutOfBoundsException.class) public",
"parameters": "()",
"return": "void",
"signature": "void handleLogIndexLessThanZero()",
"testcase": false
},
{
"class_method_signature": "TransformationController.findByCsarId(String csarId)",
"constructor": false,
"full_signature": "private Csar findByCsarId(String csarId)",
"identifier": "findByCsarId",
"modifiers": "private",
"parameters": "(String csarId)",
"return": "Csar",
"signature": "Csar findByCsarId(String csarId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.findTransformationByPlatform(Csar csar, String platformId)",
"constructor": false,
"full_signature": "private Transformation findTransformationByPlatform(Csar csar, String platformId)",
"identifier": "findTransformationByPlatform",
"modifiers": "private",
"parameters": "(Csar csar, String platformId)",
"return": "Transformation",
"signature": "Transformation findTransformationByPlatform(Csar csar, String platformId)",
"testcase": false
},
{
"class_method_signature": "TransformationController.toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"constructor": false,
"full_signature": "private List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"identifier": "toPropertyWrapList",
"modifiers": "private",
"parameters": "(PropertyInstance instance, Set<String> validKeys)",
"return": "List<InputWrap>",
"signature": "List<InputWrap> toPropertyWrapList(PropertyInstance instance, Set<String> validKeys)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@RequestMapping(\n path = \"/{platform}/inputs\",\n method = RequestMethod.GET,\n produces = \"application/hal+json\"\n )\n @ApiOperation(\n value = \"Retrieve the inputs of this transformation\",\n tags = {\"transformations\"},\n notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" +\n \"If the input is invalid it has to be set in order to proceed with \" +\n \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" +\n \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" +\n \"is returned\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The operation was executed successfully\",\n response = GetInputsResponse.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given identifier or the CSAR does not have \" +\n \"a Transformation for the specified platform.\",\n response = RestErrorResponse.class\n )\n })\n public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n ) {\n Csar csar = findByCsarId(csarId);\n Transformation transformation = findTransformationByPlatform(csar, platformId);\n List<InputWrap> inputWrapList = toPropertyWrapList(transformation.getInputs(), null);\n GetInputsResponse response = new GetInputsResponse(csarId, platformId, inputWrapList);\n return ResponseEntity.ok(response);\n }",
"class_method_signature": "TransformationController.getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"identifier": "getInputs",
"invocations": [
"findByCsarId",
"findTransformationByPlatform",
"toPropertyWrapList",
"getInputs",
"ok"
],
"modifiers": "@RequestMapping( path = \"/{platform}/inputs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Retrieve the inputs of this transformation\", tags = {\"transformations\"}, notes = \"This Operation returns a list of inputs, specific to the csar and the platform. \" + \"If the input is invalid it has to be set in order to proceed with \" + \"starting the transformation. Setting the inputs is done with a POST or PUT to the same URL \" + \"(See Set Inputs Operation). If Transformation does not have any inputs, an empty array \" + \"is returned\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = GetInputsResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier or the CSAR does not have \" + \"a Transformation for the specified platform.\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"return": "ResponseEntity<GetInputsResponse>",
"signature": "ResponseEntity<GetInputsResponse> getInputs(\n @ApiParam(value = \"The identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"csarId\") String csarId,\n @ApiParam(value = \"The identifier for the platform\", required = true, example = \"kubernetes\")\n @PathVariable(name = \"platform\") String platformId\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_50 | {
"fields": [
{
"declarator": "WAIT_DELAY_MS = 100",
"modifier": "private static final",
"original_string": "private static final int WAIT_DELAY_MS = 100;",
"type": "int",
"var_name": "WAIT_DELAY_MS"
},
{
"declarator": "TEST_EXECUTION_TIMEOUT_MS = 10000",
"modifier": "private static final",
"original_string": "private static final int TEST_EXECUTION_TIMEOUT_MS = 10000;",
"type": "int",
"var_name": "TEST_EXECUTION_TIMEOUT_MS"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationServiceImplTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TransformationServiceImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "service",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TransformationService service;",
"type": "TransformationService",
"var_name": "service"
},
{
"declarator": "testCsars",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TestCsars testCsars;",
"type": "TestCsars",
"var_name": "testCsars"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationServiceImplTest.java",
"identifier": "TransformationServiceImplTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS)\n public void stopNotStarted() throws Exception {\n transformationCreationNoProps();\n Transformation t = csar.getTransformations().get(PASSING_DUMMY.getPlatform().id);\n assertFalse(service.abortTransformation(t));\n }",
"class_method_signature": "TransformationServiceImplTest.stopNotStarted()",
"constructor": false,
"full_signature": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public void stopNotStarted()",
"identifier": "stopNotStarted",
"invocations": [
"transformationCreationNoProps",
"get",
"getTransformations",
"getPlatform",
"assertFalse",
"abortTransformation"
],
"modifiers": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public",
"parameters": "()",
"return": "void",
"signature": "void stopNotStarted()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "private final",
"original_string": "private final CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "pluginService",
"modifier": "private final",
"original_string": "private final PluginService pluginService;",
"type": "PluginService",
"var_name": "pluginService"
},
{
"declarator": "artifactService",
"modifier": "private final",
"original_string": "private final ArtifactService artifactService;",
"type": "ArtifactService",
"var_name": "artifactService"
},
{
"declarator": "tasks = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Transformation, Future<?>> tasks = new HashMap<>();",
"type": "Map<Transformation, Future<?>>",
"var_name": "tasks"
},
{
"declarator": "executor = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executor = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationServiceImpl.java",
"identifier": "TransformationServiceImpl",
"interfaces": "implements TransformationService",
"methods": [
{
"class_method_signature": "TransformationServiceImpl.TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"constructor": true,
"full_signature": "@Autowired public TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"identifier": "TransformationServiceImpl",
"modifiers": "@Autowired public",
"parameters": "(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"return": "",
"signature": " TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public boolean abortTransformation(Transformation transformation) {\n Future<?> task = tasks.get(transformation);\n //Return false \n if (task == null) {\n return false;\n }\n //Return false because the transformation has already finished\n if (task.isDone()) {\n return false;\n }\n return task.cancel(true);\n }",
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"invocations": [
"get",
"isDone",
"cancel"
],
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_11 | {
"fields": [
{
"declarator": "plugin",
"modifier": "private static",
"original_string": "private static KubernetesPlugin plugin;",
"type": "KubernetesPlugin",
"var_name": "plugin"
},
{
"declarator": "mapper",
"modifier": "private static",
"original_string": "private static BaseImageMapper mapper;",
"type": "BaseImageMapper",
"var_name": "mapper"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/kubernetes/KubernetesPluginTest.java",
"identifier": "KubernetesPluginTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test(expected = ValidationFailureException.class)\n public void modelCheckTest() throws Exception {\n EffectiveModel singleComputeModel = new EffectiveModelFactory().create(TestCsars.VALID_SINGLE_COMPUTE_WINDOWS_TEMPLATE, logMock());\n TransformationContext context = setUpMockTransformationContext(singleComputeModel);\n KubernetesLifecycle lifecycle = plugin.getInstance(context);\n plugin.transform(lifecycle);\n }",
"class_method_signature": "KubernetesPluginTest.modelCheckTest()",
"constructor": false,
"full_signature": "@Test(expected = ValidationFailureException.class) public void modelCheckTest()",
"identifier": "modelCheckTest",
"invocations": [
"create",
"logMock",
"setUpMockTransformationContext",
"getInstance",
"transform"
],
"modifiers": "@Test(expected = ValidationFailureException.class) public",
"parameters": "()",
"return": "void",
"signature": "void modelCheckTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "DOCKER_PUSH_TO_REGISTRY_PROPERTY_KEY = \"docker_push_to_registry\"",
"modifier": "public static final",
"original_string": "public static final String DOCKER_PUSH_TO_REGISTRY_PROPERTY_KEY = \"docker_push_to_registry\";",
"type": "String",
"var_name": "DOCKER_PUSH_TO_REGISTRY_PROPERTY_KEY"
},
{
"declarator": "DOCKER_REGISTRY_URL_PROPERTY_KEY = \"docker_registry_url\"",
"modifier": "public static final",
"original_string": "public static final String DOCKER_REGISTRY_URL_PROPERTY_KEY = \"docker_registry_url\";",
"type": "String",
"var_name": "DOCKER_REGISTRY_URL_PROPERTY_KEY"
},
{
"declarator": "DOCKER_REGISTRY_USERNAME_PROPERTY_KEY = \"docker_registry_username\"",
"modifier": "public static final",
"original_string": "public static final String DOCKER_REGISTRY_USERNAME_PROPERTY_KEY = \"docker_registry_username\";",
"type": "String",
"var_name": "DOCKER_REGISTRY_USERNAME_PROPERTY_KEY"
},
{
"declarator": "DOCKER_REGISTRY_PASSWORD_PROPERTY_KEY = \"docker_registry_password\"",
"modifier": "public static final",
"original_string": "public static final String DOCKER_REGISTRY_PASSWORD_PROPERTY_KEY = \"docker_registry_password\";",
"type": "String",
"var_name": "DOCKER_REGISTRY_PASSWORD_PROPERTY_KEY"
},
{
"declarator": "DOCKER_REGISTRY_REPOSITORY_PROPERTY_KEY = \"docker_registry_repository\"",
"modifier": "public static final",
"original_string": "public static final String DOCKER_REGISTRY_REPOSITORY_PROPERTY_KEY = \"docker_registry_repository\";",
"type": "String",
"var_name": "DOCKER_REGISTRY_REPOSITORY_PROPERTY_KEY"
},
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final BaseImageMapper mapper;",
"type": "BaseImageMapper",
"var_name": "mapper"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/kubernetes/KubernetesPlugin.java",
"identifier": "KubernetesPlugin",
"interfaces": "",
"methods": [
{
"class_method_signature": "KubernetesPlugin.KubernetesPlugin(BaseImageMapper mapper)",
"constructor": true,
"full_signature": "@Autowired public KubernetesPlugin(BaseImageMapper mapper)",
"identifier": "KubernetesPlugin",
"modifiers": "@Autowired public",
"parameters": "(BaseImageMapper mapper)",
"return": "",
"signature": " KubernetesPlugin(BaseImageMapper mapper)",
"testcase": false
},
{
"class_method_signature": "KubernetesPlugin.getPlatformDetails()",
"constructor": false,
"full_signature": "private static Platform getPlatformDetails()",
"identifier": "getPlatformDetails",
"modifiers": "private static",
"parameters": "()",
"return": "Platform",
"signature": "Platform getPlatformDetails()",
"testcase": false
},
{
"class_method_signature": "KubernetesPlugin.getInstance(TransformationContext context)",
"constructor": false,
"full_signature": "@Override public KubernetesLifecycle getInstance(TransformationContext context)",
"identifier": "getInstance",
"modifiers": "@Override public",
"parameters": "(TransformationContext context)",
"return": "KubernetesLifecycle",
"signature": "KubernetesLifecycle getInstance(TransformationContext context)",
"testcase": false
}
],
"superclass": "extends ToscanaPlugin<KubernetesLifecycle>"
} | {
"body": "@Override\n public KubernetesLifecycle getInstance(TransformationContext context) throws Exception {\n return new KubernetesLifecycle(context, mapper);\n }",
"class_method_signature": "KubernetesPlugin.getInstance(TransformationContext context)",
"constructor": false,
"full_signature": "@Override public KubernetesLifecycle getInstance(TransformationContext context)",
"identifier": "getInstance",
"invocations": [],
"modifiers": "@Override public",
"parameters": "(TransformationContext context)",
"return": "KubernetesLifecycle",
"signature": "KubernetesLifecycle getInstance(TransformationContext context)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_46 | {
"fields": [
{
"declarator": "WAIT_DELAY_MS = 100",
"modifier": "private static final",
"original_string": "private static final int WAIT_DELAY_MS = 100;",
"type": "int",
"var_name": "WAIT_DELAY_MS"
},
{
"declarator": "TEST_EXECUTION_TIMEOUT_MS = 10000",
"modifier": "private static final",
"original_string": "private static final int TEST_EXECUTION_TIMEOUT_MS = 10000;",
"type": "int",
"var_name": "TEST_EXECUTION_TIMEOUT_MS"
},
{
"declarator": "logger = LoggerFactory.getLogger(TransformationServiceImplTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TransformationServiceImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "service",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TransformationService service;",
"type": "TransformationService",
"var_name": "service"
},
{
"declarator": "testCsars",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private TestCsars testCsars;",
"type": "TestCsars",
"var_name": "testCsars"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/TransformationServiceImplTest.java",
"identifier": "TransformationServiceImplTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS)\n public void transformationCreationNoProps() throws Exception {\n Transformation t = service.createTransformation(csar, PASSING_DUMMY.getPlatform());\n assertTrue(csar.getTransformation(PASSING_DUMMY.getPlatform().id).isPresent());\n assertNotNull(t);\n assertEquals(TransformationState.READY, t.getState());\n }",
"class_method_signature": "TransformationServiceImplTest.transformationCreationNoProps()",
"constructor": false,
"full_signature": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public void transformationCreationNoProps()",
"identifier": "transformationCreationNoProps",
"invocations": [
"createTransformation",
"getPlatform",
"assertTrue",
"isPresent",
"getTransformation",
"getPlatform",
"assertNotNull",
"assertEquals",
"getState"
],
"modifiers": "@Test(timeout = TEST_EXECUTION_TIMEOUT_MS) public",
"parameters": "()",
"return": "void",
"signature": "void transformationCreationNoProps()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private final",
"original_string": "private final TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "private final",
"original_string": "private final CsarDao csarDao;",
"type": "CsarDao",
"var_name": "csarDao"
},
{
"declarator": "pluginService",
"modifier": "private final",
"original_string": "private final PluginService pluginService;",
"type": "PluginService",
"var_name": "pluginService"
},
{
"declarator": "artifactService",
"modifier": "private final",
"original_string": "private final ArtifactService artifactService;",
"type": "ArtifactService",
"var_name": "artifactService"
},
{
"declarator": "tasks = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Transformation, Future<?>> tasks = new HashMap<>();",
"type": "Map<Transformation, Future<?>>",
"var_name": "tasks"
},
{
"declarator": "executor = Executors.newSingleThreadExecutor()",
"modifier": "private final",
"original_string": "private final ExecutorService executor = Executors.newSingleThreadExecutor();",
"type": "ExecutorService",
"var_name": "executor"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/TransformationServiceImpl.java",
"identifier": "TransformationServiceImpl",
"interfaces": "implements TransformationService",
"methods": [
{
"class_method_signature": "TransformationServiceImpl.TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"constructor": true,
"full_signature": "@Autowired public TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"identifier": "TransformationServiceImpl",
"modifiers": "@Autowired public",
"parameters": "(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"return": "",
"signature": " TransformationServiceImpl(\n TransformationDao transformationDao,\n PluginService pluginService,\n @Lazy CsarDao csarDao,\n ArtifactService artifactService\n )",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.startTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean startTransformation(Transformation transformation)",
"identifier": "startTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean startTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.abortTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean abortTransformation(Transformation transformation)",
"identifier": "abortTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean abortTransformation(Transformation transformation)",
"testcase": false
},
{
"class_method_signature": "TransformationServiceImpl.deleteTransformation(Transformation transformation)",
"constructor": false,
"full_signature": "@Override public boolean deleteTransformation(Transformation transformation)",
"identifier": "deleteTransformation",
"modifiers": "@Override public",
"parameters": "(Transformation transformation)",
"return": "boolean",
"signature": "boolean deleteTransformation(Transformation transformation)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Transformation createTransformation(Csar csar, Platform targetPlatform) throws PlatformNotFoundException {\n return transformationDao.create(csar, targetPlatform);\n }",
"class_method_signature": "TransformationServiceImpl.createTransformation(Csar csar, Platform targetPlatform)",
"constructor": false,
"full_signature": "@Override public Transformation createTransformation(Csar csar, Platform targetPlatform)",
"identifier": "createTransformation",
"invocations": [
"create"
],
"modifiers": "@Override public",
"parameters": "(Csar csar, Platform targetPlatform)",
"return": "Transformation",
"signature": "Transformation createTransformation(Csar csar, Platform targetPlatform)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_31 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test(expected = IOException.class)\n public void writePathIsDirectoryThrowsException() throws IOException {\n targetFile.mkdir();\n access.access(targetFileName);\n }",
"class_method_signature": "PluginFileAccessTest.writePathIsDirectoryThrowsException()",
"constructor": false,
"full_signature": "@Test(expected = IOException.class) public void writePathIsDirectoryThrowsException()",
"identifier": "writePathIsDirectoryThrowsException",
"invocations": [
"mkdir",
"access"
],
"modifiers": "@Test(expected = IOException.class) public",
"parameters": "()",
"return": "void",
"signature": "void writePathIsDirectoryThrowsException()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public BufferedLineWriter access(String relativePath) throws IOException {\n File target = new File(targetDir, relativePath);\n target.getParentFile().mkdirs();\n try {\n return new BufferedLineWriter(new FileWriter(target, true));\n } catch (FileNotFoundException e) {\n logger.error(\"Failed to create OutputStream for file '{}'\", target);\n throw e;\n }\n }",
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"invocations": [
"mkdirs",
"getParentFile",
"error"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_27 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "sourceDir",
"modifier": "private",
"original_string": "private File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private",
"original_string": "private File targetDir;",
"type": "File",
"var_name": "targetDir"
},
{
"declarator": "fileContent = \"this is a test content\"",
"modifier": "private",
"original_string": "private String fileContent = \"this is a test content\";",
"type": "String",
"var_name": "fileContent"
},
{
"declarator": "targetFileName = \"filename\"",
"modifier": "private",
"original_string": "private String targetFileName = \"filename\";",
"type": "String",
"var_name": "targetFileName"
},
{
"declarator": "targetFile",
"modifier": "private",
"original_string": "private File targetFile;",
"type": "File",
"var_name": "targetFile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/plugin/PluginFileAccessTest.java",
"identifier": "PluginFileAccessTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void copyDirRecursively() throws IOException {\n String dirname = \"dir\";\n File dir = new File(sourceDir, dirname);\n dir.mkdir();\n for (int i = 0; i < 10; i++) {\n new File(dir, String.valueOf(i)).createNewFile();\n }\n\n File expectedDir = new File(targetDir, dirname);\n assertFalse(expectedDir.exists());\n access.copy(dirname);\n assertTrue(expectedDir.exists());\n for (int i = 0; i < 10; i++) {\n assertTrue(new File(expectedDir, String.valueOf(i)).exists());\n }\n }",
"class_method_signature": "PluginFileAccessTest.copyDirRecursively()",
"constructor": false,
"full_signature": "@Test public void copyDirRecursively()",
"identifier": "copyDirRecursively",
"invocations": [
"mkdir",
"createNewFile",
"valueOf",
"assertFalse",
"exists",
"copy",
"assertTrue",
"exists",
"assertTrue",
"exists",
"valueOf"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void copyDirRecursively()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File sourceDir;",
"type": "File",
"var_name": "sourceDir"
},
{
"declarator": "targetDir",
"modifier": "private final",
"original_string": "private final File targetDir;",
"type": "File",
"var_name": "targetDir"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/plugin/PluginFileAccess.java",
"identifier": "PluginFileAccess",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginFileAccess.PluginFileAccess(File sourceDir, File targetDir, Log log)",
"constructor": true,
"full_signature": "public PluginFileAccess(File sourceDir, File targetDir, Log log)",
"identifier": "PluginFileAccess",
"modifiers": "public",
"parameters": "(File sourceDir, File targetDir, Log log)",
"return": "",
"signature": " PluginFileAccess(File sourceDir, File targetDir, Log log)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.copy(String relativeSourcePath, String relativeTargetPath)",
"constructor": false,
"full_signature": "public void copy(String relativeSourcePath, String relativeTargetPath)",
"identifier": "copy",
"modifiers": "public",
"parameters": "(String relativeSourcePath, String relativeTargetPath)",
"return": "void",
"signature": "void copy(String relativeSourcePath, String relativeTargetPath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.access(String relativePath)",
"constructor": false,
"full_signature": "public BufferedLineWriter access(String relativePath)",
"identifier": "access",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedLineWriter",
"signature": "BufferedLineWriter access(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.accessAsOutputStream(String relativePath)",
"constructor": false,
"full_signature": "public BufferedOutputStream accessAsOutputStream(String relativePath)",
"identifier": "accessAsOutputStream",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "BufferedOutputStream",
"signature": "BufferedOutputStream accessAsOutputStream(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.read(String relativePath)",
"constructor": false,
"full_signature": "public String read(String relativePath)",
"identifier": "read",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String read(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.getAbsolutePath(String relativePath)",
"constructor": false,
"full_signature": "public String getAbsolutePath(String relativePath)",
"identifier": "getAbsolutePath",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "String",
"signature": "String getAbsolutePath(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void delete(String relativePath)",
"testcase": false
},
{
"class_method_signature": "PluginFileAccess.createDirectories(String relativePath)",
"constructor": false,
"full_signature": "public void createDirectories(String relativePath)",
"identifier": "createDirectories",
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void createDirectories(String relativePath)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void copy(String relativePath) throws IOException {\n copy(relativePath, relativePath);\n }",
"class_method_signature": "PluginFileAccess.copy(String relativePath)",
"constructor": false,
"full_signature": "public void copy(String relativePath)",
"identifier": "copy",
"invocations": [
"copy"
],
"modifiers": "public",
"parameters": "(String relativePath)",
"return": "void",
"signature": "void copy(String relativePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_41 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LogImplTest.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(LogImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "log",
"modifier": "private",
"original_string": "private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logfile",
"modifier": "private",
"original_string": "private File logfile;",
"type": "File",
"var_name": "logfile"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/transformation/logging/LogImplTest.java",
"identifier": "LogImplTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void getLogsFromOuterBound() throws Exception {\n logger.info(\"Trying to get logs from index 100\");\n assertSame(0, log.getLogEntries(101).size());\n logger.info(\"Done\");\n }",
"class_method_signature": "LogImplTest.getLogsFromOuterBound()",
"constructor": false,
"full_signature": "@Test public void getLogsFromOuterBound()",
"identifier": "getLogsFromOuterBound",
"invocations": [
"info",
"assertSame",
"size",
"getLogEntries",
"info"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getLogsFromOuterBound()",
"testcase": true
} | {
"fields": [
{
"declarator": "exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class)",
"modifier": "private final static",
"original_string": "private final static org.slf4j.Logger exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "exceptionHandlingLogger"
},
{
"declarator": "logEntries = Collections.synchronizedList(new LinkedList<>())",
"modifier": "private final",
"original_string": "private final List<LogEntry> logEntries = Collections.synchronizedList(new LinkedList<>());",
"type": "List<LogEntry>",
"var_name": "logEntries"
},
{
"declarator": "index = new AtomicLong(0)",
"modifier": "private final",
"original_string": "private final AtomicLong index = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "index"
},
{
"declarator": "memoryAppender = new MemoryAppender(this)",
"modifier": "private final",
"original_string": "private final MemoryAppender memoryAppender = new MemoryAppender(this);",
"type": "MemoryAppender",
"var_name": "memoryAppender"
},
{
"declarator": "persistentAppender",
"modifier": "private final",
"original_string": "private final PersistentAppender persistentAppender;",
"type": "PersistentAppender",
"var_name": "persistentAppender"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/transformation/logging/LogImpl.java",
"identifier": "LogImpl",
"interfaces": "implements Log",
"methods": [
{
"class_method_signature": "LogImpl.LogImpl(File logFile)",
"constructor": true,
"full_signature": "public LogImpl(File logFile)",
"identifier": "LogImpl",
"modifiers": "public",
"parameters": "(File logFile)",
"return": "",
"signature": " LogImpl(File logFile)",
"testcase": false
},
{
"class_method_signature": "LogImpl.readLogFromFile(File file)",
"constructor": false,
"full_signature": "private void readLogFromFile(File file)",
"identifier": "readLogFromFile",
"modifiers": "private",
"parameters": "(File file)",
"return": "void",
"signature": "void readLogFromFile(File file)",
"testcase": false
},
{
"class_method_signature": "LogImpl.addLogEntry(LogEntry e)",
"constructor": false,
"full_signature": "@Override public void addLogEntry(LogEntry e)",
"identifier": "addLogEntry",
"modifiers": "@Override public",
"parameters": "(LogEntry e)",
"return": "void",
"signature": "void addLogEntry(LogEntry e)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int first, int last, boolean checkUpperBound)",
"constructor": false,
"full_signature": "private List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"identifier": "getLogEntries",
"modifiers": "private",
"parameters": "(int first, int last, boolean checkUpperBound)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last, boolean checkUpperBound)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogEntries(int firstIndex)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int firstIndex)",
"identifier": "getLogEntries",
"modifiers": "@Override public",
"parameters": "(int firstIndex)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int firstIndex)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(String context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(String context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(String context)",
"return": "Logger",
"signature": "Logger getLogger(String context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.getLogger(Class context)",
"constructor": false,
"full_signature": "@Override public Logger getLogger(Class context)",
"identifier": "getLogger",
"modifiers": "@Override public",
"parameters": "(Class context)",
"return": "Logger",
"signature": "Logger getLogger(Class context)",
"testcase": false
},
{
"class_method_signature": "LogImpl.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public List<LogEntry> getLogEntries(int first, int last) {\n return getLogEntries(first, last, true);\n }",
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first, int last)",
"identifier": "getLogEntries",
"invocations": [
"getLogEntries"
],
"modifiers": "@Override public",
"parameters": "(int first, int last)",
"return": "List<LogEntry>",
"signature": "List<LogEntry> getLogEntries(int first, int last)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_16 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(CapabilityMapperTest.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(CapabilityMapperTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "expectedEC2",
"modifier": "private",
"original_string": "private String expectedEC2;",
"type": "String",
"var_name": "expectedEC2"
},
{
"declarator": "expectedRDS",
"modifier": "private",
"original_string": "private String expectedRDS;",
"type": "String",
"var_name": "expectedRDS"
},
{
"declarator": "expectedDiskSize",
"modifier": "private",
"original_string": "private int expectedDiskSize;",
"type": "int",
"var_name": "expectedDiskSize"
},
{
"declarator": "capabilityMapper",
"modifier": "private",
"original_string": "private CapabilityMapper capabilityMapper;",
"type": "CapabilityMapper",
"var_name": "capabilityMapper"
},
{
"declarator": "containerCapability",
"modifier": "private",
"original_string": "private ContainerCapability containerCapability;",
"type": "ContainerCapability",
"var_name": "containerCapability"
},
{
"declarator": "osCapability",
"modifier": "private",
"original_string": "private OsCapability osCapability;",
"type": "OsCapability",
"var_name": "osCapability"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
}
],
"file": "server/src/test/java/org/opentosca/toscana/plugins/cloudformation/mapper/CapabilityMapperTest.java",
"identifier": "CapabilityMapperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMapOsCapabilityToImageId() throws ParseException {\n // This is useless because the connection fails everytime because no credentials are set but maybe it will \n // become valid if we test with credentials\n try {\n String imageId = capabilityMapper.mapOsCapabilityToImageId(osCapability);\n Assert.assertThat(imageId, CoreMatchers.containsString(\"ami-\"));\n } catch (SdkClientException se) {\n logger.info(\"Probably no internet connection / credentials, omitting test\");\n }\n }",
"class_method_signature": "CapabilityMapperTest.testMapOsCapabilityToImageId()",
"constructor": false,
"full_signature": "@Test public void testMapOsCapabilityToImageId()",
"identifier": "testMapOsCapabilityToImageId",
"invocations": [
"mapOsCapabilityToImageId",
"assertThat",
"containsString",
"info"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMapOsCapabilityToImageId()",
"testcase": true
} | {
"fields": [
{
"declarator": "EC2_DISTINCTION = \"EC2\"",
"modifier": "public static final",
"original_string": "public static final String EC2_DISTINCTION = \"EC2\";",
"type": "String",
"var_name": "EC2_DISTINCTION"
},
{
"declarator": "RDS_DISTINCTION = \"RDS\"",
"modifier": "public static final",
"original_string": "public static final String RDS_DISTINCTION = \"RDS\";",
"type": "String",
"var_name": "RDS_DISTINCTION"
},
{
"declarator": "ARCH_x86_32 = \"i386\"",
"modifier": "private static final",
"original_string": "private static final String ARCH_x86_32 = \"i386\";",
"type": "String",
"var_name": "ARCH_x86_32"
},
{
"declarator": "ARCH_x86_64 = \"x86_64\"",
"modifier": "private static final",
"original_string": "private static final String ARCH_x86_64 = \"x86_64\";",
"type": "String",
"var_name": "ARCH_x86_64"
},
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "EC2_INSTANCE_TYPES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"t2.nano\", 1, 512))\n .add(new InstanceType(\"t2.micro\", 1, 1024))\n .add(new InstanceType(\"t2.small\", 1, 2048))\n .add(new InstanceType(\"t2.medium\", 2, 4096))\n .add(new InstanceType(\"t2.large\", 2, 8192))\n .add(new InstanceType(\"t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"t2.2xlarge\", 8, 32768))\n .build()",
"modifier": "private final",
"original_string": "private final ImmutableList<InstanceType> EC2_INSTANCE_TYPES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"t2.nano\", 1, 512))\n .add(new InstanceType(\"t2.micro\", 1, 1024))\n .add(new InstanceType(\"t2.small\", 1, 2048))\n .add(new InstanceType(\"t2.medium\", 2, 4096))\n .add(new InstanceType(\"t2.large\", 2, 8192))\n .add(new InstanceType(\"t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"t2.2xlarge\", 8, 32768))\n .build();",
"type": "ImmutableList<InstanceType>",
"var_name": "EC2_INSTANCE_TYPES"
},
{
"declarator": "RDS_INSTANCE_CLASSES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"db.t2.micro\", 1, 1024))\n .add(new InstanceType(\"db.t2.small\", 1, 2048))\n .add(new InstanceType(\"db.t2.medium\", 2, 4096))\n .add(new InstanceType(\"db.t2.large\", 2, 8192))\n .add(new InstanceType(\"db.t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"db.t2.2xlarge\", 8, 32768))\n .add(new InstanceType(\"db.m4.4xlarge\", 16, 65536))\n .add(new InstanceType(\"db.m4.10xlarge\", 40, 163840))\n .add(new InstanceType(\"db.m4.16xlarge\", 64, 262144))\n .build()",
"modifier": "private final",
"original_string": "private final ImmutableList<InstanceType> RDS_INSTANCE_CLASSES = ImmutableList.<InstanceType>builder()\n .add(new InstanceType(\"db.t2.micro\", 1, 1024))\n .add(new InstanceType(\"db.t2.small\", 1, 2048))\n .add(new InstanceType(\"db.t2.medium\", 2, 4096))\n .add(new InstanceType(\"db.t2.large\", 2, 8192))\n .add(new InstanceType(\"db.t2.xlarge\", 4, 16384))\n .add(new InstanceType(\"db.t2.2xlarge\", 8, 32768))\n .add(new InstanceType(\"db.m4.4xlarge\", 16, 65536))\n .add(new InstanceType(\"db.m4.10xlarge\", 40, 163840))\n .add(new InstanceType(\"db.m4.16xlarge\", 64, 262144))\n .build();",
"type": "ImmutableList<InstanceType>",
"var_name": "RDS_INSTANCE_CLASSES"
},
{
"declarator": "awsRegion",
"modifier": "private",
"original_string": "private String awsRegion;",
"type": "String",
"var_name": "awsRegion"
},
{
"declarator": "awsCredentials",
"modifier": "private",
"original_string": "private AWSCredentials awsCredentials;",
"type": "AWSCredentials",
"var_name": "awsCredentials"
}
],
"file": "server/src/main/java/org/opentosca/toscana/plugins/cloudformation/mapper/CapabilityMapper.java",
"identifier": "CapabilityMapper",
"interfaces": "",
"methods": [
{
"class_method_signature": "CapabilityMapper.CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"constructor": true,
"full_signature": "public CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"identifier": "CapabilityMapper",
"modifiers": "public",
"parameters": "(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"return": "",
"signature": " CapabilityMapper(String awsRegion, AWSCredentials awsCredentials, Logger logger)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapOsCapabilityToImageId(OsCapability osCapability)",
"constructor": false,
"full_signature": "public String mapOsCapabilityToImageId(OsCapability osCapability)",
"identifier": "mapOsCapabilityToImageId",
"modifiers": "public",
"parameters": "(OsCapability osCapability)",
"return": "String",
"signature": "String mapOsCapabilityToImageId(OsCapability osCapability)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.processResult(DescribeImagesResult describeImagesResult)",
"constructor": false,
"full_signature": "private String processResult(DescribeImagesResult describeImagesResult)",
"identifier": "processResult",
"modifiers": "private",
"parameters": "(DescribeImagesResult describeImagesResult)",
"return": "String",
"signature": "String processResult(DescribeImagesResult describeImagesResult)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"constructor": false,
"full_signature": "public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"identifier": "mapComputeCapabilityToInstanceType",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability, String distinction)",
"return": "String",
"signature": "String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"constructor": false,
"full_signature": "public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"identifier": "mapComputeCapabilityToRDSAllocatedStorage",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability)",
"return": "Integer",
"signature": "Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"constructor": false,
"full_signature": "public void mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"identifier": "mapDiskSize",
"modifiers": "public",
"parameters": "(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"return": "void",
"signature": "void mapDiskSize(ComputeCapability computeCapability, CloudFormationModule cfnModule, String nodeName)",
"testcase": false
},
{
"class_method_signature": "CapabilityMapper.findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"constructor": false,
"full_signature": "private String findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"identifier": "findCombination",
"modifiers": "private",
"parameters": "(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"return": "String",
"signature": "String findCombination(Integer numCpus, Integer memSize, ImmutableList<InstanceType> instanceTypes,\n List<Integer> allNumCpus, List<Integer> allMemSizes)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String mapOsCapabilityToImageId(OsCapability osCapability) throws SdkClientException, ParseException,\n IllegalArgumentException {\n AmazonEC2 ec2 = AmazonEC2ClientBuilder.standard()\n .withCredentials(new AWSStaticCredentialsProvider(awsCredentials))\n .withRegion(awsRegion)\n .build();\n //need to set these\n DescribeImagesRequest describeImagesRequest = new DescribeImagesRequest()\n .withFilters(\n new Filter(\"virtualization-type\").withValues(\"hvm\"),\n new Filter(\"root-device-type\").withValues(\"ebs\"))\n .withOwners(\"099720109477\"); //this is the ownerId of amazon itself\n if (osCapability.getType().isPresent() && osCapability.getType().get().equals(OsCapability.Type.WINDOWS)) {\n describeImagesRequest.withFilters(new Filter(\"platform\").withValues(\"windows\"));\n }\n if (osCapability.getDistribution().isPresent()) {\n if (osCapability.getDistribution().get().equals(OsCapability.Distribution.UBUNTU)) {\n // */ubuntu/images/* gets better results than plain *ubuntu*\n describeImagesRequest.withFilters(new Filter(\"name\").withValues(\"*ubuntu/images/*\"));\n } else {\n //just search for the string\n describeImagesRequest.withFilters(new Filter(\"name\").withValues(\"*\" + osCapability.getDistribution()\n .toString() + \"*\"));\n }\n }\n if (osCapability.getVersion().isPresent()) {\n describeImagesRequest.withFilters(new Filter(\"name\").withValues(\"*\" + osCapability.getVersion().get() +\n \"*\"));\n }\n if (osCapability.getArchitecture().isPresent()) {\n if (osCapability.getArchitecture().get().equals(OsCapability.Architecture.x86_64)) {\n describeImagesRequest.withFilters(new Filter(\"architecture\").withValues(ARCH_x86_64));\n } else if (osCapability.getArchitecture().get().equals(OsCapability.Architecture.x86_32)) {\n describeImagesRequest.withFilters(new Filter(\"architecture\").withValues(ARCH_x86_32));\n } else {\n throw new UnsupportedOperationException(\"This architecture is not supported \" + osCapability\n .getArchitecture());\n }\n } else {\n //defaulting to 64 bit architecture\n describeImagesRequest.withFilters(new Filter(\"architecture\").withValues(ARCH_x86_64));\n }\n try {\n DescribeImagesResult describeImagesResult = ec2.describeImages(describeImagesRequest);\n String imageId = processResult(describeImagesResult);\n logger.debug(\"ImageId is: '{}'\", imageId);\n return imageId;\n } catch (SdkClientException se) {\n logger.error(\"Cannot connect to AWS to request image Ids\");\n throw se;\n } catch (ParseException pe) {\n logger.error(\"Error parsing date format of image creation dates\");\n throw pe;\n } catch (IllegalArgumentException ie) {\n logger.error(\"With the filters created from the OsCapability there are no valid images received\");\n throw ie;\n }\n }",
"class_method_signature": "CapabilityMapper.mapOsCapabilityToImageId(OsCapability osCapability)",
"constructor": false,
"full_signature": "public String mapOsCapabilityToImageId(OsCapability osCapability)",
"identifier": "mapOsCapabilityToImageId",
"invocations": [
"build",
"withRegion",
"withCredentials",
"standard",
"withOwners",
"withFilters",
"withValues",
"withValues",
"isPresent",
"getType",
"equals",
"get",
"getType",
"withFilters",
"withValues",
"isPresent",
"getDistribution",
"equals",
"get",
"getDistribution",
"withFilters",
"withValues",
"withFilters",
"withValues",
"toString",
"getDistribution",
"isPresent",
"getVersion",
"withFilters",
"withValues",
"get",
"getVersion",
"isPresent",
"getArchitecture",
"equals",
"get",
"getArchitecture",
"withFilters",
"withValues",
"equals",
"get",
"getArchitecture",
"withFilters",
"withValues",
"getArchitecture",
"withFilters",
"withValues",
"describeImages",
"processResult",
"debug",
"error",
"error",
"error"
],
"modifiers": "public",
"parameters": "(OsCapability osCapability)",
"return": "String",
"signature": "String mapOsCapabilityToImageId(OsCapability osCapability)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_57 | {
"fields": [
{
"declarator": "csar",
"modifier": "private",
"original_string": "private Csar csar;",
"type": "Csar",
"var_name": "csar"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "transformation1",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Transformation transformation1;",
"type": "Transformation",
"var_name": "transformation1"
},
{
"declarator": "transformation2",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Transformation transformation2;",
"type": "Transformation",
"var_name": "transformation2"
},
{
"declarator": "transformations = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Transformation> transformations = new ArrayList<>();",
"type": "List<Transformation>",
"var_name": "transformations"
}
],
"file": "server/src/test/java/org/opentosca/toscana/core/csar/CsarImplTest.java",
"identifier": "CsarImplTest",
"interfaces": "",
"superclass": "extends BaseUnitTest"
} | {
"body": "@Test\n public void getTransformationsForSpecificPlatform() throws Exception {\n Optional<Transformation> result = csar.getTransformation(PLATFORM1.id);\n assertTrue(result.isPresent());\n assertEquals(transformation1, result.get());\n }",
"class_method_signature": "CsarImplTest.getTransformationsForSpecificPlatform()",
"constructor": false,
"full_signature": "@Test public void getTransformationsForSpecificPlatform()",
"identifier": "getTransformationsForSpecificPlatform",
"invocations": [
"getTransformation",
"assertTrue",
"isPresent",
"assertEquals",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getTransformationsForSpecificPlatform()",
"testcase": true
} | {
"fields": [
{
"declarator": "transformations = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, Transformation> transformations = new HashMap<>();",
"type": "Map<String, Transformation>",
"var_name": "transformations"
},
{
"declarator": "identifier",
"modifier": "private final",
"original_string": "private final String identifier;",
"type": "String",
"var_name": "identifier"
},
{
"declarator": "log",
"modifier": "private final",
"original_string": "private final Log log;",
"type": "Log",
"var_name": "log"
},
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "rootDir",
"modifier": "private final",
"original_string": "private final File rootDir;",
"type": "File",
"var_name": "rootDir"
},
{
"declarator": "contentDir",
"modifier": "private final",
"original_string": "private final File contentDir;",
"type": "File",
"var_name": "contentDir"
},
{
"declarator": "template",
"modifier": "private",
"original_string": "private File template;",
"type": "File",
"var_name": "template"
},
{
"declarator": "lifecyclePhases",
"modifier": "private final",
"original_string": "private final List<LifecyclePhase> lifecyclePhases;",
"type": "List<LifecyclePhase>",
"var_name": "lifecyclePhases"
}
],
"file": "server/src/main/java/org/opentosca/toscana/core/csar/CsarImpl.java",
"identifier": "CsarImpl",
"interfaces": "implements Csar",
"methods": [
{
"class_method_signature": "CsarImpl.CsarImpl(File rootDir, String identifier, Log log)",
"constructor": true,
"full_signature": "public CsarImpl(File rootDir, String identifier, Log log)",
"identifier": "CsarImpl",
"modifiers": "public",
"parameters": "(File rootDir, String identifier, Log log)",
"return": "",
"signature": " CsarImpl(File rootDir, String identifier, Log log)",
"testcase": false
},
{
"class_method_signature": "CsarImpl.initLifecyclePhases()",
"constructor": false,
"full_signature": "private List<LifecyclePhase> initLifecyclePhases()",
"identifier": "initLifecyclePhases",
"modifiers": "private",
"parameters": "()",
"return": "List<LifecyclePhase>",
"signature": "List<LifecyclePhase> initLifecyclePhases()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.validate()",
"constructor": false,
"full_signature": "@Override public boolean validate()",
"identifier": "validate",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean validate()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.wineryValidate()",
"constructor": false,
"full_signature": "private boolean wineryValidate()",
"identifier": "wineryValidate",
"modifiers": "private",
"parameters": "()",
"return": "boolean",
"signature": "boolean wineryValidate()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.parseValidate()",
"constructor": false,
"full_signature": "private boolean parseValidate()",
"identifier": "parseValidate",
"modifiers": "private",
"parameters": "()",
"return": "boolean",
"signature": "boolean parseValidate()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getTransformations()",
"constructor": false,
"full_signature": "@Override public Map<String, Transformation> getTransformations()",
"identifier": "getTransformations",
"modifiers": "@Override public",
"parameters": "()",
"return": "Map<String, Transformation>",
"signature": "Map<String, Transformation> getTransformations()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getTransformation(String platformId)",
"constructor": false,
"full_signature": "@Override public Optional<Transformation> getTransformation(String platformId)",
"identifier": "getTransformation",
"modifiers": "@Override public",
"parameters": "(String platformId)",
"return": "Optional<Transformation>",
"signature": "Optional<Transformation> getTransformation(String platformId)",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getIdentifier()",
"constructor": false,
"full_signature": "@Override public String getIdentifier()",
"identifier": "getIdentifier",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getIdentifier()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getLog()",
"constructor": false,
"full_signature": "@Override public Log getLog()",
"identifier": "getLog",
"modifiers": "@Override public",
"parameters": "()",
"return": "Log",
"signature": "Log getLog()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getLifecyclePhases()",
"constructor": false,
"full_signature": "@Override public List<LifecyclePhase> getLifecyclePhases()",
"identifier": "getLifecyclePhases",
"modifiers": "@Override public",
"parameters": "()",
"return": "List<LifecyclePhase>",
"signature": "List<LifecyclePhase> getLifecyclePhases()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getLifecyclePhase(Phase phase)",
"constructor": false,
"full_signature": "@Override public LifecyclePhase getLifecyclePhase(Phase phase)",
"identifier": "getLifecyclePhase",
"modifiers": "@Override public",
"parameters": "(Phase phase)",
"return": "LifecyclePhase",
"signature": "LifecyclePhase getLifecyclePhase(Phase phase)",
"testcase": false
},
{
"class_method_signature": "CsarImpl.equals(Object obj)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object obj)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(Object obj)",
"return": "boolean",
"signature": "boolean equals(Object obj)",
"testcase": false
},
{
"class_method_signature": "CsarImpl.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.setTransformations(List<Transformation> transformations)",
"constructor": false,
"full_signature": "@Override public void setTransformations(List<Transformation> transformations)",
"identifier": "setTransformations",
"modifiers": "@Override public",
"parameters": "(List<Transformation> transformations)",
"return": "void",
"signature": "void setTransformations(List<Transformation> transformations)",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getContentDir()",
"constructor": false,
"full_signature": "@Override public File getContentDir()",
"identifier": "getContentDir",
"modifiers": "@Override public",
"parameters": "()",
"return": "File",
"signature": "File getContentDir()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.getTemplate()",
"constructor": false,
"full_signature": "@Override public File getTemplate()",
"identifier": "getTemplate",
"modifiers": "@Override public",
"parameters": "()",
"return": "File",
"signature": "File getTemplate()",
"testcase": false
},
{
"class_method_signature": "CsarImpl.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Optional<Transformation> getTransformation(String platformId) {\n Transformation t = transformations.get(platformId);\n return Optional.ofNullable(t);\n }",
"class_method_signature": "CsarImpl.getTransformation(String platformId)",
"constructor": false,
"full_signature": "@Override public Optional<Transformation> getTransformation(String platformId)",
"identifier": "getTransformation",
"invocations": [
"get",
"ofNullable"
],
"modifiers": "@Override public",
"parameters": "(String platformId)",
"return": "Optional<Transformation>",
"signature": "Optional<Transformation> getTransformation(String platformId)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_1 | {
"fields": [
{
"declarator": "LIST_CSARS_URL = \"/api/csars\"",
"modifier": "private static final",
"original_string": "private static final String LIST_CSARS_URL = \"/api/csars\";",
"type": "String",
"var_name": "LIST_CSARS_URL"
},
{
"declarator": "MOCK_CSAR_NAMES = {\"windows-server\", \"apache\"}",
"modifier": "private static final",
"original_string": "private static final String[] MOCK_CSAR_NAMES = {\"windows-server\", \"apache\"};",
"type": "String[]",
"var_name": "MOCK_CSAR_NAMES"
},
{
"declarator": "relations = new HashMap<>()",
"modifier": "private static final",
"original_string": "private static final Map<String, String> relations = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "relations"
},
{
"declarator": "ACCEPTED_MIME_TYPE = \"application/hal+json\"",
"modifier": "private static final",
"original_string": "private static final String ACCEPTED_MIME_TYPE = \"application/hal+json\";",
"type": "String",
"var_name": "ACCEPTED_MIME_TYPE"
},
{
"declarator": "DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_CHARSET_HAL_JSON = \"application/hal+json;charset=UTF-8\";",
"type": "String",
"var_name": "DEFAULT_CHARSET_HAL_JSON"
},
{
"declarator": "CSAR_BASE_URL = LIST_CSARS_URL + \"/\"",
"modifier": "private static final",
"original_string": "private static final String CSAR_BASE_URL = LIST_CSARS_URL + \"/\";",
"type": "String",
"var_name": "CSAR_BASE_URL"
},
{
"declarator": "MULTIPART_FILE_UPLOAD_KEY = \"file\"",
"modifier": "private static final",
"original_string": "private static final String MULTIPART_FILE_UPLOAD_KEY = \"file\";",
"type": "String",
"var_name": "MULTIPART_FILE_UPLOAD_KEY"
},
{
"declarator": "MULTIPART_FILE_ORIGINAL_FILENAME = \"null\"",
"modifier": "private static final",
"original_string": "private static final String MULTIPART_FILE_ORIGINAL_FILENAME = \"null\";",
"type": "String",
"var_name": "MULTIPART_FILE_ORIGINAL_FILENAME"
},
{
"declarator": "INVALID_CSAR_NAME = \"not-a-csar\"",
"modifier": "private static final",
"original_string": "private static final String INVALID_CSAR_NAME = \"not-a-csar\";",
"type": "String",
"var_name": "INVALID_CSAR_NAME"
},
{
"declarator": "INVALID_CSAR_URL = CSAR_BASE_URL + INVALID_CSAR_NAME",
"modifier": "private static final",
"original_string": "private static final String INVALID_CSAR_URL = CSAR_BASE_URL + INVALID_CSAR_NAME;",
"type": "String",
"var_name": "INVALID_CSAR_URL"
},
{
"declarator": "VALID_CSAR_NAME = \"apache\"",
"modifier": "private static final",
"original_string": "private static final String VALID_CSAR_NAME = \"apache\";",
"type": "String",
"var_name": "VALID_CSAR_NAME"
},
{
"declarator": "DELETE_END_PATH = \"/delete\"",
"modifier": "private static final",
"original_string": "private static final String DELETE_END_PATH = \"/delete\";",
"type": "String",
"var_name": "DELETE_END_PATH"
},
{
"declarator": "DELETE_VALID_CSAR_URL = CSAR_BASE_URL + VALID_CSAR_NAME + DELETE_END_PATH",
"modifier": "private static final",
"original_string": "private static final String DELETE_VALID_CSAR_URL = CSAR_BASE_URL + VALID_CSAR_NAME + DELETE_END_PATH;",
"type": "String",
"var_name": "DELETE_VALID_CSAR_URL"
},
{
"declarator": "LIST_CSARS_SELF_URL = \"http://localhost/api/csars/\"",
"modifier": "private static final",
"original_string": "private static final String LIST_CSARS_SELF_URL = \"http://localhost/api/csars/\";",
"type": "String",
"var_name": "LIST_CSARS_SELF_URL"
},
{
"declarator": "service",
"modifier": "private",
"original_string": "private CsarService service;",
"type": "CsarService",
"var_name": "service"
},
{
"declarator": "rnd = new Random(123456789)",
"modifier": "private",
"original_string": "private Random rnd = new Random(123456789);",
"type": "Random",
"var_name": "rnd"
},
{
"declarator": "dataRead",
"modifier": "private",
"original_string": "private byte[] dataRead;",
"type": "byte[]",
"var_name": "dataRead"
},
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
}
],
"file": "server/src/test/java/org/opentosca/toscana/api/CsarControllerTest.java",
"identifier": "CsarControllerTest",
"interfaces": "",
"superclass": "extends BaseSpringTest"
} | {
"body": "@Test\n public void testDelete() throws Exception {\n //Mechanism to set this value to true once delete has been called\n final boolean[] executed = new boolean[]{false};\n doAnswer(iom -> executed[0] = true).when(service).deleteCsar(any(Csar.class));\n //Perform request\n mvc.perform(\n delete(DELETE_VALID_CSAR_URL).accept(ACCEPTED_MIME_TYPE)\n ).andDo(print())\n .andExpect(status().is(200))\n .andExpect(content().bytes(new byte[0]));\n //Check execution\n assertTrue(\"csarService.delete() did not get called!\", executed[0]);\n }",
"class_method_signature": "CsarControllerTest.testDelete()",
"constructor": false,
"full_signature": "@Test public void testDelete()",
"identifier": "testDelete",
"invocations": [
"deleteCsar",
"when",
"doAnswer",
"any",
"andExpect",
"andExpect",
"andDo",
"perform",
"accept",
"delete",
"print",
"is",
"status",
"bytes",
"content",
"assertTrue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDelete()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CsarController.class)",
"modifier": "private final static",
"original_string": "private final static Logger log = LoggerFactory.getLogger(CsarController.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "csarService",
"modifier": "private final",
"original_string": "private final CsarService csarService;",
"type": "CsarService",
"var_name": "csarService"
}
],
"file": "server/src/main/java/org/opentosca/toscana/api/CsarController.java",
"identifier": "CsarController",
"interfaces": "",
"methods": [
{
"class_method_signature": "CsarController.CsarController(CsarService csarService)",
"constructor": true,
"full_signature": "@Autowired public CsarController(CsarService csarService)",
"identifier": "CsarController",
"modifiers": "@Autowired public",
"parameters": "(CsarService csarService)",
"return": "",
"signature": " CsarController(CsarService csarService)",
"testcase": false
},
{
"class_method_signature": "CsarController.listCSARs()",
"constructor": false,
"full_signature": "@ApiOperation( value = \"List all CSARs stored on the server\", notes = \"Returns a Hypermedia Resource containing all CSARs\" + \" that have been uploaded to the server and did not get removed\", response = CsarResources.class, produces = \"application/hal+json\" ) @RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) public ResponseEntity<Resources<CsarResponse>> listCSARs()",
"identifier": "listCSARs",
"modifiers": "@ApiOperation( value = \"List all CSARs stored on the server\", notes = \"Returns a Hypermedia Resource containing all CSARs\" + \" that have been uploaded to the server and did not get removed\", response = CsarResources.class, produces = \"application/hal+json\" ) @RequestMapping( path = \"\", method = RequestMethod.GET, produces = \"application/hal+json\" ) public",
"parameters": "()",
"return": "ResponseEntity<Resources<CsarResponse>>",
"signature": "ResponseEntity<Resources<CsarResponse>> listCSARs()",
"testcase": false
},
{
"class_method_signature": "CsarController.getCSARInfo(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String name\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Returns details for a specific name (identifier)\", notes = \"Returns the element with the given name, Object contents are \" + \"equal to a regular /csars request (if you just look at the desired entry)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The Csar was found and the contents are found in the body\", response = CsarResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given name (identifier)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{name}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) public ResponseEntity<CsarResponse> getCSARInfo(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String name\n )",
"identifier": "getCSARInfo",
"modifiers": "@ApiOperation( value = \"Returns details for a specific name (identifier)\", notes = \"Returns the element with the given name, Object contents are \" + \"equal to a regular /csars request (if you just look at the desired entry)\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The Csar was found and the contents are found in the body\", response = CsarResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given name (identifier)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{name}\", method = RequestMethod.GET, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String name\n )",
"return": "ResponseEntity<CsarResponse>",
"signature": "ResponseEntity<CsarResponse> getCSARInfo(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String name\n )",
"testcase": false
},
{
"class_method_signature": "CsarController.uploadCSAR(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true)\n @PathVariable(name = \"name\") String name,\n @ApiParam(value = \"The CSAR Archive (Compressed as ZIP)\", required = true)\n @RequestParam(name = \"file\", required = true) MultipartFile file\n// HttpServletRequest request\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Creates a new CSAR\", notes = \"This operation creates a new CSAR if the name (identifier) is not used already. \" + \"The uploaded file has to be a valid CSAR archive. \" + \"Once the file was uploaded the server will synchronously \" + \"(the client has to wait for the response) unzip the archive and parse it. \" + \"Upload gets performed using Multipart Form upload.\", code = 201 ) @ApiResponses({ @ApiResponse( code = 201, message = \"The upload of the csar was successful\", response = Void.class ), @ApiResponse( code = 406, message = \"CSAR upload rejected - given ID already in use\", response = Void.class ), @ApiResponse( code = 500, message = \"The server encountered a unexpected problem\", response = Void.class ) }) @RequestMapping( path = \"/{name}\", method = {RequestMethod.PUT, RequestMethod.POST}, produces = \"application/hal+json\" ) public ResponseEntity<Void> uploadCSAR(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true)\n @PathVariable(name = \"name\") String name,\n @ApiParam(value = \"The CSAR Archive (Compressed as ZIP)\", required = true)\n @RequestParam(name = \"file\", required = true) MultipartFile file\n// HttpServletRequest request\n )",
"identifier": "uploadCSAR",
"modifiers": "@ApiOperation( value = \"Creates a new CSAR\", notes = \"This operation creates a new CSAR if the name (identifier) is not used already. \" + \"The uploaded file has to be a valid CSAR archive. \" + \"Once the file was uploaded the server will synchronously \" + \"(the client has to wait for the response) unzip the archive and parse it. \" + \"Upload gets performed using Multipart Form upload.\", code = 201 ) @ApiResponses({ @ApiResponse( code = 201, message = \"The upload of the csar was successful\", response = Void.class ), @ApiResponse( code = 406, message = \"CSAR upload rejected - given ID already in use\", response = Void.class ), @ApiResponse( code = 500, message = \"The server encountered a unexpected problem\", response = Void.class ) }) @RequestMapping( path = \"/{name}\", method = {RequestMethod.PUT, RequestMethod.POST}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true)\n @PathVariable(name = \"name\") String name,\n @ApiParam(value = \"The CSAR Archive (Compressed as ZIP)\", required = true)\n @RequestParam(name = \"file\", required = true) MultipartFile file\n// HttpServletRequest request\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> uploadCSAR(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true)\n @PathVariable(name = \"name\") String name,\n @ApiParam(value = \"The CSAR Archive (Compressed as ZIP)\", required = true)\n @RequestParam(name = \"file\", required = true) MultipartFile file\n// HttpServletRequest request\n )",
"testcase": false
},
{
"class_method_signature": "CsarController.deleteCsar(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Deletes a Existing CSAR\", notes = \"Deletes the Resulting CSAR and its transformations (if none of them is running). \" + \"If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The deletion of the CSAR was successful\", response = Void.class ), @ApiResponse( code = 400, message = \"The deletion of the CSAR failed, because there is one or more transformations still running.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given name (identifier)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{name}/delete\", method = {RequestMethod.DELETE}, produces = \"application/hal+json\" ) public ResponseEntity<Void> deleteCsar(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"identifier": "deleteCsar",
"modifiers": "@ApiOperation( value = \"Deletes a Existing CSAR\", notes = \"Deletes the Resulting CSAR and its transformations (if none of them is running). \" + \"If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The deletion of the CSAR was successful\", response = Void.class ), @ApiResponse( code = 400, message = \"The deletion of the CSAR failed, because there is one or more transformations still running.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given name (identifier)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{name}/delete\", method = {RequestMethod.DELETE}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteCsar(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"testcase": false
},
{
"class_method_signature": "CsarController.getCsarForName(@PathVariable(\"name\") String name)",
"constructor": false,
"full_signature": "private Csar getCsarForName(@PathVariable(\"name\") String name)",
"identifier": "getCsarForName",
"modifiers": "private",
"parameters": "(@PathVariable(\"name\") String name)",
"return": "Csar",
"signature": "Csar getCsarForName(@PathVariable(\"name\") String name)",
"testcase": false
},
{
"class_method_signature": "CsarController.getLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String csarId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"constructor": false,
"full_signature": "@RequestMapping( path = \"/{name}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs of a csar\", tags = {\"csars\"}, notes = \"Returns the logs for a csar, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public ResponseEntity<LogResponse> getLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String csarId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"identifier": "getLogs",
"modifiers": "@RequestMapping( path = \"/{name}/logs\", method = RequestMethod.GET, produces = \"application/hal+json\" ) @ApiOperation( value = \"Get the logs of a csar\", tags = {\"csars\"}, notes = \"Returns the logs for a csar, starting at a specific position. from the given start index all \" + \"following log lines get returned. If the start index is larger than the current last log index the operation \" + \"will return a empty list.\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The operation was executed successfully\", response = LogResponse.class ), @ApiResponse( code = 400, message = \"The given start value is less than zero\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given identifier\", response = RestErrorResponse.class ) }) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String csarId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"return": "ResponseEntity<LogResponse>",
"signature": "ResponseEntity<LogResponse> getLogs(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"test\")\n @PathVariable(name = \"name\") String csarId,\n @ApiParam(value = \"The index of the first log entry you want (0 returns the whole log)\", required = true, example = \"0\")\n @RequestParam(name = \"start\", required = false, defaultValue = \"0\") Long start\n )",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@ApiOperation(\n value = \"Deletes a Existing CSAR\",\n notes = \"Deletes the Resulting CSAR and its transformations (if none of them is running). \" +\n \"If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted\"\n )\n @ApiResponses({\n @ApiResponse(\n code = 200,\n message = \"The deletion of the CSAR was successful\",\n response = Void.class\n ),\n @ApiResponse(\n code = 400,\n message = \"The deletion of the CSAR failed, because there is one or more transformations still running.\",\n response = RestErrorResponse.class\n ),\n @ApiResponse(\n code = 404,\n message = \"There is no CSAR for the given name (identifier)\",\n response = RestErrorResponse.class\n )\n })\n @RequestMapping(\n path = \"/{name}/delete\",\n method = {RequestMethod.DELETE},\n produces = \"application/hal+json\"\n )\n public ResponseEntity<Void> deleteCsar(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n ) {\n Csar csar = getCsarForName(name);\n\n csar.getTransformations().forEach((k, v) -> {\n if (v.getState() == TransformationState.TRANSFORMING) {\n throw new ActiveTransformationsException(\n String.format(\n \"Transformation %s/%s is still running. Cannot delete csar while a transformation is running!\",\n name, k\n )\n );\n }\n });\n\n csarService.deleteCsar(csar);\n\n return ResponseEntity.ok().build();\n }",
"class_method_signature": "CsarController.deleteCsar(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"constructor": false,
"full_signature": "@ApiOperation( value = \"Deletes a Existing CSAR\", notes = \"Deletes the Resulting CSAR and its transformations (if none of them is running). \" + \"If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The deletion of the CSAR was successful\", response = Void.class ), @ApiResponse( code = 400, message = \"The deletion of the CSAR failed, because there is one or more transformations still running.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given name (identifier)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{name}/delete\", method = {RequestMethod.DELETE}, produces = \"application/hal+json\" ) public ResponseEntity<Void> deleteCsar(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"identifier": "deleteCsar",
"invocations": [
"getCsarForName",
"forEach",
"getTransformations",
"getState",
"format",
"deleteCsar",
"build",
"ok"
],
"modifiers": "@ApiOperation( value = \"Deletes a Existing CSAR\", notes = \"Deletes the Resulting CSAR and its transformations (if none of them is running). \" + \"If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted\" ) @ApiResponses({ @ApiResponse( code = 200, message = \"The deletion of the CSAR was successful\", response = Void.class ), @ApiResponse( code = 400, message = \"The deletion of the CSAR failed, because there is one or more transformations still running.\", response = RestErrorResponse.class ), @ApiResponse( code = 404, message = \"There is no CSAR for the given name (identifier)\", response = RestErrorResponse.class ) }) @RequestMapping( path = \"/{name}/delete\", method = {RequestMethod.DELETE}, produces = \"application/hal+json\" ) public",
"parameters": "(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"return": "ResponseEntity<Void>",
"signature": "ResponseEntity<Void> deleteCsar(\n @ApiParam(value = \"The unique identifier for the CSAR\", required = true, example = \"my-csar-name\")\n @PathVariable(\"name\") String name\n )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.