input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testMinAndMaxInRange ( ) { parameter . setMinimumValue ( ( - 1 ) , false ) ; parameter . setMaximumValue ( 1 , false ) ; parameter . configure ( org . apache . flink . api . java . utils . ParameterTool . fromArgs ( new java . lang . String [ ] { "--test" , "0" } ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( new java . lang . Double ( 0 ) , parameter . getValue ( ) )
testDeleteAllFolders ( ) { com . liferay . portal . kernel . model . Group group = com . liferay . portal . kernel . test . util . GroupTestUtil . addGroup ( ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( group . getGroupId ( ) , com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) ) ; com . liferay . portal . kernel . repository . model . Folder parentFolder = com . liferay . document . library . kernel . service . DLAppServiceUtil . addFolder ( group . getGroupId ( ) , DLFolderConstants . DEFAULT_PARENT_FOLDER_ID , "parent" , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , serviceContext ) ; com . liferay . portal . kernel . repository . model . Folder childFolder = com . liferay . document . library . kernel . service . DLAppServiceUtil . addFolder ( group . getGroupId ( ) , parentFolder . getFolderId ( ) , "child" , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , serviceContext ) ; com . liferay . document . library . kernel . service . DLTrashServiceUtil . moveFolderToTrash ( childFolder . getFolderId ( ) ) ; com . liferay . document . library . kernel . service . DLTrashServiceUtil . moveFolderToTrash ( parentFolder . getFolderId ( ) ) ; com . liferay . document . library . kernel . service . DLAppServiceUtil . deleteFolder ( parentFolder . getFolderId ( ) ) ; com . liferay . portal . kernel . service . GroupLocalServiceUtil . deleteGroup ( group ) ; int foldersCount = com . liferay . document . library . kernel . service . DLFolderLocalServiceUtil . getFoldersCount ( group . getGroupId ( ) , DLFolderConstants . DEFAULT_PARENT_FOLDER_ID ) ; "<AssertPlaceHolder>" ; } getGroupId ( ) { return _groupId ; }
org . junit . Assert . assertEquals ( 0 , foldersCount )
testSerialization ( ) { org . jfree . chart . plot . IntervalMarker m1 = new org . jfree . chart . plot . IntervalMarker ( 45.0 , 50.0 ) ; org . jfree . chart . plot . IntervalMarker m2 = ( ( org . jfree . chart . plot . IntervalMarker ) ( org . jfree . chart . TestUtils . serialised ( m1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( m1 , m2 )
testSearchCompartements ( ) { ca . uhn . fhir . jaxrs . server . example . Bundle response = ca . uhn . fhir . jaxrs . server . example . JaxRsPatientProviderDstu3Test . client . search ( ) . forResource ( ca . uhn . fhir . jaxrs . server . example . Patient . class ) . withIdAndCompartment ( "1" , "Condition" ) . returnBundle ( ca . uhn . fhir . jaxrs . server . example . Bundle . class ) . execute ( ) ; "<AssertPlaceHolder>" ; } getEntry ( ) { if ( ( this . entry ) == null ) this . entry = new org . hl7 . fhir . dstu3 . model . ArrayList < org . hl7 . fhir . dstu3 . model . Bundle . BundleEntryComponent > ( ) ; return this . entry ; }
org . junit . Assert . assertTrue ( ( ( response . getEntry ( ) . size ( ) ) > 0 ) )
getValueAsUnsignedByte ( ) { com . cloudhopper . smpp . tlv . Tlv tlv0 = new com . cloudhopper . smpp . tlv . Tlv ( ( ( short ) ( 61441 ) ) , new byte [ ] { ( ( byte ) ( 240 ) ) } ) ; "<AssertPlaceHolder>" ; com . cloudhopper . smpp . tlv . Tlv tlv1 = new com . cloudhopper . smpp . tlv . Tlv ( ( ( short ) ( 2 ) ) , new byte [ ] { 1 , 2 } ) ; try { tlv1 . getValueAsUnsignedByte ( ) ; org . junit . Assert . fail ( ) ; } catch ( com . cloudhopper . smpp . tlv . TlvConvertException e ) { } com . cloudhopper . smpp . tlv . Tlv tlv2 = new com . cloudhopper . smpp . tlv . Tlv ( ( ( short ) ( 3 ) ) , null ) ; try { tlv2 . getValueAsUnsignedByte ( ) ; org . junit . Assert . fail ( ) ; } catch ( com . cloudhopper . smpp . tlv . TlvConvertException e ) { } } getValueAsUnsignedByte ( ) { try { return com . cloudhopper . commons . util . ByteArrayUtil . toUnsignedByte ( this . value ) ; } catch ( java . lang . IllegalArgumentException e ) { throw new com . cloudhopper . smpp . tlv . TlvConvertException ( "unsigned<sp>byte" , e . getMessage ( ) ) ; } }
org . junit . Assert . assertEquals ( ( ( short ) ( 240 ) ) , tlv0 . getValueAsUnsignedByte ( ) )
testGetEndpointWithWrongVersion ( ) { java . lang . String stellar = "MAAS_GET_ENDPOINT('dga',<sp>'2.0')" ; java . lang . Object result = run ( stellar , new java . util . HashMap ( ) , org . apache . metron . maas . service . StellarMaaSIntegrationTest . context ) ; "<AssertPlaceHolder>" ; } run ( org . apache . metron . stellar . common . benchmark . Microbenchmark$StellarStatement , int , int ) { org . apache . metron . stellar . common . benchmark . Microbenchmark . run ( warmupRounds , statement , ( ts ) -> { } ) ; final org . apache . commons . math3 . stat . descriptive . DescriptiveStatistics stats = new org . apache . commons . math3 . stat . descriptive . DescriptiveStatistics ( ) ; org . apache . metron . stellar . common . benchmark . Microbenchmark . run ( benchmarkRounds , statement , ( ts ) -> { stats . addValue ( ts ) ; } ) ; return stats ; }
org . junit . Assert . assertNull ( result )
whenAddUserToStorageThatTheyAdd ( ) { ru . szhernovoy . model . User vasja = new ru . szhernovoy . model . User ( "Vasja" , 25 ) ; ru . szhernovoy . model . User kolja = new ru . szhernovoy . model . User ( "Kolja" , 26 ) ; ru . szhernovoy . control . Validate [ ] valid = new ru . szhernovoy . control . Validate [ 2 ] ; valid [ 0 ] = new ru . szhernovoy . control . ValidateAge ( ) ; valid [ 1 ] = new ru . szhernovoy . control . ValidateName ( ) ; ru . szhernovoy . model . UserStorage storage = new ru . szhernovoy . model . UserStorage ( 2 ) ; boolean result = storage . addUser ( valid , vasja ) ; storage . addUser ( valid , kolja ) ; boolean control = true ; "<AssertPlaceHolder>" ; } addUser ( ru . szhernovoy . control . Validate [ ] , ru . szhernovoy . model . User ) { boolean result = checkParam ( valid , user ) ; if ( result ) { user . setId ( this . generateId ( ) ) ; users [ ( ( position ) ++ ) ] = user ; } return result ; }
org . junit . Assert . assertThat ( control , org . hamcrest . core . Is . is ( result ) )
testIsPresentOnNullValue ( ) { "<AssertPlaceHolder>" ; } isPresent ( ) { return new com . annimon . stream . test . hamcrest . OptionalLongMatcher . IsPresentMatcher ( ) ; }
org . junit . Assert . assertThat ( null , com . annimon . stream . test . hamcrest . OptionalLongMatcher . isPresent ( ) )
testApplicationStartup ( ) { System . out . println ( "--><sp>OpenRate<sp>startup" ) ; int expResult = 0 ; java . lang . String [ ] args = new java . lang . String [ 2 ] ; args [ 0 ] = "-p" ; args [ 1 ] = "TestFramework.properties.xml" ; appl = OpenRate . OpenRate . getApplicationInstance ( ) ; int status = appl . createApplication ( args ) ; "<AssertPlaceHolder>" ; java . lang . Thread openRateThread = new java . lang . Thread ( appl ) ; openRateThread . start ( ) ; System . out . println ( "Waiting<sp>for<sp>startup<sp>to<sp>complete" ) ; while ( ! ( appl . isFrameworkActive ( ) ) ) { try { java . lang . Thread . sleep ( 100 ) ; } catch ( java . lang . InterruptedException ex ) { } } System . out . println ( "Waiting<sp>for<sp>the<sp>system<sp>to<sp>come<sp>up" ) ; while ( ! ( appl . isFrameworkActive ( ) ) ) { try { java . lang . Thread . sleep ( 100 ) ; } catch ( java . lang . InterruptedException ex ) { java . util . logging . Logger . getLogger ( OpenRate . OpenRateTest . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } appl . processControlEvent ( "Shutdown" , false , "true" ) ; System . out . println ( "Waiting<sp>for<sp>the<sp>system<sp>to<sp>stop" ) ; while ( appl . isFrameworkActive ( ) ) { try { java . lang . Thread . sleep ( 1000 ) ; } catch ( java . lang . InterruptedException ex ) { } } appl . finaliseApplication ( ) ; } createApplication ( java . lang . String [ ] ) { int status ; java . util . ArrayList < java . lang . String > pipelineList ; java . lang . String tmpPipelineToCreate ; boolean initError = false ; OpenRate . OpenRate . applicationVersionString = getApplicationVersion ( ) ; status = checkParameters ( args ) ; if ( status != 0 ) { return status ; } java . net . URL propertiesFileName = getPropertiesFileName ( args ) ; if ( propertiesFileName == null ) { return status ; } try { OpenRate . utils . PropertyUtils . getPropertyUtils ( ) . loadPropertiesXML ( propertiesFileName , "FWProps" ) ; } catch ( OpenRate . exception . InitializationException ex ) { System . err . println ( ( ( "Error<sp>loading<sp>properties<sp>file<sp><" + propertiesFileName ) + ">.<sp>Aborting." ) ) ; return OpenRate . OpenRate . PROPERTIES_FILE_NOT_FOUND ; } loadDefaultLogger ( ) ; System . out . println ( "" ) ; System . out . println ( "<sp>" 1 ) ; System . out . println ( ( "<sp>" + ( OpenRate . OpenRate . getApplicationVersionString ( ) ) ) ) ; System . out . println ( "<sp>" 0 ) ; System . out . println ( "<sp>" 1 ) ; if ( ( startupFramework ( ) ) == true ) { pipelineList = OpenRate . utils . PropertyUtils . getPropertyUtils ( ) . getGenericNameList ( "PipelineList" ) ; java . util . Iterator < java . lang . String > pipelineIterator = pipelineList . iterator ( ) ; while ( pipelineIterator . hasNext ( ) ) { tmpPipelineToCreate = pipelineIterator . next ( ) ; System . out . println ( ( ( "Creating<sp>pipeline:<" + tmpPipelineToCreate ) + ">" ) ) ; if ( ( createPipeline ( tmpPipelineToCreate ) ) == false ) { initError = true ; break ; } } if ( initError == false ) { OpenRate . OpenRate . appl . attachShutDownHook ( ) ; System . out . println ( "Running..." ) ; } else { System . err . println ( "Error<sp>during<sp>framework<sp>startup.<sp>See<sp>Error<sp>Log<sp>for<sp>details.<sp>Aborting." ) ; status = OpenRate . OpenRate . FATAL_EXCEPTION ; } } else { checkFrameworkExceptions ( ) ; System . err . println ( "Error<sp>during<sp>framework<sp>startup.<sp>See<sp>Error<sp>Log<sp>for<sp>details.<sp>Aborting." ) ; status = OpenRate . OpenRate . FATAL_EXCEPTION ; } return status ; }
org . junit . Assert . assertEquals ( expResult , status )
iteratorRaisesOnTooSmallRecords ( ) { java . nio . ByteBuffer buffer = java . nio . ByteBuffer . allocate ( 1024 ) ; org . apache . kafka . common . record . MemoryRecordsBuilder builder = org . apache . kafka . common . record . MemoryRecords . builder ( buffer , CompressionType . NONE , TimestampType . CREATE_TIME , 0L ) ; builder . append ( 15L , "a" . getBytes ( ) , "1" . getBytes ( ) ) ; builder . append ( 20L , "b" . getBytes ( ) , "2" . getBytes ( ) ) ; builder . close ( ) ; int position = buffer . position ( ) ; builder = org . apache . kafka . common . record . MemoryRecords . builder ( buffer , CompressionType . NONE , TimestampType . CREATE_TIME , 2L ) ; builder . append ( 30L , "c" . getBytes ( ) , "3" . getBytes ( ) ) ; builder . append ( 40L , "d" . getBytes ( ) , "4" . getBytes ( ) ) ; builder . close ( ) ; buffer . flip ( ) ; buffer . putInt ( ( position + ( DefaultRecordBatch . LENGTH_OFFSET ) ) , 9 ) ; org . apache . kafka . common . record . ByteBufferLogInputStream logInputStream = new org . apache . kafka . common . record . ByteBufferLogInputStream ( buffer , Integer . MAX_VALUE ) ; "<AssertPlaceHolder>" ; logInputStream . nextBatch ( ) ; } nextBatch ( ) { int remaining = buffer . remaining ( ) ; java . lang . Integer batchSize = nextBatchSize ( ) ; if ( ( batchSize == null ) || ( remaining < batchSize ) ) return null ; byte magic = buffer . get ( ( ( buffer . position ( ) ) + ( org . apache . kafka . common . record . Records . MAGIC_OFFSET ) ) ) ; java . nio . ByteBuffer batchSlice = buffer . slice ( ) ; batchSlice . limit ( batchSize ) ; buffer . position ( ( ( buffer . position ( ) ) + batchSize ) ) ; if ( magic > ( RecordBatch . MAGIC_VALUE_V1 ) ) return new org . apache . kafka . common . record . DefaultRecordBatch ( batchSlice ) ; else return new org . apache . kafka . common . record . AbstractLegacyRecordBatch . ByteBufferLegacyRecordBatch ( batchSlice ) ; }
org . junit . Assert . assertNotNull ( logInputStream . nextBatch ( ) )
testCreateSection ( ) { org . bukkit . configuration . Configuration config = getConfig ( ) ; java . util . Set < java . lang . String > set = new java . util . HashSet < java . lang . String > ( ) ; set . add ( "this" ) ; set . add ( "this.test.sub" ) ; set . add ( "this.test" ) ; set . add ( "this.test.other" ) ; config . createSection ( "this.test.sub" ) ; config . createSection ( "this.test.other" ) ; "<AssertPlaceHolder>" ; } getKeys ( boolean ) { java . util . Set < java . lang . String > result = new java . util . LinkedHashSet < java . lang . String > ( ) ; org . bukkit . configuration . Configuration root = getRoot ( ) ; if ( ( root != null ) && ( root . options ( ) . copyDefaults ( ) ) ) { org . bukkit . configuration . ConfigurationSection defaults = getDefaultSection ( ) ; if ( defaults != null ) { result . addAll ( defaults . getKeys ( deep ) ) ; } } mapChildrenKeys ( result , this , deep ) ; return result ; }
org . junit . Assert . assertEquals ( set , config . getKeys ( true ) )
scaleDown ( ) { prepareSlaveClusterSizeAndServerIds ( org . oscm . app . iaas . VSystemProcessorBeanTest . ONE , org . oscm . app . iaas . VSystemProcessorBeanTest . TWO ) ; org . oscm . app . iaas . data . FlowState newState = vSystemProcessor . scaleDown ( paramHandler , FlowState . VSYSTEM_CREATING , org . oscm . app . iaas . VSystemProcessorBeanTest . DISK_IMAGE_ID , true ) ; "<AssertPlaceHolder>" ; } scaleDown ( org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , java . lang . String , boolean ) { int slaveClusterSize = getSlaveClusterSize ( paramHandler ) ; java . util . List < java . lang . String > serverIds = vsysComm . getVServersForTemplate ( slaveTemplateId , paramHandler ) ; if ( ( slaveClusterSize < ( serverIds . size ( ) ) ) && ( ( serverIds . size ( ) ) > 0 ) ) { java . util . Collections . sort ( serverIds , java . text . Collator . getInstance ( ) ) ; paramHandler . setVserverId ( serverIds . get ( ( ( serverIds . size ( ) ) - 1 ) ) ) ; if ( vsysInNormalState ) { notifyAdminAgent ( false , paramHandler ) ; newStatus = org . oscm . app . iaas . data . FlowState . VSYSTEM_SCALE_DOWN_STOP_SERVER ; } } else if ( slaveClusterSize == ( serverIds . size ( ) ) ) { newStatus = determineScalingAndSizing ( paramHandler ) ; } org . oscm . app . iaas . VSystemProcessorBean . logger . debug ( ( "newStatus=" + newStatus ) ) ; return newStatus ; }
org . junit . Assert . assertEquals ( FlowState . VSYSTEM_SCALE_DOWN_STOP_SERVER , newState )
testBlob ( ) { java . lang . String clusterName = "testBlob" ; com . orientechnologies . orient . core . sql . executor . OResultSet result = com . orientechnologies . orient . core . sql . executor . OCreateClusterStatementExecutionTest . db . command ( ( "create<sp>blob<sp>cluster<sp>" + clusterName ) ) ; "<AssertPlaceHolder>" ; com . orientechnologies . orient . core . storage . OCluster cluster = ( ( com . orientechnologies . orient . core . db . document . ODatabaseDocumentTx ) ( com . orientechnologies . orient . core . sql . executor . OCreateClusterStatementExecutionTest . db ) ) . getStorage ( ) . getClusterByName ( clusterName ) ; result . close ( ) ; } getClusterIdByName ( java . lang . String ) { checkOpenness ( ) ; return underlying . getClusterIdByName ( iClusterName ) ; }
org . junit . Assert . assertTrue ( ( ( com . orientechnologies . orient . core . sql . executor . OCreateClusterStatementExecutionTest . db . getClusterIdByName ( clusterName ) ) > 0 ) )
testfromStringComDddWithLessDigits ( ) { br . com . insula . opes . Telefone telefone = br . com . insula . opes . Telefone . fromString ( "4052-9211" ) ; "<AssertPlaceHolder>" ; } isContemDdd ( ) { if ( numero . matches ( "0[3,8]\\d+" ) ) { return false ; } else { return ( numero . length ( ) ) > 9 ; } }
org . junit . Assert . assertFalse ( telefone . isContemDdd ( ) )
testGetFormattedItem ( ) { org . apache . servicecomb . transport . rest . vertx . accesslog . AccessLogParam < io . vertx . ext . web . RoutingContext > accessLogParam = new org . apache . servicecomb . transport . rest . vertx . accesslog . AccessLogParam ( ) ; io . vertx . ext . web . RoutingContext routingContext = org . mockito . Mockito . mock ( io . vertx . ext . web . RoutingContext . class ) ; java . util . Map < java . lang . String , java . lang . Object > routingContextData = new java . util . HashMap ( ) ; org . apache . servicecomb . core . Invocation invocation = org . mockito . Mockito . mock ( org . apache . servicecomb . core . Invocation . class ) ; java . lang . String testValue = "testValue" ; accessLogParam . setContextData ( routingContext ) ; org . mockito . Mockito . when ( routingContext . data ( ) ) . thenReturn ( routingContextData ) ; routingContextData . put ( RestConst . REST_INVOCATION_CONTEXT , invocation ) ; org . mockito . Mockito . when ( invocation . getContext ( org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . InvocationContextItemTest . INVOCATION_CONTEXT_KEY ) ) . thenReturn ( testValue ) ; java . lang . String result = org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . InvocationContextItemTest . ITEM . getFormattedItem ( accessLogParam ) ; "<AssertPlaceHolder>" ; } getFormattedItem ( org . apache . servicecomb . transport . rest . vertx . accesslog . AccessLogParam ) { java . util . Set < io . vertx . ext . web . Cookie > cookieSet = accessLogParam . getContextData ( ) . cookies ( ) ; if ( null == cookieSet ) { return org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . CookieItem . RESULT_NOT_FOUND ; } java . lang . String result = null ; for ( io . vertx . ext . web . Cookie cookie : cookieSet ) { if ( varName . equals ( cookie . getName ( ) ) ) { result = cookie . getValue ( ) ; } } if ( null == result ) { return org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . CookieItem . RESULT_NOT_FOUND ; } return result ; }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( testValue ) )
getByNameReturnsNullWhenDocumentNotLoaded ( ) { when ( this . getByNameQuery . execute ( ) ) . thenReturn ( java . util . Collections . singletonList ( org . phenotips . entities . spi . AbstractPrimaryEntityManagerTest . PERSON_DOCNAME ) ) ; when ( this . dab . getDocument ( org . phenotips . entities . spi . AbstractPrimaryEntityManagerTest . PERSON_REFERENCE ) ) . thenReturn ( null ) ; org . phenotips . entities . spi . Person result = this . manager . getByName ( org . phenotips . entities . spi . AbstractPrimaryEntityManagerTest . PERSON_NAME ) ; "<AssertPlaceHolder>" ; } getByName ( java . lang . String ) { try { org . xwiki . query . Query q = this . qm . createQuery ( ( ( "select<sp>doc.fullName<sp>from<sp>Document<sp>doc,<sp>doc.object(" + ( this . localSerializer . serialize ( getEntityXClassReference ( ) ) ) ) + ")<sp>as<sp>entity<sp>where<sp>doc.space<sp>=<sp>:space<sp>and<sp>doc.title<sp>=<sp>:name" ) , Query . XWQL ) . bindValue ( "space" , this . getDataSpace ( ) . getName ( ) ) . bindValue ( "name" , name ) ; java . util . List < java . lang . String > docNames = q . execute ( ) ; for ( java . lang . String docName : docNames ) { return get ( docName ) ; } } catch ( org . xwiki . query . QueryException ex ) { this . logger . warn ( "Failed<sp>to<sp>retrieve<sp>the<sp>entity<sp>named<sp>[{}]:<sp>{}" , name , ex . getMessage ( ) ) ; } return null ; }
org . junit . Assert . assertNull ( result )
crawlFailsAfterAllRetrials ( ) { com . amihaiemil . charles . WebCrawl mc = org . mockito . Mockito . mock ( com . amihaiemil . charles . WebCrawl . class ) ; org . mockito . Mockito . doThrow ( new java . lang . RuntimeException ( "Fail<sp>all<sp>retrials!" ) ) . when ( mc ) . crawl ( ) ; com . amihaiemil . charles . RetriableCrawl rc = new com . amihaiemil . charles . RetriableCrawl ( mc ) ; try { rc . crawl ( ) ; } catch ( java . lang . RuntimeException ex ) { "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( mc , org . mockito . Mockito . times ( 3 ) ) . crawl ( ) ; } } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } com . amihaiemil . charles . Link other = ( ( com . amihaiemil . charles . Link ) ( obj ) ) ; if ( ( this . href ) == null ) { if ( ( other . href ) != null ) return false ; } else { if ( ( this . href . contains ( "#" ) ) && ( other . href . contains ( "#" ) ) ) { return new com . amihaiemil . charles . Link ( "" , this . href . substring ( 0 , href . indexOf ( "#" ) ) ) . equals ( new com . amihaiemil . charles . Link ( "" , other . href . substring ( 0 , other . href . indexOf ( "#" ) ) ) ) ; } else if ( this . href . contains ( "#" ) ) { return new com . amihaiemil . charles . Link ( "" , this . href . substring ( 0 , href . indexOf ( "#" ) ) ) . equals ( new com . amihaiemil . charles . Link ( "" , other . href ) ) ; } else if ( other . href . contains ( "#" ) ) { return new com . amihaiemil . charles . Link ( "" , this . href ) . equals ( new com . amihaiemil . charles . Link ( "" , other . href . substring ( 0 , other . href . indexOf ( "#" ) ) ) ) ; } if ( ( this . href . endsWith ( "/" ) ) && ( other . href . endsWith ( "/" ) ) ) { return this . href . substring ( 0 , ( ( this . href . length ( ) ) - 1 ) ) . equals ( other . href . substring ( 0 , ( ( other . href . length ( ) ) - 1 ) ) ) ; } else if ( this . href . endsWith ( "/" ) ) { return this . href . substring ( 0 , ( ( href . length ( ) ) - 1 ) ) . equals ( other . href ) ; } else if ( other . href . endsWith ( "/" ) ) { return this . href . equals ( other . href . substring ( 0 , ( ( other . href . length ( ) ) - 1 ) ) ) ; } } return this . href . equals ( other . href ) ; }
org . junit . Assert . assertTrue ( ex . getMessage ( ) . equals ( "Fail<sp>all<sp>retrials!" ) )
testRandomVariableGradientBigSum2 ( ) { int numberOfIterations = ( ( int ) ( java . lang . Math . pow ( 10 , 3 ) ) ) ; net . finmath . stochastic . RandomVariable sum = randomVariableFactory . createRandomVariable ( 0.0 ) ; for ( int i = 0 ; i < numberOfIterations ; i ++ ) { sum = sum . add ( randomVariable01 ) ; } java . util . Map < java . lang . Long , net . finmath . stochastic . RandomVariable > aadGradient = ( ( net . finmath . montecarlo . automaticdifferentiation . RandomVariableDifferentiable ) ( sum ) ) . getGradient ( ) ; net . finmath . stochastic . RandomVariable [ ] analyticGradient = new net . finmath . stochastic . RandomVariable [ ] { new net . finmath . montecarlo . RandomVariableFromDoubleArray ( numberOfIterations ) } ; java . lang . Long [ ] keys = new java . lang . Long [ aadGradient . keySet ( ) . size ( ) ] ; keys = aadGradient . keySet ( ) . toArray ( keys ) ; java . util . Arrays . sort ( keys ) ; for ( int i = 0 ; i < ( analyticGradient . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } net . finmath . time . TimeDiscretizationFromArray other = ( ( net . finmath . time . TimeDiscretizationFromArray ) ( obj ) ) ; if ( ! ( java . util . Arrays . equals ( timeDiscretization , other . timeDiscretization ) ) ) { return false ; } return ( java . lang . Double . doubleToLongBits ( timeTickSize ) ) == ( java . lang . Double . doubleToLongBits ( other . timeTickSize ) ) ; }
org . junit . Assert . assertTrue ( analyticGradient [ i ] . equals ( aadGradient . get ( keys [ i ] ) ) )
testConvertDataToFileLocationIfEnabled ( ) { gov . hhs . fha . nhinc . admindistribution . AdminDistributionUtils adminUtils = createAdminDistributionUtils ( ) ; context . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockFileUtils ) . isSavePayloadToFileEnabled ( ) ; will ( returnValue ( true ) ) ; oneOf ( mockFileUtils ) . generateAttachmentFile ( ) ; will ( returnValue ( new java . io . File ( new java . net . URI ( URI_SAVED_FILE_STRING ) ) ) ) ; oneOf ( mockFileUtils ) . saveDataToFile ( with ( any ( javax . activation . DataHandler . class ) ) , with ( any ( java . io . File . class ) ) ) ; oneOf ( mockFileUtils ) . convertToDataHandler ( with ( any ( java . lang . String . class ) ) ) ; will ( returnValue ( gov . hhs . fha . nhinc . largefile . LargeFileUtils . getInstance ( ) . convertToDataHandler ( URI_SAVED_FILE_STRING ) ) ) ; } } ) ; oasis . names . tc . emergency . edxl . de . _1 . EDXLDistribution request = createEDXLDistribution ( ) ; adminUtils . convertDataToFileLocationIfEnabled ( request ) ; java . net . URI contentUri = gov . hhs . fha . nhinc . largefile . LargeFileUtils . getInstance ( ) . parseBase64DataAsUri ( request . getContentObject ( ) . get ( 0 ) . getNonXMLContent ( ) . getContentData ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; if ( org . apache . commons . collections . CollectionUtils . isNotEmpty ( names ) ) { for ( int i = 0 ; i < ( names . size ( ) ) ; i ++ ) { final gov . hhs . fha . nhinc . mpilib . PersonName personName = names . get ( i ) ; if ( i == 0 ) { result . append ( personName . toString ( ) ) ; } else { result . append ( "|" ) ; result . append ( personName . toString ( ) ) ; } } } return result . toString ( ) ; }
org . junit . Assert . assertEquals ( URI_SAVED_FILE_STRING , contentUri . toString ( ) )
parseFromArray ( ) { long timestamp = java . lang . System . currentTimeMillis ( ) ; long input = 1000 ; long output = 2000 ; long inputRates = 10 ; long outputRates = 20 ; result = new com . ctrip . xpipe . redis . core . proxy . monitor . SessionTrafficResult ( timestamp , input , output , inputRates , outputRates ) ; java . lang . Object [ ] objects = result . toArray ( ) ; com . ctrip . xpipe . redis . core . proxy . monitor . SessionTrafficResult other = com . ctrip . xpipe . redis . core . proxy . monitor . SessionTrafficResult . parseFromArray ( objects ) ; "<AssertPlaceHolder>" ; } parseFromArray ( java . lang . Object [ ] ) { if ( ( ( ! ( ( objects [ 0 ] ) instanceof java . lang . Long ) ) || ( ! ( ( objects [ 1 ] ) instanceof java . lang . Long ) ) ) || ( ! ( ( objects [ 2 ] ) instanceof java . lang . Long ) ) ) { throw new com . ctrip . xpipe . exception . XpipeRuntimeException ( "first<sp>element<sp>of<sp>SocketStatsResult<sp>should<sp>be<sp>timestamp" ) ; } long timestamp = ( ( long ) ( objects [ 0 ] ) ) ; long inputBytes = ( ( long ) ( objects [ 1 ] ) ) ; long outputBytes = ( ( long ) ( objects [ 2 ] ) ) ; long inputRates = ( ( long ) ( objects [ 3 ] ) ) ; long outputRates = ( ( long ) ( objects [ 4 ] ) ) ; return new com . ctrip . xpipe . redis . core . proxy . monitor . SessionTrafficResult ( timestamp , inputBytes , outputBytes , inputRates , outputRates ) ; }
org . junit . Assert . assertEquals ( result , other )
testCreateConnectionAndStart ( ) { org . apache . qpid . jms . JmsConnectionFactory factory = new org . apache . qpid . jms . JmsConnectionFactory ( getConnectionURI ( ) ) ; org . apache . qpid . jms . JmsConnection connection = ( ( org . apache . qpid . jms . JmsConnection ) ( factory . createConnection ( ) ) ) ; "<AssertPlaceHolder>" ; connection . start ( ) ; connection . close ( ) ; } createConnection ( ) { return createConnection ( getUsername ( ) , getPassword ( ) ) ; }
org . junit . Assert . assertNotNull ( connection )
testEquals_differentName ( ) { com . ibm . ws . security . registry . basic . internal . BasicGroup group = new com . ibm . ws . security . registry . basic . internal . BasicGroup ( "group" , new java . util . HashSet < java . lang . String > ( ) ) ; com . ibm . ws . security . registry . basic . internal . BasicGroup groupX = new com . ibm . ws . security . registry . basic . internal . BasicGroup ( "groupX" , new java . util . HashSet < java . lang . String > ( ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( o instanceof com . ibm . ws . monitor . internal . ProbeImpl ) { com . ibm . ws . monitor . internal . ProbeImpl that = ( ( com . ibm . ws . monitor . internal . ProbeImpl ) ( o ) ) ; return ( this . identifier ) == ( that . identifier ) ; } return false ; }
org . junit . Assert . assertFalse ( group . equals ( groupX ) )
testGetDriver ( ) { java . sql . Driver driver1 = databaseServer . getDriver ( ) ; java . sql . Driver driver2 = databaseServer . getDriver ( ) ; "<AssertPlaceHolder>" ; } getDriver ( ) { return driver ; }
org . junit . Assert . assertSame ( driver1 , driver2 )
testAppModularityMetadataWithDeclaredDependency ( ) { java . lang . String target = "//apps/multidex:modularity-metadata-simple-declared-dep" ; java . nio . file . Path result = workspace . buildAndReturnOutput ( target ) ; java . lang . String expected = workspace . getFileContents ( testdataDir . resolve ( "testAppModularityMetadataWithDeclaredDependency.txt" ) ) ; java . lang . String actual = workspace . getFileContents ( result ) ; "<AssertPlaceHolder>" ; } getFileContents ( java . lang . String ) { try ( java . util . zip . ZipFile zipFile = new java . util . zip . ZipFile ( this . zipFile . toFile ( ) ) ) { java . util . zip . ZipEntry entry = zipFile . getEntry ( pathRelativeToRoot ) ; return com . google . common . io . ByteStreams . toByteArray ( zipFile . getInputStream ( entry ) ) ; } }
org . junit . Assert . assertEquals ( expected , actual )
testBigCacheTimingWithExpiry ( ) { final int _CACHE_SIZE = 1000000 ; org . cache2k . Cache < java . lang . Integer , java . lang . Integer > c = org . cache2k . Cache2kBuilder . of ( Integer . class , Integer . class ) . entryCapacity ( _CACHE_SIZE ) . expireAfterWrite ( 5 , TimeUnit . MINUTES ) . build ( ) ; for ( int i = 0 ; i < _CACHE_SIZE ; i ++ ) { c . put ( i , i ) ; } "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "strict=" + ( strictEviction ) ) + ",<sp>recordRefresh=" ) + ( recordRefreshTime ) ) + ",<sp>disableStats=" ) + ( disableStatistics ) ) + ",<sp>entryProcessor=" ) + ( withEntryProcessor ) ) + ",<sp>wired=" ) + ( withWiredCache ) ) + ",<sp>forwarding=" ) + ( withForwardingAndAbstract ) ) + ",<sp>keep=" ) + ( keepDataAfterExpired ) ) + ",<sp>expiry=" ) + ( withExpiryAfterWrite ) ) + ",<sp>useObjectKey=" ) + ( useObjectKey ) ; }
org . junit . Assert . assertNotNull ( c . toString ( ) )
testBasic ( ) { @ org . apache . hc . core5 . http . protocol . SuppressWarnings ( "deprecation" ) final org . apache . hc . core5 . http . protocol . LookupRegistry < java . lang . Object > matcher = org . apache . hc . core5 . http . protocol . UriPatternType . newMatcher ( UriPatternType . BASIC ) ; "<AssertPlaceHolder>" ; } newMatcher ( org . apache . hc . core5 . http . protocol . UriPatternType ) { if ( type == null ) { return new org . apache . hc . core5 . http . protocol . UriPatternMatcher ( ) ; } switch ( type ) { case REGEX : return new org . apache . hc . core5 . http . protocol . UriRegexMatcher ( ) ; case URI_PATTERN : return new org . apache . hc . core5 . http . protocol . UriPatternMatcher ( ) ; case URI_PATTERN_IN_ORDER : return new org . apache . hc . core5 . http . protocol . UriPatternOrderedMatcher ( ) ; default : return new org . apache . hc . core5 . http . protocol . UriPatternMatcher ( ) ; } }
org . junit . Assert . assertTrue ( ( matcher instanceof org . apache . hc . core5 . http . protocol . UriPatternMatcher ) )
shouldNotDoAnythingForNormalEvent ( ) { org . bukkit . event . player . PlayerLoginEvent event = mock ( org . bukkit . event . player . PlayerLoginEvent . class ) ; given ( event . getResult ( ) ) . willReturn ( PlayerLoginEvent . Result . ALLOWED ) ; boolean result = onJoinVerifier . refusePlayerForFullServer ( event ) ; "<AssertPlaceHolder>" ; verify ( event ) . getResult ( ) ; verifyNoMoreInteractions ( event ) ; verifyZeroInteractions ( bukkitService , dataSource , permissionsManager ) ; } refusePlayerForFullServer ( org . bukkit . event . player . PlayerLoginEvent ) { final org . bukkit . entity . Player player = event . getPlayer ( ) ; if ( ( event . getResult ( ) ) != ( PlayerLoginEvent . Result . KICK_FULL ) ) { return false ; } else if ( ! ( permissionsManager . hasPermission ( player , PlayerStatePermission . IS_VIP ) ) ) { event . setKickMessage ( messages . retrieveSingle ( player , MessageKey . KICK_FULL_SERVER ) ) ; return true ; } java . util . Collection < ? extends org . bukkit . entity . Player > onlinePlayers = bukkitService . getOnlinePlayers ( ) ; if ( ( onlinePlayers . size ( ) ) < ( server . getMaxPlayers ( ) ) ) { event . allow ( ) ; return false ; } org . bukkit . entity . Player nonVipPlayer = generateKickPlayer ( onlinePlayers ) ; if ( nonVipPlayer != null ) { nonVipPlayer . kickPlayer ( messages . retrieveSingle ( player , MessageKey . KICK_FOR_VIP ) ) ; event . allow ( ) ; return false ; } else { fr . xephi . authme . ConsoleLogger . info ( ( ( "VIP<sp>player<sp>" + ( player . getName ( ) ) ) + "<sp>tried<sp>to<sp>join,<sp>but<sp>the<sp>server<sp>was<sp>full" ) ) ; event . setKickMessage ( messages . retrieveSingle ( player , MessageKey . KICK_FULL_SERVER ) ) ; return true ; } }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( false ) )
isOnlyEmojis_for_emojis_returns_true ( ) { java . lang . String str = "" ; boolean isEmoji = com . vdurmont . emoji . EmojiManager . isOnlyEmojis ( str ) ; "<AssertPlaceHolder>" ; } isOnlyEmojis ( java . lang . String ) { return ( string != null ) && ( com . vdurmont . emoji . EmojiParser . removeAllEmojis ( string ) . isEmpty ( ) ) ; }
org . junit . Assert . assertTrue ( isEmoji )
testIsAssignable_withMessage ( ) { org . apache . commons . lang3 . Validate . isAssignableFrom ( java . lang . CharSequence . class , java . lang . String . class , "Error" ) ; org . apache . commons . lang3 . Validate . isAssignableFrom ( java . util . AbstractList . class , java . util . ArrayList . class , "Error" ) ; try { org . apache . commons . lang3 . Validate . isAssignableFrom ( java . util . List . class , java . lang . String . class , "Error" ) ; org . junit . Assert . fail ( "Expecting<sp>IllegalArgumentException" ) ; } catch ( final java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return getMessage ( Locale . US ) ; }
org . junit . Assert . assertEquals ( "Error" , e . getMessage ( ) )
testBlockIdGeneration ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . hdfs . HdfsConfiguration ( ) ; conf . setInt ( DFSConfigKeys . DFS_REPLICATION_KEY , 1 ) ; org . apache . hadoop . hdfs . MiniDFSCluster cluster = new org . apache . hadoop . hdfs . MiniDFSCluster . Builder ( conf ) . numDataNodes ( 1 ) . build ( ) ; try { cluster . waitActive ( ) ; org . apache . hadoop . fs . FileSystem fs = cluster . getFileSystem ( ) ; org . apache . hadoop . fs . Path path = new org . apache . hadoop . fs . Path ( "testBlockIdGeneration.dat" ) ; org . apache . hadoop . hdfs . DFSTestUtil . createFile ( fs , path , IO_SIZE , ( ( BLOCK_SIZE ) * 10 ) , BLOCK_SIZE , REPLICATION , SEED ) ; java . util . List < org . apache . hadoop . hdfs . protocol . LocatedBlock > blocks = org . apache . hadoop . hdfs . DFSTestUtil . getAllBlocks ( fs , path ) ; org . apache . hadoop . hdfs . server . blockmanagement . TestSequentialBlockId . LOG . info ( ( "Block0<sp>id<sp>is<sp>" + ( blocks . get ( 0 ) . getBlock ( ) . getBlockId ( ) ) ) ) ; long nextBlockExpectedId = ( blocks . get ( 0 ) . getBlock ( ) . getBlockId ( ) ) + 1 ; for ( int i = 1 ; i < ( blocks . size ( ) ) ; ++ i ) { long nextBlockId = blocks . get ( i ) . getBlock ( ) . getBlockId ( ) ; org . apache . hadoop . hdfs . server . blockmanagement . TestSequentialBlockId . LOG . info ( ( ( ( "Block" + i ) + "<sp>id<sp>is<sp>" ) + nextBlockId ) ) ; "<AssertPlaceHolder>" ; ++ nextBlockExpectedId ; } } finally { cluster . shutdown ( ) ; } } info ( java . lang . String ) { return new org . apache . hadoop . yarn . webapp . ResponseInfo ( ) . about ( about ) ; }
org . junit . Assert . assertThat ( nextBlockId , org . hamcrest . CoreMatchers . is ( nextBlockExpectedId ) )
testOverload4 ( ) { fr . inria . corese . core . Graph g = fr . inria . corese . core . Graph . create ( ) ; java . lang . String i = "insert<sp>data<sp>{<sp>" + ( ( "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 5 + "us:t2<sp>us:length<sp>'1000<sp>m'^^us:length<sp>." ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 0 ) ; java . lang . String q = "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 3 + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 4 + "graph<sp>?g<sp>{<sp>?x<sp>?p<sp>?v<sp>.<sp>?y<sp>?p<sp>?w<sp>filter<sp>(?v<sp>=<sp>?w)<sp>}" ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 0 ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 0 ) + "@type<sp>dt:error<sp>" ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 1 ) + "us:convert(?a)<sp>=<sp>us:convert(?b)" ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 0 ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 2 ) + "if<sp>(contains(?a,<sp>'km'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 0 ) + "function<sp>us:convertw(?a)<sp>{" ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 0 ) + "function<sp>us:value(?a)<sp>{" ) + "xsd:integer(strbefore(?a,<sp>'<sp>'))" ) + "if<sp>(contains(?a,<sp>'kg'),<sp>1000<sp>*<sp>us:value(?a),<sp>us:value(?a))" 0 ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; exec . query ( i ) ; fr . inria . corese . kgram . core . Mappings map = exec . query ( q ) ; "<AssertPlaceHolder>" ; } size ( ) { return tests . size ( ) ; }
org . junit . Assert . assertEquals ( 5 , map . size ( ) )
testInvalidMatchTypeParameter ( ) { java . util . Map < java . lang . String , java . lang . Object > parameters = createBasicParams ( ) ; parameters . put ( "match-type" , "invalid" ) ; org . opennms . netmgt . poller . PollStatus status = monitor . poll ( createMonitor ( ) , parameters ) ; "<AssertPlaceHolder>" ; } isAvailable ( ) { return available ; }
org . junit . Assert . assertFalse ( status . isAvailable ( ) )
testOnClose ( ) { final boolean [ ] state = new boolean [ ] { false } ; com . annimon . stream . IntStream stream = com . annimon . stream . IntStream . of ( 0 , 1 , 2 ) . onClose ( new java . lang . Runnable ( ) { @ com . annimon . stream . intstreamtests . Override public void run ( ) { state [ 0 ] = true ; } } ) ; stream . findFirst ( ) ; stream . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { if ( ( ( params ) != null ) && ( ( params . closeHandler ) != null ) ) { params . closeHandler . run ( ) ; params . closeHandler = null ; } }
org . junit . Assert . assertTrue ( state [ 0 ] )
testNumberOfAuthors ( ) { java . util . List < org . apache . cxf . jaxrs . ext . search . jpa . Book > books = queryBooks ( "count(authors)=gt=0" ) ; "<AssertPlaceHolder>" ; } size ( ) { return cache . getSize ( ) ; }
org . junit . Assert . assertEquals ( 3 , books . size ( ) )
testDeployment ( ) { try ( grakn . client . GraknClient . Session session = graknClient . session ( "grakn" ) ) { try ( grakn . client . GraknClient . Transaction tx = session . transaction ( ) . write ( ) ) { java . util . List < grakn . core . concept . answer . ConceptMap > result = tx . execute ( graql . lang . Graql . match ( graql . lang . Graql . var ( "t" ) . sub ( "thing" ) ) . get ( ) ) ; "<AssertPlaceHolder>" ; } } } size ( ) { return patterns . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( result . size ( ) ) > 0 ) )
filterJars_removeOnlyByArtifactIdTemplate ( ) { org . pentaho . hadoop . shim . HadoopConfigurationLocator locator = new org . pentaho . hadoop . shim . HadoopConfigurationLocator ( ) ; org . apache . commons . vfs2 . FileObject root = org . apache . commons . vfs2 . VFS . getManager ( ) . resolveFile ( org . pentaho . hadoop . shim . HadoopExcludeJarsTest . HADOOP_CONFIGURATIONS_PATH ) ; java . util . List < java . net . URL > urls = locator . parseURLs ( root , root . toString ( ) ) ; count = urls . size ( ) ; java . util . List < java . net . URL > list = locator . filterJars ( urls , "pentaho-hadoop-shims-api" ) ; "<AssertPlaceHolder>" ; } filterJars ( java . util . List , java . lang . String ) { java . util . regex . Pattern pattern ; java . util . regex . Matcher matcher ; java . lang . String [ ] excludedJars ; if ( ! ( ( excludedJarsProperty == null ) || ( excludedJarsProperty . trim ( ) . isEmpty ( ) ) ) ) { excludedJars = excludedJarsProperty . split ( "," ) ; if ( excludedJars != null ) { for ( java . lang . String excludedJar : excludedJars ) { pattern = java . util . regex . Pattern . compile ( ( ( ".*/" + ( excludedJar . toLowerCase ( ) ) ) + "-.*\\.jar$" ) ) ; matcher = pattern . matcher ( "" ) ; java . util . Iterator < java . net . URL > iterator = urls . listIterator ( ) ; while ( iterator . hasNext ( ) ) { java . net . URL url = iterator . next ( ) ; if ( url . toString ( ) . toLowerCase ( ) . contains ( excludedJar . toLowerCase ( ) ) ) { if ( ( excludedJar . endsWith ( ".jar" ) ) || ( url . toString ( ) . toLowerCase ( ) . contains ( ( ( excludedJar . toLowerCase ( ) ) + ".jar" ) ) ) ) { iterator . remove ( ) ; } else { if ( matcher . reset ( url . toString ( ) . toLowerCase ( ) ) . matches ( ) ) { iterator . remove ( ) ; } } } } } } } return urls ; }
org . junit . Assert . assertEquals ( ( ( count ) - 1 ) , list . size ( ) )
testServerScanner ( ) { com . arjuna . ats . internal . jts . recovery . transactions . ExpiredServerScanner scanner = new com . arjuna . ats . internal . jts . recovery . transactions . ExpiredServerScanner ( ) ; "<AssertPlaceHolder>" ; scanner . scan ( ) ; } toBeUsed ( ) { return ( com . arjuna . ats . internal . arjuna . recovery . ExpiredTransactionStatusManagerScanner . _expiryTime ) != 0 ; }
org . junit . Assert . assertTrue ( scanner . toBeUsed ( ) )
testFind ( ) { testStream ( "findFirst" , "[101,<sp>100].stream().findFirst().get()" , java . lang . Long . valueOf ( 101 ) ) ; boolean caught = false ; try { org . glassfish . el . test . StreamTest . elp . eval ( "[].stream().findFirst().get()" ) ; } catch ( javax . el . ELException ex ) { caught = true ; } "<AssertPlaceHolder>" ; testStream ( "findFirst" , "[101,<sp>100].stream().findFirst().isPresent()" , Boolean . TRUE ) ; testStream ( "findFirst" , "[].stream().findFirst().isPresent()" , Boolean . FALSE ) ; } eval ( java . lang . String ) { return getValue ( expression , java . lang . Object . class ) ; }
org . junit . Assert . assertTrue ( caught )
testAddValueObject ( ) { final org . apache . commons . lang3 . mutable . MutableShort mutNum = new org . apache . commons . lang3 . mutable . MutableShort ( ( ( short ) ( 1 ) ) ) ; mutNum . add ( java . lang . Short . valueOf ( ( ( short ) ( 1 ) ) ) ) ; "<AssertPlaceHolder>" ; } shortValue ( ) { return value ; }
org . junit . Assert . assertEquals ( ( ( short ) ( 2 ) ) , mutNum . shortValue ( ) )
interpretationCodeNullTest ( ) { org . marc . everest . datatypes . generic . SET < org . marc . everest . datatypes . generic . CE < org . marc . everest . rmim . uv . cdar2 . vocabulary . ObservationInterpretation > > interpretationCodes = observationHelper ( org . oscarehr . e2e . model . export . template . ResultComponentModelTest . nullLabComponent ) . getInterpretationCode ( ) ; "<AssertPlaceHolder>" ; } getInterpretationCode ( ) { java . lang . String abnormal = labComponent . getMeasurementsMap ( ) . get ( Constants . MeasurementsExtKeys . abnormal . toString ( ) ) ; org . marc . everest . datatypes . generic . SET < org . marc . everest . datatypes . generic . CE < org . marc . everest . rmim . uv . cdar2 . vocabulary . ObservationInterpretation > > interpretationCodes = null ; if ( ! ( org . oscarehr . e2e . util . EverestUtils . isNullorEmptyorWhitespace ( abnormal ) ) ) { org . marc . everest . datatypes . generic . CE < org . marc . everest . rmim . uv . cdar2 . vocabulary . ObservationInterpretation > interpretation = new org . marc . everest . datatypes . generic . CE < org . marc . everest . rmim . uv . cdar2 . vocabulary . ObservationInterpretation > ( ) ; if ( abnormal . equalsIgnoreCase ( Labs . ABNORMAL_CODE ) ) { interpretation . setCodeEx ( ObservationInterpretation . Abnormal ) ; interpretation . setDisplayName ( Labs . ABNORMAL ) ; } else { interpretation . setCodeEx ( ObservationInterpretation . Normal ) ; interpretation . setDisplayName ( Labs . NORMAL ) ; } interpretationCodes = new org . marc . everest . datatypes . generic . SET < org . marc . everest . datatypes . generic . CE < org . marc . everest . rmim . uv . cdar2 . vocabulary . ObservationInterpretation > > ( interpretation ) ; } return interpretationCodes ; }
org . junit . Assert . assertNull ( interpretationCodes )
testIgnoreMultipleBranches ( ) { nl . topicus . bitbucket . persistence . WebHookConfiguration dummyConfiguration = createDummyConfiguration ( ) ; dummyConfiguration . setBranchesToIgnore ( "feature/.*" ) ; nl . topicus . bitbucket . api . PushEventService pushEventService = new nl . topicus . bitbucket . api . PushEventService ( dummyConfiguration ) ; nl . topicus . bitbucket . events . BitbucketPushEvent dummyEvent = createDummyEvent ( ) ; com . google . common . collect . ImmutableList < nl . topicus . bitbucket . events . BitbucketPushChange > changes = com . google . common . collect . ImmutableList . of ( createDummyChange ( "feature/foo" ) , createDummyChange ( "feature/bar" ) ) ; dummyEvent . getPush ( ) . setChanges ( changes ) ; "<AssertPlaceHolder>" ; } isValidEvent ( nl . topicus . bitbucket . events . Event , nl . topicus . bitbucket . persistence . WebHookConfiguration ) { return ( ! ( event instanceof nl . topicus . bitbucket . events . Ignorable ) ) || ( ! ( isIgnoredEvent ( ( ( nl . topicus . bitbucket . events . Ignorable ) ( event ) ) , configuration ) ) ) ; }
org . junit . Assert . assertThat ( pushEventService . isValidEvent ( dummyEvent , dummyConfiguration ) , org . hamcrest . Matchers . is ( false ) )
mergeTest ( ) { int count = 100 ; long from = 1000 ; long to = 10000 ; int xGroupUnit = 100 ; int yGroupUnit = 100 ; com . navercorp . pinpoint . web . scatter . ScatterData scatterData = new com . navercorp . pinpoint . web . scatter . ScatterData ( from , to , xGroupUnit , yGroupUnit ) ; java . util . List < com . navercorp . pinpoint . web . vo . scatter . Dot > dotList = createDotList ( agentId , transactionAgentId , count , from ) ; for ( com . navercorp . pinpoint . web . vo . scatter . Dot dot : dotList ) { com . navercorp . pinpoint . web . scatter . ScatterData newScatterData = new com . navercorp . pinpoint . web . scatter . ScatterData ( from , to , xGroupUnit , yGroupUnit ) ; newScatterData . addDot ( dot ) ; scatterData . merge ( newScatterData ) ; } java . util . List < com . navercorp . pinpoint . web . vo . scatter . Dot > dots = extractDotList ( scatterData ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . queue . size ( ) ; }
org . junit . Assert . assertEquals ( count , dots . size ( ) )
testListSequentialDatasets ( ) { try { when ( mockFTPClient . login ( "user" , "pssword" ) ) . thenReturn ( true ) ; when ( mockFTPClient . logout ( ) ) . thenReturn ( true ) ; when ( mockFTPClient . isConnected ( ) ) . thenReturn ( false ) ; when ( mockFTPClient . getReplyCode ( ) ) . thenReturn ( 200 ) ; when ( mockFTPClient . changeWorkingDirectory ( "a.b.c" ) ) . thenReturn ( true ) ; org . apache . commons . net . ftp . FTPFile file1 = new org . apache . commons . net . ftp . FTPFile ( ) ; file1 . setName ( "blah1" ) ; file1 . setType ( FTPFile . FILE_TYPE ) ; org . apache . commons . net . ftp . FTPFile file2 = new org . apache . commons . net . ftp . FTPFile ( ) ; file2 . setName ( "blah2" ) ; file2 . setType ( FTPFile . FILE_TYPE ) ; when ( mockFTPClient . initiateListParsing ( MainframeConfiguration . MAINFRAME_FTP_FILE_ENTRY_PARSER_CLASSNAME , "" ) ) . thenReturn ( mockFTPListParseEngine ) ; when ( mockFTPListParseEngine . hasNext ( ) ) . thenReturn ( true , false ) ; when ( mockFTPListParseEngine . getNext ( 25 ) ) . thenReturn ( new org . apache . commons . net . ftp . FTPFile [ ] { file1 , file2 } ) ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( "No<sp>IOException<sp>should<sp>be<sp>thrown!" ) ; } setupDefaultConfiguration ( ) ; conf . set ( MainframeConfiguration . MAINFRAME_INPUT_DATASET_TYPE , "s" ) ; conf . set ( MainframeConfiguration . MAINFRAME_INPUT_DATASET_NAME , "a.b.c.blah1" ) ; try { java . util . List < java . lang . String > files = org . apache . sqoop . util . MainframeFTPClientUtils . listSequentialDatasets ( "a.b.c.blah1" , conf ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException ioe ) { org . junit . Assert . fail ( "No<sp>IOException<sp>should<sp>be<sp>thrown!" ) ; } } size ( ) { return this . objects . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , files . size ( ) )
testIsReentrantReentrant ( ) { final org . osgi . framework . ServiceReference handlerReference = context . mock ( org . osgi . framework . ServiceReference . class , "handlerReference" ) ; context . checking ( new org . jmock . Expectations ( ) { { allowing ( handlerReference ) . getProperty ( EventConstants . EVENT_TOPIC ) ; will ( returnValue ( null ) ) ; allowing ( handlerReference ) . getProperty ( EventConstants . EVENT_FILTER ) ; will ( returnValue ( null ) ) ; allowing ( handlerReference ) . getProperty ( org . osgi . framework . Constants . SERVICE_ID ) ; will ( returnValue ( 20L ) ) ; allowing ( handlerReference ) . getProperty ( org . osgi . framework . Constants . SERVICE_RANKING ) ; will ( returnValue ( null ) ) ; allowing ( handlerReference ) . getProperty ( EventEngine . REENTRANT_HANDLER ) ; will ( returnValue ( "true" ) ) ; } } ) ; com . ibm . ws . event . internal . HandlerHolder holder = new com . ibm . ws . event . internal . HandlerHolder ( eventEngine , handlerReference , false ) ; "<AssertPlaceHolder>" ; } isReentrant ( ) { return reentrant ; }
org . junit . Assert . assertTrue ( holder . isReentrant ( ) )
callback_on_live_connection ( ) { class InitCount_ { public int count = 0 ; } InitCount_ init_count = new InitCount_ ( ) ; jmx_server . start ( ) ; try ( com . groupon . lex . metrics . jmx . JmxClient jmx_client = new com . groupon . lex . metrics . jmx . JmxClient ( jmx_server . url ) ) { jmx_client . getConnection ( threadpool ) . get ( ) ; jmx_client . addRecoveryCallback ( ( conn ) -> ++ init_count . count ) ; } "<AssertPlaceHolder>" ; } get ( ) { org . joda . time . DateTime result = now ; now = now . plus ( org . joda . time . Duration . standardSeconds ( interval_seconds ) ) ; return result ; }
org . junit . Assert . assertEquals ( 1 , init_count . count )
testOptionalWithoutLeft ( ) { java . lang . String query = "SELECT<sp>*\n" + ( ( "WHERE<sp>{\n" + "<sp>OPTIONAL<sp>{<sp><http://example.org/Individual1><sp>rdfs:label<sp>?l<sp>.<sp>}\n" ) + "}" ) ; int count = runQueryAndCount ( query ) ; "<AssertPlaceHolder>" ; } runQueryAndCount ( java . lang . String ) { org . eclipse . rdf4j . query . TupleQuery query = it . unibz . inf . ontop . rdf4j . repository . AbstractRDF4JTest . REPO_CONNECTION . prepareTupleQuery ( QueryLanguage . SPARQL , queryString ) ; org . eclipse . rdf4j . query . TupleQueryResult result = query . evaluate ( ) ; int count = 0 ; while ( result . hasNext ( ) ) { org . eclipse . rdf4j . query . BindingSet bindingSet = result . next ( ) ; it . unibz . inf . ontop . rdf4j . repository . AbstractRDF4JTest . LOGGER . debug ( ( bindingSet + "\n" ) ) ; count ++ ; } result . close ( ) ; return count ; }
org . junit . Assert . assertEquals ( 1 , count )
testNetgroupShell ( ) { org . apache . log4j . Logger . getRootLogger ( ) . setLevel ( org . apache . log4j . Level . DEBUG ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . set ( CommonConfigurationKeys . HADOOP_SECURITY_GROUP_MAPPING , "org.apache.hadoop.security.ShellBasedUnixGroupsNetgroupMapping" ) ; org . apache . hadoop . security . Groups groups = new org . apache . hadoop . security . Groups ( conf ) ; java . lang . String username = java . lang . System . getProperty ( "user.name" ) ; java . util . List < java . lang . String > groupList = groups . getGroups ( username ) ; org . apache . hadoop . security . TestGroupFallback . LOG . info ( ( ( username + "<sp>has<sp>GROUPS:<sp>" ) + ( groupList . toString ( ) ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return blocks . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( groupList . size ( ) ) > 0 ) )
testDate1 ( ) { long time = java . lang . System . currentTimeMillis ( ) ; java . util . Date convertedDate = _converter . convertType ( ExpandoColumnConstants . DATE , time ) ; "<AssertPlaceHolder>" ; } getTime ( ) { java . util . Calendar calendar = java . util . Calendar . getInstance ( ) ; calendar . set ( Calendar . YEAR , 1984 ) ; calendar . set ( Calendar . MONTH , Calendar . MARCH ) ; calendar . set ( Calendar . DAY_OF_MONTH , 9 ) ; calendar . set ( Calendar . HOUR_OF_DAY , 22 ) ; calendar . set ( Calendar . MINUTE , 40 ) ; calendar . set ( Calendar . SECOND , 0 ) ; calendar . set ( Calendar . MILLISECOND , 0 ) ; calendar . setTimeZone ( com . liferay . portal . kernel . util . TimeZoneUtil . getDefault ( ) ) ; return calendar . getTimeInMillis ( ) ; }
org . junit . Assert . assertEquals ( time , convertedDate . getTime ( ) )
testDeserializeProxy ( ) { java . util . List proxy = ( ( java . util . List ) ( java . lang . reflect . Proxy . newProxyInstance ( this . getClass ( ) . getClassLoader ( ) , org . apache . activemq . bugs . AMQ3537Test . TEST_CLASSES , this ) ) ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream oos = new java . io . ObjectOutputStream ( baos ) ; oos . writeObject ( proxy ) ; byte [ ] serializedProxy = baos . toByteArray ( ) ; oos . close ( ) ; baos . close ( ) ; org . apache . activemq . util . ClassLoadingAwareObjectInputStream claois = new org . apache . activemq . util . ClassLoadingAwareObjectInputStream ( new java . io . ByteArrayInputStream ( serializedProxy ) ) ; java . util . List deserializedProxy = ( ( java . util . List ) ( claois . readObject ( ) ) ) ; claois . close ( ) ; "<AssertPlaceHolder>" ; } get ( org . apache . activemq . command . ActiveMQDestination ) { if ( key . isComposite ( ) ) { org . apache . activemq . command . ActiveMQDestination [ ] destinations = key . getCompositeDestinations ( ) ; org . apache . activemq . security . Set answer = null ; for ( int i = 0 ; i < ( destinations . length ) ; i ++ ) { org . apache . activemq . command . ActiveMQDestination childDestination = destinations [ i ] ; answer = union ( answer , get ( childDestination ) ) ; if ( ( answer == null ) || ( answer . isEmpty ( ) ) ) { break ; } } return answer ; } return findWildcardMatches ( key , false ) ; }
org . junit . Assert . assertEquals ( "foo" , deserializedProxy . get ( 0 ) )
testSetCheckable_onVirtual_resolvesItem ( ) { grid = new org . eclipse . nebula . widgets . grid . Grid ( shell , org . eclipse . swt . SWT . VIRTUAL ) ; grid . setItemCount ( 1 ) ; org . eclipse . nebula . widgets . grid . GridItem item = grid . getItem ( 0 ) ; item . setCheckable ( 0 , true ) ; "<AssertPlaceHolder>" ; } isResolved ( ) { return parent . isVirtual ( ) ? ( data ) != null : true ; }
org . junit . Assert . assertTrue ( item . isResolved ( ) )
checkMessageMethod ( ) { java . lang . String str = "test" ; info . smart_tools . smartactors . testing . interfaces . itest_runner . exception . TestExecutionException exception = new info . smart_tools . smartactors . testing . interfaces . itest_runner . exception . TestExecutionException ( str ) ; "<AssertPlaceHolder>" ; throw exception ; } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( exception . getMessage ( ) , str )
test8 ( ) { nopol_examples . nopol_example_3 . NopolExample ex = new nopol_examples . nopol_example_3 . NopolExample ( ) ; "<AssertPlaceHolder>" ; } isOddNumber ( int ) { int tmp = ( a - 1 ) % 2 ; if ( tmp != 0 ) { return true ; } return false ; }
org . junit . Assert . assertTrue ( ( ! ( ex . isOddNumber ( ( 100 / 2 ) ) ) ) )
testGetTrustBundleById_exceptionInQuery_assertException ( ) { final javax . persistence . EntityManager manager = mock ( javax . persistence . EntityManager . class ) ; doThrow ( new java . lang . RuntimeException ( "Just<sp>Passing<sp>Through" ) ) . when ( manager ) . createQuery ( ( ( java . lang . String ) ( any ( ) ) ) ) ; final org . nhindirect . config . store . dao . impl . TrustBundleDaoImpl dao = new org . nhindirect . config . store . dao . impl . TrustBundleDaoImpl ( ) ; dao . setEntityManager ( manager ) ; boolean exceptionOccured = false ; try { dao . getTrustBundleById ( 1234 ) ; } catch ( org . nhindirect . config . store . ConfigurationStoreException ex ) { exceptionOccured = true ; } "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( exceptionOccured )
testBasicUpdateOfMessage ( ) { myValidatorManager . addRoot ( myShop , new com . rcpcompany . uibindings . validators . ConstraintValidatorAdapter ( ) ) ; myItem . setPrice ( 10.0F ) ; sleep ( ( 2 * ( com . rcpcompany . uibindings . internal . validators . ViewerBindingMessageCollectionTest . VD ) ) ) ; "<AssertPlaceHolder>" ; } getUnboundMessages ( ) { return myUnboundMessagesUnmodifiable ; }
org . junit . Assert . assertEquals ( 0 , myValidatorManager . getUnboundMessages ( ) . size ( ) )
testWithoutMetronome ( ) { com . hazelcast . simulator . worker . testcontainer . TestContainer_TimeStep_StartNanosTest . StartNanosTest testInstance = new com . hazelcast . simulator . worker . testcontainer . TestContainer_TimeStep_StartNanosTest . StartNanosTest ( ) ; com . hazelcast . simulator . common . TestCase testCase = new com . hazelcast . simulator . common . TestCase ( "test" ) . setProperty ( "iterations" , 10 ) . setProperty ( "threadCount" , 1 ) . setProperty ( "class" , testInstance . getClass ( ) ) ; com . hazelcast . simulator . worker . testcontainer . TestContextImpl testContext = new com . hazelcast . simulator . worker . testcontainer . TestContextImpl ( testCase . getId ( ) , "localhost" , mock ( com . hazelcast . simulator . protocol . Server . class ) ) ; com . hazelcast . simulator . worker . testcontainer . TestContainer container = new com . hazelcast . simulator . worker . testcontainer . TestContainer ( testContext , testInstance , testCase ) ; for ( com . hazelcast . simulator . common . TestPhase phase : com . hazelcast . simulator . common . TestPhase . values ( ) ) { container . invoke ( phase ) ; } java . util . List < java . lang . Long > startNanosList = testInstance . startNanosList ; "<AssertPlaceHolder>" ; } size ( ) { return testCaseList . size ( ) ; }
org . junit . Assert . assertEquals ( 10 , startNanosList . size ( ) )
testCreateSslContextJksStoreWithConfiguredContextProtocolOpenSSL ( ) { org . junit . Assume . assumeTrue ( io . netty . handler . ssl . OpenSsl . isAvailable ( ) ) ; org . junit . Assume . assumeTrue ( io . netty . handler . ssl . OpenSsl . supportsKeyManagerFactory ( ) ) ; org . apache . qpid . jms . transports . TransportOptions options = createJksSslOptions ( ) ; java . lang . String contextProtocol = "TLSv1.2" ; options . setContextProtocol ( contextProtocol ) ; io . netty . handler . ssl . SslContext context = org . apache . qpid . jms . transports . TransportSupport . createOpenSslContext ( options ) ; "<AssertPlaceHolder>" ; } createOpenSslContext ( org . apache . qpid . jms . transports . TransportOptions ) { try { java . lang . String contextProtocol = options . getContextProtocol ( ) ; org . apache . qpid . jms . transports . TransportSupport . LOG . trace ( "Getting<sp>SslContext<sp>instance<sp>using<sp>protocol:<sp>{}" , contextProtocol ) ; javax . net . ssl . KeyManagerFactory keyManagerFactory = org . apache . qpid . jms . transports . TransportSupport . loadKeyManagerFactory ( options , SslProvider . OPENSSL ) ; javax . net . ssl . TrustManagerFactory trustManagerFactory = org . apache . qpid . jms . transports . TransportSupport . loadTrustManagerFactory ( options ) ; io . netty . handler . ssl . SslContextBuilder builder = io . netty . handler . ssl . SslContextBuilder . forClient ( ) . sslProvider ( SslProvider . OPENSSL ) ; if ( options . getContextProtocol ( ) . equals ( TransportOptions . DEFAULT_CONTEXT_PROTOCOL ) ) { builder . protocols ( "TLSv1.2" ) ; } else { builder . protocols ( options . getContextProtocol ( ) ) ; } builder . keyManager ( keyManagerFactory ) ; builder . trustManager ( trustManagerFactory ) ; return builder . build ( ) ; } catch ( java . lang . Exception e ) { org . apache . qpid . jms . transports . TransportSupport . LOG . error ( "Failed<sp>to<sp>create<sp>SslContext:<sp>{}" , e , e ) ; throw e ; } }
org . junit . Assert . assertNotNull ( context )
testDoDestroy ( ) { control . bind ( session ) ; verify ( canvasHandler ) . addDomainObjectListener ( domainObjectListenerCaptor . capture ( ) ) ; control . doDestroy ( ) ; "<AssertPlaceHolder>" ; final org . kie . workbench . common . stunner . core . client . canvas . listener . CanvasDomainObjectListener domainObjectListener = domainObjectListenerCaptor . getValue ( ) ; verify ( canvasHandler ) . removeDomainObjectListener ( domainObjectListener ) ; } getExpressionEditor ( ) { return ( ( org . kie . workbench . common . dmn . client . editors . expressions . ExpressionEditorControl ) ( getSession ( ) . getCanvasControl ( org . kie . workbench . common . dmn . client . editors . expressions . ExpressionEditorControl . class ) ) ) . getExpressionEditor ( ) ; }
org . junit . Assert . assertNull ( control . getExpressionEditor ( ) )
testInitIncorrectAWSKeys ( ) { java . lang . String region = "us-west-2" ; java . lang . String awsAccessKey = "access-key" ; java . lang . String awsSecretKey = "secret-key" ; com . streamsets . pipeline . api . credential . CredentialStore . Context context = org . mockito . Mockito . mock ( CredentialStore . Context . class ) ; org . mockito . Mockito . when ( context . getConfig ( AWSSecretsManagerCredentialStore . AWS_REGION_PROP ) ) . thenReturn ( region ) ; org . mockito . Mockito . when ( context . getConfig ( AWSSecretsManagerCredentialStore . AWS_ACCESS_KEY_PROP ) ) . thenReturn ( awsAccessKey ) ; org . mockito . Mockito . when ( context . getConfig ( AWSSecretsManagerCredentialStore . AWS_SECRET_KEY_PROP ) ) . thenReturn ( awsSecretKey ) ; com . amazonaws . secretsmanager . caching . SecretCache secretCache = org . mockito . Mockito . mock ( com . amazonaws . secretsmanager . caching . SecretCache . class ) ; com . amazonaws . services . secretsmanager . model . AWSSecretsManagerException exception = new com . amazonaws . services . secretsmanager . model . AWSSecretsManagerException ( "message" ) ; com . streamsets . datacollector . credential . aws . secrets . manager . AWSSecretsManagerCredentialStore secretManager = createAWSSecretsManagerCredentialStore ( secretCache , exception ) ; java . util . List < com . streamsets . pipeline . api . credential . CredentialStore . ConfigIssue > issues = secretManager . init ( context ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( context , org . mockito . Mockito . times ( 1 ) ) . createConfigIssue ( Errors . AWS_SECRETS_MANAGER_CRED_STORE_01 , exception . getMessage ( ) , exception ) ; } size ( ) { return delegate . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , issues . size ( ) )
test ( ) { int [ ] nums = new int [ ] { 4 , 5 , 6 , 7 , 0 , 1 , 2 } ; int target = 0 ; "<AssertPlaceHolder>" ; } search ( int [ ] , int ) { int lo = 0 ; int hi = ( nums . length ) - 1 ; while ( lo < hi ) { int mid = ( lo + hi ) / 2 ; if ( ( nums [ mid ] ) == target ) { return mid ; } if ( ( nums [ lo ] ) <= ( nums [ mid ] ) ) { if ( ( target >= ( nums [ lo ] ) ) && ( target < ( nums [ mid ] ) ) ) { hi = mid - 1 ; } else { lo = mid + 1 ; } } else { if ( ( target > ( nums [ mid ] ) ) && ( target <= ( nums [ hi ] ) ) ) { lo = mid + 1 ; } else { hi = mid - 1 ; } } } return ( nums [ lo ] ) == target ? lo : - 1 ; }
org . junit . Assert . assertThat ( search ( nums , target ) , org . hamcrest . Matchers . is ( 4 ) )
javaHomePropertyWithDefaultValue ( ) { final org . jboss . msc . value . Value < java . lang . String > value = new org . jboss . msc . value . SystemPropertyValue ( "java.home" , new org . jboss . msc . value . ImmediateValue < java . lang . String > ( "default" ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return ( count ) ++ ; }
org . junit . Assert . assertSame ( java . lang . System . getProperty ( "java.home" ) , value . getValue ( ) )
basicDbTest ( ) { co . touchlab . squeaky . old . SimpleHelper helper = createHelper ( co . touchlab . squeaky . old . TypesTest . ManyTypes . class ) ; co . touchlab . squeaky . dao . Dao < co . touchlab . squeaky . old . TypesTest . ManyTypes > dao = helper . getDao ( co . touchlab . squeaky . old . TypesTest . ManyTypes . class ) ; co . touchlab . squeaky . old . TypesTest . ManyTypes manyTypes = new co . touchlab . squeaky . old . TypesTest . ManyTypes ( ) ; manyTypes . id = 1 ; manyTypes . b1 = true ; manyTypes . b2 = false ; manyTypes . by1 = 3 ; manyTypes . by2 = 5 ; manyTypes . d1 = 423.0 ; manyTypes . d2 = 6662.0 ; manyTypes . dateDefault = new java . util . Date ( ) ; manyTypes . dateLong = new java . util . Date ( ) ; manyTypes . dateYYMMDD = new java . util . Date ( ) ; manyTypes . f1 = 234.0F ; manyTypes . f2 = 6662.0F ; manyTypes . i1 = 48928374 ; manyTypes . i2 = 48418374 ; manyTypes . l1 = 8987189312L ; manyTypes . l2 = 18987189312L ; manyTypes . s1 = 31 ; manyTypes . s2 = 234 ; manyTypes . st1 = "Heyo<sp>lots<sp>of<sp>stuff" ; dao . create ( manyTypes ) ; java . util . List < co . touchlab . squeaky . old . TypesTest . ManyTypes > bs = dao . queryForAll ( ) . list ( ) ; "<AssertPlaceHolder>" ; helper . close ( ) ; } list ( ) { return makeCursorResults ( from , where , args , orderBy , limit , offset , ( ( foreignRefreshMap ) == null ? generateDefaultForeignRefreshMap ( ) : foreignRefreshMap ) ) ; }
org . junit . Assert . assertEquals ( manyTypes , bs . get ( 0 ) )
testInitThrowUnhandledException ( ) { org . camunda . bpm . engine . runtime . ProcessInstance instance = rule . processInstance ( ) ; org . camunda . bpm . engine . task . Task eventSubprocessTask = rule . taskQuery ( ) . taskDefinitionKey ( "eventSubProcessTask" ) . singleResult ( ) ; rule . getRuntimeService ( ) . setVariable ( instance . getId ( ) , ThrowBpmnErrorDelegate . EXCEPTION_INDICATOR_VARIABLE , true ) ; rule . getRuntimeService ( ) . setVariable ( instance . getId ( ) , ThrowBpmnErrorDelegate . EXCEPTION_MESSAGE_VARIABLE , "unhandledException" ) ; try { rule . getTaskService ( ) . complete ( eventSubprocessTask . getId ( ) ) ; org . junit . Assert . fail ( "should<sp>throw<sp>a<sp>ThrowBpmnErrorDelegateException" ) ; } catch ( org . camunda . bpm . qa . upgrade . util . ThrowBpmnErrorDelegate . ThrowBpmnErrorDelegateException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( "unhandledException" , e . getMessage ( ) )
should_remove_detach_entity ( ) { org . apache . deltaspike . data . test . domain . Simple simple = testData . createSimple ( "testeAttachAndRemove" ) ; repo . detach ( simple ) ; repo . attachAndRemove ( simple ) ; repo . flush ( ) ; org . apache . deltaspike . data . test . domain . Simple lookup = getEntityManager ( ) . find ( org . apache . deltaspike . data . test . domain . Simple . class , simple . getId ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return sessionId ; }
org . junit . Assert . assertNull ( lookup )
testHeapSizeForBlockIndex ( ) { java . lang . Class < org . apache . hadoop . hbase . io . hfile . HFileBlockIndex . BlockIndexReader > cl = org . apache . hadoop . hbase . io . hfile . HFileBlockIndex . BlockIndexReader . class ; long expected = org . apache . hadoop . hbase . util . ClassSize . estimateBase ( cl , false ) ; org . apache . hadoop . hbase . io . hfile . HFileBlockIndex . BlockIndexReader bi = new org . apache . hadoop . hbase . io . hfile . HFileBlockIndex . ByteArrayKeyBlockIndexReader ( 1 ) ; long actual = bi . heapSize ( ) ; expected -= org . apache . hadoop . hbase . util . ClassSize . align ( ( 2 * ( org . apache . hadoop . hbase . util . ClassSize . ARRAY ) ) ) ; if ( expected != actual ) { expected = org . apache . hadoop . hbase . util . ClassSize . estimateBase ( cl , true ) ; "<AssertPlaceHolder>" ; } } estimateBase ( java . lang . Class , boolean ) { return org . apache . hadoop . hbase . util . ClassSize . estimateBaseFromCoefficients ( org . apache . hadoop . hbase . util . ClassSize . getSizeCoefficients ( cl , debug ) , debug ) ; }
org . junit . Assert . assertEquals ( expected , actual )
serverConfig ( ) { org . jboss . hal . dmr . ResourceAddress input = new org . jboss . hal . dmr . ResourceAddress ( ) . add ( "host" , "*" ) . add ( "server-config" , "server-one" ) ; org . jboss . hal . dmr . ResourceAddress expected = new org . jboss . hal . dmr . ResourceAddress ( ) . add ( "host" , "*" ) . add ( "server-config" , "*" ) ; org . jboss . hal . dmr . ResourceAddress result = processor . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( org . jboss . hal . meta . AddressTemplate ) { org . jboss . hal . meta . AddressTemplate modified = org . jboss . hal . meta . AddressTemplate . ROOT ; if ( ( template != null ) && ( ! ( AddressTemplate . ROOT . equals ( template ) ) ) ) { java . util . List < java . lang . String [ ] > segments = stream ( template . spliterator ( ) , false ) . map ( ( segment ) -> { if ( segment . contains ( "=" ) ) { return com . google . common . base . Splitter . on ( '=' ) . omitEmptyStrings ( ) . trimResults ( ) . limit ( 2 ) . splitToList ( segment ) . toArray ( new java . lang . String [ 2 ] ) ; } return new java . lang . String [ ] { segment , null } ; } ) . collect ( toList ( ) ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; org . jboss . hal . meta . description . SegmentProcessor . process ( segments , ( segment ) -> { builder . append ( "/" ) . append ( segment [ 0 ] ) ; if ( ( segment [ 1 ] ) != null ) { builder . append ( "=" ) . append ( segment [ 1 ] ) ; } } ) ; modified = org . jboss . hal . meta . AddressTemplate . of ( builder . toString ( ) ) ; } org . jboss . hal . meta . description . ResourceDescriptionTemplateProcessor . logger . debug ( "{}<sp>-><sp>{}" , template , modified ) ; return modified ; }
org . junit . Assert . assertEquals ( expected , result )
returnsAnEmptyObjectArrayForZeroArityMethods ( ) { thereAreNoParameters ( ) ; java . lang . Object [ ] params = provider . getParametersFor ( doNothing , errors , null ) ; "<AssertPlaceHolder>" ; } getParametersFor ( br . com . caelum . vraptor . resource . ResourceMethod , java . util . List , java . util . ResourceBundle ) { br . com . caelum . iogi . parameters . Parameters parameters = parseParameters ( servletRequest ) ; java . util . List < br . com . caelum . iogi . reflection . Target < java . lang . Object > > targets = createTargets ( method ) ; java . util . List < java . lang . Object > arguments = instantiateParameters ( parameters , targets , errors ) ; return arguments . toArray ( ) ; }
org . junit . Assert . assertArrayEquals ( new java . lang . Object [ ] { } , params )
ReceiverMessageFromLinkSucceeds ( ) { com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpDeviceOperations amqpDeviceOperation = new com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpDeviceOperations ( ) ; mockit . Deencapsulation . setField ( amqpDeviceOperation , "receiverLink" , mockedReceiverLink ) ; new mockit . NonStrictExpectations ( ) { { mockedReceiverLink . current ( ) ; result = mockedDelivery ; mockedDelivery . isReadable ( ) ; result = true ; mockedDelivery . pending ( ) ; result = 10 ; mockedReceiverLink . recv ( ( ( byte [ ] ) ( any ) ) , 0 , anyInt ) ; mockedReceiverLink . advance ( ) ; mockedAmqpMessage . decode ( ( ( byte [ ] ) ( any ) ) , 0 , anyInt ) ; } } ; com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpMessage result = amqpDeviceOperation . receiverMessageFromLink ( tests . unit . com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpDeviceOperationsTest . TEST_RECEIVER_LINK_NAME ) ; "<AssertPlaceHolder>" ; } receiverMessageFromLink ( java . lang . String ) { com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpMessage result ; if ( ( linkName == null ) || ( linkName . isEmpty ( ) ) ) { result = null ; } else if ( ( this . receiverLink ) == null ) { result = null ; } else { com . microsoft . azure . sdk . iot . deps . transport . amqp . Delivery delivery = this . receiverLink . current ( ) ; if ( ( ( ( linkName . equals ( this . receiverLinkTag ) ) && ( delivery != null ) ) && ( delivery . isReadable ( ) ) ) && ( ! ( delivery . isPartial ( ) ) ) ) { int size = delivery . pending ( ) ; byte [ ] buffer = new byte [ size ] ; int read = this . receiverLink . recv ( buffer , 0 , buffer . length ) ; this . receiverLink . advance ( ) ; result = new com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpMessage ( ) ; result . decode ( buffer , 0 , read ) ; } else { result = null ; } } return result ; }
org . junit . Assert . assertNotNull ( result )
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . friendly . url . model . FriendlyURLEntryMapping missingFriendlyURLEntryMapping = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
org . junit . Assert . assertNull ( missingFriendlyURLEntryMapping )
testSizeOfPedigree ( ) { int n = jannovar . pedigree . PedigreeARTest . pedigree . getNumberOfIndividualsInPedigree ( ) ; "<AssertPlaceHolder>" ; } getNumberOfIndividualsInPedigree ( ) { if ( isSingleSample ) return 1 ; else return this . personList . size ( ) ; }
org . junit . Assert . assertEquals ( 6 , n )
testLoadStructureFromURL ( ) { java . lang . String path = new org . biojava . nbio . structure . align . util . UserConfiguration ( ) . getCacheFilePath ( ) ; java . io . File f = new java . io . File ( path , "TEST<sp>DIR" ) ; f . deleteOnExit ( ) ; if ( ! ( f . exists ( ) ) ) { System . out . println ( ( "making<sp>dir<sp>with<sp>space:" + f ) ) ; f . mkdir ( ) ; } org . biojava . nbio . structure . align . util . AtomCache c = new org . biojava . nbio . structure . align . util . AtomCache ( f . toString ( ) , f . toString ( ) ) ; c . setUseMmCif ( false ) ; c . setUseMmtf ( false ) ; c . getStructure ( "1znf" ) ; java . io . File subdir = f ; for ( java . lang . String dir : org . biojava . nbio . structure . io . PDBFileReader . PDB_SPLIT_DIR ) { subdir = new java . io . File ( subdir , dir ) ; subdir . deleteOnExit ( ) ; } subdir = new java . io . File ( subdir , "zn" ) ; java . io . File newFile = new java . io . File ( subdir , "pdb1znf.ent.gz" ) ; subdir . deleteOnExit ( ) ; newFile . deleteOnExit ( ) ; java . net . URL u = newFile . toURI ( ) . toURL ( ) ; org . biojava . nbio . structure . Structure s = c . getStructure ( ( ( u . toString ( ) ) + "?args=test" ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "Job<sp>fetching<sp>ECOD<sp>" + ecodId ; }
org . junit . Assert . assertNotNull ( s )
shouldReturnFalseAndAddErrorForEntityWhenOrderedProductAlreadyExists ( ) { when ( searchCriteriaBuilder . uniqueResult ( ) ) . thenReturn ( delivery ) ; when ( orderedProductDD . getField ( com . qcadoo . mes . deliveries . hooks . PRODUCT ) ) . thenReturn ( productField ) ; boolean result = orderedProductHooks . checkIfOrderedProductAlreadyExists ( orderedProductDD , orderedProduct ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( orderedProduct ) . addError ( productField , "deliveries.orderedProduct.error.productAlreadyExists" ) ; } checkIfOrderedProductAlreadyExists ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { com . qcadoo . model . api . search . SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD . find ( ) . add ( com . qcadoo . model . api . search . SearchRestrictions . belongsTo ( OrderedProductFields . DELIVERY , orderedProduct . getBelongsToField ( OrderedProductFields . DELIVERY ) ) ) . add ( com . qcadoo . model . api . search . SearchRestrictions . belongsTo ( OrderedProductFields . PRODUCT , orderedProduct . getBelongsToField ( OrderedProductFields . PRODUCT ) ) ) . add ( com . qcadoo . model . api . search . SearchRestrictions . belongsTo ( OrderedProductFields . ADDITIONAL_CODE , orderedProduct . getBelongsToField ( OrderedProductFields . ADDITIONAL_CODE ) ) ) ; if ( com . qcadoo . plugin . api . PluginUtils . isEnabled ( "techSubcontrForDeliveries" ) ) { searchCriteriaBuilder . add ( com . qcadoo . model . api . search . SearchRestrictions . belongsTo ( com . qcadoo . mes . deliveries . hooks . OrderedProductHooks . OPERATION , orderedProduct . getBelongsToField ( com . qcadoo . mes . deliveries . hooks . OrderedProductHooks . OPERATION ) ) ) ; } if ( com . qcadoo . plugin . api . PluginUtils . isEnabled ( "supplyNegotiations" ) ) { searchCriteriaBuilder . add ( com . qcadoo . model . api . search . SearchRestrictions . belongsTo ( com . qcadoo . mes . deliveries . hooks . OrderedProductHooks . OFFER , orderedProduct . getBelongsToField ( com . qcadoo . mes . deliveries . hooks . OrderedProductHooks . OFFER ) ) ) ; } if ( ( orderedProduct . getId ( ) ) != null ) { searchCriteriaBuilder . add ( com . qcadoo . model . api . search . SearchRestrictions . ne ( "id" , orderedProduct . getId ( ) ) ) ; } com . qcadoo . model . api . Entity orderedProductFromDB = searchCriteriaBuilder . setMaxResults ( 1 ) . uniqueResult ( ) ; if ( orderedProductFromDB == null ) { return true ; } else { orderedProduct . addError ( orderedProductDD . getField ( OrderedProductFields . PRODUCT ) , "deliveries.orderedProduct.error.productAlreadyExists" ) ; return false ; } }
org . junit . Assert . assertFalse ( result )
testMultipleEntitiesPerIndex ( ) { try ( org . hibernate . Session s = openSession ( ) ) { s . getTransaction ( ) . begin ( ) ; NotPackagedEntity box = new NotPackagedEntity ( ) ; box . title = "This<sp>feels<sp>dirty" ; s . persist ( box ) ; s . getTransaction ( ) . commit ( ) ; } try ( org . hibernate . Session s = openSession ( ) ) { s . getTransaction ( ) . begin ( ) ; org . apache . lucene . search . TermQuery q = new org . apache . lucene . search . TermQuery ( new org . apache . lucene . index . Term ( "title" , "dirty" ) ) ; java . util . List results = org . hibernate . search . Search . getFullTextSession ( s ) . createFullTextQuery ( q , NotPackagedEntity . class ) . list ( ) ; "<AssertPlaceHolder>" ; } } size ( ) { return size ; }
org . junit . Assert . assertEquals ( 1 , results . size ( ) )
processOptionsNoExpression ( ) { org . apache . hadoop . fs . shell . find . Find find = new org . apache . hadoop . fs . shell . find . Find ( ) ; find . setConf ( org . apache . hadoop . fs . shell . find . TestFind . conf ) ; java . lang . String args = "path" ; java . lang . String expected = "Print(;)" ; find . processOptions ( getArgs ( args ) ) ; org . apache . hadoop . fs . shell . find . Expression expression = find . getRootExpression ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( ( json ) == null ) { return "Test<sp>codec<sp>" + ( id ) ; } else { return json . toString ( ) ; } }
org . junit . Assert . assertEquals ( expected , expression . toString ( ) )
testContainsClass ( ) { org . apache . commons . math4 . util . NumberTransformer expected = new org . apache . commons . math4 . util . DefaultTransformer ( ) ; org . apache . commons . math4 . util . TransformerMap map = new org . apache . commons . math4 . util . TransformerMap ( ) ; map . putTransformer ( org . apache . commons . math4 . util . TransformerMapTest . class , expected ) ; "<AssertPlaceHolder>" ; } containsClass ( java . lang . Class ) { return map . containsKey ( key ) ; }
org . junit . Assert . assertTrue ( map . containsClass ( org . apache . commons . math4 . util . TransformerMapTest . class ) )
testGetAdvancesPosition ( ) { assert ( buffer . position ( ) ) < ( buffer . limit ( ) ) ; int oldPos = buffer . position ( ) ; buffer . get ( ) ; "<AssertPlaceHolder>" ; } position ( ) { return position ; }
org . junit . Assert . assertEquals ( buffer . position ( ) , ( oldPos + 1 ) )
testExonOverlapStartDuplicatedOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t59004875\t.\tN\t<CNV>\t.\t.\tSVTYPE=CNV;END=59005052" ) ; final java . lang . String expected = "1\t59004875\t.\tN\t<CNV>\t.\t.\tEND=59005052;" + ( "SVANN=copy_number_change&structural_variant&coding_transcript_variant|HIGH|OMA1|115209|transcript|NM_145243.3|Coding|;" + "SVTYPE=CNV" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
filterAttributesToGetReturnsItemWhenAttributesToGetIsNull ( ) { java . util . Map < java . lang . String , com . amazonaws . services . dynamodbv2 . model . AttributeValue > result = isolationHandler . filterAttributesToGet ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . UNLOCKED_ITEM , null ) ; "<AssertPlaceHolder>" ; } filterAttributesToGet ( java . util . Map , java . util . List ) { if ( item == null ) { return null ; } if ( ( attributesToGet == null ) || ( attributesToGet . isEmpty ( ) ) ) { return item ; } java . util . Map < java . lang . String , com . amazonaws . services . dynamodbv2 . model . AttributeValue > result = new java . util . HashMap < java . lang . String , com . amazonaws . services . dynamodbv2 . model . AttributeValue > ( ) ; for ( java . lang . String attributeName : attributesToGet ) { com . amazonaws . services . dynamodbv2 . model . AttributeValue value = item . get ( attributeName ) ; if ( value != null ) { result . put ( attributeName , value ) ; } } return result ; }
org . junit . Assert . assertEquals ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . UNLOCKED_ITEM , result )
testSerialization ( ) { org . jfree . chart . renderer . category . MinMaxCategoryRenderer r1 = new org . jfree . chart . renderer . category . MinMaxCategoryRenderer ( ) ; org . jfree . chart . renderer . category . MinMaxCategoryRenderer r2 = ( ( org . jfree . chart . renderer . category . MinMaxCategoryRenderer ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( r1 , r2 )
testFullSubjectRateShouldBeDefined ( ) { org . drugis . addis . entities . RateMeasurement base = new org . drugis . addis . entities . BasicRateMeasurement ( 50 , 100 ) ; org . drugis . addis . entities . RateMeasurement subj = new org . drugis . addis . entities . BasicRateMeasurement ( 100 , 100 ) ; org . drugis . addis . entities . relativeeffect . BasicRiskRatio or = new org . drugis . addis . entities . relativeeffect . BasicRiskRatio ( base , subj ) ; "<AssertPlaceHolder>" ; } isDefined ( ) { return ( ( super . isDefined ( ) ) && ( isAdmissible ( d_subject ) ) ) && ( isAdmissible ( d_baseline ) ) ; }
org . junit . Assert . assertTrue ( or . isDefined ( ) )
theMostRecentPrevails ( ) { turin . context . ContextTest . MyContext ctx = new turin . context . ContextTest . MyContext ( ) ; ctx . enterContext ( "a" ) ; ctx . enterContext ( "b" ) ; ctx . enterContext ( "c" ) ; "<AssertPlaceHolder>" ; } get ( ) { java . util . Stack < V > ctx = values . get ( ) ; if ( ctx . isEmpty ( ) ) { return java . util . Optional . empty ( ) ; } else { return java . util . Optional . of ( ctx . get ( ( ( ctx . size ( ) ) - 1 ) ) ) ; } }
org . junit . Assert . assertEquals ( java . util . Optional . of ( "c" ) , ctx . get ( ) )
testSetAttached_Set_To_False ( ) { mmarquee . automation . controls . AutomationApplication app = new mmarquee . automation . controls . AutomationApplication ( new mmarquee . automation . controls . ElementBuilder ( element ) . handle ( handle ) . attached ( false ) . automation ( instance ) ) ; "<AssertPlaceHolder>" ; } getIsAttached ( ) { return this . isAttached ; }
org . junit . Assert . assertFalse ( app . getIsAttached ( ) )
shouldPongServerPingFrameWithPayload ( ) { final org . apache . mina . core . service . IoHandler handler = context . mock ( org . apache . mina . core . service . IoHandler . class ) ; context . checking ( new org . kaazing . gateway . transport . test . Expectations ( ) { { oneOf ( handler ) . sessionCreated ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; oneOf ( handler ) . sessionOpened ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; oneOf ( handler ) . sessionClosed ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; atMost ( 1 ) . of ( handler ) . exceptionCaught ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) , with ( org . hamcrest . core . AllOf . allOf ( any ( java . io . IOException . class ) , org . junit . internal . matchers . ThrowableMessageMatcher . hasMessage ( equal ( LoggingUtils . EARLY_TERMINATION_OF_IOSESSION_MESSAGE ) ) ) ) ) ; } } ) ; org . apache . mina . core . future . ConnectFuture connectFuture = connector . connect ( "ws://localhost:8080/echo" , null , handler ) ; connectFuture . awaitUninterruptibly ( ) ; "<AssertPlaceHolder>" ; k3po . finish ( ) ; } isConnected ( ) { return channel . isConnected ( ) ; }
org . junit . Assert . assertTrue ( connectFuture . isConnected ( ) )
testFileFormatV2postFLUME1432 ( ) { org . apache . flume . channel . file . TestUtils . TestUtils . copyDecompressed ( "2686" 0 , new java . io . File ( checkpointDir , "2686" 1 ) ) ; for ( int i = 0 ; i < ( dataDirs . length ) ; i ++ ) { int fileIndex = i + 1 ; org . apache . flume . channel . file . TestUtils . TestUtils . copyDecompressed ( ( ( "fileformat-v2-log-" + fileIndex ) + "2686" 2 ) , new java . io . File ( dataDirs [ i ] , ( "log-" + fileIndex ) ) ) ; } java . util . Map < java . lang . String , java . lang . String > overrides = com . google . common . collect . Maps . newHashMap ( ) ; overrides . put ( FileChannelConfiguration . CAPACITY , java . lang . String . valueOf ( 10 ) ) ; overrides . put ( FileChannelConfiguration . TRANSACTION_CAPACITY , java . lang . String . valueOf ( 10 ) ) ; channel = createFileChannel ( overrides ) ; channel . start ( ) ; "<AssertPlaceHolder>" ; java . util . Set < java . lang . String > events = takeEvents ( channel , 1 ) ; java . util . Set < java . lang . String > expected = new java . util . HashSet < java . lang . String > ( ) ; expected . addAll ( java . util . Arrays . asList ( new java . lang . String [ ] { "2684" , "2685" , "2686" , "2687" , "2688" , "2689" , "2690" , "2691" } ) ) ; compareInputAndOut ( expected , events ) ; } isOpen ( ) { return open ; }
org . junit . Assert . assertTrue ( channel . isOpen ( ) )
testParseNegativeAll ( ) { java . lang . String source = ( ( ( "{-1" + ( getDecimalCharacter ( ) ) ) + "2323;<sp>-1" ) + ( getDecimalCharacter ( ) ) ) + "4343}" ; org . apache . commons . math3 . geometry . euclidean . twod . Vector2D expected = new org . apache . commons . math3 . geometry . euclidean . twod . Vector2D ( ( - 1.2323 ) , ( - 1.4343 ) ) ; org . apache . commons . math3 . geometry . euclidean . twod . Vector2D actual = vector2DFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( com . google . javascript . jscomp . AbstractCompiler ) { try { com . google . javascript . jscomp . JsAst . logger_ . fine ( ( "Parsing:<sp>" + ( sourceFile . getName ( ) ) ) ) ; com . google . javascript . jscomp . parsing . ParserRunner . ParseResult result = com . google . javascript . jscomp . parsing . ParserRunner . parse ( sourceFile , sourceFile . getCode ( ) , compiler . getParserConfig ( ) , compiler . getDefaultErrorReporter ( ) , com . google . javascript . jscomp . JsAst . logger_ ) ; root = result . ast ; compiler . setOldParseTree ( sourceFile . getName ( ) , result . oldAst ) ; } catch ( java . io . IOException e ) { compiler . report ( com . google . javascript . jscomp . JSError . make ( AbstractCompiler . READ_ERROR , sourceFile . getName ( ) ) ) ; } if ( ( ( root ) == null ) || ( compiler . hasHaltingErrors ( ) ) ) { root = com . google . javascript . rhino . IR . script ( ) ; } else { compiler . prepareAst ( root ) ; } root . setStaticSourceFile ( sourceFile ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testNodebellyMessageDetailsDeserializationTest ( ) { com . streamreduce . core . model . messages . details . SobaMessageDetails details = new com . streamreduce . core . model . messages . details . nodebelly . NodebellyMessageDetails . Builder ( ) . structure ( new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) . title ( "nodebelly<sp>message,<sp>y'all" ) . details ( "anomaly<sp>detected,<sp>y'all" ) . build ( ) ; com . streamreduce . core . model . messages . details . SobaMessageDetailsTest . Container expected = new com . streamreduce . core . model . messages . details . SobaMessageDetailsTest . Container ( details ) ; java . lang . String json = com . streamreduce . core . model . messages . details . SobaMessageDetailsTest . objectMapper . writeValueAsString ( expected ) ; com . streamreduce . core . model . messages . details . SobaMessageDetailsTest . Container actual = com . streamreduce . core . model . messages . details . SobaMessageDetailsTest . objectMapper . readValue ( json , com . streamreduce . core . model . messages . details . SobaMessageDetailsTest . Container . class ) ; "<AssertPlaceHolder>" ; } build ( ) { return details ; }
org . junit . Assert . assertEquals ( expected , actual )
passesStaticFieldToSuperClassConstructor ( ) { org . teavm . vm . VMTest . SubClass obj = new org . teavm . vm . VMTest . SubClass ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertNotNull ( obj . getValue ( ) )
searchTest4 ( ) { java . lang . String input = "b" ; org . json . JSONArray resultsArray = new org . json . JSONArray ( ) ; org . json . JSONObject expectedResult = new org . json . JSONObject ( ) ; expectedResult . put ( "matched" , resultsArray ) ; java . lang . String searchResult = this . mocker . getComponentUnderTest ( ) . search ( input , 10 , false , false , true ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( getId ( ) ) + "[" ) + ( getType ( ) . getName ( ) ) ) + "]" ; }
org . junit . Assert . assertEquals ( expectedResult . toString ( ) , searchResult )
testMoveConcurrentWithGetChildrenRefs ( ) { org . junit . Assume . assumeTrue ( "VCS<sp>read-committed<sp>semantics<sp>cannot<sp>enforce<sp>this" , isDBS ( ) ) ; prepareDocsForMoveConcurrentWithGetChildren ( ) ; java . util . List < org . nuxeo . ecm . core . api . DocumentRef > children = session . getChildrenRefs ( new org . nuxeo . ecm . core . api . PathRef ( "/folder" ) , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return getCollectedDocumentIds ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , children . size ( ) )
should_get_empty_map_for_properties ( ) { java . util . Map < java . lang . String , java . lang . String > properties = plugin . getPropertiesWithDefaultValue ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return false ; }
org . junit . Assert . assertTrue ( properties . isEmpty ( ) )
inspectImageNoImageLinkTest ( ) { final java . lang . Object [ ] errors = new java . lang . Object [ ] { null } ; com . vmware . admiral . closures . services . closure . Closure closure = new com . vmware . admiral . closures . services . closure . Closure ( ) ; dockerDriver . inspectImage ( "test_image" , null , ( error ) -> errors [ 0 ] = error ) ; "<AssertPlaceHolder>" ; } inspectImage ( java . lang . String , java . lang . String , java . util . function . Consumer ) { logInfo ( "Sending<sp>docker<sp>image<sp>inspect<sp>request<sp>for<sp>image:<sp>%s<sp>on<sp>host:<sp>%s" , imageName , computeStateLink ) ; com . vmware . admiral . adapter . docker . service . DockerImageHostRequest request = new com . vmware . admiral . adapter . docker . service . DockerImageHostRequest ( ) ; request . operationTypeId = ImageOperationType . INSPECT . id ; java . lang . String completionServiceCallBack = createImageBuildRequestUri ( imageName , computeStateLink ) ; request . serviceTaskCallback = com . vmware . admiral . service . common . ServiceTaskCallback . create ( completionServiceCallBack ) ; request . resourceReference = com . vmware . xenon . common . UriUtils . buildUri ( getHost ( ) , computeStateLink ) ; request . customProperties = new java . util . HashMap ( ) ; request . customProperties . putIfAbsent ( DockerAdapterCommandExecutor . DOCKER_BUILD_IMAGE_INSPECT_NAME_PROP_NAME , imageName ) ; getHost ( ) . sendRequest ( com . vmware . xenon . common . Operation . createPatch ( getHost ( ) , DockerHostAdapterImageService . SELF_LINK ) . setBody ( request ) . setReferer ( getHost ( ) . getUri ( ) ) . setCompletion ( ( o , ex ) -> { if ( ex != null ) { logError ( "Unable<sp>to<sp>inspect<sp>image<sp>on<sp>docker<sp>host:<sp>%s" , com . vmware . xenon . common . Utils . toString ( ex ) ) ; errorHandler . accept ( ex ) ; return ; } logInfo ( "Docker<sp>inspect<sp>image<sp>request<sp>sent.<sp>Image:<sp>%s,<sp>host:<sp>%s" , imageName , computeStateLink ) ; } ) ) ; }
org . junit . Assert . assertNotNull ( errors [ 0 ] )
testRightLongInteger ( ) { long expected = 5 ; long actual = cFunction . right ( 10L , 1 ) ; "<AssertPlaceHolder>" ; } right ( java . lang . Integer , java . lang . Long ) { return l1 > > l2 ; }
org . junit . Assert . assertEquals ( expected , actual )
whenADateFallsOnAWorkingDayItShouldBeAdjustedToSameDay ( ) { org . joda . time . DateTime firstOfNextMonth = new org . joda . time . DateTime ( ) . plusMonths ( 1 ) . withDayOfMonth ( 1 ) . toDateMidnight ( ) . toDateTime ( ) ; org . joda . time . DateTime firstTuesdayOfNextMonth = firstOfNextMonth . withDayOfWeek ( org . mifos . calendar . DayOfWeek . tuesday ( ) ) ; org . joda . time . DateTime adjustedDate = workingDayStrategy . adjust ( firstTuesdayOfNextMonth ) ; "<AssertPlaceHolder>" ; } adjust ( org . joda . time . DateTime ) { org . joda . time . DateTime ajustedDate = startingFrom ; if ( org . mifos . calendar . WorkingDay . isNotWorkingDay ( startingFrom , workingDays ) ) { ajustedDate = org . mifos . calendar . WorkingDay . nextWorkingDay ( startingFrom , workingDays ) ; } return ajustedDate ; }
org . junit . Assert . assertThat ( adjustedDate , org . hamcrest . CoreMatchers . is ( firstTuesdayOfNextMonth ) )
testCompareToWithSuperiorMinorVersion ( ) { org . tibennetwork . iarcade . mame . MameVersion version1 = new org . tibennetwork . iarcade . mame . MameVersion ( "0.78" ) ; org . tibennetwork . iarcade . mame . MameVersion version2 = new org . tibennetwork . iarcade . mame . MameVersion ( "0.149" ) ; "<AssertPlaceHolder>" ; } compareTo ( org . tibennetwork . iarcade . mame . MameVersion ) { if ( ( major ) == ( version . getMajor ( ) ) ) { return ( minor ) - ( version . getMinor ( ) ) ; } return ( major ) - ( version . getMajor ( ) ) ; }
org . junit . Assert . assertTrue ( ( ( version1 . compareTo ( version2 ) ) < 0 ) )
testSelectSubtractBaseTable ( ) { org . verdictdb . core . sqlobject . BaseTable base = new org . verdictdb . core . sqlobject . BaseTable ( "myschema" , "mytable" , "t" ) ; java . util . List < org . verdictdb . core . sqlobject . UnnamedColumn > operands = java . util . Arrays . < org . verdictdb . core . sqlobject . UnnamedColumn > asList ( new org . verdictdb . core . sqlobject . BaseColumn ( "t" , "mycolumn1" ) , new org . verdictdb . core . sqlobject . BaseColumn ( "t" , "mycolumn2" ) ) ; org . verdictdb . core . sqlobject . SelectQuery relation = org . verdictdb . core . sqlobject . SelectQuery . create ( java . util . Arrays . < org . verdictdb . core . sqlobject . SelectItem > asList ( new org . verdictdb . core . sqlobject . ColumnOp ( "subtract" , operands ) ) , base ) ; java . lang . String expected = "select<sp>t.`mycolumn1`<sp>-<sp>t.`mycolumn2`<sp>from<sp>`myschema`.`mytable`<sp>as<sp>t" ; org . verdictdb . sqlwriter . SelectQueryToSql relToSql = new org . verdictdb . sqlwriter . SelectQueryToSql ( new org . verdictdb . sqlsyntax . HiveSyntax ( ) ) ; java . lang . String actual = relToSql . toSql ( relation ) ; "<AssertPlaceHolder>" ; } toSql ( org . verdictdb . core . sqlobject . InsertValuesQuery ) { java . lang . StringBuilder sql = new java . lang . StringBuilder ( ) ; java . lang . String schemaName = query . getSchemaName ( ) ; java . lang . String tableName = query . getTableName ( ) ; java . util . List < java . lang . Object > values = query . getValues ( ) ; sql . append ( "insert<sp>into<sp>" ) ; sql . append ( quoteName ( schemaName ) ) ; sql . append ( "." ) ; sql . append ( quoteName ( tableName ) ) ; sql . append ( "<sp>values<sp>(" ) ; boolean isFirst = true ; for ( java . lang . Object v : values ) { if ( isFirst == false ) { sql . append ( ",<sp>" ) ; } if ( v instanceof org . verdictdb . commons . VerdictTimestamp ) { if ( ( syntax ) instanceof org . verdictdb . sqlsyntax . PrestoSyntax ) { sql . append ( ( ( "timestamp<sp>'" + ( v . toString ( ) ) ) + "'" ) ) ; } else { sql . append ( ( ( "'" + ( v . toString ( ) ) ) + "'" ) ) ; } } else if ( v instanceof java . lang . String ) { sql . append ( ( ( "'" + v ) + "'" ) ) ; } else { sql . append ( v . toString ( ) ) ; } isFirst = false ; } sql . append ( ")" ) ; return sql . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testSerialization ( ) { org . jfree . chart . renderer . xy . XYBlockRenderer r1 = new org . jfree . chart . renderer . xy . XYBlockRenderer ( ) ; org . jfree . chart . renderer . xy . XYBlockRenderer r2 = ( ( org . jfree . chart . renderer . xy . XYBlockRenderer ) ( org . jfree . chart . TestUtilities . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( r1 , r2 )
testMapToPair ( ) { org . nd4j . linalg . function . Map < java . lang . String , java . lang . String > map = new org . nd4j . linalg . function . HashMap ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { map . put ( java . lang . String . valueOf ( i ) , java . lang . String . valueOf ( i ) ) ; } org . nd4j . linalg . function . List < org . nd4j . linalg . primitives . Pair < java . lang . String , java . lang . String > > pairs = org . nd4j . linalg . function . FunctionalUtils . mapToPair ( map ) ; "<AssertPlaceHolder>" ; } size ( ) { return objects . size ( ) ; }
org . junit . Assert . assertEquals ( map . size ( ) , pairs . size ( ) )
testNullServerVariables ( ) { com . ibm . ws . microprofile . openapi . impl . validation . ServerVariablesValidator validator = com . ibm . ws . microprofile . openapi . impl . validation . ServerVariablesValidator . getInstance ( ) ; com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper vh = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper ( ) ; com . ibm . ws . microprofile . openapi . impl . model . servers . ServerVariablesImpl serverVariables = null ; validator . validate ( vh , context , serverVariables ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , vh . getEventsSize ( ) )
testValidConfiguration ( ) { java . lang . String conf = "<configuration>\n" + ( ( ( ( "<property>\n" + "<name>foo</name>\n" ) + "<value>bar</value>\n" ) + "</property>\n" ) + "</configuration>" ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( conf . getBytes ( ) ) ; java . util . List < java . lang . String > errors = org . apache . hadoop . util . ConfTest . checkConf ( bais ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return addrs . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( errors . isEmpty ( ) )
isNullOrEmptyInputNull_called_with_null ( ) { java . lang . String value = null ; java . lang . Boolean expResult = true ; java . lang . Boolean result = com . microsoft . azure . sdk . iot . provisioning . service . Tools . isNullOrEmpty ( value ) ; "<AssertPlaceHolder>" ; } isNullOrEmpty ( java . lang . String ) { java . lang . Boolean retVal ; if ( value == null ) retVal = true ; else retVal = ( value . length ( ) ) == 0 ; return retVal ; }
org . junit . Assert . assertEquals ( expResult , result )
testFutureEntryDate ( ) { java . util . Map < java . lang . String , java . util . List < java . lang . String > > lineages = com . google . common . collect . ImmutableMap . of ( "school1" , java . util . Arrays . asList ( "school1" ) , "school2" , java . util . Arrays . asList ( "school2" , "Proudhon" , "Kropotkin" ) , "school3" , java . util . Arrays . asList ( "school3" , "Proudhon" , "Bakunin" , "Kropotkin" ) ) ; org . mockito . Mockito . when ( edOrgExtractHelper . getEdOrgLineages ( ) ) . thenReturn ( lineages ) ; helper . setDateHelper ( new org . slc . sli . common . util . datetime . DateHelper ( ) ) ; java . util . Map < java . lang . String , java . util . List < java . util . Map < java . lang . String , java . lang . Object > > > denormalized = new java . util . HashMap < java . lang . String , java . util . List < java . util . Map < java . lang . String , java . lang . Object > > > ( ) ; java . util . Map < java . lang . String , java . lang . Object > school1 = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; school1 . put ( ParameterConstants . ENTRY_DATE , "Bakunin" 0 ) ; school1 . put ( "_id" , "school1" ) ; java . util . Map < java . lang . String , java . lang . Object > school2 = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; school2 . put ( ParameterConstants . ENTRY_DATE , "3000-05-01" ) ; school2 . put ( ParameterConstants . EXIT_WITHDRAW_DATE , "3001-05-09" ) ; school2 . put ( "_id" , "school2" ) ; denormalized . put ( "schools" , java . util . Arrays . asList ( school1 , school2 ) ) ; org . slc . sli . domain . Entity student = org . mockito . Mockito . mock ( org . slc . sli . domain . Entity . class ) ; org . mockito . Mockito . when ( student . getDenormalizedData ( ) ) . thenReturn ( denormalized ) ; java . util . Map < java . lang . String , org . joda . time . DateTime > result = helper . fetchAllEdOrgsForStudent ( student ) ; "<AssertPlaceHolder>" ; } size ( ) { return config . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )