Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-08-28 02:22:22 +0000
committerSteffen Pingel2011-08-28 02:22:22 +0000
commit1e822f3156c54d253d4f005883407982e1cc0ae0 (patch)
tree5ca117aa2de46d70578f59fa1c2d5ab1c0b7af9b
parentae24294d0af64058cc72e16fa7c490e35ebce7d7 (diff)
downloadorg.eclipse.mylyn.incubator-1e822f3156c54d253d4f005883407982e1cc0ae0.tar.gz
org.eclipse.mylyn.incubator-1e822f3156c54d253d4f005883407982e1cc0ae0.tar.xz
org.eclipse.mylyn.incubator-1e822f3156c54d253d4f005883407982e1cc0ae0.zip
REOPENED - bug 351100: fix failing tests for Mylyn 3.7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351100
-rw-r--r--org.eclipse.mylyn.sandbox.tests/src/org/eclipse/mylyn/monitor/tests/MonitorPackagingTest.java24
1 files changed, 2 insertions, 22 deletions
diff --git a/org.eclipse.mylyn.sandbox.tests/src/org/eclipse/mylyn/monitor/tests/MonitorPackagingTest.java b/org.eclipse.mylyn.sandbox.tests/src/org/eclipse/mylyn/monitor/tests/MonitorPackagingTest.java
index 7a996dc3..40b09c64 100644
--- a/org.eclipse.mylyn.sandbox.tests/src/org/eclipse/mylyn/monitor/tests/MonitorPackagingTest.java
+++ b/org.eclipse.mylyn.sandbox.tests/src/org/eclipse/mylyn/monitor/tests/MonitorPackagingTest.java
@@ -21,7 +21,6 @@ import java.util.zip.ZipFile;
import org.eclipse.mylyn.context.sdk.util.AbstractContextTest;
import org.eclipse.mylyn.internal.commons.core.ZipFileUtil;
-import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;
import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
import org.eclipse.mylyn.internal.monitor.usage.UiUsageMonitorPlugin;
@@ -34,54 +33,35 @@ public class MonitorPackagingTest extends AbstractContextTest {
UiUsageMonitorPlugin.getDefault().getInteractionLogger().stopMonitoring();
File monitorFile = UiUsageMonitorPlugin.getDefault().getMonitorLogFile();
-
List<File> files = new ArrayList<File>();
files.add(monitorFile);
- // files.add(logFile);
-
- File zipFile = new File(ContextCorePlugin.getContextStore().getContextDirectory().getParentFile()
- + "/mylarUpload.zip");
+ File zipFile = new File(monitorFile.getParentFile(), "usage-upload.zip");
+ zipFile.deleteOnExit();
ZipFileUtil.createZipFile(zipFile, files);
- // MylarMonitorPlugin.getDefault().startLog();
UiUsageMonitorPlugin.getDefault().getInteractionLogger().startMonitoring();
// pretend to upload
Thread.sleep(1000);
- zipFile = new File(ContextCorePlugin.getContextStore().getContextDirectory().getParentFile()
- + "/mylarUpload.zip");
-
- // Open the ZIP file
ZipFile zf = new ZipFile(zipFile);
try {
int numEntries = 0;
-
- // Enumerate each entry
for (Enumeration<? extends ZipEntry> entries = zf.entries(); entries.hasMoreElements();) {
numEntries++;
String zipEntryName = ((ZipEntry) entries.nextElement()).getName();
assertTrue("Unknown Entry: " + zipEntryName, zipEntryName.compareTo(monitorFile.getName()) == 0);// ||
- // zipEntryName.compareTo(logFile.getName())
- // ==
- // 0);
}
assertEquals("Results not correct size", 1, numEntries);
- // check the length of the zip
- // long fileLength = monitorFile.length() + logFile.length();
- // if(monitorFile.length() != 0 || logFile.length() != 0)
- // assertTrue("Zip didn't help", fileLength > zipFile.length());
} finally {
zf.close();
}
- // delete it
zipFile.delete();
}
public void testCreateLargeUploadPackage() throws IOException, InterruptedException {
-
for (int i = 0; i < 20000; i++) {
MonitorUiPlugin.getDefault().notifyInteractionObserved(mockSelection());
}

Back to the top