1
- package com .thomsonreuters .ema .access ;
1
+ package com .thomsonreuters .ema .access ;
2
2
3
3
import junit .framework .TestCase ;
4
- import com .thomsonreuters .ema .unittest .TestUtilities ;
4
+ import com .thomsonreuters .ema .unittest .TestUtilities ;
5
5
import com .thomsonreuters .upa .codec .Qos ;
6
6
import com .thomsonreuters .upa .codec .QosRates ;
7
7
import com .thomsonreuters .upa .codec .QosTimeliness ;
@@ -43,7 +43,7 @@ public void testLoadCfgFromFile()
43
43
System .out .println ("Using Ema Config: " + EmaConfigFileLocation );
44
44
}
45
45
46
- OmmConsumerConfigImpl testConfig = (OmmConsumerConfigImpl ) EmaFactory .createOmmConsumerConfig (EmaConfigFileLocation );
46
+ OmmConsumerConfigImpl testConfig = (OmmConsumerConfigImpl ) EmaFactory .createOmmConsumerConfig (EmaConfigFileLocation );
47
47
48
48
// Check default consumer name (Conusmer_2) and associated values
49
49
System .out .println ("Retrieving DefaultConsumer configuration values: (DefaultConsumer value=Consumer_2) " );
@@ -70,16 +70,16 @@ public void testLoadCfgFromFile()
70
70
TestUtilities .checkResult ("MaxOutstandingPosts value == 90000" , intLongValue == 90000 );
71
71
int intValue = JUnitTestConnect .configGetIntValue (testConfig , defaultConsName , JUnitTestConnect .ConfigGroupTypeConsumer , JUnitTestConnect .DispatchTimeoutApiThread );
72
72
TestUtilities .checkResult ("DispatchTimeoutApiThread value == 90" , intValue == 90 );
73
- intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .ReactorMsgEventPoolLimit ).intValue ();
74
- TestUtilities .checkResult ("ReactorMsgEventPoolLimit value == 2000" , intValue == 2000 );
75
- intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .ReactorChannelEventPoolLimit ).intValue ();
76
- TestUtilities .checkResult ("ReactorChannelEventPoolLimit value == 1500" , intValue == 1500 );
77
- intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .WorkerEventPoolLimit ).intValue ();
78
- TestUtilities .checkResult ("WorkerEventPoolLimit value == 1000" , intValue == 1000 );
79
- intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .TunnelStreamMsgEventPoolLimit ).intValue ();
80
- TestUtilities .checkResult ("TunnelStreamMsgEventPoolLimit value == 2500" , intValue == 2500 );
81
- intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .TunnelStreamStatusEventPoolLimit ).intValue ();
82
- TestUtilities .checkResult ("TunnelStreamStatusEventPoolLimit value == 3000" , intValue == 3000 );
73
+ intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .ReactorMsgEventPoolLimit ).intValue ();
74
+ TestUtilities .checkResult ("ReactorMsgEventPoolLimit value == 2000" , intValue == 2000 );
75
+ intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .ReactorChannelEventPoolLimit ).intValue ();
76
+ TestUtilities .checkResult ("ReactorChannelEventPoolLimit value == 1500" , intValue == 1500 );
77
+ intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .WorkerEventPoolLimit ).intValue ();
78
+ TestUtilities .checkResult ("WorkerEventPoolLimit value == 1000" , intValue == 1000 );
79
+ intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .TunnelStreamMsgEventPoolLimit ).intValue ();
80
+ TestUtilities .checkResult ("TunnelStreamMsgEventPoolLimit value == 2500" , intValue == 2500 );
81
+ intValue = testConfig .xmlConfig ().getGlobalConfig ().getPrimitiveValue (ConfigManager .TunnelStreamStatusEventPoolLimit ).intValue ();
82
+ TestUtilities .checkResult ("TunnelStreamStatusEventPoolLimit value == 3000" , intValue == 3000 );
83
83
84
84
intLongValue = JUnitTestConnect .configGetIntLongValue (testConfig , defaultConsName , JUnitTestConnect .ConfigGroupTypeConsumer , JUnitTestConnect .MaxDispatchCountApiThread );
85
85
TestUtilities .checkResult ("MaxDispatchCountApiThread value == 400" , intLongValue == 400 );
@@ -569,14 +569,14 @@ public void testLoadCfgFromProgrammaticConfig()
569
569
570
570
try
571
571
{
572
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorMsgEventPoolLimit" , 100 ));
573
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorChannelEventPoolLimit" , 150 ));
574
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("WorkerEventPoolLimit" , 200 ));
575
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamMsgEventPoolLimit" , 250 ));
576
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamStatusEventPoolLimit" , 300 ));
577
- outermostMap .add (EmaFactory .createMapEntry ().keyAscii ( "GlobalConfig" , MapEntry .MapAction .ADD , innerElementList ));
578
- innerElementList .clear ();
579
-
572
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorMsgEventPoolLimit" , 100 ));
573
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorChannelEventPoolLimit" , 150 ));
574
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("WorkerEventPoolLimit" , 200 ));
575
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamMsgEventPoolLimit" , 250 ));
576
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamStatusEventPoolLimit" , 300 ));
577
+ outermostMap .add (EmaFactory .createMapEntry ().keyAscii ( "GlobalConfig" , MapEntry .MapAction .ADD , innerElementList ));
578
+ innerElementList .clear ();
579
+
580
580
elementList .add (EmaFactory .createElementEntry ().ascii ("DefaultConsumer" , "Consumer_1" ));
581
581
582
582
innerElementList .add (EmaFactory .createElementEntry ().ascii ("Channel" , "Channel_1" ));
@@ -715,18 +715,18 @@ public void testLoadCfgFromProgrammaticConfig()
715
715
TestUtilities .checkResult ("ReissueTokenAttemptInterval == 9000" , intValue == 9000 );
716
716
double doubleValue = JUnitTestConnect .activeConfigGetDoubleValue (cons , JUnitTestConnect .ConfigGroupTypeConsumer , JUnitTestConnect .TokenReissueRatio , -1 );
717
717
TestUtilities .checkResult ("TokenReissueRatio == 0.9" , doubleValue == 0.9 );
718
- String enableRtt = JUnitTestConnect .activeConfigGetStringValue (cons , JUnitTestConnect .ConfigGroupTypeConsumer , JUnitTestConnect .EnableRtt , -1 );
719
- TestUtilities .checkResult ("EnableRtt value == true" , enableRtt .contentEquals ("true" ) );
720
- int value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .reactorMsgEventPoolLimit ;
721
- TestUtilities .checkResult ("ReactorMsgEventPoolLimit == 100" , value == 100 );
722
- value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .reactorChannelEventPoolLimit ;
723
- TestUtilities .checkResult ("ReactorChannelEventPoolLimit == 150" , value == 150 );
724
- value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .workerEventPoolLimit ;
725
- TestUtilities .checkResult ("WorkerEventPoolLimit == 200" , value == 200 );
726
- value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .tunnelStreamMsgEventPoolLimit ;
727
- TestUtilities .checkResult ("TunnelStreamMsgEventPoolLimit == 250" , value == 250 );
728
- value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .tunnelStreamStatusEventPoolLimit ;
729
- TestUtilities .checkResult ("TunnelStreamStatusEventPoolLimit == 300" , value == 300 );
718
+ String enableRtt = JUnitTestConnect .activeConfigGetStringValue (cons , JUnitTestConnect .ConfigGroupTypeConsumer , JUnitTestConnect .EnableRtt , -1 );
719
+ TestUtilities .checkResult ("EnableRtt value == true" , enableRtt .contentEquals ("true" ) );
720
+ int value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .reactorMsgEventPoolLimit ;
721
+ TestUtilities .checkResult ("ReactorMsgEventPoolLimit == 100" , value == 100 );
722
+ value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .reactorChannelEventPoolLimit ;
723
+ TestUtilities .checkResult ("ReactorChannelEventPoolLimit == 150" , value == 150 );
724
+ value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .workerEventPoolLimit ;
725
+ TestUtilities .checkResult ("WorkerEventPoolLimit == 200" , value == 200 );
726
+ value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .tunnelStreamMsgEventPoolLimit ;
727
+ TestUtilities .checkResult ("TunnelStreamMsgEventPoolLimit == 250" , value == 250 );
728
+ value = ((OmmConsumerImpl ) cons ).activeConfig ().globalConfig .tunnelStreamStatusEventPoolLimit ;
729
+ TestUtilities .checkResult ("TunnelStreamStatusEventPoolLimit == 300" , value == 300 );
730
730
731
731
732
732
// Check values of Consumer_1
@@ -2364,14 +2364,14 @@ public void testLoadCfgFromProgrammaticConfigForIProv()
2364
2364
ElementList innerElementList = EmaFactory .createElementList ();
2365
2365
try
2366
2366
{
2367
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorMsgEventPoolLimit" , 2000 ));
2368
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorChannelEventPoolLimit" , 1500 ));
2369
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("WorkerEventPoolLimit" , 1000 ));
2370
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamMsgEventPoolLimit" , 2500 ));
2371
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamStatusEventPoolLimit" , 3000 ));
2372
- outermostMap .add (EmaFactory .createMapEntry ().keyAscii ( "GlobalConfig" , MapEntry .MapAction .ADD , innerElementList ));
2373
- innerElementList .clear ();
2374
-
2367
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorMsgEventPoolLimit" , 2000 ));
2368
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("ReactorChannelEventPoolLimit" , 1500 ));
2369
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("WorkerEventPoolLimit" , 1000 ));
2370
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamMsgEventPoolLimit" , 2500 ));
2371
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("TunnelStreamStatusEventPoolLimit" , 3000 ));
2372
+ outermostMap .add (EmaFactory .createMapEntry ().keyAscii ( "GlobalConfig" , MapEntry .MapAction .ADD , innerElementList ));
2373
+ innerElementList .clear ();
2374
+
2375
2375
elementList .add (EmaFactory .createElementEntry ().ascii ("DefaultIProvider" , "Provider_1" ));
2376
2376
2377
2377
innerElementList .add (EmaFactory .createElementEntry ().ascii ("Server" , "Server_1" ));
@@ -2384,7 +2384,7 @@ public void testLoadCfgFromProgrammaticConfigForIProv()
2384
2384
innerElementList .add (EmaFactory .createElementEntry ().intValue ("AcceptMessageWithoutAcceptingRequests" , 1 ));
2385
2385
innerElementList .add (EmaFactory .createElementEntry ().intValue ("AcceptMessageWithoutBeingLogin" , 1 ));
2386
2386
innerElementList .add (EmaFactory .createElementEntry ().intValue ("AcceptMessageWithoutQosInRange" , 1 ));
2387
- innerElementList .add (EmaFactory .createElementEntry ().intValue ("EnforceAckIDValidation" , 1 ));
2387
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("EnforceAckIDValidation" , 1 ));
2388
2388
innerElementList .add (EmaFactory .createElementEntry ().intValue ("FieldDictionaryFragmentSize" , 2000 ));
2389
2389
innerElementList .add (EmaFactory .createElementEntry ().intValue ("EnumTypeFragmentSize" , 1000 ));
2390
2390
innerElementList .add (EmaFactory .createElementEntry ().intValue ("RefreshFirstRequired" , 0 ));
@@ -2569,11 +2569,11 @@ public void testLoadCfgFromProgrammaticConfigForIProv()
2569
2569
2570
2570
System .out .println ("Using Ema Config: " + localConfigPath );
2571
2571
2572
- OmmIProviderImpl prov = null ;
2572
+ OmmIProviderImpl prov = null ;
2573
2573
if (testCase == 0 )
2574
- prov = (OmmIProviderImpl ) JUnitTestConnect .createOmmIProvider (EmaFactory .createOmmIProviderConfig ().config (outermostMap ));
2574
+ prov = (OmmIProviderImpl ) JUnitTestConnect .createOmmIProvider (EmaFactory .createOmmIProviderConfig ().config (outermostMap ));
2575
2575
else if (testCase == 1 )
2576
- prov = (OmmIProviderImpl ) JUnitTestConnect .createOmmIProvider (EmaFactory .createOmmIProviderConfig (localConfigPath ).config (outermostMap ));
2576
+ prov = (OmmIProviderImpl ) JUnitTestConnect .createOmmIProvider (EmaFactory .createOmmIProviderConfig (localConfigPath ).config (outermostMap ));
2577
2577
2578
2578
String defaultProvName = JUnitTestConnect .activeConfigGetStringValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderName );
2579
2579
TestUtilities .checkResult ("DefaultProvider value != null" , defaultProvName != null );
@@ -2594,8 +2594,8 @@ else if (testCase == 1)
2594
2594
TestUtilities .checkResult ("AcceptMessageSameKeyButDiffStream == 1" , boolValue == true );
2595
2595
boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderAcceptMessageThatChangesService );
2596
2596
TestUtilities .checkResult ("AcceptMessageThatChangesService == 1" , boolValue == true );
2597
- boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderEnforceAckIDValidation );
2598
- TestUtilities .checkResult ("IProviderEnforceAckIDValidation == 1" , boolValue == true );
2597
+ boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderEnforceAckIDValidation );
2598
+ TestUtilities .checkResult ("IProviderEnforceAckIDValidation == 1" , boolValue == true );
2599
2599
boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderRefreshFirstRequired );
2600
2600
TestUtilities .checkResult ("RefreshFirstRequired == 0" , boolValue == false );
2601
2601
int intLongValue = JUnitTestConnect .activeConfigGetIntLongValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .DictionaryFieldDictFragmentSize );
@@ -2619,18 +2619,18 @@ else if (testCase == 1)
2619
2619
2620
2620
boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .XmlTraceToStdout );
2621
2621
TestUtilities .checkResult ("XmlTraceToStdout == 1" , boolValue == true );
2622
-
2623
- // Check Global configuration:
2624
- int value = prov .activeConfig ().globalConfig .reactorMsgEventPoolLimit ;
2625
- TestUtilities .checkResult ("ReactorMsgEventPoolLimit == 2000" , value == 2000 );
2626
- value = prov .activeConfig ().globalConfig .reactorChannelEventPoolLimit ;
2627
- TestUtilities .checkResult ("ReactorChannelEventPoolLimit == 1500" , value == 1500 );
2628
- value = prov .activeConfig ().globalConfig .workerEventPoolLimit ;
2629
- TestUtilities .checkResult ("WorkerEventPoolLimit == 1000" , value == 1000 );
2630
- value = prov .activeConfig ().globalConfig .tunnelStreamMsgEventPoolLimit ;
2631
- TestUtilities .checkResult ("TunnelStreamMsgEventPoolLimit == 2500" , value == 2500 );
2632
- value = prov .activeConfig ().globalConfig .tunnelStreamStatusEventPoolLimit ;
2633
- TestUtilities .checkResult ("TunnelStreamStatusEventPoolLimit == 3000" , value == 3000 );
2622
+
2623
+ // Check Global configuration:
2624
+ int value = prov .activeConfig ().globalConfig .reactorMsgEventPoolLimit ;
2625
+ TestUtilities .checkResult ("ReactorMsgEventPoolLimit == 2000" , value == 2000 );
2626
+ value = prov .activeConfig ().globalConfig .reactorChannelEventPoolLimit ;
2627
+ TestUtilities .checkResult ("ReactorChannelEventPoolLimit == 1500" , value == 1500 );
2628
+ value = prov .activeConfig ().globalConfig .workerEventPoolLimit ;
2629
+ TestUtilities .checkResult ("WorkerEventPoolLimit == 1000" , value == 1000 );
2630
+ value = prov .activeConfig ().globalConfig .tunnelStreamMsgEventPoolLimit ;
2631
+ TestUtilities .checkResult ("TunnelStreamMsgEventPoolLimit == 2500" , value == 2500 );
2632
+ value = prov .activeConfig ().globalConfig .tunnelStreamStatusEventPoolLimit ;
2633
+ TestUtilities .checkResult ("TunnelStreamStatusEventPoolLimit == 3000" , value == 3000 );
2634
2634
2635
2635
// Check Server configuration:
2636
2636
// Check Server_1 configuration.
@@ -3303,6 +3303,7 @@ public void testMergCfgBetweenFileAndProgrammaticConfigForIProv()
3303
3303
innerElementList .add (EmaFactory .createElementEntry ().intValue ("MaxDispatchCountApiThread" , 900 ));
3304
3304
innerElementList .add (EmaFactory .createElementEntry ().intValue ("MaxDispatchCountUserThread" , 900 ));
3305
3305
innerElementList .add (EmaFactory .createElementEntry ().intValue ("XmlTraceToStdout" , 1 ));
3306
+ innerElementList .add (EmaFactory .createElementEntry ().intValue ("EnforceAckIDValidation" , 1 ));
3306
3307
innerMap .add (EmaFactory .createMapEntry ().keyAscii ( "Provider_2" , MapEntry .MapAction .ADD , innerElementList ));
3307
3308
innerElementList .clear ();
3308
3309
@@ -3459,8 +3460,8 @@ else if (testCase == 1)
3459
3460
TestUtilities .checkResult ("AcceptMessageSameKeyButDiffStream == 1" , boolValue == true );
3460
3461
boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderAcceptMessageThatChangesService );
3461
3462
TestUtilities .checkResult ("AcceptMessageThatChangesService == 1" , boolValue == true );
3462
- boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderEnforceAckIDValidation );
3463
- TestUtilities .checkResult ("EnforceAckIDValidation == 1" , boolValue == true );
3463
+ boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderEnforceAckIDValidation );
3464
+ TestUtilities .checkResult ("EnforceAckIDValidation == 1" , boolValue == true );
3464
3465
boolValue = JUnitTestConnect .activeConfigGetBooleanValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .IProviderRefreshFirstRequired );
3465
3466
TestUtilities .checkResult ("RefreshFirstRequired == 0" , boolValue == false );
3466
3467
int intLongValue = JUnitTestConnect .activeConfigGetIntLongValue (prov , JUnitTestConnect .ConfigGroupTypeProvider , JUnitTestConnect .DictionaryFieldDictFragmentSize );
0 commit comments