README.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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
  14. src/test/resources/log4j.properties
  15. From command-line
  16. ------------------
  17. Basic execution:
  18. > mvn test
  19. NOTES:
  20. - The mvn pom.xml includes src/test/resources in the runtime classpath
  21. - detailed output (such as log4j) appears in target\surefire-reports\TEST-{testName}.xml
  22. including log4j messages.
  23. Run the tests and generate report:
  24. > mvn site (at least once to setup some basics including images for the report)
  25. > mvn surefire-report:report (run and produce report)
  26. > mvn mvn surefire-report:report-only (produce report from last run)
  27. > mvn mvn surefire-report:report-only -DshowSuccess=false (produce report from last run, only show errors)
  28. > .\target\site\surefire-report.html (view the report)
  29. Via eclipse
  30. -------------
  31. Manually add src\test\resources to the classpath for test run configuration:
  32. - run menu|run configurations|{configuration}|classpath|User Entries|advanced|add folder
  33. Then run via junit test runner.
  34. NOTE:
  35. - if you change log4.properties, rebuild the project to refresh the eclipse cache.
  36. Run Tests against Mocked storage.
  37. ---------------------------------
  38. These run automatically and make use of an in-memory emulation of azure storage.
  39. Running tests against the Azure storage emulator
  40. ---------------------------------------------------
  41. A selection of tests can run against the Azure Storage Emulator which is
  42. a high-fidelity emulation of live Azure Storage. The emulator is sufficient for high-confidence testing.
  43. The emulator is a Windows executable that runs on a local machine.
  44. To use the emulator, install Azure SDK 2.3 and start the storage emulator
  45. See http://msdn.microsoft.com/en-us/library/azure/hh403989.aspx
  46. Enable the Azure emulator tests by setting
  47. fs.azure.test.emulator -> true
  48. in src\test\resources\azure-test.xml
  49. Running tests against live Azure storage
  50. -------------------------------------------------------------------------
  51. In order to run WASB unit tests against a live Azure Storage account, add credentials to
  52. src\test\resources\azure-test.xml. These settings augment the hadoop configuration object.
  53. For live tests, set the following in azure-test.xml:
  54. 1. "fs.azure.test.account.name -> {azureStorageAccountName}
  55. 2. "fs.azure.account.key.{AccountName} -> {fullStorageKey}"
  56. =============
  57. Findbugs
  58. =============
  59. Run findbugs and show interactive GUI for review of problems
  60. > mvn findbugs:gui
  61. Run findbugs and fail build if errors are found:
  62. > mvn findbugs:check
  63. For help with findbugs plugin.
  64. > mvn findbugs:help
  65. =============
  66. Checkstyle
  67. =============
  68. Rules for checkstyle @ src\config\checkstyle.xml
  69. - these are based on a core set of standards, with exclusions for non-serious issues
  70. - as a general plan it would be good to turn on more rules over time.
  71. - Occasionally, run checkstyle with the default Sun rules by editing pom.xml.
  72. Command-line:
  73. > mvn checkstyle:check --> just test & fail build if violations found
  74. > mvn site checkstyle:checkstyle --> produce html report
  75. > . target\site\checkstyle.html --> view report.
  76. Eclipse:
  77. - add the checkstyle plugin: Help|Install, site=http://eclipse-cs.sf.net/update
  78. - window|preferences|checkstyle. Add src/config/checkstyle.xml. Set as default.
  79. - project|properties|create configurations as required, eg src/main/java -> src/config/checkstyle.xml
  80. NOTE:
  81. - After any change to the checkstyle rules xml, use window|preferences|checkstyle|{refresh}|OK