You need to sign in to do that
Don't have an account?
![nwing nwing](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Help - Issue With This - System.Exception: Assertion Failed: Expected: 3861.8125, Actual: null
I successfully wrote a class to update a date field, and used that to build a class that updates a number field, both on a before insert/before update trigger.
The date one works great. The number class worked, and then didn't, but it was working in a dev environment at one time, though I could not get it to deploy to server. I cannot find for the life of me what is going on. It runs the test and tells me that the Actual is null in the assertion.
Here is the class as well as the code. If there is ANY suggestions please! Basically, I am using four values, 'months' , 'initial rent' , and 'percent increase', and 'escalation month' to determine the total cost of a lease agreement. The escalation month is the month in which the rent goes up each 12 month cycle, by the 'percent increase' amount.
As I said this was working, but ever since I tried to deploy it it is choking now. I have a separate trigger for each class, both with the same parameters, but the other one launches the date update class, which is working fine. They are very similar in structure. In fact I used the date one as a model to help build the number update.....
Code:
trigger SiteLeaseCumCostTrigger on Site_Lease_Contract__c (before insert, before update) { SiteLeaseCumCostClass.SiteLeaseCumCostTrigger( Trigger.new ); }
Code:
public class SiteLeaseCumCostClass { public static void SiteLeaseCumCostTrigger(Site_Lease_Contract__c[] newSiteLeaseCumCost) { for (Integer i = 0; i < Trigger.new.size(); i++) { Double mthsD = newSiteLeaseCumCost[i].Lease_Term_In_Months__c; Double escmthD = newSiteLeaseCumCost[i].Escalation_Month__c; Integer mths = mthsD.intValue(); Integer escmth = escmthD.intValue(); Double trm1cost = (escmth-1) * newSiteLeaseCumCost[i].Initial_Rent__c; Double numflltrmsD = math.floor(((mthsD-(escmthD-1))/12)); Integer numflltrms = numflltrmsD.intValue(); Integer lsttrm = mths - ((numflltrms * 12) + (escmth-1)); Double trm2cost = 0; Double escpct = newSiteLeaseCumCost[i].Escalation_Amount__c/100; Integer k; Double intrnt = newSiteLeaseCumCost[i].Initial_Rent__c; for (Integer j = 1; j < numflltrms+1;j++) { trm2cost = 12*(math.pow(1+escpct,j)*intrnt) + trm2cost; k=j; } k = k+1; Double trm3cost = (12-(escmth-1))*(math.pow(1+escpct,k)*intrnt); Double alltrmcost = trm1cost + trm2cost + trm3cost; newSiteLeaseCumCost[i].Cum_Cost__c = alltrmcost; } } static testMethod void SiteLeaseCumCostTrigger(){ double cst0 = 3861.8125; Site_Lessor__c lessor = new Site_Lessor__c(Name='Testing2'); insert lessor; Site_Lease_Contract__c t = new Site_Lease_Contract__c(Site_Lessor__c=lessor.Id,Name='Name1',Lease_Term_In_Months__c=36,Escalation_Month__c=8,Initial_Rent__c=100.00,Escalation_Amount__c=5.00); insert t; Site_Lease_Contract__c testCumCost1=[select id, Cum_Cost__c from Site_Lease_Contract__c where id = :t.Id]; system.assertEquals(cst0,testCumCost1.Cum_Cost__c); } }
btw, this is working perfectly in the test system now. It saves to the test environment just fine, even though it errors out when running the test method and will not deploy to the prod environment.
aaarrgghhh!
Your system log should show you the result of the query, "retrieved x records" sort of thing.
Thank You Very Much! I will put this into action and see what I can do with it. It rolls up into, and works great, in the dev environment, so that would make sense.
so the return is working, and the numbers match up, but when I deploy it chokes.....I am befuddled.........any ideas? It is better, but no cigar quite yet....
Result: FAILED
Date: December 17, 2008 4:45:23 PM PST
Project name: SiteLeaseCumCostUpdate
Username: blah
Endpoint: www.salesforce.com
Username: blah
Endpoint: www.salesforce.com
Name: classes/SiteLeaseCumCostClass.cls
Action: UPDATED
Result: SUCCESS
Problem: n/a
Action: UPDATED
Result: SUCCESS
Problem: n/a
SiteLeaseCumCostClass.SiteLeaseCumCostTrigger System.Exception: Assertion Failed: Expected: 3861.8125, Actual: null
Average test coverage across all Apex Classes and Triggers is 50%, at least 75% test coverage is required
20081218004520.788:Class.firstclass.testTestRepeat: line 33, column 9: DeclareVar: firstclass trTest
20081218004520.788:Class.firstclass: line 1, column 14: Instance initialization: firstclass
20081218004520.788:Class.firstclass.testTestRepeat: line 33, column 9: initial value: firstclass:[]
20081218004520.788:Class.firstclass.testTestRepeat: line 34, column 9: system.assertEquals(String, String)
20081218004520.788:Class.firstclass.testRepeat: line 4, column 5: For
20081218004520.788:Class.firstclass.testRepeat: line 4, column 10: DeclareVar: Integer i
20081218004520.788:Class.firstclass.testRepeat: line 4, column 10: initial value: 0
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: system.debug(String)
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: Execution 0
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: system.debug(String)
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: Execution 1
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: system.debug(String)
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: Execution 2
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: system.debug(String)
20081218004520.788:Class.firstclass.testRepeat: line 5, column 9: Execution 3
20081218004520.788:Class.firstclass.testRepeat: line 4, column 5: Number of iterations: 4
20081218004520.788:Class.firstclass.testTestRepeat: line 35, column 9: returning String from method public String testRepeat(Integer) in 2 ms
20081218004520.788:Class.firstclass: line 32, column 28: returning from end of method static testMethod void testTestRepeat() in 2 ms
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 0 out of 100
Number of DML rows: 0 out of 500
Number of script statements: 8 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20
*** Ending Test firstclass.static testMethod void testTestRepeat()
20081218004520.792:Class.firstclass.testDupEntries: line 21, column 14: DeclareVar: LIST:String testDups
20081218004520.792:Class.firstclass.testDupEntries: line 21, column 14: initial value: ()
20081218004520.792:Class.firstclass.testDupEntries: line 22, column 14: DeclareVar: LIST:String compareResult
20081218004520.792:Class.firstclass.testDupEntries: line 22, column 14: initial value: ()
20081218004520.792:Class.firstclass.testDupEntries: line 23, column 9: DeclareVar: firstclass testClass
20081218004520.792:Class.firstclass: line 1, column 14: Instance initialization: firstclass
20081218004520.792:Class.firstclass.testDupEntries: line 23, column 9: initial value: firstclass:[]
20081218004520.792:Class.firstclass.testDupEntries: line 24, column 9: LIST:String.add(String)
20081218004520.792:Class.firstclass.testDupEntries: line 25, column 9: LIST:String.add(String)
20081218004520.792:Class.firstclass.testDupEntries: line 26, column 9: LIST:String.add(String)
20081218004520.792:Class.firstclass.testDupEntries: line 27, column 9: LIST:String.add(String)
20081218004520.792:Class.firstclass.testDupEntries: line 28, column 9: LIST:String.add(String)
20081218004520.792:Class.firstclass.testDupEntries: line 29, column 9: system.assertEquals(LIST:String, LIST:String)
20081218004520.792:Class.firstclass.dupEntries: line 11, column 14: DeclareVar: LIST:String dupValues
20081218004520.792:Class.firstclass.dupEntries: line 11, column 14: initial value: ()
20081218004520.792:Class.firstclass.dupEntries: line 12, column 13: DeclareVar: SET:String dupID
20081218004520.792:Class.firstclass.dupEntries: line 12, column 13: initial value: {}
20081218004520.792:Class.firstclass.dupEntries: line 13, column 9: SelectLoop:LIST:String
20081218004520.792:Class.firstclass.dupEntries: line 15, column 21: LIST:String.add(String)
20081218004520.792:Class.firstclass.testDupEntries: line 30, column 13: returning LIST:String from method public LIST:String dupEntries(LIST:String) in 0 ms
20081218004520.792:Class.firstclass: line 20, column 28: returning from end of method static testMethod void testDupEntries() in 3 ms
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 0 out of 100
Number of DML rows: 0 out of 500
Number of script statements: 16 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20
*** Ending Test firstclass.static testMethod void testDupEntries()
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 48, column 9: DeclareVar: Decimal cst
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 48, column 9: initial value: 3861.8125
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 49, column 9: DeclareVar: String tid
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 49, column 9: initial value:
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 51, column 9: DeclareVar: SOBJECT:Site_Lessor__c lessor
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 51, column 9: initial value: Site_Lessor__c:{Name=Testing2}
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 52, column 9: Insert: SOBJECT:Site_Lessor__c
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 52, column 9: DML Operation executed in 25 ms
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 54, column 9: DeclareVar: SOBJECT:Site_Lease_Contract__c t
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 54, column 9: initial value: Site_Lease_Contract__c:{Escalation_Month__c=8.0, Auto_Renewed__c=false, Lease_Term_In_Months__c=36.0, Escalation_Amount__c=5.0, Initial_Rent__c=100.0, Renew_Term__c=12.0, Start_Date__c=2008-12-17 00:00:00, Name=Name1, Renew_Addl_Terms__c=2.0}
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 58, column 17: Insert: SOBJECT:Site_Lease_Contract__c
*** Beginning SiteLeaseEndDateTrigger on Site_Lease_Contract trigger event BeforeInsert for null
20081218004520.834:Trigger.SiteLeaseEndDateTrigger: line 3, column 5: SiteLeaseEndDateClass.SiteLeaseEndDateTrigger(LIST:SOBJECT:Site_Lease_Contract__c)
20081218004520.834:Class.SiteLeaseEndDateClass: line 1, column 8: Static initialization: SiteLeaseEndDateClass
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 9: For
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 14: DeclareVar: Integer i
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 14: initial value: 0
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 9, column 21: DeclareVar: Double mthsD
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 9, column 21: initial value: 36.0
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 10, column 21: DeclareVar: Integer mths
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 10, column 21: initial value: 36
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 11, column 21: DeclareVar: Double RmthsD
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 11, column 21: initial value: 12.0
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 12, column 21: DeclareVar: Double RtrmsD
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 12, column 21: initial value: 2.0
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 13, column 21: DeclareVar: Integer Rmths
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 13, column 21: initial value: 60
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 15, column 22: Double mthsD <= ArrayReference.Lease_Term_In_Months__c
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 16, column 22: Integer mths <= MethodInvocation
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 17, column 22: Double RmthsD <= ArrayReference.Renew_Term__c
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 18, column 22: Double RtrmsD <= ArrayReference.Renew_Addl_Terms__c
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 19, column 22: Integer Rmths <= Add
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 21, column 22: Double mthsD <= ArrayReference.Lease_Term_In_Months__c
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 22, column 22: Integer mths <= MethodInvocation
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 23, column 22: Double RmthsD <= ArrayReference.Renew_Term__c
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 24, column 22: Double RtrmsD <= ArrayReference.Renew_Addl_Terms__c
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 25, column 22: Integer Rmths <= Add
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 30, column 56: ArrayReference.End_Date__c <= Sub
20081218004520.834:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 9: Number of iterations: 1
20081218004520.834:Trigger.SiteLeaseEndDateTrigger: line 3, column 5: returning from end of method public static void SiteLeaseEndDateTrigger(LIST:SOBJECT:Site_Lease_Contract__c) in 4 ms
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 2 out of 100
Number of DML rows: 2 out of 500
Number of script statements: 24 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 59, column 17: String tid <= SOBJECT:Site_Lease_Contract__c t.Id
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 66, column 9: DeclareVar: SOBJECT:Site_Lease_Contract__c testCumCost1
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 66, column 45: SOQL query with 1 row finished in 11 ms
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 66, column 9: initial value: Site_Lease_Contract__c:{Id=a0E40000000nb5AEAQ}
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 68, column 9: system.debug(String)
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 68, column 9:
20081218004520.796:Class.SiteLeaseCumCostClass.SiteLeaseCumCostTrigger: line 70, column 9: system.assertEquals(Decimal, Decimal)
System.Exception: Assertion Failed: Expected: 3861.8125, Actual: null
Cumulative resource usage:
Number of SOQL queries: 1 out of 100
Number of query rows: 1 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 2 out of 100
Number of DML rows: 2 out of 500
Number of script statements: 28 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20
Stack frame variables and sizes:
Frame0
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 49, column 9: DeclareVar: Date dt0
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 49, column 9: initial value: 2008-12-17 00:00:00
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 50, column 9: DeclareVar: Date dt1
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 50, column 9: initial value: 2011-12-17 00:00:00
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 51, column 9: DeclareVar: Date dt2
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 51, column 9: initial value: 2011-12-16 00:00:00
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 52, column 9: DeclareVar: Date rd0
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 52, column 9: initial value: 2013-12-17 00:00:00
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 53, column 9: DeclareVar: Date rd1
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 53, column 9: initial value: 2013-12-16 00:00:00
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 55, column 9: DeclareVar: SOBJECT:Site_Lessor__c lessor
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 55, column 9: initial value: Site_Lessor__c:{Name=Testing}
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 56, column 9: Insert: SOBJECT:Site_Lessor__c
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 56, column 9: DML Operation executed in 13 ms
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 58, column 9: DeclareVar: SOBJECT:Site_Lease_Contract__c s
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 58, column 9: initial value: Site_Lease_Contract__c:{Escalation_Month__c=8.0, Auto_Renewed__c=false, Lease_Term_In_Months__c=36.0, Escalation_Amount__c=5.0, Initial_Rent__c=100.0, Renew_Term__c=12.0, Start_Date__c=2008-12-17 00:00:00, Name=Name1, Renew_Addl_Terms__c=2.0}
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 59, column 9: Insert: SOBJECT:Site_Lease_Contract__c
*** Beginning SiteLeaseEndDateTrigger on Site_Lease_Contract trigger event BeforeInsert for null
20081218004520.898:Trigger.SiteLeaseEndDateTrigger: line 3, column 5: SiteLeaseEndDateClass.SiteLeaseEndDateTrigger(LIST:SOBJECT:Site_Lease_Contract__c)
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 9: For
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 14: DeclareVar: Integer i
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 14: initial value: 0
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 9, column 21: DeclareVar: Double mthsD
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 9, column 21: initial value: 36.0
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 10, column 21: DeclareVar: Integer mths
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 10, column 21: initial value: 36
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 11, column 21: DeclareVar: Double RmthsD
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 11, column 21: initial value: 12.0
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 12, column 21: DeclareVar: Double RtrmsD
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 12, column 21: initial value: 2.0
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 13, column 21: DeclareVar: Integer Rmths
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 13, column 21: initial value: 60
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 15, column 22: Double mthsD <= ArrayReference.Lease_Term_In_Months__c
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 16, column 22: Integer mths <= MethodInvocation
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 17, column 22: Double RmthsD <= ArrayReference.Renew_Term__c
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 18, column 22: Double RtrmsD <= ArrayReference.Renew_Addl_Terms__c
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 19, column 22: Integer Rmths <= Add
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 21, column 22: Double mthsD <= ArrayReference.Lease_Term_In_Months__c
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 22, column 22: Integer mths <= MethodInvocation
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 23, column 22: Double RmthsD <= ArrayReference.Renew_Term__c
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 24, column 22: Double RtrmsD <= ArrayReference.Renew_Addl_Terms__c
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 25, column 22: Integer Rmths <= Add
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 30, column 56: ArrayReference.End_Date__c <= Sub
20081218004520.898:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 3, column 9: Number of iterations: 1
20081218004520.898:Trigger.SiteLeaseEndDateTrigger: line 3, column 5: returning from end of method public static void SiteLeaseEndDateTrigger(LIST:SOBJECT:Site_Lease_Contract__c) in 4 ms
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 2 out of 100
Number of DML rows: 2 out of 500
Number of script statements: 27 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 61, column 9: DeclareVar: SOBJECT:Site_Lease_Contract__c testEndDate1
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 61, column 45: SOQL query with 1 row finished in 6 ms
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 61, column 9: initial value: Site_Lease_Contract__c:{End_Date__c=2011-12-16 00:00:00, Id=a0E40000000nb5BEAQ}
20081218004520.876:Class.SiteLeaseEndDateClass.SiteLeaseEndDateTrigger: line 63, column 9: system.assertEquals(Date, Date)
20081218004520.876:Class.SiteLeaseEndDateClass: line 47, column 28: returning from end of method static testMethod void SiteLeaseEndDateTrigger() in 54 ms
Number of SOQL queries: 1 out of 100
Number of query rows: 1 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 2 out of 100
Number of DML rows: 2 out of 500
Number of script statements: 29 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20
*** Ending Test SiteLeaseEndDateClass.static testMethod void SiteLeaseEndDateTrigger()
Result: FAILED
Date: December 17, 2008 5:03:17 PM PST
Project name: SiteLeaseCumCostUpdate
Username:
Endpoint: www.salesforce.com
Username:
Endpoint: www.salesforce.com
Name: triggers/SiteLeaseCumCostTrigger.trigger
Action: NO ACTION
Result: FAILED
Problem: Method does not exist or incorrect signature: SiteLeaseCumCostClass.SiteLeaseCumCostTrigger(LIST:SOBJECT:Site_Lease_Contract__c)
Action: UPDATED
Result: SUCCESS
Problem: n/a
n/a
that your Cum_Cost__c field is not even getting returned with your resulting test record. Are you sure that the objects are the same in test and in production. Does the Site_Lease_Contract__c have the same fields in both production and test, and the same permissions for visibility?
In test, you will notice that your retrieved test contract looks like this:
I am surprised you are not getting some other type of error, but I would look at the metadata for both production and test first, for a possible discrepancy.
In the UI's everything looks good. Is there someplace in particular you would recommend to look....the metadata wsdl?
Open your System Log in development, available from a link at the top of every page, next to the Setup link.
in the bottom pane, paste this code, and press "Execute Apex", save the log that is generated.
Repeat in your production instance to see what the difference might be.
I just finished building the same app/objects/fields in our official production system (we have two, one for testing) and I get the exact same issues when trying to deploy to it.
I am wondering, would data type/decimal places cause any kinds of issues? I am using both currency and double and decimal fields and I am not sure how the assignment to variables and between the math calcs might be affected........I don't know..........I am grasping at straws here.
So the problem is either, the field is not getting updated, or at least in production, your test method is not returning the same record you are updating.
I am snowed in here in Michigan today, might have another look at your trigger and testmethod if I get a chance.
Not sure if you can log a case with tech support on this or not. Our company has premier support, so I use that.
I would guess you could, wouldn't hurt.
Good Luck!
You might want to add a debug line to the trigger as well, just to make sure it is getting deployed.
Something like this would do the trick: