diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/ActivitiesEnhTestSuite.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/ActivitiesEnhTestSuite.java index fcb3c0d2cd..4c18c68d4c 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/ActivitiesEnhTestSuite.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/ActivitiesEnhTestSuite.java @@ -35,9 +35,9 @@ ActivityDescendantsSinceTest.class, ActivityNodeChildrenSinceTest.class, ActivityDescendantsSortByTest.class, - ActivityFeedEnhTest.class//, - //MakeActivityPublicTest.class, - //GetActivityReplyNodeTagsTest.class + ActivityFeedEnhTest.class, + MakeActivityPublicTest.class, + GetActivityReplyNodeTagsTest.class }) public class ActivitiesEnhTestSuite { } diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityConcurrentUpdates.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityConcurrentUpdates.java index d5041e1bf7..b8c5bdee85 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityConcurrentUpdates.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityConcurrentUpdates.java @@ -110,4 +110,39 @@ public void testConcurrentFileUploads() { } + @Test + public void testMultipleFileUploads() { + + String url = System.getProperty("ServerUrl"); + String userstr = System.getProperty("Users"); + + String[] userstrs = StringUtil.splitString(userstr, ','); + String[][] users = new String[userstrs.length][2]; + for (int i=0; i params = new HashMap(); + System.out.println(node.getPublished().getTime()); params.put("since", "" + node.getPublished().getTime()); params.put("rangeId", "created"); EntityList activityNodes = activityService.getActivityNodeDescendants(activity.getActivityUuid(), params); @@ -145,12 +146,16 @@ public void testDescendantsCreatedSinceUntil() throws ClientServicesException, X params.put("since", "" + sinceNode.getPublished().getTime()); params.put("until", "" + untilNode.getPublished().getTime()); params.put("rangeId", "created"); + System.out.println("since="+sinceNode.getPublished().getTime()); + System.out.println("until="+untilNode.getPublished().getTime()); EntityList activityNodes = activityService.getActivityNodeDescendants(activity.getActivityUuid(), params); System.out.println("Nodes:" + activityNodes.size() + " created since: " + dateFormat.format(sinceNode.getPublished()) + " until: " + dateFormat.format(untilNode.getPublished())); dumpNodes(activityNodes); + activity = null; + Assert.assertEquals(2, activityNodes.size()); } diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityDescendantsSortByTest.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityDescendantsSortByTest.java index 888034a438..d442ff8369 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityDescendantsSortByTest.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityDescendantsSortByTest.java @@ -50,7 +50,32 @@ public void testDescendantsModifiedSort() throws ClientServicesException, XMLExc params.put("sortOrder", "desc"); EntityList activityChildren = activityService.getActivityNodeChildren(activity.getActivityUuid(), params); - System.out.println("\nActivity shildren sorted descending by modification date"); + System.out.println("\nActivity children sorted descending by modification date"); + for (ActivityNode node : activityChildren) { + System.out.println(node.getTitle() + " modified: " + dateFormat.format(node.getUpdated())); + } + } + + @Test + public void testDescendantsTitleModifiedSort() throws ClientServicesException, XMLException { + long start = System.currentTimeMillis(); + activity = createActivity("ActivityDescendantsModifiedSort-"+start); + + List nodes = createActivityDescendants(activity); + org.junit.Assert.assertNotNull(nodes); + + Map params = new HashMap(); + params.put("sortfields", "title,modified"); + params.put("sortorder", "desc,asc"); + EntityList activityDescendants = activityService.getActivityNodeDescendants(activity.getActivityUuid(), params); + System.out.println("\nActivity descendants sorted descending by title and ascending by modification date"); + for (ActivityNode node : activityDescendants) { + System.out.println(node.getTitle() + " modified: " + dateFormat.format(node.getUpdated())); + } + + params.put("sortorder", "asc,desc"); + EntityList activityChildren = activityService.getActivityNodeChildren(activity.getActivityUuid(), params); + System.out.println("\nActivity children sorted ascending by title and descending by modification date"); for (ActivityNode node : activityChildren) { System.out.println(node.getTitle() + " modified: " + dateFormat.format(node.getUpdated())); } diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityFeedEnhTest.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityFeedEnhTest.java index de0fa248dd..79d69e3259 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityFeedEnhTest.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityFeedEnhTest.java @@ -249,7 +249,7 @@ public void testReduceFieldsToSingleNode() throws ClientServicesException, XMLEx Field movedDateField = read.getFieldByName(dateField.getName()); Assert.assertTrue(movedDateField instanceof DateField); Assert.assertEquals("test_date", ((DateField)movedDateField).getName()); - Assert.assertEquals(2000, ((DateField)movedDateField).getPosition()); + Assert.assertEquals(3000, ((DateField)movedDateField).getPosition()); Assert.assertNotNull(((DateField)movedDateField).getDate()); // Check hidden text field @@ -257,7 +257,7 @@ public void testReduceFieldsToSingleNode() throws ClientServicesException, XMLEx Assert.assertTrue(movedHiddenTextField instanceof TextField); Assert.assertTrue(((TextField)movedHiddenTextField).isHidden()); Assert.assertEquals("test_hidden_text", ((TextField)movedHiddenTextField).getName()); - Assert.assertEquals(3000, ((TextField)movedHiddenTextField).getPosition()); + Assert.assertEquals(2000, ((TextField)movedHiddenTextField).getPosition()); Assert.assertEquals("Hidden_Text_Field", ((TextField)movedHiddenTextField).getSummary()); // Delete the activities again diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityNodeChildrenSinceTest.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityNodeChildrenSinceTest.java index d509c3e6a6..14160850a4 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityNodeChildrenSinceTest.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/ActivityNodeChildrenSinceTest.java @@ -36,7 +36,7 @@ public class ActivityNodeChildrenSinceTest extends BaseActivityServiceTest { private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); @Test - public void testDescendantsUpdatedSince() throws ClientServicesException, XMLException { + public void testNodeChildrenUpdatedSince() throws ClientServicesException, XMLException { long start = System.currentTimeMillis(); activity = createActivity("ActivityDescendantsUpdatedSince-"+start); @@ -53,7 +53,7 @@ public void testDescendantsUpdatedSince() throws ClientServicesException, XMLExc } @Test - public void testDescendantsUpdatedUntil() throws ClientServicesException, XMLException { + public void testNodeChildrenUpdatedUntil() throws ClientServicesException, XMLException { long start = System.currentTimeMillis(); activity = createActivity("ActivityDescendantsUpdatedUntil-"+start); @@ -70,7 +70,7 @@ public void testDescendantsUpdatedUntil() throws ClientServicesException, XMLExc } @Test - public void testDescendantsUpdatedSinceUntil() throws ClientServicesException, XMLException { + public void testNodeChildrenUpdatedSinceUntil() throws ClientServicesException, XMLException { long start = System.currentTimeMillis(); activity = createActivity("ActivityDescendantsUpdatedSinceUntil-"+start); @@ -91,7 +91,7 @@ public void testDescendantsUpdatedSinceUntil() throws ClientServicesException, X } @Test - public void testDescendantsCreatedSince() throws ClientServicesException, XMLException { + public void testNodeChildrenCreatedSince() throws ClientServicesException, XMLException { long start = System.currentTimeMillis(); activity = createActivity("ActivityDescendantsCreatedSince-"+start); @@ -109,7 +109,7 @@ public void testDescendantsCreatedSince() throws ClientServicesException, XMLExc } @Test - public void testDescendantsCreatedUntil() throws ClientServicesException, XMLException { + public void testNodeChildrenCreatedUntil() throws ClientServicesException, XMLException { long start = System.currentTimeMillis(); activity = createActivity("ActivityDescendantsCreatedUntil-"+start); @@ -127,7 +127,7 @@ public void testDescendantsCreatedUntil() throws ClientServicesException, XMLExc } @Test - public void testDescendantsCreatedSinceUntil() throws ClientServicesException, XMLException { + public void testNodeChildrenCreatedSinceUntil() throws ClientServicesException, XMLException { long start = System.currentTimeMillis(); activity = createActivity("ActivityDescendantsCreatedSinceUntil-"+start); diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/BaseActivityServiceTest.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/BaseActivityServiceTest.java index 220d7cce71..8caf59980c 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/BaseActivityServiceTest.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/activities/BaseActivityServiceTest.java @@ -224,7 +224,7 @@ protected List createActivityDescendants(String activityUuid, int for (int i=0; i createActivityDescendants(Activity activity) throws } protected void dumpNodes(List nodes) { - System.out.println(" TITLE PUBLISHED UPDATED"); + System.out.println(" TITLE PUBLISHED UPDATED"); for (ActivityNode node : nodes) { String title = node.getTitle(); Date create = new Date(Long.parseLong(title.substring(title.indexOf('-')+1))); diff --git a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/ActivityXPath.java b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/ActivityXPath.java index 8ada45c9df..9948913ed8 100644 --- a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/ActivityXPath.java +++ b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/ActivityXPath.java @@ -40,6 +40,7 @@ public enum ActivityXPath implements FieldEntry { priority("./a:category[@scheme='http://www.ibm.com/xmlns/prod/sn/priority']/@term"), defaultView("./a:category[@scheme='http://www.ibm.com/xmlns/prod/sn/default-view']/@term"), deleted("./a:category[@term='deleted']"), + reply("./a:category[@term='reply']"), external("./a:category[@term='external']"), completed("./a:category[@term='completed']"), template("./a:category[@term='template']"), diff --git a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/NodeEntity.java b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/NodeEntity.java index d7a689182c..eefba341d3 100644 --- a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/NodeEntity.java +++ b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/activities/NodeEntity.java @@ -214,6 +214,17 @@ public void setTags(List tags) { super.setBaseTags(tags); } + /** + * Returns true if the node is a reply. + * + * Flag that is only present on an node that is a reply. + * + * @return + */ + public boolean isReply() { + return exists(ActivityXPath.reply); + } + /** * Returns true if the node is deleted. *