Skip to content

Commit

Permalink
#178 Savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Feb 7, 2025
1 parent f2b5358 commit 1d1a667
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 24 deletions.
14 changes: 10 additions & 4 deletions szconfig/szconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,21 +244,27 @@ func TestSzconfig_AsInterface(test *testing.T) {
// ----------------------------------------------------------------------------

func getSzConfig(ctx context.Context) *Szconfig {
_ = ctx

testValue := &testdata.TestData{
Int64s: testdata.Data1_int64s,
Strings: testdata.Data1_strings,
Uintptrs: testdata.Data1_uintptrs,
}

return &Szconfig{
result := &Szconfig{
AddDataSourceResult: testValue.String("AddDataSourceResult"),
CreateConfigResult: testValue.Uintptr("CreateConfigResult"),
GetDataSourcesResult: testValue.String("GetDataSourcesResult"),
ImportConfigResult: testValue.Uintptr("ImportConfigResult"),
ExportConfigResult: testValue.String("ExportConfigResult"),
}
err := result.SetLogLevel(ctx, "TRACE")
if err != nil {
panic(err)
}
err = result.RegisterObserver(ctx, observerSingleton)
if err != nil {
panic(err)
}
return result

}

Expand Down
16 changes: 11 additions & 5 deletions szconfigmanager/szconfigmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,26 @@ func getSzConfig(ctx context.Context) (senzing.SzConfig, error) {
}

func getSzConfigManager(ctx context.Context) (*Szconfigmanager, error) {
_ = ctx

testValue := &testdata.TestData{
Int64s: testdata.Data1_int64s,
Strings: testdata.Data1_strings,
Uintptrs: testdata.Data1_uintptrs,
}

return &Szconfigmanager{
result := &Szconfigmanager{
AddConfigResult: testValue.Int64("AddConfigResult"),
GetConfigResult: testValue.String("GetConfigResult"),
GetConfigsResult: testValue.String("GetConfigsResult"),
GetDefaultConfigIDResult: testValue.Int64("GetDefaultConfigIDResult"),
}, nil
}
err := result.SetLogLevel(ctx, "TRACE")
if err != nil {
panic(err)
}
err = result.RegisterObserver(ctx, observerSingleton)
if err != nil {
panic(err)
}
return result, nil
}

func getSzConfigManagerAsInterface(ctx context.Context) senzing.SzConfigManager {
Expand Down
16 changes: 11 additions & 5 deletions szdiagnostic/szdiagnostic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,25 @@ func deleteRecords(ctx context.Context, records []record.Record) error {
}

func getSzDiagnostic(ctx context.Context) (*Szdiagnostic, error) {
_ = ctx

testValue := &testdata.TestData{
Int64s: testdata.Data1_int64s,
Strings: testdata.Data1_strings,
Uintptrs: testdata.Data1_uintptrs,
}

return &Szdiagnostic{
result := &Szdiagnostic{
CheckDatastorePerformanceResult: testValue.String("CheckDatastorePerformanceResult"),
GetDatastoreInfoResult: testValue.String("GetDatastoreInfoResult"),
GetFeatureResult: testValue.String("GetFeatureResult"),
}, nil
}
err := result.SetLogLevel(ctx, "TRACE")
if err != nil {
panic(err)
}
err = result.RegisterObserver(ctx, observerSingleton)
if err != nil {
panic(err)
}
return result, nil
}

func getSzDiagnosticAsInterface(ctx context.Context) senzing.SzDiagnostic {
Expand Down
16 changes: 11 additions & 5 deletions szengine/szengine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,12 @@ func getEntityIDString(record record.Record) (string, error) {
}

func getSzEngine(ctx context.Context) (*Szengine, error) {
_ = ctx

testValue := &testdata.TestData{
Int64s: testdata.Data1_int64s,
Strings: testdata.Data1_strings,
Uintptrs: testdata.Data1_uintptrs,
}

return &Szengine{
result := &Szengine{
AddRecordResult: testValue.String("AddRecordResult"),
CountRedoRecordsResult: testValue.Int64("CountRedoRecordsResult"),
DeleteRecordResult: testValue.String("DeleteRecordResult"),
Expand Down Expand Up @@ -660,7 +657,16 @@ func getSzEngine(ctx context.Context) (*Szengine, error) {
WhyEntitiesResult: testValue.String("WhyEntitiesResult"),
WhyRecordInEntityResult: testValue.String("WhyRecordInEntityResult"),
WhyRecordsResult: testValue.String("WhyRecordsResult"),
}, nil
}
err := result.SetLogLevel(ctx, "TRACE")
if err != nil {
panic(err)
}
err = result.RegisterObserver(ctx, observerSingleton)
if err != nil {
panic(err)
}
return result, nil
}

func getSzEngineAsInterface(ctx context.Context) senzing.SzEngine {
Expand Down
16 changes: 11 additions & 5 deletions szproduct/szproduct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,24 @@ func TestSzproduct_AsInterface(test *testing.T) {
// ----------------------------------------------------------------------------

func getSzProduct(ctx context.Context) (*Szproduct, error) {
_ = ctx

testValue := &testdata.TestData{
Int64s: testdata.Data1_int64s,
Strings: testdata.Data1_strings,
Uintptrs: testdata.Data1_uintptrs,
}

return &Szproduct{
result := &Szproduct{
GetLicenseResult: testValue.String("GetLicenseResult"),
GetVersionResult: testValue.String("GetVersionResult"),
}, nil
}
err := result.SetLogLevel(ctx, "TRACE")
if err != nil {
panic(err)
}
err = result.RegisterObserver(ctx, observerSingleton)
if err != nil {
panic(err)
}
return result, nil
}

func getSzProductAsInterface(ctx context.Context) senzing.SzProduct {
Expand Down

0 comments on commit 1d1a667

Please sign in to comment.