Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127
This commit is contained in:
committed by
Chris Beams
parent
44a474a014
commit
1762157ad1
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2002-2006 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@@ -33,7 +33,7 @@ public abstract class AbstractControlFlowTests extends TestCase {
|
||||
new Two().testing();
|
||||
new Three().test();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public void testUnderPackage() {
|
||||
ControlFlow cflow = new ControlFlow();
|
||||
@@ -43,7 +43,7 @@ public abstract class AbstractControlFlowTests extends TestCase {
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public class One {
|
||||
|
||||
public void test() {
|
||||
|
||||
@@ -882,7 +882,7 @@ public class BridgeMethodResolverTests {
|
||||
}
|
||||
|
||||
|
||||
public class GenericHibernateRepository<T, ID extends Serializable>
|
||||
public class GenericHibernateRepository<T, ID extends Serializable>
|
||||
implements ConvenientGenericRepository<T, ID> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ConstantsTests extends TestCase {
|
||||
Constants c = new Constants(A.class);
|
||||
assertEquals(A.class.getName(), c.getClassName());
|
||||
assertEquals(9, c.getSize());
|
||||
|
||||
|
||||
assertEquals(c.asNumber("DOG").intValue(), A.DOG);
|
||||
assertEquals(c.asNumber("dog").intValue(), A.DOG);
|
||||
assertEquals(c.asNumber("cat").intValue(), A.CAT);
|
||||
|
||||
@@ -22,7 +22,7 @@ package org.springframework.core;
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
public class DefaultControlFlowTests extends AbstractControlFlowTests {
|
||||
|
||||
|
||||
/**
|
||||
* Necessary only because Eclipse won't run test suite unless
|
||||
* it declares some methods as well as inherited methods.
|
||||
|
||||
@@ -22,7 +22,7 @@ package org.springframework.core;
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
public class Jdk14ControlFlowTests extends AbstractControlFlowTests {
|
||||
|
||||
|
||||
/**
|
||||
* Necessary only because Eclipse won't run test suite unless it declares
|
||||
* some methods as well as inherited methods
|
||||
|
||||
@@ -189,7 +189,7 @@ public class LocalVariableTableParameterNameDiscovererTests extends TestCase {
|
||||
m = clazz.getMethod("getDate", null);
|
||||
names = discoverer.getParameterNames(m);
|
||||
assertEquals(0, names.length);
|
||||
|
||||
|
||||
//System.in.read();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@@ -70,7 +70,7 @@ public class NestedExceptionTests extends TestCase {
|
||||
NestedCheckedException nex = new NestedCheckedException(mesg) {};
|
||||
assertNull(nex.getCause());
|
||||
assertEquals(nex.getMessage(), mesg);
|
||||
|
||||
|
||||
// Check printStackTrace
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
PrintWriter pw = new PrintWriter(baos);
|
||||
@@ -79,7 +79,7 @@ public class NestedExceptionTests extends TestCase {
|
||||
String stackTrace = new String(baos.toByteArray());
|
||||
assertFalse(stackTrace.indexOf(mesg) == -1);
|
||||
}
|
||||
|
||||
|
||||
public void testNestedCheckedExceptionWithRootCause() {
|
||||
String myMessage = "mesg for this exception";
|
||||
String rootCauseMesg = "this is the obscure message of the root cause";
|
||||
@@ -89,7 +89,7 @@ public class NestedExceptionTests extends TestCase {
|
||||
Assert.assertEquals(nex.getCause(), rootCause);
|
||||
assertTrue(nex.getMessage().indexOf(myMessage) != -1);
|
||||
assertTrue(nex.getMessage().indexOf(rootCauseMesg) != -1);
|
||||
|
||||
|
||||
// check PrintStackTrace
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
PrintWriter pw = new PrintWriter(baos);
|
||||
|
||||
@@ -25,11 +25,11 @@ import junit.framework.TestCase;
|
||||
import org.springframework.beans.TestBean;
|
||||
|
||||
public class PrioritizedParameterNameDiscovererTests extends TestCase {
|
||||
|
||||
|
||||
private static final String[] FOO_BAR = new String[] { "foo", "bar" };
|
||||
|
||||
|
||||
private static final String[] SOMETHING_ELSE = new String[] { "something", "else" };
|
||||
|
||||
|
||||
ParameterNameDiscoverer returnsFooBar = new ParameterNameDiscoverer() {
|
||||
public String[] getParameterNames(Method m) {
|
||||
return FOO_BAR;
|
||||
@@ -38,7 +38,7 @@ public class PrioritizedParameterNameDiscovererTests extends TestCase {
|
||||
return FOO_BAR;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ParameterNameDiscoverer returnsSomethingElse = new ParameterNameDiscoverer() {
|
||||
public String[] getParameterNames(Method m) {
|
||||
return SOMETHING_ELSE;
|
||||
@@ -47,20 +47,20 @@ public class PrioritizedParameterNameDiscovererTests extends TestCase {
|
||||
return SOMETHING_ELSE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private final Method anyMethod;
|
||||
private final Class anyClass = Object.class;
|
||||
|
||||
|
||||
public PrioritizedParameterNameDiscovererTests() throws SecurityException, NoSuchMethodException {
|
||||
anyMethod = TestBean.class.getMethod("getAge", (Class[]) null);
|
||||
}
|
||||
|
||||
|
||||
public void testNoParametersDiscoverers() {
|
||||
ParameterNameDiscoverer pnd = new PrioritizedParameterNameDiscoverer();
|
||||
assertNull(pnd.getParameterNames(anyMethod));
|
||||
assertNull(pnd.getParameterNames((Constructor) null));
|
||||
}
|
||||
|
||||
|
||||
public void testOrderedParameterDiscoverers1() {
|
||||
PrioritizedParameterNameDiscoverer pnd = new PrioritizedParameterNameDiscoverer();
|
||||
pnd.addDiscoverer(returnsFooBar);
|
||||
@@ -70,7 +70,7 @@ public class PrioritizedParameterNameDiscovererTests extends TestCase {
|
||||
assertTrue(Arrays.equals(FOO_BAR, pnd.getParameterNames(anyMethod)));
|
||||
assertTrue(Arrays.equals(FOO_BAR, pnd.getParameterNames((Constructor) null)));
|
||||
}
|
||||
|
||||
|
||||
public void testOrderedParameterDiscoverers2() {
|
||||
PrioritizedParameterNameDiscoverer pnd = new PrioritizedParameterNameDiscoverer();
|
||||
pnd.addDiscoverer(returnsSomethingElse);
|
||||
|
||||
@@ -363,5 +363,5 @@ public class AnnotationUtilsTests {
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@interface Transactional {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link AbstractPropertySource} implementations.
|
||||
*
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
*/
|
||||
|
||||
@@ -137,14 +137,14 @@ public class PathMatchingResourcePatternResolverTests {
|
||||
// List expectedNames = new LinkedList(Arrays.asList(fileNames));
|
||||
// Collections.sort(sortedActualNames);
|
||||
// Collections.sort(expectedNames);
|
||||
//
|
||||
//
|
||||
// System.out.println("-----------");
|
||||
// System.out.println("Expected: " + StringUtils.collectionToCommaDelimitedString(expectedNames));
|
||||
// System.out.println("Actual: " + StringUtils.collectionToCommaDelimitedString(sortedActualNames));
|
||||
// for (int i = 0; i < resources.length; i++) {
|
||||
// System.out.println(resources[i]);
|
||||
// }
|
||||
|
||||
|
||||
assertEquals("Correct number of files found", fileNames.length, resources.length);
|
||||
for (int i = 0; i < resources.length; i++) {
|
||||
Resource resource = resources[i];
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ResourceArrayPropertyEditorTests {
|
||||
|
||||
@Test
|
||||
public void testPatternResource() throws Exception {
|
||||
// N.B. this will sometimes fail if you use classpath: instead of classpath*:.
|
||||
// N.B. this will sometimes fail if you use classpath: instead of classpath*:.
|
||||
// The result depends on the classpath - if test-classes are segregated from classes
|
||||
// and they come first on the classpath (like in Maven) then it breaks, if classes
|
||||
// comes first (like in Spring Build) then it is OK.
|
||||
|
||||
@@ -214,7 +214,7 @@ public class AnnotationMetadataTests {
|
||||
})
|
||||
@SuppressWarnings({"serial", "unused"})
|
||||
private static class AnnotatedComponent implements Serializable {
|
||||
|
||||
|
||||
@TestAutowired
|
||||
public void doWork(@TestQualifier("myColor") java.awt.Color color) {
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class AssignableTypeFilterTests extends TestCase {
|
||||
assertFalse(notMatchingFilter.match(metadataReader, metadataReaderFactory));
|
||||
assertTrue(matchingFilter.match(metadataReader, metadataReaderFactory));
|
||||
}
|
||||
|
||||
|
||||
public void testInterfaceMatch() throws Exception {
|
||||
MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
|
||||
String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTests$TestInterfaceImpl";
|
||||
@@ -49,7 +49,7 @@ public class AssignableTypeFilterTests extends TestCase {
|
||||
assertTrue(filter.match(metadataReader, metadataReaderFactory));
|
||||
ClassloadingAssertions.assertClassNotLoaded(classUnderTest);
|
||||
}
|
||||
|
||||
|
||||
public void testSuperClassMatch() throws Exception {
|
||||
MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
|
||||
String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTests$SomeDaoLikeImpl";
|
||||
@@ -59,7 +59,7 @@ public class AssignableTypeFilterTests extends TestCase {
|
||||
assertTrue(filter.match(metadataReader, metadataReaderFactory));
|
||||
ClassloadingAssertions.assertClassNotLoaded(classUnderTest);
|
||||
}
|
||||
|
||||
|
||||
public void testInterfaceThroughSuperClassMatch() throws Exception {
|
||||
MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
|
||||
String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTests$SomeDaoLikeImpl";
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2006-2010 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@@ -32,8 +32,8 @@ import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;
|
||||
/**
|
||||
* Unit test checking the behaviour of {@link CachingMetadataReaderFactory under load.
|
||||
* If the cache is not controller, this test should fail with an out of memory exception around entry
|
||||
* 5k.
|
||||
*
|
||||
* 5k.
|
||||
*
|
||||
* @author Costin Leau
|
||||
*/
|
||||
public class CachingMetadataReaderLeakTest {
|
||||
|
||||
@@ -9,7 +9,7 @@ import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Test case for {@link CompositeIterator}.
|
||||
*
|
||||
*
|
||||
* @author Erwin Vervaet
|
||||
*/
|
||||
public class CompositeIteratorTests extends TestCase {
|
||||
|
||||
@@ -24,51 +24,51 @@ import junit.framework.TestCase;
|
||||
* @author Rob Harrop
|
||||
*/
|
||||
public class FileSystemUtilsTests extends TestCase {
|
||||
|
||||
|
||||
public void testDeleteRecursively() throws Exception {
|
||||
File root = new File("./tmp/root");
|
||||
File child = new File(root, "child");
|
||||
File grandchild = new File(child, "grandchild");
|
||||
|
||||
|
||||
grandchild.mkdirs();
|
||||
|
||||
|
||||
File bar = new File(child, "bar.txt");
|
||||
bar.createNewFile();
|
||||
|
||||
|
||||
assertTrue(root.exists());
|
||||
assertTrue(child.exists());
|
||||
assertTrue(grandchild.exists());
|
||||
assertTrue(bar.exists());
|
||||
|
||||
|
||||
FileSystemUtils.deleteRecursively(root);
|
||||
|
||||
|
||||
assertFalse(root.exists());
|
||||
assertFalse(child.exists());
|
||||
assertFalse(grandchild.exists());
|
||||
assertFalse(bar.exists());
|
||||
}
|
||||
|
||||
|
||||
public void testCopyRecursively() throws Exception {
|
||||
File src = new File("./tmp/src");
|
||||
File child = new File(src, "child");
|
||||
File grandchild = new File(child, "grandchild");
|
||||
|
||||
|
||||
grandchild.mkdirs();
|
||||
|
||||
|
||||
File bar = new File(child, "bar.txt");
|
||||
bar.createNewFile();
|
||||
|
||||
|
||||
assertTrue(src.exists());
|
||||
assertTrue(child.exists());
|
||||
assertTrue(grandchild.exists());
|
||||
assertTrue(bar.exists());
|
||||
|
||||
|
||||
File dest = new File("./dest");
|
||||
FileSystemUtils.copyRecursively(src, dest);
|
||||
|
||||
|
||||
assertTrue(dest.exists());
|
||||
assertTrue(new File(dest, child.getName()).exists());
|
||||
|
||||
|
||||
FileSystemUtils.deleteRecursively(src);
|
||||
assertTrue(!src.exists());
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@@ -26,11 +26,11 @@ import org.apache.log4j.spi.LoggingEvent;
|
||||
* @author Alef Arendsen
|
||||
*/
|
||||
public class MockLog4jAppender extends AppenderSkeleton {
|
||||
|
||||
|
||||
public static final List loggingStrings = new ArrayList();
|
||||
|
||||
|
||||
public static boolean closeCalled = false;
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.AppenderSkeleton#append(org.apache.log4j.spi.LoggingEvent)
|
||||
*/
|
||||
@@ -38,7 +38,7 @@ public class MockLog4jAppender extends AppenderSkeleton {
|
||||
//System.out.println("Adding " + evt.getMessage());
|
||||
loggingStrings.add(evt.getMessage());
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.Appender#close()
|
||||
*/
|
||||
@@ -49,11 +49,11 @@ public class MockLog4jAppender extends AppenderSkeleton {
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.Appender#requiresLayout()
|
||||
*/
|
||||
public boolean requiresLayout() {
|
||||
public boolean requiresLayout() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class PropertyPlaceholderHelperTests {
|
||||
String text = "foo=${foo},bar=${bar}";
|
||||
Properties props = new Properties();
|
||||
props.setProperty("foo", "bar");
|
||||
|
||||
|
||||
assertEquals("foo=bar,bar=${bar}", this.helper.replacePlaceholders(text, props));
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@ import org.springframework.beans.TestBean;
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
public class SerializationTestUtils extends TestCase {
|
||||
|
||||
|
||||
public static void testSerialization(Object o) throws IOException {
|
||||
OutputStream baos = new ByteArrayOutputStream();
|
||||
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(o);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isSerializable(Object o) throws IOException {
|
||||
try {
|
||||
testSerialization(o);
|
||||
@@ -43,7 +43,7 @@ public class SerializationTestUtils extends TestCase {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
@@ -51,24 +51,24 @@ public class SerializationTestUtils extends TestCase {
|
||||
oos.flush();
|
||||
baos.flush();
|
||||
byte[] bytes = baos.toByteArray();
|
||||
|
||||
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
|
||||
ObjectInputStream ois = new ObjectInputStream(is);
|
||||
Object o2 = ois.readObject();
|
||||
|
||||
|
||||
return o2;
|
||||
}
|
||||
|
||||
|
||||
public SerializationTestUtils(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
|
||||
public void testWithNonSerializableObject() throws IOException {
|
||||
TestBean o = new TestBean();
|
||||
assertFalse(o instanceof Serializable);
|
||||
|
||||
|
||||
assertFalse(isSerializable(o));
|
||||
|
||||
|
||||
try {
|
||||
testSerialization(o);
|
||||
fail();
|
||||
@@ -77,17 +77,17 @@ public class SerializationTestUtils extends TestCase {
|
||||
// Ok
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void testWithSerializableObject() throws Exception {
|
||||
int x = 5;
|
||||
int y = 10;
|
||||
Point p = new Point(x, y);
|
||||
assertTrue(p instanceof Serializable);
|
||||
|
||||
|
||||
testSerialization(p);
|
||||
|
||||
|
||||
assertTrue(isSerializable(p));
|
||||
|
||||
|
||||
Point p2 = (Point) serializeAndDeserialize(p);
|
||||
assertNotSame(p, p2);
|
||||
assertEquals(x, (int) p2.getX());
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.SerializationUtils;
|
||||
|
||||
/**
|
||||
* Test for static utility to help with serialization.
|
||||
*
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @since 3.0.5
|
||||
*/
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@@ -33,17 +33,17 @@ public class StopWatchTests extends TestCase {
|
||||
long int2 = 45L;
|
||||
String name1 = "Task 1";
|
||||
String name2 = "Task 2";
|
||||
|
||||
|
||||
long fudgeFactor = 5L;
|
||||
assertFalse(sw.isRunning());
|
||||
sw.start(name1);
|
||||
Thread.sleep(int1);
|
||||
assertTrue(sw.isRunning());
|
||||
sw.stop();
|
||||
|
||||
|
||||
// TODO are timings off in JUnit? Why do these assertions sometimes fail
|
||||
// under both Ant and Eclipse?
|
||||
|
||||
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
|
||||
sw.start(name2);
|
||||
@@ -51,19 +51,19 @@ public class StopWatchTests extends TestCase {
|
||||
sw.stop();
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1 + int2);
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + int2 + fudgeFactor);
|
||||
|
||||
|
||||
assertTrue(sw.getTaskCount() == 2);
|
||||
String pp = sw.prettyPrint();
|
||||
assertTrue(pp.indexOf(name1) != -1);
|
||||
assertTrue(pp.indexOf(name2) != -1);
|
||||
|
||||
|
||||
StopWatch.TaskInfo[] tasks = sw.getTaskInfo();
|
||||
assertTrue(tasks.length == 2);
|
||||
assertTrue(tasks[0].getTaskName().equals(name1));
|
||||
assertTrue(tasks[1].getTaskName().equals(name2));
|
||||
sw.toString();
|
||||
}
|
||||
|
||||
|
||||
public void testValidUsageNotKeepingTaskList() throws Exception {
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.setKeepTaskList(false);
|
||||
@@ -71,17 +71,17 @@ public class StopWatchTests extends TestCase {
|
||||
long int2 = 45L;
|
||||
String name1 = "Task 1";
|
||||
String name2 = "Task 2";
|
||||
|
||||
|
||||
long fudgeFactor = 5L;
|
||||
assertFalse(sw.isRunning());
|
||||
sw.start(name1);
|
||||
Thread.sleep(int1);
|
||||
assertTrue(sw.isRunning());
|
||||
sw.stop();
|
||||
|
||||
|
||||
// TODO are timings off in JUnit? Why do these assertions sometimes fail
|
||||
// under both Ant and Eclipse?
|
||||
|
||||
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
|
||||
sw.start(name2);
|
||||
@@ -89,12 +89,12 @@ public class StopWatchTests extends TestCase {
|
||||
sw.stop();
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1 + int2);
|
||||
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + int2 + fudgeFactor);
|
||||
|
||||
|
||||
assertTrue(sw.getTaskCount() == 2);
|
||||
String pp = sw.prettyPrint();
|
||||
assertTrue(pp.indexOf("kept") != -1);
|
||||
sw.toString();
|
||||
|
||||
|
||||
try {
|
||||
sw.getTaskInfo();
|
||||
fail();
|
||||
@@ -103,7 +103,7 @@ public class StopWatchTests extends TestCase {
|
||||
// Ok
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void testFailureToStartBeforeGettingTimings() {
|
||||
StopWatch sw = new StopWatch();
|
||||
try {
|
||||
@@ -114,7 +114,7 @@ public class StopWatchTests extends TestCase {
|
||||
// Ok
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void testFailureToStartBeforeStop() {
|
||||
StopWatch sw = new StopWatch();
|
||||
try {
|
||||
@@ -125,7 +125,7 @@ public class StopWatchTests extends TestCase {
|
||||
// Ok
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void testRejectsStartTwice() {
|
||||
StopWatch sw = new StopWatch();
|
||||
try {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class XMLEventStreamWriterTests {
|
||||
XMLEventWriter eventWriter = outputFactory.createXMLEventWriter(stringWriter);
|
||||
streamWriter = new XMLEventStreamWriter(eventWriter, XMLEventFactory.newInstance());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void write() throws Exception {
|
||||
streamWriter.writeStartDocument();
|
||||
|
||||
Reference in New Issue
Block a user