+ Start a Discussion
ShawnFShawnF 

External entry point error

Can someone provide a definition for the "External entry point" error message?

 

What is an "External entry point"?

 

Or, better yet, what are typical causes for the "External entry point" error message? And what are typical solutions to the "External entry point" error message?

EnthEnth

I can't answer the question directly other than to advise you to check your debug log, the external entry point is usually a symptom of another exception, such as Null Pointer Exception.

ShawnFShawnF

Will definitely check the debug log. Thanks for replying.

 

This is my test method currently giving me the "External entry point" error message. The failure report tells me it errors on the very last line (the system.assertEquals line) of my method.

 

@isTest
private class TestMyPropertyExtension {
        static testmethod void testGetAllPropertiesPositive(){

            Property__c p = new Property__c();
                p.name = 'foo';
                p.Market__c = 'm1';
                p.Country__c = 'test';
                insert p;        
     
            // Use the vf page in my org named 'LocatorListing'
            PageReference pageRef = Page.LocatorListing;
            Test.setCurrentPage(pageRef);

            // Set the country param of the current vf page to the market in my test Property
            ApexPages.currentPage().getParameters().put('country', p.Country__c);
            MyPropertyExtension controller = new MyPropertyExtension();

            //Call controller.getProperties() and assert the list contains the expected records.
            List propRecords = controller.getAllProperties();
                system.assertEquals(propRecords.size(),1);
        }
}

 

The stack trace message is:

 

Class.TestMyPropertyExtension.testGetAllPropertiesPositive: line 133, column 17 External entry point

 

The  message is:

 

System.AssertException: Assertion Failed: Expected: 0, Actual: 1
EnthEnth

OK, so that seems straightforward doesn't it, your code is failing the unit test ?

 

If you're sure the code is OK then the reason for this may be following. When you try and unit test an Extension (I assume that's what you have, need to see the VG <apex:page>) you need to create the StandardController first. For example:

 

// Create a dummy object for our controller
Clone_Object__c obj = new Clone_Object__c();

// Create the standard controller
ApexPages.StandardSetController sc = new ApexPages.StandardSetController(obj);

// Create our extension controller
CloneRecordController controller = new CloneRecordController(sc);

// Now call your methods on controller

 HTH