Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy committed Sep 2, 2019
1 parent d81a2ae commit 02050ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.billyjulius</groupId>
<artifactId>testlink-helper</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/TestLink/TestCaseUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public class TestCaseUtils extends TestLinkMain{

private String _SUMMARY;

private Integer _PROJECT_ID;

private String _PROJECT_NAME;

private List<TestCaseStep> _testCaseSteps;

/**
Expand All @@ -29,7 +33,9 @@ public class TestCaseUtils extends TestLinkMain{
* @param summary is summary of test case
* @param stepResults is list of step result modeled in StepResult class
*/
public TestCaseUtils(String test_name, Integer suite_id, String summary, List<StepResult> stepResults){
public TestCaseUtils(Integer project_id, String project_name, String test_name, Integer suite_id, String summary, List<StepResult> stepResults){
this._PROJECT_ID = project_id;
this._PROJECT_NAME = project_name;
this. _TESTNAME = test_name;
this._SUITEID = suite_id;
this._SUMMARY = summary;
Expand All @@ -44,11 +50,11 @@ public TestCaseUtils(String test_name, Integer suite_id, String summary, List<St
public Integer createTestCase() {
Integer id = getTestCaseID(_TESTNAME);

if(id != 0) {
if(id == 0) {
TestCase testCase = api.createTestCase(
_TESTNAME,
_SUITEID,
_PROJECTID,
_PROJECT_ID,
"admin",
_SUMMARY,
_testCaseSteps,
Expand All @@ -67,7 +73,7 @@ public Integer createTestCase() {
TestCase testCase = api.createTestCase(
_TESTNAME,
_SUITEID,
_PROJECTID,
_PROJECT_ID,
"admin",
_SUMMARY,
_testCaseSteps,
Expand Down Expand Up @@ -103,7 +109,7 @@ public String getTestCaseExternalID(Integer tc_id) {
*/
private Integer getTestCaseID(String tc_name) {
try {
Integer tc_id = api.getTestCaseIDByName(tc_name, null,_PROJECTNAME,null);
Integer tc_id = api.getTestCaseIDByName(tc_name, null,_PROJECT_NAME,null);
return tc_id;
} catch (TestLinkAPIException exception) {
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/TestLink/TestLinkMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void Run(String test_name, Boolean test_is_success, String test_error_mes
TestBuildUtils testBuildUtils = new TestBuildUtils(tp_id, _BUILDNAME);
testBuildUtils.createTestBuild();

TestCaseUtils testCaseUtils = new TestCaseUtils(_testname, _suiteid, _testsummary, _stepResults);
TestCaseUtils testCaseUtils = new TestCaseUtils(_PROJECTID, _PROJECTNAME, _testname, _suiteid, _testsummary, _stepResults);
tc_id = testCaseUtils.createTestCase();
full_tc_external_id = testCaseUtils.getTestCaseExternalID(tc_id);
tc_external_id = Integer.parseInt(full_tc_external_id.split("-")[1]);
Expand Down Expand Up @@ -154,6 +154,6 @@ private ExecutionStatus setExecutionStatus(Boolean status) {
* Assign username to test case
*/
private void assignTestCase() {
api.assignTestCaseExecutionTask(tp_id, full_tc_external_id, _USERNAME, "Automated");
api.assignTestCaseExecutionTask(tp_id, full_tc_external_id, _USERNAME, _BUILDNAME);
}
}
2 changes: 1 addition & 1 deletion src/main/java/TestLink/TestPlanUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public TestPlanUtils(String plan_name, String project_name) {
public Integer createTestPlan() {
Integer tp_id = getTestPlanID(plan_name);

if(tp_id != 0) {
if(tp_id == 0) {
TestPlan test_plan = api.createTestPlan(plan_name, project_name, null, true, true);
tp_id = test_plan.getId();
};
Expand Down

0 comments on commit 02050ee

Please sign in to comment.