Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed Oracle Dialect, Unit Test and the pack variable to enable/disab…
…le data synchronization
  • Loading branch information
chenson42 committed Oct 24, 2007
1 parent 9f7ae25 commit 8f198c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions symmetric/src/main/resources/symmetric-dialects.xml
Expand Up @@ -138,12 +138,12 @@
<property name="triggerPrefix" value="${symmetric.runtime.trigger.prefix}" />
<property name="stringColumnTemplate" >
<value>
<![CDATA[ case when $(tableAlias).$(columnName) is null then '' else concat(concat('"',replace(replace($(tableAlias).$(columnName),'\\','\\\\'),'"','\\"')),'"') end ||','||]]>
<![CDATA[ case when $(tableAlias).$(columnName) is null then '' else concat(concat('"',replace(replace($(tableAlias).$(columnName),'\','\\'),'"','\"')),'"') end ||','||]]>
</value>
</property>
<property name="clobColumnTemplate">
<value>
<![CDATA[concat(concat('"',replace(replace($(tableAlias).$(columnName),to_clob('\\'),to_clob('\\')),to_clob('"'),to_clob('\\"'))),'"') ||','||]]>
<![CDATA[concat(concat('"',replace(replace($(tableAlias).$(columnName),to_clob('\'),to_clob('\\')),to_clob('"'),to_clob('\"'))),'"') ||','||]]>
</value>
</property>
<property name="blobColumnTemplate">
Expand Down
Expand Up @@ -48,14 +48,16 @@ public class DbTriggerTest {
final static String INSERT1 = "insert into "
+ TEST_TRIGGERS_TABLE
+ " (string_One_Value,string_Two_Value,long_String_Value,time_Value,date_Value,boolean_Value,bigInt_Value,decimal_Value) "
+ "values('\\\\','\"','\"1\"',null,null,1,1,1)";
+ "values(?,?,?,?,?,?,?,?)"; //'\\\\','\"','\"1\"',null,null,1,1,1)";

final static Object[] INSERT1_VALUES = new Object[] {"\\\\","\"","\"1\"",null,null,1,1,1};

final static String INSERT2 = "insert into "
+ TEST_TRIGGERS_TABLE
+ " (string_One_Value,string_Two_Value,long_String_Value,time_Value,date_Value,boolean_Value,bigInt_Value,decimal_Value) "
+ "values('here','here',1,null,null,1,1,1)";

final static String EXPECTED_INSERT1_CSV = "1,\"\\\\\",\"\\\"\",\"\\\"1\\\"\",,,1,1,1";
final static String EXPECTED_INSERT1_CSV = "1,\"\\\\\\\\\",\"\\\"\",\"\\\"1\\\"\",,,1,1,1";

final static String EXPECTED_INSERT2_CSV = "3,\"here\",\"here\",\"1\",,,1,1";

Expand Down Expand Up @@ -140,7 +142,7 @@ private void validateTestTableTriggers(SymmetricEngine engine)
throws Exception {
JdbcTemplate jdbcTemplate = getJdbcTemplate(engine);

int count = jdbcTemplate.update(INSERT1);
int count = jdbcTemplate.update(INSERT1, INSERT1_VALUES);

assert count == 1;
String csvString = getNextDataRow(engine);
Expand Down Expand Up @@ -235,7 +237,7 @@ private void testExcludedColumnsFunctionality(SymmetricEngine engine)
jdbcTemplate
.update("update "
+ TestConstants.TEST_PREFIX
+ "trigger set excluded_column_names='boolean_value', last_updated_time=current_timestamp "
+ "trigger set excluded_column_names='BOOLEAN_VALUE', last_updated_time=current_timestamp "
+ TEST_TRIGGER_WHERE_CLAUSE));

service.syncTriggers();
Expand Down Expand Up @@ -269,7 +271,7 @@ public void testDisableTriggers() throws Exception {
private void testDisableTriggers(SymmetricEngine engine) throws Exception {
JdbcTemplate jdbcTemplate = getJdbcTemplate(engine);
getDbDialect(engine).disableSyncTriggers();
int count = jdbcTemplate.update(INSERT1);
int count = jdbcTemplate.update(INSERT1, INSERT1_VALUES);
getDbDialect(engine).enableSyncTriggers();
assert count == 1;
String csvString = getNextDataRow(engine);
Expand Down

0 comments on commit 8f198c0

Please sign in to comment.