Search in sources :

Example 1 with Files

use of org.testng.reporters.Files in project che-server by eclipse-che.

the class KubernetesEnvironmentProvisionerTest method setUp.

@BeforeMethod
public void setUp() {
    workspaceConfig = new WorkspaceConfigImpl();
    // "openshift" is what we use in the test devfile files and what we need to test the upgrade
    // and multiple k8s-based types
    Map<String, Set<String>> allowedUpgrades = new HashMap<>();
    allowedUpgrades.compute("openshift", (__, ___) -> new HashSet<>()).add(KubernetesEnvironment.TYPE);
    Set<String> k8sEnvTypes = new HashSet<>();
    k8sEnvTypes.add(KubernetesEnvironment.TYPE);
    k8sEnvTypes.add("openshift");
    k8sEnvProvisioner = new KubernetesEnvironmentProvisioner(k8sRecipeParser, allowedUpgrades, k8sEnvTypes);
}
Also used : MachineConfigImpl(org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl) KUBERNETES_COMPONENT_TYPE(org.eclipse.che.api.workspace.server.devfile.Constants.KUBERNETES_COMPONENT_TYPE) Arrays(java.util.Arrays) Listeners(org.testng.annotations.Listeners) EnvironmentImpl(org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl) Mock(org.mockito.Mock) DevfileException(org.eclipse.che.api.workspace.server.devfile.exception.DevfileException) Assert.assertEquals(org.testng.Assert.assertEquals) WorkspaceConfigImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl) KubernetesEnvironment(org.eclipse.che.workspace.infrastructure.kubernetes.environment.KubernetesEnvironment) HashMap(java.util.HashMap) Test(org.testng.annotations.Test) Files(org.testng.reporters.Files) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Serialization(io.fabric8.kubernetes.client.utils.Serialization) Map(java.util.Map) Service(io.fabric8.kubernetes.api.model.Service) Mockito.doReturn(org.mockito.Mockito.doReturn) Serialization.unmarshal(io.fabric8.kubernetes.client.utils.Serialization.unmarshal) ServiceBuilder(io.fabric8.kubernetes.api.model.ServiceBuilder) Collections.emptyMap(java.util.Collections.emptyMap) KubernetesObjectUtil.newPVC(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesObjectUtil.newPVC) KubernetesList(io.fabric8.kubernetes.api.model.KubernetesList) KubernetesListBuilder(io.fabric8.kubernetes.api.model.KubernetesListBuilder) MockitoTestNGListener(org.mockito.testng.MockitoTestNGListener) ImmutableMap(com.google.common.collect.ImmutableMap) Collections.emptyList(java.util.Collections.emptyList) BeforeMethod(org.testng.annotations.BeforeMethod) Set(java.util.Set) IOException(java.io.IOException) Assert.assertNotNull(org.testng.Assert.assertNotNull) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) DeploymentBuilder(io.fabric8.kubernetes.api.model.apps.DeploymentBuilder) YAML_CONTENT_TYPE(org.eclipse.che.workspace.infrastructure.kubernetes.devfile.KubernetesEnvironmentProvisioner.YAML_CONTENT_TYPE) List(java.util.List) PROJECTS_VOLUME_NAME(org.eclipse.che.api.workspace.shared.Constants.PROJECTS_VOLUME_NAME) PersistentVolumeClaim(io.fabric8.kubernetes.api.model.PersistentVolumeClaim) KubernetesRecipeParser(org.eclipse.che.workspace.infrastructure.kubernetes.environment.KubernetesRecipeParser) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) RecipeImpl(org.eclipse.che.api.workspace.server.model.impl.RecipeImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) DevfileFormatException(org.eclipse.che.api.workspace.server.devfile.exception.DevfileFormatException) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) WorkspaceConfigImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) HashSet(java.util.HashSet) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with Files

use of org.testng.reporters.Files in project devspaces-images by redhat-developer.

the class KubernetesEnvironmentProvisionerTest method setUp.

