Skip to content

Commit

Permalink
Make baseURLSet static to avoid running baseURL code with each request
Browse files Browse the repository at this point in the history
- Add support for enabling many object creation IT with a sytem property, disabled by default

Resolves: https://www.pivotaltracker.com/story/show/77492702
  • Loading branch information
escowles authored and Andrew Woods committed Aug 25, 2014
1 parent 82a0596 commit db1180e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Expand Up @@ -141,7 +141,7 @@ public class FedoraNodes extends AbstractResource {
protected Session session;

private static final Logger LOGGER = getLogger(FedoraNodes.class);
private boolean baseURLSet = false;
private static boolean baseURLSet = false;

/**
* Set the baseURL for JMS events.
Expand Down
Expand Up @@ -136,6 +136,7 @@
*/
public class FedoraNodesIT extends AbstractResourceIT {

private static final String TEST_ACTIVATION_PROPERTY = "RUN_TEST_CREATE_MANY";
private SimpleDateFormat headerFormat;
private SimpleDateFormat tripleFormat;

Expand Down Expand Up @@ -280,6 +281,21 @@ public void testDeleteObject() throws Exception {
getStatus(new HttpGet(location)));
}

@Test
public void testCreateManyObjects() throws Exception {
if (System.getProperty(TEST_ACTIVATION_PROPERTY) == null) {
logger.info("Not running test because system property not set: {}", TEST_ACTIVATION_PROPERTY);
return;
}

final int manyObjects = 2000;
for ( int i = 0; i < manyObjects; i++ ) {
Thread.sleep(10); // needed to prevent overloading
final HttpResponse response = createObject("");
logger.debug( response.getFirstHeader("Location").getValue() );
}
}

@Test
public void testDeleteWithBadEtag() throws Exception {

Expand Down

0 comments on commit db1180e

Please sign in to comment.