Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Lanneluc2008-06-25 13:20:32 +0000
committerJerome Lanneluc2008-06-25 13:20:32 +0000
commitb507d9a904cae2791728076e7abcce8b001f81b2 (patch)
tree85d5c8abebc9484beba6c4ccbee5d335501967a6 /org.eclipse.jdt.core.tests.performance
parentfa21653618683a7c1daa8e88412c523157e6d5cf (diff)
downloadeclipse.jdt.core-b507d9a904cae2791728076e7abcce8b001f81b2.tar.gz
eclipse.jdt.core-b507d9a904cae2791728076e7abcce8b001f81b2.tar.xz
eclipse.jdt.core-b507d9a904cae2791728076e7abcce8b001f81b2.zip
HEAD - 190840
Diffstat (limited to 'org.eclipse.jdt.core.tests.performance')
-rw-r--r--org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java
index a21c8df110..4113a7cdcd 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java
@@ -1074,6 +1074,54 @@ public void testFindType() throws CoreException {
}
}
+/*
+ * Performance test for the first time we get the source of a class file in a bug jar with no source attached
+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=190840 )
+ */
+public void testGetSourceBigJarNoAttachment() throws CoreException {
+
+ IJavaProject project = null;
+ try {
+ project = createJavaProject("HugeJarProject");
+ IFile bigJar1 = BIG_PROJECT.getProject().getFile(BIG_JAR1_NAME);
+ project.setRawClasspath(
+ new IClasspathEntry[] {
+ JavaCore.newLibraryEntry(bigJar1.getFullPath(), null, null),
+ }, null);
+ AbstractJavaModelTests.waitUntilIndexesReady();
+ AbstractJavaModelTests.waitForAutoBuild();
+ IPackageFragmentRoot root = project.getPackageFragmentRoot(bigJar1);
+ IClassFile classFile = root.getPackageFragment("p0").getClassFile("X0.class");
+
+ // warm up
+ int max = 20;
+ int warmup = WARMUP_COUNT / 10;
+ for (int i = 0; i < warmup; i++) {
+ for (int j = 0; j < max; j++) {
+ root.close();
+ classFile.getSource();
+ }
+ }
+
+ // measure performance
+ for (int i = 0; i < MEASURES_COUNT; i++) {
+ runGc();
+ startMeasuring();
+ for (int j = 0; j < max; j++) {
+ root.close();
+ classFile.getSource();
+ }
+ stopMeasuring();
+ }
+
+ commitMeasurements();
+ assertPerformance();
+ } finally {
+ if (project != null)
+ project.getProject().delete(false, null);
+ }
+}
+
protected void resetCounters() {
// do nothing
}

Back to the top