Skip to content

Commit 2d7410a

Browse files
committed
Start filling out the support needed to test create-weblogic-operator.sh, including splitting apart create-weblogic-domain.sh so that it can be unit tested
1 parent 9d1efd6 commit 2d7410a

27 files changed

+1578
-1073
lines changed

kubernetes/create-weblogic-domain.sh

Lines changed: 18 additions & 652 deletions
Large diffs are not rendered by default.

kubernetes/internal/create-weblogic-domain.sh

Lines changed: 719 additions & 0 deletions
Large diffs are not rendered by default.

kubernetes/internal/create-weblogic-operator.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ function initialize {
7979
# Validate the required files exist
8080
validateErrors=false
8181

82-
# we don't use kubectl if we're only generating the yaml files
83-
# (e.g. so that we can unit test without installing kubectl)
8482
validateKubectlAvailable
8583

8684
if ! [ -d ${outputDir} ]; then

kubernetes/internal/domain-custom-resource-template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ spec:
7373
# replicas: 1
7474

7575
# Uncomment to export the T3Channel as a service
76-
%EXPORT_T3_CHANNEL_PREFIX%exportT3Channels:
77-
%EXPORT_T3_CHANNEL_PREFIX%- T3Channel
76+
%EXPOSE_T3_CHANNEL_PREFIX%exportT3Channels:
77+
%EXPOSE_T3_CHANNEL_PREFIX%- T3Channel
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
2+
package oracle.kubernetes.operator.create;
3+
4+
import static oracle.kubernetes.operator.create.KubernetesArtifactUtils.*;
5+
import static org.hamcrest.MatcherAssert.assertThat;
6+
import static org.hamcrest.Matchers.*;
7+
import org.junit.AfterClass;
8+
import org.junit.BeforeClass;
9+
import org.junit.Test;
10+
11+
/**
12+
* Tests that the all artifacts in the yaml files that create-domain-operator.sh
13+
* creates are correct when the admin node port is disabled and t3 channel is disable,
14+
* and there is no image pull secret.
15+
*/
16+
public class CreateDomainGeneratedFilesAdminNodePortDisabledT3ChannelDisabledTest {
17+
18+
private static CreateDomainInputs inputs;
19+
private static GeneratedDomainYamlFiles generatedFiles;
20+
21+
@BeforeClass
22+
public static void setup() throws Exception {
23+
inputs = CreateDomainInputs.newInputs(); // defaults to admin node port off, t3 channel off
24+
generatedFiles = GeneratedDomainYamlFiles.generateDomainYamlFiles(inputs);
25+
}
26+
27+
@AfterClass
28+
public static void tearDown() throws Exception {
29+
if (generatedFiles != null) {
30+
generatedFiles.remove();
31+
}
32+
}
33+
34+
@Test
35+
public void generatesCorrect_domainCustomResourceYaml_domain() throws Exception {
36+
//System.out.println("MOREAUT_DEBUG domain=\n" + YamlUtils.newYaml().dump(generatedFiles.getDomainCustomResourceYaml().getDomain()));
37+
// TBD
38+
}
39+
40+
// TBD - other tests for the other generated yaml file's k8s artifacts ...
41+
}

0 commit comments

Comments
 (0)