Search in sources :

Example 1 with OnProjectsLoadedImpl

use of org.eclipse.che.api.factory.server.model.impl.OnProjectsLoadedImpl 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;
}
Also used : OnAppLoadedImpl(org.eclipse.che.api.factory.server.model.impl.OnAppLoadedImpl) OnProjectsLoadedImpl(org.eclipse.che.api.factory.server.model.impl.OnProjectsLoadedImpl) ArrayList(java.util.ArrayList) FactoryImpl(org.eclipse.che.api.factory.server.model.impl.FactoryImpl) FactoryImage(org.eclipse.che.api.factory.server.FactoryImage) IdeImpl(org.eclipse.che.api.factory.server.model.impl.IdeImpl) ActionImpl(org.eclipse.che.api.factory.server.model.impl.ActionImpl) ButtonImpl(org.eclipse.che.api.factory.server.model.impl.ButtonImpl) AuthorImpl(org.eclipse.che.api.factory.server.model.impl.AuthorImpl) PoliciesImpl(org.eclipse.che.api.factory.server.model.impl.PoliciesImpl) ButtonAttributesImpl(org.eclipse.che.api.factory.server.model.impl.ButtonAttributesImpl) HashSet(java.util.HashSet) OnAppClosedImpl(org.eclipse.che.api.factory.server.model.impl.OnAppClosedImpl)

Aggregations

ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 FactoryImage (org.eclipse.che.api.factory.server.FactoryImage)1 ActionImpl (org.eclipse.che.api.factory.server.model.impl.ActionImpl)1 AuthorImpl (org.eclipse.che.api.factory.server.model.impl.AuthorImpl)1 ButtonAttributesImpl (org.eclipse.che.api.factory.server.model.impl.ButtonAttributesImpl)1 ButtonImpl (org.eclipse.che.api.factory.server.model.impl.ButtonImpl)1 FactoryImpl (org.eclipse.che.api.factory.server.model.impl.FactoryImpl)1 IdeImpl (org.eclipse.che.api.factory.server.model.impl.IdeImpl)1 OnAppClosedImpl (org.eclipse.che.api.factory.server.model.impl.OnAppClosedImpl)1 OnAppLoadedImpl (org.eclipse.che.api.factory.server.model.impl.OnAppLoadedImpl)1 OnProjectsLoadedImpl (org.eclipse.che.api.factory.server.model.impl.OnProjectsLoadedImpl)1 PoliciesImpl (org.eclipse.che.api.factory.server.model.impl.PoliciesImpl)1