Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By : Alex Blewitt
Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By: Alex Blewitt

Overview of this book

Eclipse is used by everyone from indie devs to NASA engineers. Its popularity is underpinned by its impressive plug-in ecosystem, which allows it to be extended to meet the needs of whoever is using it. This book shows you how to take full advantage of the Eclipse IDE by building your own useful plug-ins from start to finish. Taking you through the complete process of plug-in development, from packaging to automated testing and deployment, this book is a direct route to quicker, cleaner Java development. It may be for beginners, but we're confident that you'll develop new skills quickly. Pretty soon you'll feel like an expert, in complete control of your IDE. Don't let Eclipse define you - extend it with the plug-ins you need today for smarter, happier, and more effective development.
Table of Contents (24 chapters)
Eclipse Plug-in Development Beginner's Guide Second Edition
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – waiting for a condition


Typically an action may require some result to happen in the user interface before testing can continue. Since the SWTBot can run much faster than a human can, waiting for the result of an action may be necessary. To demonstrate this, create a Java project with a single source file and then use the conditions to wait until the class file is compiled.

  1. Create a new method in the UITest class called createJavaProject.

  2. Use the bot to create a new Java project by copying the createProject method as a template.

  3. Add the org.eclipse.core.resources as a dependency to the plug-in.

  4. Add a method getProject, which takes a projectName and returns an IProject from ResourcesPlugin.getWorkspace().getRoot().getProject().

  5. At the end of the createJavaProject method, use the getProject method with the test project to get the folder src.

  6. If the folder does not exist, create it.

  7. Get the file from src called Test.java.

  8. Create it with the contents from class Test{} bytes as a ByteArrayInputStream...