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

EvoCrash-Demo problem in Windows #14

Open RicardoTej opened 6 years ago

RicardoTej commented 6 years ago

Good afternoon :

I'm following the tutorial of the EvoCrash demo in Windows 7, gradlew.bat run works apparently well, and the message build successful appears after the execution.

But I can't find the BaseClass_ESTest.java, only SolrEntityReferenceResolver_ESTest.java and SolrEntityReferenceResolver_ESTest_scaffolding.java.

And the Demo file system is not identical to the explanation file system.

evoquestion

Thank you.

MaelAudren commented 6 years ago

Hello,

I seems that the test was not generated. The test appearing on your screen in not the test that should be generated. It is a test that already exist on github repository. The issue may come from the windows environment.

pderakhshanfar commented 6 years ago

I think we should add another step to the example in the sample. change config.properties file. In GitHub, this file is modified for running Activeeon cases. So @RicardoTej I am not sure if you change this file or not. Notting that, If EvoCrash generates this file, it will be saved in "GGA-tests/com/xpn/xwiki/objects/classes" directory.

MaelAudren commented 6 years ago

@pderakhshanfar I think there is a misunderstanding, the properties file use by gradle is in /Demo/src/resources/config.properties here are the last properties :

path.log=src/resources/logs/XWIKI/XWIKI-13916/XWIKI-13916.log
path.libs=src/resources/targetedSoftware/XWIKI-bins/XWIKI-8.4/

As consequence the XWIKI file, BaseClass_ESTest.java should be generated. I will remove the file /Demo/resources/config.properties, it is confusing.

RicardoTej commented 6 years ago

Hello: I didn't change it

nothingtocommit

and this is my config.properties

evocrashconfig

pderakhshanfar commented 6 years ago

@RicardoTej Did you check this directory "GGA-tests/com/xpn/xwiki/objects/classes/" ? Can you please send us the output of EvoCrash execution?

MaelAudren commented 6 years ago

I tried to launch run evocrash-demo through windows and I got some issues too. Here is the stacktrace :

Commands used without dependencies and class: [-generateTests, -Dcriterion=CRASH , -Dsandbox=TRUE, -Dtest_dir=src\GGA-tests\java, -Drandom_tests=0, -Dp_functional_mocking=0.8, -Dfunctional_mocking_percent=0.5, -Dminimize=TRUE, -Dheadless_chicken_test=FALSE, -Dpopulation=80, -Dsearch_budget=600, -Dglobal_timeout=3600, -Dtarget_frame=3, -Dvirtual_fs=TRUE, -Duse_separate_classloader=FALSE, -Dreplace_calls=FALSE, -Dmax_recursion=50, -Dreset_static_fields=FALSE, -Dvirtual_net=FALSE, -Dtarget_exception_crash=java.lang.ClassCastException, -DEXP=src\resources\log s\XWIKI\XWIKI-13916\XWIKI-13916.log]
16:36:07.340 [main] INFO  evo_logger - * The target class is:com.xpn.xwiki.objects.classes.BaseClass
java.lang.IllegalArgumentException: Classpath element does not exist on disk at: C:\Users\Moi\AppData\Local\Temp\evocrash\evocrash-demo\Demo\src\resources\targetedSoftware\XWIKI-bins\XWIKI-8.4\aether-api-1.1.0.jar:C:\Users\Moi\AppData\Local\Temp\evocrash\evocrash-demo\Demo\src\resources\targetedSoftware\XWIKI-bins\XWIKI-8.4\aether-connector-basic-1.1.0.jar:C:\Users\Moi\AppData\Local\Temp\evocrash\evocrash-demo\Demo\src\resource[...]C:\Users\Moi\AppData\Local\Temp\evocrash\evocrash-demo\Demo\src\resources\targetedSoftware\XWIKI-bins\XWIKI-8.4\zookeeper-3.4.6.jar
        at org.evosuite.classpath.ClassPathHandler.checkIfValidClasspathEntry(ClassPathHandler.java:211)
        at org.evosuite.classpath.ClassPathHandler.getClassPath(ClassPathHandler.java:118)
        at org.evosuite.classpath.ClassPathHandler.changeTargetClassPath(ClassPathHandler.java:105)
        at org.crash.master.CommandLineParameters.handleClassPath(CommandLineParameters.java:250)
        at org.crash.master.EvoSuite.parseCommandLine(EvoSuite.java:176)
        at eu.stamp_project.evocrash.demo.TestCreation.create(TestCreation.java:88)
        at eu.stamp_project.evocrash.demo.Application.main(Application.java:6)

I removed the majority of the classpath dependencies from the stacktrace. The build appear as successful in the end which is confusing.

Did you had something similar @RicardoTej ?

pderakhshanfar commented 6 years ago

I think I undestand the problem. The classpaths separator in windows is ";" character but in UNIX-based operating systems is ":". I am going to fix it.

RicardoTej commented 6 years ago

Good morning :

@pderakhshanfar there is not a com directory inside my GGA-tests directory, only java\org\xwiki ...

@MaelAudren Yes, I have the same stacktrace after gradlew.bat run

 Commands used without dependencies and class: [-generateTests, -Dcriterion=CRASH, -Dsandbox=TRUE, -Dtest_dir=src\GGA-tests\java, -Drandom_tests=0, -Dp_functional_mocking=0.8, -Dfunctional_mocking_percent=0.5, -Dminimize=TRUE, -Dheadless_chicken_test=FALSE, -Dpopulation=80, -Dsearch_budget=600, -Dglobal_timeout=3600, -Dtarget_frame=3, -Dvirtual_fs=TRUE, -Duse_separate_classloader=FALSE, -Dreplace_calls=FALSE, -Dmax_recursion=50, -Dreset_static_fields=FALSE, -Dvirtual_net=FALSE, -Dtarget_exception_crash=java.lang.ClassCastException, -DEXP=src\resources\logs\XWIKI\XWIKI-13916\XWIKI-13916.log]
