-
Notifications
You must be signed in to change notification settings - Fork 0
Devbox setup
This page describes how to setup a Windows based development machine for Windows Azure SDK for Java.
1. Install Eclipse IDE for Java EE Developer, following the link
http://www.eclipse.org/downloads/moreinfo/jee.php
2. Install Maven on Windows, following the link
http://maven.apache.org/guides/getting-started/windows-prerequisites.html
3. Install Maven Eclipse Integration
http://www.eclipse.org/m2e/download/
4. The Maven Eclipse plugin can also be installed from Eclipse Market Place.
5. Install git client from http://git-scm.com/downloads
The source code of Windows Azure SDK for Java can be obtained using the following git command :
git clone https://github.com/WindowsAzure/azure-sdk-for-java.git
In Eclipse -> Import -> Maven Projects, select the root (containing pom.xml) of Windows Azure SDK for Java on your machine.
The following command will run all the unit tests from the root of Windows Azure SDK for Java.
mvn package
If you just want to compile Windows Azure SDK for Java without running the unit test, the following command can serve your purpose.
mvn package -DskipTests
1. Login https://windows.azure.com with your own credential.
2. Create a storage account. (A storage account is needed for running storage service unit tests.)
3. Add root container to the blob storage account. This can be achieved using the Azure Storage Explorer (http://azurestorageexplorer.codeplex.com/)
4. Create a Service Bus account. (A service bus account is needed for running service bus unit tests.)
5. Create a Media Services account. (A media services account is needed for running media services unit tests).
(This step is only applicable if you want to run service management related features).
1. Create a self signed certificate
2. upload the certificate to your Windows Azure subscription. This step can be archived via either PowerShell or Windows Azure Portal.
3. Convert the .pfx file to a jks file (Java Keystore file).
keytool -importkeystore -srckeystore mypfxfile.pfx -srcstoretype pkcs12 -destkeystore clientcert.jks -deststoretype JKS
In order to run the unit test, you will need to setup the following environment variables. Please create new account for each machine that is running the unit test to avoid unit tests from different machine to confront each other.
set JAVA_OPTS="-Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888"
set blob.accountName=[blob account name]
set blob.accountKey=[blob key]
set blob.uri=http://[blob account name].blob.core.windows.net
set queue.accountName=[queue account name]
set queue.accountKey=[queue account key]
set queue.uri=http://[queue account name].queue.core.windows.net
set table.accountName=[table account name]
set table.accountKey=[table account key]
set table.uri=http://[table account name].table.core.windows.net
set serviceBus.uri=https://[service bus account name].servicebus.windows.net/
set serviceBus.wrap.uri=https://[service bus account name]-sb.accesscontrol.windows.net/WRAPv0.9
set serviceBus.wrap.name=owner
set serviceBus.wrap.password=[wrap password]
set serviceBus.connection.string=
set management.uri=https://management.core.windows.net/
set management.subscription.id=[Windows Azure subscription ID]
set management.keystore.path=[The path to the keystore]
set management.keystore.password=[The password of the keystore]
set management.keystore.type=[The type of the keystore, such as jks]
set media.uri=https://wamsbluclus001rest-hs.cloudapp.net/
set media.oauth.uri=https://wamsprodglobal001acs.accesscontrol.windows.net/v2/OAuth2-13
set media.oauth.client.id=[media service account name]
set media.oauth.client.secret=[media service account secret]
set media.oauth.scope=urn:WindowsAzureMediaServices
set media.queue.account.name=[media service queue account name]
set media.queue.account.key=[media service queue account key]
set media.queue.uri=[the uri of the queue used by media service]
The standard Oracle Java only support 64 bit encryption, to enable 128 bit encryption, a few extra steps need to be performed.
-
Download Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6. http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
-
Unzip the file and copy all the files to JRE/lib/security directory
Emma is a plugin to generate code coverage report for JUnit. Emma can be installed from the Eclispe->Help->Eclipse Marketplace.
Run Emma
mvn emma:emma
-
For HTTPS decryption, the certificate of the fiddler needs to be passed to JVM. (This step is optional, only for those who are interested in analyzing HTTPS traffic) a. In Fiddler, Export Fiddler's root certificate Tools -> Fiddler Options... -> HTTPS -> check "Descript HTTPS traffic" checkbox-> Export Root Certificate to Desktop b. Create a keystore with this certificate, by opening a command line as administrator (keytool doesn't work otherwise)
You should import it into the system certificate store. <JDK_HOME>\bin\keytool -import -alias fiddlerroot -keystore ..\lib\security\cacerts -file c:\users<Username>\Desktop\FiddlerRoot.cer )
c. Enter a password when prompted. This should create a file called FiddlerKeystore.
-
Fiddler with HTTPS Client Certificate support. Some HTTPS service requires clients to provide client certificate to authenticate the client. For example, Windows Azure Service Management is using this mechanism to secure the communications.
-
To configure the default JRE VM arguments in Eclipse to use Fiddler. a. Go to Window -> Preferences->Java->Installed JREs-> b. Add the following to the default VM arguments, for HTTP support: -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888 c. Add the following for HTTPS -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8888 -Djavax.net.ssl.trustStore=<path\to\FiddlerKeystore> -Djavax.net.ssl.trustStorePassword=
Azure SDK for Java
- Overview
- Getting Started
- Logging
- ListOperationCallback
- Exception handling
- Sending raw JSON
- Migration from 0.9.x to 1.0
- Long Running Operations
Azure SDK for Java (Classic)