integration-tests/src/test/java/oracle/kubernetes/operator/ItMiiConfigUpdateImage.java
@Test
  public void testMiiConfigUpdateNonJdbcImage() {
    Assumptions.assumeTrue(QUICKTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    boolean testCompletedSuccessfully = false;
    Domain domain = null;

    try {
      logTestBegin(testMethodName);
      LoggerHelper.getLocal().log(Level.INFO,
          "Creating Domain & waiting for the script to complete execution");

      // create domain w/o JDBC DS using the image created by MII
      boolean createDS = false;
      domain = createDomainUsingMii(createDS, domainNS, testClassName);
      assertNotNull(domain, "Failed to create a domain");

      // create image with a new tag to update config and verify image created successfully
      // patch domain to change image tag and verify domain restarted successfully
      Map<String, Object> domainMap = domain.getDomainMap();
      final String imageName = (String) domainMap.get("image") + "_nonjdbc";
      final String wdtModelFile = "model.jdbc.yaml";
      final String wdtModelPropFile = "model.jdbc.properties";
      createImageAndPatchDomain(domain, imageName, wdtModelFile, wdtModelPropFile);

      // get JDBC DS prop values via WLST on server pod
      final String destDir = getResultDir() + "/samples/model-in-image-update";
      String jdbcResourceData = getJdbcResources(destDir, domain);

      // verify that JDBC DS is created by checking DS name, JNDI name and read timeout
      LoggerHelper.getLocal().log(Level.INFO, "Verify that JDBC DS is created");
      final String[] jdbcResourcesToVerify =
          {"datasource.name.1=" + dsName,
              "datasource.jndiname.1=array(java.lang.String,['" + jndiName + "'])",
              "datasource.readTimeout.1=" + readTimeout_2};
      for (String prop : jdbcResourcesToVerify) {
        assertTrue(jdbcResourceData.contains(prop), prop + " is not found");
        LoggerHelper.getLocal().log(Level.INFO, prop + " exists");
      }

      testCompletedSuccessfully = true;
    } catch (Exception ex) {
      fail("FAILED - " + testMethodName);
    } finally {
      if (domain != null && (JENKINS || testCompletedSuccessfully)) {
        try {
          TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
        } catch (Exception ex) {
          LoggerHelper.getLocal().log(Level.INFO, "Failed to delete domain\n " + ex.getMessage());
        }
      }
    }

    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
/**
   * Create a domain without a JDBC DS using model in image and having config map
   * in the domain.yaml before deploying the domain. After the domain resources
   * is created, create a new image with diff tag name and model files that
   * define a JDBC DataSource and patch the domain to change image tag to reload
   * the model file, generate new config and initiate a rolling restart.
   */
Create a domain without a JDBC DS using model in image and having config map
in the domain.yaml before deploying the domain. After the domain resources
is created, create a new image with diff tag name and model files that
define a JDBC DataSource and patch the domain to change image tag to reload
the model file, generate new config and initiate a rolling restart.
Create a domain without a JDBC DS using model in image and having config map in the domain . yaml before deploying the domain . After the domain resources is created create a new image with diff tag name and model files that define a JDBC DataSource and patch the domain to change image tag to reload the model file generate new config and initiate a rolling restart .
@Test
  public void testMiiConfigUpdateNonJdbcImage() {
    Assumptions.assumeTrue(QUICKTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    boolean testCompletedSuccessfully = false;
    Domain domain = null;
    try {
      logTestBegin(testMethodName);
      LoggerHelper.getLocal().log(Level.INFO,
          "Creating Domain & waiting for the script to complete execution");
      boolean createDS = false;
      domain = createDomainUsingMii(createDS, domainNS, testClassName);
      assertNotNull(domain, "Failed to create a domain");
      Map<String, Object> domainMap = domain.getDomainMap();
      final String imageName = (String) domainMap.get("image") + "_nonjdbc";
      final String wdtModelFile = "model.jdbc.yaml";
      final String wdtModelPropFile = "model.jdbc.properties";
      createImageAndPatchDomain(domain, imageName, wdtModelFile, wdtModelPropFile);
      final String destDir = getResultDir() + "/samples/model-in-image-update";
      String jdbcResourceData = getJdbcResources(destDir, domain);
      LoggerHelper.getLocal().log(Level.INFO, "Verify that JDBC DS is created");
      final String[] jdbcResourcesToVerify =
          {"datasource.name.1=" + dsName,
              "datasource.jndiname.1=array(java.lang.String,['" + jndiName + "'])",
              "datasource.readTimeout.1=" + readTimeout_2};
      for (String prop : jdbcResourcesToVerify) {
        assertTrue(jdbcResourceData.contains(prop), prop + " is not found");
        LoggerHelper.getLocal().log(Level.INFO, prop + " exists");
      }
      testCompletedSuccessfully = true;
    } catch (Exception ex) {
      fail("FAILED - " + testMethodName);
    } finally {
      if (domain != null && (JENKINS || testCompletedSuccessfully)) {
        try {
          TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
        } catch (Exception ex) {
          LoggerHelper.getLocal().log(Level.INFO, "Failed to delete domain\n " + ex.getMessage());
        }
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
@ Test public void testMiiConfigUpdateNonJdbcImage ( ) { Assumptions . assumeTrue ( QUICKTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; boolean testCompletedSuccessfully = false ; Domain domain = null ; try { logTestBegin ( testMethodName ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Creating Domain & waiting for the script to complete execution" ) ; boolean createDS = false ; domain = createDomainUsingMii ( createDS , domainNS , testClassName ) ; assertNotNull ( domain , "Failed to create a domain" ) ; Map < String , Object > domainMap = domain . getDomainMap ( ) ; final String imageName = ( String ) domainMap . get ( "image" ) + "_nonjdbc" ; final String wdtModelFile = "model.jdbc.yaml" ; final String wdtModelPropFile = "model.jdbc.properties" ; createImageAndPatchDomain ( domain , imageName , wdtModelFile , wdtModelPropFile ) ; final String destDir = getResultDir ( ) + "/samples/model-in-image-update" ; String jdbcResourceData = getJdbcResources ( destDir , domain ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Verify that JDBC DS is created" ) ; final String [ ] jdbcResourcesToVerify = { "datasource.name.1=" + dsName , "datasource.jndiname.1=array(java.lang.String,['" + jndiName + "'])" , "datasource.readTimeout.1=" + readTimeout_2 } ; for ( String prop : jdbcResourcesToVerify ) { assertTrue ( jdbcResourceData . contains ( prop ) , prop + " is not found" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , prop + " exists" ) ; } testCompletedSuccessfully = true ; } catch ( Exception ex ) { fail ( "FAILED - " + testMethodName ) ; } finally { if ( domain != null && ( JENKINS || testCompletedSuccessfully ) ) { try { TestUtils . deleteWeblogicDomainResources ( domain . getDomainUid ( ) ) ; } catch ( Exception ex ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Failed to delete domain\n " + ex . getMessage ( ) ) ; } } } LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - " + testMethodName ) ; }
Create a domain without a JDBC DS using model in image and having config map
 in the domain.yaml before deploying the domain.
Create a domain without a JDBC DS using model in image and having config map in the domain . yaml before deploying the domain .
// create domain w/o JDBC DS using the image created by MII // create image with a new tag to update config and verify image created successfully // patch domain to change image tag and verify domain restarted successfully // get JDBC DS prop values via WLST on server pod // verify that JDBC DS is created by checking DS name, JNDI name and read timeout