public abstract class AbstractProtocolTest extends AbstractTestNanoSparqlClient<IIndexManager>
setMethodisPost(String, String)
, setAllow400s()
,
and then to call serviceRequest(String...)
to actually
process the request.
This process may be repeated multiple times.
After each call to serviceRequest(String...)
the options are reset to the defaults.Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractProtocolTest.RequestFactory |
TestCase2.MyProperties, TestCase2.RandomType
Modifier and Type | Field and Description |
---|---|
protected static String |
ASK |
protected static String |
CONSTRUCT |
protected static long |
PAUSE_BEFORE_CLOSE_TIME |
protected static String |
SELECT |
m_client, m_fixture, m_mgr, m_repo, m_rootURL, m_serviceURL, namespace, packagePath
_randomType, log
Constructor and Description |
---|
AbstractProtocolTest(javax.servlet.http.HttpServlet servlet,
String name) |
AbstractProtocolTest(String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkUpdate(boolean expected)
Assert that the update from
update has or has not taken place. |
protected AbstractProtocolTest.RequestFactory |
getRequestFactory() |
protected String |
getResponseContentType() |
static void |
main(String[] argv)
Sanity check the
charset pattern |
protected void |
matchResponseContentType(String expectedType)
Match content type against expected type
|
protected org.apache.http.conn.ClientConnectionManager |
newInstance() |
protected org.apache.http.conn.scheme.SchemeRegistry |
newSchemeRegistry() |
protected void |
resetDefaultOptions()
This method is called automatically after each call to
serviceRequest(String...)
so probably is unnecessary. |
protected String |
serviceRequest(String... paramValues)
This is the main entry point for subclasses.
|
protected void |
setAccept(String mimetype)
Sets the accept header, default is "*"
|
protected void |
setAllow400s()
Normally a 400 or 404 response fails the test, calling this method allows such responses.
|
protected void |
setHeaders(org.apache.http.Header[] headers) |
protected void |
setMethodAsGet()
The next request is a GET, (this is the default)
|
protected void |
setMethodisPost(String mimeType,
String body)
The method is a POST of the given document
|
protected void |
setMethodisPostUrlEncodedData()
The method is a POST usng url-encoded form data, with the parameters being those past
to
serviceRequest(String...) call. |
void |
setUp() |
void |
tearDown() |
asGraph, asGraph, assertSameGraph, assertSameGraph, countAll, countMatches, countResults, countResults, countResults, doConstructTest, doDeleteWithAccessPath, doDeleteWithBody, doDeleteWithPostTest, doDeleteWithQuery, doDescribeTest, doInsertByBody, doInsertbyURL, doInsertWithBodyTest, genNTRIPLES, genNTRIPLES2, getExactSize, getMatches, getResponseBody, getTestMode, getVeryLargeLiteral, loadGraphFromResource, newFixture, readFromFile, readGraphFromFile, setupDataOnServer, setupQuadsDataOnServer, writeOnBuffer
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 SELECT
protected static final String ASK
protected static final String CONSTRUCT
protected static final long PAUSE_BEFORE_CLOSE_TIME
public AbstractProtocolTest(javax.servlet.http.HttpServlet servlet, String name)
public AbstractProtocolTest(String name)
protected AbstractProtocolTest.RequestFactory getRequestFactory()
public void setUp() throws Exception
setUp
in class AbstractTestNanoSparqlClient<IIndexManager>
Exception
public void tearDown() throws Exception
tearDown
in class AbstractTestNanoSparqlClient<IIndexManager>
Exception
protected void resetDefaultOptions()
serviceRequest(String...)
so probably is unnecessary.protected String getResponseContentType()
protected void matchResponseContentType(String expectedType)
protected void setAccept(String mimetype)
mimetype
- protected void setHeaders(org.apache.http.Header[] headers)
mimetype
- protected org.apache.http.conn.ClientConnectionManager newInstance()
protected org.apache.http.conn.scheme.SchemeRegistry newSchemeRegistry()
protected String serviceRequest(String... paramValues) throws IOException
paramValues
- This is an even number of param [=] value pairs. Multiple values for the same param are supported.
These are passed to the server either as URL query params, or as URL encoded values in the body if the method
setMethodisPostUrlEncodedData()
has been called.IOException
protected void setMethodisPostUrlEncodedData()
serviceRequest(String...)
call.protected void setMethodisPost(String mimeType, String body)
mimeType
- The mimetype of the documentbody
- The string of the document bodyprotected void setAllow400s()
protected void checkUpdate(boolean expected) throws IOException
update
has or has not taken place.
This calls resetDefaultOptions()
, and the next call to serviceRequest(String...)
will need to be setup after this call.expected
- The expected resultIOException
protected void setMethodAsGet()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.