Module Road Map. 7. Version Control with Subversion Introduction Terminology

Similar documents
Introduction to Eclipse

Index. Symbols. /**, symbol, 73 >> symbol, 21

Overview of Eclipse Lectures. Module Road Map

Index. Bitwise operations, 131. Cloud, 88, 101

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

CHAPTER 6. Java Project Configuration

What s NetBeans? Like Eclipse:

Source Management (Version Control) Installation and Configuration Guide. Version 8.0 and Higher

SVN_Eclipse_at_home. 1. Download Eclipse. a. Go to: and select Eclipse IDE for Java Developers

User Guide Zend Studio for Eclipse V6.1

NetBeans Tutorial. For Introduction to Java Programming By Y. Daniel Liang. This tutorial applies to NetBeans 6, 7, or a higher version.

Enterprise Architect. User Guide Series. Portals. Author: Sparx Systems. Date: 19/03/2018. Version: 1.0 CREATED WITH

Enterprise Architect. User Guide Series. Portals

TogoDocClient Plug-ins development manual. TogoDocClient plug-ins development manual

Infor LN Studio Application Development Guide

Intro to MS Visual C++ Debugging

Supplement H.1: JBuilder X Tutorial. For Introduction to Java Programming, 5E By Y. Daniel Liang

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below.

6.170 Laboratory in Software Engineering Eclipse Reference for 6.170

Supplement II.B(1): JBuilder X Tutorial. For Introduction to Java Programming By Y. Daniel Liang

POOSL IDE Installation Manual

Eclipse Kick Start. Copyright 2005 by Sams Publishing. International Standard Book Number:

Enterprise Architect. User Guide Series. Portals

Database Explorer Quickstart

SECTION 1: CODE REASONING + VERSION CONTROL + ECLIPSE

EMC Documentum Composer

18.1 user guide No Magic, Inc. 2015

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Introduction to IBM Data Studio, Part 1: Get started with IBM Data Studio, Version and Eclipse

Introduction to IBM Data Studio, Part 1: Get started with IBM Data Studio, Version and Eclipse

25. DECUS Symposium THE Application Development Environment for OpenVMS

3. Hello World! for IDEA. Java. Summer 2008 Instructor: Dr. Masoud Yaghini

If you don t have the JDK, you will need to install it. 1. Go to

Installation Guide - Mac

Enterprise Architect. User Guide Series. Profiling. Author: Sparx Systems. Date: 10/05/2018. Version: 1.0 CREATED WITH

Evaluation Guide - WebSphere Integration

Enterprise Architect. User Guide Series. Profiling

Installation and Upgrade Guide Zend Studio 9.x

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang

Storing and Managing Code with CVS

NetBeans IDE Field Guide

Developing Android applications in Windows

SECTION 2: HW3 Setup.

Apache Subversion Tutorial

Adobe ColdFusion Documentation. September 2014

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21

Task-Oriented Solutions to Over 175 Common Problems. Covers. Eclipse 3.0. Eclipse CookbookTM. Steve Holzner

Red Hat Application Migration Toolkit 4.0

HPE Security Fortify Plugins for Eclipse

Implement an ADT while using Subversion

Lab Exercise 1 Using EGit and JUnit

From: Sudarshan N Raghavan (770)

JCreator. Starting JCreator

LinuxScope-JTD Installation Guide. Version 4.0.0

Installation and Upgrade Guide Zend Studio 9.x

Working with EGL and Subversion Using RDi with RBD

3 Getting Started with Objects

Introduction to Computation and Problem Solving

Using Eclipse Europa - A Tutorial

Embarcadero Change Manager 5.1 Installation Guide

1.00 Lecture 2. What s an IDE?

PTC Integrity Integration With Microsoft Visual Studio (SDK)

Appendix A: Courseware setup

Just Enough Eclipse What is Eclipse(TM)? Why is it important? What is this tutorial about?

What Is NetBeans? Free and open-source based > Open source since June, 2000 > Large community of users and developers

Session 5 Exercises: - Installing Subclipse - Checking out code using Subclipse - Basic object-oriented programming in Java

Slide 1 CS 170 Java Programming 1 Duration: 00:00:49 Advance mode: Auto

IntelliJ IDEA, the most intelligent Java IDE

Series 40 6th Edition SDK, Feature Pack 1 Installation Guide

Red Hat Application Migration Toolkit 4.2

The Road to CCSv4. Status Update

CS108, Stanford Handout #37. Source Control CVS

Oracle Enterprise Manager Oracle Database and Application Testing. Application Testing Suite Lab. Session S318966

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, January 2018

EAXML Demonstration Platform on Artop/Sphinx.

Software Development Kit

HPE Java Add-in Extensibility

Installation Guide - Windows

EMC Documentum Composer

An Integrated Approach to Managing Windchill Customizations. Todd Baltes Lead PLM Technical Architect SRAM

Getting Started with Eclipse/Java

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, November 2017

How To Get Database Schema In Java Using >>>CLICK HERE<<<

BLUEPRINT TEAM REPOSITORY. For Requirements Center & Requirements Center Test Definition

SECTION 2: Loop Reasoning & HW3 Setup

EGit/Gerrit Hands-on training #1: Installation and Configuration

NetBeans Primer v8.0

Outline. Tutorial III. Eclipse. Basics. Eclipse Plug-in Feature

Red Hat JBoss Fuse 6.1

JDK-WildFly-NetBeans Setup Local

Revision Control. Software Engineering SS 2007

vsphere Web Client SDK Documentation VMware vsphere Web Client SDK VMware ESXi vcenter Server 6.5.1

Resource 2 Embedded computer and development environment

Using Eclipse Che IDE to develop your codebase. Red Hat Developers Documentation Team :54:11 UTC

Technology Background Development environment, Skeleton and Libraries

Working with Beehive Controls

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

Department of Computer Science College of Engineering Boise State University

Quick Start Guide. CollabNet Subversion Connector to HP Quality Center

Transcription:

Module Road Map 1. Overview 2. Installing and Running 3. Building and Running Java Classes 4. Refactoring 5. Debugging 6. Testing with JUnit 7. Version Control with Subversion Introduction Terminology Lecture 4 Adding a repository to Eclipse Workbench Sharing a project Checking out a project from repository Synchronizing with respository 1

The Problem of Version Control Suppose two programmers are working on a project. (See http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.basic) They edit the same file. Then they both save their changes. What will happen? One approach: Programmer P1 locks the file, then unlocks it when done. What is wrong with this? 2

Subversion (SVN) An open-source based version-control system Allows coordination of source code changes made by individual developers working on a team Client-server method lets developers access code from anywhere there s an internet connection. Central server maintains history of all changes made to directory trees, called repositories Client machines have a copy of all files that developers are working on. The changes are then reported to the central server using a client that can access and update repositories. 3

Subversion What it does Subversion operations Checking out from a repository Retrieves a directory from a Subversion repository to the Workbench on local machine Sharing a resource Creates a copy of the resource on the Subversion repository Synchronizing with a repository Update Before you can commit changes, Subversion requires your sources to be in sync with any changes committed by other developers. Commit To make the changes available to other developers, you must commit them to the repository. 4

Download Subversion 5

Installing Subversion I chose the latest stable version of Windows binary 6

Unzipping Subversion 7

Put Subversion in C:\Program Files 8

Install Subversive, the Eclipse Client 9

Installing Subversive In Eclipse: Help > Software Upates > Find and Install 10

Search for Features of New Plug-in 11

Select New Remote Site 12

Fill in the Dialog Box On the New Update Site dialog enter the name of the update site and URL. Use the following values: Name: Subversive URL: for Subversive 1.1.x: http://www.polarion.org/projects/subversive/download/1. 1/update-site/ for Subversive 1.0.x: http://www.polarion.org/projects/subversive/download/up date-site/ Click on the OK button to store update site information. 13

Select Subversive To start searching the update sites, select Subversive and click on the Finish button. 14

Installing Subversive Features You will then be asked to select the features to install. It is safe to install all features. (If you want to save disk space, see the discussion at http://www.polarion.org/ind ex.php?page=installation& project=subversive#notes 15

Accept the terms of the license agreement. License Agreement 16

Install Features Then install the features. 17

Install Features, cont. Install the feature, despite the warning. 18

I suggest you restart Eclipse Restart for Safety 19

Configure Subversive After installation, choose Help > Software Upgrades > Manage Configuration 20

Select Subversive Team Provider Click to open Eclipse SDK ; then select SVN Team Provider. 21

Connecting with Subversive Select Window > Open perspective > Other 22

Select Subversion Repository Exploring 23

Click New Repository Location 24

Give the URL, user-id, and password, then click Finish. Select a Repository 25

Expand the Repository Click on the name of the repository to expand it 26

Check out the Project Rightclick on the name of the project to check it out. 27

Project Checked Out The project at the top of the pane was checked out. 28

Modify a Class 29

Committing Changes Save the file, then right-click on the filename and choose Team > Commit 30

Subversion» Conflicts A conflict occurs when you have locally modified a resource for which a more recent revision is available in the branch in the repository. 3 methods to resolve conflicts: Discard local copy by overwriting it with the newer version on the repository. Overwrite the copy on the repository with the local copy. Use extreme caution since you will be erasing changes made by others. Merge your work and the repository resource, saving locally the merged resource. 31

CVS» Conflicts Conflict types: An auto-mergeable conflicting change occurs when an source-code file has been changed both remotely and locally (i.e. has noncommitted local changes) but the changes are in different lines. A non-auto-mergeable conflicting change occurs when one or more of the same lines of a source-code file have been changed or when a binary file has been changed both remotely and locally. Binary files are never auto-mergeable. 32

Introduction to NetBeans v 5.0 Integrated Development Environment

Lecture Overview NetBeans Overview Installing and Running NetBeans NetBeans Projects Building and Running Java Classes Building Running Web Applications Refactoring Applications 34

Lecture Road Map NetBeans Overview Introduction to NetBeans Features NetBeans Projects Installing and Running NetBeans Building and Running Java Classes Building and Running Web Applications Refactoring Applications 35

NetBeans Overview» Introduction to NetBeans A comprehensive, modular Java-based IDE (Integrated Development Environment). Free and open-source based. Open source since June 2000 Large community of users and developers Provides a platform for building rich-client Java applications, Web applications, Web services etc. Supports plug-in architecture. Large set of third-party modules (plugin s) are included in the downloadable version. 36

NetBeans Overview» Features Ant-based project system Apache Ant is a Java-based build tool used to standardize and automate build and run environments for development. It is not necessary to know Ant to work with the IDE. See http://ant.apache.org/resources.html for more information on Ant. Matisse GUI Builder - provides rich framework of windows, menus, toolbars and actions. Plug-in (module) and rich client application development wizard. CVS version control. Enhanced Refactoring. 37

NetBeans Overview» Features Enterprise Development JBoss 4 and Weblogic 9 Support. Developer Collaboration Discuss/share code with other developers remotely. Conduct code review using chat capabilities. Allow others to make changes which are then represented to the rest of the group via visual cues. Send messages in plain text, XML, HTML, or Java code format. Application Profiling CPU performance profiling Memory profiling and memory leak detection 38

NetBeans Overview Installing and Running Lecture Road Map Where to get NetBeans? Installing NetBeans Running NetBeans NetBeans Projects Building and Running Java Classes Building and Running Web Applications Refactoring Applications 39

Installing and Running NetBeans» Where to get NetBeans? http:// www.netbeans.org provides downloads, articles and tutorials related to NetBeans. IDE can be downloaded from http://www.netbeans.info/downloads/index.php 40

Installing and Running NetBeans» Installing NetBeans NetBeans is available for Windows, MacOS, Linux and Solaris operating systems. Choose the NetBeans IDE 5.5.1 installer for the operating system that is installed on your development system. For Windows operating system, download the IDE 5.5.1 installer netbeans-5_5_1-windows.exe. Prior to NetBeans installation, make sure JVM (Java Virtual Machine) is installed. It is recommended that JDK 5.0 be downloaded from http://java.sun.com/j2se/1.5.0/download.jsp and installed. Execute the NetBeans self-extracting installer to start NetBeans installation. Follow the install shield instructions. 41

Installing and Running NetBeans» Running NetBeans On Windows XP, choose Start» All Programs» NetBeans 5.0» NetBeans IDE to launch NetBeans IDE. 42

Lecture Road Map NetBeans Overview Installing and Running NetBeans NetBeans Projects About Projects Project Templates Building and Running Java Applications Building and Running Web Applications Refactoring Applications 43

NetBeans Projects» About Projects A project is a group of source files and the settings with which you build, run, and debug those source files. The NetBeans IDE stores all of the information about a project in an Ant script, a properties file, and a few XML configuration files. The IDE includes support for two types of projects: Standard Projects: The IDE uses a NetBeans-generated Ant build script to build, run, clean, test, and debug your application. Free-form Projects: The IDE uses targets in an existing Ant script to build, run, clean, test, and debug your application. 44

NetBeans Projects» Project Templates The IDE includes several project templates designed to support different types of development including Web applications, general Java applications, and so forth. Standard Templates: The IDE controls all source and classpath settings, compilation, running, and debugging. The IDE generates an Ant script in which all project settings are stored. Standard Java Applications: Java Application, Java Class Library, Java Project with Existing Sources. Web Applications: Web Application, Web Application with Existing Sources. Enterprise Applications: Enterprise Application, Enterprise Application with Existing Sources. EJB Modules: EJB Module, EJB Module with Existing Sources NetBeans Plug-in Modules: Module Project, Module Suite Project, Library Wrapper Module Project. Free-Form Project Templates: The IDE relies on an existing Ant script for instructions on how to compile, run, and debug applications. Java Project with Existing Ant Script: A free-form Java project. Web Project with Existing Ant Script: A free-form project containing a web application. EJB Module with Existing Ant Script: A free-form project containing an Enterprise JavaBeans module. 45

Lecture Road Map NetBeans Overview Installing and Running NetBeans NetBeans Projects Building and Running Java Applications Setting up a Project Creating and Editing Java Source Code Compiling, Running and Debugging a Project Testing with JUnit Building and Running Web Applications Refactoring Applications 46

Java Applications» Setting up a New Project From the main menu, choose File» New Project. This opens up the New Project window. In Categories pane, select General. In Projects pane, select Java Application and click Next. 47

Java Applications» Setting up a New Project Enter the name of the project in the Project Name text box. Choose a folder for the Project Location. Ensure that Set as Main Project and Create Main Class checkboxes are checked. Enter the fully qualified name of the main class (without the.java extension) in the text box adjacent to the Create Main Class checkbox. The class name may be qualified with a package name and a dot (for example, mypackage.mainclass). Click Finish. 48

Java Applications» Setting up a New Project The project will be displayed in the Projects window. The Java file that contains the skeleton code for the main class opens in the Source Editor. Expand the project name (a.k.a. project node) in the Projects window to view the Java files that belong to the project. 49

Java Applications» Setting up a New Project Click on the Files tab to view the project s file structure in the Files window. 50

Java Applications» Setting up a New Project» Project Properties Right-click on the Project node in the Projects window. This will open the Project Properties window. In Categories pane, click on Libraries. Click Manage Platforms button to specify a different JDK platform. Compile-time and run-time class paths may be specified using the Compile tab and the Run tab respectively. 51

Exercise 1 Create a New Java Application Project titled EgApp with a main class titled MainClass in a new package titled csc517. 52

Lecture Road Map NetBeans Overview Installing and Running NetBeans NetBeans Projects Building and Running Java Applications Setting up a Project Creating and Editing Java Code Compiling, Running and Debugging a Project Testing with JUnit Building and Running Web Applications Refactoring Applications 53

Java Applications» Creating and Editing Java code In this module, you will learn how to Create a new class Navigate a Project node Add a new method to a class Create a new field to a class Use editing shortcuts 54

Java Applications» Creating and Editing Java code» Creating a new Java class To create a new Java class, right-click on the project node in the Projects window and choose New» Java class. The New Java Class window will be displayed. Enter the name of the new Java class in the Class Name text box. If the new class needs to be part of a package, type the name of a new package in the Package text box or choose an existing package from the drop-down list. Click Finish. The IDE generates the skeleton source code of the new Java class and opens it up in a new Java source window. 55

Java Applications» Creating and Editing Java code» Navigating the project node In the Projects window, expand Source packages node under the Project node to view the package nodes and Java file nodes. Expand the Java file node to view the classes defined in the Java file. Double-click on the Java file to open the Java file in the Source editor. Expand the class node to view the fields, constructors and methods of the class. 56

Java Applications» Creating and Editing Java code» Adding a new method to a class Right-click on the Methods node of the class and click Add Method to create a new Java method. This opens up the Add New Method window. The Name, Return Type, Access, Modifiers and Parameters of the new method may be specified in the Add New Method window. 57

Java Applications» Creating and Editing Java code» Adding a new field to a class Right-click on the Fields node of the class and click Add Field to add a new field. This opens up the Add New Field window. The Name, Type, Access, Modifiers and Initial Value of the field may be specified in the Add New Field window. 58

Java Applications» Creating and Editing Java Source Editing Shortcuts: Ctrl+Shift+F: Reformat the whole source code window. Ctrl+Space: Code-completion box. (The IDE offers code completion for all classes and methods in the project's compilation classpath). 59

Exercise 2 Create a new class titled NewClass and add it to the package csc517 in the project EgApp you have created in Exercise 1. Add a private integer field (member variable) mvar to the class NewClass. Change the default constructor to accept integer parameter to initialize the private integer field mvar. Add a public method printfield that takes no parameters and returns void. Add code to the printfield method to print the value of the private variable mvar to standard output. (Hint: To use code-completion feature for the print routine, type sys and hit Ctrl-Space. The IDE pops-up the code completion box with a list of methods. Choose System.out.println() print routine). 60

Lecture Road Map NetBeans Overview Installing and Running NetBeans NetBeans Projects Refactoring Applications Building and Running Java Applications Setting up a Project Creating and Editing Java Source Code Compiling, Running and Debugging a Project Testing with JUnit Building and Running Web Applications 61

Java Applications» Compiling, Running and Debugging a project In this module, you will learn how to Build a Java project Run a Java project Debug a Java project 62

Java Applications» Compiling, Running and Debugging a Project» Building a Project Choose Build» Build Main Project (F11) from the main menu to build (compile) a project. Choose Build» Clean and Build Main Project (Shift+F11) from the main menu to clean and build a project Alternatively, right-click on the project node in the project window and click Build Project or Clean and Build Project from the contextual menu. The Output window displays the build results. 63

Java Applications» Compiling, Running and Debugging a Project» Running a Project Choose Run» Run Main Project (F6) from the main menu to run a project. Alternatively, right-click on the project node in the Project window and click Run Project from the contextual menu. The Output window displays the project output. 64

Java Applications» Compiling, Running and Debugging a project» Debugging a project To set a breakpoint, place the caret in any of the methods in the Java file and press Ctrl+F8. The selected line will be highlighted indicating that the breakpoint has been set. Choose Run» Debug Main Project (F5) from the main menu to debug the project. The IDE runs the project in the debugger until the breakpoint is reached. The IDE open the Debugger windows at the bottom of the IDE. 65

Java Applications» Compiling, Running and Debugging a Project» Debugging a Project To step over a line of code, choose Run» Step Over (F8) from the main menu. To step into a method, choose Run» Step Into (F7) from the main menu. To step out of a method, choose Run» Step Out (Ctrl + F7) from the main menu. To terminate a debugging session, choose Run» Finish Debugger Session (Shift+F5). 66

Java Applications» Compiling, Running and Debugging a Project» Debugging a Project» Debugger Windows The Local Variables, Watches, and Call Stack windows open by default with every debugging session. You can open any debugger window by choosing Window» Debugging» window-name (for example, Window» Debugging» Breakpoints). 67

Java Applications» Compiling, Running and Debugging a Project» Debugging a Project» Local Variables Window The Local Variables window lists the local variables in the current call. The information given for each variable includes the variable name, type, and value. You can click the control to the left of the name to expand or collapse the variable. Call Stack Window The Call Stack window lists the sequence of calls made during execution of the current thread. The information given for each call includes the name of the method, followed by the filename and line number of the call's currently executing statement. Debugger Windows 68

Java Applications» Compiling, Running and Debugging a Project» Debugging a Project» Watches Window The Watches window lists all variables and expressions that you have specified to watch while debugging. The information given for each watch includes the variable or expression name, type, and value. When you add a new variable or expression to the Watches window, the value of the variable or expression is immediately evaluated and displayed. The value of a watch is based on the current context. As you move through your program code, the Watches window is updated to show the value of the watch for that context. Creating a Watch: Select the variable or expression in the Source Editor, right-click, and choose New Watch (Ctrl+Shift+F7). Debugger Windows The New Watch dialog box opens with the variable or expression entered in the text field. Click OK. The Watches window opens with the new watch selected. 69

Java Applications» Compiling, Running and Debugging a Project» Debugging a Project» Classes Window The Classes window displays the hierarchy of all classes that have been loaded into the virtual machine hosting the program that is being debugged. You can click the turner control (+) to the left of the class name to expand or collapse the class. You can inspect the fields, constructors, and methods in your program as well as inspect the value of static variables. Breakpoints Window The Breakpoints window lists the breakpoints set in the current project. By default, each entry contains a short text description of the breakpoint and a boolean flag indicating whether the breakpoint is enabled or disabled. Debugger Windows 70

Java Applications» Compiling, Running and Debugging a Project» Debugging a Project» Session Window The Sessions window lists the debugging sessions currently running in the IDE. The information given for each session includes the session name and state. One session is always considered the current session, unless no sessions are running. By default, the current session is the session that you most recently started. Threads Window The Threads window lists all threads in the current debugging session. For Java applications, this list also includes the thread groups in the Java virtual machine. The information given for each thread is the thread name and state. Debugger Windows 71

Exercise 3 In the project EgApp, based on the class NewClass that was created in Exercise 2, instantiate an object of type NewClass in the main() routine of the MainClass. Call the printfield routine of the NewClass object. (Use the code-completion feature of the IDE.) Build (compile) the project EgApp. Run the project EgApp. What do you see in the output window? 72