use of org.eclipse.che.api.factory.server.model.impl.OnAppClosedImpl in project che by eclipse.
the class FactoryDaoTest method createFactory.
private static FactoryImpl createFactory(int index, String userId) {
final long timeMs = System.currentTimeMillis();
final ButtonImpl factoryButton = new ButtonImpl(new ButtonAttributesImpl("red", "logo", "style", true), Button.Type.LOGO);
final AuthorImpl creator = new AuthorImpl(userId, timeMs);
final PoliciesImpl policies = new PoliciesImpl("referrer", "match", "perClick", timeMs, timeMs + 1000);
final Set<FactoryImage> images = new HashSet<>();
final List<ActionImpl> a1 = new ArrayList<>(singletonList(new ActionImpl("id" + index, ImmutableMap.of("key1", "value1"))));
final OnAppLoadedImpl onAppLoaded = new OnAppLoadedImpl(a1);
final List<ActionImpl> a2 = new ArrayList<>(singletonList(new ActionImpl("id" + index, ImmutableMap.of("key2", "value2"))));
final OnProjectsLoadedImpl onProjectsLoaded = new OnProjectsLoadedImpl(a2);
final List<ActionImpl> a3 = new ArrayList<>(singletonList(new ActionImpl("id" + index, ImmutableMap.of("key3", "value3"))));
final OnAppClosedImpl onAppClosed = new OnAppClosedImpl(a3);
final IdeImpl ide = new IdeImpl(onAppLoaded, onProjectsLoaded, onAppClosed);
final FactoryImpl factory = FactoryImpl.builder().generateId().setVersion("4_0").setName("factoryName" + index).setButton(factoryButton).setCreator(creator).setPolicies(policies).setImages(images).setIde(ide).build();
factory.setWorkspace(createWorkspaceConfig(index));
return factory;
}
Aggregations