Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{div:class=navigation}
{table:width=100%}
 {tr}
  {td} {align:left}[Previous|Rename Test] {span:class=sep}\|{span} {span:class=text}Rename Test{span}{align} {td}
  {td} {align:center}[Top|Writing Tests for Plugins] {span:class=sep}\|{span} {span:class=text}Writing Tests for Plugins{span}{align} {td}
  {td} {align:right}[Next|Find Usages Test] {span:class=sep}\|{span} {span:class=text}Find Usages Test{span}{align} {td}
 {tr}
{table}
{div}

In this test we will check if the folding builder, implemented in the previous tutorial, works as we expect.

1. Define test data

Create a file "FoldingTestData.java".

Code Block

public class Test {
    public static void main(String[] args) <fold text='{...}'>{
        System.out.println("<fold text='http://en.wikipedia.org/'>simple:website</fold>");
    }</fold>
}

2. Define a test

Code Block

public void testFolding() {
    myFixture.configureByFiles("DefaultTestData.simple");
    myFixture.testFolding(getTestDataPath() + "/FoldingTestData.java");
}

3. Run the test

Run the test and make sure it's green.

Wiki Markup
{div:class=navigation}
{table:width=100%}
 {tr}
  {td} {align:left}[Previous|Rename Test] {span:class=sep}\|{span} {span:class=text}Rename Test{span}{align} {td}
  {td} {align:center}[Top|Writing Tests for Plugins] {span:class=sep}\|{span} {span:class=text}Writing Tests for Plugins{span}{align} {td}
  {td} {align:right}[Next|Find Usages Test] {span:class=sep}\|{span} {span:class=text}Find Usages Test{span}{align} {td}
 {tr}
{table}
{div}

 

Redirect
locationhttp://www.jetbrains.org/intellij/sdk/docs/tutorials/writing_tests_for_plugins/folding_test.html