Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a parameter takes the path of application.conf for CqlSession #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

t2y
Copy link

@t2y t2y commented Feb 28, 2020

According to DataStax Java Driver 4.3 Configuration, Cassandra driver uses Typesafe Config named application.conf over 4.x.

There are many options to be able to configure CqlSession and it's useful to pass any application.conf to EmbeddedCassandraServerHelper.getSession(confPath)) for testing.

Concern

I referred EmbeddedCassandraServerHelperTest and copied it, then I modified as EmbeddedCassandraServerHelperWithConfigLoaderTest. This test has @Ignore annotation and the test will be skipped.

To confirm my change is correct, I just commented out @Ignore annotation when I test, then run test command as below. Is this an appropriate way to run ignored tests?

$ mvn test -DfailIfNoTests=false -Dtest=EmbeddedCassandraServerHelperWithConfigLoaderTest

@t2y
Copy link
Author

t2y commented Mar 2, 2020

I made a workaround to recreate CqlSession takes parameters: an address from a session returned by cassandra-unit, fixed datacenter string and a configLoader reading any configuration file.

Of course, it works. But still, it's better for simplicity to pass any configuration file to cassandra-unit.

https://github.com/t2y/cassandra-driver-sample/blob/master/src/test/java/sample/cassandra/client/RateBasedRequestThrottlingTest.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant