You need to sign in to do that
Don't have an account?
Bhushan Singh 13
while deploying using Force.com migration tool getting 0% code coverage
Hi ,
I am using Force.com migration tool , I have been created Apex class and Test class, in Force.com IDE test coverage is showing 100% but while deploying its failling and throwing the error 0% code coverage. Please help me if any one has idea about that.
Thanks & Regards
Bhushan Singh
I am using Force.com migration tool , I have been created Apex class and Test class, in Force.com IDE test coverage is showing 100% but while deploying its failling and throwing the error 0% code coverage. Please help me if any one has idea about that.
Thanks & Regards
Bhushan Singh
By Default, salesforce will run all local test classes when you are running the test classes. Please share the error message to find the reason. I thinking that your test class is failing in prod.
Here is the reference documentation, look around page 17 (Deploying Code)http://www.salesforce.com/us/developer/docs/daas/salesforce_migration_guide.pdf
Thanks and Regards
Rishi(1044)
Kloudrac Software Private Limited
I am deploying in the developer organization , please find the error below -
C:\salesforce_ant_38.0\sample\build.xml:60:
*********** DEPLOYMENT FAILED ***********
Request ID: 0Af2800000cq2kPCAQ
Code Coverage Failures:
1. Class: ApexDemo -- Test coverage of selected Apex Class is 0%, at least 75% test coverage is req
uired
*********** DEPLOYMENT FAILED ***********
Kindly check all the Fields which used in the Classes are present in the Production, Second try to deploy using the Change set using Run Specfied Test using the Test Class Name.
Thanks
Vinuthh S
Are you using Sandbox "Data" to cover test class? Please create your own data in test class to deploy.
Thanks,
Gaurav
actually i am trying to deploy in Developer Organization and i have created the own data in Test class, please verfy it .
public with sharing class ApexDemo {
public static Integer getCalculatedValue () {
//Method definition and body
//do some calculation
Integer myValue = 0; //Class Member variable
String myString = 'myvalue'; //Class Member variable
myValue = myValue+10;
return myValue;
}
}
Test Class -
@isTest
public class ApexDemoTest {
public static testmethod void getCalculatedValuetest()
{
ApexDemo apd = new ApexDemo();
System.assertEquals(getvalue(), ApexDemo.getCalculatedValue());
}
public static Integer getvalue()
{
Integer myValue = 0;
String myString = '';
return myValue+10;
}
}
Thanks & Regards
Bhushan Singh
It seems fine,
Could you try re-uploading, sometimes in salesforce it didnt run test class properly.
Thanks