Search in sources :

Example 71 with Vre

use of nl.knaw.huygens.timbuctoo.model.vre.Vre in project timbuctoo by HuygensING.

the class LoadSaveVreTest method saveCreatesAVertexForTheVre.

@Test
public void saveCreatesAVertexForTheVre() {
    final Vre vre = new Vre("VreName");
    final Vertex result = save(vre, initGraph()).get(0);
    assertThat(result, likeVertex().withLabel(Vre.DATABASE_LABEL).withProperty(VRE_NAME_PROPERTY_NAME, "VreName"));
}
Also used : VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) Neo4jVertex(org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Test(org.junit.Test)

Example 72 with Vre

use of nl.knaw.huygens.timbuctoo.model.vre.Vre in project timbuctoo by HuygensING.

the class CollectionNameHelperTest method collectionNameDoesNotPrefixForTheAdminVre.

@Test
public void collectionNameDoesNotPrefixForTheAdminVre() {
    Vre vre = VreStubs.withName(ADMIN_VRE);
    String collectionName = CollectionNameHelper.collectionName(UNPREFIXED_ENTITY_NAME, vre);
    assertThat(collectionName, not(startsWith(ADMIN_VRE)));
}
Also used : Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 73 with Vre

use of nl.knaw.huygens.timbuctoo.model.vre.Vre in project timbuctoo by HuygensING.

the class CollectionNameHelperTest method collectionNamePrefixesTheCollectionNameWithTheVreName.

@Test
public void collectionNamePrefixesTheCollectionNameWithTheVreName() {
    Vre vre = VreStubs.withName(VRE_NAME);
    String collectionName = CollectionNameHelper.collectionName(UNPREFIXED_ENTITY_NAME, vre);
    assertThat(collectionName, allOf(startsWith(VRE_NAME), containsString(UNPREFIXED_ENTITY_NAME)));
}
Also used : Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 74 with Vre

use of nl.knaw.huygens.timbuctoo.model.vre.Vre in project timbuctoo by HuygensING.

the class CollectionNameHelperTest method entityTypeNamePrefixesWithTheVreName.

@Test
public void entityTypeNamePrefixesWithTheVreName() {
    Vre vre = VreStubs.withName(VRE_NAME);
    String entityTypeName = CollectionNameHelper.entityTypeName(UNPREFIXED_ENTITY_NAME, vre);
    assertThat(entityTypeName, allOf(startsWith(VRE_NAME), endsWith(UNPREFIXED_ENTITY_NAME)));
}
Also used : Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 75 with Vre

use of nl.knaw.huygens.timbuctoo.model.vre.Vre in project timbuctoo by HuygensING.

the class CollectionNameHelperTest method entityTypeNameDoesNotPrefixForTheAdminVre.

@Test
public void entityTypeNameDoesNotPrefixForTheAdminVre() {
    Vre vre = VreStubs.withName(ADMIN_VRE);
    String entityTypeName = CollectionNameHelper.entityTypeName(UNPREFIXED_ENTITY_NAME, vre);
    assertThat(entityTypeName, not(startsWith(ADMIN_VRE)));
}
Also used : Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Aggregations

Vre (nl.knaw.huygens.timbuctoo.model.vre.Vre)81 Test (org.junit.Test)71 TinkerPopGraphManager (nl.knaw.huygens.timbuctoo.server.TinkerPopGraphManager)48 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)46 VreStubs.minimalCorrectVre (nl.knaw.huygens.timbuctoo.model.vre.VreStubs.minimalCorrectVre)44 VertexMatcher.likeVertex (nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex)43 Collection (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection)41 Matchers.containsString (org.hamcrest.Matchers.containsString)35 List (java.util.List)34 Lists (com.google.common.collect.Lists)32 Optional (java.util.Optional)31 RdfProperty (nl.knaw.huygens.timbuctoo.core.dto.rdf.RdfProperty)31 CreateCollection (nl.knaw.huygens.timbuctoo.core.dto.CreateCollection)30 TestGraphBuilder.newGraph (nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph)30 Direction (org.apache.tinkerpop.gremlin.structure.Direction)30 Graph (org.apache.tinkerpop.gremlin.structure.Graph)30 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)30 Matchers.contains (org.hamcrest.Matchers.contains)30 Matchers.containsInAnyOrder (org.hamcrest.Matchers.containsInAnyOrder)30 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)29