Skip to content

Commit

Permalink
Merge branch 'master' into fixture-interaction-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Marin committed Aug 14, 2017
2 parents a12afc5 + d3c6870 commit 57d029b
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 77 deletions.
9 changes: 9 additions & 0 deletions .bettercodehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
component_depth: 1
languages:
- java
- javascript
exclude:
- /extra/.*
- /src/fitnesse/resources/codemirror/.*
- /src/fitnesse/resources/javascript/jquery.*.js
- /src/fitnesse/resources/bootstrap/js/bootstrap.js
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ FitNesseRoot/properties
FitNesseRoot/ErrorLogs/*
FitNesseRoot/files/testResults/*
FitNesseRoot/RecentChanges*
desktop.ini
junit*.properties
FitNesseRoot/updateDoNotCopyOverList
FitNesseRoot/updateList
Expand Down
65 changes: 36 additions & 29 deletions FitNesseRoot/FitNesse/ReleaseNotes/content.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
!2 ${FITNESSE_VERSION}
* Add ability to specify the locale used to format evaluated expressions ([[#929][https://github.com/unclebob/fitnesse/pull/929]])

For a complete list of closed issues and merged pull requests see https://github.com/unclebob/fitnesse/issues?milestone=16&state=closed.


!2 20161130
* Add ability to specify the locale used to format evaluated expressions ([[929][https://github.com/unclebob/fitnesse/pull/929]])
* New Slim table type: [[Baseline decision table][!-SuiteAcceptanceTests.SuiteSlimTests.BaseLineDecisionTable-!]] ([[965][https://github.com/unclebob/fitnesse/pull/965]])
* Add base folder for plugin documentation ([[971][https://github.com/unclebob/fitnesse/pull/971]])
* !-FitNesse-! and Slim can now communicate over stdin/stdout. This removes the hassle with network ports ([[977][https://github.com/unclebob/fitnesse/pull/977]], see UserGuide.WritingAcceptanceTests.SliM.SlimProtocol.PortManagement)
* API changes:
* FitNesse is more strictly propagating exceptions, instead of only logging them ([[#923][https://github.com/unclebob/fitnesse/pull/923]])
* Updated ''!-FixtureInteraction-!'' interface ([[#911][https://github.com/unclebob/fitnesse/pull/911]])
* To improve extensibility, scenario resolution has been moved to ``!-SlimtestContext-!'' ([[974][https://github.com/unclebob/fitnesse/pull/974]])
* ''!-WikiPage-!'' interface now has a ''remove()'' method. This will replace the ''removeChild()'' method in the near future ([[#930][https://github.com/unclebob/fitnesse/pull/930]])
* FitNesse is more strictly propagating exceptions, instead of only logging them ([[923][https://github.com/unclebob/fitnesse/pull/923]])
* Updated ''!-FixtureInteraction-!'' interface ([[911][https://github.com/unclebob/fitnesse/pull/911]])
* To improve extensibility, scenario resolution has been moved to ``!-SlimtestContext-!'' ([[974][https://github.com/unclebob/fitnesse/pull/974]])''
* ''!-WikiPage-!'' interface now has a ''remove()'' method. This will replace the ''removeChild()'' method in the near future ([[930][https://github.com/unclebob/fitnesse/pull/930]])
* Issues fixed:
* Display of Map results from fixtures should allow nested HTML ([[#921][https://github.com/unclebob/fitnesse/pull/921]])
* Fix assignment of output parameters of scenarios with graceful names in decision tables ([[#928][https://github.com/unclebob/fitnesse/pull/928]])
* Fix Where Used page for pages under a Symbolic Link ([[#925][https://github.com/unclebob/fitnesse/issues/925]])
* Display of Map results from fixtures should allow nested HTML ([[921][https://github.com/unclebob/fitnesse/pull/921]])
* Fix assignment of output parameters of scenarios with graceful names in decision tables ([[928][https://github.com/unclebob/fitnesse/pull/928]])
* Fix Where Used page for pages under a Symbolic Link ([[925][https://github.com/unclebob/fitnesse/issues/925]])
* Fixed issues in ''!-CachedInteraction-!'' ([[973][https://github.com/unclebob/fitnesse/pull/973]])

For a complete list of closed issues and merged pull requests see https://github.com/unclebob/fitnesse/issues?milestone=15&state=closed.



!2 20160515
* FitNesse requires Java 7 now ([[#872][https://github.com/unclebob/fitnesse/issues/872]], [[#877][https://github.com/unclebob/fitnesse/issues/877]])
* New autocomplete feature for the "move page" page ([[#867][https://github.com/unclebob/fitnesse/issues/867]])
* Name the link to execution log simply "Execution Log" ([[#851][https://github.com/unclebob/fitnesse/issues/851]])
* Dynamically add fitnesse jartoclasspath ([[#862][https://github.com/unclebob/fitnesse/issues/862]], [[#866][https://github.com/unclebob/fitnesse/issues/866]])
* Searching for tags across Symbolic links ([[#488][https://github.com/unclebob/fitnesse/issues/488]], [[#888][https://github.com/unclebob/fitnesse/issues/888]])
* Add support for table-in-table editing in rich text editor ([[#669][https://github.com/unclebob/fitnesse/issues/669]], [[#885][https://github.com/unclebob/fitnesse/issues/885]])
* ''!-@SystemUnderTest-!'' now accepts method calls from subclasses ([[#907][https://github.com/unclebob/fitnesse/issues/907]])
* Disallow uploading to folder ''files/fitnesse'' ([[#889][https://github.com/unclebob/fitnesse/issues/889]])
* Avoid infinite cycles when using symlinks ([[#888][https://github.com/unclebob/fitnesse/issues/888]])
* (Slim) Deal with escaping content in hash table ([[#886][https://github.com/unclebob/fitnesse/issues/886]])
* Properly handle symbol assignment in first column of a query table ([[#914][https://github.com/unclebob/fitnesse/issues/914]])
* FitNesse requires Java 7 now ([[872][https://github.com/unclebob/fitnesse/issues/872]], [[877][https://github.com/unclebob/fitnesse/issues/877]])
* New autocomplete feature for the "move page" page ([[867][https://github.com/unclebob/fitnesse/issues/867]])
* Name the link to execution log simply "Execution Log" ([[851][https://github.com/unclebob/fitnesse/issues/851]])
* Dynamically add fitnesse jartoclasspath ([[862][https://github.com/unclebob/fitnesse/issues/862]], [[866][https://github.com/unclebob/fitnesse/issues/866]])
* Searching for tags across Symbolic links ([[488][https://github.com/unclebob/fitnesse/issues/488]], [[888][https://github.com/unclebob/fitnesse/issues/888]])
* Add support for table-in-table editing in rich text editor ([[669][https://github.com/unclebob/fitnesse/issues/669]], [[885][https://github.com/unclebob/fitnesse/issues/885]])
* ''!-@SystemUnderTest-!'' now accepts method calls from subclasses ([[907][https://github.com/unclebob/fitnesse/issues/907]])
* Disallow uploading to folder ''files/fitnesse'' ([[889][https://github.com/unclebob/fitnesse/issues/889]])
* Avoid infinite cycles when using symlinks ([[888][https://github.com/unclebob/fitnesse/issues/888]])
* (Slim) Deal with escaping content in hash table ([[886][https://github.com/unclebob/fitnesse/issues/886]])
* Properly handle symbol assignment in first column of a query table ([[914][https://github.com/unclebob/fitnesse/issues/914]])
* Issues fixed:
* !-CompareVersions-! responder is not escaping output properly ([[#861][https://github.com/unclebob/fitnesse/issues/861]], [[#869][https://github.com/unclebob/fitnesse/issues/869]])
* Improve code by honoring ''InterruptedException'' ([[#874][https://github.com/unclebob/fitnesse/issues/874]])
* FitNesse stops again when calling /?shutdown ([[#875][https://github.com/unclebob/fitnesse/issues/875]])
* Fixed: Running suites does not show the tests summaries ([[#876][https://github.com/unclebob/fitnesse/issues/876]])
* Fix escaping of HTML in Slim hash tables ([[#878][https://github.com/unclebob/fitnesse/issues/878]])
* Fix class loading for FitNesse resources ([[#880][https://github.com/unclebob/fitnesse/issues/880]])
* Change json content type from ''text/json'' to ''applicatioin/json'' ([[#891][https://github.com/unclebob/fitnesse/issues/891]])
* JUnit runner now plays nice with Gradle ([[#909][https://github.com/unclebob/fitnesse/issues/909]])

* !-CompareVersions-! responder is not escaping output properly ([[861][https://github.com/unclebob/fitnesse/issues/861]], [[869][https://github.com/unclebob/fitnesse/issues/869]])
* Improve code by honoring ''InterruptedException'' ([[874][https://github.com/unclebob/fitnesse/issues/874]])
* FitNesse stops again when calling /?shutdown ([[875][https://github.com/unclebob/fitnesse/issues/875]])
* Fixed: Running suites does not show the tests summaries ([[876][https://github.com/unclebob/fitnesse/issues/876]])
* Fix escaping of HTML in Slim hash tables ([[878][https://github.com/unclebob/fitnesse/issues/878]])
* Fix class loading for FitNesse resources ([[880][https://github.com/unclebob/fitnesse/issues/880]])
* Change json content type from ''text/json'' to ''applicatioin/json'' ([[891][https://github.com/unclebob/fitnesse/issues/891]])
* JUnit runner now plays nice with Gradle ([[909][https://github.com/unclebob/fitnesse/issues/909]])


For a complete list of closed issues and merged pull requests see https://github.com/unclebob/fitnesse/issues?milestone=14&state=closed.

!2 20151230
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ To reuse one of the existing styles as an entry point, create a custom css file

{{{
@import url(fitnesse_straight.css);
}}}Now you can simply add custom elements to it.
}}}

Now you can simply add custom elements to it.
For example, changing the logo to something fitting your project can be done by placing a 200 x 37 logo file names ''fitnesse-logo-small.png'' file in files/images/ and then shift-f5 reloading the page.

!3 Create a theme based on Bootstrap
The Bootstrap theme took a slightly different route. It's using a subfolder for it's resources. The skeleton.vm template  ([[files/fitnesse/bootstrap/templates/skeleton.vm][http://files/fitnesse/bootstrap/templates/skeleton.vm]]) contains the general markup and layout. It also contains references to the other resources used. You can find the resources used to compile the bootstrap style (lesscss templates) in fitnesse.jar: fitnesse/resources/bootstrap/less. Use those as a basis for the custom theme. There are a few more template files that are overwritten by the bootstrap theme. If the theme needs to be reusable, refer (''#parse'') the the bootstrap templates for a start and add your own customisations along the way.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The syntax of a wiki word is ''Camel Case'': an alternating pattern of upper and lower case letters. Strictly speaking a wiki word is a string of two more more capital letters with lower case letters or numbers between them.
The syntax of a wiki word is ''Camel Case'': an alternating pattern of upper and lower case letters. Strictly speaking a wiki word is a string of two more capital letters with lower case letters or numbers between them.

* '''!-BobMartin-!''' is a wiki word.
* '''!-SalesReport1972-!''' is a wiki word.
Expand All @@ -7,4 +7,4 @@ The syntax of a wiki word is ''Camel Case'': an alternating pattern of upper and
* '''!-RcM-!''' is a wiki word because it is two or more capitals separated by lower case letters.
* '''!-ItDoesNotMatterHowManyCapitalsThereAreYouCanHave1000IfYouLike-!''' is a wiki word with lots of capitals.
----
!note The Java Regular expression that we are using to represent a wiki word is: {{{\b[A-Z](?:[a-z0-9]+[A-Z][a-z0-9]*)+}}}
!note The Java Regular expression that we are using to represent a wiki word is: {{{\b[A-Z](?:[a-z0-9]+[A-Z][a-z0-9]*)+}}}
10 changes: 4 additions & 6 deletions src/fitnesse/slim/SlimPipeSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ public SlimPipeSocket() throws IOException {
this.stdin = System.in;

// bind System.stdout/System.stderr to original stderr
System.setOut(new PrintStream(new LoggingOutputStream(this.stderr,
STDOUT_PREFIX),
true));
System.setErr(new PrintStream(new LoggingOutputStream(this.stderr,
STDERR_PREFIX),
true));
System.setOut(new PrintStream(new LoggingOutputStream(this.stderr, STDOUT_PREFIX),
true, FileUtil.CHARENCODING));
System.setErr(new PrintStream(new LoggingOutputStream(this.stderr, STDERR_PREFIX),
true, FileUtil.CHARENCODING));

LOG.log(Level.FINER, "Creating Slim Server with pipe socket.");

Expand Down
2 changes: 1 addition & 1 deletion src/fitnesse/testrunner/PagesByTestSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private Map<WikiPageIdentity, List<WikiPage>> mapWithAllPagesButSuiteSetUpAndTea
Map<WikiPageIdentity, List<WikiPage>> pagesByTestSystem = new HashMap<>(2);

for (WikiPage wikiPage : pages) {
if (!SuiteContentsFinder.isSuiteSetupOrTearDown(wikiPage)) {
if (!WikiTestPage.isSuiteSetupOrTearDown(wikiPage)) {
WikiPageIdentity identity = new WikiPageIdentity(wikiPage);
getOrMakeListWithinMap(pagesByTestSystem, identity).add(wikiPage);
}
Expand Down
14 changes: 4 additions & 10 deletions src/fitnesse/testrunner/SuiteContentsFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public SuiteContentsFinder(final WikiPage pageToRun, final SuiteFilter suiteFilt

public List<WikiPage> getAllPagesToRunForThisSuite() {
String content = pageToRun.getHtml();
//todo perf: all pages html parsed here?
if (SuiteSpecificationRunner.isASuiteSpecificationsPage(content)) {
SuiteSpecificationRunner runner = new SuiteSpecificationRunner(wikiRootPage);
if (runner.getPageListFromPageContent(content))
Expand Down Expand Up @@ -106,19 +105,14 @@ private void addAllXRefs(List<WikiPage> xrefPages, WikiPage page) {

private void addXrefPages(List<WikiPage> pages, WikiPage thePage) {
List<String> pageReferences = WikiPageUtil.getXrefPages(thePage);
WikiPagePath testPagePath = thePage.getPageCrawler().getFullPath();
WikiPage parent = wikiRootPage.getPageCrawler().getPage(testPagePath.parentPath());
if (pageReferences.isEmpty()) {
return;
}
for (String pageReference : pageReferences) {
WikiPagePath path = PathParser.parse(pageReference);
WikiPage referencedPage = parent.getPageCrawler().getPage(path);
WikiPage referencedPage = thePage.getPageCrawler().getSiblingPage(path);
if (referencedPage != null)
pages.add(referencedPage);
}
}

public static boolean isSuiteSetupOrTearDown(WikiPage testPage) {
String name = testPage.getName();
return (PageData.SUITE_SETUP_NAME.equals(name) || PageData.SUITE_TEARDOWN_NAME.equals(name));
}

}
9 changes: 7 additions & 2 deletions src/fitnesse/testrunner/WikiTestPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ public String getContent() {
}
}


protected String getPathSeparator() {
String separator = sourcePage.getVariable(PageData.PATH_SEPARATOR);
if (separator == null)
separator = File.pathSeparator;
return separator;
}


public WikiPage getSourcePage() {
return sourcePage;
}
Expand Down Expand Up @@ -197,7 +197,7 @@ public WikiPage getTearDown() {
}

protected boolean isSuiteSetUpOrTearDownPage() {
return PageData.SUITE_SETUP_NAME.equals(getName()) || PageData.SUITE_TEARDOWN_NAME.equals(getName());
return isSuiteSetupOrTearDown(sourcePage);
}

protected WikiPage findInheritedPage(String pageName) {
Expand All @@ -216,4 +216,9 @@ public void process(WikiPage page) {
}
return uncles;
}

public static boolean isSuiteSetupOrTearDown(WikiPage wikiPage) {
String name = wikiPage.getName();
return (PageData.SUITE_SETUP_NAME.equals(name) || PageData.SUITE_TEARDOWN_NAME.equals(name));
}
}
6 changes: 3 additions & 3 deletions src/fitnesse/testsystems/CommandRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void asynchronousStart() throws IOException {
redirectOutputs(process, executionLogListener);
}

// Note: for pipe-based connection, this method is overridden in SlimClientBuilder
protected void redirectOutputs(Process process, final ExecutionLogListener executionLogListener) throws IOException {
InputStream stdout = process.getInputStream();
InputStream stderr = process.getErrorStream();
Expand Down Expand Up @@ -117,7 +118,6 @@ public void join() {
if (isDead(process)) {
exitCode = process.exitValue();
executionLogListener.exitCode(exitCode);

}
}
}
Expand Down Expand Up @@ -231,11 +231,11 @@ public String getCommandErrorMessage() {
}

// TODO: Those should go, since the data is sent to the ExecutionListener already
public InputStream getReader() {
public InputStream getInputStream() {
return process.getInputStream();
}

public OutputStream getWriter() {
public OutputStream getOutputStream() {
return process.getOutputStream();
}
}
1 change: 1 addition & 0 deletions src/fitnesse/testsystems/fit/CommandRunningFitClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public void run() {
fitClient.notify();
Exception e = new Exception(
"FitClient: external process terminated before a connection could be established.");
// TODO: use executionLogListener.exceptionOccurred(e)
commandRunner.exceptionOccurred(e);
fitClient.exceptionOccurred(e);
}
Expand Down
4 changes: 2 additions & 2 deletions src/fitnesse/testsystems/slim/PipeBasedSocketFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public Socket createSocket(final String hostName, final int port) throws IOExcep
private class PipeBasedSocket extends Socket {
@Override
public InputStream getInputStream() throws IOException {
return commandRunner.getReader();
return commandRunner.getInputStream();
}

@Override
public OutputStream getOutputStream() throws IOException {
return commandRunner.getWriter();
return commandRunner.getOutputStream();
}

@Override
Expand Down
15 changes: 9 additions & 6 deletions src/fitnesse/testsystems/slim/SlimClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import fitnesse.socketservice.SslClientSocketFactory;
import fitnesse.testsystems.*;

import static fitnesse.slim.SlimPipeSocket.STDERR_PREFIX;
import static fitnesse.slim.SlimPipeSocket.STDOUT_PREFIX;

public class SlimClientBuilder extends ClientBuilder<SlimCommandRunningClient> {
public static final String SLIM_PORT = "SLIM_PORT";
public static final String SLIM_HOST = "SLIM_HOST";
Expand Down Expand Up @@ -51,6 +54,7 @@ protected CommandRunner determineCommandRunner() {
return new CommandRunner(buildCommand(),
createClasspathEnvironment(getClassPath()),
getExecutionLogListener(), determineTimeout()) {

@Override
protected void redirectOutputs(Process process, final ExecutionLogListener executionLogListener) throws IOException {
InputStream stderr = process.getErrorStream();
Expand All @@ -59,13 +63,11 @@ protected void redirectOutputs(Process process, final ExecutionLogListener execu
public void write(String output) {
// Separate StdOut and StdErr and remove prefix"
String originalMsg;
originalMsg = extractOriginalMessage(output,
SlimPipeSocket.STDOUT_PREFIX);
originalMsg = extractOriginalMessage(output, STDOUT_PREFIX);
if (originalMsg != null) {
executionLogListener.stdOut(originalMsg);
} else {
originalMsg = extractOriginalMessage(output,
SlimPipeSocket.STDERR_PREFIX);
originalMsg = extractOriginalMessage(output, STDERR_PREFIX);
if (originalMsg != null) {
executionLogListener.stdErr(originalMsg);
setCommandErrorMessage(originalMsg);
Expand All @@ -78,7 +80,7 @@ public void write(String output) {
/**
* This reverts the wrap that the LoggingOutputStream.flush method
* is doing.
*
*
* @param prefixedMessage
* @param level
* @return == null : the message is not prefixed with the given
Expand All @@ -92,10 +94,11 @@ private String extractOriginalMessage(String prefixedMessage,
return null;
}

}), "CommandRunner stdErr").start();
}), "CommandRunner stdOutErr").start();

}
};

} else if (useManualStartForTestSystem()) {
return new MockCommandRunner(
"Connection to running SlimService: " + determineSlimHost() + ":"
Expand Down
22 changes: 15 additions & 7 deletions src/fitnesse/wiki/fs/DiskFileSystem.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
package fitnesse.wiki.fs;

import java.io.*;
import java.util.Arrays;
import java.util.Collection;

import fitnesse.util.Clock;
import util.FileUtil;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class DiskFileSystem implements FileSystem {

private FilenameFilter filenameFilter = new FilenameFilter() {
private Collection skippedFileNames = Arrays.asList("CVS", "RCS");

@Override
public boolean accept(final File dir, final String name) {
return !(new File(dir, name).isHidden() || skippedFileNames.contains(name));
}
};

@Override
public void makeFile(File file, String content) throws IOException {
FileUtil.createFile(file, content);
Expand All @@ -34,7 +42,7 @@ public boolean exists(File file) {

@Override
public String[] list(File path) {
return path.isDirectory() ? path.list() : new String[]{};
return path.isDirectory() ? path.list(filenameFilter) : new String[]{};
}

@Override
Expand Down
Loading

0 comments on commit 57d029b

Please sign in to comment.