input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testGetLongFromByte ( ) { byte value = org . apache . activemq . artemis . utils . RandomUtil . randomByte ( ) ; org . apache . activemq . artemis . jms . client . ActiveMQMapMessage message = new org . apache . activemq . artemis . jms . client . ActiveMQMapMessage ( ) ; message . setByte ( itemName , value ) ; "<AssertPlaceHolder>" ; } getLong ( java . lang . String ) { java . lang . Object value ; value = content . get ( name ) ; if ( value == null ) { return java . lang . Long . parseLong ( null ) ; } if ( value instanceof java . lang . Byte ) { return ( ( java . lang . Byte ) ( value ) ) . longValue ( ) ; } else if ( value instanceof java . lang . Short ) { return ( ( java . lang . Short ) ( value ) ) . longValue ( ) ; } else if ( value instanceof java . lang . Integer ) { return ( ( java . lang . Integer ) ( value ) ) . longValue ( ) ; } else if ( value instanceof java . lang . Long ) { return ( ( java . lang . Long ) ( value ) ) . longValue ( ) ; } else if ( value instanceof java . lang . String ) { return java . lang . Long . parseLong ( ( ( java . lang . String ) ( value ) ) ) ; } else { throw new javax . jms . MessageFormatException ( "Invalid<sp>conversion" ) ; } }
org . junit . Assert . assertEquals ( value , message . getLong ( itemName ) )
getChildTestChildNotFound ( ) { final org . opendaylight . yangtools . yang . data . impl . schema . tree . InMemoryDataTreeSnapshot inMemoryDataTreeSnapshot = new org . opendaylight . yangtools . yang . data . impl . schema . tree . InMemoryDataTreeSnapshot ( SCHEMA_CONTEXT , org . opendaylight . yangtools . yang . data . api . schema . tree . spi . TreeNodeFactory . createTreeNode ( createDocumentOne ( ) , org . opendaylight . yangtools . yang . data . api . schema . tree . spi . Version . initial ( ) ) , rootOper ) ; final org . opendaylight . yangtools . yang . data . api . schema . tree . spi . TreeNode rootNode = inMemoryDataTreeSnapshot . getRootNode ( ) ; final java . util . Optional < org . opendaylight . yangtools . yang . data . api . schema . tree . spi . TreeNode > node = org . opendaylight . yangtools . yang . data . api . schema . tree . StoreTreeNodes . getChild ( java . util . Optional . ofNullable ( rootNode ) , TestModel . OUTER_LIST_PATH . getLastPathArgument ( ) ) ; "<AssertPlaceHolder>" ; } isPresent ( ) { return org . opendaylight . yangtools . concepts . CheckedValue . isFirst ( ) ; }
org . junit . Assert . assertFalse ( node . isPresent ( ) )
testJobCompletionListener ( ) { this . tg . addTask ( this . A ) ; this . tg . addTask ( this . B ) ; this . tg . addTask ( this . C ) ; org . osc . core . broker . job . JobEngineTest . JobCompletionResponder responder = new org . osc . core . broker . job . JobEngineTest . JobCompletionResponder ( ) ; this . job = this . je . submit ( "Job-completion-listener" , this . tg , responder , false ) ; this . job . waitForCompletion ( ) ; "<AssertPlaceHolder>" ; } isCalled ( ) { return this . isCalled ; }
org . junit . Assert . assertTrue ( responder . isCalled ( ) )
testObjectDeserialization ( ) { com . owlike . genson . Genson genson = createTimestampGenson ( java . time . YearMonth . class , TimestampFormat . OBJECT ) ; java . time . YearMonth yearMonth = java . time . YearMonth . of ( 2010 , 11 ) ; java . lang . String json = "{\"year\":2010,\"month\":11}" ; "<AssertPlaceHolder>" ; } deserialize ( com . owlike . genson . stream . ObjectReader , com . owlike . genson . Context ) { T obj ; if ( options . isAsTimestamp ( ) ) { switch ( options . getTimestampFormat ( ) ) { case ARRAY : obj = readArray ( reader ) ; break ; case OBJECT : obj = readObject ( reader ) ; break ; default : throw new java . lang . IllegalArgumentException ( "Unsupported<sp>timestamp<sp>format" ) ; } } else { obj = parseFunction . apply ( reader . valueAsString ( ) ) ; } return obj ; }
org . junit . Assert . assertEquals ( yearMonth , genson . deserialize ( json , java . time . YearMonth . class ) )
testWithAnInteger ( ) { java . lang . Integer i = new java . lang . Integer ( 2 ) ; getBlock2 ( ) . setValue ( i ) ; "<AssertPlaceHolder>" ; } getBlock2 ( ) { return block2 ; }
org . junit . Assert . assertEquals ( i , getBlock2 ( ) . getValue ( ) )
testReverse3 ( ) { org . nd4j . linalg . api . ndarray . INDArray array = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 } ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ) ; org . nd4j . linalg . api . ndarray . INDArray rev = org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . api . ops . impl . transforms . same . OldReverse ( array , org . nd4j . linalg . factory . Nd4j . createUninitialized ( array . length ( ) ) ) ) ; "<AssertPlaceHolder>" ; } length ( ) { return length ; }
org . junit . Assert . assertEquals ( exp , rev )
testReloadUserData_ec2 ( ) { this . agent . parameters = net . roboconf . agent . internal . misc . AgentConstants . PLATFORM_EC2 ; this . agent . overrideProperties = true ; this . agent . userDataHelper = org . mockito . Mockito . mock ( net . roboconf . agent . internal . misc . UserDataHelper . class ) ; this . agent . reloadUserData ( ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( this . agent . userDataHelper , org . mockito . Mockito . only ( ) ) . findParametersForAmazonOrOpenStack ( org . mockito . Mockito . any ( java . util . logging . Logger . class ) ) ; } reloadUserData ( ) { if ( net . roboconf . core . utils . Utils . isEmptyOrWhitespaces ( this . parameters ) ) { this . logger . warning ( "No<sp>parameters<sp>were<sp>specified<sp>in<sp>the<sp>agent<sp>configuration.<sp>No<sp>user<sp>data<sp>will<sp>be<sp>retrieved." ) ; } else if ( ! ( this . overrideProperties ) ) { this . logger . fine ( "User<sp>data<sp>are<sp>NOT<sp>supposed<sp>to<sp>be<sp>used." ) ; } else if ( Constants . AGENT_RESET . equalsIgnoreCase ( this . parameters ) ) { if ( ( ( getMessagingClient ( ) ) != null ) && ( ( getMessagingClient ( ) . getMessageProcessor ( ) ) != null ) ) ( ( net . roboconf . agent . internal . AgentMessageProcessor ) ( getMessagingClient ( ) . getMessageProcessor ( ) ) ) . resetRequest ( ) ; } else { net . roboconf . agent . internal . AgentProperties props = null ; this . logger . fine ( "User<sp>data<sp>are<sp>supposed<sp>to<sp>be<sp>used.<sp>Retrieving<sp>in<sp>progress..." ) ; if ( ( AgentConstants . PLATFORM_EC2 . equalsIgnoreCase ( this . parameters ) ) || ( AgentConstants . PLATFORM_OPENSTACK . equalsIgnoreCase ( this . parameters ) ) ) props = this . userDataHelper . findParametersForAmazonOrOpenStack ( this . logger ) ; else if ( AgentConstants . PLATFORM_AZURE . equalsIgnoreCase ( this . parameters ) ) props = this . userDataHelper . findParametersForAzure ( this . logger ) ; else if ( AgentConstants . PLATFORM_VMWARE . equalsIgnoreCase ( this . parameters ) ) props = this . userDataHelper . findParametersForVmware ( this . logger ) ; else if ( Constants . AGENT_RESET . equalsIgnoreCase ( this . parameters ) ) props = new net . roboconf . agent . internal . AgentProperties ( ) ; else props = this . userDataHelper . findParametersFromUrl ( this . parameters , this . logger ) ; if ( props != null ) { java . lang . String errorMessage = null ; if ( ( ! ( Constants . AGENT_RESET . equalsIgnoreCase ( this . parameters ) ) ) && ( ( errorMessage = props . validate ( ) ) != null ) ) { this . logger . severe ( ( "An<sp>error<sp>was<sp>found<sp>in<sp>user<sp>data.<sp>" + errorMessage ) ) ; } this . applicationName = props . getApplicationName ( ) ; this . domain = props . getDomain ( ) ; this . scopedInstancePath = props . getScopedInstancePath ( ) ; if ( ! ( net . roboconf . core . utils . Utils . isEmptyOrWhitespaces ( props . getIpAddress ( ) ) ) ) { this . ipAddress = props . getIpAddress ( ) ; this . logger . info ( ( "The<sp>agent's<sp>address<sp>was<sp>overwritten<sp>from<sp>user<sp>data<sp>and<sp>set<sp>to<sp>" + ( this . ipAddress ) ) ) ; } try { this . logger . info ( "Reconfiguring<sp>the<sp>agent<sp>with<sp>user<sp>data." ) ; this . userDataHelper . reconfigureMessaging ( this . karafEtc , props . getMessagingConfiguration ( ) ) ; } catch ( java . lang . Exception e ) { this . logger . severe ( ( "Error<sp>in<sp>messaging<sp>reconfiguration<sp>from<sp>user<sp>data:<sp>" + e ) ) ; } } } }
org . junit . Assert . assertEquals ( AgentConstants . PLATFORM_EC2 , this . agent . parameters )
testBatchLoad ( ) { final int numItems = 200 ; java . util . List < com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . NumberSetAttributeClass > objs = new java . util . ArrayList < com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . NumberSetAttributeClass > ( ) ; java . util . List < com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . KeyPair > keyPairs = new java . util . LinkedList < com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . KeyPair > ( ) ; java . lang . Class < ? > clazz = null ; for ( int i = 0 ; i < numItems ; i ++ ) { com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . NumberSetAttributeClass obj = getUniqueNumericObject ( ) ; objs . add ( obj ) ; clazz = obj . getClass ( ) ; keyPairs . add ( new com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . KeyPair ( ) . withHashKey ( obj . getKey ( ) ) ) ; } mapper . batchSave ( objs ) ; java . util . Map < java . lang . Class < ? > , java . util . List < com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . KeyPair > > itemsToGet = new java . util . HashMap < java . lang . Class < ? > , java . util . List < com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . KeyPair > > ( ) ; java . util . Map < java . lang . String , java . util . List < java . lang . Object > > response = null ; itemsToGet . put ( clazz , keyPairs ) ; response = mapper . batchLoad ( itemsToGet ) ; java . util . List < java . lang . Object > items = response . get ( com . amazonaws . mobileconnectors . dynamodbv2 . dynamodbmapper . TABLE_NAME ) ; "<AssertPlaceHolder>" ; for ( java . lang . Object item : items ) { objs . contains ( item ) ; } java . lang . Thread . sleep ( ( 1000 * 10 ) ) ; } size ( ) { return com . amazonaws . http . IdleConnectionReaper . CONNECTION_MANAGERS . size ( ) ; }
org . junit . Assert . assertEquals ( numItems , items . size ( ) )
testDeptRepoDeletAll ( ) { int total = 0 ; deptRepo . deleteAll ( ) ; java . lang . Iterable < com . tomniu . model . Department > depts = deptRepo . findAll ( ) ; for ( com . tomniu . model . Department dept : depts ) { total ++ ; } "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 0 , total )
isDigitFirst1 ( ) { char ch = '2' ; java . lang . Class < ? > c = com . diffblue . deeptestutils . Reflector . forName ( "com.alibaba.fastjson.JSONPath$JSONPathParser" ) ; java . lang . reflect . Method m = c . getDeclaredMethod ( "isDigitFirst" , com . diffblue . deeptestutils . Reflector . forName ( "char" ) ) ; m . setAccessible ( true ) ; boolean retval = ( ( java . lang . Boolean ) ( m . invoke ( null , ch ) ) ) ; "<AssertPlaceHolder>" ; } setAccessible ( java . lang . reflect . AccessibleObject ) { if ( ! ( com . alibaba . fastjson . util . TypeUtils . setAccessibleEnable ) ) { return ; } if ( obj . isAccessible ( ) ) { return ; } try { obj . setAccessible ( true ) ; } catch ( java . security . AccessControlException error ) { com . alibaba . fastjson . util . TypeUtils . setAccessibleEnable = false ; } }
org . junit . Assert . assertEquals ( true , retval )
testPlayerMove_noMovement_false ( ) { when ( player . getLocation ( ) ) . thenReturn ( new org . bukkit . Location ( world , 0 , 0 , 0 ) ) ; "<AssertPlaceHolder>" ; } hasPlayerMoved ( ) { final double MAX_MOVE_TOLERANCE = 1.5 ; return ( distance3D ( player . getLocation ( ) , originalLocation ) ) > MAX_MOVE_TOLERANCE ; }
org . junit . Assert . assertFalse ( job . hasPlayerMoved ( ) )
testGetUriWithFilterOne ( ) { org . restheart . handlers . RequestContext context = prepareRequestContext ( ) ; java . lang . String expResult = "/dbName/collName?filter={'referenceField':'id'}" ; java . lang . String result ; try { result = org . restheart . utils . URLUtils . getUriWithFilterOne ( context , "dbName" , "collName" , "referenceField" , new org . bson . BsonString ( "id" ) ) ; "<AssertPlaceHolder>" ; } catch ( org . restheart . hal . UnsupportedDocumentIdException ex ) { org . junit . Assert . fail ( ex . getMessage ( ) ) ; } } getUriWithFilterOne ( org . restheart . handlers . RequestContext , java . lang . String , java . lang . String , java . lang . String , org . bson . BsonValue ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "/" ) . append ( dbName ) . append ( "/" ) . append ( collName ) . append ( "a" 0 ) . append ( "filter={" ) . append ( "'" ) . append ( referenceField ) . append ( "'" ) . append ( ":" ) . append ( org . restheart . utils . URLUtils . getIdString ( id ) ) . append ( "}" ) ; return context . mapUri ( sb . toString ( ) ) ; }
org . junit . Assert . assertEquals ( expResult , result )
firstLevelInheritance ( ) { com . github . mauricioaniche . ck . CKClassResult b = com . github . mauricioaniche . ck . metric . DITTest . report . get ( "dit.B" ) ; "<AssertPlaceHolder>" ; } getDit ( ) { return dit ; }
org . junit . Assert . assertEquals ( 2 , b . getDit ( ) )
putsByte ( ) { byte [ ] array = new byte [ 4 ] ; java . nio . ByteBuffer buffer = java . nio . ByteBuffer . wrap ( array ) ; buffer . put ( ( ( byte ) ( 2 ) ) ) . put ( ( ( byte ) ( 3 ) ) ) . put ( ( ( byte ) ( 5 ) ) ) . put ( ( ( byte ) ( 7 ) ) ) ; "<AssertPlaceHolder>" ; } put ( E ) { java . util . Objects . requireNonNull ( e ) ; while ( isFull ( ) ) { waitForChange ( 0 ) ; } addImpl ( e ) ; }
org . junit . Assert . assertThat ( array , org . hamcrest . CoreMatchers . is ( new byte [ ] { 2 , 3 , 5 , 7 } ) )
testAsIntWithDefault ( ) { final org . jboss . dmr . LongModelValue value = new org . jboss . dmr . LongModelValue ( 5L ) ; "<AssertPlaceHolder>" ; } asInt ( int ) { return value ; }
org . junit . Assert . assertEquals ( 5 , value . asInt ( 10 ) )
testPropertyMapGetValues ( ) { com . eclipsesource . v8 . utils . V8PropertyMap < java . lang . Object > map = new com . eclipsesource . v8 . utils . V8PropertyMap < java . lang . Object > ( ) ; map . put ( "foo" , map ) ; map . put ( "bar" , null ) ; map . put ( "baz" , null ) ; java . util . Collection < java . lang . Object > values = map . values ( ) ; "<AssertPlaceHolder>" ; values . contains ( map ) ; values . contains ( null ) ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , values . size ( ) )
testNestedDummyQuery ( ) { java . lang . String [ ] bindingNameFilter = new java . lang . String [ 1 ] ; bindingNameFilter [ 0 ] = "FILTER_AMOUNT" ; org . eclipse . birt . data . engine . api . IBaseExpression [ ] bindingExprFilter = new org . eclipse . birt . data . engine . api . IBaseExpression [ 1 ] ; bindingExprFilter [ 0 ] = new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "dataSetRow.AMOUNT" ) ; org . eclipse . birt . data . engine . api . querydefn . FilterDefinition [ ] filterDefn = new org . eclipse . birt . data . engine . api . querydefn . FilterDefinition [ ] { new org . eclipse . birt . data . engine . api . querydefn . FilterDefinition ( new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "row.FILTER_AMOUNT<sp><<sp>0" ) ) } ; java . lang . String [ ] bindingNameRow = new java . lang . String [ 6 ] ; bindingNameRow [ 0 ] = "row.FILTER_AMOUNT<sp><<sp>0" 2 ; bindingNameRow [ 1 ] = "ROW_rowPosition" ; bindingNameRow [ 2 ] = "ROW_COUNTRY" ; bindingNameRow [ 3 ] = "ROW_CITY" ; bindingNameRow [ 4 ] = "ROW_SALE_DATE" ; bindingNameRow [ 5 ] = "row.FILTER_AMOUNT<sp><<sp>0" 0 ; org . eclipse . birt . data . engine . api . IBaseExpression [ ] bindingExprRow = new org . eclipse . birt . data . engine . api . IBaseExpression [ 6 ] ; bindingExprRow [ 0 ] = new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "dataSetRow[0]" ) ; bindingExprRow [ 1 ] = new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "dataSetRow._rowPosition" ) ; bindingExprRow [ 2 ] = new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "dataSetRow.COUNTRY" ) ; bindingExprRow [ 3 ] = new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "row.FILTER_AMOUNT<sp><<sp>0" 3 ) ; bindingExprRow [ 4 ] = new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "row.FILTER_AMOUNT<sp><<sp>0" 1 ) ; bindingExprRow [ 5 ] = new org . eclipse . birt . data . engine . api . querydefn . ScriptExpression ( "dataSetRow.AMOUNT" ) ; org . eclipse . birt . data . engine . api . querydefn . QueryDefinition queryDefination = createQuery ( null , null , null , null , null , null , bindingNameFilter , bindingExprFilter , filterDefn , bindingNameRow , bindingExprRow ) ; org . eclipse . birt . data . engine . api . IResultIterator result = executeQuery ( queryDefination ) ; org . eclipse . birt . data . engine . api . IBaseQueryResults outer = result . getQueryResults ( ) ; org . eclipse . birt . data . engine . api . querydefn . QueryDefinition dummyQd = new org . eclipse . birt . data . engine . api . querydefn . QueryDefinition ( ) ; org . eclipse . birt . data . engine . api . IPreparedQuery preparedQuery = dataEngine . prepare ( dummyQd ) ; org . eclipse . birt . data . engine . api . IQueryResults queryResults = preparedQuery . execute ( outer , null ) ; "<AssertPlaceHolder>" ; } execute ( java . lang . String , java . util . HashMap ) { org . eclipse . birt . core . template . TextTemplate template = new org . eclipse . birt . core . template . TemplateParser ( ) . parse ( text ) ; org . eclipse . birt . report . engine . executor . ExecutionContext context = new org . eclipse . birt . report . engine . executor . ExecutionContext ( ) ; org . eclipse . birt . report . engine . executor . template . TemplateExecutor executor = new org . eclipse . birt . report . engine . executor . template . TemplateExecutor ( context ) ; return executor . execute ( template , values ) ; }
org . junit . Assert . assertNotNull ( queryResults )
shouldOKNullEnd ( ) { org . cedj . geekseek . web . rest . core . test . unit . StartBeforeEndValidationTestCase . StartEndDate obj = new org . cedj . geekseek . web . rest . core . test . unit . StartBeforeEndValidationTestCase . StartEndDate ( ) ; obj . start = new java . util . Date ( ) ; obj . end = null ; java . util . Set < javax . validation . ConstraintViolation < org . cedj . geekseek . web . rest . core . test . unit . StartBeforeEndValidationTestCase . StartEndDate > > result = validator . validate ( obj ) ; "<AssertPlaceHolder>" ; } validate ( java . lang . Object ) { java . util . Set < javax . validation . ConstraintViolation < java . lang . Object > > violations = validator . validate ( conference ) ; if ( ! ( violations . isEmpty ( ) ) ) { throw new javax . validation . ConstraintViolationException ( new java . util . HashSet < javax . validation . ConstraintViolation < ? > > ( violations ) ) ; } }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testSimpleWithDecimalsTrunc ( ) { org . hipparchus . geometry . euclidean . twod . Vector2D c = new org . hipparchus . geometry . euclidean . twod . Vector2D ( 1.232323232323 , 1.434343434343 ) ; java . lang . String expected = ( ( ( "{1" + ( getDecimalCharacter ( ) ) ) + "2323232323;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "4343434343}" ; java . lang . String actual = vector2DFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( org . hipparchus . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testPathTraversalWithDotDot ( ) { javax . servlet . http . HttpServletRequest request = createNiceMock ( javax . servlet . http . HttpServletRequest . class ) ; javax . servlet . http . HttpServletResponse response = createNiceMock ( javax . servlet . http . HttpServletResponse . class ) ; javax . servlet . FilterChain chain = createNiceMock ( javax . servlet . FilterChain . class ) ; resolver . getFilterChainManager ( ) . addToChain ( "/index.html" , "authcBasic" ) ; expect ( request . getAttribute ( WebUtils . INCLUDE_CONTEXT_PATH_ATTRIBUTE ) ) . andReturn ( null ) . anyTimes ( ) ; expect ( request . getContextPath ( ) ) . andReturn ( "" ) ; expect ( request . getRequestURI ( ) ) . andReturn ( "/public/../index.html" ) ; replay ( request ) ; javax . servlet . FilterChain resolved = resolver . getChain ( request , response , chain ) ; "<AssertPlaceHolder>" ; verify ( request ) ; } getChain ( javax . servlet . ServletRequest , javax . servlet . ServletResponse , javax . servlet . FilterChain ) { java . lang . String path = org . apache . shiro . web . util . WebUtils . getPathWithinApplication ( org . apache . shiro . web . util . WebUtils . toHttp ( request ) ) ; for ( final java . lang . String pathPattern : chains . keySet ( ) ) { if ( patternMatcher . matches ( pathPattern , path ) ) { final java . util . Iterator < com . google . inject . Key < ? extends javax . servlet . Filter > > chain = java . util . Arrays . asList ( chains . get ( pathPattern ) ) . iterator ( ) ; return new org . apache . shiro . guice . web . SimpleFilterChain ( originalChain , new java . util . Iterator < javax . servlet . Filter > ( ) { public boolean hasNext ( ) { return chain . hasNext ( ) ; } public javax . servlet . Filter next ( ) { return injector . getInstance ( chain . next ( ) ) ; } public void remove ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } } ) ; } } return null ; }
org . junit . Assert . assertNotNull ( resolved )
configGet ( ) { java . util . List < java . lang . String > info = jedis . configGet ( "m*" ) ; "<AssertPlaceHolder>" ; } configGet ( byte [ ] ) { sendCommand ( redis . clients . jedis . CONFIG , Keyword . GET . raw , pattern ) ; }
org . junit . Assert . assertNotNull ( info )
shouldUseContainerForNewComponent ( ) { final br . com . caelum . vraptor . view . DogController myDog = new br . com . caelum . vraptor . view . DogController ( ) ; br . com . caelum . vraptor . interceptor . InstanceContainer container = new br . com . caelum . vraptor . interceptor . InstanceContainer ( myDog ) ; br . com . caelum . vraptor . interceptor . InstantiateInterceptor interceptor = new br . com . caelum . vraptor . interceptor . InstantiateInterceptor ( container ) ; when ( method . getResource ( ) ) . thenReturn ( new br . com . caelum . vraptor . resource . DefaultResourceClass ( br . com . caelum . vraptor . view . DogController . class ) ) ; interceptor . intercept ( stack , method , null ) ; "<AssertPlaceHolder>" ; verify ( stack ) . next ( method , myDog ) ; } isEmpty ( ) { return getFullList ( ) . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( container . isEmpty ( ) )
testInvalidRange ( ) { java . lang . String [ ] invalidRangeValues = new java . lang . String [ ] { null , "1-" 4 , "1-" 8 , "1-" 3 , "1d" , "1.0" , "1.0" 4 , "%" , "1.0" 3 , "1-" 6 , "&" , "1.0" 5 , "1.0" 7 , "1.0" 9 , "1-" 0 , "1-" , "1.0" 6 , "1+2" , "**" , "*-" , "1-" 9 , "1-" 7 , "1.0" 2 , "1.0" 0 , "1-" 2 , "1.0" 5 , "1-" 5 , "<sp>-2<sp>-3<sp>-4" , "1.0" 8 , "1-" 1 } ; for ( java . lang . String invalidRange : invalidRangeValues ) { boolean accepts = org . jboss . as . ejb3 . timerservice . schedule . value . RangeValue . accepts ( invalidRange ) ; "<AssertPlaceHolder>" ; try { org . jboss . as . ejb3 . timerservice . schedule . value . RangeValue invalidRangeValue = new org . jboss . as . ejb3 . timerservice . schedule . value . RangeValue ( invalidRange ) ; org . junit . Assert . fail ( ( "Range<sp>value<sp>did<sp>*not*<sp>throw<sp>IllegalArgumentException<sp>for<sp>an<sp>invalid<sp>range:<sp>" + invalidRange ) ) ; } catch ( java . lang . IllegalArgumentException iae ) { } } } accepts ( java . lang . String ) { if ( value == null ) { return false ; } java . util . regex . Matcher matcher = org . jboss . as . ejb3 . timerservice . schedule . value . RangeValue . RANGE_PATTERN . matcher ( value ) ; return matcher . matches ( ) ; }
org . junit . Assert . assertFalse ( ( "1.0" 1 + invalidRange ) , accepts )
isUnauthenticated_nullSubject ( ) { "<AssertPlaceHolder>" ; } isUnauthenticated ( javax . security . auth . Subject ) { if ( ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ) && ( com . ibm . ws . messaging . security . utility . MessagingSecurityUtility . tc . isEntryEnabled ( ) ) ) { com . ibm . ws . sib . utils . ras . SibTr . entry ( com . ibm . ws . messaging . security . utility . MessagingSecurityUtility . tc , ( ( com . ibm . ws . messaging . security . utility . MessagingSecurityUtility . CLASS_NAME ) + "isUnauthenticated" ) , subject ) ; } boolean result = com . ibm . ws . messaging . security . utility . MessagingSecurityUtility . subjectHelper . isUnauthenticated ( subject ) ; if ( ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ) && ( com . ibm . ws . messaging . security . utility . MessagingSecurityUtility . tc . isEntryEnabled ( ) ) ) { com . ibm . ws . sib . utils . ras . SibTr . exit ( com . ibm . ws . messaging . security . utility . MessagingSecurityUtility . tc , ( ( com . ibm . ws . messaging . security . utility . MessagingSecurityUtility . CLASS_NAME ) + "isUnauthenticated" ) , result ) ; } return result ; }
org . junit . Assert . assertTrue ( subjectHelper . isUnauthenticated ( null ) )
testNoError ( ) { boolean result = checkNoError ( "Social_Files_Get_My_Files" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
testStringToHexArray ( ) { java . lang . String hex = "019f314a" ; byte [ ] hexArray = org . apache . flink . util . StringUtils . hexStringToByte ( hex ) ; byte [ ] expectedArray = new byte [ ] { 1 , - 97 , 49 , 74 } ; "<AssertPlaceHolder>" ; } hexStringToByte ( java . lang . String ) { final byte [ ] bts = new byte [ ( hex . length ( ) ) / 2 ] ; for ( int i = 0 ; i < ( bts . length ) ; i ++ ) { bts [ i ] = ( ( byte ) ( java . lang . Integer . parseInt ( hex . substring ( ( 2 * i ) , ( ( 2 * i ) + 2 ) ) , 16 ) ) ) ; } return bts ; }
org . junit . Assert . assertArrayEquals ( expectedArray , hexArray )
containShouldReturnTrueWhenElementWithIdPresent ( ) { adapter . put ( "1" , object1 , org . springframework . data . map . MapKeyValueAdapterUnitTests . COLLECTION_1 ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object , java . lang . String ) { return ( get ( id , keyspace ) ) != null ; }
org . junit . Assert . assertThat ( adapter . contains ( "1" , org . springframework . data . map . MapKeyValueAdapterUnitTests . COLLECTION_1 ) , org . hamcrest . core . Is . is ( true ) )
shouldGetElementAt ( ) { com . orange . dgil . trail . core . common . TrailPoint [ ] points = new com . orange . dgil . trail . core . common . TrailPoint [ 3 ] ; points [ 0 ] = new com . orange . dgil . trail . core . common . TrailPoint ( ) ; com . orange . dgil . trail . TestTools . setObj ( "points" , com . orange . dgil . trail . core . vecto . SlidingWindow . class , slidingWindow , points ) ; int index = 0 ; org . mockito . Mockito . when ( slidingWindow . isIndexValid ( index ) ) . thenReturn ( true ) ; org . mockito . Mockito . doCallRealMethod ( ) . when ( slidingWindow ) . getElementAt ( index ) ; com . orange . dgil . trail . core . common . TrailPoint ret = slidingWindow . getElementAt ( index ) ; "<AssertPlaceHolder>" ; } getElementAt ( int ) { if ( isIndexValid ( index ) ) { return points [ index ] ; } else { throw getInvalidIndexException ( index ) ; } }
org . junit . Assert . assertEquals ( points [ 0 ] , ret )
testRefScenario ( ) { com . sap . core . odata . api . edm . provider . EdmProvider testProvider = new com . sap . core . odata . testutil . mock . EdmTestProvider ( ) ; com . sap . core . odata . api . processor . ODataResponse response = com . sap . core . odata . api . ep . EntityProvider . writeMetadata ( testProvider . getSchemas ( ) , null ) ; java . lang . String stream = com . sap . core . odata . testutil . helper . StringHelper . inputStreamToString ( ( ( java . io . InputStream ) ( response . getEntity ( ) ) ) ) ; com . sap . core . odata . core . edm . parser . EdmParser parser = new com . sap . core . odata . core . edm . parser . EdmParser ( ) ; com . sap . core . odata . api . edm . provider . DataServices result = parser . readMetadata ( createStreamReader ( stream ) , true ) ; com . sap . core . odata . api . processor . ODataResponse response2 = com . sap . core . odata . api . ep . EntityProvider . writeMetadata ( result . getSchemas ( ) , null ) ; java . lang . String streamAfterParse = com . sap . core . odata . testutil . helper . StringHelper . inputStreamToString ( ( ( java . io . InputStream ) ( response2 . getEntity ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getEntity ( ) { com . sap . core . odata . processor . core . jpa . ODataJPAResponseBuilderTest . SalesOrderHeader sHeader = new com . sap . core . odata . processor . core . jpa . ODataJPAResponseBuilderTest . SalesOrderHeader ( 10 , 34 ) ; return sHeader ; }
org . junit . Assert . assertEquals ( stream , streamAfterParse )
canDisplayGeorgian ( ) { "<AssertPlaceHolder>" ; } findFontFor ( java . lang . String ) { try { return org . sejda . impl . sambox . util . FontUtils . findFontFor ( new org . sejda . sambox . pdmodel . PDDocument ( ) , s ) ; } finally { org . sejda . impl . sambox . util . FontUtils . clearLoadedFontCache ( ) ; } }
org . junit . Assert . assertNotNull ( findFontFor ( "<sp>" ) )
verifyMaxClusterSizeForStaticCluster ( ) { oracle . kubernetes . operator . wlsconfig . WlsClusterConfig wlsClusterConfig = new oracle . kubernetes . operator . wlsconfig . WlsClusterConfig ( "cluster1" ) ; wlsClusterConfig . addServerConfig ( createWlsServerConfig ( "ms-0" , 8011 , null ) ) ; "<AssertPlaceHolder>" ; } getMaxClusterSize ( ) { return hasDynamicServers ( ) ? ( getClusterSize ( ) ) + ( getMaxDynamicClusterSize ( ) ) : getClusterSize ( ) ; }
org . junit . Assert . assertThat ( wlsClusterConfig . getMaxClusterSize ( ) , org . hamcrest . Matchers . equalTo ( 1 ) )
testGetWhiteBoardMissingCallbackHandler ( ) { org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModule loginModule = org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . initLoginModule ( org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . TestCredentials . class , null , null ) ; "<AssertPlaceHolder>" ; } getWhiteboard ( ) { return whiteboard ; }
org . junit . Assert . assertNull ( loginModule . getWhiteboard ( ) )
test ( ) { io . katharsis . jpa . JpaRepositoryFilterBase filter = org . mockito . Mockito . spy ( new io . katharsis . jpa . JpaRepositoryFilterBase ( ) ) ; module . addFilter ( filter ) ; io . katharsis . queryspec . QuerySpec querySpec = new io . katharsis . queryspec . QuerySpec ( io . katharsis . jpa . model . TestEntity . class ) ; io . katharsis . resource . list . ResourceList < io . katharsis . jpa . model . TestEntity > list = repo . findAll ( querySpec ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( filter , org . mockito . Mockito . times ( 1 ) ) . filterQuerySpec ( org . mockito . Mockito . eq ( repo ) , org . mockito . Mockito . eq ( querySpec ) ) ; org . mockito . Mockito . verify ( filter , org . mockito . Mockito . times ( 1 ) ) . filterResults ( org . mockito . Mockito . eq ( repo ) , org . mockito . Mockito . eq ( querySpec ) , org . mockito . Mockito . eq ( list ) ) ; org . mockito . Mockito . verify ( filter , org . mockito . Mockito . times ( 1 ) ) . filterExecutor ( org . mockito . Mockito . eq ( repo ) , org . mockito . Mockito . eq ( querySpec ) , org . mockito . Mockito . any ( io . katharsis . jpa . query . JpaQueryExecutor . class ) ) ; org . mockito . Mockito . verify ( filter , org . mockito . Mockito . times ( 1 ) ) . filterTuples ( org . mockito . Mockito . eq ( repo ) , org . mockito . Mockito . eq ( querySpec ) , org . mockito . Mockito . anyList ( ) ) ; org . mockito . Mockito . verify ( filter , org . mockito . Mockito . times ( 1 ) ) . filterQuery ( org . mockito . Mockito . eq ( repo ) , org . mockito . Mockito . eq ( querySpec ) , org . mockito . Mockito . any ( io . katharsis . jpa . query . JpaQuery . class ) ) ; } size ( ) { return list . size ( ) ; }
org . junit . Assert . assertEquals ( 5 , list . size ( ) )
testTeaserWithoutLink ( ) { com . adobe . cq . wcm . core . components . models . Teaser teaser = getTeaserUnderTest ( com . adobe . cq . wcm . core . components . internal . models . v1 . TeaserImplTest . TEASER_4 ) ; verify ( teaserLogger ) . debug ( "Teaser<sp>component<sp>from<sp>/content/teasers/jcr:content/root/responsivegrid/teaser-4<sp>does<sp>not<sp>define<sp>a<sp>link." ) ; "<AssertPlaceHolder>" ; } getLinkURL ( ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertNull ( teaser . getLinkURL ( ) )
testIsAuthoritativeCompatibilityItemToPathMetadata ( ) { com . amazonaws . services . dynamodbv2 . document . Item item = org . mockito . Mockito . spy ( org . apache . hadoop . fs . s3a . s3guard . TestPathMetadataDynamoDBTranslation . TEST_DIR_ITEM ) ; item . withBoolean ( org . apache . hadoop . fs . s3a . s3guard . IS_AUTHORITATIVE , true ) ; PathMetadataDynamoDBTranslation . IGNORED_FIELDS . add ( org . apache . hadoop . fs . s3a . s3guard . IS_AUTHORITATIVE ) ; final java . lang . String user = org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) . getShortUserName ( ) ; org . apache . hadoop . fs . s3a . s3guard . DDBPathMetadata meta = itemToPathMetadata ( item , user ) ; org . mockito . Mockito . verify ( item , org . mockito . Mockito . never ( ) ) . getBoolean ( org . apache . hadoop . fs . s3a . s3guard . IS_AUTHORITATIVE ) ; "<AssertPlaceHolder>" ; } isAuthoritativeDir ( ) { return isAuthoritativeDir ; }
org . junit . Assert . assertFalse ( meta . isAuthoritativeDir ( ) )
test_getProperty_nest ( ) { navigator . setAllowPrivate ( true ) ; { java . lang . Class < ? > type = navigator . getPropertyType ( com . gh . mygreen . xlsmapper . util . PropertyTypeNavigatorTest . Person . class , "nest.price" ) ; "<AssertPlaceHolder>" . isEqualTo ( long . class ) ; } } getPropertyType ( java . lang . Class , java . lang . String ) { com . gh . mygreen . xlsmapper . util . ArgUtils . notEmpty ( property , "property" ) ; final com . gh . mygreen . xlsmapper . util . PropertyPath path = parseProperty ( property ) ; final java . util . LinkedList < java . lang . Object > stack = new java . util . LinkedList ( ) ; java . lang . Class < ? > targetClass = rootClass ; for ( com . gh . mygreen . xlsmapper . util . PropertyPath . Token token : path . getPathAsToken ( ) ) { targetClass = accessProperty ( targetClass , token , stack ) ; if ( targetClass == null ) { return null ; } } return targetClass ; }
org . junit . Assert . assertThat ( type )
testBuildWithDisabledDefaultConstraints ( ) { unit . setSecurity ( false ) ; unit . setActive ( false ) ; org . lnu . is . domain . degree . type . DegreeType context = new org . lnu . is . domain . degree . type . DegreeType ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>DegreeType<sp>e<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . degree . type . DegreeType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
singleCrossHierarchEdge_needsNoCrossHierarchy ( ) { org . eclipse . elk . alg . layered . graph . LNode leftNode = addNodeToLayer ( makeLayer ( ) ) ; org . eclipse . elk . alg . layered . graph . LNode rightOuterNode = addNodeToLayer ( makeLayer ( ) ) ; org . eclipse . elk . alg . layered . graph . LPort [ ] rightOuterPorts = addPortsOnSide ( 2 , rightOuterNode , PortSide . WEST ) ; eastWestEdgeFromTo ( leftNode , rightOuterPorts [ 1 ] ) ; setOnAllGraphs ( LayeredOptions . CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS , 0.1 , graph ) ; makeNestedTwoNodeGraphWithWesternPorts ( rightOuterNode , rightOuterPorts ) ; setUpAndMinimizeCrossings ( ) ; java . util . List < org . eclipse . elk . alg . layered . p3order . GraphInfoHolder > graphData = crossMin . getGraphData ( ) ; for ( org . eclipse . elk . alg . layered . p3order . GraphInfoHolder data : graphData ) { if ( data . hasParent ( ) ) { "<AssertPlaceHolder>" ; } } } dontSweepInto ( ) { return useBottomUp ; }
org . junit . Assert . assertFalse ( data . dontSweepInto ( ) )
testIOException ( ) { java . io . IOException test = new java . io . IOException ( "test" ) ; org . apache . nifi . toolkit . s2s . DataPacketDto dataPacketDto = new org . apache . nifi . toolkit . s2s . DataPacketDto ( "test-data" . getBytes ( StandardCharsets . UTF_8 ) ) . putAttribute ( "key" , "value" ) ; objectMapper . writeValue ( data , java . util . Arrays . stream ( new org . apache . nifi . toolkit . s2s . DataPacketDto [ ] { dataPacketDto } ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ; doThrow ( test ) . when ( transaction ) . send ( any ( org . apache . nifi . remote . protocol . DataPacket . class ) ) ; try { senderSupplier . get ( ) . sendFiles ( ) ; } catch ( java . io . IOException e ) { "<AssertPlaceHolder>" ; throw e ; } } sendFiles ( ) { org . apache . nifi . remote . Transaction transaction = siteToSiteClient . createTransaction ( TransferDirection . SEND ) ; try { org . apache . nifi . toolkit . s2s . DataPacketDto . getDataPacketStream ( input ) . forEachOrdered ( ( d ) -> { try { transaction . send ( d ) ; } catch ( e ) { throw new < org . apache . nifi . toolkit . s2s . e > java . lang . RuntimeException ( ) ; } } ) ; } catch ( java . lang . RuntimeException e ) { java . lang . Throwable cause = e . getCause ( ) ; if ( cause instanceof java . io . IOException ) { throw ( ( java . io . IOException ) ( cause ) ) ; } throw new java . io . IOException ( e . getMessage ( ) , e ) ; } transaction . confirm ( ) ; return transaction . complete ( ) ; }
org . junit . Assert . assertEquals ( test , e )
testE2ETokenRenewal ( ) { org . apache . hadoop . yarn . api . ApplicationMasterProtocol client ; try ( org . apache . hadoop . yarn . server . MiniYARNCluster cluster = new org . apache . hadoop . yarn . server . MiniYARNCluster ( "testE2ETokenRenewal" , 1 , 1 , 1 ) ; org . apache . hadoop . yarn . client . api . YarnClient rmClient = org . apache . hadoop . yarn . client . api . YarnClient . createYarnClient ( ) ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . yarn . conf . YarnConfiguration ( ) ; conf . setBoolean ( YarnConfiguration . AMRM_PROXY_ENABLED , true ) ; conf . setInt ( YarnConfiguration . RM_NM_EXPIRY_INTERVAL_MS , 1500 ) ; conf . setInt ( YarnConfiguration . RM_NM_HEARTBEAT_INTERVAL_MS , 1500 ) ; conf . setInt ( YarnConfiguration . RM_AM_EXPIRY_INTERVAL_MS , 1500 ) ; conf . setInt ( YarnConfiguration . RM_AMRM_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS , 6 ) ; cluster . init ( conf ) ; cluster . start ( ) ; final org . apache . hadoop . conf . Configuration yarnConf = cluster . getConfig ( ) ; yarnConf . set ( YarnConfiguration . RM_SCHEDULER_ADDRESS , YarnConfiguration . DEFAULT_AMRM_PROXY_ADDRESS ) ; rmClient . init ( yarnConf ) ; rmClient . start ( ) ; org . apache . hadoop . yarn . api . records . ApplicationId appId = createApp ( rmClient , cluster ) ; client = createAMRMProtocol ( rmClient , appId , cluster , yarnConf ) ; client . registerApplicationMaster ( org . apache . hadoop . yarn . api . protocolrecords . RegisterApplicationMasterRequest . newInstance ( org . apache . hadoop . net . NetUtils . getHostname ( ) , 1024 , "" ) ) ; org . apache . hadoop . yarn . client . api . impl . TestAMRMProxy . LOG . info ( "testAMRMPRoxy<sp>-<sp>Allocate<sp>Resources<sp>Application<sp>Master" ) ; org . apache . hadoop . yarn . api . protocolrecords . AllocateRequest request = createAllocateRequest ( rmClient . getNodeReports ( NodeState . RUNNING ) ) ; org . apache . hadoop . yarn . api . records . Token lastToken = null ; org . apache . hadoop . yarn . api . protocolrecords . AllocateResponse response = null ; for ( int i = 0 ; i < 5 ; i ++ ) { response = client . allocate ( request ) ; request . setResponseId ( ( ( request . getResponseId ( ) ) + 1 ) ) ; if ( ( ( response . getAMRMToken ( ) ) != null ) && ( ! ( response . getAMRMToken ( ) . equals ( lastToken ) ) ) ) { break ; } lastToken = response . getAMRMToken ( ) ; java . lang . Thread . sleep ( 1500 ) ; } "<AssertPlaceHolder>" ; org . apache . hadoop . yarn . client . api . impl . TestAMRMProxy . LOG . info ( "testAMRMPRoxy<sp>-<sp>Finish<sp>Application<sp>Master" ) ; client . finishApplicationMaster ( org . apache . hadoop . yarn . api . protocolrecords . FinishApplicationMasterRequest . newInstance ( FinalApplicationStatus . SUCCEEDED , "success" , null ) ) ; } } getAMRMToken ( ) { org . apache . hadoop . security . Credentials credentials = org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) . getCredentials ( ) ; java . util . Iterator < org . apache . hadoop . security . token . Token < ? > > iter = credentials . getAllTokens ( ) . iterator ( ) ; org . apache . hadoop . security . token . Token < org . apache . hadoop . yarn . security . AMRMTokenIdentifier > result = null ; while ( iter . hasNext ( ) ) { org . apache . hadoop . security . token . Token < ? > token = iter . next ( ) ; if ( token . getKind ( ) . equals ( AMRMTokenIdentifier . KIND_NAME ) ) { if ( result != null ) { org . junit . Assert . fail ( ( ( ( ( "credentials<sp>has<sp>more<sp>than<sp>one<sp>AMRM<sp>token." + "<sp>token1:<sp>" ) + result ) + "<sp>token2:<sp>" ) + token ) ) ; } result = ( ( org . apache . hadoop . security . token . Token < org . apache . hadoop . yarn . security . AMRMTokenIdentifier > ) ( token ) ) ; } } return result ; }
org . junit . Assert . assertFalse ( response . getAMRMToken ( ) . equals ( lastToken ) )
write ( ) { org . apache . oltu . oauth2 . jwt . JWT jwt = new org . apache . oltu . oauth2 . jwt . JWT . Builder ( ) . setHeaderAlgorithm ( "accounts.google.com" 1 ) . setHeaderCustomField ( "kid" , "be1da0b3567bd265a25098fbcc2b09f21345b3a2" ) . setClaimsSetAudience ( "accounts.google.com" 5 ) . setClaimsSetIssuer ( "accounts.google.com" ) . setClaimsSetSubject ( "106422453082479998429" ) . setClaimsSetExpirationTime ( 1366730217L ) . setClaimsSetIssuedAt ( 1366726317L ) . setClaimsSetCustomField ( "accounts.google.com" 2 , "106422453082479998429" ) . setClaimsSetCustomField ( "accounts.google.com" 4 , "true" ) . setClaimsSetCustomField ( "accounts.google.com" 3 , "true" ) . setClaimsSetCustomField ( "cid" , "accounts.google.com" 5 ) . setClaimsSetCustomField ( "azp" , "accounts.google.com" 5 ) . setClaimsSetCustomField ( "email" , "antonio.sanso@gmail.com" ) . setClaimsSetCustomField ( "accounts.google.com" 6 , "accounts.google.com" 7 ) . setClaimsSetCustomField ( "accounts.google.com" 0 , "accounts.google.com" 7 ) . setSignature ( "XWYi5Zj1YWAMGIml_ftoAwmvW1Y7oeybLCpzQrJVuWJpS8L8Vd2TL-RTIOEVG03VA7e0_-_frNuw7MxUgVEgh8G-Nnbk_baJ6k_3w5c1SKFamFiHHDoKLFhrt1Y8JKSuGwE02V-px4Cn0dRAQAc1IN5CU6wqCrYK0p-fv_fvy28" ) . build ( ) ; java . lang . String encodedJWT = new org . apache . oltu . oauth2 . jwt . io . JWTWriter ( ) . write ( jwt ) ; "<AssertPlaceHolder>" ; } write ( T ) { if ( token == null ) { throw new java . lang . IllegalArgumentException ( "Impossible<sp>to<sp>build<sp>a<sp>Token<sp>from<sp>a<sp>null<sp>JWS<sp>representation." ) ; } java . lang . String header = writeHeader ( token ) ; java . lang . String encodedHeader = base64Encode ( header ) ; java . lang . String body = writeBody ( token ) ; java . lang . String encodedBody = base64Encode ( body ) ; java . lang . String signature = writeSignature ( token ) ; return new java . lang . StringBuilder ( ) . append ( encodedHeader ) . append ( '.' ) . append ( encodedBody ) . append ( '.' ) . append ( signature ) . toString ( ) ; }
org . junit . Assert . assertEquals ( org . apache . oltu . oauth2 . jwt . JWT , encodedJWT )
setInputRangeValue ( ) { org . openqa . selenium . WebElement rangeField = driver . findElement ( org . openqa . selenium . By . id ( "range" ) ) ; rangeField . sendKeys ( "20" ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { assertElementNotStale ( ) ; if ( attribute . equalsIgnoreCase ( "value" ) ) { return callMethod ( ( "if(/^input|select|option|textarea$/i.test(locator.nodeName)){" + ( ( "return<sp>locator.value;" + "}" ) + "return<sp>locator.textContent;" ) ) ) ; } else { return callMethod ( ( ( ( ( "return<sp>" + ( OperaAtom . GET_ATTRIBUTE ) ) + "(locator,<sp>'" ) + attribute ) + "')" ) ) ; } }
org . junit . Assert . assertThat ( rangeField . getAttribute ( "value" ) , org . hamcrest . CoreMatchers . is ( "20" ) )
testGetScrollPanel ( ) { final com . google . gwt . user . client . ui . AbsolutePanel expectedPanel = mock ( com . google . gwt . user . client . ui . AbsolutePanel . class ) ; doReturn ( expectedPanel ) . when ( gridLienzoPanel ) . getScrollPanel ( ) ; final com . google . gwt . user . client . ui . AbsolutePanel actualPanel = gridLienzoScrollHandler . getScrollPanel ( ) ; "<AssertPlaceHolder>" ; } getScrollPanel ( ) { return scrollPanel ; }
org . junit . Assert . assertEquals ( expectedPanel , actualPanel )
testEquals ( ) { opennlp . tools . parser . Parse p1 = opennlp . tools . parser . Parse . parseParse ( opennlp . tools . parser . ParseTest . PARSE_STRING ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj instanceof opennlp . tools . tokenize . TokenSample ) { opennlp . tools . tokenize . TokenSample a = ( ( opennlp . tools . tokenize . TokenSample ) ( obj ) ) ; return ( getText ( ) . equals ( a . getText ( ) ) ) && ( java . util . Arrays . equals ( getTokenSpans ( ) , a . getTokenSpans ( ) ) ) ; } return false ; }
org . junit . Assert . assertTrue ( p1 . equals ( p1 ) )
shouldReturnFalseForEmptyArray ( ) { int [ ] nums = new int [ ] { } ; "<AssertPlaceHolder>" ; } containsDuplicate ( int [ ] ) { java . util . Set < java . lang . Integer > set = new java . util . HashSet < java . lang . Integer > ( ) ; for ( int i = 0 ; i < ( nums . length ) ; i ++ ) { if ( ! ( set . add ( nums [ i ] ) ) ) { return true ; } } return false ; }
org . junit . Assert . assertFalse ( containsDuplicate . containsDuplicate ( nums ) )
getValueStringByKeyValueNull ( ) { java . util . HashMap < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "key2" , null ) ; java . lang . String keyName = "key2" ; java . lang . String expResult = "" ; java . lang . String result = com . microsoft . azure . sdk . iot . deps . util . Tools . getValueStringByKey ( map , keyName ) ; "<AssertPlaceHolder>" ; } getValueStringByKey ( java . util . Map , java . lang . String ) { java . lang . String retVal ; if ( ( map == null ) || ( keyName == null ) ) { retVal = "" ; } else { java . lang . Object val = map . get ( keyName ) ; if ( val != null ) retVal = val . toString ( ) . trim ( ) ; else retVal = "" ; } return retVal ; }
org . junit . Assert . assertEquals ( expResult , result )
testGetVertices ( ) { com . puresoltechnologies . ductiledb . core . graph . StarWarsGraph . addStarWarsFiguresData ( com . puresoltechnologies . ductiledb . core . graph . DuctileDBGraphIT . graph ) ; java . lang . Iterable < com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex > vertices = com . puresoltechnologies . ductiledb . core . graph . DuctileDBGraphIT . graph . getVertices ( ) ; int count = 0 ; for ( @ com . puresoltechnologies . ductiledb . core . graph . SuppressWarnings ( "unused" ) com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex vertex : vertices ) { count ++ ; } "<AssertPlaceHolder>" ; } getVertices ( ) { try { com . puresoltechnologies . ductiledb . bigtable . BigTable table = openVertexTable ( ) ; com . puresoltechnologies . ductiledb . bigtable . ResultScanner result = table . getScanner ( new com . puresoltechnologies . ductiledb . bigtable . Scan ( ) ) ; return new com . puresoltechnologies . ductiledb . core . graph . tx . AttachedVertexIterable ( this , result ) ; } catch ( java . io . IOException e ) { throw new com . puresoltechnologies . ductiledb . core . DuctileDBException ( "Could<sp>not<sp>get<sp>vertices." , e ) ; } }
org . junit . Assert . assertEquals ( 10 , count )
getInitializer ( ) { org . springframework . context . annotation . AnnotationConfigApplicationContext cxt = new org . springframework . context . annotation . AnnotationConfigApplicationContext ( org . springframework . web . issues . MyConfig . class ) ; org . springframework . web . bind . support . ConfigurableWebBindingInitializer bean = cxt . getBean ( org . springframework . web . bind . support . ConfigurableWebBindingInitializer . class ) ; org . springframework . validation . Validator validator = bean . getValidator ( ) ; "<AssertPlaceHolder>" ; validator . validate ( new java . lang . Object ( ) , new org . springframework . validation . BeanPropertyBindingResult ( new java . lang . Object ( ) , "" ) ) ; } getValidator ( ) { this . getValidatorCalled = true ; this . counter . getAndIncrement ( ) ; return null ; }
org . junit . Assert . assertNotNull ( validator )
testBrpPersoonslijstGetterZonderInhoud ( ) { final nl . moderniseringgba . isc . esb . message . brp . generated . ErkenningNotarieelVerzoekType erkenningNotarieelVerzoek = new nl . moderniseringgba . isc . esb . message . brp . generated . ErkenningNotarieelVerzoekType ( ) ; final nl . moderniseringgba . isc . esb . message . brp . impl . ErkenningNotarieelVerzoekBericht erkenningNotarieelVerzoekBericht = new nl . moderniseringgba . isc . esb . message . brp . impl . ErkenningNotarieelVerzoekBericht ( erkenningNotarieelVerzoek ) ; "<AssertPlaceHolder>" ; } getBrpPersoonslijst ( ) { return asBrpPersoonslijst ( leesUitBrpAntwoordType . getBrpPl ( ) ) ; }
org . junit . Assert . assertNull ( erkenningNotarieelVerzoekBericht . getBrpPersoonslijst ( ) )
nullStringToDate ( ) { "<AssertPlaceHolder>" ; } stringToDate ( java . lang . String ) { org . sentilo . common . utils . DateUtils . LOCK_TZ_PSAB_DF . lock ( ) ; try { return org . springframework . util . StringUtils . hasText ( date ) ? org . sentilo . common . utils . DateUtils . TZ_PSAB_DF . parse ( org . sentilo . common . utils . DateUtils . formatToUTC ( date ) ) : null ; } catch ( final java . text . ParseException e ) { throw new java . lang . IllegalArgumentException ( ( "Error<sp>parsing<sp>date<sp>" + date ) , e ) ; } finally { org . sentilo . common . utils . DateUtils . LOCK_TZ_PSAB_DF . unlock ( ) ; } }
org . junit . Assert . assertNull ( org . sentilo . common . utils . DateUtils . stringToDate ( null ) )
testConstructors ( ) { net . sourceforge . pmd . properties . PropertyDescriptor < T > desc = createProperty ( ) ; "<AssertPlaceHolder>" ; try { createBadProperty ( ) ; } catch ( java . lang . Exception ex ) { return ; } org . junit . Assert . fail ( "uncaught<sp>constructor<sp>exception" ) ; } createProperty ( ) { return new net . sourceforge . pmd . properties . FloatProperty ( "testFloat" , "Test<sp>float<sp>property" , net . sourceforge . pmd . properties . FloatPropertyTest . MIN , net . sourceforge . pmd . properties . FloatPropertyTest . MAX , 9.0F , 1.0F ) ; }
org . junit . Assert . assertNotNull ( desc )
testBinaryEncodedToBase64 ( ) { com . vmware . xenon . common . TestGsonConfiguration . BinaryHolder instance = new com . vmware . xenon . common . TestGsonConfiguration . BinaryHolder ( ) ; instance . picture = "ssdfgsdgsdg" . getBytes ( ) ; java . lang . String base64encoded = java . util . Base64 . getEncoder ( ) . encodeToString ( instance . picture ) ; java . lang . String json = com . vmware . xenon . common . Utils . toJson ( instance ) ; "<AssertPlaceHolder>" ; } toJson ( java . lang . Object ) { if ( body instanceof java . lang . String ) { return ( ( java . lang . String ) ( body ) ) ; } java . lang . StringBuilder content = com . vmware . xenon . common . Utils . getBuilder ( ) ; com . vmware . xenon . common . serialization . JsonMapper mapper = com . vmware . xenon . common . serialization . GsonSerializers . getJsonMapperFor ( body ) ; mapper . toJson ( body , content ) ; return content . toString ( ) ; }
org . junit . Assert . assertTrue ( json . contains ( base64encoded ) )
testTranslateContextSuccessfull7 ( ) { ichunk . setContext ( ExplanationChunk . WARNING ) ; java . lang . String expResult = "WARNING" ; java . lang . String result = org . goodoldai . jeff . report . rtf . RTFChunkUtility . translateContext ( ichunk ) ; "<AssertPlaceHolder>" ; } translateContext ( org . goodoldai . jeff . explanation . ExplanationChunk ) { if ( echunk == null ) { throw new org . goodoldai . jeff . explanation . ExplanationException ( "The<sp>entered<sp>chunk<sp>must<sp>not<sp>be<sp>null" ) ; } java . lang . Class < org . goodoldai . jeff . explanation . ExplanationChunk > cl = org . goodoldai . jeff . explanation . ExplanationChunk . class ; java . lang . reflect . Field [ ] fields = cl . getDeclaredFields ( ) ; try { for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { java . lang . reflect . Field field = fields [ i ] ; if ( ( java . lang . reflect . Modifier . isPublic ( field . getModifiers ( ) ) ) && ( ( field . getInt ( field . getName ( ) ) ) == ( echunk . getContext ( ) ) ) ) { return field . getName ( ) ; } } return null ; } catch ( java . lang . Exception e ) { throw new org . goodoldai . jeff . explanation . ExplanationException ( e . getMessage ( ) ) ; } }
org . junit . Assert . assertEquals ( expResult , result )
testSerialization ( ) { org . jfree . chart . labels . IntervalCategoryItemLabelGenerator g1 = new org . jfree . chart . labels . IntervalCategoryItemLabelGenerator ( "{3}<sp>-<sp>{4}" , java . text . DateFormat . getInstance ( ) ) ; org . jfree . chart . labels . IntervalCategoryItemLabelGenerator g2 = ( ( org . jfree . chart . labels . IntervalCategoryItemLabelGenerator ) ( org . jfree . chart . TestUtils . serialised ( g1 ) ) ) ; "<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 ( g1 , g2 )
initShouldCreateTheDatabaseIfItNotExists ( ) { java . lang . String database = "test" + ( java . lang . System . currentTimeMillis ( ) ) ; try { executeStatement ( ( "DROP<sp>DATABASE<sp>" + database ) ) ; } catch ( java . lang . Exception e ) { } url = "jdbc:mysql://127.0.0.1:3306/" + database ; props . put ( "karaf.lock.jdbc.url" , url ) ; lock = createLock ( props ) ; java . sql . Connection connection = getConnection ( ( "jdbc:mysql://127.0.0.1:3306/" + database ) , user , password ) ; "<AssertPlaceHolder>" ; executeStatement ( ( "DROP<sp>DATABASE<sp>" + database ) ) ; close ( connection ) ; } isClosed ( ) { return closed ; }
org . junit . Assert . assertFalse ( connection . isClosed ( ) )
Should_apply_flags_on_config ( ) { com . artemis . WorldConfiguration configuration = builder . alwaysDelayComponentRemoval ( true ) . build ( ) ; "<AssertPlaceHolder>" ; } isAlwaysDelayComponentRemoval ( ) { return alwaysDelayComponentRemoval ; }
org . junit . Assert . assertTrue ( configuration . isAlwaysDelayComponentRemoval ( ) )
testEmpty ( ) { java . lang . String delimiter = "\r\n" ; final java . lang . String boundary = "MockMultiPartTestBoundary" ; java . lang . String str = ( ( ( delimiter + "--" ) + boundary ) + "--" ) + delimiter ; javax . servlet . MultipartConfigElement config = new javax . servlet . MultipartConfigElement ( _dirname , 1024 , 3072 , 50 ) ; com . firefly . codec . http2 . model . MultiPartFormInputStream mpis = new com . firefly . codec . http2 . model . MultiPartFormInputStream ( new test . codec . http2 . model . ByteArrayInputStream ( str . getBytes ( ) ) , ( "multipart/form-data,<sp>boundary=" + boundary ) , config , _tmpDir ) ; mpis . setDeleteOnExit ( true ) ; "<AssertPlaceHolder>" ; } getParts ( ) { if ( ( multiPartFormInputStream ) == null ) { return null ; } else { try { return multiPartFormInputStream . getParts ( ) ; } catch ( java . io . IOException e ) { com . firefly . server . http2 . router . handler . body . HTTPBodyHandlerSPIImpl . log . error ( "get<sp>multi<sp>part<sp>exception" , e ) ; return null ; } } }
org . junit . Assert . assertTrue ( mpis . getParts ( ) . isEmpty ( ) )
unconfiguredAdminServer_hasNoEnvironmentVariables ( ) { oracle . kubernetes . weblogic . domain . model . ServerSpec spec = domain . getAdminServerSpec ( ) ; "<AssertPlaceHolder>" ; } getEnvironmentVariables ( ) { return withStateAdjustments ( server . getEnv ( ) ) ; }
org . junit . Assert . assertThat ( spec . getEnvironmentVariables ( ) , org . hamcrest . Matchers . empty ( ) )
testSize ( ) { org . apache . tajo . datum . Datum d = org . apache . tajo . datum . DatumFactory . createInt4 ( 5 ) ; "<AssertPlaceHolder>" ; } size ( ) { return taskRequestQueue . size ( ) ; }
org . junit . Assert . assertEquals ( 4 , d . size ( ) )
InheritanceImplementsInterface ( ) { java . lang . String fromClass = "Domain.Direct.Violating.InheritanceImplementsInterface" ; java . lang . String toClass = "Technology.Direct.Dao.IMapDAO" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Inheritance" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , boolean ) { return areDependencyTypesDetected ( classFrom , classTo , dependencyTypes , "" , isIndirect ) ; }
org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , false ) )
testRollover ( ) { final long start = Long . MAX_VALUE ; final long now = start + 2 ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 2 , ( now - start ) )
escapePercent ( ) { java . lang . String testString = "claim%" ; java . lang . String resultString = "claim\\%" ; java . lang . String convertedTestString = ch . puzzle . itc . mobiliar . business . utils . JpaWildcardConverter . convertWildCards ( testString ) ; "<AssertPlaceHolder>" ; } convertWildCards ( java . lang . String ) { if ( searchText == null ) { return null ; } searchText = searchText . replace ( "%" , ( ( ch . puzzle . itc . mobiliar . business . utils . JpaWildcardConverter . ESCAPE_CHARACTER ) + "%" ) ) . replace ( ch . puzzle . itc . mobiliar . business . utils . JpaWildcardConverter . WILDCARD_CHARACTER , '%' ) . replace ( "_" , ( ( ch . puzzle . itc . mobiliar . business . utils . JpaWildcardConverter . ESCAPE_CHARACTER ) + "_" ) ) ; return searchText ; }
org . junit . Assert . assertEquals ( convertedTestString , resultString )
testLinkedList ( ) { org . mapdb . elsa . Collection c = new java . util . LinkedList ( ) ; for ( int i = 0 ; i < 2000 ; i ++ ) { c . add ( i ) ; "<AssertPlaceHolder>" ; } } clone ( E ) { return org . mapdb . elsa . ElsaSerializerBaseTest . clonePojo ( value ) ; }
org . junit . Assert . assertEquals ( c , org . mapdb . elsa . ElsaSerializerBaseTest . clone ( c ) )
testSerdeEmpty ( ) { boolean print = false ; org . deeplearning4j . eval . org . nd4j [ ] arr = new org . nd4j . evaluation . IEvaluation [ ] { new org . deeplearning4j . eval . Evaluation ( ) , new org . deeplearning4j . eval . EvaluationBinary ( ) , new org . deeplearning4j . eval . ROCBinary ( 10 ) , new org . deeplearning4j . eval . ROCMultiClass ( 10 ) , new org . deeplearning4j . eval . RegressionEvaluation ( 3 ) , new org . deeplearning4j . eval . RegressionEvaluation ( ) , new org . deeplearning4j . eval . EvaluationCalibration ( ) } ; for ( org . nd4j . evaluation . IEvaluation e : arr ) { java . lang . String json = e . toJson ( ) ; java . lang . String stats = e . stats ( ) ; if ( print ) { System . out . println ( ( ( ( ( e . getClass ( ) ) + "\n" ) + json ) + "\n\n" ) ) ; } org . deeplearning4j . eval . IEvaluation fromJson = ( ( org . deeplearning4j . eval . IEvaluation ) ( org . deeplearning4j . eval . org . nd4j . evaluation . BaseEvaluation . fromJson ( json , org . nd4j . evaluation . BaseEvaluation . class ) ) ) ; "<AssertPlaceHolder>" ; } } toJson ( ) { try { return new org . datavec . api . transform . serde . JsonSerializer ( ) . getObjectMapper ( ) . writeValueAsString ( this ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } }
org . junit . Assert . assertEquals ( e . toJson ( ) , fromJson . toJson ( ) )
testSimpleSchema ( ) { io . cdap . cdap . api . data . schema . Schema simpleSchema = io . cdap . cdap . api . data . schema . Schema . of ( Schema . Type . INT ) ; java . util . Set < java . lang . String > expected = java . util . Collections . singleton ( "properties:schema" ) ; io . cdap . cdap . data2 . metadata . indexer . SchemaIndexer indexer = new io . cdap . cdap . data2 . metadata . indexer . SchemaIndexer ( ) ; io . cdap . cdap . proto . id . DatasetId datasetInstance = new io . cdap . cdap . proto . id . DatasetId ( "ns1" , "ds1" ) ; java . util . Set < java . lang . String > actual = indexer . getIndexes ( new io . cdap . cdap . data2 . metadata . dataset . MetadataEntry ( datasetInstance , io . cdap . cdap . data2 . metadata . indexer . SchemaIndexerTest . KEY , simpleSchema . toString ( ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . Objects . toStringHelper ( this ) . add ( "bindAddress" , httpService . getBindAddress ( ) ) . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetUserDnFromArray ( ) { java . lang . String userDnForTest = "snd1" ; java . lang . String [ ] array = new java . lang . String [ ] { userDnForTest , "idn" } ; java . lang . String userDN = datawave . security . util . DnUtils . getUserDN ( array ) ; "<AssertPlaceHolder>" ; } getUserDN ( java . lang . String [ ] ) { return datawave . security . util . DnUtils . getUserDN ( dns , false ) ; }
org . junit . Assert . assertEquals ( userDnForTest , userDN )
getSharedPlaylistContent ( ) { java . util . List < com . github . felixgail . gplaymusic . model . Playlist > playlists = getApi ( ) . getPlaylistApi ( ) . listPlaylists ( ) ; assume ( playlists ) ; java . util . Optional < com . github . felixgail . gplaymusic . model . Playlist > sharedPlaylistOptional = playlists . stream ( ) . filter ( ( p ) -> p . getType ( ) . equals ( Playlist . PlaylistType . SHARED ) ) . findFirst ( ) ; org . junit . Assume . assumeTrue ( "Test<sp>could<sp>not<sp>be<sp>run.<sp>No<sp>shared<sp>playlist<sp>found." , sharedPlaylistOptional . isPresent ( ) ) ; com . github . felixgail . gplaymusic . model . Playlist sharedPlaylist = sharedPlaylistOptional . get ( ) ; java . util . List < com . github . felixgail . gplaymusic . model . PlaylistEntry > entries = sharedPlaylist . getContents ( 100 ) ; "<AssertPlaceHolder>" ; testPlaylistEntries ( entries ) ; System . out . printf ( "%d<sp>playlist<sp>entries<sp>found<sp>and<sp>validated.\n" , entries . size ( ) ) ; } getContents ( int ) { return mainApi . getPlaylistApi ( ) . getContents ( this , maxResults ) ; }
org . junit . Assert . assertNotNull ( entries )
testGetCourseSetMembers ( ) { java . util . Set members = cm . getCourseSetMemberships ( "BIO_DEPT" ) ; "<AssertPlaceHolder>" ; try { cm . getCourseSetMemberships ( "bad<sp>eid" ) ; org . junit . Assert . fail ( ) ; } catch ( org . sakaiproject . coursemanagement . api . exception . IdNotFoundException ide ) { } } size ( ) { return m_wrapper . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , members . size ( ) )
testIsLoggingEnabled ( ) { herdRestControllerAdvice . afterPropertiesSet ( ) ; "<AssertPlaceHolder>" ; } isLoggingEnabled ( ) { return loggingEnabled ; }
org . junit . Assert . assertTrue ( herdRestControllerAdvice . isLoggingEnabled ( ) )
testAllItemIDsCSV ( ) { java . lang . String response = target ( "/item/allIDs" ) . request ( ) . get ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { java . util . Map < java . lang . String , java . lang . Integer > map = getModel ( ) . getWords ( ) ; java . lang . Integer count ; synchronized ( map ) { count = map . get ( word ) ; } if ( count == null ) { throw new com . cloudera . oryx . api . serving . OryxServingException ( Response . Status . BAD_REQUEST , "No<sp>such<sp>word" ) ; } return count ; }
org . junit . Assert . assertEquals ( 9 , response . split ( "\n" ) . length )
testDoubleEqConjunction ( ) { org . hisp . dhis . query . Query query = org . hisp . dhis . query . Query . from ( schemaService . getDynamicSchema ( org . hisp . dhis . dataelement . DataElement . class ) ) ; org . hisp . dhis . query . Conjunction conjunction = query . conjunction ( ) ; conjunction . add ( org . hisp . dhis . query . Restrictions . eq ( "id" , "deabcdefghD" ) ) ; conjunction . add ( org . hisp . dhis . query . Restrictions . eq ( "id" , "deabcdefghF" ) ) ; query . add ( conjunction ) ; java . util . List < ? extends org . hisp . dhis . common . IdentifiableObject > objects = queryEngine . query ( query ) ; "<AssertPlaceHolder>" ; } size ( ) { return messages . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , objects . size ( ) )
test2Crossing8Vertex ( ) { final org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . GraphLayerImpl top = new org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . GraphLayerImpl ( 0 ) ; top . addNewVertex ( "A" ) ; top . addNewVertex ( "B" ) ; top . addNewVertex ( "C" ) ; top . addNewVertex ( "D" ) ; final org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . GraphLayerImpl bottom = new org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . GraphLayerImpl ( 1 ) ; bottom . addNewVertex ( "E" ) ; bottom . addNewVertex ( "F" ) ; bottom . addNewVertex ( "G" ) ; bottom . addNewVertex ( "H" ) ; final java . util . List < org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . OrientedEdge > edges = new java . util . ArrayList ( ) ; edges . add ( new org . kie . workbench . common . stunner . core . graph . processing . layout . OrientedEdgeImpl ( "A" , "E" ) ) ; edges . add ( new org . kie . workbench . common . stunner . core . graph . processing . layout . OrientedEdgeImpl ( "A" , "G" ) ) ; edges . add ( new org . kie . workbench . common . stunner . core . graph . processing . layout . OrientedEdgeImpl ( "A" , "H" ) ) ; edges . add ( new org . kie . workbench . common . stunner . core . graph . processing . layout . OrientedEdgeImpl ( "B" , "F" ) ) ; edges . add ( new org . kie . workbench . common . stunner . core . graph . processing . layout . OrientedEdgeImpl ( "C" , "H" ) ) ; edges . add ( new org . kie . workbench . common . stunner . core . graph . processing . layout . OrientedEdgeImpl ( "D" , "H" ) ) ; final org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . step03 . LayerCrossingCount cc = new org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . step03 . LayerCrossingCount ( ) ; final int result = cc . crossing ( edges , top , bottom ) ; "<AssertPlaceHolder>" ; } crossing ( java . util . List , org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . GraphLayer , org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . GraphLayer ) { final java . lang . Object [ ] entries = flat ( edges , north , south ) ; int firstIndex = 1 ; while ( firstIndex < ( south . getVertices ( ) . size ( ) ) ) { firstIndex <<= 1 ; } final int treeSize = ( 2 * firstIndex ) - 1 ; firstIndex -= 1 ; final int [ ] tree = new int [ treeSize ] ; int crossings = 0 ; for ( final java . lang . Object entry : entries ) { int index = ( ( java . lang . Integer ) ( entry ) ) + firstIndex ; if ( index < 0 ) { continue ; } tree [ index ] += org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . step03 . LayerCrossingCount . DEFAULT_VERTEX_WEIGHT ; int weightSum = 0 ; while ( index > 0 ) { if ( ( index % 2 ) != 0 ) { weightSum += tree [ ( index + 1 ) ] ; } index = ( index - 1 ) > > 1 ; tree [ index ] += org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . step03 . LayerCrossingCount . DEFAULT_VERTEX_WEIGHT ; } crossings += ( org . kie . workbench . common . stunner . core . graph . processing . layout . sugiyama . step03 . LayerCrossingCount . DEFAULT_VERTEX_WEIGHT ) * weightSum ; } return crossings ; }
org . junit . Assert . assertEquals ( 2 , result )
testBufferOverflow ( ) { int port = org . fluentd . logger . util . MockFluentd . randomPort ( ) ; org . fluentd . logger . util . MockFluentd fluentd = new org . fluentd . logger . util . MockFluentd ( port , new org . fluentd . logger . util . MockFluentd . MockProcess ( ) { public void process ( org . msgpack . MessagePack msgpack , java . net . Socket socket ) throws java . io . IOException { java . io . BufferedInputStream in = new java . io . BufferedInputStream ( socket . getInputStream ( ) ) ; try { org . msgpack . unpacker . Unpacker unpacker = msgpack . createUnpacker ( in ) ; while ( true ) { unpacker . read ( org . fluentd . logger . sender . Event . class ) ; } } catch ( java . io . EOFException e ) { } } } ) ; fluentd . start ( ) ; org . fluentd . logger . sender . Sender sender = new org . fluentd . logger . sender . RawSocketSender ( "localhost" , port , 3000 , 256 ) ; org . fluentd . logger . sender . Map < java . lang . String , java . lang . Object > data = new org . fluentd . logger . sender . HashMap < java . lang . String , java . lang . Object > ( ) ; data . put ( "large" , randomString ( 512 ) ) ; boolean success = sender . emit ( "tag.label1" , data ) ; "<AssertPlaceHolder>" ; sender . close ( ) ; fluentd . close ( ) ; } emit ( java . lang . String , java . util . Map ) { return emit ( tag , ( ( java . lang . System . currentTimeMillis ( ) ) / 1000 ) , data ) ; }
org . junit . Assert . assertFalse ( success )
listArrayIndexOutOfBoundsShouldResolveAsEmpty ( ) { com . github . jknack . handlebars . Handlebars handlebars = new com . github . jknack . handlebars . Handlebars ( ) ; com . github . jknack . handlebars . Template template = handlebars . compileInline ( "{{list.[10]}}" ) ; java . util . Map < java . lang . String , java . lang . Object > context = new java . util . HashMap ( ) ; context . put ( "list" , java . util . Arrays . asList ( "s1" , "s2" ) ) ; "<AssertPlaceHolder>" ; } apply ( T ) { return "" ; }
org . junit . Assert . assertEquals ( "" , template . apply ( context ) )
testSerialization ( ) { org . jfree . data . general . DefaultPieDataset d1 = new org . jfree . data . general . DefaultPieDataset ( ) ; d1 . setValue ( "C1" , new java . lang . Double ( 234.2 ) ) ; d1 . setValue ( "C2" , null ) ; d1 . setValue ( "C3" , new java . lang . Double ( 345.9 ) ) ; d1 . setValue ( "C4" , new java . lang . Double ( 452.7 ) ) ; org . jfree . data . general . DefaultPieDataset d2 = ( ( org . jfree . data . general . DefaultPieDataset ) ( org . jfree . chart . TestUtils . serialised ( d1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( T extends java . io . Serializable ) { T 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 = ( ( T ) ( 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 ( d1 , d2 )
size_cyclophane_even ( ) { int [ ] [ ] cyclophane_even = org . openscience . cdk . graph . InitialCyclesTest . cyclophane_even ( ) ; org . openscience . cdk . graph . VertexShortCycles vsc = new org . openscience . cdk . graph . VertexShortCycles ( cyclophane_even ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; }
org . junit . Assert . assertThat ( vsc . size ( ) , org . hamcrest . CoreMatchers . is ( 3 ) )
testGradient ( ) { cn . edu . hit . ir . JNN . Model m = new cn . edu . hit . ir . JNN . Model ( ) ; cn . edu . hit . ir . JNN . Trainers . SimpleSGDTrainer sgd = new cn . edu . hit . ir . JNN . Trainers . SimpleSGDTrainer ( m ) ; cn . edu . hit . ir . JNN . ComputationGraph cg = new cn . edu . hit . ir . JNN . ComputationGraph ( ) ; java . util . Vector < java . lang . Double > xV = new java . util . Vector < java . lang . Double > ( java . util . Arrays . asList ( 1.0 , 2.0 ) ) ; java . util . Vector < java . lang . Double > yV = new java . util . Vector < java . lang . Double > ( java . util . Arrays . asList ( 1.0 , 2.0 ) ) ; java . util . Vector < java . lang . Double > zV = new java . util . Vector < java . lang . Double > ( java . util . Arrays . asList ( 2.0 , 3.0 ) ) ; cn . edu . hit . ir . JNN . Expression W = Expression . Creator . parameter ( cg , m . addParameters ( cn . edu . hit . ir . JNN . Dim . create ( 2 , 1 ) ) ) ; cn . edu . hit . ir . JNN . Expression x = Expression . Creator . input ( cg , cn . edu . hit . ir . JNN . Dim . create ( 2 , 1 ) , xV ) ; cn . edu . hit . ir . JNN . Expression y = Expression . Creator . input ( cg , cn . edu . hit . ir . JNN . Dim . create ( 2 , 1 ) , yV ) ; cn . edu . hit . ir . JNN . Expression z = Expression . Creator . input ( cg , cn . edu . hit . ir . JNN . Dim . create ( 1 , 2 ) , zV ) ; cn . edu . hit . ir . JNN . Expression t = Expression . Creator . multiply ( x , z ) ; cn . edu . hit . ir . JNN . Expression s = Expression . Creator . multiply ( t , W ) ; cn . edu . hit . ir . JNN . Expression loss = Expression . Creator . squaredDistance ( s , y ) ; cg . gradientCheck ( ) ; cg . forward ( ) ; cg . backward ( ) ; "<AssertPlaceHolder>" ; } gradientCheck ( ) { for ( int i = 0 ; i < ( parameterNodes . size ( ) ) ; ++ i ) { int j = parameterNodes . get ( i ) ; if ( ( nodes . get ( j ) . getName ( ) ) == "ParameterNode" ) { checkParameterNode ( nodes . get ( j ) ) ; } else { checkLookupNode ( nodes . get ( j ) ) ; } } }
org . junit . Assert . assertEquals ( true , m . gradientCheck ( ) )
testDefaultPipelineIsUsedWhenSetInConfiguration ( ) { resetSingleton ( ) ; try ( org . neo4j . graphdb . Transaction tx = getDatabase ( ) . beginTx ( ) ) { getNLPManager ( ) . setDefaultPipeline ( TextProcessor . DEFAULT_PIPELINE ) ; getNLPManager ( ) . annotateTextAndPersist ( "some<sp>text" , "id1" , null , null , false , false ) ; "<AssertPlaceHolder>" ; tx . success ( ) ; } } annotateTextAndPersist ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean , boolean ) { java . lang . String lang = checkTextLanguage ( text , checkForLanguage ) ; com . graphaware . nlp . PipelineSpecification pipelineSpecification = getPipelineSpecification ( pipelineName ) ; com . graphaware . nlp . domain . AnnotatedText at = annotate ( text , lang , pipelineSpecification ) ; return processAnnotationPersist ( id , text , at , pipelineSpecification ) ; }
org . junit . Assert . assertTrue ( true )
testScriptField ( ) { com . liferay . portal . search . script . ScriptField scriptField = com . liferay . portal . search . script . test . ScriptsInstantiationTest . _scripts . scriptField ( "field" , com . liferay . portal . search . script . test . ScriptsInstantiationTest . _scripts . script ( "Math.min(1,<sp>1)" ) ) ; "<AssertPlaceHolder>" ; } script ( java . lang . String ) { return builder ( ) . idOrCode ( idOrCode ) . build ( ) ; }
org . junit . Assert . assertNotNull ( scriptField )
testField ( ) { org . apache . openjpa . meta . FieldMetaData . MemberProvider b = new org . apache . openjpa . meta . FieldMetaData . MemberProvider ( getClass ( ) . getDeclaredField ( "field" ) ) ; org . apache . openjpa . meta . FieldMetaData . MemberProvider b2 = roundtrip ( b ) ; "<AssertPlaceHolder>" ; } getMember ( ) { return ( ( org . apache . openjpa . persistence . meta . Members . Member < ? extends Z , X > ) ( _member ) ) ; }
org . junit . Assert . assertEquals ( b . getMember ( ) , b2 . getMember ( ) )
shouldInstantiateFieldWithPrivateDefaultConstructor ( ) { org . mockito . internal . util . reflection . FieldInitializer fieldInitializer = new org . mockito . internal . util . reflection . FieldInitializer ( this , this . getClass ( ) . getDeclaredField ( "privateDefaultConstructor" ) ) ; "<AssertPlaceHolder>" ; } initialize ( ) { if ( fr . inria . astor . core . setup . ConfigurationProperties . hasProperty ( "seed" ) ) { java . lang . Integer seed = fr . inria . astor . core . setup . ConfigurationProperties . getPropertyInt ( "seed" ) ; fr . inria . astor . core . setup . RandomManager . randomNumberGenerator = new java . util . Random ( seed ) ; } else { ConfigurationProperties . properties . setProperty ( "seed" , "0" ) ; fr . inria . astor . core . setup . RandomManager . randomNumberGenerator = new java . util . Random ( 0 ) ; } }
org . junit . Assert . assertNotNull ( fieldInitializer . initialize ( ) )
whenInitializedWithDeclarationAndThenInitalizationUsingUserInputs_thenCorrect ( ) { java . io . InputStream is = new java . io . ByteArrayInputStream ( "1<sp>2<sp>3<sp>4<sp>5<sp>6<sp>7<sp>8<sp>9" . getBytes ( ) ) ; java . lang . System . setIn ( is ) ; "<AssertPlaceHolder>" ; java . lang . System . setIn ( System . in ) ; } declarationAndThenInitializationUsingUserInputs ( ) { int [ ] [ ] jaggedArr = new int [ 3 ] [ ] ; jaggedArr [ 0 ] = new int [ 2 ] ; jaggedArr [ 1 ] = new int [ 3 ] ; jaggedArr [ 2 ] = new int [ 4 ] ; initializeElements ( jaggedArr ) ; return jaggedArr ; }
org . junit . Assert . assertArrayEquals ( new int [ ] [ ] { new int [ ] { 1 , 2 } , new int [ ] { 3 , 4 , 5 } , new int [ ] { 6 , 7 , 8 , 9 } } , obj . declarationAndThenInitializationUsingUserInputs ( ) )
testGetWebAppRootURL ( ) { java . lang . String returnValue = xaConfigUtil . getWebAppRootURL ( ) ; "<AssertPlaceHolder>" ; } getWebAppRootURL ( ) { return webappRootURL ; }
org . junit . Assert . assertEquals ( returnValue , xaConfigUtil . webappRootURL )
testCompareLess ( ) { int result = com . annimon . stream . Objects . compare ( 10 , 20 , com . annimon . stream . Functions . naturalOrder ( ) ) ; "<AssertPlaceHolder>" ; } naturalOrder ( ) { return new java . util . Comparator < java . lang . Integer > ( ) { @ com . annimon . stream . Override public int compare ( java . lang . Integer o1 , java . lang . Integer o2 ) { return com . annimon . stream . Objects . compareInt ( o1 , o2 ) ; } } ; }
org . junit . Assert . assertEquals ( ( - 1 ) , result )
testReadExtended ( ) { org . switchyard . config . model . composite . CompositeModel cm = org . switchyard . config . model . composite . CompositeModelTests . _puller . pull ( org . switchyard . config . model . composite . CompositeModelTests . EXTENDED_XML , getClass ( ) ) ; org . switchyard . config . model . composite . test . bogus . BogusImplementationModel bim = ( ( org . switchyard . config . model . composite . test . bogus . BogusImplementationModel ) ( cm . getComponents ( ) . get ( 0 ) . getImplementation ( ) ) ) ; "<AssertPlaceHolder>" ; } getFoo ( ) { return getModelAttribute ( org . switchyard . config . model . composite . test . bogus . BogusImplementationModel . FOO ) ; }
org . junit . Assert . assertEquals ( "bar" , bim . getFoo ( ) )
testForm_02 ( ) { org . apache . jena . sparql . sse . Item item = org . apache . jena . sparql . sse . SSE . parse ( "(base<sp><http://example/>)" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { return org . apache . jena . sparql . sse . SSE . parse ( str , null ) ; }
org . junit . Assert . assertNull ( item )
testApplyStyle ( ) { java . util . TreeMap < org . odftoolkit . odfdom . dom . style . props . OdfStyleProperty , java . lang . String > searchProps = new java . util . TreeMap < org . odftoolkit . odfdom . dom . style . props . OdfStyleProperty , java . lang . String > ( ) ; searchProps . put ( StyleTextPropertiesElement . FontName , "Arial" ) ; searchProps . put ( StyleTextPropertiesElement . FontSize , "12pt" ) ; search1 = new org . odftoolkit . odfdom . incubator . search . TextStyleNavigation ( searchProps , doc ) ; org . odftoolkit . odfdom . incubator . doc . style . OdfStyle style = null ; try { style = new org . odftoolkit . odfdom . incubator . doc . style . OdfStyle ( doc . getContentDom ( ) ) ; style . setProperty ( StyleTextPropertiesElement . FontSize , "23pt" ) ; style . setProperty ( StyleTextPropertiesElement . FontWeight , "bold" ) ; style . setStyleFamilyAttribute ( "text" ) ; } catch ( java . lang . Exception e1 ) { org . odftoolkit . odfdom . incubator . search . TextStyleNavigationTest . LOG . log ( Level . SEVERE , e1 . getMessage ( ) , e1 ) ; org . junit . Assert . fail ( ( ( ( ( "Failed<sp>with<sp>" + ( e1 . getClass ( ) . getName ( ) ) ) + ":<sp>'" ) + ( e1 . getMessage ( ) ) ) + "'" ) ) ; } int i = 0 ; while ( search1 . hasNext ( ) ) { i ++ ; org . odftoolkit . odfdom . incubator . search . TextSelection item = ( ( org . odftoolkit . odfdom . incubator . search . TextSelection ) ( search1 . getCurrentItem ( ) ) ) ; try { item . applyStyle ( style ) ; } catch ( org . odftoolkit . odfdom . incubator . search . InvalidNavigationException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } java . util . TreeMap < org . odftoolkit . odfdom . dom . style . props . OdfStyleProperty , java . lang . String > chgProps = new java . util . TreeMap < org . odftoolkit . odfdom . dom . style . props . OdfStyleProperty , java . lang . String > ( ) ; chgProps . put ( StyleTextPropertiesElement . FontSize , "23pt" ) ; chgProps . put ( StyleTextPropertiesElement . FontWeight , "bold" ) ; search4 = new org . odftoolkit . odfdom . incubator . search . TextStyleNavigation ( chgProps , doc ) ; int j = 0 ; while ( search4 . hasNext ( ) ) { j ++ ; } "<AssertPlaceHolder>" ; try { doc . save ( org . odftoolkit . odfdom . utils . ResourceUtilities . newTestOutputFile ( org . odftoolkit . odfdom . incubator . search . TextStyleNavigationTest . SAVE_FILE_STYLE ) ) ; } catch ( java . lang . Exception e ) { org . odftoolkit . odfdom . incubator . search . TextStyleNavigationTest . LOG . log ( Level . SEVERE , e . getMessage ( ) , e ) ; org . junit . Assert . fail ( ( ( ( ( "Failed<sp>with<sp>" + ( e . getClass ( ) . getName ( ) ) ) + ":<sp>'" ) + ( e . getMessage ( ) ) ) + "'" ) ) ; } } hasNext ( ) { mCurrentSelectedItem = findnext ( mCurrentSelectedItem ) ; return ( mCurrentSelectedItem ) != null ; }
org . junit . Assert . assertTrue ( ( i == j ) )
testGetParameters ( ) { java . lang . Long personId = 2L ; org . lnu . is . domain . person . Person person = new org . lnu . is . domain . person . Person ( ) ; person . setId ( personId ) ; java . lang . Long languageId = 3L ; org . lnu . is . domain . language . Language language = new org . lnu . is . domain . language . Language ( ) ; language . setId ( languageId ) ; java . lang . Long languageLevelId = 1L ; org . lnu . is . domain . language . LanguageLevel languageLevel = new org . lnu . is . domain . language . LanguageLevel ( ) ; languageLevel . setId ( languageLevelId ) ; org . lnu . is . domain . person . language . PersonLanguage entity = new org . lnu . is . domain . person . language . PersonLanguage ( ) ; entity . setPerson ( person ) ; entity . setLanguage ( language ) ; entity . setLanguageLevel ( languageLevel ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "person" , person ) ; expected . put ( "language" , language ) ; expected . put ( "languageLevel" , languageLevel ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; when ( personDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( person ) ; when ( languageDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( language ) ; when ( languageLevelDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( languageLevel ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetInstanceFromFactory ( ) { org . irods . jargon . core . connection . IRODSAccount irodsAccount = org . irods . jargon . core . pub . CollectionAndDataObjectListAndSearchAOImplTest . testingPropertiesHelper . buildIRODSAccountFromTestProperties ( org . irods . jargon . core . pub . CollectionAndDataObjectListAndSearchAOImplTest . testingProperties ) ; org . irods . jargon . core . pub . CollectionAndDataObjectListAndSearchAO actual = org . irods . jargon . core . pub . CollectionAndDataObjectListAndSearchAOImplTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) . getCollectionAndDataObjectListAndSearchAO ( irodsAccount ) ; "<AssertPlaceHolder>" ; } getCollectionAndDataObjectListAndSearchAO ( org . irods . jargon . core . connection . IRODSAccount ) { checkIrodsSessionSet ( ) ; return new org . irods . jargon . core . pub . CollectionAndDataObjectListAndSearchAOImpl ( irodsSession , irodsAccount ) ; }
org . junit . Assert . assertNotNull ( actual )
escapeJSON_f ( ) { java . lang . String input = "\f" ; java . lang . String escaped = org . oscm . json . EscapeUtils . escapeJSON ( input ) ; "<AssertPlaceHolder>" ; } escapeJSON ( java . lang . String ) { if ( aText == null ) { return null ; } final java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; java . text . StringCharacterIterator iterator = new java . text . StringCharacterIterator ( aText ) ; char character = iterator . current ( ) ; while ( character != ( java . text . StringCharacterIterator . DONE ) ) { if ( character == '\"' ) { result . append ( "\\\"" ) ; } else if ( character == '\\' ) { result . append ( "\\\\" ) ; } else if ( character == '/' ) { result . append ( "\\/" ) ; } else if ( character == '\b' ) { result . append ( "\\b" ) ; } else if ( character == '\f' ) { result . append ( "\\f" ) ; } else if ( character == '\n' ) { result . append ( "\\n" ) ; } else if ( character == '\r' ) { result . append ( "\\r" ) ; } else if ( character == '\t' ) { result . append ( "\\t" ) ; } else { result . append ( character ) ; } character = iterator . next ( ) ; } return result . toString ( ) ; }
org . junit . Assert . assertEquals ( "\\f" , escaped )
genotypeInformationTest ( ) { this . patientEdit . expandGenotypeInformation ( ) ; this . patientEdit . openNewEntryListOfCandidateGenes ( ) ; "<AssertPlaceHolder>" ; this . patientEdit . setGeneCandidateComment ( "Genes" ) ; this . patientEdit . openNewEntryPreviouslyTested ( ) ; } checkGeneCandidateSearchHideSuggestions ( java . lang . String ) { this . geneCandidateSearch . clear ( ) ; this . geneCandidateSearch . sendKeys ( search ) ; return getDriver ( ) . findElements ( org . openqa . selenium . By . cssSelector ( "#body<sp>><sp>div.suggestItems.ajaxsuggest<sp>><sp>div:nth-child(1)<sp>><sp>span" ) ) . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( this . patientEdit . checkGeneCandidateSearchHideSuggestions ( "a" ) ) > 0 ) )
testSortingOnModTime ( ) { java . lang . String testBasePath = ( ( ( org . apache . flink . hdfstests . ContinuousFileProcessingTest . hdfsURI ) + "/" ) + ( java . util . UUID . randomUUID ( ) ) ) + "/" ; final long [ ] modTimes = new long [ org . apache . flink . hdfstests . ContinuousFileProcessingTest . NO_OF_FILES ] ; final org . apache . flink . hdfstests . org . apache . hadoop [ ] filesCreated = new org . apache . hadoop . fs . Path [ org . apache . flink . hdfstests . ContinuousFileProcessingTest . NO_OF_FILES ] ; for ( int i = 0 ; i < ( org . apache . flink . hdfstests . ContinuousFileProcessingTest . NO_OF_FILES ) ; i ++ ) { org . apache . flink . api . java . tuple . Tuple2 < org . apache . hadoop . fs . Path , java . lang . String > file = org . apache . flink . hdfstests . ContinuousFileProcessingTest . createFileAndFillWithData ( testBasePath , "file" , i , "This<sp>is<sp>test<sp>line." ) ; java . lang . Thread . sleep ( 400 ) ; filesCreated [ i ] = file . f0 ; modTimes [ i ] = org . apache . flink . hdfstests . ContinuousFileProcessingTest . hdfs . getFileStatus ( file . f0 ) . getModificationTime ( ) ; } org . apache . flink . api . java . io . TextInputFormat format = new org . apache . flink . api . java . io . TextInputFormat ( new org . apache . flink . core . fs . Path ( testBasePath ) ) ; format . setFilesFilter ( org . apache . flink . api . common . io . FilePathFilter . createDefaultFilter ( ) ) ; org . apache . flink . core . fs . FileInputSplit [ ] splits = format . createInputSplits ( 1 ) ; org . apache . flink . streaming . api . functions . source . ContinuousFileMonitoringFunction < java . lang . String > monitoringFunction = createTestContinuousFileMonitoringFunction ( format , FileProcessingMode . PROCESS_ONCE ) ; org . apache . flink . hdfstests . ContinuousFileProcessingTest . ModTimeVerifyingSourceContext context = new org . apache . flink . hdfstests . ContinuousFileProcessingTest . ModTimeVerifyingSourceContext ( modTimes ) ; monitoringFunction . open ( new org . apache . flink . configuration . Configuration ( ) ) ; monitoringFunction . run ( context ) ; "<AssertPlaceHolder>" ; for ( int i = 0 ; i < ( org . apache . flink . hdfstests . ContinuousFileProcessingTest . NO_OF_FILES ) ; i ++ ) { org . apache . flink . hdfstests . ContinuousFileProcessingTest . hdfs . delete ( filesCreated [ i ] , false ) ; } } getCounter ( ) { return counter ; }
org . junit . Assert . assertEquals ( splits . length , context . getCounter ( ) )
test_getAllRelationTags ( ) { "<AssertPlaceHolder>" ; } getAllBuildingTags ( ) { final java . util . List < io . github . data4all . model . data . Tag > result = new java . util . ArrayList < io . github . data4all . model . data . Tag > ( ) ; for ( io . github . data4all . model . data . Tag t : io . github . data4all . model . data . Tags . TAG_LIST ) { final java . util . List < io . github . data4all . model . data . ClassifiedValue > classifiedValues = new java . util . ArrayList < io . github . data4all . model . data . ClassifiedValue > ( ) ; if ( t instanceof io . github . data4all . model . data . ClassifiedTag ) { for ( io . github . data4all . model . data . ClassifiedValue v : ( ( io . github . data4all . model . data . ClassifiedTag ) ( t ) ) . getClassifiedValues ( ) ) { if ( v . canBeBuilding ( ) ) { classifiedValues . add ( v ) ; } } } if ( ! ( classifiedValues . isEmpty ( ) ) ) { result . add ( new io . github . data4all . model . data . ClassifiedTag ( t . getId ( ) , t . getKey ( ) , t . getType ( ) , classifiedValues ) ) ; } } return result ; }
org . junit . Assert . assertEquals ( 4 , io . github . data4all . model . data . Tags . getAllBuildingTags ( ) . size ( ) )
testIndexer ( ) { java . io . File indexDirectory = testFolder . newFolder ( ) ; java . lang . String indexDirectoryName = indexDirectory . getPath ( ) ; ner_dictionary . indexing . Indexer indexer = new ner_dictionary . indexing . Indexer ( indexDirectoryName ) ; "<AssertPlaceHolder>" ; } getIndexWriter ( ) { return this . indexWriter ; }
org . junit . Assert . assertNotNull ( indexer . getIndexWriter ( ) )
testGetHex ( ) { byte [ ] raw = new byte [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 } ; java . lang . String expResult = "000102030405060708090a0b0c0d0e0f10" ; java . lang . String result = org . owasp . dependencycheck . utils . Checksum . getHex ( raw ) ; "<AssertPlaceHolder>" ; } getHex ( byte [ ] ) { if ( raw == null ) { return null ; } final java . lang . StringBuilder hex = new java . lang . StringBuilder ( ( 2 * ( raw . length ) ) ) ; for ( final byte b : raw ) { hex . append ( org . owasp . dependencycheck . utils . Checksum . HEXES . charAt ( ( ( b & 240 ) > > 4 ) ) ) . append ( org . owasp . dependencycheck . utils . Checksum . HEXES . charAt ( ( b & 15 ) ) ) ; } return hex . toString ( ) ; }
org . junit . Assert . assertEquals ( expResult , result )
testConvertAll ( ) { java . lang . Long id = 1L ; java . lang . Long departmentId = 2L ; java . lang . Long specialtyId = 3L ; org . lnu . is . domain . specialty . Specialty specialty = new org . lnu . is . domain . specialty . Specialty ( ) ; specialty . setId ( specialtyId ) ; org . lnu . is . domain . department . Department department = new org . lnu . is . domain . department . Department ( ) ; department . setId ( departmentId ) ; org . lnu . is . domain . department . specialty . DepartmentSpecialty expected = new org . lnu . is . domain . department . specialty . DepartmentSpecialty ( ) ; expected . setId ( id ) ; expected . setDepartment ( department ) ; expected . setSpecialty ( specialty ) ; org . lnu . is . resource . department . specialty . DepartmentSpecialtyResource source = new org . lnu . is . resource . department . specialty . DepartmentSpecialtyResource ( ) ; source . setId ( id ) ; source . setDepartmentId ( departmentId ) ; source . setSpecialtyId ( specialtyId ) ; org . lnu . is . domain . department . specialty . DepartmentSpecialty expected1 = new org . lnu . is . domain . department . specialty . DepartmentSpecialty ( ) ; org . lnu . is . resource . department . specialty . DepartmentSpecialtyResource source1 = new org . lnu . is . resource . department . specialty . DepartmentSpecialtyResource ( ) ; java . util . List < org . lnu . is . resource . department . specialty . DepartmentSpecialtyResource > sources = java . util . Arrays . asList ( source , source1 ) ; java . util . List < org . lnu . is . domain . department . specialty . DepartmentSpecialty > expecteds = java . util . Arrays . asList ( expected , expected1 ) ; java . util . List < org . lnu . is . domain . department . specialty . DepartmentSpecialty > actual = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
org . junit . Assert . assertEquals ( expecteds , actual )
testFtpCommandsOneCommandWithComma ( ) { java . lang . String inputString = ",quote<sp>SITE<sp>RDW<sp>READTAPEFORMAT=V" ; java . lang . String [ ] expected = new java . lang . String [ ] { "quote<sp>SITE<sp>RDW<sp>READTAPEFORMAT=V" } ; java . lang . String [ ] cmds = org . apache . sqoop . util . MainframeFTPClientUtils . parseFtpCommands ( inputString ) ; "<AssertPlaceHolder>" ; } parseFtpCommands ( java . lang . String ) { if ( org . apache . commons . lang3 . StringUtils . isBlank ( ftpCmds ) ) { return new java . lang . String [ ] { } ; } return java . util . Arrays . stream ( ftpCmds . split ( "," ) ) . map ( String :: trim ) . filter ( org . apache . commons . lang3 . StringUtils :: isNotEmpty ) . toArray ( java . lang . String [ ] :: new ) ; }
org . junit . Assert . assertArrayEquals ( cmds , expected )
initFromPackageWithoutAnnotatedClasses ( ) { org . apache . olingo . odata2 . annotation . processor . core . datasource . AnnotationInMemoryDs ds = new org . apache . olingo . odata2 . annotation . processor . core . datasource . AnnotationInMemoryDs ( this . getClass ( ) . getPackage ( ) . getName ( ) , false ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertNotNull ( ds )
testSize ( ) { org . apache . tajo . datum . Datum d = org . apache . tajo . datum . DatumFactory . createBit ( ( ( byte ) ( 1 ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return casesMap . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , d . size ( ) )
testHasEditableColumns ( ) { final org . drools . workbench . screens . guided . dtable . client . widget . table . GuidedDecisionTablePresenter . Access access = mock ( GuidedDecisionTablePresenter . Access . class ) ; doReturn ( access ) . when ( dtPresenter ) . getAccess ( ) ; doReturn ( true ) . when ( access ) . hasEditableColumns ( ) ; final boolean hasEditableColumns = dtPresenter . hasEditableColumns ( ) ; "<AssertPlaceHolder>" ; verify ( access ) . hasEditableColumns ( ) ; } hasEditableColumns ( ) { return getAccess ( ) . hasEditableColumns ( ) ; }
org . junit . Assert . assertTrue ( hasEditableColumns )