Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cucumber7compatibility #457

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>parent-TRUNK</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
2 changes: 1 addition & 1 deletion io.cucumber.eclipse.editor/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",
org.eclipse.e4.ui.css.swt.theme,
org.eclipse.ui.genericeditor,
io.cucumber.gherkin;bundle-version="16.0.0",
io.cucumber.messages;bundle-version="13.2.1",
io.cucumber.messages;bundle-version="[13.2.1,14.0.0)",
org.eclipse.ui.trace,
org.eclipse.ui.console,
net.mihai-nita.ansicon.plugin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public void handleEnvelope(Envelope env) {
continue;
}
PickleStep pickleStep = pickleSteps.get(pickleStepId);
if(pickleStep == null)
continue;
session.newTestCase(step.getId(), pickleStep.getId(), testSuite, pickleStep.getText(), step.toString());
}
return;
Expand Down
81 changes: 51 additions & 30 deletions io.cucumber.eclipse.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@
</copyright>

<license url="">
The MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
&quot;Software&quot;), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
The MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
&quot;Software&quot;), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</license>

Expand Down Expand Up @@ -59,13 +59,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
id="io.cucumber.gherkin"
download-size="0"
install-size="0"
version="16.0.0"/>
version="0.0.0"/>

<plugin
id="io.cucumber.messages"
download-size="0"
install-size="0"
version="13.2.1"/>
version="0.0.0"/>

<plugin
id="io.cucumber.eclipse.editor"
Expand All @@ -77,55 +77,55 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
id="io.cucumber.cucumber-java"
download-size="0"
install-size="0"
version="6.9.1"/>
version="0.0.0"/>

<plugin
id="io.cucumber.cucumber-core"
download-size="0"
install-size="0"
version="6.9.1"/>
version="0.0.0"/>

<plugin
id="io.cucumber.cucumber-plugin"
download-size="0"
install-size="0"
version="6.9.1"/>
version="0.0.0"/>

<plugin
id="io.cucumber.cucumber-gherkin"
download-size="0"
install-size="0"
version="6.9.1"/>
version="0.0.0"/>

<plugin
id="io.cucumber.cucumber-gherkin-messages"
download-size="0"
install-size="0"
version="6.9.1"/>
version="0.0.0"/>

<plugin
id="io.cucumber.cucumber-expressions"
download-size="0"
install-size="0"
version="11.0.0"/>
version="0.0.0"/>

<plugin
id="io.cucumber.datatable"
download-size="0"
install-size="0"
version="3.5.0"/>
version="0.0.0"/>

<plugin
id="io.cucumber.docstring"
download-size="0"
install-size="0"
version="6.9.1"/>
version="0.0.0"/>

<plugin
id="io.cucumber.tag-expressions"
download-size="0"
install-size="0"
version="3.0.0"/>
version="0.0.0"/>

<plugin
id="io.cucumber.create-meta"
Expand All @@ -148,4 +148,25 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
version="0.0.0"
unpack="false"/>

<plugin
id="io.cucumber.eclipse.java.plugins.v6"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="io.cucumber.eclipse.java.plugins.v7"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="io.cucumber.messages.source"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
11 changes: 11 additions & 0 deletions io.cucumber.eclipse.java.plugins.v6/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cucumber Eclipse Plugins
Bundle-SymbolicName: io.cucumber.eclipse.java.plugins.v6
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: io.cucumber.eclipse.java.plugins
Require-Bundle: io.cucumber.cucumber-plugin;bundle-version="[0.0.0,7.0.0)",
io.cucumber.messages;bundle-version="[0.0.0,14.0.0)",
io.cucumber.eclipse.java.plugins;bundle-version="2.0.0"
Export-Package: io.cucumber.eclipse.java.plugins.v6
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package io.cucumber.eclipse.java.plugins.v6;

import java.io.IOException;
import java.util.function.Consumer;

import io.cucumber.eclipse.java.plugins.BaseCucumberEclipsePlugin;
import io.cucumber.messages.Messages.Envelope;
import io.cucumber.plugin.ConcurrentEventListener;
import io.cucumber.plugin.event.EventPublisher;

/**
* Specialized plugin that allows to transfer the {@link Envelope}s emitted to a
* remote process or consume them locally
*
* @author christoph
*
*/
public class CucumberV6EclipsePlugin extends BaseCucumberEclipsePlugin<Envelope> implements ConcurrentEventListener{


public CucumberV6EclipsePlugin(String port) throws IOException {
super(port);
}

public CucumberV6EclipsePlugin(Consumer<Envelope> consumer) {
super(consumer);
}

@Override
public void setEventPublisher(EventPublisher publisher) {
publisher.registerHandlerFor(Envelope.class, consumer::accept);
}

@Override
protected boolean isFinished(Envelope env) {
return env.hasTestRunFinished() ;
}

@Override
protected io.cucumber.eclipse.java.plugins.dto.Envelope convert(Envelope envelope) {
return MessageToDtoConverter.convert(envelope);
}


}
Loading