use of io.crnk.meta.MetaModule in project crnk-framework by crnk-project.
the class AbstractJpaJerseyTest method setup.
@Before
public void setup() {
client = new CrnkClient(getBaseUri().toString());
client.setPushAlways(false);
JpaModule module = JpaModule.newClientModule();
setupModule(module, false);
client.addModule(module);
MetaModule clientMetaModule = MetaModule.create();
clientMetaModule.addMetaProvider(new ResourceMetaProvider());
client.addModule(clientMetaModule);
metaModule.getLookup().initialize();
setNetworkTimeout(client, 10000, TimeUnit.SECONDS);
}
use of io.crnk.meta.MetaModule in project crnk-framework by crnk-project.
the class GeneratorExecutor method run.
public void run(File outputDir) {
TSGeneratorConfig config = new TSGeneratorConfig();
config.setGenerateExpressions(true);
config.getNpm().setPackagingEnabled(false);
config.getNpm().setPackageName("@crnk/angular-ngrx");
config.getNpm().getPackageMapping().put(MetaElement.class.getPackage().getName(), "@crnk/angular-ngrx/meta");
MetaModule metaModule = MetaModule.create();
metaModule.addMetaProvider(new ResourceMetaProvider());
CrnkBoot boot = new CrnkBoot();
boot.setServiceDiscovery(new EmptyServiceDiscovery());
boot.addModule(metaModule);
boot.boot();
TSGenerator generator = new TSGenerator(outputDir, metaModule.getLookup(), config);
try {
generator.run();
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
use of io.crnk.meta.MetaModule 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();
}
use of io.crnk.meta.MetaModule 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();
}
use of io.crnk.meta.MetaModule in project crnk-framework by crnk-project.
the class AbstractOperationsTest method setup.
@Before
public void setup() {
client = new CrnkClient(getBaseUri().toString());
client.setActionStubFactory(JerseyActionStubFactory.newInstance());
client.getHttpAdapter().setReceiveTimeout(10000000, TimeUnit.MILLISECONDS);
MetaModule metaModule = MetaModule.create();
metaModule.addMetaProvider(new ResourceMetaProvider());
client.addModule(metaModule);
JpaModule module = JpaModule.newClientModule();
setupModule(module, false);
client.addModule(module);
setNetworkTimeout(client, 10000, TimeUnit.SECONDS);
}
Aggregations