0
votes

I cloned the https://github.com/Azure/azure-storage-java.git project and want to do some changes. In-order to verify the changes I would like to execute the Junits.

Looking at https://github.com/Azure/azure-storage-java/blob/master/microsoft-azure-storage-test/res/TestConfigurations.xml. It looks like there are two options.

  1. Running against the storage emulator
  2. Running against real storage

I tried to edit https://github.com/Azure/azure-storage-java/blob/master/microsoft-azure-storage-test/res/TestConfigurations.xml with my own storage account and got

com.microsoft.azure.storage.StorageException: A Client side exception occurred, please check the inner exception for details: Caused by: java.lang.IllegalArgumentException: Primary and secondary location URIs in a StorageUri

Please advise, both options are fine by me?

1

1 Answers

0
votes

Did some debugging and figured it out (worked for me on the 2.2.0 version).

The key for testing setting is in the file microsoft-azure-storage-test/res/TestConfigurations.xml
It allows you to use a real storage account or the Azure Storage Emulator.

The actual storage to use is determined by the <TargetTestTenant> element

<TestConfigurations>
<TargetTestTenant>ProductionTenant</TargetTestTenant>
Or
<TargetTestTenant>DevStore</TargetTestTenant>

The exception com.microsoft.azure.storage.StorageException was due to a missing elements under the <TenantConfiguration> for the new file service

I used the ProductionTenant since my existing emulator (VS 2013) did not included any emulation for file service

<TenantConfiguration>
    <TenantName>ProductionTenant</TenantName>
    <TenantType>Cloud</TenantType>
    <AccountName>[ACCOUNT]</AccountName> ...
    <FileServiceEndpoint>http://[ACCOUNT].file.core.windows.net</FileServiceEndpoint> 
    <FileServiceSecondaryEndpoint>http://[ACCOUNT]-secondary.file.core.windows.net</FileServiceSecondaryEndpoint>
</TenantConfiguration>

Finally execute

mvn clean test