Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate compare performance tests to JUnit 5 #749

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions team/tests/org.eclipse.compare.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Require-Bundle: org.junit,
org.eclipse.core.tests.harness,
org.eclipse.core.filesystem,
org.eclipse.team.ui
Import-Package: org.junit.jupiter.api,
org.junit.platform.suite.api
Bundle-Activator: org.eclipse.compare.tests.CompareTestPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@
*******************************************************************************/
package org.eclipse.compare.tests.performance;

import junit.framework.Test;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;

import junit.framework.TestSuite;

/**
* @since 3.1
*/
@Suite
@SelectClasses({RangeDifferencerTest.class})
public class PerformanceTestSuite extends TestSuite {

public static Test suite() {
TestSuite suite= new TestSuite("Compare performance tests"); //$NON-NLS-1$
//$JUnit-BEGIN$
suite.addTestSuite(RangeDifferencerTest.class);
//$JUnit-END$
return suite;
}
//
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.compare.tests.performance;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.eclipse.compare.contentmergeviewer.ITokenComparator;
import org.eclipse.compare.internal.DocLineComparator;
import org.eclipse.compare.rangedifferencer.RangeDifference;
Expand All @@ -21,17 +23,14 @@
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.test.performance.Dimension;
import org.eclipse.test.performance.PerformanceTestCase;
import org.eclipse.test.performance.PerformanceTestCaseJunit5;
import org.junit.jupiter.api.Test;

public class RangeDifferencerTest extends PerformanceTestCase {
public class RangeDifferencerTest extends PerformanceTestCaseJunit5 {


// static private final String EXPLANATION = "Performance decrease caused by changes in the compare framework, see bug 210688";

public RangeDifferencerTest(String name) {
super(name);
}

/*
* Creates document with 5000 lines.
* Parameter code determines where additional lines are added.
Expand Down Expand Up @@ -62,6 +61,7 @@ private IDocument createDocument(int code) {
return new Document(sb.toString());
}

@Test
public void testLargeDocument() {

tagAsGlobalSummary("3-way compare, 5000 lines", Dimension.ELAPSED_PROCESS); //$NON-NLS-1$
Expand Down
Loading