README.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. =============
  2. Building
  3. =============
  4. basic compilation:
  5. > mvn clean compile test-compile
  6. Compile, run tests and produce jar
  7. > mvn clean package
  8. =============
  9. Unit tests
  10. =============
  11. Most of the tests will run without additional configuration.
  12. For complete testing, configuration in src/test/resources is required:
  13. src/test/resources/azure-test.xml -> Defines Azure storage dependencies, including account information
  14. The other files in src/test/resources do not normally need alteration:
  15. log4j.properties -> Test logging setup
  16. hadoop-metrics2-azure-file-system.properties -> used to wire up instrumentation for testing
  17. From command-line
  18. ------------------
  19. Basic execution:
  20. > mvn test
  21. NOTES:
  22. - The mvn pom.xml includes src/test/resources in the runtime classpath
  23. - detailed output (such as log4j) appears in target\surefire-reports\TEST-{testName}.xml
  24. including log4j messages.
  25. Run the tests and generate report:
  26. > mvn site (at least once to setup some basics including images for the report)
  27. > mvn surefire-report:report (run and produce report)
  28. > mvn mvn surefire-report:report-only (produce report from last run)
  29. > mvn mvn surefire-report:report-only -DshowSuccess=false (produce report from last run, only show errors)
  30. > .\target\site\surefire-report.html (view the report)
  31. Via eclipse
  32. -------------
  33. Manually add src\test\resources to the classpath for test run configuration:
  34. - run menu|run configurations|{configuration}|classpath|User Entries|advanced|add folder
  35. Then run via junit test runner.
  36. NOTE:
  37. - if you change log4.properties, rebuild the project to refresh the eclipse cache.
  38. Run Tests against Mocked storage.
  39. ---------------------------------
  40. These run automatically and make use of an in-memory emulation of azure storage.
  41. Running tests against the Azure storage emulator
  42. ---------------------------------------------------
  43. A selection of tests can run against the Azure Storage Emulator which is
  44. a high-fidelity emulation of live Azure Storage. The emulator is sufficient for high-confidence testing.
  45. The emulator is a Windows executable that runs on a local machine.
  46. To use the emulator, install Azure SDK 2.3 and start the storage emulator
  47. See http://msdn.microsoft.com/en-us/library/azure/hh403989.aspx
  48. Enable the Azure emulator tests by setting
  49. fs.azure.test.emulator -> true
  50. in src\test\resources\azure-test.xml
  51. Known issues:
  52. Symptom: When running tests for emulator, you see the following failure message
  53. com.microsoft.windowsazure.storage.StorageException: The value for one of the HTTP headers is not in the correct format.
  54. Issue: The emulator can get into a confused state.
  55. Fix: Restart the Azure Emulator. Ensure it is v3.2 or later.
  56. Running tests against live Azure storage
  57. -------------------------------------------------------------------------
  58. In order to run WASB unit tests against a live Azure Storage account, add credentials to
  59. src\test\resources\azure-test.xml. These settings augment the hadoop configuration object.
  60. For live tests, set the following in azure-test.xml:
  61. 1. "fs.azure.test.account.name -> {azureStorageAccountName}
  62. 2. "fs.azure.account.key.{AccountName} -> {fullStorageKey}"
  63. =============
  64. Findbugs
  65. =============
  66. Run findbugs and show interactive GUI for review of problems
  67. > mvn findbugs:gui
  68. Run findbugs and fail build if errors are found:
  69. > mvn findbugs:check
  70. For help with findbugs plugin.
  71. > mvn findbugs:help
  72. =============
  73. Checkstyle
  74. =============
  75. Rules for checkstyle @ src\config\checkstyle.xml
  76. - these are based on a core set of standards, with exclusions for non-serious issues
  77. - as a general plan it would be good to turn on more rules over time.
  78. - Occasionally, run checkstyle with the default Sun rules by editing pom.xml.
  79. Command-line:
  80. > mvn checkstyle:check --> just test & fail build if violations found
  81. > mvn site checkstyle:checkstyle --> produce html report
  82. > . target\site\checkstyle.html --> view report.
  83. Eclipse:
  84. - add the checkstyle plugin: Help|Install, site=http://eclipse-cs.sf.net/update
  85. - window|preferences|checkstyle. Add src/config/checkstyle.xml. Set as default.
  86. - project|properties|create configurations as required, eg src/main/java -> src/config/checkstyle.xml
  87. NOTE:
  88. - After any change to the checkstyle rules xml, use window|preferences|checkstyle|{refresh}|OK
  89. =============
  90. Javadoc
  91. =============
  92. Command-line
  93. > mvn javadoc:javadoc