Search in sources :

Example 26 with WorkerImpl

use of org.eclipse.che.multiuser.permission.workspace.server.model.impl.WorkerImpl in project devspaces-images by redhat-developer.

the class WorkerDaoTest method setUp.

@BeforeMethod
public void setUp() throws TckRepositoryException {
    workers = new WorkerImpl[] { new WorkerImpl("ws1", "user1", Arrays.asList("read", "use", "run")), new WorkerImpl("ws1", "user2", Arrays.asList("read", "use")), new WorkerImpl("ws2", "user1", Arrays.asList("read", "run")), new WorkerImpl("ws2", "user2", Arrays.asList("read", "use", "run", "configure")), new WorkerImpl("ws2", "user0", Arrays.asList("read", "use", "run", "configure")) };
    final UserImpl[] users = new UserImpl[] { new UserImpl("user0", "user0@com.com", "usr0"), new UserImpl("user1", "user1@com.com", "usr1"), new UserImpl("user2", "user2@com.com", "usr2") };
    userRepository.createAll(Arrays.asList(users));
    AccountImpl account = new AccountImpl("account1", "accountName", "test");
    accountRepository.createAll(Collections.singletonList(account));
    workspaceRepository.createAll(Arrays.asList(new WorkspaceImpl("ws0", account, new WorkspaceConfigImpl("ws-name0", "", "cfg0", null, null, null, null)), new WorkspaceImpl("ws1", account, new WorkspaceConfigImpl("ws-name1", "", "cfg1", null, null, null, null)), new WorkspaceImpl("ws2", account, new WorkspaceConfigImpl("ws-name2", "", "cfg2", null, null, null, null))));
    workerRepository.createAll(Stream.of(workers).map(WorkerImpl::new).collect(Collectors.toList()));
}
Also used : WorkspaceImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl) UserImpl(org.eclipse.che.api.user.server.model.impl.UserImpl) AccountImpl(org.eclipse.che.account.spi.AccountImpl) WorkspaceConfigImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl) WorkerImpl(org.eclipse.che.multiuser.permission.workspace.server.model.impl.WorkerImpl) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

WorkerImpl (org.eclipse.che.multiuser.permission.workspace.server.model.impl.WorkerImpl)26 UserImpl (org.eclipse.che.api.user.server.model.impl.UserImpl)18 WorkspaceImpl (org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl)18 AccountImpl (org.eclipse.che.account.spi.AccountImpl)16 TckResourcesCleaner (org.eclipse.che.commons.test.tck.TckResourcesCleaner)12 WorkspaceConfigImpl (org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl)10 TypeLiteral (com.google.inject.TypeLiteral)8 DBInitializer (org.eclipse.che.core.db.DBInitializer)8 SchemaInitializer (org.eclipse.che.core.db.schema.SchemaInitializer)8 FlywaySchemaInitializer (org.eclipse.che.core.db.schema.impl.flyway.FlywaySchemaInitializer)8 WorkerDao (org.eclipse.che.multiuser.permission.workspace.server.spi.WorkerDao)8 WorkerDaoTest (org.eclipse.che.multiuser.permission.workspace.server.spi.tck.WorkerDaoTest)8 JpaWorkerDao (org.eclipse.che.multiuser.permission.workspace.server.spi.jpa.JpaWorkerDao)6 JpaPersistModule (com.google.inject.persist.jpa.JpaPersistModule)4 HashMap (java.util.HashMap)4 UserDevfileImpl (org.eclipse.che.api.devfile.server.model.impl.UserDevfileImpl)4 SerializableConverter (org.eclipse.che.api.workspace.server.devfile.SerializableConverter)4 CommandImpl (org.eclipse.che.api.workspace.server.model.impl.CommandImpl)4 EnvironmentImpl (org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl)4 MachineConfigImpl (org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl)4