Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Flex Developer Center / Flex Test Drive /

Flex Test Drive: Test and debug your code

by Adobe

Adobe logo

Modified

2 May 2011

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Flash BuilderFlexRIA
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Video | Code | Tutorial | Links

Test server-side code

 

This content requires Flash To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player. To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the Test Drive solution files (ZIP, 14 MB)

Code

No code is written in this tutorial.

Tutorial

In the previous two modules, you built Flex applications that retrieve, display, and modify data from a database. In this module you test and debug your code.

In this tutorial, you use the Flash Builder Test Operation to test your server-side code—even before writing any Flex code. This is useful to make sure your server-side operations are all working before you call them in your application.

Step 1: Test a service operation that returns data.

Right-click the getEmployees()operation in the Data/Services view and select Test Operation. Click the Test button in the Test Operation view.

You will see all the return data displayed in the TestOperation view (see Figure 1).

Test the getEmployees() service operation.
Figure 1. Test the getEmployees() service operation.

Java developers: You will get an employee object that is an array of Employee objects.

Step 2: Test a service operation that requires an input parameter.

Select the getEmployeesById() operation from the drop-down in the Test Operation view. Enter a value for the argument and click Test (see Figure 2).

The getEmployeesById() operation is invoked with the value you specified and the return data is displayed in the Test Operation view.

Test the getEmployeesById() service operation.
Figure 2. Test the getEmployeesById() service operation.

Step 3: Test a service operation that requires a complex input parameter.

Select the createEmployee() operation in the Test Operation view. Click in the Enter Value field and click the Ellipses button. You should get a pop-up window to enter input data (see Figure 3). Close this window.

You will be asked for an input object when testing the createEmployee() operation.
Figure 3. You will be asked for an input object when testing the createEmployee() operation.

Java developers: Your Input Argument window will look different because your method already knows it needs an Employee object. You can skip Steps 4 and 5 below and just enter test values here as shown in Figure 5 and then test the operation. Be sure to enter integers for id and departmentid and only two characters for state. It doesn't matter what id you specify, it will not be used; a value will be generated automatically for it by the database when the data is inserted.

Step 4: Configure the createEmployee() operation return type.

Return to the Data/Services view, right-click createEmployee() and select Configure Return Type. In the dialog box, auto-detect from sample data, change the type from Object to Employee, and then click in the Enter Value field (see Figure 4). Click the Ellipses button that appears and enter values for each Employee field (see Figure 5). Be sure to enter integers for departmentid and id and only two characters for state.

It does not matter what id you specify, it will not be used; a value will be automatically generated for it by the database when the data is inserted.

Specify data type when configuring the createEmployee() return type.
Figure 4. Specify data type when configuring the createEmployee() return type.
Specify input arguments when configuring the createEmployee() return type.
Figure 5. Specify input arguments when configuring the createEmployee() return type.

You should now see parameter and return types (Employee and int, respectively) specified for the createEmployee()operation in the Data/Services panel.

Step 5: Test the createEmployee() operation again.

Right-click createEmployees() in the Data/Services view and select Test Operation. Click the Test button in the Test Operation view.

This time you will see the test values you specified while configuring the return type already entered in the Enter Value field.

After you test the operation, you should see an integer displayed as the response value (see Figure 6). A new employee was successfully added to the database. If you run your application again, you will see this new employee in the DataGrid.

Test the createEmployee() service operation.
Figure 6. Test the createEmployee() service operation.

In this tutorial, you tested your server-side operations even before writing any code. In the next tutorial, you will monitor the traffic between your application and the server after you use service calls in your code.

Learn more

Refer to the following resources to learn more about this topic:

Documentation: Accessing data with Flex

  • Testing service operations
  • Authenticating access to services
  • Debugging remote services

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This

  • Flex Test Drive: Modify the database
  • Flex Test Drive: Build an application in an hour
  • Flex Test Drive: Change the appearance of your application
  • Flex Test Drive: Build an application in an hour
  • Flex Test Drive: Deploy your application to a web server
  • Flex Test Drive: Add charts and graphs
  • Test Drive: Deploy your application to a web server
  • Flex Test Drive: Add charts and graphs
  • Flex Test Drive: Build an application in an hour
  • Flex Test Drive: Build an application in an hour

Tutorials and samples

Tutorials

  • Flex mobile performance checklist
  • Flex and Maven with Flexmojos – Part 3: Journeyman
  • Migrating Flex 3 applications to Flex 4.5 – Part 4

Samples

  • Twitter Trends
  • Flex 4.5 reference applications
  • Mobile Trader Flex app on Android Market

Flex user forum

More
12/17/2012 need secure video streaming in Flex mobile for iOS
05/17/2013 Mobile Support
05/21/2013 Flex IFrame Flex drop down menus are hidden behind iframe
05/16/2013 How to disable touch event on swipe gesture event

Flex Cookbook

More

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement