• cjmarchi1
  • NEWBIE
  • 25 Points
  • Member since 2012

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

hello, 

it's been some days now I havent been able to deploy a very simple trigger to server. Now it says that there is no coverage to deploy it (42% so far) whenever I try to deploy to server both my trigger and test class.

I am using Enterprise Edition for nonprofits and Force.com IDE version 25.

Before this problem, I was stuck by this problem described down here: (http://boards.developerforce.com/t5/General-Development/Unable-to-refresh-resource/td-p/205678/page/2
I managed this first problem reinstalling eclipse and force.com IDE, and switching workspaces to the same workspace, and the message error described above disapeared. 

Now I am stuck by this coverage problem: 
************** 
*** Deployment Log *** 
Result: FAILED 
Date: August 21, 2012 2:44:43 PM BRT 

# Deployed From: 
Project name: IDS 
Username: cjmarchi1@uol.com.br 
Endpoint: www.salesforce.com 

# Deployed To: 
Username: cjmarchi1@uol.com.br 
Endpoint: www.salesforce.com 

# Deploy Results: 
File Name: classes/PreencheNomeContaEmContatoClass.cls 
Full Name: PreencheNomeContaEmContatoClass 
Action: UPDATED 
Result: SUCCESS 
Problem: n/a 

File Name: package.xml 
Full Name: package.xml 
Action: UPDATED 
Result: SUCCESS 
Problem: n/a 

File Name: triggers/PreencheNomeContaEmContato.trigger 
Full Name: PreencheNomeContaEmContato 
Action: UPDATED 
Result: SUCCESS 
Problem: n/a 

# Test Results: 

Run Failures: 
CMSConsoleActionsController.t1 System.QueryException: List has no rows for assignment to SObject 
CMSFoldersController.t1 System.QueryException: List has no rows for assignment to SObject 
CMSForceConsoleController.t1 System.QueryException: List has no rows for assignment to SObject 
CMSForceSetupController.t1 System.AssertException: Assertion Failed 
CMSSiteDetailController.t1 System.QueryException: List has no rows for assignment to SObject 
contentblockcomponentController.t1 System.QueryException: List has no rows for assignment to SObject 
FormItemIncludeController.t1 System.QueryException: List has no rows for assignment to SObject 
FriendlyURLs.t1 System.QueryException: List has no rows for assignment to SObject 
HomePageController.t1 System.QueryException: List has no rows for assignment to SObject 
PageBrowserController.t1 System.QueryException: List has no rows for assignment to SObject 
pageController.t1 System.QueryException: List has no rows for assignment to SObject 
PageItemEditExtension.t1 System.QueryException: List has no rows for assignment to SObject 
PageItemIncludeController.t1 System.QueryException: List has no rows for assignment to SObject 
PreviewPageController.t1 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t2 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t3 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t4 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t5 System.QueryException: List has no rows for assignment to SObject 
CleanupUnusedContentBlockItems A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
PreventFolderOrphans A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
PreventTemplateOrphans A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
SetAsHomePage A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
SetHomePageSiteId A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
PreventActiveWebFormDelete A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
A cobertura média do teste em todas as classes e acionadores do Apex é de 42%, pelo menos 75% de cobertura de teste são necessários. 
**************



The code for my trigger:
trigger PreencheNomeContaEmContato on Contact (before insert) { 
for(Contact a : Trigger.New) 
a.AccountId = '001E000000JKUmr'; 
}


The code for my test class:


@isTest 
private class PreencheNomeContaEmContatoClass { 

static TestMethod void PreencheNomeContaEmContatoMethod(){ 
string test0Value = 'testeeeeeeee12345'; 
insereContato(test0Value); 
Contact testObj = [Select Name, AccountId from Contact where Name = :test0Value]; 
System.assertNotEquals(testObj, null); 


private static void insereContato(String field2Value) 

Contact obj = new Contact(); 
obj.LastName = field2Value; 
insert obj; 


}

 

hello, 

it's been some days now I havent been able to deploy a very simple trigger to server. Now it says that there is no coverage to deploy it (42% so far) whenever I try to deploy to server both my trigger and test class.

I am using Enterprise Edition for nonprofits and Force.com IDE version 25.

Before this problem, I was stuck by this problem described down here: (http://boards.developerforce.com/t5/General-Development/Unable-to-refresh-resource/td-p/205678/page/2
I managed this first problem reinstalling eclipse and force.com IDE, and switching workspaces to the same workspace, and the message error described above disapeared. 

Now I am stuck by this coverage problem: 
************** 
*** Deployment Log *** 
Result: FAILED 
Date: August 21, 2012 2:44:43 PM BRT 

# Deployed From: 
Project name: IDS 
Username: cjmarchi1@uol.com.br 
Endpoint: www.salesforce.com 

# Deployed To: 
Username: cjmarchi1@uol.com.br 
Endpoint: www.salesforce.com 

# Deploy Results: 
File Name: classes/PreencheNomeContaEmContatoClass.cls 
Full Name: PreencheNomeContaEmContatoClass 
Action: UPDATED 
Result: SUCCESS 
Problem: n/a 

File Name: package.xml 
Full Name: package.xml 
Action: UPDATED 
Result: SUCCESS 
Problem: n/a 

File Name: triggers/PreencheNomeContaEmContato.trigger 
Full Name: PreencheNomeContaEmContato 
Action: UPDATED 
Result: SUCCESS 
Problem: n/a 

# Test Results: 

Run Failures: 
CMSConsoleActionsController.t1 System.QueryException: List has no rows for assignment to SObject 
CMSFoldersController.t1 System.QueryException: List has no rows for assignment to SObject 
CMSForceConsoleController.t1 System.QueryException: List has no rows for assignment to SObject 
CMSForceSetupController.t1 System.AssertException: Assertion Failed 
CMSSiteDetailController.t1 System.QueryException: List has no rows for assignment to SObject 
contentblockcomponentController.t1 System.QueryException: List has no rows for assignment to SObject 
FormItemIncludeController.t1 System.QueryException: List has no rows for assignment to SObject 
FriendlyURLs.t1 System.QueryException: List has no rows for assignment to SObject 
HomePageController.t1 System.QueryException: List has no rows for assignment to SObject 
PageBrowserController.t1 System.QueryException: List has no rows for assignment to SObject 
pageController.t1 System.QueryException: List has no rows for assignment to SObject 
PageItemEditExtension.t1 System.QueryException: List has no rows for assignment to SObject 
PageItemIncludeController.t1 System.QueryException: List has no rows for assignment to SObject 
PreviewPageController.t1 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t2 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t3 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t4 System.QueryException: List has no rows for assignment to SObject 
TestCMSForceTriggers.t5 System.QueryException: List has no rows for assignment to SObject 
CleanupUnusedContentBlockItems A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
PreventFolderOrphans A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
PreventTemplateOrphans A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
SetAsHomePage A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
SetHomePageSiteId A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
PreventActiveWebFormDelete A cobertura do teste do Apex selecionado Trigger é de 0%. São necessários pelo menos 1% de cobertura do teste 
A cobertura média do teste em todas as classes e acionadores do Apex é de 42%, pelo menos 75% de cobertura de teste são necessários. 
**************



The code for my trigger:
trigger PreencheNomeContaEmContato on Contact (before insert) { 
for(Contact a : Trigger.New) 
a.AccountId = '001E000000JKUmr'; 
}


The code for my test class:


@isTest 
private class PreencheNomeContaEmContatoClass { 

static TestMethod void PreencheNomeContaEmContatoMethod(){ 
string test0Value = 'testeeeeeeee12345'; 
insereContato(test0Value); 
Contact testObj = [Select Name, AccountId from Contact where Name = :test0Value]; 
System.assertNotEquals(testObj, null); 


private static void insereContato(String field2Value) 

Contact obj = new Contact(); 
obj.LastName = field2Value; 
insert obj; 


}