| /***************************************************************************** |
| * 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-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * 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 AbstractUniqueIndexCreationTest extends AbstractPerfTest { |
| |
| protected static final ExecutionTimeHelperMerger merger = new ExecutionTimeHelperMerger("Time for creation with unique 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.UNIQUE_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()); |
| } |
| } |
| |
| } |