Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import ua.com.fielden.platform.ioc.ApplicationInjectorFactory;
import ua.com.fielden.platform.ioc.NewUserEmailNotifierTestIocModule;
import ua.com.fielden.platform.sample.domain.*;
import ua.com.fielden.platform.web.test.config.ApplicationDomain;

import java.io.FileInputStream;
import java.io.IOException;
Expand All @@ -16,7 +17,8 @@
import java.util.Properties;
import java.util.Random;

import static ua.com.fielden.eql.BenchmarkIocModule.newBenchmarkModule;
import static ua.com.fielden.eql.AbstractEqlBenchmark.IocModule.iocModule;
import static ua.com.fielden.eql.BenchmarkIocModule.benchmarkModule;
import static ua.com.fielden.platform.entity.query.fluent.EntityQueryUtils.expr;
import static ua.com.fielden.platform.entity.query.fluent.EntityQueryUtils.select;

Expand Down Expand Up @@ -326,8 +328,7 @@ public void setup() throws IOException {
}

injector = new ApplicationInjectorFactory(Workflows.development)
.add(newBenchmarkModule(properties))
.add(new NewUserEmailNotifierTestIocModule())
.add(benchmarkModule(iocModule(properties)))
.getInjector();

afterSetup(injector);
Expand All @@ -344,4 +345,25 @@ private <T> T getInstance(final Class<T> type) {
*/
protected abstract Object finish(final QueryModel<?> queryModel);

static class IocModule extends BenchmarkIocModule {

public static IocModule iocModule(final Properties inProps) {
// final var props = propertiesUnionLeft(
// mkProperties(Map.of(AuditingIocModule.AUDIT_MODE, AuditingMode.DISABLED.name())),
// inProps);
return new IocModule(inProps);
}

private IocModule(final Properties props) {
super(props, new ApplicationDomain(), ApplicationDomain.domainTypes());
}

@Override
protected void configure() {
super.configure();
install(new NewUserEmailNotifierTestIocModule());
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.google.inject.util.Modules;
import ua.com.fielden.platform.basic.config.IApplicationDomainProvider;
import ua.com.fielden.platform.entity.AbstractEntity;
import ua.com.fielden.platform.entity.proxy.IIdOnlyProxiedEntityTypeCache;
import ua.com.fielden.platform.ioc.BasicWebServerIocModule;
import ua.com.fielden.platform.security.annotations.SessionCache;
Expand All @@ -25,10 +27,16 @@

import static java.lang.String.format;

/// Standard IoC module for EQL benchmarks.
///
/// To use this module or a module that extends this one, it is necessary to pass it to [#benchmarkModule] first.
///
class BenchmarkIocModule extends BasicWebServerIocModule {

public static Module newBenchmarkModule(final Properties props) {
return Modules.override(new BenchmarkIocModule(props))
/// Completes the configuration in `module`.
///
public static Module benchmarkModule(final BenchmarkIocModule module) {
return Modules.override(module)
.with(new AbstractModule() {
@Override
protected void configure() {
Expand All @@ -38,10 +46,12 @@ protected void configure() {
});
}

private BenchmarkIocModule(final Properties props) {
super(List::of,
List.of(),
props);
public BenchmarkIocModule(
final Properties props,
final IApplicationDomainProvider appDomain,
final List<Class<? extends AbstractEntity<?>>> domainTypes)
{
super(appDomain, domainTypes, props);
}

@Override
Expand Down
Loading
Loading