Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

372
Views
why embedded mongo process not stoping by mongodExecutable.stop()?

Embedded mongo started successful with below code,,but not stoping by mongodExecutable.stop(),this suppose to stop the running mongo. what can be the issue, The below code

 public class Test
       {
 private static final String CONNECTION_STRING = "mongodb://%s:%d";

    private static MongodExecutable mongodExecutable;
    ObjectMapper mapper = new ObjectMapper();
    private static MongodProcess mongod = null;
   

    @After
   public void clean() {
        //mongodExecutable.stop();
        if(mongod.isProcessRunning()) {
        //mongod.stopInternal();
        mongodExecutable.stop();
    }}

    @Before
   public void setup() throws Exception {
        String ip = "localhost";
        int port = 27017;
        

        IMongodConfig mongodConfig = new MongodConfigBuilder().version(Version.Main.PRODUCTION)
            .net(new Net(ip, port, Network.localhostIsIPv6()))
            .build();

        MongodStarter starter = MongodStarter.getDefaultInstance();
        mongodExecutable = starter.prepare(mongodConfig);
        mongod=mongodExecutable.start();
    }

    @Test
    public void testfeature() throws Exception {
         assertEquals(1, 1);
       
        
    }
 }
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!