You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "João Reis (Jira)" <ji...@apache.org> on 2025/06/13 16:27:00 UTC

[jira] [Updated] (CASSGO-71) Add a way to create HostInfo objects for testing purposes

     [ https://issues.apache.org/jira/browse/CASSGO-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

João Reis updated CASSGO-71:
----------------------------
    Summary: Add a way to create HostInfo objects for testing purposes  (was: Make HostFilter interface easier to test)

> Add a way to create HostInfo objects for testing purposes
> ---------------------------------------------------------
>
>                 Key: CASSGO-71
>                 URL: https://issues.apache.org/jira/browse/CASSGO-71
>             Project: Apache Cassandra Go driver
>          Issue Type: New Feature
>          Components: Core
>            Reporter: João Reis
>            Priority: Normal
>             Fix For: 2.0.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> {{// HostFilter interface is used when a host is discovered via server sent events.}}
> {{type HostFilter interface {}}
> {{    // Called when a new host is discovered, returning true will cause the host}}
> {{    // to be added to the pools.}}
> {{    Accept(host *HostInfo) bool}}
> {{}}}
>  
> The Accept method should have an interface as the parameter instead of HostInfo so that it is possible to mock it. Currently there are a lot of unexported fields in HostInfo so it's not possible to create a HostInfo object with the appropriate values for specific tests (e.g. datacenter).
>  
> {{// HostFilter interface is used when a host is discovered via server sent events.}}
> {{type HostFilter interface {}}
> {{    // Called when a new host is discovered, returning true will cause the host}}
> {{    // to be added to the pools.}}
> {{    Accept(host Host) bool}}
> {{}}}
>  
> {{type Host interface {}}
> {{Peer() net.IP}}
> {{ConnectAddress() net.IP }}
> {{{}{}}}{{{}BroadcastAddress() net.IP{}}}
> {{ListenAddress() }}{{net.IP}}
> {{RPCAddress() net.IP}}
> {{PreferredIP() net.IP }}
> {{DataCenter() string }}
> {{Rack() string}}
> {{HostID() string}}
> {{WorkLoad() string}}
> {{Graph() bool}}
> {{DSEVersion() string}}
> {{Partitioner() string }}
> {{ClusterName() string}}
> {{Version() cassVersion // probably needs new interface as cassVersion is unexported}}
> {{Tokens() []string}}
> {{Port() int}}
> {{IsUp() bool}}
> {{String() string}}
> {{}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org