Skip to content

Commit

Permalink
reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Jul 30, 2019
1 parent 5d22c7b commit 64c12bf
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## July 29 2019 - v0.10.2
## July 29 2019 - v0.10.3
* Patched mysql script parsing

## July 10 2019 - v0.10.1
Expand Down
8 changes: 2 additions & 6 deletions example/aerospike/aerospike_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ func TestDsunit_Aerospike(t *testing.T) {
}
}




func runSomeBusinessLogic() error {
config, err := dsc.NewConfigWithParameters("aerospike", "tcp(127.0.0.1:3000)/[namespace]", "", map[string]interface{}{
"namespace": "test",
Expand All @@ -81,11 +78,10 @@ func runSomeBusinessLogic() error {
return nil
}


func startAerospike() error {

_, err := endlyManager.Run(endlyContext, &docker.RunRequest{
Image: "aerospike/aerospike-server:latest",
Image: "aerospike/aerospike-server:latest",
Ports: map[string]string{
"3000": "3000",
"3001": "3001",
Expand All @@ -100,7 +96,7 @@ func startAerospike() error {

func stopAerospike() error {
_, err := endlyManager.Run(endlyContext, &docker.StopRequest{
Name: "aerospike_dsunit",
Name: "aerospike_dsunit",
})
if err != nil {
return err
Expand Down
6 changes: 0 additions & 6 deletions example/casandra/casandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ func TestDsunit_Casandra(t *testing.T) {
dsunit.ExpectFor(t, "mydb", dsunit.FullTableDatasetCheckPolicy, "data", "use_case_1")
}



func casandraRunSomeBusinessLogic() error {
config, err := dsc.NewConfigWithParameters("cql", "127.0.0.1?keyspace=mydb", "", nil)
if err != nil {
Expand All @@ -79,9 +77,6 @@ func casandraRunSomeBusinessLogic() error {
return nil
}




func startCasandra() error {

_, err := endlyManager.Run(endlyContext, &docker.RunRequest{
Expand All @@ -108,4 +103,3 @@ func stopCasandra() error {
return err

}

9 changes: 3 additions & 6 deletions example/mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func mySQLTearDown(t *testing.T) {
}
}


func TestDsunit_MySQL(t *testing.T) {
mySQLSetup(t)
defer mySQLTearDown(t)
Expand All @@ -66,7 +65,6 @@ func TestDsunit_MySQL(t *testing.T) {
assert.Equal(t, "ok", resp.Status)
}


dumpRequest, _ := dsunit.NewDumpRequestFromURL(path.Join(parent, "dump_req.yaml"))
resp := service.Dump(dumpRequest)
assert.Equal(t, "ok", resp.Status)
Expand Down Expand Up @@ -97,11 +95,11 @@ func mySQLRunSomeBusinessLogic() error {
return nil
}


var mysqlCredentials = url.NewResource("config/secret.json").URL

func startMySQL() error {
_, err := endlyManager.Run(endlyContext, &docker.RunRequest{
Image: "mysql:5.6",
Image: "mysql:5.6",
Ports: map[string]string{
"3306": "3306",
},
Expand All @@ -120,10 +118,9 @@ func startMySQL() error {
return err
}


func stopMySQL() error {
_, err := endlyManager.Run(endlyContext, &docker.StopRequest{
Name: "mysql_dsunit",
Name: "mysql_dsunit",
})
return err

Expand Down
14 changes: 5 additions & 9 deletions example/ora/ora_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ Prerequisites:
var endlyManager = endly.New()
var endlyContext = endlyManager.NewContext(toolbox.NewContext())



func setup(t *testing.T) {

err := startOracle()
Expand All @@ -51,7 +49,7 @@ func TestDsunit_Oracle(t *testing.T) {
setup(t)
defer tearDown(t)

// showCreateTable()
// showCreateTable()

if dsunit.InitFromURL(t, "config/init.json") {
if !dsunit.PrepareFor(t, "mydb", "data", "use_case_1") {
Expand All @@ -75,18 +73,16 @@ func showCreateTable() error {
return err
}
dialect := dsc.GetDatastoreDialect("oci8")
DDL, err := dialect.ShowCreateTable(manager, "events")
DDL, err := dialect.ShowCreateTable(manager, "events")

dd := strings.Replace(DDL, "events", "events_993999", 1)
dd = strings.Replace(dd, ";", "", 1)

_, err =manager.Execute(dd )
_, err = manager.Execute(dd)
fmt.Printf("DML: %v %v\n", DDL, err)
return nil
}



func runSomeBusinessLogic() error {
config, err := dsc.NewConfigWithParameters("oci8", "mydb/[email protected]:1521/xe", "", nil)
if err != nil {
Expand All @@ -113,7 +109,7 @@ func runSomeBusinessLogic() error {
func startOracle() error {

_, err := endlyManager.Run(endlyContext, &docker.RunRequest{
Image: "thebookpeople/oracle-xe-11g",
Image: "thebookpeople/oracle-xe-11g",
Env: map[string]string{
"ORACLE_ALLOW_REMOTE": "true",
},
Expand All @@ -127,7 +123,7 @@ func startOracle() error {

func stopOracle() error {
_, err := endlyManager.Run(endlyContext, &docker.StopRequest{
Name: "ora_dsunit",
Name: "ora_dsunit",
})
return err

Expand Down
1 change: 0 additions & 1 deletion example/pg/pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func runSomeBusinessLogic() error {

var pgCredential = url.NewResource("config/secret.json").URL


func startPostgres() error {
_, err := endlyManager.Run(endlyContext, &docker.RunRequest{
Image: "postgres:9.6-alpine",
Expand Down

0 comments on commit 64c12bf

Please sign in to comment.