Commits

Anonymous committed 2c6e12a

Add first sword service document AT

Comments (0)

Files changed (34)

acceptance-test-driver/pom.xml

             <artifactId>httpclient</artifactId>
             <version>4.1.2</version>
         </dependency>
+        <dependency>
+            <groupId>org.swordapp</groupId>
+            <artifactId>sword-client</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>net.chempound</groupId>

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/DriverFactory.java

 package net.chempound.acceptance.dsl;
 
-import net.chempound.acceptance.dsl.driver.APIDriver;
-import net.chempound.acceptance.dsl.driver.PingbackDriver;
-import net.chempound.acceptance.dsl.driver.WebUIDriver;
+import net.chempound.acceptance.dsl.driver.api.APIDriver;
+import net.chempound.acceptance.dsl.driver.api.PingbackDriver;
+import net.chempound.acceptance.dsl.driver.sword.SwordClientDriver;
+import net.chempound.acceptance.dsl.driver.browser.WebUIDriver;
 
 /**
  * @author Sam Adams
 
     WebUIDriver createWebUIDriver();
 
+    SwordClientDriver createSwordDriver();
+
     PingbackDriver createPingbackDriver();
 
     void shutdown();
-
 }

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/SeleniumDriverFactory.java

 package net.chempound.acceptance.dsl;
 
 import com.gargoylesoftware.htmlunit.BrowserVersion;
-import net.chempound.acceptance.dsl.driver.APIDriver;
-import net.chempound.acceptance.dsl.driver.PingbackDriver;
-import net.chempound.acceptance.dsl.driver.WebUIDriver;
+import net.chempound.acceptance.dsl.driver.api.APIDriver;
+import net.chempound.acceptance.dsl.driver.api.PingbackDriver;
+import net.chempound.acceptance.dsl.driver.sword.SwordClientDriver;
+import net.chempound.acceptance.dsl.driver.browser.WebUIDriver;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.firefox.FirefoxDriver;
 import org.openqa.selenium.htmlunit.HtmlUnitDriver;
     }
 
     @Override
+    public SwordClientDriver createSwordDriver() {
+        return new SwordClientDriver(context);
+    }
+
+    @Override
     public APIDriver createAPIDriver() {
         return new APIDriver(context);
     }

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/APIDriver.java

-package net.chempound.acceptance.dsl.driver;
-
-import net.chempound.acceptance.dsl.TestContext;
-import net.chempound.client.*;
-import net.chempound.storage.InMemoryResource;
-import net.chempound.storage.LocalResource;
-import net.chempound.util.MimeType;
-
-/**
- * @author Sam Adams
- */
-public class APIDriver {
-
-    private final ChempoundClient client;
-    private final TestContext context;
-
-    public APIDriver(final TestContext context) {
-        this.context = context;
-        this.client = new DefaultChempoundClient();
-    }
-
-    public Collection createCollection(final CollectionSpecification... specifications) {
-        final CreateCollectionInstruction instruction = new CreateCollectionInstruction();
-        for (final CollectionSpecification specification : specifications) {
-            specification.apply(instruction);
-        }
-        return createCollection(instruction);
-    }
-
-    Collection createCollection(final CreateCollectionInstruction instruction) {
-        final CreateCollectionRequest request = new CreateCollectionRequest()
-            .withUri(instruction.parent != null ? instruction.parent : context.getContentRoot())
-            .withTitle(context.actual(instruction.title))
-            .withSlug(context.actual(instruction.slug));
-
-        final CreateCollectionResponse response;
-        try {
-            response = client.createCollection(request);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-
-        return new Collection(response.getUri(), response.getTitle());
-    }
-
-    public DepositReceipt depositItem(final DepositSpecification... specifications) {
-        final DepositInstruction instruction = new DepositInstruction();
-        for (final DepositSpecification specification : specifications) {
-            specification.apply(instruction);
-        }
-        return depositItem(instruction);
-    }
-
-    private DepositReceipt depositItem(final DepositInstruction instruction) {
-        final DepositItemRequest request = new DepositItemRequest()
-            .withUri(instruction.parent != null ? instruction.parent : context.getContentRoot())
-            .withTitle(context.actual(instruction.title))
-            .withSlug(context.actual(instruction.slug))
-            .withMetadata(instruction.metadata);
-
-        if (instruction.files != null) {
-            for (final Resource file : instruction.files) {
-                request.withFile(createResource(file));
-            }
-        }
-
-        final DepositItemResponse response;
-        try {
-            response = client.depositItem(request);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-
-        return new DepositReceipt(response.getTitle(), response.getSplashPage(), response.getEditLink(),
-                                  response.getEditMediaLink(), response.getDerivedResources());
-    }
-
-    private static LocalResource createResource(final Resource file) {
-        return new InMemoryResource(file.getPath(), new MimeType(file.getMimeType()), file.getContent());
-    }
-}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/Collection.java

-package net.chempound.acceptance.dsl.driver;
-
-import java.net.URI;
-
-/**
- * @author Sam Adams
- */
-public class Collection {
-    
-    private final URI uri;
-    private final String title;
-
-    public Collection(final URI uri, final String title) {
-        this.uri = uri;
-        this.title = title;
-    }
-
-    public URI getUri() {
-        return uri;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/CollectionMatchers.java

 package net.chempound.acceptance.dsl.driver;
 
+import net.chempound.acceptance.dsl.driver.api.Collection;
 import org.hamcrest.Description;
 import org.hamcrest.Matcher;
 import org.hamcrest.TypeSafeMatcher;

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/CollectionPage.java

-package net.chempound.acceptance.dsl.driver;
-
-import net.chempound.acceptance.dsl.TestContext;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-/**
- * @author Sam Adams
- */
-public class CollectionPage implements CollectionView {
-    
-    private final WebDriver webDriver;
-    private final TestContext context;
-
-    public CollectionPage(final WebDriver webDriver, final TestContext context) {
-        this.webDriver = webDriver;
-        this.context = context;
-    }
-
-    @Override
-    public boolean matchesTitle(final String title) {
-        final WebElement element = webDriver.findElement(By.cssSelector(".collection h1.title"));
-        return context.actual(title).equals(element.getText());
-    }
-
-    @Override
-    public boolean hasSlug(final String slug) {
-        return webDriver.getCurrentUrl().contains('/' + context.actual(slug) + '/');
-    }
-
-    @Override
-    public boolean containsChild(final Collection child) {
-        final List<WebElement> elements = webDriver.findElements(By.cssSelector(".collection .result"));
-        for (final WebElement element : elements) {
-            final WebElement title = element.findElement(By.tagName("h2"));
-            final WebElement link = title.findElement(By.tagName("a"));
-            if (child.getUri().toString().equals(link.getAttribute("href"))) {
-                if (child.getTitle() == null || child.getTitle().equals(title.getText())) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/CollectionSpecifications.java

 package net.chempound.acceptance.dsl.driver;
 
+import net.chempound.acceptance.dsl.driver.api.Collection;
+
 public class CollectionSpecifications {
 
     public static CollectionSpecification withSlug(final String slug) {

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/CollectionView.java

 package net.chempound.acceptance.dsl.driver;
 
+import net.chempound.acceptance.dsl.driver.api.Collection;
+
 /**
  * @author Sam Adams
  */

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/CreateCollectionInstruction.java

  */
 public class CreateCollectionInstruction {
 
-    URI parent;
-    String title;
-    String slug;
+    public URI parent;
+    public String title;
+    public String slug;
 
 }

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/DepositInstruction.java

  */
 public class DepositInstruction {
 
-    URI parent;
-    String title;
-    String slug;
-    boolean multipart;
-    List<Resource> files = new ArrayList<Resource>();
-    boolean inProgress;
-    Model metadata;
+    public URI parent;
+    public String title;
+    public String slug;
+    public boolean multipart;
+    public List<Resource> files = new ArrayList<Resource>();
+    public boolean inProgress;
+    public Model metadata;
 
 }

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/DepositReceipt.java

-package net.chempound.acceptance.dsl.driver;
-
-import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.model.Link;
-import org.junit.Assert;
-
-import java.net.URI;
-import java.util.List;
-
-/**
- * @author Sam Adams
- */
-public class DepositReceipt implements ItemView {
-
-    private final String title;
-    private final URI uri;
-    private final Link editLink;
-    private final Link editMediaLink;
-    private final List<Link> derivedResources;
-
-    public DepositReceipt(final String title, final URI uri, final Link editLink, final Link editMediaLink, final List<Link> derivedResources) {
-        this.title = title;
-        this.uri = uri;
-        this.editLink = editLink;
-        this.editMediaLink = editMediaLink;
-        this.derivedResources = derivedResources;
-    }
-
-    public URI getUri() {
-        return uri;
-    }
-
-    public Link getEditMediaLink() {
-        return editMediaLink;
-    }
-
-    public IRI getMediaResourceIri() {
-        Assert.fail();
-        return null;
-    }
-
-    public IRI getSwordEditIri() {
-        Assert.fail();
-        return null;
-    }
-
-    public IRI getSwordStatementIri() {
-        Assert.fail();
-        // http://purl.org/net/sword/terms/statement
-        return null;
-    }
-
-    public IRI getAlternateResources() {
-        Assert.fail();
-        // http://purl.org/net/sword/terms/originalDeposit
-        return null;
-    }
-
-    public IRI getDerivedResources() {
-        Assert.fail();
-        // ttp://purl.org.net/sword/terms/derivedResource
-        return null;
-    }
-
-
-    @Override
-    public boolean hasTitle(final String title) {
-        return title.equals(title);
-    }
-
-    @Override
-    public boolean hasFiles(final String... files) {
-        if (derivedResources.size() != files.length) {
-            return false;
-        }
-        for (final String file : files) {
-            boolean found = false;
-            for (final Link link : derivedResources) {
-                if (link.getResolvedHref().toString().endsWith('/' + file)) {
-                    found = true;
-                }
-            }
-            if (!found) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean hasSlug(final String slug) {
-        return uri.toString().contains(slug);
-    }
-
-    @Override
-    public boolean hasPingbacks(final URI... pingbacks) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public boolean isInProgress(final boolean inProgress) {
-        throw new UnsupportedOperationException();
-    }
-
-}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/ItemPage.java

-package net.chempound.acceptance.dsl.driver;
-
-import net.chempound.acceptance.dsl.TestContext;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-
-import java.net.URI;
-import java.util.List;
-
-import static java.lang.String.format;
-
-/**
- * @author Sam Adams
- */
-public class ItemPage implements ItemView {
-
-    private static final String XPATH_FILE = "//a[@href='%s']";
-    private static final String XPATH_PINGBACK = "//li[contains(@class, 'pingback')]/a[@href='%s']";
-
-    private final WebDriver webDriver;
-    private final TestContext context;
-
-    public ItemPage(final WebDriver webDriver, final TestContext context) {
-        this.webDriver = webDriver;
-        this.context = context;
-    }
-
-    @Override
-    public boolean hasTitle(final String title) {
-        final WebElement element = webDriver.findElement(By.cssSelector(".item h1.title"));
-        return context.actual(title).equals(element.getText());
-    }
-
-    @Override
-    public boolean hasFiles(final String... files) {
-        for (final String file : files) {
-            final URI uri = URI.create(webDriver.getCurrentUrl()).resolve(file);
-            final List<WebElement> elements = webDriver.findElements(By.xpath(format(XPATH_FILE, uri)));
-            if (elements.isEmpty()) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean hasPingbacks(final URI... pingbacks) {
-        for (final URI pingback : pingbacks) {
-            final List<WebElement> elements = webDriver.findElements(By.xpath(format(XPATH_PINGBACK, pingback)));
-            if (elements.isEmpty()) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean isInProgress(final boolean inProgress) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public boolean hasSlug(final String slug) {
-        return webDriver.getCurrentUrl().contains('/' + context.actual(slug) + '/');
-    }
-}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/PingbackDriver.java

-package net.chempound.acceptance.dsl.driver;
-
-import net.chempound.acceptance.dsl.TestContext;
-import net.chempound.webapp.pingback.PingbackFault;
-import nu.xom.Builder;
-import nu.xom.Document;
-import nu.xom.Nodes;
-import org.apache.http.Header;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.util.EntityUtils;
-
-import java.io.IOException;
-import java.net.URI;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Sam Adams
- */
-public class PingbackDriver {
-
-    private final HttpClient httpClient = new DefaultHttpClient();
-
-    private final TestContext context;
-
-    public PingbackDriver(final TestContext context) {
-        this.context = context;
-    }
-
-    public void pingback(final URI targetUrl, final URI sourceUrl) throws Exception {
-        pingback(targetUrl, sourceUrl, null);
-    }
-
-    public void pingback(final URI targetUrl, final URI sourceUrl, final PingbackFault expectedFault) throws Exception {
-        final URI pingbackUrl = findPingbackUrl(targetUrl);
-        doPingback(targetUrl, sourceUrl, expectedFault, pingbackUrl);
-    }
-
-    public void doPingback(final URI targetUrl, final URI sourceUrl, final PingbackFault expectedFault, final URI pingbackUrl) throws Exception {
-        final Document response = sendPingback(pingbackUrl, sourceUrl, targetUrl);
-        if (expectedFault == null) {
-            checkSucccess(response);
-        } else {
-            checkFault(response, expectedFault);
-        }
-    }
-
-    private void checkSucccess(final Document response) {
-        assertTrue(response.toXML(), response.query("/methodResponse/params").size() != 0);
-    }
-
-    private void checkFault(final Document response, final PingbackFault expectedFault) {
-        final Nodes query = response.query("/methodResponse/fault/value/struct/member/value/int");
-        assertEquals(response.toXML(), 1, query.size());
-        final String faultCode = query.get(0).getValue();
-        assertEquals(response.toXML(), expectedFault.getCode(), Integer.parseInt(faultCode));
-    }
-
-    private Document sendPingback(final URI pingbackUrl, final URI sourceUrl, final URI targetUrl) throws Exception {
-        final HttpPost request = new HttpPost(pingbackUrl);
-        request.setEntity(new StringEntity("<?xml version='1.0'?>" +
-                                            "<methodCall>" +
-                                            "  <methodName>pingback.ping</methodName>" +
-                                            "  <params>" +
-                                            "    <param><value><string>" + sourceUrl + "</string></value></param>" +
-                                            "    <param><value><string>" + targetUrl + "</string></value></param>" +
-                                            "  </params>" +
-                                            "</methodCall>", "text/xml", "UTF-8"));
-
-        final HttpResponse response = httpClient.execute(request);
-        try {
-            if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
-                throw new RuntimeException("HTTP request returned status: " + response.getStatusLine());
-            }
-
-            return new Builder().build(response.getEntity().getContent());
-        } finally {
-            EntityUtils.consume(response.getEntity());
-        }
-    }
-
-    public URI findPingbackUrl(final URI targetUrl) throws IOException {
-        final HttpResponse response = httpClient.execute(new HttpGet(targetUrl));
-        try {
-            if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
-                throw new RuntimeException("HTTP request returned status: " + response.getStatusLine());
-            }
-            final Header header = response.getFirstHeader("X-Pingback");
-            if (header == null) {
-                throw new RuntimeException("X-Pingback header not found");
-            }
-            return URI.create(header.getValue());
-        } finally {
-            EntityUtils.consume(response.getEntity());
-        }
-    }
-
-}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/ServiceDocumentMatchers.java

+package net.chempound.acceptance.dsl.driver;
+
+import net.chempound.acceptance.dsl.driver.sword.SwordServiceDocument;
+import net.chempound.acceptance.dsl.driver.sword.SwordWorkspace;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+
+public class ServiceDocumentMatchers {
+
+    public static Matcher<SwordServiceDocument> hasVersion(final String version) {
+        return new TypeSafeMatcher<SwordServiceDocument>() {
+            @Override
+            protected boolean matchesSafely(final SwordServiceDocument swordServiceDocument) {
+                return version.equals(swordServiceDocument.getVersion());
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("version matches '" + version + "'");
+            }
+        };
+    }
+
+    public static Matcher<SwordServiceDocument> hasMaxUploadSize(final String maxUploadSize) {
+        return new TypeSafeMatcher<SwordServiceDocument>() {
+            @Override
+            protected boolean matchesSafely(final SwordServiceDocument swordServiceDocument) {
+                return maxUploadSize.equals(swordServiceDocument.getMaxUploadSize());
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("maxUploadSize matches '" + maxUploadSize + "'");
+            }
+        };
+    }
+
+    public static Matcher<SwordServiceDocument> hasWorkspace(final Matcher<SwordWorkspace>... matchers) {
+        return new TypeSafeMatcher<SwordServiceDocument>() {
+            @Override
+            protected boolean matchesSafely(final SwordServiceDocument swordServiceDocument) {
+                for (final SwordWorkspace workspace : swordServiceDocument.getWorkspaces()) {
+                    boolean match = true;
+                    for (final Matcher<SwordWorkspace> matcher : matchers) {
+                        if (!matcher.matches(workspace)) {
+                            match = false;
+                            break;
+                        }
+                    }
+                    if (match) {
+                        return true;
+                    }
+                }
+                return false;
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("workspace matches");
+            }
+        };
+    }
+
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/WebUIDriver.java

-package net.chempound.acceptance.dsl.driver;
-
-import net.chempound.acceptance.dsl.TestContext;
-import org.hamcrest.Matcher;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-
-import java.net.URI;
-
-import static java.util.Arrays.asList;
-import static org.junit.Assert.assertThat;
-
-/**
- * @author Sam Adams
- */
-public class WebUIDriver {
-    
-    private final WebDriver webDriver;
-    private final TestContext context;
-
-    public WebUIDriver(final WebDriver webDriver, final TestContext context) {
-        this.webDriver = webDriver;
-        this.context = context;
-    }
-    
-    protected void loadPage(final URI uri) {
-        webDriver.navigate().to(uri.toString());
-    }
-
-    @SuppressWarnings("unchecked")
-    public void verify(final Collection collection, final Matcher<CollectionView> matcher) {
-        check(collection, asList(matcher));
-    }
-
-    @SuppressWarnings("unchecked")
-    public void verify(final Collection collection, final Matcher<CollectionView> matcher1, final Matcher<CollectionView> matcher2) {
-        check(collection, asList(matcher1, matcher2));
-    }
-
-    public void check(final Collection collection, final Iterable<Matcher<CollectionView>> matchers) {
-        loadPage(collection.getUri());
-        
-        webDriver.findElement(By.cssSelector(".collection"));
-        
-        final CollectionView collectionView = new CollectionPage(webDriver, context);
-        for (final Matcher<CollectionView> matcher : matchers) {
-            assertThat(collectionView, matcher);
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public void check(final DepositReceipt item, final Matcher<ItemView> matcher) {
-        check(item, asList(matcher));
-    }
-
-    @SuppressWarnings("unchecked")
-    public void check(final DepositReceipt item, final Matcher<ItemView> matcher1, final Matcher<ItemView> matcher2) {
-        check(item, asList(matcher1, matcher2));
-    }
-
-    public void check(final DepositReceipt item, final Iterable<Matcher<ItemView>> matchers) {
-        loadPage(item.getUri());
-
-        webDriver.findElement(By.cssSelector(".item"));
-
-        final ItemView itemView = new ItemPage(webDriver, context);
-        for (final Matcher<ItemView> matcher : matchers) {
-            assertThat(itemView, matcher);
-        }
-    }
-
-}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/api/APIDriver.java

+package net.chempound.acceptance.dsl.driver.api;
+
+import net.chempound.acceptance.dsl.TestContext;
+import net.chempound.acceptance.dsl.driver.*;
+import net.chempound.client.*;
+import net.chempound.storage.InMemoryResource;
+import net.chempound.storage.LocalResource;
+import net.chempound.util.MimeType;
+
+/**
+ * @author Sam Adams
+ */
+public class APIDriver {
+
+    private final ChempoundClient client;
+    private final TestContext context;
+
+    public APIDriver(final TestContext context) {
+        this.context = context;
+        this.client = new DefaultChempoundClient();
+    }
+
+    public Collection createCollection(final CollectionSpecification... specifications) {
+        final CreateCollectionInstruction instruction = new CreateCollectionInstruction();
+        for (final CollectionSpecification specification : specifications) {
+            specification.apply(instruction);
+        }
+        return createCollection(instruction);
+    }
+
+    Collection createCollection(final CreateCollectionInstruction instruction) {
+        final CreateCollectionRequest request = new CreateCollectionRequest()
+            .withUri(instruction.parent != null ? instruction.parent : context.getContentRoot())
+            .withTitle(context.actual(instruction.title))
+            .withSlug(context.actual(instruction.slug));
+
+        final CreateCollectionResponse response;
+        try {
+            response = client.createCollection(request);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        return new Collection(response.getUri(), response.getTitle());
+    }
+
+    public DepositReceipt depositItem(final DepositSpecification... specifications) {
+        final DepositInstruction instruction = new DepositInstruction();
+        for (final DepositSpecification specification : specifications) {
+            specification.apply(instruction);
+        }
+        return depositItem(instruction);
+    }
+
+    private DepositReceipt depositItem(final DepositInstruction instruction) {
+        final DepositItemRequest request = new DepositItemRequest()
+            .withUri(instruction.parent != null ? instruction.parent : context.getContentRoot())
+            .withTitle(context.actual(instruction.title))
+            .withSlug(context.actual(instruction.slug))
+            .withMetadata(instruction.metadata);
+
+        if (instruction.files != null) {
+            for (final Resource file : instruction.files) {
+                request.withFile(createResource(file));
+            }
+        }
+
+        final DepositItemResponse response;
+        try {
+            response = client.depositItem(request);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        return new DepositReceipt(response.getTitle(), response.getSplashPage(), response.getEditLink(),
+                                  response.getEditMediaLink(), response.getDerivedResources());
+    }
+
+    private static LocalResource createResource(final Resource file) {
+        return new InMemoryResource(file.getPath(), new MimeType(file.getMimeType()), file.getContent());
+    }
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/api/Collection.java

+package net.chempound.acceptance.dsl.driver.api;
+
+import java.net.URI;
+
+/**
+ * @author Sam Adams
+ */
+public class Collection {
+    
+    private final URI uri;
+    private final String title;
+
+    public Collection(final URI uri, final String title) {
+        this.uri = uri;
+        this.title = title;
+    }
+
+    public URI getUri() {
+        return uri;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/api/DepositReceipt.java

+package net.chempound.acceptance.dsl.driver.api;
+
+import net.chempound.acceptance.dsl.driver.ItemView;
+import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.model.Link;
+import org.junit.Assert;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * @author Sam Adams
+ */
+public class DepositReceipt implements ItemView {
+
+    private final String title;
+    private final URI uri;
+    private final Link editLink;
+    private final Link editMediaLink;
+    private final List<Link> derivedResources;
+
+    public DepositReceipt(final String title, final URI uri, final Link editLink, final Link editMediaLink, final List<Link> derivedResources) {
+        this.title = title;
+        this.uri = uri;
+        this.editLink = editLink;
+        this.editMediaLink = editMediaLink;
+        this.derivedResources = derivedResources;
+    }
+
+    public URI getUri() {
+        return uri;
+    }
+
+    public Link getEditMediaLink() {
+        return editMediaLink;
+    }
+
+    public IRI getMediaResourceIri() {
+        Assert.fail();
+        return null;
+    }
+
+    public IRI getSwordEditIri() {
+        Assert.fail();
+        return null;
+    }
+
+    public IRI getSwordStatementIri() {
+        Assert.fail();
+        // http://purl.org/net/sword/terms/statement
+        return null;
+    }
+
+    public IRI getAlternateResources() {
+        Assert.fail();
+        // http://purl.org/net/sword/terms/originalDeposit
+        return null;
+    }
+
+    public IRI getDerivedResources() {
+        Assert.fail();
+        // ttp://purl.org.net/sword/terms/derivedResource
+        return null;
+    }
+
+
+    @Override
+    public boolean hasTitle(final String title) {
+        return title.equals(title);
+    }
+
+    @Override
+    public boolean hasFiles(final String... files) {
+        if (derivedResources.size() != files.length) {
+            return false;
+        }
+        for (final String file : files) {
+            boolean found = false;
+            for (final Link link : derivedResources) {
+                if (link.getResolvedHref().toString().endsWith('/' + file)) {
+                    found = true;
+                }
+            }
+            if (!found) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public boolean hasSlug(final String slug) {
+        return uri.toString().contains(slug);
+    }
+
+    @Override
+    public boolean hasPingbacks(final URI... pingbacks) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean isInProgress(final boolean inProgress) {
+        throw new UnsupportedOperationException();
+    }
+
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/api/PingbackDriver.java

+package net.chempound.acceptance.dsl.driver.api;
+
+import net.chempound.acceptance.dsl.TestContext;
+import net.chempound.webapp.pingback.PingbackFault;
+import nu.xom.Builder;
+import nu.xom.Document;
+import nu.xom.Nodes;
+import org.apache.http.Header;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.net.URI;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Sam Adams
+ */
+public class PingbackDriver {
+
+    private final HttpClient httpClient = new DefaultHttpClient();
+
+    private final TestContext context;
+
+    public PingbackDriver(final TestContext context) {
+        this.context = context;
+    }
+
+    public void pingback(final URI targetUrl, final URI sourceUrl) throws Exception {
+        pingback(targetUrl, sourceUrl, null);
+    }
+
+    public void pingback(final URI targetUrl, final URI sourceUrl, final PingbackFault expectedFault) throws Exception {
+        final URI pingbackUrl = findPingbackUrl(targetUrl);
+        doPingback(targetUrl, sourceUrl, expectedFault, pingbackUrl);
+    }
+
+    public void doPingback(final URI targetUrl, final URI sourceUrl, final PingbackFault expectedFault, final URI pingbackUrl) throws Exception {
+        final Document response = sendPingback(pingbackUrl, sourceUrl, targetUrl);
+        if (expectedFault == null) {
+            checkSucccess(response);
+        } else {
+            checkFault(response, expectedFault);
+        }
+    }
+
+    private void checkSucccess(final Document response) {
+        assertTrue(response.toXML(), response.query("/methodResponse/params").size() != 0);
+    }
+
+    private void checkFault(final Document response, final PingbackFault expectedFault) {
+        final Nodes query = response.query("/methodResponse/fault/value/struct/member/value/int");
+        assertEquals(response.toXML(), 1, query.size());
+        final String faultCode = query.get(0).getValue();
+        assertEquals(response.toXML(), expectedFault.getCode(), Integer.parseInt(faultCode));
+    }
+
+    private Document sendPingback(final URI pingbackUrl, final URI sourceUrl, final URI targetUrl) throws Exception {
+        final HttpPost request = new HttpPost(pingbackUrl);
+        request.setEntity(new StringEntity("<?xml version='1.0'?>" +
+                                            "<methodCall>" +
+                                            "  <methodName>pingback.ping</methodName>" +
+                                            "  <params>" +
+                                            "    <param><value><string>" + sourceUrl + "</string></value></param>" +
+                                            "    <param><value><string>" + targetUrl + "</string></value></param>" +
+                                            "  </params>" +
+                                            "</methodCall>", "text/xml", "UTF-8"));
+
+        final HttpResponse response = httpClient.execute(request);
+        try {
+            if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
+                throw new RuntimeException("HTTP request returned status: " + response.getStatusLine());
+            }
+
+            return new Builder().build(response.getEntity().getContent());
+        } finally {
+            EntityUtils.consume(response.getEntity());
+        }
+    }
+
+    public URI findPingbackUrl(final URI targetUrl) throws IOException {
+        final HttpResponse response = httpClient.execute(new HttpGet(targetUrl));
+        try {
+            if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
+                throw new RuntimeException("HTTP request returned status: " + response.getStatusLine());
+            }
+            final Header header = response.getFirstHeader("X-Pingback");
+            if (header == null) {
+                throw new RuntimeException("X-Pingback header not found");
+            }
+            return URI.create(header.getValue());
+        } finally {
+            EntityUtils.consume(response.getEntity());
+        }
+    }
+
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/browser/CollectionPage.java

+package net.chempound.acceptance.dsl.driver.browser;
+
+import net.chempound.acceptance.dsl.TestContext;
+import net.chempound.acceptance.dsl.driver.api.Collection;
+import net.chempound.acceptance.dsl.driver.CollectionView;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+
+import java.util.List;
+
+/**
+ * @author Sam Adams
+ */
+public class CollectionPage implements CollectionView {
+    
+    private final WebDriver webDriver;
+    private final TestContext context;
+
+    public CollectionPage(final WebDriver webDriver, final TestContext context) {
+        this.webDriver = webDriver;
+        this.context = context;
+    }
+
+    @Override
+    public boolean matchesTitle(final String title) {
+        final WebElement element = webDriver.findElement(By.cssSelector(".collection h1.title"));
+        return context.actual(title).equals(element.getText());
+    }
+
+    @Override
+    public boolean hasSlug(final String slug) {
+        return webDriver.getCurrentUrl().contains('/' + context.actual(slug) + '/');
+    }
+
+    @Override
+    public boolean containsChild(final Collection child) {
+        final List<WebElement> elements = webDriver.findElements(By.cssSelector(".collection .result"));
+        for (final WebElement element : elements) {
+            final WebElement title = element.findElement(By.tagName("h2"));
+            final WebElement link = title.findElement(By.tagName("a"));
+            if (child.getUri().toString().equals(link.getAttribute("href"))) {
+                if (child.getTitle() == null || child.getTitle().equals(title.getText())) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/browser/ItemPage.java

+package net.chempound.acceptance.dsl.driver.browser;
+
+import net.chempound.acceptance.dsl.TestContext;
+import net.chempound.acceptance.dsl.driver.ItemView;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+
+import java.net.URI;
+import java.util.List;
+
+import static java.lang.String.format;
+
+/**
+ * @author Sam Adams
+ */
+public class ItemPage implements ItemView {
+
+    private static final String XPATH_FILE = "//a[@href='%s']";
+    private static final String XPATH_PINGBACK = "//li[contains(@class, 'pingback')]/a[@href='%s']";
+
+    private final WebDriver webDriver;
+    private final TestContext context;
+
+    public ItemPage(final WebDriver webDriver, final TestContext context) {
+        this.webDriver = webDriver;
+        this.context = context;
+    }
+
+    @Override
+    public boolean hasTitle(final String title) {
+        final WebElement element = webDriver.findElement(By.cssSelector(".item h1.title"));
+        return context.actual(title).equals(element.getText());
+    }
+
+    @Override
+    public boolean hasFiles(final String... files) {
+        for (final String file : files) {
+            final URI uri = URI.create(webDriver.getCurrentUrl()).resolve(file);
+            final List<WebElement> elements = webDriver.findElements(By.xpath(format(XPATH_FILE, uri)));
+            if (elements.isEmpty()) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public boolean hasPingbacks(final URI... pingbacks) {
+        for (final URI pingback : pingbacks) {
+            final List<WebElement> elements = webDriver.findElements(By.xpath(format(XPATH_PINGBACK, pingback)));
+            if (elements.isEmpty()) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public boolean isInProgress(final boolean inProgress) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean hasSlug(final String slug) {
+        return webDriver.getCurrentUrl().contains('/' + context.actual(slug) + '/');
+    }
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/browser/WebUIDriver.java

+package net.chempound.acceptance.dsl.driver.browser;
+
+import net.chempound.acceptance.dsl.TestContext;
+import net.chempound.acceptance.dsl.driver.*;
+import net.chempound.acceptance.dsl.driver.api.Collection;
+import net.chempound.acceptance.dsl.driver.api.DepositReceipt;
+import org.hamcrest.Matcher;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+
+import java.net.URI;
+
+import static java.util.Arrays.asList;
+import static org.junit.Assert.assertThat;
+
+/**
+ * @author Sam Adams
+ */
+public class WebUIDriver {
+    
+    private final WebDriver webDriver;
+    private final TestContext context;
+
+    public WebUIDriver(final WebDriver webDriver, final TestContext context) {
+        this.webDriver = webDriver;
+        this.context = context;
+    }
+    
+    protected void loadPage(final URI uri) {
+        webDriver.navigate().to(uri.toString());
+    }
+
+    @SuppressWarnings("unchecked")
+    public void verify(final Collection collection, final Matcher<CollectionView> matcher) {
+        check(collection, asList(matcher));
+    }
+
+    @SuppressWarnings("unchecked")
+    public void verify(final Collection collection, final Matcher<CollectionView> matcher1, final Matcher<CollectionView> matcher2) {
+        check(collection, asList(matcher1, matcher2));
+    }
+
+    public void check(final Collection collection, final Iterable<Matcher<CollectionView>> matchers) {
+        loadPage(collection.getUri());
+        
+        webDriver.findElement(By.cssSelector(".collection"));
+        
+        final CollectionView collectionView = new CollectionPage(webDriver, context);
+        for (final Matcher<CollectionView> matcher : matchers) {
+            assertThat(collectionView, matcher);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void check(final DepositReceipt item, final Matcher<ItemView> matcher) {
+        check(item, asList(matcher));
+    }
+
+    @SuppressWarnings("unchecked")
+    public void check(final DepositReceipt item, final Matcher<ItemView> matcher1, final Matcher<ItemView> matcher2) {
+        check(item, asList(matcher1, matcher2));
+    }
+
+    public void check(final DepositReceipt item, final Iterable<Matcher<ItemView>> matchers) {
+        loadPage(item.getUri());
+
+        webDriver.findElement(By.cssSelector(".item"));
+
+        final ItemView itemView = new ItemPage(webDriver, context);
+        for (final Matcher<ItemView> matcher : matchers) {
+            assertThat(itemView, matcher);
+        }
+    }
+
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/sword/SwordClientDriver.java

+package net.chempound.acceptance.dsl.driver.sword;
+
+import net.chempound.acceptance.dsl.TestContext;
+import org.swordapp.client.SWORDClient;
+import org.swordapp.client.ServiceDocument;
+
+public class SwordClientDriver {
+
+    private final TestContext context;
+    private final SWORDClient swordClient;
+
+    public SwordClientDriver(final TestContext context) {
+        this.context = context;
+        this.swordClient = new SWORDClient();
+    }
+
+    public SwordServiceDocument getServiceDocument() throws Exception {
+        final ServiceDocument serviceDocument = swordClient.getServiceDocument(context.getRootUri().resolve("sword/service.xml").toString());
+        return new SwordServiceDocument(serviceDocument);
+    }
+
+
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/sword/SwordServiceDocument.java

+package net.chempound.acceptance.dsl.driver.sword;
+
+import org.swordapp.client.ProtocolViolationException;
+import org.swordapp.client.SWORDWorkspace;
+import org.swordapp.client.ServiceDocument;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SwordServiceDocument {
+
+    private final ServiceDocument serviceDocument;
+
+    public SwordServiceDocument(final ServiceDocument serviceDocument) {
+        this.serviceDocument = serviceDocument;
+    }
+
+    public String getVersion() {
+        try {
+            return serviceDocument.getVersion();
+        } catch (ProtocolViolationException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public String getMaxUploadSize() {
+        try {
+            return String.valueOf(serviceDocument.getMaxUploadSize());
+        } catch (ProtocolViolationException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public List<SwordWorkspace> getWorkspaces() {
+        final List<SwordWorkspace> workspaces = new ArrayList<SwordWorkspace>();
+        for (SWORDWorkspace workspace : serviceDocument.getWorkspaces()) {
+            workspaces.add(new SwordWorkspace(workspace));
+        }
+        return workspaces;
+    }
+}

acceptance-test-driver/src/main/java/net/chempound/acceptance/dsl/driver/sword/SwordWorkspace.java

+package net.chempound.acceptance.dsl.driver.sword;
+
+import org.swordapp.client.SWORDWorkspace;
+
+public class SwordWorkspace {
+
+    private final SWORDWorkspace workspace;
+
+    public SwordWorkspace(final SWORDWorkspace workspace) {
+        this.workspace = workspace;
+    }
+
+}

acceptance-tests/src/test/java/net/chempound/acceptance/PingbackAcceptanceTest.java

 
 import net.chempound.acceptance.dsl.AbstractAcceptanceTest;
 import net.chempound.acceptance.dsl.server.StubBlogServer;
-import net.chempound.acceptance.dsl.driver.APIDriver;
-import net.chempound.acceptance.dsl.driver.DepositReceipt;
-import net.chempound.acceptance.dsl.driver.PingbackDriver;
-import net.chempound.acceptance.dsl.driver.WebUIDriver;
+import net.chempound.acceptance.dsl.driver.api.APIDriver;
+import net.chempound.acceptance.dsl.driver.api.DepositReceipt;
+import net.chempound.acceptance.dsl.driver.api.PingbackDriver;
+import net.chempound.acceptance.dsl.driver.browser.WebUIDriver;
 import org.junit.*;
 
 import java.net.URI;

acceptance-tests/src/test/java/net/chempound/acceptance/api/DepositAcceptanceTest.java

+package net.chempound.acceptance.api;
+
+import net.chempound.acceptance.dsl.AbstractAcceptanceTest;
+import net.chempound.acceptance.dsl.driver.api.APIDriver;
+import net.chempound.acceptance.dsl.driver.api.DepositReceipt;
+import net.chempound.acceptance.dsl.driver.Resource;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static net.chempound.acceptance.dsl.driver.DepositSpecifications.*;
+import static net.chempound.acceptance.dsl.driver.ItemMatchers.*;
+
+/**
+ * @author Sam Adams
+ */
+public class DepositAcceptanceTest extends AbstractAcceptanceTest {
+
+    private APIDriver apiDriver;
+
+    @Before
+    public void setUp() throws Exception {
+        apiDriver = driverFactory.createAPIDriver();
+    }
+
+    @Test
+    public void shouldCreateItemOnMetadataOnlyDeposit() {
+        DepositReceipt item = apiDriver.depositItem(withSlug("slug"), withTitle("title"));
+
+        verify(item, hasTitle("title"), hasSlug("slug"));
+    }
+
+    @Test
+    public void shouldCreateItemOnBinaryDeposit() {
+        Resource file = newResource("file");
+        
+        DepositReceipt item = apiDriver.depositItem(withFile(file));
+
+        verify(item, hasFiles(file.getPath()));
+    }
+
+    @Test
+    public void shouldCreateItemOnBinaryDepositWithMultipleFiles() {
+        Resource file1 = newResource("file1");
+        Resource file2 = newResource("file2");
+        Resource file3 = newResource("file3");
+
+        DepositReceipt item = apiDriver.depositItem(withFiles(file1, file2, file3));
+
+        verify(item, hasFiles(file1.getPath(), file2.getPath(), file3.getPath()));
+    }
+
+    @Test
+    public void shouldCreateItemOnMultipartDeposit() {
+        Resource file = newResource("file");
+
+        DepositReceipt item = apiDriver.depositItem(withTitle("title"), withFile(file), asMultipart(true));
+
+        verify(item, hasTitle("title"), hasFiles(file.getPath()));
+    }
+
+    @Test
+    public void shouldCreateItemOnMultipartDepositWithMultipleFiles() {
+        Resource file1 = newResource("file1");
+        Resource file2 = newResource("file2");
+        Resource file3 = newResource("file3");
+
+        DepositReceipt item = apiDriver.depositItem(withTitle("title"), withFiles(file1, file2, file3), asMultipart(true));
+
+        verify(item, hasTitle("title"), hasFiles(file1.getPath(), file2.getPath(), file3.getPath()));
+    }
+
+    @Test
+    @Ignore
+    public void shouldSupportInProgressDeposit() {
+        DepositReceipt item = apiDriver.depositItem(withTitle("title"), inProgress(true));
+
+        verify(item, hasTitle("title"), isInProgress(true));
+    }
+
+}

acceptance-tests/src/test/java/net/chempound/acceptance/chemistry/GaussianLogAcceptanceTest.java

 package net.chempound.acceptance.chemistry;
 
 import net.chempound.acceptance.dsl.AbstractAcceptanceTest;
-import net.chempound.acceptance.dsl.driver.APIDriver;
+import net.chempound.acceptance.dsl.driver.api.APIDriver;
 import net.chempound.acceptance.dsl.driver.Resource;
 import net.chempound.compchem.gaussian.GaussianLogImporter;
 import net.chempound.content.DepositRequest;

acceptance-tests/src/test/java/net/chempound/acceptance/chemistry/NwChemLogAcceptanceTest.java

 package net.chempound.acceptance.chemistry;
 
 import net.chempound.acceptance.dsl.AbstractAcceptanceTest;
-import net.chempound.acceptance.dsl.driver.APIDriver;
+import net.chempound.acceptance.dsl.driver.api.APIDriver;
 import net.chempound.acceptance.dsl.driver.Resource;
 import net.chempound.compchem.nwchem.NWChemLogImporter;
 import net.chempound.content.DepositRequest;

acceptance-tests/src/test/java/net/chempound/acceptance/sword/DepositAcceptanceTest.java

-package net.chempound.acceptance.sword;
-
-import net.chempound.acceptance.dsl.AbstractAcceptanceTest;
-import net.chempound.acceptance.dsl.driver.APIDriver;
-import net.chempound.acceptance.dsl.driver.DepositReceipt;
-import net.chempound.acceptance.dsl.driver.Resource;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import static net.chempound.acceptance.dsl.driver.DepositSpecifications.*;
-import static net.chempound.acceptance.dsl.driver.ItemMatchers.*;
-
-/**
- * @author Sam Adams
- */
-public class DepositAcceptanceTest extends AbstractAcceptanceTest {
-
-    private APIDriver apiDriver;
-
-    @Before
-    public void setUp() throws Exception {
-        apiDriver = driverFactory.createAPIDriver();
-    }
-
-    @Test
-    public void shouldCreateItemOnMetadataOnlyDeposit() {
-        DepositReceipt item = apiDriver.depositItem(withSlug("slug"), withTitle("title"));
-
-        verify(item, hasTitle("title"), hasSlug("slug"));
-    }
-
-    @Test
-    public void shouldCreateItemOnBinaryDeposit() {
-        Resource file = newResource("file");
-        
-        DepositReceipt item = apiDriver.depositItem(withFile(file));
-
-        verify(item, hasFiles(file.getPath()));
-    }
-
-    @Test
-    public void shouldCreateItemOnBinaryDepositWithMultipleFiles() {
-        Resource file1 = newResource("file1");
-        Resource file2 = newResource("file2");
-        Resource file3 = newResource("file3");
-
-        DepositReceipt item = apiDriver.depositItem(withFiles(file1, file2, file3));
-
-        verify(item, hasFiles(file1.getPath(), file2.getPath(), file3.getPath()));
-    }
-
-    @Test
-    public void shouldCreateItemOnMultipartDeposit() {
-        Resource file = newResource("file");
-
-        DepositReceipt item = apiDriver.depositItem(withTitle("title"), withFile(file), asMultipart(true));
-
-        verify(item, hasTitle("title"), hasFiles(file.getPath()));
-    }
-
-    @Test
-    public void shouldCreateItemOnMultipartDepositWithMultipleFiles() {
-        Resource file1 = newResource("file1");
-        Resource file2 = newResource("file2");
-        Resource file3 = newResource("file3");
-
-        DepositReceipt item = apiDriver.depositItem(withTitle("title"), withFiles(file1, file2, file3), asMultipart(true));
-
-        verify(item, hasTitle("title"), hasFiles(file1.getPath(), file2.getPath(), file3.getPath()));
-    }
-
-    @Test
-    @Ignore
-    public void shouldSupportInProgressDeposit() {
-        DepositReceipt item = apiDriver.depositItem(withTitle("title"), inProgress(true));
-
-        verify(item, hasTitle("title"), isInProgress(true));
-    }
-
-}

acceptance-tests/src/test/java/net/chempound/acceptance/sword/SwordStatementAcceptanceTest.java

 package net.chempound.acceptance.sword;
 
 import net.chempound.acceptance.dsl.AbstractAcceptanceTest;
-import net.chempound.acceptance.dsl.driver.APIDriver;
+import net.chempound.acceptance.dsl.driver.sword.SwordClientDriver;
+import net.chempound.acceptance.dsl.driver.sword.SwordServiceDocument;
 import org.junit.Before;
+import org.junit.Test;
+
+import static net.chempound.acceptance.dsl.driver.ServiceDocumentMatchers.hasMaxUploadSize;
+import static net.chempound.acceptance.dsl.driver.ServiceDocumentMatchers.hasVersion;
 
 /**
  * @author Sam Adams
  */
 public class SwordStatementAcceptanceTest extends AbstractAcceptanceTest {
 
-    private APIDriver apiDriver;
+    private SwordClientDriver swordDriver;
 
     @Before
     public void setUp() throws Exception {
-        apiDriver = driverFactory.createAPIDriver();
+        swordDriver = driverFactory.createSwordDriver();
     }
 
+    @Test
+    public void shouldProvideSwordStatement() throws Exception {
+        final SwordServiceDocument serviceDocument = swordDriver.getServiceDocument();
+        verify(serviceDocument, hasVersion("2.0"), hasMaxUploadSize("-1"));
+    }
 }

acceptance-tests/src/test/java/net/chempound/acceptance/ui/CollectionAcceptanceTest.java

 package net.chempound.acceptance.ui;
 
 import net.chempound.acceptance.dsl.AbstractAcceptanceTest;
-import net.chempound.acceptance.dsl.driver.APIDriver;
-import net.chempound.acceptance.dsl.driver.Collection;
-import net.chempound.acceptance.dsl.driver.WebUIDriver;