diff --git a/source/org/jivesoftware/smackx/pubsub/GetItemsRequest.java b/source/org/jivesoftware/smackx/pubsub/GetItemsRequest.java
index 55d3f5861..09355713c 100644
--- a/source/org/jivesoftware/smackx/pubsub/GetItemsRequest.java
+++ b/source/org/jivesoftware/smackx/pubsub/GetItemsRequest.java
@@ -40,9 +40,9 @@ public class GetItemsRequest extends NodeExtension
maxItems = maxItemsToReturn;
}
- public GetItemsRequest(String nodeId, String subscriptionId, int maxItems)
+ public GetItemsRequest(String nodeId, String subscriptionId, int maxItemsToReturn)
{
- super(PubSubElementType.ITEMS, nodeId);
+ this(nodeId, maxItemsToReturn);
subId = subscriptionId;
}
@@ -70,14 +70,14 @@ public class GetItemsRequest extends NodeExtension
{
builder.append(" subid='");
builder.append(getSubscriptionId());
- builder.append("'/>");
+ builder.append("'");
}
if (getMaxItems() > 0)
{
builder.append(" max_items='");
builder.append(getMaxItems());
- builder.append("'/>");
+ builder.append("'");
}
builder.append("/>");
return builder.toString();
diff --git a/test/org/jivesoftware/smackx/pubsub/TestMessageContent.java b/test/org/jivesoftware/smackx/pubsub/TestMessageContent.java
index 3bfc353be..ce7a0b3f1 100644
--- a/test/org/jivesoftware/smackx/pubsub/TestMessageContent.java
+++ b/test/org/jivesoftware/smackx/pubsub/TestMessageContent.java
@@ -98,4 +98,19 @@ public class TestMessageContent extends TestCase
{
}
}
+
+ public void testGetItemsRequest()
+ {
+ GetItemsRequest request = new GetItemsRequest("testId");
+ assertEquals("", request.toXML());
+
+ request = new GetItemsRequest("testId", 5);
+ assertEquals("", request.toXML());
+
+ request = new GetItemsRequest("testId", "qwerty");
+ assertEquals("", request.toXML());
+
+ request = new GetItemsRequest("testId", "qwerty", 5);
+ assertEquals("", request.toXML());
+ }
}