Created
June 7, 2012 06:43
-
-
Save eddies/2886981 to your computer and use it in GitHub Desktop.
fedora-client test for multiple clients
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourmediashelf.fedora.client; | |
import static com.yourmediashelf.fedora.client.FedoraClient.addRelationship; | |
import static org.junit.Assert.assertEquals; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
import com.yourmediashelf.fedora.client.request.AddRelationship; | |
import com.yourmediashelf.fedora.client.request.BaseFedoraRequestIT; | |
import com.yourmediashelf.fedora.client.request.FedoraRequest; | |
import com.yourmediashelf.fedora.client.response.FedoraResponse; | |
/** | |
* This is an integration test which requires a running Fedora server. | |
* | |
* @author Edwin Shin | |
* | |
*/ | |
public class MultipleClientIT extends BaseFedoraRequestIT { | |
private FedoraClient fedora2; | |
@Before | |
public void setUp() throws Exception { | |
FedoraRequest.setDefaultClient(fedora); | |
super.setUp(); | |
FedoraRequest.setDefaultClient(null); | |
fedora2 = new FedoraClient(getCredentials()); | |
} | |
@After | |
public void tearDown() throws Exception { | |
FedoraRequest.setDefaultClient(fedora); | |
super.tearDown(); | |
} | |
@Test | |
public void testAddRelationship() throws Exception { | |
String predicate = "urn:foo/testAddRelationship"; | |
String object = "urn:foo/한"; | |
AddRelationship ar = | |
addRelationship(testPid).predicate(predicate).object(object); | |
FedoraResponse response = ar.execute(fedora); | |
assertEquals(200, response.getStatus()); | |
response = ar.execute(fedora2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment