Maven migration (first draft)

This commit is contained in:
Graham Triggs 2015-11-19 23:47:41 +00:00
parent da79ac3e1d
commit fee48b0b50
1711 changed files with 662 additions and 0 deletions

View file

@ -0,0 +1,6 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix auth: <http://vitro.mannlib.cornell.edu/ns/vitro/authorization#> .
@prefix simplePermission: <java:edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission#> .
auth:ADMIN
auth:hasPermission simplePermission:UseSparqlUpdateApi ;

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>Test Suite</title>
</head>
<body>
<table id="suiteTable" cellpadding="1" cellspacing="1" border="1" class="selenium"><tbody>
<tr><td><b>Test Suite</b></td></tr>
<tr><td><a href="TestApiDisabled.html">TestApiDisabled</a></td></tr>
<tr><td><a href="TestApiWorks.html">TestApiWorks</a></td></tr>
<tr><td><a href="TestApiFailure.html">TestApiFailure</a></td></tr>
</tbody></table>
</body>
</html>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>CreateTestFacultyMember</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">CreateTestFacultyMember</td></tr>
</thead><tbody>
<!--Check that API is disabled by default-->
<tr>
<td>deleteAllVisibleCookies</td>
<td></td>
<td></td>
</tr>
<tr>
<td>setTimeout</td>
<td>10000000</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=input[type=&quot;submit&quot;]</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>403 Account is not authorized</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>CreateTestFacultyMember</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">CreateTestFacultyMember</td></tr>
</thead><tbody>
<!--Check API failure conditions-->
<tr>
<td>deleteAllVisibleCookies</td>
<td></td>
<td></td>
</tr>
<tr>
<td>setTimeout</td>
<td>10000000</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='GET method not allowed']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>HTTP Status 405 - HTTP method GET is not supported by this URL</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='Email and password missing']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>403 email/password combination is not valid</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='No such user']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>403 email/password combination is not valid</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='Wrong password']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>403 email/password combination is not valid</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='Account not authorized']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>403 Account is not authorized</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='SPARQL is invalid']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>400 Failed to parse SPARQL update</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value=&quot;SPARQL doesn't specify a GRAPH&quot;]</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>400 SPARQL update must specify a GRAPH URI.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>CreateTestFacultyMember</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">CreateTestFacultyMember</td></tr>
</thead><tbody>
<!--Check that API works-->
<tr>
<td>deleteAllVisibleCookies</td>
<td></td>
<td></td>
</tr>
<tr>
<td>setTimeout</td>
<td>10000000</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=input[type=&quot;submit&quot;]</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>200 SPARQL update accepted.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Get RDF</td>
<td></td>
</tr>
<!--During pause check that RDF is displayed-->
<tr>
<td>pause</td>
<td>10000</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='Successful DELETE']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>200 SPARQL update accepted.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Get RDF</td>
<td></td>
</tr>
<tr>
<td>assertTitle</td>
<td>Individual Not Found</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/vivo/TestSparqlApi.html</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -0,0 +1,163 @@
<style>
form {
border: 2 solid black;
background-color: #E0E0E0;
}
input, textarea {
margin: 6px;
}
form a {
float: right;
}
</style>
<h1>Test the SPARQL API</h1>
<form action="api/sparqlUpdate" method="POST">
<a href="individual?uri=http%3A%2F%2Ftest.domain%2Fns%23book1&format=rdfxml">Get RDF</a>
<input type="text" name="email" value="testAdmin@cornell.edu" />
<input type="text" name="password" value="Password" />
<br/>
<textarea name="update" rows="6" cols="70" wrap="soft">
INSERT DATA {
GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-2> {
<http://test.domain/ns#book1>
<http://purl.org/dc/elements/1.1/title>
"Fundamentals of Compiler Design" .
}
}
</textarea>
<br/>
<input type="submit" value="Successful INSERT">
</form>
<form action="api/sparqlUpdate" method="POST">
<a href="individual?uri=http%3A%2F%2Ftest.domain%2Fns%23book1&format=rdfxml">Get RDF</a>
<input type="text" name="email" value="testAdmin@cornell.edu" />
<input type="text" name="password" value="Password" />
<br/>
<textarea name="update" rows="7" cols="70" wrap="soft">
DELETE DATA {
GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-2> {
<http://test.domain/ns#book1>
<http://purl.org/dc/elements/1.1/title>
"Fundamentals of Compiler Design" .
}
}
</textarea>
<br/>
<input type="submit" value="Successful DELETE">
</form>
<form action="api/sparqlUpdate" method="GET">
<input type="text" name="email" value="testAdmin@cornell.edu" />
<input type="text" name="password" value="Password" />
<br/>
<textarea name="update" rows="4" cols="70" wrap="soft">
INSERT DATA {
GRAPH <bogus> {
}
}
</textarea>
<br/>
<input type="submit" value="GET method not allowed">
</form>
<form action="api/sparqlUpdate" method="POST">
<textarea name="update" rows="4" cols="70" wrap="soft">
INSERT DATA {
GRAPH <bogus> {
}
}
</textarea>
<br/>
<input type="submit" value="Email and password missing">
</form>
<form action="api/sparqlUpdate" method="POST">
<input type="text" name="email" value="bogus@cornell.edu" />
<input type="text" name="password" value="Password" />
<br/>
<textarea name="update" rows="4" cols="70" wrap="soft">
INSERT DATA {
GRAPH <bogus> {
}
}
</textarea>
<br/>
<input type="submit" value="No such user">
</form>
<form action="api/sparqlUpdate" method="POST">
<input type="text" name="email" value="testAdmin@cornell.edu" />
<input type="text" name="password" value="BOGUS" />
<br/>
<textarea name="update" rows="4" cols="70" wrap="soft">
INSERT DATA {
GRAPH <bogus> {
}
}
</textarea>
<br/>
<input type="submit" value="Wrong password">
</form>
<form action="api/sparqlUpdate" method="POST">
<input type="text" name="email" value="joeUser@cornell.edu" />
<input type="text" name="password" value="Password" />
<br/>
<textarea name="update" rows="4" cols="70" wrap="soft">
INSERT DATA {
GRAPH <bogus> {
}
}
</textarea>
<br/>
<input type="submit" value="Account not authorized">
</form>
<form action="api/sparqlUpdate" method="POST">
<input type="text" name="email" value="testAdmin@cornell.edu" />
<input type="text" name="password" value="Password" />
<input type="submit" value="SPARQL is missing">
</form>
<form action="api/sparqlUpdate" method="POST">
<input type="text" name="email" value="testAdmin@cornell.edu" />
<input type="text" name="password" value="Password" />
<br/>
<textarea name="update" rows="4" cols="70" wrap="soft">
INSERT DATA } {
GRAPH <bogus> {
}
}
</textarea>
<br/>
<input type="submit" value="SPARQL is invalid">
</form>
<form action="api/sparqlUpdate" method="POST">
<input type="text" name="email" value="testAdmin@cornell.edu" />
<input type="text" name="password" value="Password" />
<br/>
<textarea name="update" rows="5" cols="70" wrap="soft">
INSERT DATA {
<http://test.domain/ns#book1>
<http://purl.org/dc/elements/1.1/title>
"Fundamentals of Compiler Design" .
}
</textarea>
<br/>
<input type="submit" value="SPARQL doesn't specify a GRAPH">
</form>
<pre>
200 Success
400 Failed to parse SPARQL update
400 SPARQL update must specify a GRAPH URI.
403 username/password combination is not valid
403 Account is not authorized
405 Method not allowed
500 Unknown error
</pre>