function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Juan DevelopJuan Develop 

Issue with Test Class in Eclipse

I have beed trying to develop a couple of triggers using eclipse but when I try to save it on the server is not letting me. This is a production org. So I have to create test classes. My problem comes when trying to run the test class on eclipse. How do I do that?
mikefmikef
Juan:

Start with this page.

You will need to develop on a DE org so you can save in Eclipse.
Then Create your test class.
Then you want to deploy to production; the trigger and the test class.

You will not be able to save directly in production with the Eclipse took kit.
hokusaihokusai

I have the same issue in production.  I have created trigger and test class in the sandbox and have 93% coverage.  I successfully save trigger to production.  I try to save the test class to production with the IDE "Save to Server".  I get:

 

Save to server will overwrite selected components on the server.

Are you sure you want to save the selected components to server?

I say yes and it does not succeed. 

mikefmikef
You need to use the migration feature to get your test class into production.
You can't just save it to a production instance.

Go to the Force.com project you want to move to production and right click.
Choose Force.com -> Deploy to server.

It will take awhile to load, but follow the wizard.
This will get code into production.

You can also do the same thing with the ant toolkit if you like ant and the command line.
hokusaihokusai
Thanks for the fast response.  I developed in a sandbox that is out of date.  Deploy to Server is at the project level and would overwrite the production site with an old config.  Is there a way to deploy only one class instead of the the whole project?
mikefmikef
yep when you deploy you will get a list of triggers, classes etc and you select the ones you want to deploy.
hokusaihokusai
Perfect thanks!
jcherian2jcherian2
I am not getting the "Deploy to Server" option when I right click on the Project I am trying to deploy and choose the Force.com menu item. I only have the following options:

Remove Force.com Nature

Work Offline

Execute Anonymous

Open Force.com Perspective

Refresh from Server

Show in Salesforce Web


Thanks!


Message Edited by jcherian2 on 09-26-2008 10:11 AM