lp.wrap
Class WrapperUtilsTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by lp.wrap.WrapperUtilsTest
All Implemented Interfaces:
Test

public class WrapperUtilsTest
extends TestCase

Contains tests of the WrapperUtils class.

Version:
1.0.0
Author:
Martin Slota
See Also:
WrapperUtils

Field Summary
private static char SEP
          A shortcut name for File.separatorChar.
private static WrapperUtils WU
          The singleton instance of WrapperUtils
 
Constructor Summary
WrapperUtilsTest(String testName)
          A default test case constructor.
 
Method Summary
 void testDumpToString()
          Tests of the WrapperUtils.dumpToString(InputStream) method.
 void testExec()
          Tests of the WrapperUtils.exec(String) method.
 void testGetCommandName()
          Tests of the WrapperUtils.getCommandName(String) method.
 void testGetShortCommandName()
          Tests of the WrapperUtils.getShortCommandName(String) method.
 void testTransfer1()
          Tests of the WrapperUtils.transfer(InputStream, OutputStream) method.
 void testTransfer2()
          Tests of the WrapperUtils.transfer(String, OutputStream) method.
 void testTransfer3()
          Tests of the WrapperUtils.transfer(InputStream, StringBuilder) method.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEP

private static final char SEP
A shortcut name for File.separatorChar.


WU

private static final WrapperUtils WU
The singleton instance of WrapperUtils

Constructor Detail

WrapperUtilsTest

public WrapperUtilsTest(String testName)
A default test case constructor.

Parameters:
testName - the name of the test case
Method Detail

testGetCommandName

public void testGetCommandName()
Tests of the WrapperUtils.getCommandName(String) method.


testGetShortCommandName

public void testGetShortCommandName()
Tests of the WrapperUtils.getShortCommandName(String) method.


testTransfer1

public void testTransfer1()
                   throws IOException
Tests of the WrapperUtils.transfer(InputStream, OutputStream) method.

Throws:
IOException - if an I/O error occurs while running the tests (should never happen)

testTransfer2

public void testTransfer2()
                   throws IOException
Tests of the WrapperUtils.transfer(String, OutputStream) method.

Throws:
IOException - if an I/O error occurs while running the tests (should never happen)

testTransfer3

public void testTransfer3()
                   throws IOException
Tests of the WrapperUtils.transfer(InputStream, StringBuilder) method.

Throws:
IOException - if an I/O error occurs while running the tests (should never happen)

testDumpToString

public void testDumpToString()
                      throws IOException
Tests of the WrapperUtils.dumpToString(InputStream) method.

Throws:
IOException - if an I/O error occurs while running the tests (should never happen)

testExec

public void testExec()
              throws WrapperException,
                     InterruptedException,
                     IOException
Tests of the WrapperUtils.exec(String) method.

Throws:
WrapperException - if an IOException occurs while running the tests (should never happen)
InterruptedException - if an error occurs while waiting for the Process with the "cat" command to finish execution
IOException - if an I/O error occurs while closing the standard input of the process