use of org.apache.hadoop.crypto.key.kms.server.KMSWebApp in project ranger by apache.
the class RangerKmsAuthorizerTest method startServers.
@BeforeClass
public static void startServers() throws Exception {
if (!UNRESTRICTED_POLICIES_INSTALLED) {
return;
}
DerbyTestUtils.startDerby();
Path configDir = Paths.get("src/test/resources/kms");
Path logDir = Paths.get("target");
System.setProperty(KMSConfiguration.KMS_CONFIG_DIR, configDir.toFile().getAbsolutePath());
System.setProperty("kms.log.dir", logDir.toFile().getAbsolutePath());
System.setProperty("hostname", "localhost");
System.setProperty("user", "autotest");
// Start KMSWebApp
ServletContextEvent servletContextEvent = Mockito.mock(ServletContextEvent.class);
kmsWebapp = new KMSWebApp();
kmsWebapp.contextInitialized(servletContextEvent);
}
use of org.apache.hadoop.crypto.key.kms.server.KMSWebApp in project testcases by coheigea.
the class RangerKmsAuthorizerTest method startServers.
@BeforeClass
public static void startServers() throws Exception {
DerbyTestUtils.startDerby();
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);
}
Aggregations