/**
  * DERBY-2026 make sure loginTimeout does not affect queries
  *
  * @throws SQLException
  */
 public void clientTestDerby2026LoginTimeout() throws SQLException {
   String url =
       "jdbc:splice://"
           + TestConfiguration.getCurrent().getHostName()
           + ":"
           + TestConfiguration.getCurrent().getPort()
           + "/"
           + TestConfiguration.getCurrent().getDefaultDatabaseName();
   try {
     DriverManager.setLoginTimeout(10);
     // System.out.println(url);
     try {
       Class.forName("org.apache.derby.jdbc.ClientDriver");
     } catch (ClassNotFoundException e) {
       fail(e.getMessage());
     }
     Connection conn = DriverManager.getConnection(url);
     TestRoutines.installRoutines(conn);
     CallableStatement cs = conn.prepareCall("CALL TESTROUTINE.SLEEP(20000)");
     cs.execute();
     // rollback to make sure our connection is ok.
     conn.rollback();
   } finally {
     DriverManager.setLoginTimeout(0);
   }
 }
 public static Test suite() {
   if (JDBC.vmSupportsJSR169())
     // Test uses DriverManager which
     // is not supported with JSR169
     return new TestSuite("empty ConnectTest:DriverManager not supported");
   else {
     TestSuite suite = new TestSuite("ConnectTest suite");
     suite.addTest(TestConfiguration.defaultSuite(ConnectTest.class));
     // Derby2026 test uses explicit client connection so not relevant to embedded
     suite.addTest(
         TestConfiguration.clientServerDecorator(
             new ConnectTest("clientTestDerby2026LoginTimeout")));
     return new CleanDatabaseTestSetup(suite);
   }
 }
  public static Test suite() {
    TestSuite suite = new TestSuite("LazyDefaultSchemaCreationTest");

    TestSuite[] suites = {
      new TestSuite("LazyDefaultSchemaCreationTest:embedded"),
      new TestSuite("LazyDefaultSchemaCreationTest:clientServer")
    };

    for (int i = 0; i < 2; i++) {
      suites[i].addTest(
          DatabasePropertyTestSetup.setLockTimeouts(
              new LazyDefaultSchemaCreationTest("testDerby48testNewSchemaHang"), 2, 1));

      suites[i].addTest(
          DatabasePropertyTestSetup.setLockTimeouts(
              new LazyDefaultSchemaCreationTest("testDerby48SelfLockingRecovery"), 2, 1));

      Properties p = new Properties();
      p.setProperty("derby.locks.deadlockTrace", "true");

      suites[i].addTest(
          DatabasePropertyTestSetup.setLockTimeouts(
              new DatabasePropertyTestSetup(
                  new LazyDefaultSchemaCreationTest(
                      "testDerby48SelfLockingRecoveryDeadlockDetectionOn"),
                  p,
                  false),
              2, // deadlock timeout
              1)); // wait timeout

      suites[i].addTest(
          DatabasePropertyTestSetup.setLockTimeouts(
              new DatabasePropertyTestSetup(
                  new LazyDefaultSchemaCreationTest("testDerby3678"), p, false),
              2, // deadlock timeout
              1)); // wait timeout

      suites[i].addTest(
          new CleanDatabaseTestSetup(
              new LazyDefaultSchemaCreationTest("testDerby3043CheckConstraint")));

      if (i == 0) {
        suite.addTest(suites[i]);
      } else {
        suite.addTest(TestConfiguration.clientServerDecorator(suites[i]));
      }
    }

    return suite;
  }
 public static Test suite() {
   return TestConfiguration.defaultSuite(UnsupportedVetter.class);
 }