From ba98ab1ef4202d0489df0ae2dd2aee8fe6f378d4 Mon Sep 17 00:00:00 2001 From: Quentin Le Menez Date: Thu, 15 Feb 2018 17:10:08 +0100 Subject: Bug 531190 - [Releng] Remove generated tests framework and plugins - Remove the generated tests framework - Remove the associated dev plugins and nature to the tests plugins - Remove the xtend files for test generation - Remove the outdated all encompassing test suite - Rewire the dev menu plugin to plain old src instead of src/main/java - Move the junit framework plugins to the root of the junit test folder Change-Id: Id2c0c18762c7c917de93430d3ace2f48940c1297 Signed-off-by: Quentin Le Menez --- .../framework/m2t/xtend/templates/Importator.xtend | 87 ---------------------- 1 file changed, 87 deletions(-) delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend (limited to 'tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend') diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend deleted file mode 100644 index bb720f81ee2..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend +++ /dev/null @@ -1,87 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import java.util.Map -import com.google.common.collect.Maps -import com.google.common.base.Joiner -import com.google.common.collect.Iterables -import com.google.common.collect.Ordering -import javax.inject.Singleton -import java.io.File - -/** - * Extensions for managing imports in generated Java files. - */ - @Singleton -class Importator { - Map> importsByFile = Maps.newHashMap - ThreadLocal tlFile = new ThreadLocal; - - def reset() { - imports.clear - } - - def CharSequence managingImports(File file, () => CharSequence template) { - var CharSequence result = null - - tlFile.set(file) - try { - result = importify(template.apply) - } finally { - tlFile.remove - importsByFile.remove(file) - } - - result - } - - private def file() { - tlFile.get - } - - def imports() { - if (importsByFile.containsKey(file)) - importsByFile.get(file) - else - Maps.newHashMap => [ - importsByFile.put(file, it) - ] - } - - def String imported(String qualifiedClassName) { - val simpleName = qualifiedClassName.substring(qualifiedClassName.lastIndexOf('.') + 1) - val existing = imports.get(simpleName) - - if ((simpleName == qualifiedClassName) || ((existing != null) && (existing != qualifiedClassName))) { - // Cannot import the same name again - qualifiedClassName - } else { - imports.put(simpleName, qualifiedClassName) - simpleName - } - } - - def String markImports() { - "$$$imports$$$" - } - - private def CharSequence importify(CharSequence text) { - val importsText = Joiner.on(System.getProperty("line.separator")).join( - Iterables.transform(Ordering.natural.sortedCopy(imports.values), [f|'import ' + f + ';']) - ) - - text.toString.replaceFirst("\\$\\$\\$imports\\$\\$\\$", importsText) - } -} \ No newline at end of file -- cgit v1.2.3