Skip to content

Commit 2245bcf

Browse files
committed
Add stub test methods for the generate domain k8s artifacts when the admin node port and t3 channel are disabled, fix underlying parsed yaml classes to match
1 parent c1bcfea commit 2245bcf

6 files changed

+89
-15
lines changed

src/test/java/oracle/kubernetes/operator/create/CreateDomainGeneratedFilesAdminNodePortDisabledT3ChannelDisabledTest.java

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,75 @@ public static void tearDown() throws Exception {
3131
}
3232
}
3333

34+
@Test
35+
public void generatesCorrect_createWeblogicDomainYaml_createWeblogicDomainJob() throws Exception {
36+
//System.out.println("MOREAUT_DEBUG create domain job =\n" + YamlUtils.newYaml().dump(generatedFiles.getCreateWeblogicDomainJobYaml().getCreateWeblogicDomainJob()));
37+
// TBD
38+
}
39+
40+
@Test
41+
public void generatesCorrect_createWeblogicDomainYaml_createWeblogicDomainConfigMap() throws Exception {
42+
//System.out.println("MOREAUT_DEBUG create domain config map =\n" + YamlUtils.newYaml().dump(generatedFiles.getCreateWeblogicDomainJobYaml().getCreateWeblogicDomainConfigMap()));
43+
// TBD
44+
}
45+
3446
@Test
3547
public void generatesCorrect_domainCustomResourceYaml_domain() throws Exception {
36-
//System.out.println("MOREAUT_DEBUG domain=\n" + YamlUtils.newYaml().dump(generatedFiles.getDomainCustomResourceYaml().getDomain()));
48+
//System.out.println("MOREAUT_DEBUG domain custom resource =\n" + YamlUtils.newYaml().dump(generatedFiles.getDomainCustomResourceYaml().getDomain()));
49+
// TBD
50+
}
51+
52+
@Test
53+
public void generatesCorrect_traefikYaml_traefikServiceAccount() throws Exception {
54+
//System.out.println("MOREAUT_DEBUG traefik service account =\n" + YamlUtils.newYaml().dump(generatedFiles.getTraefikYaml().getTraefikServiceAccount()));
55+
// TBD
56+
}
57+
58+
@Test
59+
public void generatesCorrect_traefikYaml_traefikDeployment() throws Exception {
60+
//System.out.println("MOREAUT_DEBUG traefik deployment =\n" + YamlUtils.newYaml().dump(generatedFiles.getTraefikYaml().getTraefikDeployment()));
3761
// TBD
3862
}
3963

40-
// TBD - other tests for the other generated yaml file's k8s artifacts ...
64+
@Test
65+
public void generatesCorrect_traefikYaml_traefikConfigMap() throws Exception {
66+
//System.out.println("MOREAUT_DEBUG traefik config map =\n" + YamlUtils.newYaml().dump(generatedFiles.getTraefikYaml().getTraefikConfigMap()));
67+
// TBD
68+
}
69+
70+
@Test
71+
public void generatesCorrect_traefikYaml_traefikService() throws Exception {
72+
//System.out.println("MOREAUT_DEBUG traefik service =\n" + YamlUtils.newYaml().dump(generatedFiles.getTraefikYaml().getTraefikService()));
73+
// TBD
74+
}
75+
76+
@Test
77+
public void generatesCorrect_traefikYaml_traefikDashboardService() throws Exception {
78+
//System.out.println("MOREAUT_DEBUG traefik dashboard service =\n" + YamlUtils.newYaml().dump(generatedFiles.getTraefikYaml().getTraefikDashboardService()));
79+
// TBD
80+
}
81+
82+
@Test
83+
public void generatesCorrect_traefikSecurityYaml_traefikClusterRole() throws Exception {
84+
//System.out.println("MOREAUT_DEBUG traefik cluster role =\n" + YamlUtils.newYaml().dump(generatedFiles.getTraefikSecurityYaml().getTraefikClusterRole()));
85+
// TBD
86+
}
87+
88+
@Test
89+
public void generatesCorrect_traefikSecurityYaml_traefikDashboardClusterRoleBinding() throws Exception {
90+
//System.out.println("MOREAUT_DEBUG traefik dashboard cluster role binding =\n" + YamlUtils.newYaml().dump(generatedFiles.getTraefikSecurityYaml().getTraefikDashboardClusterRoleBinding()));
91+
// TBD
92+
}
93+
94+
@Test
95+
public void generatesCorrect_weblogicDomainPersistentVolumeYaml_weblogicDomainPersistentVolume() throws Exception {
96+
//System.out.println("MOREAUT_DEBUG weblogic domain persistent volume =\n" + YamlUtils.newYaml().dump(generatedFiles.getWeblogicDomainPersistentVolumeYaml().getWeblogicDomainPersistentVolume()));
97+
// TBD
98+
}
99+
100+
@Test
101+
public void generatesCorrect_weblogicDomainPersistentVolumeClaimYaml_weblogicDomainPersistentVolumeClaim() throws Exception {
102+
//System.out.println("MOREAUT_DEBUG weblogic domain persistent volume claim =\n" + YamlUtils.newYaml().dump(generatedFiles.getWeblogicDomainPersistentVolumeClaimYaml().getWeblogicDomainPersistentVolumeClaim()));
103+
// TBD
104+
}
41105
}

