http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java b/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java index 9a9dd15..267de1b 100644 --- a/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java +++ b/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java @@ -88,7 +88,7 @@ public class DeploymentFactoryFuncTest { File deployDir = new File( config.getGatewayDeploymentDir() ); deployDir.mkdirs(); -// ((GatewayTestConfig) config).setDeploymentDir( "clusters" ); + // ((GatewayTestConfig) config).setDeploymentDir( "clusters" ); addStacksDir(config, targetDir); DefaultGatewayServices srvcs = new DefaultGatewayServices(); @@ -131,11 +131,11 @@ public class DeploymentFactoryFuncTest { //by default the first filter will be the X-Forwarded header filter assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/role", equalTo( "xforwardedheaders" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/name", equalTo( "XForwardedHeaderFilter" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/class", equalTo( "XForwardedHeaderFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/class", equalTo( "org.apache.knox.gateway.filter.XForwardedHeaderFilter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/role", equalTo( "federation" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/name", equalTo( "HeaderPreAuth" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/class", equalTo( "HeaderPreAuthFederationFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/class", equalTo( "org.apache.knox.gateway.preauth.filter.HeaderPreAuthFederationFilter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/param[1]/name", equalTo( "filter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/param[1]/value", equalTo( "org.opensource.ExistingFilter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/param[2]/name", equalTo( "test-param-name" ) ) ); @@ -252,15 +252,15 @@ public class DeploymentFactoryFuncTest { topology.addProvider( authorizer ); EnterpriseArchive war = DeploymentFactory.createDeployment( config, topology ); -// File dir = new File( System.getProperty( "user.dir" ) ); -// File file = war.as( ExplodedExporter.class ).exportExploded( dir, "test-cluster.war" ); + // File dir = new File( System.getProperty( "user.dir" ) ); + // File file = war.as( ExplodedExporter.class ).exportExploded( dir, "test-cluster.war" ); Document web = XmlUtils.readXml( war.get( "%2F/WEB-INF/web.xml" ).getAsset().openStream() ); assertThat( web, hasXPath( "/web-app" ) ); assertThat( web, hasXPath( "/web-app/servlet" ) ); assertThat( web, hasXPath( "/web-app/servlet/servlet-name" ) ); assertThat( web, hasXPath( "/web-app/servlet/servlet-name", equalTo( "test-cluster-knox-gateway-servlet" ) ) ); - assertThat( web, hasXPath( "/web-app/servlet/servlet-class", equalTo( "GatewayServlet" ) ) ); + assertThat( web, hasXPath( "/web-app/servlet/servlet-class", equalTo( "org.apache.knox.gateway.GatewayServlet" ) ) ); assertThat( web, hasXPath( "/web-app/servlet/init-param/param-name", equalTo( "gatewayDescriptorLocation" ) ) ); assertThat( web, hasXPath( "/web-app/servlet/init-param/param-value", equalTo( "/WEB-INF/gateway.xml" ) ) ); assertThat( web, hasXPath( "/web-app/servlet-mapping/servlet-name", equalTo( "test-cluster-knox-gateway-servlet" ) ) ); @@ -272,137 +272,137 @@ public class DeploymentFactoryFuncTest { //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( "ResponseCookieFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/class", equalTo( "org.apache.knox.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( "ShiroSubjectIdentityAdapter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/class", equalTo( "org.apache.knox.gateway.filter.ShiroSubjectIdentityAdapter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/role", equalTo( "rewrite" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/class", equalTo( "UrlRewriteServletFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/class", equalTo( "org.apache.knox.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( "IdentityAsserterFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[5]/class", equalTo( "org.apache.knox.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( "AclsAuthorizationFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/class", equalTo( "org.apache.knox.gateway.filter.AclsAuthorizationFilter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/role", equalTo( "dispatch" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/name", equalTo( "webhdfs" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/class", equalTo( "GatewayDispatchFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/class", equalTo( "org.apache.knox.gateway.dispatch.GatewayDispatchFilter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[2]/pattern", equalTo( "/webhdfs/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( "ResponseCookieFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[1]/class", equalTo( "org.apache.knox.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( "ShiroSubjectIdentityAdapter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[3]/class", equalTo( "org.apache.knox.gateway.filter.ShiroSubjectIdentityAdapter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[4]/role", equalTo( "rewrite" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[4]/class", equalTo( "UrlRewriteServletFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[4]/class", equalTo( "org.apache.knox.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( "IdentityAsserterFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[5]/class", equalTo( "org.apache.knox.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( "AclsAuthorizationFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/class", equalTo( "org.apache.knox.gateway.filter.AclsAuthorizationFilter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/role", equalTo( "dispatch" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/name", equalTo( "webhdfs" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/class", equalTo( "GatewayDispatchFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/class", equalTo( "org.apache.knox.gateway.dispatch.GatewayDispatchFilter" ) ) ); LOG_EXIT(); } - @Test( timeout = LONG_TIMEOUT ) - public void testWebXmlGeneration() throws IOException, SAXException, ParserConfigurationException, URISyntaxException { - LOG_ENTER(); - GatewayConfig config = new GatewayTestConfig(); - File targetDir = new File(System.getProperty("user.dir"), "target"); - File gatewayDir = new File(targetDir, "gateway-home-" + UUID.randomUUID()); - gatewayDir.mkdirs(); - ((GatewayTestConfig) config).setGatewayHomeDir(gatewayDir.getAbsolutePath()); - File deployDir = new File(config.getGatewayDeploymentDir()); - deployDir.mkdirs(); - - DefaultGatewayServices srvcs = new DefaultGatewayServices(); - Map<String, String> options = new HashMap<>(); - options.put("persist-master", "false"); - options.put("master", "password"); - try { - DeploymentFactory.setGatewayServices(srvcs); - srvcs.init(config, options); - } catch (ServiceLifecycleException e) { - e.printStackTrace(); // I18N not required. - } + @Test( timeout = LONG_TIMEOUT ) + public void testWebXmlGeneration() throws IOException, SAXException, ParserConfigurationException, URISyntaxException { + LOG_ENTER(); + GatewayConfig config = new GatewayTestConfig(); + File targetDir = new File(System.getProperty("user.dir"), "target"); + File gatewayDir = new File(targetDir, "gateway-home-" + UUID.randomUUID()); + gatewayDir.mkdirs(); + ((GatewayTestConfig) config).setGatewayHomeDir(gatewayDir.getAbsolutePath()); + File deployDir = new File(config.getGatewayDeploymentDir()); + deployDir.mkdirs(); - Topology topology = new Topology(); - topology.setName("test-cluster"); - Service service = new Service(); - service.setRole("WEBHDFS"); - service.addUrl("http://localhost:50070/webhdfs"); - topology.addService(service); - Provider provider = new Provider(); - provider.setRole("authentication"); - provider.setName("ShiroProvider"); - 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("Default"); - asserter.setEnabled(true); - topology.addProvider(asserter); - Provider authorizer = new Provider(); - authorizer.setRole("authorization"); - authorizer.setName("AclsAuthz"); - authorizer.setEnabled(true); - topology.addProvider(authorizer); - Provider ha = new Provider(); - ha.setRole("ha"); - ha.setName("HaProvider"); - ha.setEnabled(true); - topology.addProvider(ha); - - for (int i = 0; i < 10; i++) { - createAndTestDeployment(config, topology); - } - LOG_EXIT(); - } - - private void createAndTestDeployment(GatewayConfig config, Topology topology) throws IOException, SAXException, ParserConfigurationException { - - EnterpriseArchive 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 web = XmlUtils.readXml(war.get("%2F/WEB-INF/web.xml").getAsset().openStream()); - assertThat(web, hasXPath("/web-app/servlet/servlet-class", equalTo("GatewayServlet"))); - assertThat(web, hasXPath("/web-app/servlet/init-param/param-name", equalTo("gatewayDescriptorLocation"))); - assertThat(web, hasXPath("/web-app/servlet/init-param/param-value", equalTo("/WEB-INF/gateway.xml"))); - assertThat(web, hasXPath("/web-app/servlet-mapping/servlet-name", equalTo("test-cluster-knox-gateway-servlet"))); - assertThat(web, hasXPath("/web-app/servlet-mapping/url-pattern", equalTo("/*"))); - //testing the order of listener classes generated - assertThat(web, hasXPath("/web-app/listener[2]/listener-class", equalTo("GatewayServicesContextListener"))); - assertThat(web, hasXPath("/web-app/listener[3]/listener-class", equalTo("GatewayMetricsServletContextListener"))); - assertThat(web, hasXPath("/web-app/listener[4]/listener-class", equalTo("org.apache.hadoop.gateway.ha.provider" + - ".HaServletContextListener"))); - assertThat(web, hasXPath("/web-app/listener[5]/listener-class", equalTo("org.apache.hadoop.gateway.filter" + - ".rewrite.api.UrlRewriteServletContextListener"))); - } + DefaultGatewayServices srvcs = new DefaultGatewayServices(); + Map<String, String> options = new HashMap<>(); + options.put("persist-master", "false"); + options.put("master", "password"); + try { + DeploymentFactory.setGatewayServices(srvcs); + srvcs.init(config, options); + } catch (ServiceLifecycleException e) { + e.printStackTrace(); // I18N not required. + } + + Topology topology = new Topology(); + topology.setName("test-cluster"); + Service service = new Service(); + service.setRole("WEBHDFS"); + service.addUrl("http://localhost:50070/webhdfs"); + topology.addService(service); + Provider provider = new Provider(); + provider.setRole("authentication"); + provider.setName("ShiroProvider"); + 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("Default"); + asserter.setEnabled(true); + topology.addProvider(asserter); + Provider authorizer = new Provider(); + authorizer.setRole("authorization"); + authorizer.setName("AclsAuthz"); + authorizer.setEnabled(true); + topology.addProvider(authorizer); + Provider ha = new Provider(); + ha.setRole("ha"); + ha.setName("HaProvider"); + ha.setEnabled(true); + topology.addProvider(ha); + + for (int i = 0; i < 10; i++) { + createAndTestDeployment(config, topology); + } + LOG_EXIT(); + } + + private void createAndTestDeployment(GatewayConfig config, Topology topology) throws IOException, SAXException, ParserConfigurationException { + + EnterpriseArchive 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 web = XmlUtils.readXml(war.get("%2F/WEB-INF/web.xml").getAsset().openStream()); + assertThat(web, hasXPath("/web-app/servlet/servlet-class", equalTo("org.apache.knox.gateway.GatewayServlet"))); + assertThat(web, hasXPath("/web-app/servlet/init-param/param-name", equalTo("gatewayDescriptorLocation"))); + assertThat(web, hasXPath("/web-app/servlet/init-param/param-value", equalTo("/WEB-INF/gateway.xml"))); + assertThat(web, hasXPath("/web-app/servlet-mapping/servlet-name", equalTo("test-cluster-knox-gateway-servlet"))); + assertThat(web, hasXPath("/web-app/servlet-mapping/url-pattern", equalTo("/*"))); + //testing the order of listener classes generated + assertThat(web, hasXPath("/web-app/listener[2]/listener-class", equalTo("org.apache.knox.gateway.services.GatewayServicesContextListener"))); + assertThat(web, hasXPath("/web-app/listener[3]/listener-class", equalTo("org.apache.knox.gateway.services.GatewayMetricsServletContextListener"))); + assertThat(web, hasXPath("/web-app/listener[4]/listener-class", equalTo("org.apache.knox.gateway.ha.provider" + + ".HaServletContextListener"))); + assertThat(web, hasXPath("/web-app/listener[5]/listener-class", equalTo("org.apache.knox.gateway.filter" + + ".rewrite.api.UrlRewriteServletContextListener"))); + } @Test( timeout = LONG_TIMEOUT ) public void testDeploymentWithServiceParams() throws Exception { @@ -461,7 +461,7 @@ public class DeploymentFactoryFuncTest { EnterpriseArchive war = DeploymentFactory.createDeployment( config, topology ); Document doc = XmlUtils.readXml( war.get( "%2F/WEB-INF/gateway.xml" ).getAsset().openStream() ); -// dump( doc ); + // dump( doc ); Node resourceNode, filterNode, paramNode; String value;
http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-test/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/resources/log4j.properties b/gateway-test/src/test/resources/log4j.properties index 5c77441..e500707 100644 --- a/gateway-test/src/test/resources/log4j.properties +++ b/gateway-test/src/test/resources/log4j.properties @@ -23,11 +23,11 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n -#log4j.logger.org.apache.hadoop.gateway=DEBUG +#log4j.logger.org.apache.knox.gateway=DEBUG #log4j.logger.org.apache.hadoop.test=DEBUG -#log4j.logger.org.apache.hadoop.gateway.http=TRACE -#log4j.logger.org.apache.hadoop.gateway.http.request.body=OFF -#log4j.logger.org.apache.hadoop.gateway.http.response.body=OFF +#log4j.logger.org.apache.knox.gateway.http=TRACE +#log4j.logger.org.apache.knox.gateway.http.request.body=OFF +#log4j.logger.org.apache.knox.gateway.http.response.body=OFF #log4j.logger.org.apache.directory=DEBUG #log4j.logger.org.eclipse.jetty=DEBUG http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/solr/query_response.xml ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/solr/query_response.xml b/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/solr/query_response.xml deleted file mode 100644 index dd79042..0000000 --- a/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/solr/query_response.xml +++ /dev/null @@ -1,20 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<?xml version="1.0" encoding="UTF-8"?> -<response> -<lst name="responseHeader"><bool name="zkConnected">true</bool><int name="status">0</int><int name="QTime">9</int><lst name="params"><str name="q">author_s:William Shakespeare</str></lst></lst><result name="response" numFound="2" start="0" maxScore="0.62191015"><doc><str name="id">book2</str><arr name="title_t"><str>The Merchant of Venice</str></arr><str name="author_s">William Shakespeare</str><long name="_version_">1571258160735322112</long></doc><doc><str name="id">book1</str><arr name="title_t"><str>The Merchant of Venice</str></arr><str name="author_s">William Shakespeare</str><long name="_version_">1571258154399825920</long></doc></result> -</response> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/changes.txt ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/changes.txt b/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/changes.txt index 72e5da8..9249ab1 100644 --- a/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/changes.txt +++ b/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/changes.txt @@ -1904,7 +1904,7 @@ Release 0.20.202.0 - unreleased MAPREDUCE-1754. Replace mapred.persmissions.supergroup with an acl : mapreduce.gateway.administrators and HADOOP-6748.: Remove - org.apache.hadoop.gateway.administrators. Contributed by Amareshwari Sriramadasu. + org.apache.knox.gateway.administrators. Contributed by Amareshwari Sriramadasu. HADOOP-6701. Incorrect exit codes for "dfs -chown", "dfs -chgrp" (rphulari) http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/solr/query_response.xml ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/solr/query_response.xml b/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/solr/query_response.xml new file mode 100644 index 0000000..dd79042 --- /dev/null +++ b/gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/solr/query_response.xml @@ -0,0 +1,20 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<?xml version="1.0" encoding="UTF-8"?> +<response> +<lst name="responseHeader"><bool name="zkConnected">true</bool><int name="status">0</int><int name="QTime">9</int><lst name="params"><str name="q">author_s:William Shakespeare</str></lst></lst><result name="response" numFound="2" start="0" maxScore="0.62191015"><doc><str name="id">book2</str><arr name="title_t"><str>The Merchant of Venice</str></arr><str name="author_s">William Shakespeare</str><long name="_version_">1571258160735322112</long></doc><doc><str name="id">book1</str><arr name="title_t"><str>The Merchant of Venice</str></arr><str name="author_s">William Shakespeare</str><long name="_version_">1571258154399825920</long></doc></result> +</response> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-test/src/test/resources/shiro.ini ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/resources/shiro.ini b/gateway-test/src/test/resources/shiro.ini index b3472a2..8bb3303 100644 --- a/gateway-test/src/test/resources/shiro.ini +++ b/gateway-test/src/test/resources/shiro.ini @@ -17,7 +17,7 @@ ########################################################################## [main] -ldapRealm = org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm +ldapRealm = org.apache.knox.gateway.shirorealm.KnoxLdapRealm ldapRealm.userDnTemplate = uid={0},ou=people,dc=hadoop,dc=apache,dc=org ldapRealm.contextFactory.url = ldap://localhost:33389 ldapRealm.contextFactory.authenticationMechanism = simple http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-util-common/src/main/java/org/apache/knox/gateway/i18n/GatewayUtilCommonMessages.java ---------------------------------------------------------------------- diff --git a/gateway-util-common/src/main/java/org/apache/knox/gateway/i18n/GatewayUtilCommonMessages.java b/gateway-util-common/src/main/java/org/apache/knox/gateway/i18n/GatewayUtilCommonMessages.java index b550b0b..a2ec64d 100644 --- a/gateway-util-common/src/main/java/org/apache/knox/gateway/i18n/GatewayUtilCommonMessages.java +++ b/gateway-util-common/src/main/java/org/apache/knox/gateway/i18n/GatewayUtilCommonMessages.java @@ -24,7 +24,7 @@ import org.apache.knox.gateway.i18n.messages.MessageLevel; import org.apache.knox.gateway.i18n.messages.Messages; import org.apache.knox.gateway.i18n.messages.StackTrace; -@Messages(logger="org.apache.hadoop.gateway") +@Messages(logger="org.apache.knox.gateway") public interface GatewayUtilCommonMessages { @Message(level = MessageLevel.ERROR, text = "Failed to serialize map to Json string {0}: {1}" ) http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-util-urltemplate/src/main/java/org/apache/knox/gateway/util/urltemplate/Messages.java ---------------------------------------------------------------------- diff --git a/gateway-util-urltemplate/src/main/java/org/apache/knox/gateway/util/urltemplate/Messages.java b/gateway-util-urltemplate/src/main/java/org/apache/knox/gateway/util/urltemplate/Messages.java index 9f7e52e..b50c374 100644 --- a/gateway-util-urltemplate/src/main/java/org/apache/knox/gateway/util/urltemplate/Messages.java +++ b/gateway-util-urltemplate/src/main/java/org/apache/knox/gateway/util/urltemplate/Messages.java @@ -17,6 +17,6 @@ */ package org.apache.knox.gateway.util.urltemplate; -@org.apache.knox.gateway.i18n.messages.Messages(logger="org.apache.hadoop.gateway") +@org.apache.knox.gateway.i18n.messages.Messages(logger="org.apache.knox.gateway") public interface Messages { } http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig ---------------------------------------------------------------------- diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig index 6b6012b..4e1a9c8 100644 --- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig +++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.gateway.util.urltemplate; +package org.apache.knox.gateway.util.urltemplate; import org.apache.hadoop.test.category.FastTests; http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java ---------------------------------------------------------------------- diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java index d8ae528..9d65b05 100644 --- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java +++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java @@ -260,7 +260,7 @@ public class RewriterTest { assertThat( actualOutput, equalTo( expectOutput ) ); // *://**/webhdfs/v1/{path=**}?**={**} - // http://{org.apache.org.apache.hadoop.gateway.address}/gatewaycluster/webhdfs/v1/{path}?**={**} + // http://{org.apache.org.apache.knox.gateway.address}/gatewaycluster/webhdfs/v1/{path}?**={**} // 1) Should not add query if none in source. // 2) Should only add unmatch query parameters // Consider chaning = within {} to : and wrapping query fully within {} (e.g. {query=pattern:alias} http://git-wip-us.apache.org/repos/asf/knox/blob/2e6713b6/knox-cli-launcher/src/main/resources/META-INF/launcher.cfg ---------------------------------------------------------------------- diff --git a/knox-cli-launcher/src/main/resources/META-INF/launcher.cfg b/knox-cli-launcher/src/main/resources/META-INF/launcher.cfg index 1a64b71..57dce52 100644 --- a/knox-cli-launcher/src/main/resources/META-INF/launcher.cfg +++ b/knox-cli-launcher/src/main/resources/META-INF/launcher.cfg @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -main.class = org.apache.hadoop.gateway.util.KnoxCLI +main.class = org.apache.knox.gateway.util.KnoxCLI class.path = ../lib/*.jar;../dep/*.jar;../ext;../ext/*.jar GATEWAY_HOME=${launcher.dir}/.. log4j.configuration=${GATEWAY_HOME}/conf/${launcher.name}-log4j.properties \ No newline at end of file