]>
Commit | Line | Data |
---|---|---|
c04ea8eb EK |
1 | package no.uio.ifi.refaktor.benchmark; |
2 | ||
3 | import static org.junit.Assert.assertTrue; | |
c7844d42 | 4 | import no.uio.ifi.refaktor.change.changers.ProjectWideExtractAndMoveMethodChanger; |
2b4a9262 | 5 | import no.uio.ifi.refaktor.change.changers.RefaktorChanger; |
c04ea8eb EK |
6 | import no.uio.ifi.refaktor.utils.RefaktorDebug; |
7 | ||
8 | import org.eclipse.core.runtime.CoreException; | |
9 | import org.eclipse.core.runtime.NullProgressMonitor; | |
261675a2 | 10 | import org.junit.Assume; |
c04ea8eb EK |
11 | import org.junit.Test; |
12 | ||
13 | public 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 | } |