Skip to content

Commit

Permalink
fix get datastreams response tag to match fcrepo 3x
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Mar 28, 2013
1 parent ffd0d74 commit 9fa6174
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Expand Up @@ -15,6 +15,7 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;

import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpDelete;
Expand All @@ -37,10 +38,26 @@ public class FedoraDatastreamsIT extends AbstractResourceIT {
@Test
public void testGetDatastreams() throws Exception {
execute(postObjMethod("FedoraDatastreamsTest1"));

final HttpPost dsmethod =
postDSMethod("FedoraDatastreamsTest1", "zxc", "foo");
assertEquals(201, getStatus(dsmethod));

final HttpGet method =
new HttpGet(serverAddress +
"objects/FedoraDatastreamsTest1/datastreams");
assertEquals(200, getStatus(method));



final HttpResponse response = execute(method);

String content = IOUtils.toString(response.getEntity().getContent());

logger.info(content);

assertTrue("Found the wrong XML tag", compile(
"<datastream ", DOTALL).matcher(content).find());
}

@Test
Expand Down
Expand Up @@ -4,12 +4,14 @@
import java.util.Set;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "objectDatastreams")
public class ObjectDatastreams {

@XmlElement(name = "datastream")
public Set<DatastreamElement> datastreams;

@XmlType(name = "datastream")
Expand Down

0 comments on commit 9fa6174

Please sign in to comment.