Search in sources :

Example 1 with ImmutableMetaDatabase

use of com.torodb.core.transaction.metainf.ImmutableMetaDatabase in project torodb by torodb.

the class IdentifierFactoryImplTest method unallowedCollectionDocPartRootToIdentifierTest.

@Test
public void unallowedCollectionDocPartRootToIdentifierTest() {
    ImmutableMetaDatabase metaDatabase = new ImmutableMetaDatabase.Builder("database", "database").build();
    String identifier = identifierFactory.toDocPartIdentifier(metaDatabase, "unallowed_table", createTableRef());
    Assert.assertEquals("_unallowed_table", identifier);
}
Also used : ImmutableMetaDatabase(com.torodb.core.transaction.metainf.ImmutableMetaDatabase) Test(org.junit.Test)

Example 2 with ImmutableMetaDatabase

use of com.torodb.core.transaction.metainf.ImmutableMetaDatabase in project torodb by torodb.

the class IdentifierFactoryImplTest method docPartArrayChildToIdentifierTest.

@Test
public void docPartArrayChildToIdentifierTest() {
    ImmutableMetaDatabase metaDatabase = new ImmutableMetaDatabase.Builder("database", "database").build();
    String identifier = identifierFactory.toDocPartIdentifier(metaDatabase, "collecti", createTableRef("array"));
    Assert.assertEquals("collecti_array", identifier);
}
Also used : ImmutableMetaDatabase(com.torodb.core.transaction.metainf.ImmutableMetaDatabase) Test(org.junit.Test)

Example 3 with ImmutableMetaDatabase

use of com.torodb.core.transaction.metainf.ImmutableMetaDatabase in project torodb by torodb.

the class IdentifierFactoryImplTest method long128DocPartToIdentifierTest.

@Test
public void long128DocPartToIdentifierTest() {
    ImmutableMetaDatabase metaDatabase = new ImmutableMetaDatabase.Builder("database", "database").build();
    String identifier = identifierFactory.toDocPartIdentifier(metaDatabase, "collecti", createTableRef("long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long"));
    Assert.assertEquals("collecti_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long", identifier);
}
Also used : ImmutableMetaDatabase(com.torodb.core.transaction.metainf.ImmutableMetaDatabase) Test(org.junit.Test)

Example 4 with ImmutableMetaDatabase

use of com.torodb.core.transaction.metainf.ImmutableMetaDatabase in project torodb by torodb.

the class IdentifierFactoryImplTest method docPartObjectArrayInArrayObjectToIdentifierTest.

@Test
public void docPartObjectArrayInArrayObjectToIdentifierTest() {
    ImmutableMetaDatabase metaDatabase = new ImmutableMetaDatabase.Builder("database", "database").build();
    String identifier = identifierFactory.toDocPartIdentifier(metaDatabase, "collecti", createTableRef("object", "array", "2", "object"));
    Assert.assertEquals("collecti_object_array$2_object", identifier);
}
Also used : ImmutableMetaDatabase(com.torodb.core.transaction.metainf.ImmutableMetaDatabase) Test(org.junit.Test)

Example 5 with ImmutableMetaDatabase

use of com.torodb.core.transaction.metainf.ImmutableMetaDatabase in project torodb by torodb.

the class IdentifierFactoryImplTest method docPartRootToIdentifierTest.

@Test
public void docPartRootToIdentifierTest() {
    ImmutableMetaDatabase metaDatabase = new ImmutableMetaDatabase.Builder("database", "database").build();
    String identifier = identifierFactory.toDocPartIdentifier(metaDatabase, "collecti", createTableRef());
    Assert.assertEquals("collecti", identifier);
}
Also used : ImmutableMetaDatabase(com.torodb.core.transaction.metainf.ImmutableMetaDatabase) Test(org.junit.Test)

Aggregations

ImmutableMetaDatabase (com.torodb.core.transaction.metainf.ImmutableMetaDatabase)13 Test (org.junit.Test)12 Lists (com.google.common.collect.Lists)1 CollectionData (com.torodb.core.d2r.CollectionData)1 D2RTranslator (com.torodb.core.d2r.D2RTranslator)1 D2RTranslatorFactory (com.torodb.core.d2r.D2RTranslatorFactory)1 ImmutableMetaDocPart (com.torodb.core.transaction.metainf.ImmutableMetaDocPart)1 MutableMetaCollection (com.torodb.core.transaction.metainf.MutableMetaCollection)1 WrapperMutableMetaCollection (com.torodb.core.transaction.metainf.WrapperMutableMetaCollection)1 WrapperMutableMetaDatabase (com.torodb.core.transaction.metainf.WrapperMutableMetaDatabase)1 KvDocument (com.torodb.kvdocument.values.KvDocument)1 Collections (java.util.Collections)1 List (java.util.List)1 Tuple2 (org.jooq.lambda.tuple.Tuple2)1 Assert.assertEquals (org.junit.Assert.assertEquals)1 Before (org.junit.Before)1 BDDMockito.given (org.mockito.BDDMockito.given)1 Mockito (org.mockito.Mockito)1