src/test/java/oracle/kubernetes/operator/create/GeneratedDomainYamlFiles.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class GeneratedDomainYamlFiles {
1515

1616
private UserProjects userProjects;
1717
private DomainFiles domainFiles;
18-
private ParsedCreateWeblogicDomainJobYaml createDomainJobYaml;
18+
private ParsedCreateWeblogicDomainJobYaml createWeblogicDomainJobYaml;
1919
private ParsedDomainCustomResourceYaml domainCustomResourceYaml;
2020
private ParsedTraefikYaml traefikYaml;
2121
private ParsedTraefikSecurityYaml traefikSecurityYaml;
@@ -32,7 +32,7 @@ private GeneratedDomainYamlFiles(CreateDomainInputs inputs) throws Exception {
3232
try {
3333
domainFiles = new DomainFiles(userProjects.getPath(), inputs);
3434
assertThat(execCreateDomain(userProjects.getPath(), inputs), succeedsAndPrints("Completed"));
35-
createDomainJobYaml =
35+
createWeblogicDomainJobYaml =
3636
new ParsedCreateWeblogicDomainJobYaml(domainFiles.getCreateWeblogicDomainJobYamlPath(), inputs);
3737
domainCustomResourceYaml =
3838
new ParsedDomainCustomResourceYaml(domainFiles.getDomainCustomResourceYamlPath(), inputs);
@@ -52,8 +52,12 @@ private GeneratedDomainYamlFiles(CreateDomainInputs inputs) throws Exception {
5252
}
5353
}
5454

55+
public ParsedCreateWeblogicDomainJobYaml getCreateWeblogicDomainJobYaml() { return createWeblogicDomainJobYaml; }
5556
public ParsedDomainCustomResourceYaml getDomainCustomResourceYaml() { return domainCustomResourceYaml; }
56-
// TBD - other generated yaml files
57+
public ParsedTraefikYaml getTraefikYaml() { return traefikYaml; }
58+
public ParsedTraefikSecurityYaml getTraefikSecurityYaml() { return traefikSecurityYaml; }
59+
public ParsedWeblogicDomainPersistentVolumeYaml getWeblogicDomainPersistentVolumeYaml() { return weblogicDomainPersistentVolumeYaml; }
60+
public ParsedWeblogicDomainPersistentVolumeClaimYaml getWeblogicDomainPersistentVolumeClaimYaml() { return weblogicDomainPersistentVolumeClaimYaml; }
5761

5862
public void remove() throws Exception {
5963
userProjects.remove();

src/test/java/oracle/kubernetes/operator/create/ParsedCreateWeblogicDomainJobYaml.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
import java.nio.file.Path;
55

6+
import io.kubernetes.client.models.V1ConfigMap;
7+
import io.kubernetes.client.models.V1Job;
8+
69
import static oracle.kubernetes.operator.create.KubernetesArtifactUtils.*;
710

811
/**
@@ -17,9 +20,12 @@ public ParsedCreateWeblogicDomainJobYaml(Path yamlPath, CreateDomainInputs input
1720
this.inputs = inputs;
1821
parsedYaml = new ParsedKubernetesYaml(yamlPath);
1922
}
20-
}
2123

22-
/*
23-
ConfigMap - domain-domainuid-scripts
24-
kind: Job - domain-domainuid-job
25-
*/
24+
public V1ConfigMap getCreateWeblogicDomainConfigMap() {
25+
return parsedYaml.getConfigMaps().find("domain-" + inputs.getDomainUid() + "-scripts");
26+
}
27+
28+
public V1Job getCreateWeblogicDomainJob() {
29+
return parsedYaml.getJobs().find("domain-" + inputs.getDomainUid() + "-job");
30+
}
31+
}

src/test/java/oracle/kubernetes/operator/create/ParsedTraefikYaml.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ExtensionsV1beta1Deployment getTraefikDeployment() {
3131
return parsedYaml.getDeployments().find(getTraefikScope());
3232
}
3333

34-
public V1ConfigMap getTraefikConfig() {
34+
public V1ConfigMap getTraefikConfigMap() {
3535
return parsedYaml.getConfigMaps().find(getTraefikScope());
3636
}
3737

src/test/java/oracle/kubernetes/operator/create/ParsedWeblogicDomainPersistentVolumeClaimYaml.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public ParsedWeblogicDomainPersistentVolumeClaimYaml(Path yamlPath, CreateDomain
2121
parsedYaml = new ParsedKubernetesYaml(yamlPath);
2222
}
2323

24-
public V1PersistentVolumeClaim getPersistentVolumeClaim() {
25-
return parsedYaml.getPersistentVolumeClaims().find(inputs.getPersistenceVolumeClaimName());
24+
public V1PersistentVolumeClaim getWeblogicDomainPersistentVolumeClaim() {
25+
return parsedYaml.getPersistentVolumeClaims().find(inputs.getDomainUid() + "-" + inputs.getPersistenceVolumeClaimName());
2626
}
2727
}

src/test/java/oracle/kubernetes/operator/create/ParsedWeblogicDomainPersistentVolumeYaml.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public ParsedWeblogicDomainPersistentVolumeYaml(Path yamlPath, CreateDomainInput
2121
parsedYaml = new ParsedKubernetesYaml(yamlPath);
2222
}
2323

24-
public V1PersistentVolume getPersistentVolume() {
25-
return parsedYaml.getPersistentVolumes().find(inputs.getPersistenceVolumeName());
24+
public V1PersistentVolume getWeblogicDomainPersistentVolume() {
25+
return parsedYaml.getPersistentVolumes().find(inputs.getDomainUid() + "-" + inputs.getPersistenceVolumeName());
2626
}
2727
}

0 commit comments

Comments
 (0)