public static void runTest1() throws Exception {
    final int MAX_CONNECTIONS = 3;
    int count = 0;
    DataSource ds = null;
    try {
      Context ctx = cache.getJNDIContext();
      ds = (DataSource) ctx.lookup("java:/XAPooledDataSource");
    } catch (NamingException e) {
      LogWriterUtils.getLogWriter().fine("Naming Exception caught in lookup: " + e);
      fail("failed in naming lookup: ", e);
      return;
    } catch (Exception e) {
      LogWriterUtils.getLogWriter().fine("Exception caught during naming lookup: " + e);
      fail("failed in naming lookup: ", e);
      return;
    }
    try {
      for (count = 0; count < MAX_CONNECTIONS; count++) {
        ds.getConnection();
        LogWriterUtils.getLogWriter().fine("Thread 1 acquired connection #" + count);
      }
      fail("expected max connect exception");
    } catch (SQLException e) {
      if (count < (MAX_CONNECTIONS - 1)) {
        Assert.fail("runTest1 SQL Exception", e);
      } else {
        LogWriterUtils.getLogWriter().fine("Success SQLException caught at connection #" + count);
      }
    }
  }
Return file as string and then modify the string accordingly **
geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java