Skip to content
Permalink
Browse files

[JENKINS-27505] Collapse tests for JENKINS-27505 to save execution time.

  • Loading branch information...
ikedam committed Apr 11, 2015
1 parent 236632b commit f0a88e65be79628b4cd407b0d7576d7a1abcdd9e
Showing with 29 additions and 28 deletions.
  1. +29 −28 test/src/test/groovy/lib/form/TextAreaTest.groovy
@@ -73,36 +73,37 @@ class TextAreaTest {

}

@Test
public void testText() {
def TEXT_TO_TEST = "some\nvalue\n";
def p = j.createFreeStyleProject();
def target = new TextareaTestBuilder(TEXT_TO_TEST);
p.buildersList.add(target);
j.configRoundtrip(p);
j.assertEqualDataBoundBeans(target, p.getBuildersList().get(TextareaTestBuilder.class));
}

@Issue("JENKINS-27505")
@Test
public void testTextBeginningWithEmptyLine() {
def TEXT_TO_TEST = "\nbegin\n\nwith\nempty\nline\n\n";
def p = j.createFreeStyleProject();
def target = new TextareaTestBuilder(TEXT_TO_TEST);
p.buildersList.add(target);
j.configRoundtrip(p);
j.assertEqualDataBoundBeans(target, p.getBuildersList().get(TextareaTestBuilder.class));
}

@Issue("JENKINS-27505")
@Test
public void testTextBeginningWithTwoEmptyLines() {
def TEXT_TO_TEST = "\n\nbegin\n\nwith\ntwo\nempty\nline\n\n";
def p = j.createFreeStyleProject();
def target = new TextareaTestBuilder(TEXT_TO_TEST);
p.buildersList.add(target);
j.configRoundtrip(p);
j.assertEqualDataBoundBeans(target, p.getBuildersList().get(TextareaTestBuilder.class));
public void testText() {
T1:{
def TEXT_TO_TEST = "some\nvalue\n";
def p = j.createFreeStyleProject();
def target = new TextareaTestBuilder(TEXT_TO_TEST);
p.buildersList.add(target);
j.configRoundtrip(p);
j.assertEqualDataBoundBeans(target, p.getBuildersList().get(TextareaTestBuilder.class));
}

// test for a textarea beginning with a empty line.
T2:{
def TEXT_TO_TEST = "\nbegin\n\nwith\nempty\nline\n\n";
def p = j.createFreeStyleProject();
def target = new TextareaTestBuilder(TEXT_TO_TEST);
p.buildersList.add(target);
j.configRoundtrip(p);
j.assertEqualDataBoundBeans(target, p.getBuildersList().get(TextareaTestBuilder.class));
}

// test for a textarea beginning with two empty lines.
T3:{
def TEXT_TO_TEST = "\n\nbegin\n\nwith\ntwo\nempty\nline\n\n";
def p = j.createFreeStyleProject();
def target = new TextareaTestBuilder(TEXT_TO_TEST);
p.buildersList.add(target);
j.configRoundtrip(p);
j.assertEqualDataBoundBeans(target, p.getBuildersList().get(TextareaTestBuilder.class));
}
}

public static class TextareaTestBuilder extends Builder {

0 comments on commit f0a88e6

Please sign in to comment.
You can’t perform that action at this time.