Search in sources :

Example 1 with ResourceMetaProvider

use of io.crnk.meta.provider.resource.ResourceMetaProvider 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 ResourceMetaProvider

use of io.crnk.meta.provider.resource.ResourceMetaProvider 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 ResourceMetaProvider

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

the class MetaResourceRepositoryTest method setup.

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

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

Example 4 with ResourceMetaProvider

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

the class ResourceMetaProviderTest method setup.

@Before
public void setup() {
    super.setup();
    resourceProvider = new ResourceMetaProvider();
    lookup = new MetaLookup();
    lookup.setModuleContext(boot.getModuleRegistry().getContext());
    lookup.addProvider(resourceProvider);
    lookup.initialize();
}
Also used : ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) Before(org.junit.Before)

Example 5 with ResourceMetaProvider

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

the class AbstractMetaJerseyTest method createModule.

public MetaModule createModule() {
    MetaModule module = MetaModule.create();
    module.addMetaProvider(new ResourceMetaProvider());
    return module;
}
Also used : ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) MetaModule(io.crnk.meta.MetaModule)

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