01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.ui.tests.performance.parts;
11:
12: import junit.framework.Test;
13: import junit.framework.TestSuite;
14:
15: import org.eclipse.pde.internal.core.schema.Schema;
16: import org.eclipse.pde.internal.core.schema.SchemaDescriptor;
17: import org.eclipse.test.performance.Dimension;
18:
19: /**
20: * SchemaLoaderPerfTest
21: *
22: */
23: public class SchemaLoaderPerfTest extends AbstractSchemaPerfTest {
24:
25: private boolean fAbbreviated;
26:
27: /**
28: * @return
29: */
30: public static Test suite() {
31: return new TestSuite(SchemaLoaderPerfTest.class);
32: }
33:
34: /**
35: * @throws Exception
36: */
37: public void testSchemaUnabbreviated() throws Exception {
38: fAbbreviated = false;
39: fTestIterations = 5;
40: fWarmupIterations = 50;
41: fRuns = 600;
42: executeTestRun();
43: }
44:
45: /**
46: * @throws Exception
47: */
48: public void testSchemaAbbreviated() throws Exception {
49: fAbbreviated = true;
50: fTestIterations = 5;
51: fWarmupIterations = 50;
52: fRuns = 3000;
53: tagAsSummary(
54: "Loading " + fTestIterations + " large schemas", Dimension.ELAPSED_PROCESS); //$NON-NLS-1$
55: executeTestRun();
56: }
57:
58: /* (non-Javadoc)
59: * @see org.eclipse.pde.ui.tests.performance.parts.AbstractSchemaPerfTest#executeTest()
60: */
61: protected void executeTest() throws Exception {
62: SchemaDescriptor descriptor = new SchemaDescriptor(fXSDFile);
63: Schema schema = (Schema) descriptor.getSchema(fAbbreviated);
64: if (schema.getName() == null) {
65: throw new Exception(
66: "ERROR: Extension point schema name missing"); //$NON-NLS-1$
67: }
68: }
69:
70: }
|