Skip to content

Commit d957ffe

Browse files
author
Vitaliy Boyko
committed
Updated test framework to Junit 4 and fixed ignored tests
1 parent 24e9647 commit d957ffe

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,13 @@ idea {
103103
generatedSourceDirs += file('gen')
104104
}
105105
}
106+
107+
dependencies {
108+
testImplementation 'junit:junit:4.13'
109+
}
110+
111+
test {
112+
useJUnit()
113+
114+
maxHeapSize = '1G'
115+
}

tests/com/magento/idea/magento2plugin/actions/generation/generator/BaseGeneratorTestCase.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,29 @@
66

77
import com.intellij.psi.PsiDirectory;
88
import com.intellij.psi.PsiFile;
9+
import com.intellij.testFramework.LightPlatformTestCase;
910
import com.magento.idea.magento2plugin.BaseProjectTestCase;
1011
import com.magento.idea.magento2plugin.magento.packages.File;
1112
import com.magento.idea.magento2plugin.project.util.GetProjectBasePath;
13+
import org.junit.Before;
1214

1315
abstract public class BaseGeneratorTestCase extends BaseProjectTestCase {
1416
private static final String testDataFolderPath = "testData" + File.separator + "actions" + File.separator;
1517
private static final String fixturesFolderPath = "generation" + File.separator + "generator" + File.separator;
1618

1719
@Override
20+
@Before
1821
protected void setUp() throws Exception {
1922
super.setUp();
2023
myFixture.setTestDataPath(testDataFolderPath);
2124
}
2225

26+
@Override
27+
protected void tearDown() throws Exception {
28+
super.tearDown();
29+
LightPlatformTestCase.closeAndDeleteProject();
30+
}
31+
2332
protected String getFixturePath(String fileName) {
2433
return prepareFixturePath(fileName, fixturesFolderPath);
2534
}

0 commit comments

Comments
 (0)