diff --git a/global_test.go b/global_test.go index 3b0a2af..5aa99e0 100644 --- a/global_test.go +++ b/global_test.go @@ -5,7 +5,7 @@ import ( "sync" "testing" - "forge.lthn.ai/core/go/pkg/core" + framework "forge.lthn.ai/core/go/pkg/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -53,12 +53,12 @@ func TestGlobal_SetDefault(t *testing.T) { } }() - core, err := core.New( - core.WithName("process", NewService(Options{})), + c, err := framework.New( + framework.WithName("process", NewService(Options{})), ) require.NoError(t, err) - svc, err := core.ServiceFor[*Service](core, "process") + svc, err := framework.ServiceFor[*Service](c, "process") require.NoError(t, err) SetDefault(svc) @@ -81,12 +81,12 @@ func TestGlobal_ConcurrentDefault(t *testing.T) { } }() - core, err := core.New( - core.WithName("process", NewService(Options{})), + c, err := framework.New( + framework.WithName("process", NewService(Options{})), ) require.NoError(t, err) - svc, err := core.ServiceFor[*Service](core, "process") + svc, err := framework.ServiceFor[*Service](c, "process") require.NoError(t, err) SetDefault(svc) @@ -117,12 +117,12 @@ func TestGlobal_ConcurrentSetDefault(t *testing.T) { // Create multiple services var services []*Service for i := 0; i < 10; i++ { - core, err := core.New( - core.WithName("process", NewService(Options{})), + c, err := framework.New( + framework.WithName("process", NewService(Options{})), ) require.NoError(t, err) - svc, err := core.ServiceFor[*Service](core, "process") + svc, err := framework.ServiceFor[*Service](c, "process") require.NoError(t, err) services = append(services, svc) } @@ -161,12 +161,12 @@ func TestGlobal_ConcurrentOperations(t *testing.T) { } }() - core, err := core.New( - core.WithName("process", NewService(Options{})), + c, err := framework.New( + framework.WithName("process", NewService(Options{})), ) require.NoError(t, err) - svc, err := core.ServiceFor[*Service](core, "process") + svc, err := framework.ServiceFor[*Service](c, "process") require.NoError(t, err) SetDefault(svc) diff --git a/runner_test.go b/runner_test.go index 7c3f354..b1be48d 100644 --- a/runner_test.go +++ b/runner_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "forge.lthn.ai/core/go/pkg/core" + framework "forge.lthn.ai/core/go/pkg/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -12,12 +12,12 @@ import ( func newTestRunner(t *testing.T) *Runner { t.Helper() - core, err := core.New( - core.WithName("process", NewService(Options{})), + c, err := framework.New( + framework.WithName("process", NewService(Options{})), ) require.NoError(t, err) - svc, err := core.ServiceFor[*Service](core, "process") + svc, err := framework.ServiceFor[*Service](c, "process") require.NoError(t, err) return NewRunner(svc) diff --git a/service_test.go b/service_test.go index b5ad3a1..dc8c85b 100644 --- a/service_test.go +++ b/service_test.go @@ -7,23 +7,23 @@ import ( "testing" "time" - "forge.lthn.ai/core/go/pkg/core" + framework "forge.lthn.ai/core/go/pkg/core" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -func newTestService(t *testing.T) (*Service, *core.Core) { +func newTestService(t *testing.T) (*Service, *framework.Core) { t.Helper() - core, err := core.New( - core.WithName("process", NewService(Options{BufferSize: 1024})), + c, err := framework.New( + framework.WithName("process", NewService(Options{BufferSize: 1024})), ) require.NoError(t, err) - svc, err := core.ServiceFor[*Service](core, "process") + svc, err := framework.ServiceFor[*Service](c, "process") require.NoError(t, err) - return svc, core + return svc, c } func TestService_Start(t *testing.T) { @@ -120,8 +120,8 @@ func TestService_Run(t *testing.T) { func TestService_Actions(t *testing.T) { t.Run("broadcasts events", func(t *testing.T) { - core, err := core.New( - core.WithName("process", NewService(Options{})), + c, err := framework.New( + framework.WithName("process", NewService(Options{})), ) require.NoError(t, err) @@ -130,7 +130,7 @@ func TestService_Actions(t *testing.T) { var exited []ActionProcessExited var mu sync.Mutex - core.RegisterAction(func(c *core.Core, msg core.Message) error { + c.RegisterAction(func(cc *framework.Core, msg framework.Message) error { mu.Lock() defer mu.Unlock() switch m := msg.(type) { @@ -144,7 +144,7 @@ func TestService_Actions(t *testing.T) { return nil }) - svc, _ := core.ServiceFor[*Service](core, "process") + svc, _ := framework.ServiceFor[*Service](c, "process") proc, err := svc.Start(context.Background(), "echo", "test") require.NoError(t, err)