Examples of HttpFSServerWebApp


Examples of org.apache.hadoop.fs.http.server.HttpFSServerWebApp

  public void tokens() throws Exception {
    String dir = TestDirHelper.getTestDir().getAbsolutePath();
    Configuration conf = new Configuration(false);
    conf.set("server.services", StringUtils.join(",",
      Arrays.asList(DelegationTokenManagerService.class.getName())));
    HttpFSServerWebApp server = new HttpFSServerWebApp(dir, dir, dir, dir, conf);
    server.setAuthority(new InetSocketAddress(InetAddress.getLocalHost(), 14000));
    server.init();
    DelegationTokenManager tm = server.get(DelegationTokenManager.class);
    Token token = tm.createToken(UserGroupInformation.getCurrentUser(), "foo");
    Assert.assertNotNull(token);
    tm.verifyToken(token);
    Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis());
    tm.cancelToken(token, "foo");
    try {
      tm.verifyToken(token);
      Assert.fail();
    } catch (DelegationTokenManagerException ex) {
      //NOP
    } catch (Exception ex) {
      Assert.fail();
    }
    server.destroy();
  }
View Full Code Here

Examples of org.apache.hadoop.fs.http.server.HttpFSServerWebApp

    conf.set("httpfs.services", StringUtils.join(",",
      Arrays.asList(InstrumentationService.class.getName(),
          SchedulerService.class.getName(),
          FileSystemAccessService.class.getName(),
          DelegationTokenManagerService.class.getName())));
    Server server = new HttpFSServerWebApp(dir, dir, dir, dir, conf);
    server.init();
    DelegationTokenManager tm = server.get(DelegationTokenManager.class);
    Assert.assertNotNull(tm);
    server.destroy();
  }
View Full Code Here

Examples of org.apache.hadoop.fs.http.server.HttpFSServerWebApp

  public void tokens() throws Exception {
    String dir = TestDirHelper.getTestDir().getAbsolutePath();
    Configuration conf = new Configuration(false);
    conf.set("server.services", StringUtils.join(",",
      Arrays.asList(DelegationTokenManagerService.class.getName())));
    HttpFSServerWebApp server = new HttpFSServerWebApp(dir, dir, dir, dir, conf);
    server.setAuthority(new InetSocketAddress(InetAddress.getLocalHost(), 14000));
    server.init();
    DelegationTokenManager tm = server.get(DelegationTokenManager.class);
    Token token = tm.createToken(UserGroupInformation.getCurrentUser(), "foo");
    Assert.assertNotNull(token);
    tm.verifyToken(token);
    Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis());
    tm.cancelToken(token, "foo");
    try {
      tm.verifyToken(token);
      Assert.fail();
    } catch (DelegationTokenManagerException ex) {
      //NOP
    } catch (Exception ex) {
      Assert.fail();
    }
    server.destroy();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.