diff --git a/automated-perf-test.exe b/automated-perf-test.exe new file mode 100644 index 0000000..b593a78 Binary files /dev/null and b/automated-perf-test.exe differ diff --git a/uiServices/src/testCaseServices.go b/uiServices/src/testCaseServices.go index 778de07..1aabaa9 100644 --- a/uiServices/src/testCaseServices.go +++ b/uiServices/src/testCaseServices.go @@ -5,14 +5,15 @@ import ( "encoding/json" "encoding/xml" "fmt" - "github.com/Sirupsen/logrus" - "github.com/go-chi/chi" - "github.com/xtracdev/automated-perf-test/testStrategies" "io/ioutil" "net/http" "os" "path/filepath" "strings" + + "github.com/Sirupsen/logrus" + "github.com/go-chi/chi" + "github.com/xtracdev/automated-perf-test/testStrategies" ) const testCaseSchema string = "testCase_schema.json" @@ -150,19 +151,22 @@ func getAllTestCases(rw http.ResponseWriter, req *http.Request) { file, err := os.Open(fmt.Sprintf("%s%s", testCasePathDir, filename)) if err != nil { - logrus.Error("Cannot Open File: " + filename) + logrus.Error("File not found: " + filename) + rw.WriteHeader(http.StatusNotFound) continue } byteValue, err := ioutil.ReadAll(file) if err != nil { - logrus.Error("Cannot Read File: " + filename) + logrus.Error("An error has occured : " + filename) + rw.WriteHeader(http.StatusInternalServerError) continue } err = xml.Unmarshal(byteValue, testCase) if err != nil { - logrus.Error("Cannot Unmarshall File: " + filename) + logrus.Error("Bad request: " + filename) + rw.WriteHeader(http.StatusBadRequest) continue } diff --git a/uiServices/src/testSuiteServices.go b/uiServices/src/testSuiteServices.go index 0dc8bc4..93c360d 100644 --- a/uiServices/src/testSuiteServices.go +++ b/uiServices/src/testSuiteServices.go @@ -245,17 +245,20 @@ func getAllTestSuites(rw http.ResponseWriter, req *http.Request) { file, err := os.Open(fmt.Sprintf("%s%s", testSuitePathDir, filename)) if err != nil { - logrus.Error("Cannot open file: ", filename) + logrus.Error("File not found: ", filename) + rw.WriteHeader(http.StatusNotFound) } byteValue, err := ioutil.ReadAll(file) if err != nil { - logrus.Error("Cannot Read File: ", filename) + logrus.Error("An error has occured: ", filename) + rw.WriteHeader(http.StatusInternalServerError) } err = xml.Unmarshal(byteValue, testSuite) if err != nil { - logrus.Error("Cannot Unmarshall: ", filename) + logrus.Error("Bad request: ", filename) + rw.WriteHeader(http.StatusBadRequest) }