#container = Container()
        #print 'starting container'
        #container.start()
        #print 'started container'

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')
        self.RR = ResourceRegistryServiceClient(node=self.container.node)

        print 'started services'

    @unittest.skip('this test just for debugging setup')
    def test_just_the_setup(self):
        return


rimi = ResourceImplMetatestIntegration(TestInstrumentManagementServiceMeta,
                                       InstrumentManagementService, log)
rimi.test_all_in_one(True)

rimi.add_resource_impl_inttests(InstrumentAgentInstanceImpl,
                                {"exchange_name": "rhubarb"})
rimi.add_resource_impl_inttests(InstrumentAgentImpl, {
    "agent_version": "3",
    "time_source": "the universe"
})
rimi.add_resource_impl_inttests(InstrumentDeviceImpl, {
    "serial_number": "123",
    "firmware_version": "x"
})
rimi.add_resource_impl_inttests(InstrumentModelImpl,
                                {"model_label": "redundant?"})
rimi.add_resource_impl_inttests(PlatformAgentInstanceImpl,
        # Start container
        #print 'instantiating container'
        self._start_container()
        #container = Container()
        #print 'starting container'
        #container.start()
        #print 'started container'

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')
        self.RR = ResourceRegistryServiceClient(node=self.container.node)
        
        print 'started services'

    
    @unittest.skip('this test just for debugging setup')
    def test_just_the_setup(self):
        return




rimi = ResourceImplMetatestIntegration(TestObservatoryManagementServiceMeta, ObservatoryManagementService, log)
rimi.test_all_in_one(True)

rimi.add_resource_impl_inttests(ObservatoryImpl, {})
rimi.add_resource_impl_inttests(SubsiteImpl, {})
rimi.add_resource_impl_inttests(PlatformSiteImpl, {})
rimi.add_resource_impl_inttests(InstrumentSiteImpl, {})


from ion.services.sa.resource_impl.resource_impl_metatest_integration import ResourceImplMetatestIntegration


class FakeProcess(LocalContextMixin):
    name = ''


@attr('META', group='sa')
#@unittest.skip('not working')
class TestDataProductManagementServiceMeta(IonIntegrationTestCase):
    def setUp(self):
        # Start container
        #print 'instantiating container'
        self._start_container()
        #container = Container()
        #print 'starting container'
        #container.start()
        #print 'started container'

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')

        print 'started services'


#dynamically add tests to the test classes. THIS MUST HAPPEN OUTSIDE THE CLASS

rimi = ResourceImplMetatestIntegration(TestDataProductManagementServiceMeta,
                                       DataProductManagementService, log)
rimi.add_resource_impl_inttests(DataProductImpl)

class FakeProcess(LocalContextMixin):
    name = ''


@attr('META', group='sa')
#@unittest.skip('not working')
class TestDataProductManagementServiceMeta(IonIntegrationTestCase):

    def setUp(self):
        # Start container
        #print 'instantiating container'
        self._start_container()
        #container = Container()
        #print 'starting container'
        #container.start()
        #print 'started container'

        self.container.start_rel_from_url('res/deploy/r2sa.yml')

        print 'started services'


 
#dynamically add tests to the test classes. THIS MUST HAPPEN OUTSIDE THE CLASS


rimi = ResourceImplMetatestIntegration(TestDataProductManagementServiceMeta, DataProductManagementService, log)
rimi.add_resource_impl_inttests(DataProductImpl)
        # Start container
        # print 'instantiating container'
        self._start_container()
        # container = Container()
        # print 'starting container'
        # container.start()
        # print 'started container'

        self.container.start_rel_from_url("res/deploy/r2deploy.yml")
        self.RR = ResourceRegistryServiceClient(node=self.container.node)

        print "started services"

    @unittest.skip("this test just for debugging setup")
    def test_just_the_setup(self):
        return


rimi = ResourceImplMetatestIntegration(TestInstrumentManagementServiceMeta, InstrumentManagementService, log)

rimi.add_resource_impl_inttests(InstrumentAgentInstanceImpl, {"exchange_name": "rhubarb"})
rimi.add_resource_impl_inttests(InstrumentAgentImpl, {"agent_version": "3", "time_source": "the universe"})
rimi.add_resource_impl_inttests(InstrumentDeviceImpl, {"serial_number": "123", "firmware_version": "x"})
rimi.add_resource_impl_inttests(InstrumentModelImpl, {"model_label": "redundant?"})
rimi.add_resource_impl_inttests(PlatformAgentInstanceImpl, {"exchange_name": "sausage"})
rimi.add_resource_impl_inttests(PlatformAgentImpl, {"description": "the big donut"})
rimi.add_resource_impl_inttests(PlatformDeviceImpl, {"serial_number": "2345"})
rimi.add_resource_impl_inttests(PlatformModelImpl, {"description": "tammy breathed deeply"})
rimi.add_resource_impl_inttests(SensorDeviceImpl, {"serial_number": "123"})
rimi.add_resource_impl_inttests(SensorModelImpl, {"model_label": "redundant field?"})
@attr('META', group='sa')
class TestObservatoryManagementServiceMeta(IonIntegrationTestCase):
    def setUp(self):
        # Start container
        #print 'instantiating container'
        self._start_container()
        #container = Container()
        #print 'starting container'
        #container.start()
        #print 'started container'

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')
        self.RR = ResourceRegistryServiceClient(node=self.container.node)

        print 'started services'

    @unittest.skip('this test just for debugging setup')
    def test_just_the_setup(self):
        return


rimi = ResourceImplMetatestIntegration(TestObservatoryManagementServiceMeta,
                                       ObservatoryManagementService, log)
rimi.test_all_in_one(True)

rimi.add_resource_impl_inttests(ObservatoryImpl, {})
rimi.add_resource_impl_inttests(SubsiteImpl, {})
rimi.add_resource_impl_inttests(PlatformSiteImpl, {})
rimi.add_resource_impl_inttests(InstrumentSiteImpl, {})
class TestMarineFacilityManagementServiceMeta(IonIntegrationTestCase):

    def setUp(self):
        # Start container
        #print 'instantiating container'
        self._start_container()
        #container = Container()
        #print 'starting container'
        #container.start()
        #print 'started container'

        self.container.start_rel_from_url('res/deploy/r2sa.yml')
        self.RR = ResourceRegistryServiceClient(node=self.container.node)
        
        print 'started services'

    def test_just_the_setup(self):
        return




rimi = ResourceImplMetatestIntegration(TestMarineFacilityManagementServiceMeta, MarineFacilityManagementService, log)

rimi.add_resource_impl_inttests(LogicalInstrumentImpl, {})
rimi.add_resource_impl_inttests(LogicalPlatformImpl, {})
rimi.add_resource_impl_inttests(MarineFacilityImpl, {})
rimi.add_resource_impl_inttests(SiteImpl, {})


from ion.services.sa.resource_impl.resource_impl_metatest_integration import ResourceImplMetatestIntegration





@attr('META', group='sa')
#@unittest.skip('not working')
class TestDataProductManagementServiceMeta(IonIntegrationTestCase):

    def setUp(self):
        # Start container
        #print 'instantiating container'
        self._start_container()

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')

        print 'started services'

        # Now create client to DataProductManagementService
        self.client = DataProductManagementServiceClient(node=self.container.node)
        self.rrclient = ResourceRegistryServiceClient(node=self.container.node)
        self.damsclient = DataAcquisitionManagementServiceClient(node=self.container.node)
        self.pubsubcli =  PubsubManagementServiceClient(node=self.container.node)
        self.ingestclient = IngestionManagementServiceClient(node=self.container.node)


rimi = ResourceImplMetatestIntegration(TestDataProductManagementServiceMeta, DataProductManagementService, log)
rimi.test_all_in_one(True)

rimi.add_resource_impl_inttests(DataProductImpl, {})
        # Start container
        #print 'instantiating container'
        self._start_container()
        #container = Container()
        #print 'starting container'
        #container.start()
        #print 'started container'

        self.container.start_rel_from_url('res/deploy/r2deploy.yml')
        self.RR = ResourceRegistryServiceClient(node=self.container.node)
        
        print 'started services'

    @unittest.skip('this test just for debugging setup')
    def test_just_the_setup(self):
        return

 
rimi = ResourceImplMetatestIntegration(TestInstrumentManagementServiceMeta, InstrumentManagementService, log)
rimi.test_all_in_one(True)

rimi.add_resource_impl_inttests(InstrumentAgentImpl, {"driver_module": "potato"})
rimi.add_resource_impl_inttests(InstrumentDeviceImpl, {"serial_number": "123", "firmware_version": "x"})
rimi.add_resource_impl_inttests(InstrumentModelImpl, {})
rimi.add_resource_impl_inttests(PlatformAgentImpl, {"description": "the big donut"})
rimi.add_resource_impl_inttests(PlatformDeviceImpl, {"serial_number": "2345"})
rimi.add_resource_impl_inttests(PlatformModelImpl, {"description": "tammy breathed deeply"})
rimi.add_resource_impl_inttests(SensorDeviceImpl, {"serial_number": "123"})
rimi.add_resource_impl_inttests(SensorModelImpl, {})