12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- // Copyright The OpenTelemetry Authors
- // SPDX-License-Identifier: Apache-2.0
- package syslogexporter
- import (
- "testing"
- "time"
- "github.com/cenkalti/backoff/v4"
- "github.com/stretchr/testify/assert"
- "go.opentelemetry.io/collector/component"
- "go.opentelemetry.io/collector/exporter/exporterhelper"
- )
- func TestType(t *testing.T) {
- factory := NewFactory()
- pType := factory.Type()
- assert.Equal(t, pType, component.Type("syslog"))
- }
- func TestCreateDefaultConfig(t *testing.T) {
- cfg := createDefaultConfig()
- assert.Equal(t, cfg, &Config{
- Port: 514,
- Network: "tcp",
- Protocol: "rfc5424",
- QueueSettings: exporterhelper.QueueSettings{
- Enabled: false,
- NumConsumers: 10,
- QueueSize: 1000,
- },
- RetrySettings: exporterhelper.RetrySettings{
- Enabled: true,
- InitialInterval: 5 * time.Second,
- RandomizationFactor: backoff.DefaultRandomizationFactor,
- Multiplier: backoff.DefaultMultiplier,
- MaxInterval: 30 * time.Second,
- MaxElapsedTime: 5 * time.Minute,
- },
- TimeoutSettings: exporterhelper.TimeoutSettings{
- Timeout: 5 * time.Second,
- },
- })
- }
|