@BeforeMethod
public void setUp() {
    workspaceConfig = new WorkspaceConfigImpl();
    // "openshift" is what we use in the test devfile files and what we need to test the upgrade
    // and multiple k8s-based types
    Map<String, Set<String>> allowedUpgrades = new HashMap<>();
    allowedUpgrades.compute("openshift", (__, ___) -> new HashSet<>()).add(KubernetesEnvironment.TYPE);
    Set<String> k8sEnvTypes = new HashSet<>();
    k8sEnvTypes.add(KubernetesEnvironment.TYPE);
    k8sEnvTypes.add("openshift");
    k8sEnvProvisioner = new KubernetesEnvironmentProvisioner(k8sRecipeParser, allowedUpgrades, k8sEnvTypes);
}
Also used : MachineConfigImpl(org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl) KUBERNETES_COMPONENT_TYPE(org.eclipse.che.api.workspace.server.devfile.Constants.KUBERNETES_COMPONENT_TYPE) Arrays(java.util.Arrays) Listeners(org.testng.annotations.Listeners) EnvironmentImpl(org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl) Mock(org.mockito.Mock) DevfileException(org.eclipse.che.api.workspace.server.devfile.exception.DevfileException) Assert.assertEquals(org.testng.Assert.assertEquals) WorkspaceConfigImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl) KubernetesEnvironment(org.eclipse.che.workspace.infrastructure.kubernetes.environment.KubernetesEnvironment) HashMap(java.util.HashMap) Test(org.testng.annotations.Test) Files(org.testng.reporters.Files) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Serialization(io.fabric8.kubernetes.client.utils.Serialization) Map(java.util.Map) Service(io.fabric8.kubernetes.api.model.Service) Mockito.doReturn(org.mockito.Mockito.doReturn) Serialization.unmarshal(io.fabric8.kubernetes.client.utils.Serialization.unmarshal) ServiceBuilder(io.fabric8.kubernetes.api.model.ServiceBuilder) Collections.emptyMap(java.util.Collections.emptyMap) KubernetesObjectUtil.newPVC(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesObjectUtil.newPVC) KubernetesList(io.fabric8.kubernetes.api.model.KubernetesList) KubernetesListBuilder(io.fabric8.kubernetes.api.model.KubernetesListBuilder) MockitoTestNGListener(org.mockito.testng.MockitoTestNGListener) ImmutableMap(com.google.common.collect.ImmutableMap) Collections.emptyList(java.util.Collections.emptyList) BeforeMethod(org.testng.annotations.BeforeMethod) Set(java.util.Set) IOException(java.io.IOException) Assert.assertNotNull(org.testng.Assert.assertNotNull) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) DeploymentBuilder(io.fabric8.kubernetes.api.model.apps.DeploymentBuilder) YAML_CONTENT_TYPE(org.eclipse.che.workspace.infrastructure.kubernetes.devfile.KubernetesEnvironmentProvisioner.YAML_CONTENT_TYPE) List(java.util.List) PROJECTS_VOLUME_NAME(org.eclipse.che.api.workspace.shared.Constants.PROJECTS_VOLUME_NAME) PersistentVolumeClaim(io.fabric8.kubernetes.api.model.PersistentVolumeClaim) KubernetesRecipeParser(org.eclipse.che.workspace.infrastructure.kubernetes.environment.KubernetesRecipeParser) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) RecipeImpl(org.eclipse.che.api.workspace.server.model.impl.RecipeImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) DevfileFormatException(org.eclipse.che.api.workspace.server.devfile.exception.DevfileFormatException) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) WorkspaceConfigImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) HashSet(java.util.HashSet) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)2 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)2 KubernetesList (io.fabric8.kubernetes.api.model.KubernetesList)2 KubernetesListBuilder (io.fabric8.kubernetes.api.model.KubernetesListBuilder)2 PersistentVolumeClaim (io.fabric8.kubernetes.api.model.PersistentVolumeClaim)2 Service (io.fabric8.kubernetes.api.model.Service)2 ServiceBuilder (io.fabric8.kubernetes.api.model.ServiceBuilder)2 Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)2 DeploymentBuilder (io.fabric8.kubernetes.api.model.apps.DeploymentBuilder)2 Serialization (io.fabric8.kubernetes.client.utils.Serialization)2 Serialization.unmarshal (io.fabric8.kubernetes.client.utils.Serialization.unmarshal)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 Collections.emptyList (java.util.Collections.emptyList)2 Collections.emptyMap (java.util.Collections.emptyMap)2 Collections.singletonList (java.util.Collections.singletonList)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2