Skip to content

Commit

Permalink
Restore previous createRepository behavior - bug19066
Browse files Browse the repository at this point in the history
Previously Catalog.createRepository would create the repository if it did not
exist, or open it otherwise in the Sesame client. When the override parameter
was added to the request, the default behavior of put on a repository changed.
This change adds the override='false' to all put repository requests to restore
the previous behavior for the Java Sesame client APIs.

This allows the events test to run unmodified, so no release notes are needed
as the external API has not changed.

Also added a small change to build.xml to give the events test JVM more
space to run using jvmargs.

Tests added for:     none
make test-suite run? yes, and test-stress-events

Signed-off-by: Ahmon Dancy <dancy@franz.com>
  • Loading branch information
Ross Jekel authored and dancyatfranz committed Feb 27, 2010
1 parent 3c938f3 commit 9052a24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build.xml
Expand Up @@ -88,10 +88,11 @@
<attribute name="tasknamex" default="java"/> <attribute name="tasknamex" default="java"/>
<attribute name="classname"/> <attribute name="classname"/>
<attribute name="arg"/> <attribute name="arg"/>
<attribute name="maxmemory" default="128m"/>
<sequential> <sequential>
<property name="log" value="info"/> <property name="log" value="info"/>
<java classname="@{classname}" failonerror="true" taskname="@{tasknamex}" <java classname="@{classname}" failonerror="true" taskname="@{tasknamex}"
fork="true"> fork="true" maxmemory="@{maxmemory}">
<sysproperty key="org.apache.commons.logging.Log" <sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.SimpleLog"/> value="org.apache.commons.logging.impl.SimpleLog"/>
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog" <sysproperty key="org.apache.commons.logging.simplelog.defaultlog"
Expand Down Expand Up @@ -175,7 +176,7 @@
<target name="test-stress-events" <target name="test-stress-events"
depends="compile" depends="compile"
description="Run test.stress.Events"> description="Run test.stress.Events">
<run-java tasknamex="ev" classname="test.stress.Events" arg=""/> <run-java tasknamex="ev" classname="test.stress.Events" arg="" maxmemory="512m"/>
</target> </target>


<target name="tutorial" <target name="tutorial"
Expand Down
3 changes: 2 additions & 1 deletion src/com/franz/agraph/http/AGHTTPClient.java
Expand Up @@ -13,6 +13,7 @@


import static com.franz.agraph.http.AGProtocol.AMOUNT_PARAM_NAME; import static com.franz.agraph.http.AGProtocol.AMOUNT_PARAM_NAME;
import static org.openrdf.http.protocol.Protocol.ACCEPT_PARAM_NAME; import static org.openrdf.http.protocol.Protocol.ACCEPT_PARAM_NAME;
import static com.franz.agraph.http.AGProtocol.OVERRIDE_PARAM_NAME;
import info.aduna.net.http.HttpClientUtil; import info.aduna.net.http.HttpClientUtil;


import java.io.IOException; import java.io.IOException;
Expand Down Expand Up @@ -287,7 +288,7 @@ protected final void releaseConnection(HttpMethod method) {
public void putRepository(String repositoryURL) throws IOException, public void putRepository(String repositoryURL) throws IOException,
RepositoryException, UnauthorizedException, AGHttpException { RepositoryException, UnauthorizedException, AGHttpException {
Header[] headers = new Header[0]; Header[] headers = new Header[0];
NameValuePair[] params = new NameValuePair[0]; NameValuePair[] params = { new NameValuePair(OVERRIDE_PARAM_NAME, "false") };
put(repositoryURL,headers,params,null); put(repositoryURL,headers,params,null);
} }


Expand Down
5 changes: 5 additions & 0 deletions src/com/franz/agraph/http/AGProtocol.java
Expand Up @@ -68,6 +68,11 @@ public class AGProtocol extends Protocol {
*/ */
public static final String AUTOCOMMIT_PARAM_NAME = "autoCommit"; public static final String AUTOCOMMIT_PARAM_NAME = "autoCommit";


/**
* Parameter name for the 'override' parameter for put on a repository.
*/
public static final String OVERRIDE_PARAM_NAME = "override";

/** /**
* Relative location of session close. * Relative location of session close.
*/ */
Expand Down

0 comments on commit 9052a24

Please sign in to comment.