Lines 804-809
Link Here
|
804 |
assertPerformance(); |
804 |
assertPerformance(); |
805 |
} |
805 |
} |
806 |
|
806 |
|
|
|
807 |
public void testCloseProjects() throws JavaModelException { |
808 |
// store current settings |
809 |
long oldSnapInterval = ENV.getWorkspace().getDescription().getSnapshotInterval(); |
810 |
boolean oldAutoBuildPolicy = ENV.isAutoBuilding(); |
811 |
|
812 |
// prevent snapshots and autobuilds from disturbing our measures |
813 |
ENV.getWorkspace().getDescription().setSnapshotInterval(100000); |
814 |
ENV.getWorkspace().getDescription().setAutoBuilding(false); |
815 |
|
816 |
try { |
817 |
int length=ALL_PROJECTS.length; |
818 |
// Warm-up |
819 |
for (int i=0; i<WARMUP_COUNT; i++) { |
820 |
for (int j=0; j<length; j++) { |
821 |
ENV.closeProject(ALL_PROJECTS[j].getPath()); |
822 |
} |
823 |
for (int j=0; j<length; j++) { |
824 |
ENV.openProject(ALL_PROJECTS[j].getPath()); |
825 |
} |
826 |
} |
827 |
|
828 |
// Measures |
829 |
for (int i=0; i<MEASURES_COUNT; i++) { |
830 |
AbstractJavaModelTests.waitUntilIndexesReady(); |
831 |
// should not be autobuilding... |
832 |
if (ENV.isAutoBuilding()) { |
833 |
ENV.waitForAutoBuild(); |
834 |
} |
835 |
runGc(); |
836 |
startMeasuring(); |
837 |
for (int j=0; j<length; j++) { |
838 |
ENV.closeProject(ALL_PROJECTS[j].getPath()); |
839 |
} |
840 |
stopMeasuring(); |
841 |
for (int j=0; j<length; j++) { |
842 |
ENV.openProject(ALL_PROJECTS[j].getPath()); |
843 |
} |
844 |
} |
845 |
// Commit |
846 |
commitMeasurements(); |
847 |
assertPerformance(); |
848 |
} |
849 |
finally { |
850 |
// restore previous settings |
851 |
ENV.getWorkspace().getDescription().setSnapshotInterval(oldSnapInterval); |
852 |
ENV.getWorkspace().getDescription().setAutoBuilding(oldAutoBuildPolicy); |
853 |
} |
854 |
} |
855 |
|
856 |
public void testStartJDTPlugin() throws JavaModelException { |
857 |
// store current settings |
858 |
long oldSnapInterval = ENV.getWorkspace().getDescription().getSnapshotInterval(); |
859 |
// prevent snapshots and autobuilds from disturbing our measures |
860 |
ENV.getWorkspace().getDescription().setSnapshotInterval(100000); |
861 |
try { |
862 |
// Warm-up |
863 |
for (int i=0; i<WARMUP_COUNT; i++) { |
864 |
simulateExitRestart(); |
865 |
JavaCore.initializeAfterLoad(null); |
866 |
AbstractJavaModelTests.waitUntilIndexesReady(); |
867 |
} |
868 |
|
869 |
// Measures |
870 |
for (int i=0; i<MEASURES_COUNT; i++) { |
871 |
// shutdwon |
872 |
simulateExit(); |
873 |
runGc(); |
874 |
startMeasuring(); |
875 |
// restart |
876 |
simulateRestart(); |
877 |
JavaCore.initializeAfterLoad(null); |
878 |
AbstractJavaModelTests.waitUntilIndexesReady(); |
879 |
stopMeasuring(); |
880 |
} |
881 |
// Commit |
882 |
commitMeasurements(); |
883 |
assertPerformance(); |
884 |
} |
885 |
catch (CoreException ex) { |
886 |
// do nothing |
887 |
} |
888 |
finally { |
889 |
// restore previous settings |
890 |
ENV.getWorkspace().getDescription().setSnapshotInterval(oldSnapInterval); |
891 |
} |
892 |
} |
893 |
|
807 |
protected void resetCounters() { |
894 |
protected void resetCounters() { |
808 |
// do nothing |
895 |
// do nothing |
809 |
} |
896 |
} |