示例#1
0
 @Test
 public void testSourceNotRequired() throws Exception {
   Command command =
       helpGetCommand(
           "update bqt1.smalla set stringkey = 1 where stringkey = 2", EXAMPLE_BQT); // $NON-NLS-1$
   AtomicRequestMessage arm = createNewAtomicRequestMessage(1, 1);
   arm.setCommand(command);
   ConnectorManager cm = TestConnectorManager.getConnectorManager();
   cm.getExecutionFactory().setSourceRequired(false);
   ConnectorWork synchConnectorWorkItem = cm.registerRequest(arm);
   synchConnectorWorkItem.execute();
   synchConnectorWorkItem.close();
   FakeConnector fc = (FakeConnector) cm.getExecutionFactory();
   assertEquals(1, fc.getConnectionCount());
   assertEquals(1, fc.getCloseCount());
 }
示例#2
0
 @Test
 public void testConvertIn() throws Exception {
   Command command =
       helpGetCommand(
           "select intkey from bqt1.smalla where stringkey in ('1', '2')",
           EXAMPLE_BQT); //$NON-NLS-1$
   AtomicRequestMessage arm = createNewAtomicRequestMessage(1, 1);
   arm.setCommand(command);
   ConnectorManager cm = TestConnectorManager.getConnectorManager();
   cm.getExecutionFactory().setSourceRequired(false);
   ConnectorWork synchConnectorWorkItem = cm.registerRequest(arm);
   synchConnectorWorkItem.execute();
   synchConnectorWorkItem.close();
   FakeConnector fc = (FakeConnector) cm.getExecutionFactory();
   assertEquals(
       "SELECT SmallA.IntKey FROM SmallA WHERE SmallA.StringKey = '2' OR SmallA.StringKey = '1'",
       fc.getCommands().get(0).toString());
   assertEquals(1, fc.getConnectionCount());
   assertEquals(1, fc.getCloseCount());
 }