Ejemplo n.º 1
0
        private void checkSQL(ExecuteContext ctx, boolean patched) {
            for (int i = 0; i < rendered; i++) {
                assertTrue(ctx.batchQueries()[i].toString().toLowerCase().contains("insert"));

                if (patched) {
                    assertTrue(ctx.batchSQL()[i].toLowerCase().contains("values    ("));
                }
            }
        }
Ejemplo n.º 2
0
        @SuppressWarnings("serial")
        private void checkBase(ExecuteContext ctx) {
            assertNotNull(ctx.query());
            assertNotNull(ctx.batchQueries());
            assertTrue(ctx.query().toString().toLowerCase().contains("select"));
            assertTrue(ctx.batchQueries()[0].toString().toLowerCase().contains("select"));
            assertEquals(ctx.query(), ctx.batchQueries()[0]);
            assertEquals(1, ctx.batchSQL().length);

            assertEquals("Bar", ctx.getData("Foo"));
            assertEquals("Baz", ctx.getData("Bar"));
            assertEquals(new HashMap<String, String>() {{
                put("Foo", "Bar");
                put("Bar", "Baz");
            }}, ctx.getData());

            assertNull(ctx.routine());
            assertEquals(ExecuteType.READ, ctx.type());
        }