]> git.uio.no Git - ifi-stolz-refaktor.git/blame - software/no.uio.ifi.refaktor.benchmark/src/no/uio/ifi/refaktor/benchmark/SearchBasedExtractAndMoveMethodChangerBenchmark.java
SearchBasedExtractAndMoveMethodChangerBenchmark: adding system parameter
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor.benchmark / src / no / uio / ifi / refaktor / benchmark / SearchBasedExtractAndMoveMethodChangerBenchmark.java
CommitLineData
c04ea8eb
EK
1package no.uio.ifi.refaktor.benchmark;
2
3import static org.junit.Assert.assertTrue;
c7844d42 4import no.uio.ifi.refaktor.change.changers.ProjectWideExtractAndMoveMethodChanger;
2b4a9262 5import no.uio.ifi.refaktor.change.changers.RefaktorChanger;
c04ea8eb
EK
6import no.uio.ifi.refaktor.utils.RefaktorDebug;
7
8import org.eclipse.core.runtime.CoreException;
9import org.eclipse.core.runtime.NullProgressMonitor;
261675a2 10import org.junit.Assume;
c04ea8eb
EK
11import org.junit.Test;
12
13public class SearchBasedExtractAndMoveMethodChangerBenchmark extends AbstractSearchBasedExtractAndMoveMethodBenchmark {
14
c04ea8eb
EK
15 @Test
16 public void bench() throws Throwable {
261675a2
EK
17 Assume.assumeTrue(Boolean.parseBoolean(System.getProperty("refaktor.junit.runAll", "false")));
18
c04ea8eb
EK
19 assertTrue(getProject().exists());
20
21 makeChangeToWorkspace();
22
23 getStatistics().recordTimeUsed();
24 printStatistics();
25 }
26
27 private void makeChangeToWorkspace() throws CoreException {
c7844d42 28 RefaktorChanger changer = new ProjectWideExtractAndMoveMethodChanger(getProject(), getStatistics());
c04ea8eb 29 changer.checkPreconditions();
a554b0ce 30 changer.execute(new NullProgressMonitor());
c04ea8eb
EK
31 }
32
33 private void printStatistics() {
34 RefaktorDebug.println("Time used on analysis and change: " + getStatistics().getTimeUsed());
35 }
36}