How to delete a Test Class WITHOUT using eclipse

I cannot install Eclipse, even if I wanted to. It is not approved software for my org.

How can test classes be deleted from production, using deployments?
There no ‘active’ checkbox when I am editing the classes in sandbox mode, so I can’t just deactivate the test class, and i cant deploy a deleted class to prod… how the heck is this done?

I dont want to use ANT or special software. SF must have a native way to achieve this. And if not… then I am very disappointed in humanity.

Answer

You can do this with only the software that comes installed with Windows/Linux/Mac. These instructions will be for Windows.

Create a Folder

Make a folder on your desktop. You’ll want this so you can keep your files in order.

Create package.xml

Open Notepad (Start > Accessories > Notepad). Copy the following text into the text editor:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <version>30.0</version>
</Package>

Save this file as package.xml within the folder you created. NOTE: You have to change “Save as type” to “All files (*.*)”, or Notepad will “helpfully” add a “.txt” extension that we don’t want.

Create destructiveChanges.xml

Create a new file in Notepad (File > New). Copy the following text into your text editor:

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>SomeTestClass</members>
        <name>ApexClass</name>
    </types>
    <version>30.0</version>
</Package>

Change SomeTestClass to the class you want to delete.

Save this file in the folder you created as destructiveChanges.xml (note the capital C in “changes”). Again, make sure that you saved it as “All files (*.*)”.

At this point, you have two files in your folder. Open the folder, select both XML files, right-click, and choose “Send To > Compressed Folder”. The default name is fine.

You’re all set up at this point. Now, you just need to deploy the file.

Go to http://workbench.developerforce.com/, login using your production credentials, then choose “Migration > Deploy”, upload your file, and confirm the process.

See this article (not mine: http://carvingintheclouds.blogspot.com/2013/12/deploying-destructive-changes-using.html) for some pictures and nice cloud-like palettes.

Attribution
Source : Link , Question Author : DownstairsB , Answer Author : sfdcfox

Leave a Comment