Search in sources :

Example 1 with MetaModuleConfig

use of io.crnk.meta.MetaModuleConfig in project crnk-framework by crnk-project.

the class TSGeneratorTest method setup.

@Before
public void setup() {
    Project project = Mockito.mock(Project.class);
    TSGeneratorExtension config = new TSGeneratorExtension(project, null);
    File outputDir = testProjectDir.getRoot();
    MetaModuleConfig metaConfig = new MetaModuleConfig();
    metaConfig.addMetaProvider(new ResourceMetaProvider());
    MetaModule metaModule = MetaModule.createServerModule(metaConfig);
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceDiscovery(new EmptyServiceDiscovery());
    boot.addModule(metaModule);
    boot.boot();
    generator = new TSGenerator(outputDir, metaModule.getLookup(), config);
}
Also used : Project(org.gradle.api.Project) CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) File(java.io.File) MetaModule(io.crnk.meta.MetaModule) TSGeneratorExtension(io.crnk.gen.typescript.TSGeneratorExtension) MetaModuleConfig(io.crnk.meta.MetaModuleConfig) EmptyServiceDiscovery(io.crnk.core.module.discovery.EmptyServiceDiscovery) Before(org.junit.Before)

Example 2 with MetaModuleConfig

use of io.crnk.meta.MetaModuleConfig in project crnk-framework by crnk-project.

the class MetaModuleProducer method createMetaModule.

@Produces
@ApplicationScoped
public MetaModule createMetaModule() {
    MetaModuleConfig metaConfig = new MetaModuleConfig();
    metaConfig.addMetaProvider(new ResourceMetaProvider());
    MetaModule metaModule = MetaModule.createServerModule(metaConfig);
    return metaModule;
}
Also used : ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) MetaModule(io.crnk.meta.MetaModule) MetaModuleConfig(io.crnk.meta.MetaModuleConfig) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 3 with MetaModuleConfig

use of io.crnk.meta.MetaModuleConfig 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 4 with MetaModuleConfig

use of io.crnk.meta.MetaModuleConfig 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)

Aggregations

MetaModule (io.crnk.meta.MetaModule)4 MetaModuleConfig (io.crnk.meta.MetaModuleConfig)4 ResourceMetaProvider (io.crnk.meta.provider.resource.ResourceMetaProvider)4 CrnkBoot (io.crnk.core.boot.CrnkBoot)3 Before (org.junit.Before)3 ConstantServiceUrlProvider (io.crnk.core.engine.url.ConstantServiceUrlProvider)2 TestModule (io.crnk.test.mock.TestModule)2 EmptyServiceDiscovery (io.crnk.core.module.discovery.EmptyServiceDiscovery)1 TSGeneratorExtension (io.crnk.gen.typescript.TSGeneratorExtension)1 File (java.io.File)1 ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Produces (javax.enterprise.inject.Produces)1 Project (org.gradle.api.Project)1