S
- public abstract class AbstractTestNanoSparqlClient<S extends IIndexManager> extends ProxyTestCase<S>
TestCase2.MyProperties, TestCase2.RandomType
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.jetty.client.HttpClient |
m_client
The http client.
|
protected org.eclipse.jetty.server.Server |
m_fixture
A jetty
Server running a NanoSparqlServer instance. |
protected RemoteRepositoryManager |
m_mgr
The client-API wrapper for the remote service.
|
protected RemoteRepository |
m_repo
The client-API wrapper to the NSS for the configured default namespace.
|
protected String |
m_rootURL
The URL of the root of the web application server.
|
protected String |
m_serviceURL
The effective
NanoSparqlServer http end point (including the
ContextPath). |
protected String |
namespace
The namespace of the
AbstractTripleStore instance against which
the test is running. |
protected static String |
packagePath
The path used to resolve resources in this package when they are being
uploaded to the
NanoSparqlServer . |
_randomType, log
Constructor and Description |
---|
AbstractTestNanoSparqlClient() |
AbstractTestNanoSparqlClient(String name) |
Modifier and Type | Method and Description |
---|---|
protected static org.openrdf.model.Graph |
asGraph(org.openrdf.query.GraphQueryResult result)
Deprecated.
by
asGraph(IPreparedGraphQuery) which can ensure that
the GraphQueryResult is closed. |
protected static org.openrdf.model.Graph |
asGraph(IPreparedGraphQuery preparedQuery)
Preferred version executes the
IPreparedGraphQuery and ensures
that the GraphQueryResult is closed. |
protected static void |
assertSameGraph(org.openrdf.model.Graph expected,
org.openrdf.model.Graph actual)
Compare two graphs for equality.
|
protected static void |
assertSameGraph(org.openrdf.model.Graph expected,
IPreparedGraphQuery actual)
Compare two graphs for equality.
|
protected long |
countAll() |
protected static int |
countMatches(org.openrdf.model.Graph g,
org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Count matches of the triple pattern.
|
protected static long |
countResults(org.openrdf.query.GraphQueryResult result)
Counts the #of results in a SPARQL result set.
|
protected static long |
countResults(org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> result)
Return the #of solutions in a result set.
|
protected static long |
countResults(org.openrdf.query.TupleQueryResult result)
Counts the #of results in a SPARQL result set.
|
protected void |
doConstructTest(String method,
org.openrdf.rio.RDFFormat format) |
protected long |
doDeleteWithAccessPath(org.openrdf.model.URI s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.URI... c) |
protected void |
doDeleteWithBody(int ntriples,
org.openrdf.rio.RDFFormat format) |
protected void |
doDeleteWithPostTest(org.openrdf.rio.RDFFormat format)
Test helps PUTs some data, verifies that it is visible, DELETEs the data,
and then verifies that it is gone.
|
protected long |
doDeleteWithQuery(String query) |
protected void |
doDescribeTest(String method,
org.openrdf.rio.RDFFormat format)
Inserts some data into the KB and then issues a DESCRIBE query against
the REST API and verifies the expected results.
|
protected long |
doInsertByBody(String method,
org.openrdf.rio.RDFFormat rdfFormat,
org.openrdf.model.Graph g,
org.openrdf.model.URI defaultContext)
Reads a resource and sends it using an INSERT with BODY request to be
loaded into the database.
|
protected long |
doInsertbyURL(String method,
String resource)
Insert a resource into the
NanoSparqlServer . |
protected void |
doInsertWithBodyTest(String method,
int ntriples,
org.openrdf.rio.RDFFormat format)
Test of POST w/ BODY having data to be loaded.
|
protected byte[] |
genNTRIPLES(int ntriples,
org.openrdf.rio.RDFFormat format)
Generates some statements and serializes them using the specified
RDFFormat . |
protected org.openrdf.model.Graph |
genNTRIPLES2(int ntriples) |
protected long |
getExactSize()
Deprecated.
|
protected static org.openrdf.model.Statement[] |
getMatches(org.openrdf.model.Graph g,
org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Return the statements matching the triple pattern.
|
protected static String |
getResponseBody(HttpURLConnection conn) |
protected com.bigdata.rdf.sail.webapp.TestMode |
getTestMode()
The
TestMode that is in effect. |
protected org.openrdf.model.Literal |
getVeryLargeLiteral()
Generate and return a very large literal.
|
protected org.openrdf.model.Graph |
loadGraphFromResource(String resource)
Load and return a graph from a resource.
|
protected org.eclipse.jetty.server.Server |
newFixture(String lnamespace) |
protected static String |
readFromFile(File file)
Read the contents of a file.
|
protected static org.openrdf.model.Graph |
readGraphFromFile(File file) |
void |
setUp() |
protected void |
setupDataOnServer()
Sets up a simple data set on the server.
|
protected void |
setupQuadsDataOnServer()
Sets up a simple data set on the server.
|
void |
tearDown() |
protected static byte[] |
writeOnBuffer(org.openrdf.rio.RDFFormat format,
org.openrdf.model.Graph g)
Write a graph on a buffer suitable for sending as an HTTP request body.
|
getDelegate, getIndexManager, getOurDelegate, getProperties, setDelegate
checkIfProxy, setUp, tearDown, tearDownAfterSuite
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
protected static final String packagePath
NanoSparqlServer
.protected org.eclipse.jetty.server.Server m_fixture
Server
running a NanoSparqlServer
instance.protected String namespace
AbstractTripleStore
instance against which
the test is running. A unique namespace is used for each test run, but
the namespace is based on the test name.protected org.eclipse.jetty.client.HttpClient m_client
protected RemoteRepositoryManager m_mgr
protected RemoteRepository m_repo
protected String m_serviceURL
NanoSparqlServer
http end point (including the
ContextPath).protected String m_rootURL
http://localhost:9999 -- root URL http://localhost:9999/bigdata -- webapp URL (includes "/bigdata" context path.
public AbstractTestNanoSparqlClient()
public AbstractTestNanoSparqlClient(String name)
protected com.bigdata.rdf.sail.webapp.TestMode getTestMode()
TestMode
that is in effect.protected org.eclipse.jetty.server.Server newFixture(String lnamespace) throws Exception
Exception
public void setUp() throws Exception
setUp
in class ProxyTestCase<S extends IIndexManager>
Exception
public void tearDown() throws Exception
tearDown
in class ProxyTestCase<S extends IIndexManager>
Exception
protected static long countResults(org.openrdf.query.TupleQueryResult result) throws Exception
result
- The connection from which to read the results.Exception
- If anything goes wrong.protected static long countResults(org.openrdf.query.GraphQueryResult result) throws Exception
result
- The connection from which to read the results.Exception
- If anything goes wrong.protected static int countMatches(org.openrdf.model.Graph g, org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
protected static org.openrdf.model.Statement[] getMatches(org.openrdf.model.Graph g, org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
protected static void assertSameGraph(org.openrdf.model.Graph expected, IPreparedGraphQuery actual) throws Exception
Note: This is not very efficient if the Graph
implementations are
not indexed.
Note: This does not handle equality testing with blank nodes (it does not test for isomorphic graphs).
expected
- actual
- Exception
protected static void assertSameGraph(org.openrdf.model.Graph expected, org.openrdf.model.Graph actual)
Note: This is not very efficient if the Graph
implementations are
not indexed.
Note: This does not handle equality testing with blank nodes (it does not test for isomorphic graphs).
expected
- actual
- protected static org.openrdf.model.Graph asGraph(IPreparedGraphQuery preparedQuery) throws Exception
IPreparedGraphQuery
and ensures
that the GraphQueryResult
is closed.preparedQuery
- The prepared query.Exception
protected static org.openrdf.model.Graph asGraph(org.openrdf.query.GraphQueryResult result) throws Exception
Exception
protected static long countResults(org.openrdf.repository.RepositoryResult<org.openrdf.model.Statement> result) throws Exception
result
- The result set.Exception
protected byte[] genNTRIPLES(int ntriples, org.openrdf.rio.RDFFormat format) throws org.openrdf.rio.RDFHandlerException
RDFFormat
.ntriples
- The #of statements to generate.format
- The format.org.openrdf.rio.RDFHandlerException
protected org.openrdf.model.Graph genNTRIPLES2(int ntriples) throws org.openrdf.rio.RDFHandlerException
org.openrdf.rio.RDFHandlerException
protected org.openrdf.model.Literal getVeryLargeLiteral()
protected long countAll() throws Exception
Exception
getExactSize()
@Deprecated protected long getExactSize()
countAll()
protected void doDeleteWithPostTest(org.openrdf.rio.RDFFormat format) throws Exception
format
- The interchange format.Exception
protected long doDeleteWithAccessPath(org.openrdf.model.URI s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.URI... c) throws Exception
Exception
protected void doDeleteWithBody(int ntriples, org.openrdf.rio.RDFFormat format) throws Exception
Exception
protected void doInsertWithBodyTest(String method, int ntriples, org.openrdf.rio.RDFFormat format) throws Exception
Exception
protected long doInsertbyURL(String method, String resource) throws Exception
NanoSparqlServer
. This is used to
load resources in the test package into the server.Exception
protected static String readFromFile(File file) throws IOException
file
- The file.IOException
protected static org.openrdf.model.Graph readGraphFromFile(File file) throws org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException, IOException
org.openrdf.rio.RDFParseException
org.openrdf.rio.RDFHandlerException
IOException
protected static byte[] writeOnBuffer(org.openrdf.rio.RDFFormat format, org.openrdf.model.Graph g) throws org.openrdf.rio.RDFHandlerException
format
- The RDF Format to use.g
- The graph.org.openrdf.rio.RDFHandlerException
protected org.openrdf.model.Graph loadGraphFromResource(String resource) throws org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException, IOException
resource
- The resource.org.openrdf.rio.RDFParseException
org.openrdf.rio.RDFHandlerException
IOException
protected long doInsertByBody(String method, org.openrdf.rio.RDFFormat rdfFormat, org.openrdf.model.Graph g, org.openrdf.model.URI defaultContext) throws Exception
method
- servlet
- resource
- Exception
protected static String getResponseBody(HttpURLConnection conn) throws IOException
IOException
protected void doDescribeTest(String method, org.openrdf.rio.RDFFormat format) throws Exception
format
- The format is used to specify the Accept header.Exception
protected void setupDataOnServer() throws Exception
Exception
protected void setupQuadsDataOnServer() throws Exception
Exception
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.