blob: 339dcbf6a27c2fddf458dfddff45be40ffca4572 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2018 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.cdo.benchmarks.tests;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
import org.eclipse.papyrus.uml.tools.utils.internal.preferences.NameElementNamingStrategyPreferenceInitializer;
import org.eclipse.papyrus.uml.tools.utils.internal.preferences.NamedElementIndexNamingStrategyEnum;
import org.junit.AfterClass;
import org.junit.BeforeClass;
/**
* @author VL222926
*
*/
public abstract class AbstractQuickIndexCreationTest extends AbstractPerfTest {
protected static final ExecutionTimeHelperMerger merger = new ExecutionTimeHelperMerger("Time for creation with quick index");
@BeforeClass
public static final void initTest() {
// we need to initialize it before usingUMLElementTypes.CLASS, because, it is Papyrus that fills the GMF registry used by UMLElementTypes.CLASS.
// without doing that, the value will be null
ElementTypeSetConfigurationRegistry.getInstance();
IPreferenceStore store = org.eclipse.papyrus.uml.tools.utils.Activator.getDefault().getPreferenceStore();
store.setValue(NameElementNamingStrategyPreferenceInitializer.NAMED_ELEMENT_INDEX_INITIALIZATION, NamedElementIndexNamingStrategyEnum.QUICK_INDEX_INITIALIZATION.toString());
}
@AfterClass
public static final void endTest() {
IPreferenceStore store = org.eclipse.papyrus.uml.tools.utils.Activator.getDefault().getPreferenceStore();
store.setToDefault(NameElementNamingStrategyPreferenceInitializer.NAMED_ELEMENT_INDEX_INITIALIZATION);
if (merger.isFull()) {
System.out.println(merger.toString());
}
}
}