This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continuous Integration Setup & Code Cleanup
Tech debt release to get CI working, catch up on some unit tests, documentation, etc. **Refactoring (Could Impact Existing Code)** * Changed NebulaSettings.cls to use static variables and methods * Changed Logger.cls to use static methods - everything now calls Logger directly * Renamed QueryUtils.cls to QueryArgumentFormatter.cls (and refactored it) * QueryBuilder.cls now uses QueryArgumentFormatter.cls * Fixed the ordering of the filter scopes to be in descending order (for readability) **Bugfixes** * Fixed a problem with SObjectRecordTypes.cls when the object has no record types * Logger now checks the custom setting to see if it is enabled **Continuous Integration** * Added .travis.yml for continuous integration. Passing unit tests with 75% code coverage is now required to approve a PR * Added Travis CI build badges to README.md **Unit Tests** * Standardised the naming convention on a few test methods * Added more unit tests & test classes
- Loading branch information
Showing
23 changed files
with
654 additions
and
181 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
|
||
script: | ||
- npm install -g jsforce-metadata-tools | ||
- jsforce-deploy --dry-run -u $DEPLOYMENT_USERNAME -p $DEPLOYMENT_PASSWORD$DEPLOYMENT_TOKEN -D $TRAVIS_BUILD_DIR/src -l $DEPLOYMENT_LOGIN_URL --rollbackOnError true --testLevel $DEPLOYMENT_TEST_LEVEL --pollTimeout $POLL_TIMEOUT |
This file contains 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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# Nebula Framework for Salesforce Apex | ||
<a href="https://githubsfdeploy.herokuapp.com?owner=jongpie&repo=NebulaFramework"> | ||
<img alt="Deploy to Salesforce" | ||
src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png"> | ||
</a> | ||
<img alt="Deploy to Salesforce"src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png"> | ||
</a> | ||
|
||
## Branches | ||
| Name | Build Status | | ||
| -------- | -------- | | ||
| master | <img src="https://travis-ci.org/jongpie/NebulaFramework.svg?branch=master"> | | ||
| dev | <img src="https://travis-ci.org/jongpie/NebulaFramework.svg?branch=dev"> | |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/************************************************************************************************* | ||
* This file is part of the Nebula Framework project, released under the MIT License. * | ||
* See LICENSE file or go to https://github.com/jongpie/NebulaFramework for full license details. * | ||
*************************************************************************************************/ | ||
@isTest | ||
private class NebulaSettings_Tests { | ||
|
||
@isTest | ||
static void it_should_return_recordTypesSettings() { | ||
List<NebulaRecordTypesSettings__c> existingSettings = [SELECT Id FROM NebulaRecordTypesSettings__c]; | ||
System.assert(existingSettings.isEmpty()); | ||
|
||
Test.startTest(); | ||
System.assertNotEquals(null, NebulaSettings.recordTypesSettings); | ||
Test.stopTest(); | ||
} | ||
|
||
@isTest | ||
static void it_should_return_loggerSettings() { | ||
List<NebulaLoggerSettings__c> existingSettings = [SELECT Id FROM NebulaLoggerSettings__c]; | ||
System.assert(existingSettings.isEmpty()); | ||
|
||
Test.startTest(); | ||
System.assertNotEquals(null, NebulaSettings.loggerSettings); | ||
Test.stopTest(); | ||
} | ||
|
||
@isTest | ||
static void it_should_return_repositorySettings() { | ||
List<NebulaRepositorySettings__c> existingSettings = [SELECT Id FROM NebulaRepositorySettings__c]; | ||
System.assert(existingSettings.isEmpty()); | ||
|
||
Test.startTest(); | ||
System.assertNotEquals(null, NebulaSettings.repositorySettings); | ||
Test.stopTest(); | ||
} | ||
|
||
@isTest | ||
static void it_should_return_triggerHandlerSettings() { | ||
List<NebulaTriggerHandlerSettings__c> existingSettings = [SELECT Id FROM NebulaTriggerHandlerSettings__c]; | ||
System.assert(existingSettings.isEmpty()); | ||
|
||
Test.startTest(); | ||
System.assertNotEquals(null, NebulaSettings.triggerHandlerSettings); | ||
Test.stopTest(); | ||
} | ||
|
||
@isTest | ||
static void it_should_reset_all_settings_to_defaults() { | ||
NebulaLoggerSettings__c nebulaLoggerSettings = NebulaLoggerSettings__c.getInstance(); | ||
upsert nebulaLoggerSettings; | ||
Id originalLoggerSettingsId = NebulaLoggerSettings__c.getInstance().Id; | ||
|
||
NebulaRecordTypesSettings__c nebulaRecordTypesSettings = NebulaRecordTypesSettings__c.getInstance(); | ||
upsert nebulaRecordTypesSettings; | ||
Id originalRecordTypesSettingsId = NebulaRecordTypesSettings__c.getInstance().Id; | ||
|
||
NebulaRepositorySettings__c nebulaRepositorySettings = NebulaRepositorySettings__c.getInstance(); | ||
upsert nebulaRepositorySettings; | ||
Id originalRepositorySettingsId = NebulaRepositorySettings__c.getInstance().Id; | ||
|
||
NebulaTriggerHandlerSettings__c nebulaTriggerHandlerSettings = NebulaTriggerHandlerSettings__c.getInstance(); | ||
upsert nebulaTriggerHandlerSettings; | ||
Id originalTriggerHandlerSettingsId = NebulaTriggerHandlerSettings__c.getInstance().Id; | ||
|
||
Test.startTest(); | ||
NebulaSettings.resetAllSettingsToDefaults(); | ||
Test.stopTest(); | ||
|
||
System.assertNotEquals(originalLoggerSettingsId, NebulaLoggerSettings__c.getInstance().Id); | ||
System.assertNotEquals(originalRecordTypesSettingsId, NebulaRecordTypesSettings__c.getInstance().Id); | ||
System.assertNotEquals(originalRepositorySettingsId, NebulaRepositorySettings__c.getInstance().Id); | ||
System.assertNotEquals(originalTriggerHandlerSettingsId, NebulaTriggerHandlerSettings__c.getInstance().Id); | ||
} | ||
|
||
} |
File renamed without changes.
Oops, something went wrong.