Questions tagged [test-class]
66 questions
1
vote
2 answers
What does " java.lang.ArrayIndexOutOfBoundsException: 0" mean when running Liquibase plugin in Gradle?
I'm using Gradle 2.7 on Windows 7 (bash shell in cygwin). I want to execute my LIquibase plugin's update task before the testClasses phase, so I have
liquibase {
activities {
main {
File propsFile = new…

Dave
- 15,639
- 133
- 442
- 830
1
vote
2 answers
Salesforce: APEX Test Class for Web Service
I've created a basic frontend that dips into my force.com data by way of a Public Guest User and a webservice call. Essentially, the code is requesting the Rate (aka cost) of various items that a user may select (line 10). Everything is working on…

iTZKooPA
- 11
- 1
- 2
1
vote
1 answer
Determining the test classes in a project
I wonder is there any id or specified label to distinguish a selected class whether it is one of the standard class declarations or test class in run-time?
EDIT: I collect the entire classes from the project. I separate abstract classes,…

Hakan Özler
- 968
- 1
- 10
- 22
1
vote
1 answer
Test class constructor in c# implementing vs. ClassInitialize
I implement a test class for unit tests in VS2013
Inside that class I define the following struct and list:
private struct TestCase
{
public string Statement { set; get; }
public string ExpectedStatement { set; get; }
…

YAKOVM
- 9,805
- 31
- 116
- 217
1
vote
2 answers
Use the same TestClass with different base class
I am testing various servers,which has the same model, already tested by unit tests.
Now I want to test the real servers (not only general model).
When testing general model I created fake general server with fake adapter, which were defined in the…

user3235566
- 23
- 3
0
votes
0 answers
Default Execution Order of Test Classes in JUnit 4
Pretty much the title says it all. Note that the question is order of "classes" not the test methods inside them. Per answers here, the default execution order of test methods within a class can be configured using @FixMethodOrder and the default is…

ParSal
- 114
- 3
- 9
0
votes
0 answers
Is there any way to increase code coverage of apex class?
I have tried multiples ways to achieve more than 80% code coverage for this apex class but fail to do that. I have tried (Test.isRunningTest()) as well to cover the single query.
`public with sharing class FetchMultipleRecords {
// Method to fetch…

apz
- 1
- 1
0
votes
0 answers
can you please let me know whether it is possible to write test class to validate Layout?
can you please let me know whether it is possible to write test class to validate Layout ?
For example in task creation layout if the position of button is changed, is it possible for apex test class to detect the change and test class or method…

Hemant-2
- 3
- 1
- 3
0
votes
0 answers
I am Getting the inspection Id null in controller class while sending the email using email template & VF Component & graph is not visible in mail
Controller:
`global class FireHydrantTestTempController {
public Id inspectionId { get; set; }
public Id documentId { get; set; }
public FireHydrantTestTempController() {
try {
system.debug('Inspection Id' + this.inspectionId);
…
0
votes
0 answers
Method does not exist or incorrect signature : void
I'm getting the below error while saving the test class. Can anyone help on this please?
Error :
Method does not exist or incorrect signature: void exceptionLogFromFlow(List) from the type…

Pihu
- 1
- 1
0
votes
0 answers
How to add data in a test class Apex
I already created a test class, simple test class, but I cant give data to it, Somebody can explain me a little please here is my code, when i Run the test the cover is 14 % and I dont know how to give data, for exceptions and made it at leas the 75…
0
votes
0 answers
Test cases pass when run individually and fail when run together
Showing error in class where i am trying to get the values of static ArrayList adjacent_list_train=new ArrayList();
which is returning error like: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1. The…

Khushboo Patel
- 3
- 2
0
votes
0 answers
How do I start the test class SpringbootTwitter4jDemoApplicationTest in following spring boot project twitter4j-spring-boot-sample?
I've downloaded and cloned maven project successfully and as well imported it as maven project.
I can run the main class in tomcat serverserver console but there is test class SpringbootTwitter4jDemoApplicationTest that I want to run but I…

Orçun
- 1
- 2
0
votes
1 answer
Apex Test Class for Invocablemethods
I'm brand new to writing apex and especially test classes in apex. I can’t seem to find out how to properly call my class method in my test class it seems like. My test class is definitely not finished but I'm just starting with one of my delete…

Scott
- 15
- 1
- 6
0
votes
1 answer
Salesforce Beginner - test class for controller extension
I am new to coding and am using Salesforce.
I need help understanding how to create a test class for a controller extension.
I am clutching at straws when building the Test Class and now have 66% code coverage. Your help to adjust the below code…

Michael
- 1