|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectossj.common.tck.Util
public class Util
Collection of useful methods & metadata
Field Summary | |
---|---|
static PrintStream |
outputFile
for log |
Random |
RANDOM
used for random generator |
Constructor Summary | |
---|---|
Util()
Creates new util |
|
Util(boolean generic)
Creates a new Util object. |
Method Summary | |
---|---|
static boolean |
contains(int[] a,
int key)
|
static boolean |
contains(Object[] a,
Object key)
|
static boolean |
containsDuplicates(Vector v,
javax.oss.ManagedEntityKey key)
|
javax.jms.QueueReceiver |
createQueueReceiver(String msgSelector)
DOCUMENT ME! |
javax.jms.QueueSender |
createQueueSender()
DOCUMENT ME! |
javax.jms.QueueSession |
createQueueSession()
DOCUMENT ME! |
String[] |
deepCopy(String[] src)
performs a deep copy on src |
static String[] |
diff(String[] first,
String[] second)
gets first minus second i.e. |
static int |
find(ArrayList list,
javax.oss.ManagedEntityKey key)
|
static int |
find(javax.oss.ManagedEntityKey[] keys,
javax.oss.ManagedEntityKey key)
|
static int |
find(Vector v,
javax.oss.ManagedEntityKey key)
|
ArrayList |
findImplementationOf(Class myInterface)
DOCUMENT ME! |
ArrayList |
findInterfaceStartsWith(String s)
|
Class |
getAttributeType(javax.oss.AttributeAccess mev,
String name)
|
long |
getEventTimeout()
|
Vector |
getIllegalKeys(javax.oss.ManagedEntityValue mev)
|
static int[] |
getIllegalValue(int[] vals,
int count)
gets a value which is different from all input values and not null input array members must not be null |
static String[] |
getIllegalValue(String[] vals,
int count)
gets a value which is different from all input values and not null input array members must not be null |
InitialContext |
getInitialContext()
|
Hashtable |
getManagedEntityKeys(javax.oss.JVTSession jas)
|
static Object |
getMaxAsObject(Class cls)
|
static Object |
getMinAsObject(Class cls)
|
String |
getProperty(String prop)
DOCUMENT ME! |
String |
getQueueFactoryName()
|
String |
getRequestQueueName()
|
String |
getTopicFactoryName()
return the name of the topic factory from the properties file |
String |
getTopicName()
return the name of the topic from the properties file |
javax.jms.TopicSubscriber |
getTopicSubscriber()
|
javax.jms.TopicSubscriber |
getTopicSubscriber(String msgSelector)
|
long |
getTotalTimeout()
The timeout to wait for all events |
static String[] |
intersect(String[] first,
String[] second)
|
static boolean |
isSameType(javax.oss.ManagedEntityValue first,
javax.oss.ManagedEntityValue second)
|
static boolean |
isSubset(String[] subSet,
String[] superSet)
|
String |
isValidJndiName(String jndiName)
Test if the given JNDI name follows: System/System1/ApplicationType/Common/Application/1-1;1-1;ReferenceImplementation/Comp/name or System/System1/ApplicationType/Common/Application/1-1;1-1;ReferenceImplementation/Resource/name |
void |
log(String s)
DOCUMENT ME! |
void |
log(Throwable e)
DOCUMENT ME! |
static String |
makeCSList(Object[] items)
makes a comma separated list of the items String representation |
Date |
randomDate()
|
Object |
randomElement(Object[] a)
|
javax.oss.AttributeAccess |
randomManagedEntityValueAtrributes(javax.oss.AttributeAccess mev)
Creates a random value for the given ManagedEntityValue |
javax.oss.MultiValueList |
randomMultiValue(Class cls)
DOCUMENT ME! |
String |
randomString()
|
String[] |
randomSubset(String[] set)
|
ArrayList |
randomSubsetNotEmpty(Object[] set)
|
String[] |
randomSubsetNotEmpty(String[] set)
|
Object |
randomValue(String name,
javax.oss.AttributeAccess mev)
Creates a random value for the given attribute name and ManagedEntityValue So far, Date and String are the only non primitve types supported. |
Object |
randomValueInstance(Class cls)
DOCUMENT ME! |
void |
shuffle(Object[] a)
shuffles the array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static PrintStream outputFile
public final Random RANDOM
Constructor Detail |
---|
public Util() throws Exception
Exception
public Util(boolean generic) throws Exception
generic
- DOCUMENT ME!
Exception
- DOCUMENT ME!Method Detail |
---|
public void log(String s)
s
- DOCUMENT ME!public void log(Throwable e)
e
- DOCUMENT ME!public long getEventTimeout()
public long getTotalTimeout()
public Class getAttributeType(javax.oss.AttributeAccess mev, String name) throws Exception
Exception
public InitialContext getInitialContext() throws TCKException
TCKException
public String getTopicFactoryName()
public String getQueueFactoryName()
public String getRequestQueueName()
public String getTopicName()
public String isValidJndiName(String jndiName)
name
- the jndi name to test
public javax.jms.TopicSubscriber getTopicSubscriber() throws Exception
Exception
public javax.jms.TopicSubscriber getTopicSubscriber(String msgSelector) throws TCKException
msgSelector
- The selector for incoming messages
TCKException
public javax.jms.QueueSession createQueueSession() throws TCKException
TCKException
- DOCUMENT ME!public javax.jms.QueueSender createQueueSender() throws TCKException
TCKException
- DOCUMENT ME!public javax.jms.QueueReceiver createQueueReceiver(String msgSelector) throws TCKException
msgSelector
- DOCUMENT ME!
TCKException
- DOCUMENT ME!public static String[] intersect(String[] first, String[] second)
public static boolean isSubset(String[] subSet, String[] superSet)
subSet
- The subsetsuperSet
- The superset
public static String[] diff(String[] first, String[] second)
first
- second
-
public static boolean contains(Object[] a, Object key) throws IllegalArgumentException
IllegalArgumentException
- If an argument is nullpublic static boolean contains(int[] a, int key) throws IllegalArgumentException
a
- key
-
IllegalArgumentException
- If an argument is nullpublic static int find(ArrayList list, javax.oss.ManagedEntityKey key)
list
- List of Keyskey
- The Key to be looked for
public static int find(Vector v, javax.oss.ManagedEntityKey key)
v
- Vector of Keyskey
- The Key to be looked for
public static int find(javax.oss.ManagedEntityKey[] keys, javax.oss.ManagedEntityKey key)
list
- List of Keyskey
- The Key to be looked for
public static boolean containsDuplicates(Vector v, javax.oss.ManagedEntityKey key)
keys
- key
-
public static String makeCSList(Object[] items)
items
- The items
public String[] deepCopy(String[] src)
src
- The source to be copied
public void shuffle(Object[] a) throws IllegalArgumentException
IllegalArgumentException
- If a is nullpublic String[] randomSubset(String[] set)
set
- The set of strings
public String[] randomSubsetNotEmpty(String[] set)
set
- The set of String
public ArrayList randomSubsetNotEmpty(Object[] set)
set
- The set
public static Object getMinAsObject(Class cls) throws IllegalArgumentException
The
- class to get the minimum from
IllegalArgumentException
- If !cls.IsPrimitive()public static Object getMaxAsObject(Class cls) throws IllegalArgumentException
The
- class to get the maximum from
IllegalArgumentException
- If !cls.IsPrimitive()public static String[] getIllegalValue(String[] vals, int count) throws IllegalArgumentException
vals
- The values to be different fromcount
- The number of values to return
IllegalArgumentException
public static int[] getIllegalValue(int[] vals, int count) throws IllegalArgumentException
vals
- The values to be different fromcount
- The number of values to return
IllegalArgumentException
public Date randomDate()
public String randomString()
public Object randomValue(String name, javax.oss.AttributeAccess mev) throws Exception
name
- The name of the attributemev
- The ManagedEntityValue
Exception
public javax.oss.AttributeAccess randomManagedEntityValueAtrributes(javax.oss.AttributeAccess mev) throws Exception
mev
- The ManagedEntityValue
Exception
public javax.oss.MultiValueList randomMultiValue(Class cls) throws Exception
cls
- DOCUMENT ME!
Exception
- DOCUMENT ME!public Object randomValueInstance(Class cls) throws Exception
cls
- DOCUMENT ME!
Exception
- DOCUMENT ME!public static boolean isSameType(javax.oss.ManagedEntityValue first, javax.oss.ManagedEntityValue second)
first
- second
-
public Hashtable getManagedEntityKeys(javax.oss.JVTSession jas) throws Exception
Exception
public Vector getIllegalKeys(javax.oss.ManagedEntityValue mev) throws Exception
Exception
public Object randomElement(Object[] a)
a
- Array to select from
public String getProperty(String prop)
prop
- DOCUMENT ME!
public ArrayList findInterfaceStartsWith(String s)
public ArrayList findImplementationOf(Class myInterface)
myInterface
- DOCUMENT ME!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |