Model Creation and Testing using Eclipse plug-ins - PowerPoint PPT Presentation

1 / 44
About This Presentation
Title:

Model Creation and Testing using Eclipse plug-ins

Description:

Model Creation and Testing using Eclipse plug-ins – PowerPoint PPT presentation

Number of Views:106
Avg rating:3.0/5.0
Slides: 45
Provided by: umk82
Category:

less

Transcript and Presenter's Notes

Title: Model Creation and Testing using Eclipse plug-ins


1
Model Creation and Testing using Eclipse plug-ins
2
Prerequisite for this tutorial.
3
Plug-ins that you need.
  • Eclipse UML2 version 2.1.0 (md5)
  • Eclipse EMF version 2.3.0
  • Omondos EclipseUML version 3.2.0 Studio

4
For that you need
  • Eclipse Version 3.3.0
  • Build id I20070222-0951

5
The general rule
  • You need to create a folder in your Eclipse dir.
    and then unzip the downloaded zip file
  • Look for feature and plugin folder in your
    created folder after every download of a plug-in.
  • Copy and paste all the folders and files to the
    corresponding feature and plugin folder of the
    Eclipse folder.
  • Special note A safe measure is to copy and
    paste all the .jar files of the plugins folder
    (in your created folder) separately into the
    plugins folder of Eclipse

6
These folders should be in your eclipse
directory.
7
The basic jar files required.
8
For Omondo UML
9
How to check your plug-ins
10
UML Modeling with Eclipse UML2
11
Open Eclipse in Resource perspective
  • Select the Window gt Open Perspective gt Other
    menu item.
  • 2) Select the Resource perspective and press the
    OK button.
  • 3) Select the File gt New gt Project... menu item.
  • 4) Select the Project wizard from the General
    category and press the Next gt button.
  • 5) Enter a project name and press the Finish
    button.

12
UML with Eclipse The Starting Point
13
Creating a model
  • Select a project (i.e. Getting Started with UML2)
    in the Navigator view and select the File gt New gt
    Other... menu item.
  • 2) Select the UML Model wizard from the Example
    EMF Model Creation Wizards category and press the
    Next gt button.
  • 3) Enter a file name (i.e. ExtendedPO2.uml) and
    press the Next gt button.
  • 4) Select Model for the model object and press
    the Finish button.
  • 5) Select the Window gt Show View gt Properties
    menu item.
  • 6) Select the ltModelgt element in the UML editor.
  • 7) Enter a value (i.e. epo2) for the Name
    property in the Properties view.

14
Creating a model
15
How to generate primitive types
  • 1) Select a package (i.e. ltModelgt epo2) in the
    UML editor.
  • 2) Right-click and select the New Child gt
    Packaged Element Primitive Type option from the
    context menu.
  • 3) Enter a value (i.e. int) for the Name
    property in the Properties view.

16
How to generate Classes
  • Select a package (ex. ltModelgt epo2) in the UML
    editor.
  • Right-click and select the New Child gt Packaged
    Element Class option from the context menu.
  • Enter a value (i.e. Supplier) for the Name
    property in the Properties view

17
How to generate Classes Types
18
How to generate generalizations
  • Select a classifier (i.e. ltClassgt USAddress) in
    the UML editor.
  • Right-click and select the New Child gt
    Generalization option from the context menu.
  • Select a value (i.e. epo2Address) for the
    General property in the Properties view.

