integration-tests/src/test/java/oracle/kubernetes/operator/MiiConfigUpdateBaseTest.java
protected void copyAndUpdateModelFileWSecret(String destDir, String modelFile, String secretName) {
    LoggerHelper.getLocal().log(Level.INFO, "Copy and modify test modelFile");
    final String origDir = BaseTest.getProjectRoot()
        + "/integration-tests/src/test/resources/model-in-image";

    try {
      Files.deleteIfExists(Paths.get(destDir + "/" + modelFile));

      // copy MySQL yaml file
      final Path src = Paths.get(origDir + "/" + modelFile);
      final Path dst = Paths.get(destDir + "/" + modelFile);
      LoggerHelper.getLocal().log(Level.INFO, "Copying " + src.toString() + " to " + dst.toString());
      Charset charset = StandardCharsets.UTF_8;
      String content = new String(Files.readAllBytes(src), charset);
      Files.write(dst, content.getBytes(charset));
      content = new String(Files.readAllBytes(dst), charset);
      LoggerHelper.getLocal().log(Level.INFO, "Replace secret name token with " + secretName);
      content = content.replaceAll("SECRET_NAME", secretName);
      Files.write(dst, content.getBytes(charset));
    } catch (Exception ex) {
      ex.printStackTrace();
      fail("Failed to copy and modify test modelFile", ex.getCause());
    }
  }
/**
   * Copy model files from source dir. to test dir. and replace JDBC URL token with real value.
   * @param destDir destination directory name to copy model files to
   * @param modelFiles names of model files to copy
   * @param secretName secret name to create
   */
Copy model files from source dir. to test dir. and replace JDBC URL token with real value.
@param destDir destination directory name to copy model files to
@param modelFiles names of model files to copy
@param secretName secret name to create
Copy model files from source dir . to test dir . and replace JDBC URL token with real value . @param destDir destination directory name to copy model files to @param modelFiles names of model files to copy @param secretName secret name to create
protected void copyAndUpdateModelFileWSecret(String destDir, String modelFile, String secretName) {
    LoggerHelper.getLocal().log(Level.INFO, "Copy and modify test modelFile");
    final String origDir = BaseTest.getProjectRoot()
        + "/integration-tests/src/test/resources/model-in-image";
    try {
      Files.deleteIfExists(Paths.get(destDir + "/" + modelFile));
      final Path src = Paths.get(origDir + "/" + modelFile);
      final Path dst = Paths.get(destDir + "/" + modelFile);
      LoggerHelper.getLocal().log(Level.INFO, "Copying " + src.toString() + " to " + dst.toString());
      Charset charset = StandardCharsets.UTF_8;
      String content = new String(Files.readAllBytes(src), charset);
      Files.write(dst, content.getBytes(charset));
      content = new String(Files.readAllBytes(dst), charset);
      LoggerHelper.getLocal().log(Level.INFO, "Replace secret name token with " + secretName);
      content = content.replaceAll("SECRET_NAME", secretName);
      Files.write(dst, content.getBytes(charset));
    } catch (Exception ex) {
      ex.printStackTrace();
      fail("Failed to copy and modify test modelFile", ex.getCause());
    }
  }
protected void copyAndUpdateModelFileWSecret ( String destDir , String modelFile , String secretName ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Copy and modify test modelFile" ) ; final String origDir = BaseTest . getProjectRoot ( ) + "/integration-tests/src/test/resources/model-in-image" ; try { Files . deleteIfExists ( Paths . get ( destDir + "/" + modelFile ) ) ; final Path src = Paths . get ( origDir + "/" + modelFile ) ; final Path dst = Paths . get ( destDir + "/" + modelFile ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Copying " + src . toString ( ) + " to " + dst . toString ( ) ) ; Charset charset = StandardCharsets . UTF_8 ; String content = new String ( Files . readAllBytes ( src ) , charset ) ; Files . write ( dst , content . getBytes ( charset ) ) ; content = new String ( Files . readAllBytes ( dst ) , charset ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Replace secret name token with " + secretName ) ; content = content . replaceAll ( "SECRET_NAME" , secretName ) ; Files . write ( dst , content . getBytes ( charset ) ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; fail ( "Failed to copy and modify test modelFile" , ex . getCause ( ) ) ; } }
Copy model files from source dir.
Copy model files from source dir .
// copy MySQL yaml file