embulk-output-sqlserver 0.6.5 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 061683eb985abcdb6dfdeb2f8f69d959724699da
4
- data.tar.gz: acf3b941ce60f1a7f3ff844893e5bbfe1d50eb59
3
+ metadata.gz: dad9cc8adb34ede9de7d4928636e1c79f465f4d3
4
+ data.tar.gz: 21b9f512ffa74a2ce15a426f9202037a47357276
5
5
  SHA512:
6
- metadata.gz: 32691b72800b548ede9ba7d9035c7fd948542f5c273e6a1deca18363966b0ccd55d5a35792c53cb1d98eb575082f3651c5b200abe73e41f1b97c8f1628817500
7
- data.tar.gz: 4c43cda38c7c2f27650bb072efe6c02cccb3f7371b7c20274bb4f30b77b3c5af6e2c3bb2c9a51a7b6b98bf10e75c4432cd2a60b942903edae146ee8dabfde6ca
6
+ metadata.gz: a125d3123a15b602a18b9c3a3feaa26c1d901a9d4e93a083e5bb3bc4897bfb815ffc27c5399a209a5af870481af922bc8782e8a1756a3c05fe52ab48c0018d92
7
+ data.tar.gz: d82c71b0a77c92fcd9d7ccf0f6e8e6805ef8618c5956f216cab06b4352b48396cd8da3f96a59d7ec296a7c94bdf05396d39ce681a38eb35164e4efbb053a8357
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # SQL Server output plugins for Embulk
1
+ # SQL Server output plugin for Embulk
2
2
 
3
- SQL Server output plugins for Embulk loads records to SQL Server.
3
+ SQL Server output plugin for Embulk loads records to SQL Server.
4
4
 
5
5
  ## Overview
6
6
 
data/build.gradle CHANGED
@@ -3,6 +3,6 @@ dependencies {
3
3
  compile 'net.sourceforge.jtds:jtds:1.3.1'
4
4
 
5
5
  testCompile 'org.embulk:embulk-standards:0.8.8'
6
- testCompile files('../embulk-output-jdbc/build/classes/test/')
6
+ testCompile project(':embulk-output-jdbc').sourceSets.test.output
7
7
  testCompile files('driver/sqljdbc41.jar')
8
8
  }
@@ -3,7 +3,6 @@ package org.embulk.output.sqlserver;
3
3
  import org.embulk.output.AbstractJdbcOutputPluginTest;
4
4
  import org.embulk.output.SQLServerOutputPlugin;
5
5
  import org.embulk.spi.OutputPlugin;
6
- import org.junit.BeforeClass;
7
6
  import org.junit.Test;
8
7
 
9
8
  import java.math.BigDecimal;
@@ -19,19 +18,19 @@ import java.util.Date;
19
18
  import java.util.Iterator;
20
19
  import java.util.List;
21
20
 
21
+ import static java.util.Locale.ENGLISH;
22
22
  import static org.junit.Assert.assertEquals;
23
23
 
24
24
 
25
25
  public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
26
26
  {
27
- private static boolean useJtdsDriver = false;
28
- static {
27
+ private boolean useJtdsDriver = false;
28
+
29
+
30
+ @Override
31
+ protected void prepare() throws SQLException {
29
32
  tester.addPlugin(OutputPlugin.class, "sqlserver", SQLServerOutputPlugin.class);
30
- }
31
33
 
32
- @BeforeClass
33
- public static void beforeClass()
34
- {
35
34
  try {
36
35
  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
37
36
  } catch (ClassNotFoundException e) {
@@ -40,13 +39,14 @@ public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
40
39
  }
41
40
 
42
41
  try {
43
- new SQLServerOutputPluginTest().connect();
42
+ connect();
44
43
  enabled = true;
45
44
  } catch (Throwable t) {
46
45
  System.out.println(t);
47
46
  } finally {
48
47
  if (!enabled) {
49
- System.out.println("Warning: you should prepare database in order to test (server = localhost, port = 1433, instance = SQLEXPRESS, database = TESTDB, user = TEST_USER, password = TEST_PW).");
48
+ System.out.println(String.format(ENGLISH, "Warning: you should prepare database in order to test (server = %s, port = %d, database = %s, user = %s, password = %s).",
49
+ getHost(), getPort(), getDatabase(), getUser(), getPassword()));
50
50
  }
51
51
  }
52
52
  }
@@ -341,7 +341,8 @@ public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
341
341
  } catch (Throwable t) {
342
342
  System.out.println(t);
343
343
  System.out.println("Warning: jTDS driver can't connect to database.");
344
- System.out.println("(server = localhost, port = 1433, instance = SQLEXPRESS, database = TESTDB, user = TEST_USER, password = TEST_PW)");
344
+ System.out.println(String.format(ENGLISH, "(server = %s, port = %d, database = %s, user = %s, password = %s)",
345
+ getHost(), getPort(), getDatabase(), getUser(), getPassword()));
345
346
  return;
346
347
  }
347
348
 
@@ -771,11 +772,13 @@ public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
771
772
  @Override
772
773
  protected Connection connect() throws SQLException
773
774
  {
775
+ String url;
774
776
  if(useJtdsDriver) {
775
- return DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/TESTDB;instance=SQLEXPRESS;useLOBs=false", "TEST_USER", "test_pw");
777
+ url = "jdbc:jtds:sqlserver://%s:%d/%s;useLOBs=false";
776
778
  } else {
777
- return DriverManager.getConnection("jdbc:sqlserver://localhost\\SQLEXPRESS:1433;databasename=TESTDB", "TEST_USER", "test_pw");
779
+ url = "jdbc:sqlserver://%s:%d;databasename=%s";
778
780
  }
781
+ return DriverManager.getConnection(String.format(ENGLISH, url, getHost(), getPort(), getDatabase()), getUser(), getPassword());
779
782
  }
780
783
 
781
784
  }
