use of org.eclipse.emfcloud.modelserver.emf.util.JsonPatchHelper in project emfcloud-modelserver by eclipse-emfcloud.
the class DefaultModelResourceManagerTest method beforeTests.
@Before
public void beforeTests() throws DecodingException {
when(serverConfig.getWorkspaceRootURI()).thenReturn(URI.createFileURI(getCWD().getAbsolutePath() + "/" + RESOURCE_PATH));
modelResourceManager = Guice.createInjector(new AbstractModule() {
private Multibinder<EPackageConfiguration> ePackageConfigurationBinder;
private ArrayList<Class<? extends EPackageConfiguration>> ePackageConfigurations;
@Override
protected void configure() {
ePackageConfigurations = Lists.newArrayList(EcorePackageConfiguration.class, CommandPackageConfiguration.class);
ePackageConfigurationBinder = Multibinder.newSetBinder(binder(), EPackageConfiguration.class);
ePackageConfigurations.forEach(c -> ePackageConfigurationBinder.addBinding().to(c));
bind(ServerConfiguration.class).toInstance(serverConfig);
bind(CommandCodec.class).toInstance(commandCodec);
bind(ModelWatchersManager.class).toInstance(watchersManager);
bind(AdapterFactory.class).toInstance(new EcoreAdapterFactory());
bind(ModelRepository.class).to(DefaultModelRepository.class).in(Scopes.SINGLETON);
bind(ModelResourceManager.class).to(DefaultModelResourceManager.class).in(Scopes.SINGLETON);
bind(JsonPatchHelper.class).toInstance(jsonPatchHelper);
}
}).getInstance(DefaultModelResourceManager.class);
}
Aggregations