Skip to content

Commit

Permalink
Test all wsdl files in fixture folder at least pass go fmt syntax checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbornm committed Sep 11, 2015
1 parent 2e8ea25 commit 11df3b6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gowsdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (g *GoWsdl) unmarshal() error {

parsedUrl, err := url.Parse(g.file)
if parsedUrl.Scheme == "" {
log.Println("Reading", "file", g.file)
//log.Println("Reading", "file", g.file)

data, err = ioutil.ReadFile(g.file)
if err != nil {
Expand Down
34 changes: 34 additions & 0 deletions gowsdl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package gowsdl
import (
"testing"
"strings"
"go/format"
"bytes"
"path/filepath"
)

func TestElementGenerationDoesntCommentOutStructProperty(t *testing.T) {
Expand All @@ -21,3 +24,34 @@ func TestElementGenerationDoesntCommentOutStructProperty(t *testing.T) {
t.Error(string(resp["types"]))
}
}

func TestVboxGeneratesWithoutSyntaxErrors(t *testing.T) {
files, err := filepath.Glob("fixtures/*.wsdl")
if err != nil {
t.Error(err)
}

for _,file := range files {
g := GoWsdl{
file: file,
pkg: "myservice",
}

resp,err := g.Start()
if err != nil {
continue
//t.Error(err)
}

data := new(bytes.Buffer)
data.Write(resp["header"])
data.Write(resp["types"])
data.Write(resp["operations"])
data.Write(resp["soap"])

_, err = format.Source(data.Bytes())
if err != nil {
t.Error(err)
}
}
}

0 comments on commit 11df3b6

Please sign in to comment.