topology.setName( "test-cluster" );
Service service = new Service();
service.setRole( "WEBHDFS" );
service.setUrl( "http://localhost:50070/webhdfs" );
topology.addService( service );
Provider provider = new Provider();
provider.setRole( "authentication" );
provider.setEnabled( true );
Param param = new Param();
param.setName( "contextConfigLocation" );
param.setValue( "classpath:app-context-security.xml" );
provider.addParam( param );
topology.addProvider( provider );
Provider asserter = new Provider();
asserter.setRole( "identity-assertion" );
asserter.setName("Pseudo");
asserter.setEnabled( true );
topology.addProvider( asserter );
Provider authorizer = new Provider();
authorizer.setRole( "authorization" );
authorizer.setName("AclsAuthz");
authorizer.setEnabled( true );
topology.addProvider( authorizer );
WebArchive war = DeploymentFactory.createDeployment( config, topology );
//File dir = new File( System.getProperty( "user.dir" ) );
//File file = war.as( ExplodedExporter.class ).exportExploded( dir, "test-cluster.war" );