Package samples.system
Class SystemClassUser
- java.lang.Object
-
- samples.system.SystemClassUser
-
public class SystemClassUser extends Object
Class used to demonstrate PowerMock's ability to mock system classes.
-
-
Constructor Summary
Constructors Constructor Description SystemClassUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyProperty(String to, String from)voiddoMoreComplicatedStuff()ProcessexecuteCommand()Stringformat(String one, String args)StringgeneratePerishableToken()InetAddressgetLocalHost()StringgetSystemProperty()intlengthOf(StringBuilder to)StringBuildernewStringBuilder()URLnewURL(String anUrl)StringperformEncode()voidshuffleCollection(List<?> list)voidthreadSleep()URLConnectionuseURL(URL url)
-
-
-
Method Detail
-
threadSleep
public void threadSleep() throws InterruptedException- Throws:
InterruptedException
-
performEncode
public String performEncode() throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
executeCommand
public Process executeCommand() throws IOException
- Throws:
IOException
-
getSystemProperty
public String getSystemProperty() throws IOException
- Throws:
IOException
-
doMoreComplicatedStuff
public void doMoreComplicatedStuff() throws IOException- Throws:
IOException
-
copyProperty
public void copyProperty(String to, String from) throws IOException
- Throws:
IOException
-
format
public String format(String one, String args) throws IOException
- Throws:
IOException
-
newURL
public URL newURL(String anUrl) throws MalformedURLException
- Throws:
MalformedURLException
-
newStringBuilder
public StringBuilder newStringBuilder()
-
shuffleCollection
public void shuffleCollection(List<?> list)
-
useURL
public URLConnection useURL(URL url) throws IOException
- Throws:
IOException
-
getLocalHost
public InetAddress getLocalHost() throws IOException
- Throws:
IOException
-
generatePerishableToken
public String generatePerishableToken()
-
lengthOf
public int lengthOf(StringBuilder to)
-
-