View | Details | Raw Unified | Return to bug 178499 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java (-1 / +1 lines)
Lines 425-431 Link Here
425
	 * @throws IOException
425
	 * @throws IOException
426
	 */
426
	 */
427
	public void testFullBuildDefault() throws CoreException, IOException {
427
	public void testFullBuildDefault() throws CoreException, IOException {
428
		tagAsSummary("Build entire workspace", true); // put in fingerprint
428
		tagAsSummary("Build entire workspace", false); // do NOT put in fingerprint
429
		build(null, warningOptions(0/*default warnings*/), false);
429
		build(null, warningOptions(0/*default warnings*/), false);
430
	}
430
	}
431
431
(-)src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java (-17 / +103 lines)
Lines 39-45 Link Here
39
	// Tests counters
39
	// Tests counters
40
	static int TESTS_COUNT = 0;
40
	static int TESTS_COUNT = 0;
41
	private final static int WARMUP_COUNT = 1; // 30;
41
	private final static int WARMUP_COUNT = 1; // 30;
42
	private final static int ITERATIONS_COUNT = 1000;
43
	private final static int FOLDERS_COUNT = 200;
42
	private final static int FOLDERS_COUNT = 200;
44
	private final static int PACKAGES_COUNT = 200;
43
	private final static int PACKAGES_COUNT = 200;
45
	static int TESTS_LENGTH;
44
	static int TESTS_LENGTH;
Lines 312-318 Link Here
312
 * First wait that already started indexing jobs end before perform test.
311
 * First wait that already started indexing jobs end before perform test.
313
 * Perform one find before measure performance for warm-up.
312
 * Perform one find before measure performance for warm-up.
314
 */
313
 */
315
public void testPerfNameLookupFindKnownType() throws CoreException {
314
public void testNameLookupFindKnownType() throws CoreException {
316
315
317
	// Wait for indexing end
316
	// Wait for indexing end
318
	AbstractJavaModelTests.waitUntilIndexesReady();
317
	AbstractJavaModelTests.waitUntilIndexesReady();
Lines 333-339 Link Here
333
	for (int i=0; i<MEASURES_COUNT; i++) {
332
	for (int i=0; i<MEASURES_COUNT; i++) {
334
		runGc();
333
		runGc();
335
		startMeasuring();
334
		startMeasuring();
336
		for (int n=0; n<ITERATIONS_COUNT; n++) {
335
		for (int n=0; n<50000; n++) {
337
			NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY);
336
			NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY);
338
			nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL);
337
			nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL);
339
		}
338
		}
Lines 351-357 Link Here
351
 * First wait that already started indexing jobs end before perform test.
350
 * First wait that already started indexing jobs end before perform test.
352
 * Perform one find before measure performance for warm-up.
351
 * Perform one find before measure performance for warm-up.
353
 */
352
 */
354
public void testPerfNameLookupFindKnownSecondaryType() throws CoreException {
353
public void testNameLookupFindKnownSecondaryType() throws CoreException {
355
354
356
	// Wait for indexing end
355
	// Wait for indexing end
357
	AbstractJavaModelTests.waitUntilIndexesReady();
356
	AbstractJavaModelTests.waitUntilIndexesReady();
Lines 374-380 Link Here
374
	for (int i=0; i<MEASURES_COUNT; i++) {
373
	for (int i=0; i<MEASURES_COUNT; i++) {
375
		runGc();
374
		runGc();
376
		startMeasuring();
375
		startMeasuring();
377
		for (int n=0; n<ITERATIONS_COUNT; n++) {
376
		for (int n=0; n<50000; n++) {
378
			NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY);
377
			NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY);
379
			nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL);
378
			nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL);
380
		}
379
		}
Lines 392-398 Link Here
392
 * First wait that already started indexing jobs end before perform test.
391
 * First wait that already started indexing jobs end before perform test.
393
 * Perform one find before measure performance for warm-up.
392
 * Perform one find before measure performance for warm-up.
394
 */
393
 */
