You need to sign in to do that
Don't have an account?

Accessing static fields from a test class
I'm trying to access static fields of a class from within a test class, with a statement like this:
genericObject.genericField = outerClass.staticVariable;
And the Force IDE is telling me 'Variable does not exist' when I try and execute the test. I'm not able to find anything about special considerations when accessing static class members within tests. Am I doing something fundamentally wrong here?
So it appears that test cases you run locally still somehow look to the server for other classes? Something like that ... after I removed all my compile errors from my test class and saved the whole project to the server, it ran fine.
All Answers
Hi,
Please check if the 'genericField' is static as well.
Thanks.
public ??
Declaring the variable as 'static varName' should be fine. You can make the variable as 'public' as well - should not be a problem.
So it appears that test cases you run locally still somehow look to the server for other classes? Something like that ... after I removed all my compile errors from my test class and saved the whole project to the server, it ran fine.
lol that doesnt happen