• TechNINJA
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Have a test method for an apex batch and for some reason it is not calling the "Start()" or "Execute()" when i run the tests. If I run the apex batch via execute anonyomous the apex batch runs as expected. Here's my test method:

start():

 

global Database.QueryLocator start(Database.BatchableContext BC){
ALMLogUtils.log(CLASSNAME,'start() called !!!!');
....
..
}

 testMethod:

 

 

 

 

	public static testmethod void testActionAlertBatch(){
		TestDataHelper testData = new TestDataHelper();
        String acctNbr = '123456';
        User usr = testData.createLeaderUser(acctNbr);

		usr.Action_Alert_Enabled__c=true;
		usr.Action_Alert_1__c='Orders Not submitted';
		usr.Action_Alert_Frequency__c='Daily';
		update usr;
        List<Leader_Downline_Summary__c> ldrData = testData.createLdrSmryData(usr.MRKT_ID_ACCT_NR_KEY__c,usr.Id);
		
		Test.startTest();
		ActionAlertBatch alertBatch = new ActionAlertBatch(testData.market,System.now());
		Database.executeBatch(alertBatch,200);
		List<Action_Alert__c> alerts = [select Id from Action_Alert__c where OwnerId=:usr.Id];
		System.assert(alerts.size()==1); 
		System.assert(alerts[0].Type__c=='Orders Not submitted'); 
	}

 

 

Logs when running the test method:

 

15:2:28.189 (2083121000)|CONSTRUCTOR_EXIT|[140,33]|<Constructor>(SOBJECT:Market__c, Datetime)
15:2:28.189 (2083193000)|STATEMENT_EXECUTE|[141,3]|Database.executeBatch(ActionAlertBatch, Integer)
15:2:28.189 (2083324000)|METHOD_ENTRY|[141,3]|Database.executeBatch(ActionAlertBatch, Integer)
15:2:28.290 (2184134000)|METHOD_EXIT|[141,3]|Database.executeBatch(ActionAlertBatch, Integer)
15:2:28.290 (2184217000)|STATEMENT_EXECUTE|[142,3]|DeclareVar: LIST<Action_Alert__c> alerts
15:2:28.290 (2184250000)|SOQL_EXECUTE_BEGIN|[142,34]|Aggregations:0|select Id from Action_Alert__c where OwnerId=:usr.Id
15:2:28.320 (2214411000)|SOQL_EXECUTE_END|[142,34]|Rows:0
15:2:28.320 (2214499000)|HEAP_ALLOCATE|[142,34]|Bytes:4
15:2:28.320 (2214550000)|HEAP_ALLOCATE|[142,34]|Bytes:4
15:2:28.320 (2214633000)|STATEMENT_EXECUTE|[143,3]|System.assert(Boolean)
15:2:28.320 (2214751000)|METHOD_ENTRY|[143,3]|System.assert(Boolean)
15:2:28.321 (2214808000)|METHOD_ENTRY|[143,17]|LIST<Action_Alert__c>.size()
15:2:28.321 (2214838000)|METHOD_EXIT|[143,17]|LIST<Action_Alert__c>.size()
15:2:28.321 (2214885000)|EXCEPTION_THROWN|[143,3]|System.AssertException: Assertion Failed

 Not sure what I'm missing. 

 

 

Is there a easy way to show pop up from a visual force page, without linking it to another visual force page.

I want to show some information .

 

I have seen example of yahoo model dialogue box.

 

I am in process of creating  a 100% native application, I do nt want to call to any external js libraries.