Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.JdbcOperations


    double arg1 = 24.7;
    String arg2 = "foo";
    Object arg3 = new Object();

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, Date.class);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here


    double arg1 = 24.7;
    String arg2 = "foo";
    Object arg3 = new Object();

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, Date.class);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here

    double arg1 = 24.7;
    String arg2 = "foo";
    Object arg3 = new Object();

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, Date.class);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here

        return new Date();
      }
    };

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, rm);
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
    Date result = jth.queryForObject(sql, rm);
View Full Code Here

        return new Date();
      }
    };

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, rm);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here

        return new Date();
      }
    };

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, rm);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here

      unifiedTypes2[unifiedTypes2.length - 1] = Object[].class;
      unifiedArgs2[unifiedArgs2.length - 1] = new Object[]{};
    }

    MockControl mc;
    JdbcOperations jo = null;
    NamedParameterJdbcOperations npjo = null;
    Method joMethod = null;
    SimpleJdbcTemplate jth = null;

    if (namedParameters) {
View Full Code Here

    when(incrementerFactory.getIncrementer("ORACLE", tablePrefix + "STEP_EXECUTION_SEQ")).thenReturn(new StubIncrementer());
    factory.setIncrementerFactory(incrementerFactory);

    factory.afterPropertiesSet();
   
    JdbcOperations jdbcOperations = (JdbcOperations) ReflectionTestUtils.getField(factory, "jdbcOperations");
    assertTrue(jdbcOperations instanceof JdbcTemplate);
 
View Full Code Here

    when(incrementerFactory.getIncrementer("ORACLE", tablePrefix + "JOB_SEQ")).thenReturn(new StubIncrementer());
    when(incrementerFactory.getIncrementer("ORACLE", tablePrefix + "JOB_EXECUTION_SEQ")).thenReturn(new StubIncrementer());
    when(incrementerFactory.getIncrementer("ORACLE", tablePrefix + "STEP_EXECUTION_SEQ")).thenReturn(new StubIncrementer());
    factory.setIncrementerFactory(incrementerFactory);
   
    JdbcOperations customJdbcOperations = mock(JdbcOperations.class);
    factory.setJdbcOperations(customJdbcOperations);
   
    factory.afterPropertiesSet();
   
    assertEquals(customJdbcOperations, ReflectionTestUtils.getField(factory, "jdbcOperations"));
View Full Code Here

 
  @Test
  public void testDefaultJdbcOperations() throws Exception {
   
    factory.afterPropertiesSet();
    JdbcOperations jdbcOperations = (JdbcOperations) ReflectionTestUtils.getField(factory, "jdbcOperations");
    assertTrue(jdbcOperations instanceof JdbcTemplate);
 
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.JdbcOperations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.