Escolar Documentos
Profissional Documentos
Cultura Documentos
Copy eGovFrame-2.5_EN.zip from USB to C:\ Copy other 2 directories from USB to Desktop (or any directory)
Page l
Table of contents
1. Overview
2. Development Tool
3. Deploy(Maven) 4. CI(Configuration Integration) Server
Page l
Development Environment
Overview
Development Environment provides a set of tools on implementation(coding, debugging), test, deployment and configuration which are needed to develop an application based on the eGovFrame Runtime Environment
Implementation Tools
Test Tools
Distribution Tools
Page l
Development Environment
4 service groups, 13 services compose the development environment. Support various tools that are required for a programming based on eGovFrame
Overview
Development Tool
Implementation Tool Debug Code Generation Test Tool Test Reporting Deployment Tool Build Conf. & Change Mgt. Tool Configuration Mgt. Change Management
Editor
Methodology & Template
Code Inspection
Batch
Unit Test
Batch Test
Deployment
Page l
Development Environment
4 service groups, 13 services compose the development environment. Various open sources are also provided for a programming based on eGovFrame development environment
Overview
Development Tool
Implementation Tool Debug Code Generation Test Tool Test Reporting Deployment Tool Build Conf. & Change Mgt. Tool Configuration Mgt. Change Management
Editor
Methodology & Template
Code Inspection
Batch
Unit Test
Batch Test
Deployment
Page l
Overview
Developer PC
Development Server
Coding
Code editing Testing Debugging Inspection
Build
Compile Packaging
Success?
Yes Commit
Configuration management
Checkout
Build
Compile Packaging
No
Operation Server
WAS restart
Deploy
Development Tool
1. Overview 2. eGovFrame IDE 11. Batch Configuration 12. eGovFrame Template Project
3. UML
4. ERD 5. DBIO 6. Code Generation 7. eGovFrame Java Project 8. Common Component 9. Batch Job 10. Batch Job Launcher
13.Code Inspection
14. Server Connection Management 15. Test
Page l
Development Tool
Development tool consist of UML, ERD, DBIO Editor, eGovFrame Template project and so on
New Batch Job Launcher New Batch Job New Batch Template Project
Customize Development Tool Common Component Eclipse platform (JEE package)
Template Project DBIO Editor WebFlow Editor Source Code Editor ERD Editor UML Editor
Overview
Page l
eGovFrame IDE
Development Tool
Development tool provides integrated menu, perspective, view and editor characterized for eGovFrame for developers' convenience
eGovFrame Integrated Menu for quick access
eGovFrame Perspective
Page l
10
Development Tool
Integrated menu, eGovFrame, only activated in eGovFrame perspective provides quick access to eGovFrame related plug-ins
Start - New Batch Template Project : Generate eGovFrame Batch Project - New Core Project : Generate eGovFrame Core Project - New Web Project : Generate eGovFrame Web Project - New Template Project : Generate eGovFrame Template Project - New DeviceAPI Template Project : Generate eGovFrame Mobile DeviceAPI Project - New Mobile Project : Generate eGovFrame Mobile Web Project - New Mobile Template Project : Generate eGovFrame Mobile Template Project Analysis - New Usecase Diagram : Generates Usecase Diagram Design - New ER Diagram : Generates ER Diagram - New Class Diagram : Generates Class Diagram
Page l
11
Development Tool
Integrated menu, eGovFrame, only activated in eGovFrame perspective provides quick access to eGovFrame related plug-ins
Implementation - New Batch Job : Create Batch Job - New Batch Job Launcher : Create Batch Job Launcher - XMI Based CodeGen : Generate source code from model (UML XMI) - Add eGovFrame Common Component : Install Common Component - New SQL Map Config : Create SQL Map Config file - New SQL Map : Create SQL Map file - Show DBIO Search View - Add DeviceAPI Template : Generate Mobile DeviceAPI Template - Add Mobile Common Component : Install Common Component for Mobile - Mobile Web Verification : Check Mobile Web Standard Verification Test - Batch Job Test : Test batch by JUnit Configuration - Customize Development Tool : Selectively install the required functionality - Server Connection Management Show SVN Repositories View Nexus : Manage Nexus repository information
12
Page l
UML
Development Tool
AmaterasUML as an open source of UML editor supports to make UseCase Diagram and Class Diagram
UseCase Diagram Class Diagram Limitations Support diagrams based on UML 1.4 Not support UML 2.0
UseCase Diagram
Class Diagram
Page l
13
ERD
Development Tool
AmaterasERD as an open source of ERD editor supports Logical and Physical model
Page l
14
DBIO
DBIO Editor for programming DBIO by iBatis SQL Map API is provided
SQL Map Config Editor - Supports editing SQL Map Config File
Development Tool
In/Out Section
* Basically, SQL Map File and SQL Map Config File are required to iBatis SQL Map API
Page l
15
Code Generator
Development Tool
Generate source code based on pre-defined templates or models defined in Class Diagram
Page l
16
Development Tool
Project appropriate to developing web application based on eGovFrame is generated 2 ways to access the wizard
Page l
17
Development Tool
Page l
18
Select DB
Run Connection Test. Create Table button will be activated if succeeded. Create tables by click Create Table Check if tables are created normally : 4 Status are
Create tables
Page l
19
Development Tool
Select or Change OS Type Limited to Windows or Linux Main Page Input initial page address to be shown right after running the application IP for G4C Check IP for G4C Select or change Database
What you have done here can be checked in the file globals.properties
Page l
20
Batch Job
Development Tool
Batch Job wizard to generate batch job file by configuring job and step, flow control and partitioning
Process for creating Batch Job Select Batch Job info Select Batch Step info
Page l
21
Development Tool
Generate batch job execution info include Job Launcher, Job Operator and DB info
Page l
22
Batch Configuration
Development Tool
Preference for batch is provided to create or select Job Parameter, Job Reader/Writer and Listener intuitionally
Create Reader/Writer
Job Parameter
- Add input data for batch execution - Add output data for batch execution
Listener - Add Listeners to catch events at pre or post of Job, Step or Chunk
Page l
23
Development Tool
Management
Enterprise Business - Main Page, Authorization Management, Menu Management, etc.
Page l
24
Development Tool
eGovFrame Batch Template Project provides 6 kinds of batch templates by types of input resource and executing batch
Page l
25
Code Inspection
Development Tool
PMD as an open source of source code analyzer finds unused variables, empty catch blocks, unnecessary object creation, and so forth
* After checking code with PMD, the result will be shown in PMD Perspective
Page l
26
Implementation Tool
SVN Repositories View and Nexus Repository Management can be directly reached by eGovFrame Menu
SVN Repositories View
Nexus Repository
27
Test Overview
Development Tool
Test tool supports writing TestCase by Unit Test, Mock and DB Test Framework, Test Automation, Test Coverage and Test Reporting
Test Tool Writing TestCase Write Test Class OOServiceTest Target Module OOService Unit Test Framework Analyze Test Coverage Run Running Test
Implementation Tool
MockDao
<<Dataset>>
Mock Framework
Automation DB Test Framework Test Automation Reporting Test Reporting Test Report
OODao
DaoTest
DB
DB
Page l
28
Test Process
Development Tool
write TestCases
run TestCases
Page l
29
Development Tool
As a Unit Test Framework for Java Programming, JUnit supports writing Unit Test code and running Automated Test 1: public class UserAdminTest {
component Test Class using test framework(e.g. JUnit) Test fixture Setup of test data Test method (e.g. testOOO)
2: 3: /* Class under test */ 4: private UserAdmin userAdmin; 5: 6: /* A simple test user */ 7: private User user; // Test Data (Fixture) 8: /* An administrator role */ // 9: private Role adminRole; // 10: 11: /** 12: * Initializes the test fixture. 13: */ 14: @Before 15: public void setUp() throws Exception { 16: userAdmin = new UserAdmin(); 17: user = new User("John", "Doe"); // Test Data Setup 18: adminRole = new Role("Administrator"); // 19: } 20: 21: /** 22: * Test for method with ... 23: */ 24: @Test 25: public void testAddUser() { 26: user.setAge(18); // Extra Test Setup 27: userAdmin.addUser("jdoe", user, adminRole); // Use 28: Test Data 29: 30: User result = userAdmin.getUser("jdoe"); 31: assertEquals("John", result.getFirstName()); 32: assertEquals("Doe", result.getLastName()); 33: } 34: }
Page l
Internal method
30
Development Tool
As a Unit Test Framework for Java Programming, JUnit supports writing Unit Test code and running Automated Test
Page l
31
Deploy - Maven
1. Architecture 2. Directory Structure
3. POM.XML
4. Build Lifecycle 5. Plug-in 6. Repository 7. Nexus
Page l
32
Architecture
Deploy
Maven was originally started as an attempt to simplify the build process and provides a standard way to build projects. It includes a clear definition of what the project consisted of(POM), dependency management(library control), project life cycle management, etc Maven Architecture
POM.XML
Source files
Reporting Resources
Compile
Packaged libraries
Page l
33
Directory Structure
Providing a standard directory structure
Maven Standard Directory Structure
Deploy
Directory/File
Description
The core of a project's configuration in Maven. It is a single configuration file that contains the majority of information required to build a project. (Ex: dependency)
/pom.xml
/src/main/java
/src/main/resourc Resources for deploying, namely XML, properties, etc. Copied to target/classes es /src/main/webapp INF/web.xml, webapp/index.jsp, css, etc) /src/test/java
Test case Java sources. Compiled to target/test-classes Web application related files (/WEB-
/target
34
POM.XML
Deploy
The POM contains all necessary information about a project, as well as configurations of plug-ins to be used during the build process. groupId:artifactId:version are all required fields and act much like an address and timestamp in a repository, acting like a coordinate system for Maven projects
POM.XML
Project Information Name URL Artifact Description
<project xmlns=http://maven.apache.org/POM/4.0.0 ....> <groupId>egovframework.dev.com</groupId> <artifactId>egovframework-dev-com</artifactId> <version>1.0</version> <packaging>war</packaging> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.4</version> <scope>test</scope> </dependency> </dependencies> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> </configuration> </plugin> </plugins> </project>
Artifact Info.
Inception Year
Group Id
Version Dependencies Dependencies Build Settings
Artifact Id
Dependency Management
Repositories Repositories
Plug-in Setting
Properties
Build
Packaging
Reporting
Page l
35
Build Lifecycle
Deploy
Maven 2.0 is based around the central concept of a build lifecycle. What this means is that the process for building and distributing a particular artifact (project) is clearly defined
Build Lifecycle
Phase Validate Description validate the project is correct and all necessary information is available test the compiled source code using a suitable unit testing framework take the compiled code and package it in its distributable format, such as a JAR run any checks to verify the package is valid and meets quality criteria install the package into the local repository, for use as a dependency in other projects locally
surefire
jar
copies the final package to the remote repository for Deploy sharing with other developers and projects
deploy
Lifecycle Phases
install Plugins
Page l
36
Plug-in
m2eclipse plug-in to use Maven in eGovFrame IDE
Deploy
Maven install
Click Maven install to initiate build lifecycle phase. It packages and installs the project into the local repository
Page l
37
Repository
Deploy
Using libraries that declared in the pom.xml of the project as dependency and the libraries come from the repository. If it exits in local repository, use it, if not, download from the remote repository to local and use
Maven Repository Composition Diagram
Intranet Internet
Computer 1
Computer 1
Computer 3
Computer 3
Page l
38
Nexus
Deploy
Nexus manages software artifacts required for development, deployment, and provisioning. Also it simplifies the maintenance of internal repositories and access to external repositories
Page l
39
3. Hudson Build
4. Hudson Dashboard
Page l
40
Overview
CI Server
Continuous integration (CI) is the practice, in software engineering, of merging all developer workspaces with a shared mainline several times a day
Notice
Feedback Mechanism Build Failed Source Code Build Watch & Polling Version Control Server (SVN) CI Server Deploy Build Success Test Coverage Analysis Code Inspection Unit Tests
Development Server
Page l
41
Subversion
CI Server
Subversion is a version control system that keeps track of changes made to files and folders (directories), facilitating data recovery and providing a history of the changes that have been made over time
Features Change management for source as well as data Versioning is done for folders as well as for individual files File and folder properties are recorded over time, thereby creating a detailed history
Project Team
Developer
Deploy Tool
Deploy
PL
CMO
Backup
Repository
Page l
42
Hudson Build
CI Server
Hudson as an open source CI server provides automatic build with a script and offers a feedback mechanism about build results to developers
Main Screen : Display a list of projects, build status and build success or failure
Page l
43
Hudson Dashboard
Providing a dashboard function to show build, test results, etc
CI Server
Page l
44
Reference
Eclipse Home http://www.eclipse.org/ Apache Maven http://maven.apache.org/ Subversion Project Home Page http://subversion.tigris.org/ Continuous Integration (Martin Fowler) http://martinfowler.com/articles/continuousIntegration.html#AutomateDeployment Hudson Home https://hudson.dev.java.net/
Page l
45
Page l
46 46