STAMP-project / EvoCrash-demo

See https://stamp-project.github.io/botsing/ for the latest version of STAMP crash reproduction tool.
https://stamp-project.github.io/botsing/
Apache License 2.0
1 stars 2 forks source link

the generated test should not contain a try-catch block #3

Closed monperrus closed 6 years ago

monperrus commented 6 years ago

in order to show that the exception is really reproduced

MaelAudren commented 6 years ago

I'm using linux and I didn't manage to reproduce the exception even by removing the try/catch block. java -cp ../evocrash-lib/evocrash-1.0.0.jar:../src/test:"$(cat xwikiclasspath.txt)" org.junit.runner.JUnitCore com.xpn.xwiki.objects.classes.BaseClass_ESTest always work for me.

When I remove the annotation and the try/catch block I got this :

public class BaseClass_ESTest extends BaseClass_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      BaseClass baseClass0 = new BaseClass();
      baseClass0.addTextField("^3:mVG", "^3:mVG", (-2692));
      TextAreaClass.ContentType textAreaClass_ContentType0 = TextAreaClass.ContentType.WIKI_TEXT;
  }
}
xdevroey commented 6 years ago

Hi! @pderakhshanfar could you take a look at this? @MaelAudren What is the error message (if any)?

MaelAudren commented 6 years ago

I found out the issue I removed the whole try/catch block which contains the lines

baseClass0.addTextAreaField("<>", ",Iqw!OCByZ7G/RC", 0, 0, textAreaClass_ContentType0);
fail("Expecting exception: ClassCastException");

which are responsible for the test failing.

Only try and catch should be removed but not the content as a consequence the final java file should look like:

public class BaseClass_ESTest extends BaseClass_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      BaseClass baseClass0 = new BaseClass();
      baseClass0.addDBListField("<>", "<>", 0, false, false, "EeaQ+");
      TextAreaClass.ContentType textAreaClass_ContentType0 = TextAreaClass.ContentType.WIKI_TEXT;
      baseClass0.addTextAreaField("<>", ",Iqw!OCByZ7G/RC", 0, 0, textAreaClass_ContentType0);
      fail("Expecting exception: ClassCastException");
  }
}
xdevroey commented 6 years ago

See https://github.com/STAMP-project/EvoCrash/issues/3