anonymous tests

This commit is contained in:
Konstantin Bulenkov
2012-01-31 17:21:22 +01:00
parent c2dcc5229d
commit 80ccdf22ba
10 changed files with 115 additions and 9 deletions
+10
View File
@@ -0,0 +1,10 @@
class Anonymous {
int num1;
int num2;
Object o = new Object(){
int num = 1;
};
Anonymous() {}
void foo() {}
}
@@ -24,8 +24,10 @@ public class JavaFileStructureSelectionTest extends JavaFileStructureTestCase {
return "selection";
}
public void testField() throws Exception {checkTree();}
public void testMethod() throws Exception {checkTree();}
public void testConstructor() throws Exception {checkTree();}
public void testInsideClass() throws Exception {checkTree();}
public void testField() throws Exception {checkTree();}
public void testMethod() throws Exception {checkTree();}
public void testConstructor() throws Exception {checkTree();}
public void testInsideClass() throws Exception {checkTree();}
public void testAnonymous() throws Exception {checkTree();}
public void testAnonymousInAnonymous() throws Exception {checkTree();}
}
@@ -33,6 +33,9 @@ public abstract class JavaFileStructureTestCase extends FileStructureTestBase {
public void setUp() throws Exception {
super.setUp();
myShowAnonymousByDefault = PropertiesComponent.getInstance().getBoolean(getAnonymousPropertyName(), false);
if (getTestName(false).contains("Anonymous")) {
setShowAnonymous(true);
}
}
@Override
@@ -40,6 +43,11 @@ public abstract class JavaFileStructureTestCase extends FileStructureTestBase {
return "java";
}
public void setShowAnonymous(boolean show) throws Exception {
myPopup.setTreeActionState(JavaAnonymousClassesNodeProvider.class, show);
update();
}
@Override
public void tearDown() throws Exception {
PropertiesComponent.getInstance().setValue(getAnonymousPropertyName(), Boolean.toString(myShowAnonymousByDefault));