1
edit
Changes
no edit summary
=Lab 1=
*[http://zenit.senecac.on.ca/wiki/index.php/Teams_Winter_2011/team4 Teampage]
==Tutorial==
===Preparing Eclipse===
===Creating your first Java project===
===Browsing Java elements using the package explorer===
===Editing Java elements===
===Creating a Java class===
*Select a package in the package explorer, right click: New->Class
*Give the class a meaningful name, click finish
*Note: At least one class that you make should have "public static void main(String [] args)" CHECKED
===Renaming Java elements===
===Moving and copying Java elements===
===Navigate to a Java element's declaration===
===Viewing the type Hierarchy===
===Running your programs===
* Ensure that the *NOTE specified in class creation is adhered to:
** public static void main(String [] args), Must exist in a class
* There are several ways to run your programs in eclipse including:
** Clicking the run button in the toolbar
** You can right click a java project or package and select run as (which gives numerous options in which to run your program)
** And you can also use the keyboard shortcut Ctrl+F11
===Debugging your programs===
* Select your Java project in the package explorer, right click: Debug As->Java Application
===Evaluating expressions===
* Evaluating expressions requires you to be in Debug Perspective before doing anything
* Once in debug perspective, highlight the line in which you want to evaluate the expression for
* Then, in the toolbar, select Context->Inspect
===Evaluating snippets===
* TO evaluate a snippet, we must first create a scrapbook page
** This is done by File->New->Other->Java->Java Run/Debug->Scrapbook Page
* A window will pop up asking for both a folder and file name, enter these
* An editor will now pop up where you can enter your code snippets that you wish to have evaluated
* To view the results, right click on the snippet and select display
===Using the Java browsing perspective===
*Click on Window on the menu bar, Open perspective->Other
**Select Java browsing, Click OK
*These perspective is used to easily traverse through projects and edit code
===Writing and running JUnit tests===
*Select a package in the package explorer, right click: New->JUnit Test Case
**Give it a meaningful name, Click Finish
*Ensure your class "extends TestCase"
*Create functions within your class, JUnit will automatically call them if they adhere to the naming conventions: function name = "test" + x
**public void testEquivs()
*Select your Java project in the package explorer, right click: Debug As->JUnit Test