def test_createLocalMirror(self): print('createLocalMirror') dataRoot = cvac.DirectoryPath( "corpus" ); corpusConfigFile = cvac.FilePath( dataRoot, "CvacCorpusTest.properties" ) corpus = self.cs.openCorpus( corpusConfigFile ) if not corpus: raise RuntimeError("could not open corpus from config file at '" +dataRoot.relativePath+"/"+corpusConfigFile.filename+"'") adapter = self.ic.createObjectAdapter("") ident = Ice.Identity() ident.name = IcePy.generateUUID() ident.category = "" # adapter.add( self, ident ) adapter.add( TestCorpusCallback(), ident ) adapter.activate() # adapter = self.ic.createObjectAdapter("CorpusServer") # adapter.add( TestCorpusCallback(), ic.stringToIdentity("CorpusServer:default -p 10011")) # adapter.activate() # receiver = cvac.CorpusCallbackPrx.uncheckedCast( # adapter.createProxy( self.ic.stringToIdentity("callbackReceiver"))) self.cs.createLocalMirror( corpus, ident ) if not self.cs.localMirrorExists( corpus ): raise RuntimeError( "could not create local mirror for", corpusConfigFile.filename )
def xtest_createLocalMirror(self): print('createLocalMirror') dataRoot = cvac.DirectoryPath( "corpus" ); corpusConfigFile = cvac.FilePath( dataRoot, "CvacCorpusTest.properties" ) corpus = self.cs.openCorpus( corpusConfigFile ) if not corpus: raise RuntimeError("could not open corpus from config file at '" +dataRoot.relativePath+"/"+corpusConfigFile.filename+"'") adapter = self.ic.createObjectAdapter("") ident = Ice.Identity() ident.name = IcePy.generateUUID() ident.category = "" # adapter.add( self, ident ) adapter.add( TestCorpusCallback(), ident ) adapter.activate() # adapter = self.ic.createObjectAdapter("CorpusServer") # adapter.add( TestCorpusCallback(), ic.stringToIdentity("CorpusServer:default -p 10011")) # adapter.activate() # receiver = cvac.CorpusCallbackPrx.uncheckedCast( # adapter.createProxy( self.ic.stringToIdentity("callbackReceiver"))) self.cs.createLocalMirror( corpus, ident ) if not self.cs.localMirrorExists( corpus ): raise RuntimeError( "could not create local mirror for", corpusConfigFile.filename )
def xtest_openCorpusLabelMe(self): print('openCorpusLabelMe') dataRoot = cvac.DirectoryPath( "corpus" ); corpusConfigFile = cvac.FilePath( dataRoot, "LabelMeCarsTest.properties" ) # corpusConfigFile = cvac.FilePath( dataRoot, "NpsVisionLabelMe.properties" ) corpus = self.cs.openCorpus( corpusConfigFile ) if not corpus: raise RuntimeError("could not open corpus from config file at '" +dataRoot.relativePath+"/"+corpusConfigFile.filename+"'"+"\n" +"Did you build CVAC with BUILD_LABELME_CORPUS=ON?") adapter = self.ic.createObjectAdapter("") ident = Ice.Identity() ident.name = IcePy.generateUUID() ident.category = "" adapter.add( TestCorpusCallback(), ident ) adapter.activate() self.cs.createLocalMirror( corpus, ident ) labels = self.cs.getDataSet( corpus ) if not labels: raise RuntimeError("could not obtain labels from Corpus '" +corpus.name+"'")