input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
searchSourceTest ( ) { final com . github . wuic . nut . ConvertibleNut nut = org . mockito . Mockito . mock ( com . github . wuic . nut . ConvertibleNut . class ) ; final com . github . wuic . nut . SourceMapNutImpl src = org . mockito . Mockito . mock ( com . github . wuic . nut . SourceMapNutImpl . class ) ; org . mockito . Mockito . when ( nut . getSource ( ) ) . thenReturn ( src ) ; org . mockito . Mockito . when ( src . getName ( ) ) . thenReturn ( "source" ) ; org . mockito . Mockito . when ( nut . getName ( ) ) . thenReturn ( "nut" ) ; "<AssertPlaceHolder>" ; } findByName ( com . github . wuic . nut . ConvertibleNut , java . lang . String ) { java . lang . String parsedName = com . github . wuic . util . StringUtils . simplifyPathWithDoubleDot ( nut . getName ( ) ) ; if ( ( ( ( parsedName . equals ( nutName ) ) || ( ( '/' + parsedName ) . equals ( nutName ) ) ) || ( parsedName . equals ( ( '/' + nutName ) ) ) ) || ( com . github . wuic . util . IOUtils . mergePath ( "best-effort" , nutName ) . equals ( parsedName ) ) ) { return nut ; } else if ( ( ! ( nut instanceof com . github . wuic . nut . Source ) ) && ( ( nut . getSource ( ) ) instanceof com . github . wuic . nut . SourceMapNut ) ) { final com . github . wuic . nut . ConvertibleNut retval = com . github . wuic . util . NutUtils . findInSourceMapByName ( nut , com . github . wuic . nut . SourceMapNut . class . cast ( nut . getSource ( ) ) , nutName ) ; if ( retval != null ) { return retval ; } } if ( ( nut . getReferencedNuts ( ) ) != null ) { final com . github . wuic . nut . ConvertibleNut ref = com . github . wuic . util . NutUtils . findByName ( nut . getReferencedNuts ( ) , nutName ) ; if ( ref != null ) { return ref ; } } return null ; }
|
org . junit . Assert . assertNotNull ( com . github . wuic . util . NutUtils . findByName ( nut , "source" ) )
|
testCreateRootSchemaWithNoMetadataSchema ( ) { org . apache . calcite . schema . SchemaPlus rootSchema = org . apache . calcite . tools . Frameworks . createRootSchema ( false ) ; "<AssertPlaceHolder>" ; } getSubSchemaNames ( ) { return schema . getSubSchemaNames ( ) ; }
|
org . junit . Assert . assertThat ( rootSchema . getSubSchemaNames ( ) . size ( ) , org . hamcrest . CoreMatchers . equalTo ( 0 ) )
|
testCleanupDelay ( ) { config . setCleanupDelay ( TimeUnit . HOURS . toMillis ( 1 ) ) ; "<AssertPlaceHolder>" ; } getCleanupDelay ( ) { if ( ( cleanupDelayMillis ) < 0 ) { return java . lang . Math . min ( ( ( expireAfterMillis ) / 10 ) , TimeUnit . MINUTES . toMillis ( 10 ) ) ; } return cleanupDelayMillis ; }
|
org . junit . Assert . assertEquals ( TimeUnit . HOURS . toMillis ( 1 ) , config . getCleanupDelay ( ) )
|
testIsFullyAuthenticated ( ) { "<AssertPlaceHolder>" ; } isAuthorized ( org . pac4j . core . context . WebContext , org . pac4j . core . authorization . checker . List , java . lang . String , org . pac4j . core . authorization . checker . Map ) { final org . pac4j . core . authorization . checker . List < org . pac4j . core . authorization . checker . Authorizer > authorizers = new org . pac4j . core . authorization . checker . ArrayList ( ) ; java . lang . String authorizerNames = authorizersValue ; if ( authorizerNames == null ) { authorizerNames = ( ( org . pac4j . core . context . DefaultAuthorizers . CSRF ) + ( org . pac4j . core . context . Pac4jConstants . ELEMENT_SEPARATOR ) ) + ( org . pac4j . core . context . DefaultAuthorizers . SECURITYHEADERS ) ; } if ( isNotBlank ( authorizerNames ) ) { final java . lang . String [ ] names = authorizerNames . split ( Pac4jConstants . ELEMENT_SEPARATOR ) ; final int nb = names . length ; for ( int i = 0 ; i < nb ; i ++ ) { final java . lang . String name = names [ i ] . trim ( ) ; if ( DefaultAuthorizers . HSTS . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . STRICT_TRANSPORT_SECURITY_HEADER ) ; } else if ( DefaultAuthorizers . NOSNIFF . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . X_CONTENT_TYPE_OPTIONS_HEADER ) ; } else if ( DefaultAuthorizers . NOFRAME . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . X_FRAME_OPTIONS_HEADER ) ; } else if ( DefaultAuthorizers . XSSPROTECTION . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . XSS_PROTECTION_HEADER ) ; } else if ( DefaultAuthorizers . NOCACHE . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . CACHE_CONTROL_HEADER ) ; } else if ( DefaultAuthorizers . SECURITYHEADERS . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . CACHE_CONTROL_HEADER ) ; authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . X_CONTENT_TYPE_OPTIONS_HEADER ) ; authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . STRICT_TRANSPORT_SECURITY_HEADER ) ; authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . X_FRAME_OPTIONS_HEADER ) ; authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . XSS_PROTECTION_HEADER ) ; } else if ( DefaultAuthorizers . CSRF_TOKEN . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . CSRF_TOKEN_GENERATOR_AUTHORIZER ) ; } else if ( DefaultAuthorizers . CSRF_CHECK . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . CSRF_AUTHORIZER ) ; } else if ( DefaultAuthorizers . CSRF . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . CSRF_TOKEN_GENERATOR_AUTHORIZER ) ; authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . CSRF_AUTHORIZER ) ; } else if ( DefaultAuthorizers . ALLOW_AJAX_REQUESTS . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . CORS_AUTHORIZER ) ; } else if ( DefaultAuthorizers . IS_ANONYMOUS . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . IS_ANONYMOUS_AUTHORIZER ) ; } else if ( DefaultAuthorizers . IS_AUTHENTICATED . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . IS_AUTHENTICATED_AUTHORIZER ) ; } else if ( DefaultAuthorizers . IS_FULLY_AUTHENTICATED . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . IS_FULLY_AUTHENTICATED_AUTHORIZER ) ; } else if ( DefaultAuthorizers . IS_REMEMBERED . equalsIgnoreCase ( name ) ) { authorizers . add ( org . pac4j . core . authorization . checker . DefaultAuthorizationChecker . IS_REMEMBERED_AUTHORIZER ) ; } else { assertNotNull ( "authorizersMap" , authorizersMap ) ; org . pac4j . core . authorization . checker . Authorizer result = null ; for ( final Map . Entry < java . lang . String , org . pac4j . core . authorization . checker . Authorizer > entry : authorizersMap . entrySet ( ) ) { if ( areEqualsIgnoreCaseAndTrim ( entry . getKey ( ) , name ) ) { result = entry . getValue ( ) ; break ; } } assertNotNull ( ( ( "authorizersMap['" + name ) + "']" ) , result ) ; authorizers . add ( result ) ; } } } return isAuthorized ( context , profiles , authorizers ) ; }
|
org . junit . Assert . assertTrue ( checker . isAuthorized ( null , profiles , DefaultAuthorizers . IS_FULLY_AUTHENTICATED , null ) )
|
testSelf ( ) { sonia . scm . net . ahc . AdvancedHttpRequest ahr = new sonia . scm . net . ahc . AdvancedHttpRequest ( ahc , HttpMethod . GET , "https://www.scm-manager.org" ) ; "<AssertPlaceHolder>" ; } self ( ) { return this ; }
|
org . junit . Assert . assertEquals ( sonia . scm . net . ahc . AdvancedHttpRequest . class , ahr . self ( ) . getClass ( ) )
|
preferRecentlyFailed ( ) { org . junit . runner . Request request = org . junit . runner . Request . aClass ( org . junit . tests . experimental . max . MaxStarterTest . TwoTests . class ) ; fMax . run ( request ) ; java . util . List < org . junit . runner . Description > tests = fMax . sortedLeavesForTest ( request ) ; org . junit . runner . Description dontSucceed = org . junit . runner . Description . createTestDescription ( org . junit . tests . experimental . max . MaxStarterTest . TwoTests . class , "dontSucceed" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { return field . get ( target ) ; }
|
org . junit . Assert . assertEquals ( dontSucceed , tests . get ( 0 ) )
|
testGetSourceInfoNoClient ( ) { org . hawkular . apm . server . api . services . SpanCache spanCache = new org . hawkular . apm . server . api . utils . SourceInfoUtilTest . TestSpanCache ( ) ; org . hawkular . apm . server . api . model . zipkin . Span serverSpan = new org . hawkular . apm . server . api . model . zipkin . Span ( null , null ) ; serverSpan . setId ( "1" ) ; serverSpan . setParentId ( "1" ) ; spanCache . store ( null , java . util . Arrays . asList ( serverSpan ) , SpanUniqueIdGenerator :: toUnique ) ; "<AssertPlaceHolder>" ; } getSourceInfo ( java . lang . String , org . hawkular . apm . server . api . model . zipkin . Span , org . hawkular . apm . server . api . services . SpanCache ) { java . lang . String clientSpanId = org . hawkular . apm . server . api . utils . zipkin . SpanUniqueIdGenerator . getClientId ( serverSpan . getId ( ) ) ; if ( ( spanCache != null ) && ( clientSpanId != null ) ) { org . hawkular . apm . server . api . model . zipkin . Span clientSpan = spanCache . get ( tenantId , clientSpanId ) ; org . hawkular . apm . server . api . model . zipkin . Span rootOrServerSpan = org . hawkular . apm . server . api . utils . SourceInfoUtil . findRootOrServerSpan ( tenantId , clientSpan , spanCache ) ; if ( rootOrServerSpan != null ) { org . hawkular . apm . api . model . events . SourceInfo si = new org . hawkular . apm . api . model . events . SourceInfo ( ) ; if ( ( clientSpan . getDuration ( ) ) != null ) { si . setDuration ( clientSpan . getDuration ( ) ) ; } if ( ( clientSpan . getTimestamp ( ) ) != null ) { si . setTimestamp ( clientSpan . getTimestamp ( ) ) ; } si . setTraceId ( clientSpan . getTraceId ( ) ) ; si . setFragmentId ( clientSpan . getId ( ) ) ; si . getProperties ( ) . addAll ( clientSpan . binaryAnnotationMapping ( ) . getProperties ( ) ) ; si . setHostAddress ( clientSpan . ipv4 ( ) ) ; if ( ( clientSpan . service ( ) ) != null ) { si . getProperties ( ) . add ( new org . hawkular . apm . api . model . Property ( org . hawkular . apm . api . model . Constants . PROP_SERVICE_NAME , clientSpan . service ( ) ) ) ; } si . setId ( clientSpan . getId ( ) ) ; si . setMultipleConsumers ( false ) ; java . net . URL url = rootOrServerSpan . url ( ) ; si . setEndpoint ( new org . hawkular . apm . api . model . events . EndpointRef ( ( url != null ? url . getPath ( ) : null ) , org . hawkular . apm . server . api . utils . zipkin . SpanDeriverUtil . deriveOperation ( rootOrServerSpan ) , ( ! ( rootOrServerSpan . serverSpan ( ) ) ) ) ) ; return si ; } } return null ; }
|
org . junit . Assert . assertNull ( org . hawkular . apm . server . api . utils . SourceInfoUtil . getSourceInfo ( null , serverSpan , spanCache ) )
|
summary ( com . netflix . spectator . api . Measurement ) { new mockit . Expectations ( ) { { measurement . value ( ) ; result = 10 ; } } ; node . addMeasurement ( measurement ) ; node . addMeasurement ( measurement ) ; "<AssertPlaceHolder>" ; } summary ( ) { double result = 0 ; for ( com . netflix . spectator . api . Measurement measurement : measurements ) { result += measurement . value ( ) ; } return result ; }
|
org . junit . Assert . assertEquals ( 20 , node . summary ( ) , 0 )
|
killAll ( ) { nginxCommandLineInterface . killAll ( ) . thenCompose ( ( nginxResponse ) -> nginxCommandLineInterface . stop ( ) ) . thenCompose ( ( nginxResponse ) -> nginxCommandLineInterface . start ( ) ) . thenCompose ( ( nginxResponse ) -> nginxCommandLineInterface . killAll ( ) ) . thenAccept ( ( nginxResponse ) -> { if ( nginxResponse . error ( ) ) { com . jslsolucoes . nginx . admin . agent . model . response . NginxExceptionResponse nginxExceptionResponse = ( ( com . jslsolucoes . nginx . admin . agent . model . response . NginxExceptionResponse ) ( nginxResponse ) ) ; org . junit . Assert . fail ( nginxExceptionResponse . getStackTrace ( ) ) ; } else if ( nginxResponse . forbidden ( ) ) { com . jslsolucoes . nginx . admin . agent . model . response . NginxAuthenticationFailResponse nginxAuthenticationFailResponse = ( ( com . jslsolucoes . nginx . admin . agent . model . response . NginxAuthenticationFailResponse ) ( nginxResponse ) ) ; org . junit . Assert . fail ( nginxAuthenticationFailResponse . getMessage ( ) ) ; } else { com . jslsolucoes . nginx . admin . agent . model . response . NginxCommandLineInterfaceResponse nginxCommandLineInterfaceResponse = ( ( com . jslsolucoes . nginx . admin . agent . model . response . NginxCommandLineInterfaceResponse ) ( nginxResponse ) ) ; "<AssertPlaceHolder>" ; } } ) . join ( ) ; } getSuccess ( ) { return success ; }
|
org . junit . Assert . assertTrue ( nginxCommandLineInterfaceResponse . getSuccess ( ) )
|
testInvalidMaxCardinality ( ) { com . github . anno4j . Anno4j anno4j = new com . github . anno4j . Anno4j ( ) ; com . github . anno4j . ValidatedTransaction transaction = anno4j . createValidatedTransaction ( ) ; transaction . begin ( ) ; com . github . anno4j . transaction . ValidatedTransactionTest . SpecialTestResource resource = transaction . createObject ( com . github . anno4j . transaction . ValidatedTransactionTest . SpecialTestResource . class ) ; resource . setCardinality ( com . google . common . collect . Sets . newHashSet ( 1 , 2 , 3 , 4 ) ) ; resource . setQualifiedCardinality ( com . google . common . collect . Sets . < com . github . anno4j . transaction . ValidatedTransactionTest . TestResource > newHashSet ( resource ) ) ; boolean exceptionThrown = false ; try { transaction . commit ( ) ; } catch ( com . github . anno4j . ValidatedTransaction e ) { exceptionThrown = true ; } "<AssertPlaceHolder>" ; } commit ( ) { connection . commit ( ) ; }
|
org . junit . Assert . assertTrue ( exceptionThrown )
|
testEncryptSignature ( ) { org . apache . cxf . service . Service service = createService ( ) ; org . apache . wss4j . stax . ext . WSSSecurityProperties inProperties = new org . apache . wss4j . stax . ext . WSSSecurityProperties ( ) ; inProperties . setCallbackHandler ( new org . apache . cxf . ws . security . wss4j . TestPwdCallback ( ) ) ; java . util . Properties cryptoProperties = org . apache . wss4j . common . crypto . CryptoFactory . getProperties ( "insecurity.properties" , this . getClass ( ) . getClassLoader ( ) ) ; inProperties . setSignatureVerificationCryptoProperties ( cryptoProperties ) ; inProperties . setDecryptionCryptoProperties ( cryptoProperties ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor inhandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor ( inProperties ) ; service . getInInterceptors ( ) . add ( inhandler ) ; org . apache . cxf . ws . security . wss4j . StaxCryptoCoverageChecker checker = new org . apache . cxf . ws . security . wss4j . StaxCryptoCoverageChecker ( ) ; service . getInInterceptors ( ) . add ( checker ) ; org . apache . cxf . ws . security . wss4j . Echo echo = createClientProxy ( ) ; org . apache . cxf . endpoint . Client client = org . apache . cxf . frontend . ClientProxy . getClient ( echo ) ; client . getInInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingInInterceptor ( ) ) ; client . getOutInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingOutInterceptor ( ) ) ; org . apache . wss4j . stax . ext . WSSSecurityProperties properties = new org . apache . wss4j . stax . ext . WSSSecurityProperties ( ) ; java . util . List < org . apache . wss4j . stax . ext . WSSConstants . Action > actions = new java . util . ArrayList ( ) ; actions . add ( XMLSecurityConstants . ENCRYPT ) ; actions . add ( XMLSecurityConstants . SIGNATURE ) ; properties . setActions ( actions ) ; properties . setEncryptionUser ( "myalias" ) ; properties . setSignatureUser ( "myalias" ) ; properties . setEncryptionSymAlgorithm ( XMLSecurityConstants . NS_XENC_AES128 ) ; java . util . Properties outCryptoProperties = org . apache . wss4j . common . crypto . CryptoFactory . getProperties ( "outsecurity.properties" , this . getClass ( ) . getClassLoader ( ) ) ; properties . setSignatureCryptoProperties ( outCryptoProperties ) ; properties . setEncryptionCryptoProperties ( outCryptoProperties ) ; properties . setCallbackHandler ( new org . apache . cxf . ws . security . wss4j . TestPwdCallback ( ) ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ohandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ( properties ) ; client . getOutInterceptors ( ) . add ( ohandler ) ; "<AssertPlaceHolder>" ; } echo ( int ) { return i ; }
|
org . junit . Assert . assertEquals ( "test" , echo . echo ( "test" ) )
|
testJoiningFalse ( ) { org . geotools . data . complex . AppSchemaDataAccessRegistry . getAppSchemaProperties ( ) . setProperty ( AppSchemaDataAccessConfigurator . PROPERTY_JOINING , "false" ) ; boolean joining = org . geotools . data . complex . config . AppSchemaDataAccessConfigurator . isJoining ( ) ; "<AssertPlaceHolder>" ; org . geotools . data . complex . AppSchemaDataAccessRegistry . clearAppSchemaProperties ( ) ; } isJoining ( ) { java . lang . String s = org . geotools . data . complex . AppSchemaDataAccessRegistry . getAppSchemaProperties ( ) . getProperty ( org . geotools . data . complex . config . AppSchemaDataAccessConfigurator . PROPERTY_JOINING ) ; return ( s == null ) || ( s . equalsIgnoreCase ( "true" ) ) ; }
|
org . junit . Assert . assertFalse ( joining )
|
testThatOneSettedElementIsOk ( ) { br . com . caelum . stella . bean . validation . xml . logic . StellaChoiceValidator validator = new br . com . caelum . stella . bean . validation . xml . logic . StellaChoiceValidator ( ) ; validator . initialize ( new net . vidageek . mirror . dsl . Mirror ( ) . on ( br . com . caelum . stella . bean . validation . xml . StellaChoiceValidatorTest . AnnotatedModel . class ) . reflect ( ) . annotation ( br . com . caelum . stella . bean . validation . xml . Choice . class ) . atClass ( ) ) ; "<AssertPlaceHolder>" ; } isValid ( java . lang . Object , javax . validation . ConstraintValidatorContext ) { java . lang . Class < ? extends java . lang . Object > type = toValidate . getClass ( ) ; if ( ! ( hasChoiceItens ( toValidate ) ) ) { return validateChoice ( toValidate , new net . vidageek . mirror . dsl . Mirror ( ) . on ( type ) . reflectAll ( ) . fields ( ) ) ; } return validateChoice ( toValidate , getChoiceItemAnnotatedFields ( type ) ) ; }
|
org . junit . Assert . assertTrue ( validator . isValid ( new br . com . caelum . stella . bean . validation . xml . StellaChoiceValidatorTest . AnnotatedModel ( ) , context ) )
|
bottomBit ( ) { set . set ( 0 ) ; final int ret = set . previousSetBit ( 0 ) ; "<AssertPlaceHolder>" ; } previousSetBit ( int ) { if ( i < 0 ) { if ( i == ( - 1 ) ) return - 1 ; throw new java . lang . IndexOutOfBoundsException ( ( "i=" + i ) ) ; } final long [ ] [ ] [ ] bits = this . bits ; final int aSize = ( bits . length ) - 1 ; if ( w1 > aSize ) { w1 = aSize ; w2 = com . zaxxer . sparsebits . SparseBitSet . LENGTH2_SIZE ; w3 = com . zaxxer . sparsebits . SparseBitSet . LENGTH3_SIZE ; w4 = com . zaxxer . sparsebits . SparseBitSet . LENGTH4_SIZE ; } else { w2 = ( w > > ( com . zaxxer . sparsebits . SparseBitSet . SHIFT2 ) ) & ( com . zaxxer . sparsebits . SparseBitSet . MASK2 ) ; w3 = w & ( com . zaxxer . sparsebits . SparseBitSet . MASK3 ) ; w4 = i % ( com . zaxxer . sparsebits . SparseBitSet . LENGTH4 ) ; } long word ; long [ ] [ ] a2 ; long [ ] a3 ; for ( ; w1 >= 0 ; -- w1 ) { if ( ( a2 = bits [ w1 ] ) != null ) for ( ; w2 >= 0 ; -- w2 ) { if ( ( a3 = a2 [ w2 ] ) != null ) for ( ; w3 >= 0 ; -- w3 ) { if ( ( word = a3 [ w3 ] ) != 0 ) for ( int bitIdx = w4 ; bitIdx >= 0 ; -- bitIdx ) { if ( ( word & ( 1L << bitIdx ) ) != 0 ) return ( ( ( ( w1 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT1 ) ) + ( w2 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT2 ) ) ) + w3 ) << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT3 ) ) + bitIdx ; } w4 = com . zaxxer . sparsebits . SparseBitSet . LENGTH4_SIZE ; } w3 = com . zaxxer . sparsebits . SparseBitSet . LENGTH3_SIZE ; w4 = com . zaxxer . sparsebits . SparseBitSet . LENGTH4_SIZE ; } w2 = com . zaxxer . sparsebits . SparseBitSet . LENGTH2_SIZE ; w3 = com . zaxxer . sparsebits . SparseBitSet . LENGTH3_SIZE ; w4 = com . zaxxer . sparsebits . SparseBitSet . LENGTH4_SIZE ; } return - 1 ; }
|
org . junit . Assert . assertEquals ( 0 , ret )
|
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . portal . kernel . model . PortalPreferences . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "portalPreferencesId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "portalPreferencesId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
getConfiguredTimerValueInMs_nullValue ( ) { doReturn ( java . lang . Long . valueOf ( 0 ) ) . when ( configServiceBean ) . getLongConfigurationSetting ( ConfigurationKey . TIMER_INTERVAL_BILLING_OFFSET , Configuration . GLOBAL_CONTEXT ) ; long result = configServiceBean . getConfiguredBillingOffsetInMs ( ) ; "<AssertPlaceHolder>" ; } getConfiguredBillingOffsetInMs ( ) { long configuredValue = getLongConfigurationSetting ( ConfigurationKey . TIMER_INTERVAL_BILLING_OFFSET , Configuration . GLOBAL_CONTEXT ) ; long maxAllowedValue = 28 * ( org . oscm . converter . DateConverter . MILLISECONDS_PER_DAY ) ; if ( configuredValue < 0 ) { configuredValue = 0 ; } else if ( configuredValue > maxAllowedValue ) { configuredValue = maxAllowedValue ; } return configuredValue ; }
|
org . junit . Assert . assertEquals ( 0 , result )
|
test1 ( ) { ch . ethz . globis . phtree . nv . PhTreeNV i = create ( 2 , 16 ) ; i . insert ( 130 , 226 ) ; "<AssertPlaceHolder>" ; } contains ( java . util . List , double [ ] ) { for ( double [ ] vl : l ) { if ( java . util . Arrays . equals ( vl , v ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( i . contains ( 130 , 226 ) )
|
testEntrySetIteratorFastForEach ( ) { for ( int i = 0 ; i < 100 ; i ++ ) { m . put ( i , java . lang . Integer . valueOf ( i ) ) ; } final java . util . Set < it . unimi . dsi . fastutil . ints . Int2ObjectMap . Entry < java . lang . Integer > > s = new java . util . HashSet ( ) ; it . unimi . dsi . fastutil . ints . Int2ObjectMaps . fastForEach ( m , ( x ) -> s . add ( new it . unimi . dsi . fastutil . ints . AbstractInt2ObjectMap . BasicEntry < > ( x . getIntKey ( ) , x . getValue ( ) ) ) ) ; "<AssertPlaceHolder>" ; } int2ObjectEntrySet ( ) { return delegate . int2ObjectEntrySet ( ) ; }
|
org . junit . Assert . assertEquals ( m . int2ObjectEntrySet ( ) , s )
|
testParseInterlanguageLinksEn ( ) { java . util . Map < java . lang . String , java . lang . String > expected = reader . readCsv ( dictionary . InterlanguageLinksParserTest . SAMPLE_OUTPUT_EN ) ; java . util . Map < java . lang . String , java . lang . String > actual = interlanguage . parse ( dictionary . InterlanguageLinksParserTest . SAMPLE_INPUT_EN ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { return parse ( new java . io . File ( path ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testConstructor_withCause ( ) { java . lang . RuntimeException cause = new java . lang . RuntimeException ( ) ; com . hazelcast . simulator . test . TestException exception = new com . hazelcast . simulator . test . TestException ( cause ) ; "<AssertPlaceHolder>" ; } getCause ( ) { return cause ; }
|
org . junit . Assert . assertEquals ( cause , exception . getCause ( ) )
|
dropRight_A$int ( ) { com . m3 . scalaflavor4j . Nil < java . lang . String > nil = com . m3 . scalaflavor4j . Nil . < java . lang . String > apply ( ) ; int n = 3 ; com . m3 . scalaflavor4j . Seq < java . lang . String > actual = nil . dropRight ( n ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( resource ) == null ) || ( ( resource . getResource ( ) ) == null ) ; }
|
org . junit . Assert . assertThat ( actual . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) )
|
createTableWithoutHashKey ( ) { try { com . amazonaws . services . dynamodbv2 . model . TableDescription result = createTable ( createTableName ( ) , null , createNumberAttributeDefinition ( ) ) ; "<AssertPlaceHolder>" ; } catch ( com . amazonaws . AmazonServiceException ase ) { } } createNumberAttributeDefinition ( ) { java . lang . String name = java . util . UUID . randomUUID ( ) . toString ( ) . substring ( 0 , 2 ) ; return createNumberAttributeDefinition ( name ) ; }
|
org . junit . Assert . assertTrue ( false )
|
testOneElement ( ) { final kieker . analysisteetime . util . RunningMedian < java . lang . Integer > runningMedian = kieker . analysisteetime . util . RunningMedian . forInteger ( ) ; runningMedian . add ( 5 ) ; final long median = runningMedian . getMedian ( ) ; "<AssertPlaceHolder>" ; } getMedian ( ) { if ( ( this . maxHeap . isEmpty ( ) ) && ( this . minHeap . isEmpty ( ) ) ) { throw new java . lang . IllegalStateException ( "There<sp>are<sp>no<sp>present<sp>values<sp>for<sp>this<sp>running<sp>median." ) ; } else if ( ( this . maxHeap . size ( ) ) == ( this . minHeap . size ( ) ) ) { return this . meanBuilder . apply ( this . maxHeap . peek ( ) , this . minHeap . peek ( ) ) ; } else if ( ( this . maxHeap . size ( ) ) > ( this . minHeap . size ( ) ) ) { return this . maxHeap . peek ( ) ; } else { return this . minHeap . peek ( ) ; } }
|
org . junit . Assert . assertEquals ( 5 , median )
|
testValidateInput3 ( ) { System . out . println ( "validateInput" ) ; java . lang . String un = "erferfti" ; java . lang . String pw = "paerf00A" ; testPackage . mockSignUp instance = new testPackage . mockSignUp ( ) ; boolean expResult = true ; boolean result = instance . validateInput3 ( un , pw ) ; "<AssertPlaceHolder>" ; } validateInput3 ( java . lang . String , java . lang . String ) { boolean isAtLeast = ( ( pw . length ( ) ) < 6 ) || ( ( pw . length ( ) ) > 14 ) ; boolean hasRestr = ! ( pw . matches ( "[A-Za-z0-9]*" ) ) ; if ( un . substring ( 0 , 1 ) . matches ( "[0-9]" ) ) { return false ; } if ( ( ( un . length ( ) ) < 6 ) || ( ( un . length ( ) ) > 14 ) ) { return false ; } if ( isAtLeast || hasRestr ) { return false ; } return true ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
given_resultwith_nbreresult_0_thenReturn_JsonNode ( ) { final com . fasterxml . jackson . databind . JsonNode jsonNode = fr . gouv . vitam . metadata . core . utils . MetadataJsonResponseUtils . populateJSONObjectResponse ( fr . gouv . vitam . metadata . core . utils . MetadataJsonResponseUtilsTest . buildResult ( 0 ) , new fr . gouv . vitam . common . database . parser . request . multiple . SelectParserMultiple ( ) ) ; "<AssertPlaceHolder>" ; } buildResult ( int ) { final java . util . List < java . lang . String > list = new java . util . ArrayList ( nbrResult ) ; for ( int i = 0 ; i < nbrResult ; i ++ ) { list . add ( java . lang . Integer . toString ( i ) ) ; } final fr . gouv . vitam . metadata . core . database . collections . Result result = new fr . gouv . vitam . metadata . core . database . collections . ResultDefault ( fr . gouv . vitam . common . database . builder . request . configuration . BuilderToken . FILTERARGS . UNITS , new java . util . ArrayList < java . lang . String > ( ) ) ; return result ; }
|
org . junit . Assert . assertNotNull ( jsonNode )
|
testConvertAll ( ) { 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 familyTypeId = 3L ; org . lnu . is . domain . family . type . FamilyType familyType = new org . lnu . is . domain . family . type . FamilyType ( ) ; familyType . setId ( familyTypeId ) ; java . lang . Long id = 1L ; java . lang . String name = "name" ; java . util . Date birthdate = new java . util . Date ( ) ; org . lnu . is . domain . person . family . PersonFamily expected = new org . lnu . is . domain . person . family . PersonFamily ( ) ; expected . setPerson ( person ) ; expected . setFamilyType ( familyType ) ; expected . setId ( id ) ; expected . setName ( name ) ; expected . setBirthDate ( birthdate ) ; java . util . List < org . lnu . is . domain . person . family . PersonFamily > expecteds = java . util . Arrays . asList ( expected ) ; org . lnu . is . resource . person . family . PersonFamilyResource source = new org . lnu . is . resource . person . family . PersonFamilyResource ( ) ; source . setPersonId ( personId ) ; source . setFamilyTypeId ( familyTypeId ) ; source . setId ( id ) ; source . setName ( name ) ; source . setBirthDate ( birthdate ) ; java . util . List < org . lnu . is . resource . person . family . PersonFamilyResource > sources = java . util . Arrays . asList ( source ) ; java . util . List < org . lnu . is . domain . person . family . PersonFamily > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( expecteds , actuals )
|
testBindingMaxBericht ( ) { java . lang . String xml = leesBestand ( "afstamming_InschrijvingAangifteGeboorte_Bijhouding_v0001_MAX.xml" ) ; nl . bzk . brp . business . dto . bijhouding . AbstractBijhoudingsBericht bericht = unmarshalObject ( xml ) ; "<AssertPlaceHolder>" ; checkStuurgegevens ( bericht , "organisatie" , "applicatie" , "123456789" 0 ) ; checkActies ( bericht , 20120101 , SoortActie . AANGIFTE_GEBOORTE , SoortActie . REGISTRATIE_NATIONALITEIT ) ; nl . bzk . brp . model . logisch . Relatie relatie = getRelatieUitGeboorteActie ( bericht ) ; checkRelatieEnBetrokkenheden ( relatie , 3 ) ; nl . bzk . brp . model . logisch . Persoon kind = getKindUitGeboorteActie ( bericht ) ; checkIdentificatieNummersEnGeslacht ( kind , "123456789" , "123456789" , GeslachtsAanduiding . ONBEKEND ) ; checkAanschrijving ( kind , true , false , "123456789" 2 ) ; checkGeboorte ( kind , 20120101 ) ; checkVoornamen ( kind , "Piet" , "123456789" 3 ) ; checkGeslachtsnaamcomponenten ( kind , new java . lang . String [ ] { "Bokkel" , "van" , "123456789" 1 } ) ; nl . bzk . brp . model . logisch . Persoon persoon = getKindUitRegistratieNationaliteitActie ( bericht ) ; checkNationaliteit ( persoon , "1" , "reden<sp>verkrijging" , "reden<sp>verlies" ) ; } unmarshalObject ( java . lang . String ) { nl . bzk . brp . pocmotor . binding . IBindingFactory bfact = nl . bzk . brp . pocmotor . binding . BindingDirectory . getFactory ( getBindingClass ( ) ) ; nl . bzk . brp . pocmotor . binding . IUnmarshallingContext uctx = bfact . createUnmarshallingContext ( ) ; return ( ( T ) ( uctx . unmarshalDocument ( new java . io . ByteArrayInputStream ( xml . getBytes ( ) ) , null ) ) ) ; }
|
org . junit . Assert . assertNotNull ( bericht )
|
testBatchQueryCount ( ) { helper . migrateProcessInstancesAsync ( 1 ) ; helper . migrateProcessInstancesAsync ( 1 ) ; long count = managementService . createBatchQuery ( ) . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { return count ( ALL_STATES ) ; }
|
org . junit . Assert . assertEquals ( 2 , count )
|
encodeResponse ( ) { java . lang . String recordId = "recordId" ; byte [ ] recordIdBytes = recordId . getBytes ( Charsets . UTF_8 ) ; io . netty . channel . embedded . EmbeddedChannel channel = new io . netty . channel . embedded . EmbeddedChannel ( new org . apache . jackrabbit . oak . segment . standby . codec . GetHeadResponseEncoder ( ) ) ; channel . writeOutbound ( new org . apache . jackrabbit . oak . segment . standby . codec . GetHeadResponse ( "clientId" , "recordId" ) ) ; io . netty . buffer . ByteBuf buffer = ( ( io . netty . buffer . ByteBuf ) ( channel . readOutbound ( ) ) ) ; io . netty . buffer . ByteBuf expected = io . netty . buffer . Unpooled . buffer ( ) ; expected . writeInt ( ( ( recordIdBytes . length ) + 1 ) ) ; expected . writeByte ( Messages . HEADER_RECORD ) ; expected . writeBytes ( recordIdBytes ) ; "<AssertPlaceHolder>" ; } writeByte ( byte ) { position = org . apache . jackrabbit . oak . segment . BinaryUtils . writeByte ( buffer , position , value ) ; dirty = true ; }
|
org . junit . Assert . assertEquals ( expected , buffer )
|
testFindGroupDNWhenExceptionInSearch ( ) { conf . setVar ( HiveConf . ConfVars . HIVE_SERVER2_PLAIN_LDAP_GROUPDNPATTERN , com . google . common . base . Joiner . on ( ":" ) . join ( "CN=%s,OU=org1,DC=foo,DC=bar" , "CN=%s,OU=org2,DC=foo,DC=bar" ) ) ; javax . naming . NamingEnumeration < javax . naming . directory . SearchResult > result = org . apache . hive . service . auth . ldap . LdapTestUtils . LdapTestUtils . mockNamingEnumeration ( "CN=Group1" ) ; when ( ctx . search ( anyString ( ) , anyString ( ) , any ( javax . naming . directory . SearchControls . class ) ) ) . thenReturn ( result ) . thenThrow ( javax . naming . NamingException . class ) ; search = new org . apache . hive . service . auth . ldap . LdapSearch ( conf , ctx ) ; java . lang . String expected = "CN=Group1" ; java . lang . String actual = search . findGroupDn ( "grp1" ) ; "<AssertPlaceHolder>" ; } findGroupDn ( java . lang . String ) { return execute ( groupBases , queries . findGroupDnById ( group ) ) . getSingleLdapName ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
simpleIndex ( ) { java . util . List < java . lang . String > disabledIndexes = disabler . disableOldIndexes ( "/oak:index/foo" , builder ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ) == 0 ; }
|
org . junit . Assert . assertTrue ( disabledIndexes . isEmpty ( ) )
|
testDeleteProcessInstancesAsyncWithSkipCustomListeners ( ) { org . camunda . bpm . engine . test . api . runtime . util . IncrementCounterListener . counter = 0 ; org . camunda . bpm . model . bpmn . BpmnModelInstance instance = org . camunda . bpm . engine . test . api . runtime . migration . models . ProcessModels . newModel ( org . camunda . bpm . engine . test . api . runtime . ONE_TASK_PROCESS ) . startEvent ( ) . userTask ( ) . camundaExecutionListenerClass ( ExecutionListener . EVENTNAME_END , org . camunda . bpm . engine . test . api . runtime . util . IncrementCounterListener . class . getName ( ) ) . endEvent ( ) . done ( ) ; testRule . deploy ( instance ) ; org . camunda . bpm . engine . test . api . runtime . List < java . lang . String > processIds = startTestProcesses ( 1 ) ; org . camunda . bpm . engine . batch . Batch batch = runtimeService . deleteProcessInstancesAsync ( processIds , null , org . camunda . bpm . engine . test . api . runtime . TESTING_INSTANCE_DELETE , true ) ; executeSeedJob ( batch ) ; executeBatchJobs ( batch ) ; "<AssertPlaceHolder>" ; } executeBatchJobs ( org . camunda . bpm . engine . batch . Batch ) { java . lang . String batchJobDefinitionId = batch . getBatchJobDefinitionId ( ) ; java . util . List < org . camunda . bpm . engine . runtime . Job > batchJobs = managementService . createJobQuery ( ) . jobDefinitionId ( batchJobDefinitionId ) . list ( ) ; org . junit . Assert . assertFalse ( batchJobs . isEmpty ( ) ) ; java . util . List < java . lang . Exception > catchedExceptions = new java . util . ArrayList < java . lang . Exception > ( ) ; for ( org . camunda . bpm . engine . runtime . Job batchJob : batchJobs ) { try { managementService . executeJob ( batchJob . getId ( ) ) ; } catch ( java . lang . Exception e ) { catchedExceptions . add ( e ) ; } } return catchedExceptions ; }
|
org . junit . Assert . assertThat ( IncrementCounterListener . counter , org . hamcrest . CoreMatchers . is ( 0 ) )
|
testCreation ( ) { java . lang . Runnable runnable = mock ( org . eclipse . swt . widgets . Runnable . class ) ; org . eclipse . swt . widgets . TimerExecTask task = new org . eclipse . swt . widgets . TimerExecTask ( scheduler , runnable ) ; "<AssertPlaceHolder>" ; } getRunnable ( ) { return runnable ; }
|
org . junit . Assert . assertEquals ( runnable , task . getRunnable ( ) )
|
testMeterMetrics ( ) { java . lang . String source = this . getClass ( ) . getResource ( "/com/cloudera/csd/tools/codahale/meters.json" ) . getPath ( ) ; adapter . init ( source , CodahaleMetricAdapter . DEFAULT_CONVENTIONS ) ; java . util . List < com . cloudera . csd . descriptors . MetricDescriptor > metrics = adapter . getServiceMetrics ( ) ; "<AssertPlaceHolder>" ; for ( com . cloudera . csd . descriptors . MetricDescriptor metric : metrics ) { java . lang . String metricName = ( metric . getName ( ) . contains ( "metric2" ) ) ? "metric2" : "metric1" ; com . cloudera . csd . tools . codahale . CodahaleMetricTypes . MeterMetricType type = getMeterTypeForMetric ( metric . getName ( ) ) ; validateComplexMetric ( metric , adapter . getServiceName ( ) , type . makeMetricName ( ( "test_svc_" + metricName ) ) , type . makeMetricLabel ( java . lang . String . format ( "test_svc_%s_label" , metricName ) ) , type . makeMetricDescription ( java . lang . String . format ( "test_svc_%s_description" , metricName ) ) , "bytes" , type . isCounter ( ) ) ; } } getServiceMetrics ( ) { return serviceMetrics ; }
|
org . junit . Assert . assertEquals ( ( 2 * ( com . cloudera . csd . tools . codahale . CodahaleMetricTypes . MeterMetricType . values ( ) . length ) ) , metrics . size ( ) )
|
testAddExistingUrl ( ) { java . io . File tempFile = createTempFile ( "recent" , ".url" ) ; tempFile . deleteOnExit ( ) ; java . net . URL url = tempFile . toURI ( ) . toURL ( ) ; model . addUrl ( url ) ; model . addUrl ( url ) ; model . addUrl ( url ) ; "<AssertPlaceHolder>" ; } getUrls ( ) { java . util . List < java . net . URL > result = new java . util . ArrayList ( ) ; java . lang . String recentUrls = preferences . get ( slash . navigation . converter . gui . models . RecentUrlsModel . RECENT_URLS_PREFERENCE , "" ) ; for ( char c : recentUrls . toCharArray ( ) ) { java . lang . String urlString = preferences . get ( ( ( slash . navigation . converter . gui . models . RecentUrlsModel . RECENT_URL_PREFERENCE ) + c ) , null ) ; if ( urlString != null ) { try { java . net . URL url = new java . net . URL ( urlString ) ; java . io . File file = slash . common . io . Files . toFile ( url ) ; if ( ( file == null ) || ( file . exists ( ) ) ) result . add ( 0 , url ) ; } catch ( java . net . MalformedURLException e ) { slash . navigation . converter . gui . models . RecentUrlsModel . log . warning ( ( ( ( "Recent<sp>URL<sp>'" + urlString ) + "'<sp>is<sp>malformed:<sp>" ) + e ) ) ; } } } return result . subList ( 0 , java . lang . Math . min ( result . size ( ) , getMaximumCount ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( singletonList ( url ) , model . getUrls ( ) )
|
testNextBoolean ( ) { org . numenta . nupic . util . MersenneTwisterFast m = new org . numenta . nupic . util . MersenneTwisterFast ( 42 ) ; "<AssertPlaceHolder>" ; } nextBoolean ( ) { int y ; if ( ( mti ) >= ( org . numenta . nupic . util . MersenneTwisterFast . N ) ) { int kk ; final int [ ] mt = this . mt ; final int [ ] mag01 = this . mag01 ; for ( kk = 0 ; kk < ( ( org . numenta . nupic . util . MersenneTwisterFast . N ) - ( org . numenta . nupic . util . MersenneTwisterFast . M ) ) ; kk ++ ) { y = ( ( mt [ kk ] ) & ( org . numenta . nupic . util . MersenneTwisterFast . UPPER_MASK ) ) | ( ( mt [ ( kk + 1 ) ] ) & ( org . numenta . nupic . util . MersenneTwisterFast . LOWER_MASK ) ) ; mt [ kk ] = ( ( mt [ ( kk + ( org . numenta . nupic . util . MersenneTwisterFast . M ) ) ] ) ^ ( y > > > 1 ) ) ^ ( mag01 [ ( y & 1 ) ] ) ; } for ( ; kk < ( ( org . numenta . nupic . util . MersenneTwisterFast . N ) - 1 ) ; kk ++ ) { y = ( ( mt [ kk ] ) & ( org . numenta . nupic . util . MersenneTwisterFast . UPPER_MASK ) ) | ( ( mt [ ( kk + 1 ) ] ) & ( org . numenta . nupic . util . MersenneTwisterFast . LOWER_MASK ) ) ; mt [ kk ] = ( ( mt [ ( kk + ( ( org . numenta . nupic . util . MersenneTwisterFast . M ) - ( org . numenta . nupic . util . MersenneTwisterFast . N ) ) ) ] ) ^ ( y > > > 1 ) ) ^ ( mag01 [ ( y & 1 ) ] ) ; } y = ( ( mt [ ( ( org . numenta . nupic . util . MersenneTwisterFast . N ) - 1 ) ] ) & ( org . numenta . nupic . util . MersenneTwisterFast . UPPER_MASK ) ) | ( ( mt [ 0 ] ) & ( org . numenta . nupic . util . MersenneTwisterFast . LOWER_MASK ) ) ; mt [ ( ( org . numenta . nupic . util . MersenneTwisterFast . N ) - 1 ) ] = ( ( mt [ ( ( org . numenta . nupic . util . MersenneTwisterFast . M ) - 1 ) ] ) ^ ( y > > > 1 ) ) ^ ( mag01 [ ( y & 1 ) ] ) ; mti = 0 ; } y = mt [ ( ( mti ) ++ ) ] ; y ^= y > > > 11 ; y ^= ( y << 7 ) & ( org . numenta . nupic . util . MersenneTwisterFast . TEMPERING_MASK_B ) ; y ^= ( y << 15 ) & ( org . numenta . nupic . util . MersenneTwisterFast . TEMPERING_MASK_C ) ; y ^= y > > > 18 ; return ( ( boolean ) ( ( y > > > 31 ) != 0 ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( m . nextBoolean ( ) ) || true ) )
|
testRemoveProfile ( ) { org . libreplan . business . users . entities . Profile profile = createValidProfile ( ) ; profileDAO . save ( profile ) ; profileDAO . remove ( profile . getId ( ) ) ; "<AssertPlaceHolder>" ; } exists ( PK extends java . io . Serializable ) { return ( getSession ( ) . createCriteria ( entityClass ) . add ( org . hibernate . criterion . Restrictions . idEq ( id ) ) . setProjection ( org . hibernate . criterion . Projections . id ( ) ) . uniqueResult ( ) ) != null ; }
|
org . junit . Assert . assertFalse ( profileDAO . exists ( profile . getId ( ) ) )
|
testCascadeRemoveFail ( ) { java . util . Date currentTime = new java . util . Date ( ) ; java . lang . String serviceName = "MapReduce2" ; java . lang . String clusterName = "test_cluster1" ; createService ( currentTime , serviceName , clusterName ) ; org . apache . ambari . server . orm . entities . ClusterServiceEntity clusterServiceEntity = clusterServiceDAO . findByClusterAndServiceNames ( clusterName , serviceName ) ; clusterServiceDAO . remove ( clusterServiceEntity ) ; "<AssertPlaceHolder>" ; } findByClusterAndServiceNames ( java . lang . String , java . lang . String ) { javax . persistence . TypedQuery < org . apache . ambari . server . orm . entities . ClusterServiceEntity > query = entityManagerProvider . get ( ) . createNamedQuery ( "clusterServiceByClusterAndServiceNames" , org . apache . ambari . server . orm . entities . ClusterServiceEntity . class ) ; query . setParameter ( "clusterName" , clusterName ) ; query . setParameter ( "serviceName" , serviceName ) ; try { return query . getSingleResult ( ) ; } catch ( javax . persistence . NoResultException ignored ) { return null ; } }
|
org . junit . Assert . assertNull ( clusterServiceDAO . findByClusterAndServiceNames ( clusterName , serviceName ) )
|
testPropertyMapContainsSelfComputeHash ( ) { com . eclipsesource . v8 . utils . V8PropertyMap < java . lang . Object > map = new com . eclipsesource . v8 . utils . V8PropertyMap < java . lang . Object > ( ) ; map . put ( "foo" , map ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return v8Object . hashCode ( ) ; }
|
org . junit . Assert . assertEquals ( map . hashCode ( ) , map . get ( "foo" ) . hashCode ( ) )
|
testSetImage ( ) { org . eclipse . swt . graphics . Image image = getImage ( ) ; view . setImage ( image ) ; "<AssertPlaceHolder>" ; } getImage ( ) { return image ; }
|
org . junit . Assert . assertSame ( image , view . getImage ( ) )
|
shouldAllowUsersWriteAccessToTheirOwnOperations ( ) { uk . gov . gchq . gaffer . named . operation . NamedOperationDetail op = new uk . gov . gchq . gaffer . named . operation . NamedOperationDetail . Builder ( ) . operationName ( uk . gov . gchq . gaffer . store . operation . handler . named . cache . NamedOperationCacheTest . OPERATION_NAME ) . creatorId ( standardUser . getUserId ( ) ) . operationChain ( standardOpChain ) . readers ( readers ) . writers ( new java . util . ArrayList ( ) ) . build ( ) ; uk . gov . gchq . gaffer . store . operation . handler . named . cache . NamedOperationCacheTest . cache . addNamedOperation ( op , false , standardUser ) ; uk . gov . gchq . gaffer . store . operation . handler . named . cache . NamedOperationCacheTest . cache . addNamedOperation ( standard , true , standardUser ) ; "<AssertPlaceHolder>" ; } getNamedOperation ( java . lang . String , uk . gov . gchq . gaffer . user . User ) { return get ( name , user , null ) ; }
|
org . junit . Assert . assertEquals ( standard , uk . gov . gchq . gaffer . store . operation . handler . named . cache . NamedOperationCacheTest . cache . getNamedOperation ( uk . gov . gchq . gaffer . store . operation . handler . named . cache . NamedOperationCacheTest . OPERATION_NAME , standardUser ) )
|
testFirePlaylistChangeEventSongAdded ( ) { final org . bff . javampd . playlist . PlaylistChangeEvent [ ] changeEvent = new org . bff . javampd . playlist . PlaylistChangeEvent [ 1 ] ; playlist . addPlaylistChangeListener ( ( event ) -> changeEvent [ 0 ] = event ) ; playlist . firePlaylistChangeEvent ( PlaylistChangeEvent . Event . SONG_ADDED , "name" ) ; "<AssertPlaceHolder>" ; } firePlaylistChangeEvent ( org . bff . javampd . playlist . PlaylistChangeEvent$Event , java . lang . String ) { org . bff . javampd . playlist . PlaylistChangeEvent pce = new org . bff . javampd . playlist . PlaylistChangeEvent ( this , event , name ) ; for ( org . bff . javampd . playlist . PlaylistChangeListener pcl : listeners ) { pcl . playlistChanged ( pce ) ; } }
|
org . junit . Assert . assertEquals ( "name" , changeEvent [ 0 ] . getName ( ) )
|
runQuery ( ) { final java . lang . String ryaInstance = "rya" ; final org . apache . rya . streams . api . entity . StreamsQuery sQuery = new org . apache . rya . streams . api . entity . StreamsQuery ( java . util . UUID . randomUUID ( ) , "SELECT<sp>*<sp>WHERE<sp>{<sp>?person<sp><urn:worksAt><sp>?business<sp>.<sp>}" , true , false ) ; final org . eclipse . rdf4j . model . ValueFactory vf = org . eclipse . rdf4j . model . impl . SimpleValueFactory . getInstance ( ) ; final java . util . List < org . apache . rya . api . model . VisibilityStatement > statements = new java . util . ArrayList ( ) ; statements . add ( new org . apache . rya . api . model . VisibilityStatement ( vf . createStatement ( vf . createIRI ( "urn:Alice" ) , vf . createIRI ( "urn:worksAt" ) , vf . createIRI ( "rya" 0 ) ) , "a" ) ) ; statements . add ( new org . apache . rya . api . model . VisibilityStatement ( vf . createStatement ( vf . createIRI ( "urn:Bob" ) , vf . createIRI ( "urn:worksAt" ) , vf . createIRI ( "urn:TacoShop" ) ) , "a" ) ) ; statements . add ( new org . apache . rya . api . model . VisibilityStatement ( vf . createStatement ( vf . createIRI ( "urn:Charlie" ) , vf . createIRI ( "urn:worksAt" ) , vf . createIRI ( "urn:TacoShop" ) ) , "a" ) ) ; final java . util . List < org . apache . rya . api . model . VisibilityBindingSet > expected = new java . util . ArrayList ( ) ; org . eclipse . rdf4j . query . impl . MapBindingSet bs = new org . eclipse . rdf4j . query . impl . MapBindingSet ( ) ; bs . addBinding ( "rya" 1 , vf . createIRI ( "urn:Alice" ) ) ; bs . addBinding ( "business" , vf . createIRI ( "rya" 0 ) ) ; expected . add ( new org . apache . rya . api . model . VisibilityBindingSet ( bs , "a" ) ) ; bs = new org . eclipse . rdf4j . query . impl . MapBindingSet ( ) ; bs . addBinding ( "rya" 1 , vf . createIRI ( "urn:Bob" ) ) ; bs . addBinding ( "business" , vf . createIRI ( "urn:TacoShop" ) ) ; expected . add ( new org . apache . rya . api . model . VisibilityBindingSet ( bs , "a" ) ) ; bs = new org . eclipse . rdf4j . query . impl . MapBindingSet ( ) ; bs . addBinding ( "rya" 1 , vf . createIRI ( "urn:Charlie" ) ) ; bs . addBinding ( "business" , vf . createIRI ( "urn:TacoShop" ) ) ; expected . add ( new org . apache . rya . api . model . VisibilityBindingSet ( bs , "a" ) ) ; final org . apache . rya . streams . kafka . interactor . CreateKafkaTopic createKafkaTopic = new org . apache . rya . streams . kafka . interactor . CreateKafkaTopic ( kafka . getZookeeperServers ( ) ) ; final java . lang . String kafkaServers = ( ( kafka . getKafkaHostname ( ) ) + ":" ) + ( kafka . getKafkaPort ( ) ) ; final org . apache . rya . streams . kafka . KafkaStreamsFactory jobFactory = new org . apache . rya . streams . kafka . SingleThreadKafkaStreamsFactory ( kafkaServers ) ; final org . apache . rya . streams . querymanager . QueryExecutor executor = new org . apache . rya . streams . querymanager . kafka . LocalQueryExecutor ( createKafkaTopic , jobFactory ) ; executor . startAndWait ( ) ; try { executor . startQuery ( ryaInstance , sQuery ) ; java . lang . Thread . sleep ( 5000 ) ; final java . lang . String statementsTopic = org . apache . rya . streams . kafka . KafkaTopics . statementsTopic ( ryaInstance ) ; final org . apache . rya . streams . api . interactor . LoadStatements loadStatements = new org . apache . rya . streams . kafka . interactor . KafkaLoadStatements ( statementsTopic , stmtProducer ) ; loadStatements . fromCollection ( statements ) ; final java . lang . String resultsTopic = org . apache . rya . streams . kafka . KafkaTopics . queryResultsTopic ( ryaInstance , sQuery . getQueryId ( ) ) ; resultConsumer . subscribe ( com . google . common . collect . Lists . newArrayList ( resultsTopic ) ) ; final java . util . List < org . apache . rya . api . model . VisibilityBindingSet > results = org . apache . rya . test . kafka . KafkaTestUtil . pollForResults ( 500 , 6 , 3 , resultConsumer ) ; "<AssertPlaceHolder>" ; } finally { executor . stopAndWait ( ) ; } } pollForResults ( int , int , int , org . apache . kafka . clients . consumer . Consumer ) { requireNonNull ( consumer ) ; final java . util . List < V > values = new java . util . ArrayList ( ) ; int i = 0 ; while ( ( ( values . size ( ) ) < targetSize ) && ( i < pollIterations ) ) { for ( final org . apache . kafka . clients . consumer . ConsumerRecord < K , V > record : consumer . poll ( pollMs ) ) { values . add ( record . value ( ) ) ; } i ++ ; } return values ; }
|
org . junit . Assert . assertEquals ( expected , results )
|
testExtendedTypes ( ) { com . tinkerpop . blueprints . Graph graph = com . tinkerpop . blueprints . impls . tg . TinkerGraphFactory . createTinkerGraph ( ) ; com . tinkerpop . frames . FramedGraphFactory factory = new com . tinkerpop . frames . FramedGraphFactory ( new com . tinkerpop . frames . modules . AbstractModule ( ) { @ com . tinkerpop . frames . modules . Override public void doConfigure ( com . tinkerpop . frames . FramedGraphConfiguration config ) { config . addTypeResolver ( new com . tinkerpop . frames . modules . TypeResolver ( ) { @ com . tinkerpop . frames . modules . Override public java . lang . Class < ? > [ ] resolveTypes ( com . tinkerpop . blueprints . Edge e , java . lang . Class < ? > defaultType ) { return new java . lang . Class [ 0 ] ; } @ com . tinkerpop . frames . modules . Override public java . lang . Class < ? > [ ] resolveTypes ( com . tinkerpop . blueprints . Vertex v , java . lang . Class < ? > defaultType ) { return new java . lang . Class [ ] { com . tinkerpop . frames . modules . TypeResolverTest . ExtendedPerson . class } ; } } ) ; } } ) ; framedGraph = factory . create ( graph ) ; com . tinkerpop . frames . domain . classes . Person marko = framedGraph . getVertex ( 1 , com . tinkerpop . frames . domain . classes . Person . class ) ; "<AssertPlaceHolder>" ; } getVertex ( java . lang . Object , java . lang . Class ) { return this . frame ( getVertex ( id ) , kind ) ; }
|
org . junit . Assert . assertTrue ( ( marko instanceof com . tinkerpop . frames . modules . TypeResolverTest . ExtendedPerson ) )
|
givenResourceAllowed_whenIsAllowed_thenReturnsTrue ( ) { com . brandwatch . robots . cli . Result result = new com . brandwatch . robots . cli . Result ( com . brandwatch . robots . cli . ResultTest . VALID_RESOURCE , true ) ; "<AssertPlaceHolder>" ; } isAllowed ( ) { return allowed ; }
|
org . junit . Assert . assertThat ( result . isAllowed ( ) , org . hamcrest . CoreMatchers . equalTo ( true ) )
|
stopTransactionAcceptedVerifyReturnValue ( ) { when ( chargePointService . remoteStopTransaction ( any ( io . motown . ocpp . v12 . soap . chargepoint . RemoteStopTransactionRequest . class ) , anyString ( ) ) ) . thenReturn ( getRemoteStopTransactionResponse ( RemoteStartStopStatus . ACCEPTED ) ) ; boolean willTransactionStop = client . stopTransaction ( io . motown . ocpp . v12 . soap . chargepoint . CHARGING_STATION_ID , ( ( io . motown . domain . api . chargingstation . NumberedTransactionId ) ( io . motown . ocpp . v12 . soap . chargepoint . TRANSACTION_ID ) ) . getNumber ( ) ) ; "<AssertPlaceHolder>" ; } getNumber ( ) { return java . lang . Integer . valueOf ( id . substring ( ( ( id . lastIndexOf ( '_' ) ) + 1 ) , id . length ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( willTransactionStop )
|
testBlockTypeProtoDefaultsToContiguous ( ) { org . apache . hadoop . hdfs . server . namenode . FsImageProto . INodeSection . INodeFile . Builder builder = INodeSection . INodeFile . newBuilder ( ) ; org . apache . hadoop . hdfs . server . namenode . FsImageProto . INodeSection . INodeFile inodeFile = builder . build ( ) ; org . apache . hadoop . hdfs . protocol . BlockType defaultBlockType = org . apache . hadoop . hdfs . protocolPB . PBHelperClient . convert ( inodeFile . getBlockType ( ) ) ; "<AssertPlaceHolder>" ; } getBlockType ( ) { return org . apache . hadoop . hdfs . protocol . BlockType . CONTIGUOUS ; }
|
org . junit . Assert . assertEquals ( defaultBlockType , BlockType . CONTIGUOUS )
|
testUninstall ( ) { java . lang . Class < ? > defaultUiClass = txt . getUI ( ) . getClass ( ) ; wrapper . install ( txt , true ) ; wrapper . uninstall ( txt ) ; "<AssertPlaceHolder>" ; } getUI ( ) { return ( ( org . jdesktop . swingx . plaf . MonthViewUI ) ( ui ) ) ; }
|
org . junit . Assert . assertEquals ( defaultUiClass , txt . getUI ( ) . getClass ( ) )
|
get_class ( ) { final com . mousefeed . client . Messages messages = new com . mousefeed . client . Messages ( com . mousefeed . client . MessagesTest . class ) ; assert isNotBlank ( messages . get ( com . mousefeed . client . MessagesTest . SHORT_KEY ) ) ; "<AssertPlaceHolder>" ; assert isNotBlank ( new com . mousefeed . client . Messages ( ) . get ( com . mousefeed . client . MessagesTest . FULL_KEY ) ) ; assert isNotBlank ( new com . mousefeed . client . Messages ( null ) . get ( com . mousefeed . client . MessagesTest . FULL_KEY ) ) ; } get ( org . eclipse . e4 . ui . workbench . renderers . swt . HandledContributionItem ) { final org . eclipse . core . commands . ParameterizedCommand parCommand = getItemParCommand ( item ) ; return parCommand == null ? null : parCommand . getCommand ( ) ; }
|
org . junit . Assert . assertEquals ( messages . get ( com . mousefeed . client . MessagesTest . SHORT_KEY ) , messages . get ( com . mousefeed . client . MessagesTest . FULL_KEY ) )
|
testBadCase ( ) { net . sourceforge . pmd . Rule rule = makeXpathRuleFromXPath ( "//ConstructorDeclaration[metric('cYclo')<sp>><sp>1]" ) ; final java . lang . String code = "class<sp>Hoo<sp>{<sp>Hoo()<sp>{if(true){}}<sp>}" ; java . util . Iterator < net . sourceforge . pmd . RuleViolation > violations = getViolations ( rule , code ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( attributes != null ) && ( ( index ) < ( attributes . getLength ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( violations . hasNext ( ) )
|
testReceiveNoWaitPassthrough ( ) { org . apache . qpid . jms . JmsSession session = org . mockito . Mockito . mock ( org . apache . qpid . jms . JmsSession . class ) ; org . apache . qpid . jms . JmsMessageConsumer messageConsumer = org . mockito . Mockito . mock ( org . apache . qpid . jms . JmsMessageConsumer . class ) ; org . apache . qpid . jms . JmsConsumer consumer = new org . apache . qpid . jms . JmsConsumer ( session , messageConsumer ) ; try { "<AssertPlaceHolder>" ; } finally { consumer . close ( ) ; } org . mockito . Mockito . verify ( messageConsumer , org . mockito . Mockito . times ( 1 ) ) . receiveNoWait ( ) ; } receiveNoWait ( ) { try { return consumer . receiveNoWait ( ) ; } catch ( javax . jms . JMSException e ) { throw org . apache . qpid . jms . exceptions . JmsExceptionSupport . createRuntimeException ( e ) ; } }
|
org . junit . Assert . assertNull ( consumer . receiveNoWait ( ) )
|
newArrayTest ( ) { java . lang . String [ ] newArray = cn . hutool . core . util . ArrayUtil . newArray ( java . lang . String . class , 3 ) ; "<AssertPlaceHolder>" ; } newArray ( java . lang . Class , int ) { return ( ( T [ ] ) ( java . lang . reflect . Array . newInstance ( componentType , newSize ) ) ) ; }
|
org . junit . Assert . assertEquals ( 3 , newArray . length )
|
should_get_field_value ( ) { org . fest . reflect . core . Reflection_field_Test . Person person = new org . fest . reflect . core . Reflection_field_Test . Person ( ) ; person . name = "Yoda" ; java . lang . String name = org . fest . reflect . core . Reflection . field ( "name" ) . ofType ( java . lang . String . class ) . in ( person ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { try { java . lang . Object value = descriptor . getReadMethod ( ) . invoke ( target ) ; return castSafely ( value , propertyType ) ; } catch ( java . lang . Throwable t ) { java . lang . String msg = java . lang . String . format ( "Failed<sp>to<sp>get<sp>the<sp>value<sp>of<sp>property<sp>'%s'" , descriptor . getName ( ) ) ; throw new org . fest . reflect . exception . ReflectionError ( msg , t ) ; } }
|
org . junit . Assert . assertEquals ( "Yoda" , name )
|
testShouldRemoveContactsIfUserIsRemoved ( ) { final java . lang . String userId = getAccount1 ( ) . getUser ( ) . getId ( ) ; dao . deleteById ( userId ) ; "<AssertPlaceHolder>" ; } readContacts ( java . lang . String ) { return doDbQuery ( getSqliteOpenHelper ( ) , new org . solovyev . android . messenger . users . SqliteUserDao . LoadContactsByUserId ( getContext ( ) , userId , getSqliteOpenHelper ( ) , this ) ) ; }
|
org . junit . Assert . assertTrue ( dao . readContacts ( userId ) . isEmpty ( ) )
|
testEmpty ( ) { replay ( lineProcessorsMock ) ; fontLoader . load ( fontRenderer , null , createInputStream ( new byte [ ] { } ) , "somename.fnt" , 0 , 0 , "" ) ; "<AssertPlaceHolder>" ; } createInputStream ( byte [ ] ) { java . io . InputStream in = new java . io . ByteArrayInputStream ( data ) { @ org . jglfont . format . angelcode . Override public void close ( ) throws java . io . IOException { super . close ( ) ; closeCalled = true ; } } ; return in ; }
|
org . junit . Assert . assertTrue ( closeCalled )
|
testPlaceGroupGetSelection ( ) { System . out . println ( "placeGroupGetSelection" ) ; mudmap2 . frontend . GUIElement . WorldPanel . WorldPanel instance = null ; java . util . HashSet < mudmap2 . backend . Place > expResult = null ; java . util . HashSet < mudmap2 . backend . Place > result = instance . placeGroupGetSelection ( ) ; "<AssertPlaceHolder>" ; org . junit . Assert . fail ( "The<sp>test<sp>case<sp>is<sp>a<sp>prototype." ) ; } placeGroupGetSelection ( ) { if ( ( placeGroupBoxStart ) != null ) { placeGroupBoxSelectionToList ( ) ; } return placeGroup ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testValidate__Live ( ) { org . apache . ambari . server . KdcServerConnectionVerification kdcConnVerifier = new org . apache . ambari . server . KdcServerConnectionVerification ( configuration ) ; boolean result = kdcConnVerifier . isKdcReachable ( "c6501:88" ) ; "<AssertPlaceHolder>" ; } isKdcReachable ( java . lang . String ) { try { if ( ( kdcHost == null ) || ( kdcHost . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "Invalid<sp>hostname<sp>for<sp>KDC<sp>server" ) ; } java . lang . String [ ] kdcDetails = kdcHost . split ( ":" ) ; if ( ( kdcDetails . length ) == 1 ) { return isKdcReachable ( kdcDetails [ 0 ] , parsePort ( config . getDefaultKdcPort ( ) ) ) ; } else { return isKdcReachable ( kdcDetails [ 0 ] , parsePort ( kdcDetails [ 1 ] ) ) ; } } catch ( java . lang . Exception e ) { org . apache . ambari . server . KdcServerConnectionVerification . LOG . error ( ( "Exception<sp>while<sp>checking<sp>KDC<sp>reachability:<sp>" + e ) ) ; return false ; } }
|
org . junit . Assert . assertTrue ( result )
|
givenHttpClientThatFailure_whenMakeACall_shouldReturnFailureAndRecover ( ) { com . baeldung . vavr . exception . handling . client . Response defaultResponse = new com . baeldung . vavr . exception . handling . client . Response ( "b" ) ; com . baeldung . vavr . exception . handling . client . HttpClient httpClient = ( ) -> { throw new com . baeldung . vavr . exception . handling . client . ClientException ( "non<sp>critical<sp>problem" ) ; } ; io . vavr . control . Try < com . baeldung . vavr . exception . handling . client . Response > recovered = new com . baeldung . vavr . exception . handling . VavrTry ( httpClient ) . getResponse ( ) . recover ( ( r ) -> Match ( r ) . of ( Case ( $ ( instanceOf ( . class ) ) , defaultResponse ) , Case ( $ ( instanceOf ( . class ) ) , defaultResponse ) ) ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return success ; }
|
org . junit . Assert . assertTrue ( recovered . isSuccess ( ) )
|
mixtureTest ( ) { final greycat . Graph graph = new greycat . GraphBuilder ( ) . withPlugin ( new greycat . ml . MLPlugin ( ) ) . withScheduler ( new greycat . scheduler . NoopScheduler ( ) ) . build ( ) ; graph . connect ( new greycat . Callback < java . lang . Boolean > ( ) { @ greycat . ml . profiling . Override public void on ( java . lang . Boolean result ) { double [ ] data = new double [ 3 ] ; java . util . Random rand = new java . util . Random ( ) ; greycat . ml . algorithm . profiling . GaussianMixtureNode node1 = ( ( greycat . ml . algorithm . profiling . GaussianMixtureNode ) ( graph . newTypedNode ( 0 , 0 , GaussianMixtureNode . NAME ) ) ) ; node1 . set ( GaussianMixtureNode . LEVEL , Type . INT , 1 ) ; node1 . set ( GaussianMixtureNode . WIDTH , Type . INT , 100 ) ; double [ ] sum = new double [ 3 ] ; int total = 220 ; for ( int i = 0 ; i < total ; i ++ ) { data [ 0 ] = 8 + ( ( rand . nextDouble ( ) ) * 4 ) ; data [ 1 ] = 90 + ( ( rand . nextDouble ( ) ) * 20 ) ; data [ 2 ] = ( - 60 ) + ( ( rand . nextDouble ( ) ) * 20 ) ; node1 . learnWith ( data ) ; sum [ 0 ] += data [ 0 ] ; sum [ 1 ] += data [ 1 ] ; sum [ 2 ] += data [ 2 ] ; } sum [ 0 ] = ( sum [ 0 ] ) / total ; sum [ 1 ] = ( sum [ 1 ] ) / total ; sum [ 2 ] = ( sum [ 2 ] ) / total ; double eps = 1.0E-7 ; double [ ] res = node1 . getAvg ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { "<AssertPlaceHolder>" ; } } } ) ; } abs ( int ) { if ( index < 0 ) { return - index ; } else { return index ; } }
|
org . junit . Assert . assertTrue ( ( ( java . lang . Math . abs ( ( ( res [ i ] ) - ( sum [ i ] ) ) ) ) < eps ) )
|
checkOff ( ) { java . lang . Thread . sleep ( 2000 ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return count ; }
|
org . junit . Assert . assertEquals ( 0 , bean . getCount ( ) )
|
loadNumericBooleanUsingV2CompatSchema_UnmarshallsCorrectly ( ) { stubGetItemRequest ( "booleanAttr" , software . amazon . awssdk . services . dynamodb . model . AttributeValue . builder ( ) . n ( "1" ) . build ( ) ) ; final software . amazon . awssdk . services . dynamodb . mapper . V2CompatibleBooleansTest . UnitTestPojo pojo = loadPojo ( v2CompatMapper ) ; "<AssertPlaceHolder>" ; } getBooleanAttr ( ) { return booleanAttr ; }
|
org . junit . Assert . assertTrue ( pojo . getBooleanAttr ( ) )
|
fixedOrderMustTransfer_checkWhetherMarked ( ) { org . eclipse . elk . alg . layered . graph . LNode leftOuterNode = addNodeToLayer ( makeLayer ( ) ) ; org . eclipse . elk . alg . layered . graph . LNode [ ] middleNodes = addNodesToLayer ( 2 , makeLayer ( ) ) ; setFixedOrderConstraint ( middleNodes [ 0 ] ) ; setFixedOrderConstraint ( middleNodes [ 1 ] ) ; org . eclipse . elk . alg . layered . graph . LNode rightOuterNode = addNodeToLayer ( makeLayer ( ) ) ; org . eclipse . elk . alg . layered . graph . LPort [ ] leftOuterPorts = addPortsOnSide ( 2 , leftOuterNode , PortSide . EAST ) ; org . eclipse . elk . alg . layered . graph . LPort [ ] rightOuterPorts = addPortsOnSide ( 2 , rightOuterNode , PortSide . WEST ) ; eastWestEdgeFromTo ( leftOuterPorts [ 0 ] , middleNodes [ 0 ] ) ; eastWestEdgeFromTo ( leftOuterPorts [ 1 ] , middleNodes [ 1 ] ) ; eastWestEdgeFromTo ( middleNodes [ 0 ] , rightOuterPorts [ 0 ] ) ; eastWestEdgeFromTo ( middleNodes [ 1 ] , rightOuterPorts [ 1 ] ) ; makeNestedTwoNodeGraphWithEasternPorts ( leftOuterNode , leftOuterPorts ) ; 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 ( ) )
|
testOnErrorIgnore ( ) { buildRule . executeTarget ( "onerror.ignore" ) ; "<AssertPlaceHolder>" ; } getLog ( ) { return mLog ; }
|
org . junit . Assert . assertEquals ( "" , buildRule . getLog ( ) )
|
testIsListWithKeyAndDisplayValuesWhenEmpty ( ) { java . util . Map < java . lang . String , java . lang . Object > properties = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; "<AssertPlaceHolder>" ; } isListWithKeyAndDisplayValues ( org . mayocat . addons . model . AddonFieldDefinition ) { return org . mayocat . addons . util . AddonUtils . isListWithKeyAndDisplayValues ( field . getProperties ( ) ) ; }
|
org . junit . Assert . assertFalse ( org . mayocat . addons . util . AddonUtils . isListWithKeyAndDisplayValues ( properties ) )
|
testBitwiseZip ( ) { int x = 65535 ; int y = 16711935 ; byte [ ] actual = tiny . mdhbase . Utils . bitwiseZip ( x , y ) ; byte [ ] expected = new byte [ ] { 0 , 0 , 85 , 85 , ( - 85 ) - 1 , ( - 85 ) - 1 , ( - 0 ) - 1 , ( - 0 ) - 1 } ; "<AssertPlaceHolder>" ; } bitwiseZip ( int , int ) { byte [ ] ret = new byte [ 8 ] ; int xh = tiny . mdhbase . Utils . makeGap ( x ) ; int xl = tiny . mdhbase . Utils . makeGap ( ( x << 16 ) ) ; int yh = ( tiny . mdhbase . Utils . makeGap ( y ) ) > > > 1 ; int yl = ( tiny . mdhbase . Utils . makeGap ( ( y << 16 ) ) ) > > > 1 ; int zh = xh | yh ; int zl = xl | yl ; byte [ ] rh = org . apache . hadoop . hbase . util . Bytes . toBytes ( zh ) ; byte [ ] rl = org . apache . hadoop . hbase . util . Bytes . toBytes ( zl ) ; java . lang . System . arraycopy ( rh , 0 , ret , 0 , 4 ) ; java . lang . System . arraycopy ( rl , 0 , ret , 4 , 4 ) ; return ret ; }
|
org . junit . Assert . assertArrayEquals ( expected , actual )
|
testAtom ( ) { org . openscience . cdk . interfaces . IAtom a = new org . openscience . cdk . Atom ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( a )
|
testBuildWithParameters ( ) { java . lang . String abbrName = "abbr<sp>name" ; java . lang . String name = "fdsfds" ; org . lnu . is . domain . specialty . SpecialtyType context = new org . lnu . is . domain . specialty . SpecialtyType ( ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>SpecialtyType<sp>e<sp>WHERE<sp>(<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . specialty . SpecialtyType > 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 ( expected , actualQuery )
|
testGetRF1DifferentOrders ( ) { org . nd4j . linalg . api . ndarray . INDArray a = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } , new int [ ] { 3 , 3 } , 'c' ) . dup ( 'f' ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 7.0 , 8.0 , 9.0 , 0.14285715 , 0.85714287 , 1.7142857 , 0.5714286 , 0.5 , 0.0 } , new int [ ] { 3 , 3 } , 'c' ) . dup ( 'f' ) ; org . nd4j . linalg . api . ndarray . INDArray r = org . nd4j . linalg . factory . Nd4j . getNDArrayFactory ( ) . lapack ( ) . getrf ( a ) ; "<AssertPlaceHolder>" ; } getrf ( org . nd4j . linalg . api . ndarray . INDArray ) { if ( ( ( A . rows ( ) ) > ( Integer . MAX_VALUE ) ) || ( ( A . columns ( ) ) > ( Integer . MAX_VALUE ) ) ) throw new org . nd4j . linalg . exception . ND4JArraySizeException ( ) ; int m = ( ( int ) ( A . rows ( ) ) ) ; int n = ( ( int ) ( A . columns ( ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray INFO = org . nd4j . linalg . factory . Nd4j . createArrayFromShapeBuffer ( org . nd4j . linalg . factory . Nd4j . getDataBufferFactory ( ) . createInt ( 1 ) , org . nd4j . linalg . factory . Nd4j . getShapeInfoProvider ( ) . createShapeInformation ( new long [ ] { 1 , 1 } , A . dataType ( ) ) . getFirst ( ) ) ; int mn = java . lang . Math . min ( m , n ) ; org . nd4j . linalg . api . ndarray . INDArray IPIV = org . nd4j . linalg . factory . Nd4j . createArrayFromShapeBuffer ( org . nd4j . linalg . factory . Nd4j . getDataBufferFactory ( ) . createInt ( mn ) , org . nd4j . linalg . factory . Nd4j . getShapeInfoProvider ( ) . createShapeInformation ( new long [ ] { 1 , mn } , A . dataType ( ) ) . getFirst ( ) ) ; if ( ( A . data ( ) . dataType ( ) ) == ( org . nd4j . linalg . api . buffer . DataType . DOUBLE ) ) dgetrf ( m , n , A , IPIV , INFO ) ; else if ( ( A . data ( ) . dataType ( ) ) == ( org . nd4j . linalg . api . buffer . DataType . FLOAT ) ) sgetrf ( m , n , A , IPIV , INFO ) ; else throw new java . lang . UnsupportedOperationException ( ) ; if ( ( INFO . getInt ( 0 ) ) < 0 ) { throw new java . lang . Error ( ( ( "Parameter<sp>#" + ( INFO . getInt ( 0 ) ) ) + "<sp>to<sp>getrf()<sp>was<sp>not<sp>valid" ) ) ; } else if ( ( INFO . getInt ( 0 ) ) > 0 ) { log . warn ( ( "The<sp>matrix<sp>is<sp>singular<sp>-<sp>cannot<sp>be<sp>used<sp>for<sp>inverse<sp>op.<sp>Check<sp>L<sp>matrix<sp>at<sp>row<sp>" + ( INFO . getInt ( 0 ) ) ) ) ; } return IPIV ; }
|
org . junit . Assert . assertEquals ( exp , a )
|
testPrepare ( ) { preparator . prepare ( ) ; "<AssertPlaceHolder>" ; } getCcsProtocolType ( ) { return ccsProtocolType ; }
|
org . junit . Assert . assertTrue ( ( ( message . getCcsProtocolType ( ) . getValue ( ) ) == 1 ) )
|
unequalIfTagsAreUnequal ( ) { com . ontology2 . bakemono . joins . TaggedTextItem k1 = new com . ontology2 . bakemono . joins . TaggedTextItem ( new org . apache . hadoop . io . Text ( "Doctor<sp>Funkenstein" ) , new org . apache . hadoop . io . VIntWritable ( 33550336 ) ) ; com . ontology2 . bakemono . joins . TaggedTextItem k2 = new com . ontology2 . bakemono . joins . TaggedTextItem ( new org . apache . hadoop . io . Text ( "Sir<sp>Nose<sp>D'void<sp>of<sp>Funk" ) , new org . apache . hadoop . io . VIntWritable ( 702 ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( other instanceof com . ontology2 . haruhi . ssh . HadoopConfigurationVariable ) { com . ontology2 . haruhi . ssh . HadoopConfigurationVariable that = ( ( com . ontology2 . haruhi . ssh . HadoopConfigurationVariable ) ( other ) ) ; return ( this . configFile . equals ( that . configFile ) ) && ( this . key . equals ( that . key ) ) ; } return false ; }
|
org . junit . Assert . assertFalse ( k1 . equals ( k2 ) )
|
shouldNotEqualWhenConfig2HasAllKeysFromConfig1ButAlsoANewOne ( ) { org . apache . commons . configuration . HierarchicalConfiguration hc1 = new org . apache . commons . configuration . HierarchicalConfiguration ( ) ; hc1 . addProperty ( "key1" , "value1" ) ; com . tinkerpop . rexster . extension . ExtensionConfiguration config1 = new com . tinkerpop . rexster . extension . ExtensionConfiguration ( "ns" , "name" , hc1 ) ; org . apache . commons . configuration . HierarchicalConfiguration hc2 = new org . apache . commons . configuration . HierarchicalConfiguration ( ) ; hc2 . addProperty ( "key1" , "value1" ) ; hc2 . addProperty ( "new-key" , "value1" ) ; com . tinkerpop . rexster . extension . ExtensionConfiguration config2 = new com . tinkerpop . rexster . extension . ExtensionConfiguration ( "ns" , "name" , hc2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; final com . tinkerpop . rexster . RexsterApplicationGraph that = ( ( com . tinkerpop . rexster . RexsterApplicationGraph ) ( o ) ) ; if ( ! ( graphName . equals ( that . graphName ) ) ) return false ; if ( ! ( graph . getClass ( ) . equals ( that . graph . getClass ( ) ) ) ) return false ; for ( com . tinkerpop . rexster . extension . ExtensionAllowed extensionAllowed : extensionAllowables ) { if ( ! ( that . getExtensionAllowables ( ) . contains ( extensionAllowed ) ) ) { return false ; } } for ( com . tinkerpop . rexster . extension . ExtensionConfiguration configuration : extensionConfigurations ) { if ( ! ( that . getExtensionConfigurations ( ) . contains ( configuration ) ) ) { return false ; } } return true ; }
|
org . junit . Assert . assertFalse ( config1 . equals ( config2 ) )
|
shouldFailWithoutAdditionalInfosWhenMimeTypeIsNotSupportedByConverter ( ) { java . lang . String converterName = cs . getConverterName ( "image/jpeg" , "application/pdf" ) ; org . nuxeo . ecm . core . api . blobholder . BlobHolder blobHolder = getBlobFromPath ( "test-docs/hello.xls" , "application/vnd.ms-excel" ) ; try { cs . convert ( converterName , blobHolder , java . util . Collections . emptyMap ( ) ) ; org . junit . Assert . fail ( "Should<sp>have<sp>raised<sp>a<sp>ConversionException" ) ; } catch ( org . nuxeo . ecm . core . convert . api . ConversionException e ) { "<AssertPlaceHolder>" ; } } getInfos ( ) { java . util . List < org . nuxeo . ecm . core . api . CoreSessionService . CoreSessionRegistrationInfo > infos = org . nuxeo . runtime . api . Framework . getService ( org . nuxeo . ecm . core . api . CoreSessionService . class ) . getCoreSessionRegistrationInfos ( ) ; return toInfos ( toSortedRegistration ( infos ) ) ; }
|
org . junit . Assert . assertTrue ( e . getInfos ( ) . isEmpty ( ) )
|
serialize ( ) { "<AssertPlaceHolder>" ; } serialize ( ) { org . junit . Assert . assertArrayEquals ( data , org . onlab . packet . lacp . LacpCollectorTlvTest . COLLECTOR_TLV . serialize ( ) ) ; }
|
org . junit . Assert . assertArrayEquals ( data , org . onlab . packet . lacp . LacpCollectorTlvTest . COLLECTOR_TLV . serialize ( ) )
|
testGetSplit ( ) { org . apache . tajo . catalog . TableMeta meta = org . apache . tajo . catalog . CatalogUtil . newTableMeta ( "KAFKA" , new org . apache . tajo . conf . TajoConf ( ) ) ; java . util . Map < java . lang . String , java . lang . String > option = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; option . put ( KafkaStorageConstants . KAFKA_TOPIC , org . apache . tajo . storage . kafka . KafkaTestUtil . TOPIC_NAME ) ; option . put ( KafkaStorageConstants . KAFKA_FRAGMENT_SIZE , "10" ) ; meta . setPropertySet ( new org . apache . tajo . util . KeyValueSet ( option ) ) ; org . apache . tajo . catalog . TableDesc td = new org . apache . tajo . catalog . TableDesc ( "test_table" , null , meta , null ) ; org . apache . tajo . storage . kafka . KafkaTablespace kafkaTablespace = org . apache . tajo . storage . TablespaceManager . getByName ( "cluster1" ) ; java . util . List < org . apache . tajo . storage . fragment . Fragment > fragmentList = kafkaTablespace . getSplits ( "" , td , false , null ) ; long totalCount = 0 ; for ( int i = 0 ; i < ( fragmentList . size ( ) ) ; i ++ ) { totalCount += fragmentList . get ( i ) . getLength ( ) ; } "<AssertPlaceHolder>" ; } getLength ( ) { return length ; }
|
org . junit . Assert . assertEquals ( 100 , totalCount )
|
testPreservedValuesAreNotSerialized ( ) { java . lang . String propertyName = "foo" ; org . eclipse . swt . internal . widgets . WidgetRemoteAdapter adapter = org . eclipse . swt . widgets . WidgetSerialization_Test . getWidgetRemoteAdapter ( widget ) ; adapter . preserve ( propertyName , "bar" ) ; org . eclipse . swt . widgets . Widget deserializedWidget = serializeAndDeserialize ( widget ) ; org . eclipse . rap . rwt . internal . lifecycle . RemoteAdapter deserializedAdapter = org . eclipse . swt . widgets . WidgetSerialization_Test . getWidgetRemoteAdapter ( deserializedWidget ) ; "<AssertPlaceHolder>" ; } getPreserved ( java . lang . String ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertNull ( deserializedAdapter . getPreserved ( propertyName ) )
|
selectedFieldsNone ( ) { cascading . tuple . Fields fields = new com . hotels . plunger . Data ( new cascading . tuple . Fields ( "A" , "B" ) , new java . util . ArrayList < cascading . tuple . Tuple > ( ) ) . withFields ( Fields . NONE ) . selectedFields ( ) ; "<AssertPlaceHolder>" ; } selectedFields ( ) { cascading . tuple . Fields fields = new com . hotels . plunger . Data ( new cascading . tuple . Fields ( "A" , "B" ) , new java . util . ArrayList < cascading . tuple . Tuple > ( ) ) . withFields ( new cascading . tuple . Fields ( "A" ) ) . selectedFields ( ) ; org . junit . Assert . assertThat ( fields , org . hamcrest . CoreMatchers . is ( new cascading . tuple . Fields ( "A" ) ) ) ; }
|
org . junit . Assert . assertThat ( fields , org . hamcrest . CoreMatchers . is ( Fields . NONE ) )
|
testNameRedundancyWithObsoletes ( ) { owltools . io . ParserWrapper parser = new owltools . io . ParserWrapper ( ) ; org . semanticweb . owlapi . model . IRI iri = org . semanticweb . owlapi . model . IRI . create ( getResource ( "verification/name_redundancy.obo" ) . getAbsoluteFile ( ) ) ; owltools . graph . OWLGraphWrapper graph = parser . parseToOWLGraph ( iri . toString ( ) ) ; owltools . ontologyverification . impl . NameRedundancyCheck check = new owltools . ontologyverification . impl . NameRedundancyCheck ( ) ; check . setIgnoreObsolete ( false ) ; java . util . Collection < owltools . ontologyverification . CheckWarning > warnings = check . check ( graph , graph . getAllOWLObjects ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . bitSetSize ; }
|
org . junit . Assert . assertEquals ( 3 , warnings . size ( ) )
|
shouldReturnSingleNumber ( ) { org . neo4j . neode . probabilities . ProbabilityDistribution generator = org . neo4j . neode . probabilities . NormalProbabilityDistributionUnique . normalDistribution ( ) ; int result = generator . generateSingle ( org . neo4j . neode . Range . exactly ( 1 ) ) ; "<AssertPlaceHolder>" ; } exactly ( int ) { return new org . neo4j . neode . Range ( count , count ) ; }
|
org . junit . Assert . assertEquals ( 1 , result )
|
testCustomLDPath ( ) { java . util . List < com . github . anno4j . model . Annotation > list = queryService . addCriteria ( "fn:getSelector(.)[is-a<sp>oa:FragmentSelector]" ) . execute ( ) ; "<AssertPlaceHolder>" ; } size ( ) { try { if ( ( _size ) < 0 ) { synchronized ( this ) { if ( ( _size ) < 0 ) { int index = findSize ( ) ; _size = index ; } } } return _size ; } catch ( org . openrdf . repository . RepositoryException e ) { throw new org . openrdf . repository . object . exceptions . ObjectStoreException ( e ) ; } }
|
org . junit . Assert . assertEquals ( 1 , list . size ( ) )
|
testAllWithNewAxis ( ) { org . nd4j . linalg . api . ndarray . INDArray arr = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 24 , 24 ) . reshape ( 4 , 2 , 3 ) ; org . nd4j . linalg . api . ndarray . INDArray get = arr . get ( newAxis ( ) , all ( ) , point ( 1 ) ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] [ ] { new double [ ] { 4 , 5 , 6 } , new double [ ] { 10 , 11 , 12 } , new double [ ] { 16 , 17 , 18 } , new double [ ] { 22 , 23 , 24 } } ) . reshape ( 1 , 4 , 3 ) ; "<AssertPlaceHolder>" ; } reshape ( char , int , int ) { return ( ( org . nd4j . linalg . api . complex . IComplexNDArray ) ( super . reshape ( order , rows , columns ) ) ) ; }
|
org . junit . Assert . assertEquals ( assertion , get )
|
testPreciseConstructRelativePronoun ( ) { java . lang . String text = "The<sp>police<sp>want<sp>to<sp>catch<sp>a<sp>man<sp>who<sp>ran<sp>away." ; jCas . setDocumentText ( text ) ; processJCas ( ) ; processJCasWithSieve ( 4 ) ; java . util . List < uk . gov . dstl . baleen . types . semantic . ReferenceTarget > targets = new java . util . ArrayList ( org . apache . uima . fit . util . JCasUtil . select ( jCas , uk . gov . dstl . baleen . types . semantic . ReferenceTarget . class ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( ( int ) ( flattened ( ) . count ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( 1 , targets . size ( ) )
|
asInteger ( ) { tester . requestScope ( "aaa" , "1" ) ; "<AssertPlaceHolder>" ; } asInteger ( java . lang . CharSequence ) { if ( name == null ) { throw new java . lang . NullPointerException ( "The<sp>name<sp>parameter<sp>must<sp>not<sp>be<sp>null." ) ; } return org . slim3 . util . IntegerUtil . toInteger ( request . getAttribute ( name . toString ( ) ) ) ; }
|
org . junit . Assert . assertThat ( tester . asInteger ( "aaa" ) , org . hamcrest . CoreMatchers . is ( 1 ) )
|
testGetContainerConfiguration ( ) { setUp ( com . google . cloud . tools . jib . image . json . V22ManifestTemplate . class ) ; java . nio . file . Path jsonFile = java . nio . file . Paths . get ( com . google . common . io . Resources . getResource ( "core/json/containerconfig.json" ) . toURI ( ) ) ; java . lang . String expectedJson = new java . lang . String ( java . nio . file . Files . readAllBytes ( jsonFile ) , java . nio . charset . StandardCharsets . UTF_8 ) ; com . google . cloud . tools . jib . blob . Blob containerConfigurationBlob = imageToJsonTranslator . getContainerConfigurationBlob ( ) ; java . io . ByteArrayOutputStream byteArrayOutputStream = new java . io . ByteArrayOutputStream ( ) ; containerConfigurationBlob . writeTo ( byteArrayOutputStream ) ; "<AssertPlaceHolder>" ; } writeTo ( java . io . OutputStream ) { try ( java . io . InputStream fileStream = new java . io . BufferedInputStream ( java . nio . file . Files . newInputStream ( file ) ) ) { return com . google . cloud . tools . jib . blob . BlobDescriptor . fromPipe ( fileStream , outputStream ) ; } }
|
org . junit . Assert . assertEquals ( expectedJson , new java . lang . String ( byteArrayOutputStream . toByteArray ( ) , java . nio . charset . StandardCharsets . UTF_8 ) )
|
testToString ( ) { buffer . clear ( ) ; buffer . writeBytes ( releaseLater ( copiedBuffer ( "Hello,<sp>World!" , CharsetUtil . ISO_8859_1 ) ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( "Hello,<sp>World!" , buffer . toString ( CharsetUtil . ISO_8859_1 ) )
|
testNoCryptoToken ( ) { final java . lang . String joseHeader = "{\"alg\":\"none\"}" ; final byte [ ] message = "HELLO" . getBytes ( "UTF-8" ) ; final byte [ ] jwsPayload = net . trajano . auth . internal . Utils . getJwsPayload ( ( ( ( net . trajano . auth . internal . Base64 . encodeWithoutPadding ( joseHeader . getBytes ( "UTF-8" ) ) ) + "." ) + ( net . trajano . auth . internal . Base64 . encodeWithoutPadding ( message ) ) ) , jwks ) ; "<AssertPlaceHolder>" ; } encodeWithoutPadding ( byte [ ] ) { return net . trajano . auth . internal . Base64 . encode ( bytes , 0 , bytes . length , false ) ; }
|
org . junit . Assert . assertArrayEquals ( message , jwsPayload )
|
zonedTimeFormatIsoOffsetDateTimeMs ( ) { java . time . Instant moment = java . time . Instant . now ( ) ; java . util . Date time = java . util . Date . from ( moment ) ; java . time . format . DateTimeFormatter formatter = java . time . format . DateTimeFormatter . ofPattern ( "yyyy-MM-dd'T'HH:mm:ss.SSSSSSX" ) ; java . lang . String str = java . time . OffsetDateTime . ofInstant ( moment , java . time . ZoneId . systemDefault ( ) ) . format ( formatter ) ; java . util . Date dtParsed = com . cloud . utils . DateUtil . parseTZDateString ( str ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( "ClipboardDataFormat<sp>[id=" + ( id ) ) + ",<sp>name=\"" ) + ( name ) ) + "\"" ) + ( ( id ) == ( rdpclient . clip . ClipboardDataFormat . CB_FORMAT_UNICODETEXT ) ? "<sp>(Unicode<sp>text)" : "" ) ) + ( ( id ) == ( rdpclient . clip . ClipboardDataFormat . CB_FORMAT_TEXT ) ? "<sp>(text)" : "" ) ) + "]" ; }
|
org . junit . Assert . assertEquals ( str , time . toString ( ) , dtParsed . toString ( ) )
|
shouldProperlyCalculateNextPositionAwayFromTargetNearWall ( ) { net . evlikat . siberian . geo . Position next = net . evlikat . siberian . geo . Position . on ( 0 , 3 ) . awayFrom ( net . evlikat . siberian . geo . Position . on ( 2 , 3 ) , java . util . Arrays . asList ( net . evlikat . siberian . geo . Direction . EAST , net . evlikat . siberian . geo . Direction . NORTH , net . evlikat . siberian . geo . Direction . SOUTH ) ) ; "<AssertPlaceHolder>" ; } on ( int , int ) { return new net . evlikat . siberian . geo . Position ( x , y ) ; }
|
org . junit . Assert . assertEquals ( net . evlikat . siberian . geo . Position . on ( 0 , 2 ) , next )
|
testFallbackUnncessaryAlreadyDefault ( ) { java . lang . String defaultFile = GeoLiteCityDatabase . GEO_HDFS_FILE_DEFAULT ; java . util . Map < java . lang . String , java . lang . Object > globalConfig = java . util . Collections . singletonMap ( GeoLiteCityDatabase . GEO_HDFS_FILE , defaultFile ) ; "<AssertPlaceHolder>" ; } determineHdfsDirWithFallback ( java . util . Map , java . lang . String , java . lang . String ) { if ( ! ( globalConfig . containsKey ( org . apache . metron . enrichment . adapters . maxmind . geo . GeoLiteCityDatabase . GEO_HDFS_FILE ) ) ) { org . apache . hadoop . fs . FileSystem fs = org . apache . metron . enrichment . adapters . maxmind . MaxMindDbUtilities . getFileSystem ( ) ; try { if ( hdfsPathsExist ( fs , hdfsFile , hdfsFallbackFile ) ) { hdfsFile = hdfsFallbackFile ; } } catch ( java . io . IOException e ) { org . apache . metron . enrichment . adapters . maxmind . geo . GeoLiteCityDatabase . LOG . warn ( "Issue<sp>validating<sp>database<sp>HDFS<sp>fallback<sp>locations" , e ) ; } } return hdfsFile ; }
|
org . junit . Assert . assertEquals ( GeoLiteCityDatabase . INSTANCE . determineHdfsDirWithFallback ( globalConfig , defaultFile , "" ) , defaultFile )
|
testReloadAsyncNull ( ) { initializeExpectedSink ( 1 ) ; expect ( logging . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( logging . getSinkAsync ( com . google . cloud . logging . SinkTest . NAME ) ) . andReturn ( com . google . api . core . ApiFutures . < com . google . cloud . logging . Sink > immediateFuture ( null ) ) ; replay ( logging ) ; initializeSink ( ) ; "<AssertPlaceHolder>" ; } reloadAsync ( ) { java . util . concurrent . Future < com . google . cloud . logging . Sink > future = sink . reloadAsync ( ) ; com . google . cloud . logging . Sink latestSink = future . get ( ) ; if ( latestSink == null ) { } return latestSink ; }
|
org . junit . Assert . assertNull ( sink . reloadAsync ( ) . get ( ) )
|
verifyEvaluation_Truststore ( ) { addEntry ( "SSO_IDP_TRUSTSTORE" , SSO_IDP_TRUSTSTORE ) ; query . execute ( ) ; "<AssertPlaceHolder>" ; } getIDPTruststore ( ) { return idpTruststore ; }
|
org . junit . Assert . assertEquals ( SSO_IDP_TRUSTSTORE , query . getIDPTruststore ( ) )
|
missingPageType ( ) { try ( org . sejda . sambox . pdmodel . PDDocument doc = org . sejda . sambox . input . PDFParser . parse ( org . sejda . io . SeekableSources . inMemorySeekableSourceFrom ( getClass ( ) . getResourceAsStream ( "/sambox/missing_page_type.pdf" ) ) ) ) { "<AssertPlaceHolder>" ; } } getPage ( int ) { return getDocumentCatalog ( ) . getPages ( ) . get ( pageIndex ) ; }
|
org . junit . Assert . assertNotNull ( doc . getPage ( 0 ) )
|
test ( ) { org . apache . catalina . Server server = mock ( org . apache . catalina . Server . class ) ; org . jboss . modcluster . container . tomcat . ServerProvider provider = new org . jboss . modcluster . container . tomcat . SimpleServerProvider ( server ) ; "<AssertPlaceHolder>" ; } getServer ( ) { return this . server ; }
|
org . junit . Assert . assertSame ( server , provider . getServer ( ) )
|
testCompress ( ) { org . apache . hadoop . mapred . JobConf job = new org . apache . hadoop . mapred . JobConf ( ) ; job . set ( JobContext . TASK_ATTEMPT_ID , org . apache . hadoop . mapred . TestTextOutputFormat . attempt ) ; job . set ( org . apache . hadoop . mapreduce . lib . output . FileOutputFormat . COMPRESS , "true" ) ; org . apache . hadoop . mapred . FileOutputFormat . setOutputPath ( job , org . apache . hadoop . mapred . TestTextOutputFormat . workDir . getParent ( ) . getParent ( ) ) ; org . apache . hadoop . mapred . FileOutputFormat . setWorkOutputPath ( job , org . apache . hadoop . mapred . TestTextOutputFormat . workDir ) ; org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . mapred . TestTextOutputFormat . workDir . getFileSystem ( job ) ; if ( ! ( fs . mkdirs ( org . apache . hadoop . mapred . TestTextOutputFormat . workDir ) ) ) { org . junit . Assert . fail ( "Failed<sp>to<sp>create<sp>output<sp>directory" ) ; } java . lang . String file = "test_compress.txt" ; org . apache . hadoop . mapred . Reporter reporter = Reporter . NULL ; org . apache . hadoop . mapred . TextOutputFormat < java . lang . Object , java . lang . Object > theOutputFormat = new org . apache . hadoop . mapred . TextOutputFormat < java . lang . Object , java . lang . Object > ( ) ; org . apache . hadoop . mapred . RecordWriter < java . lang . Object , java . lang . Object > theRecordWriter = theOutputFormat . getRecordWriter ( org . apache . hadoop . mapred . TestTextOutputFormat . localFs , job , file , reporter ) ; org . apache . hadoop . io . Text key1 = new org . apache . hadoop . io . Text ( "key1" ) ; org . apache . hadoop . io . Text key2 = new org . apache . hadoop . io . Text ( "key2" ) ; org . apache . hadoop . io . Text val1 = new org . apache . hadoop . io . Text ( "val1" ) ; org . apache . hadoop . io . Text val2 = new org . apache . hadoop . io . Text ( "val2" ) ; org . apache . hadoop . io . NullWritable nullWritable = org . apache . hadoop . io . NullWritable . get ( ) ; try { theRecordWriter . write ( key1 , val1 ) ; theRecordWriter . write ( null , nullWritable ) ; theRecordWriter . write ( null , val1 ) ; theRecordWriter . write ( nullWritable , val2 ) ; theRecordWriter . write ( key2 , nullWritable ) ; theRecordWriter . write ( key1 , null ) ; theRecordWriter . write ( null , null ) ; theRecordWriter . write ( key2 , val2 ) ; } finally { theRecordWriter . close ( reporter ) ; } java . lang . StringBuffer expectedOutput = new java . lang . StringBuffer ( ) ; expectedOutput . append ( key1 ) . append ( "\t" ) . append ( val1 ) . append ( "\n" ) ; expectedOutput . append ( val1 ) . append ( "\n" ) ; expectedOutput . append ( val2 ) . append ( "\n" ) ; expectedOutput . append ( key2 ) . append ( "\n" ) ; expectedOutput . append ( key1 ) . append ( "\n" ) ; expectedOutput . append ( key2 ) . append ( "\t" ) . append ( val2 ) . append ( "\n" ) ; org . apache . hadoop . io . compress . DefaultCodec codec = new org . apache . hadoop . io . compress . DefaultCodec ( ) ; codec . setConf ( job ) ; org . apache . hadoop . fs . Path expectedFile = new org . apache . hadoop . fs . Path ( org . apache . hadoop . mapred . TestTextOutputFormat . workDir , ( file + ( codec . getDefaultExtension ( ) ) ) ) ; final java . io . FileInputStream istream = new java . io . FileInputStream ( expectedFile . toString ( ) ) ; org . apache . hadoop . io . compress . CompressionInputStream cistream = codec . createInputStream ( istream ) ; org . apache . hadoop . util . LineReader reader = new org . apache . hadoop . util . LineReader ( cistream ) ; java . lang . String output = "" ; org . apache . hadoop . io . Text out = new org . apache . hadoop . io . Text ( ) ; while ( ( reader . readLine ( out ) ) > 0 ) { output += out ; output += "\n" ; } reader . close ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( ( json ) == null ) { return "Test<sp>codec<sp>" + ( id ) ; } else { return json . toString ( ) ; } }
|
org . junit . Assert . assertEquals ( expectedOutput . toString ( ) , output )
|
testQueryNoAuthenticatedTenants ( ) { identityService . setAuthentication ( "user" , null , null ) ; org . camunda . bpm . engine . history . HistoricExternalTaskLogQuery query = historyService . createHistoricExternalTaskLogQuery ( ) ; "<AssertPlaceHolder>" ; } count ( ) { this . resultType = org . camunda . bpm . engine . impl . AbstractNativeQuery . ResultType . COUNT ; if ( ( commandExecutor ) != null ) { return ( ( java . lang . Long ) ( commandExecutor . execute ( this ) ) ) ; } return executeCount ( org . camunda . bpm . engine . impl . context . Context . getCommandContext ( ) , getParameterMap ( ) ) ; }
|
org . junit . Assert . assertThat ( query . count ( ) , org . hamcrest . CoreMatchers . is ( 0L ) )
|
improperWSDL ( ) { try { org . switchyard . extensions . wsdl . WSDLService . fromWSDL ( "HelloWebService2.wsdl" , "HelloWebService" ) ; } catch ( org . switchyard . extensions . wsdl . WSDLReaderException e ) { boolean exceptionMatches = e . getMessage ( ) . contains ( "SWITCHYARD012801" ) ; "<AssertPlaceHolder>" ; } } getMessage ( ) { return _message ; }
|
org . junit . Assert . assertTrue ( exceptionMatches )
|
testCross ( ) { org . nd4j . linalg . api . ndarray . INDArray a = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 4 , 2 , 1 } , new int [ ] { 1 , 3 } ) ; org . nd4j . linalg . api . ndarray . INDArray b = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 3 , 4 } , new int [ ] { 1 , 3 } ) ; org . nd4j . linalg . api . ndarray . INDArray expOut = org . nd4j . linalg . factory . Nd4j . create ( DataType . DOUBLE , 1 , 3 ) ; lombok . val op = new org . nd4j . linalg . api . ops . impl . shape . Cross ( a , b , expOut ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( op ) ; org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . SDVariable sdA = sd . var ( "a" , expOut . shape ( ) ) ; org . nd4j . autodiff . samediff . SDVariable sdB = sd . var ( "b" , expOut . shape ( ) ) ; sd . associateArrayWithVariable ( a , sdA ) ; sd . associateArrayWithVariable ( b , sdB ) ; org . nd4j . autodiff . samediff . SDVariable t = sd . math ( ) . cross ( "cross" , sdA , sdB ) ; org . nd4j . autodiff . samediff . SDVariable loss = sd . mean ( "loss" , t ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( new org . nd4j . autodiff . validation . TestCase ( sd ) . expectedOutput ( "cross" , expOut ) . gradientCheck ( true ) ) ; "<AssertPlaceHolder>" ; } gradientCheck ( boolean ) { this . setGradientCheck ( isGradientCheck ) ; return this ; }
|
org . junit . Assert . assertNull ( err , err )
|
shouldReturnFalseDupIpInAllowAndDenyListWhenDenyFirst ( ) { org . chimi . ipfilter . Config config = new org . chimi . ipfilter . Config ( ) ; config . setAllowFirst ( false ) ; config . allow ( "1.2.3.4" ) ; config . deny ( "1.2.3.4" ) ; org . chimi . ipfilter . IpFilter ipFilter = new org . chimi . ipfilter . ConfigIpFilter ( config ) ; "<AssertPlaceHolder>" ; } accept ( java . lang . String ) { return remoteAddr . equals ( org . chimi . ipfilter . web . impl . FakeIpBlocker . ALLOW_IP ) ; }
|
org . junit . Assert . assertFalse ( ipFilter . accept ( "1.2.3.4" ) )
|
testAddingDependingJobToRunningJobFails ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; org . apache . hadoop . mapreduce . lib . jobcontrol . ControlledJob job1 = new org . apache . hadoop . mapreduce . lib . jobcontrol . ControlledJob ( conf ) ; job1 . setJobState ( ControlledJob . State . RUNNING ) ; "<AssertPlaceHolder>" ; } addDependingJob ( org . apache . hadoop . mapreduce . lib . jobcontrol . ControlledJob ) { if ( ( this . state ) == ( org . apache . hadoop . mapreduce . lib . jobcontrol . ControlledJob . State . WAITING ) ) { if ( ( this . dependingJobs ) == null ) { this . dependingJobs = new java . util . ArrayList < org . apache . hadoop . mapreduce . lib . jobcontrol . ControlledJob > ( ) ; } return this . dependingJobs . add ( dependingJob ) ; } else { return false ; } }
|
org . junit . Assert . assertFalse ( job1 . addDependingJob ( new org . apache . hadoop . mapreduce . lib . jobcontrol . ControlledJob ( conf ) ) )
|
getQName_default ( ) { javax . xml . namespace . QName expected = new javax . xml . namespace . QName ( ezvcard . VCardVersion . V4_0 . getXmlNamespace ( ) , "test" ) ; javax . xml . namespace . QName actual = scribe . getQName ( ) ; "<AssertPlaceHolder>" ; } getQName ( ) { return qname ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testRemoveSchema4 ( ) { java . lang . String sql = "update<sp>testx.test<sp>set<sp>testx.name='abcd<sp>testx.aa'<sp>and<sp>testx.name2='abcd<sp>testx.aa'<sp>where<sp>testx.id=1" ; java . lang . String sqltrue = "update<sp>test<sp>set<sp>name='abcd<sp>testx.aa'<sp>and<sp>name2='abcd<sp>testx.aa'<sp>where<sp>id=1" ; java . lang . String sqlnew = io . mycat . route . util . RouterUtil . removeSchema ( sql , "testx" ) ; "<AssertPlaceHolder>" ; } removeSchema ( java . lang . String , java . lang . String ) { final java . lang . String upStmt = stmt . toUpperCase ( ) ; final java . lang . String upSchema = ( schema . toUpperCase ( ) ) + "." ; int strtPos = 0 ; int indx = 0 ; boolean flag = false ; indx = upStmt . indexOf ( upSchema , strtPos ) ; if ( indx < 0 ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( "`" ) . append ( schema . toUpperCase ( ) ) . append ( "`." ) ; indx = upStmt . indexOf ( sb . toString ( ) , strtPos ) ; flag = true ; if ( indx < 0 ) { return stmt ; } } int firstE = upStmt . indexOf ( "'" ) ; int endE = upStmt . lastIndexOf ( "'" ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; while ( indx > 0 ) { sb . append ( stmt . substring ( strtPos , indx ) ) ; strtPos = indx + ( upSchema . length ( ) ) ; if ( flag ) { strtPos += 2 ; } if ( ( ( indx > firstE ) && ( indx < endE ) ) && ( ( ( io . mycat . route . util . RouterUtil . countChar ( stmt , indx ) ) % 2 ) == 1 ) ) { sb . append ( stmt . substring ( indx , ( ( indx + ( schema . length ( ) ) ) + 1 ) ) ) ; } indx = upStmt . indexOf ( upSchema , strtPos ) ; } sb . append ( stmt . substring ( strtPos ) ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "" , sqltrue , sqlnew )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.