@@ -521,7 +521,6 @@ private void verifyFDiscoverDomainWithRequiredArgument(String expectedModelFile)
521
521
checkContents .add ("SourcePath: wlsdeploy/applications/simple-app.war" );
522
522
verifyModelFileContents (expectedModelFile , checkContents );
523
523
}
524
-
525
524
/**
526
525
* test discoverDomain.sh with -model_file argument
527
526
* @throws Exception - if any error occurs
@@ -534,7 +533,7 @@ void test18DiscoverDomainWithModelFile(TestInfo testInfo) throws Exception {
534
533
Path discoveredArchive = getTestOutputPath (testInfo ).resolve ("discoveredArchive.zip" );
535
534
Path discoveredModelFile = getTestOutputPath (testInfo ).resolve ("discoveredRestrictedJRFD1.yaml" );
536
535
String cmd = discoverDomainScript + " -oracle_home " + mwhome_12213 + " -domain_home " +
537
- domainParentDir + FS + "restrictedJRFD1 -archive_file " + discoveredArchive +
536
+ domainParentDir + FS + "restrictedJRFD1 -archive_file " + discoveredArchive +
538
537
" -model_file " + discoveredModelFile ;
539
538
try (PrintWriter out = getTestMethodWriter (testInfo )) {
540
539
CommandResult result = Runner .run (cmd , getTestMethodEnvironment (testInfo ), out );
@@ -925,7 +924,46 @@ void test30OnlineUpdateApp(TestInfo testInfo) throws Exception {
925
924
926
925
927
926
}
927
+ /**
928
+ * test discoverDomain.sh that model can create a working domain
929
+ * @throws Exception - if any error occurs
930
+ */
931
+ @ DisplayName ("Test 31: Discover domain and then create a new domain from the model" )
932
+ @ Order (31 )
933
+ @ Tag ("gate" )
934
+ @ Test
935
+ void test31DiscoverDomainWithModelFile (TestInfo testInfo ) throws Exception {
936
+ Path discoveredArchive = getTestOutputPath (testInfo ).resolve ("discoveredArchive.zip" );
937
+ Path discoveredModelFile = getTestOutputPath (testInfo ).resolve ("discoveredModel.yaml" );
938
+ Path discoveredVariableFile = getTestOutputPath (testInfo ).resolve ("discoveredVariable.properties" );
939
+ String cmd = discoverDomainScript + " -oracle_home " + mwhome_12213 + " -domain_home " +
940
+ domainParentDir + FS + "domain2 -archive_file " + discoveredArchive +
941
+ " -model_file " + discoveredModelFile + " -variable_file " + discoveredVariableFile ;
942
+ try (PrintWriter out = getTestMethodWriter (testInfo )) {
943
+ CommandResult result = Runner .run (cmd , getTestMethodEnvironment (testInfo ), out );
928
944
945
+ verifyResult (result , "discoverDomain.sh completed successfully" );
946
+
947
+ // verify model file
948
+ verifyModelFile (discoveredModelFile .toString ());
949
+
950
+ String domainHome = domainParentDir + FS + "createDomainFromDiscover" ;
951
+ cmd = createDomainScript + " -oracle_home " + mwhome_12213 + " -domain_home " +
952
+ domainHome + " -archive_file " + discoveredArchive +
953
+ " -model_file " + discoveredModelFile + " -variable_file " + getSampleVariableFile ();
954
+ result = Runner .run (cmd , getTestMethodEnvironment (testInfo ), out );
955
+
956
+ verifyResult (result , "createDomain.sh completed successfully" );
957
+
958
+ setUpBootProperties (domainHome , "AdminServer" , "weblogic" , "welcome1" );
959
+ Path adminServerOut = getTestOutputPath (testInfo ).resolve ("AdminServer.out" );
960
+ boolean isServerUp = startAdminServer (domainHome , adminServerOut );
961
+ if (!isServerUp ) {
962
+ throw new Exception ("Admin server did not come up after createDomain from discoverDomain" );
963
+ }
964
+ stopAdminServer (domainHome );
965
+ }
966
+ }
929
967
930
968
private boolean startAdminServer (String domainHome , Path outputFile ) throws Exception {
931
969
boolean isServerUp = false ;
0 commit comments