Repository: commons-io Updated Branches: refs/heads/master d00ff3a70 -> a768fe9aa
http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/input/TailerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/input/TailerTest.java b/src/test/java/org/apache/commons/io/input/TailerTest.java index db50efa..a39289e 100644 --- a/src/test/java/org/apache/commons/io/input/TailerTest.java +++ b/src/test/java/org/apache/commons/io/input/TailerTest.java @@ -144,8 +144,8 @@ public class TailerTest extends FileBasedTestCase { final String expected = lines.get(i); final String actual = tailerlines.get(i); if (!expected.equals(actual)) { - fail("Line: " + i - + "\nExp: (" + expected.length() + ") " + expected + fail("Line: " + i + + "\nExp: (" + expected.length() + ") " + expected + "\nAct: (" + actual.length() + ") "+ actual); } } http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/input/TeeInputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/input/TeeInputStreamTest.java b/src/test/java/org/apache/commons/io/input/TeeInputStreamTest.java index 8d16ff9..f853d24 100644 --- a/src/test/java/org/apache/commons/io/input/TeeInputStreamTest.java +++ b/src/test/java/org/apache/commons/io/input/TeeInputStreamTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReaderUtilitiesCompatibilityTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReaderUtilitiesCompatibilityTest.java b/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReaderUtilitiesCompatibilityTest.java index d1c7d10..63c7b16 100644 --- a/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReaderUtilitiesCompatibilityTest.java +++ b/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReaderUtilitiesCompatibilityTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java b/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java index 9ec9869..d7ec41c 100644 --- a/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java +++ b/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java @@ -114,12 +114,12 @@ public abstract class AbstractMonitorTestCase { * @param fileChange expected number of files changed * @param fileDelete expected number of files deleted */ - protected void checkCollectionSizes(String label, - final int dirCreate, - final int dirChange, - final int dirDelete, - final int fileCreate, - final int fileChange, + protected void checkCollectionSizes(String label, + final int dirCreate, + final int dirChange, + final int dirDelete, + final int fileCreate, + final int fileChange, final int fileDelete) { label = label + "[" + listener.getCreatedDirectories().size() + " " + listener.getChangedDirectories().size() + http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/monitor/CollectionFileListener.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/monitor/CollectionFileListener.java b/src/test/java/org/apache/commons/io/monitor/CollectionFileListener.java index e8c045b..773409c 100644 --- a/src/test/java/org/apache/commons/io/monitor/CollectionFileListener.java +++ b/src/test/java/org/apache/commons/io/monitor/CollectionFileListener.java @@ -125,7 +125,7 @@ public class CollectionFileListener implements FileAlterationListener, Serializa /** * Directory created Event. - * + * * @param directory The directory created */ @Override @@ -135,7 +135,7 @@ public class CollectionFileListener implements FileAlterationListener, Serializa /** * Directory changed Event. - * + * * @param directory The directory changed */ @Override @@ -145,7 +145,7 @@ public class CollectionFileListener implements FileAlterationListener, Serializa /** * Directory deleted Event. - * + * * @param directory The directory deleted */ @Override @@ -155,7 +155,7 @@ public class CollectionFileListener implements FileAlterationListener, Serializa /** * File created Event. - * + * * @param file The file created */ @Override @@ -165,7 +165,7 @@ public class CollectionFileListener implements FileAlterationListener, Serializa /** * File changed Event. - * + * * @param file The file changed */ @Override @@ -175,7 +175,7 @@ public class CollectionFileListener implements FileAlterationListener, Serializa /** * File deleted Event. - * + * * @param file The file deleted */ @Override http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java b/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java index 0a3fa34..2faedf1 100644 --- a/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java +++ b/src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java @@ -90,7 +90,7 @@ public class FileAlterationMonitorTestCase extends AbstractMonitorTestCase { /** * Test checkAndNotify() method - * @throws Exception + * @throws Exception */ @Test public void testMonitor() throws Exception { @@ -138,7 +138,7 @@ public class FileAlterationMonitorTestCase extends AbstractMonitorTestCase { /** * Test using a thread factory. - * @throws Exception + * @throws Exception */ @Test public void testThreadFactory() throws Exception { http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java b/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java index 5e986a2..6840a6e 100644 --- a/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java +++ b/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java @@ -89,7 +89,7 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase { /** * Test checkAndNotify() method - * @throws Exception + * @throws Exception */ @Test public void testDirectory() throws Exception { @@ -148,7 +148,7 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase { /** * Test checkAndNotify() creating - * @throws Exception + * @throws Exception */ @Test public void testFileCreate() throws Exception { @@ -208,7 +208,7 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase { /** * Test checkAndNotify() creating - * @throws Exception + * @throws Exception */ @Test public void testFileUpdate() throws Exception { @@ -265,7 +265,7 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase { /** * Test checkAndNotify() deleting - * @throws Exception + * @throws Exception */ @Test public void testFileDelete() throws Exception { http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java index b91d2ed..12b0188 100644 --- a/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java index da618a0..8b6a547 100644 --- a/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java index dedba25..fe4af3d 100644 --- a/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. @@ -29,7 +29,7 @@ public class ClosedOutputStreamTest { /** * Test the <code>write(b)</code> method. - * @throws Exception + * @throws Exception */ @Test public void testRead() throws Exception { http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java index d8ba18e..8804efe 100644 --- a/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java index adb58b9..7f3bd78 100644 --- a/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java @@ -60,7 +60,7 @@ public class DeferredFileOutputStreamTest * The test data as a byte array, derived from the string. */ private final byte[] testBytes = testString.getBytes(); - + private final int initialBufferSize; /** @@ -344,7 +344,7 @@ public class DeferredFileOutputStreamTest /** * Test specifying a temporary file and the threshold is reached. - * @throws Exception + * @throws Exception */ @Test public void testTempFileError() throws Exception { http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java index 851a319..d792302 100644 --- a/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. @@ -23,8 +23,8 @@ import java.io.IOException; /** - * Really not a lot to do here, but checking that no - * Exceptions are thrown. + * Really not a lot to do here, but checking that no + * Exceptions are thrown. * */ http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/NullWriterTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/NullWriterTest.java b/src/test/java/org/apache/commons/io/output/NullWriterTest.java index 36775e4..8f4a2b4 100644 --- a/src/test/java/org/apache/commons/io/output/NullWriterTest.java +++ b/src/test/java/org/apache/commons/io/output/NullWriterTest.java @@ -5,9 +5,9 @@ * 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. @@ -19,8 +19,8 @@ package org.apache.commons.io.output; import org.junit.Test; /** - * Really not a lot to do here, but checking that no - * Exceptions are thrown. + * Really not a lot to do here, but checking that no + * Exceptions are thrown. * */ public class NullWriterTest { http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java index fdd9c0d..9e44532 100644 --- a/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java b/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java index bdf1019..405b151 100644 --- a/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java +++ b/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java index d1af805..47b44e2 100644 --- a/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. @@ -36,7 +36,7 @@ public class TaggedOutputStreamTest { @Test public void testNormalStream() { try { - final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); final OutputStream stream = new TaggedOutputStream(buffer); stream.write('a'); stream.write(new byte[] { 'b' }); http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java index 3df755c..89a57d7 100644 --- a/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java +++ b/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/serialization/ClosingBase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/serialization/ClosingBase.java b/src/test/java/org/apache/commons/io/serialization/ClosingBase.java index 6e05963..33bbd32 100644 --- a/src/test/java/org/apache/commons/io/serialization/ClosingBase.java +++ b/src/test/java/org/apache/commons/io/serialization/ClosingBase.java @@ -26,7 +26,7 @@ import java.util.List; import org.junit.After; import org.junit.Before; -/** Test base class that keeps track of Closeable objects +/** Test base class that keeps track of Closeable objects * and cleans them up. */ public class ClosingBase { @@ -36,7 +36,7 @@ public class ClosingBase { toClose.add(t); return t; } - + @Before public void setup() throws IOException { toClose.clear(); http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/serialization/MockSerializedClass.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/serialization/MockSerializedClass.java b/src/test/java/org/apache/commons/io/serialization/MockSerializedClass.java index 55ca45b..cd0d8a4 100644 --- a/src/test/java/org/apache/commons/io/serialization/MockSerializedClass.java +++ b/src/test/java/org/apache/commons/io/serialization/MockSerializedClass.java @@ -22,9 +22,9 @@ import java.io.Serializable; public class MockSerializedClass implements Serializable { private static final long serialVersionUID = 2139985988735372175L; - + private final String str; - + MockSerializedClass(String str) { this.str = str; } http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/serialization/MoreComplexObject.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/serialization/MoreComplexObject.java b/src/test/java/org/apache/commons/io/serialization/MoreComplexObject.java index 1401f2d..201b52d 100644 --- a/src/test/java/org/apache/commons/io/serialization/MoreComplexObject.java +++ b/src/test/java/org/apache/commons/io/serialization/MoreComplexObject.java @@ -31,7 +31,7 @@ import java.util.UUID; */ public class MoreComplexObject implements Serializable { private static final long serialVersionUID = -5187124661539240729L; - + private final Random random = new Random(System.currentTimeMillis()); private final String string = UUID.randomUUID().toString(); private final Integer integer = random.nextInt(); @@ -39,7 +39,7 @@ public class MoreComplexObject implements Serializable { private final long pLong = random.nextLong(); private final Integer [] intArray = { random.nextInt(), random.nextInt() }; private final List<Boolean> boolList = new ArrayList<>(); - + MoreComplexObject() { for(int i=0 ; i < 5; i++) { boolList.add(random.nextBoolean()); http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java b/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java index 1ba7129..941a9c0 100644 --- a/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java +++ b/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java @@ -32,15 +32,15 @@ import java.util.Random; import org.junit.Before; import org.junit.Test; -/** This is more an example than a test - deserialize our {@link MoreComplexObject} - * to verify which settings it requires, as the object uses a number of primitive +/** This is more an example than a test - deserialize our {@link MoreComplexObject} + * to verify which settings it requires, as the object uses a number of primitive * and java.* member objects. */ public class MoreComplexObjectTest extends ClosingBase { - + private InputStream inputStream; private MoreComplexObject original; - + @Override @Before public void setup() throws IOException { @@ -50,12 +50,12 @@ public class MoreComplexObjectTest extends ClosingBase { oos.writeObject(original); inputStream = willClose(new ByteArrayInputStream(bos.toByteArray())); } - + private void assertSerialization(ObjectInputStream ois) throws ClassNotFoundException, IOException { final MoreComplexObject copy = (MoreComplexObject) (ois.readObject()); assertEquals("Expecting same data after deserializing", original.toString(), copy.toString()); } - + /** Trusting java.lang.* and the array variants of that means we have * to define a number of accept classes explicitly. Quite safe but * might become a bit verbose. @@ -68,7 +68,7 @@ public class MoreComplexObjectTest extends ClosingBase { .accept("java.lang.*","[Ljava.lang.*") )); } - + /** Trusting java.* is probably reasonable and avoids having to be too * detailed in the accepts. */ @@ -80,10 +80,10 @@ public class MoreComplexObjectTest extends ClosingBase { .accept("java.*","[Ljava.*") )); } - + /** Here we accept everything but reject specific classes, using a pure * blacklist mode. - * + * * That's not as safe as it's hard to get an exhaustive blacklist, but * might be ok in controlled environments. */ http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/serialization/RegexpClassNameMatcherTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/serialization/RegexpClassNameMatcherTest.java b/src/test/java/org/apache/commons/io/serialization/RegexpClassNameMatcherTest.java index 4225aba..d54542f 100644 --- a/src/test/java/org/apache/commons/io/serialization/RegexpClassNameMatcherTest.java +++ b/src/test/java/org/apache/commons/io/serialization/RegexpClassNameMatcherTest.java @@ -53,7 +53,7 @@ public class RegexpClassNameMatcherTest { public void testNullStringPattern() { new RegexpClassNameMatcher((String)null); } - + @Test(expected=IllegalArgumentException.class) public void testNullPatternPattern() { new RegexpClassNameMatcher((Pattern)null); http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java b/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java index f2e109c..f2c3429 100644 --- a/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java +++ b/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java @@ -186,7 +186,7 @@ public class ValidatingObjectInputStreamTest extends ClosingBase { .reject(MockSerializedClass.class, Integer.class) ); } - + @Test(expected = InvalidClassException.class) public void rejectPrecedence() throws Exception { assertSerialization( @@ -195,7 +195,7 @@ public class ValidatingObjectInputStreamTest extends ClosingBase { .reject(MockSerializedClass.class, Integer.class) ); } - + @Test(expected = InvalidClassException.class) public void rejectOnly() throws Exception { assertSerialization( @@ -203,7 +203,7 @@ public class ValidatingObjectInputStreamTest extends ClosingBase { .reject(Integer.class) ); } - + @Test(expected = RuntimeException.class) public void customInvalidMethod() throws Exception { class CustomVOIS extends ValidatingObjectInputStream { @@ -216,7 +216,7 @@ public class ValidatingObjectInputStreamTest extends ClosingBase { throw new RuntimeException("Custom exception"); } }; - + assertSerialization( willClose(new CustomVOIS(testStream)) .reject(Integer.class) http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java b/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java index 0e940dc..4e3a6ce 100644 --- a/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java +++ b/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java @@ -5,9 +5,9 @@ * 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. http://git-wip-us.apache.org/repos/asf/commons-io/blob/a768fe9a/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java b/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java index 7c73d0d..0fa5c32 100644 --- a/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java +++ b/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java @@ -5,9 +5,9 @@ * 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.