DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. When Unit Testing a Server, Why Not USE the Server?

When Unit Testing a Server, Why Not USE the Server?

Oren Eini user avatar by
Oren Eini
·
Apr. 18, 11 · News
Like (0)
Save
Tweet
Share
3.12K Views

Join the DZone community and get the full member experience.

Join For Free

one of the most interesting aspects of build ravendb was that it opened up my mind to the way we can use the fundamental nature of the server to open up additional information about the server operations.

one thing that i noticed recently is that if i need to debug a test for ravendb, i often need to stop the current thread (the test thread) and then go to the server test instance to look at what is actually going on in there.

the fun part is that this is really nice, because i can go an inspect the running test instance, see what is going on, and then modify things to see how they affect the behavior, etc. the only problem is that this is actually quite complex to set up manually (stop on debugger, freeze the appropriate thread, resume run, inspect server – modify stuff there, stop on debugger, thaw thread, continue run, etc).

what occurred to me, however, is that i can codify this behavior, and end up with this:

image

this method will only operate while a debugger is attached, but it is going to save me a lot of time.  once i am done, i need to delete the marker document:

image

this is especially important if you are running in memory mode, since the moment the test is over, the database is completely wiped out.


unit test

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Core Machine Learning Metrics
  • 7 Awesome Libraries for Java Unit and Integration Testing
  • The Data Leakage Nightmare in AI
  • Java Development Trends 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: