| org.jgroups.tests.ChannelTestBase
All known Subclasses: org.jgroups.blocks.RpcDispatcherAnycastMultipleCallsTest, org.jgroups.tests.DistributedHashtableUnitTest, org.jgroups.tests.MultiplexerViewTest, org.jgroups.tests.MultiplexerTest, org.jgroups.tests.FlushTest, org.jgroups.tests.ConcurrentStartupTest,
ChannelTestBase | public class ChannelTestBase extends TestCase (Code) | | author: Bela Ban author: Vladimir Blagojevic author: Brian Stansberry version: $Revision$ |
Inner Class :protected class DefaultChannelTestFactory implements ChannelTestFactory | |
Inner Class :public class DefaultMuxChannelTestFactory implements ChannelTestFactory | |
Inner Class :public class NextAvailableMuxChannelTestFactory implements ChannelTestFactory | |
Inner Class :protected interface ChannelTestFactory | |
Inner Class :abstract protected class ChannelApplication implements Runnable,MemberRetrievable | |
Inner Class :abstract protected class PushChannelApplication extends ChannelApplication implements ExtendedReceiver | |
Inner Class :abstract protected class PushChannelApplicationWithSemaphore extends PushChannelApplication | |
Inner Class :protected interface MemberRetrievable | |
Method Summary | |
public static void | acquireSemaphore(Semaphore semaphore, long timeout, int count) | public static boolean | areViewsComplete(MemberRetrievable[] channels, int memberCount) Checks each channel in the parameter array to see if it has the
exact same view as other channels in an array. | public static void | blockUntilViewsReceived(MemberRetrievable[] channels, long timeout) Loops, continually calling
ChannelTestBase.areViewsComplete(MemberRetrievable[]) until it either returns true or timeout ms have elapsed. | public static void | blockUntilViewsReceived(Collection channels, long timeout) | public static void | blockUntilViewsReceived(MemberRetrievable[] channels, int count, long timeout) Loops, continually calling
ChannelTestBase.areViewsComplete(MemberRetrievable[]) until it either returns true or timeout ms have elapsed. | public static void | blockUntilViewsReceived(Collection channels, int count, long timeout) | protected String[] | createApplicationNames(int applicationCount) | protected Channel | createChannel(Object id) | protected Channel | createChannel() | protected String[] | createMuxApplicationNames(int muxApplicationstPerChannelCount) | protected String[] | createMuxApplicationNames(int muxApplicationstPerChannelCount, int muxFactoryCount) | protected int | getMuxFactoryCount() Returns value of mux.factorycount system property has been set, otherwise returns
DEFAULT_MUX_FACTORY_COUNT. | protected String | getNextChannelName() Returns channel name as String next in alphabetic sequence since getNextChannelName()
has been called last. | protected boolean | isMuxChannelUsed() Returns true if JVM has been started with mux.on system property
set to true, false otherwise. | public static boolean | isViewComplete(MemberRetrievable channel, int memberCount) | protected void | setUp() | protected boolean | shouldCompareThreadCount() Returns true if JVM has been started with threadcount system property
set to true, false otherwise. | public static void | sleepRandom(int maxTime) | public static void | sleepThread(long sleeptime) Puts the current thread to sleep for the desired number of ms, suppressing
any exceptions. | public static void | takeAllPermits(Semaphore semaphore, int count) | protected void | tearDown() | protected boolean | useBlocking() Returns true if JVM has been started with useBlocking system property
set to true, false otherwise. |
DEFAULT_MUX_FACTORY_COUNT | protected static String DEFAULT_MUX_FACTORY_COUNT(Code) | | |
MUX_CHANNEL_CONFIG | protected static String MUX_CHANNEL_CONFIG(Code) | | |
MUX_CHANNEL_CONFIG_STACK_NAME | protected static String MUX_CHANNEL_CONFIG_STACK_NAME(Code) | | |
active_threads | protected int active_threads(Code) | | |
currentChannelGeneratedName | protected int currentChannelGeneratedName(Code) | | |
log | final protected Log log(Code) | | |
ChannelTestBase | public ChannelTestBase()(Code) | | |
acquireSemaphore | public static void acquireSemaphore(Semaphore semaphore, long timeout, int count) throws Exception(Code) | | |
areViewsComplete | public static boolean areViewsComplete(MemberRetrievable[] channels, int memberCount)(Code) | | Checks each channel in the parameter array to see if it has the
exact same view as other channels in an array.
|
blockUntilViewsReceived | public static void blockUntilViewsReceived(MemberRetrievable[] channels, long timeout)(Code) | | Loops, continually calling
ChannelTestBase.areViewsComplete(MemberRetrievable[]) until it either returns true or timeout ms have elapsed.
Parameters: channels - channels which must all have consistent views Parameters: timeout - max number of ms to loop throws: RuntimeException - if timeout ms have elapse withoutall channels having the same number of members. |
blockUntilViewsReceived | public static void blockUntilViewsReceived(Collection channels, long timeout)(Code) | | |
blockUntilViewsReceived | public static void blockUntilViewsReceived(MemberRetrievable[] channels, int count, long timeout)(Code) | | Loops, continually calling
ChannelTestBase.areViewsComplete(MemberRetrievable[]) until it either returns true or timeout ms have elapsed.
Parameters: channels - channels which must all have consistent views Parameters: timeout - max number of ms to loop throws: RuntimeException - if timeout ms have elapse withoutall channels having the same number of members. |
blockUntilViewsReceived | public static void blockUntilViewsReceived(Collection channels, int count, long timeout)(Code) | | |
createApplicationNames | protected String[] createApplicationNames(int applicationCount)(Code) | | |
createMuxApplicationNames | protected String[] createMuxApplicationNames(int muxApplicationstPerChannelCount)(Code) | | Returns an array of mux application/service names with a guarantee that:
- there are no application/service name collissions on top of one channel
(i.e cannot have two application/service(s) with the same name on top of one channel)
- each generated application/service name is guaranteed to have a corresponding
pair application/service with the same name on another channel
Parameters: muxApplicationstPerChannelCount - |
createMuxApplicationNames | protected String[] createMuxApplicationNames(int muxApplicationstPerChannelCount, int muxFactoryCount)(Code) | | Returns an array of mux application/service names with a guarantee that:
- there are no application/service name collissions on top of one channel
(i.e cannot have two application/service(s) with the same name on top of one channel)
- each generated application/service name is guaranteed to have a corresponding
pair application/service with the same name on another channel
Parameters: muxApplicationstPerChannelCount - Parameters: muxFactoryCount - how many mux factories should be used (has to be less than getMuxFactoryCount()) array of mux application id's represented as String objects |
getMuxFactoryCount | protected int getMuxFactoryCount()(Code) | | Returns value of mux.factorycount system property has been set, otherwise returns
DEFAULT_MUX_FACTORY_COUNT.
|
getNextChannelName | protected String getNextChannelName()(Code) | | Returns channel name as String next in alphabetic sequence since getNextChannelName()
has been called last. Sequence is restarted to letter "A" after each setUp call.
|
isMuxChannelUsed | protected boolean isMuxChannelUsed()(Code) | | Returns true if JVM has been started with mux.on system property
set to true, false otherwise.
|
isViewComplete | public static boolean isViewComplete(MemberRetrievable channel, int memberCount)(Code) | | |
shouldCompareThreadCount | protected boolean shouldCompareThreadCount()(Code) | | Returns true if JVM has been started with threadcount system property
set to true, false otherwise.
|
sleepRandom | public static void sleepRandom(int maxTime)(Code) | | |
sleepThread | public static void sleepThread(long sleeptime)(Code) | | Puts the current thread to sleep for the desired number of ms, suppressing
any exceptions.
Parameters: sleeptime - number of ms to sleep |
takeAllPermits | public static void takeAllPermits(Semaphore semaphore, int count)(Code) | | |
useBlocking | protected boolean useBlocking()(Code) | | Returns true if JVM has been started with useBlocking system property
set to true, false otherwise.
|
|
|