[tranche] r282 committed - Updated Tranche Commons JAR....

1 view
Skip to first unread message

tra...@googlecode.com

unread,
Jul 16, 2010, 4:29:59 PM7/16/10
to tranche-d...@googlegroups.com
Revision: 282
Author: augman85
Date: Fri Jul 16 13:29:10 2010
Log: Updated Tranche Commons JAR.
Stopped add file tool from sending upload receipt/registration on a stopped
upload.
Cleaned the upload stoppage logic.
http://code.google.com/p/tranche/source/detail?r=282

Modified:
/lib/tranche-commons.jar
/src/org/tranche/add/AddFileTool.java
/src/org/tranche/get/GetFileToolPerformanceLog.java
/test/org/tranche/add/AddFileToolTest.java

=======================================
--- /lib/tranche-commons.jar Fri Jun 18 14:20:10 2010
+++ /lib/tranche-commons.jar Fri Jul 16 13:29:10 2010
Binary file, no diff available.
=======================================
--- /src/org/tranche/add/AddFileTool.java Thu May 13 11:20:05 2010
+++ /src/org/tranche/add/AddFileTool.java Fri Jul 16 13:29:10 2010
@@ -687,7 +687,10 @@
* <p>Stops the upload.</p>
*/
public void stop() {
- this.stopped = true;
+ stopped = true;
+ synchronized (AddFileTool.this) {
+ notifyAll();
+ }
}

/**
@@ -1239,7 +1242,7 @@
report.setHash(null);
}
// register our upload only if there were no failures
- if (!dataOnly && !TestUtil.isTesting()) {
+ if (!dataOnly && !stopped && !TestUtil.isTesting()) {
if (!report.isFailed()) {
AddFileToolUtil.registerUpload(this, report);
if (emailConfirmationSet != null
&& !emailConfirmationSet.isEmpty()) {
@@ -1437,11 +1440,11 @@
* @param event An event.
*/
private void fire(AddFileToolEvent event) {
- // break point
+ // break/pause point
+ waitHereOnPause();
if (stopped) {
return;
}
- waitHereOnPause();
for (AddFileToolListener l : getListeners()) {
try {
if (event.getType() == AddFileToolEvent.TYPE_METADATA) {
@@ -1489,11 +1492,11 @@
* @param propagationExceptions
*/
private void fireFailure(AddFileToolEvent event,
Collection<PropagationExceptionWrapper> exceptions) {
- // break point
+ // break/pause point
+ waitHereOnPause();
if (stopped) {
return;
}
- waitHereOnPause();
for (AddFileToolListener l : getListeners()) {
try {
if (event.getType() == AddFileToolEvent.TYPE_METADATA) {
=======================================
--- /src/org/tranche/get/GetFileToolPerformanceLog.java Tue Apr 27 10:26:55
2010
+++ /src/org/tranche/get/GetFileToolPerformanceLog.java Fri Jul 16 13:29:10
2010
@@ -419,7 +419,7 @@
private void sendEmailAndDeleteFile() {
File zippedFile = null;
try {
- String subject = "[" +
ConfigureTranche.get(ConfigureTranche.CATEGORY_GENERAL,
ConfigureTranche.PROP_NAME) + "] Upload Performance Log @ " +
TextUtil.getFormattedDate(TimeUtil.getTrancheTimestamp());
+ String subject = "[" +
ConfigureTranche.get(ConfigureTranche.CATEGORY_GENERAL,
ConfigureTranche.PROP_NAME) + "] Download Performance Log @ " +
TextUtil.getFormattedDate(TimeUtil.getTrancheTimestamp());
String message = "See attached file.";

zippedFile = CompressionUtil.zipCompress(this.getFile());
=======================================
--- /test/org/tranche/add/AddFileToolTest.java Tue Apr 27 10:26:55 2010
+++ /test/org/tranche/add/AddFileToolTest.java Fri Jul 16 13:29:10 2010
@@ -1493,7 +1493,7 @@
t.start();

Thread.yield();
- Thread.sleep(500);
+ Thread.sleep(5000);

assertTrue("Should be executing.", aft.isExecuting());

@@ -1504,10 +1504,8 @@
assertFalse("Thread shouldn't be running.", t.isAlive());
assertTrue("Since it was stopped, should be finished.",
reportArr[0].isFinished());
assertNull("Shouldn't have a hash.", reportArr[0].getHash());
-
} finally {
testNetwork.stop();
-
IOUtil.recursiveDelete(testDir);
}
}

Reply all
Reply to author
Forward
0 new messages