Cross Column

Showing posts with label Oracle ADF. Show all posts
Showing posts with label Oracle ADF. Show all posts

Saturday, November 2, 2013

How to Create Load Testing Scripts Using OpenScript

This article is one of the Oracle Application Test Suite (OATS)[1] series published on Xml and More, which includes the following:

In this article, we will show:
  • How to create load testing scripts using OpenScript[2]

Introduction to OpenScript


Application Testing Suite (OATS) is comprised of several tightly integrated products.[1] The script designer —OpenScript—only runs on Windows, but all the runtime components are available for both Linux and Windows. OpenScript is a scripting platform for creating automated test scripts in Java.

You can use OpenScript to create scripts for different testings. For example, OATS supports
  • Functional Testing
  • Load Testing
In this article, we will show you how to create load testing scripts in OpenScript.

The Platform


Scripting platform is based upon the Eclipse open source development environment. Initial OpenScript product provides access to a limited set of the Eclipse development environment.

The workbench is the base layer of software and code that provide the foundation on which the OpenScript Modules and Application Programming Interfaces (APIs) operate. Each Workbench window contains one or more perspectives. OpenScript Workbench provides the following perspectives:
  • Tester perspective
  • Developer perspective
  • Reset perspective
Workspaces are created in Oracle OpenScript. Workspaces store project-related script files and Results Log files. You can use them to organize your various testing projects. Three levels of management are provided:
  • Scripts (lowest)
  • Folders
  • Repositories (highest)
You can download OATS from [3]. The version used in this demonstration is
Version: 12.3.0.1 Build 376

Cheat Sheet


Like every recording task, you need to rehearse and make sure all glitches are resolved before the final recording. If you have decided the click path, prepare a cheat sheet like below:

[1] Bring_up_FUSE_URL
[2] Login_SALESREPUSER00001_Welcome1
[3] Click_the_Opportunities_Card
[4] Select_Quarter_2_2013
[5] Drilldown_on_Pinnacle_Server
[6] Click_on_Sales_Account_Picker
[7] Search_for_CUSTOMER_101328336
[8] Click_Cancel
[9] Click_Add_Revenue_Item
[10] Select_Type_Item
[11] Click_Product_LOV_and_Search
[12] Search_for_Elite_Pro_DG_452
[13] Select_Product_and_click_Ok
[14] Click_Cancel
[15] Logout

The numbering of step is for human readers and can help the recording. Each row on the list corresponds to a click in your click path and will become the title of step group in OpenScript recording.

OpenScript Preferences


Before recording, there are some preferences you want to set. To set them, you click on View and then OpenScript Preferences. For example, we would like to control the grouping, naming and numbering of step groups by ourselves (see "Cheat Sheet"). So, set your "ADF Load" preferences as below:


Creating a New Project


In this demonstration, we will create an open script for load testing (File > New...). Our web application is CRM FUSE. So, we have selected "Oracle Fusion/ADF" wizard from the New Project (see above).
  • Oracle Fusion/ADF
    • This option lets you create a new script for load testing of Oracle Application Development Framework (ADF)-based applications and other applications that utilize HTTP and ADF protocols at the protocol level.

At the next step, you are asked to provide a Script Name. So, we set them as follows:
  • Create script as a Function Library (unchecked)
  • Script Name: FUSE_Saleopty_oct07_wrk
Finally click Finish to create a new script. The resulting script will contain the Initialize, Run, and Finish nodes. The Run node will contain recorded HTTP protocol navigations based upon the defined Step Group preferences and the navigations and ADF protocol for actions performed during recording. You can edit the script tree or Java code to customize the script.[4]

In the following sections, we will demonstrate how to create:
  • First step group
  • Remaining step groups

Creating First Step Group


Creating the first step group is a bit different from the rest. So, we describe it separately. Note that we have NOT clicked on the record button yet.

Before we click on the record button (i.e., red circle), create the first message group as shown below:
Open your notepad and copy the first row into the title field as shown below. Then click OK.

Note that we have chosen "No delay" for the first step. But, for other steps, we will specify "Delay 44 secs."

Start Recording