08:57:46.600 [main] INFO  evo_logger - * The target class is:com.xpn.xwiki.objects.classes.BaseClass
  08:57:46.600 [main] INFO  evo_logger - * The target class is:com.xpn.xwiki.objects.classes.BaseClass
  demo\Demo\src\resources\targetedSoftware\XWIKI-bins\XWIKI-8.4\zookeeper-3.4.6.jar 
  at org.evosuite.classpath.ClassPathHandler.checkIfValidClasspathEntry(ClassPathHandler.java:211)
at org.evosuite.classpath.ClassPathHandler.getClassPath(ClassPathHandler.java:118)
at org.evosuite.classpath.ClassPathHandler.changeTargetClassPath(ClassPathHandler.java:105)
at org.crash.master.CommandLineParameters.handleClassPath(CommandLineParameters.java:250)
at org.crash.master.EvoSuite.parseCommandLine(EvoSuite.java:176)
at eu.stamp_project.evocrash.demo.TestCreation.create(TestCreation.java:88)
at eu.stamp_project.evocrash.demo.Application.main(Application.java:6)
    BUILD SUCCESSFUL   
    Total time: 5.004 secs

gradlewRun.txt gradlewtest.txt

and here is the evosuite-report\statistics.csv content

statisticscsv

Thank you

RicardoTej commented 6 years ago

Good afternoon :

Is there any news about the demo in Windows ? I still have the problem.

Thank you

pderakhshanfar commented 6 years ago

Hi @RicardoTej I fixed the problem in the last commit. Please check it, and see if the problem is solved or not.

RicardoTej commented 6 years ago

Good morning :

I get the last commit to check it in Windows, but the execution of gradlew.bat run never finish.

It doesn't exceed 75%

windowsconsole

It works fine in Linux.

fermenreq commented 6 years ago

Dear @RicardoTej , all.

I was testing Evocrash-demo and I suggest you to use a UNIX SO, it works fine for me.

Writing JUnit test case 'BaseClass_ESTest' to src/GGA-tests/java
Done!
Computation finished
BUILD SUCCESSFUL
Total time: 4 mins 52.574 secs

I'm agree with you that the README. is not quite good for example:

The BaseClass_ESTest_scaffolding. java file is on root@VTSS031:/EvoCrash-demo/Demo/src# cd GGA-tests/java/com/xpn/xwiki/objects/classes/.

/*
 * This file was automatically generated by EvoSuite
 * Mon Aug 13 08:12:05 UTC 2018
 */

package com.xpn.xwiki.objects.classes;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.xpn.xwiki.objects.classes.BaseClass;
import com.xpn.xwiki.objects.classes.TextAreaClass;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;

@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class BaseClass_ESTest extends BaseClass_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      BaseClass baseClass0 = new BaseClass();
      TextAreaClass.ContentType textAreaClass_ContentType0 = TextAreaClass.ContentType.WIKI_TEXT;
      baseClass0.addDateField("mtwxan", "bz", "\u022D", 414);
      // Undeclared exception!
      try {
        baseClass0.addTextAreaField("mtwxan", "mtwxan", (-1160), (-1160), textAreaClass_ContentType0);
        fail("Expecting exception: ClassCastException");

      } catch(ClassCastException e) {
         //
         // com.xpn.xwiki.objects.classes.DateClass cannot be cast to com.xpn.xwiki.objects.classes.TextAreaClass
         //
         verifyException("com.xpn.xwiki.objects.classes.BaseClass", e);
      }
  }
}

Best, Fernando Méndez - fernando.mendez@atos.net

fermenreq commented 6 years ago

Hi, For a nice follow up , this issue may be closed.

Thanks, Fernando

RicardoTej commented 6 years ago

Good morning : I still have the problem in Windows Tahnk you very much.

xdevroey commented 6 years ago

Hi @RicardoTej,

Have you tried using Powershell on Windows? I think it supports bash commands and should work with the UNIX OS scripts (gradlew). Unfortunately, we do not have access to a Windows machine.

Please also note that this demo project is meant to have a simple way to run EvoCrash, you can run it from a classical command line using the different parameters described in http://www.evocrash.org/download.html. A Maven plugin to work with any crash is part of the next development steps.

Best,

Xavier

RicardoTej commented 6 years ago

Good afternoon @xdevroey, all

It works fine using Powershell on Windows.

Thank you !

jesus-gorronogoitia commented 6 years ago

Hi Xavier, @xdevroey @pderakhshanfar has also reported us that about the refactoring process you are currently performing in Evocrash. Do you think we should wait for this refactoring to be complete before working on the Eclipse plugin for Evocrash? or do you think that most of the Evocrash properties defined in the config.properties will be kept without changes, so we can work in parallel on an Wizard that enables the end-user to define those properties in a form-based visual widget so the plugin will create the config.properties. Then, the plugin can invoke Evocrash either using the CLI or the Maven plugin on. If properties will be kept, are they defined somewhere? We need to provide end-users with information about each property and validate their values against their acceptable ranges

xdevroey commented 6 years ago

Hi Yosu,

The new version will simplify the list of properties to provide so I would suggest waiting a bit. I will open an issue on the new tool and put the list there ASAP. Should we also create a sub-module for the eclipse plugin (like for the maven-plugin) or do you prefer to work on an external project?

Best,

Xavier

jesus-gorronogoitia commented 6 years ago

Hi Xavier, Thanks, we will wait for the new Evocrash release. Please, let us know when ready. There is already a STAMP repository for STAMP Eclipse plugins Regards Yosu