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:
Phillip Webb
2012-12-18 13:45:00 -08:00
committed by Chris Beams
parent 44a474a014
commit 1762157ad1
1400 changed files with 5920 additions and 5923 deletions

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -27,39 +27,39 @@ import org.springframework.dao.support.DataAccessUtilsTests.MapPersistenceExcept
* @since 2.0
*/
public class ChainedPersistenceExceptionTranslatorTests extends TestCase {
public void testEmpty() {
ChainedPersistenceExceptionTranslator pet = new ChainedPersistenceExceptionTranslator();
//MapPersistenceExceptionTranslator mpet = new MapPersistenceExceptionTranslator();
RuntimeException in = new RuntimeException("in");
assertSame(in, DataAccessUtils.translateIfNecessary(in, pet));
}
public void testExceptionTranslationWithTranslation() {
MapPersistenceExceptionTranslator mpet1 = new MapPersistenceExceptionTranslator();
RuntimeException in1 = new RuntimeException("in");
InvalidDataAccessApiUsageException out1 = new InvalidDataAccessApiUsageException("out");
InvalidDataAccessApiUsageException out2 = new InvalidDataAccessApiUsageException("out");
mpet1.addTranslation(in1, out1);
ChainedPersistenceExceptionTranslator chainedPet1 = new ChainedPersistenceExceptionTranslator();
assertSame("Should not translate yet", in1, DataAccessUtils.translateIfNecessary(in1, chainedPet1));
chainedPet1.addDelegate(mpet1);
assertSame("Should now translate", out1, DataAccessUtils.translateIfNecessary(in1, chainedPet1));
// Now add a new translator and verify it wins
MapPersistenceExceptionTranslator mpet2 = new MapPersistenceExceptionTranslator();
mpet2.addTranslation(in1, out2);
chainedPet1.addDelegate(mpet2);
assertSame("Should still translate the same due to ordering",
assertSame("Should still translate the same due to ordering",
out1, DataAccessUtils.translateIfNecessary(in1, chainedPet1));
ChainedPersistenceExceptionTranslator chainedPet2 = new ChainedPersistenceExceptionTranslator();
chainedPet2.addDelegate(mpet2);
chainedPet2.addDelegate(mpet1);
assertSame("Should translate differently due to ordering",
assertSame("Should translate differently due to ordering",
out2, DataAccessUtils.translateIfNecessary(in1, chainedPet2));
RuntimeException in2 = new RuntimeException("in2");
OptimisticLockingFailureException out3 = new OptimisticLockingFailureException("out2");
assertNull(chainedPet2.translateExceptionIfPossible(in2));

View File

@@ -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.
@@ -104,7 +104,7 @@ public class CciLocalTransactionTests {
LocalTransaction localTransaction = createMock(LocalTransaction.class);
final Record record = createMock(Record.class);
final InteractionSpec interactionSpec = createMock(InteractionSpec.class);
expect(connectionFactory.getConnection()).andReturn(connection);
expect(connection.getLocalTransaction()).andReturn(localTransaction);
@@ -122,7 +122,7 @@ public class CciLocalTransactionTests {
localTransaction.rollback();
connection.close();
replay(connectionFactory, connection, localTransaction, interaction, record);
org.springframework.jca.cci.connection.CciLocalTransactionManager tm = new org.springframework.jca.cci.connection.CciLocalTransactionManager();

View File

@@ -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.

View File

@@ -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.
@@ -80,7 +80,7 @@ public class EisOperationTests {
InteractionSpec interactionSpec = createMock(InteractionSpec.class);
SimpleRecordOperation operation = new SimpleRecordOperation(connectionFactory, interactionSpec);
expect(connectionFactory.getConnection()).andReturn(connection);
expect(connection.createInteraction()).andReturn(interaction);

View File

@@ -52,7 +52,7 @@ import org.springframework.util.ClassUtils;
* DataSource ds = new DriverManagerDataSource(...);
* builder.bind("java:comp/env/jdbc/myds", ds);
* builder.activate();</pre>
*
*
* Note that it's impossible to activate multiple builders within the same JVM,
* due to JNDI restrictions. Thus to configure a fresh builder repeatedly, use
* the following code to get a reference to either an already activated builder

View File

@@ -50,7 +50,7 @@ public class CallCountingTransactionManager extends AbstractPlatformTransactionM
++rollbacks;
--inflight;
}
public void clear() {
begun = commits = rollbacks = inflight = 0;
}

View File

@@ -43,7 +43,7 @@ import org.springframework.transaction.support.TransactionTemplate;
* @since 12.05.2003
*/
public class JtaTransactionManagerTests extends TestCase {
public void testJtaTransactionManagerWithCommit() throws Exception {
MockControl utControl = MockControl.createControl(UserTransaction.class);
UserTransaction ut = (UserTransaction) utControl.getMock();

View File

@@ -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.

View File

@@ -76,13 +76,13 @@ public class TxNamespaceHandlerTests extends TestCase {
assertEquals("Should have 1 rolled back transaction", 1, ptm.rollbacks);
}
}
public void testRollbackRules() {
TransactionInterceptor txInterceptor = (TransactionInterceptor) context.getBean("txRollbackAdvice");
TransactionAttributeSource txAttrSource = txInterceptor.getTransactionAttributeSource();
TransactionAttribute txAttr = txAttrSource.getTransactionAttribute(getAgeMethod,ITestBean.class);
assertTrue("should be configured to rollback on Exception",txAttr.rollbackOn(new Exception()));
txAttr = txAttrSource.getTransactionAttribute(setAgeMethod, ITestBean.class);
assertFalse("should not rollback on RuntimeException",txAttr.rollbackOn(new RuntimeException()));
}

View File

@@ -43,7 +43,7 @@ import org.springframework.util.SerializationTestUtils;
* @author Juergen Hoeller
*/
public class AnnotationTransactionAttributeSourceTests {
@Test
public void testSerializable() throws Exception {
TestBean1 tb = new TestBean1();
@@ -71,10 +71,10 @@ public class AnnotationTransactionAttributeSourceTests {
@Test
public void testNullOrEmpty() throws Exception {
Method method = Empty.class.getMethod("getAge", (Class[]) null);
AnnotationTransactionAttributeSource atas = new AnnotationTransactionAttributeSource();
assertNull(atas.getTransactionAttribute(method, null));
// Try again in case of caching
assertNull(atas.getTransactionAttribute(method, null));
}
@@ -86,10 +86,10 @@ public class AnnotationTransactionAttributeSourceTests {
@Test
public void testTransactionAttributeDeclaredOnClassMethod() throws Exception {
Method classMethod = ITestBean.class.getMethod("getAge", (Class[]) null);
AnnotationTransactionAttributeSource atas = new AnnotationTransactionAttributeSource();
TransactionAttribute actual = atas.getTransactionAttribute(classMethod, TestBean1.class);
RuleBasedTransactionAttribute rbta = new RuleBasedTransactionAttribute();
rbta.getRollbackRules().add(new RollbackRuleAttribute(Exception.class));
assertEquals(rbta.getRollbackRules(), ((RuleBasedTransactionAttribute) actual).getRollbackRules());
@@ -124,7 +124,7 @@ public class AnnotationTransactionAttributeSourceTests {
AnnotationTransactionAttributeSource atas = new AnnotationTransactionAttributeSource();
TransactionAttribute actual = atas.getTransactionAttribute(interfaceMethod, TestBean2.class);
RuleBasedTransactionAttribute rbta = new RuleBasedTransactionAttribute();
assertEquals(rbta.getRollbackRules(), ((RuleBasedTransactionAttribute) actual).getRollbackRules());
}
@@ -152,11 +152,11 @@ public class AnnotationTransactionAttributeSourceTests {
TransactionAttribute actual2 = atas.getTransactionAttribute(interfaceMethod2, TestBean3.class);
assertEquals(TransactionAttribute.PROPAGATION_REQUIRED, actual2.getPropagationBehavior());
}
@Test
public void testRollbackRulesAreApplied() throws Exception {
Method method = TestBean3.class.getMethod("getAge", (Class[]) null);
AnnotationTransactionAttributeSource atas = new AnnotationTransactionAttributeSource();
TransactionAttribute actual = atas.getTransactionAttribute(method, TestBean3.class);
@@ -167,13 +167,13 @@ public class AnnotationTransactionAttributeSourceTests {
assertEquals(rbta.getRollbackRules(), ((RuleBasedTransactionAttribute) actual).getRollbackRules());
assertTrue(actual.rollbackOn(new Exception()));
assertFalse(actual.rollbackOn(new IOException()));
actual = atas.getTransactionAttribute(method, method.getDeclaringClass());
rbta = new RuleBasedTransactionAttribute();
rbta.getRollbackRules().add(new RollbackRuleAttribute("java.lang.Exception"));
rbta.getRollbackRules().add(new NoRollbackRuleAttribute(IOException.class));
assertEquals(rbta.getRollbackRules(), ((RuleBasedTransactionAttribute) actual).getRollbackRules());
assertTrue(actual.rollbackOn(new Exception()));
assertFalse(actual.rollbackOn(new IOException()));
@@ -189,7 +189,7 @@ public class AnnotationTransactionAttributeSourceTests {
AnnotationTransactionAttributeSource atas = new AnnotationTransactionAttributeSource();
TransactionAttribute actual = atas.getTransactionAttribute(method, TestBean4.class);
RuleBasedTransactionAttribute rbta = new RuleBasedTransactionAttribute();
rbta.getRollbackRules().add(new RollbackRuleAttribute(Exception.class));
rbta.getRollbackRules().add(new NoRollbackRuleAttribute(IOException.class));
@@ -265,7 +265,7 @@ public class AnnotationTransactionAttributeSourceTests {
void setAge(int age);
String getName();
String getName();
void setName(String name);
}
@@ -278,7 +278,7 @@ public class AnnotationTransactionAttributeSourceTests {
void setAge(int age);
String getName();
String getName();
void setName(String name);
}
@@ -291,12 +291,12 @@ public class AnnotationTransactionAttributeSourceTests {
void setAge(int age);
String getName();
String getName();
void setName(String name);
}
public static class Empty implements ITestBean {
private String name;

View File

@@ -82,14 +82,14 @@ public class AnnotationTransactionNamespaceHandlerTests extends TestCase {
}
}
public void testNonPublicMethodsNotAdvised() {
TransactionalTestBean testBean = getTestBean();
CallCountingTransactionManager ptm = (CallCountingTransactionManager) context.getBean("transactionManager");
assertEquals("Should not have any started transactions", 0, ptm.begun);
testBean.annotationsOnProtectedAreIgnored();
assertEquals("Should not have any started transactions", 0, ptm.begun);
assertEquals("Should not have any started transactions", 0, ptm.begun);
}
public void testMBeanExportAlsoWorks() throws Exception {
@@ -125,7 +125,7 @@ public class AnnotationTransactionNamespaceHandlerTests extends TestCase {
public String doSomething() {
return "done";
}
@Transactional
protected void annotationsOnProtectedAreIgnored() {
}

View File

@@ -47,11 +47,11 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport.Tran
* @since 16.03.2003
*/
public abstract class AbstractTransactionAspectTests extends TestCase {
protected Method exceptionalMethod;
protected Method getNameMethod;
protected Method setNameMethod;
@@ -246,7 +246,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
ptm.commit(status);
ptmControl.setVoidCallable(1);
ptmControl.replay();
final String spouseName = "innerName";
TestBean outer = new TestBean() {
@@ -264,7 +264,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
return spouseName;
}
};
ITestBean outerProxy = (ITestBean) advised(outer, ptm, tas);
ITestBean innerProxy = (ITestBean) advised(inner, ptm, tas);
outer.setSpouse(innerProxy);
@@ -272,13 +272,13 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
checkTransactionStatus(false);
// Will invoke inner.getName, which is non-transactional
outerProxy.exceptional(null);
outerProxy.exceptional(null);
checkTransactionStatus(false);
ptmControl.verify();
}
public void testEnclosingTransactionWithNestedTransactionOnAdvisedInside() throws Throwable {
final TransactionAttribute outerTxatt = new DefaultTransactionAttribute();
final TransactionAttribute innerTxatt = new DefaultTransactionAttribute(TransactionDefinition.PROPAGATION_NESTED);
@@ -291,23 +291,23 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
TransactionStatus outerStatus = transactionStatusForNewTransaction();
TransactionStatus innerStatus = transactionStatusForNewTransaction();
MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
PlatformTransactionManager ptm = (PlatformTransactionManager) ptmControl.getMock();
// Expect a transaction
ptm.getTransaction(outerTxatt);
ptmControl.setReturnValue(outerStatus, 1);
ptm.getTransaction(innerTxatt);
ptmControl.setReturnValue(innerStatus, 1);
ptm.commit(innerStatus);
ptmControl.setVoidCallable(1);
ptm.commit(outerStatus);
ptmControl.setVoidCallable(1);
ptmControl.replay();
final String spouseName = "innerName";
TestBean outer = new TestBean() {
@@ -328,7 +328,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
return spouseName;
}
};
ITestBean outerProxy = (ITestBean) advised(outer, ptm, tas);
ITestBean innerProxy = (ITestBean) advised(inner, ptm, tas);
outer.setSpouse(innerProxy);
@@ -336,13 +336,13 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
checkTransactionStatus(false);
// Will invoke inner.getName, which is non-transactional
outerProxy.exceptional(null);
outerProxy.exceptional(null);
checkTransactionStatus(false);
ptmControl.verify();
}
public void testRollbackOnCheckedException() throws Throwable {
doTestRollbackOnException(new Exception(), true, false);
}
@@ -419,7 +419,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
}
ptmControl.replay();
TestBean tb = new TestBean();
TestBean tb = new TestBean();
ITestBean itb = (ITestBean) advised(tb, ptm, tas);
try {
@@ -437,7 +437,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
ptmControl.verify();
}
/**
* Test that TransactionStatus.setRollbackOnly works.
*/
@@ -466,7 +466,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
return name;
}
};
ITestBean itb = (ITestBean) advised(tb, ptm, tas);
// verification!?
@@ -474,7 +474,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
ptmControl.verify();
}
/**
* @return a TransactionStatus object configured for a new transaction
*/
@@ -507,7 +507,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
throw new UnsupportedOperationException(
"Shouldn't have invoked target method when couldn't create transaction for transactional method");
}
};
};
ITestBean itb = (ITestBean) advised(tb, ptm, tas);
try {
@@ -545,7 +545,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
ptmControl.setThrowable(ex);
ptmControl.replay();
TestBean tb = new TestBean();
TestBean tb = new TestBean();
ITestBean itb = (ITestBean) advised(tb, ptm, tas);
String name = "new name";

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2012 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.
@@ -66,13 +66,13 @@ public class BeanFactoryTransactionTests extends TestCase {
assertTrue("testBean is a dynamic proxy", Proxy.isProxyClass(testBean.getClass()));
doTestGetsAreNotTransactional(testBean);
}
public void testGetsAreNotTransactionalWithProxyFactory2Cglib() throws NoSuchMethodException {
ITestBean testBean = (ITestBean) factory.getBean("proxyFactory2Cglib");
assertTrue("testBean is CGLIB advised", AopUtils.isCglibProxy(testBean));
doTestGetsAreNotTransactional(testBean);
}
public void testProxyFactory2Lazy() throws NoSuchMethodException {
ITestBean testBean = (ITestBean) factory.getBean("proxyFactory2Lazy");
assertFalse(factory.containsSingleton("target"));
@@ -84,14 +84,14 @@ public class BeanFactoryTransactionTests extends TestCase {
ImplementsNoInterfaces ini = (ImplementsNoInterfaces) factory.getBean("cglibNoInterfaces");
assertTrue("testBean is CGLIB advised", AopUtils.isCglibProxy(ini));
String newName = "Gordon";
// Install facade
CallCountingTransactionManager ptm = new CallCountingTransactionManager();
PlatformTransactionManagerFacade.delegate = ptm;
ini.setName(newName);
assertEquals(newName, ini.getName());
assertEquals(2, ptm.commits);
assertEquals(2, ptm.commits);
}
public void testGetsAreNotTransactionalWithProxyFactory3() throws NoSuchMethodException {
@@ -171,7 +171,7 @@ public class BeanFactoryTransactionTests extends TestCase {
// Ok
}
}
/**
* Test that we can set the target to a dynamic TargetSource.
*/
@@ -179,13 +179,13 @@ public class BeanFactoryTransactionTests extends TestCase {
// Install facade
CallCountingTransactionManager txMan = new CallCountingTransactionManager();
PlatformTransactionManagerFacade.delegate = txMan;
TestBean tb = (TestBean) factory.getBean("hotSwapped");
assertEquals(666, tb.getAge());
int newAge = 557;
tb.setAge(newAge);
assertEquals(newAge, tb.getAge());
TestBean target2 = new TestBean();
target2.setAge(65);
HotSwappableTargetSource ts = (HotSwappableTargetSource) factory.getBean("swapper");
@@ -193,7 +193,7 @@ public class BeanFactoryTransactionTests extends TestCase {
assertEquals(target2.getAge(), tb.getAge());
tb.setAge(newAge);
assertEquals(newAge, target2.getAge());
assertEquals(0, txMan.inflight);
assertEquals(2, txMan.commits);
assertEquals(0, txMan.rollbacks);

View File

@@ -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.
@@ -25,17 +25,17 @@ import org.springframework.beans.TestBean;
* @author Rod Johnson
*/
public class ImplementsNoInterfaces {
private TestBean testBean;
public void setDependency(TestBean testBean) {
this.testBean = testBean;
}
public String getName() {
return testBean.getName();
}
public void setName(String name) {
testBean.setName(name);
}

View File

@@ -20,7 +20,7 @@ import org.springframework.core.NestedRuntimeException;
/**
* An example {@link RuntimeException} for use in testing rollback rules.
*
*
* @author Chris Beams
*/
@SuppressWarnings("serial")

View File

@@ -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.
@@ -31,7 +31,7 @@ import org.springframework.transaction.TransactionStatus;
* @since 26.04.2003
*/
public class PlatformTransactionManagerFacade implements PlatformTransactionManager {
/**
* This member can be changed to change behavior class-wide.
*/

View File

@@ -39,17 +39,17 @@ public class RollbackRuleTests extends TestCase {
RollbackRuleAttribute rr = new RollbackRuleAttribute(java.lang.Exception.class.getName());
assertTrue(rr.getDepth(new Exception()) == 0);
}
public void testFoundImmediatelyWithClass() {
RollbackRuleAttribute rr = new RollbackRuleAttribute(Exception.class);
assertTrue(rr.getDepth(new Exception()) == 0);
}
public void testNotFound() {
RollbackRuleAttribute rr = new RollbackRuleAttribute(java.io.IOException.class.getName());
assertTrue(rr.getDepth(new MyRuntimeException("")) == -1);
}
public void testAncestry() {
RollbackRuleAttribute rr = new RollbackRuleAttribute(java.lang.Exception.class.getName());
// Exception -> Runtime -> NestedRuntime -> MyRuntimeException

View File

@@ -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.

View File

@@ -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.
@@ -23,15 +23,15 @@ import org.springframework.util.SerializationTestUtils;
import junit.framework.TestCase;
/**
*
*
* @author Rod Johnson
*/
public class TransactionAttributeSourceAdvisorTests extends TestCase {
public TransactionAttributeSourceAdvisorTests(String s) {
super(s);
}
public void testSerializability() throws Exception {
TransactionInterceptor ti = new TransactionInterceptor();
ti.setTransactionAttributes(new Properties());

View File

@@ -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.
@@ -23,7 +23,7 @@ import junit.framework.TestCase;
import org.springframework.transaction.TransactionDefinition;
/**
* Format is
* Format is
* <code>FQN.Method=tx attribute representation</code>
*
* @author Rod Johnson
@@ -50,7 +50,7 @@ public class TransactionAttributeSourceEditorTests extends TestCase {
// Ok
}
}
public void testMatchesSpecific() throws Exception {
TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();
// TODO need FQN?

View File

@@ -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.
@@ -45,14 +45,14 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests
}
/**
* Template method to create an advised object given the
* Template method to create an advised object given the
* target object and transaction setup.
* Creates a TransactionInterceptor and applies it.
*/
protected Object advised(Object target, PlatformTransactionManager ptm, TransactionAttributeSource tas) {
TransactionInterceptor ti = new TransactionInterceptor();
ti.setTransactionManager(ptm);
assertEquals(ptm, ti.getTransactionManager());
assertEquals(ptm, ti.getTransactionManager());
ti.setTransactionAttributeSource(tas);
assertEquals(tas, ti.getTransactionAttributeSource());
@@ -60,9 +60,9 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests
pf.addAdvice(0, ti);
return pf.getProxy();
}
/**
* A TransactionInterceptor should be serializable if its
* A TransactionInterceptor should be serializable if its
* PlatformTransactionManager is.
*/
public void testSerializableWithAttributeProperties() throws Exception {
@@ -121,6 +121,6 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests
public void rollback(TransactionStatus status) throws TransactionException {
throw new UnsupportedOperationException();
}
}
}

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2009 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.