共用方式為


Building Windows Azure Service Part7: Service Testing

In this post, you will test the GuestBook application in the Development Fabric (aka, devfabric). The devfabric is a simulated environment for developing and testing Windows Azure applications on your test machine.

A Visual Studio project with source code is available at the end of this post to accompany the subject matter discussed.

  1. In Visual Studio, press F5 to execute the service. The service builds and then launches the local development fabric. To show the development fabric UI, right-click its icon located in the system tray and select Show Development Fabric UI.

    image

    Figure 9 Development Fabric UI

  2. Switch to Internet Explorer to view the GuestBook application.

  3. Add a new entry to the guest book as described in the next steps.

  4. Type your name and a message.

  5. Choose an image to upload. It is a good idea to choose a large high resolution image because the guestbook service will resize it.

  6. Click the pencil icon to submit the entry.

image

Figure 10 GuestBook Home Page

Once you submit an entry, the web role creates a new entry in the guest book table and uploads the photo to the Blob Storage. The page contains a timer that triggers a page refresh every 5 seconds, so the new entry should appear on the page after a brief interval.

Initially, the new entry contains a link to the blob that contains the uploaded image so it will appear with the same size as the original image.

image

Figure 11 GuestBook Image Original Size

After a few seconds, the page refreshes and displays the thumbnail that the worker role generated.

image

Figure 12 GuestBook Generated Thumbnail

For related topics, see the following posts.

GuestBook.zip