Search in sources :

Example 11 with ResourceMetaProvider

use of io.crnk.meta.provider.resource.ResourceMetaProvider in project crnk-framework by crnk-project.

the class JsonApiFormatTest method setup.

@Before
public void setup() {
    MetaModuleConfig config = new MetaModuleConfig();
    config.addMetaProvider(new ResourceMetaProvider());
    MetaModule metaModule = MetaModule.createServerModule(config);
    this.module = Mockito.spy(HomeModule.create(HomeFormat.JSON_API));
    boot = new CrnkBoot();
    boot.addModule(module);
    boot.addModule(metaModule);
    boot.addModule(new TestModule());
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.boot();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) MetaModule(io.crnk.meta.MetaModule) TestModule(io.crnk.test.mock.TestModule) MetaModuleConfig(io.crnk.meta.MetaModuleConfig) Before(org.junit.Before)

Example 12 with ResourceMetaProvider

use of io.crnk.meta.provider.resource.ResourceMetaProvider in project crnk-framework by crnk-project.

the class JsonHomeFormatTest method setup.

@Before
public void setup() {
    MetaModuleConfig config = new MetaModuleConfig();
    config.addMetaProvider(new ResourceMetaProvider());
    MetaModule metaModule = MetaModule.createServerModule(config);
    this.module = Mockito.spy(HomeModule.create(HomeFormat.JSON_HOME));
    boot = new CrnkBoot();
    boot.addModule(module);
    boot.addModule(metaModule);
    boot.addModule(new TestModule());
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.boot();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) MetaModule(io.crnk.meta.MetaModule) TestModule(io.crnk.test.mock.TestModule) MetaModuleConfig(io.crnk.meta.MetaModuleConfig) Before(org.junit.Before)

Example 13 with ResourceMetaProvider

use of io.crnk.meta.provider.resource.ResourceMetaProvider in project crnk-framework by crnk-project.

the class MetaRelationshipRepositoryImplTest method setup.

@Before
public void setup() {
    super.setup();
    resourceProvider = new ResourceMetaProvider();
    lookup = new MetaLookup();
    lookup.setModuleContext(boot.getModuleRegistry().getContext());
    lookup.addProvider(resourceProvider);
    lookup.initialize();
    repo = new MetaRelationshipRepositoryImpl(new Supplier<MetaLookup>() {

        @Override
        public MetaLookup get() {
            return lookup;
        }
    }, MetaElement.class, MetaElement.class);
}
Also used : MetaRelationshipRepositoryImpl(io.crnk.meta.internal.MetaRelationshipRepositoryImpl) MetaElement(io.crnk.meta.model.MetaElement) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) Supplier(io.crnk.core.utils.Supplier) Before(org.junit.Before)

Example 14 with ResourceMetaProvider

use of io.crnk.meta.provider.resource.ResourceMetaProvider in project crnk-framework by crnk-project.

the class AbstractMetaTest method setup.

@Before
public void setup() {
    boot = new CrnkBoot();
    boot.addModule(new JaxrsModule(null));
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.addModule(new TestModule());
    boot.addModule(new io.crnk.test.mock.dynamic.DynamicModule());
    configure();
    boot.boot();
    resourceProvider = new ResourceMetaProvider();
    lookup = new MetaLookup();
    lookup.addProvider(resourceProvider);
    lookup.setModuleContext(boot.getModuleRegistry().getContext());
    lookup.initialize();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) JaxrsModule(io.crnk.rs.internal.JaxrsModule) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) TestModule(io.crnk.test.mock.TestModule) Before(org.junit.Before)

Example 15 with ResourceMetaProvider

use of io.crnk.meta.provider.resource.ResourceMetaProvider in project crnk-framework by crnk-project.

the class MetaMetaTest method setup.

@Before
public void setup() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.addModule(new TestModule());
    resourceProvider = new ResourceMetaProvider();
    MetaModuleConfig moduleConfig = new MetaModuleConfig();
    moduleConfig.addMetaProvider(resourceProvider);
    MetaModule module = MetaModule.createServerModule(moduleConfig);
    boot.addModule(module);
    boot.boot();
    lookup = module.getLookup();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) TestModule(io.crnk.test.mock.TestModule) Before(org.junit.Before)

Aggregations

ResourceMetaProvider (io.crnk.meta.provider.resource.ResourceMetaProvider)16 Before (org.junit.Before)11 MetaModule (io.crnk.meta.MetaModule)8 CrnkBoot (io.crnk.core.boot.CrnkBoot)7 ConstantServiceUrlProvider (io.crnk.core.engine.url.ConstantServiceUrlProvider)5 MetaModuleConfig (io.crnk.meta.MetaModuleConfig)4 TestModule (io.crnk.test.mock.TestModule)4 MetaElement (io.crnk.meta.model.MetaElement)3 CrnkClient (io.crnk.client.CrnkClient)2 EmptyServiceDiscovery (io.crnk.core.module.discovery.EmptyServiceDiscovery)2 Supplier (io.crnk.core.utils.Supplier)2 JaxrsModule (io.crnk.rs.internal.JaxrsModule)2 ReflectionsServiceDiscovery (io.crnk.core.module.discovery.ReflectionsServiceDiscovery)1 TSGeneratorConfig (io.crnk.gen.typescript.TSGeneratorConfig)1 TSGeneratorExtension (io.crnk.gen.typescript.TSGeneratorExtension)1 TSGenerator (io.crnk.gen.typescript.internal.TSGenerator)1 JpaModule (io.crnk.jpa.JpaModule)1 SampleJsonServiceLocator (io.crnk.legacy.locator.SampleJsonServiceLocator)1 MetaLookup (io.crnk.meta.MetaLookup)1 MetaRelationshipRepositoryImpl (io.crnk.meta.internal.MetaRelationshipRepositoryImpl)1