@Test( expected = KettleException.class ) public void testReadRepException() throws KettleException { Repository repository = mock( Repository.class ); ObjectId objectId = mock( ObjectId.class ); when( repository.getStepAttributeString( objectId, "hostname" ) ).thenThrow( new RuntimeException() ); couchDbInputMeta.readRep( repository, null, objectId, null ); }
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { hostname = rep.getStepAttributeString( id_step, "hostname" ); port = rep.getStepAttributeString( id_step, "port" ); dbName = rep.getStepAttributeString( id_step, "db_name" ); designDocument = rep.getStepAttributeString( id_step, "design_document" ); viewName = rep.getStepAttributeString( id_step, "view_name" ); authenticationUser = rep.getStepAttributeString( id_step, "auth_user" ); authenticationPassword = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "auth_password" ) ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "CouchDbInputMeta.Exception.UnexpectedErrorWhileReadingStepInfo" ), e ); } }
CouchDbInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { hostname = rep.getStepAttributeString( id_step, "hostname" ); port = rep.getStepAttributeString( id_step, "port" ); dbName = rep.getStepAttributeString( id_step, "db_name" ); designDocument = rep.getStepAttributeString( id_step, "design_document" ); viewName = rep.getStepAttributeString( id_step, "view_name" ); authenticationUser = rep.getStepAttributeString( id_step, "auth_user" ); authenticationPassword = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "auth_password" ) ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "CouchDbInputMeta.Exception.UnexpectedErrorWhileReadingStepInfo" ), e ); } } }
CouchDbInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { hostname = rep.getStepAttributeString( id_step, "hostname" ); port = rep.getStepAttributeString( id_step, "port" ); dbName = rep.getStepAttributeString( id_step, "db_name" ); designDocument = rep.getStepAttributeString( id_step, "design_document" ); viewName = rep.getStepAttributeString( id_step, "view_name" ); authenticationUser = rep.getStepAttributeString( id_step, "auth_user" ); authenticationPassword = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "auth_password" ) ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "CouchDbInputMeta.Exception.UnexpectedErrorWhileReadingStepInfo" ), e ); } } CouchDbInputMeta(); }
CouchDbInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { hostname = rep.getStepAttributeString( id_step, "hostname" ); port = rep.getStepAttributeString( id_step, "port" ); dbName = rep.getStepAttributeString( id_step, "db_name" ); designDocument = rep.getStepAttributeString( id_step, "design_document" ); viewName = rep.getStepAttributeString( id_step, "view_name" ); authenticationUser = rep.getStepAttributeString( id_step, "auth_user" ); authenticationPassword = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "auth_password" ) ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "CouchDbInputMeta.Exception.UnexpectedErrorWhileReadingStepInfo" ), e ); } } CouchDbInputMeta(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); @Override void setDefault(); @Override void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override String getXML(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
                                Trans trans ); @Override StepDataInterface getStepData(); String getHostname(); void setHostname( String hostname ); String getPort(); void setPort( String port ); String getDbName(); void setDbName( String dbName ); String getAuthenticationUser(); void setAuthenticationUser( String authenticationUser ); String getAuthenticationPassword(); void setAuthenticationPassword( String authenticationPassword ); String getViewName(); void setViewName( String viewName ); String getDesignDocument(); void setDesignDocument( String designDocument ); }
CouchDbInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { hostname = rep.getStepAttributeString( id_step, "hostname" ); port = rep.getStepAttributeString( id_step, "port" ); dbName = rep.getStepAttributeString( id_step, "db_name" ); designDocument = rep.getStepAttributeString( id_step, "design_document" ); viewName = rep.getStepAttributeString( id_step, "view_name" ); authenticationUser = rep.getStepAttributeString( id_step, "auth_user" ); authenticationPassword = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "auth_password" ) ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "CouchDbInputMeta.Exception.UnexpectedErrorWhileReadingStepInfo" ), e ); } } CouchDbInputMeta(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); @Override void setDefault(); @Override void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override String getXML(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
                                Trans trans ); @Override StepDataInterface getStepData(); String getHostname(); void setHostname( String hostname ); String getPort(); void setPort( String port ); String getDbName(); void setDbName( String dbName ); String getAuthenticationUser(); void setAuthenticationUser( String authenticationUser ); String getAuthenticationPassword(); void setAuthenticationPassword( String authenticationPassword ); String getViewName(); void setViewName( String viewName ); String getDesignDocument(); void setDesignDocument( String designDocument ); static final String DEFAULT_HOSTNAME; static final String DEFAULT_PORT; static final String DEFAULT_DB_NAME; static final String DEFAULT_VIEW_NAME; static final String VALUE_META_NAME; }