input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testIsAlive1 ( ) { org . nd4j . jita . allocator . time . impl . BinaryTimer timer = new org . nd4j . jita . allocator . time . impl . BinaryTimer ( 2 , java . util . concurrent . TimeUnit . SECONDS ) ; timer . triggerEvent ( ) ; "<AssertPlaceHolder>" ; } isAlive ( ) { long currentTime = java . lang . System . currentTimeMillis ( ) ; if ( ( currentTime - ( timer . get ( ) ) ) > ( timeframeMilliseconds ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( timer . isAlive ( ) )
reconstructFormattingElementsInTable ( ) { java . lang . String h = "<p><b>One</p><sp><table><tr><td><p><i>Three<p>Four</i></td></tr></table><sp><p>Five</p>" ; leap . lang . jsoup . parser . Document doc = leap . lang . jsoup . Jsoup . parse ( h ) ; java . lang . String want = "<p><b>One</b></p>\n" + ( ( ( ( ( ( ( "<b><sp>\n" + "<sp><table>\n" ) + "<sp><tbody>\n" ) + "<sp><tr>\n" ) + "<sp><td><p><i>Three</i></p><p><i>Four</i></p></td>\n" ) + "<sp></tr>\n" ) + "<sp></tbody>\n" ) + "<sp></table><sp><p>Five</p></b>" ) ; "<AssertPlaceHolder>" ; } body ( ) { leap . lang . jsoup . helper . Validate . isTrue ( executed , "Request<sp>must<sp>be<sp>executed<sp>(with<sp>.execute(),<sp>.get(),<sp>or<sp>.post()<sp>before<sp>getting<sp>response<sp>body" ) ; java . lang . String body ; if ( ( charset ) == null ) body = java . nio . charset . Charset . forName ( DataUtil . defaultCharset ) . decode ( byteData ) . toString ( ) ; else body = java . nio . charset . Charset . forName ( charset ) . decode ( byteData ) . toString ( ) ; byteData . rewind ( ) ; return body ; }
org . junit . Assert . assertEquals ( want , doc . body ( ) . html ( ) )
testDBDictionaryGetBatchFetchSize ( ) { org . apache . openjpa . jdbc . sql . DBDictionary db = new org . apache . openjpa . jdbc . sql . MySQLDictionary ( ) ; "<AssertPlaceHolder>" ; } getBatchFetchSize ( int ) { return Integer . MIN_VALUE ; }
org . junit . Assert . assertEquals ( Integer . MIN_VALUE , db . getBatchFetchSize ( 1 ) )
reset ( ) { stateMachine . execute ( org . jboss . hal . ballroom . form . VIEW , org . jboss . hal . ballroom . form . READONLY ) ; stateMachine . execute ( org . jboss . hal . ballroom . form . RESET ) ; "<AssertPlaceHolder>" ; } current ( ) { return current ; }
org . junit . Assert . assertEquals ( org . jboss . hal . ballroom . form . READONLY , stateMachine . current ( ) )
shouldRead ( ) { java . lang . String value = writeAndGetValue ( this . viewState ) ; given ( this . request . getParameter ( "org.springframework.springfaces.id" ) ) . willReturn ( value ) ; org . springframework . springfaces . mvc . render . ViewArtifact read = this . handler . read ( this . request ) ; "<AssertPlaceHolder>" ; } read ( javax . servlet . http . HttpServletRequest ) { java . lang . String id = request . getParameter ( org . springframework . springfaces . mvc . render . ClientFacesViewStateHandler . ID ) ; if ( id == null ) { return null ; } id = decrypt ( request , id ) ; return new org . springframework . springfaces . mvc . render . ViewArtifact ( id ) ; }
org . junit . Assert . assertThat ( read , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( this . viewState ) ) )
batchForEachEntry ( ) { com . gs . collections . impl . parallel . BatchIterable < Map . Entry < java . lang . Integer , java . lang . Integer > > entries = ( ( com . gs . collections . impl . parallel . BatchIterable < Map . Entry < java . lang . Integer , java . lang . Integer > > ) ( com . gs . collections . impl . map . mutable . UnifiedMap . newWithKeysValues ( 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 ) . entrySet ( ) ) ) ; for ( int sectionCount = 1 ; sectionCount <= 16 ; ++ sectionCount ) { com . gs . collections . impl . math . Sum sum = new com . gs . collections . impl . math . IntegerSum ( 0 ) ; for ( int sectionIndex = 0 ; sectionIndex < sectionCount ; ++ sectionIndex ) { entries . batchForEach ( new com . gs . collections . impl . map . mutable . UnifiedMapTest . EntrySumProcedure ( sum ) , sectionIndex , sectionCount ) ; } "<AssertPlaceHolder>" ; } } getValue ( ) { return this . value ; }
org . junit . Assert . assertEquals ( 20 , sum . getValue ( ) )
testTargetInstanceReference ( ) { java . lang . Object received = fixture . getTarget ( ) ; "<AssertPlaceHolder>" ; } getTarget ( ) { return target ; }
org . junit . Assert . assertSame ( target , received )
testNFAChangedOnOneNewComputationState ( ) { org . apache . flink . cep . pattern . Pattern < org . apache . flink . cep . Event , ? > pattern = org . apache . flink . cep . pattern . Pattern . < org . apache . flink . cep . Event > begin ( "start" ) . where ( new org . apache . flink . cep . pattern . conditions . SimpleCondition < org . apache . flink . cep . Event > ( ) { @ org . apache . flink . cep . nfa . Override public boolean filter ( org . apache . flink . cep . Event value ) throws org . apache . flink . cep . nfa . Exception { return value . getName ( ) . equals ( "start" ) ; } } ) . followedBy ( "a*" ) . where ( new org . apache . flink . cep . pattern . conditions . SimpleCondition < org . apache . flink . cep . Event > ( ) { private static final long serialVersionUID = 1858562682635302605L ; @ org . apache . flink . cep . nfa . Override public boolean filter ( org . apache . flink . cep . Event value ) throws org . apache . flink . cep . nfa . Exception { return value . getName ( ) . equals ( "a" ) ; } } ) . oneOrMore ( ) . optional ( ) . next ( "end" ) . where ( new org . apache . flink . cep . pattern . conditions . IterativeCondition < org . apache . flink . cep . Event > ( ) { private static final long serialVersionUID = 8061969839441121955L ; @ org . apache . flink . cep . nfa . Override public boolean filter ( org . apache . flink . cep . Event value , org . apache . flink . cep . nfa . Context < org . apache . flink . cep . Event > ctx ) throws org . apache . flink . cep . nfa . Exception { return value . getName ( ) . equals ( "b" ) ; } } ) . within ( org . apache . flink . streaming . api . windowing . time . Time . milliseconds ( 10 ) ) ; org . apache . flink . cep . nfa . NFA < org . apache . flink . cep . Event > nfa = compile ( pattern , true ) ; org . apache . flink . cep . nfa . NFAState nfaState = nfa . createInitialNFAState ( ) ; nfaState . resetStateChanged ( ) ; nfa . process ( sharedBufferAccessor , nfaState , new org . apache . flink . cep . Event ( 6 , "start" , 1.0 ) , 6L , skipStrategy , timerService ) ; nfaState . resetStateChanged ( ) ; nfa . process ( sharedBufferAccessor , nfaState , new org . apache . flink . cep . Event ( 6 , "a" , 1.0 ) , 7L , skipStrategy , timerService ) ; "<AssertPlaceHolder>" ; } isStateChanged ( ) { return stateChanged ; }
org . junit . Assert . assertTrue ( nfaState . isStateChanged ( ) )
simple_sendMsg_and_rcvMsg ( ) { final java . lang . String rulebase = "rules/reloaded/msg001.prova" ; java . util . concurrent . atomic . AtomicInteger count = new java . util . concurrent . atomic . AtomicInteger ( ) ; java . util . Map < java . lang . String , java . lang . Object > globals = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; globals . put ( "$Count" , count ) ; prova = new ws . prova . api2 . ProvaCommunicatorImpl ( test . ws . prova . test2 . ProvaMessagingTest . kAgent , test . ws . prova . test2 . ProvaMessagingTest . kPort , rulebase , ws . prova . api2 . ProvaCommunicatorImpl . SYNC , globals ) ; try { synchronized ( this ) { wait ( 1000 ) ; "<AssertPlaceHolder>" ; } } catch ( java . lang . Exception e ) { } } get ( ) { return count ; }
org . junit . Assert . assertEquals ( 4 , count . get ( ) )
save3 ( ) { org . fastquery . bean . sunny . Card card = new org . fastquery . bean . sunny . Card ( "32ccczuidazhi" ) ; java . math . BigInteger bigInteger = sunnyDBService . saveToId ( card ) ; int effect = sunnyDBService . delete ( bigInteger . intValue ( ) ) ; "<AssertPlaceHolder>" ; } delete ( java . lang . Object [ ] ) { java . util . List < java . lang . Object > objs = java . util . Arrays . asList ( obs ) ; java . util . List < org . fastquery . struct . SQLValue > sqlValues = new java . util . ArrayList ( ) ; sqlValues . add ( new org . fastquery . struct . SQLValue ( "DELETE<sp>FROM<sp>`userinfo`<sp>WHERE<sp>id<sp>=<sp>?" , objs ) ) ; return org . fastquery . core . DB . modify ( sqlValues , true ) ; }
org . junit . Assert . assertThat ( effect , is ( 1 ) )
testStdout ( ) { final org . apache . commons . exec . CommandLine cl = new org . apache . commons . exec . CommandLine ( environmentScript ) ; final int exitValue = exec . execute ( cl ) ; "<AssertPlaceHolder>" ; } isFailure ( int ) { return ( exitValue % 2 ) == 0 ; }
org . junit . Assert . assertFalse ( exec . isFailure ( exitValue ) )
assertSetQueryTimeout ( ) { for ( java . util . Map . Entry < org . apache . shardingsphere . core . constant . DatabaseType , java . sql . Statement > each : statements . entrySet ( ) ) { each . getValue ( ) . executeQuery ( sql ) ; each . getValue ( ) . setQueryTimeout ( 10 ) ; "<AssertPlaceHolder>" ; } } getQueryTimeout ( ) { return 0 ; }
org . junit . Assert . assertThat ( each . getValue ( ) . getQueryTimeout ( ) , org . hamcrest . CoreMatchers . is ( 10 ) )
whenBuildingANonEmptyTour_tourReverseIterIteratesOverActivitiesCorrectly ( ) { com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route = VehicleRoute . Builder . newInstance ( vehicle , driver ) . build ( ) ; java . util . Iterator < com . graphhopper . jsprit . core . problem . solution . route . activity . TourActivity > iter = route . getTourActivities ( ) . reverseActivityIterator ( ) ; int count = 0 ; while ( iter . hasNext ( ) ) { @ com . graphhopper . jsprit . core . problem . solution . route . SuppressWarnings ( "unused" ) com . graphhopper . jsprit . core . problem . solution . route . activity . TourActivity act = iter . next ( ) ; count ++ ; } "<AssertPlaceHolder>" ; } next ( ) { return null ; }
org . junit . Assert . assertEquals ( 0 , count )
clearNonExistentInitializationFlows ( ) { java . util . Set < org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeId > theOrphanSffs = sfcFlowWriterTestMock . clearSffsIfNoRspExists ( ) ; "<AssertPlaceHolder>" ; } clearSffsIfNoRspExists ( ) { java . util . Set < org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeId > sffNodeIDs = new java . util . HashSet ( ) ; if ( ! ( rspNameToFlowsMap . containsKey ( OpenflowConstants . SFC_FLOWS ) ) ) { org . opendaylight . sfc . util . openflow . writer . SfcOfFlowWriterImpl . LOG . warn ( "clearSffsIfNoRspExists()<sp>-<sp>Attempting<sp>to<sp>delete<sp>initialization<sp>flows,<sp>and<sp>they<sp>do<sp>not<sp>exist" ) ; return sffNodeIDs ; } java . util . Map < java . lang . String , java . util . List < org . opendaylight . sfc . util . openflow . writer . FlowDetails > > theInitializationFlows = rspNameToFlowsMap . get ( OpenflowConstants . SFC_FLOWS ) ; java . util . function . Predicate < java . lang . String > isOrphanSff = ( sffName ) -> ( this . timesFeaturedInRsps ( sffName ) ) == 1 ; java . util . Set < java . lang . String > orphanSffs = theInitializationFlows . entrySet ( ) . stream ( ) . map ( Entry :: getKey ) . filter ( isOrphanSff ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; orphanSffs . forEach ( ( sffName ) -> { sffNodeIDs . add ( new org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeId ( sffName ) ) ; setOfFlowsToDelete . addAll ( theInitializationFlows . get ( sffName ) ) ; theInitializationFlows . remove ( sffName ) ; } ) ; return sffNodeIDs ; }
org . junit . Assert . assertTrue ( theOrphanSffs . isEmpty ( ) )
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . portal . kernel . model . UserGroup . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "userGroupId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . portal . kernel . model . UserGroup > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
shouldThrowExceptionIfStartIsBiggerThanEnd ( ) { final java . util . List < java . lang . Integer > values = java . util . Arrays . asList ( 0 , 1 , 2 , 3 ) ; final int start = 3 ; final int end = 1 ; try { new uk . gov . gchq . gaffer . commonutil . iterable . LimitedCloseableIterable ( values , start , end ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( final java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( ( ( super . getMessage ( ) ) + "<sp>in<sp>string<sp>\'" ) + ( this . visibility ) ) + "\'<sp>at<sp>position<sp>" ) + ( super . getErrorOffset ( ) ) ; }
org . junit . Assert . assertNotNull ( e . getMessage ( ) )
testProcessInWithHeaders ( ) { org . hawkular . apm . api . model . config . CollectorConfiguration cc = new org . hawkular . apm . api . model . config . CollectorConfiguration ( ) ; org . hawkular . apm . api . model . config . txn . TransactionConfig btc = new org . hawkular . apm . api . model . config . txn . TransactionConfig ( ) ; cc . getTransactions ( ) . put ( "testapp" , btc ) ; org . hawkular . apm . api . model . config . txn . Processor p1 = new org . hawkular . apm . api . model . config . txn . Processor ( ) ; btc . getProcessors ( ) . add ( p1 ) ; p1 . setNodeType ( NodeType . Component ) ; p1 . setDirection ( Direction . In ) ; org . hawkular . apm . api . model . config . txn . SetPropertyAction pa1 = new org . hawkular . apm . api . model . config . txn . SetPropertyAction ( ) ; p1 . getActions ( ) . add ( pa1 ) ; pa1 . setName ( "test" ) ; org . hawkular . apm . api . model . config . txn . TextExpression expr = new org . hawkular . apm . api . model . config . txn . TextExpression ( ) ; expr . setSource ( DataSource . Header ) ; expr . setKey ( "hello" ) ; pa1 . setExpression ( expr ) ; org . hawkular . apm . client . collector . internal . ProcessorManager pm = new org . hawkular . apm . client . collector . internal . ProcessorManager ( cc ) ; org . hawkular . apm . api . model . trace . Trace trace = new org . hawkular . apm . api . model . trace . Trace ( ) ; org . hawkular . apm . api . model . trace . Component service = new org . hawkular . apm . api . model . trace . Component ( ) ; trace . getNodes ( ) . add ( service ) ; trace . setTransaction ( "testapp" ) ; java . util . Map < java . lang . String , java . lang . String > headers = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; headers . put ( "hello" , "world" ) ; pm . process ( trace , service , Direction . In , headers ) ; "<AssertPlaceHolder>" ; } hasProperty ( java . lang . String ) { for ( org . hawkular . apm . api . model . Property property : this . properties ) { if ( property . getName ( ) . equals ( name ) ) { return true ; } } return false ; }
org . junit . Assert . assertTrue ( service . hasProperty ( "test" ) )
testCalculatorOperationForMUL ( ) { java . util . Set < com . calculator . enumuse . OperationStrategy > calculatorStrategies = new java . util . HashSet < com . calculator . enumuse . OperationStrategy > ( ) ; calculatorStrategies . add ( CalculatorOperationStrategy . ADD ) ; calculatorStrategies . add ( CalculatorOperationStrategy . SUBTRACTION ) ; calculatorStrategies . add ( CalculatorOperationStrategy . MULTIPLICATION ) ; calculatorStrategies . add ( ExtendedCalculatorOperationStrategy . DIVISION ) ; com . calculator . enumuse . CalculatorInput input = new com . calculator . enumuse . CalculatorInput ( "*" , 10 , 5 ) ; com . calculator . enumuse . CalculatorContext ctxCalculator = new com . calculator . enumuse . CalculatorContext ( calculatorStrategies ) ; "<AssertPlaceHolder>" ; } execute ( com . validation . enumuse . UserInput ) { com . validation . enumuse . ValidationStrategy userValidation = UserValidationStrategy . UNSUPPORTED ; for ( java . util . Iterator < com . validation . enumuse . ValidationStrategy > iterator = userValidationStrategies . iterator ( ) ; iterator . hasNext ( ) ; ) { userValidation = iterator . next ( ) ; if ( userValidation . validate ( userInput ) ) { return userValidation . getValidationType ( ) ; } } return null ; }
org . junit . Assert . assertEquals ( 50 , ctxCalculator . execute ( input ) )
getPassThru ( ) { java . lang . Object object = new java . lang . Object ( ) ; "<AssertPlaceHolder>" ; } getPassThru ( ) { java . lang . Object object = new java . lang . Object ( ) ; org . junit . Assert . assertSame ( object , com . gs . collections . impl . block . factory . Functions . getPassThru ( ) . valueOf ( object ) ) ; }
org . junit . Assert . assertSame ( object , com . gs . collections . impl . block . factory . Functions . getPassThru ( ) . valueOf ( object ) )
testCanSetClientIp ( ) { com . eclipsesource . tabris . tracking . TrackingInfo trackingInfo = new com . eclipsesource . tabris . tracking . TrackingInfo ( ) ; trackingInfo . setClientIp ( "foo" ) ; java . lang . String ip = trackingInfo . getClientIp ( ) ; "<AssertPlaceHolder>" ; } getClientIp ( ) { return clientIp ; }
org . junit . Assert . assertSame ( "foo" , ip )
testGetSecretKey ( ) { java . lang . String apikey = org . sagebionetworks . IT990AuthenticationController . synapse . retrieveApiKey ( ) ; "<AssertPlaceHolder>" ; System . out . println ( apikey ) ; org . sagebionetworks . IT990AuthenticationController . synapse . logout ( ) ; org . sagebionetworks . IT990AuthenticationController . synapse . setUsername ( org . sagebionetworks . IT990AuthenticationController . username ) ; org . sagebionetworks . IT990AuthenticationController . synapse . setApiKey ( apikey ) ; org . sagebionetworks . IT990AuthenticationController . synapse . getMyProfile ( ) ; } retrieveApiKey ( ) { return getJSONEntity ( getAuthEndpoint ( ) , "/secretKey" , org . sagebionetworks . repo . model . auth . SecretKey . class ) . getSecretKey ( ) ; }
org . junit . Assert . assertNotNull ( apikey )
testRemoveFromStringNullArray ( ) { java . lang . String [ ] array = null ; array = com . liferay . portal . kernel . util . ArrayUtil . remove ( array , "c" ) ; "<AssertPlaceHolder>" ; } remove ( boolean [ ] , boolean ) { return com . liferay . portal . kernel . util . ArrayUtil . remove ( array , value ) ; }
org . junit . Assert . assertNull ( array )
testEquals ( ) { org . o3project . odenos . core . component . network . flow . ofpflow . OFPFlowActionSetQueue obj = target ; boolean result = target . equals ( obj ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == ( this ) ) { return true ; } if ( ! ( obj instanceof org . o3project . odenos . remoteobject . event . EventSubscription ) ) { return false ; } org . o3project . odenos . remoteobject . event . EventSubscription eventSubscription = ( ( org . o3project . odenos . remoteobject . event . EventSubscription ) ( obj ) ) ; return this . subscriberId . equals ( eventSubscription . getSubscriberId ( ) ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( true ) )
getLabelColor_labelWithDecimalValue ( ) { java . lang . String testLabel = "Label<sp>[%.3f]" ; when ( widget . getLabel ( ) ) . thenReturn ( testLabel ) ; org . eclipse . smarthome . model . sitemap . ColorArray colorArray = mock ( org . eclipse . smarthome . model . sitemap . ColorArray . class ) ; when ( colorArray . getState ( ) ) . thenReturn ( "21" ) ; when ( colorArray . getCondition ( ) ) . thenReturn ( "<" ) ; when ( colorArray . getArg ( ) ) . thenReturn ( "yellow" ) ; org . eclipse . emf . common . util . BasicEList < org . eclipse . smarthome . model . sitemap . ColorArray > colorArrays = new org . eclipse . emf . common . util . BasicEList < org . eclipse . smarthome . model . sitemap . ColorArray > ( ) ; colorArrays . add ( colorArray ) ; when ( widget . getLabelColor ( ) ) . thenReturn ( colorArrays ) ; when ( item . getState ( ) ) . thenReturn ( new org . eclipse . smarthome . core . library . types . DecimalType ( ( 10.0F / 3.0F ) ) ) ; java . lang . String color = org . eclipse . smarthome . ui . internal . items . ItemUIRegistryImplTest . uiRegistry . getLabelColor ( widget ) ; "<AssertPlaceHolder>" ; } getLabelColor ( org . eclipse . smarthome . model . sitemap . Widget ) { return processColorDefinition ( getState ( w ) , w . getLabelColor ( ) ) ; }
org . junit . Assert . assertEquals ( "yellow" , color )
findElementTwoBy ( ) { final org . openqa . selenium . support . pagefactory . ByChainedTest . AllDriver driver = mock ( org . openqa . selenium . support . pagefactory . ByChainedTest . AllDriver . class ) ; final org . openqa . selenium . WebElement elem1 = mock ( org . openqa . selenium . support . pagefactory . ByChainedTest . AllElement . class , "webElement1" ) ; final org . openqa . selenium . WebElement elem2 = mock ( org . openqa . selenium . support . pagefactory . ByChainedTest . AllElement . class , "webElement2" ) ; final org . openqa . selenium . WebElement elem3 = mock ( org . openqa . selenium . support . pagefactory . ByChainedTest . AllElement . class , "webElement3" ) ; final org . openqa . selenium . WebElement elem4 = mock ( org . openqa . selenium . support . pagefactory . ByChainedTest . AllElement . class , "webElement4" ) ; final org . openqa . selenium . WebElement elem5 = mock ( org . openqa . selenium . support . pagefactory . ByChainedTest . AllElement . class , "webElement5" ) ; final java . util . List < org . openqa . selenium . WebElement > elems12 = new java . util . ArrayList < org . openqa . selenium . WebElement > ( ) ; elems12 . add ( elem1 ) ; elems12 . add ( elem2 ) ; final java . util . List < org . openqa . selenium . WebElement > elems34 = new java . util . ArrayList < org . openqa . selenium . WebElement > ( ) ; elems34 . add ( elem3 ) ; elems34 . add ( elem4 ) ; final java . util . List < org . openqa . selenium . WebElement > elems5 = new java . util . ArrayList < org . openqa . selenium . WebElement > ( ) ; elems5 . add ( elem5 ) ; final java . util . List < org . openqa . selenium . WebElement > elems345 = new java . util . ArrayList < org . openqa . selenium . WebElement > ( ) ; elems345 . addAll ( elems34 ) ; elems345 . addAll ( elems5 ) ; when ( driver . findElementsByName ( "cheese" ) ) . thenReturn ( elems12 ) ; when ( elem1 . findElements ( org . openqa . selenium . By . name ( "photo" ) ) ) . thenReturn ( elems34 ) ; when ( elem2 . findElements ( org . openqa . selenium . By . name ( "photo" ) ) ) . thenReturn ( elems5 ) ; org . openqa . selenium . support . pagefactory . ByChained by = new org . openqa . selenium . support . pagefactory . ByChained ( org . openqa . selenium . By . name ( "cheese" ) , org . openqa . selenium . By . name ( "photo" ) ) ; "<AssertPlaceHolder>" ; } findElement ( org . openqa . selenium . By ) { return by . findElement ( this ) ; }
org . junit . Assert . assertThat ( by . findElement ( driver ) , org . hamcrest . Matchers . equalTo ( elem3 ) )
constructor_setsThisAsSeleniumServerInRemoteControlConfiguration ( ) { org . openqa . selenium . server . RemoteControlConfiguration remoteConfiguration = new org . openqa . selenium . server . RemoteControlConfiguration ( ) ; server = new org . openqa . selenium . server . SeleniumServer ( remoteConfiguration ) ; "<AssertPlaceHolder>" ; } getSslCertificateGenerator ( ) { return sslCertGenerator ; }
org . junit . Assert . assertEquals ( server , remoteConfiguration . getSslCertificateGenerator ( ) )
initiallyEmpty ( ) { com . vaadin . v7 . ui . RichTextArea tf = new com . vaadin . v7 . ui . RichTextArea ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ( ) ) == 0 ; }
org . junit . Assert . assertTrue ( tf . isEmpty ( ) )
getTakenGeplandVoorVandaagStatusWordUitgevoerd ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . Dienst dienst = em . getReference ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Dienst . class , 4 ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie toegangLeveringsAutorisatie = em . getReference ( nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie . class , 1 ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . Selectietaak selectietaak = new nl . bzk . algemeenbrp . dal . domein . brp . entity . Selectietaak ( dienst , toegangLeveringsAutorisatie , 1 ) ; selectietaak . setStatus ( ( ( short ) ( SelectietaakStatus . IN_UITVOERING . getId ( ) ) ) ) ; selectietaak . setDatumPlanning ( nl . bzk . algemeenbrp . util . common . DatumUtil . vandaag ( ) ) ; em . persist ( selectietaak ) ; final java . util . List < nl . bzk . algemeenbrp . dal . domein . brp . entity . Selectietaak > takenGeplandVoorVandaag = selectieRepository . getTakenGeplandVoorVandaag ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( takenGeplandVoorVandaag . isEmpty ( ) )
interleavedStdio ( ) { logging . record ( hudson . cli . PlainCLIProtocol . class , Level . FINE ) . record ( jenkins . util . FullDuplexHttpService . class , Level . FINE ) ; java . io . File jar = tmp . newFile ( "11<sp>*<sp>11" 1 ) ; org . apache . commons . io . FileUtils . copyURLToFile ( j . jenkins . getJnlpJars ( "11<sp>*<sp>11" 1 ) . getURL ( ) , jar ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . PipedInputStream pis = new java . io . PipedInputStream ( ) ; java . io . PipedOutputStream pos = new java . io . PipedOutputStream ( pis ) ; java . io . PrintWriter pw = new java . io . PrintWriter ( new org . apache . commons . io . output . TeeOutputStream ( pos , System . err ) , true ) ; hudson . Proc proc = new hudson . Launcher . LocalLauncher ( hudson . util . StreamTaskListener . fromStderr ( ) ) . launch ( ) . cmds ( "java" , "-jar" , jar . getAbsolutePath ( ) , "-s" , j . getURL ( ) . toString ( ) , "-noKeyAuth" , "groovysh" ) . stdout ( new org . apache . commons . io . output . TeeOutputStream ( baos , System . out ) ) . stderr ( System . err ) . stdin ( pis ) . start ( ) ; while ( ! ( baos . toString ( ) . contains ( "11<sp>*<sp>11" 3 ) ) ) { java . lang . Thread . sleep ( 100 ) ; } pw . println ( "11<sp>*<sp>11" ) ; while ( ! ( baos . toString ( ) . contains ( "121" ) ) ) { java . lang . Thread . sleep ( 100 ) ; } java . lang . Thread . sleep ( 31000 ) ; pw . println ( "11<sp>*<sp>11<sp>*<sp>11" ) ; while ( ! ( baos . toString ( ) . contains ( "1331" ) ) ) { java . lang . Thread . sleep ( 100 ) ; } pw . println ( "11<sp>*<sp>11" 0 ) ; "<AssertPlaceHolder>" ; } join ( ) { final hudson . Proc procHolderForJoin = start ( ) ; hudson . Launcher . LOGGER . log ( Level . FINER , "Started<sp>the<sp>process<sp>{0}" , procHolderForJoin ) ; if ( procHolderForJoin instanceof hudson . Proc . ProcWithJenkins23271Patch ) { return procHolderForJoin . join ( ) ; } else { if ( ! ( procHolderForJoin instanceof hudson . Proc . LocalProc ) ) { hudson . Launcher . LOGGER . log ( Level . FINE , ( "Process<sp>{0}<sp>of<sp>type<sp>{1}<sp>is<sp>neither<sp>{2}<sp>nor<sp>instance<sp>of<sp>{3}.<sp>" + "If<sp>this<sp>process<sp>operates<sp>with<sp>Jenkins<sp>agents<sp>via<sp>remote<sp>invocation,<sp>you<sp>may<sp>get<sp>into<sp>JENKINS-23271" ) , new java . lang . Object [ ] { procHolderForJoin , procHolderForJoin . getClass ( ) , hudson . Proc . LocalProc . class , hudson . Proc . ProcWithJenkins23271Patch . class } ) ; } try { final int returnCode = procHolderForJoin . join ( ) ; if ( hudson . Launcher . LOGGER . isLoggable ( Level . FINER ) ) { hudson . Launcher . LOGGER . log ( Level . FINER , "Process<sp>{0}<sp>has<sp>finished<sp>with<sp>the<sp>return<sp>code<sp>{1}" , new java . lang . Object [ ] { procHolderForJoin , returnCode } ) ; } return returnCode ; } finally { if ( procHolderForJoin . isAlive ( ) ) { hudson . Launcher . LOGGER . log ( Level . WARNING , "Process<sp>{0}<sp>has<sp>not<sp>finished<sp>after<sp>the<sp>join()<sp>method<sp>completion" , procHolderForJoin ) ; } } } }
org . junit . Assert . assertEquals ( 0 , proc . join ( ) )
testCopyPaste ( ) { java . lang . String expected = "hello<sp>world" ; org . sikuli . api . robot . desktop . Clipboard . putText ( expected ) ; java . lang . String found = org . sikuli . api . robot . desktop . Clipboard . getText ( ) ; "<AssertPlaceHolder>" ; } getText ( ) { org . sikuli . api . robot . desktop . Transferable clipboardContents = org . sikuli . api . robot . desktop . Clipboard . getSystemClipboard ( ) . getContents ( org . sikuli . api . robot . desktop . Clipboard . class ) ; org . sikuli . api . robot . desktop . DataFlavor [ ] flavors = clipboardContents . getTransferDataFlavors ( ) ; if ( ( flavors . length ) == 0 ) return null ; org . sikuli . api . robot . desktop . DataFlavor textFlavor = org . sikuli . api . robot . desktop . DataFlavor . selectBestTextFlavor ( flavors ) ; if ( textFlavor == null ) return null ; org . sikuli . api . robot . desktop . Reader clipboardReader = null ; try { clipboardReader = textFlavor . getReaderForText ( clipboardContents ) ; java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; char [ ] cbuf = new char [ 4096 ] ; int rcount = clipboardReader . read ( cbuf ) ; while ( rcount != ( - 1 ) ) { sb . append ( cbuf , 0 , rcount ) ; rcount = clipboardReader . read ( cbuf ) ; } return sb . toString ( ) ; } catch ( org . sikuli . api . robot . desktop . UnsupportedFlavorException e ) { return null ; } catch ( org . sikuli . api . robot . desktop . IOException e ) { return null ; } finally { if ( clipboardReader != null ) try { clipboardReader . close ( ) ; } catch ( org . sikuli . api . robot . desktop . IOException e ) { } } }
org . junit . Assert . assertEquals ( expected , found )
test_setSizeCustomResize ( ) { if ( SwtTestUtil . isGTK ) { org . eclipse . swt . widgets . Shell testShell = new org . eclipse . swt . widgets . Shell ( shell , ( ( org . eclipse . swt . SWT . RESIZE ) | ( org . eclipse . swt . SWT . ON_TOP ) ) ) ; org . eclipse . swt . graphics . Point size = new org . eclipse . swt . graphics . Point ( 200 , 200 ) ; testShell . setSize ( size ) ; testShell . open ( ) ; "<AssertPlaceHolder>" ; testShell . dispose ( ) ; } } getSize ( ) { checkWidget ( ) ; org . eclipse . swt . widgets . NSRect frame = ( ( window ) != null ) ? window . frame ( ) : view . frame ( ) ; return new org . eclipse . swt . widgets . Point ( ( ( int ) ( frame . width ) ) , ( ( int ) ( frame . height ) ) ) ; }
org . junit . Assert . assertEquals ( size , testShell . getSize ( ) )
testAddPasswordAndUserdata ( ) { com . cloud . network . Network network = org . mockito . Mockito . mock ( com . cloud . network . Network . class ) ; com . cloud . vm . VirtualMachineProfile vm = org . mockito . Mockito . mock ( com . cloud . vm . VirtualMachineProfile . class ) ; com . cloud . vm . NicProfile nic = org . mockito . Mockito . mock ( com . cloud . vm . NicProfile . class ) ; com . cloud . deploy . DeployDestination dest = org . mockito . Mockito . mock ( com . cloud . deploy . DeployDestination . class ) ; com . cloud . vm . ReservationContext context = org . mockito . Mockito . mock ( com . cloud . vm . ReservationContext . class ) ; com . cloud . network . Network . Service service = com . cloud . network . Network . Service . UserData ; final long networkId = 1 ; final long physicalNetworkId = 42 ; final long networkOfferingId = 10 ; final long dataCenterId = 33 ; when ( network . getId ( ) ) . thenReturn ( networkId ) ; when ( network . getPhysicalNetworkId ( ) ) . thenReturn ( physicalNetworkId ) ; when ( network . getTrafficType ( ) ) . thenReturn ( TrafficType . Guest ) ; when ( network . getNetworkOfferingId ( ) ) . thenReturn ( networkOfferingId ) ; when ( network . getDataCenterId ( ) ) . thenReturn ( dataCenterId ) ; when ( network . getVpcId ( ) ) . thenReturn ( null ) ; when ( vm . getType ( ) ) . thenReturn ( VirtualMachine . Type . User ) ; when ( virtualRouterElement . _networkMdl . getPhysicalNetworkId ( network ) ) . thenReturn ( physicalNetworkId ) ; when ( virtualRouterElement . _networkMdl . isProviderEnabledInPhysicalNetwork ( physicalNetworkId , Network . Provider . VirtualRouter . getName ( ) ) ) . thenReturn ( true ) ; when ( virtualRouterElement . _networkMdl . isProviderSupportServiceInNetwork ( networkId , service , Network . Provider . VirtualRouter ) ) . thenReturn ( true ) ; when ( virtualRouterElement . _dcDao . findById ( dataCenterId ) ) . thenReturn ( org . mockito . Mockito . mock ( com . cloud . dc . DataCenterVO . class ) ) ; when ( virtualRouterElement . canHandle ( network , service ) ) . thenReturn ( false ) ; "<AssertPlaceHolder>" ; } addPasswordAndUserdata ( com . cloud . network . Network , com . cloud . vm . NicProfile , com . cloud . vm . VirtualMachineProfile , com . cloud . deploy . DeployDestination , com . cloud . vm . ReservationContext ) { if ( canHandle ( dest , network . getTrafficType ( ) ) ) { if ( ( vm . getType ( ) ) != ( VirtualMachine . Type . User ) ) { return false ; } @ com . cloud . network . element . SuppressWarnings ( "unchecked" ) com . cloud . vm . UserVmVO uservm = _userVmDao . findById ( vm . getId ( ) ) ; _userVmDao . loadDetails ( uservm ) ; java . lang . String password = ( ( java . lang . String ) ( vm . getParameter ( VirtualMachineProfile . Param . VmPassword ) ) ) ; java . lang . String userData = uservm . getUserData ( ) ; java . lang . String sshPublicKey = uservm . getDetail ( "SSH.PublicKey" ) ; com . cloud . agent . manager . Commands cmds = new com . cloud . agent . manager . Commands ( Command . OnError . Continue ) ; if ( ( password != null ) && ( nic . isDefaultNic ( ) ) ) { com . cloud . agent . api . routing . SavePasswordCommand cmd = new com . cloud . agent . api . routing . SavePasswordCommand ( password , nic . getIPv4Address ( ) , uservm . getHostName ( ) , _networkMgr . getExecuteInSeqNtwkElmtCmd ( ) ) ; cmds . addCommand ( "password" , cmd ) ; } java . lang . String serviceOffering = _serviceOfferingDao . findByIdIncludingRemoved ( uservm . getServiceOfferingId ( ) ) . getDisplayText ( ) ; java . lang . String zoneName = _dcDao . findById ( network . getDataCenterId ( ) ) . getName ( ) ; cmds . addCommand ( "vmdata" , generateVmDataCommand ( nic . getIPv4Address ( ) , userData , serviceOffering , zoneName , nic . getIPv4Address ( ) , uservm . getHostName ( ) , uservm . getInstanceName ( ) , uservm . getId ( ) , uservm . getUuid ( ) , sshPublicKey ) ) ; try { _agentManager . send ( dest . getHost ( ) . getId ( ) , cmds ) ; } catch ( com . cloud . exception . OperationTimedoutException e ) { com . cloud . network . element . CloudZonesNetworkElement . s_logger . debug ( ( "Unable<sp>to<sp>send<sp>vm<sp>data<sp>command<sp>to<sp>host<sp>" + ( dest . getHost ( ) ) ) ) ; return false ; } com . cloud . agent . api . Answer dataAnswer = cmds . getAnswer ( "vmdata" ) ; if ( ( dataAnswer != null ) && ( dataAnswer . getResult ( ) ) ) { com . cloud . network . element . CloudZonesNetworkElement . s_logger . info ( ( "Sent<sp>vm<sp>data<sp>successfully<sp>to<sp>vm<sp>" + ( uservm . getInstanceName ( ) ) ) ) ; return true ; } com . cloud . network . element . CloudZonesNetworkElement . s_logger . info ( ( "Failed<sp>to<sp>send<sp>vm<sp>data<sp>to<sp>vm<sp>" + ( uservm . getInstanceName ( ) ) ) ) ; return false ; } return false ; }
org . junit . Assert . assertTrue ( virtualRouterElement . addPasswordAndUserdata ( network , nic , vm , dest , context ) )
testReducerValidValues ( ) { org . apache . hadoop . io . Text key = new org . apache . hadoop . io . Text ( "key123" ) ; co . nubetech . hiho . dedup . HihoTuple hihoTuple = new co . nubetech . hiho . dedup . HihoTuple ( ) ; hihoTuple . setKey ( key ) ; co . nubetech . hiho . merge . HihoValue hihoValue1 = new co . nubetech . hiho . merge . HihoValue ( ) ; co . nubetech . hiho . merge . HihoValue hihoValue2 = new co . nubetech . hiho . merge . HihoValue ( ) ; org . apache . hadoop . io . Text value1 = new org . apache . hadoop . io . Text ( "value1" ) ; org . apache . hadoop . io . Text value2 = new org . apache . hadoop . io . Text ( "value2" ) ; hihoValue1 . setVal ( value1 ) ; hihoValue2 . setVal ( value2 ) ; hihoValue1 . setIsOld ( true ) ; hihoValue2 . setIsOld ( false ) ; java . util . ArrayList < co . nubetech . hiho . merge . HihoValue > values = new java . util . ArrayList < co . nubetech . hiho . merge . HihoValue > ( ) ; values . add ( hihoValue1 ) ; values . add ( hihoValue2 ) ; org . apache . hadoop . mapreduce . Reducer . Context context = mock ( Reducer . Context . class ) ; org . apache . hadoop . mapreduce . Counters counters = new org . apache . hadoop . mapreduce . Counters ( ) ; org . apache . hadoop . mapreduce . Counter counter = counters . findCounter ( MergeRecordCounter . OUTPUT ) ; when ( context . getCounter ( MergeRecordCounter . OUTPUT ) ) . thenReturn ( counter ) ; co . nubetech . hiho . merge . MergeValueReducer mergeReducer = new co . nubetech . hiho . merge . MergeValueReducer ( ) ; mergeReducer . reduce ( hihoTuple , values , context ) ; verify ( context ) . write ( value2 , key ) ; "<AssertPlaceHolder>" ; } write ( K , V ) { writeObject ( value ) ; out . write ( co . nubetech . hiho . mapreduce . lib . output . NoKeyOnlyValueOutputFormat . NoKeyRecordWriter . newline ) ; }
org . junit . Assert . assertEquals ( 1 , context . getCounter ( MergeRecordCounter . OUTPUT ) . getValue ( ) )
testRemoteExceptionFromHistoryServer ( ) { org . apache . hadoop . mapreduce . v2 . api . MRClientProtocol historyServerProxy = mock ( org . apache . hadoop . mapreduce . v2 . api . MRClientProtocol . class ) ; when ( historyServerProxy . getJobReport ( getJobReportRequest ( ) ) ) . thenThrow ( new java . io . IOException ( "Job<sp>ID<sp>doesnot<sp>Exist" ) ) ; org . apache . hadoop . mapred . ResourceMgrDelegate rm = mock ( org . apache . hadoop . mapred . ResourceMgrDelegate . class ) ; when ( rm . getApplicationReport ( org . apache . hadoop . mapreduce . TypeConverter . toYarn ( oldJobId ) . getAppId ( ) ) ) . thenReturn ( null ) ; org . apache . hadoop . mapred . ClientServiceDelegate clientServiceDelegate = getClientServiceDelegate ( historyServerProxy , rm ) ; try { clientServiceDelegate . getJobStatus ( oldJobId ) ; org . junit . Assert . fail ( "Invoke<sp>should<sp>throw<sp>exception<sp>after<sp>retries." ) ; } catch ( java . io . IOException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
org . junit . Assert . assertTrue ( e . getMessage ( ) . contains ( "Job<sp>ID<sp>doesnot<sp>Exist" ) )
testGetTotalNumberOfRecords ( ) { org . apache . hadoop . conf . Configuration conf = buildConfiguration ( ) ; com . qubitproducts . hive . storage . jdbc . dao . DatabaseAccessor accessor = com . qubitproducts . hive . storage . jdbc . dao . DatabaseAccessorFactory . getAccessor ( conf ) ; int numRecords = accessor . getTotalNumberOfRecords ( conf ) ; "<AssertPlaceHolder>" ; } getTotalNumberOfRecords ( org . apache . hadoop . conf . Configuration ) { java . sql . Connection conn = null ; java . sql . PreparedStatement ps = null ; java . sql . ResultSet rs = null ; try { initializeDatabaseConnection ( conf ) ; java . lang . String sql = com . qubitproducts . hive . storage . jdbc . conf . JdbcStorageConfigManager . getQueryToExecute ( conf ) ; java . lang . String countQuery = ( "SELECT<sp>COUNT(*)<sp>FROM<sp>(" + sql ) + ")<sp>tmptable" ; com . qubitproducts . hive . storage . jdbc . dao . GenericJdbcDatabaseAccessor . LOGGER . debug ( "Query<sp>to<sp>execute<sp>is<sp>[{}]" , countQuery ) ; conn = dbcpDataSource . getConnection ( ) ; ps = conn . prepareStatement ( countQuery ) ; rs = ps . executeQuery ( ) ; if ( rs . next ( ) ) { return rs . getInt ( 1 ) ; } else { com . qubitproducts . hive . storage . jdbc . dao . GenericJdbcDatabaseAccessor . LOGGER . warn ( "The<sp>count<sp>query<sp>did<sp>not<sp>return<sp>any<sp>results." , countQuery ) ; throw new com . qubitproducts . hive . storage . jdbc . exception . HiveJdbcDatabaseAccessException ( "Count<sp>query<sp>did<sp>not<sp>return<sp>any<sp>results." ) ; } } catch ( com . qubitproducts . hive . storage . jdbc . exception . HiveJdbcDatabaseAccessException he ) { throw he ; } catch ( java . lang . Exception e ) { com . qubitproducts . hive . storage . jdbc . dao . GenericJdbcDatabaseAccessor . LOGGER . error ( "Caught<sp>exception<sp>while<sp>trying<sp>to<sp>get<sp>the<sp>number<sp>of<sp>records" , e ) ; throw new com . qubitproducts . hive . storage . jdbc . exception . HiveJdbcDatabaseAccessException ( e ) ; } finally { cleanupResources ( conn , ps , rs ) ; } }
org . junit . Assert . assertThat ( numRecords , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( 5 ) ) )
testToString ( ) { org . kitteh . irc . client . library . command . TopicCommand topicCommand = new org . kitteh . irc . client . library . command . TopicCommand ( this . client , org . kitteh . irc . client . library . command . TopicCommandTest . CHANNEL ) ; topicCommand . topic ( org . kitteh . irc . client . library . command . TopicCommandTest . TOPIC ) ; topicCommand . execute ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . toStringer ( ) . toString ( ) ; }
org . junit . Assert . assertTrue ( topicCommand . toString ( ) . contains ( org . kitteh . irc . client . library . command . TopicCommandTest . TOPIC ) )
inject_A$Class ( ) { com . github . seratch . taskun . inject . GuiceTaskunInjector target = new com . github . seratch . taskun . inject . GuiceTaskunInjector ( new com . google . inject . AbstractModule ( ) { @ com . github . seratch . taskun . inject . Override protected void configure ( ) { } } ) ; java . lang . Class < ? > clazz = com . github . seratch . taskun . inject . GuiceTaskunInjectorTest . class ; java . lang . Object actual = target . inject ( clazz ) ; "<AssertPlaceHolder>" ; } inject ( java . lang . Class ) { return ( ( T ) ( s2Container . getComponent ( clazz ) ) ) ; }
org . junit . Assert . assertNotNull ( actual )
testGetCombinedAutocompleteReturnsNullIfEmptyWithSeparators ( ) { "<AssertPlaceHolder>" ; } getCombinedAutocomplete ( java . lang . String , java . lang . String [ ] ) { if ( com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . OFF . equalsIgnoreCase ( valueOne ) ) { return com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . OFF ; } java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; if ( valueOne != null ) { builder . append ( valueOne ) ; } if ( args != null ) { for ( java . lang . String val : args ) { if ( ! ( com . github . bordertech . wcomponents . util . Util . empty ( val ) ) ) { if ( com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . OFF . equalsIgnoreCase ( val ) ) { return com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . OFF ; } builder . append ( com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . SEPARATOR ) ; builder . append ( val ) ; } } } java . lang . String built = builder . toString ( ) . trim ( ) ; if ( com . github . bordertech . wcomponents . util . Util . empty ( built ) ) { return null ; } return built ; }
org . junit . Assert . assertNull ( com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . getCombinedAutocomplete ( "" , "" ) )
test_create_notZip ( ) { java . io . File txtFile = new java . io . File ( tmpFolder , "abc.txt" ) ; txtFile . createNewFile ( ) ; final org . talend . updates . runtime . nexus . component . ComponentIndexBean indexBean = new org . talend . updates . runtime . nexus . component . ComponentIndexManager ( ) . create ( txtFile ) ; "<AssertPlaceHolder>" ; } create ( org . eclipse . core . runtime . IProgressMonitor ) { org . eclipse . core . runtime . IProgressMonitor pMoniter = monitor ; if ( monitor == null ) { pMoniter = new org . eclipse . core . runtime . NullProgressMonitor ( ) ; } org . eclipse . core . runtime . IProgressMonitor subMonitor = new org . eclipse . core . runtime . SubProgressMonitor ( pMoniter , 100 ) ; org . eclipse . core . resources . IProject p = org . eclipse . core . resources . ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( project . getName ( ) ) ; beforeCreate ( subMonitor , p ) ; subMonitor . worked ( 10 ) ; createSimpleProject ( subMonitor , p ) ; subMonitor . worked ( 80 ) ; afterCreate ( subMonitor , p ) ; project = p ; subMonitor . done ( ) ; }
org . junit . Assert . assertNull ( indexBean )
testGetSetState ( ) { com . microsoft . windowsazure . services . media . models . AssetState expectedState = AssetState . Published ; com . microsoft . windowsazure . services . media . models . AssetInfo assetInfo = new com . microsoft . windowsazure . services . media . models . AssetInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . AssetType ( ) . setState ( expectedState . getCode ( ) ) ) ; com . microsoft . windowsazure . services . media . models . AssetState actualState = assetInfo . getState ( ) ; "<AssertPlaceHolder>" ; } getState ( ) { if ( ( ( ( ( sendLink . getLocalState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . UNINITIALIZED ) ) || ( ( receiveLink . getLocalState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . UNINITIALIZED ) ) ) || ( ( sendLink . getRemoteState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . UNINITIALIZED ) ) ) || ( ( receiveLink . getRemoteState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . UNINITIALIZED ) ) ) { return IOObjectState . OPENING ; } if ( ( ( ( ( sendLink . getRemoteState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . ACTIVE ) ) && ( ( receiveLink . getRemoteState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . ACTIVE ) ) ) && ( ( sendLink . getLocalState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . ACTIVE ) ) ) && ( ( receiveLink . getRemoteState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . ACTIVE ) ) ) { return IOObjectState . OPENED ; } if ( ( ( sendLink . getRemoteState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . CLOSED ) ) && ( ( receiveLink . getRemoteState ( ) ) == ( org . apache . qpid . proton . engine . EndpointState . CLOSED ) ) ) { return IOObjectState . CLOSED ; } return IOObjectState . CLOSING ; }
org . junit . Assert . assertEquals ( expectedState , actualState )
testGetAsObjectOneChar ( ) { java . lang . String in = "x" ; java . lang . String out = ( ( java . lang . String ) ( converter . getAsObject ( context , component , in ) ) ) ; "<AssertPlaceHolder>" ; } getAsObject ( javax . faces . context . FacesContext , javax . faces . component . UIComponent , java . lang . String ) { org . oscm . internal . vo . VOPaymentInfo retVal = null ; for ( org . oscm . internal . vo . VOPaymentInfo vopsp : accountingService . getPaymentInfos ( ) ) { if ( java . lang . Long . valueOf ( vopsp . getKey ( ) ) . toString ( ) . equals ( value ) ) { retVal = vopsp ; } } return retVal ; }
org . junit . Assert . assertEquals ( in , out )
testNewChemModel ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IChemModel model = builder . newInstance ( org . openscience . cdk . interfaces . IChemModel . class ) ; "<AssertPlaceHolder>" ; } getBuilder ( ) { return org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ; }
org . junit . Assert . assertNotNull ( model )
shouldUnwrapEntity ( ) { final uk . gov . gchq . gaffer . data . element . Entity entity = new uk . gov . gchq . gaffer . data . element . Entity ( "group" ) ; final uk . gov . gchq . gaffer . data . element . ElementValueLoader entityLoader = mock ( uk . gov . gchq . gaffer . data . element . ElementValueLoader . class ) ; final uk . gov . gchq . gaffer . data . element . LazyEntity lazyEntity = new uk . gov . gchq . gaffer . data . element . LazyEntity ( entity , entityLoader ) ; final uk . gov . gchq . gaffer . data . element . Entity result = lazyEntity . getElement ( ) ; "<AssertPlaceHolder>" ; } getElement ( ) { if ( null == ( element ) ) { if ( isDeleted ( ) ) { throw new java . lang . IllegalStateException ( "Element<sp>has<sp>been<sp>marked<sp>for<sp>deletion<sp>it<sp>should<sp>not<sp>be<sp>used" ) ; } try { setElement ( serialisation . getElement ( cell , includeMatchedVertex ) ) ; } catch ( final uk . gov . gchq . gaffer . exception . SerialisationException e ) { throw new java . lang . RuntimeException ( e ) ; } } return element ; }
org . junit . Assert . assertSame ( entity , result )
testIsPassthru ( ) { gov . hhs . fha . nhinc . orchestration . Orchestratable instance = new gov . hhs . fha . nhinc . orchestration . OrchestratableTest . OrchestratableImpl ( ) ; boolean expResult = false ; boolean result = instance . isPassthru ( ) ; "<AssertPlaceHolder>" ; } isPassthru ( ) { return true ; }
org . junit . Assert . assertEquals ( expResult , result )
runWhileExceptionTest ( ) { this . result = 0 ; com . github . hermannpencole . nifi . config . utils . FunctionUtils . runWhile ( ( ) -> { throw new java . lang . IndexOutOfBoundsException ( ) ; } , 1 , ( - 1 ) ) ; "<AssertPlaceHolder>" ; } runWhile ( java . util . function . Supplier , int , int ) { com . github . hermannpencole . nifi . config . utils . FunctionUtils . runTimeout ( ( ) -> runWhile ( function , interval ) , timeout ) ; }
org . junit . Assert . assertEquals ( 2 , this . result )
testDSRestartWithPreviousRunningContainers ( ) { java . lang . String [ ] args = new java . lang . String [ ] { "--jar" , org . apache . hadoop . yarn . applications . distributedshell . TestDistributedShell . APPMASTER_JAR , "--num_containers" , "1" , "--shell_command" , getSleepCommand ( 8 ) , "--master_memory" , "512" , "--master_memory" 0 , "128" , "--keep_containers_across_application_attempts" } ; org . apache . hadoop . yarn . applications . distributedshell . TestDistributedShell . LOG . info ( "--master_memory" 1 ) ; org . apache . hadoop . yarn . applications . distributedshell . Client client = new org . apache . hadoop . yarn . applications . distributedshell . Client ( org . apache . hadoop . yarn . applications . distributedshell . TestDSFailedAppMaster . class . getName ( ) , new org . apache . hadoop . conf . Configuration ( yarnCluster . getConfig ( ) ) ) ; client . init ( args ) ; org . apache . hadoop . yarn . applications . distributedshell . TestDistributedShell . LOG . info ( "Running<sp>DS<sp>Client" ) ; boolean result = client . run ( ) ; org . apache . hadoop . yarn . applications . distributedshell . TestDistributedShell . LOG . info ( ( "Client<sp>run<sp>completed.<sp>Result=" + result ) ) ; "<AssertPlaceHolder>" ; } info ( java . lang . String ) { return getInstance ( org . apache . hadoop . yarn . webapp . ResponseInfo . class ) . about ( about ) ; }
org . junit . Assert . assertTrue ( result )
calculateBreakend_should_return_interval_for_single_evidence ( ) { au . edu . wehi . idsv . BreakendSummary bs = au . edu . wehi . idsv . model . Models . calculateBreakend ( getContext ( ) . getLinear ( ) , com . google . common . collect . Lists . newArrayList ( new au . edu . wehi . idsv . MockDirectedBreakpoint ( new au . edu . wehi . idsv . BreakpointSummary ( 0 , FWD , 1 , 1 , 2 , 1 , BWD , 2 , 2 , 2 ) ) ) ) ; "<AssertPlaceHolder>" ; } getLinear ( ) { return linear ; }
org . junit . Assert . assertEquals ( new au . edu . wehi . idsv . BreakendSummary ( 0 , FWD , 1 , 1 , 2 ) , bs )
constructor ( ) { Student s = new Student ( "a" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( "a" , s . getName ( ) )
testIsSelected_Returns_True_When_COM_Returns_Zero ( ) { doAnswer ( ( invocation ) -> { java . lang . Object [ ] args = invocation . getArguments ( ) ; com . sun . jna . ptr . IntByReference reference = ( ( com . sun . jna . ptr . IntByReference ) ( args [ 0 ] ) ) ; reference . setValue ( 1 ) ; return 0 ; } ) . when ( rawPattern ) . getCurrentIsSelected ( any ( com . sun . jna . ptr . IntByReference . class ) ) ; mmarquee . automation . pattern . SelectionItem item = new mmarquee . automation . pattern . SelectionItem ( element ) ; item . rawPattern = rawPattern ; boolean selected = item . isSelected ( ) ; "<AssertPlaceHolder>" ; } isSelected ( ) { com . sun . jna . ptr . IntByReference ibr = new com . sun . jna . ptr . IntByReference ( ) ; final int res = this . getPattern ( ) . getCurrentIsSelected ( ibr ) ; if ( res != 0 ) { throw new mmarquee . automation . AutomationException ( res ) ; } return ( ibr . getValue ( ) ) == 1 ; }
org . junit . Assert . assertTrue ( selected )
testPropertyMapGetValuesEmpty ( ) { com . eclipsesource . v8 . utils . V8PropertyMap < java . lang . Object > map = new com . eclipsesource . v8 . utils . V8PropertyMap < java . lang . Object > ( ) ; java . util . Collection < java . lang . Object > values = map . values ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , values . size ( ) )
testCreate ( ) { oscar . entities . Billingmaster master = new oscar . entities . Billingmaster ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( master ) ; master . setBillingNo ( 99999 ) ; dao . save ( master ) ; int count = dao . updateBillingUnitForBillingNumber ( "NIHRENASEIBE" , 99999 ) ; "<AssertPlaceHolder>" ; } updateBillingUnitForBillingNumber ( java . lang . String , java . lang . Integer ) { javax . persistence . Query query = entityManager . createQuery ( ( ( "UPDATE<sp>" + ( oscar . entities . Billingmaster . class . getSimpleName ( ) ) ) + "<sp>b<sp>SET<sp>b.billingUnit<sp>=<sp>:billingUnit<sp>WHERE<sp>b.billingNo<sp>=<sp>:billingNo" ) ) ; query . setParameter ( "billingUnit" , billingUnit ) ; query . setParameter ( "billingNo" , billingNo ) ; return query . executeUpdate ( ) ; }
org . junit . Assert . assertTrue ( ( count == 1 ) )
depsHaveStripAndDebugFlavorsPropagatedForPlatformDeps ( ) { com . facebook . buck . core . model . BuildTarget bundleTargetWithStripFlavor = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:bundle#iphoneos-x86_64,strip-all,dwarf-and-dsym" ) ; com . facebook . buck . core . model . BuildTarget unflavoredDep = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep1" ) ; com . facebook . buck . core . model . BuildTarget unflavoredDepAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#otherflavor" 2 ) ; com . facebook . buck . core . model . BuildTarget flavoredDep = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep2#iphoneos-i386,strip-debug,dwarf" ) ; com . facebook . buck . core . model . BuildTarget flavoredDepNotInDomain = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#otherflavor" ) ; com . facebook . buck . core . model . BuildTarget flavoredDepNotInDomainAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#iphoneos-x86_64,strip-all,dwarf-and-dsym,otherflavor" ) ; com . facebook . buck . core . model . BuildTarget stripFlavorOnly = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep4#strip-debug" ) ; com . facebook . buck . core . model . BuildTarget stripFlavorOnlyAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#otherflavor" 3 ) ; com . facebook . buck . core . model . BuildTarget debugFlavorOnly = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep5#dwarf" ) ; com . facebook . buck . core . model . BuildTarget debugFlavorOnlyAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep5#iphoneos-x86_64,strip-all,dwarf" ) ; com . facebook . buck . core . model . BuildTarget binary = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:binary" ) ; com . facebook . buck . apple . AppleBundleDescription desc = FakeAppleRuleDescriptions . BUNDLE_DESCRIPTION ; com . facebook . buck . apple . AppleBundleDescriptionArg constructorArg = com . facebook . buck . apple . AppleBundleDescriptionArg . builder ( ) . setName ( "//bar:dep3#otherflavor" 1 ) . setExtension ( com . facebook . buck . util . types . Either . ofLeft ( AppleBundleExtension . BUNDLE ) ) . setInfoPlist ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "//bar:dep3#otherflavor" 0 ) ) . setPlatformBinary ( com . facebook . buck . rules . coercer . PatternMatchedCollection . < com . facebook . buck . core . model . BuildTarget > builder ( ) . add ( java . util . regex . Pattern . compile ( "iphoneos-x86_64" ) , binary ) . build ( ) ) . setDeps ( com . google . common . collect . ImmutableSortedSet . < com . facebook . buck . core . model . BuildTarget > naturalOrder ( ) . add ( binary ) . add ( unflavoredDep ) . add ( flavoredDep ) . add ( flavoredDepNotInDomain ) . add ( stripFlavorOnly ) . add ( debugFlavorOnly ) . build ( ) ) . build ( ) ; com . google . common . collect . ImmutableSortedSet . Builder < com . facebook . buck . core . model . BuildTarget > implicitDeps = com . google . common . collect . ImmutableSortedSet . naturalOrder ( ) ; desc . findDepsForTargetFromConstructorArgs ( bundleTargetWithStripFlavor , createCellRoots ( filesystem ) , constructorArg , implicitDeps , com . google . common . collect . ImmutableSortedSet . naturalOrder ( ) ) ; "<AssertPlaceHolder>" ; } add ( com . facebook . buck . android . MergeAndroidResourcesStepTest$RDotTxtFile ) { filesystem . writeLinesToPath ( entry . contents , entry . filePath ) ; filePathToPackageName . put ( entry . filePath , entry . packageName ) ; }
org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableSortedSet . < com . facebook . buck . core . model . BuildTarget > naturalOrder ( ) . add ( unflavoredDepAfterPropagation ) . add ( flavoredDep ) . add ( flavoredDepNotInDomainAfterPropagation ) . add ( stripFlavorOnlyAfterPropagation ) . add ( debugFlavorOnlyAfterPropagation ) . build ( ) , implicitDeps . build ( ) )
testMealsFires ( ) { com . sample . domain . Reservation reservation = new com . sample . domain . Reservation ( ) ; reservation . setUpgrademeal ( true ) ; ksession . insert ( reservation ) ; com . sample . domain . User user = new com . sample . domain . User ( ) ; user . setLoyaltylevel ( "None" ) ; ksession . insert ( user ) ; ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } getFactCount ( ) { return 0 ; }
org . junit . Assert . assertEquals ( 3 , ksession . getFactCount ( ) )
testDenotesDynamicAllNullPropertyState ( ) { "<AssertPlaceHolder>" ; } denotesDynamicJcrAll ( org . apache . jackrabbit . oak . api . PropertyState ) { return ( ( ( property != null ) && ( ( org . apache . jackrabbit . oak . api . Type . LONGS ) == ( property . getType ( ) ) ) ) && ( ( property . count ( ) ) == 1 ) ) && ( ( property . getValue ( Type . LONG , 0 ) ) == ( org . apache . jackrabbit . oak . spi . security . privilege . JcrAllUtil . DYNAMIC_JCR_ALL_VALUE ) ) ; }
org . junit . Assert . assertFalse ( org . apache . jackrabbit . oak . spi . security . privilege . JcrAllUtil . denotesDynamicJcrAll ( null ) )
toVOServiceOperationParameters_Null ( ) { java . util . List < org . oscm . internal . vo . VOServiceOperationParameter > parameters = org . oscm . serviceprovisioningservice . assembler . TechServiceOperationParameterAssembler . toVOServiceOperationParameters ( null , facade ) ; "<AssertPlaceHolder>" ; } toVOServiceOperationParameters ( java . util . List , org . oscm . i18nservice . bean . LocalizerFacade ) { if ( operationParameters == null ) { return null ; } java . util . List < org . oscm . internal . vo . VOServiceOperationParameter > result = new java . util . ArrayList < org . oscm . internal . vo . VOServiceOperationParameter > ( ) ; for ( org . oscm . domobjects . OperationParameter parameter : operationParameters ) { result . add ( org . oscm . serviceprovisioningservice . assembler . TechServiceOperationParameterAssembler . toVOServiceOperationParameter ( parameter , localizerFacade ) ) ; } return result ; }
org . junit . Assert . assertNull ( parameters )
testDOIManagerIsInvoked ( ) { when ( doiManager . fetchDOIBibtex ( "111" ) ) . thenReturn ( "OK" ) ; org . orcid . jaxb . model . record_v2 . Work w = new org . orcid . jaxb . model . record_v2 . Work ( ) ; w . setWorkExternalIdentifiers ( new org . orcid . jaxb . model . record_v2 . ExternalIDs ( ) ) ; org . orcid . jaxb . model . record_v2 . ExternalID id = new org . orcid . jaxb . model . record_v2 . ExternalID ( ) ; id . setType ( "doi" ) ; id . setValue ( "111" ) ; w . getExternalIdentifiers ( ) . getExternalIdentifier ( ) . add ( id ) ; java . lang . String bib = bibtexManager . generateBibtex ( org . orcid . core . manager . impl . BibtexManagerTest . ORCID , w ) ; "<AssertPlaceHolder>" ; } generateBibtex ( java . lang . String , org . orcid . jaxb . model . v3 . release . record . Work ) { if ( ( ( ( work . getWorkCitation ( ) ) != null ) && ( ( work . getWorkCitation ( ) . getWorkCitationType ( ) ) != null ) ) && ( work . getWorkCitation ( ) . getWorkCitationType ( ) . equals ( CitationType . BIBTEX ) ) ) { return work . getWorkCitation ( ) . getCitation ( ) ; } if ( ( ( work . getWorkExternalIdentifiers ( ) ) != null ) && ( ( work . getWorkExternalIdentifiers ( ) . getExternalIdentifier ( ) ) != null ) ) { java . lang . String doi = extractID ( work , WorkExternalIdentifierType . DOI ) ; if ( doi != null ) { try { java . lang . String bibtex = doiManager . fetchDOIBibtex ( doi ) ; if ( bibtex != null ) return bibtex ; } catch ( java . lang . Exception e ) { org . orcid . core . manager . v3 . impl . BibtexManagerImpl . LOGGER . warn ( ( "cannot<sp>resolve<sp>DOI<sp>to<sp>metadata:" + doi ) ) ; } } } java . lang . String creditName = getCreditName ( orcid ) ; return workToBibtex ( work , creditName ) ; }
org . junit . Assert . assertEquals ( "OK" , bib )
testMultipleServiceBindingDifferentService ( ) { commandProcessor . bind ( new com . betfair . cougar . core . api . ServiceBindingDescriptor ( ) { @ com . betfair . cougar . transport . impl . protocol . http . Override public com . betfair . cougar . core . api . OperationBindingDescriptor [ ] getOperationBindings ( ) { return new com . betfair . cougar . core . api . OperationBindingDescriptor [ 0 ] ; } @ com . betfair . cougar . transport . impl . protocol . http . Override public com . betfair . cougar . core . api . ServiceVersion getServiceVersion ( ) { return new com . betfair . cougar . core . api . ServiceVersion ( "v1.2" ) ; } @ com . betfair . cougar . transport . impl . protocol . http . Override public java . lang . String getServiceName ( ) { return "service1" ; } @ com . betfair . cougar . transport . impl . protocol . http . Override public com . betfair . cougar . api . export . Protocol getServiceProtocol ( ) { return null ; } } ) ; commandProcessor . bind ( new com . betfair . cougar . core . api . ServiceBindingDescriptor ( ) { @ com . betfair . cougar . transport . impl . protocol . http . Override public com . betfair . cougar . core . api . OperationBindingDescriptor [ ] getOperationBindings ( ) { return new com . betfair . cougar . core . api . OperationBindingDescriptor [ 0 ] ; } @ com . betfair . cougar . transport . impl . protocol . http . Override public com . betfair . cougar . core . api . ServiceVersion getServiceVersion ( ) { return new com . betfair . cougar . core . api . ServiceVersion ( "v3.3" ) ; } @ com . betfair . cougar . transport . impl . protocol . http . Override public java . lang . String getServiceName ( ) { return "service2" ; } @ com . betfair . cougar . transport . impl . protocol . http . Override public com . betfair . cougar . api . export . Protocol getServiceProtocol ( ) { return null ; } } ) ; int count = 0 ; for ( com . betfair . cougar . core . api . ServiceBindingDescriptor ignored : commandProcessor . getServiceBindingDescriptors ( ) ) { count ++ ; } "<AssertPlaceHolder>" ; } getServiceBindingDescriptors ( ) { return serviceBindingDescriptors . values ( ) ; }
org . junit . Assert . assertEquals ( 2 , count )
testPairMapAddHeaders ( ) { one . util . streamex . List < java . lang . String > result = one . util . streamex . StreamEx . of ( "aaa" , "abc" , "bar" , "foo" , "baz" , "argh" ) . sorted ( ) . prepend ( "" ) . pairMap ( ( a , b ) -> ( a . isEmpty ( ) ) || ( ( a . charAt ( 0 ) ) != ( b . charAt ( 0 ) ) ) ? java . util . stream . Stream . of ( ( ( "===<sp>" + ( b . substring ( 0 , 1 ) . toUpperCase ( ) ) ) + "<sp>===" ) , b ) : java . util . stream . Stream . of ( b ) ) . flatMap ( one . util . streamex . Function . identity ( ) ) . toList ( ) ; one . util . streamex . List < java . lang . String > expected = java . util . Arrays . asList ( "bar" 0 , "aaa" , "abc" , "argh" , "===<sp>B<sp>===" , "bar" , "baz" , "bar" 1 , "foo" ) ; "<AssertPlaceHolder>" ; } flatMap ( one . util . streamex . LongFunction ) { return new one . util . streamex . LongStreamEx ( stream ( ) . flatMap ( mapper ) , context ) ; }
org . junit . Assert . assertEquals ( expected , result )
manageModificationVDiskCreation_VSERVER_STARTED_Stopped ( ) { org . oscm . app . iaas . data . FlowState flowState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; org . oscm . app . iaas . data . FlowState newState = null ; doReturn ( VServerStatus . STOPPED ) . when ( vServerProcessor . vserverComm ) . getVServerStatus ( any ( org . oscm . app . iaas . PropertyHandler . class ) ) ; newState = vServerProcessor . manageModificationVDiskCreation ( "controllerId" , "instanceId" , paramHandler , flowState , newState ) ; "<AssertPlaceHolder>" ; } manageModificationVDiskCreation ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , org . oscm . app . iaas . data . FlowState ) { org . oscm . app . iaas . data . FlowState newState = newStateParam ; boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; switch ( flowState ) { case VSERVER_MODIFICATION_REQUESTED : if ( ( paramHandler . getControllerWaitTime ( ) ) != 0 ) { paramHandler . suspendProcessInstanceFor ( paramHandler . getControllerWaitTime ( ) ) ; newState = org . oscm . app . iaas . data . FlowState . WAITING_BEFORE_STOP ; break ; } case WAITING_BEFORE_STOP : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STOPPED_FOR_MODIFICATION , paramHandler ) ) { java . lang . String status = vserverComm . getVServerStatus ( paramHandler ) ; if ( VServerStatus . RUNNING . equals ( status ) ) { vserverComm . stopVServer ( paramHandler ) ; } else if ( VServerStatus . STOPPED . equals ( status ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STOPPED_FOR_MODIFICATION ; } } break ; case VSERVER_STOPPED_FOR_MODIFICATION : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATING , paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATING ; vserverComm . modifyVServerAttributes ( paramHandler ) ; if ( vdiskInfo . isAdditionalDiskSelected ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATION_REQUESTED ; } } break ; case VSDISK_CREATION_REQUESTED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATING , paramHandler ) ) ) { vdiskInfo . createVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATING ; } break ; case VSDISK_CREATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATED , paramHandler ) ) { if ( vdiskInfo . isVDiskDeployed ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATED ; } } break ; case VSDISK_CREATED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHING , paramHandler ) ) ) { vdiskInfo . attachVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHING ; } break ; case VSDISK_ATTACHING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHED , paramHandler ) ) { if ( vdiskInfo . isVDiskAttached ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHED ; } } break ; case VSDISK_ATTACHED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATING , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATING ; } break ; case VSERVER_UPDATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATED , paramHandler ) ) { if ( VServerStatus . STOPPED . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATED ; } } break ; case VSERVER_UPDATED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) { if ( vserverComm . startVServer ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } } break ; case VSERVER_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_RETRIEVEGUEST ; } } break ; case VSERVER_RETRIEVEGUEST : java . lang . String mail = paramHandler . getMailForCompletion ( ) ; if ( mail != null ) { newState = dispatchVServerManualOperation ( controllerId , instanceId , paramHandler , mail ) ; } else if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; default : } return newState ; }
org . junit . Assert . assertNull ( newState )
testLexerUnicodeUnescapedBMPSetWithRange ( ) { org . antlr . v4 . tool . LexerGrammar lg = new org . antlr . v4 . tool . LexerGrammar ( ( "2:RULE_STOP<sp>0\n" 2 + "ID<sp>:<sp>(\'亜\'|\'亝\'|\'江\'|\'た\'..\'ほ\')\n<sp>;" ) ) ; java . lang . String expecting = "max<sp>type<sp>1\n" + ( ( ( ( ( ( ( ( ( ( ( ( "2:RULE_STOP<sp>0\n" 4 + "1:RULE_START<sp>0\n" ) + "2:RULE_STOP<sp>0\n" ) + "2:RULE_STOP<sp>0\n" 1 ) + "4:BASIC<sp>0\n" ) + "2:RULE_STOP<sp>0\n" 0 ) + "mode<sp>0:0\n" ) + "2:RULE_STOP<sp>0\n" 5 ) + "0->1<sp>EPSILON<sp>0,0,0\n" ) + "1->3<sp>EPSILON<sp>0,0,0\n" ) + "3->4<sp>SET<sp>0,0,0\n" ) + "2:RULE_STOP<sp>0\n" 3 ) + "0:0\n" ) ; org . antlr . v4 . runtime . atn . ATN atn = createATN ( lg , true ) ; java . lang . String result = org . antlr . v4 . runtime . atn . ATNSerializer . getDecoded ( atn , java . util . Arrays . asList ( lg . getTokenNames ( ) ) ) ; "<AssertPlaceHolder>" ; } getTokenNames ( ) { int numTokens = getMaxTokenType ( ) ; java . lang . String [ ] tokenNames = new java . lang . String [ numTokens + 1 ] ; for ( int i = 0 ; i < ( tokenNames . length ) ; i ++ ) { tokenNames [ i ] = getTokenName ( i ) ; } return tokenNames ; }
org . junit . Assert . assertEquals ( expecting , result )
testFastHtmlExportWork ( ) { java . net . URL url = getClass ( ) . getResource ( "Prd-5240.prpt" ) ; org . pentaho . reporting . engine . classic . core . MasterReport report = ( ( org . pentaho . reporting . engine . classic . core . MasterReport ) ( new org . pentaho . reporting . libraries . resourceloader . ResourceManager ( ) . createDirectly ( url , org . pentaho . reporting . engine . classic . core . MasterReport . class ) . getResource ( ) ) ) ; final java . io . ByteArrayOutputStream boutFast = new java . io . ByteArrayOutputStream ( ) ; final java . io . ByteArrayOutputStream boutSlow = new java . io . ByteArrayOutputStream ( ) ; org . pentaho . reporting . engine . classic . core . modules . output . fast . html . FastHtmlReportUtil . processStreamHtml ( report , boutFast ) ; org . pentaho . reporting . engine . classic . core . modules . output . table . html . HtmlReportUtil . createStreamHTML ( report , boutSlow ) ; java . lang . String htmlFast = boutFast . toString ( "UTF-8" ) ; java . lang . String htmlSlow = boutSlow . toString ( "UTF-8" ) ; "<AssertPlaceHolder>" ; } toString ( boolean ) { return builder . toString ( compact ) ; }
org . junit . Assert . assertEquals ( htmlSlow , htmlFast )
testPosCase ( ) { java . util . Random rnd = new java . util . Random ( ) ; for ( int c = 0 ; c < 10 ; ++ c ) { int length = ( rnd . nextInt ( 20 ) ) + 10 ; int x = rnd . nextInt ( length ) ; algorithm . common . ListNode head = new algorithm . common . ListNode ( 0 ) ; algorithm . common . ListNode cur = head ; for ( int i = 0 ; i < length ; ++ i ) { cur . next = new algorithm . common . ListNode ( rnd . nextInt ( 100 ) ) ; cur = cur . next ; } algorithm . common . ListNode newHead = question . partition ( head , x ) ; cur = newHead ; boolean afterX = ( newHead . val ) >= x ; while ( cur != null ) { if ( x <= ( cur . val ) ) { afterX = true ; } if ( afterX ) { "<AssertPlaceHolder>" ; } cur = cur . next ; } } } partition ( algorithm . common . ListNode , int ) { if ( head == null ) { return null ; } algorithm . common . ListNode headL = new algorithm . common . ListNode ( 0 ) ; algorithm . common . ListNode headGe = new algorithm . common . ListNode ( 0 ) ; algorithm . common . ListNode headLCur = headL ; algorithm . common . ListNode headGeCur = headGe ; algorithm . common . ListNode cur = head ; while ( cur != null ) { if ( ( cur . val ) < x ) { headLCur . next = new algorithm . common . ListNode ( cur . val ) ; headLCur = headLCur . next ; } else { headGeCur . next = new algorithm . common . ListNode ( cur . val ) ; headGeCur = headGeCur . next ; } cur = cur . next ; } headLCur . next = headGe . next ; return headL . next ; }
org . junit . Assert . assertTrue ( ( x <= ( cur . val ) ) )
getRequestConfigFromAsyncClient ( ) { org . apache . http . impl . nio . client . CloseableHttpAsyncClient client = com . ctrip . soa . caravan . util . net . apache . async . PoolingHttpAsyncClientFactory . create ( ) ; org . apache . http . client . config . RequestConfig requestConfig = com . ctrip . soa . caravan . util . net . apache . RequestConfigs . getRequestConfig ( client ) ; "<AssertPlaceHolder>" ; } getRequestConfig ( java . lang . Object ) { if ( client == null ) return null ; if ( client instanceof org . apache . http . client . methods . Configurable ) return ( ( org . apache . http . client . methods . Configurable ) ( client ) ) . getConfig ( ) ; return com . ctrip . soa . caravan . util . net . apache . RequestConfigs . getRequestConfigFromField ( client ) ; }
org . junit . Assert . assertNotNull ( requestConfig )
template ( ) { org . optaplanner . benchmark . api . PlannerBenchmarkFactory plannerBenchmarkFactory = org . optaplanner . benchmark . api . PlannerBenchmarkFactory . createFromFreemarkerXmlResource ( "org/optaplanner/benchmark/api/testdataPlannerBenchmarkConfigTemplate.xml.ftl" ) ; org . optaplanner . benchmark . api . PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory . buildPlannerBenchmark ( ) ; "<AssertPlaceHolder>" ; plannerBenchmark . benchmark ( ) ; } buildPlannerBenchmark ( ) { org . optaplanner . benchmark . api . PlannerBenchmarkFactory plannerBenchmarkFactory = argOption . buildPlannerBenchmarkFactory ( ) ; org . optaplanner . benchmark . api . PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory . buildPlannerBenchmark ( ) ; buildEverySolver ( plannerBenchmark ) ; }
org . junit . Assert . assertNotNull ( plannerBenchmark )
test_pojo_annotation_logging ( ) { com . godaddy . logging . AnnotatedPojo annotatedPojo = new com . godaddy . logging . AnnotatedPojo ( ) ; logger . with ( annotatedPojo ) . info ( "Annotation<sp>Logging" ) ; java . lang . String expectedLogMessage = "Annotation<sp>Logging;<sp>AnnotatedPojo.hashAnnotationField=\"574ddfe7cc3cdd67bb290ca50e964e5904613bd373a5fd1924e27f8552aae310\";<sp>" + ( ( "AnnotatedPojo.noAnnotationField=\"NoAnnotationField\";<sp>AnnotatedPojo" + ".hashAnnotationProperty=\"5f7e0a2dff6ec731caf7060a4442f3a553d0efd220cb416eaaf923b2ed0d4472\";<sp>AnnotatedPojo" ) + ".noAnnotationProperty=\"NoAnnotationProperty\"" ) ; java . lang . String actualLogMessage = getLoggingEvent ( ) . getFormattedMessage ( ) ; "<AssertPlaceHolder>" ; } getLoggingEvent ( ) { verify ( mockAppender , atLeastOnce ( ) ) . doAppend ( captorLoggingEvent . capture ( ) ) ; return captorLoggingEvent . getValue ( ) ; }
org . junit . Assert . assertEquals ( actualLogMessage , expectedLogMessage )
testToFieldPathArray_EmptyArray ( ) { "<AssertPlaceHolder>" ; } toFieldPathArray ( java . lang . String [ ] ) { if ( fieldPaths == null ) { return null ; } else if ( ( fieldPaths . length ) == 0 ) { return org . ojai . util . Fields . EMPTRY_FIELDPATH_ARRAY ; } else { final org . ojai . FieldPath [ ] fpArray = new org . ojai . FieldPath [ fieldPaths . length ] ; for ( int i = 0 ; i < ( fieldPaths . length ) ; i ++ ) { fpArray [ i ] = org . ojai . FieldPath . parseFrom ( fieldPaths [ i ] ) ; } return fpArray ; } }
org . junit . Assert . assertArrayEquals ( new org . ojai . FieldPath [ 0 ] , org . ojai . util . Fields . toFieldPathArray ( new java . lang . String [ 0 ] ) )
testDefaultsCanBeOverridden ( ) { org . apache . commons . configuration . Configuration conf = new org . apache . commons . configuration . PropertiesConfiguration ( ) ; conf . setProperty ( ClusterSpec . Property . RUN_URL_BASE . getConfigName ( ) , "http://example.org" ) ; org . apache . whirr . ClusterSpec spec = org . apache . whirr . ClusterSpec . withNoDefaults ( conf ) ; "<AssertPlaceHolder>" ; } getRunUrlBase ( ) { return runUrlBase ; }
org . junit . Assert . assertThat ( spec . getRunUrlBase ( ) , org . hamcrest . Matchers . is ( "http://example.org" ) )
testShouldReturnNullOnInvalidDemoNo ( ) { java . util . List < org . oscarehr . common . model . Drug > drugs = new java . util . ArrayList < org . oscarehr . common . model . Drug > ( ) ; drugs . add ( getTestDrug ( ) ) ; org . oscarehr . util . LoggedInInfo info = new org . oscarehr . util . LoggedInInfo ( ) ; org . oscarehr . managers . PrescriptionDrugs pd = prescribe ( info , drugs , ( - 1 ) ) ; "<AssertPlaceHolder>" ; } prescribe ( org . oscarehr . util . LoggedInInfo , java . util . List , java . lang . Integer ) { if ( ( drugs . get ( 0 ) . getId ( ) ) > 1 ) return null ; org . oscarehr . common . model . Prescription p = new org . oscarehr . common . model . Prescription ( ) ; p . setProviderNo ( "1" ) ; p . setDemographicId ( 1 ) ; p . setTextView ( "SOME<sp>TEXT" ) ; org . oscarehr . ws . PrescriptionDrugs pd = new org . oscarehr . ws . PrescriptionDrugs ( p , drugs ) ; return pd ; }
org . junit . Assert . assertNull ( pd )
should_process_column_with_basic_value ( ) { net . rrm . ehour . backup . service . restore . structure . FieldMap fieldDefinitionMap = net . rrm . ehour . backup . service . restore . structure . FieldMapFactory . buildFieldMapForEntity ( net . rrm . ehour . backup . service . restore . structure . Project . class ) ; net . rrm . ehour . backup . service . restore . structure . FieldDefinition fieldDef = fieldDefinitionMap . get ( "project_code" ) ; net . rrm . ehour . backup . service . restore . structure . Project project = net . rrm . ehour . backup . service . restore . structure . ProjectObjectMother . createProject ( 1 ) ; project . setProjectCode ( null ) ; java . util . Map < java . lang . Class < ? > , java . lang . Object > embeddables = com . google . common . collect . Maps . newHashMap ( ) ; fieldDef . process ( project , embeddables , "TEC" ) ; "<AssertPlaceHolder>" ; } getProjectCode ( ) { return this . projectCode ; }
org . junit . Assert . assertEquals ( "TEC" , project . getProjectCode ( ) )
testcontroleerAanvangGeldigheidTegenBijhouding ( ) { maakPersoonEntiteitMeBijhoudingsHistorie ( 20000101 ) ; final nl . bzk . brp . bijhouding . bericht . model . PersoonGegevensElement PersoonGegevensElement = builder . maakPersoonGegevensElement ( "pers" , nl . bzk . brp . bijhouding . bericht . model . AbstractPersoonWijzigingActieElementTest . PERS_SLEUTEL ) ; final nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . AdministratieveHandelingParameters ahpara = new nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . AdministratieveHandelingParameters ( ) ; ahpara . partijCode ( "1234" ) ; ahpara . soort ( AdministratieveHandelingElementSoort . VERHUIZING_INTERGEMEENTELIJK ) ; when ( bericht . getAdministratieveHandeling ( ) ) . thenReturn ( builder . maakAdministratieveHandelingElement ( "ah" , ahpara ) ) ; PersoonGegevensElement . setVerzoekBericht ( bericht ) ; nl . bzk . brp . bijhouding . bericht . model . AbstractPersoonWijzigingActieElement element = builder . maakRegistratieMigratieActieElement ( "com" , 20010101 , PersoonGegevensElement ) ; element . setVerzoekBericht ( bericht ) ; final java . util . List < nl . bzk . brp . bijhouding . bericht . model . MeldingElement > meldingen = new java . util . LinkedList ( ) ; element . controleerAanvangGeldigheidTegenBijhouding ( meldingen ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) )
testSearchXCredentialStores ( ) { org . apache . ranger . view . VXCredentialStore vXCredentialStore = vXCredentialStore ( ) ; java . util . List < org . apache . ranger . view . VXCredentialStore > vXCredentialStores = java . util . Arrays . asList ( vXCredentialStore ) ; org . apache . ranger . view . VXCredentialStoreList vXCredentialStoreList = new org . apache . ranger . view . VXCredentialStoreList ( ) ; vXCredentialStoreList . setVXCredentialStores ( vXCredentialStores ) ; org . apache . ranger . common . SearchCriteria searchCriteria = new org . apache . ranger . common . SearchCriteria ( ) ; java . util . List < org . apache . ranger . common . SortField > sortFields = null ; org . mockito . Mockito . when ( searchUtil . extractCommonCriterias ( request , sortFields ) ) . thenReturn ( searchCriteria ) ; org . mockito . Mockito . when ( assetMgr . searchXCredentialStores ( searchCriteria ) ) . thenReturn ( vXCredentialStoreList ) ; org . apache . ranger . view . VXCredentialStoreList actualvxCredentialStoreList = assetREST . searchXCredentialStores ( request ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( assetMgr ) . searchXCredentialStores ( searchCriteria ) ; } getVXCredentialStores ( ) { return vXCredentialStores ; }
org . junit . Assert . assertEquals ( vXCredentialStoreList . getVXCredentialStores ( ) , actualvxCredentialStoreList . getVXCredentialStores ( ) )
testOnMessageFailure ( ) { setupBeforeDeliverySuccessful ( ) ; context . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockEndpointAndListener ) . onMessage ( with ( same ( stubMessage ) ) ) ; will ( throwException ( new java . lang . RuntimeException ( ) ) ) ; } } ) ; setupAfterDeliverySuccessful ( ) ; doBeforeDeliveryExpectSuccess ( ) ; try { endpointProxy . onMessage ( stubMessage ) ; org . junit . Assert . fail ( "An<sp>exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } doAfterDeliveryExpectSuccess ( ) ; } onMessage ( javax . jms . Message ) { int attempt = 0 ; final int maxRetries = jmsConnector . getReconnectionPolicy ( ) . getMaxSendRetries ( ) ; while ( ( ( started . get ( ) ) && ( message != null ) ) && ( ( maxRetries == ( ReconnectionPolicy . INFINITE ) ) || ( attempt <= maxRetries ) ) ) { try { if ( ( attempt ++ ) > 0 ) { try { java . lang . Thread . sleep ( jmsConnector . getReconnectionPolicy ( ) . getNextDelay ( attempt ) ) ; } catch ( java . lang . InterruptedException e ) { break ; } } javax . jms . Message converted ; if ( ( jmsMessageConvertor ) != null ) { if ( doHandleReplyTo ) { javax . jms . Destination replyTo = message . getJMSReplyTo ( ) ; if ( replyTo != null ) { converted = jmsMessageConvertor . convert ( message , processReplyToDestination ( replyTo ) ) ; } else { converted = jmsMessageConvertor . convert ( message ) ; } } else { message . setJMSReplyTo ( null ) ; converted = jmsMessageConvertor . convert ( message ) ; } } else { continue ; } try { sendMessage ( converted ) ; } catch ( java . lang . Exception e ) { jmsConnector . handleConnectionFailure ( getConnectionForProducer ( ) ) ; continue ; } try { message . acknowledge ( ) ; } catch ( java . lang . Exception e ) { jmsConnector . handleConnectionFailure ( getConnnectionForConsumer ( ) ) ; continue ; } return ; } catch ( java . lang . Exception e ) { org . apache . activemq . network . jms . DestinationBridge . LOG . info ( "failed<sp>to<sp>forward<sp>message<sp>on<sp>attempt:<sp>{}<sp>reason:<sp>{}<sp>message:<sp>{}" , new java . lang . Object [ ] { attempt , e , message } , e ) ; } } }
org . junit . Assert . assertTrue ( true )
testConvertAmountDefault ( ) { javax . money . CurrencyUnit [ ] units = new javax . money . CurrencyUnit [ ] { javax . money . Monetary . getCurrency ( "CHF" ) , javax . money . Monetary . getCurrency ( "EUR" ) , javax . money . Monetary . getCurrency ( "USD" ) , javax . money . Monetary . getCurrency ( "JPY" ) , javax . money . Monetary . getCurrency ( "INR" ) } ; org . javamoney . moneta . Money [ ] moneys = new org . javamoney . moneta . Money [ ] { org . javamoney . moneta . Money . of ( 10 , "CHF" ) , org . javamoney . moneta . Money . of ( 123.34 , "USD" ) , org . javamoney . moneta . Money . of ( 2300.3 , "INR" ) } ; for ( javax . money . CurrencyUnit u1 : units ) { for ( org . javamoney . moneta . Money m : moneys ) { boolean exception = false ; javax . money . MonetaryAmount expected = null ; try { expected = m . with ( org . javamoney . adopjsr . MonetaryConversions . getConversion ( org . javamoney . adopjsr . ConversionQueryBuilder . of ( ) . setTermCurrency ( u1 ) . build ( ) ) ) ; } catch ( java . lang . Exception e ) { exception = true ; } javax . money . MonetaryAmount res = conv . convertAmountDefault ( u1 , m ) ; try { "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { if ( ! exception ) { throw e ; } } } } } convertAmountDefault ( javax . money . CurrencyUnit , javax . money . MonetaryAmount ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertEquals ( expected , res )
testRemove ( ) { com . liferay . portal . kernel . model . ResourceAction newResourceAction = addResourceAction ( ) ; _persistence . remove ( newResourceAction ) ; com . liferay . portal . kernel . model . ResourceAction existingResourceAction = _persistence . fetchByPrimaryKey ( newResourceAction . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertNull ( existingResourceAction )
testDisplayNeighborOperationalState ( ) { createDefaultProtocol ( ) ; org . opendaylight . protocol . bgp . cli . utils . BGPOperationalStateUtils . displayBgpOperationalState ( getDataBroker ( ) , this . stream , org . opendaylight . protocol . bgp . cli . utils . BGPOperationalStateUtilsTest . RIB_ID , null , org . opendaylight . protocol . bgp . cli . utils . NeighborStateCliUtilsTest . NEIGHBOR_ADDRESS ) ; final java . lang . String expected = org . apache . commons . io . IOUtils . toString ( getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "empty-neighbor.txt" ) , org . opendaylight . protocol . bgp . cli . utils . PeerGroupStateCliUtilsTest . UTF8 ) ; "<AssertPlaceHolder>" ; } toString ( ) { return peerId . getValue ( ) . substring ( org . opendaylight . protocol . bgp . rib . spi . RouterId . PEER_ID_PREFIX_LENGTH ) ; }
org . junit . Assert . assertEquals ( expected , this . output . toString ( ) )
setsYearOnV1TagOnly ( ) { com . mpatric . mp3agic . ID3v1 id3v1Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v1TagForTesting ( ) ; com . mpatric . mp3agic . ID3Wrapper wrapper = new com . mpatric . mp3agic . ID3Wrapper ( id3v1Tag , null ) ; wrapper . setYear ( "a<sp>year" ) ; "<AssertPlaceHolder>" ; } getYear ( ) { if ( ( ( ( id3v2Tag ) != null ) && ( ( id3v2Tag . getYear ( ) ) != null ) ) && ( ( id3v2Tag . getYear ( ) . length ( ) ) > 0 ) ) { return id3v2Tag . getYear ( ) ; } else if ( ( id3v1Tag ) != null ) { return id3v1Tag . getYear ( ) ; } else { return null ; } }
org . junit . Assert . assertEquals ( "a<sp>year" , id3v1Tag . getYear ( ) )
cloneAdhocQueryRequest ( ) { oasis . names . tc . ebxml_regrep . xsd . query . _3 . AdhocQueryRequest request = new oasis . names . tc . ebxml_regrep . xsd . query . _3 . AdhocQueryRequest ( ) ; request . setId ( "11111" ) ; oasis . names . tc . ebxml_regrep . xsd . query . _3 . AdhocQueryRequest clonedRequest = msgUtils . clone ( request ) ; request . setId ( "22222" ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( "11111" , clonedRequest . getId ( ) )
testHasSameOriginSameProvider ( ) { com . orange . cepheus . cep . model . Provider provider = new com . orange . cepheus . cep . model . Provider ( "http://sameUrl" ) ; provider . setServiceName ( "SN" ) ; provider . setServicePath ( "SP" ) ; com . orange . cepheus . cep . model . Provider pr = new com . orange . cepheus . cep . model . Provider ( "http://sameUrl" ) ; pr . setServiceName ( "SN" ) ; pr . setServicePath ( "SP" ) ; boolean checkTest = pr . hasSameOrigin ( provider ) ; "<AssertPlaceHolder>" ; } hasSameOrigin ( com . orange . cepheus . cep . model . Provider ) { if ( otherProvider != null ) { if ( ( ( otherProvider . url ) != null ) && ( ! ( otherProvider . url . isEmpty ( ) ) ) ) { return ( ( url . equals ( otherProvider . url ) ) && ( java . util . Objects . equals ( servicePath , otherProvider . servicePath ) ) ) && ( java . util . Objects . equals ( serviceName , otherProvider . serviceName ) ) ; } } return false ; }
org . junit . Assert . assertTrue ( checkTest )
test_LIKE ( ) { final java . lang . Object [ ] cases = new java . lang . Object [ ] { new java . lang . Object [ ] { "aa_b" 5 , "aa_b" 2 , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 5 , null , Boolean . FALSE } , new java . lang . Object [ ] { null , "aa_b" 3 , Boolean . FALSE } , new java . lang . Object [ ] { null , "aa_b" 2 , Boolean . TRUE } , new java . lang . Object [ ] { "aa_b" 2 , null , Boolean . TRUE } , new java . lang . Object [ ] { "aa_b" 2 , "aa_b" 2 , Boolean . TRUE } , new java . lang . Object [ ] { "aa_b" 4 , "aa_b" 1 , Boolean . TRUE } , new java . lang . Object [ ] { "aa_b" 4 , "aa_b" 0 , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "a.*b" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "a\\%b" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "aa_b" , Boolean . TRUE } , new java . lang . Object [ ] { "aa_b" 4 , "aa\\_b" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "a_b" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "aa.b" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 1 , "a\\%b" , Boolean . TRUE } , new java . lang . Object [ ] { "aa_b" 1 , "a\\\\%b" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "aaab\\" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "aa[a]b" , Boolean . FALSE } , new java . lang . Object [ ] { "aa_b" 4 , "aa[[a]b" , Boolean . FALSE } } ; for ( int i = 0 ; i < ( cases . length ) ; i ++ ) { java . lang . Object [ ] c = ( ( java . lang . Object [ ] ) ( cases [ i ] ) ) ; java . lang . String str = ( ( java . lang . String ) ( c [ 0 ] ) ) ; java . lang . String pattern = ( ( java . lang . String ) ( c [ 1 ] ) ) ; java . lang . Boolean expected = ( ( java . lang . Boolean ) ( c [ 2 ] ) ) ; java . lang . Object result = org . eclipse . birt . data . engine . script . ScriptEvalUtil . evalConditionalExpr ( str , IConditionalExpression . OP_LIKE , pattern , null ) ; "<AssertPlaceHolder>" ; } } evalConditionalExpr ( java . lang . Object , int , java . lang . Object [ ] , org . eclipse . birt . data . engine . api . BaseCompareHints ) { org . eclipse . birt . data . engine . api . script . BaseScriptEvalUtil . ExprTextAndValue [ ] opTextAndValue = new org . eclipse . birt . data . engine . api . script . BaseScriptEvalUtil . ExprTextAndValue [ ops . length ] ; for ( int i = 0 ; i < ( ops . length ) ; i ++ ) { opTextAndValue [ i ] = org . eclipse . birt . data . engine . api . script . BaseScriptEvalUtil . createExprTextAndValueInstance ( ops [ i ] ) ; } java . lang . Object resultObject = obj ; java . lang . Object [ ] resultOp = new java . lang . Object [ ops . length ] ; for ( int i = 0 ; i < ( ops . length ) ; i ++ ) { resultOp [ i ] = opTextAndValue [ i ] . value ; if ( ( operator != ( org . eclipse . birt . data . engine . api . IConditionalExpression . OP_IN ) ) && ( operator != ( org . eclipse . birt . data . engine . api . IConditionalExpression . OP_NOT_IN ) ) ) { if ( ( ( opTextAndValue [ i ] . value ) != null ) && ( opTextAndValue [ i ] . value . getClass ( ) . isArray ( ) ) ) { if ( ( java . lang . reflect . Array . getLength ( opTextAndValue [ i ] . value ) ) > 1 ) { throw new org . eclipse . birt . data . engine . core . DataException ( org . eclipse . birt . data . engine . i18n . ResourceConstants . BAD_COMPARE_SINGLE_WITH_MULITI , org . eclipse . birt . data . engine . api . script . BaseScriptEvalUtil . toStringForMultiValues ( opTextAndValue [ i ] . value ) ) ; } if ( ( java . lang . reflect . Array . getLength ( opTextAndValue [ i ] . value ) ) == 0 ) { resultOp [ i ] = null ; } else if ( ( java . lang . reflect . Array . getLength ( opTextAndValue [ i ] . value ) ) == 1 ) { resultOp [ i ] = java . lang . reflect . Array . get ( opTextAndValue [ i ] . value , 0 ) ; } opTextAndValue [ i ] . value = resultOp [ i ] ; } } } java . lang . Object
org . junit . Assert . assertEquals ( result , expected )
singleColumnUniqueWithNulls ( ) { final int tid = createTable ( "test" , "t1" , "id<sp>int<sp>not<sp>null<sp>primary<sp>key,<sp>name<sp>varchar(32),<sp>unique(name)" ) ; writeRows ( row ( tid , 1 , "abc" ) , row ( tid , 2 , "def" ) , row ( tid , 3 , null ) , row ( tid , 4 , "ghi" ) , row ( tid , 5 , null ) ) ; "<AssertPlaceHolder>" ; try { writeRows ( row ( tid , 6 , "abc" ) ) ; org . junit . Assert . fail ( "DuplicateKeyException<sp>expected" ) ; } catch ( com . foundationdb . server . error . DuplicateKeyException e ) { } } scanAll ( int ) { com . foundationdb . server . test . Table table = getTable ( tableID ) ; com . foundationdb . qp . operator . Operator plan = scanTablePlan ( table ) ; return runPlan ( session ( ) , com . foundationdb . qp . util . SchemaCache . globalSchema ( table . getAIS ( ) ) , plan ) ; }
org . junit . Assert . assertEquals ( 5 , scanAll ( tid ) . size ( ) )
isIdentifierInUseByAnotherPatient_shouldReturnTrueWhenPatientIdentifierDoesNotContainAPatientAndAPatientHasThisId ( ) { org . openmrs . PatientIdentifierType pit = org . openmrs . api . PatientServiceTest . patientService . getPatientIdentifierType ( 1 ) ; org . openmrs . PatientIdentifier patientIdentifier = new org . openmrs . PatientIdentifier ( "7TU-8" , pit , null ) ; "<AssertPlaceHolder>" ; } isIdentifierInUseByAnotherPatient ( org . openmrs . PatientIdentifier ) { boolean checkPatient = ( ( patientIdentifier . getPatient ( ) ) != null ) && ( ( patientIdentifier . getPatient ( ) . getPatientId ( ) ) != null ) ; boolean checkLocation = ( ( patientIdentifier . getLocation ( ) ) != null ) && ( ( patientIdentifier . getIdentifierType ( ) . getUniquenessBehavior ( ) ) == ( org . openmrs . PatientIdentifierType . UniquenessBehavior . LOCATION ) ) ; java . lang . String hql = "select<sp>count(*)<sp>from<sp>PatientIdentifier<sp>pi,<sp>Patient<sp>p<sp>where<sp>pi.patient.patientId<sp>=<sp>p.patient.patientId<sp>" + "and<sp>p.voided<sp>=<sp>false<sp>and<sp>pi.voided<sp>=<sp>false<sp>and<sp>pi.identifier<sp>=<sp>:identifier<sp>and<sp>pi.identifierType<sp>=<sp>:idType" ; if ( checkPatient ) { hql += "<sp>and<sp>p.patientId<sp>!=<sp>:ptId" ; } if ( checkLocation ) { hql += "<sp>and<sp>pi.location<sp>=<sp>:locationId" ; } org . hibernate . Query query = sessionFactory . getCurrentSession ( ) . createQuery ( hql ) ; query . setString ( "identifier" , patientIdentifier . getIdentifier ( ) ) ; query . setInteger ( "idType" , patientIdentifier . getIdentifierType ( ) . getPatientIdentifierTypeId ( ) ) ; if ( checkPatient ) { query . setInteger ( "ptId" , patientIdentifier . getPatient ( ) . getPatientId ( ) ) ; } if ( checkLocation ) { query . setInteger ( "locationId" , patientIdentifier . getLocation ( ) . getLocationId ( ) ) ; } return ! ( "0" . equals ( query . uniqueResult ( ) . toString ( ) ) ) ; }
org . junit . Assert . assertTrue ( org . openmrs . api . PatientServiceTest . patientService . isIdentifierInUseByAnotherPatient ( patientIdentifier ) )
move_right ( ) { a . move ( 2 , 4 , 5 ) ; "<AssertPlaceHolder>" ; } move ( int , int , int ) { if ( from < to ) { for ( int i = length - 1 ; i >= 0 ; -- i ) set ( ( to + i ) , get ( ( from + i ) ) ) ; } else if ( from > to ) { for ( int i = 0 ; i < length ; ++ i ) set ( ( to + i ) , get ( ( from + i ) ) ) ; } }
org . junit . Assert . assertArrayEquals ( new java . lang . Object [ ] { 5 , 6 , 7 , 10 , null , null , null , null , null , null , 1 , 2 , 3 , 4 , 3 , 4 } , a . array )
testManageAckStreamingOperationNoAck ( ) { final com . stratio . decision . clustering . ClusterSyncManager spyClusterSyncManager = org . powermock . api . mockito . PowerMockito . spy ( new com . stratio . decision . clustering . ClusterSyncManager ( com . stratio . decision . commons . constants . STREAMING . ZK_CLUSTER_MANAGER_PATH , "id" , configurationContext , failOverTask , curatorFramework , zkUtils , clusterBarrierManager ) ) ; org . powermock . api . mockito . PowerMockito . doReturn ( true ) . when ( spyClusterSyncManager ) . isLeader ( ) ; doNothing ( ) . when ( zkUtils ) . createZNodeJsonReply ( any ( com . stratio . decision . commons . messages . StratioStreamingMessage . class ) , any ( java . lang . Object . class ) ) ; com . stratio . decision . commons . dto . ActionCallbackDto reply = spyClusterSyncManager . manageAckStreamingOperation ( message , nodeReply ) ; "<AssertPlaceHolder>" ; } manageAckStreamingOperation ( com . stratio . decision . commons . messages . StratioStreamingMessage , com . stratio . decision . commons . dto . ActionCallbackDto ) { com . stratio . decision . commons . dto . ActionCallbackDto ackReply = reply ; try { if ( ! ( clusteringEnabled ) ) { zkUtils . createZNodeJsonReply ( message , reply ) ; } else { if ( allAckEnabled ) { zkUtils . createTempZNodeJsonReply ( message , reply , groupId ) ; java . lang . String path = zkUtils . getTempZNodeJsonReplyPath ( message ) ; java . lang . String barrierPath = path . concat ( "/" ) . concat ( com . stratio . decision . clustering . ClusterSyncManager . BARRIER_RELATIVE_PATH ) ; if ( ( this . clusterBarrierManager ) == null ) { clusterBarrierManager = new com . stratio . decision . clustering . ClusterBarrierManager ( this , ackTimeout ) ; } boolean success = clusterBarrierManager . manageAckBarrier ( path , clusterNodes . size ( ) ) ; if ( isLeader ( ) ) { ackReply = manageBarrierResults ( message , reply , path , success ) ; } } else { if ( isLeader ( ) ) { zkUtils . createZNodeJsonReply ( message , reply ) ; } } } } catch ( java . lang . Exception e ) { com . stratio . decision . clustering . ClusterSyncManager . logger . error ( "Exception<sp>managing<sp>the<sp>ack<sp>of<sp>the<sp>group<sp>{}<sp>for<sp>the<sp>request<sp>{}:<sp>{}" , groupId , message . getRequest_id ( ) , e . getMessage ( ) ) ; } return ackReply ; }
org . junit . Assert . assertEquals ( nodeReply , reply )
testSetting_CommonMinMappers ( ) { java . lang . String actualCommand = com . thinkbiganalytics . kylo . nifi . teradata . tdch . core . processor . utils . TdchBuilderTest . getBaseTdchBuilder ( ) . setCommonThrottleMappers ( true ) . setCommonMinMappers ( 3 ) . build ( ) ; java . lang . String expectedCommand = ( ( ( ( ( ( ( com . thinkbiganalytics . kylo . nifi . teradata . tdch . core . processor . utils . TdchBuilderTest . getBaseTdchCommand1 ( ) ) + ( com . thinkbiganalytics . kylo . nifi . teradata . tdch . core . processor . utils . TdchBuilderTest . SPACE ) ) + ( com . thinkbiganalytics . kylo . nifi . teradata . tdch . core . processor . utils . TdchBuilderTest . getBaseTdchCommand2 ( ) ) ) + ( com . thinkbiganalytics . kylo . nifi . teradata . tdch . core . processor . utils . TdchBuilderTest . SPACE ) ) + "-throttlemappers<sp>\"true\"" ) + ( com . thinkbiganalytics . kylo . nifi . teradata . tdch . core . processor . utils . TdchBuilderTest . SPACE ) ) + "-minmappers<sp>\"3\"" ) + ( com . thinkbiganalytics . kylo . nifi . teradata . tdch . core . processor . utils . TdchBuilderTest . SPACE ) ; "<AssertPlaceHolder>" ; } getBaseTdchCommand2 ( ) { return "-jobtype<sp>\"hive\"" ; }
org . junit . Assert . assertEquals ( expectedCommand , actualCommand )
nullAttributeTwoDocs ( ) { eu . europa . esig . dss . xades . validation . DetachedSignatureResolver resolver = new eu . europa . esig . dss . xades . validation . DetachedSignatureResolver ( java . util . Arrays . < eu . europa . esig . dss . DSSDocument > asList ( new eu . europa . esig . dss . InMemoryDocument ( new byte [ ] { 1 , 2 , 3 } ) , new eu . europa . esig . dss . InMemoryDocument ( new byte [ ] { 2 , 3 } ) ) , eu . europa . esig . dss . DigestAlgorithm . SHA256 ) ; org . w3c . dom . Attr attr = null ; org . apache . xml . security . utils . resolver . ResourceResolverContext context = new org . apache . xml . security . utils . resolver . ResourceResolverContext ( attr , null , false ) ; "<AssertPlaceHolder>" ; resolver . engineResolveURI ( context ) ; } engineCanResolveURI ( org . apache . xml . security . utils . resolver . ResourceResolverContext ) { return ( nullURI ( context ) ) || ( definedFilename ( context ) ) ; }
org . junit . Assert . assertTrue ( resolver . engineCanResolveURI ( context ) )
testRegularRoleTrue ( ) { boolean result = _callTestRegularRole ( true ) ; "<AssertPlaceHolder>" ; } _callTestRegularRole ( boolean ) { when ( _roleLocalService . fetchRole ( 1 , "test" ) ) . thenReturn ( _role ) ; when ( _role . getType ( ) ) . thenReturn ( RoleConstants . TYPE_REGULAR ) ; when ( _userLocalService . hasRoleUser ( 1 , "test" , 1 , true ) ) . thenReturn ( returnValue ) ; com . liferay . dynamic . data . mapping . form . evaluator . internal . function . DefaultDDMExpressionParameterAccessor ddmExpressionParameterAccessor = new com . liferay . dynamic . data . mapping . form . evaluator . internal . function . DefaultDDMExpressionParameterAccessor ( ) ; ddmExpressionParameterAccessor . setGetCompanyIdSupplier ( ( ) -> 1L ) ; ddmExpressionParameterAccessor . setGetUserIdSupplier ( ( ) -> 1L ) ; _belongsToRoleFunction . setDDMExpressionParameterAccessor ( ddmExpressionParameterAccessor ) ; return _belongsToRoleFunction . apply ( new java . lang . String [ ] { "test" } ) ; }
org . junit . Assert . assertTrue ( result )
testNoMatchAfterTwo ( ) { java . util . List < java . lang . String > candidates = fetchCandidates ( ":operation-properties-one-two-three(two=2,oo" ) ; "<AssertPlaceHolder>" ; } asList ( ) { final java . util . List < java . lang . String > result = new java . util . ArrayList ( ) ; for ( java . util . Collection < org . wildfly . core . launcher . Arguments . Argument > args : map . values ( ) ) { for ( org . wildfly . core . launcher . Arguments . Argument arg : args ) { result . add ( arg . asCommandLineArgument ( ) ) ; } } return result ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( ) , candidates )
testDecimalLogicalTypeWithDeprecatedPrecision ( ) { org . apache . parquet . schema . PrimitiveType expected = new org . apache . parquet . schema . PrimitiveType ( REQUIRED , BINARY , "aDecimal" , org . apache . parquet . schema . LogicalTypeAnnotation . decimalType ( 3 , 4 ) ) ; org . apache . parquet . schema . PrimitiveType actual = org . apache . parquet . schema . Types . required ( org . apache . parquet . schema . BINARY ) . as ( org . apache . parquet . schema . LogicalTypeAnnotation . decimalType ( 3 , 4 ) ) . precision ( 4 ) . named ( "aDecimal" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expected , actual )
testConvertAll ( ) { java . lang . String topic = "topic" ; java . lang . String content = "content" ; org . lnu . is . domain . broadcasting . BroadcastingMessage source = new org . lnu . is . domain . broadcasting . BroadcastingMessage ( ) ; source . setContent ( content ) ; source . setTopic ( topic ) ; java . util . List < org . lnu . is . domain . broadcasting . BroadcastingMessage > sources = java . util . Arrays . asList ( source ) ; org . lnu . is . resource . broadcasting . BroadcastingMessageResource expected = new org . lnu . is . resource . broadcasting . BroadcastingMessageResource ( ) ; expected . setTopic ( topic ) ; expected . setContent ( content ) ; java . util . List < org . lnu . is . resource . broadcasting . BroadcastingMessageResource > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . resource . broadcasting . BroadcastingMessageResource > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
org . junit . Assert . assertEquals ( expecteds , actuals )
testSerialization ( ) { org . jfree . chart . renderer . xy . XYDifferenceRenderer r1 = new org . jfree . chart . renderer . xy . XYDifferenceRenderer ( java . awt . Color . red , java . awt . Color . blue , false ) ; org . jfree . chart . renderer . xy . XYDifferenceRenderer r2 = ( ( org . jfree . chart . renderer . xy . XYDifferenceRenderer ) ( 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 )
testParameterizedTypesAllowed ( ) { java . lang . reflect . Constructor < ? > [ ] ctors = com . picocontainer . parameters . ConstantParameterTestCase . ConstantParameterTestClass . class . getConstructors ( ) ; java . lang . reflect . Type [ ] t = ctors [ 0 ] . getGenericParameterTypes ( ) ; com . picocontainer . parameters . ConstantParameter param = new com . picocontainer . parameters . ConstantParameter ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } resolve ( com . picocontainer . PicoContainer , com . picocontainer . ComponentAdapter , com . picocontainer . ComponentAdapter , java . lang . reflect . Type , com . picocontainer . NameBinding , boolean , java . lang . annotation . Annotation ) { return new com . picocontainer . parameters . Resolver ( ) { final com . picocontainer . parameters . Resolver resolver = com . picocontainer . parameters . ComponentParameter . super . resolve ( container , forAdapter , injecteeAdapter , expectedType , expectedNameBinding , useNames , binding ) ; public boolean isResolved ( ) { boolean superResolved = resolver . isResolved ( ) ; if ( ! superResolved ) { if ( ( collectionParameter ) != null ) { return collectionParameter . resolve ( container , forAdapter , null , expectedType , expectedNameBinding , useNames , binding ) . isResolved ( ) ; } return false ; } return superResolved ; } public java . lang . Object resolveInstance ( final java . lang . reflect . Type into ) { java . lang . Object result = null ; if ( ( expectedType instanceof java . lang . Class ) || ( ( expectedType instanceof java . lang . reflect . ParameterizedType ) && ( ( ( ( java . lang . reflect . ParameterizedType ) ( expectedType ) ) . getRawType ( ) ) == ( javax . inject . Provider . class ) ) ) ) { result = com . picocontainer . parameters . ComponentParameter . super . resolve ( container , forAdapter , injecteeAdapter , expectedType , expectedNameBinding , useNames , binding ) . resolveInstance ( into ) ; } else if ( expectedType instanceof java . lang . reflect . ParameterizedType ) { result = com . picocontainer . parameters . ComponentParameter . super . resolve ( container , forAdapter , injecteeAdapter , ( ( java . lang . reflect . ParameterizedType ) ( expectedType ) ) . getRawType ( ) , expectedNameBinding , useNames , binding ) . resolveInstance ( into ) ; } if ( ( result == null ) && ( ( collectionParameter ) != null ) ) { result = collectionParameter . resolve ( container , forAdapter , injecteeAdapter , expectedType , expectedNameBinding , useNames , binding ) . resolveInstance ( into ) ; } return result ; } public com . picocontainer . ComponentAdapter < ? > getComponentAdapter ( ) { return resolver . getComponentAdapter ( ) ; } } ; }
org . junit . Assert . assertTrue ( param . resolve ( null , null , null , t [ 0 ] , null , false , null ) . isResolved ( ) )
Load_String_List ( ) { com . mysema . rdfbean . object . Session session = com . mysema . rdfbean . object . SessionUtil . openSession ( com . mysema . rdfbean . object . ListContainerTest . Example . class ) ; com . mysema . rdfbean . object . ListContainerTest . Example example = new com . mysema . rdfbean . object . ListContainerTest . Example ( ) ; example . list = java . util . Arrays . asList ( "1" , "2" , "3" , "4" ) ; session . save ( example ) ; session . clear ( ) ; example = session . findInstances ( com . mysema . rdfbean . object . ListContainerTest . Example . class ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } get ( com . mysema . rdfbean . model . ID ) { return datatypeToType . get ( id ) ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "1" , "2" , "3" , "4" ) , example . list )
testDoJob_csv_createdir ( ) { System . out . println ( "doJob<sp>4" ) ; instance . setInputFile ( ( ( basedir ) + "/short.jtl" ) ) ; instance . setOutputCSVFile ( kg . apc . emulators . TestJMeterUtils . getTempDir ( ) . concat ( File . separator ) . concat ( "testFile.csv" ) ) ; instance . setPluginType ( "ResponseTimesOverTime" ) ; instance . addExportMode ( PluginsCMDWorker . EXPORT_CSV ) ; int result = instance . doJob ( ) ; int expResult = 0 ; "<AssertPlaceHolder>" ; } doJob ( ) { org . apache . jorphan . collections . HashTree testTree ; try { testTree = loadJMX ( new java . io . File ( jmx ) ) ; kg . apc . cmdtools . TestPlanCheckTool . log . info ( "JMX<sp>is<sp>fine" ) ; } catch ( java . lang . Exception e ) { kg . apc . cmdtools . TestPlanCheckTool . log . error ( "Failed<sp>to<sp>load<sp>JMX" , e ) ; return 1 ; } if ( isStats ) { showStats ( testTree ) ; } if ( isDump ) { dumpTree ( testTree ) ; } return 0 ; }
org . junit . Assert . assertEquals ( expResult , result )
discardRPreservesTypeSafeKey ( ) { com . jnape . palatable . lambda . adt . hmap . TypeSafeKey . Simple < java . lang . String > stringKey = com . jnape . palatable . lambda . adt . hmap . TypeSafeKey . typeSafeKey ( ) ; com . jnape . palatable . lambda . adt . hmap . TypeSafeKey < java . lang . String , java . lang . String > discardedKey = stringKey . discardR ( simpleIso ( id ( ) , id ( ) ) ) ; com . jnape . palatable . lambda . adt . hmap . HMap map = com . jnape . palatable . lambda . adt . hmap . HMap . emptyHMap ( ) . put ( stringKey , "123" ) ; "<AssertPlaceHolder>" ; } just ( A ) { if ( a == null ) throw new java . lang . NullPointerException ( ) ; return new com . jnape . palatable . lambda . adt . Maybe . Just < > ( a ) ; }
org . junit . Assert . assertEquals ( com . jnape . palatable . lambda . adt . Maybe . just ( "123" ) , map . get ( discardedKey ) )
complexSort ( ) { final com . yandex . yoctodb . mutable . DatabaseBuilder dbBuilder = com . yandex . yoctodb . DatabaseFormat . getCurrent ( ) . newDatabaseBuilder ( ) ; for ( int i = 0 ; i < ( DOCS ) ; i ++ ) { dbBuilder . merge ( com . yandex . yoctodb . DatabaseFormat . getCurrent ( ) . newDocumentBuilder ( ) . withField ( "f1" , ( i / 2 ) , com . yandex . yoctodb . SORTABLE ) . withField ( "f2" , i , com . yandex . yoctodb . SORTABLE ) . withPayload ( ( "payload" + i ) . getBytes ( ) ) ) ; } final java . io . ByteArrayOutputStream os = new java . io . ByteArrayOutputStream ( ) ; dbBuilder . buildWritable ( ) . writeTo ( os ) ; final com . yandex . yoctodb . immutable . Database db = com . yandex . yoctodb . DatabaseFormat . getCurrent ( ) . getDatabaseReader ( ) . from ( com . yandex . yoctodb . util . buf . Buffer . from ( os . toByteArray ( ) ) ) ; final com . yandex . yoctodb . query . Query q = select ( ) . orderBy ( desc ( "f1" ) ) . and ( asc ( "f2" ) ) ; final java . util . List < java . lang . String > results = new java . util . ArrayList ( DOCS ) ; db . execute ( q , new com . yandex . yoctodb . StringProcessor ( results ) ) ; final java . util . List < java . lang . String > expected = new java . util . ArrayList ( DOCS ) ; for ( int i = ( DOCS ) - 2 ; i >= 0 ; i -= 2 ) { expected . add ( ( "payload" + i ) ) ; expected . add ( ( "payload" + ( i + 1 ) ) ) ; } "<AssertPlaceHolder>" ; } execute ( com . yandex . yoctodb . query . Query , com . yandex . yoctodb . query . DocumentProcessor ) { throw new java . lang . IllegalStateException ( ) ; }
org . junit . Assert . assertEquals ( expected , results )
test_equals_otherType ( ) { org . joda . money . format . MoneyAmountStyle a = MoneyAmountStyle . LOCALIZED_GROUPING ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == other ) { return true ; } if ( other instanceof org . joda . money . BigMoney ) { org . joda . money . BigMoney otherMoney = ( ( org . joda . money . BigMoney ) ( other ) ) ; return ( currency . equals ( otherMoney . getCurrencyUnit ( ) ) ) && ( amount . equals ( otherMoney . amount ) ) ; } return false ; }
org . junit . Assert . assertEquals ( false , a . equals ( new java . lang . Object ( ) ) )
utf8FixupUtf ( ) { org . mockito . Mockito . when ( request . getQueryString ( ) ) . thenReturn ( ( ( ( java . net . URLEncoder . encode ( "" , "UTF-8" ) ) + "=" ) + ( java . net . URLEncoder . encode ( "rvztrtkrfr" , "UTF-8" ) ) ) ) ; java . util . HashMap < java . lang . String , java . lang . Object [ ] > params = new java . util . HashMap < java . lang . String , java . lang . Object [ ] > ( ) ; servlet . utf8Fixup ( request , params ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return elements . get ( elementName ) ; }
org . junit . Assert . assertEquals ( "rvztrtkrfr" , params . get ( "" ) [ 0 ] )
testKeyLength ( ) { if ( ( org . sakaiproject . basiclti . util . BlowFish . MAX_KEY_LENGTH ) != 16 ) { log . warn ( "Warning:<sp>changing<sp>the<sp>BlowFish.MAX_KEY_LENGTH<sp>may<sp>cause<sp>interoperability<sp>issues" ) ; } "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 16 , BlowFish . MAX_KEY_LENGTH )
testLeaseRecoveryAfterFailover ( ) { final org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . setBoolean ( DFSConfigKeys . DFS_PERMISSIONS_ENABLED_KEY , false ) ; conf . setInt ( DFSConfigKeys . DFS_BLOCK_SIZE_KEY , org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . BLOCK_SIZE ) ; org . apache . hadoop . fs . FSDataOutputStream stm = null ; final org . apache . hadoop . hdfs . MiniDFSCluster cluster = new org . apache . hadoop . hdfs . MiniDFSCluster . Builder ( conf ) . nnTopology ( org . apache . hadoop . hdfs . MiniDFSNNTopology . simpleHOPSTopology ( 2 ) ) . numDataNodes ( 3 ) . build ( ) ; try { cluster . waitActive ( ) ; java . lang . Thread . sleep ( 500 ) ; org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . LOG . info ( "Starting<sp>with<sp>NN<sp>0<sp>active" ) ; org . apache . hadoop . fs . FileSystem fs = cluster . getFileSystem ( 0 ) ; stm = fs . create ( org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . TEST_PATH ) ; org . apache . hadoop . hdfs . AppendTestUtil . write ( stm , 0 , org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . BLOCK_AND_A_HALF ) ; stm . hflush ( ) ; org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . LOG . info ( "Failing<sp>over<sp>to<sp>NN<sp>1" ) ; cluster . restartNameNode ( 0 ) ; cluster . waitActive ( ) ; "<AssertPlaceHolder>" ; org . apache . hadoop . fs . FileSystem fsOtherUser = createFsAsOtherUser ( cluster , conf ) ; org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . loopRecoverLease ( fsOtherUser , org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . TEST_PATH ) ; org . apache . hadoop . hdfs . AppendTestUtil . check ( fs , org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . TEST_PATH , org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . BLOCK_AND_A_HALF ) ; } finally { org . apache . hadoop . io . IOUtils . closeStream ( stm ) ; cluster . shutdown ( ) ; } } exists ( org . apache . hadoop . fs . Path ) { return fs . exists ( p ) ; }
org . junit . Assert . assertTrue ( fs . exists ( org . apache . hadoop . hdfs . server . namenode . ha . TestPipelinesFailover . TEST_PATH ) )
should_get_all_active_projects ( ) { when ( projectDao . findAllActive ( ) ) . thenReturn ( com . google . common . collect . Lists . newArrayList ( net . rrm . ehour . domain . ProjectObjectMother . createProject ( 1 ) ) ) ; java . util . List < net . rrm . ehour . domain . Project > activeProjects = projectService . getActiveProjects ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return nodes . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , activeProjects . size ( ) )