Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactoring unit tests.

  • Loading branch information...
commit a164ba90572794836d90ecb1580d8fdd96542810 1 parent b437dbb
@spmallette spmallette authored
View
76 rexster-server/src/test/java/com/tinkerpop/rexster/BaseTest.java
@@ -1,6 +1,9 @@
package com.tinkerpop.rexster;
import com.tinkerpop.blueprints.Graph;
+import com.tinkerpop.blueprints.impls.sail.SailGraph;
+import com.tinkerpop.blueprints.impls.sail.SailGraphFactory;
+import com.tinkerpop.blueprints.impls.sail.impls.MemoryStoreSailGraph;
import com.tinkerpop.blueprints.impls.tg.TinkerGraph;
import com.tinkerpop.blueprints.impls.tg.TinkerGraphFactory;
import com.tinkerpop.rexster.server.DefaultRexsterApplication;
@@ -11,6 +14,7 @@
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -45,17 +49,13 @@
@Before
public void init() {
this.mockery = new JUnit4Mockery();
+ this.createDefaultGraphs(TinkerGraphFactory.createTinkerGraph(), new TinkerGraph());
+ }
- this.toyGraph = TinkerGraphFactory.createTinkerGraph();
- this.raToyGraph = new DefaultRexsterApplication(graphName, this.toyGraph);
-
- this.emptyGraph = new TinkerGraph();
- this.raEmptyGraph = new DefaultRexsterApplication(graphName, this.emptyGraph);
-
- final List<String> namespaces = new ArrayList<String>();
- namespaces.add("*:*");
- this.raToyGraph.getApplicationGraph(graphName).loadAllowableExtensions(namespaces);
- this.raEmptyGraph.getApplicationGraph(graphName).loadAllowableExtensions(namespaces);
+ @After
+ public void tearDown() {
+ this.toyGraph.shutdown();
+ this.emptyGraph.shutdown();
}
public static void printPerformance(String name, Integer events, String eventName, double timeInMilliseconds) {
@@ -65,22 +65,45 @@ public static void printPerformance(String name, Integer events, String eventNam
logger.info(name + ": " + eventName + " in " + timeInMilliseconds + "ms");
}
- protected ResourceHolder<VertexResource> constructResourceWithToyGraph() {
- return this.constructResource(true, new HashMap<String, Object>(), MediaType.APPLICATION_JSON_TYPE);
+ protected ResourceHolder<PrefixResource> constructPrefixResource() {
+ final SailGraph sg = new MemoryStoreSailGraph();
+ SailGraphFactory.createTinkerGraph(sg);
+
+ // have to reset with a sail graph for prefixes to work. empty graph is not used
+ // in these tests so no need to reset.
+ this.createDefaultGraphs(sg, this.emptyGraph);
+
+ final UriInfo uri = this.mockery.mock(UriInfo.class);
+ final URI requestUriPath = URI.create("http://localhost/graphs/graph/prefixes");
+ final HttpServletRequest httpServletRequest = this.mockery.mock(HttpServletRequest.class);
+
+ this.mockery.checking(new Expectations() {{
+ allowing(httpServletRequest).getParameterMap();
+ will(returnValue(new HashMap<String, String>()));
+ allowing(uri).getAbsolutePath();
+ will(returnValue(requestUriPath));
+ }});
+
+ final PrefixResource resource = new PrefixResource(uri, httpServletRequest, this.raToyGraph);
+ return new ResourceHolder<PrefixResource>(resource, null);
+ }
+
+ protected ResourceHolder<VertexResource> constructVertexResourceWithToyGraph() {
+ return this.constructVertexResource(true, new HashMap<String, Object>(), MediaType.APPLICATION_JSON_TYPE);
}
- protected ResourceHolder<VertexResource> constructResourceWithEmptyGraph() {
- return this.constructResource(false, new HashMap<String, Object>(), MediaType.APPLICATION_JSON_TYPE);
+ protected ResourceHolder<VertexResource> constructVertexResourceWithEmptyGraph() {
+ return this.constructVertexResource(false, new HashMap<String, Object>(), MediaType.APPLICATION_JSON_TYPE);
}
- protected ResourceHolder<VertexResource> constructResource(final boolean useToyGraph,
- final HashMap<String, Object> parameters){
- return this.constructResource(useToyGraph, parameters, MediaType.APPLICATION_JSON_TYPE);
+ protected ResourceHolder<VertexResource> constructVertexResource(final boolean useToyGraph,
+ final HashMap<String, Object> parameters){
+ return this.constructVertexResource(useToyGraph, parameters, MediaType.APPLICATION_JSON_TYPE);
}
- protected ResourceHolder<VertexResource> constructResource(final boolean useToyGraph,
- final HashMap<String, Object> parameters,
- final MediaType mediaType) {
+ protected ResourceHolder<VertexResource> constructVertexResource(final boolean useToyGraph,
+ final HashMap<String, Object> parameters,
+ final MediaType mediaType) {
final UriInfo uri = this.mockery.mock(UriInfo.class);
final HttpServletRequest httpServletRequest = this.mockery.mock(HttpServletRequest.class);
@@ -120,4 +143,17 @@ protected void assertFoundElementsInResults(final JSONArray jsonResultArray, fin
Assert.assertTrue(foundIds.contains(expectedId));
}
}
+
+ private void createDefaultGraphs(final Graph toy, final Graph empty) {
+ this.toyGraph = toy;
+ this.emptyGraph = empty;
+
+ this.raToyGraph = new DefaultRexsterApplication(graphName, toy);
+ this.raEmptyGraph = new DefaultRexsterApplication(graphName, empty);
+
+ final List<String> namespaces = new ArrayList<String>();
+ namespaces.add("*:*");
+ this.raToyGraph.getApplicationGraph(graphName).loadAllowableExtensions(namespaces);
+ this.raEmptyGraph.getApplicationGraph(graphName).loadAllowableExtensions(namespaces);
+ }
}
View
81 rexster-server/src/test/java/com/tinkerpop/rexster/PrefixResourceTest.java
@@ -22,75 +22,37 @@
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
-public class PrefixResourceTest {
-
- private static final String graphName = "graph";
- protected Mockery mockery = new JUnit4Mockery();
-
- @Before
- public void init() {
- this.mockery = new JUnit4Mockery();
- }
-
+public class PrefixResourceTest extends BaseTest {
@Test
public void getPrefixesValid() {
- final SailGraph sg = new MemoryStoreSailGraph();
- SailGraphFactory.createTinkerGraph(sg);
- final RexsterApplicationGraph rag = new RexsterApplicationGraph(graphName, sg);
- final RexsterApplication ra = this.mockery.mock(RexsterApplication.class);
- final UriInfo uri = this.mockery.mock(UriInfo.class);
- final HttpServletRequest httpServletRequest = this.mockery.mock(HttpServletRequest.class);
-
- this.mockery.checking(new Expectations() {{
- allowing(httpServletRequest).getParameterMap();
- will(returnValue(new HashMap<String, String>()));
- allowing(ra).getApplicationGraph(with(any(String.class)));
- will(returnValue(rag));
- }});
-
- PrefixResource resource = new PrefixResource(uri, httpServletRequest, ra);
- Response response = resource.getPrefixes("graph");
+ final ResourceHolder<PrefixResource> holder = this.constructPrefixResource();
+ final Response response = holder.getResource().getPrefixes(graphName);
Assert.assertNotNull(response);
Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- JSONObject jsonObject = (JSONObject) response.getEntity();
+ final JSONObject jsonObject = (JSONObject) response.getEntity();
Assert.assertNotNull(jsonObject);
Assert.assertTrue(jsonObject.has(Tokens.RESULTS));
- JSONArray results = jsonObject.optJSONArray(Tokens.RESULTS);
+ final JSONArray results = jsonObject.optJSONArray(Tokens.RESULTS);
Assert.assertNotNull(results);
-// Assert.assertEquals(6, results.length());
+ Assert.assertEquals(1, results.length());
Assert.assertTrue(jsonObject.has(Tokens.QUERY_TIME));
}
@Test
public void getSinglePrefixValid() {
-
- SailGraph sg = new MemoryStoreSailGraph();
- SailGraphFactory.createTinkerGraph(sg);
- final RexsterApplicationGraph rag = new RexsterApplicationGraph("graph", sg);
- final RexsterApplication ra = this.mockery.mock(RexsterApplication.class);
-
- final UriInfo uri = this.mockery.mock(UriInfo.class);
- final HttpServletRequest httpServletRequest = this.mockery.mock(HttpServletRequest.class);
-
- this.mockery.checking(new Expectations() {{
- allowing(httpServletRequest).getParameterMap();
- will(returnValue(new HashMap<String, String>()));
- allowing(ra).getApplicationGraph(with(any(String.class)));
- will(returnValue(rag));
- }});
-
- PrefixResource resource = new PrefixResource(uri, httpServletRequest, ra);
- Response response = resource.getSinglePrefix("graph", "tg");
+ final ResourceHolder<PrefixResource> holder = this.constructPrefixResource();
+ final PrefixResource resource = holder.getResource();
+ final Response response = resource.getSinglePrefix(graphName, "tg");
Assert.assertNotNull(response);
Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- JSONObject jsonObject = (JSONObject) response.getEntity();
+ final JSONObject jsonObject = (JSONObject) response.getEntity();
Assert.assertNotNull(jsonObject);
Assert.assertTrue(jsonObject.has(Tokens.RESULTS));
@@ -101,29 +63,14 @@ public void getSinglePrefixValid() {
@Test
public void deleteSinglePrefixValid() {
-
- SailGraph sg = new MemoryStoreSailGraph();
- SailGraphFactory.createTinkerGraph(sg);
- final RexsterApplicationGraph rag = new RexsterApplicationGraph("graph", sg);
- final RexsterApplication ra = this.mockery.mock(RexsterApplication.class);
-
- final UriInfo uri = this.mockery.mock(UriInfo.class);
- final HttpServletRequest httpServletRequest = this.mockery.mock(HttpServletRequest.class);
-
- this.mockery.checking(new Expectations() {{
- allowing(httpServletRequest).getParameterMap();
- will(returnValue(new HashMap<String, String>()));
- allowing(ra).getApplicationGraph(with(any(String.class)));
- will(returnValue(rag));
- }});
-
- PrefixResource resource = new PrefixResource(uri, httpServletRequest, ra);
- Response response = resource.deleteSinglePrefix("graph", "tg");
+ final ResourceHolder<PrefixResource> holder = this.constructPrefixResource();
+ final PrefixResource resource = holder.getResource();
+ Response response = resource.deleteSinglePrefix(graphName, "tg");
Assert.assertNotNull(response);
Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- JSONObject jsonObject = (JSONObject) response.getEntity();
+ final JSONObject jsonObject = (JSONObject) response.getEntity();
Assert.assertNotNull(jsonObject);
Assert.assertTrue(jsonObject.has(Tokens.QUERY_TIME));
View
58 rexster-server/src/test/java/com/tinkerpop/rexster/VertexResourceTest.java
@@ -23,7 +23,7 @@
public class VertexResourceTest extends BaseTest {
@Test
public void getVerticesAll() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getVertices(graphName);
this.assertVerticesOkResponseJsonStructure(6, 6, response);
@@ -39,7 +39,7 @@ public void getVerticesKeyIndexed() {
parameters.put(Tokens.KEY, "name");
parameters.put(Tokens.VALUE, "marko");
- final VertexResource resource = this.constructResource(true, parameters).getResource();
+ final VertexResource resource = this.constructVertexResource(true, parameters).getResource();
final KeyIndexableGraph graph = (KeyIndexableGraph) this.toyGraph;
graph.createKeyIndex("name", Vertex.class);
@@ -53,7 +53,7 @@ public void getVerticesKeyIndexed() {
@Test
public void getVerticesNoResults() {
- final VertexResource resource = this.constructResourceWithEmptyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithEmptyGraph().getResource();
final Response response = resource.getVertices(graphName);
this.assertVerticesOkResponseJsonStructure(0, 0, response);
}
@@ -64,7 +64,7 @@ public void getVerticesWithValidOffset() {
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_START, "1");
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_END, "3");
- final VertexResource resource = this.constructResource(true, parameters).getResource();
+ final VertexResource resource = this.constructVertexResource(true, parameters).getResource();
final Response response = resource.getVertices(graphName);
this.assertVerticesOkResponseJsonStructure(2, 2, response);
@@ -79,7 +79,7 @@ public void getVerticesWithInvalidOffsetNotEnoughResults() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_START, "10");
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_END, "20");
- final VertexResource resource = this.constructResource(true, parameters).getResource();
+ final VertexResource resource = this.constructVertexResource(true, parameters).getResource();
final Response response = resource.getVertices(graphName);
this.assertVerticesOkResponseJsonStructure(0, 0, response);
@@ -90,7 +90,7 @@ public void getVerticesWithInvalidOffsetStartAfterEnd() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_START, "100");
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_END, "20");
- final VertexResource resource = this.constructResource(true, parameters).getResource();
+ final VertexResource resource = this.constructVertexResource(true, parameters).getResource();
final Response response = resource.getVertices(graphName);
this.assertVerticesOkResponseJsonStructure(0, 0, response);
@@ -98,13 +98,13 @@ public void getVerticesWithInvalidOffsetStartAfterEnd() {
@Test(expected = WebApplicationException.class)
public void getSingleVertexNotFound() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
resource.getSingleVertex(graphName, "id-does-not-match-any");
}
@Test
public void getSingleVertexFound() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getSingleVertex(graphName, "1");
Assert.assertNotNull(response);
@@ -124,13 +124,13 @@ public void getSingleVertexFound() {
@Test(expected = WebApplicationException.class)
public void getVertexEdgesNotFound() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
resource.getSingleVertex(graphName, "id-does-not-match-any");
}
@Test
public void getVertexEdgesFoundVertexReturnInEdgesNoOffset() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getVertexEdges(graphName, "3", Tokens.IN_E);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 3);
@@ -145,7 +145,7 @@ public void getVertexEdgesFoundVertexReturnOutEdgesNoOffsetWithLabel() {
put(Tokens._LABEL, "created");
}};
- final VertexResource resource = this.constructResource(true, map).getResource();
+ final VertexResource resource = this.constructVertexResource(true, map).getResource();
final Response response = resource.getVertexEdges(graphName, "1", Tokens.OUT_E);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 1);
@@ -156,7 +156,7 @@ public void getVertexEdgesFoundVertexReturnOutEdgesNoOffsetWithLabel() {
@Test
public void getVertexEdgesFoundVertexReturnInVerticesNoOffset() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getVertexEdges(graphName, "3", Tokens.IN);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 3);
@@ -176,7 +176,7 @@ public void getVertexEdgesFoundVertexReturnInVerticesNoOffsetWithLabel() {
put(Tokens._LABEL, "knows");
}};
- final VertexResource resource = this.constructResource(true, map).getResource();
+ final VertexResource resource = this.constructVertexResource(true, map).getResource();
final Response response = resource.getVertexEdges("graph", "1", Tokens.IN);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 1);
@@ -187,7 +187,7 @@ public void getVertexEdgesFoundVertexReturnInVerticesNoOffsetWithLabel() {
@Test
public void getVertexEdgesFoundVertexOutEdgesNoOffset() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getVertexEdges(graphName, "6", Tokens.OUT_E);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 1);
@@ -198,7 +198,7 @@ public void getVertexEdgesFoundVertexOutEdgesNoOffset() {
@Test
public void getVertexEdgesFoundVertexOutVerticesNoOffset() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getVertexEdges(graphName, "6", Tokens.OUT);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 1);
@@ -209,7 +209,7 @@ public void getVertexEdgesFoundVertexOutVerticesNoOffset() {
@Test
public void getVertexEdgesFoundVertexBothEdgesNoOffset() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getVertexEdges(graphName, "4", Tokens.BOTH_E);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 3);
@@ -220,7 +220,7 @@ public void getVertexEdgesFoundVertexBothEdgesNoOffset() {
@Test
public void getVertexEdgesFoundVertexBothVerticesNoOffset() {
- final VertexResource resource = this.constructResourceWithToyGraph().getResource();
+ final VertexResource resource = this.constructVertexResourceWithToyGraph().getResource();
final Response response = resource.getVertexEdges(graphName, "4", Tokens.BOTH);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 3);
@@ -234,7 +234,7 @@ public void getVertexEdgesFoundVertexBothEdgesWithValidOffset() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_START, "1");
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_END, "3");
- final VertexResource resource = this.constructResource(true, parameters).getResource();
+ final VertexResource resource = this.constructVertexResource(true, parameters).getResource();
final Response response = resource.getVertexEdges(graphName, "1", Tokens.BOTH_E);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 3);
@@ -248,7 +248,7 @@ public void getVertexEdgesFoundVertexBothEdgesWithOffsetNotEnoughResults() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_START, "10");
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_END, "20");
- final VertexResource resource = this.constructResource(true, parameters).getResource();
+ final VertexResource resource = this.constructVertexResource(true, parameters).getResource();
final Response response = resource.getVertexEdges(graphName, "1", Tokens.BOTH_E);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 3);
@@ -263,7 +263,7 @@ public void getVertexEdgesFoundVertexBothEdgesWithOffsetStartAfterEnd() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_START, "30");
parameters.put(Tokens.REXSTER + "." + Tokens.OFFSET_END, "20");
- final VertexResource resource = this.constructResource(true, parameters).getResource();
+ final VertexResource resource = this.constructVertexResource(true, parameters).getResource();
final Response response = resource.getVertexEdges(graphName, "1", Tokens.BOTH_E);
final JSONObject json = assertEdgesOkResponseJsonStructure(response, 3);
@@ -277,7 +277,7 @@ public void getVertexEdgesFoundVertexBothEdgesWithOffsetStartAfterEnd() {
public void postNullVertexOnUriAcceptTypedJsonValid() {
// types are always parsed on the URI
final HashMap<String, Object> parameters = generateVertexParametersToPost(true);
- final ResourceHolder<VertexResource> holder = constructResource(false, parameters,
+ final ResourceHolder<VertexResource> holder = constructVertexResource(false, parameters,
RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON_TYPE);
final VertexResource resource = holder.getResource();
final Response response = resource.postNullVertexOnUri(holder.getRequest(), graphName);
@@ -289,7 +289,7 @@ public void postNullVertexOnUriAcceptTypedJsonValid() {
public void postNullVertexRexsterConsumesJsonAcceptJsonValid() {
final HashMap<String, Object> parameters = generateVertexParametersToPost(false);
final JSONObject jsonToPost = new JSONObject(parameters);
- final ResourceHolder<VertexResource> holder = constructResource(false, parameters);
+ final ResourceHolder<VertexResource> holder = constructVertexResource(false, parameters);
final VertexResource resource = holder.getResource();
final Response response = resource.postNullVertexRexsterConsumesJson(holder.getRequest(), graphName, jsonToPost);
assertPostVertexProducesJson(response, false, false);
@@ -299,7 +299,7 @@ public void postNullVertexRexsterConsumesJsonAcceptJsonValid() {
public void postNullVertexRexsterConsumesTypedJsonAcceptTypedJsonValid() {
final HashMap<String, Object> parameters = generateVertexParametersToPost(true);
final JSONObject jsonToPost = new JSONObject(parameters);
- final ResourceHolder<VertexResource> holder = constructResource(false, parameters, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON_TYPE);
+ final ResourceHolder<VertexResource> holder = constructVertexResource(false, parameters, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON_TYPE);
final VertexResource resource = holder.getResource();
final Response response = resource.postNullVertexRexsterConsumesTypedJson(holder.getRequest(), graphName, jsonToPost);
assertPostVertexProducesJson(response, false, true);
@@ -309,7 +309,7 @@ public void postNullVertexRexsterConsumesTypedJsonAcceptTypedJsonValid() {
public void postVertexOnUriButHasElementProperties() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Tokens._ID, "300");
- final ResourceHolder<VertexResource> holder = constructResource(true, parameters);
+ final ResourceHolder<VertexResource> holder = constructVertexResource(true, parameters);
final VertexResource resource = holder.getResource();
resource.postVertexOnUri(holder.getRequest(), graphName, "1");
}
@@ -318,7 +318,7 @@ public void postVertexOnUriButHasElementProperties() {
public void putVertexConsumesUriValid() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("some-property", "300a");
- final ResourceHolder<VertexResource> holder = this.constructResource(true, parameters);
+ final ResourceHolder<VertexResource> holder = this.constructVertexResource(true, parameters);
final VertexResource resource = holder.getResource();
final Response response = resource.putVertexConsumesUri(holder.getRequest(), graphName, "1");
@@ -342,13 +342,13 @@ public void putVertexConsumesUriValid() {
@Test(expected = WebApplicationException.class)
public void putVertexConsumesUriNoVertexFound() {
final HashMap<String, Object> parameters = generateVertexParametersToPost(false);
- final ResourceHolder<VertexResource> holder = constructResource(false, parameters);
+ final ResourceHolder<VertexResource> holder = constructVertexResource(false, parameters);
holder.getResource().putVertexConsumesUri(holder.getRequest(), graphName, "1");
}
@Test
public void deleteVertexValid() {
- final ResourceHolder<VertexResource> holder = this.constructResourceWithToyGraph();
+ final ResourceHolder<VertexResource> holder = this.constructVertexResourceWithToyGraph();
final VertexResource resource = holder.getResource();
final Response response = resource.deleteVertex(graphName, "1");
@@ -363,7 +363,7 @@ public void deleteVertexValid() {
@Test(expected = WebApplicationException.class)
public void deleteVertexNoVertexFound() {
- final ResourceHolder<VertexResource> holder = this.constructResourceWithToyGraph();
+ final ResourceHolder<VertexResource> holder = this.constructVertexResourceWithToyGraph();
final VertexResource resource = holder.getResource();
resource.deleteVertex(graphName, "100");
}
@@ -372,7 +372,7 @@ public void deleteVertexNoVertexFound() {
public void deleteVertexPropertiesValid() {
final HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("name", "");
- final ResourceHolder<VertexResource> holder = this.constructResource(true, parameters);
+ final ResourceHolder<VertexResource> holder = this.constructVertexResource(true, parameters);
final VertexResource resource = holder.getResource();
final Response response = resource.deleteVertex(graphName, "1");
Please sign in to comment.
Something went wrong with that request. Please try again.