Author: hboutemy Date: Mon Oct 15 21:12:04 2012 New Revision: 1398527 URL: http://svn.apache.org/viewvc?rev=1398527&view=rev Log: code formatting
Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/ExpandTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/OsTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/PathToolTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/StringUtilsTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/XmlStreamReaderTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/shell/BourneShellTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestException.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestExceptionWithDetail.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryWalkerTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/Java7SupportTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternsTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/SelectorUtilsTest.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTestHelper.java maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/testhelpers/FileTestHelper.java Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/ExpandTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/ExpandTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/ExpandTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/ExpandTest.java Mon Oct 15 21:12:04 2012 @@ -32,7 +32,6 @@ import java.net.URL; import static org.hamcrest.CoreMatchers.*; - /** * This will test the plexus utility class {@link Expand}. * @@ -44,7 +43,8 @@ import static org.hamcrest.CoreMatchers. * * @author <a href="mailto:strub...@yahoo.de">Mark Struberg</a> */ -public class ExpandTest extends Assert +public class ExpandTest + extends Assert { private static final String TEST_ZIP_LOCATION = "/expand/expand_test.zip"; @@ -74,7 +74,6 @@ public class ExpandTest extends Assert */ private File getTestTargetDir() { - return tempFolder.newFolder( TEST_ZIP_TARGET_FOLDER ); } @@ -93,7 +92,8 @@ public class ExpandTest extends Assert } @Test - public void testExecute() throws Exception + public void testExecute() + throws Exception { Expand expand = new Expand(); @@ -109,7 +109,8 @@ public class ExpandTest extends Assert } @Test - public void testExecuteIntoNonexistingDirectory() throws Exception + public void testExecuteIntoNonexistingDirectory() + throws Exception { Expand expand = new Expand(); @@ -131,7 +132,8 @@ public class ExpandTest extends Assert } @Test - public void testExecuteNonexistingSource() throws Exception + public void testExecuteNonexistingSource() + throws Exception { Expand expand = new Expand(); @@ -143,7 +145,6 @@ public class ExpandTest extends Assert try { - expand.execute(); fail( "expand with notexiting source must throw Exception!" ); } @@ -162,7 +163,7 @@ public class ExpandTest extends Assert @Test( expected = NullPointerException.class ) public void testExecute_NullSource() - throws Exception + throws Exception { Expand expand = new Expand(); expand.setSrc( null ); @@ -175,7 +176,7 @@ public class ExpandTest extends Assert @Test public void testExecute_NullDest() - throws Exception + throws Exception { Expand expand = new Expand(); expand.setSrc( getSourceFile() ); @@ -202,7 +203,8 @@ public class ExpandTest extends Assert } @Test - public void testExecute_Overwrite() throws Exception + public void testExecute_Overwrite() + throws Exception { File targetDir = getTestTargetDir(); File expandedFile = null; @@ -305,7 +307,7 @@ public class ExpandTest extends Assert { assertThat( "target directory must exist" , targetDir.exists() - , is( true) ); + , is( true ) ); File expandedFile = new File( targetDir, TEST_UNZIPPED_FILE ); @@ -321,16 +323,13 @@ public class ExpandTest extends Assert { File expandedFile = verifyExpandedFile( targetDir ); - assertNotNull(expandedFile); + assertNotNull( expandedFile ); java.util.Scanner scanner = new java.util.Scanner( expandedFile ).useDelimiter( "\n" ); String text = scanner.next(); assertThat( "expanded file content must match" , text - , is( expectedContent) ); + , is( expectedContent ) ); } - - - } Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/OsTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/OsTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/OsTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/OsTest.java Mon Oct 15 21:12:04 2012 @@ -30,14 +30,14 @@ import java.util.Set; import static org.hamcrest.CoreMatchers.*; - /** * This class will test the 'Os' class which evaluates * operation system specific settings. * * @author <a href="mailto:strub...@yahoo.de">Mark Struberg</a> */ -public class OsTest extends Assert +public class OsTest + extends Assert { private String origOsName; private String origOsFamily; @@ -47,7 +47,7 @@ public class OsTest extends Assert @Before public void setUp() - throws Exception + throws Exception { origOsName = System.getProperty( "os.name" ); origOsArch = System.getProperty( "os.arch" ); @@ -68,7 +68,7 @@ public class OsTest extends Assert @After public void tearDown() - throws Exception + throws Exception { // set the original OS settings again System.setProperty( "os.name" , origOsName ); @@ -83,7 +83,7 @@ public class OsTest extends Assert } private void setStaticOsField( String variableName, Object value ) - throws NoSuchFieldException, IllegalAccessException + throws NoSuchFieldException, IllegalAccessException { Field field = Os.class.getField( variableName ); @@ -98,7 +98,7 @@ public class OsTest extends Assert @Test public void testConstructor() - throws Exception + throws Exception { Os os = new Os(); os.eval(); Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/PathToolTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/PathToolTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/PathToolTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/PathToolTest.java Mon Oct 15 21:12:04 2012 @@ -31,7 +31,6 @@ import java.io.File; import static org.hamcrest.CoreMatchers.is; - /** * Test the {@link PathTool} class. * Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/StringUtilsTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/StringUtilsTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/StringUtilsTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/StringUtilsTest.java Mon Oct 15 21:12:04 2012 @@ -32,28 +32,28 @@ import org.junit.rules.TemporaryFolder; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; - /** * Test the {@link StringUtils} class. * * We don't need to test this * @author <a href="mailto:strub...@yahoo.de">Mark Struberg</a> */ -public class StringUtilsTest extends Assert +public class StringUtilsTest + extends Assert { @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); - @Test(expected = NullPointerException.class) + @Test( expected = NullPointerException.class ) public void testAbbreviate_NPE() { assertThat( StringUtils.abbreviate( null, 10 ) , nullValue() ); } - @Test(expected = IllegalArgumentException.class) + @Test( expected = IllegalArgumentException.class ) public void testAbbreviate_MinLength() { assertThat( StringUtils.abbreviate( "This is a longtext", 3 ) @@ -70,14 +70,14 @@ public class StringUtilsTest extends Ass , is( "This is a longtext" ) ); } - @Test(expected = NullPointerException.class) + @Test( expected = NullPointerException.class ) public void testAbbreviate_Offset_NPE() { assertThat( StringUtils.abbreviate( null, 10, 20 ) , nullValue() ); } - @Test(expected = IllegalArgumentException.class) + @Test( expected = IllegalArgumentException.class ) public void testAbbreviate_Offset_MinLength() { assertThat( StringUtils.abbreviate( "This is a longtext", 10, 3 ) @@ -616,15 +616,15 @@ public class StringUtilsTest extends Ass assertThat( StringUtils.escape( null, null, '#' ) , nullValue() ); - assertThat( StringUtils.escape( "dings", new char[]{'\t','\b'}, '+' ) + assertThat( StringUtils.escape( "dings", new char[]{ '\t', '\b' }, '+' ) , is( "dings" ) ); - assertThat( StringUtils.escape( "dings\tbums", new char[]{'\t','\b'}, '+' ) + assertThat( StringUtils.escape( "dings\tbums", new char[]{ '\t', '\b' }, '+' ) , is( "dings+\tbums" ) ); - assertThat( StringUtils.escape( "dings\nbums", new char[]{'\t','\b'}, '+' ) + assertThat( StringUtils.escape( "dings\nbums", new char[]{ '\t', '\b' }, '+' ) , is( "dings\nbums" ) ); - assertThat( StringUtils.escape( "dings\bbums", new char[]{'\t','\b'}, '+' ) + assertThat( StringUtils.escape( "dings\bbums", new char[]{ '\t', '\b' }, '+' ) , is( "dings+\bbums" ) ); } @@ -740,7 +740,7 @@ public class StringUtilsTest extends Ass assertThat( StringUtils.indexOfAny( "dings", null ) , is( -1 ) ); - assertThat( StringUtils.indexOfAny( null, new String[]{ } ) + assertThat( StringUtils.indexOfAny( null, new String[]{} ) , is( -1 ) ); assertThat( StringUtils.indexOfAny( "dings bums dongs", new String[]{ "knuff", "bums" } ) @@ -762,7 +762,7 @@ public class StringUtilsTest extends Ass @Test public void testInterpolate() { - Map<String,String> variables = new HashMap<String,String>(); + Map<String, String> variables = new HashMap<String, String>(); assertThat( StringUtils.interpolate( "This ${text} will get replaced", variables ) , is( "This ${text} will get replaced" ) ); @@ -1035,17 +1035,17 @@ public class StringUtilsTest extends Ass assertThat( StringUtils.join( new Object[0], null ) , is( "" ) ); - assertThat( StringUtils.join( new Object[]{ "a", "b", "c"}, null ) + assertThat( StringUtils.join( new Object[]{ "a", "b", "c" }, null ) , is( "abc" ) ); - assertThat( StringUtils.join( new Object[]{ "a", "b", "c"}, "__" ) + assertThat( StringUtils.join( new Object[]{ "a", "b", "c" }, "__" ) , is( "a__b__c" ) ); } @Test( expected = NullPointerException.class ) public void testJoin_Iterator_NPE() { - StringUtils.join( (Iterator) null, null ); + StringUtils.join( (Iterator<?>) null, null ); } @Test @@ -1076,10 +1076,10 @@ public class StringUtilsTest extends Ass assertThat( StringUtils.lastIndexOfAny( "dings", null ) , is( -1 ) ); - assertThat( StringUtils.lastIndexOfAny( "dings bums boms", new String[] {"ms", " b"} ) + assertThat( StringUtils.lastIndexOfAny( "dings bums boms", new String[] { "ms", " b" } ) , is( 13 ) ); - assertThat( StringUtils.lastIndexOfAny( "dings bums boms", new String[] {"nix", "da"} ) + assertThat( StringUtils.lastIndexOfAny( "dings bums boms", new String[] { "nix", "da" } ) , is( -1 ) ); } @@ -1729,10 +1729,10 @@ public class StringUtilsTest extends Ass public void testSplit1() { assertThat( StringUtils.split( "dings" ) - , is( new String[]{"dings"} ) ); + , is( new String[]{ "dings" } ) ); assertThat( StringUtils.split( "dings bums" ) - , is( new String[]{"dings", "bums"} ) ); + , is( new String[]{ "dings", "bums" } ) ); } @Test( expected = NullPointerException.class ) @@ -1751,16 +1751,16 @@ public class StringUtilsTest extends Ass public void testSplit2() { assertThat( StringUtils.split( "dings", null ) - , is( new String[]{"dings"} ) ); + , is( new String[]{ "dings" } ) ); assertThat( StringUtils.split( "dings bums", null ) - , is( new String[]{"dings", "bums"} ) ); + , is( new String[]{ "dings", "bums" } ) ); assertThat( StringUtils.split( "dings", "+" ) - , is( new String[]{"dings"} ) ); + , is( new String[]{ "dings" } ) ); assertThat( StringUtils.split( "dings+bums", "+" ) - , is( new String[]{"dings", "bums"} ) ); + , is( new String[]{ "dings", "bums" } ) ); } @Test( expected = NullPointerException.class ) @@ -1779,25 +1779,25 @@ public class StringUtilsTest extends Ass public void testSplit3() { assertThat( StringUtils.split( "dings", null, 3 ) - , is( new String[]{"dings"} ) ); + , is( new String[]{ "dings" } ) ); assertThat( StringUtils.split( "dings bums", null, 3 ) - , is( new String[]{"dings", "bums"} ) ); + , is( new String[]{ "dings", "bums" } ) ); assertThat( StringUtils.split( "dings", "+", 3 ) - , is( new String[]{"dings"} ) ); + , is( new String[]{ "dings" } ) ); assertThat( StringUtils.split( "dings+bums", "+", 3 ) - , is( new String[]{"dings", "bums"} ) ); + , is( new String[]{ "dings", "bums" } ) ); assertThat( StringUtils.split( "dings+bums", "+", 1 ) - , is( new String[]{"dings+bums"} ) ); + , is( new String[]{ "dings+bums" } ) ); assertThat( StringUtils.split( "dings+bums", "+", 0 ) - , is( new String[]{"dings", "bums"} ) ); + , is( new String[]{ "dings", "bums" } ) ); assertThat( StringUtils.split( "dings+bums", "+", -5 ) - , is( new String[]{"dings", "bums"} ) ); + , is( new String[]{ "dings", "bums" } ) ); } @@ -1840,11 +1840,11 @@ public class StringUtilsTest extends Ass assertThat( StringUtils.stripAll( new String[]{} ) , is( new String[]{} ) ); - assertThat( StringUtils.stripAll( new String[]{"dings"} ) - , is( new String[]{"dings"} ) ); + assertThat( StringUtils.stripAll( new String[]{ "dings" } ) + , is( new String[]{ "dings" } ) ); - assertThat( StringUtils.stripAll( new String[]{" dings ", " bums \t "} ) - , is( new String[]{"dings", "bums"} ) ); + assertThat( StringUtils.stripAll( new String[]{ " dings ", " bums \t " } ) + , is( new String[]{ "dings", "bums" } ) ); } @Test @@ -1856,11 +1856,11 @@ public class StringUtilsTest extends Ass assertThat( StringUtils.stripAll( new String[]{}, " " ) , is( new String[]{} ) ); - assertThat( StringUtils.stripAll( new String[]{"dings"}, " " ) - , is( new String[]{"dings"} ) ); + assertThat( StringUtils.stripAll( new String[]{ "dings" }, " " ) + , is( new String[]{ "dings" } ) ); - assertThat( StringUtils.stripAll( new String[]{" dings ", " bums \t "}, " " ) - , is( new String[]{"dings", "bums \t"} ) ); + assertThat( StringUtils.stripAll( new String[]{ " dings ", " bums \t " }, " " ) + , is( new String[]{ "dings", "bums \t" } ) ); } @Test @@ -1928,7 +1928,7 @@ public class StringUtilsTest extends Ass @Test public void testSubstring2() { - assertThat( StringUtils.substring( null, 0, 2) + assertThat( StringUtils.substring( null, 0, 2 ) , nullValue() ); assertThat( StringUtils.substring( null, -3, 0 ) @@ -2043,7 +2043,7 @@ public class StringUtilsTest extends Ass , is( " " ) ); assertThat( StringUtils.unifyLineSeparators( "dings\nbums\r\ndongs", "\n" ) - , is( "dings\nbums\ndongs") ); + , is( "dings\nbums\ndongs" ) ); } @Test Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/XmlStreamReaderTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/XmlStreamReaderTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/XmlStreamReaderTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/XmlStreamReaderTest.java Mon Oct 15 21:12:04 2012 @@ -103,7 +103,7 @@ public class XmlStreamReaderTest checkXmlStreamReader( text, encoding, encoding, null ); } - private static void checkXmlStreamReader( String text, String encoding, byte[] bom ) + private static void checkXmlStreamReader( String text, String encoding, byte[] bom ) throws IOException { checkXmlStreamReader( text, encoding, encoding, bom ); Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java Mon Oct 15 21:12:04 2012 @@ -19,7 +19,6 @@ package org.apache.maven.shared.utils.cl * under the License. */ - import java.util.Arrays; import java.util.HashMap; import java.util.Locale; @@ -52,7 +51,7 @@ public class CommandLineUtilsTest public void testEnsureCaseSensitivity() throws Exception { - Map<String, String> data = new HashMap<String, String>( ); + Map<String, String> data = new HashMap<String, String>(); data.put( "abz", "cool" ); assertTrue( CommandLineUtils.ensureCaseSensitivity( data, false ).containsKey( "ABZ" ) ); assertTrue( CommandLineUtils.ensureCaseSensitivity( data, true ).containsKey( "abz" ) ); Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/shell/BourneShellTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/shell/BourneShellTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/shell/BourneShellTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/cli/shell/BourneShellTest.java Mon Oct 15 21:12:04 2012 @@ -1,18 +1,22 @@ package org.apache.maven.shared.utils.cli.shell; /* - * 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. + * 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. */ import org.apache.maven.shared.utils.StringUtils; @@ -77,7 +81,7 @@ public class BourneShellTest String[] args = { "\'some arg with spaces\'" }; - List shellCommandLine = sh.getShellCommandLine( args ); + List<String> shellCommandLine = sh.getShellCommandLine( args ); String cli = StringUtils.join( shellCommandLine.iterator(), " " ); System.out.println( cli ); @@ -93,7 +97,7 @@ public class BourneShellTest String[] args = { "some arg with spaces" }; - List shellCommandLine = sh.getShellCommandLine( args ); + List<String> shellCommandLine = sh.getShellCommandLine( args ); String cli = StringUtils.join( shellCommandLine.iterator(), " " ); System.out.println( cli ); @@ -112,7 +116,7 @@ public class BourneShellTest String[] args = { ";some&argwithunix$chars" }; - List shellCommandLine = sh.getShellCommandLine( args ); + List<String> shellCommandLine = sh.getShellCommandLine( args ); String cli = StringUtils.join( shellCommandLine.iterator(), " " ); System.out.println( cli ); @@ -129,7 +133,7 @@ public class BourneShellTest assertEquals( "/bin/sh", lines.get( 0 ) ); assertEquals( "-c", lines.get( 1 ) ); - assertEquals( "chmod --password ';password'", lines.get( 2) ); + assertEquals( "chmod --password ';password'", lines.get( 2 ) ); commandline = new Commandline( newShell() ); commandline.setExecutable( "chmod" ); @@ -150,10 +154,10 @@ public class BourneShellTest lines = commandline.getShell().getShellCommandLine( commandline.getArguments() ); System.out.println( Arrays.asList( lines ) ); - assertEquals( "cmd.exe", lines.get( 0) ); - assertEquals( "/X", lines.get( 1 )); - assertEquals( "/C", lines.get( 2 )); - assertEquals( "\"--password ;password\"", lines.get( 3) ); + assertEquals( "cmd.exe", lines.get( 0 ) ); + assertEquals( "/X", lines.get( 1 ) ); + assertEquals( "/C", lines.get( 2 ) ); + assertEquals( "\"--password ;password\"", lines.get( 3 ) ); } public void testBourneShellQuotingCharacters() @@ -187,11 +191,10 @@ public class BourneShellTest List<String> lines = commandline.getShell().getShellCommandLine( commandline.getArguments() ); System.out.println( lines ); - assertEquals( "/bin/sh", lines.get( 0 )); - assertEquals( "-c", lines.get( 1 )); + assertEquals( "/bin/sh", lines.get( 0 ) ); + assertEquals( "-c", lines.get( 1 ) ); assertEquals( "chmod ' ' '|' '&&' '||' ';' ';;' '&' '()' '<' '<<' '>' '>>' '*' '?' '[' ']' '{' '}' '`'", - lines.get( 2 ) ); - + lines.get( 2 ) ); } } Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestException.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestException.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestException.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestException.java Mon Oct 15 21:12:04 2012 @@ -19,13 +19,12 @@ package org.apache.maven.shared.utils.ex * under the License. */ - - /** * * @author <a href="mailto:strub...@yahoo.de">Mark Struberg</a> */ -public class TestException extends Exception +public class TestException + extends Exception { private Throwable cause; private Throwable specialCause; @@ -40,13 +39,11 @@ public class TestException extends Excep this.cause = cause; } - @SuppressWarnings("UnusedDeclaration") public Throwable getSourceException() { return cause; } - @SuppressWarnings("UnusedDeclaration") public Throwable getSpecialCause() { return specialCause; Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestExceptionWithDetail.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestExceptionWithDetail.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestExceptionWithDetail.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/exceptionutils/TestExceptionWithDetail.java Mon Oct 15 21:12:04 2012 @@ -19,14 +19,13 @@ package org.apache.maven.shared.utils.ex * under the License. */ - - /** * This test exception has a 'detail' field. * * @author <a href="mailto:strub...@yahoo.de">Mark Struberg</a> */ -public class TestExceptionWithDetail extends Exception +public class TestExceptionWithDetail + extends Exception { private Throwable detail; Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java Mon Oct 15 21:12:04 2012 @@ -1,19 +1,22 @@ package org.apache.maven.shared.utils.introspection; /* - * Copyright 2001-2005 The Apache Software Foundation. + * 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 * - * Licensed 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 * - * 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. + * 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. */ import java.util.ArrayList; @@ -39,9 +42,9 @@ public class ReflectionValueExtractorTes super.setUp(); Dependency dependency1 = new Dependency(); - dependency1.setArtifactId("dep1"); + dependency1.setArtifactId( "dep1" ); Dependency dependency2 = new Dependency(); - dependency2.setArtifactId("dep2"); + dependency2.setArtifactId( "dep2" ); project = new Project(); project.setModelVersion( "4.0.0" ); @@ -94,39 +97,39 @@ public class ReflectionValueExtractorTes // ---------------------------------------------------------------------- // List - Dependency dependency = (Dependency)ReflectionValueExtractor.evaluate( "project.dependencies[0]", project ); + Dependency dependency = (Dependency) ReflectionValueExtractor.evaluate( "project.dependencies[0]", project ); Assert.assertNotNull( dependency ); - Assert.assertTrue( "dep1".equals(dependency.getArtifactId()) ); + Assert.assertTrue( "dep1".equals( dependency.getArtifactId() ) ); - String artifactId = (String)ReflectionValueExtractor.evaluate( "project.dependencies[1].artifactId", project ); + String artifactId = (String) ReflectionValueExtractor.evaluate( "project.dependencies[1].artifactId", project ); - Assert.assertTrue( "dep2".equals(artifactId) ); + Assert.assertTrue( "dep2".equals( artifactId ) ); // Array - dependency = (Dependency)ReflectionValueExtractor.evaluate( "project.dependenciesAsArray[0]", project ); + dependency = (Dependency) ReflectionValueExtractor.evaluate( "project.dependenciesAsArray[0]", project ); Assert.assertNotNull( dependency ); - Assert.assertTrue( "dep1".equals(dependency.getArtifactId()) ); + Assert.assertTrue( "dep1".equals( dependency.getArtifactId() ) ); - artifactId = (String)ReflectionValueExtractor.evaluate( "project.dependenciesAsArray[1].artifactId", project ); + artifactId = (String) ReflectionValueExtractor.evaluate( "project.dependenciesAsArray[1].artifactId", project ); - Assert.assertTrue( "dep2".equals(artifactId) ); + Assert.assertTrue( "dep2".equals( artifactId ) ); // Map - dependency = (Dependency)ReflectionValueExtractor.evaluate( "project.dependenciesAsMap(dep1)", project ); + dependency = (Dependency) ReflectionValueExtractor.evaluate( "project.dependenciesAsMap(dep1)", project ); Assert.assertNotNull( dependency ); - Assert.assertTrue( "dep1".equals(dependency.getArtifactId()) ); + Assert.assertTrue( "dep1".equals( dependency.getArtifactId() ) ); - artifactId = (String)ReflectionValueExtractor.evaluate( "project.dependenciesAsMap(dep2).artifactId", project ); + artifactId = (String) ReflectionValueExtractor.evaluate( "project.dependenciesAsMap(dep2).artifactId", project ); - Assert.assertTrue( "dep2".equals(artifactId) ); + Assert.assertTrue( "dep2".equals( artifactId ) ); // ---------------------------------------------------------------------- // Build @@ -246,7 +249,7 @@ public class ReflectionValueExtractorTes public Dependency[] getDependenciesAsArray() { List<Dependency> list = getDependencies(); - return list.toArray(new Dependency[list.size()]); + return list.toArray( new Dependency[list.size()] ); } public Map<String, Dependency> getDependenciesAsMap() @@ -275,7 +278,7 @@ public class ReflectionValueExtractorTes return artifactId; } - public void setArtifactId(String id) + public void setArtifactId( String id ) { artifactId = id; } Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java Mon Oct 15 21:12:04 2012 @@ -19,7 +19,6 @@ package org.apache.maven.shared.utils.io * under the License. */ - import org.apache.maven.shared.utils.testhelpers.FileTestHelper; import org.junit.Ignore; import org.junit.Rule; @@ -40,9 +39,8 @@ public class DirectoryScannerTest @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); - - - private void createTestData() throws IOException + private void createTestData() + throws IOException { File rootDir = tempFolder.getRoot(); File folder1 = new File( rootDir, "folder1" ); @@ -58,11 +56,11 @@ public class DirectoryScannerTest File folder2 = new File( folder1, "ignorefolder" ); folder2.mkdirs(); FileTestHelper.generateTestFile( new File( folder2, "file7.txt" ), 17 ); - } @Test - public void testSimpleScan() throws Exception + public void testSimpleScan() + throws Exception { createTestData(); @@ -89,7 +87,8 @@ public class DirectoryScannerTest } @Test - public void testSimpleIncludes() throws Exception + public void testSimpleIncludes() + throws Exception { createTestData(); @@ -116,7 +115,8 @@ public class DirectoryScannerTest } @Test - public void testSimpleExcludes() throws Exception + public void testSimpleExcludes() + throws Exception { createTestData(); @@ -145,7 +145,7 @@ public class DirectoryScannerTest public void testIsSymLin() throws IOException { - File file = new File( "."); + File file = new File( "." ); DirectoryScanner ds = new DirectoryScanner(); ds.isSymbolicLink( file, "abc" ); } @@ -196,7 +196,8 @@ public class DirectoryScannerTest checkFiles( "expectedExcludedFiles", expectedExcludedFiles, ds.getExcludedFiles() ); checkFiles( "expectedExcludedDirectories", expectedExcludedDirectories, ds.getExcludedDirectories() ); - checkFiles( "visitedFiles", expectedIncludedFiles, scanConductor.visitedFiles.toArray(new String[scanConductor.visitedFiles.size()])); + checkFiles( "visitedFiles", expectedIncludedFiles, + scanConductor.visitedFiles.toArray( new String[scanConductor.visitedFiles.size()] ) ); } /** @@ -217,12 +218,13 @@ public class DirectoryScannerTest for ( int i = 0; i < resolvedFiles.length; i++ ) { - Assert.assertEquals( msg, expectedFiles[ i ], resolvedFiles[ i ].replace( "\\", "/" ) ); + Assert.assertEquals( msg, expectedFiles[i], resolvedFiles[i].replace( "\\", "/" ) ); } } } - private static class TestScanConductor implements ScanConductor + private static class TestScanConductor + implements ScanConductor { final List<String> visitedFiles = new ArrayList<String>(); @@ -246,8 +248,8 @@ public class DirectoryScannerTest } } - - private void removeAndAddSomeFiles() throws IOException + private void removeAndAddSomeFiles() + throws IOException { File rootDir = tempFolder.getRoot(); File file2 = new File( rootDir, "file2.txt" ); @@ -260,7 +262,8 @@ public class DirectoryScannerTest } @Test - public void testScanDiff() throws Exception + public void testScanDiff() + throws Exception { createTestData(); @@ -284,14 +287,14 @@ public class DirectoryScannerTest Assert.assertNotNull( addedFiles ); Assert.assertNotNull( removedFiles ); Assert.assertEquals( 1, addedFiles.length ); - Assert.assertEquals(2, removedFiles.length ); + Assert.assertEquals( 2, removedFiles.length ); } - - @Ignore("Enable this test to run performance checks") @Test - public void performanceTest() throws Exception { + public void performanceTest() + throws Exception + { File rootFolder = tempFolder.getRoot(); @@ -317,7 +320,7 @@ public class DirectoryScannerTest long endTime = System.nanoTime(); long durationEmptyRun = endTime - startTime; - System.out.println( "durationEmptyRun [ns]: " + durationEmptyRun); + System.out.println( "durationEmptyRun [ns]: " + durationEmptyRun ); startTime = System.nanoTime(); for ( int i = 1; i < cycles; i++ ) @@ -341,11 +344,11 @@ public class DirectoryScannerTest endTime = System.nanoTime(); long durationWithSnapshotScanner = endTime - startTime; - System.out.println( "durationWithSnapshotScanner [ns]: " + durationWithSnapshotScanner); + System.out.println( "durationWithSnapshotScanner [ns]: " + durationWithSnapshotScanner ); long dirScannerOverhead = durationWithSnapshotScanner - durationEmptyRun; - System.out.println( "Overhead for n cycles [ns]: " + dirScannerOverhead); + System.out.println( "Overhead for n cycles [ns]: " + dirScannerOverhead ); } } Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryWalkerTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryWalkerTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryWalkerTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/DirectoryWalkerTest.java Mon Oct 15 21:12:04 2012 @@ -1,19 +1,22 @@ package org.apache.maven.shared.utils.io; /* - * Copyright 2001-2006 The Apache Software Foundation. + * 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 * - * Licensed 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 * - * 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. + * 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. */ import java.io.File; @@ -30,7 +33,7 @@ public class DirectoryWalkerTest walker.addSCMExcludes(); - walker.setBaseDir( new File("src/test/resources/directorywalker") ); + walker.setBaseDir( new File("src/test/resources/directorywalker" ) ); WalkCollector collector = new WalkCollector(); walker.addDirectoryWalkListener( collector ); Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/FileUtilsTest.java Mon Oct 15 21:12:04 2012 @@ -19,7 +19,6 @@ package org.apache.maven.shared.utils.io * under the License. */ - import org.apache.maven.shared.utils.testhelpers.FileTestHelper; import org.hamcrest.CoreMatchers; import org.junit.Before; @@ -53,7 +52,6 @@ import static org.junit.matchers.JUnitMa * @version $Id: FileUtilsTestCase.java 1081025 2011-03-13 00:45:10Z niallp $ * @see FileUtils */ -@SuppressWarnings({"ResultOfMethodCallIgnored", "ConstantConditions"}) public class FileUtilsTest { @@ -112,7 +110,7 @@ public class FileUtilsTest { throw new IOException( "Cannot create file " + file + " as the parent directory does not exist" ); } - BufferedOutputStream output = new BufferedOutputStream( new java.io.FileOutputStream( file ) ); + BufferedOutputStream output = new BufferedOutputStream( new FileOutputStream( file ) ); try { FileTestHelper.generateTestData( output, size ); @@ -184,8 +182,8 @@ public class FileUtilsTest public void toFile3() throws Exception { - assertThat( FileUtils.toFile(null), CoreMatchers.<File>nullValue() ); - assertThat( FileUtils.toFile( new URL( "http://jakarta.apache.org" ) ), CoreMatchers.<File>nullValue() ); + assertThat( FileUtils.toFile( null ), CoreMatchers.<File> nullValue() ); + assertThat( FileUtils.toFile( new URL( "http://jakarta.apache.org" ) ), CoreMatchers.<File> nullValue() ); } @Test( expected = NumberFormatException.class ) Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/Java7SupportTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/Java7SupportTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/Java7SupportTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/Java7SupportTest.java Mon Oct 15 21:12:04 2012 @@ -1,11 +1,5 @@ package org.apache.maven.shared.utils.io; -import java.io.File; - -import org.junit.Test; - -import static org.junit.Assert.assertFalse; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -25,6 +19,12 @@ import static org.junit.Assert.assertFal * under the License. */ +import java.io.File; + +import org.junit.Test; + +import static org.junit.Assert.assertFalse; + public class Java7SupportTest { @Test Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternTest.java Mon Oct 15 21:12:04 2012 @@ -1,4 +1,5 @@ package org.apache.maven.shared.utils.io; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -21,17 +22,17 @@ package org.apache.maven.shared.utils.io import org.junit.Test; import static org.junit.Assert.*; - /** * @author Kristian Rosenvold */ -public class MatchPatternTest { +public class MatchPatternTest +{ @Test public void matchPath() - throws Exception + throws Exception { MatchPattern mp = MatchPattern.fromString( "ABC*" ); - assertTrue(mp.matchPath( "ABCD", true )); + assertTrue( mp.matchPath( "ABCD", true ) ); } } Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternsTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternsTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternsTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/MatchPatternsTest.java Mon Oct 15 21:12:04 2012 @@ -1,4 +1,5 @@ package org.apache.maven.shared.utils.io; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,6 +18,7 @@ package org.apache.maven.shared.utils.io * specific language governing permissions and limitations * under the License. */ + import org.junit.Test; import static org.junit.Assert.*; @@ -24,15 +26,15 @@ import static org.junit.Assert.*; /** * @author Kristian Rosenvold */ -public class MatchPatternsTest { +public class MatchPatternsTest +{ @Test public void matches() - throws Exception + throws Exception { MatchPatterns from = MatchPatterns.from( "ABC**", "CDE**" ); assertTrue( from.matches( "ABCDE", true ) ); assertTrue( from.matches( "CDEF", true ) ); assertFalse( from.matches( "XYZ", true ) ); - } } Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/SelectorUtilsTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/SelectorUtilsTest.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/SelectorUtilsTest.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/SelectorUtilsTest.java Mon Oct 15 21:12:04 2012 @@ -25,7 +25,6 @@ import java.io.File; import org.junit.Test; - /** * Test the {@link SelectorUtils} class. * @@ -33,7 +32,7 @@ import org.junit.Test; public class SelectorUtilsTest { - @Test(expected=NullPointerException.class) + @Test( expected = NullPointerException.class ) public void testMatchPatternStart() { SelectorUtils.matchPatternStart( null, null ); @@ -42,17 +41,18 @@ public class SelectorUtilsTest @Test public void testEmptyStrings() { - assertTrue(SelectorUtils.matchPatternStart("", "")); + assertTrue( SelectorUtils.matchPatternStart( "", "" ) ); } @Test - public void testRegexPrefix() throws Exception + public void testRegexPrefix() + throws Exception { - assertEquals(true, SelectorUtils.matchPatternStart(SelectorUtils.REGEX_HANDLER_PREFIX + File.separator + - "aaa" + SelectorUtils.PATTERN_HANDLER_SUFFIX, "")); + assertEquals( true, + SelectorUtils.matchPatternStart( SelectorUtils.REGEX_HANDLER_PREFIX + File.separator + "aaa" + + SelectorUtils.PATTERN_HANDLER_SUFFIX, "" ) ); } - @Test public void testAntPatternStrings() { @@ -68,20 +68,18 @@ public class SelectorUtilsTest } - private void assertAntDoesNotMatch(String pattern, String target) + private void assertAntDoesNotMatch( String pattern, String target ) { - assertEquals(false, SelectorUtils.matchPatternStart(wrapWithAntHandler(pattern), target)); + assertEquals( false, SelectorUtils.matchPatternStart( wrapWithAntHandler( pattern ), target ) ); } - private void assertAntMatch(String pattern, String target) + private void assertAntMatch( String pattern, String target ) { - assertEquals(true, SelectorUtils.matchPatternStart(wrapWithAntHandler(pattern), target)); + assertEquals( true, SelectorUtils.matchPatternStart( wrapWithAntHandler( pattern ), target ) ); } - - private String wrapWithAntHandler(String val) + private String wrapWithAntHandler( String val ) { return SelectorUtils.ANT_HANDLER_PREFIX + val + SelectorUtils.PATTERN_HANDLER_SUFFIX; } - } Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTestHelper.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTestHelper.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTestHelper.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTestHelper.java Mon Oct 15 21:12:04 2012 @@ -18,7 +18,6 @@ package org.apache.maven.shared.utils.re * under the License. */ - /** * * @author stephenc @@ -32,7 +31,6 @@ class ReflectorTestHelper private ReflectorTestHelper() { - } ReflectorTestHelper( Boolean throwSomething ) @@ -61,7 +59,7 @@ class ReflectorTestHelper private static ReflectorTestHelper getInstance() { - return new ReflectorTestHelper( ); + return new ReflectorTestHelper(); } static ReflectorTestHelper getInstance( Boolean throwSomething ) @@ -70,7 +68,7 @@ class ReflectorTestHelper { throw new HelperException( "Something" ); } - return new ReflectorTestHelper( ); + return new ReflectorTestHelper(); } protected static ReflectorTestHelper getInstance( Integer throwCount ) @@ -79,7 +77,7 @@ class ReflectorTestHelper { throw new HelperException( "Something" ); } - return new ReflectorTestHelper( ); + return new ReflectorTestHelper(); } public static ReflectorTestHelper getInstance( String throwMessage ) @@ -88,15 +86,17 @@ class ReflectorTestHelper { throw new HelperException( throwMessage ); } - return new ReflectorTestHelper( ); + return new ReflectorTestHelper(); } - public ReflectorTestHelper getInstance(String aString, Boolean aBoolean) { - return new ReflectorTestHelper( ); + public ReflectorTestHelper getInstance( String aString, Boolean aBoolean ) + { + return new ReflectorTestHelper(); } public static class HelperException - extends RuntimeException { + extends RuntimeException + { public HelperException() { super(); //To change body of overridden methods use File | Settings | File Templates. Modified: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/testhelpers/FileTestHelper.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/testhelpers/FileTestHelper.java?rev=1398527&r1=1398526&r2=1398527&view=diff ============================================================================== --- maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/testhelpers/FileTestHelper.java (original) +++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/testhelpers/FileTestHelper.java Mon Oct 15 21:12:04 2012 @@ -19,7 +19,6 @@ package org.apache.maven.shared.utils.te * under the License. */ - import org.apache.maven.shared.utils.io.FileUtils; import org.apache.maven.shared.utils.io.IOUtil; import org.junit.rules.TemporaryFolder; @@ -38,7 +37,7 @@ public final class FileTestHelper } public static void generateTestData( OutputStream out, long size ) - throws IOException + throws IOException { for ( int i = 0; i < size; i++ ) { @@ -47,7 +46,8 @@ public final class FileTestHelper } } - public static void generateTestFile( File testfile, int size ) throws IOException + public static void generateTestFile( File testfile, int size ) + throws IOException { if ( testfile.exists() ) { @@ -64,7 +64,7 @@ public final class FileTestHelper public static void createLineBasedFile( File file, String[] data ) - throws IOException + throws IOException { if ( file.getParentFile() != null && !file.getParentFile().exists() ) { @@ -73,8 +73,9 @@ public final class FileTestHelper PrintWriter output = new PrintWriter( new OutputStreamWriter( new FileOutputStream( file ), "UTF-8" ) ); try { - for (String aData : data) { - output.println(aData); + for ( String aData : data ) + { + output.println( aData ); } } finally