This repository was archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Update README.md with more details #8
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,15 +18,15 @@ Please refer https://github.com/forcedotcom/ApexUnit/wiki to know about the key | |
| - Installation instructions : https://maven.apache.org/install.html | ||
| - Configuring maven : https://maven.apache.org/configure.html | ||
| - Eclipse 3.6 or later | ||
| - OAuth setup for the org to get Client ID and Client Secret | ||
| - OAuth setup for the org to get Client ID and Client Secret using connected app | ||
| - http://salesforce.stackexchange.com/questions/40346/where-do-i-find-the-client-id-and-client-secret-of-an-existing-connected-app | ||
| - http://stackoverflow.com/questions/18464598/where-to-get-client-id-and-client-secret-of-salesforce-api-for-rails-3-2-11 | ||
| - http://www.calvinfroedge.com/salesforce-how-to-generate-api-credentials/ | ||
| - Please verify the oauth setup for the org by executing the following command : | ||
| ```shell | ||
| curl -v <Salesforce_Org_URL>/services/oauth2/token -d "grant_type=password" -d "client_id=****************" -d "client_secret= **************" -d "username=***********" -d "password= *******" | ||
| curl -v <Salesforce_Org_URL>/services/oauth2/token -d "grant_type=password" -d "client_id=*CLIENT_ID_GOES_HERE*" -d "client_secret= *CLIENT_SECRET_GOES_HERE*" -d "username=*[email protected]*" -d "password= *your_password_goes_here*" | ||
| ``` | ||
| *The above command should provide you the access_token in the response.* | ||
| *The above command should provide you the access_token in the response.If you have special characters in your password you will have to pass URL-encoded password plus the security token* | ||
|
|
||
| ## How to build and execute? | ||
| - Clone the project onto your local system using the command: | ||
|
|
@@ -35,7 +35,12 @@ curl -v <Salesforce_Org_URL>/services/oauth2/token -d "grant_type=password" -d " | |
| ``` | ||
| This would create a local copy of the project for you. | ||
| - (Optional) Open the project in an IDE(eclipse, intelliJ etc.) | ||
| - Modify/Add manifest files for test classes (for execution) and for Apex(source) classes (for code coverage computation) in the following location in your project setup: src/main/resources | ||
| - There are two ways in which user can select the list of tests to execute and the lsit of classes to examine the code coverage | ||
| - regex - identify and provide regex for the test class names that you want to execute for the "-regex.for.selecting.test.classes.to.execute" parameter. Example: if you want to execute the tests: My_Apex_controller_Test, My_Apex_builder_Test and My_Apex_validator_Test, identify the regex as "My_Apex_\*_Test". Pass the parameter "-regex.for.selecting.test.classes.to.execute My_Apex_\*_Test" while executing the mvn command. | ||
| - Similarly, you can provide regex for the classes for which you want to examine the code coverage by using "-regex.for.selecting.source.classes.for.code.coverage.computation My_Apex_\*_Class" while executing the mvn command. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add source in? |
||
| - Manifest files - List of tests can be read from Manifest files. Create a manifest file say ManifestFile_Unit_Tests.txt in "src/main/resources" location of your project. Add test names to execute in the manifest file. Specify this manifest file as "-manifest.files.with.test.class.names.to.execute ManifestFile_Unit_Tests.txt" while executing the mvn command. | ||
| - Similarly, add the class names for which you want to exercise code coverage in a manifest file say ClasssManifestFile.txt in "src/main/resources" location of your project and Specify this manifest file as "-manifest.files.with.source.class.names.for.code.coverage.computation ClassManifestFile.txt" while executing the mvn command. | ||
| - Note that multiple regexes and manifest files can be specified using comma seperation(without spaces). Example: "-regex.for.selecting.test.classes.to.execute This_Is_Regex1\*,\*Few_Test,Another_\*_regex -manifest.files.with.source.class.names.for.code.coverage.computation ClassManifestFile.txt,MoreClassesManifestFile.txt" | ||
| - Go to your project directory(to the directory having pom.xml) in command prompt and execute the following command: | ||
| ```java | ||
| mvn compile exec:java -Dexec.mainClass="com.sforce.cd.apexUnit.ApexUnitRunner" | ||
|
|
@@ -79,7 +84,7 @@ Note: User must provide either of the (-regex.for.selecting.source.classes.for.c | |
|
|
||
| Sample command: | ||
| ```java | ||
| mvn compile exec:java -Dexec.mainClass="com.sforce.cd.apexUnit.ApexUnitRunner" -Dexec.args=" -org.login.url https://na14.salesforce.com -org.username test****@salesforce.com -org.password ****** -org.wide.code.coverage.threshold 75 -team.code.coverage.threshold 80 -org.client.id ******* -org.client.secret ***** -regex.for.selecting.test.classes.to.execute Sample*Test,Sample*test -regex.for.selecting.source.classes.for.code.coverage.computation Sample,Mobile,Wrapper -manifest.files.with.test.class.names.to.execute ManifestFile.txt -manifest.files.with.source.class.names.for.code.coverage.computation ClassManifestFile.txt -max.test.execution.time.threshold 10" | ||
| mvn compile exec:java -Dexec.mainClass="com.sforce.cd.apexUnit.ApexUnitRunner" -Dexec.args=" -org.login.url https://na14.salesforce.com -org.username yourusername@salesforce.com -org.password yourpassword-org.wide.code.coverage.threshold 75 -team.code.coverage.threshold 80 -org.client.id CLIENT_ID_FROM_CONNECTED_APP -org.client.secret CLIENT_SECRET_FROM_CONNECTED_APP -regex.for.selecting.test.classes.to.execute Sample*Test,Sample*test -regex.for.selecting.source.classes.for.code.coverage.computation Sample*,Mobile*Controller,Wrapper -manifest.files.with.test.class.names.to.execute ManifestFile.txt -manifest.files.with.source.class.names.for.code.coverage.computation ClassManifestFile.txt -max.test.execution.time.threshold 10" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you say , your_regular_exp1, regular_exp2,... instead of Sample_Test,Sample_test where ever applicable?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ``` | ||
| Note: Multiple comma separated manifest files and regexes can be provided.Please do not include spaces while providing multiple regex or manifest files. | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a number bullet over to '-'