integration-tests/src/test/java/oracle/kubernetes/operator/ItUsabilityOperatorHelmChart.java
@Test
  public void testOperatorCreateDeleteCreate() throws Exception {
    Assumptions.assumeTrue(QUICKTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Operator firstoperator = null;
    Operator secondoperator = null;
    boolean gotException = false;
    try {
      LoggerHelper.getLocal().log(Level.INFO, "Checking if first operator is running, if not creating");
      Map<String, Object> operatorMap1 = createOperatorMap(getNewSuffixCount(), true, "usab");
      firstoperator =
          new Operator(operatorMap1, RestCertType.SELF_SIGNED);
      firstoperator.callHelmInstall();
      namespaceList.append(" ").append(operatorMap1.get("namespace"));
      int randNumber = getNewSuffixCount();
      Map<String, Object> operatorMap2 = createOperatorMap(randNumber, true, "usab");
      secondoperator =
          new Operator(operatorMap2, RestCertType.SELF_SIGNED);
      secondoperator.callHelmInstall();
      namespaceList.append(" ").append(operatorMap1.get("namespace"));
      LoggerHelper.getLocal().log(Level.INFO, "Delete second operator and verify the first operator pod still running");
      secondoperator.destroy();
      Thread.sleep(BaseTest.getWaitTimePod() * 1000);

      LoggerHelper.getLocal().log(Level.INFO, "Verify first perator pod is running");
      firstoperator.verifyOperatorReady();
      LoggerHelper.getLocal().log(Level.INFO,
          "Create again second operator pod and verify it is started again after create - delete -create steps");
      secondoperator =
          new Operator(
              (createOperatorMap(randNumber, true, "usab")),
              false,
              false,
              false,
              RestCertType.SELF_SIGNED);
      secondoperator.callHelmInstall();

    } catch (Exception ex) {
      gotException = true;
      LoggerHelper.getLocal().log(Level.INFO, "Got exception - " + testMethodName);
    } finally {
      if (firstoperator != null) {
        firstoperator.destroy();
      }
      if (secondoperator != null) {
        secondoperator.destroy();
      }
    }

    Assertions.assertFalse(gotException, "Helm installation should success");
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
/**
   * Install two operators op1 and op2. 
   * Delete and (re)install op2 with same attributes while op1 is running.
   * Make sure op2 is (re)installed successfully.
   *
   * @throws Exception if operator installation fails 
   */
Install two operators op1 and op2.
Delete and (re)install op2 with same attributes while op1 is running.
Make sure op2 is (re)installed successfully.

@throws Exception if operator installation fails
Install two operators op1 and op2 . Delete and ( re ) install op2 with same attributes while op1 is running . Make sure op2 is ( re ) installed successfully . @throws Exception if operator installation fails
@Test
  public void testOperatorCreateDeleteCreate() throws Exception {
    Assumptions.assumeTrue(QUICKTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Operator firstoperator = null;
    Operator secondoperator = null;
    boolean gotException = false;
    try {
      LoggerHelper.getLocal().log(Level.INFO, "Checking if first operator is running, if not creating");
      Map<String, Object> operatorMap1 = createOperatorMap(getNewSuffixCount(), true, "usab");
      firstoperator =
          new Operator(operatorMap1, RestCertType.SELF_SIGNED);
      firstoperator.callHelmInstall();
      namespaceList.append(" ").append(operatorMap1.get("namespace"));
      int randNumber = getNewSuffixCount();
      Map<String, Object> operatorMap2 = createOperatorMap(randNumber, true, "usab");
      secondoperator =
          new Operator(operatorMap2, RestCertType.SELF_SIGNED);
      secondoperator.callHelmInstall();
      namespaceList.append(" ").append(operatorMap1.get("namespace"));
      LoggerHelper.getLocal().log(Level.INFO, "Delete second operator and verify the first operator pod still running");
      secondoperator.destroy();
      Thread.sleep(BaseTest.getWaitTimePod() * 1000);
      LoggerHelper.getLocal().log(Level.INFO, "Verify first perator pod is running");
      firstoperator.verifyOperatorReady();
      LoggerHelper.getLocal().log(Level.INFO,
          "Create again second operator pod and verify it is started again after create - delete -create steps");
      secondoperator =
          new Operator(
              (createOperatorMap(randNumber, true, "usab")),
              false,
              false,
              false,
              RestCertType.SELF_SIGNED);
      secondoperator.callHelmInstall();
    } catch (Exception ex) {
      gotException = true;
      LoggerHelper.getLocal().log(Level.INFO, "Got exception - " + testMethodName);
    } finally {
      if (firstoperator != null) {
        firstoperator.destroy();
      }
      if (secondoperator != null) {
        secondoperator.destroy();
      }
    }
    Assertions.assertFalse(gotException, "Helm installation should success");
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
@ Test public void testOperatorCreateDeleteCreate ( ) throws Exception { Assumptions . assumeTrue ( QUICKTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Operator firstoperator = null ; Operator secondoperator = null ; boolean gotException = false ; try { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Checking if first operator is running, if not creating" ) ; Map < String , Object > operatorMap1 = createOperatorMap ( getNewSuffixCount ( ) , true , "usab" ) ; firstoperator = new Operator ( operatorMap1 , RestCertType . SELF_SIGNED ) ; firstoperator . callHelmInstall ( ) ; namespaceList . append ( " " ) . append ( operatorMap1 . get ( "namespace" ) ) ; int randNumber = getNewSuffixCount ( ) ; Map < String , Object > operatorMap2 = createOperatorMap ( randNumber , true , "usab" ) ; secondoperator = new Operator ( operatorMap2 , RestCertType . SELF_SIGNED ) ; secondoperator . callHelmInstall ( ) ; namespaceList . append ( " " ) . append ( operatorMap1 . get ( "namespace" ) ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Delete second operator and verify the first operator pod still running" ) ; secondoperator . destroy ( ) ; Thread . sleep ( BaseTest . getWaitTimePod ( ) * 1000 ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Verify first perator pod is running" ) ; firstoperator . verifyOperatorReady ( ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Create again second operator pod and verify it is started again after create - delete -create steps" ) ; secondoperator = new Operator ( ( createOperatorMap ( randNumber , true , "usab" ) ) , false , false , false , RestCertType . SELF_SIGNED ) ; secondoperator . callHelmInstall ( ) ; } catch ( Exception ex ) { gotException = true ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Got exception - " + testMethodName ) ; } finally { if ( firstoperator != null ) { firstoperator . destroy ( ) ; } if ( secondoperator != null ) { secondoperator . destroy ( ) ; } } Assertions . assertFalse ( gotException , "Helm installation should success" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - " + testMethodName ) ; }
Install two operators op1 and op2.
Install two operators op1 and op2 .