I used IntelliJ to write Cucumber feature files i.e., *.feature files and corresponding step definition files in Java within the IDE. The user experience is great and IDE opens up its IntelliSense showing all valid options for which the step definitions exist. If I write a new step in a scenario or a step that has no corresponding step definition exist already in the Java file, it highlights the step with different colour and similarly if regex don't match. I get informed by this highlighting that something has to be written for this step in Java file or the step is wrong and will not execute.
I need the same functionality on a non developer machine i.e., on a Business Analyst or Product owner machine, where there is no IDE installed but just an editor like Notepad++. I know about the Notepad++ plug-in for Gherkin but it doesn't highlight the step for which step definition is missing in the *.java step definition file. Please suggest any editor or free IDE that has similar plug-in available.
Thanks,
Shany
In case you use JIRA to manage your stories then you can use a JIRA plugin which has Auto-complete, parameter highlight functionality. There are other similar plugins you can browse.
Related
I'm using Eclipse Eclipse IDE for Java Developers [Version: 2018-12 (4.10.0)
Build id: 20181214-0600] to develop a JavaFX project but I got some problems.
After a Java update, I've found several errors in my CSS files. Eclipse seems to think the CSS files are Java source code, as figured in the image below.
When I drag the mouse on a error, the description is "Syntax error on token 'Invalid character', interface expected" (because of # symbol)
I'm sure the code is correct because there are no errors before the latest java update to version 1.8.2.
Anyone can help me?
Most likely what happened here is what #Gianpio Benincasa said: You've created a new class, then in the file explorer you renamed it.
However, it's worth checking this one: Go to window/preferences, type 'associations' in the filter box to quickly nav to setting General>Editors>File Associations, and scroll through the file types list for *.css. Click on it, and check which editors are associated with it.
An eclipse with no particularly relevant plugins should only list 'Text Editor', and it should be marked as default. If you added plugins specifically for editing CSS, those will also be listed (and one of those is now probably default instead). Perhaps you or someone else went out of their way to add the java editor to this list somehow. If that is the case, simply make 'text editor' the default again (click it, click 'default'), then click on the java editor, and click 'remove'.
for eclipse that is a java class, in fact the icon has the "J". Probably when you created it you have created a new class and then have renamed it.
Create a new generic file instead a java class and copy the contents to the new file.
For create a generic file, rightclick and follow new-> other-> General-> files
Have a nice day
I need to write a java plugin will draw on the attributes using the rhapsody . What do you recommend for that. Where should I start ? Previously I did not write plug-ins.
First place to start is to look at the samples provided by IBM. You can find them (on Windows 7, version 7.5.3 of Rhapsody) in:
C:\Users\\IBM\Rational\Rhapsody\7.5.3\Samples\ExtensibilitySamples
There are 3 types you can create:
1. A plugin (what you are asking about)
2. A Check plugin (ties into the model check sub-system)
3. Event callback plugin (don't know much about this one)
I've written 1 and 2.
There should be a how-to document in and around that directory area that walks you through creating a simple plugin. If not, it probably is available in the Rhapsody help (from within the tool)
Basically, you write your Java plugin to conform to a specific interface that IBM provides(com.telelogic.rhapsody.core.RPUserPlugin), create a .hep file that describes the details of that, and then drop the .hep file into the .rpy folder of your project. You then create a new profile in your model with the same name as your .hep file and that should link to the .hep information.
A sample .hep file looks like this:
[Helpers]
numberOfElements=1
#REM: Tranformer Generation plug-in
name1=Generate Transformers
JavaMainClass1=sida.jni.transformerplugin.TransformerPlugin
JavaClassPath1=..\TransformerPlugin\DefaultConfig
isPlugin1=1
isVisible1=1
DLLServerCompatible1=1
Take special note of the numbers added to the end of the attribute names:
ex. isPlugin1, isVisible1
You will want to match that to the name# attribute in the file.
Then make sure your java plugin class files are on the classpath or (better yet), co-located to your .rpy folder. For example, our plugins sit in a folder right next to (at the same level as) our .rpy folder.
If all goes well, you should see an initialization string spit out in the Rhapsody console window for the plugin.
Hope this gets you started...
In IntelliJ with the ASM Bytecode plugin installed you can select "Show Bytecode outline" in the popup menu when viewing a class file. Recently my IntelliJ (Community Version 12.1.6) started displaying:
// couldn't generate bytecode view, no .class file found
in the ASM window.
This occurs on various class files across different modules in my project. The strange thing is that I will get this message for one class; but another class in the same module and package works fine.
The entire project compiles fine and all my tests run. I cannot figure out why I get this message for one class and not another.
I have had the same problems after moving to IDEA 12 but my "positive hit rate" for being actually able to view the byte code outline became more stable again after upgrading to version 13. However, the result is still rather dissatisfying. From the logs, I learned that the plugin seems to not being able to find the referred class files even though they exist. It helps to make the project before trying to view the files, but this is not a perfect solution either. I guess, the problems will stay until someone sufficiently annoyed (maybe you?) upgrades the plugin.
What I use for now is simply javap from IntelliJ IDEA. You can add external tools by doing the following:
Settings > External Tools > Add...
Set the javap location for the called program: For example C:\Program Files\Java\jdk7\bin\javap.exe on Windows, depending of your installation path.
Add -v -c $FileClass$ as the parameters (here you can of course set the parameters you actually require).
Set $OutputPath$ as the working directory.
Now you can use javap from the right click menu on the source code view and you can also define a shortcut for the command.
Per Andrey Breslav's comment, the correct resolution to this issue is to use the "Show Bytecode" command in the "View" menu. You must have the source file open for this command to be displayed. You must have compiled the source since the last change for the command to complete successfully.
So I've been making a grammar in Eclipse with ANTLR v3.4 and I've made one that works and I want to make sure when I edit it everything still works. I can go into the interpretter everytime but that seems like a huge waste of time.
Questions:
I've read about gunit but the link it gives to download gUnit:
( http://antlr.org/hudson/job/gUnit/org.antlr$gunit/lastSuccessfulBuild/ ) doesn't work. How can I get gUnit.
What is the best way to test grammars? Is it actually gUnit or should I just do java tests like jUnit tests?
The question is old, but I'm leaving a reference for completeness:
For me, the gUnit was useless. So I managed to find how test only the Lexer and then, only the parser.
I answered it here: https://stackoverflow.com/a/53884851/976948
Basically, there are links for 2 articles about how to test it:
Unit test for Lexer
Unit test for Parser
I recently completed two ANTLR3 assignments (I'm working on my Master's in Computer Science) using Eclipse. I found no single document that had a process for installing, configuring, writing, and debugging a grammar in Eclipse. So, after working through various issues, I found the easiest thing to do was to stay in Eclipse for testing.
To use the process I have come to use (outlined below) you must first have the ANTLR IDE v2.1.2 installed. Add it right from inside Eclipse Indigo: http://antlrv3ide.sourceforge.net/updates. This site also has some useful doc on using the ANTLR IDE. Once installed, the IDE has to be configured. Video tutorials are a bit out of date but helpful. See a detailed how to guide on configuring ANTLR IDE in Eclipse. The main configuration item is the java output folder. Do this in Eclipse by going to Windows, Preferences, ANTLR, Code Generator, check Project relative folder and in the Output folder name box type a folder name (mine is called "antlr-java", others use "generated").
Test/Debug Process for ANTLR in Eclipse Indigo with ANTLR IDE
After a new project is created, right-click it, select Configure, Convert to
ANTLR Project...
Create the grammar in a .g file and save it. Note: filename has to match grammar name.
If there are significant errors, debug the grammar. Eclipse shows the ANTLR error(s)
and what line(s) are affected. At first, these errors seem hard to understand but
they can be worked through by using various resources:
- The Definitive ANTLR Reference by Terence Parr the guy who wrote ANTLR
- the ANTLR Reference Manual
- google the error; many times you will end up here at stackoverflow;
in particular, Bart Kiers is both knowledgeable and helpful (Bart: thx for
the help you didn't know you gave me)
On the first save after the serious ANTLR errors are resolved, the java output folder you
configured in Eclipse will be created and a java file in that folder will also be created.
Right-click on the java output folder, select Build Path, Use As a Source Folder. This
tells Eclipse where to look for the project's java source.
There are likely to be errors in the new java file. Select it, then search through looking
for java errors. Go back to your grammar or java file(s), correct the errors, and re-save
the grammar until both grammar and java files are error free, then run it.
From this point on, it's the usual modify-run-debug cycle.
The only other Eclipse change I needed was to create a few Run Configurations for testing
command line parameters.
You can download gUnit there but I think there is no latest version...
Try Jarvana... Latest version there is 3.4: http://repo1.maven.org/maven2/org/antlr/gunit/3.4/gunit-3.4.jar
#Dave Newton is right. As of ANTLR v3.1, gUnit is included in the main ANTLR Tool jar as is stated there.
I didn't know for gUnit till now. It looks great for grammar testing, but I think that JUnit tests will do their job to...
This is the first time I heard of gUinit and read up on it. (I don't use ANTLR much.) It sounds interesting, but half useless.
My approach to validating grammars is to actually validate the the entire parser with "normal" unit tests. The thing is, you should have unit tests in place anyway and the tests that check for grammar regression you just add it there. The thing is in my experience that most errors come in semantic analysis and reduction and not the grammar.
Is there a command line way to invoke the java code formatting feature of Eclipse?
Also, is there a way to configure the way it formats the code via command line?
The goal is to have a common code formatting mechanism for the entire team and automate that step prior to check in of code.
ajay try this post, there are some step-by-step instructions included here.
Have a look at the JDT application org.eclipse.jdt.core.JavaCodeFormatter.
I haven't tried this out, but you should be able to start eclipse as
eclipse -application org.eclipse.jdt.core.JavaCodeFormatter -all...other...options
See org.eclipse.jdt.core.formatter.CodeFormatterApplication for the available options.
You can create specific format xml and whole team can use that
Windows/Preference/java/formatter/Configure project specific setting , here we can edit and create customized format xml .Others can import this xml . Not very sure about command line
I know of no way from command line. Have you looked at Save Actions?
Preferences => Java => Editor => Save Actions let you format all code whenever it's saved. If everyone uses Eclipse, you can distribute your standard formatting XML file and use Save Actions to take the manual step out of formatting.
The downside, of course, is that everyone has to use the same project settings.