• ildiavolorosso
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I'm hoping people can think me through a bit of a pickle I've gotten myself into. I have a custom controller for a relatively non-standard Visualforce page that simply iterates through HTTP POST or GET parameters and looks for specific patterns. In a nutshell, the action in question looks like this:

      public PageReference reconcile() {
            // get request parameters
            Map<String, String> parameters = ApexPages.currentPage().getParameters();
            for (String pName: parameters.keySet()) {
                    String pVal = parameters.get(pName);
                    System.debug('PARAM NAME: ' + pName + ' PARAM VAL:' + pVal);
                    
                    // parse the Assessment ID out of the parameter name
                    if (pName.contains('reconcile')) {
                        String assesmentId = pName.replace('reconcile', '');
                        System.debug('RECONCILING ASSESSMENT ID: ' + assesmentId);
                        
// ...work gets done here
                        }                                    
                    }
            }
}

 

So rather than storing state in the controller, I work iteratively. But now I'm having trouble achieving code coverage. My unit test looks something like this:

 

 

       PageRef pageRef = Page.ReconcilePayments; // this is the page my controller is attached to
       Test.setCurrentPage(pageRef);
       ReconcilePaymentController recController = new ReconcilePaymentController();
       System.assert(recController != null);

Now, I can call the reconcile() action directly, but in order to achieve test coverage (and, more importantly,  a good meaningful test) I need to include the parameters and I don't see a way to do that in the pageRef methods...pageRef seems to represent the result of invoking a page, and does not include the request.

 

How would you approach getting this unit test done?

 

 

 

Hi folks. A recent Windows Security update left my IDE hosed. I've been trying like mad to get things working, including reinstalling both the JRE and IDE from scratch. But after running the self-extractor, I get the following error when I go to run the installer:

IDE Installer Error

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I've tried editing my PATH and CLASSPATH system variables, but with no luck. What gives? Any idea how I can get this thing running? The same thing happens when I try to run Eclipse. I've tried Googling for the issue, and have had some hits, but none of the hits resolves this so far...

I'm hoping people can think me through a bit of a pickle I've gotten myself into. I have a custom controller for a relatively non-standard Visualforce page that simply iterates through HTTP POST or GET parameters and looks for specific patterns. In a nutshell, the action in question looks like this:

      public PageReference reconcile() {
            // get request parameters
            Map<String, String> parameters = ApexPages.currentPage().getParameters();
            for (String pName: parameters.keySet()) {
                    String pVal = parameters.get(pName);
                    System.debug('PARAM NAME: ' + pName + ' PARAM VAL:' + pVal);
                    
                    // parse the Assessment ID out of the parameter name
                    if (pName.contains('reconcile')) {
                        String assesmentId = pName.replace('reconcile', '');
                        System.debug('RECONCILING ASSESSMENT ID: ' + assesmentId);
                        
// ...work gets done here
                        }                                    
                    }
            }
}

 

So rather than storing state in the controller, I work iteratively. But now I'm having trouble achieving code coverage. My unit test looks something like this:

 

 

       PageRef pageRef = Page.ReconcilePayments; // this is the page my controller is attached to
       Test.setCurrentPage(pageRef);
       ReconcilePaymentController recController = new ReconcilePaymentController();
       System.assert(recController != null);

Now, I can call the reconcile() action directly, but in order to achieve test coverage (and, more importantly,  a good meaningful test) I need to include the parameters and I don't see a way to do that in the pageRef methods...pageRef seems to represent the result of invoking a page, and does not include the request.

 

How would you approach getting this unit test done?

 

 

 

Hi,

 

I wrote trigger for Chatter . This trigger basically send  an email to a person whatever we right on their wall, but the main problem is that whenever I write on my own wall this trigger doesn't execute/ work , It should work and send email to me also. Right now I am comparing  userId of userobject  with ParentId of UserFeed. 

 

Can anyone help on this issue. How can I solve this problem.

 

Thanks,

Rajiv

  • April 09, 2011
  • Like
  • 0

Hi folks. A recent Windows Security update left my IDE hosed. I've been trying like mad to get things working, including reinstalling both the JRE and IDE from scratch. But after running the self-extractor, I get the following error when I go to run the installer:

IDE Installer Error

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I've tried editing my PATH and CLASSPATH system variables, but with no luck. What gives? Any idea how I can get this thing running? The same thing happens when I try to run Eclipse. I've tried Googling for the issue, and have had some hits, but none of the hits resolves this so far...