Search in sources :

Example 16 with MetaType

use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.

the class MetaLookupTest method testPrimitiveDate.

@Test
public void testPrimitiveDate() {
    MetaType meta = resourceProvider.getMeta(Date.class);
    Assert.assertEquals("base.date", meta.getId());
    Assert.assertEquals(Date.class, meta.getImplementationClass());
}
Also used : MetaType(io.crnk.meta.model.MetaType) Test(org.junit.Test)

Example 17 with MetaType

use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.

the class MetaLookupTest method testPrimitiveInteger.

@Test
public void testPrimitiveInteger() {
    MetaType meta = resourceProvider.getMeta(Integer.class);
    Assert.assertEquals("base.integer", meta.getId());
    Assert.assertEquals(Integer.class, meta.getImplementationClass());
    MetaType primitiveMeta = resourceProvider.getMeta(int.class);
    Assert.assertSame(meta, primitiveMeta);
}
Also used : MetaType(io.crnk.meta.model.MetaType) Test(org.junit.Test)

Example 18 with MetaType

use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.

the class MetaLookupTest method testPrimitiveString.

@Test
public void testPrimitiveString() {
    MetaType meta = resourceProvider.getMeta(String.class);
    Assert.assertEquals("base.string", meta.getId());
    Assert.assertEquals(String.class, meta.getImplementationClass());
}
Also used : MetaType(io.crnk.meta.model.MetaType) Test(org.junit.Test)

Example 19 with MetaType

use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.

the class MetaLookupTest method testStringArray.

@Test
public void testStringArray() {
    MetaType meta = resourceProvider.getMeta(String[].class);
    Assert.assertEquals("base.string$array", meta.getId());
    Assert.assertEquals(String[].class, meta.getImplementationClass());
}
Also used : MetaType(io.crnk.meta.model.MetaType) Test(org.junit.Test)

Example 20 with MetaType

use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.

the class MetaLookupTest method testPrimitiveUUID.

@Test
public void testPrimitiveUUID() {
    MetaType meta = resourceProvider.getMeta(UUID.class);
    Assert.assertEquals("base.uuid", meta.getId());
    Assert.assertEquals(UUID.class, meta.getImplementationClass());
}
Also used : MetaType(io.crnk.meta.model.MetaType) Test(org.junit.Test)

Aggregations

MetaType (io.crnk.meta.model.MetaType)21 Test (org.junit.Test)16 MetaAttribute (io.crnk.meta.model.MetaAttribute)5 MetaDataObject (io.crnk.meta.model.MetaDataObject)3 TSField (io.crnk.gen.typescript.model.TSField)2 MetaResource (io.crnk.meta.model.resource.MetaResource)2 Type (java.lang.reflect.Type)2 ResourceFieldType (io.crnk.core.engine.information.resource.ResourceFieldType)1 ResourceInformation (io.crnk.core.engine.information.resource.ResourceInformation)1 RegistryEntry (io.crnk.core.engine.registry.RegistryEntry)1 ResourceRegistry (io.crnk.core.engine.registry.ResourceRegistry)1 SerializeType (io.crnk.core.resource.annotations.SerializeType)1 TSParameterizedType (io.crnk.gen.typescript.model.TSParameterizedType)1 TSType (io.crnk.gen.typescript.model.TSType)1 MetaJpaDataObject (io.crnk.jpa.meta.MetaJpaDataObject)1 TestEntity (io.crnk.jpa.model.TestEntity)1 MetaArrayType (io.crnk.meta.model.MetaArrayType)1 MetaMapType (io.crnk.meta.model.MetaMapType)1 MetaResourceField (io.crnk.meta.model.resource.MetaResourceField)1 ParameterizedType (java.lang.reflect.ParameterizedType)1