You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2017/10/26 07:35:30 UTC
polygene-java git commit: Remove testcase sent to JOOQ community.
Repository: polygene-java
Updated Branches:
refs/heads/develop e2b886613 -> 826cb7be4
Remove testcase sent to JOOQ community.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/826cb7be
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/826cb7be
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/826cb7be
Branch: refs/heads/develop
Commit: 826cb7be43270c25429794334fb9fb71873a2239
Parents: e2b8866
Author: niclas <ni...@hedhman.org>
Authored: Thu Oct 26 15:35:22 2017 +0800
Committer: niclas <ni...@hedhman.org>
Committed: Thu Oct 26 15:35:22 2017 +0800
----------------------------------------------------------------------
.../java/org/hedhman/niclas/Experiment.java | 78 --------------------
1 file changed, 78 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/826cb7be/extensions/entitystore-sql/src/test/java/org/hedhman/niclas/Experiment.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/hedhman/niclas/Experiment.java b/extensions/entitystore-sql/src/test/java/org/hedhman/niclas/Experiment.java
deleted file mode 100644
index 27ed3f2..0000000
--- a/extensions/entitystore-sql/src/test/java/org/hedhman/niclas/Experiment.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.hedhman.niclas;
-
-import javax.sql.DataSource;
-import org.apache.commons.dbcp2.BasicDataSource;
-import org.jooq.Configuration;
-import org.jooq.ConnectionProvider;
-import org.jooq.DSLContext;
-import org.jooq.DataType;
-import org.jooq.Field;
-import org.jooq.Name;
-import org.jooq.Record;
-import org.jooq.SQLDialect;
-import org.jooq.Table;
-import org.jooq.TransactionProvider;
-import org.jooq.conf.RenderNameStyle;
-import org.jooq.conf.Settings;
-import org.jooq.impl.DSL;
-import org.jooq.impl.DataSourceConnectionProvider;
-import org.jooq.impl.DefaultConfiguration;
-import org.jooq.impl.SQLDataType;
-import org.jooq.impl.TableImpl;
-import org.jooq.impl.ThreadLocalTransactionProvider;
-import org.junit.Test;
-
-public class Experiment
-{
- @Test
- public void test1()
- throws Exception
- {
- String host = "127.0.0.1";
- int port = 3306;
- DataSource dataSource = dbcpDataSource( host, port );
- Settings settings = new Settings().withRenderNameStyle( RenderNameStyle.QUOTED );
- SQLDialect dialect = SQLDialect.MARIADB;
-
- ConnectionProvider connectionProvider = new DataSourceConnectionProvider( dataSource );
- TransactionProvider transactionProvider = new ThreadLocalTransactionProvider( connectionProvider, false );
- Configuration configuration = new DefaultConfiguration()
- .set( dialect )
- .set( connectionProvider )
- .set( transactionProvider )
- .set( settings );
-
- DSLContext dsl = DSL.using( configuration );
-
- Field<String> identityColumn = DSL.field( DSL.name( "_identity" ), SQLDataType.VARCHAR );
- Name entitiesTableName = DSL.name( "ENTITIES" );
- Table<Record> entitiesTable = new TableImpl<Record>( entitiesTableName );
- dsl.transaction( t -> {
-
- dsl.createTableIfNotExists( entitiesTable )
- .column( identityColumn )
- .execute();
- });
-
- dsl.transaction( t -> {
- dsl.insertInto( entitiesTable )
- .set( identityColumn, "12" )
- .execute();
- });
- }
-
- private DataSource dbcpDataSource( String host, int port )
- throws Exception
- {
- BasicDataSource pool = new BasicDataSource();
-
- String driverClass = "com.mysql.jdbc.Driver";
- Class.forName( driverClass );
- pool.setDriverClassName( driverClass );
- pool.setUrl( "jdbc:mysql://" + host + ":" + port + "/testdb" );
- pool.setUsername( "root" );
- pool.setPassword( "testing" );
- pool.setDefaultAutoCommit( false );
- return pool;
- }
-}