Skip to content

Commit

Permalink
Fix defect 20170308 (#6)
Browse files Browse the repository at this point in the history
* fix defect

* resolve conflicts

* modify the .properties

* fix the defect that the order confusion of iterations

* resolve the conflicts
  • Loading branch information
marchhead authored and etiennec committed Mar 9, 2017
1 parent 2e47b63 commit cfcbfd5
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class VersionOneConstants {
API_VERSION_API_DATA_ROOT + "Scope?sel=Name&where=AssetState='64'&Accept=application/json";

public static final String STORIES_WITH_TIMEBOX_SUFFIX = API_VERSION_API_DATA_ROOT
+ "Story?Accept=application/json&sel=Name,Status.Name,Timebox.Name,Timebox.State.Code,Timebox.BeginDate,Timebox.EndDate,CreateDate,ChangeDate,Children.Actuals.Value.@Sum,Children.ToDo.@Sum,Children.DetailEstimate.@Sum&where=Scope=$myScope&with=$myScope=";
+ "Story?Accept=application/json&sort=Timebox.BeginDate&sel=Name,Status.Name,Timebox.Name,Timebox.State.Code,Timebox.BeginDate,Timebox.EndDate,CreateDate,ChangeDate,Children.Actuals.Value.@Sum,Children.ToDo.@Sum,Children.DetailEstimate.@Sum&where=Scope=$myScope&with=$myScope=";

public static final String ACTUALS_SUFFIX =
API_VERSION_API_DATA_ROOT + "Actual?Accept=application/json&sel=Workitem.Parent,Date,Value";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -151,7 +152,7 @@ private String encodeUrl(String url) {
}

private Map<VersionOneTimebox, List<VersionOneStory>> getStoriesWithTimebox(String scopeId) {
Map<VersionOneTimebox, List<VersionOneStory>> iterations = new HashMap<>();
Map<VersionOneTimebox, List<VersionOneStory>> iterations = new LinkedHashMap<>();
ClientResponse response = wrapper.sendGet(baseUri + VersionOneConstants.STORIES_WITH_TIMEBOX_SUFFIX + scopeId);

String jsonStr = response.getEntity(String.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.ppm.integration.agilesdk.connector.versionone.model;

public class VersionOneActualForTimesheet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.ppm.integration.agilesdk.connector.versionone.model;

public class VersionOneScope {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Date getScheduledFinish() {

@Override
public Date getScheduledStart() {
if (beginDate.compareTo(createDate) == 1) {
if (beginDate.compareTo(createDate) < 0) {
return toDate(this.createDate);
}
return toDate(this.beginDate);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.ppm.integration.agilesdk.connector.versionone.model;

import com.ppm.integration.agilesdk.pm.ExternalTask;
Expand Down Expand Up @@ -65,7 +66,8 @@ public void setStories(List<VersionOneStory> stories) {
this.stories = stories;
}

@Override public int hashCode() {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((beginDate == null) ? 0 : beginDate.hashCode());
Expand All @@ -74,7 +76,8 @@ public void setStories(List<VersionOneStory> stories) {
return result;
}

@Override public boolean equals(Object obj) {
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
Expand All @@ -100,27 +103,32 @@ public void setStories(List<VersionOneStory> stories) {
return true;
}

@Override public String getName() {
@Override
public String getName() {

return this.timeboxName;
}

@Override public Date getScheduledFinish() {
@Override
public Date getScheduledFinish() {

return toDate(this.endDate);
}

@Override public Date getScheduledStart() {
@Override
public Date getScheduledStart() {

return toDate(this.beginDate);
}

@Override public TaskStatus getStatus() {
@Override
public TaskStatus getStatus() {

return getTaskStatus(this.stateCode);
}

@Override public List<ExternalTask> getChildren() {
@Override
public List<ExternalTask> getChildren() {
List<ExternalTask> list = new ArrayList<>();
for (VersionOneStory s : stories) {
list.add(s);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.ppm.integration.agilesdk.connector.versionone.rest.util;

import org.apache.wink.client.ClientConfig;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.ppm.integration.agilesdk.connector.versionone.rest.util;

public class RestConstants {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.ppm.integration.agilesdk.connector.versionone.rest.util;

import org.apache.commons.codec.binary.Base64;
Expand All @@ -19,7 +20,8 @@ public ClientConfig getClientConfig() {
return clientConfig;
}

@Override public ClientConfig setProxy(String proxyHost, String proxyPort) {
@Override
public ClientConfig setProxy(String proxyHost, String proxyPort) {

if (proxyHost != null && !proxyHost.isEmpty() && proxyPort != null && !proxyPort.isEmpty()) {
clientConfig.proxyHost(proxyHost);
Expand All @@ -28,8 +30,10 @@ public ClientConfig getClientConfig() {
return clientConfig;
}

// some responses not expected when setting the authentication with this method
@Override public ClientConfig setBasicAuthorizatonWithBasicAuthHandler(String username, String password) {
// some responses not expected when setting the authentication with this
// method
@Override
public ClientConfig setBasicAuthorizatonWithBasicAuthHandler(String username, String password) {

basicAuthHandler = basicAuthHandler == null ? new BasicAuthSecurityHandler() : basicAuthHandler;
basicAuthHandler.setUserName(username);
Expand All @@ -39,12 +43,14 @@ public ClientConfig getClientConfig() {
}

// recommend this method to set the authentication for now
@Override public String getBasicAuthorizaton() {
@Override
public String getBasicAuthorizaton() {

return basicAuthentication;
}

@Override public void setBasicAuthorizaton(String username, String password) {
@Override
public void setBasicAuthorizaton(String username, String password) {

String basicToken = new String(Base64.encodeBase64((username + ":" + password).getBytes()));
basicAuthentication = RestConstants.BASIC_AUTHENTICATION_PREFIX + basicToken;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.ppm.integration.agilesdk.connector.versionone.rest.util.exception;

import java.lang.Thread.UncaughtExceptionHandler;
Expand All @@ -7,8 +8,7 @@
import com.ppm.integration.IntegrationException;
import com.ppm.integration.agilesdk.connector.versionone.VersionOneIntegrationConnector;

public class VersionOneConnectivityExceptionHandler implements
UncaughtExceptionHandler {
public class VersionOneConnectivityExceptionHandler implements UncaughtExceptionHandler {

@Override
public void uncaughtException(Thread t, Throwable e) {
Expand Down

0 comments on commit cfcbfd5

Please sign in to comment.