395
public void testPerfNameLookupFindUnknownType() throws CoreException {
394
public void testNameLookupFindUnknownType() throws CoreException {
396
395
397
	// Wait for indexing end
396
	// Wait for indexing end
398
	AbstractJavaModelTests.waitUntilIndexesReady();
397
	AbstractJavaModelTests.waitUntilIndexesReady();
Lines 413-419 Link Here
413
	for (int i=0; i<MEASURES_COUNT; i++) {
412
	for (int i=0; i<MEASURES_COUNT; i++) {
414
		runGc();
413
		runGc();
415
		startMeasuring();
414
		startMeasuring();
416
		for (int n=0; n<ITERATIONS_COUNT; n++) {
415
		for (int n=0; n<50000; n++) {
417
			NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY);
416
			NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY);
418
			nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL);
417
			nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL);
419
		}
418
		}
Lines 431-437 Link Here
431
 * First wait that already started indexing jobs end before perform test.
430
 * First wait that already started indexing jobs end before perform test.
432
 * Perform one find before measure performance for warm-up.
431
 * Perform one find before measure performance for warm-up.
433
 */
432
 */
434
public void testPerfProjectFindKnownType() throws CoreException {
433
public void testProjectFindKnownType() throws CoreException {
435
	tagAsSummary("Find known type in project", false); // do NOT put in fingerprint
434
	tagAsSummary("Find known type in project", false); // do NOT put in fingerprint
436
435
437
	// Wait for indexing end
436
	// Wait for indexing end
Lines 452-458 Link Here
452
	for (int i=0; i<MEASURES_COUNT; i++) {
451
	for (int i=0; i<MEASURES_COUNT; i++) {
453
		runGc();
452
		runGc();
454
		startMeasuring();
453
		startMeasuring();
455
		for (int n=0; n<ITERATIONS_COUNT; n++) {
454
		for (int n=0; n<50000; n++) {
456
			BIG_PROJECT.findType(fullQualifiedName);
455
			BIG_PROJECT.findType(fullQualifiedName);
457
		}
456
		}
458
		stopMeasuring();
457
		stopMeasuring();
Lines 469-475 Link Here
469
 * First wait that already started indexing jobs end before perform test.
468
 * First wait that already started indexing jobs end before perform test.
470
 * Perform one find before measure performance for warm-up.
469
 * Perform one find before measure performance for warm-up.
471
 */
470
 */
472
public void testPerfProjectFindKnownMemberType() throws CoreException {
471
public void testProjectFindKnownMemberType() throws CoreException {
473
	tagAsSummary("Find known member type in project", false); // do NOT put in fingerprint
472
	tagAsSummary("Find known member type in project", false); // do NOT put in fingerprint
474
473
475
	// Wait for indexing end
474
	// Wait for indexing end
Lines 493-499 Link Here
493
	for (int i=0; i<MEASURES_COUNT; i++) {
492
	for (int i=0; i<MEASURES_COUNT; i++) {
494
		runGc();
493
		runGc();
495
		startMeasuring();
494
		startMeasuring();
496
		for (int n=0; n<ITERATIONS_COUNT; n++) {
495
		for (int n=0; n<4000; n++) {
497
			BIG_PROJECT.findType(fullQualifiedName);
496
			BIG_PROJECT.findType(fullQualifiedName);
498
		}
497
		}
499
		stopMeasuring();
498
		stopMeasuring();
Lines 510-516 Link Here
510
 * First wait that already started indexing jobs end before perform test.
509
 * First wait that already started indexing jobs end before perform test.
511
 * Perform one find before measure performance for warm-up.
510
 * Perform one find before measure performance for warm-up.
512
 */
511
 */
513
public void testPerfProjectFindKnownSecondaryType() throws CoreException {
512
public void testProjectFindKnownSecondaryType() throws CoreException {
514
	tagAsSummary("Find known secondary type in project", false); // do NOT put in fingerprint
513
	tagAsSummary("Find known secondary type in project", false); // do NOT put in fingerprint
515
514
516
	// Wait for indexing end
515
	// Wait for indexing end
Lines 530-536 Link Here
530
	for (int i=0; i<MEASURES_COUNT; i++) {
529
	for (int i=0; i<MEASURES_COUNT; i++) {
531
		runGc();
530
		runGc();
532
		startMeasuring();
531
		startMeasuring();
533
		for (int n=0; n<ITERATIONS_COUNT; n++) {
532
		for (int n=0; n<1000; n++) {
534
			BIG_PROJECT.findType(fullQualifiedName);
533
			BIG_PROJECT.findType(fullQualifiedName);
535
		}
534
		}
536
		stopMeasuring();
535
		stopMeasuring();
Lines 547-553 Link Here
547
 * First wait that already started indexing jobs end before perform test.
546
 * First wait that already started indexing jobs end before perform test.
548
 * Perform one find before measure performance for warm-up.
547
 * Perform one find before measure performance for warm-up.
549
 */
548
 */
550
public void testPerfProjectFindUnknownType() throws CoreException {
549
public void testProjectFindUnknownType() throws CoreException {
551
	tagAsSummary("Find unknown type in project", false); // do NOT put in fingerprint
550
	tagAsSummary("Find unknown type in project", false); // do NOT put in fingerprint
552
551
553
	// Wait for indexing end
552
	// Wait for indexing end
Lines 568-574 Link Here
568
	for (int i=0; i<MEASURES_COUNT; i++) {
567
	for (int i=0; i<MEASURES_COUNT; i++) {
569
		runGc();
568
		runGc();
570
		startMeasuring();
569
		startMeasuring();
571
		for (int n=0; n<ITERATIONS_COUNT; n++) {
570
		for (int n=0; n<2000; n++) {
572
			BIG_PROJECT.findType(fullQualifiedName);
571
			BIG_PROJECT.findType(fullQualifiedName);
573
		}
572
		}
574
		stopMeasuring();
573
		stopMeasuring();
Lines 748-754 Link Here
748
 * Performance test for looking up package fragments
747
 * Performance test for looking up package fragments
749
 * (see bug 72683 Slow code assist in Display view)
748
 * (see bug 72683 Slow code assist in Display view)
750
 */
749
 */
751
public void testPerfSeekPackageFragments() throws CoreException {
750
public void testSeekPackageFragments() throws CoreException {
752
	assertNotNull("We should have the 'BigProject' in workspace!", BIG_PROJECT);
751
	assertNotNull("We should have the 'BigProject' in workspace!", BIG_PROJECT);
753
	class PackageRequestor implements IJavaElementRequestor {
752
	class PackageRequestor implements IJavaElementRequestor {
754
		ArrayList pkgs = new ArrayList();
753
		ArrayList pkgs = new ArrayList();
Lines 784-790 Link Here
784
	for (int i = 0; i < MEASURES_COUNT; i++) {
783
	for (int i = 0; i < MEASURES_COUNT; i++) {
785
		runGc();
784
		runGc();
786
		startMeasuring();
785
		startMeasuring();
787
		for (int j = 0; j < ITERATIONS_COUNT; j++) {
786
		for (int j = 0; j < 50000; j++) {
788
			getNameLookup(BIG_PROJECT).seekPackageFragments("org.eclipse.jdt.core.tests" + j + "0.performance" + j, false/*not partial match*/, requestor);
787
			getNameLookup(BIG_PROJECT).seekPackageFragments("org.eclipse.jdt.core.tests" + j + "0.performance" + j, false/*not partial match*/, requestor);
789
		}
788
		}
790
		stopMeasuring();
789
		stopMeasuring();
Lines 793-798 Link Here
793
	assertPerformance();
792
	assertPerformance();
794
}
793
}
795
794
795
public void testCloseProjects() throws JavaModelException {
796
	// store current settings
797
	long oldSnapInterval = ENV.getWorkspace().getDescription().getSnapshotInterval();
798
	boolean oldAutoBuildPolicy = ENV.isAutoBuilding();
799
	
800
	// prevent snapshots and autobuilds from disturbing our measures
801
	ENV.getWorkspace().getDescription().setSnapshotInterval(100000);
802
	ENV.getWorkspace().getDescription().setAutoBuilding(false);
803
	
804
	try {
805
		int length=ALL_PROJECTS.length;
806
		// Warm-up
807
		for (int i=0; i<WARMUP_COUNT; i++) {
808
			for (int j=0; j<length; j++) {
809
				ENV.closeProject(ALL_PROJECTS[j].getPath());
810
			}
811
			for (int j=0; j<length; j++) {
812
				ENV.openProject(ALL_PROJECTS[j].getPath());
813
			}
814
		}
815
	
816
		// Measures
817
		for (int i=0; i<MEASURES_COUNT; i++) {
818
			AbstractJavaModelTests.waitUntilIndexesReady();
819
			// should not be autobuilding...
820
			if (ENV.isAutoBuilding()) {
821
				ENV.waitForAutoBuild();
822
			}
823
			runGc();
824
			startMeasuring();
825
			for (int j=0; j<length; j++) {
826
				ENV.closeProject(ALL_PROJECTS[j].getPath());
827
			}
828
			stopMeasuring();
829
			for (int j=0; j<length; j++) {
830
				ENV.openProject(ALL_PROJECTS[j].getPath());
831
			}
832
		}
833
		// Commit
834
		commitMeasurements();
835
		assertPerformance();
836
	}
837
	finally {
838
		// restore previous settings
839
		ENV.getWorkspace().getDescription().setSnapshotInterval(oldSnapInterval);
840
		ENV.getWorkspace().getDescription().setAutoBuilding(oldAutoBuildPolicy);
841
	}
842
}
843
844
public void testStartJDTPlugin() throws JavaModelException {
845
	// store current settings
846
	long oldSnapInterval = ENV.getWorkspace().getDescription().getSnapshotInterval();	
847
	// prevent snapshots and autobuilds from disturbing our measures
848
	ENV.getWorkspace().getDescription().setSnapshotInterval(100000);
849
	try {
850
		// Warm-up
851
		for (int i=0; i<WARMUP_COUNT; i++) {
852
			simulateExitRestart();
853
			JavaCore.initializeAfterLoad(null);
854
			AbstractJavaModelTests.waitUntilIndexesReady();
855
		}
856
	
857
		// Measures
858
		for (int i=0; i<MEASURES_COUNT; i++) {
859
			// shutdwon
860
			simulateExit();			
861
			runGc();
862
			startMeasuring();
863
			// restart
864
			simulateRestart();
865
			JavaCore.initializeAfterLoad(null);
866
			AbstractJavaModelTests.waitUntilIndexesReady();
867
			stopMeasuring();
868
		}
869
		// Commit
870
		commitMeasurements();
871
		assertPerformance();
872
	}
873
	catch (CoreException ex) {
874
		// do nothing
875
	}
876
	finally {
877
		// restore previous settings
878
		ENV.getWorkspace().getDescription().setSnapshotInterval(oldSnapInterval);
879
	}
880
}
881
796
protected void resetCounters() {
882
protected void resetCounters() {
797
	// do nothing
883
	// do nothing
798
}
884
}
(-)src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java (-7 / +10 lines)
Lines 549-564 Link Here
549
		for (int i = 0; i < 2; i++) {
549
		for (int i = 0; i < 2; i++) {
550
			ASTParser parser = ASTParser.newParser(astLevel);
550
			ASTParser parser = ASTParser.newParser(astLevel);
551
			parser.setSource(unit);
551
			parser.setSource(unit);
552
			parser.setResolveBindings(astLevel!=AST.JLS2);
552
			parser.setResolveBindings(false);
553
			parser.createAST(null);
553
			parser.createAST(null);
554
		}
554
		}
555
555
556
		// Measures
556
		// Measures
557
		for (int i = 0; i < MEASURES_COUNT; i++) {
557
		int measures = MEASURES_COUNT * 2;
558
		int iterations = ITERATIONS_COUNT >> 1;
559
		for (int i = 0; i < measures; i++) {
558
			ASTNode result = null;
560
			ASTNode result = null;
559
			runGc();
561
			runGc();
560
			startMeasuring();
562
			startMeasuring();
561
			for (int j=0; j<ITERATIONS_COUNT; j++) {
563
			for (int j=0; j<iterations; j++) {
562
				ASTParser parser = ASTParser.newParser(astLevel);
564
				ASTParser parser = ASTParser.newParser(astLevel);
563
				parser.setSource(unit);
565
				parser.setSource(unit);
564
				parser.setResolveBindings(false);
566
				parser.setResolveBindings(false);
Lines 569-575 Link Here
569
			CompilationUnit compilationUnit = (CompilationUnit) result;
571
			CompilationUnit compilationUnit = (CompilationUnit) result;
570
			CommentMapperASTVisitor visitor = new CommentMapperASTVisitor(compilationUnit);
572
			CommentMapperASTVisitor visitor = new CommentMapperASTVisitor(compilationUnit);
571
			compilationUnit.accept(visitor);
573
			compilationUnit.accept(visitor);
572
			nodesCount += visitor.nodes * ITERATIONS_COUNT;
574
			nodesCount += visitor.nodes * iterations;
573
		}
575
		}
574
576
575
		// Commit
577
		// Commit
Lines 580-586 Link Here
580
	/**
582
	/**
581
	 * @deprecated To reduce deprecated warnings
583
	 * @deprecated To reduce deprecated warnings
582
	 */
584
	 */
583
	public void testDomAstCreationJLS2() throws JavaModelException {
585
	public void testPerfDomAstCreationJLS2() throws JavaModelException {
584
		tagAsSummary("DOM AST tree for one file using JLS2", true); // put in fingerprint
586
		tagAsSummary("DOM AST tree for one file using JLS2", true); // put in fingerprint
585
587
586
		ICompilationUnit unit = getCompilationUnit("org.eclipse.jdt.core", "org.eclipse.jdt.internal.compiler.parser", "Parser.java");
588
		ICompilationUnit unit = getCompilationUnit("org.eclipse.jdt.core", "org.eclipse.jdt.internal.compiler.parser", "Parser.java");
Lines 593-599 Link Here
593
	/**
595
	/**
594
	 * Performance DOM/AST creation on the entire workspace using JLS3.
596
	 * Performance DOM/AST creation on the entire workspace using JLS3.
595
	 */
597
	 */
596
	public void testDomAstCreationJLS3() throws JavaModelException {
598
	public void testPerfDomAstCreationJLS3() throws JavaModelException {
597
		tagAsSummary("DOM AST tree for one file using JLS3", false); // put in fingerprint
599
		tagAsSummary("DOM AST tree for one file using JLS3", false); // put in fingerprint
598
600
599
		ICompilationUnit unit = getCompilationUnit("org.eclipse.jdt.core", "org.eclipse.jdt.internal.compiler.parser", "Parser.java");
601
		ICompilationUnit unit = getCompilationUnit("org.eclipse.jdt.core", "org.eclipse.jdt.internal.compiler.parser", "Parser.java");
Lines 711-717 Link Here
711
			null);
713
			null);
712
714
713
		// Measures
715
		// Measures
714
		for (int i = 0; i < MEASURES_COUNT; i++) {
716
		int measures = MEASURES_COUNT * 2;
717
		for (int i = 0; i < measures; i++) {
715
			runGc();
718
			runGc();
716
			startMeasuring();
719
			startMeasuring();
717
			parser.createASTs(compilationUnits, new String[0], new ASTRequestor() {/* do nothing*/}, null);
720
			parser.createASTs(compilationUnits, new String[0], new ASTRequestor() {/* do nothing*/}, null);
(-)src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java (-24 / +32 lines)
Lines 23-33 Link Here
23
import org.eclipse.jdt.core.*;
23
import org.eclipse.jdt.core.*;
24
import org.eclipse.jdt.core.tests.builder.TestingEnvironment;
24
import org.eclipse.jdt.core.tests.builder.TestingEnvironment;
25
import org.eclipse.jdt.core.tests.junit.extension.TestCase;
25
import org.eclipse.jdt.core.tests.junit.extension.TestCase;
26
import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests;
26
import org.eclipse.jdt.core.tests.performance.util.JdtCorePerformanceMeter;
27
import org.eclipse.jdt.core.tests.performance.util.JdtCorePerformanceMeter;
27
import org.eclipse.jdt.core.tests.util.Util;
28
import org.eclipse.jdt.core.tests.util.Util;
28
import org.eclipse.jdt.internal.compiler.batch.Main;
29
import org.eclipse.jdt.internal.compiler.batch.Main;
29
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
30
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
30
import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
31
import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
32
import org.eclipse.jdt.internal.core.JavaCorePreferenceInitializer;
31
import org.eclipse.jdt.internal.core.JavaModelManager;
33
import org.eclipse.jdt.internal.core.JavaModelManager;
32
import org.eclipse.jdt.internal.core.JavaProject;
34
import org.eclipse.jdt.internal.core.JavaProject;
33
import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
35
import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
Lines 794-808 Link Here
794
					}
796
					}
795
				};
797
				};
796
				IWorkspace workspace = ResourcesPlugin.getWorkspace();
798
				IWorkspace workspace = ResourcesPlugin.getWorkspace();
797
				if (workspace.isTreeLocked()) {
799
				workspace.run(
798
					compilation.run(null/*no progress available*/);
800
					compilation,
799
				} else {
801
					null/*don't take any lock*/,
800
					workspace.run(
802
					IWorkspace.AVOID_UPDATE,
801
						compilation,
803
					null/*no progress available here*/);
802
						null/*don't take any lock*/,
803
						IWorkspace.AVOID_UPDATE,
804
						null/*no progress available here*/);
805
				}
806
				stopMeasuring();
804
				stopMeasuring();
807
			}
805
			}
808
		}
806
		}
Lines 966-987 Link Here
966
		for (int i = 0; i < MEASURES_COUNT; i++) {
964
		for (int i = 0; i < MEASURES_COUNT; i++) {
967
			runGc();
965
			runGc();
968
			NullPrintWriter nullPrint= new NullPrintWriter();
966
			NullPrintWriter nullPrint= new NullPrintWriter();
967
			Main main = new Main(nullPrint, nullPrint, false);
969
			startMeasuring();
968
			startMeasuring();
970
			final Main main = new Main(nullPrint, nullPrint, false);
969
			main.compile(Main.tokenize(cmdLine));
971
			IWorkspaceRunnable compilation = new IWorkspaceRunnable() {
972
				public void run(IProgressMonitor monitor) throws CoreException {
973
					main.compile(Main.tokenize(cmdLine));
974
				}
975
			};
976
			if (workspace.isTreeLocked()) {
977
				compilation.run(null/*no progress available*/);
978
			} else {
979
				workspace.run(
980
					compilation,
981
					null/*don't take any lock*/,
982
					IWorkspace.AVOID_UPDATE,
983
					null/*no progress available here*/);
984
			}
985
			stopMeasuring();
970
			stopMeasuring();
986
			if (!"none".equals(COMPILER_OUTPUT_DIR)) {
971
			if (!"none".equals(COMPILER_OUTPUT_DIR)) {
987
				cleanupDirectory(new File(COMPILER_OUTPUT_DIR));
972
				cleanupDirectory(new File(COMPILER_OUTPUT_DIR));
Lines 1239-1244 Link Here
1239
		}		
1224
		}		
1240
		return null;
1225
		return null;
1241
	}
1226
	}
1227
	/*
1228
	 * Simulate a save/exit of the workspace
1229
	 */
1230
	protected void simulateExit() throws CoreException {
1231
		AbstractJavaModelTests.waitForAutoBuild();
1232
		ResourcesPlugin.getWorkspace().save(true/*full save*/, null/*no progress*/);
1233
		JavaModelManager.getJavaModelManager().shutdown();
1234
	}
1235
	/*
1236
	 * Simulate a save/exit/restart of the workspace
1237
	 */
1238
	protected void simulateExitRestart() throws CoreException {
1239
		simulateExit();
1240
		simulateRestart();
1241
	}
1242
	/*
1243
	 * Simulate a restart of the workspace
1244
	 */
1245
	protected void simulateRestart() throws CoreException {
1246
		JavaModelManager.doNotUse(); // reset the MANAGER singleton
1247
		JavaModelManager.getJavaModelManager().startup();
1248
		new JavaCorePreferenceInitializer().initializeDefaultPreferences();
1249
	}
1242
1250
1243
	/**
1251
	/**
1244
	 * Split a list of compilation units in several arrays.
1252
	 * Split a list of compilation units in several arrays.

Return to bug 178499