forked from rlogiacco/Natural
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated core lang model into cucumber grammar
76: Unable to hide/suppress warnings on feature files Task-Url: rlogiacco#76 Signed-off-by: Aaron R Miller <[email protected]>
- Loading branch information
Aaron R Miller
committed
Aug 3, 2020
1 parent
de4829b
commit 0e508b2
Showing
16 changed files
with
800 additions
and
775 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...atural.cucumber.tests/src/org/agileware/natural/cucumber/tests/CucumberExamplesTest.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package org.agileware.natural.cucumber.tests | ||
|
||
import org.agileware.natural.cucumber.model.CucumberModel | ||
import org.agileware.natural.lang.model.DocumentModel | ||
import org.agileware.natural.testing.AbstractExamplesTest | ||
import org.eclipse.xtext.testing.InjectWith | ||
import org.eclipse.xtext.testing.XtextRunner | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(XtextRunner) | ||
@InjectWith(CucumberInjectorProvider) | ||
class CucumberExamplesTest extends AbstractExamplesTest<CucumberModel> {} | ||
class CucumberExamplesTest extends AbstractExamplesTest<DocumentModel> {} |
2 changes: 1 addition & 1 deletion
2
org.agileware.natural.cucumber.web/WebRoot/xtext-resources/generated/mode-feature.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...gileware.natural.cucumber.web/src/org/agileware/natural/cucumber/web/CucumberServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* generated by Xtext 2.23.0-SNAPSHOT | ||
*/ | ||
package org.agileware.natural.cucumber.web; | ||
|
||
import com.google.inject.Injector; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import org.eclipse.xtext.util.DisposableRegistry; | ||
import org.eclipse.xtext.web.servlet.XtextServlet; | ||
|
||
/** | ||
* Deploy this class into a servlet container to enable DSL-specific services. | ||
*/ | ||
@WebServlet(name = "XtextServices", urlPatterns = "/xtext-service/*") | ||
public class CucumberServlet extends XtextServlet { | ||
|
||
DisposableRegistry disposableRegistry; | ||
|
||
public void init() throws ServletException { | ||
super.init(); | ||
Injector injector = new CucumberWebSetup().createInjectorAndDoEMFRegistration(); | ||
this.disposableRegistry = injector.getInstance(DisposableRegistry.class); | ||
} | ||
|
||
public void destroy() { | ||
if (disposableRegistry != null) { | ||
disposableRegistry.dispose(); | ||
disposableRegistry = null; | ||
} | ||
super.destroy(); | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
...agileware.natural.cucumber.web/src/org/agileware/natural/cucumber/web/ServerLauncher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* generated by Xtext 2.23.0-SNAPSHOT | ||
*/ | ||
package org.agileware.natural.cucumber.web; | ||
|
||
import java.net.InetSocketAddress; | ||
import org.eclipse.jetty.annotations.AnnotationConfiguration; | ||
import org.eclipse.jetty.server.Server; | ||
import org.eclipse.jetty.util.log.Slf4jLog; | ||
import org.eclipse.jetty.webapp.Configuration; | ||
import org.eclipse.jetty.webapp.MetaInfConfiguration; | ||
import org.eclipse.jetty.webapp.WebAppContext; | ||
import org.eclipse.jetty.webapp.WebInfConfiguration; | ||
import org.eclipse.jetty.webapp.WebXmlConfiguration; | ||
|
||
/** | ||
* This program starts an HTTP server for testing the web integration of your DSL. | ||
* Just execute it and point a web browser to http://localhost:8080/ | ||
*/ | ||
public class ServerLauncher { | ||
public static void main(String[] args) { | ||
Server server = new Server(new InetSocketAddress("localhost", 8080)); | ||
WebAppContext ctx = new WebAppContext(); | ||
ctx.setResourceBase("WebRoot"); | ||
ctx.setWelcomeFiles(new String[] {"index.html"}); | ||
ctx.setContextPath("/"); | ||
ctx.setConfigurations(new Configuration[] { | ||
new AnnotationConfiguration(), | ||
new WebXmlConfiguration(), | ||
new WebInfConfiguration(), | ||
new MetaInfConfiguration() | ||
}); | ||
ctx.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, | ||
".*/org\\.agileware\\.natural\\.cucumber\\.web/.*,.*\\.jar"); | ||
ctx.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false"); | ||
server.setHandler(ctx); | ||
Slf4jLog log = new Slf4jLog(ServerLauncher.class.getName()); | ||
try { | ||
server.start(); | ||
log.info("Server started " + server.getURI() + "..."); | ||
new Thread() { | ||
|
||
public void run() { | ||
try { | ||
log.info("Press enter to stop the server..."); | ||
int key = System.in.read(); | ||
if (key != -1) { | ||
server.stop(); | ||
} else { | ||
log.warn( | ||
"Console input is not available. In order to stop the server, you need to cancel process manually."); | ||
} | ||
} catch (Exception e) { | ||
log.warn(e); | ||
} | ||
} | ||
|
||
}.start(); | ||
server.join(); | ||
} catch (Exception exception) { | ||
log.warn(exception.getMessage()); | ||
System.exit(1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 11 additions & 43 deletions
54
org.agileware.natural.cucumber/model/generated/Cucumber.genmodel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" | ||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext 2.21.0" modelDirectory="/org.agileware.natural.cucumber/src-gen" | ||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext 2.23.0-SNAPSHOT" modelDirectory="/org.agileware.natural.cucumber/src-gen" | ||
modelPluginID="org.agileware.natural.cucumber" forceOverwrite="true" modelName="Cucumber" | ||
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" | ||
complianceLevel="8.0" copyrightFields="false" runtimeVersion="2.20"> | ||
complianceLevel="8.0" copyrightFields="false" runtimeVersion="2.20" usedGenPackages="platform:/resource/org.agileware.natural.lang/model/generated/Natural.genmodel#//model"> | ||
<genPackages prefix="Model" basePackage="org.agileware.natural.cucumber" disposableProviderFactory="true" | ||
fileExtensions="feature" ecorePackage="Cucumber.ecore#/"> | ||
<genClasses ecoreClass="Cucumber.ecore#//CucumberModel"> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//CucumberModel/locale"/> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//CucumberModel/feature"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//AbstractScenario"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//AbstractScenario/steps"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//Section"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Section/tags"/> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//Section/title"/> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//Section/narrative"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//Feature"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Feature/background"/> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Feature/scenarios"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//Feature"/> | ||
<genClasses ecoreClass="Cucumber.ecore#//AbstractScenario"/> | ||
<genClasses ecoreClass="Cucumber.ecore#//Background"/> | ||
<genClasses ecoreClass="Cucumber.ecore#//Scenario"/> | ||
<genClasses ecoreClass="Cucumber.ecore#//ScenarioOutline"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//ScenarioOutline/examples"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//ScenarioOutline"/> | ||
<genClasses ecoreClass="Cucumber.ecore#//Step"> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//Step/keyword"/> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//Step/description"/> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Step/table"/> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Step/code"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//Example"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Example/table"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//Table"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Table/rows"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//TableRow"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//TableRow/cols"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//TableCol"> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//TableCol/cell"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//DocString"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//DocString/text"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//Tag"> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//Tag/id"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//Text"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Text/lines"/> | ||
</genClasses> | ||
<genClasses ecoreClass="Cucumber.ecore#//TextLine"> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//TextLine/value"/> | ||
<genClasses ecoreClass="Cucumber.ecore#//Section"> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Section/meta"/> | ||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Cucumber.ecore#//Section/title"/> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Section/narrative"/> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Section/scenarios"/> | ||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Cucumber.ecore#//Section/steps"/> | ||
</genClasses> | ||
</genPackages> | ||
</genmodel:GenModel> |
Oops, something went wrong.