Skip to content

Commit

Permalink
[1907627] test case-sensitive tables
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Mar 7, 2008
1 parent 6936e14 commit 3a6661c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Expand Up @@ -71,6 +71,7 @@ public void testLifecycle() {
testSyncInsertCondition();
testSyncUpdateCondition();
testSyncUpdateWithEmptyKey();
testCaseSensitiveTableNames();
testIgnoreNodeChannel();
testPurge();
testHeartbeat();
Expand Down Expand Up @@ -252,6 +253,17 @@ protected void testVirtualTransactionId() {
Assert.assertEquals(rootJdbcTemplate.update("delete from test_very_long_table_name_1234 where id='42'"), 1);
Assert.assertEquals(rootJdbcTemplate.queryForObject("select transaction_id from sym_data_event where data_id in (select max(data_id) from sym_data)", String.class), "42", "The hardcoded transaction id was not found.");
}

protected void testCaseSensitiveTableNames() {
rootJdbcTemplate.update("insert into TEST_ALL_CAPS values(1, 'HELLO')");
getClientEngine().pull();
Assert.assertEquals(clientJdbcTemplate.queryForInt("select count(*) from TEST_ALL_CAPS where ALL_CAPS_ID = 1"),
1, "Table name in all caps was not synced");
rootJdbcTemplate.update("insert into Test_Mixed_Case values(1, 'Hello')");
getClientEngine().pull();
Assert.assertEquals(clientJdbcTemplate.queryForInt("select count(*) from Test_Mixed_Case where Mixed_Case_Id = 1"),
1, "Table name in mixed case was not synced");
}

protected void testMultipleChannels() {
}
Expand Down
8 changes: 8 additions & 0 deletions symmetric/src/test/resources/test-integration-root-setup.sql
Expand Up @@ -40,6 +40,14 @@ insert into sym_trigger
(source_table_name,source_node_group_id,target_node_group_id,channel_id,sync_on_update,sync_on_insert,sync_on_delete,sync_on_update_condition,sync_on_insert_condition,sync_on_delete_condition,initial_load_select,node_select,tx_id_expression,initial_load_order,last_updated_by,last_updated_time,name_for_insert_trigger,create_time)
values('test_store_status','test-node-group','test-root-group','testchannel', 1, 1, 1, null, null, null, null, null, null, 1, 'erilong', current_timestamp,null,current_timestamp);

insert into sym_trigger
(source_table_name,source_node_group_id,target_node_group_id,channel_id,sync_on_update,sync_on_insert,sync_on_delete,sync_on_update_condition,sync_on_insert_condition,sync_on_delete_condition,initial_load_select,node_select,tx_id_expression,initial_load_order,last_updated_by,last_updated_time,name_for_insert_trigger,create_time)
values('TEST_ALL_CAPS','test-root-group','test-node-group','testchannel', 1, 1, 1, null, null, null, null, null, null, 1, 'erilong', current_timestamp,null,current_timestamp);

insert into sym_trigger
(source_table_name,source_node_group_id,target_node_group_id,channel_id,sync_on_update,sync_on_insert,sync_on_delete,sync_on_update_condition,sync_on_insert_condition,sync_on_delete_condition,initial_load_select,node_select,tx_id_expression,initial_load_order,last_updated_by,last_updated_time,name_for_insert_trigger,create_time)
values('Test_Mixed_Case','test-root-group','test-node-group','testchannel', 1, 1, 1, null, null, null, null, null, null, 1, 'erilong', current_timestamp,null,current_timestamp);

insert into test_customer
(customer_id, name, is_active, address, city, state, zip, entry_time)
values(100, 'John Smith', '1', '300 Main Street', 'Columbus', 'OH', 43230, {ts '2007-01-02 11:30:00'});
Expand Down
10 changes: 10 additions & 0 deletions symmetric/src/test/resources/test-tables-ddl.xml
Expand Up @@ -68,4 +68,14 @@
<column name="icon" type="BLOB"/>
</table>

<table name="TEST_ALL_CAPS">
<column name="ALL_CAPS_ID" type="INTEGER" primaryKey="true" required="true" />
<column name="NAME" type="VARCHAR" size="50" required="true" />
</table>

<table name="Test_Mixed_Case">
<column name="Mixed_Case_Id" type="INTEGER" primaryKey="true" required="true" />
<column name="Name" type="VARCHAR" size="50" required="true" />
</table>

</database>

0 comments on commit 3a6661c

Please sign in to comment.