Now click the record button. Your chosen browser (for our demonstration, it's Firefox) will be brought up. Copy your URL:
http://www.mycompany.com:9006/customer/faces/CrmFusionHome
into the address field and hit Enter. This finishes the recording of the first step group.

Next repeat the following subtasks for the remaining groups until it finishes:
  1. Creating a new step group in OpenScript
    • Right select previous Step Group to bring up context menu and select New > Step Group
  2. Copying the next row of click path from Notepad
  3. Clicking next step in your Browser


Finally, don't forget to stop the recorder.

Exporting Script


If your runtime environment is Linux, you need to export script created in OpenScript as follows:
File > Export Script...

For example, a new zip file was created in our default repository:
D:\OracleATS\OFT\FUSE_Saleopty_oct07_wrk.zip
You can then copy it to your Linux box:
scp FUSE_Saleopty_Server1_wrk.zip aime1@mylinuxserver:/scratch/aime1/work

References

  1. Oracle Application Testing Suite
  2. OpenScript for Load Testing Script Troubleshooting (Tutorial)
    • Version: 12.3.0.1 Build 376 was used in this article.
    • This version requires Firefox 10.0 ESR (Windows download).
  3. Oracle Application Testing Suite Downloads
  4. Oracle Application Testing Suite 12.x: Oracle Load Testing Overview
  5. OATS: Tie All Processes Together — from OpenScript to Scenario (Xml and More)

Friday, September 27, 2013

Book Review: Developing Web Applications with Oracle ADF Essentials

At the end of book, the author has claimed that:
If you have followed the exercises in this book, you are ready to build real-world ADF Essentials applications and can consider yourself an ADF Essentials journeyman.
I cannot agree more. If you are new to ADF (Oracle Application Development Framework) programming, you probably need to add this cookbook to your toolbox. Unfortunately, some hyperlinks embedded in the book are broken. At the end of this article, you can find the correct links to some of the important topics covered in the book.

Bottom-up Approach


ADF Essentials toolkit is used in this book to help you learn ADF programming. The recent released ADF Essentials gives developers a free version of the core components of the ADF framework which they can use to build an end-to-end ADF-based solution including advanced UI components, taskflows,[4] the binding layer and business components or EJBs.

In this book, the author uses a bottom-up approach which introduces you to the ADF programming. A full-blown DVD rental application (in Chap 6) was built, tested and deployed using the following technology stack:
  • The free MySQL database[5]
  • The free GlassFish application server[7]
    • Note that you also need Java Development Kit[6]
  • The free ADF Essentials toolkit[3]
  • The free JDeveloper development tool[9]
    • Oracle also supports ADF Essentials as part of their Oracle Enterprise Pack for Eclipse (OEPE) product.[8]
Although GlassFish was used in the exercises, this book also discusses features that are available only on WebLogic Server (WLS) and its associated management system—Oracle Enterprise Manager Grid Control. For example, ADF logger is the preferred logging component (vs. log4j and Logback) for ADF applications. And there are differences in the supported features for logging on GlassFish and WLS:
  • Logging configuration
    • ADF logging is controlled by the logging.xml file.
    • JDeveloper offers a nice interface for managing this file for the built-in WLS.
  • Log monitoring
    • WLS—logging can be read and analyzed using Oracle Enterprise Manager Grid Control.
    • GlassFish—logging can only be read directly from server.log file.

ADF Framework


All ADF applications consist of the following parts:


  • View layer
    • The View layer consists of the pages that are displayed to end users (JSF pages or JSF page fragments).
    • ADF Faces is based on JSF and built on top of Trinidad, an open source JSF framework.
  • Controller layer
    • The Controller layer consists of ADF Task Flows[4,17] that control the flow between the elements of the view layer
  • Model layer
    • ADF Model is a binding layer to bind the UI (ADF Faces based on JSF) without tight coupling UI components to the back end data model.
  • Business Service layer
    • The Business Service layer provides services to query and manipulate data.
    • There are many ways to build business services—in this book, it uses ADF Business Components, but you can also use, for example, JPA Entities and EJB 3.0 Session beansPOJOsweb services, and so on.
  • Database layer
    • The Database layer is where your data is stored persistently.

The Book


In this book, it shows you:
  • How to set up the entire infrastructure for building ADF applications
  • How to install the necessary interconnections and wired everything together
  • How to add Java code to your application to implement customized business logic
  • How to build and deploy ADF applications to application servers
  • How to debug ADF applications
  • How to build scalable structure using foundation workspaces and ADF libraries
  • How to secure ADF application (Apache Shiro[15] is used in this book)
Without doubt, you will be able to write real-world ADF applications after reading this book. But, before you roll up sleeves and jump to the programming, try to read the following guidelines first:
  • ADF Naming and Project Layout Guidelines[11]

References

  1. Developing Web Applications with Oracle ADF Essentials (reviewed book in this article)
  2. journeyman (wikipedia)
  3. ADF Essentials downloads
    • Version 11.1.2.4 was used in the book.
    • After navigating to this home page, then click on
    • Oracle ADF Essentials - FREEOracle ADF Task Flow in a Nutshell
  4. Oracle ADF Task Flow in a Nutshell (Xml and More)
  5. MySQL downloads
    • Free Community Server edition Version 5.6.12 was used in the book.
  6. JDK 7 downloads
    • In order to be able to install and run GlassFish, your system first needs to have JDK 7 installed. Jdk1.7.0_25 was installed and used in the book.
  7. GlassFish downloads
    • GlassFish Server Open Source Edition 3.1.2.2 (for Windows platform) was used in the book.
  8. Oracle Enterprise Pack for Eclipse 12c (12.1.2.1.1)
    • Oracle Application Development Framework - Oracle ADF
    • Oracle JDeveloper downloads
      • Studio Edition 11.1.2.4.0 was used in the book.
    • ADF Naming and Project Layut Guidelines v1.00 (16/Jan/2013)
    • Oracle ADF Essentials
    • ADF Naming and Project Layout Guidelines (By Chris Muir)
    • Adventures in ADF Logging - Part 1 (Duncan Mills)
    • Apache Shiro
    • Using Bind Variable to Implement Range Selection Declaratively (Xml and More)
    • Understanding Task Flow Transaction and Savepoint Support in Oracle ADF (Xml and More)

    Monday, October 22, 2012

    Oracle releases new ADF Mobile

    Oracle ADF Mobile enables developer to build applications that install and run on both iOS and Android devices from one source code.

    Development is done with JDeveloper and ADF and leverages Java and HTML5 technologies, while keeping the same visual and declarative approach ADF is known for.

    Redwood Shores, Calif. – October 22, 2012

    News Facts

    • Oracle today announced the general availability of Oracle Application Development Framework (ADF) Mobile, an extension of the Oracle Application Development Framework.
    • Part of Oracle Fusion Middleware, Oracle ADF Mobile is a HTML5 and Java-based framework that enables developers to easily build, deploy, and extend enterprise applications for mobile environments, including iOS and Android, from a single code base. Based on a next-generation hybrid mobile development architecture, Oracle ADF Mobile allows developers to increase productivity, while protecting investments, by enabling code reuse through a flexible, open standards-based architecture.
    • Oracle ADF Mobile based applications enable enterprises across industries to meet frequently changing mobile requirements by allowing developers to rapidly and visually develop applications once, and deploy to multiple devices and platforms. 

    See Also


    Monday, April 16, 2012

    Book Review: "Oracle JDeveloper 11gR2 Cookbook"

    Developing an enterprise application using SOA (i.e., Service Oriented Architecture) is a challenging  task.  With appropriate supporting technologies and tools, it can save you a lot of effort.

    The core technology covered in this book is Oracle ADF.  Oracle ADF is an end-to-end Java EE framework for building rich enterprise web and mobile applications based on Java EE services and SOA.  Oracle ADF implements the "plumbing" of your application and abstracts the complexities of Java EE development.   It also takes care of areas such as:
    • Object/Relational mapping
    • Caching
    • Persistence
    • User interface framework
    • Controller layer
    • Binding of business services to user interfaces. 
    Unlike other Java frameworks the development experience with Oracle ADF is visual and declarative through the JDeveloper IDE.  From the book, you can find plenty of such examples.

    What's Covered?

    First, the author has discussed issues that you need to address in the early design and architectural phases of the project:
    • Modularize your application
      • Break up the application in multiple workspaces
      • Divide data model into appropriate application modules
      • Avoid circular dependencies use tools such as Dependency Finder 
    • Make your application easy to extend
      • For example, allow the ability to extend the framework's base classes early on in the development process
    • Set up logging with the right logging framework
      • Choose ODL (Oracle Diagnostics Logging) for its tight integration with WebLogic and JDeveloper
    • Use page template to ensure that pages throughout the application are consistent, and provide a familiar look and feel to the end user
    • Customize the exception error message for your application
    • Use a generic backing bean actions framework to encapsulate common functionality for common JSF page actions
    After laying out the foundation, the author then expand the scope of discussion vertically and horizontally. 

    Vertically, the book covers different layers of the ADF's MVC architecture and various components in each layer.  Horizontally, it discusses different supporting frameworks or technologies which are used to help you create a successful end-to-end enterprise application:
    • IDE: JDeveloper
    • Integration Framework: Hudson
    • Unit Testing Framework: JUnit
    • Deployment Framework: WebLogic Server
    • Application Monitoring: JRockit Mission Control
    
    

    Conclusion

    This book shows you how to use Oracle JDeveloper and ADF to develop enterprise applications using SOA.

    In roughly 400 pages, it tries to cover topics that are usually covered by large volumes of documentation from the following areas:
    However, the author has done a good job of presenting a complex subject in a coherent and easy-to-read manner.  He has also provides many useful recipes which can be eventually incorporated into your application implementations.  Overall, it provides a useful reference for all developers starting enterprise application development with Oracle ADF.

    Besides the book, the author also writes on his blogs JDeveloper Frequently Asked Questions  and ADF Code Bits.

    Reviewed Book


    © Travel for Life Guide. All Rights Reserved.

    Analytical Insights on Health, Culture, and Security.