Removed ambiguity between two Messages.raw methods to make certain IDEs happy by reodering the parameters of one of the methods
| | |
| | | * are creating is locale sensitive. If so you should instead create |
| | | * a formal message. |
| | | * |
| | | * @param formatString of the message or the message itself if not |
| | | * arguments are necessary |
| | | * @param category of this message |
| | | * @param severity of this message |
| | | * @param formatString of the message or the message itself if not |
| | | * arguments are necessary |
| | | * @param args any arguments for the format string |
| | | * @return a message object that will render the same in all locales; |
| | | * null if <code>formatString</code> is null |
| | | */ |
| | | static public Message raw(CharSequence formatString, Category category, |
| | | Severity severity, Object... args) { |
| | | static public Message raw(Category category, Severity severity, |
| | | CharSequence formatString, Object... args) { |
| | | Message message = null; |
| | | if (formatString != null) { |
| | | MessageDescriptor.Raw md = |
| | |
| | | @Test(dataProvider = "rawData1") |
| | | public void testRaw1(String fmt, Category c, Severity s, |
| | | String result, Object... args) { |
| | | Message message = Message.raw(fmt, c, s, args); |
| | | Message message = Message.raw(c, s, fmt, args); |
| | | assert (message.toString().equals(result)); |
| | | assert (message.toString(Locale.CHINESE).equals(result)); |
| | | } |
| | |
| | | @Test(dataProvider = "rawData1") |
| | | public void testGetDescriptor(String fmt, Category c, Severity s, |
| | | String result, Object... args) { |
| | | Message message = Message.raw(fmt, c, s, args); |
| | | Message message = Message.raw(c, s, fmt, args); |
| | | MessageDescriptor desc = message.getDescriptor(); |
| | | assert(desc.getCategory().equals(c)); |
| | | assert(desc.getSeverity().equals(s)); |
| | |
| | | |
| | | private void log(String s) |
| | | { |
| | | logError(Message.raw("InitOnLineTests/" + s, Category.SYNC, Severity.INFORMATION)); |
| | | logError(Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "InitOnLineTests/" + s)); |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo(s); |
| | |
| | | public void saturateQueueAndRestart() throws Exception |
| | | { |
| | | logError(Message.raw( |
| | | "Starting Replication ProtocolWindowTest : saturateAndRestart", |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | Category.SYNC, Severity.INFORMATION, |
| | | "Starting Replication ProtocolWindowTest : saturateAndRestart")); |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |
| | |
| | | public void protocolVersion() throws Exception |
| | | { |
| | | logError(Message.raw( |
| | | "Starting Replication ProtocolWindowTest : protocolVersion", |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | Category.SYNC, Severity.INFORMATION, |
| | | "Starting Replication ProtocolWindowTest : protocolVersion")); |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |
| | |
| | | */ |
| | | protected void cleanConfigEntries() |
| | | { |
| | | logError(Message.raw("ReplicationTestCase/Cleaning config entries", |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "ReplicationTestCase/Cleaning config entries")); |
| | | |
| | | DeleteOperationBasis op; |
| | | // Delete entries |
| | |
| | | while (true) |
| | | { |
| | | DN dn = configEntryList.removeLast(); |
| | | logError(Message.raw("cleaning config entry " + dn, |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "cleaning config entry " + dn)); |
| | | |
| | | op = new DeleteOperationBasis(connection, InternalClientConnection |
| | | .nextOperationID(), InternalClientConnection.nextMessageID(), null, |
| | |
| | | */ |
| | | protected void cleanRealEntries() |
| | | { |
| | | logError(Message.raw("ReplicationTestCase/Cleaning entries", |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "ReplicationTestCase/Cleaning entries")); |
| | | |
| | | DeleteOperationBasis op; |
| | | // Delete entries |
| | |
| | | while (true) |
| | | { |
| | | DN dn = entryList.removeLast(); |
| | | logError(Message.raw("cleaning entry " + dn, |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "cleaning entry " + dn)); |
| | | |
| | | op = new DeleteOperationBasis(connection, InternalClientConnection |
| | | .nextOperationID(), InternalClientConnection.nextMessageID(), null, |
| | |
| | | @Test() |
| | | public void pushSchemaChange() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication test : pushSchemaChange ", |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "Starting replication test : pushSchemaChange ")); |
| | | |
| | | final DN baseDn = DN.decode("cn=schema"); |
| | | |
| | |
| | | @Test(dependsOnMethods = { "pushSchemaChange" }) |
| | | public void replaySchemaChange() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication test : pushSchemaChange ", |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "Starting replication test : pushSchemaChange ")); |
| | | |
| | | final DN baseDn = DN.decode("cn=schema"); |
| | | |
| | |
| | | @Test(enabled=true, dependsOnMethods = { "replaySchemaChange" }) |
| | | public void pushSchemaFilesChange() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication test : pushSchemaFilesChange ", |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "Starting replication test : pushSchemaFilesChange ")); |
| | | |
| | | final DN baseDn = DN.decode("cn=schema"); |
| | | |
| | |
| | | @Test(enabled=true, groups="slow") |
| | | public void fromServertoBroker() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication StressTest : fromServertoBroker", |
| | | Category.SYNC, Severity.NOTICE)); |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "Starting replication StressTest : fromServertoBroker")); |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | final int TOTAL_MESSAGES = 1000; |
| | |
| | | @Test(enabled=false) |
| | | public void toggleReceiveStatus() throws Exception |
| | | { |
| | | logError(Message.raw("Starting synchronization test : toggleReceiveStatus", |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | logError(Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "Starting synchronization test : toggleReceiveStatus")); |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |
| | |
| | | @Test(groups = "slow") |
| | | public void lostHeartbeatFailover() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication test : lostHeartbeatFailover", |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | logError(Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "Starting replication test : lostHeartbeatFailover")); |
| | | |
| | | cleanRealEntries(); |
| | | |
| | |
| | | @Test(enabled=true, groups="slow") |
| | | public void namingConflicts() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication test : namingConflicts", |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | logError(Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "Starting replication test : namingConflicts")); |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | String resolvedMonitorAttr = "resolved-naming-conflicts"; |
| | |
| | | public void updateOperations(boolean assured) throws Exception |
| | | { |
| | | logError(Message.raw( |
| | | "Starting replication test : updateOperations " + assured, |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | Category.SYNC, Severity.INFORMATION, |
| | | "Starting replication test : updateOperations " + assured)); |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |
| | |
| | | @Test(enabled=true) |
| | | public void deleteNoSuchObject() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication test : deleteNoSuchObject", |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | logError(Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "Starting replication test : deleteNoSuchObject")); |
| | | |
| | | DN dn = DN.decode("cn=No Such Object,ou=People,dc=example,dc=com"); |
| | | DeleteOperationBasis op = |
| | |
| | | @Test(enabled=false) |
| | | public void infiniteReplayLoop() throws Exception |
| | | { |
| | | logError(Message.raw("Starting replication test : infiniteReplayLoop", |
| | | Category.SYNC, Severity.INFORMATION)); |
| | | logError(Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "Starting replication test : infiniteReplayLoop")); |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |