-
Notifications
You must be signed in to change notification settings - Fork 165
Developing for the Azure Storage Java Library
First, if you intend to contribute to the project, please make sure you've followed the instructions provided in the Azure Projects Contribution Guidelines. Make sure you've signed the CLA. Before you start working on a feature or substantial code contribution please discuss it with the team via a GitHub issue.
The Azure Storage development team generally uses Eclipse so instructions will be tailored to that preference. That being said, any preferred IDE or other toolset should be usable.
- Java JDK/JRE. You may use 7 but note that the code must be compatible with 6.
- Maven. This will help manage the project dependencies for you, among other things.
- Eclipse. Additionally, install the Maven Integration plugin if this is not included by default with the Eclipse installation you choose.
- Grab the source code itself from GitHub.
To import our project into Eclipse, go to File->Import…->Maven/Existing Maven Projects->{navigate to azure-storage-java directory}->{check off the pom}). This will import the library and test folders as source folders, but also the samples folder which you should ignore. Importing as a Maven project will also automatically add our dependencies to the classpath. Import the samples folder separately if desired (it has its own pom) by following the above directions but going to the azure-storage-java/microsoft-azure-storage-samples folder and using that pom.
The Java library supports several methods to set up credentials to run tests. You can set an environment variable named storageConnection with a connection string as its value or you can set an environment variable named storageTestConfiguration which is a file path to a configuration file on your system. If you do neither of those, the test configuration file in the res folder will be used. To set up your own test configuration file, use that as a model. The same configuration file format is used for .Net.
To actually run tests, right click the individual test or test class in either the Package Explorer or Outline and click Run As->JUnit Test. To run one of our suites, navigate to the TestRunners class and follow the same procedure with any of the suites. You may also use JUnit directly from the command line if preferred.