Status: Accepted
Owner: ----
Labels: Type-Enhancement Priority-Medium
New issue 680 by pekka.klarck: Support JVM properties
http://code.google.com/p/robotframework/issues/detail?id=680
JVM has some useful built-in properties and supports also custom properties:
$ jython -Dmyprop='my value'
Jython 2.5.1rc3 (Release_2_5_1rc3:6809, Sep 23 2009, 21:40:34)
[Java HotSpot(TM) Server VM (Sun Microsystems Inc.)] on java1.6.0_20
Type "help", "copyright", "credits" or "license" for more information.
from java.lang import System
System.getProperty('myprop')
u'my value'
System.getProperty('os.name')
u'Linux'
Robot Framework should support these properties somehow. Implementing at
least one of these features would be nice:
1) Allow using properties directly using variable syntax. We already
support environment variables in format `%{NAME}`, and it would probably be
safe to use this syntax with properties too. The logic could go so that if
no environment variable is found, and we are running on Jython, a property
with the same name is searched. This would be trivial to implement.
2) Have special keywords for getting and setting properties, possibly also
for loading external property files. If there's more than one or two
keywords, we should probably create a separate library instead of adding
them to `BuiltIn`.
What do others think? Should this be done already in 2.5.5?