target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void deleteVersionTest() throws KettleException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = new UnifiedRepositoryPurgeService( mockRepo ); String fi... | @Override public void deleteVersion( RepositoryElementInterface element, String versionId ) throws KettleException { String fileId = element.getObjectId().getId(); deleteVersion( fileId, versionId ); } | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersion( RepositoryElementInterface element, String versionId ) throws KettleException { String fileId = element.getObjectId().getId(); deleteVersion( fileId, versionId ); } } | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersion( RepositoryElementInterface element, String versionId ) throws KettleException { String fileId = element.getObjectId().getId(); deleteVersion( fileId, versionId ); } UnifiedRepositoryPurgeService( IUnifiedRepository unifiedRepo... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersion( RepositoryElementInterface element, String versionId ) throws KettleException { String fileId = element.getObjectId().getId(); deleteVersion( fileId, versionId ); } UnifiedRepositoryPurgeService( IUnifiedRepository unifiedRepo... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersion( RepositoryElementInterface element, String versionId ) throws KettleException { String fileId = element.getObjectId().getId(); deleteVersion( fileId, versionId ); } UnifiedRepositoryPurgeService( IUnifiedRepository unifiedRepo... |
@Test public void keepNumberOfVersions0Test() throws KettleException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = new UnifiedRepositoryPurgeService( mockRepo ); S... | @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } } | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } UnifiedRepositoryPurgeService( IUnifiedRepos... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } UnifiedRepositoryPurgeService( IUnifiedRepos... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } UnifiedRepositoryPurgeService( IUnifiedRepos... |
@Test public void keepNumberOfVersionsTest() throws KettleException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = new UnifiedRepositoryPurgeService( mockRepo ); St... | @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } } | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } UnifiedRepositoryPurgeService( IUnifiedRepos... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } UnifiedRepositoryPurgeService( IUnifiedRepos... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } UnifiedRepositoryPurgeService( IUnifiedRepos... |
@Test public void deleteVersionsBeforeDate() throws KettleException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = new UnifiedRepositoryPurgeService( mockRepo ); St... | @Override public void deleteVersionsBeforeDate( RepositoryElementInterface element, Date beforeDate ) throws KettleException { try { Serializable fileId = element.getObjectId().getId(); deleteVersionsBeforeDate( fileId, beforeDate ); } catch ( Exception e ) { processDeleteException( e ); } } | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersionsBeforeDate( RepositoryElementInterface element, Date beforeDate ) throws KettleException { try { Serializable fileId = element.getObjectId().getId(); deleteVersionsBeforeDate( fileId, beforeDate ); } catch ( Exception e ) { pro... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersionsBeforeDate( RepositoryElementInterface element, Date beforeDate ) throws KettleException { try { Serializable fileId = element.getObjectId().getId(); deleteVersionsBeforeDate( fileId, beforeDate ); } catch ( Exception e ) { pro... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersionsBeforeDate( RepositoryElementInterface element, Date beforeDate ) throws KettleException { try { Serializable fileId = element.getObjectId().getId(); deleteVersionsBeforeDate( fileId, beforeDate ); } catch ( Exception e ) { pro... | UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersionsBeforeDate( RepositoryElementInterface element, Date beforeDate ) throws KettleException { try { Serializable fileId = element.getObjectId().getId(); deleteVersionsBeforeDate( fileId, beforeDate ); } catch ( Exception e ) { pro... |
@Test public void doPurgeUtilVersionCountTest() throws PurgeDeletionException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = getPurgeService( mockRepo ); PurgeUtili... | public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpecification.getPath() != null && !purgeSpecification.getPa... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... |
@Test( expected = KettleException.class ) public void exceptionThrownWhenParsingXmlWithBigAmountOfExternalEntitiesFromInputStream() throws Exception { repoMeta.readDataFromInputStream( new ByteArrayInputStream( XXEUtils.MALICIOUS_XML.getBytes() ) ); } | public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory(); DocumentBui... | RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFac... | RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFac... | RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFac... | RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFac... |
@Test public void doPurgeUtilDateBeforeTest() throws PurgeDeletionException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = getPurgeService( mockRepo ); PurgeUtility... | public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpecification.getPath() != null && !purgeSpecification.getPa... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... | UnifiedRepositoryPurgeService implements IPurgeService { public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException { if ( purgeSpecification != null ) { getLogger().setCurrentFilePath( purgeSpecification.getPath() ); logConfiguration( purgeSpecification ); if ( purgeSpe... |
@Test public void testGetPlugins() throws Exception { String plugins = controller.getPlugins(); assertEquals( "[{\"name\":\"PLUGIN NAME\",\"description\":\"PLUGIN DESCRIPTION\",\"id\":\"ID\"}]", plugins ); } | @SuppressWarnings( "unchecked" ) public String getPlugins() { List<PluginInterface> plugins = pluginRegistry.getPlugins( RepositoryPluginType.class ); JSONArray list = new JSONArray(); for ( PluginInterface pluginInterface : plugins ) { if ( !pluginInterface.getIds()[0].equals( "PentahoEnterpriseRepository" ) ) { JSONO... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getPlugins() { List<PluginInterface> plugins = pluginRegistry.getPlugins( RepositoryPluginType.class ); JSONArray list = new JSONArray(); for ( PluginInterface pluginInterface : plugins ) { if ( !pluginInterface.getIds()[0].equals( "PentahoEnt... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getPlugins() { List<PluginInterface> plugins = pluginRegistry.getPlugins( RepositoryPluginType.class ); JSONArray list = new JSONArray(); for ( PluginInterface pluginInterface : plugins ) { if ( !pluginInterface.getIds()[0].equals( "PentahoEnt... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getPlugins() { List<PluginInterface> plugins = pluginRegistry.getPlugins( RepositoryPluginType.class ); JSONArray list = new JSONArray(); for ( PluginInterface pluginInterface : plugins ) { if ( !pluginInterface.getIds()[0].equals( "PentahoEnt... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getPlugins() { List<PluginInterface> plugins = pluginRegistry.getPlugins( RepositoryPluginType.class ); JSONArray list = new JSONArray(); for ( PluginInterface pluginInterface : plugins ) { if ( !pluginInterface.getIds()[0].equals( "PentahoEnt... |
@Test public void testCreateRepository() throws Exception { String id = ID; Map<String, Object> items = new HashMap<>(); when( pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class ) ) .thenReturn( repositoryMeta ); when( pluginRegistry.loadClass( RepositoryPluginType.class, repositoryMeta.getI... | public boolean createRepository( String id, Map<String, Object> items ) { try { RepositoryMeta repositoryMeta = pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class ); repositoryMeta.populate( items, repositoriesMeta ); if ( repositoryMeta.getName() != null ) { Repository repository = pluginRe... | RepositoryConnectController { public boolean createRepository( String id, Map<String, Object> items ) { try { RepositoryMeta repositoryMeta = pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class ); repositoryMeta.populate( items, repositoriesMeta ); if ( repositoryMeta.getName() != null ) { Re... | RepositoryConnectController { public boolean createRepository( String id, Map<String, Object> items ) { try { RepositoryMeta repositoryMeta = pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class ); repositoryMeta.populate( items, repositoriesMeta ); if ( repositoryMeta.getName() != null ) { Re... | RepositoryConnectController { public boolean createRepository( String id, Map<String, Object> items ) { try { RepositoryMeta repositoryMeta = pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class ); repositoryMeta.populate( items, repositoriesMeta ); if ( repositoryMeta.getName() != null ) { Re... | RepositoryConnectController { public boolean createRepository( String id, Map<String, Object> items ) { try { RepositoryMeta repositoryMeta = pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class ); repositoryMeta.populate( items, repositoriesMeta ); if ( repositoryMeta.getName() != null ) { Re... |
@Test public void testGetRepositories() { when( repositoriesMeta.nrRepositories() ).thenReturn( 1 ); when( repositoriesMeta.getRepository( 0 ) ).thenReturn( repositoryMeta ); JSONObject json = new JSONObject(); json.put( "displayName", REPOSITORY_NAME ); json.put( "isDefault", false ); json.put( "description", REPOSITO... | @SuppressWarnings( "unchecked" ) public String getRepositories() { JSONArray list = new JSONArray(); if ( repositoriesMeta != null ) { for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { list.add( repositoriesMeta.getRepository( i ).toJSONObject() ); } } return list.toString(); } | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getRepositories() { JSONArray list = new JSONArray(); if ( repositoriesMeta != null ) { for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { list.add( repositoriesMeta.getRepository( i ).toJSONObject() ); } } return list.toString();... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getRepositories() { JSONArray list = new JSONArray(); if ( repositoriesMeta != null ) { for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { list.add( repositoriesMeta.getRepository( i ).toJSONObject() ); } } return list.toString();... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getRepositories() { JSONArray list = new JSONArray(); if ( repositoriesMeta != null ) { for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { list.add( repositoriesMeta.getRepository( i ).toJSONObject() ); } } return list.toString();... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getRepositories() { JSONArray list = new JSONArray(); if ( repositoriesMeta != null ) { for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { list.add( repositoriesMeta.getRepository( i ).toJSONObject() ); } } return list.toString();... |
@Test public void testConnectToRepository() throws Exception { when( pluginRegistry.loadClass( RepositoryPluginType.class, repositoryMeta.getId(), Repository.class ) ) .thenReturn( repository ); controller.setCurrentRepository( repositoryMeta ); controller.connectToRepository(); verify( repository ).init( repositoryMet... | public void connectToRepository() throws KettleException { connectToRepository( currentRepository ); } | RepositoryConnectController { public void connectToRepository() throws KettleException { connectToRepository( currentRepository ); } } | RepositoryConnectController { public void connectToRepository() throws KettleException { connectToRepository( currentRepository ); } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
RepositoriesMeta repositoriesMeta ); RepositoryConnectCon... | RepositoryConnectController { public void connectToRepository() throws KettleException { connectToRepository( currentRepository ); } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
RepositoriesMeta repositoriesMeta ); RepositoryConnectCon... | RepositoryConnectController { public void connectToRepository() throws KettleException { connectToRepository( currentRepository ); } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
RepositoriesMeta repositoriesMeta ); RepositoryConnectCon... |
@Test public void testGetDatabases() throws Exception { when( repositoriesMeta.nrDatabases() ).thenReturn( 1 ); when( repositoriesMeta.getDatabase( 0 ) ).thenReturn( databaseMeta ); when( databaseMeta.getName() ).thenReturn( DATABASE_NAME ); String databases = controller.getDatabases(); assertEquals( "[{\"name\":\"DATA... | @SuppressWarnings( "unchecked" ) public String getDatabases() { JSONArray list = new JSONArray(); for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { JSONObject databaseJSON = new JSONObject(); databaseJSON.put( "name", repositoriesMeta.getDatabase( i ).getName() ); list.add( databaseJSON ); } return list.toSt... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getDatabases() { JSONArray list = new JSONArray(); for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { JSONObject databaseJSON = new JSONObject(); databaseJSON.put( "name", repositoriesMeta.getDatabase( i ).getName() ); list.add( data... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getDatabases() { JSONArray list = new JSONArray(); for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { JSONObject databaseJSON = new JSONObject(); databaseJSON.put( "name", repositoriesMeta.getDatabase( i ).getName() ); list.add( data... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getDatabases() { JSONArray list = new JSONArray(); for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { JSONObject databaseJSON = new JSONObject(); databaseJSON.put( "name", repositoriesMeta.getDatabase( i ).getName() ); list.add( data... | RepositoryConnectController { @SuppressWarnings( "unchecked" ) public String getDatabases() { JSONArray list = new JSONArray(); for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { JSONObject databaseJSON = new JSONObject(); databaseJSON.put( "name", repositoriesMeta.getDatabase( i ).getName() ); list.add( data... |
@Test public void testDeleteRepository() throws Exception { int index = 1; when( repositoriesMeta.findRepository( REPOSITORY_NAME ) ).thenReturn( repositoryMeta ); when( repositoriesMeta.indexOfRepository( repositoryMeta ) ).thenReturn( index ); when( repositoriesMeta.getRepository( index ) ).thenReturn( repositoryMeta... | public boolean deleteRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); int index = repositoriesMeta.indexOfRepository( repositoryMeta ); if ( index != -1 ) { Spoon spoon = spoonSupplier.get(); if ( spoon.getRepositoryName() != null && spoon.getRepositoryName().equals( ... | RepositoryConnectController { public boolean deleteRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); int index = repositoriesMeta.indexOfRepository( repositoryMeta ); if ( index != -1 ) { Spoon spoon = spoonSupplier.get(); if ( spoon.getRepositoryName() != null && spoo... | RepositoryConnectController { public boolean deleteRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); int index = repositoriesMeta.indexOfRepository( repositoryMeta ); if ( index != -1 ) { Spoon spoon = spoonSupplier.get(); if ( spoon.getRepositoryName() != null && spoo... | RepositoryConnectController { public boolean deleteRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); int index = repositoriesMeta.indexOfRepository( repositoryMeta ); if ( index != -1 ) { Spoon spoon = spoonSupplier.get(); if ( spoon.getRepositoryName() != null && spoo... | RepositoryConnectController { public boolean deleteRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); int index = repositoriesMeta.indexOfRepository( repositoryMeta ); if ( index != -1 ) { Spoon spoon = spoonSupplier.get(); if ( spoon.getRepositoryName() != null && spoo... |
@Test public void testSetDefaultRepository() { int index = 1; when( repositoriesMeta.findRepository( REPOSITORY_NAME ) ).thenReturn( repositoryMeta ); when( repositoriesMeta.indexOfRepository( repositoryMeta ) ).thenReturn( index ); boolean result = controller.setDefaultRepository( REPOSITORY_NAME ); assertEquals( true... | public boolean setDefaultRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { repositoriesMeta.getRepository( i ).setDefault( false ); } if ( repositoryMeta != null ) { repositoryMeta.setDefault( true ); } tr... | RepositoryConnectController { public boolean setDefaultRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { repositoriesMeta.getRepository( i ).setDefault( false ); } if ( repositoryMeta != null ) { repositor... | RepositoryConnectController { public boolean setDefaultRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { repositoriesMeta.getRepository( i ).setDefault( false ); } if ( repositoryMeta != null ) { repositor... | RepositoryConnectController { public boolean setDefaultRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { repositoriesMeta.getRepository( i ).setDefault( false ); } if ( repositoryMeta != null ) { repositor... | RepositoryConnectController { public boolean setDefaultRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) { repositoriesMeta.getRepository( i ).setDefault( false ); } if ( repositoryMeta != null ) { repositor... |
@Test public void testAddDatabase() throws Exception { controller.addDatabase( databaseMeta ); verify( repositoriesMeta ).addDatabase( databaseMeta ); verify( repositoriesMeta ).writeData(); } | public void addDatabase( DatabaseMeta databaseMeta ) { if ( databaseMeta != null ) { repositoriesMeta.addDatabase( databaseMeta ); save(); } } | RepositoryConnectController { public void addDatabase( DatabaseMeta databaseMeta ) { if ( databaseMeta != null ) { repositoriesMeta.addDatabase( databaseMeta ); save(); } } } | RepositoryConnectController { public void addDatabase( DatabaseMeta databaseMeta ) { if ( databaseMeta != null ) { repositoriesMeta.addDatabase( databaseMeta ); save(); } } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
RepositoriesMeta r... | RepositoryConnectController { public void addDatabase( DatabaseMeta databaseMeta ) { if ( databaseMeta != null ) { repositoriesMeta.addDatabase( databaseMeta ); save(); } } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
RepositoriesMeta r... | RepositoryConnectController { public void addDatabase( DatabaseMeta databaseMeta ) { if ( databaseMeta != null ) { repositoriesMeta.addDatabase( databaseMeta ); save(); } } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
RepositoriesMeta r... |
@Test public void testGetDefaultUrl() throws Exception { String defaultUrl = controller.getDefaultUrl(); assertNotNull( defaultUrl ); } | public String getDefaultUrl() { ResourceBundle resourceBundle = PropertyResourceBundle.getBundle( PKG.getPackage().getName() + ".plugin" ); return resourceBundle.getString( DEFAULT_URL ); } | RepositoryConnectController { public String getDefaultUrl() { ResourceBundle resourceBundle = PropertyResourceBundle.getBundle( PKG.getPackage().getName() + ".plugin" ); return resourceBundle.getString( DEFAULT_URL ); } } | RepositoryConnectController { public String getDefaultUrl() { ResourceBundle resourceBundle = PropertyResourceBundle.getBundle( PKG.getPackage().getName() + ".plugin" ); return resourceBundle.getString( DEFAULT_URL ); } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
... | RepositoryConnectController { public String getDefaultUrl() { ResourceBundle resourceBundle = PropertyResourceBundle.getBundle( PKG.getPackage().getName() + ".plugin" ); return resourceBundle.getString( DEFAULT_URL ); } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
... | RepositoryConnectController { public String getDefaultUrl() { ResourceBundle resourceBundle = PropertyResourceBundle.getBundle( PKG.getPackage().getName() + ".plugin" ); return resourceBundle.getString( DEFAULT_URL ); } RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier,
... |
@Test public void loadMappingMeta() throws Exception { String variablePath = "Internal.Entry.Current.Directory"; String virtualDir = "/testFolder/CDA-91"; String fileName = "testTrans.ktr"; VariableSpace variables = new Variables(); variables.setVariable( variablePath, virtualDir ); StepWithMappingMeta mappingMetaMock ... | public static TransMeta loadMappingMeta( StepWithMappingMeta mappingMeta, Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException { return loadMappingMeta( mappingMeta, rep, metaStore, space, true ); } | StepWithMappingMeta extends BaseStepMeta { public static TransMeta loadMappingMeta( StepWithMappingMeta mappingMeta, Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException { return loadMappingMeta( mappingMeta, rep, metaStore, space, true ); } } | StepWithMappingMeta extends BaseStepMeta { public static TransMeta loadMappingMeta( StepWithMappingMeta mappingMeta, Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException { return loadMappingMeta( mappingMeta, rep, metaStore, space, true ); } } | StepWithMappingMeta extends BaseStepMeta { public static TransMeta loadMappingMeta( StepWithMappingMeta mappingMeta, Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException { return loadMappingMeta( mappingMeta, rep, metaStore, space, true ); } static TransMeta loadMappingMeta( StepWithMappi... | StepWithMappingMeta extends BaseStepMeta { public static TransMeta loadMappingMeta( StepWithMappingMeta mappingMeta, Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException { return loadMappingMeta( mappingMeta, rep, metaStore, space, true ); } static TransMeta loadMappingMeta( StepWithMappi... |
@Test public void testGetRepository() throws Exception { KettleFileRepositoryMeta kettleFileRepositoryMeta = new KettleFileRepositoryMeta(); kettleFileRepositoryMeta.setId( REPOSITORY_ID ); kettleFileRepositoryMeta.setDescription( REPOSITORY_DESCRIPTION ); kettleFileRepositoryMeta.setName( REPOSITORY_NAME ); when( repo... | public String getRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); if ( repositoryMeta != null ) { currentRepository = repositoryMeta; return repositoryMeta.toJSONObject().toString(); } return ""; } | RepositoryConnectController { public String getRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); if ( repositoryMeta != null ) { currentRepository = repositoryMeta; return repositoryMeta.toJSONObject().toString(); } return ""; } } | RepositoryConnectController { public String getRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); if ( repositoryMeta != null ) { currentRepository = repositoryMeta; return repositoryMeta.toJSONObject().toString(); } return ""; } RepositoryConnectController( PluginRegis... | RepositoryConnectController { public String getRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); if ( repositoryMeta != null ) { currentRepository = repositoryMeta; return repositoryMeta.toJSONObject().toString(); } return ""; } RepositoryConnectController( PluginRegis... | RepositoryConnectController { public String getRepository( String name ) { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name ); if ( repositoryMeta != null ) { currentRepository = repositoryMeta; return repositoryMeta.toJSONObject().toString(); } return ""; } RepositoryConnectController( PluginRegis... |
@Test public void testIsDatabaseWithNameExist() throws Exception { final DatabaseMeta databaseMeta1 = new DatabaseMeta(); databaseMeta1.setName( "TestDB1" ); controller.addDatabase( databaseMeta1 ); final DatabaseMeta databaseMeta2 = new DatabaseMeta(); databaseMeta2.setName( "TestDB2" ); controller.addDatabase( databa... | @VisibleForTesting boolean isDatabaseWithNameExist( DatabaseMeta databaseMeta, boolean isNew ) { for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { final DatabaseMeta iterDatabase = repositoriesMeta.getDatabase( i ); if ( iterDatabase.getName().trim().equalsIgnoreCase( databaseMeta.getName().trim() ) ) { if (... | RepositoryConnectController { @VisibleForTesting boolean isDatabaseWithNameExist( DatabaseMeta databaseMeta, boolean isNew ) { for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { final DatabaseMeta iterDatabase = repositoriesMeta.getDatabase( i ); if ( iterDatabase.getName().trim().equalsIgnoreCase( databaseMe... | RepositoryConnectController { @VisibleForTesting boolean isDatabaseWithNameExist( DatabaseMeta databaseMeta, boolean isNew ) { for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { final DatabaseMeta iterDatabase = repositoriesMeta.getDatabase( i ); if ( iterDatabase.getName().trim().equalsIgnoreCase( databaseMe... | RepositoryConnectController { @VisibleForTesting boolean isDatabaseWithNameExist( DatabaseMeta databaseMeta, boolean isNew ) { for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { final DatabaseMeta iterDatabase = repositoriesMeta.getDatabase( i ); if ( iterDatabase.getName().trim().equalsIgnoreCase( databaseMe... | RepositoryConnectController { @VisibleForTesting boolean isDatabaseWithNameExist( DatabaseMeta databaseMeta, boolean isNew ) { for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) { final DatabaseMeta iterDatabase = repositoriesMeta.getDatabase( i ); if ( iterDatabase.getName().trim().equalsIgnoreCase( databaseMe... |
@Test public void connectedToRepository() { when( repository.isConnected() ).thenReturn( true ); assertTrue( timeoutHandler.connectedToRepository() ); } | boolean connectedToRepository() { return repository.isConnected(); } | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } } | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } RepositorySessionTimeoutHandler( ReconnectableRepository repository,
RepositoryConnectController repositoryConnectController ); } | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } RepositorySessionTimeoutHandler( ReconnectableRepository repository,
RepositoryConnectController repositoryConnectController ); @SuppressWarnings( "unchecked" ) @Override Object invo... | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } RepositorySessionTimeoutHandler( ReconnectableRepository repository,
RepositoryConnectController repositoryConnectController ); @SuppressWarnings( "unchecked" ) @Override Object invo... |
@Test public void connectedToRepositoryReturnsFalse() { when( repository.isConnected() ).thenReturn( false ); assertFalse( timeoutHandler.connectedToRepository() ); } | boolean connectedToRepository() { return repository.isConnected(); } | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } } | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } RepositorySessionTimeoutHandler( ReconnectableRepository repository,
RepositoryConnectController repositoryConnectController ); } | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } RepositorySessionTimeoutHandler( ReconnectableRepository repository,
RepositoryConnectController repositoryConnectController ); @SuppressWarnings( "unchecked" ) @Override Object invo... | RepositorySessionTimeoutHandler implements InvocationHandler { boolean connectedToRepository() { return repository.isConnected(); } RepositorySessionTimeoutHandler( ReconnectableRepository repository,
RepositoryConnectController repositoryConnectController ); @SuppressWarnings( "unchecked" ) @Override Object invo... |
@Test public void wrapMetastoreWithTimeoutHandler() throws Throwable { IMetaStore metaStore = mock( IMetaStore.class ); doThrow( KettleRepositoryLostException.class ).when( metaStore ).createNamespace( any() ); SessionTimeoutHandler sessionTimeoutHandler = mock( SessionTimeoutHandler.class ); IMetaStore wrappedMetaStor... | static IMetaStore wrapMetastoreWithTimeoutHandler( IMetaStore metaStore, SessionTimeoutHandler sessionTimeoutHandler ) { MetaStoreSessionTimeoutHandler metaStoreSessionTimeoutHandler = new MetaStoreSessionTimeoutHandler( metaStore, sessionTimeoutHandler ); return wrapObjectWithTimeoutHandler( metaStore, metaStoreSessio... | RepositorySessionTimeoutHandler implements InvocationHandler { static IMetaStore wrapMetastoreWithTimeoutHandler( IMetaStore metaStore, SessionTimeoutHandler sessionTimeoutHandler ) { MetaStoreSessionTimeoutHandler metaStoreSessionTimeoutHandler = new MetaStoreSessionTimeoutHandler( metaStore, sessionTimeoutHandler ); ... | RepositorySessionTimeoutHandler implements InvocationHandler { static IMetaStore wrapMetastoreWithTimeoutHandler( IMetaStore metaStore, SessionTimeoutHandler sessionTimeoutHandler ) { MetaStoreSessionTimeoutHandler metaStoreSessionTimeoutHandler = new MetaStoreSessionTimeoutHandler( metaStore, sessionTimeoutHandler ); ... | RepositorySessionTimeoutHandler implements InvocationHandler { static IMetaStore wrapMetastoreWithTimeoutHandler( IMetaStore metaStore, SessionTimeoutHandler sessionTimeoutHandler ) { MetaStoreSessionTimeoutHandler metaStoreSessionTimeoutHandler = new MetaStoreSessionTimeoutHandler( metaStore, sessionTimeoutHandler ); ... | RepositorySessionTimeoutHandler implements InvocationHandler { static IMetaStore wrapMetastoreWithTimeoutHandler( IMetaStore metaStore, SessionTimeoutHandler sessionTimeoutHandler ) { MetaStoreSessionTimeoutHandler metaStoreSessionTimeoutHandler = new MetaStoreSessionTimeoutHandler( metaStore, sessionTimeoutHandler ); ... |
@SuppressWarnings( "unchecked" ) @Test public void testHandlerCallOnException() throws Throwable { when( repositoryService.getUsers() ).thenThrow( KettleRepositoryLostException.class ); Method method = RepositorySecurityManager.class.getMethod( "getUsers" ); metaStoresessionTimeoutHandler.invoke( mock( Proxy.class ), m... | @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ex.getCause(), method, args ); } } | RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ... | RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ... | RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ... | RepositoryServiceSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( repositoryService, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( repositoryService, ... |
@Test public void handle() throws Throwable { when( repository.readTransSharedObjects( any() ) ).thenReturn( mock( SharedObjects.class ) ); Method method = Repository.class.getMethod( "readTransSharedObjects", TransMeta.class ); sessionTimeoutHandler.handle( repository, mock( Exception.class ), method, new Object[] { m... | public Object handle( Object objectToHandle, Throwable exception, Method method, Object[] args ) throws Throwable { if ( lookupForConnectTimeoutError( exception ) && !calledFromThisHandler() ) { try { return method.invoke( objectToHandle, args ); } catch ( InvocationTargetException ex2 ) { if ( !lookupForConnectTimeout... | SessionTimeoutHandler { public Object handle( Object objectToHandle, Throwable exception, Method method, Object[] args ) throws Throwable { if ( lookupForConnectTimeoutError( exception ) && !calledFromThisHandler() ) { try { return method.invoke( objectToHandle, args ); } catch ( InvocationTargetException ex2 ) { if ( ... | SessionTimeoutHandler { public Object handle( Object objectToHandle, Throwable exception, Method method, Object[] args ) throws Throwable { if ( lookupForConnectTimeoutError( exception ) && !calledFromThisHandler() ) { try { return method.invoke( objectToHandle, args ); } catch ( InvocationTargetException ex2 ) { if ( ... | SessionTimeoutHandler { public Object handle( Object objectToHandle, Throwable exception, Method method, Object[] args ) throws Throwable { if ( lookupForConnectTimeoutError( exception ) && !calledFromThisHandler() ) { try { return method.invoke( objectToHandle, args ); } catch ( InvocationTargetException ex2 ) { if ( ... | SessionTimeoutHandler { public Object handle( Object objectToHandle, Throwable exception, Method method, Object[] args ) throws Throwable { if ( lookupForConnectTimeoutError( exception ) && !calledFromThisHandler() ) { try { return method.invoke( objectToHandle, args ); } catch ( InvocationTargetException ex2 ) { if ( ... |
@SuppressWarnings( "unchecked" ) @Test public void testHandlerCallOnException() throws Throwable { when( metaStore.getName() ).thenThrow( KettleRepositoryLostException.class ); Method method = IMetaStore.class.getMethod( "getName" ); metaStoresessionTimeoutHandler.invoke( mock( Proxy.class ), method, new Object[0] ); v... | @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( metaStore, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( metaStore, ex.getCause(), method, args ); } } | MetaStoreSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( metaStore, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( metaStore, ex.getCause(), method, a... | MetaStoreSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( metaStore, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( metaStore, ex.getCause(), method, a... | MetaStoreSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( metaStore, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( metaStore, ex.getCause(), method, a... | MetaStoreSessionTimeoutHandler implements InvocationHandler { @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return method.invoke( metaStore, args ); } catch ( InvocationTargetException ex ) { return sessionTimeoutHandler.handle( metaStore, ex.getCause(), method, a... |
@Test public void setPipedOutputStream() { PipedOutputStream pipedOutputStream = new PipedOutputStream(); log4jPipedAppender.setPipedOutputStream( pipedOutputStream ); assertThat( log4jPipedAppender.getPipedOutputStream(), is( pipedOutputStream ) ); } | public void setPipedOutputStream( PipedOutputStream pipedOutputStream ) { this.pipedOutputStream = pipedOutputStream; } | Log4jPipedAppender implements Appender { public void setPipedOutputStream( PipedOutputStream pipedOutputStream ) { this.pipedOutputStream = pipedOutputStream; } } | Log4jPipedAppender implements Appender { public void setPipedOutputStream( PipedOutputStream pipedOutputStream ) { this.pipedOutputStream = pipedOutputStream; } Log4jPipedAppender(); } | Log4jPipedAppender implements Appender { public void setPipedOutputStream( PipedOutputStream pipedOutputStream ) { this.pipedOutputStream = pipedOutputStream; } Log4jPipedAppender(); void addFilter( Filter filter ); Filter getFilter(); void clearFilters(); void close(); void doAppend( LoggingEvent event ); void setName... | Log4jPipedAppender implements Appender { public void setPipedOutputStream( PipedOutputStream pipedOutputStream ) { this.pipedOutputStream = pipedOutputStream; } Log4jPipedAppender(); void addFilter( Filter filter ); Filter getFilter(); void clearFilters(); void close(); void doAppend( LoggingEvent event ); void setName... |
@Test public void doAppend() throws IOException { PipedOutputStream pipedOutputStream = mock( PipedOutputStream.class ); LoggingEvent loggingEvent = mock( LoggingEvent.class ); Layout testLayout = mock( Layout.class ); when( testLayout.format( loggingEvent ) ).thenReturn( "LOG_TEST_LINE" ); log4jPipedAppender.setLayout... | public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { pipedOutputStream.write( line.getBytes() ); } catch ( IOException e ) { System.out.println( "Unable to write to piped output stream : " + e.getMessage() ); } } | Log4jPipedAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { pipedOutputStream.write( line.getBytes() ); } catch ( IOException e ) { System.out.println( "Unable to write to piped output stream : " + e.getMessage() ); } } } | Log4jPipedAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { pipedOutputStream.write( line.getBytes() ); } catch ( IOException e ) { System.out.println( "Unable to write to piped output stream : " + e.getMessage() ); } } Log4jPipedAppender(... | Log4jPipedAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { pipedOutputStream.write( line.getBytes() ); } catch ( IOException e ) { System.out.println( "Unable to write to piped output stream : " + e.getMessage() ); } } Log4jPipedAppender(... | Log4jPipedAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { pipedOutputStream.write( line.getBytes() ); } catch ( IOException e ) { System.out.println( "Unable to write to piped output stream : " + e.getMessage() ); } } Log4jPipedAppender(... |
@Test public void testRunsATrans() throws Exception { TransMeta parentMeta = new TransMeta( this.getClass().getResource( "subtrans-executor-parent.ktr" ).getPath(), new Variables() ); TransMeta subMeta = new TransMeta( this.getClass().getResource( "subtrans-executor-sub.ktr" ).getPath(), new Variables() ); LoggingObjec... | public Result execute( List<RowMetaAndData> rows ) throws KettleException { if ( rows.isEmpty() ) { return null; } this.transExecutorData.groupTimeStart = System.currentTimeMillis(); Trans subtrans = this.createSubtrans(); this.transExecutorData.setExecutorTrans( subtrans ); passParametersToTrans( subtrans, rows.get( 0... | SubtransExecutor { public Result execute( List<RowMetaAndData> rows ) throws KettleException { if ( rows.isEmpty() ) { return null; } this.transExecutorData.groupTimeStart = System.currentTimeMillis(); Trans subtrans = this.createSubtrans(); this.transExecutorData.setExecutorTrans( subtrans ); passParametersToTrans( su... | SubtransExecutor { public Result execute( List<RowMetaAndData> rows ) throws KettleException { if ( rows.isEmpty() ) { return null; } this.transExecutorData.groupTimeStart = System.currentTimeMillis(); Trans subtrans = this.createSubtrans(); this.transExecutorData.setExecutorTrans( subtrans ); passParametersToTrans( su... | SubtransExecutor { public Result execute( List<RowMetaAndData> rows ) throws KettleException { if ( rows.isEmpty() ) { return null; } this.transExecutorData.groupTimeStart = System.currentTimeMillis(); Trans subtrans = this.createSubtrans(); this.transExecutorData.setExecutorTrans( subtrans ); passParametersToTrans( su... | SubtransExecutor { public Result execute( List<RowMetaAndData> rows ) throws KettleException { if ( rows.isEmpty() ) { return null; } this.transExecutorData.groupTimeStart = System.currentTimeMillis(); Trans subtrans = this.createSubtrans(); this.transExecutorData.setExecutorTrans( subtrans ); passParametersToTrans( su... |
@Test public void close() throws IOException { PipedOutputStream pipedOutputStream = mock( PipedOutputStream.class ); log4jPipedAppender.setPipedOutputStream( pipedOutputStream ); log4jPipedAppender.close(); verify( pipedOutputStream ).close(); } | public void close() { try { pipedOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close piped output stream: " + e.getMessage() ); } } | Log4jPipedAppender implements Appender { public void close() { try { pipedOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close piped output stream: " + e.getMessage() ); } } } | Log4jPipedAppender implements Appender { public void close() { try { pipedOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close piped output stream: " + e.getMessage() ); } } Log4jPipedAppender(); } | Log4jPipedAppender implements Appender { public void close() { try { pipedOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close piped output stream: " + e.getMessage() ); } } Log4jPipedAppender(); void addFilter( Filter filter ); Filter getFilter(); void clearFilters(); void close(); vo... | Log4jPipedAppender implements Appender { public void close() { try { pipedOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close piped output stream: " + e.getMessage() ); } } Log4jPipedAppender(); void addFilter( Filter filter ); Filter getFilter(); void clearFilters(); void close(); vo... |
@Test public void eventAddedError() { log4jPlugin.eventAdded( new KettleLoggingEvent( "ERROR_TEST_MESSAGE", 0L, LogLevel.ERROR ) ); verify( logger ).log( Level.ERROR, "ERROR_TEST_MESSAGE" ); } | @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoLogger.log( Level.INFO, event.getMessage() ); brea... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... |
@Test public void eventAddedDebug() { log4jPlugin.eventAdded( new KettleLoggingEvent( "DEBUG_TEST_MESSAGE", 0L, LogLevel.DEBUG ) ); verify( logger ).log( Level.DEBUG, "DEBUG_TEST_MESSAGE" ); } | @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoLogger.log( Level.INFO, event.getMessage() ); brea... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... |
@Test public void eventAddedDetailed() { log4jPlugin.eventAdded( new KettleLoggingEvent( "DETAILED_TEST_MESSAGE", 0L, LogLevel.DETAILED ) ); verify( logger ).log( Level.INFO, "DETAILED_TEST_MESSAGE" ); } | @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoLogger.log( Level.INFO, event.getMessage() ); brea... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... |
@Test public void eventAddedRowLevel() { log4jPlugin.eventAdded( new KettleLoggingEvent( "ROWLEVEL_TEST_MESSAGE", 0L, LogLevel.ROWLEVEL ) ); verify( logger ).log( Level.DEBUG, "ROWLEVEL_TEST_MESSAGE" ); } | @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoLogger.log( Level.INFO, event.getMessage() ); brea... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... |
@Test public void eventAddedBasic() { log4jPlugin.eventAdded( new KettleLoggingEvent( "BASIC_TEST_MESSAGE", 0L, LogLevel.BASIC ) ); verify( logger ).log( Level.INFO, "BASIC_TEST_MESSAGE" ); } | @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoLogger.log( Level.INFO, event.getMessage() ); brea... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... |
@Test public void eventAddedMinimal() { log4jPlugin.eventAdded( new KettleLoggingEvent( "MINIMAL_TEST_MESSAGE", 0L, LogLevel.MINIMAL ) ); verify( logger ).log( Level.INFO, "MINIMAL_TEST_MESSAGE" ); } | @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoLogger.log( Level.INFO, event.getMessage() ); brea... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... | Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoL... |
@Test public void formatNonLogMessage_without_add_time() { Log4jKettleLayout layout = new Log4jKettleLayout( false ); String actualResult = layout.format( mock( LoggingEvent.class ) ); assertThat( actualResult, equalTo( "<null>" ) ); } | public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.getMessage(); if ( object instanceof LogMessage ) { LogMessage messag... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... |
@Test public void formatNonLogMessage_with_add_time() { Log4jKettleLayout layout = new Log4jKettleLayout( true ); String actualResult = layout.format( mock( LoggingEvent.class ) ); assertThat( actualResult, equalTo( "1970/01/01 00:00:00 - <null>" ) ); } | public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.getMessage(); if ( object instanceof LogMessage ) { LogMessage messag... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... |
@Test public void formatLogMessage_without_add_time() { Log4jKettleLayout layout = new Log4jKettleLayout( false ); LoggingEvent loggingEvent = mock( LoggingEvent.class ); LogMessage logMessage = new LogMessage( "TEST_MESSAGE", "TEST_ID", LogLevel.BASIC ); when( loggingEvent.getMessage() ).thenReturn( logMessage ); Stri... | public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.getMessage(); if ( object instanceof LogMessage ) { LogMessage messag... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... |
@Test public void testConnectRepository() throws KettleException { TransExecutionConfiguration transExecConf = new TransExecutionConfiguration(); final RepositoriesMeta repositoriesMeta = mock( RepositoriesMeta.class ); final RepositoryMeta repositoryMeta = mock( RepositoryMeta.class ); final Repository repository = mo... | public Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ) throws KettleException { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName ); if ( repositoryMeta == null ) { log.logBasic( "I couldn't find the repository with... | TransExecutionConfiguration implements ExecutionConfiguration { public Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ) throws KettleException { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName ); if ( repositoryMet... | TransExecutionConfiguration implements ExecutionConfiguration { public Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ) throws KettleException { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName ); if ( repositoryMet... | TransExecutionConfiguration implements ExecutionConfiguration { public Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ) throws KettleException { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName ); if ( repositoryMet... | TransExecutionConfiguration implements ExecutionConfiguration { public Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ) throws KettleException { RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName ); if ( repositoryMet... |
@Test public void formatLogMessage_with_add_time() { Log4jKettleLayout layout = new Log4jKettleLayout( true ); LoggingEvent loggingEvent = mock( LoggingEvent.class ); LogMessage logMessage = new LogMessage( "TEST_MESSAGE", "TEST_ID", LogLevel.BASIC ); when( loggingEvent.getMessage() ).thenReturn( logMessage ); String a... | public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.getMessage(); if ( object instanceof LogMessage ) { LogMessage messag... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... | Log4jKettleLayout extends Layout implements Log4JLayoutInterface { public String format( LoggingEvent event ) { StringBuffer line = new StringBuffer(); String dateTimeString = ""; if ( timeAdded ) { dateTimeString = LOCAL_SIMPLE_DATE_PARSER.get().format( new Date( event.timeStamp ) ) + " - "; } Object object = event.ge... |
@Test public void doAppend() throws IOException { LoggingEvent loggingEvent = mock( LoggingEvent.class ); Layout testLayout = mock( Layout.class ); when( testLayout.format( loggingEvent ) ).thenReturn( "LOG_TEST_LINE" ); log4jFileAppender.setLayout( testLayout ); log4jFileAppender.doAppend( loggingEvent ); verify( outp... | public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { fileOutputStream.write( line.getBytes( Const.XML_ENCODING ) ); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMessage() ); } } | Log4jFileAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { fileOutputStream.write( line.getBytes( Const.XML_ENCODING ) ); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMes... | Log4jFileAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { fileOutputStream.write( line.getBytes( Const.XML_ENCODING ) ); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMes... | Log4jFileAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { fileOutputStream.write( line.getBytes( Const.XML_ENCODING ) ); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMes... | Log4jFileAppender implements Appender { public void doAppend( LoggingEvent event ) { String line = layout.format( event ) + Const.CR; try { fileOutputStream.write( line.getBytes( Const.XML_ENCODING ) ); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMes... |
@Test public void close() throws IOException { log4jFileAppender.close(); verify( outputStream ).close(); } | public void close() { try { fileOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMessage() ); } } | Log4jFileAppender implements Appender { public void close() { try { fileOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMessage() ); } } } | Log4jFileAppender implements Appender { public void close() { try { fileOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMessage() ); } } Log4jFileAppender( FileObject file ); Log4jFileAppender( FileObject file, boolean append ); } | Log4jFileAppender implements Appender { public void close() { try { fileOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMessage() ); } } Log4jFileAppender( FileObject file ); Log4jFileAppender( FileObject file, boolean append ); vo... | Log4jFileAppender implements Appender { public void close() { try { fileOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close Logging file [" + file.getName() + "] : " + e.getMessage() ); } } Log4jFileAppender( FileObject file ); Log4jFileAppender( FileObject file, boolean append ); vo... |
@Test public void createReport() throws Exception { LoggingObjectInterface log = mock( LoggingObjectInterface.class ); AutoDocOptionsInterface options = mock( AutoDocOptionsInterface.class ); when( options.isIncludingImage() ).thenReturn( Boolean.TRUE ); KettleReportBuilder builder = new KettleReportBuilder( log, Colle... | public void createReport() throws Exception { report = new MasterReport(); KettleFileTableModel transMetaTableModel = new KettleFileTableModel( parentObject, filenames ); TableDataFactory dataFactory = new TableDataFactory( "default", transMetaTableModel ); report.setDataFactory( dataFactory ); ReportHeader reportHeade... | KettleReportBuilder { public void createReport() throws Exception { report = new MasterReport(); KettleFileTableModel transMetaTableModel = new KettleFileTableModel( parentObject, filenames ); TableDataFactory dataFactory = new TableDataFactory( "default", transMetaTableModel ); report.setDataFactory( dataFactory ); Re... | KettleReportBuilder { public void createReport() throws Exception { report = new MasterReport(); KettleFileTableModel transMetaTableModel = new KettleFileTableModel( parentObject, filenames ); TableDataFactory dataFactory = new TableDataFactory( "default", transMetaTableModel ); report.setDataFactory( dataFactory ); Re... | KettleReportBuilder { public void createReport() throws Exception { report = new MasterReport(); KettleFileTableModel transMetaTableModel = new KettleFileTableModel( parentObject, filenames ); TableDataFactory dataFactory = new TableDataFactory( "default", transMetaTableModel ); report.setDataFactory( dataFactory ); Re... | KettleReportBuilder { public void createReport() throws Exception { report = new MasterReport(); KettleFileTableModel transMetaTableModel = new KettleFileTableModel( parentObject, filenames ); TableDataFactory dataFactory = new TableDataFactory( "default", transMetaTableModel ); report.setDataFactory( dataFactory ); Re... |
@Test public void testGetBatchSizeInt() { ElasticSearchBulkMeta esbm = new ElasticSearchBulkMeta(); int batchSize = esbm.getBatchSizeInt( new VariableSpaceImpl() ); assertEquals( batchSize, ElasticSearchBulkMeta.DEFAULT_BATCH_SIZE ); } | public int getBatchSizeInt( VariableSpace vars ) { return Const.toInt( vars.environmentSubstitute( this.batchSize ), DEFAULT_BATCH_SIZE ); } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public int getBatchSizeInt( VariableSpace vars ) { return Const.toInt( vars.environmentSubstitute( this.batchSize ), DEFAULT_BATCH_SIZE ); } } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public int getBatchSizeInt( VariableSpace vars ) { return Const.toInt( vars.environmentSubstitute( this.batchSize ), DEFAULT_BATCH_SIZE ); } ElasticSearchBulkMeta(); } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public int getBatchSizeInt( VariableSpace vars ) { return Const.toInt( vars.environmentSubstitute( this.batchSize ), DEFAULT_BATCH_SIZE ); } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutFie... | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public int getBatchSizeInt( VariableSpace vars ) { return Const.toInt( vars.environmentSubstitute( this.batchSize ), DEFAULT_BATCH_SIZE ); } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutFie... |
@Test public void testClone() { ElasticSearchBulkMeta esbm = new ElasticSearchBulkMeta(); ElasticSearchBulkMeta esbmClone = (ElasticSearchBulkMeta) esbm.clone(); assertNotNull( esbmClone ); } | public Object clone() { ElasticSearchBulkMeta retval = (ElasticSearchBulkMeta) super.clone(); return retval; } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public Object clone() { ElasticSearchBulkMeta retval = (ElasticSearchBulkMeta) super.clone(); return retval; } } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public Object clone() { ElasticSearchBulkMeta retval = (ElasticSearchBulkMeta) super.clone(); return retval; } ElasticSearchBulkMeta(); } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public Object clone() { ElasticSearchBulkMeta retval = (ElasticSearchBulkMeta) super.clone(); return retval; } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutField(); void setIdOutField( Stri... | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public Object clone() { ElasticSearchBulkMeta retval = (ElasticSearchBulkMeta) super.clone(); return retval; } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutField(); void setIdOutField( Stri... |
@Test public void testSupportsErrorHandling() { ElasticSearchBulkMeta esbm = new ElasticSearchBulkMeta(); boolean supportsError = esbm.supportsErrorHandling(); assertTrue( supportsError ); } | public boolean supportsErrorHandling() { return true; } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public boolean supportsErrorHandling() { return true; } } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public boolean supportsErrorHandling() { return true; } ElasticSearchBulkMeta(); } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public boolean supportsErrorHandling() { return true; } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutField(); void setIdOutField( String idField ); boolean isJsonInsert(); void setJsonInser... | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public boolean supportsErrorHandling() { return true; } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutField(); void setIdOutField( String idField ); boolean isJsonInsert(); void setJsonInser... |
@Test public void testGetStepData() { ElasticSearchBulkMeta esbm = new ElasticSearchBulkMeta(); StepDataInterface sdi = esbm.getStepData(); assertTrue( sdi instanceof ElasticSearchBulkData ); } | public StepDataInterface getStepData() { return new ElasticSearchBulkData(); } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public StepDataInterface getStepData() { return new ElasticSearchBulkData(); } } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public StepDataInterface getStepData() { return new ElasticSearchBulkData(); } ElasticSearchBulkMeta(); } | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public StepDataInterface getStepData() { return new ElasticSearchBulkData(); } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutField(); void setIdOutField( String idField ); boolean isJsonInse... | ElasticSearchBulkMeta extends BaseStepMeta implements StepMetaInterface { public StepDataInterface getStepData() { return new ElasticSearchBulkData(); } ElasticSearchBulkMeta(); String getJsonField(); void setJsonField( String jsonField ); String getIdOutField(); void setIdOutField( String idField ); boolean isJsonInse... |
@Test public void testGetBundleNewUTF8() throws Exception { res = GlobalMessages.getBundle( Locale.JAPAN, "org/pentaho/di/i18n/messages/test_utf8_messages" ); assertEquals( "環境変数の選択", res.getString( "System.Dialog.SelectEnvironmentVar.Title" ) ); res = GlobalMessages.getBundle( Locale.CHINA, "org/pentaho/di/i18n/messag... | public static ResourceBundle getBundle( String packageName ) throws MissingResourceException { return getBundle( packageName, GlobalMessages.getInstance().getClass() ); } | GlobalMessages extends AbstractMessageHandler { public static ResourceBundle getBundle( String packageName ) throws MissingResourceException { return getBundle( packageName, GlobalMessages.getInstance().getClass() ); } } | GlobalMessages extends AbstractMessageHandler { public static ResourceBundle getBundle( String packageName ) throws MissingResourceException { return getBundle( packageName, GlobalMessages.getInstance().getClass() ); } GlobalMessages(); } | GlobalMessages extends AbstractMessageHandler { public static ResourceBundle getBundle( String packageName ) throws MissingResourceException { return getBundle( packageName, GlobalMessages.getInstance().getClass() ); } GlobalMessages(); static synchronized MessageHandler getInstance(); static synchronized Locale getLoc... | GlobalMessages extends AbstractMessageHandler { public static ResourceBundle getBundle( String packageName ) throws MissingResourceException { return getBundle( packageName, GlobalMessages.getInstance().getClass() ); } GlobalMessages(); static synchronized MessageHandler getInstance(); static synchronized Locale getLoc... |
@Test public void testOpenLocalPentahoMetaStore() throws Exception { MetaStoreConst.disableMetaStore = false; File tempDir = Files.createTempDir(); String tempPath = tempDir.getAbsolutePath(); System.setProperty( Const.PENTAHO_METASTORE_FOLDER, tempPath ); String metaFolder = tempPath + File.separator + XmlUtil.META_FO... | public static IMetaStore openLocalPentahoMetaStore() throws MetaStoreException { return MetaStoreConst.openLocalPentahoMetaStore( true ); } | MetaStoreConst { public static IMetaStore openLocalPentahoMetaStore() throws MetaStoreException { return MetaStoreConst.openLocalPentahoMetaStore( true ); } } | MetaStoreConst { public static IMetaStore openLocalPentahoMetaStore() throws MetaStoreException { return MetaStoreConst.openLocalPentahoMetaStore( true ); } } | MetaStoreConst { public static IMetaStore openLocalPentahoMetaStore() throws MetaStoreException { return MetaStoreConst.openLocalPentahoMetaStore( true ); } static final String getDefaultPentahoMetaStoreLocation(); static IMetaStore openLocalPentahoMetaStore(); static IMetaStore openLocalPentahoMetaStore( boolean allo... | MetaStoreConst { public static IMetaStore openLocalPentahoMetaStore() throws MetaStoreException { return MetaStoreConst.openLocalPentahoMetaStore( true ); } static final String getDefaultPentahoMetaStoreLocation(); static IMetaStore openLocalPentahoMetaStore(); static IMetaStore openLocalPentahoMetaStore( boolean allo... |
@Test public void testDefaultPassedBatchId() { TransExecutionConfiguration tec = new TransExecutionConfiguration(); assertEquals( "default passedBatchId value must be null", null, tec.getPassedBatchId() ); } | public Long getPassedBatchId() { return passedBatchId; } | TransExecutionConfiguration implements ExecutionConfiguration { public Long getPassedBatchId() { return passedBatchId; } } | TransExecutionConfiguration implements ExecutionConfiguration { public Long getPassedBatchId() { return passedBatchId; } TransExecutionConfiguration(); TransExecutionConfiguration( Node trecNode ); } | TransExecutionConfiguration implements ExecutionConfiguration { public Long getPassedBatchId() { return passedBatchId; } TransExecutionConfiguration(); TransExecutionConfiguration( Node trecNode ); Object clone(); Map<String, String> getArguments(); void setArguments( Map<String, String> arguments ); void setParams( M... | TransExecutionConfiguration implements ExecutionConfiguration { public Long getPassedBatchId() { return passedBatchId; } TransExecutionConfiguration(); TransExecutionConfiguration( Node trecNode ); Object clone(); Map<String, String> getArguments(); void setArguments( Map<String, String> arguments ); void setParams( M... |
@Test public void testStringObjectId() { String expectedId = UUID.randomUUID().toString(); StringObjectId obj = new StringObjectId( expectedId ); assertEquals( expectedId, obj.getId() ); assertEquals( expectedId, obj.toString() ); assertEquals( expectedId.hashCode(), obj.hashCode() ); assertFalse( obj.equals( null ) );... | public StringObjectId( String id ) { this.id = id; } | StringObjectId implements ObjectId, Comparable<StringObjectId> { public StringObjectId( String id ) { this.id = id; } } | StringObjectId implements ObjectId, Comparable<StringObjectId> { public StringObjectId( String id ) { this.id = id; } StringObjectId( String id ); StringObjectId( ObjectId objectId ); } | StringObjectId implements ObjectId, Comparable<StringObjectId> { public StringObjectId( String id ) { this.id = id; } StringObjectId( String id ); StringObjectId( ObjectId objectId ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override int compareTo( StringObjectId o ); @Override String toStrin... | StringObjectId implements ObjectId, Comparable<StringObjectId> { public StringObjectId( String id ) { this.id = id; } StringObjectId( String id ); StringObjectId( ObjectId objectId ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override int compareTo( StringObjectId o ); @Override String toStrin... |
@Test public void testNegatedTrueFuncEvaluatesAsFalse() throws Exception { String left = "test_filed"; String right = "test_value"; int func = Condition.FUNC_TRUE; boolean negate = true; Condition condition = new Condition( negate, left, func, right, null ); assertFalse( condition.evaluate( new RowMeta(), new Object[]{... | public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_valuename ); } if ( right_valuename != null && rig... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... |
@Test public void testPdi13227() throws Exception { RowMetaInterface rowMeta1 = new RowMeta(); rowMeta1.addValueMeta( new ValueMetaNumber( "name1" ) ); rowMeta1.addValueMeta( new ValueMetaNumber( "name2" ) ); rowMeta1.addValueMeta( new ValueMetaNumber( "name3" ) ); RowMetaInterface rowMeta2 = new RowMeta(); rowMeta2.ad... | public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_valuename ); } if ( right_valuename != null && rig... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... | Condition implements Cloneable, XMLInterface { public boolean evaluate( RowMetaInterface rowMeta, Object[] r ) { boolean retval = false; try { if ( isAtomic() ) { if ( function == FUNC_TRUE ) { return !negate; } if ( left_valuename != null && left_valuename.length() > 0 ) { left_fieldnr = rowMeta.indexOfValue( left_val... |
@SuppressWarnings( "deprecation" ) @Test public void testDateCache() { DateCache cache = new DateCache(); cache.populate( "yyyy-MM-dd", 2016, 2016 ); assertEquals( 366, cache.getSize() ); assertEquals( Calendar.FEBRUARY, cache.lookupDate( "2016-02-29" ).getMonth() ); assertEquals( 29, cache.lookupDate( "2016-02-29" ).g... | public DateCache() { cache = new HashMap<String, Date>(); } | DateCache { public DateCache() { cache = new HashMap<String, Date>(); } } | DateCache { public DateCache() { cache = new HashMap<String, Date>(); } DateCache(); } | DateCache { public DateCache() { cache = new HashMap<String, Date>(); } DateCache(); void populate( String datePattern, int fromYear, int toYear ); void addDate( String dateString, Date date ); Date lookupDate( String dateString ); int getSize(); static void main( String[] args ); } | DateCache { public DateCache() { cache = new HashMap<String, Date>(); } DateCache(); void populate( String datePattern, int fromYear, int toYear ); void addDate( String dateString, Date date ); Date lookupDate( String dateString ); int getSize(); static void main( String[] args ); } |
@Test public void testObjectTypePairsToString() throws Exception { Exception cause = new NullPointerException(); Map<String, RepositoryObjectType> notFoundedReferences = new LinkedHashMap<String, RepositoryObjectType>(); String pathToTransStub = "/path/Trans.ktr"; String pathToJobStub = "/path/Job.ktr"; notFoundedRefer... | public String objectTypePairsToString() { StringBuilder result = new StringBuilder(); for ( Map.Entry entry : objectTypePairs.entrySet() ) { if ( entry.getKey() != null ) { result.append( Const.CR ); result.append( "\"" ); result.append( entry.getKey() ); result.append( "\"" ); result.append( " [" ); result.append( ent... | LookupReferencesException extends KettleException { public String objectTypePairsToString() { StringBuilder result = new StringBuilder(); for ( Map.Entry entry : objectTypePairs.entrySet() ) { if ( entry.getKey() != null ) { result.append( Const.CR ); result.append( "\"" ); result.append( entry.getKey() ); result.appen... | LookupReferencesException extends KettleException { public String objectTypePairsToString() { StringBuilder result = new StringBuilder(); for ( Map.Entry entry : objectTypePairs.entrySet() ) { if ( entry.getKey() != null ) { result.append( Const.CR ); result.append( "\"" ); result.append( entry.getKey() ); result.appen... | LookupReferencesException extends KettleException { public String objectTypePairsToString() { StringBuilder result = new StringBuilder(); for ( Map.Entry entry : objectTypePairs.entrySet() ) { if ( entry.getKey() != null ) { result.append( Const.CR ); result.append( "\"" ); result.append( entry.getKey() ); result.appen... | LookupReferencesException extends KettleException { public String objectTypePairsToString() { StringBuilder result = new StringBuilder(); for ( Map.Entry entry : objectTypePairs.entrySet() ) { if ( entry.getKey() != null ) { result.append( Const.CR ); result.append( "\"" ); result.append( entry.getKey() ); result.appen... |
@Test public void testGetUrlStrings() throws Exception { String sFileA = "hdfs: String sFileB = "file: FileObject fileA = mock( FileObject.class ); FileObject fileB = mock( FileObject.class ); when( fileA.getPublicURIString() ).thenReturn( sFileA ); when( fileB.getPublicURIString() ).thenReturn( sFileB ); FileInputList... | public String[] getUrlStrings() { String[] fileStrings = new String[ files.size() ]; for ( int i = 0; i < fileStrings.length; i++ ) { fileStrings[ i ] = files.get( i ).getPublicURIString(); } return fileStrings; } | FileInputList { public String[] getUrlStrings() { String[] fileStrings = new String[ files.size() ]; for ( int i = 0; i < fileStrings.length; i++ ) { fileStrings[ i ] = files.get( i ).getPublicURIString(); } return fileStrings; } } | FileInputList { public String[] getUrlStrings() { String[] fileStrings = new String[ files.size() ]; for ( int i = 0; i < fileStrings.length; i++ ) { fileStrings[ i ] = files.get( i ).getPublicURIString(); } return fileStrings; } } | FileInputList { public String[] getUrlStrings() { String[] fileStrings = new String[ files.size() ]; for ( int i = 0; i < fileStrings.length; i++ ) { fileStrings[ i ] = files.get( i ).getPublicURIString(); } return fileStrings; } static String getRequiredFilesDescription( List<FileObject> nonExistantFiles ); static St... | FileInputList { public String[] getUrlStrings() { String[] fileStrings = new String[ files.size() ]; for ( int i = 0; i < fileStrings.length; i++ ) { fileStrings[ i ] = files.get( i ).getPublicURIString(); } return fileStrings; } static String getRequiredFilesDescription( List<FileObject> nonExistantFiles ); static St... |
@Test public void testInitCap() { assertEquals( "Sven", Const.initCap( "Sven" ) ); assertEquals( "Matt", Const.initCap( "MATT" ) ); assertEquals( "Sven Boden", Const.initCap( "sven boden" ) ); assertEquals( "Sven Boden ", Const.initCap( "sven boden " ) ); assertEquals( "Sven Boden Was Here", Const.initCap( "sven boden ... | public static String initCap( String string ) { StringBuilder change = new StringBuilder( string ); boolean new_word; int i; char lower, upper, ch; new_word = true; for ( i = 0; i < string.length(); i++ ) { lower = change.substring( i, i + 1 ).toLowerCase().charAt( 0 ); upper = change.substring( i, i + 1 ).toUpperCase(... | Const { public static String initCap( String string ) { StringBuilder change = new StringBuilder( string ); boolean new_word; int i; char lower, upper, ch; new_word = true; for ( i = 0; i < string.length(); i++ ) { lower = change.substring( i, i + 1 ).toLowerCase().charAt( 0 ); upper = change.substring( i, i + 1 ).toUp... | Const { public static String initCap( String string ) { StringBuilder change = new StringBuilder( string ); boolean new_word; int i; char lower, upper, ch; new_word = true; for ( i = 0; i < string.length(); i++ ) { lower = change.substring( i, i + 1 ).toLowerCase().charAt( 0 ); upper = change.substring( i, i + 1 ).toUp... | Const { public static String initCap( String string ) { StringBuilder change = new StringBuilder( string ); boolean new_word; int i; char lower, upper, ch; new_word = true; for ( i = 0; i < string.length(); i++ ) { lower = change.substring( i, i + 1 ).toLowerCase().charAt( 0 ); upper = change.substring( i, i + 1 ).toUp... | Const { public static String initCap( String string ) { StringBuilder change = new StringBuilder( string ); boolean new_word; int i; char lower, upper, ch; new_word = true; for ( i = 0; i < string.length(); i++ ) { lower = change.substring( i, i + 1 ).toLowerCase().charAt( 0 ); upper = change.substring( i, i + 1 ).toUp... |
@Test public void testSortStrings() { String[] arr1 = { "Red", "Blue", "Black", "Black", "Green" }; String[] arr2 = { "aaa", "zzz", "yyy", "sss", "ttt", "t" }; String[] arr3 = { "A", "B", "C", "D" }; String[] results = Const.sortStrings( arr1 ); assertTrue( isArraySorted( arr1 ) ); assertTrue( isArraySorted( results ) ... | public static String[] sortStrings( String[] input ) { Arrays.sort( input ); return input; } | Const { public static String[] sortStrings( String[] input ) { Arrays.sort( input ); return input; } } | Const { public static String[] sortStrings( String[] input ) { Arrays.sort( input ); return input; } } | Const { public static String[] sortStrings( String[] input ) { Arrays.sort( input ); return input; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, ... | Const { public static String[] sortStrings( String[] input ) { Arrays.sort( input ); return input; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, ... |
@Test public void testIsEmpty() { assertTrue( Const.isEmpty( (String) null ) ); assertTrue( Const.isEmpty( "" ) ); assertFalse( Const.isEmpty( "test" ) ); } | @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... |
@Test public void testIsEmptyStringArray() { assertTrue( Const.isEmpty( (String[]) null ) ); assertTrue( Const.isEmpty( new String[] {} ) ); assertFalse( Const.isEmpty( new String[] { "test" } ) ); } | @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... |
@Test public void simpleConvert() { TransMeta meta = new TransMeta(); meta.setFilename( "fileName" ); meta.addStep( new StepMeta( "stepName", stepMetaInterface ) ); Transformation trans = TransMetaConverter.convert( meta ); assertThat( trans.getId(), is( meta.getFilename() ) ); assertThat( trans.getOperations().size(),... | public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransM... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... |
@Test public void testIsEmptyObjectArray() { assertTrue( Const.isEmpty( (Object[]) null ) ); assertTrue( Const.isEmpty( new Object[] {} ) ); assertFalse( Const.isEmpty( new Object[] { "test" } ) ); } | @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... |
@Test public void testIsEmptyList() { assertTrue( Const.isEmpty( (List) null ) ); assertTrue( Const.isEmpty( new ArrayList() ) ); assertFalse( Const.isEmpty( Arrays.asList( "test", 1 ) ) ); } | @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... |
@Test public void testIsEmptyStringBuffer() { assertTrue( Const.isEmpty( (StringBuffer) null ) ); assertTrue( Const.isEmpty( new StringBuffer( "" ) ) ); assertFalse( Const.isEmpty( new StringBuffer( "test" ) ) ); } | @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... |
@Test public void testIsEmptyStringBuilder() { assertTrue( Const.isEmpty( (StringBuilder) null ) ); assertTrue( Const.isEmpty( new StringBuilder( "" ) ) ); assertFalse( Const.isEmpty( new StringBuilder( "test" ) ) ); } | @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } } | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... | Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int ... |
@Test public void testNVL() { assertNull( Const.NVL( null, null ) ); assertEquals( "test", Const.NVL( "test", "test1" ) ); assertEquals( "test", Const.NVL( "test", null ) ); assertEquals( "test1", Const.NVL( null, "test1" ) ); } | public static String NVL( String source, String def ) { if ( source == null || source.length() == 0 ) { return def; } return source; } | Const { public static String NVL( String source, String def ) { if ( source == null || source.length() == 0 ) { return def; } return source; } } | Const { public static String NVL( String source, String def ) { if ( source == null || source.length() == 0 ) { return def; } return source; } } | Const { public static String NVL( String source, String def ) { if ( source == null || source.length() == 0 ) { return def; } return source; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ... | Const { public static String NVL( String source, String def ) { if ( source == null || source.length() == 0 ) { return def; } return source; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ... |
@Test public void testNrSpacesBefore() { try { Const.nrSpacesBefore( null ); fail( "Expected NullPointerException" ); } catch ( NullPointerException ex ) { } assertEquals( 0, Const.nrSpacesBefore( "" ) ); assertEquals( 1, Const.nrSpacesBefore( " " ) ); assertEquals( 3, Const.nrSpacesBefore( " " ) ); assertEquals( 0, Co... | public static int nrSpacesBefore( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( nr ) == ' ' ) { nr++; } return nr; } | Const { public static int nrSpacesBefore( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( nr ) == ' ' ) { nr++; } return nr; } } | Const { public static int nrSpacesBefore( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( nr ) == ' ' ) { nr++; } return nr; } } | Const { public static int nrSpacesBefore( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( nr ) == ' ' ) { nr++; } return nr; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int ... | Const { public static int nrSpacesBefore( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( nr ) == ' ' ) { nr++; } return nr; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int ... |
@Test public void testNrSpacesAfter() { try { Const.nrSpacesAfter( null ); fail( "Expected NullPointerException" ); } catch ( NullPointerException ex ) { } assertEquals( 0, Const.nrSpacesAfter( "" ) ); assertEquals( 1, Const.nrSpacesAfter( " " ) ); assertEquals( 3, Const.nrSpacesAfter( " " ) ); assertEquals( 0, Const.n... | public static int nrSpacesAfter( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( field.length() - 1 - nr ) == ' ' ) { nr++; } return nr; } | Const { public static int nrSpacesAfter( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( field.length() - 1 - nr ) == ' ' ) { nr++; } return nr; } } | Const { public static int nrSpacesAfter( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( field.length() - 1 - nr ) == ' ' ) { nr++; } return nr; } } | Const { public static int nrSpacesAfter( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( field.length() - 1 - nr ) == ' ' ) { nr++; } return nr; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round... | Const { public static int nrSpacesAfter( String field ) { int nr = 0; int len = field.length(); while ( nr < len && field.charAt( field.length() - 1 - nr ) == ' ' ) { nr++; } return nr; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round... |
@Test public void testLtrim() { assertEquals( null, Const.ltrim( null ) ); assertEquals( "", Const.ltrim( "" ) ); assertEquals( "", Const.ltrim( " " ) ); assertEquals( "test ", Const.ltrim( "test " ) ); assertEquals( "test ", Const.ltrim( " test " ) ); } | public static String ltrim( String source ) { if ( source == null ) { return null; } int from = 0; while ( from < source.length() && isSpace( source.charAt( from ) ) ) { from++; } return source.substring( from ); } | Const { public static String ltrim( String source ) { if ( source == null ) { return null; } int from = 0; while ( from < source.length() && isSpace( source.charAt( from ) ) ) { from++; } return source.substring( from ); } } | Const { public static String ltrim( String source ) { if ( source == null ) { return null; } int from = 0; while ( from < source.length() && isSpace( source.charAt( from ) ) ) { from++; } return source.substring( from ); } } | Const { public static String ltrim( String source ) { if ( source == null ) { return null; } int from = 0; while ( from < source.length() && isSpace( source.charAt( from ) ) ) { from++; } return source.substring( from ); } static double round( double f, int places ); static double round( double f, int places, int roun... | Const { public static String ltrim( String source ) { if ( source == null ) { return null; } int from = 0; while ( from < source.length() && isSpace( source.charAt( from ) ) ) { from++; } return source.substring( from ); } static double round( double f, int places ); static double round( double f, int places, int roun... |
@Test public void testRtrim() { assertEquals( null, Const.rtrim( null ) ); assertEquals( "", Const.rtrim( "" ) ); assertEquals( "", Const.rtrim( " " ) ); assertEquals( "test", Const.rtrim( "test " ) ); assertEquals( "test ", Const.ltrim( " test " ) ); } | public static String rtrim( String source ) { if ( source == null ) { return null; } int max = source.length(); while ( max > 0 && isSpace( source.charAt( max - 1 ) ) ) { max--; } return source.substring( 0, max ); } | Const { public static String rtrim( String source ) { if ( source == null ) { return null; } int max = source.length(); while ( max > 0 && isSpace( source.charAt( max - 1 ) ) ) { max--; } return source.substring( 0, max ); } } | Const { public static String rtrim( String source ) { if ( source == null ) { return null; } int max = source.length(); while ( max > 0 && isSpace( source.charAt( max - 1 ) ) ) { max--; } return source.substring( 0, max ); } } | Const { public static String rtrim( String source ) { if ( source == null ) { return null; } int max = source.length(); while ( max > 0 && isSpace( source.charAt( max - 1 ) ) ) { max--; } return source.substring( 0, max ); } static double round( double f, int places ); static double round( double f, int places, int ro... | Const { public static String rtrim( String source ) { if ( source == null ) { return null; } int max = source.length(); while ( max > 0 && isSpace( source.charAt( max - 1 ) ) ) { max--; } return source.substring( 0, max ); } static double round( double f, int places ); static double round( double f, int places, int ro... |
@Test public void testTrim() { assertEquals( null, Const.trim( null ) ); assertEquals( "", Const.trim( "" ) ); assertEquals( "", Const.trim( " " ) ); assertEquals( "test", Const.trim( "test " ) ); assertEquals( "test", Const.trim( " test " ) ); } | public static String trim( String str ) { if ( str == null ) { return null; } int max = str.length() - 1; int min = 0; while ( min <= max && isSpace( str.charAt( min ) ) ) { min++; } while ( max >= 0 && isSpace( str.charAt( max ) ) ) { max--; } if ( max < min ) { return ""; } return str.substring( min, max + 1 ); } | Const { public static String trim( String str ) { if ( str == null ) { return null; } int max = str.length() - 1; int min = 0; while ( min <= max && isSpace( str.charAt( min ) ) ) { min++; } while ( max >= 0 && isSpace( str.charAt( max ) ) ) { max--; } if ( max < min ) { return ""; } return str.substring( min, max + 1 ... | Const { public static String trim( String str ) { if ( str == null ) { return null; } int max = str.length() - 1; int min = 0; while ( min <= max && isSpace( str.charAt( min ) ) ) { min++; } while ( max >= 0 && isSpace( str.charAt( max ) ) ) { max--; } if ( max < min ) { return ""; } return str.substring( min, max + 1 ... | Const { public static String trim( String str ) { if ( str == null ) { return null; } int max = str.length() - 1; int min = 0; while ( min <= max && isSpace( str.charAt( min ) ) ) { min++; } while ( max >= 0 && isSpace( str.charAt( max ) ) ) { max--; } if ( max < min ) { return ""; } return str.substring( min, max + 1 ... | Const { public static String trim( String str ) { if ( str == null ) { return null; } int max = str.length() - 1; int min = 0; while ( min <= max && isSpace( str.charAt( min ) ) ) { min++; } while ( max >= 0 && isSpace( str.charAt( max ) ) ) { max--; } if ( max < min ) { return ""; } return str.substring( min, max + 1 ... |
@Test public void transWithHops() { TransMeta meta = new TransMeta(); meta.setFilename( "fileName" ); StepMeta from = new StepMeta( "step1", stepMetaInterface ); meta.addStep( from ); StepMeta to = new StepMeta( "step2", stepMetaInterface ); meta.addStep( to ); meta.addTransHop( new TransHopMeta( from, to ) ); Transfor... | public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransM... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... |
@Test public void testOnlySpaces() { try { Const.onlySpaces( null ); fail( "Expected NullPointerException" ); } catch ( NullPointerException ex ) { } assertEquals( true, Const.onlySpaces( "" ) ); assertEquals( true, Const.onlySpaces( " " ) ); assertEquals( false, Const.onlySpaces( " test " ) ); } | public static boolean onlySpaces( String str ) { for ( int i = 0; i < str.length(); i++ ) { if ( !isSpace( str.charAt( i ) ) ) { return false; } } return true; } | Const { public static boolean onlySpaces( String str ) { for ( int i = 0; i < str.length(); i++ ) { if ( !isSpace( str.charAt( i ) ) ) { return false; } } return true; } } | Const { public static boolean onlySpaces( String str ) { for ( int i = 0; i < str.length(); i++ ) { if ( !isSpace( str.charAt( i ) ) ) { return false; } } return true; } } | Const { public static boolean onlySpaces( String str ) { for ( int i = 0; i < str.length(); i++ ) { if ( !isSpace( str.charAt( i ) ) ) { return false; } } return true; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, in... | Const { public static boolean onlySpaces( String str ) { for ( int i = 0; i < str.length(); i++ ) { if ( !isSpace( str.charAt( i ) ) ) { return false; } } return true; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, in... |
@Test public void testSplitString() { assertEquals( 0, Const.splitString( "", ";" ).length ); assertEquals( 0, Const.splitString( null, ";" ).length ); String[] a = Const.splitString( ";", ";" ); assertEquals( 1, a.length ); assertEquals( "", a[0] ); a = Const.splitString( "a;b;c;d", ";" ); assertEquals( 4, a.length );... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringChar() { assertEquals( 0, Const.splitString( "", ';' ).length ); assertEquals( 0, Const.splitString( null, ';' ).length ); String[] a = Const.splitString( ";", ';' ); assertEquals( 1, a.length ); assertEquals( "", a[0] ); a = Const.splitString( "a;b;c;d", ';' ); assertEquals( 4, a.lengt... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringNullWithDelimiterNullAndEnclosureNull() { String[] result = Const.splitString( null, null, null ); assertNull( result ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringNullWithDelimiterNullAndEnclosureNullRemoveEnclosure() { String[] result = Const.splitString( null, null, null, true ); assertNull( result ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterNullAndEnclosureNull() { String stringToSplit = "Hello, world"; String[] result = Const.splitString( stringToSplit, null, null ); assertSplit( result, stringToSplit ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterNullAndEnclosureNullRemoveEnclosure() { String stringToSplit = "Hello, world"; String[] result = Const.splitString( stringToSplit, null, null, true ); assertSplit( result, stringToSplit ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndEnclosureNull() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER1 ); String[] result = Const.splitString( stringToSplit, DELIMITER1, null ); assertSplit( result, chunks ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndEnclosureNullMultiChar() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER2 ); String[] result = Const.splitString( stringToSplit, DELIMITER2, null ); assertSplit( result, chunks ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndEnclosureNullRemoveEnclosure() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER1 ); String[] result = Const.splitString( stringToSplit, DELIMITER1, null, true ); assertSplit( result, chunks ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void transIdFromRepo() throws Exception { TransMeta meta = new TransMeta(); meta.setName( "transName" ); Transformation trans = TransMetaConverter.convert( meta ); assertThat( trans.getId(), is( "/transName" ) ); } | public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransM... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... |
@Test public void testClearOptionsData() throws Exception { } | public void clearOptionsData() { getControls(); if ( optionsParameterTree != null ) { optionsParameterTree.getRootChildren().removeAll(); } } | DataHandler extends AbstractXulEventHandler { public void clearOptionsData() { getControls(); if ( optionsParameterTree != null ) { optionsParameterTree.getRootChildren().removeAll(); } } } | DataHandler extends AbstractXulEventHandler { public void clearOptionsData() { getControls(); if ( optionsParameterTree != null ) { optionsParameterTree.getRootChildren().removeAll(); } } DataHandler(); } | DataHandler extends AbstractXulEventHandler { public void clearOptionsData() { getControls(); if ( optionsParameterTree != null ) { optionsParameterTree.getRootChildren().removeAll(); } } DataHandler(); void loadConnectionData(); void loadAccessData(); void editOptions( int index ); void clearOptionsData(); void getOpt... | DataHandler extends AbstractXulEventHandler { public void clearOptionsData() { getControls(); if ( optionsParameterTree != null ) { optionsParameterTree.getRootChildren().removeAll(); } } DataHandler(); void loadConnectionData(); void loadAccessData(); void editOptions( int index ); void clearOptionsData(); void getOpt... |
@Test public void testSplitStringWithDelimiterAndEnclosureNullMultiCharRemoveEnclosure() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER2 ); String[] result = Const.splitString( stringToSplit, DELIMITER2, null, true ); assertSplit( result, ch... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndEmptyEnclosure() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER1 ); String[] result = Const.splitString( stringToSplit, DELIMITER1, "" ); assertSplit( result, chunks ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndEmptyEnclosureMultiChar() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER2 ); String[] result = Const.splitString( stringToSplit, DELIMITER2, "" ); assertSplit( result, chunks ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndEmptyEnclosureRemoveEnclosure() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER1 ); String[] result = Const.splitString( stringToSplit, DELIMITER1, "", true ); assertSplit( result, chunks ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndEmptyEnclosureMultiCharRemoveEnclosure() { String mask = "Hello%s world"; String[] chunks = {"Hello", " world"}; String stringToSplit = String.format( mask, DELIMITER2 ); String [] result = Const.splitString( stringToSplit, DELIMITER2, "", true ); assertSplit( result, ch... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndQuoteEnclosure1() { String mask = "%sHello%s world%s"; String stringToSplit = String.format( mask, ENCLOSURE1, DELIMITER1, ENCLOSURE1 ); String[] result = Const.splitString( stringToSplit, DELIMITER1, ENCLOSURE1 ); assertSplit( result, stringToSplit ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndQuoteEnclosureMultiChar1() { String mask = "%sHello%s world%s"; String stringToSplit = String.format( mask, ENCLOSURE2, DELIMITER2, ENCLOSURE2 ); String[] result = Const.splitString( stringToSplit, DELIMITER2, ENCLOSURE2 ); assertSplit( result, stringToSplit ); } | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndQuoteEnclosureRemoveEnclosure1() { String mask = "%sHello%s world%s"; String[] chunks1 = { "Hello" + DELIMITER1 + " world" }; String stringToSplit = String.format( mask, ENCLOSURE1, DELIMITER1, ENCLOSURE1 ); String[] result = Const.splitString( stringToSplit, DELIMITER1,... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDelimiterAndQuoteEnclosureMultiCharRemoveEnclosure1() { String mask = "%sHello%s world%s"; String[] chunks2 = { "Hello" + DELIMITER2 + " world" }; String stringToSplit = String.format( mask, ENCLOSURE2, DELIMITER2, ENCLOSURE2 ); String[] result = Const.splitString( stringToSplit, DE... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithDifferentDelimiterAndEnclosure() { String[] result = Const.splitString( "a;'b;c;d';'e,f';'g';h", ";", "'" ); assertNotNull( result ); assertEquals( 5, result.length ); assertEquals( "a", result[0] ); assertEquals( "'b;c;d'", result[1] ); assertEquals( "'e,f'", result[2] ); assertEqu... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void transConfigItems() throws Exception { TransMeta meta = new TransMeta(); meta.setName( "foo" ); Transformation trans = TransMetaConverter.convert( meta ); assertThat( trans.getConfig().get( TransMetaConverter.TRANS_META_NAME_CONF_KEY ), is( "foo" ) ); assertThat( (String) trans.getConfig().get( TransMe... | public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransM... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... | TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDis... |
@Test public void testSplitStringWithMultipleCharacterDelimiterAndEnclosure() { String[] result = Const.splitString( "html this is a web page html</newpage>html and so is this html", "</newpage>", "html" ); assertNotNull( result ); assertEquals( 2, result.length ); assertEquals( "html this is a web page html", result[0... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitStringWithEscaping() { String[] result; result = Const.splitString( null, null, null ); assertNull( result ); result = Const.splitString( "Hello, world", null, null ); assertNotNull( result ); assertEquals( result.length, 1 ); assertEquals( result[0], "Hello, world" ); result = Const.splitStr... | public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen ) { if ... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... | Const { public static String[] splitString( String string, String separator ) { List<String> list = new ArrayList<>(); if ( string == null || string.length() == 0 ) { return new String[] {}; } int sepLen = separator.length(); int from = 0; int end = string.length() - sepLen + 1; for ( int i = from; i < end; i += sepLen... |
@Test public void testSplitPath() { String[] a = Const.splitPath( "", "/" ); assertEquals( 0, a.length ); a = Const.splitPath( null, "/" ); assertEquals( 0, a.length ); a = Const.splitPath( "/", "/" ); assertEquals( 0, a.length ); a = Const.splitPath( "/level1", "/" ); assertEquals( 1, a.length ); assertEquals( "level1... | public static String[] splitPath( String path, String separator ) { if ( path == null || path.length() == 0 || path.equals( separator ) ) { return new String[] {}; } while ( path.endsWith( separator ) ) { path = path.substring( 0, path.length() - 1 ); } int sepLen = separator.length(); int nr_separators = 1; int from =... | Const { public static String[] splitPath( String path, String separator ) { if ( path == null || path.length() == 0 || path.equals( separator ) ) { return new String[] {}; } while ( path.endsWith( separator ) ) { path = path.substring( 0, path.length() - 1 ); } int sepLen = separator.length(); int nr_separators = 1; in... | Const { public static String[] splitPath( String path, String separator ) { if ( path == null || path.length() == 0 || path.equals( separator ) ) { return new String[] {}; } while ( path.endsWith( separator ) ) { path = path.substring( 0, path.length() - 1 ); } int sepLen = separator.length(); int nr_separators = 1; in... | Const { public static String[] splitPath( String path, String separator ) { if ( path == null || path.length() == 0 || path.equals( separator ) ) { return new String[] {}; } while ( path.endsWith( separator ) ) { path = path.substring( 0, path.length() - 1 ); } int sepLen = separator.length(); int nr_separators = 1; in... | Const { public static String[] splitPath( String path, String separator ) { if ( path == null || path.length() == 0 || path.equals( separator ) ) { return new String[] {}; } while ( path.endsWith( separator ) ) { path = path.substring( 0, path.length() - 1 ); } int sepLen = separator.length(); int nr_separators = 1; in... |
@Test public void testRound_BigDecimal() { assertEquals( new BigDecimal( "1.0" ), Const.round( new BigDecimal( "1.0" ), 0, BigDecimal.ROUND_UP ) ); assertEquals( new BigDecimal( "1.0" ), Const.round( new BigDecimal( "1.0" ), 0, BigDecimal.ROUND_DOWN ) ); assertEquals( new BigDecimal( "1.0" ), Const.round( new BigDecima... | public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } } | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } } | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long ... | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long ... |
@Test public void testRound() { assertEquals( 1.0, Const.round( 1.0, 0, BigDecimal.ROUND_UP ) ); assertEquals( 1.0, Const.round( 1.0, 0, BigDecimal.ROUND_DOWN ) ); assertEquals( 1.0, Const.round( 1.0, 0, BigDecimal.ROUND_CEILING ) ); assertEquals( 1.0, Const.round( 1.0, 0, BigDecimal.ROUND_FLOOR ) ); assertEquals( 1.0,... | public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } } | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } } | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long ... | Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.