@Test
    public void testUpgradeTables() throws Exception {
        TestRMTxStore store = new TestRMTxStore();
        store.setDriverClassName("org.apache.derby.jdbc.EmbeddedDriver");
        // workaround for the db file deletion problem during the tests
        store.setUrl(MessageFormat.format("jdbc:derby:{0};create=true", TEST_DB_NAME));
        // use the old db definitions to create the tables
        store.init();
        // verify the absence of the new columns in the tables
        verifyColumns(store, "CXF_RM_SRC_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, true);
        verifyColumns(store, "CXF_RM_DEST_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, true);
        verifyColumns(store, INBOUND_MSGS_TABLE_NAME, new String[]{}, true);
        verifyColumns(store, OUTBOUND_MSGS_TABLE_NAME, new String[]{}, true);
        // upgrade the tables and add new columns to the old tables
        store.upgrade();
        store.init();
        // verify the presence of the new columns in the upgraded tables
        verifyColumns(store, "CXF_RM_SRC_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, false);
        verifyColumns(store, "CXF_RM_DEST_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, false);
        verifyColumns(store, INBOUND_MSGS_TABLE_NAME, new String[]{}, false);
        verifyColumns(store, OUTBOUND_MSGS_TABLE_NAME, new String[]{}, false);
    }
@Test
    public void testUpgradeTables() throws Exception {
        TestRMTxStore store = new TestRMTxStore();
        store.setDriverClassName("org.apache.derby.jdbc.EmbeddedDriver");
       
        store.setUrl(MessageFormat.format("jdbc:derby:{0};create=true", TEST_DB_NAME));
       
        store.init();
       
        verifyColumns(store, "CXF_RM_SRC_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, true);
        verifyColumns(store, "CXF_RM_DEST_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, true);
        verifyColumns(store, INBOUND_MSGS_TABLE_NAME, new String[]{}, true);
        verifyColumns(store, OUTBOUND_MSGS_TABLE_NAME, new String[]{}, true);
       
        store.upgrade();
        store.init();
       
        verifyColumns(store, "CXF_RM_SRC_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, false);
        verifyColumns(store, "CXF_RM_DEST_SEQUENCES", new String[]{"PROTOCOL_VERSION"}, false);
        verifyColumns(store, INBOUND_MSGS_TABLE_NAME, new String[]{}, false);
        verifyColumns(store, OUTBOUND_MSGS_TABLE_NAME, new String[]{}, false);
    }
@test public void testupgradetables() throws exception { testrmtxstore store = new testrmtxstore(); store.setdriverclassname("org.apache.derby.jdbc.embeddeddriver"); store.seturl(messageformat.format("jdbc:derby:{0};create=true", test_db_name)); store.init(); verifycolumns(store, "cxf_rm_src_sequences", new string[]{"protocol_version"}, true); verifycolumns(store, "cxf_rm_dest_sequences", new string[]{"protocol_version"}, true); verifycolumns(store, inbound_msgs_table_name, new string[]{}, true); verifycolumns(store, outbound_msgs_table_name, new string[]{}, true); store.upgrade(); store.init(); verifycolumns(store, "cxf_rm_src_sequences", new string[]{"protocol_version"}, false); verifycolumns(store, "cxf_rm_dest_sequences", new string[]{"protocol_version"}, false); verifycolumns(store, inbound_msgs_table_name, new string[]{}, false); verifycolumns(store, outbound_msgs_table_name, new string[]{}, false); }