How to use a JUnit @Test Method to create a simple MVP tool in Java
Автор: EvilTester - Software Testing
Загружено: 2016-04-15
Просмотров: 1296
Описание:
http://JavaForTesters.com
Demonstration of using @Test methods in IntelliJ IDE as a tool
Demonstration of running @Test methods in IntelliJ
Demonstration of debugging @Test methods in IntelliJ
Overview of Markdown
Overview of Leanpub
Overview of Pandoc
I use @Test annotated methods for simple tools. In this Java For Testers Case Study video I will show you how I do that.
So first. Here is a tool. This is an MVP. A Minimal Viable Product.
I want to take a leanpub project - a set of markdown files where the order is controlled by a Book.txt file. And I want to output a single markdown file that I can run through pandoc to create a pdf locally.
Markdown is a simple text markup language, that can be converted to HTML, or PDF, or some other formatting easily.
I want a tool to do that.
The IDE is my GUI. I can run the test, and it will do the work.
The variables are my GUI input fields.
I have some simple error handling - run @Test without adding a Book.txt file
Add a book.txt file, run the tool.
It is a 'minimum' viable product, so it doesn't do all the work. But it prompts me what to do next, so I have to enter a console command.
This works. I have a tool that will help me convert a leanpub project into a local preview.
I haven't made it robust, but if I encounter problems, I can run it in debug mode and set breakpoints.
If I use this enough, then I'll spend time refactoring, and I might even get to the point where I want a standalone tool, with a GUI or a command line interface.
But, I don't have to start there.
I use this approach a lot, and I tend to use Java, rather than a lot of scripting languages because I'm more familiar with it.
So if you want to knock up a quick tool. And have some basic programming knowledge. Don't think you have to write a full GUI or CLI. You can just run @Test annotated methods from a GUI.
The code for this is on GitHub
https://github.com/eviltester/pandoci...
In my eviltester 'pandocifier' project.
You can read more about this on my Java blog at blog.JavaForTesters.com.
And if you want to learn Java, using @Test methods, to help support you with your testing. Then I wrote the book Java For Testers.
http://JavaForTesters.com
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: