New Testing Framework

We've started working on a new framework for plugins testing. In this
new model we're addressing several shortcomings of old one, mainly:

1. The need to extend certain TestCases. We see this as a major
limitation, and this requirement removed in new testing framework. You
can extend your own test cases, use TestNG, or even write stand-alone
applications.

2. Complexity of environment configuration. We believe it's much simpler
to setup a complicated testing environment now with a new model.

The forthcoming EAP build has some early prototype of new testing
framework. We'd like you to take a look at it and provide a feedback,
whether you like it or not, request additional features, or give more ideas.

While it completely lacks documentation right now, it should pretty
straightforward to use. Here's a sample from one of our actual test case:


protected void setUp() throws Exception {
super.setUp();

final TestFixtureBuilder]]> testFixtureBuilder =
IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder();

final WebModuleFixtureBuilder moduleBuilder =
testFixtureBuilder.addModule(WebModuleFixtureBuilder.class);

moduleBuilder.addContentRoot(getTestDataPath());
moduleBuilder.addWebRoot(getTestDataPath(), "/");
moduleBuilder.setWebXml(getTestDataPath() + "/WEB-INF/web.xml");

moduleBuilder.addLibrary(LIBRARY_NAME, new String[]
{getTestDataPath() + "/classes"});


myFixture = testFixtureBuilder.getFixture();
myFixture.setUp();

myModule = moduleBuilder.getFixture().getModule();
}

protected void tearDown() throws Exception {
myFixture.tearDown();
super.tearDown();
}

1 comment
Comment actions Permalink

That's great! Will a couple examples be included in the next EAP build?
Naturally I am mainly interested in unit testing intentions and
inspections, so an example of those would be most welcome.

By the way, your message did not appear on the web forum, only in the
NNTP news group. Is something amiss with sync?

Bas

Mike Aizatsky (JetBrains) wrote:

We've started working on a new framework for plugins testing. In this
new model we're addressing several shortcomings of old one, mainly:

1. The need to extend certain TestCases. We see this as a major
limitation, and this requirement removed in new testing framework. You
can extend your own test cases, use TestNG, or even write stand-alone
applications.

2. Complexity of environment configuration. We believe it's much simpler
to setup a complicated testing environment now with a new model.

The forthcoming EAP build has some early prototype of new testing
framework. We'd like you to take a look at it and provide a feedback,
whether you like it or not, request additional features, or give more ideas.

While it completely lacks documentation right now, it should pretty
straightforward to use. Here's a sample from one of our actual test case:


protected void setUp() throws Exception {
super.setUp();

final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder =
IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder();

final WebModuleFixtureBuilder moduleBuilder =
testFixtureBuilder.addModule(WebModuleFixtureBuilder.class);

moduleBuilder.addContentRoot(getTestDataPath());
moduleBuilder.addWebRoot(getTestDataPath(), "/");
moduleBuilder.setWebXml(getTestDataPath() + "/WEB-INF/web.xml");

moduleBuilder.addLibrary(LIBRARY_NAME, new String[]
{getTestDataPath() + "/classes"});


myFixture = testFixtureBuilder.getFixture();
myFixture.setUp();

myModule = moduleBuilder.getFixture().getModule();
}

protected void tearDown() throws Exception {
myFixture.tearDown();
super.tearDown();
}

0

Please sign in to leave a comment.