• kyasu
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies

Hi,

I am writing "send e-mail program" using sendEmail method.

 

I want to see error message about failure of sending e-mail.

 

How can I make e-mail to be failure ?

  • August 17, 2010
  • Like
  • 0

hi,

I writeing a testMethod for "Batch class".

I want to test "Batch class" with only "test data created in testMethod".

But existing records are tested too when execute test.

 

I want to test only "test data".

 

How to code testMethod ?

  • August 11, 2010
  • Like
  • 0

こんにちは


現在、次のようなバッチクラスのテストメソッドを作成しています。


BatchClass:

global class BatchClass implements Database.Batchable<sObject> {
	public String query = 'Select c.Id, c.Name, From CustomObject__c c;

	global Database.QueryLocator start(Database.BatchableContext bc) {
        	return Database.getQueryLocator(query);
        } 
........

}

BatchClassTest:

 

 public class BatchClassTest {
    static testMethod void testBatch() {         
        CustomObject__c co = new CustomObject__c(Id = 'id', Name = 'name');   

        BatchClass bc = new BatchClass();
        bc.query = 'Select c.Id, c.Name From CustomObject__c c Limit 200;
        Test.startTest();
        Database.executeBatch(bc, 200);
        Test.stopTest();
    }
}

 

しかし、作成したものを、「テストを実行」するとexecute以降が読まれません。

 

デバッグログには、以下のようなことが書かれていました。


デバッグログ:

No more than one executeBatch can be called from within a testmethod. Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.

 


色々と似たような例を探したのですが、なかなか糸口が見つかりません。

どうすれば、execute以降も読まれるようになるのでしょうか。
お願い致します。

  • August 10, 2010
  • Like
  • 0

When Batch Apex is executed, I can see execution result ( Job Type, Status, Total Batches, ...  ) in Apex Job.

But, there is not a detail of the log about excuted Batch Apex.

 

I know the log print in Debug Log.  

But, non-sysadmin can not see it.

I want to enable non-sysadmin to see the log.

 

I guess 

If the detail of the log print in Apex Job,    non-sysadmin can see it.

 

Can I get the detail of the log in Apex Job ?

  • August 09, 2010
  • Like
  • 0

Hi,

I am writing "send e-mail program" using sendEmail method.

 

I want to see error message about failure of sending e-mail.

 

How can I make e-mail to be failure ?

  • August 17, 2010
  • Like
  • 0

hi,

I writeing a testMethod for "Batch class".

I want to test "Batch class" with only "test data created in testMethod".

But existing records are tested too when execute test.

 

I want to test only "test data".

 

How to code testMethod ?

  • August 11, 2010
  • Like
  • 0

こんにちは


現在、次のようなバッチクラスのテストメソッドを作成しています。


BatchClass:

global class BatchClass implements Database.Batchable<sObject> {
	public String query = 'Select c.Id, c.Name, From CustomObject__c c;

	global Database.QueryLocator start(Database.BatchableContext bc) {
        	return Database.getQueryLocator(query);
        } 
........

}

BatchClassTest:

 

 public class BatchClassTest {
    static testMethod void testBatch() {         
        CustomObject__c co = new CustomObject__c(Id = 'id', Name = 'name');   

        BatchClass bc = new BatchClass();
        bc.query = 'Select c.Id, c.Name From CustomObject__c c Limit 200;
        Test.startTest();
        Database.executeBatch(bc, 200);
        Test.stopTest();
    }
}

 

しかし、作成したものを、「テストを実行」するとexecute以降が読まれません。

 

デバッグログには、以下のようなことが書かれていました。


デバッグログ:

No more than one executeBatch can be called from within a testmethod. Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.

 


色々と似たような例を探したのですが、なかなか糸口が見つかりません。

どうすれば、execute以降も読まれるようになるのでしょうか。
お願い致します。

  • August 10, 2010
  • Like
  • 0

When Batch Apex is executed, I can see execution result ( Job Type, Status, Total Batches, ...  ) in Apex Job.

But, there is not a detail of the log about excuted Batch Apex.

 

I know the log print in Debug Log.  

But, non-sysadmin can not see it.

I want to enable non-sysadmin to see the log.

 

I guess 

If the detail of the log print in Apex Job,    non-sysadmin can see it.

 

Can I get the detail of the log in Apex Job ?

  • August 09, 2010
  • Like
  • 0