unclebob / fitnesse

FitNesse -- The Acceptance Test Wiki
fitnesse.org
Other
2.04k stars 713 forks source link

Problems upgrade to latest version. #1198

Closed hnfn closed 5 years ago

hnfn commented 5 years ago

Hello,

We got an old .net application to maintain and it has some FitNesse/Slim test suites with pretty old version of FitNesse and Fitsharp. I'm trying to upgrade from Fitnesse version 2014018 and Fitsharp 2,2,4498,25493 (from version.txt in dll-file) Precond: .NET framework 4.7 solution/projects. Windows 10. Java 1.8.0_201 Tried with latest version of FitNesse(20190224) and Fitsharp 2.7. It didn't work so I went back to try several combinations with the result that the combination of FitNesse 20161106 and Fitsharp 2.5.1 working for me. But I'm really interested why I cant get these newer versions to work.

I run into 3 problems.

  1. slim.port issue. Seems to have somehting to do with default socket communication. Cause test suite to hang. Fitsharp also has problems with this, see 3 below. This is with fitsharp 2.4. $ java -Xmx100M -jar fitnesse-standalone_20161106.jar -v -p 8081 -l fitnessaccesslogs/ Configured verbose logging Bootstrapping FitNesse, the fully integrated standalone wiki and acceptance testing framework. root page: fitnesse.wiki.fs.WikiFilePage: FitNesseRoot logger: C:\FitNesse_20161106\fitnessaccesslogs authenticator: fitnesse.authentication.PromiscuousAuthenticator page factory: fitnesse.html.template.PageFactory page theme: bootstrap Starting FitNesse on port: 8081 Creating plain socket on port: 8081 Starting process [C:\FitNesse\FitSharp2.4\Runner.exe, -c, mysuite.config.xml, 1] Trying to connect to host: localhost on port: 1 timeout setting: 10 Connected to host: localhost on port: 1 timeout setting: 10 Read Slim Header: >< THIS LINE IS NOT SEEN BEFOR I KILLED THE JAVA PROCESS.

    This is from the page when I hit stop button. Unable to start test system 'slim': fitnesse.slim.SlimError: Got invalid slim header from client. Read the following:

    • Slim port must be set from FitNesse version 20161106 and/or Fitsharp 2.5.1. Is this expected behaviour?
  2. This Fitnesse problem seems to happen in version 20180127 and later, when a IndexOutOfBoundsException is raised when executing a slim Table:table.

    This is a part from Console when it happens: ... Adding public void java.lang.Throwable.printStackTrace(java.io.PrintWriter) Adding public void java.lang.Throwable.printStackTrace(java.io.PrintStream) Adding public synchronized java.lang.Throwable java.lang.Throwable.fillInStackTrace() Adding public synchronized java.lang.Throwable java.lang.Throwable.getCause() Adding public synchronized java.lang.Throwable java.lang.Throwable.initCause(java.lang.Throwable) Adding public java.lang.String java.lang.Throwable.toString() Adding public final synchronized void java.lang.Throwable.addSuppressed(java.lang.Throwable) Adding public java.lang.String java.lang.Throwable.getLocalizedMessage() Adding public java.lang.String java.lang.Throwable.getMessage() Adding public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace() Adding public final synchronized java.lang.Throwable[] java.lang.Throwable.getSuppressed() Adding public void java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) Reflecting interface java.io.Serializable Reflecting class java.lang.Object Adding public final void java.lang.Object.wait() throws java.lang.InterruptedException Adding public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException Adding public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException Adding public boolean java.lang.Object.equals(java.lang.Object) Adding public native int java.lang.Object.hashCode() Adding public final native java.lang.Class java.lang.Object.getClass() Adding public final native void java.lang.Object.notify() Adding public final native void java.lang.Object.notifyAll()

    Test system terminated with exception [fitnesse.testsystems.TestExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0]
    ResourceManager: found keyboardShortcuts.vm with loader fitnesse.html.template.ClasspathResourceLoader
    ResourceManager: found wikiFooter.vm with loader fitnesse.html.template.ClasspathResourceLoader
    =================================================================
    == Class: class fitnesse.responders.run.SuiteResponder$WikiPageFooterRenderer
    Reflecting class fitnesse.responders.run.SuiteResponder$WikiPageFooterRenderer
    Adding public java.lang.String fitnesse.responders.run.SuiteResponder$WikiPageFooterRenderer.render()
    Reflecting class java.lang.Object
    Adding public final void java.lang.Object.wait() throws java.lang.InterruptedException
    Adding public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
    Adding public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
    Adding public boolean java.lang.Object.equals(java.lang.Object)
    Adding public java.lang.String java.lang.Object.toString()
    Adding public native int java.lang.Object.hashCode()
    Adding public final native java.lang.Class java.lang.Object.getClass()
    Adding public final native void java.lang.Object.notify()
    Adding public final native void java.lang.Object.notifyAll()
    =================================================================

    ...

    When debugging this, it seems that the table is submitted to the fixture correctly.

  3. Fitsharp problems 'Test not run' when slim.port is not set in 2.5 or later and debug stops working in version 2.6 or later. From debug window when pressing 'Go': System.Runtime.Serialization.SerializationException: Type 'fitSharp.RunnerW.MainForm+TextReporter' in assembly 'RunnerW, Version=2.6.6621.26674, Culture=neutral, PublicKeyToken=null' is not marked as serializable. at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at fitSharp.Machine.Application.Shell.RunInNewDomain(AppDomainSetup appDomainSetup) at fitSharp.Machine.Application.Shell.RunInDomain(Memory memory) at fitSharp.Machine.Model.Either2.Select[R](Func2 withLeft, Func`2 withRight) at fitSharp.Machine.Application.Shell.Run()

    Result: 1

Any ideas of what I'm doing wrong causing problem 1 and 2 would be appreciated.

jediwhale commented 5 years ago

I'll try to reproduce these problems and I'll let you know what I find...

jediwhale commented 5 years ago

Do you get problem 1 with the 20190224 version of FitNesse and version 2.7.0 of FitSharp? I tried a simple test and it works. From the FitNesse console:

Starting process [D:\my\code\try\issues\sut\packages\FitSharp.2.7.0\lib\net452\Runner.exe, -r, fitSharp.Slim.Service.Runner, D:\my\code\try\issues\sut\myslim\bin\Debug\myslim.dll, 1]
Trying to connect to host: localhost on port: 1 timeout setting: 10
Connected to host: localhost on port: 1 timeout setting: 10
Trying to get SlimHeader:  timeout setting: 10
Read Slim Header: >Slim -- V0.5<
Got Slim Header: Slim -- V0.5, and Version 0.5
hnfn commented 5 years ago

Problem 1 seems to be some encoding problem. I get the same 'Test not run as in issue #1008. We have the same with our swedish characters åäö.

jediwhale commented 5 years ago

Fixed problem 1. Looking at problem 2 now.

jediwhale commented 5 years ago

Can you post an example of a test page and fixture code that shows problem 2? I can't reproduce it.

hnfn commented 5 years ago

I think problem 2 is a mixture of my lack of knowledge how Fitnesse works and a bad design of test cases. These test cases is built up from 2 table:table which are used as inputdata to fixtures where a static variable is populated with the data from tables. After that an empty Query table is used to call a fixture to validate businesslogic with inputdata from the static variable. If something is wrong the Query table is populated with error information. I suspect that this is not a common way to use Fitnesse. The IndexOutOfBoundsException I got was from the 2 table:table when their fixtures returned an empty result because they are used as inputdata. This was apparently possible in earlier versions of Fitnesse.

jediwhale commented 5 years ago

Updated documentation about SLIM_PORT for problem 3

githmashwinkumar commented 2 years ago

I want to propose Fitnesse as tool for automating Visual Studio Testing (2022 version). Before I did this I wanted to set up the POC. Have created this Test project with method "Addition". image Have all the required files placed in this folder and I am running the Jar from this folder - image This is the version showing up in the frontpage - Release v20220319 Have edited the root by giving this information - image Created the Test Case ensuring matching of Parameter and Method names image Running this Test case throws this error - image modified my Test Case page by including the Classpath. Outcome is still the same. Getting same error. image

Everything was working fine 2 weeks back. When I resumed my work yesterday I was greeted with this error. Any help in resolving this would be greatly appreciated. Thanks