@@ -35,9 +35,9 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST1
43
43
  mode: insert_direct
@@ -35,9 +35,9 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST1
43
43
  mode: insert
@@ -35,9 +35,9 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST1
43
43
  mode: insert_direct
@@ -17,10 +17,10 @@ in:
17
17
  - {name: ITEM7, type: timestamp, format: '%H:%M:%S.%N'}
18
18
  out:
19
19
  type: sqlserver
20
- host: localhost
21
- database: TESTDB
22
- user: TEST_USER
23
- password: test_pw
20
+ host: #host#
21
+ database: #database#
22
+ user: #user#
23
+ password: #password#
24
24
  table: TEST5
25
25
  mode: insert_direct
26
26
  insert_method: native
@@ -16,10 +16,10 @@ in:
16
16
  - {name: ITEM6, type: double}
17
17
  out:
18
18
  type: sqlserver
19
- host: localhost
20
- database: TESTDB
21
- user: TEST_USER
22
- password: test_pw
19
+ host: #host#
20
+ database: #database#
21
+ user: #user#
22
+ password: #password#
23
23
  table: TEST4
24
24
  mode: insert_direct
25
25
  insert_method: native
@@ -15,10 +15,10 @@ in:
15
15
  - {name: ITEM5, type: long}
16
16
  out:
17
17
  type: sqlserver
18
- host: localhost
19
- database: TESTDB
20
- user: TEST_USER
21
- password: test_pw
18
+ host: #host#
19
+ database: #database#
20
+ user: #user#
21
+ password: #password#
22
22
  table: TEST3
23
23
  mode: insert_direct
24
24
  insert_method: native
@@ -16,10 +16,10 @@ in:
16
16
  - {name: ITEM6, type: string}
17
17
  out:
18
18
  type: sqlserver
19
- host: localhost
20
- database: TESTDB
21
- user: TEST_USER
22
- password: test_pw
19
+ host: #host#
20
+ database: #database#
21
+ user: #user#
22
+ password: #password#
23
23
  table: TEST2
24
24
  mode: insert_direct
25
25
  insert_method: native
@@ -35,10 +35,10 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST1
43
43
  mode: insert_direct
44
44
  insert_method: native
@@ -35,9 +35,9 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST___A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789
43
43
  mode: replace
@@ -35,9 +35,9 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST1
43
43
  mode: replace
@@ -35,10 +35,10 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST1
43
43
  mode: insert_direct
44
44
  column_options:
@@ -35,9 +35,9 @@ in:
35
35
  - {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
36
36
  out:
37
37
  type: sqlserver
38
- host: localhost
39
- database: TESTDB
40
- user: TEST_USER
41
- password: test_pw
38
+ host: #host#
39
+ database: #database#
40
+ user: #user#
41
+ password: #password#
42
42
  table: TEST1
43
43
  mode: truncate_insert
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-sqlserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-11 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -19,8 +19,8 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - build.gradle
22
- - classpath/embulk-output-jdbc-0.6.5.jar
23
- - classpath/embulk-output-sqlserver-0.6.5.jar
22
+ - classpath/embulk-output-jdbc-0.7.0.jar
23
+ - classpath/embulk-output-sqlserver-0.7.0.jar
24
24
  - classpath/jtds-1.3.1.jar
25
25
  - lib/embulk/output/sqlserver.rb
26
26
  - src/main/java/org/embulk/output/SQLServerOutputPlugin.java