Skip to content

Commit

Permalink
unit tests: added few tests for multi level subject references
Browse files Browse the repository at this point in the history
  • Loading branch information
neowit committed Oct 8, 2014
1 parent 067e724 commit 8636143
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/com/neowit/utils/UsageReporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class UsageReporter(basicConfig: BasicConfig) extends Logging {
in.close()
}
def report() {
if (0 != basicConfig.getProperty("reportUsage").getOrElse(1)) {
if ("0" != basicConfig.getProperty("reportUsage").getOrElse("1")) {
try {
reportUsage()
} catch {
Expand Down
47 changes: 47 additions & 0 deletions src/test/resources/completions/src/classes/SObjectCompletions.cls
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,53 @@ public with sharing class SObjectCompletions {
Account a = new Account(AccountNumber = '10', My_Object__r.);// test_My_Object__r
}

/**
* #START
{
"lineMarker": "testSObjectNewWithMultiLevelRelationship",
"column": 74,
"itemsCountMin": 40,
"signatureContains": ["abbreviate(Integer maxWidth)", "abbreviate(Integer maxWidth, Integer offset)", "capitalize", "center", "charAt", "compareTo", "equals"],
"signatureMustNotContain" : ["escapeSingleQuotes", "format", "valueOf"]
}
* #END
*/
public void testSObjectNewWithMultiLevelRelationship() {
Account a = new Account(AccountNumber = '10', CreatedBy.Contact.Email.);// testSObjectNewWithMultiLevelRelationship
}

/**
* #START
{
"lineMarker": "testDirectSObjecFieldReference",
"column": 19,
"itemsCountMin": 4,
"signatureContains": ["format", "intValue", "longValue", "round"],
"signatureMustNotContain" : ["valueOf"]
}
* #END
*/
public void testDirectSObjecFieldReference() {
Account a = new Account();
a.AnnualRevenue.;// testDirectSObjecFieldReference
}

/**
* #START
{
"lineMarker": "testSObjecReferenceWithMultiLevelRelationship",
"column": 29,
"itemsCountMin": 40,
"signatureContains": ["abbreviate(Integer maxWidth)", "abbreviate(Integer maxWidth, Integer offset)", "capitalize", "center", "charAt", "compareTo", "equals"],
"signatureMustNotContain" : ["escapeSingleQuotes", "format", "valueOf"]
}
* #END
*/
public void testSObjecReferenceWithMultiLevelRelationship() {
Account a = new Account();
a.CreatedBy.Contact.Email.;// testSObjecReferenceWithMultiLevelRelationship
}

/**
* #START
{
Expand Down
1 change: 1 addition & 0 deletions src/test/scala/com/neowit/apex/CodeCompletions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CodeCompletions extends FunSuite {
s"--config=${escapeFilePath(loginCredentialsPath)}"
,"--action=listCompletions"
,s"--projectPath=${escapeFilePath(projectPath)}"
,s"--reportUsage=0"

)

Expand Down

0 comments on commit 8636143

Please sign in to comment.