Example usage for org.apache.hadoop.crypto.key.kms.server KMSWebApp KMSWebApp

List of usage examples for org.apache.hadoop.crypto.key.kms.server KMSWebApp KMSWebApp

Introduction

In this page you can find the example usage for org.apache.hadoop.crypto.key.kms.server KMSWebApp KMSWebApp.

Prototype

KMSWebApp

Source Link

Usage

From source file:org.apache.coheigea.bigdata.kms.ranger.RangerKmsAuthorizerTest.java

License:Apache License

@BeforeClass
public static void startServers() throws Exception {
    DerbyTestUtils.startDerby();/*from ww  w.ja  va 2 s. c o  m*/

    Path configDir = Paths.get("src/test/resources/kms");
    System.setProperty(KMSConfiguration.KMS_CONFIG_DIR, configDir.toFile().getAbsolutePath());

    // Start KMSWebApp
    ServletContextEvent servletContextEvent = EasyMock.createMock(ServletContextEvent.class);
    ServletContext servletContext = EasyMock.createMock(ServletContext.class);
    EasyMock.expect(servletContextEvent.getServletContext()).andReturn(servletContext).anyTimes();
    EasyMock.replay(servletContextEvent);

    kmsWebapp = new KMSWebApp();
    kmsWebapp.contextInitialized(servletContextEvent);
}

From source file:org.apache.ranger.authorization.kms.authorizer.RangerKmsAuthorizerTest.java

License:Apache License

@BeforeClass
public static void startServers() throws Exception {
    if (!UNRESTRICTED_POLICIES_INSTALLED) {
        return;/*www.j a va 2 s  . c  om*/
    }
    DerbyTestUtils.startDerby();

    Path configDir = Paths.get("src/test/resources/kms");
    System.setProperty(KMSConfiguration.KMS_CONFIG_DIR, configDir.toFile().getAbsolutePath());

    // Start KMSWebApp
    ServletContextEvent servletContextEvent = Mockito.mock(ServletContextEvent.class);
    ServletContext servletContext = Mockito.mock(ServletContext.class);
    Mockito.when(servletContextEvent.getServletContext()).thenReturn(servletContext);

    kmsWebapp = new KMSWebApp();
    kmsWebapp.contextInitialized(servletContextEvent);
}