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 testRound_Long() { assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_UP ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_DOWN ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_CEILING ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_FLOOR ) ); assertEquals( 1L, Con...
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 testToInt() { assertEquals( 123, Const.toInt( "123", -12 ) ); assertEquals( -12, Const.toInt( "123f", -12 ) ); }
public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; }
Const { public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } 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 toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } 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 testToLong() { assertEquals( 1447252914241L, Const.toLong( "1447252914241", -12 ) ); assertEquals( -1447252914241L, Const.toLong( "1447252914241L", -1447252914241L ) ); }
public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; }
Const { public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } 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 long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } 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 testToDouble() { Assert.assertEquals( 123.45, Const.toDouble( "123.45", -12.34 ), 1e-15 ); Assert.assertEquals( -12.34, Const.toDouble( "123asd", -12.34 ), 1e-15 ); }
public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; }
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigD...
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigD...
@Test public void testRightPad() { final String s = "Pad me baby one more time"; assertEquals( " ", Const.rightPad( (String) null, 5 ) ); assertEquals( "Pad", Const.rightPad( s, 3 ) ); final StringBuffer sb = new StringBuffer( s ); assertEquals( s + " ", Const.rightPad( sb, 28 ) ); assertEquals( "Pad me baby", Const.ri...
public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } }
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } }
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } }
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDec...
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDec...
@Test public void transConfigItemsNoNameSpecified() throws Exception { TransMeta meta = new TransMeta(); Transformation trans = TransMetaConverter.convert( meta ); assertThat( trans.getConfig().get( TransMetaConverter.TRANS_META_NAME_CONF_KEY ), is( TransMetaConverter.TRANS_DEFAULT_NAME ) ); assertThat( (String) trans....
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 testReplace() { final String source = "A journey of a thousand miles never begins"; assertEquals( "A journey of a thousand miles begins with a single step", Const.replace( source, "never begins", "begins with a single step" ) ); assertEquals( source, Const.replace( source, "evil", "good" ) ); assertEq...
public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } }
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } }
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } }
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } static double round( double f, int places ); static double round( doub...
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } static double round( double f, int places ); static double round( doub...
@Test public void testRepl() { String source = "A journey of a thousand miles never begins"; StringBuffer sb = new StringBuffer( source ); Const.repl( sb, "never begins", "begins with a single step" ); assertEquals( "A journey of a thousand miles begins with a single step", sb.toString() ); sb = new StringBuffer( sourc...
public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pattern.quo...
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pat...
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pat...
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pat...
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pat...
@Test public void testGetOS() { final String key = "os.name"; final String os = System.getProperty( key ); System.setProperty( key, "BeOS" ); assertEquals( "BeOS", Const.getOS() ); System.setProperty( key, os ); }
public static String getOS() { return System.getProperty( "os.name" ); }
Const { public static String getOS() { return System.getProperty( "os.name" ); } }
Const { public static String getOS() { return System.getProperty( "os.name" ); } }
Const { public static String getOS() { return System.getProperty( "os.name" ); } 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 roundingMode ); ...
Const { public static String getOS() { return System.getProperty( "os.name" ); } 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 roundingMode ); ...
@Test public void testQuoteCharByOS() { assertEquals( SystemUtils.IS_OS_WINDOWS ? "\"" : "'", Const.getQuoteCharByOS() ); }
public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } }
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } }
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } }
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } 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 ...
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } 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 ...
@Test public void testIsWindows() { assertEquals( SystemUtils.IS_OS_WINDOWS, Const.isWindows() ); }
public static boolean isWindows() { return getOS().startsWith( "Windows" ); }
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } }
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } }
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } 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 roundingMod...
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } 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 roundingMod...
@Test public void testIsLinux() { assertEquals( SystemUtils.IS_OS_LINUX, Const.isLinux() ); }
public static boolean isLinux() { return getOS().startsWith( "Linux" ); }
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } }
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } }
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } 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 roundingMode );...
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } 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 roundingMode );...
@Test public void testIsOSX() { assertEquals( SystemUtils.IS_OS_MAC_OSX, Const.isOSX() ); }
public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); }
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } }
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } }
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } 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 roundi...
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } 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 roundi...
@Test public void testIsKDE() { final String kdeVersion = System.getProperty( "KDE_SESSION_VERSION" ); assertEquals( kdeVersion != null && !kdeVersion.isEmpty(), Const.isKDE() ); }
public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); }
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } }
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } }
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } 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...
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } 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...
@Test public void testGetHostName() { assertFalse( Const.getHostname().isEmpty() ); }
public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { Enumerat...
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { ...
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { ...
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { ...
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { ...
@Test public void testGetHostnameReal() { doWithModifiedSystemProperty( "KETTLE_SYSTEM_HOSTNAME", "MyHost", new Runnable() { @Override public void run() { assertEquals( "MyHost", Const.getHostnameReal() ); } } ); }
public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostname != n...
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostn...
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostn...
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostn...
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostn...
@Test public void testDisabledHops() { TransMeta trans = new TransMeta(); StepMeta start = new StepMeta( "Start", stepMetaInterface ); trans.addStep( start ); StepMeta withEnabledHop = new StepMeta( "WithEnabledHop", stepMetaInterface ); trans.addStep( withEnabledHop ); StepMeta withDisabledHop = new StepMeta( "WithDis...
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 testReplEnv() { assertNull( Const.replEnv( (String) null ) ); System.setProperty( "testProp", "testValue" ); assertEquals( "Value for testProp property is testValue.", Const.replEnv( "Value for testProp property is %%testProp%%." ) ); assertEquals( "Value for testProp property is testValue.", Const.re...
@Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var = str.s...
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var...
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var...
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var...
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var...
@Test public void testNullToEmpty() { assertEquals( "", Const.nullToEmpty( null ) ); assertEquals( "value", Const.nullToEmpty( "value" ) ); }
public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; }
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; } }
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; } }
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } 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 ); static long round( long f,...
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } 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 ); static long round( long f,...
@Test public void testIndexOfString() { assertEquals( -1, Const.indexOfString( null, (String[]) null ) ); assertEquals( -1, Const.indexOfString( null, new String[] {} ) ); assertEquals( 1, Const.indexOfString( "bar", new String[] { "foo", "bar" } ) ); assertEquals( -1, Const.indexOfString( "baz", new String[] { "foo", ...
public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; }
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } }
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } }
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } static double round( double f, int places ); static doub...
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } static double round( double f, int places ); static doub...
@Test public void testIndexsOfStrings() { Assert.assertArrayEquals( new int[] { 2, 1, -1 }, Const.indexsOfStrings( new String[] { "foo", "bar", "qux" }, new String[] { "baz", "bar", "foo" } ) ); }
public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; }
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } }
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } }
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } static double round( double f, int places ); static double round( double f, int place...
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } static double round( double f, int places ); static double round( double f, int place...
@Test public void testIndexsOfFoundStrings() { Assert.assertArrayEquals( new int[] { 2, 1 }, Const.indexsOfFoundStrings( new String[] { "qux", "foo", "bar" }, new String[] { "baz", "bar", "foo" } ) ); }
public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesList.size(...
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesLi...
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesLi...
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesLi...
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesLi...
@Test public void testGetDistinctStrings() { assertNull( Const.getDistinctStrings( null ) ); assertTrue( Const.getDistinctStrings( new String[] {} ).length == 0 ); Assert.assertArrayEquals( new String[] { "bar", "foo" }, Const.getDistinctStrings( new String[] { "foo", "bar", "foo", "bar" } ) ); }
public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if ( !sorted...
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if (...
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if (...
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if (...
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if (...
@Test public void testStackTracker() { assertTrue( Const.getStackTracker( new Exception() ).contains( getClass().getName() + ".testStackTracker(" + getClass().getSimpleName() + ".java:" ) ); }
public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); }
Const { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } }
Const { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } }
Const { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } 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 { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } 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 testGetCustomStackTrace() { assertTrue( Const.getCustomStackTrace( new Exception() ).contains( getClass().getName() + ".testGetCustomStackTrace(" + getClass().getSimpleName() + ".java:" ) ); }
public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStackTrace()...
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStac...
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStac...
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStac...
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStac...
@Test public void testCreateNewClassLoader() throws KettleException { ClassLoader cl = Const.createNewClassLoader(); assertTrue( cl instanceof URLClassLoader && ( (URLClassLoader) cl ).getURLs().length == 0 ); }
public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } }
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } }
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } }
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } static double round( double f, in...
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } static double round( double f, in...
@Test public void testCreateByteArray() { assertTrue( Const.createByteArray( 5 ).length == 5 ); }
public static byte[] createByteArray( int size ) { return new byte[size]; }
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } }
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } }
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } 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 roundingMode ...
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } 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 roundingMode ...
@Test public void testRemovingDisabledInputSteps() { TransMeta trans = new TransMeta(); StepMeta inputToBeRemoved = new StepMeta( "InputToBeRemoved", stepMetaInterface ); trans.addStep( inputToBeRemoved ); StepMeta inputToStay = new StepMeta( "InputToStay", stepMetaInterface ); trans.addStep( inputToStay ); StepMeta in...
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 testCreateFilename() { assertEquals( "dir" + Const.FILE_SEPARATOR + "file__1.ext", Const.createFilename( "dir" + Const.FILE_SEPARATOR, "File\t~ 1", ".ext" ) ); assertEquals( "dir" + Const.FILE_SEPARATOR + "file__1.ext", Const.createFilename( "dir", "File\t~ 1", ".ext" ) ); }
public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } return f...
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } ...
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } ...
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } ...
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } ...
@Test public void testCreateName() { assertNull( Const.createName( null ) ); assertEquals( "test - trans", Const.createName( "transformations" + Const.FILE_SEPARATOR + "test\t~- trans.ktr" ) ); }
public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pureFilename...
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pure...
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pure...
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pure...
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pure...
@Test public void testFilenameOnly() { assertNull( Const.filenameOnly( null ) ); assertTrue( Const.filenameOnly( "" ).isEmpty() ); assertEquals( "file.txt", Const.filenameOnly( "dir" + Const.FILE_SEPARATOR + "file.txt" ) ); assertEquals( "file.txt", Const.filenameOnly( "file.txt" ) ); }
public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring( idx + 1...
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring(...
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring(...
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring(...
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring(...
@Test public void testGetDateFormats() { final String[] formats = Const.getDateFormats(); assertTrue( formats.length > 0 ); for ( String format : formats ) { assertTrue( format != null && !format.isEmpty() ); } }
public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const.DateForm...
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const....
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const....
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const....
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const....
@Test public void testGetNumberFormats() { final String[] formats = Const.getNumberFormats(); assertTrue( formats.length > 0 ); for ( String format : formats ) { assertTrue( format != null && !format.isEmpty() ); } }
public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ ) { numbe...
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ )...
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ )...
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ )...
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ )...
@Test public void testGetConversionFormats() { final List<String> dateFormats = Arrays.asList( Const.getDateFormats() ); final List<String> numberFormats = Arrays.asList( Const.getNumberFormats() ); final List<String> conversionFormats = Arrays.asList( Const.getConversionFormats() ); assertEquals( dateFormats.size() + ...
public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x++ ) { f...
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x...
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x...
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x...
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x...
@Test public void testGetTransformationAndJobFilterNames() { List<String> filters = Arrays.asList( Const.getTransformationAndJobFilterNames() ); assertTrue( filters.size() == 5 ); for ( String filter : filters ) { assertFalse( filter.isEmpty() ); } }
public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getStri...
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages...
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages...
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages...
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages...
@Test public void testGetTransformationFilterNames() { List<String> filters = Arrays.asList( Const.getTransformationFilterNames() ); assertTrue( filters.size() == 3 ); for ( String filter : filters ) { assertFalse( filter.isEmpty() ); } }
public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) };...
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.A...
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.A...
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.A...
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.A...
@Test public void testGetJobFilterNames() { List<String> filters = Arrays.asList( Const.getJobFilterNames() ); assertTrue( filters.size() == 3 ); for ( String filter : filters ) { assertFalse( filter.isEmpty() ); } }
public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_JOB_FILTE...
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_J...
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_J...
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_J...
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_J...
@Test public void testNanoTime() { assertTrue( String.valueOf( Const.nanoTime() ).endsWith( "000" ) ); }
public static long nanoTime() { return new Date().getTime() * 1000; }
Const { public static long nanoTime() { return new Date().getTime() * 1000; } }
Const { public static long nanoTime() { return new Date().getTime() * 1000; } }
Const { public static long nanoTime() { return new Date().getTime() * 1000; } 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 roundingMode ); sta...
Const { public static long nanoTime() { return new Date().getTime() * 1000; } 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 roundingMode ); sta...
@Test public void testMultipleDisabledHops() { TransMeta trans = new TransMeta(); StepMeta input = new StepMeta( "Input", stepMetaInterface ); trans.addStep( input ); StepMeta step1 = new StepMeta( "Step1", stepMetaInterface ); trans.addStep( step1 ); StepMeta step2 = new StepMeta( "Step2", stepMetaInterface ); trans.a...
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 testTrimToType() { final String source = " trim me hard "; assertEquals( "trim me hard", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_BOTH ) ); assertEquals( "trim me hard ", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_LEFT ) ); assertEquals( " trim me hard", Const.trimToType( sou...
public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE_NONE: d...
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE...
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE...
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE...
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE...
@Test public void testSafeAppendDirectory() { final String expected = "dir" + Const.FILE_SEPARATOR + "file"; assertEquals( expected, Const.safeAppendDirectory( "dir", "file" ) ); assertEquals( expected, Const.safeAppendDirectory( "dir" + Const.FILE_SEPARATOR, "file" ) ); assertEquals( expected, Const.safeAppendDirector...
public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparator ) ) {...
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparat...
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparat...
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparat...
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparat...
@Test public void testGetEmptyPaddedStrings() { final String[] strings = Const.getEmptyPaddedStrings(); for ( int i = 0; i < 250; i++ ) { assertEquals( i, strings[i].length() ); } }
public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; }
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } }
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } }
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } static double round( doubl...
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } static double round( doubl...
@Test public void testGetPercentageFreeMemory() { assertTrue( Const.getPercentageFreeMemory() > 0 ); }
public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 * (doubl...
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 ...
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 ...
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 ...
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 ...
@Test public void testRemoveDigits() { assertNull( Const.removeDigits( null ) ); assertEquals( "foobar", Const.removeDigits( "123foo456bar789" ) ); }
public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); }
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
@Test public void testGetDigitsOnly() { assertNull( Const.removeDigits( null ) ); assertEquals( "123456789", Const.getDigitsOnly( "123foo456bar789" ) ); }
public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); }
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString()...
@Test public void testRemoveTimeFromDate() { final Date date = Const.removeTimeFromDate( new Date() ); assertEquals( 0, date.getHours() ); assertEquals( 0, date.getMinutes() ); assertEquals( 0, date.getSeconds() ); }
public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calendar.set( ...
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calend...
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calend...
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calend...
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calend...
@Test public void testEscapeSQL() { assertEquals( "SELECT ''Let''s rock!'' FROM dual", Const.escapeSQL( "SELECT 'Let's rock!' FROM dual" ) ); }
public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); }
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } }
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } }
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, ...
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, ...
@Test public void testRemoveCRLF() { assertEquals( "foo\tbar", Const.removeCRLF( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeCRLF( "" ) ); assertEquals( "", Const.removeCRLF( null ) ); assertEquals( "", Const.removeCRLF( "\r\n" ) ); assertEquals( "This is a test of the emergency broadcast system", Const.removeCRL...
public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( tmp, 0, ...
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( ...
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( ...
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( ...
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( ...
@Test public void testRemoveCR() { assertEquals( "foo\r\tbar", Const.removeCR( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeCR( "" ) ); assertEquals( "", Const.removeCR( null ) ); assertEquals( "", Const.removeCR( "\n" ) ); assertEquals( "\r", Const.removeCR( "\n\r\n" ) ); assertEquals( "This \ris \ra test \rof \r...
public static String removeCR( String in ) { return removeChar( in, '\n' ); }
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } }
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } }
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } 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 roundingMod...
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } 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 roundingMod...
@Test public void errorHops() throws Exception { 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 ...
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 testRemoveLF() { assertEquals( "foo\n\tbar", Const.removeLF( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeLF( "" ) ); assertEquals( "", Const.removeLF( null ) ); assertEquals( "", Const.removeLF( "\r" ) ); assertEquals( "\n", Const.removeLF( "\r\n\r" ) ); assertEquals( "This \nis a \ntest of \nth...
public static String removeLF( String in ) { return removeChar( in, '\r' ); }
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } }
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } }
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } 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 roundingMod...
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } 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 roundingMod...
@Test public void testRemoveTAB() { assertEquals( "foo\r\nbar", Const.removeTAB( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeTAB( "" ) ); assertEquals( "", Const.removeTAB( null ) ); assertEquals( "", Const.removeTAB( "\t" ) ); assertEquals( "\r", Const.removeTAB( "\t\r\t" ) ); assertEquals( "Thisisatest", Const....
public static String removeTAB( String in ) { return removeChar( in, '\t' ); }
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } }
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } }
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } 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 roundingMo...
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } 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 roundingMo...
@Test public void testAddTimeToDate() throws Exception { final Date date = new Date( 1447252914241L ); assertNull( Const.addTimeToDate( null, null, null ) ); assertEquals( date, Const.addTimeToDate( date, null, null ) ); assertEquals( 1447256637241L, Const.addTimeToDate( date, "01:02:03", "HH:mm:ss" ).getTime() ); }
public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.getTime() +...
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.get...
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.get...
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.get...
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.get...
@Test public void testGetOccurenceString() { assertEquals( 0, Const.getOccurenceString( "", "" ) ); assertEquals( 0, Const.getOccurenceString( "foo bar bazfoo", "cat" ) ); assertEquals( 2, Const.getOccurenceString( "foo bar bazfoo", "foo" ) ); }
public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, start + len...
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, sta...
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, sta...
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, sta...
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, sta...
@Test public void testGetAvailableFontNames() { assertTrue( Const.GetAvailableFontNames().length > 0 ); }
public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; }
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } }
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } }
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } stati...
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } stati...
@Test public void testGetKettlePropertiesFileHeader() { assertFalse( Const.getKettlePropertiesFileHeader().isEmpty() ); }
public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) + CR ); ...
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) ...
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) ...
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) ...
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) ...
@Test public void testProtectXMLCDATA() { assertEquals( null, Const.protectXMLCDATA( null ) ); assertEquals( "", Const.protectXMLCDATA( "" ) ); assertEquals( "<![CDATA[foo]]>", Const.protectXMLCDATA( "foo" ) ); }
public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; }
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } }
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } }
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int...
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int...
@Test public void testGetOcuranceString() { assertEquals( 0, Const.getOcuranceString( "", "" ) ); assertEquals( 0, Const.getOcuranceString( "foo bar bazfoo", "cat" ) ); assertEquals( 2, Const.getOcuranceString( "foo bar bazfoo", "foo" ) ); }
public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; }
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } }
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } }
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } static double round( double f, int place...
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } static double round( double f, int place...
@Test public void testEscapeXml() { final String xml = "<xml xmlns:test=\"http: final String escaped = "&lt;xml xmlns:test=&quot;http: assertNull( Const.escapeXml( null ) ); assertEquals( escaped, Const.escapeXml( xml ) ); }
public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); }
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } }
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } }
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, ...
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, ...
@Test public void testLpad() { final String s = "pad me"; assertEquals( s, Const.Lpad( s, "-", 0 ) ); assertEquals( s, Const.Lpad( s, "-", 3 ) ); assertEquals( "--" + s, Const.Lpad( s, "-", 8 ) ); assertEquals( s, Const.Lpad( s, null, 15 ) ); assertEquals( s, Const.Lpad( s, "", 15 ) ); assertEquals( s, Const.Lpad( s, "...
public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize )...
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
@Test public void lazyConversionTurnedOff() throws KettleException { KettleEnvironment.init(); TransMeta transMeta = new TransMeta(); CsvInputMeta csvInputMeta = new CsvInputMeta(); csvInputMeta.setLazyConversionActive( true ); StepMeta csvInput = new StepMeta( "Csv", csvInputMeta ); transMeta.addStep( csvInput ); Tabl...
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 testRpad() { final String s = "pad me"; assertEquals( s, Const.Rpad( s, "-", 0 ) ); assertEquals( s, Const.Rpad( s, "-", 3 ) ); assertEquals( s + "--", Const.Rpad( s, "-", 8 ) ); assertEquals( s, Const.Rpad( s, null, 15 ) ); assertEquals( s, Const.Rpad( s, "", 15 ) ); assertEquals( s, Const.Rpad( s, "...
public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize )...
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size -...
@Test public void testClassIsOrExtends() { assertFalse( Const.classIsOrExtends( Object.class, Object.class ) ); assertTrue( Const.classIsOrExtends( String.class, String.class ) ); assertTrue( Const.classIsOrExtends( ArrayList.class, ArrayList.class ) ); }
public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); }
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } }
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } }
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } static double round( double f, int places ); static double round( double f, int pla...
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } static double round( double f, int places ); static double round( double f, int pla...
@Test public void testReleaseType() { for ( Const.ReleaseType type : Const.ReleaseType.values() ) { assertFalse( type.getMessage().isEmpty() ); } }
@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 test1() throws Exception { String inXml, expectedXml; try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterIn1.xml" ) ) { inXml = IOUtils.toString( in ); } try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterExpected1.xml" ) ) { expectedXml = IOUt...
public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; String...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
@Test public void testcdata() throws Exception { String input = " <annotations>" + " <annotation>" + " <name>c44cc4ed-9647-44f2-b1d9-0523c01f0c94</name>\n" + " <field>HiddenField</field>\n" + " <type>CREATE_ATTRIBUTE</type>\n" + " <properties>" + " <property>" + " <name>hidden</name>\n" + " <value><![CDATA[true]]></val...
public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; String...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
@Test public void test2() throws Exception { String inXml, expectedXml; try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterIn2.xml" ) ) { inXml = IOUtils.toString( in ); } try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterExpected2.xml" ) ) { expectedXml = IOUt...
public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; String...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer...
@Test( expected = KettleException.class ) public void exceptionIsThrownWhenParsingXmlWithBigAmountOfExternalEntities() throws KettleException { final String maliciousXml = "<?xml version=\"1.0\"?>\n" + "<!DOCTYPE lolz [\n" + " <!ENTITY lol \"lol\">\n" + " <!ELEMENT lolz (#PCDATA)>\n" + " <!ENTITY lol1 \"&lol;&lol;&lol;...
public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, handler ); ...
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, ...
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, ...
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, ...
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, ...
@Test public void testStartsWithScheme() { String fileName = "zip:file: assertTrue( KettleVFS.startsWithScheme( fileName ) ); fileName = "SavedLinkedres.zip!Calculate median and percentiles using the group by steps.ktr"; assertFalse( KettleVFS.startsWithScheme( fileName ) ); }
public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; break; } } r...
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; ...
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; ...
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; ...
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; ...
@Test public void testPutRow() throws Exception { rowSet.putRow( new RowMeta(), row ); assertSame( row, rowSet.getRow() ); }
@Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long ti...
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long ti...
@Test public void testPutRowWait() throws Exception { rowSet.putRowWait( new RowMeta(), row, 1, TimeUnit.SECONDS ); assertSame( row, rowSet.getRowWait( 1, TimeUnit.SECONDS ) ); }
@Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( l...
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( l...
@Test public void testIncludesSubTransformations() throws Exception { TransMeta parentTransMeta = new TransMeta( getClass().getResource( "trans-meta-converter-parent.ktr" ).getPath() ); Transformation transformation = TransMetaConverter.convert( parentTransMeta ); @SuppressWarnings( { "unchecked", "ConstantConditions" ...
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 testGetRowImmediate() throws Exception { rowSet.putRow( new RowMeta(), row ); assertSame( row, rowSet.getRowImmediate() ); }
@Override public Object[] getRowImmediate() { return getRow(); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, ...
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, ...
@Test public void testSize() throws Exception { assertEquals( 0, rowSet.size() ); rowSet.putRow( new RowMeta(), row ); assertEquals( 1, rowSet.size() ); rowSet.clear(); assertEquals( 0, rowSet.size() ); }
@Override public int size() { return row == null ? 0 : 1; }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Objec...
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Objec...
@Test public void testGetRegexpByDateFormat() { assertNull( DateDetector.getRegexpByDateFormat( null ) ); assertEquals( SAMPLE_REGEXP, DateDetector.getRegexpByDateFormat( SAMPLE_DATE_FORMAT ) ); }
public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRe...
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRe...
@Test public void testGetRegexpByDateFormatLocale() { assertNull( DateDetector.getRegexpByDateFormat( null, null ) ); assertNull( DateDetector.getRegexpByDateFormat( null, LOCALE_en_US ) ); assertNull( DateDetector.getRegexpByDateFormat( SAMPLE_DATE_FORMAT_US ) ); assertEquals( SAMPLE_REGEXP_US, DateDetector.getRegexpB...
public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRe...
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRe...
@Test public void testGetDateFormatByRegex() { assertNull( DateDetector.getDateFormatByRegex( null ) ); assertEquals( SAMPLE_DATE_FORMAT, DateDetector.getDateFormatByRegex( SAMPLE_REGEXP ) ); }
public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String ...
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String ...
@Test public void testGetDateFormatByRegexLocale() { assertNull( DateDetector.getDateFormatByRegex( null, null ) ); assertNull( DateDetector.getDateFormatByRegex( null, LOCALE_en_US ) ); assertEquals( SAMPLE_DATE_FORMAT, DateDetector.getDateFormatByRegex( SAMPLE_REGEXP_US ) ); assertEquals( SAMPLE_DATE_FORMAT_US, DateD...
public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String ...
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String ...
@Test public void testGetDateFromString() throws ParseException { assertEquals( SAMPLE_DATE_US, DateDetector.getDateFromString( SAMPLE_DATE_STRING_US ) ); try { DateDetector.getDateFromString( null ); } catch ( ParseException e ) { } }
public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector();...
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector();...
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector();...
@Test public void testGetDateFromStringLocale() throws ParseException { assertEquals( SAMPLE_DATE_US, DateDetector.getDateFromString( SAMPLE_DATE_STRING_US, LOCALE_en_US ) ); try { DateDetector.getDateFromString( null ); } catch ( ParseException e ) { } try { DateDetector.getDateFromString( null, null ); } catch ( Pars...
public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector();...
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector();...
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector();...
@Test public void testGetDateFromStringByFormat() throws ParseException { assertEquals( SAMPLE_DATE, DateDetector.getDateFromStringByFormat( SAMPLE_DATE_STRING, SAMPLE_DATE_FORMAT ) ); try { DateDetector.getDateFromStringByFormat( SAMPLE_DATE_STRING, null ); } catch ( ParseException e ) { } try { DateDetector.getDateFr...
public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is null. ", 0 ); } Si...
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is nul...
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is nul...
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is nul...
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is nul...
@Test public void testDetectDateFormat() { assertEquals( SAMPLE_DATE_FORMAT, DateDetector.detectDateFormat( SAMPLE_DATE_STRING, LOCALE_es ) ); assertNull( DateDetector.detectDateFormat( null ) ); }
public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); }
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } }
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } private DateDetector(); }
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( Strin...
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( Strin...
@Test public void testClonesTransMeta() throws KettleException { class ResultCaptor implements Answer<Object> { private Object result; public Object getResult() { return result; } @Override public java.lang.Object answer( InvocationOnMock invocationOnMock ) throws Throwable { result = invocationOnMock.callRealMethod();...
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 testIsValidDate() { assertTrue( DateDetector.isValidDate( SAMPLE_DATE_STRING_US ) ); assertFalse( DateDetector.isValidDate( null ) ); assertTrue( DateDetector.isValidDate( SAMPLE_DATE_STRING, SAMPLE_DATE_FORMAT ) ); assertFalse( DateDetector.isValidDate( SAMPLE_DATE_STRING, null ) ); }
public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } }
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } }
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } private DateDetector(); }
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpBy...
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpBy...
@Test public void testIsValidDateFormatToStringDate() { assertTrue( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE_FORMAT_US, SAMPLE_DATE_STRING_US ) ); assertFalse( DateDetector.isValidDateFormatToStringDate( null, SAMPLE_DATE_STRING_US ) ); assertFalse( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE...
public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String ge...
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String ge...
@Test public void testIsValidDateFormatToStringDateLocale() { assertTrue( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE_FORMAT_US, SAMPLE_DATE_STRING_US, LOCALE_en_US ) ); assertFalse( DateDetector.isValidDateFormatToStringDate( null, SAMPLE_DATE_STRING, LOCALE_en_US ) ); assertFalse( DateDetector.isValidDate...
public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String ge...
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String ge...
@Test public void testGetCount() { List<String> strings = Arrays.asList( "02/29/2000", "03/29/2000" ); for ( String string : strings ) { evaluator.evaluateString( string ); } assertEquals( strings.size(), evaluator.getCount() ); }
public int getCount() { return count; }
StringEvaluator { public int getCount() { return count; } }
StringEvaluator { public int getCount() { return count; } StringEvaluator(); StringEvaluator( boolean tryTrimming ); StringEvaluator( boolean tryTrimming, List<String> numberFormats, List<String> dateFormats ); StringEvaluator( boolean tryTrimming, String[] numberFormats, String[] dateFormats ); }
StringEvaluator { public int getCount() { return count; } StringEvaluator(); StringEvaluator( boolean tryTrimming ); StringEvaluator( boolean tryTrimming, List<String> numberFormats, List<String> dateFormats ); StringEvaluator( boolean tryTrimming, String[] numberFormats, String[] dateFormats ); void evaluateString(...
StringEvaluator { public int getCount() { return count; } StringEvaluator(); StringEvaluator( boolean tryTrimming ); StringEvaluator( boolean tryTrimming, List<String> numberFormats, List<String> dateFormats ); StringEvaluator( boolean tryTrimming, String[] numberFormats, String[] dateFormats ); void evaluateString(...
@Test public void vfsUserDirIsRoot_IsPublishedOnInitialisation() throws Exception { EnvUtil.environmentInit(); assertNotNull( Variables.getADefaultVariableSpace().getVariable( Const.VFS_USER_DIR_IS_ROOT ) ); assertNotNull( System.getProperty( Const.VFS_USER_DIR_IS_ROOT ) ); }
public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDefaultValue...
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDe...
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDe...
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDe...
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDe...
@Test public void createLocale_Null() throws Exception { assertNull( EnvUtil.createLocale( null ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new ...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
@Test public void createLocale_Empty() throws Exception { assertNull( EnvUtil.createLocale( "" ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new ...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
@Test public void createLocale_SingleCode() throws Exception { assertEquals( Locale.ENGLISH, EnvUtil.createLocale( "en" ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new ...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
@Test public void createLocale_DoubleCode() throws Exception { assertEquals( Locale.US, EnvUtil.createLocale( "en_US" ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new ...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLoc...
@Test public void testIsEmpty() { assertTrue( Utils.isEmpty( (String) null ) ); assertTrue( Utils.isEmpty( "" ) ); assertFalse( Utils.isEmpty( "test" ) ); }
public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; }
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } }
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } }
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } static int getDamerauLevenshteinDistance( String s, String t ); static boolean isEmpty( CharSequence val ); static boolean isEmpty( CharSequence[] strings ); static boolean isEmpty( Object[] array ); static boolean i...
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } static int getDamerauLevenshteinDistance( String s, String t ); static boolean isEmpty( CharSequence val ); static boolean isEmpty( CharSequence[] strings ); static boolean isEmpty( Object[] array ); static boolean i...
@Test public void testReplaceHadoopClusterToFileSystemURL() throws KettleException, MetaStoreException { TransMeta origTransMeta = new TransMeta(); Variables variables = new Variables(); String inputUrl = "hc: String outputUrl = "hc: TransMeta transMeta = spy( origTransMeta ); IMetaStore metaStore = mock( IMetaStore.cl...
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( expected = RuntimeException.class ) public void testGetOptionHelpNoDatabase() throws Exception { when( accessBox.getSelectedItem() ).thenReturn( "JNDI" ); when( connectionBox.getSelectedItem() ).thenReturn( "MyDB" ); dataHandler.getOptionHelp(); }
public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO_HELP_AVAILABLE" ); showMessage( message, fals...
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO...
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO...
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO...
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO...
@Test public void cacheSmallBlock() { SmallBlock smallBlock = new SmallBlock(); BlockHeader header = new BlockHeader(); NulsDigestData hash = NulsDigestData.calcDigestData("abcdefg".getBytes()); header.setHash(hash); manager.cacheSmallBlock(smallBlock); assertTrue(true); this.getSmallBlock(hash, smallBlock); this.remov...
public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); }
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } }
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } private TemporaryCacheManager(); }
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } private TemporaryCacheManager(); static TemporaryCacheManager getInstance(); void cacheSmallBlock(SmallBlock smallBlock); void cacheSmallBlockWithRequest(NulsDigestData r...
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } private TemporaryCacheManager(); static TemporaryCacheManager getInstance(); void cacheSmallBlock(SmallBlock smallBlock); void cacheSmallBlockWithRequest(NulsDigestData r...
@Test public void testGetRoundByIndex() { assertNotNull(roundManager); assertNotNull(roundManager.getChain()); long index = 1002L; assertEquals(0, roundManager.getRoundList().size()); MeetingRound round = new MeetingRound(); round.setIndex(index); roundManager.addRound(round); assertEquals(1, roundManager.getRoundList(...
public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; }
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } }
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } RoundManager(Chain chain); }
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void add...
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void add...
@Test public void testClearRound() { MeetingRound round = new MeetingRound(); round.setIndex(1l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(2l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(3l); roundManager.addRound(round); round = new MeetingRound(); round.se...
public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } }
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } }
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } Roun...
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } Roun...
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } Roun...
@Test public void testInitRound() { assertNotNull(roundManager); assertNotNull(roundManager.getChain()); Chain chain = roundManager.getChain(); assertNotNull(chain.getEndBlockHeader()); assert(chain.getAllBlockList().size() > 0); MeetingRound round = roundManager.initRound(); assertNotNull(round); assertEquals(round.ge...
public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeader = blockHeader...
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeade...
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeade...
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeade...
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeade...
@Test public void testGetSmallBlock() { Block block = createBlock(); SmallBlock smallBlock = ConsensusTool.getSmallBlock(block); assertNotNull(smallBlock); assertEquals(smallBlock.getHeader(), block.getHeader()); assertEquals(smallBlock.getSubTxList().size() , 0); assertEquals(smallBlock.getTxHashList().get(0), block.g...
public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(tx); } } smallBl...
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(...
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(...
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(...
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(...