Hi,

In my unit tests, I was checking the environment through
SystemProperty.environment.value(), to check it's equal to
SystemProperty.Environment.Value.Development.
In some older versions of the SDK, it used to work, but since a few versions
ago, it started failing.

I'm using the LocalServiceTestHelper helper class, to setup a local
environment, calling the setUp() / tearDown() methods, configuring the
various services I need, etc.
But when I'm calling SystemProperty.environment.value(), I get an NPE along
the lines of:

java.lang.NullPointerException: Name is null
at java.lang.Enum.valueOf(Enum.java:195)
at
com.google.appengine.api.utils.SystemProperty$Environment$Value.valueOf(SystemProperty.java:70)
at
com.google.appengine.api.utils.SystemProperty$Environment.value(SystemProperty.java:91)

I would expect SystemProperty.environment.value() to return
the SystemProperty.Environment.Value.Development value.
But it doesn't -- and I think it used to work a while ago.

To circumvent this, I have to explicitely call:
SystemProperty.environment.set("Development")
to manually set the environment to Development, in my setUp() method.

Is this expected behavior, is it a bug, or am I missing something?

Thanks for your attention.

-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to