/** * @param bool * boolean to test. * @throws IllegalArgumentException * if bool is true. */ public static void assertFalse( final boolean bool ) throws IllegalArgumentException { assertFalse( bool, "Value cannot be true" ); }
@Test public void testMatchesExcludePattern() throws Exception { Mockito.when( fileNameMock.getBaseName() ).thenReturn( EXCLUDE_PATTERN_FILE_NAME ); boolean includeFile = fileSelector.includeFile( fileSelectInfoMock ); Assert.assertFalse( includeFile ); }
@Test public void testDifferentFileType() throws Exception { Mockito.when( fileObjectMock.getType() ).thenReturn( FileType.IMAGINARY ); boolean includeFile = fileSelector.includeFile( fileSelectInfoMock ); Assert.assertFalse( includeFile ); } }
@Test public void testMatchesPatternAndExcludePattern() throws Exception { fileSelector = new JobEntryZipFile.ZipJobEntryPatternFileSelector( Pattern.compile( PATTERN ), Pattern.compile( PATTERN ) ); boolean includeFile = fileSelector.includeFile( fileSelectInfoMock ); Assert.assertFalse( includeFile ); }
@Test public void testTransformationHasHandlerFalseTrans() throws KettleException { addHandlers( transformationMessageEvent, messageEventHandler, messageEventHandler2 ); assertFalse( messageEventService.hasHandlers( otherTransMessageEvent ) ); }
@Test public void testOperationHasHandlerFalseTrans() throws KettleException { addHandlers( operationMessageEvent, messageEventHandler, messageEventHandler2 ); assertFalse( messageEventService.hasHandlers( otherTransMessageEvent ) ); }
@Test public void testExcludePatternNull() throws Exception { fileSelector = new JobEntryZipFile.ZipJobEntryPatternFileSelector( Pattern.compile( PATTERN ), null ); boolean includeFile = fileSelector.includeFile( fileSelectInfoMock ); Assert.assertTrue( includeFile ); Mockito.when( fileNameMock.getBaseName() ).thenReturn( EXCLUDE_PATTERN_FILE_NAME ); includeFile = fileSelector.includeFile( fileSelectInfoMock ); Assert.assertFalse( includeFile ); }
@Test public void testPatternNull() throws Exception { fileSelector = new JobEntryZipFile.ZipJobEntryPatternFileSelector( null, Pattern.compile( EXCLUDE_PATTERN ) ); boolean includeFile = fileSelector.includeFile( fileSelectInfoMock ); Assert.assertTrue( includeFile ); Mockito.when( fileNameMock.getBaseName() ).thenReturn( EXCLUDE_PATTERN_FILE_NAME ); includeFile = fileSelector.includeFile( fileSelectInfoMock ); Assert.assertFalse( includeFile ); }
@Test public void testTransformationHasHandlerFalseOp() throws KettleException { addHandlers( transformationMessageEvent, messageEventHandler, messageEventHandler2 ); assertFalse( messageEventService.hasHandlers( otherOpMessageEvent ) ); }
@Test public void testOperationHasHandlerFalseOp() throws KettleException { addHandlers( operationMessageEvent, messageEventHandler, messageEventHandler2 ); assertFalse( messageEventService.hasHandlers( otherOpMessageEvent ) ); }
@Test public void testLoadsDrivers() throws Exception { LoadDriversListener listener = new LoadDriversListener(); listener.startup( null ); Enumeration<Driver> drivers = DriverManager.getDrivers(); while ( drivers.hasMoreElements() ) { Driver driver = drivers.nextElement(); if ( "org.pentaho.commons.system.LoadDriversListenerTest$FakeDriver".equals( driver.getClass().getName() ) ) { return; } } Assert.assertFalse( true, "didn't find FakeDriver" ); }
@Test public void testIsWriteable() { Assert.assertFalse( beanUtil.isWriteable( "[~!@#$%^&*(){}|.,]-=_+|;'\"?<>~`:" ) ); }
@Test public void testPromptNow() throws Exception { runtimeCtx.setPromptStatus( IRuntimeContext.PROMPT_NO ); Assert.assertFalse( runtimeCtx.isPromptPending() ); runtimeCtx.promptNow(); Assert.assertTrue( runtimeCtx.isPromptPending() ); }
@Test public void testPromptNeeded() throws Exception { runtimeCtx.setPromptStatus( IRuntimeContext.PROMPT_NO ); Assert.assertFalse( runtimeCtx.isPromptPending() ); runtimeCtx.promptNeeded(); Assert.assertTrue( runtimeCtx.isPromptPending() ); }