public class MockSystemReader extends SystemReader
SystemReader
for tests.Constructor and Description |
---|
MockSystemReader() |
Modifier and Type | Method and Description |
---|---|
void |
clearProperties() |
MonotonicClock |
getClock() |
long |
getCurrentTime() |
DateFormat |
getDateTimeInstance(int dateStyle,
int timeStyle) |
String |
getenv(String variable) |
String |
getHostname() |
Locale |
getLocale() |
String |
getProperty(String key) |
SimpleDateFormat |
getSimpleDateFormat(String pattern) |
TimeZone |
getTimeZone() |
int |
getTimezone(long when) |
FileBasedConfig |
openSystemConfig(Config parent,
FS fs) |
FileBasedConfig |
openUserConfig(Config parent,
FS fs) |
void |
setCurrentPlatform()
Assign some properties for the currently executing platform
|
void |
setProperty(String key,
String value) |
void |
setUnix()
Emulate Unix
|
void |
setWindows()
Emulate Windows
|
void |
tick(int secDelta)
Adjusts the current time in seconds.
|
checkPath, checkPath, getInstance, getSimpleDateFormat, isMacOS, isWindows, setInstance, setPlatformChecker
public void clearProperties()
public String getenv(String variable)
getenv
in class SystemReader
public String getProperty(String key)
getProperty
in class SystemReader
public FileBasedConfig openUserConfig(Config parent, FS fs)
openUserConfig
in class SystemReader
public FileBasedConfig openSystemConfig(Config parent, FS fs)
openSystemConfig
in class SystemReader
public String getHostname()
getHostname
in class SystemReader
public long getCurrentTime()
getCurrentTime
in class SystemReader
public MonotonicClock getClock()
getClock
in class SystemReader
public void tick(int secDelta)
secDelta
- number of seconds to add to the current time.public int getTimezone(long when)
getTimezone
in class SystemReader
public TimeZone getTimeZone()
getTimeZone
in class SystemReader
public Locale getLocale()
getLocale
in class SystemReader
public SimpleDateFormat getSimpleDateFormat(String pattern)
getSimpleDateFormat
in class SystemReader
public DateFormat getDateTimeInstance(int dateStyle, int timeStyle)
getDateTimeInstance
in class SystemReader
public void setCurrentPlatform()
public void setWindows()
public void setUnix()
Copyright © 2018 Eclipse JGit Project. All rights reserved.