19
How to generate generalizations
20
How to generate properties
  • Select a classifier (i.e. ltClassgt Supplier) in
    the UML editor.
  • Right-click and select the New Child gt Property
    option from the context menu.
  • Enter a value (i.e. "name) for the Name property
    in the Properties view.
  • Select a value (i.e. epo2String) for the Type
    property in the Properties view.
  • Enter a value (i.e. 0) for the Lower property in
    the Properties view.

21
How to generate properties
22
How to generate association -I
  • Select a package (i.e. ltModelgt epo2) in the UML
    editor.
  • Right-click and select the New Child gt Packaged
    Element Association option from the context menu.
  • Enter a value (e.g. A_supplier_orders) for the
    Name property in the Properties view.
  • Select the association (i.e. ltAssociationgt
    A_supplier_orders) in the UML editor.
  • Right-click and select the New Child gt Property
    option from the context menu.
  • Select a value (i.e. epo2Supplier) for the Type
    property in the Properties view.
  • Select a class (i.e. ltClassgt Supplier) in the UML
    editor.

23
How to generate association -II
  • Right-click and select the New Child gt Property
    option from the context menu.
  • Select a value (i.e. Composite) for the
    Aggregation property in the Properties view.
  • Select a value (i.e. epo2A_supplier_orders) for
    the Association property in the Properties view.
  • Enter a value (i.e. "orders") for the Name
    property in the Properties view.
  • Select a value (i.e. epo2PurchaseOrder) for the
    Type property in the Properties view.
  • Enter a value (i.e. 0) for the Lower property in
    the Properties view.
  • Enter a value (i.e. ) for the Upper property in
    the Properties view.

24
How to generate association
25
EMF Vs Omondo
  • The Eclipse Modeling Project (EMF is a product of
    that) focus is to provide a unified set of
    model-based development technologies.
  • Omondo's focus is to provide UML/MDA model
    development tools.

26
Working with EMF models
27
Creating an EMF project
28
Creating ECore model -I
29
Creating ECore model -II
30
Creating ECore model -III
31
Creating ECore model -IV
32
Creating an EMF Class
33
Creating EMF enumerations
34
Setting Enumeration types
35
Creating EMF attributes
36
Setting OCL type
37
Setting OCL constraint
38
Working with Eclipse JUnit(No plug-in required
?)
39
JUnit Elements
  • Test Case Class Named classnameTest.java,
    where classname is the name of the class that is
    being tested.
  • Test Case Method Named testmethodname, where
    methodname is the name of the method that is
    tested.
  • Test Suite Default name for Eclipse is
    AllTests.java

40
Creating test class
  • Select File gt New gt JUnit Test Case
  • OR
  • Select the arrow of the button in the upper left
    of the toolbar. Select JUnit Test Case
  • OR
  • Right click on a package in the Package Explorer
    view in the Java Perspective, and select
    JUnitTestCase
  • OR
  • Click on the arrow of the icon in the toolbar.
    Select JUnit Test Case .
  • OR
  • You can create a normal Java class but include
    junit.framework.TestCase as the super class of
    the test class you are creating.

41
Points to be noted.
  • Check to make sure that you are creating the
    TestCase in the proper package. Give the test
    case a name.
  • Use the Browse button to search for a different
    super class. The default super class
    junit.framework.TestCase.
  • Check which method stubs you would like to
    create. You can create a main method, setUp(),
    tearDown(), or a constructor(), but all of these
    are optional.
  • A constructor is only run when the test case
    class is first instantiated, but the setUp() and
    tearDown() methods are run before and after,
    respectively, each test case is run.

42
Running your test case/suite
  • You can right click on the test case class or
    test suite class and select Run As gt JUnit Test.
  • OR
  • You can select a test case or suite and click the
    arrow on the icon or select Run from the
    toolbar, and select Run As gt JUnit Test.
  • OR
  • You can select a test case or suite and click the
    arrow on the icon or select Run from the
    toolbar, and select Run... From here you will
    create a new JUnit test configuration, and name
    it. You can choose to run a single test case, or
    run all test cases in a project or folder.

43
Downloads
  • 1. Eclipse Download http//www.eclipse.org/downlo
    ads/download.php?file/eclipse/downloads/drops/S-3
    .3M5eh-200702220951/
  • UML Download
  • (a) http//www.omondo.com/download/index.html
  • (b)http//www.eclipse.org/modeling/mdt/downloads/
    ?projectuml2uml2
  • 2. EMF Download
  • http//www.eclipse.org/downloads/download.php?fi
    le/modeling/emf/emf/downloads/drops/2.3.0/S200706
    200000/emf-sdo-xsd-SDK-2.3.0RC4.zip

44
References
  • http//www.telecom-lille1.eu/people/Vanwormhoudt/s
    iteEMFOCL/tutoriel/TutorialEMFOCL1.htm
  • http//www.eclipse.org/modeling/mdt/uml2/docs/arti
    cles/Getting_Started_with_UML2/article.html
  • http//open.ncsu.edu/se/tutorials/junit/

45
Thank you!
Write a Comment
User Comments (0)
About PowerShow.com