Class TestUtils

java.lang.Object
com.github.mizosoft.methanol.testing.TestUtils

public class TestUtils extends Object
  • Field Details

    • EMPTY_BUFFER

      public static final ByteBuffer EMPTY_BUFFER
  • Constructor Details

    • TestUtils

      public TestUtils()
  • Method Details

    • awaitUninterruptibly

      public static void awaitUninterruptibly(CountDownLatch latch)
    • awaitUnchecked

      public static void awaitUnchecked(CyclicBarrier barrier)
    • shutdown

      public static void shutdown(Executor... executors)
    • gunzip

      public static byte[] gunzip(byte[] data)
    • gzip

      public static byte[] gzip(String s)
    • zlibUnwrap

      public static byte[] zlibUnwrap(byte[] zlibWrapped)
    • inflate

      public static byte[] inflate(byte[] data)
    • deflate

      public static byte[] deflate(String s)
    • headers

      public static HttpHeaders headers(String... pairs)
    • copyRemaining

      public static int copyRemaining(ByteBuffer src, ByteBuffer dst)
    • load

      public static byte[] load(Class<?> caller, String location)
    • loadUtf8

      public static String loadUtf8(Class<?> caller, String location)
    • lines

      public static List<String> lines(String s)
    • listFiles

      public static List<Path> listFiles(Path dir) throws IOException
      Throws:
      IOException
    • toByteArray

      public static byte[] toByteArray(ByteBuffer buffer)
    • localhostCert

      public static X509Certificate localhostCert()
    • localhostSslContext

      public static SSLContext localhostSslContext()
      Build SSLContext that trusts a self-assigned certificate for the loopback address.
    • inputReaderOf

      public static BufferedReader inputReaderOf(Process process)