summaryrefslogtreecommitdiff
path: root/plugins/app/tests/plugin_1.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-05 17:58:23 +0300
committerGitHub <[email protected]>2020-11-05 17:58:23 +0300
commit9fbe7726dd55cfedda724b7644e1b6bf7c1a6cb4 (patch)
treef2bf9b97d38103de51e2d140aa76666f9c6341c8 /plugins/app/tests/plugin_1.go
parentedc45b3e24afdb5e56e74ffbbbd50e0e3b04922b (diff)
parent73da7300fcc9b8b22faa1c91fc1faff22ab944ff (diff)
Merge pull request #388 from spiral/enhancement/testsv2.0.0-alpha15
Tests for the new plugins
Diffstat (limited to 'plugins/app/tests/plugin_1.go')
-rw-r--r--plugins/app/tests/plugin_1.go55
1 files changed, 0 insertions, 55 deletions
diff --git a/plugins/app/tests/plugin_1.go b/plugins/app/tests/plugin_1.go
deleted file mode 100644
index 7259ea9d..00000000
--- a/plugins/app/tests/plugin_1.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package tests
-
-import (
- "errors"
- "fmt"
-
- "github.com/spiral/roadrunner/v2/plugins/app"
- "github.com/spiral/roadrunner/v2/plugins/config"
-)
-
-type Foo struct {
- configProvider config.Provider
- spawner app.WorkerFactory
-}
-
-func (f *Foo) Init(p config.Provider, spw app.WorkerFactory) error {
- f.configProvider = p
- f.spawner = spw
- return nil
-}
-
-func (f *Foo) Serve() chan error {
- errCh := make(chan error, 1)
-
- r := &app.Config{}
- err := f.configProvider.UnmarshalKey("app", r)
- if err != nil {
- errCh <- err
- return errCh
- }
-
- cmd, err := f.spawner.CmdFactory(nil)
- if err != nil {
- errCh <- err
- return errCh
- }
- if cmd == nil {
- errCh <- errors.New("command is nil")
- return errCh
- }
- a := cmd()
- out, err := a.Output()
- if err != nil {
- errCh <- err
- return errCh
- }
-
- fmt.Println(string(out))
-
- return errCh
-}
-
-func (f *Foo) Stop() error {
- return nil
-}