/** * Initialize the central log store with optional limitation to the size * * @param maxSize the maximum size * @param maxLogTimeoutHours The maximum time that a log line times out in hours. */ public static void init( int maxSize, int maxLogTimeoutMinutes ) { KettleLogStore.init( maxSize, maxLogTimeoutMinutes ); }
/** * Initialize the central log store with optional limitation to the size and redirect of stdout and stderr * * @param maxSize * the maximum size * @param maxLogTimeoutMinutes * the maximum time that a log line times out in hours * @param redirectStdOut * a boolean indicating whether to redirect stdout to the logging framework * @param redirectStdErr * a boolean indicating whether to redirect stderr to the logging framework */ public static void init( int maxSize, int maxLogTimeoutMinutes, boolean redirectStdOut, boolean redirectStdErr ) { if ( maxSize > 0 || maxLogTimeoutMinutes > 0 ) { init0( maxSize, maxLogTimeoutMinutes, redirectStdOut, redirectStdErr ); } else { init( redirectStdOut, redirectStdErr ); } }
/** * Create the central log store with optional limitation to the size * * @param maxSize the maximum size * @param maxLogTimeoutMinutes The maximum time that a log line times out in Minutes. */ private CentralLogStore( int maxSize, int maxLogTimeoutMinutes ) { KettleLogStore.init( maxSize, maxLogTimeoutMinutes ); }
public static void init() { KettleLogStore.init(); }
public static void init() { init( EnvUtil.getSystemProperty( Const.KETTLE_REDIRECT_STDOUT, "N" ).equalsIgnoreCase( "Y" ), EnvUtil .getSystemProperty( Const.KETTLE_REDIRECT_STDERR, "N" ).equalsIgnoreCase( "Y" ) ); }
/** * Initialize the central log store with optional limitation to the size * * @param maxSize * the maximum size * @param maxLogTimeoutMinutes * The maximum time that a log line times out in hours. */ public static void init( int maxSize, int maxLogTimeoutMinutes ) { init( maxSize, maxLogTimeoutMinutes, EnvUtil .getSystemProperty( Const.KETTLE_REDIRECT_STDOUT, "N" ).equalsIgnoreCase( "Y" ), EnvUtil .getSystemProperty( Const.KETTLE_REDIRECT_STDERR, "N" ).equalsIgnoreCase( "Y" ) ); }
@BeforeClass public static void setUpBeforeClass() throws Exception { KettleLogStore.init(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { KettleLogStore.init(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { KettleLogStore.init(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { KettleLogStore.init(); }
@Before public void before() { KettleLogStore.init(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { KettleLogStore.init(); }
@Before public void setUp() throws Exception { KettleLogStore.init(); KettleDatabaseRepositoryConnectionDelegate delegate = mock( KettleDatabaseRepositoryConnectionDelegate.class ); repository = mock( KettleDatabaseRepository.class ); repository.connectionDelegate = delegate; helper = new KettleDatabaseRepositoryCreationHelper( repository ); when( repository.getLog() ).thenReturn( log ); }
protected void setup( T meta ) { KettleLogStore.init(); this.meta = meta; info = new BeanInjectionInfo( meta.getClass() ); injector = new BeanInjector( info ); nonTestedProperties = new HashSet<>( info.getProperties().keySet() ); }
@Test public void testGetStatusServletEscapesHtmlWhenTransFound() throws ServletException, IOException { KettleLogStore.init(); HttpServletRequest mockHttpServletRequest = mock( HttpServletRequest.class ); HttpServletResponse mockHttpServletResponse = mock( HttpServletResponse.class ); Trans mockTrans = mock( Trans.class ); TransMeta mockTransMeta = mock( TransMeta.class ); LogChannelInterface mockChannelInterface = mock( LogChannelInterface.class ); StringWriter out = new StringWriter(); PrintWriter printWriter = new PrintWriter( out ); when( mockHttpServletRequest.getContextPath() ).thenReturn( GetStatusServlet.CONTEXT_PATH ); when( mockHttpServletRequest.getParameter( anyString() ) ).thenReturn( ServletTestUtils.BAD_STRING_TO_TEST ); when( mockHttpServletResponse.getWriter() ).thenReturn( printWriter ); when( mockTransformationMap.getTransformation( any( CarteObjectEntry.class ) ) ).thenReturn( mockTrans ); when( mockTrans.getLogChannel() ).thenReturn( mockChannelInterface ); when( mockTrans.getTransMeta() ).thenReturn( mockTransMeta ); when( mockTransMeta.getMaximum() ).thenReturn( new Point( 10, 10 ) ); getStatusServlet.doGet( mockHttpServletRequest, mockHttpServletResponse ); assertFalse( out.toString().contains( ServletTestUtils.BAD_STRING_TO_TEST ) ); } }
public static void runCarte( SlaveServerConfig config ) throws Exception { KettleLogStore.init( config.getMaxLogLines(), config.getMaxLogTimeoutMinutes() ); config.setJoining( true ); Carte carte = new Carte( config, false ); CarteSingleton.setCarte( carte ); carte.getWebServer().join(); }
@BeforeClass public static void setUpBeforeClass() throws KettlePluginException { KettleLogStore.init(); ValueMetaPluginType.getInstance().searchPlugins(); }
private void setupJobMockExecution() { setInternalState( mockedJob, "jobMeta", mockedJobMeta ); setInternalState( mockedJob, "log", mockedLogChannel ); setInternalState( mockedJob, "jobTracker", new JobTracker( mockedJobMeta ) ); setInternalState( mockedJob, "jobEntryListeners", new ArrayList<>( ) ); setInternalState( mockedJob, "jobEntryResults", new LinkedList<>( ) ); setInternalState( mockedJob, "status", new AtomicInteger( 0 ) ); when( mockedJobMeta.findJobEntry( JobMeta.STRING_SPECIAL_START, 0, false ) ).thenReturn( mockedJobEntryCopy ); when( mockedJobEntryCopy.getEntry() ).thenReturn( mockedJobEntrySpecial ); when( mockedJobEntrySpecial.getLogChannel() ).thenReturn( mockedLogChannel ); when( mockedJobEntrySpecial.clone() ).thenReturn( mockedJobEntrySpecial ); when( mockedJob.isStopped() ).thenCallRealMethod(); doCallRealMethod().when( mockedJob ).setStopped( anyBoolean() ); KettleLogStore.init(); }
@Test public void testExecute() { KettleLogStore.init(); Result previousResult = new Result(); JobEntryMailValidator validator = new JobEntryMailValidator(); Result result = validator.execute( previousResult, 0 ); assertNotNull( result ); }
/** * Configure the central log store from the provided command line options * * @param maxLogLinesOption Option for maximum log lines * @param maxLogTimeoutOption Option for log timeout * @throws KettleException Error parsing command line arguments */ public static void configureLogging( final CommandLineOption maxLogLinesOption, final CommandLineOption maxLogTimeoutOption ) throws KettleException { int maxLogLines = parseIntArgument( maxLogLinesOption, 0 ); if ( Utils.isEmpty( maxLogLinesOption.getArgument() ) ) { maxLogLines = Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_LOG_SIZE_IN_LINES ), 5000 ); } int maxLogTimeout = parseIntArgument( maxLogTimeoutOption, 0 ); if ( Utils.isEmpty( maxLogTimeoutOption.getArgument() ) ) { maxLogTimeout = Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES ), 1440 ); } KettleLogStore.init( maxLogLines, maxLogTimeout ); }