Skip to main content

Set Up Test Data for an Entire Test Class - Spring15

You can reduce test execution times especially when you’re working with many records. Test setup (@testSetup) methods enable you to create common test data easily and efficiently. By setting up records once for the class, you don’t need to re-create records for each test method. If a test class contains a test setup method, the testing framework executes the test setup method first, before any test method in the class. Records that are created in a test setup method are available to all test methods in the test class and are rolled back at the end of test class execution.

Comments

  1. This way my pal Wesley Virgin's story begins in this SHOCKING and controversial video.

    As a matter of fact, Wesley was in the army-and soon after leaving-he unveiled hidden, "self mind control" secrets that the CIA and others used to obtain anything they want.

    THESE are the EXACT same secrets many famous people (especially those who "became famous out of nowhere") and top business people used to become wealthy and famous.

    You've heard that you utilize only 10% of your brain.

    That's because the majority of your BRAINPOWER is UNCONSCIOUS.

    Perhaps this expression has even taken place IN YOUR own head... as it did in my good friend Wesley Virgin's head 7 years back, while riding an unregistered, trash bucket of a vehicle without a license and with $3 on his debit card.

    "I'm absolutely frustrated with going through life paycheck to paycheck! When will I finally make it?"

    You took part in those thoughts, isn't it right?

    Your success story is waiting to be written. All you have to do is in YOURSELF.

    WATCH WESLEY SPEAK NOW

    ReplyDelete

Post a Comment

Popular posts from this blog

Mashup Integration in Salesforce

During preparation for TA certification exam, I came across a word Mashup for integration a number of times. I explored about it and below is description:- Mashups, sometimes called “composites,” are hybrid applications created by bringing together several data sources and Web services to create a new application or to add value to an existing application. Behind the scenes, mashups may require different levels of integration, depending on whether the mashed-up data is only meant to be viewed, whether it can be edited, and whether data is actually transferred between systems. There are three types of mashup:- Client Presentation Mashup - In this type of mashup the integration takes place strictly at the visual level. It makes possible to view data from two or more applications in a browser,  without actually moving data between the applications. Example - Google Maps. Client Service Mashup - As mashups evolve, they are becoming more complex and sophisticated. Client ser

Grant Access Using Hierarchies

Problem There is a custom object say 'XYZ' and OWD for this is set to ' Private ', which means record of this can be seen by only owner and users above in role-hierarchy and territory. However, to share this with other user, we can manually share it. The problem is that I don't want other users, who are above in role-hierarchy and territory of the user with whom record has shared, can see it. Solution We can un-check ' Grant Access Using Hierarchies ' check box for object 'XYZ' on 'Sharing Settings' page. We can go to Setup >> Security Controls >> Sharing Settings and click on ' Edit ' button. On the edit page, we can un-check ' Grant Access Using Hierarchies ' for required object.  Major uses of 'Grant Access Using Hierarchies' are:- If you disable the Grant Access Using Hierarchies option, sharing with a role or territory and subordinates only shares with the users directly asso

ReadOnly Annotation

Use Case:- You want to show up to 10000 record on single VF page. Count of records based upon some business requirement where number of records could go up to 1 million. So far, it was not possible to achieve above in VF page because of following limitations:- The maximum number of items in a collection that can be iterated over using components such as <apex:dataTable> , <apex:dataList> , and <apex:repeat> is 1000. Normally, queries for a single Visualforce page request may not retrieve more than 50,000 rows. Solution:- But with API version 23.0 , salesforce has introduced ' ReadOnly ' annotation which has following functionality/restriction:- The @ReadOnly annotation allows you to perform unrestricted queries against the Force.comdatabase. All other limits still apply. It's important to note that this annotation, while removing the limit of the number of returned rows for a request, blocks you from performing the following operations