@Test public void should_not_contain_where_clause_on_submissions() throws Exception { // given SubmissionListFilter filter = new SubmissionListFilter(); filter.getStatuses().setStatuses(new ArrayList<>()); final DSLContext create = new DefaultDSLContext(SQLDialect.POSTGRES); final SelectJoinStep step = create.select().from(); // when SubmissionFilterAppender.appendOn(filter, step); // then assertThat("should not contain where clause on submissions", step.getSQL(), not(containsString("where 1 = 0"))); }
@SuppressWarnings("unchecked") @Override public <T extends Throwable> void doInTransactionWithException(ExceptionRunnable<T> run) throws T { Throwable[] t = new Throwable[1]; try(DSLContext c = new DefaultDSLContext(configuration)) { c.transaction(() -> { try { run.run(); } catch (Throwable e) { ExceptionUtils.rethrowRuntime(e); t[0] = e; } }); } if (t[0] != null) { throw (T)t[0]; } }
@Test(timeout = 4000) public void test02() throws Throwable { SQLDialect sQLDialect0 = SQLDialect.POSTGRES_9_4; DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0); Product product0 = new Product(); // Undeclared exception! try { WorkspaceSnapshot.selectWorkspaceClosure(defaultDSLContext0, product0); fail("Expecting exception: RuntimeException"); } catch (RuntimeException e) { // // Cannot execute query. No Connection configured // assertThrownBy("org.jooq.impl.AbstractQuery", e); } }
@Test(timeout = 4000) public void test05() throws Throwable { WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot(); Product product0 = new Product(); workspaceSnapshot0.definingProduct = product0; DefaultConfiguration defaultConfiguration0 = new DefaultConfiguration(); NoConnectionProvider noConnectionProvider0 = (NoConnectionProvider) defaultConfiguration0.connectionProvider(); SQLDialect sQLDialect0 = SQLDialect.SQLITE; Settings settings0 = new Settings(); DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(noConnectionProvider0, sQLDialect0, settings0); // Undeclared exception! try { workspaceSnapshot0.loadDefiningProduct(defaultDSLContext0); fail("Expecting exception: RuntimeException"); } catch (RuntimeException e) { // // Cannot execute query. No Connection configured // assertThrownBy("org.jooq.impl.AbstractQuery", e); } }
@Test(timeout = 4000) public void test09() throws Throwable { WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot(); Product product0 = new Product(); workspaceSnapshot0.definingProduct = product0; SQLDialect sQLDialect0 = SQLDialect.MARIADB; DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0); // Undeclared exception! try { workspaceSnapshot0.load(defaultDSLContext0); fail("Expecting exception: RuntimeException"); } catch (RuntimeException e) { // // Cannot execute query. No Connection configured // assertThrownBy("org.jooq.impl.AbstractQuery", e); } }
@Test(timeout = 4000) public void test10() throws Throwable { WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot(); Product product0 = new Product(); workspaceSnapshot0.definingProduct = product0; DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext((SQLDialect) null); // Undeclared exception! try { workspaceSnapshot0.load(defaultDSLContext0); fail("Expecting exception: NullPointerException"); } catch (NullPointerException e) { // // no message in exception (getMessage() returned null) // assertThrownBy("org.jooq.impl.AbstractScope", e); } }
@Test(timeout = 4000) public void test11() throws Throwable { UUID uUID0 = UUID.randomUUID(); SQLDialect sQLDialect0 = SQLDialect.MYSQL; DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0); // Undeclared exception! try { WorkspaceSnapshot.getAuthorizations(uUID0, defaultDSLContext0); fail("Expecting exception: RuntimeException"); } catch (RuntimeException e) { // // Cannot execute query. No Connection configured // assertThrownBy("org.jooq.impl.AbstractQuery", e); } }
@Test(timeout = 4000) public void test13() throws Throwable { UUID uUID0 = new UUID(948L, 0L); SQLDialect sQLDialect0 = SQLDialect.CUBRID; Settings settings0 = new Settings(); DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext((DataSource) null, sQLDialect0, settings0); // Undeclared exception! try { WorkspaceSnapshot.getAuthorizations(uUID0, defaultDSLContext0); fail("Expecting exception: NullPointerException"); } catch (NullPointerException e) { // // no message in exception (getMessage() returned null) // assertThrownBy("org.jooq.impl.DataSourceConnectionProvider", e); } }
@Test(timeout = 4000) public void test14() throws Throwable { WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot(); DefaultConfiguration defaultConfiguration0 = new DefaultConfiguration(); DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(defaultConfiguration0); // Undeclared exception! try { workspaceSnapshot0.deltaFrom(defaultDSLContext0, workspaceSnapshot0); fail("Expecting exception: NullPointerException"); } catch (NullPointerException e) { // // no message in exception (getMessage() returned null) // assertThrownBy("com.chiralbehaviors.CoRE.workspace.WorkspaceSnapshot", e); } }
@Test(timeout = 4000) public void test15() throws Throwable { SQLDialect sQLDialect0 = SQLDialect.H2; DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0); Product product0 = new Product(); try { new WorkspaceSnapshot(product0, defaultDSLContext0); fail("Expecting exception: RuntimeException"); } catch (RuntimeException e) { // // Cannot execute query. No Connection configured // assertThrownBy("org.jooq.impl.AbstractQuery", e); } }
@Test(timeout = 4000) public void test18() throws Throwable { Product product0 = new Product(); PGPoolingDataSource pGPoolingDataSource0 = PGPoolingDataSource.getDataSource(""); SQLDialect sQLDialect0 = SQLDialect.MARIADB; Settings settings0 = new Settings(); DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(pGPoolingDataSource0, sQLDialect0, settings0); try { new WorkspaceSnapshot(product0, defaultDSLContext0); fail("Expecting exception: NullPointerException"); } catch (NullPointerException e) { // // no message in exception (getMessage() returned null) // assertThrownBy("org.jooq.impl.DataSourceConnectionProvider", e); } }
@Test(timeout = 4000) public void test22() throws Throwable { WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot(); Jdbc3SimpleDataSource jdbc3SimpleDataSource0 = new Jdbc3SimpleDataSource(); DataSourceConnectionProvider dataSourceConnectionProvider0 = new DataSourceConnectionProvider(jdbc3SimpleDataSource0); SQLDialect sQLDialect0 = SQLDialect.FIREBIRD; Settings settings0 = new Settings(); DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(dataSourceConnectionProvider0, sQLDialect0, settings0); // Undeclared exception! try { workspaceSnapshot0.load(defaultDSLContext0); fail("Expecting exception: NullPointerException"); } catch (NullPointerException e) { // // no message in exception (getMessage() returned null) // assertThrownBy("com.chiralbehaviors.CoRE.workspace.WorkspaceSnapshot", e); } }
@Test(timeout = 4000) public void test23() throws Throwable { SQLDialect sQLDialect0 = SQLDialect.SQLITE; DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext((DataSource) null, sQLDialect0, (Settings) null); Product product0 = new Product(); // Undeclared exception! try { WorkspaceSnapshot.selectWorkspaceClosure(defaultDSLContext0, product0); fail("Expecting exception: NullPointerException"); } catch (NullPointerException e) { // // no message in exception (getMessage() returned null) // assertThrownBy("org.jooq.impl.DataSourceConnectionProvider", e); } }
@Override public void doInTransaction(Runnable run) { try(DSLContext c = new DefaultDSLContext(configuration)) { c.transaction(() -> { run.run(); }); } }
@Override public <T> T doInTransactionResult(Supplier<T> run) { try(DSLContext c = new DefaultDSLContext(configuration)) { return c.transactionResult(() -> { return run.get(); }); } }
@Test(timeout = 4000) public void test21() throws Throwable { SQLDialect sQLDialect0 = SQLDialect.POSTGRES_9_5; DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0); URL uRL0 = MockURL.getHttpExample(); // Undeclared exception! try { WorkspaceSnapshot.load(defaultDSLContext0, uRL0); fail("Expecting exception: VerifyError"); } catch (VerifyError e) { // // Bad type on operand stack // Exception Details: // Location: // com/fasterxml/jackson/databind/ObjectMapper.<clinit>()V @62: invokespecial // Reason: // Type 'com/fasterxml/jackson/databind/util/StdDateFormat' (current frame, stack[8]) is not assignable to 'java/text/DateFormat' // Current Frame: // bci: @62 // flags: { } // locals: { } // stack: { uninitialized 35, uninitialized 35, null, 'com/fasterxml/jackson/databind/AnnotationIntrospector', 'com/fasterxml/jackson/databind/introspect/VisibilityChecker', null, 'com/fasterxml/jackson/databind/type/TypeFactory', null, 'com/fasterxml/jackson/databind/util/StdDateFormat', null, 'java/util/Locale', null, 'com/fasterxml/jackson/core/Base64Variant' } // Bytecode: // 0x0000000: 1304 16b8 06ef b304 14bb 06f1 59b7 06f2 // 0x0000010: b306 e5b8 06f5 b306 e7bb 06f7 59b7 06f8 // 0x0000020: b306 e9bb 0102 5901 b206 e5b2 06e7 01b8 // 0x0000030: 00f7 01b2 06fd 01b8 0703 01b8 0709 b707 // 0x0000040: 0cb3 00fc 1307 0eb8 0713 b113 070e b807 // 0x0000050: 13bf // Exception Handler Table: // bci [0, 75] => handler: 75 // Stackmap Table: // same_locals_1_stack_item_extended(@75,Object[#1587]) // assertThrownBy("com.chiralbehaviors.CoRE.workspace.WorkspaceSnapshot", e); } }
@Bean public DefaultDSLContext dslContext(org.jooq.Configuration configuration) { return new DefaultDSLContext(configuration); }
@Bean public DefaultDSLContext dsl() { LOG.info("DSL Initialized"); return new DefaultDSLContext(config()); }
@Bean public DefaultDSLContext createDefaultDSLContext() { return new DefaultDSLContext(dataSourceConnectionProvider(), SQLDialect.MYSQL); }
@Override protected DSLContext create() { return new DefaultDSLContext(newConfiguration); }
protected DSLContext create() { return new DefaultDSLContext(configuration); }
@Bean(name="presets-jooq-context") @Inject public DefaultDSLContext dsl(@Named("presets-jooq-configuration") DefaultConfiguration config) { return new DefaultDSLContext(config); }