content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 04:55:28 GMT 2024
   */
  
  package com.gbshape.dbe.utils;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.shaded.org.mockito.Mockito.*;
  import static org.evosuite.runtime.EvoAssertions.*;
  import com.gbshape.dbe.struts.bean.ColumnBean;
  import com.gbshape.dbe.struts.bean.DBDataBean;
  import com.gbshape.dbe.struts.bean.DataTypeBean;
  import com.gbshape.dbe.utils.DBEHelper;
  import java.io.InputStream;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.util.HashMap;
  import javax.servlet.ServletContext;
  import oracle.sql.RAW;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.ViolatedAssumptionAnswer;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class DBEHelper_Original_ESTest extends DBEHelper_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetImplementationVersionWithNull() throws Throwable  {
        String implementationVersion = DBEHelper.getImplementationVersion((ServletContext) null);
        assertEquals("?", implementationVersion);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetCalendarThrowsNullPointerException() throws Throwable  {
        // Undeclared exception!
        try { 
          DBEHelper.getCalendar((ResultSet) null, "-mB&b");
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.gbshape.dbe.utils.DBEHelper", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testShowTableStatus() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        boolean showTableStatus = DBEHelper.showTableStatus(arg0);
        assertTrue(showTableStatus);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testShowDataBases() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        boolean showDataBases = DBEHelper.showDataBases(arg0);
        assertFalse(showDataBases);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDBAvailableReturningFalse() throws Throwable  {
        boolean dBAvailable = DBEHelper.isDBAvailable("");
        assertFalse(dBAvailable);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsColumnExtra() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        boolean columnExtra = DBEHelper.isColumnExtra(arg0);
        assertFalse(columnExtra);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetJDBCDriver() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String jDBCDriver = DBEHelper.getJDBCDriver(arg0);
        assertEquals("", jDBCDriver);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetImportTasks() throws Throwable  {
        HashMap importTasks = DBEHelper.getImportTasks();
        assertEquals(0, importTasks.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDimDataTypes() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String[] dimDataTypes = DBEHelper.getDimDataTypes(arg0);
        assertNull(dimDataTypes);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDataTypes() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String[] dataTypes = DBEHelper.getDataTypes(arg0);
        assertNull(dataTypes);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDBEConfig() throws Throwable  {
        DBDataBean[] dBEConfig = DBEHelper.getDBEConfig();
        assertNull(dBEConfig);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetConnectionStartURL() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String connectionStartURL = DBEHelper.getConnectionStartURL(arg0);
        assertEquals("", connectionStartURL);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDecodeISOReturningNull() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String decodeISO = DBEHelper.decodeISO(arg0, (String) null);
        assertNull(decodeISO);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDecodeISOReturningNonEmptyString() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String decodeISO = DBEHelper.decodeISO(arg0, "E-ELbn <Y_CZK!}9W~");
        assertEquals("E-ELbn <Y_CZK!}9W~", decodeISO);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDecodeAjaxReturningNull() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String decodeAjax = DBEHelper.decodeAjax(arg0, (String) null);
        assertNull(decodeAjax);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDecodeAjaxReturningNonEmptyString() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String decodeAjax = DBEHelper.decodeAjax(arg0, "?");
        assertEquals("?", decodeAjax);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCanCreateSequence() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        boolean canCreateSequence = DBEHelper.canCreateSequence(arg0);
        assertFalse(canCreateSequence);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDataTypeBean0() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        DataTypeBean dataTypeBean = DBEHelper.getDataTypeBean(arg0, "Q&pPYb&f&m#s2");
        assertNull(dataTypeBean);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetImplementationVersionReturningNull() throws Throwable  {
        RAW rAW = new RAW();
        InputStream asciiStreamValue = rAW.asciiStreamValue();
        ServletContext arg0 = mock(ServletContext.class, new ViolatedAssumptionAnswer());
        doReturn(asciiStreamValue).when(arg0).getResourceAsStream(anyString());
        String implementationVersion = DBEHelper.getImplementationVersion(arg0);
        assertNull(implementationVersion);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetImplementationVersion() throws Throwable  {
        ServletContext arg0 = mock(ServletContext.class, new ViolatedAssumptionAnswer());
        doReturn((InputStream) null).when(arg0).getResourceAsStream(anyString());
        String implementationVersion = DBEHelper.getImplementationVersion(arg0);
        assertEquals("?", implementationVersion);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDataTypeBean1() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        DataTypeBean dataTypeBean = DBEHelper.getDataTypeBean(arg0, "INSERT INTO 6k6[ Do () VALUES () ).len");
        assertNull(dataTypeBean);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendValuesNoDecodeAjax() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        StringBuffer arg1 = new StringBuffer();
        ColumnBean arg2 = new ColumnBean();
        DBEHelper.appendValuesNoDecodeAjax(arg0, arg1, arg2, (String) null);
        assertEquals(" NULL ", arg1.toString());
        assertEquals(6, arg1.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendValuesNoDecodeAjaxThrowsNullPointerException() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        StringBuffer arg1 = new StringBuffer(252);
        ColumnBean arg2 = new ColumnBean();
        // Undeclared exception!
        try { 
          DBEHelper.appendValuesNoDecodeAjax(arg0, arg1, arg2, "?");
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.gbshape.dbe.utils.DBEHelper", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendValuesWithNullAndEmptyString() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        ColumnBean arg2 = new ColumnBean();
        // Undeclared exception!
        try { 
          DBEHelper.appendValues(arg0, (StringBuffer) null, arg2, "");
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.gbshape.dbe.utils.DBEHelper", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendValuesWithStringBufferWhereLengthIsZeroAndNonEmptyString() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        StringBuffer arg1 = new StringBuffer();
        ColumnBean arg2 = new ColumnBean();
        // Undeclared exception!
        try { 
          DBEHelper.appendValues(arg0, arg1, arg2, "th$YkT,c#sx(JKE]");
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.gbshape.dbe.utils.DBEHelper", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendValue() throws Throwable  {
        ColumnBean arg2 = new ColumnBean();
        DBDataBean arg0 = new DBDataBean();
        StringBuffer arg1 = new StringBuffer("");
        DBEHelper.appendValue(arg0, arg1, arg2, "");
        assertEquals("= NULL ", arg1.toString());
        assertEquals(7, arg1.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendValueThrowsNullPointerException() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        StringBuffer arg1 = new StringBuffer();
        ColumnBean arg2 = new ColumnBean();
        // Undeclared exception!
        try { 
          DBEHelper.appendValue(arg0, arg1, arg2, "-%LI");
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.gbshape.dbe.utils.DBEHelper", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseJSONThrowsStringIndexOutOfBoundsException() throws Throwable  {
        // Undeclared exception!
        try { 
          DBEHelper.parseJSON("\" all_objects o\n");
          fail("Expecting exception: StringIndexOutOfBoundsException");
        
        } catch(StringIndexOutOfBoundsException e) {
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseJSON() throws Throwable  {
        HashMap parseJSON = DBEHelper.parseJSON(":@C_/lma' MLU");
        assertEquals(1, parseJSON.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetConnectionThrowsSQLException0() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        arg0.setDriver("oracle.sql.CharacterSetFactoryDefault");
        arg0.setUser("oracle.sql.CharacterSetFactoryDefault");
        try { 
          DBEHelper.getConnection(arg0);
          fail("Expecting exception: SQLException");
        
        } catch(SQLException e) {
           //
           // Invalid Oracle URL specified
           //
           verifyException("oracle.jdbc.driver.DatabaseError", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetConnectionThrowsSQLException1() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        arg0.setDriver("oracle.sql.CharacterSetFactoryDefault");
        try { 
          DBEHelper.getConnection(arg0);
          fail("Expecting exception: SQLException");
        
        } catch(SQLException e) {
           //
           // Invalid Oracle URL specified
           //
           verifyException("oracle.jdbc.driver.DatabaseError", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesDBEHelper() throws Throwable  {
        DBEHelper dBEHelper = new DBEHelper();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDecodeISOReturningEmptyString() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String decodeISO = DBEHelper.decodeISO(arg0, "");
        assertEquals("", decodeISO);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDecodeAjaxReturningEmptyString() throws Throwable  {
        DBDataBean arg0 = new DBDataBean();
        String decodeAjax = DBEHelper.decodeAjax(arg0, "");
        assertEquals("", decodeAjax);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDBAvailableReturningTrue() throws Throwable  {
        boolean dBAvailable = DBEHelper.isDBAvailable("oracle");
        assertTrue(dBAvailable);
    }
  }
  