Mircea Carasel wrote: > Hi, > Regarding XCF-2629 I am experiencing a problem and I don't know what > should be the correct behavior > I created a separated initializer task in order to save in the database > the default Nat Traversal settings at application start-up. > In this way, the method NatTraversalManagerImpl.getNatTraversal is not > trying to insert default Nat Traversal settings in the database - it > just retrieves the saved data. > > The problem is that some tests with Nat Traversal are failing since this > initializer task is not executed in the test environment. (None of the > other initializer tasks are executed) - and the > NatTraversalManagerImpl.getNatTraversal throws, obviously, NULL pointer > exception. > If this is the correct behavior in the test environment, I am thinking > to let the getNatTraversal method unchanged (save NAT Traversal if > nat_traversal table is empty). > > However, shouldn't be better to execute all initializer tasks once the > test environment is started? > If yes, how can we implement this?
I'd rather test against pristine database and have tests worry about inserting all data that they need. Otherwise bugs in init tasks will cause hard to find test failures. > > Please let me know what do you think. > > Thanks a lot, > Mircea > The test should insert NAT traversal records to the database as a part of the setup. There should be a separate method in NatTraversalManager (with a separate test) that is used by init task and inserts NatTraversal record. D. _______________________________________________ sipx-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipx-dev Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev
