Skip to content

Commit

Permalink
Merge pull request #6 from anrchen/issue-7/refactoring
Browse files Browse the repository at this point in the history
Issue 7/refactoring
  • Loading branch information
anrchen authored Mar 7, 2018
2 parents 8bcddf2 + 505bdc2 commit a35e6c0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fp.v11.splints;

import java.util.Collection;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConnection;
Expand All @@ -8,6 +9,8 @@
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.Text;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
*
Expand Down Expand Up @@ -200,9 +203,10 @@ public String createIssue() {
}

@Override
public void getIssueDetails() {
public NodeList getIssueDetails() {
String projectId = "PROJECT_ID";
String ticketNumber = "TICKET_NUMBER";
NodeList result = null;

try {
/*
Expand Down Expand Up @@ -268,6 +272,7 @@ public void getIssueDetails() {

}
DumpSOAPElement(replybody, 0);
result = replybody.getChildNodes();

} catch (Exception ex) {

Expand All @@ -276,16 +281,18 @@ public void getIssueDetails() {
}

System.out.println("Done");
return result;
}

@Override
public void linkIssues() {
public NodeList linkIssues() {
String linkType = "LINK_TYPE";
String projectId1 = "PROJECT_ID1";
String ticketNumber1 = "TICKET_NUMBER1";
String projectId2 = "PROJECT_ID2";
String ticketNumber2 = "TICKET_NUMBER2";

NodeList result = null;

try {
/*
// Comment this out for NO proxy.
Expand Down Expand Up @@ -364,7 +371,7 @@ public void linkIssues() {
//reply.writeTo( System.out );
// Get result
SOAPBody replybody = reply.getSOAPPart().getEnvelope().getBody();

result = replybody.getChildNodes();
// Check for error
if (replybody.hasFault()) {
throw new Exception(replybody.getFault().getFaultString());
Expand All @@ -381,6 +388,7 @@ public void linkIssues() {
} catch (Exception ex) {
ex.printStackTrace();
}
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package fp.v11.splints;

import org.w3c.dom.NodeList;

/**
* Interface for interacting with Splints
* @author soen487-w18-team03
Expand All @@ -16,11 +18,11 @@ public interface ISplints {
* Gets issue details
*
*/
public void getIssueDetails();
public NodeList getIssueDetails();

/**
* Links two issues
*
*/
public void linkIssues();
public NodeList linkIssues();
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class PromptCredentialsProvider {

private final Console console;
private final Scanner scanner;
private final String USERNAME_INPUT_TEXT = "Your username: ";
private final String PASSWORD_INPUT_TEXT = "Your password: ";
public static final String USERNAME_INPUT_TEXT = "Your username: ";
public static final String PASSWORD_INPUT_TEXT = "Your password: ";

public PromptCredentialsProvider() {
this.scanner = new Scanner(System.in);
Expand Down
File renamed without changes.

0 comments on commit a35e6c0

Please sign in to comment.