You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by km...@apache.org on 2013/09/12 01:37:43 UTC
git commit: test-refactor
Updated Branches:
refs/heads/master 5e056a15d -> 2f9abf6d0
test-refactor
Project: http://git-wip-us.apache.org/repos/asf/incubator-knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-knox/commit/2f9abf6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-knox/tree/2f9abf6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-knox/diff/2f9abf6d
Branch: refs/heads/master
Commit: 2f9abf6d00c0896d52e0b09397f15c415b484d90
Parents: 5e056a1
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Wed Sep 11 19:37:22 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Wed Sep 11 19:37:22 2013 -0400
----------------------------------------------------------------------
gateway-server/pom.xml | 61 -------------
.../gateway/deploy/DeploymentFactoryTest.java | 96 +-------------------
2 files changed, 1 insertion(+), 156 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/2f9abf6d/gateway-server/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-server/pom.xml b/gateway-server/pom.xml
index c2c6d9d..f84b84f 100644
--- a/gateway-server/pom.xml
+++ b/gateway-server/pom.xml
@@ -184,52 +184,6 @@
<dependency>
<groupId>${gateway-group}</groupId>
- <artifactId>gateway-service-hdfs</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${gateway-group}</groupId>
- <artifactId>gateway-service-templeton</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${gateway-group}</groupId>
- <artifactId>gateway-service-oozie</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${gateway-group}</groupId>
- <artifactId>gateway-provider-rewrite</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${gateway-group}</groupId>
- <artifactId>gateway-provider-secure-query</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${gateway-group}</groupId>
- <artifactId>gateway-provider-hostmap-static</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>gateway-provider-security-shiro</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>gateway-provider-security-authz-acls</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>gateway-provider-identity-assertion-pseudo</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${gateway-group}</groupId>
<artifactId>gateway-test-utils</artifactId>
<scope>test</scope>
</dependency>
@@ -310,21 +264,6 @@
<scope>test</scope>
</dependency>
- <!--
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>gateway-provider-security-spring</artifactId>
- <scope>test</scope>
- </dependency>
- -->
- <!--
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>gateway-provider-security-hawk</artifactId>
- <scope>test</scope>
- </dependency>
- -->
-
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/2f9abf6d/gateway-server/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryTest.java
index 1da6355..08d5c4b 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryTest.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.gateway.topology.ProviderParam;
import org.apache.hadoop.gateway.topology.Service;
import org.apache.hadoop.gateway.topology.Topology;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Ignore;
import org.junit.Test;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
@@ -65,101 +66,6 @@ public class DeploymentFactoryTest {
assertThat( gateway, hasXPath( "/gateway" ) );
}
- @Test
- public void testSimpleTopology() throws IOException, SAXException, ParserConfigurationException {
- GatewayConfig config = new GatewayConfigImpl();
- Topology topology = new Topology();
- topology.setName( "test-cluster" );
- Service service = new Service();
- service.setRole( "NAMENODE" );
- service.setUrl( new URL( "http://localhost:50070/webhdfs/v1" ) );
- topology.addService( service );
- Provider provider = new Provider();
- provider.setRole( "authentication" );
- provider.setEnabled( true );
- ProviderParam param = new ProviderParam();
- 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" );
-
- Document wad = parse( war.get( "WEB-INF/web.xml" ).getAsset().openStream() );
- assertThat( wad, hasXPath( "/web-app/servlet/servlet-name", equalTo( "test-cluster" ) ) );
- assertThat( wad, hasXPath( "/web-app/servlet/servlet-class", equalTo( "org.apache.hadoop.gateway.GatewayServlet" ) ) );
- assertThat( wad, hasXPath( "/web-app/servlet/init-param/param-name", equalTo( "gatewayDescriptorLocation" ) ) );
- assertThat( wad, hasXPath( "/web-app/servlet/init-param/param-value", equalTo( "gateway.xml" ) ) );
- assertThat( wad, hasXPath( "/web-app/servlet-mapping/servlet-name", equalTo( "test-cluster" ) ) );
- assertThat( wad, hasXPath( "/web-app/servlet-mapping/url-pattern", equalTo( "/*" ) ) );
-
- Document gateway = parse( war.get( "WEB-INF/gateway.xml" ).getAsset().openStream() );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/pattern", equalTo( "/namenode/api/v1/?**" ) ) );
- //assertThat( gateway, hasXPath( "/gateway/resource[1]/target", equalTo( "http://localhost:50070/webhdfs/v1/?{**}" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/role", equalTo( "authentication" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/class", equalTo( "org.apache.hadoop.gateway.filter.ResponseCookieFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/role", equalTo( "authentication" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/class", equalTo( "org.apache.shiro.web.servlet.ShiroFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/role", equalTo( "authentication" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/class", equalTo( "org.apache.hadoop.gateway.filter.PostAuthenticationFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/role", equalTo( "rewrite" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/class", equalTo( "org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[5]/role", equalTo( "identity-assertion" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[5]/class", equalTo( "org.apache.hadoop.gateway.identityasserter.filter.IdentityAsserterFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/role", equalTo( "authorization" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/name", equalTo( "AclsAuthz" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/class", equalTo( "org.apache.hadoop.gateway.filter.AclsAuthorizationFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/role", equalTo( "dispatch" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/name", equalTo( "http-client" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/class", equalTo( "org.apache.hadoop.gateway.dispatch.HttpClientDispatch" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[2]/pattern", equalTo( "/namenode/api/v1/**?**" ) ) );
- //assertThat( gateway, hasXPath( "/gateway/resource[2]/target", equalTo( "http://localhost:50070/webhdfs/v1/{path=**}?{**}" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[1]/role", equalTo( "authentication" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[1]/class", equalTo( "org.apache.hadoop.gateway.filter.ResponseCookieFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[2]/role", equalTo( "authentication" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[2]/class", equalTo( "org.apache.shiro.web.servlet.ShiroFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[3]/role", equalTo( "authentication" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[3]/class", equalTo( "org.apache.hadoop.gateway.filter.PostAuthenticationFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[4]/role", equalTo( "rewrite" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[4]/class", equalTo( "org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[5]/role", equalTo( "identity-assertion" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[5]/class", equalTo( "org.apache.hadoop.gateway.identityasserter.filter.IdentityAsserterFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/role", equalTo( "authorization" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/name", equalTo( "AclsAuthz" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/class", equalTo( "org.apache.hadoop.gateway.filter.AclsAuthorizationFilter" ) ) );
-
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/role", equalTo( "dispatch" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/name", equalTo( "http-client" ) ) );
- assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/class", equalTo( "org.apache.hadoop.gateway.dispatch.HttpClientDispatch" ) ) );
- }
-
private Document parse( InputStream stream ) throws IOException, SAXException, ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();