Skip to content

Commit

Permalink
Rename junit test package to junit4
Browse files Browse the repository at this point in the history
  • Loading branch information
theangrydev authored and robert.sloss committed Jan 8, 2019
1 parent f8c6d93 commit ffd8905
Show file tree
Hide file tree
Showing 42 changed files with 58 additions and 61 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.orig
*.iws
.idea/workspace.xml
.ant-targets-build.xml
out
build/artifacts
lib/build
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Alternative tools:
Currently this library supports several features:
* Generate [HTML](https://github.com/bodar/yatspec/raw/wiki/example.html) based on a [JUnit Java](/test/com/googlecode/yatspec/junit/SpecificationExampleTest.java) file
* BDD "Given / When / Then" support with automatic capturing and display of "givens" and captured inputs and output.
* Tabular data tests by using [@TableRunner](src/com/googlecode/yatspec/junit/TableRunner.java)
with [@Table](src/com/googlecode/yatspec/junit/Table.java) and [@Row](src/com/googlecode/yatspec/junit/Row.java) support for JUnit Methods (similar to in MBUnit / NUnit)
* [@Notes](src/com/googlecode/yatspec/junit/Notes.java) to add comments to tests
* [@LinkingNote](/src/com/googlecode/yatspec/junit/LinkingNote.java) to [generate links between tests](https://www.youtube.com/watch?v=CFMkD-t363c)
* Tabular data tests by using [@TableRunner](src/com/googlecode/yatspec/junit4/TableRunner.java)
with [@Table](src/com/googlecode/yatspec/junit4/Table.java) and [@Row](src/com/googlecode/yatspec/junit4/Row.java) support for JUnit Methods (similar to in MBUnit / NUnit)
* [@Notes](src/com/googlecode/yatspec/junit4/Notes.java) to add comments to tests
* [@LinkingNote](/com/googlecode/yatspec/junit4/LinkingNote.java) to [generate links between tests](https://www.youtube.com/watch?v=CFMkD-t363c)

### Quick Start ###

The simplest example would be to add the JUnit [@RunWith](http://junit.sourceforge.net/javadoc/org/junit/runner/RunWith.html) attribute specifying the [SpecRunner](/src/com/googlecode/yatspec/junit/SpecRunner.java) class to your Test class.
The simplest example would be to add the JUnit [@RunWith](http://junit.sourceforge.net/javadoc/org/junit/runner/RunWith.html) attribute specifying the [SpecRunner](/com/googlecode/yatspec/junit4/SpecRunner.java) class to your Test class.

```java
@RunWith(SpecRunner.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.yatspec.rendering.ScenarioNameRendererFactory;
import com.googlecode.yatspec.state.ScenarioName;
import org.junit.runners.model.FrameworkMethod;

import static com.googlecode.yatspec.junit.ParameterResolverFactory.parameterResolver;
import static com.googlecode.yatspec.junit4.ParameterResolverFactory.parameterResolver;
import static java.util.Arrays.asList;

public class DecoratingFrameworkMethod extends FrameworkMethod {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.Option;
import com.googlecode.yatspec.rendering.html.HtmlResultRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.Option;
import com.googlecode.totallylazy.Sequences;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import java.lang.reflect.Method;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import static com.googlecode.yatspec.Creator.create;
import static java.lang.Class.forName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.yatspec.state.Result;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.Predicate;
import com.googlecode.yatspec.state.Result;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.Callable1;
import com.googlecode.totallylazy.Predicate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import java.lang.reflect.Array;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

public interface WithCustomResultListeners {
Iterable<SpecResultListener> getResultListeners() throws Exception;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.predicates.LogicalPredicate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.googlecode.totallylazy.Callable1;
import com.googlecode.totallylazy.Sequence;
import com.googlecode.totallylazy.Strings;
import com.googlecode.yatspec.junit.Table;
import com.googlecode.yatspec.junit4.Table;
import com.googlecode.yatspec.state.ScenarioTable;
import com.googlecode.yatspec.state.TestMethod;
import com.thoughtworks.qdox.model.*;
Expand Down
2 changes: 1 addition & 1 deletion src/com/googlecode/yatspec/rendering/FileRenderer.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.googlecode.yatspec.rendering;

import com.googlecode.totallylazy.Files;
import com.googlecode.yatspec.junit.SpecResultListener;
import com.googlecode.yatspec.junit4.SpecResultListener;
import com.googlecode.yatspec.state.Result;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.googlecode.yatspec.rendering;

import com.googlecode.totallylazy.Callable1;
import com.googlecode.yatspec.junit.LinkingNote;
import com.googlecode.yatspec.rendering.Renderer;
import com.googlecode.yatspec.junit4.LinkingNote;

import java.io.File;

Expand Down
2 changes: 1 addition & 1 deletion src/com/googlecode/yatspec/rendering/NotesRenderer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.googlecode.yatspec.rendering;

import com.googlecode.yatspec.junit.Notes;
import com.googlecode.yatspec.junit4.Notes;

public class NotesRenderer implements Renderer<Notes>{
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.googlecode.yatspec.rendering;

import com.googlecode.yatspec.junit.SpecRunner;
import com.googlecode.yatspec.rendering.junit.HumanReadableScenarioNameRenderer;
import com.googlecode.yatspec.state.ScenarioName;

import static com.googlecode.yatspec.Creator.create;
import static java.lang.Class.forName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import com.googlecode.totallylazy.Predicate;
import com.googlecode.totallylazy.Xml;
import com.googlecode.yatspec.Creator;
import com.googlecode.yatspec.junit.LinkingNote;
import com.googlecode.yatspec.junit.Notes;
import com.googlecode.yatspec.junit.SpecResultListener;
import com.googlecode.yatspec.junit4.LinkingNote;
import com.googlecode.yatspec.junit4.Notes;
import com.googlecode.yatspec.junit4.SpecResultListener;
import com.googlecode.yatspec.parsing.Files;
import com.googlecode.yatspec.parsing.JavaSource;
import com.googlecode.yatspec.rendering.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.googlecode.yatspec.rendering.html.index;

import com.googlecode.funclate.stringtemplate.EnhancedStringTemplateGroup;
import com.googlecode.yatspec.junit.SpecResultListener;
import com.googlecode.yatspec.junit4.SpecResultListener;
import com.googlecode.yatspec.rendering.Content;
import com.googlecode.yatspec.rendering.ContentAtUrl;
import com.googlecode.yatspec.rendering.Index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.googlecode.totallylazy.Group;
import com.googlecode.totallylazy.Pair;
import com.googlecode.totallylazy.Sequence;
import com.googlecode.yatspec.junit.SpecResultListener;
import com.googlecode.yatspec.junit4.SpecResultListener;
import com.googlecode.yatspec.rendering.Index;
import com.googlecode.yatspec.rendering.html.HtmlResultRenderer;
import com.googlecode.yatspec.state.Result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import com.googlecode.totallylazy.Function1;
import com.googlecode.totallylazy.Sequences;
import com.googlecode.totallylazy.regex.Regex;
import com.googlecode.yatspec.junit.Notes;
import com.googlecode.yatspec.junit4.Notes;
import com.googlecode.yatspec.state.TestMethod;

import java.util.regex.MatchResult;

import static com.googlecode.totallylazy.regex.Regex.regex;
import static com.googlecode.yatspec.junit.Notes.methods.notes;
import static com.googlecode.yatspec.junit4.Notes.methods.notes;

public class NotesTagFinder implements TagFinder {
private Regex regex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.googlecode.totallylazy.Callable1;
import com.googlecode.totallylazy.Pair;
import com.googlecode.totallylazy.Predicate;
import com.googlecode.yatspec.junit.Notes;
import com.googlecode.yatspec.junit.SpecResultListener;
import com.googlecode.yatspec.junit4.Notes;
import com.googlecode.yatspec.junit4.SpecResultListener;
import com.googlecode.yatspec.parsing.Files;
import com.googlecode.yatspec.parsing.JavaSource;
import com.googlecode.yatspec.rendering.NotesRenderer;
Expand All @@ -19,7 +19,6 @@
import java.util.ArrayList;
import java.util.List;

import static com.googlecode.totallylazy.Callables.asString;
import static com.googlecode.totallylazy.Maps.entries;
import static com.googlecode.totallylazy.Predicates.*;
import static com.googlecode.totallylazy.Sequences.sequence;
Expand Down
2 changes: 1 addition & 1 deletion src/com/googlecode/yatspec/state/TestMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Map;

import static com.googlecode.totallylazy.Sequences.sequence;
import static com.googlecode.yatspec.junit.YatspecAnnotation.methods.yatspecAnnotations;
import static com.googlecode.yatspec.junit4.YatspecAnnotation.methods.yatspecAnnotations;
import static java.lang.System.lineSeparator;

@SuppressWarnings({"unused"})
Expand Down
2 changes: 1 addition & 1 deletion src/com/googlecode/yatspec/state/TestResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.List;

import static com.googlecode.totallylazy.Sequences.sequence;
import static com.googlecode.yatspec.junit.YatspecAnnotation.methods.yatspecAnnotations;
import static com.googlecode.yatspec.junit4.YatspecAnnotation.methods.yatspecAnnotations;
import static com.googlecode.yatspec.parsing.Text.wordify;
import static java.util.Arrays.asList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.yatspec.state.givenwhenthen.TestState;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.yatspec.state.givenwhenthen.TestState;
import org.junit.BeforeClass;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

public class ChildClassTest extends AbstractTestCase {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.yatspec.rendering.junit.HumanReadableScenarioNameRenderer;
import com.googlecode.yatspec.rendering.junit.MavenSurefireScenarioNameRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.Mapper;
import com.googlecode.totallylazy.Predicates;
Expand All @@ -12,7 +12,7 @@
import java.util.Map;

import static com.googlecode.totallylazy.Sequences.sequence;
import static com.googlecode.yatspec.junit.DecoratingFrameworkMethodTest.row;
import static com.googlecode.yatspec.junit4.DecoratingFrameworkMethodTest.row;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.hamcrest.CoreMatchers.is;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.yatspec.rendering.LinkingNoteRenderer;
import com.googlecode.yatspec.state.TestMethod;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.Sequence;
import com.googlecode.yatspec.plugin.sequencediagram.ByNamingConventionMessageProducer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.totallylazy.StringPrintStream;
import org.junit.After;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import com.googlecode.yatspec.rendering.NotesRenderer;
import com.googlecode.yatspec.rendering.html.HtmlResultRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.googlecode.yatspec.junit;
package com.googlecode.yatspec.junit4;

import org.hamcrest.Matcher;
import org.junit.Test;
Expand Down
10 changes: 5 additions & 5 deletions test/com/googlecode/yatspec/parsing/TestParserTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.googlecode.yatspec.parsing;

import com.googlecode.yatspec.junit.Notes;
import com.googlecode.yatspec.junit.Row;
import com.googlecode.yatspec.junit.SpecRunner;
import com.googlecode.yatspec.junit.Table;
import com.googlecode.yatspec.junit4.Notes;
import com.googlecode.yatspec.junit4.Row;
import com.googlecode.yatspec.junit4.SpecRunner;
import com.googlecode.yatspec.junit4.Table;
import com.googlecode.yatspec.state.TestMethod;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -12,7 +12,7 @@
import java.util.Locale;

import static com.googlecode.totallylazy.Sequences.sequence;
import static com.googlecode.yatspec.junit.Notes.methods.notes;
import static com.googlecode.yatspec.junit4.Notes.methods.notes;
import static com.googlecode.yatspec.parsing.TestParser.parseTestMethods;
import static java.lang.String.format;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.googlecode.yatspec.plugin.dictionary;

import com.googlecode.yatspec.junit.SpecResultListener;
import com.googlecode.yatspec.junit.SpecRunner;
import com.googlecode.yatspec.junit.WithCustomResultListeners;
import com.googlecode.yatspec.junit4.SpecResultListener;
import com.googlecode.yatspec.junit4.SpecRunner;
import com.googlecode.yatspec.junit4.WithCustomResultListeners;
import com.googlecode.yatspec.rendering.html.HtmlResultRenderer;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
2 changes: 1 addition & 1 deletion test/com/googlecode/yatspec/rendering/Annotations.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.googlecode.yatspec.rendering;

import com.googlecode.yatspec.junit.Notes;
import com.googlecode.yatspec.junit4.Notes;

public class Annotations {
private Annotations() {
Expand Down
4 changes: 2 additions & 2 deletions test/com/googlecode/yatspec/state/TestResultTest.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.googlecode.yatspec.state;

import com.googlecode.yatspec.junit.Notes;
import com.googlecode.yatspec.junit4.Notes;
import org.junit.Test;

import static com.googlecode.totallylazy.Sequences.sequence;
import static com.googlecode.yatspec.junit.Notes.methods.notes;
import static com.googlecode.yatspec.junit4.Notes.methods.notes;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

Expand Down

0 comments on commit ffd8905

Please sign in to comment.