git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[maven-release-plugin] copy for tag wamblee-utils-0.2.2
[utils]
/
support
/
spring
/
src
/
test
/
java
/
org
/
wamblee
/
concurrency
/
spring
/
LockAdviceTest.java
diff --git
a/support/spring/src/test/java/org/wamblee/concurrency/spring/LockAdviceTest.java
b/support/spring/src/test/java/org/wamblee/concurrency/spring/LockAdviceTest.java
index b56beacd9c9e7f1c4872a7957566758700d26fad..e2fc216e8a551e2de312eca3a1b0a387cf0817ab 100644
(file)
--- a/
support/spring/src/test/java/org/wamblee/concurrency/spring/LockAdviceTest.java
+++ b/
support/spring/src/test/java/org/wamblee/concurrency/spring/LockAdviceTest.java
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 2005 the original author or authors.
+ * Copyright 2005
-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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-12,31
+12,23
@@
* 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.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
-
+ */
package org.wamblee.concurrency.spring;
import org.springframework.aop.framework.ProxyFactoryBean;
package org.wamblee.concurrency.spring;
import org.springframework.aop.framework.ProxyFactoryBean;
+
import org.wamblee.concurrency.AbstractLockTestCase;
import org.wamblee.concurrency.JvmLock;
import org.wamblee.concurrency.spring.LockAdvice;
import org.wamblee.concurrency.AbstractLockTestCase;
import org.wamblee.concurrency.JvmLock;
import org.wamblee.concurrency.spring.LockAdvice;
+
import org.wamblee.test.TimingUtils;
/**
*
import org.wamblee.test.TimingUtils;
/**
*
- *
* @author Erik Brakkee
*/
public class LockAdviceTest extends AbstractLockTestCase {
* @author Erik Brakkee
*/
public class LockAdviceTest extends AbstractLockTestCase {
-
- private class Runner implements Runnable {
- public void run() {
- LockAdviceTest.this.getTracker().eventOccurred(ACQUIRED);
- TimingUtils.sleep(SLEEP_TIME);
- }
- }
-
- private Runnable _target;
+ private Runnable target;
/*
* (non-Javadoc)
/*
* (non-Javadoc)
@@
-46,16
+38,15
@@
public class LockAdviceTest extends AbstractLockTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
@Override
protected void setUp() throws Exception {
super.setUp();
-
+
Runner runner = new Runner();
LockAdvice advice = new LockAdvice(new JvmLock());
Runner runner = new Runner();
LockAdvice advice = new LockAdvice(new JvmLock());
-
+
ProxyFactoryBean support = new ProxyFactoryBean();
ProxyFactoryBean support = new ProxyFactoryBean();
- support.setInterfaces(new Class[]{ Runnable.class });
+ support.setInterfaces(new Class[]
{ Runnable.class });
support.setTarget(runner);
support.addAdvice(advice);
support.setTarget(runner);
support.addAdvice(advice);
- _target = (Runnable)support.getObject();
-
+ target = (Runnable) support.getObject();
}
/*
}
/*
@@
-69,7
+60,7
@@
public class LockAdviceTest extends AbstractLockTestCase {
public void run() {
try {
getTracker().eventOccurred(STARTED);
public void run() {
try {
getTracker().eventOccurred(STARTED);
-
_
target.run();
+ target.run();
getTracker().eventOccurred(RELEASED);
} catch (Throwable e) {
throw new RuntimeException(e);
getTracker().eventOccurred(RELEASED);
} catch (Throwable e) {
throw new RuntimeException(e);
@@
-77,7
+68,14
@@
public class LockAdviceTest extends AbstractLockTestCase {
};
});
t.start();
};
});
t.start();
+
return t;
}
return t;
}
+ private class Runner implements Runnable {
+ public void run() {
+ LockAdviceTest.this.getTracker().eventOccurred(ACQUIRED);
+ TimingUtils.sleep(SLEEP_TIME);
+ }
+ }
}
}