Search in sources :

Example 1 with ImmutableMetaDocPart

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

the class BatchMetaCollectionTest method setUp.

@Before
public void setUp() {
    ImmutableMetaCollection immutableCollection = new ImmutableMetaCollection.Builder("colName", "colId").put(new ImmutableMetaDocPart(tableRefFactory.createRoot(), "docPartName")).build();
    delegate = Mockito.spy(new WrapperMutableMetaCollection(immutableCollection, (o) -> {
    }));
    collection = new BatchMetaCollection(delegate);
}
Also used : WrapperMutableMetaCollection(com.torodb.core.transaction.metainf.WrapperMutableMetaCollection) ImmutableMetaDocPart(com.torodb.core.transaction.metainf.ImmutableMetaDocPart) ImmutableMetaCollection(com.torodb.core.transaction.metainf.ImmutableMetaCollection) Before(org.junit.Before)

Example 2 with ImmutableMetaDocPart

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

the class BatchMetaDocPartTest method setUp.

@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
    testChangeConsumer = mock(Consumer.class);
    delegateChangeConsumer = mock(Consumer.class);
    delegate = new WrapperMutableMetaDocPart(new ImmutableMetaDocPart(tableRefFactory.createRoot(), "docPartId"), delegateChangeConsumer);
    docPart = new BatchMetaDocPart(delegate, testChangeConsumer, true);
}
Also used : WrapperMutableMetaDocPart(com.torodb.core.transaction.metainf.WrapperMutableMetaDocPart) Consumer(java.util.function.Consumer) ImmutableMetaDocPart(com.torodb.core.transaction.metainf.ImmutableMetaDocPart) Before(org.junit.Before)

Example 3 with ImmutableMetaDocPart

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

the class IdentifierFactoryImplTest method emptyFieldToIdentifierTest.

@Test
public void emptyFieldToIdentifierTest() {
    ImmutableMetaDocPart metaDocPart = new ImmutableMetaDocPart.Builder(createTableRef(), "docpart").build();
    String identifier = identifierFactory.toFieldIdentifier(metaDocPart, "", FieldType.STRING);
    Assert.assertEquals("_s", identifier);
}
Also used : ImmutableMetaDocPart(com.torodb.core.transaction.metainf.ImmutableMetaDocPart) Test(org.junit.Test)

Example 4 with ImmutableMetaDocPart

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

the class IdentifierFactoryImplTest method fieldToIdentifierTest.

@Test
public void fieldToIdentifierTest() {
    ImmutableMetaDocPart metaDocPart = new ImmutableMetaDocPart.Builder(createTableRef(), "docpart").build();
    String identifier = identifierFactory.toFieldIdentifier(metaDocPart, "field", FieldType.STRING);
    Assert.assertEquals("field_s", identifier);
}
Also used : ImmutableMetaDocPart(com.torodb.core.transaction.metainf.ImmutableMetaDocPart) Test(org.junit.Test)

Example 5 with ImmutableMetaDocPart

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

the class IdentifierFactoryImplTest method long128FieldToIdentifierTest.

@Test
public void long128FieldToIdentifierTest() {
    ImmutableMetaDocPart metaDocPart = new ImmutableMetaDocPart.Builder(createTableRef(), "docpart").build();
    String identifier = identifierFactory.toFieldIdentifier(metaDocPart, "field__long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long", FieldType.STRING);
    Assert.assertEquals("field__long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_s", identifier);
}
Also used : ImmutableMetaDocPart(com.torodb.core.transaction.metainf.ImmutableMetaDocPart) Test(org.junit.Test)

Aggregations

ImmutableMetaDocPart (com.torodb.core.transaction.metainf.ImmutableMetaDocPart)10 Test (org.junit.Test)7 ImmutableMetaField (com.torodb.core.transaction.metainf.ImmutableMetaField)3 Before (org.junit.Before)3 ImmutableMetaCollection (com.torodb.core.transaction.metainf.ImmutableMetaCollection)2 ImmutableMetaScalar (com.torodb.core.transaction.metainf.ImmutableMetaScalar)2 WrapperMutableMetaDocPart (com.torodb.core.transaction.metainf.WrapperMutableMetaDocPart)2 Iterables (com.google.common.collect.Iterables)1 Lists (com.google.common.collect.Lists)1 TableRefFactory (com.torodb.core.TableRefFactory)1 WriteBackendTransaction (com.torodb.core.backend.WriteBackendTransaction)1 CollectionData (com.torodb.core.d2r.CollectionData)1 DocPartData (com.torodb.core.d2r.DocPartData)1 AddCollectionDdlJob (com.torodb.core.dsl.backend.AddCollectionDdlJob)1 AddDatabaseDdlJob (com.torodb.core.dsl.backend.AddDatabaseDdlJob)1 AddDocPartDdlJob (com.torodb.core.dsl.backend.AddDocPartDdlJob)1 AddFieldDdlJob (com.torodb.core.dsl.backend.AddFieldDdlJob)1 AddScalarDddlJob (com.torodb.core.dsl.backend.AddScalarDddlJob)1 BackendTransactionJob (com.torodb.core.dsl.backend.BackendTransactionJob)1 BackendTransactionJobFactory (com.torodb.core.dsl.backend.BackendTransactionJobFactory)1