Weitere ähnliche Inhalte
Ähnlich wie Lab3 RTC Source Control (20)
Mehr von IBM Rational software (16)
Kürzlich hochgeladen (20)
Lab3 RTC Source Control
- 2. Student Exercises
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
© Copyright IBM Corp. 2008, 2013 Exercise 3. Jazz Source Control 3-1
V9.0
EXempty
Exercise 3. Jazz Source Control
What this exercise is about
The purpose of this exercise is to master the primary source-control
capabilities of IBM® Rational Team Concert™: use source control, create
workspaces, manage change sets, make and deliver software changes,
resolve file conflicts, and manipulate your workspaces and streams.
What you should be able to do
At the end of this exercise, you should be able to:
• Create a repository workspace and begin working on a team.
• Associate your work with the appropriate work items.
• Review and manage change sets.
• Detect and resolve file conflicts.
• Change the configuration of your workspaces.
- 3. Student Exercises
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
3-2 Developing Software with IBM Rational Team Concert, V4.0.4 © Copyright IBM Corp. 2008, 2013
3.1. Create a repository workspace for the JKE Banking project
Scenario
In the previous exercises, you joined the JKE Banking project team and reviewed a work
item that was assigned to you. In this exercise, you update a repository workspace to a
baseline in which you can change source code to implement your assigned work item for
the JKE Banking project.
__ 1. Start the Rational Team Concert Eclipse client from the desktop shortcut, Quick Launch
toolbar, or Start menu.
Help. To start from the Start menu, click Start > All Programs > IBM Rational Team
Concert > IBM Rational Team Concert.
__ 2. In the Workspace Launcher window, select C:workspacesdeb; then click OK.
__ 3. Switch to the Work Items perspective, if necessary, and load a repository workspace with
code from a known-stable baseline:
• In the Team Artifacts view, expand My Repository Workspaces > Deb BRM Stream
Workspace.
• Right-click Java UI, and then click Replace With > Baseline.
• Select 2: Week 1 (Sprint 1, Release 1.0) from the list; then click Finish.
Help. In this case, this will be the same baseline that is currently being used.
__ 4. Right-click Deb BRM Stream Workspace, and then click Show > Repository Files. A new
Repository Files view opens in the workbench. Explore the file structure of the Java UI
project folder in the workspace.
__ 5. Right-click Deb BRM Stream Workspace, and then click New > Flow Diagram. A Flow
Diagram editor opens. In this window, you can see the flow of changes between workspaces
and streams in the project. Experiment with how you can tailor this flow diagram by
displaying only what is important to you and showing or hiding various streams and
workspaces.
Note which users have workspaces that deliver to the Conversion Team stream.
__ 6. 6. Close the flow diagram.
Help. Do not save the flow diagram.
- 4. Student Exercises
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
© Copyright IBM Corp. 2008, 2013 Exercise 3. Jazz Source Control 3-3
V9.0
EXempty 3.2. Complete and test your work
Scenario
In this exercise, you change Java™ source code in files that are in the Jazz™ source
control repository to resolve one of your assigned work items.Click File > Save to save the
JKEBanking.java file.
__ 1. In the My Work view, examine the Current Work section.
Help. The Current Work section identifies unresolved work items that are assigned to you
for the current project iteration.
__ 2. Double-click the work item called Add a Change Password function to open it in the Work
Item editor. Review the details of the work item.
__ 3. Near the top of the Work Item editor, click the arrow that is next to the work-item state
indicator, and from the list, click Start Working. Click Save.
The work item state changes to In Progress. Click the arrow that is next to the task ID, and
then click Set as Current Work Item.
This task becomes your active work item, as indicated by the task ID and summary that are
displayed in the lower status bar of the workbench.
__ 4. Switch to the Java perspective by clicking Window > Open Perspective > Java.
Help. After you identify a task to work on, switch to the Java perspective to make the
required code changes.
__ 5. In the Package Explorer view, expand the JKEJavaUI folders until you find the Java source
files: Click JKEJavaUI > src > com.jke.ui.
Help. Observe the yellow repository indicators on the folder and file icons. The indicators
signify that the resources are stored in a source control repository.
__ 6. Double-click the JKEBanking.java file. The JKEBanking.java file opens in an editor.
__ 7. In the JKEBanking.java file, find this line: private Shell fShell;
Help. To find the line, you can scroll and search, click Edit > Find/Replace, or click the
method in the Outline pane of the editor.
- 5. Student Exercises
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
3-4 Developing Software with IBM Rational Team Concert, V4.0.4 © Copyright IBM Corp. 2008, 2013
__ 8. After the private Shell fShell; line, add this line: private MenuItem
fChangePasswordItem;
Help. If the work item is not open in a Work Item editor, you can open it by double-clicking
the task ID and the title of the work item that is displayed near the bottom of the Eclipse
client.
__ 9. In the JKEBanking.java file, find this line:
jkeMenuItem.setMenu(jkeMenu);
__ 10. After the jkeMenuItem.setMenu(jkeMenu); line, add this code:
fChangePasswordItem= new MenuItem(jkeMenu, SWT.NONE);
fChangePasswordItem.setText("&Change Password");
fChangePasswordItem.setEnabled(false);
__ 11. Click File > Save to save the JKEBanking.java file.
__ 12. In the Package Explorer view, right-click the JKEJavaUI folder, and then click Team >
Show Pending Changes. The Pending Changes view opens.
__ 13. Expand the folders in the Pending Changes view by clicking Deb BRM Stream Workspace
> Java UI > Unresolved. Expand the subfolders of the Unresolved folder to see the Java
source file that you changed.
Help. These changes are currently local to your Eclipse workspace, or sandbox, and have
not been saved in a Jazz source control repository workspace or stream. You might also see
an Incoming folder in the Pending Changes view. This folder is discussed later.
__ 14. Right-click the Unresolved folder in the Pending Changes view below the Deb BRM Stream
workspace, and then click Check-in All.
Help. This action checks in your changes to your personal repository workspace. Observe
that after the check-in is complete, the changes are no longer unresolved in the Pending
Changes view but are now part of an Outgoing change set that is associated with the
current work item.
__ 15. In the Package Explorer view, select the JKEJavaUI folder. Click Run > Run As > Java
Application. The user interface of the JKE Banking application window opens. Check the
menu for your change.
Help. Select the win-64 java application to start.
__ 16. Close the JKE Banking application window.
- 6. Student Exercises
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
© Copyright IBM Corp. 2008, 2013 Exercise 3. Jazz Source Control 3-5
V9.0
EXempty 3.3. Resolve conflicts and deliver your work
Scenario
You completed the changes to resolve the work item that was assigned to you for the JKE
Banking project. You will now resolve the work item and share your work with the rest of the
team. However, you are not the only developer who works on this project. You might need to
resolve conflicts if other developers modified the same file.
Although integration and merge activities are a normal part of parallel development, the lab
exercises provide unusual circumstances in which you merge changes with yourself.
Typically, you merge files that someone else on your team has changed.
__ 1. In the Pending Changes view, expand the Outgoing folder and subfolders for the Deb BRM
Stream Workspace.
Help. Verify that the Java source file that you modified is part of the Outgoing change set
that belongs to the Add a Change Password function work item.
__ 2. Mark the work item as resolved:
• Open the work item called “Add a Change Password function” in the Work Item editor.
• From the work item state list, select Complete; then click Save.
• In the Confirm Deliver window, click No. You do not want to deliver these change sets
now.
Tip: Double-click the current work item that is displayed at the bottom of the workbench.
__ 3. Deliver your change set from your repository workspace to the team stream: a. In the
Pending Changes view, right-click the Outgoing folder, and then click Deliver. b. Review
the suggestion in the error window, and then click OK to close the window.
Help. An error window notifies you that the delivery failed. Why did the delivery fail?
Before you continue, you might wonder what the incoming changes are that are waiting for
your acceptance in the Pending Changes view of your repository workspace.
Recall that when you created your repository workspace, you replaced the default
configuration with the latest baseline from the stream, Sprint 1 (Release 1.0). To refresh
your memory, review step 3 in Exercise 3.1. You can examine the changes that were
delivered to the stream after this baseline was applied:
• In the Deb BRM Stream Workspace, right-click JavaUI Component, and click Compare
with > Current Baseline.
- 7. Student Exercises
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
3-6 Developing Software with IBM Rational Team Concert, V4.0.4 © Copyright IBM Corp. 2008, 2013
• In the Change Explorer view, expand the JavaUI Component.
• Right-click one of the change sets, and then click Related Artifacts > Open. Review the
work item. What work does this work item request?
• Expand JavaUI Component and the change sets to find the file-level changes.
• Challenge: Compare the current version of the JKEBanking.java file in the stream
with the version that was used in the latest baseline.
__ 4. As suggested in the delivery error window, try to accept the incoming change sets:
• In the Pending Changes view, right-click the Incoming folder, and then click Accept.
• When you are prompted, click Auto-Resolve. Rational Team Concert tries to
automatically merge the conflicting files.
• Click OK to close the Auto Resolve window.
Help. A conflict arises because of the changes to the login screen that you made earlier.
You are notified that the conflicts could not be resolved automatically. You must merge the
changed files manually.
__ 5. In the Pending Changes view, observe that the incoming changes were moved to an
Outgoing folder.
• Right-click Add a Change Password function work item, and then click Set as
Current Work item. When you are prompted to reopen the work item, click Yes.
• Deliver your outgoing change set to the BRM stream by right-clicking the Outgoing
folder and then clicking Deliver. No outgoing changes remain to be delivered.
- 8. Student Exercises
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
© Copyright IBM Corp. 2008, 2013 Exercise 3. Jazz Source Control 3-7
V9.0
EXempty 3.4. Create and propagate baselines
Scenario
The development team completed its work. All changes are merged and delivered to the
BRM stream. The team lead creates a baseline that represents the sum of the changes and
delivers it to the stream.
__ 1. As the team lead, complete these steps to create a BRM baseline:
• In the Pending Changes view, expand all of the folders under Deb BRM Stream
Workspace. Refresh the view to ensure that no incoming, outgoing, or unresolved
change sets exist.
• If any incoming change sets exist, accept them, and resolve any conflicts.
• Right-click Java UI Component, and then click New > Baseline.
• Name the baseline Sprint 2 (Release 2.0).
• Click OK. The Pending Changes view now includes an outgoing change set that
contains the new baseline.
• Deliver the outgoing change set.
• In the Team Artifacts view, expand JKE Banking > Source Control > BRM Stream.
Help. After you complete this step, observe the baseline on the Java UI Component
element in the BRM stream. The baseline should be called Sprint 2 (Release 2.0).
__ 2. In the Pending Changes view, right-click Java UI Component, and then click Show >
History. In the component history, note the work items that you completed.
End of exercise