Added: oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/authentication/TestExampleAltAuthenticationHandler.java URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/authentication/TestExampleAltAuthenticationHandler.java?rev=1430060&view=auto ============================================================================== --- oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/authentication/TestExampleAltAuthenticationHandler.java (added) +++ oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/authentication/TestExampleAltAuthenticationHandler.java Mon Jan 7 22:18:40 2013 @@ -0,0 +1,140 @@ +/** + * 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. + */ +package org.apache.oozie.authentication; + +import java.net.URLEncoder; +import java.text.MessageFormat; +import java.util.Properties; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.hadoop.security.authentication.client.AuthenticationException; +import org.apache.hadoop.security.authentication.server.AuthenticationToken; +import org.apache.oozie.service.Services; +import org.apache.oozie.test.XTestCase; +import org.mockito.Mockito; + +public class TestExampleAltAuthenticationHandler extends XTestCase { + + private ExampleAltAuthenticationHandler handler; + private final String redirectUrl = "http://foo:11000/oozie-login/?backurl={0}"; + + @Override + protected void setUp() throws Exception { + super.setUp(); + + new Services().init(); + Services.get().getConf().set("oozie.authentication.ExampleAltAuthenticationHandler.redirect.url", redirectUrl); + handler = new ExampleAltAuthenticationHandler(); + Properties props = new Properties(); + props.setProperty(ExampleAltAuthenticationHandler.PRINCIPAL, getOoziePrincipal()); + props.setProperty(ExampleAltAuthenticationHandler.KEYTAB, getKeytabFile()); + try { + handler.init(props); + } catch (Exception ex) { + handler = null; + throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + if (handler != null) { + handler.destroy(); + handler = null; + } + Services.get().destroy(); + super.tearDown(); + } + + public void testRedirect() throws Exception { + String oozieBaseUrl = Services.get().getConf().get("oozie.base.url"); + String resolvedRedirectUrl = MessageFormat.format(redirectUrl, URLEncoder.encode(oozieBaseUrl, "ISO-8859-1")); + + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + HttpServletResponse response = Mockito.mock(HttpServletResponse.class); + + // A User-Agent without "java", "curl", "wget", or "perl" (default) in it is considered to be a browser + Mockito.when(request.getHeader("User-Agent")).thenReturn("Some Browser"); + // Pretend the request URL is from oozie.base.url + Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer(oozieBaseUrl)); + + // The HttpServletResponse needs to return the encoded redirect url + Mockito.when(response.encodeRedirectURL(resolvedRedirectUrl)).thenReturn(resolvedRedirectUrl); + + handler.authenticate(request, response); + Mockito.verify(response).sendRedirect(resolvedRedirectUrl); + } + + public void testAuthenticateCookie() throws Exception { + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + HttpServletResponse response = Mockito.mock(HttpServletResponse.class); + + // A User-Agent without "java" in it is considered to be a browser + Mockito.when(request.getHeader("User-Agent")).thenReturn("Some Browser"); + + // We need the request to return the auth cookie + Cookie[] cookies = {new Cookie("some.other.cookie", "someValue"), + new Cookie("oozie.web.login.auth", "someUser")}; + Mockito.when(request.getCookies()).thenReturn(cookies); + + AuthenticationToken token = handler.authenticate(request, response); + assertEquals("someUser", token.getUserName()); + assertEquals("someUser", token.getName()); + assertEquals("alt-kerberos", token.getType()); + } + + // Some browsers or server implementations will quote cookie values, so test that behavior by repeating testAuthenticateCookie() + // but with "\"someUser\"" instead of "someUser" + public void testAuthenticateCookieQuoted() throws Exception { + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + HttpServletResponse response = Mockito.mock(HttpServletResponse.class); + + // A User-Agent without "java" in it is considered to be a browser + Mockito.when(request.getHeader("User-Agent")).thenReturn("Some Browser"); + + // We need the request to return the auth cookie + Cookie[] cookies = {new Cookie("some.other.cookie", "someValue"), + new Cookie("oozie.web.login.auth", "\"someUser\"")}; + Mockito.when(request.getCookies()).thenReturn(cookies); + + AuthenticationToken token = handler.authenticate(request, response); + assertEquals("someUser", token.getUserName()); + assertEquals("someUser", token.getName()); + assertEquals("alt-kerberos", token.getType()); + } + + public void testAuthenticateCookieQuotedInvalid() throws Exception { + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + HttpServletResponse response = Mockito.mock(HttpServletResponse.class); + + // A User-Agent without "java" in it is considered to be a browser + Mockito.when(request.getHeader("User-Agent")).thenReturn("Some Browser"); + + // We need the request to return the auth cookie + Cookie[] cookies = {new Cookie("some.other.cookie", "someValue"), + new Cookie("oozie.web.login.auth", "\"\"")}; + Mockito.when(request.getCookies()).thenReturn(cookies); + + try { + handler.authenticate(request, response); + } catch(AuthenticationException ae) { + assertEquals("Unable to parse authentication cookie", ae.getMessage()); + } + } +}
Added: oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLDAPLoginServlet.java URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLDAPLoginServlet.java?rev=1430060&view=auto ============================================================================== --- oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLDAPLoginServlet.java (added) +++ oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLDAPLoginServlet.java Mon Jan 7 22:18:40 2013 @@ -0,0 +1,166 @@ +/** + * 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. + */ +package org.apache.oozie.servlet.login; + +import java.io.File; +import java.net.HttpURLConnection; +import java.net.URL; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import javax.naming.directory.Attribute; +import javax.naming.directory.Attributes; +import javax.naming.directory.BasicAttribute; +import javax.naming.directory.BasicAttributes; +import javax.servlet.http.HttpServletResponse; +import org.apache.directory.server.core.configuration.MutablePartitionConfiguration; +import org.apache.directory.server.unit.AbstractServerTest; + +// LDAP stuff based on https://cwiki.apache.org/DIRxSRVx10/using-apacheds-for-unit-tests.html +// The default admin user for Apache DS is "uid=admin,ou=system" and password is "secret" +public class TestLDAPLoginServlet extends AbstractServerTest { + + // We need to subclass the AbstractServerTest to get the LDAP stuff, so we'll have to do a wrapper to inherit the + // TestLoginServlet tests instead of subclassing it + TestLoginServlet tls = new TestLoginServlet() { + @Override + protected Class getServletClass() { + // Make the TestLoginServlet use LDAPLoginServlet instead of LoginServlet + return LDAPLoginServlet.class; + } + + @Override + protected Map<String, String> getInitParameters() { + // Configure for LDAP tests + HashMap<String, String> initParams = new HashMap<String, String>(); + initParams.put("ldap.provider.url", "o=test"); + initParams.put("ldap.context.factory", "org.apache.directory.server.jndi.ServerContextFactory"); + return initParams; + } + }; + + @Override + public void setUp() throws Exception { + // Add partition 'test' + MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration(); + pcfg.setName("test"); + pcfg.setSuffix("o=test"); + + // Create some indices + Set<String> indexedAttrs = new HashSet<String>(); + indexedAttrs.add("objectClass"); + indexedAttrs.add("o"); + pcfg.setIndexedAttributes(indexedAttrs); + + // Create a first entry associated to the partition + Attributes attrs = new BasicAttributes(true); + + // First, the objectClass attribute + Attribute attr = new BasicAttribute("objectClass"); + attr.add("top"); + attr.add("organization"); + attrs.put(attr); + + // The the 'Organization' attribute + attr = new BasicAttribute("o"); + attr.add("test"); + attrs.put(attr); + + // Associate this entry to the partition + pcfg.setContextEntry(attrs); + + // As we can create more than one partition, we must store + // each created partition in a Set before initialization + Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>(); + pcfgs.add(pcfg); + + configuration.setContextPartitionConfigurations(pcfgs); + + // Create a working directory + File workingDirectory = new File("server-work"); + configuration.setWorkingDirectory(workingDirectory); + + // Now, let's call the super class which is responsible for the + // partitions creation + super.setUp(); + + // setUp the TestLoginServlet + tls.setUp(); + } + + public void testGetMissingBackurl() throws Exception { + tls.testGetMissingBackurl(); + } + + public void testGetSuccess() throws Exception { + tls.testGetSuccess(); + } + + public void testPostMissingBackurl() throws Exception { + tls.testPostMissingBackurl(); + } + + public void testPostMissingUsernamePassword() throws Exception { + tls.testPostMissingUsernamePassword(); + } + + public void testPostInvalidUsernamePassword() throws Exception { + // Valid username, invalid password + URL url = new URL(tls.container.getServletURL("/") + + "?backurl=http://foo:11000/oozie&username=uid=admin,ou=system&password=bar"); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + String html = tls.getHTML(conn); + assertEquals(MessageFormat.format(TestLoginServlet.loginPageTemplate, + "<font color=\"red\">Error: Invalid Username or Password</font><br>", + "uid=admin,ou=system", "http://foo:11000/oozie"), html); + + // InValid username, valid password + url = new URL(tls.container.getServletURL("/") + + "?backurl=http://foo:11000/oozie&username=foo&password=secret"); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + html = tls.getHTML(conn); + assertEquals(MessageFormat.format(TestLoginServlet.loginPageTemplate, + "<font color=\"red\">Error: Invalid Username or Password</font><br>", "foo", "http://foo:11000/oozie"), html); + } + + public void testPostSuccess() throws Exception { + // Now that its actually going to work successfully, the backurl needs to go somewhere real; about:blank provides a + // convinient location that doesn't require internet access or another servlet running locally + URL url = new URL(tls.container.getServletURL("/") + "?backurl=about:blank&username=uid=admin,ou=system&password=secret"); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_FOUND, conn.getResponseCode()); + String cookies = tls.getCookies(conn); + String username = tls.getUsernameFromCookies(cookies); + assertEquals("uid=admin,ou=system", username); + } + + @Override + public void tearDown() throws Exception { + // tear down the TestLoginServlet + tls.tearDown(); + + super.tearDown(); + } +} Added: oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLoginServlet.java URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLoginServlet.java?rev=1430060&view=auto ============================================================================== --- oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLoginServlet.java (added) +++ oozie/branches/hcat-intre/login/src/test/java/org/apache/oozie/servlet/login/TestLoginServlet.java Mon Jan 7 22:18:40 2013 @@ -0,0 +1,212 @@ +/** + * 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. + */ +package org.apache.oozie.servlet.login; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLDecoder; +import java.text.MessageFormat; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import junit.framework.TestCase; +import org.apache.oozie.test.EmbeddedServletContainer; + +public class TestLoginServlet extends TestCase { + + protected EmbeddedServletContainer container; + protected static String loginPageTemplate; + + static { + try { + StringBuilder sb = new StringBuilder(); + InputStream is = new FileInputStream(new File("src/main/resources/login-page-template.html")); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String line = br.readLine(); + while (line != null) { + sb.append(line).append("\n"); + line = br.readLine(); + } + br.close(); + loginPageTemplate = sb.toString(); + } catch (IOException ex) { + ex.printStackTrace(); + fail("Unable to read login-page-template.html"); + } + } + + protected Class getServletClass() { + return LoginServlet.class; + } + + protected Map<String, String> getInitParameters() { + return null; + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + container = new EmbeddedServletContainer("oozie-login"); + container.addServletEndpoint("/", getServletClass(), getInitParameters()); + container.start(); + } + + @Override + protected void tearDown() throws Exception { + if (container != null) { + container.stop(); + } + super.tearDown(); + } + + public void testGetMissingBackurl() throws Exception { + URL url = new URL(container.getServletURL("/")); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + assertEquals(HttpServletResponse.SC_BAD_REQUEST, conn.getResponseCode()); + assertEquals("missing or invalid 'backurl' parameter", conn.getResponseMessage()); + } + + public void testGetSuccess() throws Exception { + URL url = new URL(container.getServletURL("/") + "?backurl=http://foo:11000/oozie"); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + String html = getHTML(conn); + assertEquals(MessageFormat.format(loginPageTemplate, "", "", "http://foo:11000/oozie"), html); + + // With optional username parameter + url = new URL(container.getServletURL("/") + "?backurl=http://foo:11000/oozie&username=foo"); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + html = getHTML(conn); + assertEquals(MessageFormat.format(loginPageTemplate, "", "foo", "http://foo:11000/oozie"), html); + } + + public void testPostMissingBackurl() throws Exception { + // Missing all + URL url = new URL(container.getServletURL("/")); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_BAD_REQUEST, conn.getResponseCode()); + assertEquals("missing or invalid 'backurl' parameter", conn.getResponseMessage()); + + // Missing only backurl + url = new URL(container.getServletURL("/") + "?username=foo&password=bar"); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_BAD_REQUEST, conn.getResponseCode()); + assertEquals("missing or invalid 'backurl' parameter", conn.getResponseMessage()); + } + + public void testPostMissingUsernamePassword() throws Exception { + // Missing password + URL url = new URL(container.getServletURL("/") + "?backurl=http://foo:11000/oozie&username=foo"); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + String html = getHTML(conn); + assertEquals(MessageFormat.format(loginPageTemplate, + "<font color=\"red\">Error: Invalid Username or Password</font><br>", "foo", "http://foo:11000/oozie"), html); + + // Missing username + url = new URL(container.getServletURL("/") + "?backurl=http://foo:11000/oozie&password=bar"); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + html = getHTML(conn); + assertEquals(MessageFormat.format(loginPageTemplate, + "<font color=\"red\">Error: Invalid Username or Password</font><br>", "", "http://foo:11000/oozie"), html); + + // Missing both + url = new URL(container.getServletURL("/") + "?backurl=http://foo:11000/oozie"); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + html = getHTML(conn); + assertEquals(MessageFormat.format(loginPageTemplate, + "<font color=\"red\">Error: Invalid Username or Password</font><br>", "", "http://foo:11000/oozie"), html); + } + + public void testPostInvalidUsernamePassword() throws Exception { + URL url = new URL(container.getServletURL("/") + "?backurl=http://foo:11000/oozie&username=foo&password=bar"); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + String html = getHTML(conn); + assertEquals(MessageFormat.format(loginPageTemplate, + "<font color=\"red\">Error: Invalid Username or Password</font><br>", "foo", "http://foo:11000/oozie"), html); + } + + public void testPostSuccess() throws Exception { + // Now that its actually going to work successfully, the backurl needs to go somewhere real; about:blank provides a + // convinient location that doesn't require internet access or another servlet running locally + URL url = new URL(container.getServletURL("/") + "?backurl=about:blank&username=foo&password=foo"); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + assertEquals(HttpServletResponse.SC_FOUND, conn.getResponseCode()); + String cookies = getCookies(conn); + String username = getUsernameFromCookies(cookies); + assertEquals("foo", username); + } + + protected String getHTML(HttpURLConnection conn) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); + String line; + StringBuilder htmlBuilder = new StringBuilder(); + while ((line = br.readLine()) != null) { + htmlBuilder.append(line); + htmlBuilder.append("\n"); + } + br.close(); + return htmlBuilder.toString(); + } + + protected String getCookies(HttpURLConnection conn) throws Exception { + Map<String, List<String>> headers = conn.getHeaderFields(); + for (String key : headers.keySet()) { + if (key != null && key.equals("Set-Cookie")) { + List<String> cookies = headers.get(key); + return cookies.get(0); + } + } + return null; + } + + protected String getUsernameFromCookies(String cookies) throws UnsupportedEncodingException { + String[] cookiesSplit = cookies.split(";"); + for (String split : cookiesSplit) { + if (split.startsWith("oozie.web.login.auth=")) { + String value = split.substring("oozie.web.login.auth=".length()); + if (value.startsWith("\"") && value.endsWith("\"")) { + value = value.substring(1, value.length() - 1); + } + return URLDecoder.decode(value, "UTF-8"); + } + } + return null; + } +} Modified: oozie/branches/hcat-intre/release-log.txt URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/release-log.txt?rev=1430060&r1=1430059&r2=1430060&view=diff ============================================================================== --- oozie/branches/hcat-intre/release-log.txt (original) +++ oozie/branches/hcat-intre/release-log.txt Mon Jan 7 22:18:40 2013 @@ -1,5 +1,8 @@ -- Oozie 3.4.0 release (trunk - unreleased) +OOZIE-1144 OOZIE-1137 breaks the sharelib (rkanter) +OOZIE-1035 Improve forkjoin validation to allow same errorTo transitions (rkanter) +OOZIE-1137 In light of federation use actionLibPath instead of appPath (vaidya via rkanter) OOZIE-1102 Update Oozie README.txt to have the TLP mailing list and links (jaoki via rkanter) OOZIE-1103 Create example using AltKerberosAuthenticationHandler (rkanter) OOZIE-816 Add Support for Hadoop 1.1.1 (zhujinwei and harsh via harsh) Added: oozie/branches/hcat-intre/src/main/resources/checkstyle-header.txt URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/src/main/resources/checkstyle-header.txt?rev=1430060&view=auto ============================================================================== --- oozie/branches/hcat-intre/src/main/resources/checkstyle-header.txt (added) +++ oozie/branches/hcat-intre/src/main/resources/checkstyle-header.txt Mon Jan 7 22:18:40 2013 @@ -0,0 +1,18 @@ +/** + * 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. +*/ + Added: oozie/branches/hcat-intre/src/main/resources/checkstyle.xml URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/src/main/resources/checkstyle.xml?rev=1430060&view=auto ============================================================================== --- oozie/branches/hcat-intre/src/main/resources/checkstyle.xml (added) +++ oozie/branches/hcat-intre/src/main/resources/checkstyle.xml Mon Jan 7 22:18:40 2013 @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> +<!-- + 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. +--> + +<module name="Checker"> + + <module name="RegexpSingleline"> + <property name="severity" value="warning"/> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module> + + <module name="Header"> + <property name="severity" value="warning"/> + <property name="headerFile" value="src/main/resources/checkstyle-header.txt"/> + </module> + + <module name="TreeWalker"> + + <module name="LineLength"> + <property name="severity" value="warning"/> + <property name="max" value="132"/> + </module> + + </module> + +</module> +
