Refactor base class for shares

Now all created resources can be deleted either in tearDownClass
or in tearDown method...