@Test
  public void useContextClassloader() throws Exception {
    // v0.2 and prior did not test context class loader in Dropship, which caused problems with
    // libraries such as hadoop. This test reproduces that behavior and ensures that we can
    // set the context class loader and then use it to load classes.
    ClassLoader old = Thread.currentThread().getContextClassLoader();
    try {
      String gav = "joda-time:joda-time:[1.6,)";
      String className = "org.joda.time.chrono.BuddhistChronology";
      ClassLoader loader = MavenArtifactResolution.createClassLoader(settings, logger, gav);
      Thread.currentThread().setContextClassLoader(loader);
      loader = Thread.currentThread().getContextClassLoader();
      assertThat(loader).isNotNull();
      Class<?> buddhistChronology = loader.loadClass(className);
      assertThat(buddhistChronology).isNotNull();
      Method factoryMethod = buddhistChronology.getMethod("getInstance");
      assertThat(factoryMethod.invoke(null)).isNotNull();
    } finally {
      Thread.currentThread().setContextClassLoader(old);
    }
  }