PolicyUtilsTestpublic class PolicyUtilsTest extends TestCase
Fields Summary |
---|
private static final PolicyLogger | LOGGER |
Constructors Summary |
---|
public PolicyUtilsTest(String testName)
super(testName);
|
Methods Summary |
---|
protected void | setUp()
| protected void | tearDown()
| public void | testCollectionsCombine()Test of combine method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.Collections.
// TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
| public void | testCommonsGetStackMethodName()Test of getStackMethodName method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.Commons.
int index;
String expResult, result;
index = 0;
expResult = "dumpThreads";
result = PolicyUtils.Commons.getStackMethodName(index);
assertEquals(expResult, result);
index = 1;
expResult = "getStackTrace";
result = PolicyUtils.Commons.getStackMethodName(index);
assertEquals(expResult, result);
index = 2;
expResult = "getStackMethodName";
result = PolicyUtils.Commons.getStackMethodName(index);
assertEquals(expResult, result);
index = 3;
expResult = "testCommonsGetStackMethodName";
result = PolicyUtils.Commons.getStackMethodName(index);
assertEquals(expResult, result);
| public void | testComparisonCompareBoolean()Test of compareBoolean method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.Comparison.
boolean b1, b2;
int expResult, result;
b1 = true;
b2 = true;
expResult = 0;
result = PolicyUtils.Comparison.compareBoolean(b1, b2);
assertEquals(expResult, result);
b1 = false;
b2 = false;
expResult = 0;
result = PolicyUtils.Comparison.compareBoolean(b1, b2);
assertEquals(expResult, result);
b1 = false;
b2 = true;
expResult = -1;
result = PolicyUtils.Comparison.compareBoolean(b1, b2);
assertEquals(expResult, result);
b1 = true;
b2 = false;
expResult = 1;
result = PolicyUtils.Comparison.compareBoolean(b1, b2);
assertEquals(expResult, result);
| public void | testComparisonCompareNullableStrings()Test of compareNullableStrings method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.Comparison.
String s1, s2;
int expResult, result;
s1 = null;
s2 = null;
expResult = 0;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = "";
s2 = "";
expResult = 0;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = "abc";
s2 = "abc";
expResult = 0;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = null;
s2 = "";
expResult = -1;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = null;
s2 = "abc";
expResult = -1;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = "abc";
s2 = "abd";
expResult = -1;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = "";
s2 = null;
expResult = 1;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = "abc";
s2 = null;
expResult = 1;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
s1 = "abd";
s2 = "abc";
expResult = 1;
result = PolicyUtils.Comparison.compareNullableStrings(s1, s2);
assertEquals(expResult, result);
| public void | testConfigFileGenerateFullName()Test of generateFullName method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.ConfigFile.
System.out.println("generateFullName");
String configFileIdentifier = "test";
String expResult = "wsit-test.xml";
String result = PolicyUtils.ConfigFile.generateFullName(configFileIdentifier);
assertEquals(expResult, result);
| public void | testConfigFileLoadFromClasspath()Test of loadFromClasspath method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.ConfigFile.
// TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
| public void | testConfigFileLoadFromContext()Test of loadFromContext method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.ConfigFile.
// TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
| public void | testGetCallerMethodName()
class TestCall {
public void testCall() {
String expResult, result;
expResult = "testGetCallerMethodName";
result = PolicyUtils.Commons.getCallerMethodName();
assertEquals(expResult, result);
}
};
TestCall tc = new TestCall();
tc.testCall();
| public void | testIOCloseResource()Test of closeResource method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.IO.
PolicyUtils.IO.closeResource((Closeable) null);
PolicyUtils.IO.closeResource((XMLStreamReader) null);
// TODO: add more testing code
| public void | testReflectionInvoke()Test of invoke method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.Reflection.
// TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
| public void | testRtf2396Unquote()
assertEquals("hello Vasku", PolicyUtils.Rfc2396.unquote("hello%20Vasku"));
| public void | testServiceProviderLoad()Test of load method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.ServiceProvider.
System.out.println("load");
PolicyAssertionCreator[] result = PolicyUtils.ServiceProvider.load(PolicyAssertionCreator.class, this.getClass().getClassLoader());
assertEquals(9, result.length);
| public void | testTextCreateIndent()Test of createIndent method, of class com.sun.xml.ws.policy.privateutil.PolicyUtils.Text.
int indentLevel;
String expResult, result;
indentLevel = 0;
expResult = "";
result = PolicyUtils.Text.createIndent(indentLevel);
assertEquals(expResult, result);
indentLevel = 1;
expResult = " ";
result = PolicyUtils.Text.createIndent(indentLevel);
assertEquals(expResult, result);
indentLevel = 2;
expResult = " ";
result = PolicyUtils.Text.createIndent(indentLevel);
assertEquals(expResult, result);
|
|