Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2015-01-19 05:19:41 -0500
committerAxel Richard2015-01-19 05:19:41 -0500
commit249f5f4f5e32294dea13397e412cf2b7bfa38976 (patch)
tree9daadaaaa87b1642c3b695246c1ecaa4fb92e9e0 /performance
parent28ae980395ca30ee65cba808e1d917c585745b32 (diff)
downloadorg.eclipse.emf.compare-249f5f4f5e32294dea13397e412cf2b7bfa38976.tar.gz
org.eclipse.emf.compare-249f5f4f5e32294dea13397e412cf2b7bfa38976.tar.xz
org.eclipse.emf.compare-249f5f4f5e32294dea13397e412cf2b7bfa38976.zip
Fix csv files of performances tests (temporary commit)
Change-Id: Ie4268307cf3bf556a612f9126ba8ea2c05ef11fb Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Diffstat (limited to 'performance')
-rw-r--r--performance/org.eclipse.emf.compare.tests.performance/pom.xml2
-rw-r--r--performance/org.eclipse.emf.compare.tests.performance/src/org/eclipse/emf/compare/tests/performance/FixCSV.java71
2 files changed, 72 insertions, 1 deletions
diff --git a/performance/org.eclipse.emf.compare.tests.performance/pom.xml b/performance/org.eclipse.emf.compare.tests.performance/pom.xml
index 8f88f9fde..f82231760 100644
--- a/performance/org.eclipse.emf.compare.tests.performance/pom.xml
+++ b/performance/org.eclipse.emf.compare.tests.performance/pom.xml
@@ -20,7 +20,7 @@
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<includes>
- <include>org/eclipse/emf/compare/tests/performance/PerformanceSuite.class</include>
+ <include>org/eclipse/emf/compare/tests/performance/FixCSV.class</include>
</includes>
<argLine>-Xmx2048m -XX:MaxPermSize=256m</argLine>
</configuration>
diff --git a/performance/org.eclipse.emf.compare.tests.performance/src/org/eclipse/emf/compare/tests/performance/FixCSV.java b/performance/org.eclipse.emf.compare.tests.performance/src/org/eclipse/emf/compare/tests/performance/FixCSV.java
new file mode 100644
index 000000000..9da1b9932
--- /dev/null
+++ b/performance/org.eclipse.emf.compare.tests.performance/src/org/eclipse/emf/compare/tests/performance/FixCSV.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.tests.performance;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.junit.Test;
+
+/**
+ * Temporary file: reorganize csv files of performances tests.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ *
+ */
+public class FixCSV {
+
+ @Test
+ public void test() throws IOException {
+ Collection<String> scenarios = new ArrayList<String>();
+ scenarios.add("TestCompare");
+ scenarios.add("TestConflict");
+ scenarios.add("TestDiff");
+ scenarios.add("TestEqui");
+ scenarios.add("TestLogicalModel");
+ scenarios.add("TestMatchContent");
+ scenarios.add("TestMatchId");
+ scenarios.add("TestPostComparisonGMF");
+ scenarios.add("TestPostComparisonUML");
+ scenarios.add("TestPostMatchUML");
+ scenarios.add("TestReq");
+
+ Collection<String> tests = new ArrayList<String>();
+ tests.add("-system_time.csv");
+ tests.add("-heap_delta.csv");
+ tests.add("-heap_peek.csv");
+
+ for (String scenario : scenarios) {
+ for (String test : tests) {
+ File output = new File(scenario + test);
+ if (output.exists()) {
+ Path path = Paths.get(output.toURI());
+ Charset charset = StandardCharsets.UTF_8;
+ String content = new String(Files.readAllBytes(path), charset);
+ // Replace first line
+ content = content
+ .replaceFirst("Large UML",
+ "Small Split UML, Nominal Split UML, Large UML, Large Split UML");
+ // Delete 2015 lines
+ content = content.replaceAll("2015/01/.*", "");
+ Files.write(path, content.getBytes(charset));
+ }
+ }
+ }
+ }
+}

Back to the top