input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testConstructorInitializerInjection ( ) { org . apache . tuscany . sca . implementation . java . injection . TestObjectFactory < org . apache . tuscany . sca . implementation . java . injection . TestObjectFactoryTestCase . Foo > factory = new org . apache . tuscany . sca . implementation . java . injection . TestObjectFactory < org . apache . tuscany . sca . implementation . java . injection . TestObjectFactoryTestCase . Foo > ( ctor ) ; factory . setInitializerFactory ( 0 , new org . apache . tuscany . sca . implementation . java . injection . SingletonObjectFactory < java . lang . String > ( "foo" ) ) ; org . apache . tuscany . sca . implementation . java . injection . TestObjectFactoryTestCase . Foo foo = factory . getInstance ( ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { return org . apache . tuscany . sca . implementation . spring . webapp . ApplicationContextAccessorBean . INSTANCE ; }
org . junit . Assert . assertEquals ( "foo" , foo . foo )
testGetCustomTransformationNotFound ( ) { final java . lang . String chainrSpec = new java . lang . String ( java . nio . file . Files . readAllBytes ( java . nio . file . Paths . get ( "src/test/resources/TestTransformFactory/chainrSpec.json" ) ) ) ; try { org . apache . nifi . processors . jolt . record . util . TransformFactory . getCustomTransform ( this . getClass ( ) . getClassLoader ( ) , "TestCustomJoltTransform" , chainrSpec ) ; } catch ( java . lang . ClassNotFoundException cnf ) { "<AssertPlaceHolder>" ; } } getLocalizedMessage ( ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( errors . size ( ) ) . append ( "<sp>validation<sp>error" ) ; if ( ( errors . size ( ) ) == 1 ) { sb . append ( ":<sp>" ) . append ( errors . get ( 0 ) ) ; } else { sb . append ( "s" ) ; } return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( "TestCustomJoltTransform" , cnf . getLocalizedMessage ( ) )
testResolveSimpleRepositoryName ( ) { com . github . dockerjava . core . NameParser . HostnameReposName resolved = com . github . dockerjava . core . NameParser . resolveRepositoryName ( "repository" ) ; "<AssertPlaceHolder>" ; } resolveRepositoryName ( java . lang . String ) { if ( reposName . contains ( "://" ) ) { throw new com . github . dockerjava . core . exception . InvalidRepositoryNameException ( ) ; } java . lang . String [ ] nameParts = reposName . split ( "/" , 2 ) ; if ( ( ( nameParts . length ) == 1 ) || ( ( ( ! ( nameParts [ 0 ] . contains ( "." ) ) ) && ( ! ( nameParts [ 0 ] . contains ( ":" ) ) ) ) && ( ! ( nameParts [ 0 ] . equals ( "localhost" ) ) ) ) ) { return new com . github . dockerjava . core . NameParser . HostnameReposName ( com . github . dockerjava . api . model . AuthConfig . DEFAULT_SERVER_ADDRESS , reposName ) ; } java . lang . String hostname = nameParts [ 0 ] ; reposName = nameParts [ 1 ] ; if ( hostname . contains ( "index.docker.io" ) ) { throw new com . github . dockerjava . core . exception . InvalidRepositoryNameException ( java . lang . String . format ( "Invalid<sp>repository<sp>name,<sp>try<sp>\"%s\"<sp>instead" , reposName ) ) ; } if ( org . apache . commons . lang . StringUtils . containsIgnoreCase ( reposName , com . github . dockerjava . core . NameParser . SHA256_SEPARATOR ) ) { reposName = org . apache . commons . lang . StringUtils . substringBeforeLast ( reposName , com . github . dockerjava . core . NameParser . SHA256_SEPARATOR ) ; } com . github . dockerjava . core . NameParser . validateRepoName ( reposName ) ; return new com . github . dockerjava . core . NameParser . HostnameReposName ( hostname , reposName ) ; }
org . junit . Assert . assertEquals ( resolved , new com . github . dockerjava . core . NameParser . HostnameReposName ( com . github . dockerjava . api . model . AuthConfig . DEFAULT_SERVER_ADDRESS , "repository" ) )
validOutputStream ( ) { java . io . OutputStream os = mock ( java . io . OutputStream . class ) ; net . coobird . thumbnailator . tasks . io . OutputStreamImageSink sink = new net . coobird . thumbnailator . tasks . io . OutputStreamImageSink ( os ) ; "<AssertPlaceHolder>" ; } getSink ( ) { if ( ! ( written ) ) { throw new java . lang . IllegalStateException ( "BufferedImageSink<sp>has<sp>not<sp>been<sp>written<sp>to<sp>yet." ) ; } return img ; }
org . junit . Assert . assertEquals ( os , sink . getSink ( ) )
testGetCompletionCount2 ( ) { org . hawkular . apm . api . model . events . CompletionTime ct1 = new org . hawkular . apm . api . model . events . CompletionTime ( ) ; ct1 . setTransaction ( org . hawkular . apm . server . elasticsearch . AnalyticsServiceElasticsearchTest . TXN ) ; ct1 . setTimestamp ( 1000 ) ; org . hawkular . apm . api . model . events . CompletionTime ct2 = new org . hawkular . apm . api . model . events . CompletionTime ( ) ; ct2 . setTransaction ( org . hawkular . apm . server . elasticsearch . AnalyticsServiceElasticsearchTest . TXN ) ; ct2 . setTimestamp ( 2000 ) ; analytics . storeTraceCompletions ( null , java . util . Arrays . asList ( ct1 , ct2 ) ) ; org . hawkular . apm . api . services . Criteria criteria = new org . hawkular . apm . api . services . Criteria ( ) ; criteria . setTransaction ( org . hawkular . apm . server . elasticsearch . AnalyticsServiceElasticsearchTest . TXN ) . setStartTime ( 1 ) . setEndTime ( 1 ) ; org . hawkular . apm . tests . common . Wait . until ( ( ) -> ( analytics . getTraceCompletionCount ( null , criteria ) ) == 1 ) ; "<AssertPlaceHolder>" ; } getTraceCompletionCount ( java . lang . String , org . hawkular . apm . api . services . Criteria ) { if ( org . hawkular . apm . analytics . service . rest . client . AnalyticsServiceRESTClient . log . isLoggable ( Level . FINEST ) ) { org . hawkular . apm . analytics . service . rest . client . AnalyticsServiceRESTClient . log . finest ( ( ( ( "Get<sp>completion<sp>count:<sp>tenantId=[" + tenantId ) + "]<sp>criteria=" ) + criteria ) ) ; } java . lang . String path = "analytics/trace/completion/count?criteria=%s" ; return getResultsForUrl ( tenantId , org . hawkular . apm . analytics . service . rest . client . AnalyticsServiceRESTClient . LONG , path , criteria ) ; }
org . junit . Assert . assertEquals ( 1 , analytics . getTraceCompletionCount ( null , criteria ) )
testGetReloadArgs ( ) { org . netbeans . modules . gradle . actions . DefaultActionMapping instance = new org . netbeans . modules . gradle . actions . DefaultActionMapping ( ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getReloadArgs ( ) ; "<AssertPlaceHolder>" ; } getReloadArgs ( ) { return ( reloadArgs ) != null ? reloadArgs : "" ; }
org . junit . Assert . assertEquals ( expResult , result )
validate_statusIsSet_returnTrue ( ) { confirmation . setStatus ( DataTransferStatus . Accepted ) ; boolean isValid = confirmation . validate ( ) ; "<AssertPlaceHolder>" ; } validate ( ) { return true ; }
org . junit . Assert . assertThat ( isValid , org . hamcrest . CoreMatchers . is ( true ) )
testNullValueProperties ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . setAllowNullValueProperties ( true ) ; out = new java . io . BufferedWriter ( new java . io . FileWriter ( org . apache . hadoop . conf . TestConfiguration . CONFIG ) ) ; startConfig ( ) ; appendProperty ( "attr" , "value" , true ) ; appendProperty ( "attr" , "" , true ) ; endConfig ( ) ; org . apache . hadoop . fs . Path fileResource = new org . apache . hadoop . fs . Path ( org . apache . hadoop . conf . TestConfiguration . CONFIG ) ; conf . addResource ( fileResource ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { java . lang . String [ ] names = handleDeprecation ( org . apache . hadoop . conf . Configuration . deprecationContext . get ( ) , name ) ; java . lang . String result = null ; for ( java . lang . String n : names ) { result = substituteVars ( getProps ( ) . getProperty ( n ) ) ; } return result ; }
org . junit . Assert . assertEquals ( "value" , conf . get ( "attr" ) )
testSize ( ) { org . pb . x12 . Loop loop = new org . pb . x12 . Loop ( new org . pb . x12 . Context ( '~' , '*' , ':' ) , "ST" ) ; loop . addSegment ( "ST*835*000000001" ) ; loop . addSegment ( "BPR*DATA*NOT*VALID*RANDOM*TEXT" ) ; loop . addSegment ( "DTM*111*20090915" ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; size = this . segments . size ( ) ; for ( org . pb . x12 . Loop l : this . childList ( ) ) { size += l . size ( ) ; } return size ; }
org . junit . Assert . assertEquals ( new java . lang . Integer ( 3 ) , new java . lang . Integer ( loop . size ( ) ) )
removeAllFrom ( ) { org . eclipse . collections . api . list . MutableList < java . lang . Integer > sourceFastList = org . eclipse . collections . impl . list . mutable . FastList . newListWith ( 1 , 2 , 3 , 4 , 5 , 6 ) ; org . eclipse . collections . api . list . MutableList < java . lang . Integer > removeFastList = org . eclipse . collections . impl . list . mutable . FastList . newListWith ( 1 , 3 , 5 ) ; org . eclipse . collections . impl . utility . Iterate . removeAllFrom ( removeFastList , sourceFastList ) ; "<AssertPlaceHolder>" ; } with ( T , T , T ) { if ( org . eclipse . collections . impl . block . factory . Comparators . nullSafeEquals ( one , two ) ) { return this . of ( one , three ) ; } if ( org . eclipse . collections . impl . block . factory . Comparators . nullSafeEquals ( one , three ) ) { return this . of ( one , two ) ; } if ( org . eclipse . collections . impl . block . factory . Comparators . nullSafeEquals ( two , three ) ) { return this . of ( one , two ) ; } return new org . eclipse . collections . impl . set . immutable . ImmutableTripletonSet ( one , two , three ) ; }
org . junit . Assert . assertEquals ( Lists . immutable . with ( 2 , 4 , 6 ) , sourceFastList )
testGetParameterMetaData ( ) { stmt . prepare ( "call<sp>testProc0(?,?)" ) ; org . eclipse . datatools . connectivity . oda . IParameterMetaData md = stmt . getParameterMetaData ( ) ; "<AssertPlaceHolder>" ; } getParameterMetaData ( ) { return new org . eclipse . datatools . connectivity . oda . IParameterMetaData ( ) { public int getParameterCount ( ) throws org . eclipse . datatools . connectivity . oda . OdaException { return qps . length ; } public int getParameterMode ( int param ) throws org . eclipse . datatools . connectivity . oda . OdaException { return org . eclipse . datatools . connectivity . oda . IParameterMetaData . parameterModeIn ; } public java . lang . String getParameterName ( int param ) throws org . eclipse . datatools . connectivity . oda . OdaException { return qps [ ( param - 1 ) ] . name ; } public int getParameterType ( int param ) throws org . eclipse . datatools . connectivity . oda . OdaException { return org . eclipse . birt . data . oda . pojo . impl . Driver . getNativeDataTypeCode ( getParameterTypeName ( param ) ) ; } public java . lang . String getParameterTypeName ( int param ) throws org . eclipse . datatools . connectivity . oda . OdaException { return qps [ ( param - 1 ) ] . nativeTypeName ; } public int getPrecision ( int param ) throws org . eclipse . datatools . connectivity . oda . OdaException { return - 1 ; } public int getScale ( int param ) throws org . eclipse . datatools . connectivity . oda . OdaException { return - 1 ; } public int isNullable ( int param ) throws org . eclipse . datatools . connectivity . oda . OdaException { return org . eclipse . datatools . connectivity . oda . IParameterMetaData . parameterNullableUnknown ; } } ; }
org . junit . Assert . assertNotNull ( md )
testOS ( ) { "<AssertPlaceHolder>" ; } utils ( ) { return new com . opera . core . systems . OperaUtils ( ) { public java . lang . String getCoreVersion ( ) { return core . getCoreVersion ( ) ; } public org . openqa . selenium . Platform getPlatform ( ) { return org . openqa . selenium . Platform . extractFromSysProperty ( core . getOperatingSystem ( ) ) ; } public com . opera . core . systems . OperaProduct getProduct ( ) { return com . opera . core . systems . OperaProduct . get ( core . getProduct ( ) ) ; } public java . lang . String getBinaryPath ( ) { return core . getBinaryPath ( ) ; } public java . lang . String getUserAgent ( ) { return core . getUserAgent ( ) ; } public com . opera . core . systems . Integer getPID ( ) { return core . getProcessID ( ) ; } public void clearPrivateData ( com . opera . core . systems . OperaDriver . PrivateData ... flags ) { ( ( com . opera . core . systems . scope . stp . services . ScopeCore ) ( core ) ) . clearPrivateData ( flags ) ; } } ; }
org . junit . Assert . assertNotNull ( driver . utils ( ) . getPlatform ( ) )
testMatchHivePolicy_NoResourceName ( ) { boolean bnlChk = rangerBizUtil . matchHivePolicy ( null , null , null , 0 ) ; "<AssertPlaceHolder>" ; } matchHivePolicy ( java . lang . String , java . util . List , java . lang . Long , int ) { return matchHivePolicy ( resourceName , xResourceList , xUserId , permission , 0 , 0 , true ) ; }
org . junit . Assert . assertFalse ( bnlChk )
bug49751 ( ) { org . apache . poi . hssf . usermodel . HSSFWorkbook wb = org . apache . poi . hssf . usermodel . TestBugs . openSample ( "Linked<sp>Cell" 8 ) ; int numCellStyles = wb . getNumCellStyles ( ) ; java . util . List < java . lang . String > namedStyles = java . util . Arrays . asList ( "Linked<sp>Cell" 3 , "20%<sp>-<sp>Accent2" , "Heading<sp>2" 0 , "20%<sp>-<sp>Accent4" , "20%<sp>-<sp>Accent4" 1 , "20%<sp>-<sp>Accent6" , "Heading<sp>2" 4 , "Accent4" 1 , "Accent4" 6 , "Accent4" 8 , "Linked<sp>Cell" 4 , "Heading<sp>2" 8 , "Accent4" 3 , "Accent4" 4 , "Linked<sp>Cell" 7 , "60%<sp>-<sp>Accent4" , "60%<sp>-<sp>Accent5" , "Heading<sp>2" 3 , "Accent4" 2 , "Accent2" , "Heading<sp>2" 5 , "Accent4" , "Linked<sp>Cell" 0 , "Accent4" 5 , "Accent4" 0 , "Accent4" 7 , "Linked<sp>Cell" 1 , "Explanatory<sp>Text" , "Heading<sp>2" 2 , "Linked<sp>Cell" 6 , "Heading<sp>2" , "Heading<sp>2" 1 , "Linked<sp>Cell" 9 , "Heading<sp>2" 6 , "Linked<sp>Cell" , "Linked<sp>Cell" 5 , "Accent4" 9 , "Heading<sp>2" 7 , "Linked<sp>Cell" 2 , "Heading<sp>2" 9 , "20%<sp>-<sp>Accent4" 0 ) ; java . util . List < java . lang . String > collecteddStyles = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < numCellStyles ; i ++ ) { org . apache . poi . hssf . usermodel . HSSFCellStyle cellStyle = wb . getCellStyleAt ( i ) ; java . lang . String styleName = cellStyle . getUserStyleName ( ) ; if ( styleName != null ) { collecteddStyles . add ( styleName ) ; } } "<AssertPlaceHolder>" ; wb . close ( ) ; } containsAll ( org . apache . poi . util . IntList ) { boolean rval = true ; if ( ( this ) != c ) { for ( int j = 0 ; rval && ( j < ( c . _limit ) ) ; j ++ ) { if ( ! ( contains ( c . _array [ j ] ) ) ) { rval = false ; } } } return rval ; }
org . junit . Assert . assertTrue ( namedStyles . containsAll ( collecteddStyles ) )
shouldChangeSupportedTypesWhenInternalMethodIsOverriden ( ) { final ro . isdc . wro . model . resource . processor . ResourcePreProcessor processor = new ro . isdc . wro . model . resource . processor . decorator . ProcessorDecorator ( new ro . isdc . wro . model . resource . processor . impl . js . JSMinProcessor ( ) ) { @ ro . isdc . wro . model . resource . processor . decorator . Override protected ro . isdc . wro . model . resource . SupportedResourceType getSupportedResourceTypeInternal ( ) { return null ; } } ; "<AssertPlaceHolder>" ; } getSupportedResourceType ( ) { return getProcessorDecorator ( ) . getSupportedResourceType ( ) ; }
org . junit . Assert . assertNull ( null , new ro . isdc . wro . model . resource . processor . decorator . ProcessorDecorator ( processor ) . getSupportedResourceType ( ) )
testKeyBuildingFromRowVisibility ( ) { org . apache . accumulo . core . data . Key keyBuilt = org . apache . accumulo . core . data . Key . builder ( ) . row ( "foo" ) . visibility ( "v" ) . build ( ) ; org . apache . accumulo . core . data . Key keyExpected = new org . apache . accumulo . core . data . Key ( "foo" , "" , "" , "v" ) ; "<AssertPlaceHolder>" ; } build ( ) { return builderFunction . apply ( this ) ; }
org . junit . Assert . assertEquals ( keyExpected , keyBuilt )
canCreateController ( ) { com . berryworks . edireader . tokenizer . Tokenizer tokenizer = new com . berryworks . edireader . tokenizer . EDITokenizer ( new java . io . StringReader ( "" ) , null ) ; com . berryworks . edireader . plugin . PluginControllerImpl controller = plugin . createController ( "SomeStandard" , tokenizer ) ; "<AssertPlaceHolder>" ; } createController ( java . lang . String , com . berryworks . edireader . tokenizer . Tokenizer ) { return new com . berryworks . edireader . plugin . PluginControllerImpl ( standard , tokenizer ) ; }
org . junit . Assert . assertNotNull ( controller )
handleItemRetriesWhenUnknownCompletedTransaction ( ) { doReturn ( mockTx ) . when ( isolationHandler ) . loadTransaction ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . TX_ID ) ; doThrow ( com . amazonaws . services . dynamodbv2 . transactions . exceptions . UnknownCompletedTransactionException . class ) . when ( isolationHandler ) . getOldCommittedItem ( mockTx , com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . TABLE_NAME , com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . KEY ) ; when ( mockTxManager . createKeyMap ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . TABLE_NAME , com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . NON_TRANSIENT_APPLIED_ITEM ) ) . thenReturn ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . KEY ) ; when ( mockClient . getItem ( com . amazonaws . services . dynamodbv2 . transactions . ReadCommittedIsolationHandlerImplUnitTest . GET_ITEM_REQUEST ) ) . thenReturn ( new com . amazonaws . services . dynamodbv2 . model . GetItemResult ( ) . withItem ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . NON_TRANSIENT_APPLIED_ITEM ) ) ; boolean caughtException = false ; try { isolationHandler . handleItem ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . NON_TRANSIENT_APPLIED_ITEM , com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . TABLE_NAME , 1 ) ; } catch ( com . amazonaws . services . dynamodbv2 . transactions . exceptions . TransactionException e ) { caughtException = true ; } "<AssertPlaceHolder>" ; verify ( isolationHandler , times ( 2 ) ) . loadTransaction ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . TX_ID ) ; verify ( isolationHandler ) . createGetItemRequest ( com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . TABLE_NAME , com . amazonaws . services . dynamodbv2 . transactions . ReadUncommittedIsolationHandlerImplUnitTest . NON_TRANSIENT_APPLIED_ITEM ) ; verify ( mockClient ) . getItem ( com . amazonaws . services . dynamodbv2 . transactions . ReadCommittedIsolationHandlerImplUnitTest . GET_ITEM_REQUEST ) ; } handleItem ( java . util . Map , java . util . List , java . lang . String ) { return filterAttributesToGet ( handleItem ( item , tableName , numRetries ) , attributesToGet ) ; }
org . junit . Assert . assertTrue ( caughtException )
testCancelOrderInvoice ( ) { try { java . lang . Boolean result = runFlowAndGetPayload ( "cancel-order-invoice" ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( org . mule . modules . tests . ConnectorTestUtils . getStackTrace ( e ) ) ; } }
org . junit . Assert . assertTrue ( result )
testSerialization ( ) { org . jfree . data . xy . DefaultXYDataset d1 = new org . jfree . data . xy . DefaultXYDataset ( ) ; double [ ] x1 = new double [ ] { 1.0 , 2.0 , 3.0 } ; double [ ] y1 = new double [ ] { 4.0 , 5.0 , 6.0 } ; double [ ] [ ] data1 = new double [ ] [ ] { x1 , y1 } ; d1 . addSeries ( "S1" , data1 ) ; org . jfree . data . xy . XYBarDataset bd1 = new org . jfree . data . xy . XYBarDataset ( d1 , 5.0 ) ; org . jfree . data . xy . XYBarDataset bd2 = ( ( org . jfree . data . xy . XYBarDataset ) ( org . jfree . chart . TestUtils . serialised ( bd1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( bd1 , bd2 )
getValidationWarning ( ) { java . lang . String actual = messages . getValidationWarning ( 0 ) ; java . lang . String expected = messages . getMessage ( "validate.0" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expected , actual )
doWebSocketConnectWithDirectCstr ( ) { org . apache . vysper . xmpp . extension . websockets . TomcatXmppWebSocketServlet servlet = new org . apache . vysper . xmpp . extension . websockets . TomcatXmppWebSocketServlet ( serverRuntimeContext ) ; org . apache . catalina . websocket . StreamInbound webSocket = servlet . createWebSocketInbound ( "xmpp" ) ; "<AssertPlaceHolder>" ; } createWebSocketInbound ( java . lang . String ) { org . apache . vysper . xmpp . extension . websockets . TomcatXmppWebSocket sessionContext = new org . apache . vysper . xmpp . extension . websockets . TomcatXmppWebSocket ( serverRuntimeContext ) ; return sessionContext ; }
org . junit . Assert . assertTrue ( ( webSocket instanceof org . apache . vysper . xmpp . extension . websockets . TomcatXmppWebSocket ) )
testSunAttack ( ) { de . rub . nds . tlsattacker . attacks . ec . oracles . TestECSunOracle oracle = new de . rub . nds . tlsattacker . attacks . ec . oracles . TestECSunOracle ( "secp256r1" ) ; de . rub . nds . tlsattacker . attacks . ec . ICEAttacker attacker = new de . rub . nds . tlsattacker . attacks . ec . ICEAttacker ( oracle , ICEAttacker . ServerType . ORACLE , 4 ) ; attacker . attack ( ) ; java . math . BigInteger result = attacker . getResult ( ) ; de . rub . nds . tlsattacker . attacks . ec . ICEAttackerTest . LOGGER . debug ( result ) ; de . rub . nds . tlsattacker . attacks . ec . ICEAttackerTest . LOGGER . debug ( oracle . getComputer ( ) . getSecret ( ) ) ; "<AssertPlaceHolder>" ; } getComputer ( ) { return computer ; }
org . junit . Assert . assertEquals ( oracle . getComputer ( ) . getSecret ( ) , result )
testAdjustTLSContext ( ) { de . rub . nds . tlsattacker . core . protocol . message . ECDHEServerKeyExchangeMessage message = new de . rub . nds . tlsattacker . core . protocol . message . ECDHEServerKeyExchangeMessage ( ) ; message . setCurveType ( EllipticCurveType . NAMED_CURVE . getValue ( ) ) ; message . setNamedGroup ( NamedGroup . SECP256R1 . getValue ( ) ) ; message . setPublicKey ( de . rub . nds . modifiablevariable . util . ArrayConverter . hexStringToByteArray ( "04f660a88e9dae015684be56c25610f9c62cf120cb075eea60c560e5e6dd5d10ef6e391d7213a298985470dc2268949317ce24940d474a0c8386ab13b312ffc104" ) ) ; message . setPublicKeyLength ( 65 ) ; message . prepareComputations ( ) ; message . getComputations ( ) . setPremasterSecret ( new byte [ ] { 0 , 1 , 2 , 3 } ) ; message . getComputations ( ) . setPrivateKey ( new java . math . BigInteger ( "12345" ) ) ; handler . adjustTLSContext ( message ) ; "<AssertPlaceHolder>" ; } getPreMasterSecret ( ) { if ( ( context . getPreMasterSecret ( ) ) != null ) { return copy ( context . getPreMasterSecret ( ) ) ; } else { return config . getDefaultPreMasterSecret ( ) ; } }
org . junit . Assert . assertNull ( context . getPreMasterSecret ( ) )
testSearchWithIncludesStarNoRecurse ( ) { java . lang . String methodName = "testSearchWithIncludes" ; ca . uhn . fhir . jpa . dao . dstu3 . IIdType parentParentOrgId ; { ca . uhn . fhir . jpa . dao . dstu3 . Organization org = new ca . uhn . fhir . jpa . dao . dstu3 . Organization ( ) ; org . getNameElement ( ) . setValue ( ( methodName + "_O1Parent" ) ) ; parentParentOrgId = myOrganizationDao . create ( org , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } ca . uhn . fhir . jpa . dao . dstu3 . IIdType parentOrgId ; { ca . uhn . fhir . jpa . dao . dstu3 . Organization org = new ca . uhn . fhir . jpa . dao . dstu3 . Organization ( ) ; org . getNameElement ( ) . setValue ( ( methodName + "_O1Parent" ) ) ; org . setPartOf ( new ca . uhn . fhir . jpa . dao . dstu3 . Reference ( parentParentOrgId ) ) ; parentOrgId = myOrganizationDao . create ( org , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } ca . uhn . fhir . jpa . dao . dstu3 . IIdType orgId ; { ca . uhn . fhir . jpa . dao . dstu3 . Organization org = new ca . uhn . fhir . jpa . dao . dstu3 . Organization ( ) ; org . getNameElement ( ) . setValue ( ( methodName + "_O1" ) ) ; org . setPartOf ( new ca . uhn . fhir . jpa . dao . dstu3 . Reference ( parentOrgId ) ) ; orgId = myOrganizationDao . create ( org , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } ca . uhn . fhir . jpa . dao . dstu3 . IIdType patientId ; { ca . uhn . fhir . jpa . dao . dstu3 . Patient patient = new ca . uhn . fhir . jpa . dao . dstu3 . Patient ( ) ; patient . addIdentifier ( ) . setSystem ( "urn:system" ) . setValue ( "001" ) ; patient . addName ( ) . setFamily ( ( ( "Tester_" + methodName ) + "_P1" ) ) . addGiven ( "Joe" ) ; patient . getManagingOrganization ( ) . setReferenceElement ( orgId ) ; patientId = myPatientDao . create ( patient , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } { ca . uhn . fhir . jpa . searchparam . SearchParameterMap params = new ca . uhn . fhir . jpa . searchparam . SearchParameterMap ( ) ; params . add ( Patient . SP_FAMILY , new ca . uhn . fhir . jpa . dao . dstu3 . StringParam ( ( ( "Tester_" + methodName ) + "_P1" ) ) ) ; params . addInclude ( new ca . uhn . fhir . model . api . Include ( "*" ) . asNonRecursive ( ) ) ; ca . uhn . fhir . jpa . dao . dstu3 . List < ca . uhn . fhir . jpa . dao . dstu3 . IIdType > resources = toUnqualifiedVersionlessIds ( myPatientDao . search ( params ) ) ; "<AssertPlaceHolder>" ; } } search ( ca . uhn . fhir . rest . param . StringParam ) { final ca . uhn . fhir . jaxrs . server . example . List < ca . uhn . fhir . jaxrs . server . example . Patient > result = new ca . uhn . fhir . jaxrs . server . example . LinkedList < ca . uhn . fhir . jaxrs . server . example . Patient > ( ) ; for ( final ca . uhn . fhir . jaxrs . server . example . List < ca . uhn . fhir . jaxrs . server . example . Patient > patientIterator : ca . uhn . fhir . jaxrs . server . example . JaxRsPatientRestProviderDstu3 . patients . values ( ) ) { ca . uhn . fhir . jaxrs . server . example . Patient single = null ; for ( ca . uhn . fhir . jaxrs . server . example . Patient patient : patientIterator ) { if ( ( name == null ) || ( patient . getName ( ) . get ( 0 ) . getFamilyElement ( ) . getValueNotNull ( ) . equals ( name . getValueNotNull ( ) ) ) ) { single = patient ; } } if ( single != null ) { result . add ( single ) ; } } return result ; }
org . junit . Assert . assertThat ( resources , contains ( patientId , orgId ) )
should_return_this ( ) { org . fest . assertions . api . StringAssert returned = assertions . hasSize ( 0 ) ; "<AssertPlaceHolder>" ; } hasSize ( int ) { arrays . assertHasSize ( description , actual , expected ) ; return this ; }
org . junit . Assert . assertSame ( assertions , returned )
testRevert ( ) { double tolerancePerc = 0.01 ; int nSamples = 500 ; int nFeatures = 3 ; org . nd4j . linalg . api . ndarray . INDArray featureSet = org . nd4j . linalg . factory . Nd4j . randn ( nSamples , nFeatures ) ; org . nd4j . linalg . api . ndarray . INDArray labelSet = org . nd4j . linalg . factory . Nd4j . zeros ( nSamples , 1 ) ; org . nd4j . linalg . dataset . DataSet sampleDataSet = new org . nd4j . linalg . dataset . DataSet ( featureSet , labelSet ) ; org . nd4j . linalg . dataset . api . preprocessor . NormalizerStandardize myNormalizer = new org . nd4j . linalg . dataset . api . preprocessor . NormalizerStandardize ( ) ; myNormalizer . fit ( sampleDataSet ) ; org . nd4j . linalg . dataset . DataSet transformed = sampleDataSet . copy ( ) ; myNormalizer . transform ( transformed ) ; myNormalizer . revert ( transformed ) ; org . nd4j . linalg . api . ndarray . INDArray delta = org . nd4j . linalg . ops . transforms . Transforms . abs ( transformed . getFeatures ( ) . sub ( sampleDataSet . getFeatures ( ) ) ) . div ( sampleDataSet . getFeatures ( ) ) ; double maxdeltaPerc = delta . max ( 0 , 1 ) . mul ( 100 ) . getDouble ( 0 , 0 ) ; "<AssertPlaceHolder>" ; } getDouble ( org . nd4j . linalg . api . ndarray . INDArray , int [ ] ) { long offset = org . nd4j . linalg . api . shape . Shape . getOffset ( arr . shapeInfo ( ) , org . nd4j . linalg . util . ArrayUtil . toLongArray ( indices ) ) ; return arr . data ( ) . getDouble ( offset ) ; }
org . junit . Assert . assertTrue ( ( maxdeltaPerc < tolerancePerc ) )
readNegativeHalf ( ) { final byte [ ] data = new byte [ ] { 0 , ( ( byte ) ( 192 ) ) } ; final java . io . ByteArrayInputStream stream = new java . io . ByteArrayInputStream ( data ) ; final com . flagstone . transform . coder . SWFDecoder fixture = new com . flagstone . transform . coder . SWFDecoder ( stream ) ; "<AssertPlaceHolder>" ; } readHalf ( ) { final int bits = readUnsignedShort ( ) ; final int sign = ( bits > > ( com . flagstone . transform . coder . SWFDecoder . HALF_SIGN_SHIFT ) ) & ( Coder . BIT0 ) ; int exp = ( bits > > ( com . flagstone . transform . coder . SWFDecoder . HALF_EXP_SHIFT ) ) & ( Coder . LOWEST5 ) ; int mantissa = bits & ( Coder . LOWEST10 ) ; float value ; if ( exp == 0 ) { if ( mantissa == 0 ) { value = java . lang . Float . intBitsToFloat ( ( sign << ( com . flagstone . transform . coder . SWFDecoder . SIGN_SHIFT ) ) ) ; } else { while ( ( mantissa & ( Coder . BIT10 ) ) == 0 ) { mantissa <<= 1 ; exp -= 1 ; } exp += 1 ; exp = exp + ( ( com . flagstone . transform . coder . SWFDecoder . EXP_MAX ) - ( com . flagstone . transform . coder . SWFDecoder . HALF_EXP_OFFSET ) ) ; mantissa &= ~ ( Coder . BIT10 ) ; mantissa = mantissa << ( com . flagstone . transform . coder . SWFDecoder . MANT_SHIFT ) ; value = java . lang . Float . intBitsToFloat ( ( ( ( sign << ( com . flagstone . transform . coder . SWFDecoder . SIGN_SHIFT ) ) | ( exp << ( com . flagstone . transform . coder . SWFDecoder . EXP_SHIFT ) ) ) | mantissa ) ) ; } } else if ( exp == ( com . flagstone . transform . coder . SWFDecoder . HALF_EXP_MAX ) ) { if ( mantissa == 0 ) { value = java . lang . Float . intBitsToFloat ( ( ( sign << ( com . flagstone . transform . coder . SWFDecoder . SIGN_SHIFT ) ) | ( com . flagstone . transform . coder . SWFDecoder . INFINITY ) ) ) ; } else { value = java . lang . Float . intBitsToFloat ( ( ( ( sign << ( com . flagstone . transform . coder . SWFDecoder . SIGN_SHIFT ) ) | ( com . flagstone . transform . coder . SWFDecoder . INFINITY ) ) | ( mantissa << ( com . flagstone . transform . coder . SWFDecoder . MANT_SHIFT ) ) ) ) ; } } else { exp = exp + ( ( com . flagstone . transform . coder . SWFDecoder . EXP_MAX ) - ( com . flagstone . transform . coder . SWFDecoder . HALF_EXP_OFFSET ) ) ; mantissa = mantissa << ( com . flagstone . transform . coder . SWFDecoder . MANT_SHIFT ) ; value = java . lang . Float . intBitsToFloat ( ( ( ( sign << ( com . flagstone . transform . coder . SWFDecoder . SIGN_SHIFT ) ) | ( exp << ( com . flagstone . transform . coder . SWFDecoder . EXP_SHIFT ) ) ) | mantissa ) ) ; } return value ; }
org . junit . Assert . assertEquals ( ( - 2.0 ) , fixture . readHalf ( ) , 0.0 )
security ( ) { ser . FSTConfiguration conf = ser . FSTConfiguration . createDefaultConfiguration ( ) . setVerifier ( new ser . FSTConfiguration . ClassSecurityVerifier ( ) { @ ser . Override public boolean allowClassDeserialization ( java . lang . Class cl ) { if ( cl . getPackage ( ) . getName ( ) . startsWith ( "java.awt" ) ) return false ; return true ; } } ) ; try { byte [ ] hallos = conf . asByteArray ( new ser . Dimension ( 13 , 13 ) ) ; conf . asObject ( hallos ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception ex ) { System . out . println ( ex . getMessage ( ) ) ; } } getName ( ) { return name ; }
org . junit . Assert . assertTrue ( false )
test ( ) { org . febit . wit_shaded . asm . ClassWriter classWriter = new org . febit . wit_shaded . asm . ClassWriter ( org . febit . wit_shaded . asm . Constants . V1_5 , org . febit . wit_shaded . asm . Constants . ACC_PUBLIC , "x/Example" , "java/lang/Object" , null ) ; org . febit . wit . asm . ASMUtil . visitConstructor ( classWriter ) ; org . febit . wit_shaded . asm . MethodWriter m = classWriter . visitMethod ( org . febit . wit . asm . ACC_PUBLIC , "test" , "([Ljava/lang/Object;)Ljava/lang/Object;" , null ) ; org . febit . wit_shaded . asm . Label toException = new org . febit . wit_shaded . asm . Label ( ) ; m . visitVarInsn ( Constants . ALOAD , 1 ) ; m . visitJumpInsn ( Constants . IFNULL , toException ) ; m . visitVarInsn ( Constants . ALOAD , 1 ) ; m . visitInsn ( Constants . ARRAYLENGTH ) ; m . visitJumpInsn ( Constants . IFEQ , toException ) ; m . visitVarInsn ( Constants . ALOAD , 1 ) ; m . visitInsn ( Constants . ICONST_0 ) ; m . visitInsn ( Constants . AALOAD ) ; m . visitJumpInsn ( Constants . IFNULL , toException ) ; m . visitVarInsn ( Constants . ALOAD , 1 ) ; m . visitInsn ( Constants . ICONST_0 ) ; m . visitInsn ( Constants . AALOAD ) ; m . visitTypeInsn ( Constants . CHECKCAST , "java/lang/String" ) ; m . visitMethodInsn ( Constants . INVOKEVIRTUAL , "java/lang/String" , "length" , "()I" ) ; org . febit . wit . asm . ASMUtil . visitBoxIfNeed ( m , int . class ) ; m . visitInsn ( Constants . ARETURN ) ; m . visitLabel ( toException ) ; org . febit . wit . asm . ASMUtil . visitScriptRuntimeException ( m , "First<sp>argument<sp>can't<sp>be<sp>null." ) ; m . visitMaxs ( ) ; java . lang . Class < ? > exampleClass = org . febit . wit . asm . ASMUtil . loadClass ( "x.Example" , classWriter ) ; try { java . lang . Object obj = exampleClass . newInstance ( ) ; java . lang . Object result = exampleClass . getMethods ( ) [ 0 ] . invoke ( obj , new java . lang . Object [ ] { new java . lang . Object [ ] { "" } } ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . reflect . InvocationTargetException exception ) { exception . getCause ( ) . printStackTrace ( ) ; throw exception ; } } loadClass ( java . lang . String , org . febit . wit_shaded . asm . ClassWriter ) { return org . febit . wit . asm . ASMUtil . CLASS_LOADER . loadClass ( name , classWriter . toByteArray ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result )
shouldParseCrlWithVersion0 ( ) { boolean hasFailure = parseCrl ( "root/CRLVersion0/badCRLVersion0.crl" ) ; "<AssertPlaceHolder>" ; } parseCrl ( java . lang . String ) { java . io . File file = new java . io . File ( net . ripe . rpki . commons . interop . BBNCrlConformanceTest . PATH_TO_BBN_OBJECTS , crl ) ; byte [ ] encoded = com . google . common . io . Files . toByteArray ( file ) ; net . ripe . rpki . commons . validation . ValidationResult result = net . ripe . rpki . commons . validation . ValidationResult . withLocation ( file . getName ( ) ) ; net . ripe . rpki . commons . crypto . crl . X509Crl . parseDerEncoded ( encoded , result ) ; return result . hasFailures ( ) ; }
org . junit . Assert . assertTrue ( hasFailure )
jettyComponentIsDeployed ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( server )
testSerialization ( ) { org . jfree . data . gantt . Task t1 = new org . jfree . data . gantt . Task ( "T" , new java . util . Date ( 1 ) , new java . util . Date ( 2 ) ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( t1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . data . gantt . Task t2 = ( ( org . jfree . data . gantt . Task ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } }
org . junit . Assert . assertEquals ( t1 , t2 )
testSystemPolicyPath ( ) { System . out . println ( ( "path=<sp>" + ( GlobalPolicyUtil . domainCfgFolder ) ) ) ; "<AssertPlaceHolder>" ; } println ( java . lang . String ) { l . log ( logLevel , ( ( org . glassfish . flashlight . impl . client . FlashLightBTracePrintWriter . BTRACE_PREFIX ) + s ) ) ; }
org . junit . Assert . assertNotNull ( GlobalPolicyUtil . domainCfgFolder )
testGetAllMessages ( ) { com . skype . TestUtils . showMessageDialog ( ( ( "Please,<sp>send<sp>a<sp>chat<sp>message<sp>'Hello,<sp>World!'<sp>to<sp>" + ( com . skype . TestData . getFriendId ( ) ) ) + "." ) ) ; com . skype . Friend friend = com . skype . TestData . getFriend ( ) ; com . skype . ChatMessage [ ] messages = friend . getAllChatMessages ( ) ; "<AssertPlaceHolder>" ; } getAllChatMessages ( ) { try { java . lang . String command = ( "GET<sp>CHAT<sp>" + ( getId ( ) ) ) + "<sp>CHATMESSAGES" ; java . lang . String responseHeader = ( "CHAT<sp>" + ( getId ( ) ) ) + "<sp>CHATMESSAGES<sp>" ; java . lang . String response = com . skype . connector . Connector . getInstance ( ) . execute ( command , responseHeader ) ; if ( response . contains ( "ERROR" ) ) { throw new com . skype . SkypeException ( ( ( ( "Error<sp>when<sp>issuing<sp>command:<sp>" + command ) + "<sp>-<sp>" ) + response ) ) ; } java . lang . String data = response . substring ( responseHeader . length ( ) ) ; java . lang . String [ ] ids = com . skype . Utils . convertToArray ( data ) ; com . skype . ChatMessage [ ] chatMessages = new com . skype . ChatMessage [ ids . length ] ; for ( int i = 0 ; i < ( ids . length ) ; ++ i ) { chatMessages [ i ] = com . skype . ChatMessage . getInstance ( ids [ i ] ) ; } return chatMessages ; } catch ( com . skype . connector . ConnectorException ex ) { com . skype . Utils . convertToSkypeException ( ex ) ; return null ; } }
org . junit . Assert . assertTrue ( ( 0 < ( messages . length ) ) )
testGet ( ) { java . io . InputStream inputStream = null ; try { inputStream = client . get ( "resource" ) ; "<AssertPlaceHolder>" ; } finally { try { inputStream . close ( ) ; } catch ( java . lang . Exception e ) { } } } get ( java . lang . String ) { checkNotNull ( name ) ; com . illumina . basespace . response . GetFileResponse getFileResponse = client . getFile ( name ) ; if ( getFileResponse == null ) { return null ; } com . illumina . basespace . entity . File file = getFileResponse . get ( ) ; return client . getFileInputStream ( file ) ; }
org . junit . Assert . assertNotNull ( inputStream )
testMsgNotifHeartbeat_invalidInstance ( ) { this . app . getMySqlVm ( ) . setStatus ( InstanceStatus . PROBLEM ) ; net . roboconf . messaging . api . messages . from_agent_to_dm . MsgNotifHeartbeat msg = new net . roboconf . messaging . api . messages . from_agent_to_dm . MsgNotifHeartbeat ( this . app . getName ( ) , new net . roboconf . core . model . beans . Instance ( "unknown" ) , "192.168.1.45" ) ; this . processor . processMessage ( msg ) ; "<AssertPlaceHolder>" ; } getMySqlVm ( ) { return this . mySqlVm ; }
org . junit . Assert . assertEquals ( InstanceStatus . PROBLEM , this . app . getMySqlVm ( ) . getStatus ( ) )
NoShardAvailableActionException_1_ ( ) { com . fujitsu . dc . common . es . impl . AbstractRetryableEsRequestTest . TestRequest requestMock = org . mockito . Mockito . spy ( new com . fujitsu . dc . common . es . impl . AbstractRetryableEsRequestTest . TestRequest ( ) ) ; org . elasticsearch . action . NoShardAvailableActionException toBeThrown = org . mockito . Mockito . mock ( org . elasticsearch . action . NoShardAvailableActionException . class ) ; org . mockito . Mockito . doThrow ( toBeThrown ) . doReturn ( com . fujitsu . dc . common . es . impl . AbstractRetryableEsRequestTest . SUCCESS_RESPONSE ) . when ( requestMock ) . doProcess ( ) ; java . lang . String result = requestMock . doRequest ( ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( requestMock , org . mockito . Mockito . times ( 2 ) ) . doProcess ( ) ; org . mockito . Mockito . verify ( requestMock , org . mockito . Mockito . times ( 0 ) ) . onParticularError ( org . mockito . Mockito . any ( org . elasticsearch . ElasticsearchException . class ) ) ; }
org . junit . Assert . assertEquals ( com . fujitsu . dc . common . es . impl . AbstractRetryableEsRequestTest . SUCCESS_RESPONSE , result )
testFactoryMakesJSR330ConstructorInjector ( ) { com . picocontainer . ComponentFactory cf = createComponentFactory ( ) ; com . picocontainer . monitors . ConsoleComponentMonitor cm = new com . picocontainer . monitors . ConsoleComponentMonitor ( ) ; com . picocontainer . ComponentAdapter < java . util . HashMap > ca = cf . createComponentAdapter ( cm , new com . picocontainer . lifecycle . NullLifecycleStrategy ( ) , new java . util . Properties ( ) , java . util . Map . class , java . util . HashMap . class , null , null , null ) ; "<AssertPlaceHolder>" ; java . lang . String foo = xs . toXML ( ca ) . replace ( "\"" , "" ) ; org . junit . Assert . assertTrue ( ( "Got<sp>" + foo ) , foo . contains ( "<Constructor-Injection>" ) ) ; } createComponentAdapter ( com . picocontainer . ComponentMonitor , com . picocontainer . LifecycleStrategy , java . util . Properties , java . lang . Object , java . lang . Class , com . picocontainer . parameters . ConstructorParameters , com . picocontainer . parameters . FieldParameters [ ] , com . picocontainer . parameters . MethodParameters [ ] ) { com . picocontainer . ComponentAdapter < T > adapter = constructorInjection . createComponentAdapter ( monitor , lifecycle , props , key , impl , constructorParams , fieldParams , methodParams ) ; java . lang . String otherKey = props . getProperty ( "ForCAF" ) ; if ( ( otherKey != null ) && ( ! ( otherKey . equals ( "" ) ) ) ) { props . remove ( "ForCAF" ) ; return new com . picocontainer . script . xml . XMLContainerBuilder . MySingleMemberInjector ( key , impl , monitor , false , true , otherKey , ( ( com . picocontainer . Injector ) ( adapter ) ) ) ; } return adapter ; }
org . junit . Assert . assertNotNull ( ca )
testMultipleAutoAttachedEventsAreReturnedWithProcedure ( ) { long t = dateToMillis ( 2016 , 1 , 1 , 1 ) ; for ( int i = 0 ; i < 10 ; ++ i ) { createEvent ( ( t + i ) ) ; } int i = 0 ; try ( com . graphaware . module . timetree . proc . Transaction tx = getDatabase ( ) . beginTx ( ) ) { com . graphaware . module . timetree . proc . Result rs = getDatabase ( ) . execute ( ( "CALL<sp>ga.timetree.events.single(" + ( "{time:<sp>{params}.time,<sp>resolution:<sp>{params}.resolution,<sp>timezone:<sp>{params}.timezone,<sp>relationshipTypes:<sp>[{params}.relationshipType],<sp>direction:<sp>{params}.direction})<sp>" + "YIELD<sp>node,<sp>relationshipType,<sp>direction<sp>RETURN<sp>*" ) ) , getParamsMapForTime ( t ) ) ; while ( rs . hasNext ( ) ) { java . util . Map < java . lang . String , java . lang . Object > record = rs . next ( ) ; ++ i ; } tx . success ( ) ; } "<AssertPlaceHolder>" ; } next ( ) { org . joda . time . MutableDateTime time = new org . joda . time . MutableDateTime ( getTime ( ) ) ; time . add ( getResolution ( ) . getDateTimeFieldType ( ) . getDurationType ( ) , 1 ) ; return new com . graphaware . module . timetree . domain . TimeInstant ( time . getMillis ( ) , getTimezone ( ) , getResolution ( ) ) ; }
org . junit . Assert . assertEquals ( 10 , i )
test2 ( ) { java . lang . String baseName = cn . xiaowenjie . myrestutil . StackTraceHelper . getBasePackage ( "cn.xiaowenjie.myrestutil" , 5 ) ; "<AssertPlaceHolder>" ; } getBasePackage ( java . lang . String , int ) { java . lang . StringBuilder stringBuilder = new java . lang . StringBuilder ( ) ; java . util . regex . Matcher matcher = cn . xiaowenjie . myrestutil . StackTraceHelper . PATTERN . matcher ( pack ) ; int degree = 0 ; while ( matcher . find ( ) ) { degree ++ ; if ( ( deep <= 0 ) || ( degree <= deep ) ) { java . lang . String group = matcher . group ( 2 ) ; System . out . println ( group ) ; stringBuilder . append ( group ) . append ( "." ) ; } else { break ; } } java . lang . String basePackage = stringBuilder . substring ( 0 , ( ( stringBuilder . length ( ) ) - 1 ) ) ; log . debug ( "basePackage<sp>is<sp>{}" , basePackage ) ; return basePackage ; }
org . junit . Assert . assertEquals ( "cn.xiaowenjie.myrestutil" , baseName )
getUsers ( ) { java . util . List < org . oscm . internal . usermanagement . POUser > result = usb . getUsers ( ) ; verify ( usb . isl , times ( 1 ) ) . getOrganizationUsers ( ) ; verify ( usb . dc , times ( 1 ) ) . toPOUser ( eq ( pu ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , result . size ( ) )
testWithEmptyGraphWithVertices ( ) { org . apache . flink . graph . library . clustering . undirected . TriadicCensus . Result expectedResult = new org . apache . flink . graph . library . clustering . undirected . TriadicCensus . Result ( 0 , 0 , 0 , 0 ) ; org . apache . flink . graph . library . clustering . undirected . TriadicCensus . Result triadCensus = new org . apache . flink . graph . library . clustering . undirected . TriadicCensus < org . apache . flink . types . LongValue , org . apache . flink . types . NullValue , org . apache . flink . types . NullValue > ( ) . run ( emptyGraphWithVertices ) . execute ( ) ; "<AssertPlaceHolder>" ; } execute ( ) { return execute ( org . apache . flink . streaming . api . environment . StreamExecutionEnvironment . DEFAULT_JOB_NAME ) ; }
org . junit . Assert . assertEquals ( expectedResult , triadCensus )
testReleaseCallbackInvokedEvenIfRenderingFails ( ) { final java . util . concurrent . atomic . AtomicBoolean callbackInvoked = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; org . trimou . engine . MustacheEngine engine = org . trimou . engine . MustacheEngineBuilder . newBuilder ( ) . setMissingValueHandler ( new org . trimou . engine . interpolation . ThrowingExceptionMissingValueHandler ( ) ) . addResolver ( new org . trimou . engine . resolver . AbstractResolver ( ( ( org . trimou . engine . resolver . Resolver . DEFAULT_PRIORITY ) + 100 ) ) { @ org . trimou . engine . context . Override public java . lang . Object resolve ( java . lang . Object contextObject , java . lang . String name , org . trimou . engine . resolver . ResolutionContext context ) { context . registerReleaseCallback ( ( ) -> callbackInvoked . set ( true ) ) ; return null ; } } ) . build ( ) ; try { engine . compileMustache ( "release_callback_invoked_rendering_fails" , "{{cannotmatch}}" ) . render ( null ) ; org . junit . Assert . fail ( "Rendering<sp>should<sp>fail" ) ; } catch ( org . trimou . exception . MustacheException e ) { if ( ! ( MustacheProblem . RENDER_NO_VALUE . equals ( e . getCode ( ) ) ) ) { org . junit . Assert . fail ( "Unexpected<sp>problem" ) ; } } "<AssertPlaceHolder>" ; } get ( ) { return instance ; }
org . junit . Assert . assertTrue ( callbackInvoked . get ( ) )
should_get_last_build_number ( ) { when ( hudsonFinder . getLastBuildNumber ( "projectName" ) ) . thenReturn ( 42 ) ; int lastBuildNumber = hudson . getLastBuildNumber ( "projectName" ) ; "<AssertPlaceHolder>" ; } getLastBuildNumber ( java . lang . String ) { checkJobName ( projectName ) ; return hudsonFinder . getLastBuildNumber ( projectName ) ; }
org . junit . Assert . assertEquals ( 42 , lastBuildNumber )
switchIndexesTest ( ) { when ( fr . gouv . vitam . logbook . operations . client . LogbookOperationsClientRestTest . mock . post ( ) ) . thenReturn ( javax . ws . rs . core . Response . status ( Status . OK ) . entity ( fr . gouv . vitam . common . json . JsonHandler . createObjectNode ( ) ) . build ( ) ) ; com . fasterxml . jackson . databind . JsonNode resp = fr . gouv . vitam . logbook . operations . client . LogbookOperationsClientRestTest . client . switchIndexes ( new fr . gouv . vitam . common . database . parameter . SwitchIndexParameters ( ) ) ; "<AssertPlaceHolder>" ; } switchIndexes ( fr . gouv . vitam . common . database . parameter . SwitchIndexParameters ) { fr . gouv . vitam . common . ParametersChecker . checkParameter ( "The<sp>options<sp>are<sp>mandatory" , switchIndexParam ) ; javax . ws . rs . core . Response response = null ; try { response = performRequest ( HttpMethod . POST , fr . gouv . vitam . logbook . operations . client . LogbookOperationsClientRest . ALIASES_URI , null , switchIndexParam , MediaType . APPLICATION_JSON_TYPE , MediaType . APPLICATION_JSON_TYPE ) ; return response . readEntity ( com . fasterxml . jackson . databind . JsonNode . class ) ; } catch ( fr . gouv . vitam . common . exception . VitamClientInternalException e ) { fr . gouv . vitam . logbook . operations . client . LogbookOperationsClientRest . LOGGER . debug ( "Internal<sp>Server<sp>Error" , e ) ; throw new fr . gouv . vitam . logbook . common . exception . LogbookClientServerException ( "Internal<sp>Server<sp>Error" , e ) ; } finally { consumeAnyEntityAndClose ( response ) ; } }
org . junit . Assert . assertNotNull ( resp )
testAddIntReplaceValue ( ) { v8 . add ( "foo" , 42 ) ; v8 . add ( "foo" , 43 ) ; int result = v8 . executeIntegerScript ( "foo" ) ; "<AssertPlaceHolder>" ; } executeIntegerScript ( java . lang . String ) { return executeIntegerScript ( script , null , 0 ) ; }
org . junit . Assert . assertEquals ( 43 , result )
testGetFileNames ( ) { upload = new org . eclipse . rap . rwt . widgets . FileUpload ( shell , org . eclipse . swt . SWT . MULTI ) ; org . eclipse . rap . rwt . internal . widgets . IFileUploadAdapter adapter = org . eclipse . rap . rwt . widgets . FileUpload_Test . getFileUploadAdapter ( upload ) ; adapter . setFileNames ( new java . lang . String [ ] { "foo.txt" , "bar.txt" } ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "foo.txt" , "bar.txt" } ; "<AssertPlaceHolder>" ; } getFileNames ( ) { if ( ( returnCode ) == ( org . eclipse . swt . SWT . OK ) ) { java . lang . String [ ] completedFileNames = getCompletedFileNames ( ) ; if ( ( isMulti ( ) ) || ( ( completedFileNames . length ) == 0 ) ) { return completedFileNames ; } return new java . lang . String [ ] { completedFileNames [ ( ( completedFileNames . length ) - 1 ) ] } ; } return org . eclipse . swt . widgets . FileDialog . EMPTY_ARRAY ; }
org . junit . Assert . assertArrayEquals ( expected , upload . getFileNames ( ) )
testTest ( ) { logger . info ( "test" ) ; com . datumbox . framework . common . dataobjects . TransposeDataList transposeDataList = new com . datumbox . framework . common . dataobjects . TransposeDataList ( ) ; transposeDataList . put ( 0 , new com . datumbox . framework . common . dataobjects . FlatDataList ( java . util . Arrays . asList ( new java . lang . Object [ ] { 136 , 115 , 142 , 140 , 123 , 147 , 133 , 150 , 138 , 147 , 151 , 145 , 147.0 } ) ) ) ; transposeDataList . put ( 1 , new com . datumbox . framework . common . dataobjects . FlatDataList ( java . util . Arrays . asList ( new java . lang . Object [ ] { 141.0 , 117 , 141 , 145 , 127 , 146 , 135 , 152 , 135 , 152 , 149 , 148 , 147 } ) ) ) ; boolean is_twoTailed = true ; double aLevel = 0.05 ; boolean expResult = false ; boolean result = com . datumbox . framework . core . statistics . nonparametrics . relatedsamples . SignRelatedSamples . test ( transposeDataList , is_twoTailed , aLevel ) ; "<AssertPlaceHolder>" ; } test ( com . datumbox . framework . common . dataobjects . TransposeDataList , boolean , double ) { if ( ( transposeDataList . size ( ) ) != 2 ) { throw new java . lang . IllegalArgumentException ( "The<sp>collection<sp>must<sp>contain<sp>observations<sp>from<sp>2<sp>groups." ) ; } double pvalue = com . datumbox . framework . core . statistics . nonparametrics . relatedsamples . SignRelatedSamples . getPvalue ( transposeDataList ) ; boolean rejectH0 = false ; double a = aLevel ; if ( is_twoTailed ) { a = aLevel / 2 ; } if ( ( pvalue <= a ) || ( pvalue >= ( 1 - a ) ) ) { rejectH0 = true ; } return rejectH0 ; }
org . junit . Assert . assertEquals ( expResult , result )
testFromJsonObjectNoData ( ) { javax . json . JsonObject jsonObject = javax . json . Json . createObjectBuilder ( ) . build ( ) ; edu . wpi . rail . jrosbridge . messages . std . UInt64 data = edu . wpi . rail . jrosbridge . messages . std . UInt64 . fromJsonObject ( jsonObject ) ; "<AssertPlaceHolder>" ; } getData ( ) { return this . data ; }
org . junit . Assert . assertEquals ( 0L , data . getData ( ) )
checkingWithExpectShouldThrowAssertionErrorIfExceptionIsDifferent ( ) { expectedException . expect ( net . usikkert . kouchat . junit . UnsupportedOperationException . class ) ; expectedException . expectMessage ( "the<sp>error<sp>message" ) ; final java . lang . AssertionError error = runTestAndThrow ( "the<sp>error<sp>message" ) ; "<AssertPlaceHolder>" ; } runTestAndThrow ( java . lang . String ) { final org . junit . runners . model . Statement statement = expectedException . apply ( new org . junit . runners . model . Statement ( ) { @ net . usikkert . kouchat . junit . Override public void evaluate ( ) throws java . lang . Throwable { throw new java . lang . IllegalArgumentException ( messageToThrow ) ; } } , null ) ; try { statement . evaluate ( ) ; } catch ( final java . lang . Throwable throwable ) { if ( throwable instanceof java . lang . AssertionError ) { return ( ( java . lang . AssertionError ) ( throwable ) ) ; } } return null ; }
org . junit . Assert . assertNotNull ( error )
testInitialization ( ) { de . metanome . algorithm_integration . results . DenialConstraint expectedResult = new de . metanome . algorithm_integration . results . DenialConstraint ( ) ; de . metanome . backend . result_postprocessing . results . DenialConstraintResult rankingResult = new de . metanome . backend . result_postprocessing . results . DenialConstraintResult ( expectedResult ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return this . result ; }
org . junit . Assert . assertEquals ( expectedResult , rankingResult . getResult ( ) )
getValueWithDefault ( ) { "<AssertPlaceHolder>" ; } get ( java . lang . String , java . lang . Class ) { java . io . Serializable s = get ( key ) ; if ( s != null ) { try { return clazz . cast ( s ) ; } catch ( java . lang . ClassCastException ignore ) { } } return null ; }
org . junit . Assert . assertThat ( subject . get ( key , value ) , org . hamcrest . CoreMatchers . is ( value ) )
testGetFolderIterator_01 ( ) { java . util . Set < org . eclipse . emf . common . util . URI > containedURIs = com . google . common . collect . Sets . newHashSet ( getWorkspace ( ) . getFolderIterator ( myProjectURI . appendSegment ( "src" ) ) ) ; java . util . Set < org . eclipse . emf . common . util . URI > expectation = com . google . common . collect . Sets . newHashSet ( myProjectURI . appendSegments ( new java . lang . String [ ] { "src" , "A.js" } ) , myProjectURI . appendSegments ( new java . lang . String [ ] { "src" , "B.js" } ) , myProjectURI . appendSegments ( new java . lang . String [ ] { "src" , "sub" , "B.js" } ) , myProjectURI . appendSegments ( new java . lang . String [ ] { "src" , "sub" , "C.js" } ) , myProjectURI . appendSegments ( new java . lang . String [ ] { "src" , "sub" , "leaf" , "D.js" } ) ) ; "<AssertPlaceHolder>" ; } getFolderIterator ( org . eclipse . emf . common . util . URI ) { final java . io . File sourceContainerDirectory = new java . io . File ( java . net . URI . create ( folderLocation . toString ( ) ) ) ; if ( sourceContainerDirectory . isDirectory ( ) ) { org . eclipse . emf . common . util . AbstractTreeIterator < java . io . File > treeIterator = new org . eclipse . emf . common . util . AbstractTreeIterator < java . io . File > ( sourceContainerDirectory , false ) { @ eu . numberfour . n4js . internal . Override protected java . util . Iterator < ? extends java . io . File > getChildren ( java . lang . Object root ) { if ( ( root instanceof java . io . File ) && ( ( ( java . io . File ) ( root ) ) . isDirectory ( ) ) ) { return java . util . Arrays . asList ( ( ( java . io . File ) ( root ) ) . listFiles ( ) ) . iterator ( ) ; } return com . google . common . collect . Iterators . emptyIterator ( ) ; } } ; return com . google . common . collect . Iterators . unmodifiableIterator ( com . google . common . collect . Iterators . transform ( com . google . common . collect . Iterators . filter ( treeIterator , new com . google . common . base . Predicate < java . io . File > ( ) { @ eu . numberfour . n4js . internal . Override public boolean apply ( java . io . File input ) { return ! ( input . isDirectory ( ) ) ; } } ) , new com . google . common . base . Function < java . io . File , org . eclipse . emf . common . util . URI > ( ) { @ eu . numberfour . n4js . internal . Override public org . eclipse . emf . common . util . URI apply ( java . io . File input ) { return org . eclipse . emf . common . util . URI . createURI ( input . toURI ( ) . toString ( ) ) ; } } ) ) ; } return com . google . common . collect . Iterators . emptyIterator ( ) ; }
org . junit . Assert . assertEquals ( expectation , containedURIs )
testStartStreaming ( ) { org . mockito . Mockito . when ( client . initializeState ( StreamFrom . BEGINNING , StreamTo . NOW ) ) . thenReturn ( rx . Completable . complete ( ) ) ; org . mockito . Mockito . when ( client . startStreaming ( org . mockito . Mockito . < java . lang . Short [ ] > anyVararg ( ) ) ) . thenReturn ( rx . Completable . complete ( ) ) ; com . couchbase . client . dcp . state . SessionState sessionState = org . mockito . Mockito . mock ( com . couchbase . client . dcp . state . SessionState . class ) ; org . mockito . Mockito . when ( sessionState . isAtEnd ( ) ) . thenReturn ( false , false , true ) ; org . mockito . Mockito . when ( client . sessionState ( ) ) . thenReturn ( sessionState ) ; java . util . concurrent . BlockingQueue < com . couchbase . client . deps . io . netty . buffer . ByteBuf > resultsQueue = new java . util . concurrent . ArrayBlockingQueue ( 3 ) ; streamingConnection . startStreaming ( resultsQueue ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( 2000 ) ; org . mockito . Mockito . verify ( client , org . mockito . Mockito . times ( 3 ) ) . sessionState ( ) ; } isStreaming ( ) { return streaming ; }
org . junit . Assert . assertTrue ( streamingConnection . isStreaming ( ) )
selectRowIdAndVersionAggregateFunction ( ) { org . sagebionetworks . table . cluster . SqlQuery translator = new org . sagebionetworks . table . cluster . SqlQueryBuilder ( "select<sp>max(foo)<sp>from<sp>syn123" , tableSchema ) . build ( ) ; "<AssertPlaceHolder>" ; } includesRowIdAndVersion ( ) { return this . includesRowIdAndVersion ; }
org . junit . Assert . assertFalse ( translator . includesRowIdAndVersion ( ) )
isTaskPendingForUser ( ) { final org . bonitasoft . engine . identity . model . SUser expectedUser = repository . add ( aUser ( ) . withId ( 1L ) . build ( ) ) ; repository . add ( aUser ( ) . withId ( 2L ) . build ( ) ) ; final org . bonitasoft . engine . core . process . instance . model . SPendingActivityMapping pendingActivity = repository . add ( aPendingActivityMapping ( ) . withUserId ( expectedUser . getId ( ) ) . build ( ) ) ; boolean taskPendingForUser = repository . isTaskPendingForUser ( pendingActivity . getActivityId ( ) , expectedUser . getId ( ) ) ; "<AssertPlaceHolder>" . isTrue ( ) ; } getId ( ) { return id ; }
org . junit . Assert . assertThat ( taskPendingForUser )
nullMarkerInEvent ( ) { evaluator . addMarker ( "M" ) ; evaluator . start ( ) ; "<AssertPlaceHolder>" ; } evaluate ( ch . qos . logback . access . spi . IAccessEvent ) { java . lang . String url = event . getRequestURL ( ) ; for ( java . lang . String expected : URLList ) { if ( url . contains ( expected ) ) { return true ; } } return false ; }
org . junit . Assert . assertFalse ( evaluator . evaluate ( event ) )
testFastMultiNodeDijkstra_OneToMany ( ) { org . matsim . core . config . Config config = org . matsim . core . config . ConfigUtils . createConfig ( ) ; org . matsim . api . core . v01 . Scenario scenario = org . matsim . core . scenario . ScenarioUtils . createScenario ( config ) ; createNetwork ( scenario ) ; org . matsim . core . router . util . TravelTime travelTime = new org . matsim . core . trafficmonitoring . FreeSpeedTravelTime ( ) ; org . matsim . core . router . util . TravelDisutility travelDisutility = new org . matsim . core . router . costcalculators . RandomizingTimeDistanceTravelDisutilityFactory ( org . matsim . api . core . v01 . TransportMode . car , config . planCalcScore ( ) ) . createTravelDisutility ( travelTime ) ; org . matsim . core . router . FastMultiNodeDijkstra dijkstra = ( ( org . matsim . core . router . FastMultiNodeDijkstra ) ( new org . matsim . core . router . FastMultiNodeDijkstraFactory ( false ) . createPathCalculator ( scenario . getNetwork ( ) , travelDisutility , travelTime ) ) ) ; org . matsim . api . core . v01 . network . Node fromNode = scenario . getNetwork ( ) . getNodes ( ) . get ( org . matsim . api . core . v01 . Id . create ( "n0" , org . matsim . api . core . v01 . network . Node . class ) ) ; org . matsim . api . core . v01 . network . Node toNode1 = scenario . getNetwork ( ) . getNodes ( ) . get ( org . matsim . api . core . v01 . Id . create ( "n3" , org . matsim . api . core . v01 . network . Node . class ) ) ; org . matsim . api . core . v01 . network . Node toNode2 = scenario . getNetwork ( ) . getNodes ( ) . get ( org . matsim . api . core . v01 . Id . create ( "n4" , org . matsim . api . core . v01 . network . Node . class ) ) ; org . matsim . api . core . v01 . network . Node toNode3 = scenario . getNetwork ( ) . getNodes ( ) . get ( org . matsim . api . core . v01 . Id . create ( "n5" , org . matsim . api . core . v01 . network . Node . class ) ) ; java . util . List < org . matsim . core . router . InitialNode > toNodes = new java . util . ArrayList < org . matsim . core . router . InitialNode > ( ) ; toNodes . add ( new org . matsim . core . router . InitialNode ( toNode1 , 0.0 , 0.0 ) ) ; toNodes . add ( new org . matsim . core . router . InitialNode ( toNode2 , 0.0 , 0.0 ) ) ; toNodes . add ( new org . matsim . core . router . InitialNode ( toNode3 , 0.0 , 0.0 ) ) ; org . matsim . api . core . v01 . network . Node toNode = dijkstra . createImaginaryNode ( toNodes ) ; path = dijkstra . constructPath ( fromNode , toNode3 , 3600.0 ) ; "<AssertPlaceHolder>" ; } constructPath ( org . matsim . api . core . v01 . network . Node , org . matsim . api . core . v01 . network . Node , double ) { if ( ( toNode == null ) || ( fromNode == null ) ) return null ; if ( ! ( fromNode instanceof org . matsim . core . router . util . RoutingNetworkNode ) ) fromNode = this . routingNetwork . getNodes ( ) . get ( fromNode . getId ( ) ) ; if ( ! ( toNode instanceof org . matsim . core . router . util . RoutingNetworkNode ) ) toNode = this . routingNetwork . getNodes ( ) . get ( toNode . getId ( ) ) ; return super . constructPath ( fromNode , toNode , startTime ) ; }
org . junit . Assert . assertNull ( path )
testToFloatArrayForRandomArray ( ) { int size = getArrayLength ( ) ; float [ ] primitive = new float [ size ] ; java . lang . Float [ ] object = new java . lang . Float [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { float value = cz . zcu . kiv . jop . util . ArrayUtilsTest . rand . nextFloat ( ) ; primitive [ i ] = value ; object [ i ] = new java . lang . Float ( value ) ; } "<AssertPlaceHolder>" ; } toObjectArray ( boolean [ ] ) { if ( array == null ) { return null ; } if ( ( array . length ) == 0 ) { return cz . zcu . kiv . jop . util . ArrayUtils . EMPTY_BOOLEAN_OBJECT_ARRAY ; } java . lang . Boolean [ ] retArray = new java . lang . Boolean [ array . length ] ; for ( int i = 0 ; i < ( array . length ) ; i ++ ) { retArray [ i ] = new java . lang . Boolean ( array [ i ] ) ; } return retArray ; }
org . junit . Assert . assertArrayEquals ( object , cz . zcu . kiv . jop . util . ArrayUtils . toObjectArray ( primitive ) )
getClientAddressDefault ( ) { org . mockito . Mockito . when ( request . getRemoteAddr ( ) ) . thenReturn ( "127.0.0.1" ) ; "<AssertPlaceHolder>" ; } getClientAddress ( javax . servlet . http . HttpServletRequest ) { for ( final java . lang . String header : com . cloud . api . ApiServlet . s_clientAddressHeaders ) { final java . lang . String ip = com . cloud . api . ApiServlet . getCorrectIPAddress ( request . getHeader ( header ) ) ; if ( ip != null ) { return java . net . InetAddress . getByName ( ip ) ; } } return java . net . InetAddress . getByName ( request . getRemoteAddr ( ) ) ; }
org . junit . Assert . assertEquals ( java . net . InetAddress . getByName ( "127.0.0.1" ) , com . cloud . api . ApiServlet . getClientAddress ( request ) )
testCreateThriftOneSource ( ) { "<AssertPlaceHolder>" ; } createThriftOneSource ( ) { if ( ( org . apache . hadoop . hbase . thrift . MetricsThriftServerSourceFactoryImpl . FactoryStorage . INSTANCE . thriftOne ) == null ) { org . apache . hadoop . hbase . thrift . MetricsThriftServerSourceFactoryImpl . FactoryStorage . INSTANCE . thriftOne = new org . apache . hadoop . hbase . thrift . MetricsThriftServerSourceImpl ( METRICS_NAME , METRICS_DESCRIPTION , THRIFT_ONE_METRICS_CONTEXT , THRIFT_ONE_JMX_CONTEXT ) ; } return org . apache . hadoop . hbase . thrift . MetricsThriftServerSourceFactoryImpl . FactoryStorage . INSTANCE . thriftOne ; }
org . junit . Assert . assertSame ( new org . apache . hadoop . hbase . thrift . MetricsThriftServerSourceFactoryImpl ( ) . createThriftOneSource ( ) , new org . apache . hadoop . hbase . thrift . MetricsThriftServerSourceFactoryImpl ( ) . createThriftOneSource ( ) )
predecessorKeyThrowsExceptionIfKeyIsNotPresent ( ) { com . google . firebase . database . collection . ImmutableSortedMap < java . lang . String , java . lang . Integer > map = new com . google . firebase . database . collection . ArraySortedMap ( com . google . firebase . database . collection . ArraySortedMapTest . StringComparator ) ; map = map . insert ( "key" , 1 ) ; "<AssertPlaceHolder>" ; try { map . getPredecessorKey ( "no-key" ) ; org . junit . Assert . fail ( "Didn't<sp>throw<sp>exception" ) ; } catch ( java . lang . IllegalArgumentException e ) { } } getPredecessorKey ( K ) { int pos = findKey ( key ) ; if ( pos == ( - 1 ) ) { throw new java . lang . IllegalArgumentException ( "Can't<sp>find<sp>predecessor<sp>of<sp>nonexistent<sp>key" ) ; } else { return pos > 0 ? this . keys [ ( pos - 1 ) ] : null ; } }
org . junit . Assert . assertEquals ( null , map . getPredecessorKey ( "key" ) )
testSecondPhaseResult ( ) { com . orientechnologies . orient . server . distributed . impl . coordinator . transaction . OTransactionSecondPhaseResponse operation = new com . orientechnologies . orient . server . distributed . impl . coordinator . transaction . OTransactionSecondPhaseResponse ( true , new java . util . ArrayList ( ) , new java . util . ArrayList ( ) , new java . util . ArrayList ( ) ) ; com . orientechnologies . orient . server . distributed . impl . coordinator . transaction . OTransactionSecondPhaseResponse readOperation = new com . orientechnologies . orient . server . distributed . impl . coordinator . transaction . OTransactionSecondPhaseResponse ( ) ; com . orientechnologies . orient . server . distributed . impl . coordinator . transaction . TransactionMessagesReadWriteTests . writeRead ( operation , readOperation ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return success ; }
org . junit . Assert . assertEquals ( operation . isSuccess ( ) , readOperation . isSuccess ( ) )
testUpdateOneContext ( ) { statistics . update ( org . openehealth . ipf . commons . test . performance . PerformanceMeasurementTestUtils . createMeasurementHistory ( ) ) ; "<AssertPlaceHolder>" ; } getMeasurementNames ( ) { java . util . Set < java . lang . String > keys = statisticsByMeasurementName . keySet ( ) ; return new java . util . ArrayList < java . lang . String > ( keys ) ; }
org . junit . Assert . assertEquals ( 1 , statistics . getMeasurementNames ( ) . size ( ) )
convertEmptyArray ( ) { "<AssertPlaceHolder>" ; } bsonArrayToJsonArray ( io . mewbase . bson . BsonArray ) { final io . mewbase . bson . JsonArrayBuilder builder = io . mewbase . bson . Json . createArrayBuilder ( ) ; final io . mewbase . bson . BsonCodec . ArrayBuilderVistior visitor = new io . mewbase . bson . BsonCodec . ArrayBuilderVistior ( builder ) ; bsonArray . iterator ( ) . forEachRemaining ( ( element ) -> element . visit ( visitor ) ) ; return builder . build ( ) ; }
org . junit . Assert . assertEquals ( javax . json . Json . createArrayBuilder ( ) . build ( ) , io . mewbase . bson . BsonCodec . bsonArrayToJsonArray ( new io . mewbase . bson . BsonArray ( ) ) )
shouldReturnFieldDefinitionForTwoLevelsDeepPath ( ) { com . qcadoo . model . api . DataDefinition firstBtDataDef = mock ( com . qcadoo . model . api . DataDefinition . class ) ; mockBelongsToField ( "firstBelongsTo" , dataDefinition , firstBtDataDef ) ; com . qcadoo . model . api . DataDefinition secondBtDataDef = mock ( com . qcadoo . model . api . DataDefinition . class ) ; mockBelongsToField ( "secondBelongsTo" , firstBtDataDef , secondBtDataDef ) ; com . qcadoo . model . api . FieldDefinition fieldDefinition = mockFieldDefinition ( "fieldName" , java . lang . String . class , secondBtDataDef ) ; java . lang . String field = "firstBelongsTo.secondBelongsTo.fieldName" ; final com . qcadoo . model . api . FieldDefinition res = com . qcadoo . view . internal . components . grid . GridComponentFilterUtils . getFieldDefinition ( dataDefinition , field ) ; "<AssertPlaceHolder>" ; } getFieldDefinition ( com . qcadoo . model . api . DataDefinition , java . lang . String ) { java . lang . String [ ] path = field . split ( "\\." ) ; for ( int i = 0 ; i < ( path . length ) ; i ++ ) { if ( ( dataDefinition . getField ( path [ i ] ) ) == null ) { return null ; } com . qcadoo . model . api . FieldDefinition fieldDefinition = dataDefinition . getField ( path [ i ] ) ; if ( i < ( ( path . length ) - 1 ) ) { if ( ( fieldDefinition . getType ( ) ) instanceof com . qcadoo . model . api . types . BelongsToType ) { dataDefinition = ( ( com . qcadoo . model . api . types . BelongsToType ) ( fieldDefinition . getType ( ) ) ) . getDataDefinition ( ) ; continue ; } else { return null ; } } return fieldDefinition ; } return null ; }
org . junit . Assert . assertEquals ( fieldDefinition , res )
testExpandForRemovingNotNullHint ( ) { io . quantumdb . core . schema . operations . AlterColumn operation = io . quantumdb . core . schema . operations . SchemaOperations . alterColumn ( "referrals" , "invitee_id" ) . dropHint ( io . quantumdb . core . migration . operations . NOT_NULL ) ; changelog . addChangeSet ( "Michael<sp>de<sp>Jong" , "Dropped<sp>NOT_NULL<sp>constraint<sp>of<sp>'invitee_id'<sp>column." , operation ) ; migrator . migrate ( catalog , refLog , changelog . getLastAdded ( ) , operation ) ; io . quantumdb . core . schema . definitions . Table originalTable = catalog . getTable ( "referrals" ) ; io . quantumdb . core . schema . definitions . Table ghostTable = getGhostTable ( originalTable ) ; io . quantumdb . core . schema . definitions . Table expectedGhostTable = new io . quantumdb . core . schema . definitions . Table ( ghostTable . getName ( ) ) . addColumn ( new io . quantumdb . core . schema . definitions . Column ( "invitee_id" , integer ( ) , IDENTITY , AUTO_INCREMENT ) ) . addColumn ( new io . quantumdb . core . schema . definitions . Column ( "invited_by_id" , integer ( ) ) ) ; "<AssertPlaceHolder>" ; } integer ( ) { return new io . quantumdb . core . schema . definitions . ColumnType ( ColumnType . Type . INTEGER , false , "integer" , ( ) -> 0 , ( statement , position , value ) -> statement . setInt ( position , ( ( java . lang . Number ) ( value ) ) . intValue ( ) ) ) ; }
org . junit . Assert . assertEquals ( expectedGhostTable , ghostTable )
searchUncategorizedProcessDeploymentInfos ( ) { final org . bonitasoft . engine . persistence . QueryOptions options = new org . bonitasoft . engine . persistence . QueryOptions ( 0 , 10 ) ; when ( persistenceService . searchEntity ( org . bonitasoft . engine . core . process . definition . model . SProcessDefinitionDeployInfo . class , "Uncategorized" , options , null ) ) . thenReturn ( new java . util . ArrayList < org . bonitasoft . engine . core . process . definition . model . SProcessDefinitionDeployInfo > ( ) ) ; final java . util . List < org . bonitasoft . engine . core . process . definition . model . SProcessDefinitionDeployInfo > result = processDefinitionServiceImpl . searchUncategorizedProcessDeploymentInfos ( options ) ; "<AssertPlaceHolder>" ; } searchUncategorizedProcessDeploymentInfos ( org . bonitasoft . engine . search . SearchOptions ) { final org . bonitasoft . engine . service . TenantServiceAccessor tenantAccessor = getTenantAccessor ( ) ; final org . bonitasoft . engine . search . descriptor . SearchEntitiesDescriptor searchEntitiesDescriptor = tenantAccessor . getSearchEntitiesDescriptor ( ) ; final org . bonitasoft . engine . core . process . definition . ProcessDefinitionService processDefinitionService = tenantAccessor . getProcessDefinitionService ( ) ; final org . bonitasoft . engine . search . descriptor . SearchProcessDefinitionsDescriptor searchDescriptor = searchEntitiesDescriptor . getSearchProcessDefinitionsDescriptor ( ) ; final org . bonitasoft . engine . search . process . SearchUncategorizedProcessDeploymentInfos transactionSearch = new org . bonitasoft . engine . search . process . SearchUncategorizedProcessDeploymentInfos ( processDefinitionService , searchDescriptor , searchOptions ) ; try { transactionSearch . execute ( ) ; } catch ( final org . bonitasoft . engine . commons . exceptions . SBonitaException e ) { throw new org . bonitasoft . engine . exception . SearchException ( "Problem<sp>encountered<sp>while<sp>searching<sp>for<sp>Uncategorized<sp>Process<sp>Definitions" , e ) ; } return transactionSearch . getResult ( ) ; }
org . junit . Assert . assertNotNull ( result )
testCreateDaoTableConfig ( ) { createDao ( com . j256 . ormlite . dao . Foo . class , true ) ; com . j256 . ormlite . dao . RuntimeExceptionDao < com . j256 . ormlite . dao . Foo , java . lang . String > dao = com . j256 . ormlite . dao . RuntimeExceptionDao . createDao ( connectionSource , com . j256 . ormlite . table . DatabaseTableConfig . fromClass ( databaseType , com . j256 . ormlite . dao . Foo . class ) ) ; "<AssertPlaceHolder>" ; } countOf ( ) { checkForInitialized ( ) ; com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadOnlyConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . queryForCountStar ( connection ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
org . junit . Assert . assertEquals ( 0 , dao . countOf ( ) )
getPagesEmptyRange ( ) { org . sejda . model . parameter . AddBackPagesParameters victim = new org . sejda . model . parameter . AddBackPagesParameters ( ) ; "<AssertPlaceHolder>" ; } getPages ( int ) { return java . util . Collections . unmodifiableSet ( pages . stream ( ) . filter ( ( p ) -> ( p <= upperLimit ) && ( p > 0 ) ) . collect ( java . util . stream . Collectors . toSet ( ) ) ) ; }
org . junit . Assert . assertEquals ( 10 , victim . getPages ( 10 ) . size ( ) )
testCreateUsers_NoProvOnInstance ( ) { final java . lang . String instanceId = createService ( ProvisioningStatus . COMPLETED ) ; final java . util . List < org . oscm . provisioning . data . User > users = new java . util . ArrayList ( ) ; final org . oscm . provisioning . data . UserResult result = new org . oscm . provisioning . data . UserResult ( ) ; result . setRc ( 1 ) ; doReturn ( result ) . when ( provServiceMock ) . createUsers ( instanceId , users , null ) ; when ( controllerMock . createUsers ( anyString ( ) , any ( org . oscm . app . v2_0 . data . ProvisioningSettings . class ) , any ( java . util . List . class ) ) ) . thenReturn ( new org . oscm . app . v2_0 . data . InstanceStatusUsers ( ) ) ; org . oscm . provisioning . data . UserResult ur = runTX ( new java . util . concurrent . Callable < org . oscm . provisioning . data . UserResult > ( ) { @ org . oscm . app . v2_0 . service . Override public org . oscm . provisioning . data . UserResult call ( ) { return proxy . createUsers ( instanceId , users , null ) ; } } ) ; verifyZeroInteractions ( provServiceMock ) ; "<AssertPlaceHolder>" ; } getRc ( ) { return localRc ; }
org . junit . Assert . assertEquals ( 0 , ur . getRc ( ) )
testGetParametersWithDisablesSecurityFlag ( ) { unit . setSecurity ( false ) ; java . lang . String name = "AddressN" ; java . lang . String abbrName = "AN" ; org . lnu . is . domain . address . type . AddressType entity = new org . lnu . is . domain . address . type . AddressType ( ) ; entity . setName ( name ) ; entity . setAbbrName ( abbrName ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "name" , name ) ; expected . put ( "abbrName" , abbrName ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetServicePathForNamingNoGRNoNM ( ) { System . out . println ( ( ( getTestTraceHead ( "[NGSIEvent.getServicePathForNaming]" ) ) + "--------<sp>When<sp>grouping<sp>and<sp>mappings<sp>are<sp>not<sp>enabled,<sp>the<sp>original<sp>service<sp>path<sp>is<sp>returned" ) ) ; java . util . HashMap < java . lang . String , java . lang . String > headers = new java . util . HashMap ( ) ; headers . put ( CommonConstants . HEADER_FIWARE_SERVICE_PATH , originalServicePath ) ; headers . put ( NGSIConstants . FLUME_HEADER_MAPPED_SERVICE_PATH , mappedServicePath ) ; headers . put ( NGSIConstants . FLUME_HEADER_GROUPED_SERVICE_PATH , groupedServicePath ) ; byte [ ] body = null ; com . telefonica . iot . cygnus . containers . NotifyContextRequest . ContextElement originalCE = null ; com . telefonica . iot . cygnus . containers . NotifyContextRequest . ContextElement mappedCE = null ; com . telefonica . iot . cygnus . interceptors . NGSIEvent event = new com . telefonica . iot . cygnus . interceptors . NGSIEvent ( headers , body , originalCE , mappedCE ) ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( getTestTraceHead ( "[NGSIEvent.getServicePathForNaming]" ) ) + "-<sp>OK<sp>-<sp>The<sp>original<sp>service<sp>path<sp>has<sp>been<sp>returned" ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( getTestTraceHead ( "[NGSIEvent.getServicePathForNaming]" ) ) + "-<sp>FAIL<sp>-<sp>The<sp>original<sp>service<sp>path<sp>has<sp>not<sp>been<sp>returned" ) ) ; throw e ; } getServicePathForNaming ( boolean , boolean ) { if ( enableGrouping ) { return headers . get ( NGSIConstants . FLUME_HEADER_GROUPED_SERVICE_PATH ) ; } else if ( enableMappings ) { return headers . get ( NGSIConstants . FLUME_HEADER_MAPPED_SERVICE_PATH ) ; } else { return headers . get ( CommonConstants . HEADER_FIWARE_SERVICE_PATH ) ; }
org . junit . Assert . assertEquals ( originalServicePath , event . getServicePathForNaming ( false , false ) )
testSetResultOptionsNullOptionsEntryGroup20 ( ) { nl . surfnet . coin . api . client . domain . AbstractEntry entry = getAbstractEntryGroup20 ( 3 ) ; controller . setResultOptions ( entry , null , null , "title" ) ; "<AssertPlaceHolder>" ; } getEntryCollection ( ) { java . util . ArrayList < nl . surfnet . coin . api . client . domain . Person > list = new java . util . ArrayList < nl . surfnet . coin . api . client . domain . Person > ( ) ; if ( ( this . entry ) != null ) { list . add ( entry ) ; } return list ; }
org . junit . Assert . assertEquals ( 3 , entry . getEntryCollection ( ) . size ( ) )
testFindLinksByNoteId ( ) { int noteId1 = 101 ; int noteId2 = 202 ; boolean isActive = true ; org . oscarehr . common . model . GroupNoteLink groupNoteLink1 = new org . oscarehr . common . model . GroupNoteLink ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( groupNoteLink1 ) ; groupNoteLink1 . setNoteId ( noteId1 ) ; groupNoteLink1 . setActive ( isActive ) ; dao . persist ( groupNoteLink1 ) ; org . oscarehr . common . model . GroupNoteLink groupNoteLink2 = new org . oscarehr . common . model . GroupNoteLink ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( groupNoteLink2 ) ; groupNoteLink2 . setNoteId ( noteId2 ) ; groupNoteLink2 . setActive ( isActive ) ; dao . persist ( groupNoteLink2 ) ; org . oscarehr . common . model . GroupNoteLink groupNoteLink3 = new org . oscarehr . common . model . GroupNoteLink ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( groupNoteLink3 ) ; groupNoteLink3 . setNoteId ( noteId1 ) ; groupNoteLink3 . setActive ( isActive ) ; dao . persist ( groupNoteLink3 ) ; org . oscarehr . common . model . GroupNoteLink groupNoteLink4 = new org . oscarehr . common . model . GroupNoteLink ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( groupNoteLink4 ) ; groupNoteLink4 . setNoteId ( noteId1 ) ; groupNoteLink4 . setActive ( ( ! isActive ) ) ; dao . persist ( groupNoteLink4 ) ; java . util . List < org . oscarehr . common . model . GroupNoteLink > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . GroupNoteLink > ( java . util . Arrays . asList ( groupNoteLink1 , groupNoteLink3 ) ) ; java . util . List < org . oscarehr . common . model . GroupNoteLink > result = dao . findLinksByNoteId ( noteId1 ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
org . junit . Assert . assertTrue ( true )
expandsCorrectly ( ) { for ( int i = 1 ; i < 100 ; i ++ ) { zemberek . core . collections . IntMap < java . lang . String > im = new zemberek . core . collections . IntMap ( i ) ; int elements = i * 10 ; for ( int j = 0 ; j < elements ; j ++ ) { im . put ( j , ( "" + j ) ) ; } for ( int j = 0 ; j < elements ; j ++ ) { "<AssertPlaceHolder>" ; } checkSize ( im , elements ) ; } } get ( java . lang . String ) { return data . get ( key ) ; }
org . junit . Assert . assertEquals ( im . get ( j ) , ( "" + j ) )
shouldAddTermsFromRedisOnHvalsCommand ( ) { when ( localParamsMock . get ( "command" ) ) . thenReturn ( "hvals" ) ; when ( localParamsMock . get ( "key" ) ) . thenReturn ( "simpleKey" ) ; when ( localParamsMock . get ( QueryParsing . V ) ) . thenReturn ( "string_field" ) ; when ( jedisMock . hvals ( anyString ( ) ) ) . thenReturn ( com . sematext . solr . redis . Arrays . asList ( "123" , "321" ) ) ; when ( requestMock . getSchema ( ) ) . thenReturn ( schema ) ; when ( schema . getQueryAnalyzer ( ) ) . thenReturn ( new org . apache . lucene . analysis . standard . StandardAnalyzer ( ) ) ; redisQParser = new com . sematext . solr . redis . RedisQParser ( "string_field" , localParamsMock , paramsMock , requestMock , commandHandler ) ; final org . apache . lucene . search . Query query = redisQParser . parse ( ) ; verify ( jedisMock ) . hvals ( "simpleKey" ) ; org . apache . lucene . search . IndexSearcher searcher = new org . apache . lucene . search . IndexSearcher ( new org . apache . lucene . index . MultiReader ( ) ) ; final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = com . sematext . solr . redis . TestRedisQParser . extractTerms ( searcher , query ) ; "<AssertPlaceHolder>" ; } extractTerms ( org . apache . lucene . search . IndexSearcher , org . apache . lucene . search . Query ) { final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = new com . sematext . solr . redis . HashSet ( ) ; org . apache . lucene . search . Query rewrittenQuery = searcher . rewrite ( query ) ; if ( rewrittenQuery instanceof org . apache . lucene . search . ConstantScoreQuery ) { org . apache . lucene . search . ConstantScoreQuery constantScoreQuery = ( ( org . apache . lucene . search . ConstantScoreQuery ) ( rewrittenQuery ) ) ; rewrittenQuery = constantScoreQuery . getQuery ( ) ; } searcher . createNormalizedWeight ( rewrittenQuery , true ) . extractTerms ( terms ) ; return terms ; }
org . junit . Assert . assertEquals ( 2 , terms . size ( ) )
testHasDataflowNatureOnProjectWithDataflowNatureReturnsTrue ( ) { when ( project . hasNature ( DataflowJavaProjectNature . DATAFLOW_NATURE_ID ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } hasDataflowNature ( org . eclipse . core . resources . IProject ) { return ( project != null ) && ( com . google . cloud . tools . eclipse . util . NatureUtils . hasNature ( project , com . google . cloud . tools . eclipse . dataflow . core . natures . DataflowJavaProjectNature . DATAFLOW_NATURE_ID ) ) ; }
org . junit . Assert . assertTrue ( com . google . cloud . tools . eclipse . dataflow . core . natures . DataflowJavaProjectNature . hasDataflowNature ( project ) )
testSelectUsingMixedBooleanExpressionMatchers ( ) { com . liferay . dynamic . data . mapping . form . values . query . DDMFormValuesQuery ddmFormValuesQuery = createDDMFormValuesQuery ( ( "//*[@value('en_US')<sp>=<sp>'wrong'<sp>and<sp>@value('en_US')<sp>=<sp>'wrong'<sp>or" + "@value('pt_BR')<sp>=<sp>'Pt<sp>text22']" ) ) ; java . util . List < com . liferay . dynamic . data . mapping . storage . DDMFormFieldValue > ddmFormFieldValues = ddmFormValuesQuery . selectDDMFormFieldValues ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( ddmFormFieldValues . toString ( ) , 3 , ddmFormFieldValues . size ( ) )
testEqualsSelf ( ) { org . jfree . data . time . TimeSeriesDataItem item = new org . jfree . data . time . TimeSeriesDataItem ( new org . jfree . data . time . Day ( 23 , 9 , 2001 ) , 99.7 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; mdz . hc . ProcessValue other = ( ( mdz . hc . ProcessValue ) ( obj ) ) ; if ( ( state ) != ( other . state ) ) return false ; if ( ( timestamp ) == null ) { if ( ( other . timestamp ) != null ) return false ; } else if ( ! ( timestamp . equals ( other . timestamp ) ) ) return false ; if ( ( value ) == null ) { if ( ( other . value ) != null ) return false ; } else if ( ! ( value . equals ( other . value ) ) ) return false ; return true ; }
org . junit . Assert . assertTrue ( item . equals ( item ) )
testSetdataFor ( ) { double [ ] [ ] doubles = new double [ ] [ ] { new double [ ] { 1 , 2 , 3 } , new double [ ] { 4 , 5 , 6 } , new double [ ] { 7 , 8 , 9 } } ; org . jblas . DoubleMatrix inMatrix = new org . jblas . DoubleMatrix ( doubles ) ; org . jblas . DoubleMatrix outMatrix_ACTUAL = new org . jblas . DoubleMatrix ( ( 2 * ( inMatrix . rows ) ) , inMatrix . columns ) ; org . jblas . DoubleMatrix outMatrix_EXPECTED = new org . jblas . DoubleMatrix ( ( 2 * ( inMatrix . rows ) ) , inMatrix . columns ) ; outMatrix_EXPECTED . put ( 0 , 1 , 5 ) ; outMatrix_EXPECTED . put ( 1 , 1 , 8 ) ; org . jlinda . core . utils . LinearAlgebraUtils . setdata ( outMatrix_ACTUAL , new org . jlinda . core . Window ( 0 , 1 , 1 , 1 ) , inMatrix , new org . jlinda . core . Window ( 1 , 2 , 1 , 1 ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( outMatrix_ACTUAL , outMatrix_EXPECTED )
testDoOCR_File_Rectangle ( ) { net . sourceforge . tess4j . TesseractTest . logger . info ( "doOCR<sp>on<sp>a<sp>BMP<sp>image<sp>with<sp>bounding<sp>rectangle" ) ; java . io . File imageFile = new java . io . File ( this . testResourcesDataPath , "eurotext.bmp" ) ; java . awt . Rectangle rect = new java . awt . Rectangle ( 0 , 0 , 1024 , 800 ) ; java . lang . String expResult = "The<sp>(quick)<sp>[brown]<sp>{fox}<sp>jumps!\nOver<sp>the<sp>$43,456.78<sp><lazy><sp>#90<sp>dog" ; java . lang . String result = instance . doOCR ( imageFile , rect ) ; net . sourceforge . tess4j . TesseractTest . logger . info ( result ) ; "<AssertPlaceHolder>" ; } doOCR ( net . sourceforge . tess4j . List , java . awt . Rectangle ) { return doOCR ( imageList , null , rect ) ; }
org . junit . Assert . assertEquals ( expResult , result . substring ( 0 , expResult . length ( ) ) )
testAuthenticateUserRegular ( ) { org . oscm . security . ADMRealmImpl realmImpl = new org . oscm . security . SecurityIT . TestADMRealmImpl ( "40" ) ; findAndBindWasCalled = false ; realmImpl . authenticateUser ( "40" , org . oscm . security . SecurityIT . LDAP_PASSWORD ) ; "<AssertPlaceHolder>" ; } authenticateUser ( java . lang . String , java . lang . String ) { java . lang . String [ ] groups = null ; try { org . oscm . security . UserQuery userQuery = getUserQuery ( userKey ) ; try { java . lang . Long . parseLong ( userKey ) ; userQuery . execute ( ) ; if ( ( userQuery . getOrgKey ( ) ) == null ) { logAndThrowException ( java . lang . String . format ( "PlatformUser<sp>'%s'<sp>not<sp>found." , userKey ) ) ; } } catch ( java . lang . NumberFormatException ex ) { logger . finest ( ( ( ( "User<sp>key<sp>" + userKey ) + "<sp>contains<sp>non<sp>numeric<sp>characters," ) + "<sp>database<sp>access<sp>skipped." ) ) ; throw new javax . security . auth . login . LoginException ( java . lang . String . format ( "Login<sp>failed<sp>for<sp>invalid<sp>user<sp>key<sp>'%s'" , userKey ) ) ; } if ( ! ( org . oscm . security . ADMRealmImpl . activeStatusList . contains ( userQuery . getStatus ( ) ) ) ) { logAndThrowException ( java . lang . String . format ( "Login<sp>for<sp>user<sp>'%s'<sp>failed<sp>as<sp>the<sp>user<sp>account<sp>is<sp>locked." , userKey ) ) ; } org . oscm . security . AuthenticationModeQuery authModeQuery = getAuthenticationModeQuery ( ) ; authModeQuery . execute ( ) ; if ( AuthenticationMode . SAML_SP . name ( ) . equals ( authModeQuery . getAuthenticationMode ( ) ) ) { handleSSOLogin ( userKey , password , authModeQuery , userQuery ) ; } else { handleInternalLogin ( userKey , password , userQuery ) ; } org . oscm . security . List < java . lang . String > roles = loadRoleNames ( userKey ) ; groups = roles . toArray ( new java . lang . String [ ] { } ) ; return groups ; } catch ( java . sql . SQLException e ) { throw new javax . security . auth . login . LoginException ( ( ( org . oscm . security . ADMRealmImpl . ERR_DB_ACCESS ) + ( e . toString ( ) ) ) ) ; } catch ( javax . naming . NamingException e ) { throw new javax . security . auth . login . LoginException ( org . oscm . security . ADMRealmImpl . ERR_DB_LOOKUP ) ; } }
org . junit . Assert . assertFalse ( findAndBindWasCalled )
fullyQualifiedClass ( ) { java . lang . String tag = new org . apache . isis . core . metamodel . services . swagger . internal . Tagger ( ) . tagFor ( "foo.bar.Abc" , null ) ; "<AssertPlaceHolder>" ; } is ( org . apache . isis . core . metamodel . spec . feature . Contributed ) { return new com . google . common . base . Predicate < T > ( ) { @ org . apache . isis . core . metamodel . specloader . specimpl . Override public boolean apply ( org . apache . isis . core . metamodel . spec . feature . ObjectMember input ) { return contributed . isIncluded ( ) ; } } ; }
org . junit . Assert . assertThat ( tag , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( "bar" ) ) )
rootConcurrentDelete ( ) { final int numThreads = alluxio . client . fs . ConcurrentDeleteIntegrationTest . CONCURRENCY_FACTOR ; alluxio . AlluxioURI [ ] paths = new alluxio . AlluxioURI [ numThreads ] ; for ( int i = 0 ; i < numThreads ; i ++ ) { paths [ i ] = new alluxio . AlluxioURI ( ( "/file" + i ) ) ; mFileSystem . createFile ( paths [ i ] , alluxio . client . fs . ConcurrentDeleteIntegrationTest . sCreatePersistedFileOptions ) . close ( ) ; } java . util . List < java . lang . Throwable > errors = alluxio . client . fs . ConcurrentFileSystemMasterUtils . unaryOperation ( mFileSystem , ConcurrentFileSystemMasterUtils . UnaryOperation . DELETE , paths , alluxio . client . fs . ConcurrentDeleteIntegrationTest . LIMIT_MS ) ; if ( ! ( errors . isEmpty ( ) ) ) { org . junit . Assert . fail ( ( ( ( "Encountered<sp>" + ( errors . size ( ) ) ) + "<sp>errors,<sp>the<sp>first<sp>one<sp>is<sp>" ) + ( errors . get ( 0 ) ) ) ) ; } java . util . List < alluxio . client . file . URIStatus > files = mFileSystem . listStatus ( new alluxio . AlluxioURI ( "/" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return mDelegate . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , files . size ( ) )
testSetMultiple ( ) { com . vaadin . ui . AbstractComponent component = getComponent ( ) ; component . setStyleName ( "style1<sp>style2" ) ; "<AssertPlaceHolder>" ; } getStyleName ( ) { return styleName ; }
org . junit . Assert . assertEquals ( component . getStyleName ( ) , "style1<sp>style2" )
getLogSchemaVersionsByApplicationTokenTest ( ) { org . kaaproject . kaa . common . dto . ApplicationDto application = createApplication ( tenantAdminDto ) ; org . kaaproject . kaa . common . dto . logs . LogSchemaDto logSchemaDto = createLogSchema ( application . getId ( ) ) ; org . kaaproject . kaa . common . dto . admin . SchemaVersions schemaVersions = client . getSchemaVersionsByApplicationToken ( application . getApplicationToken ( ) ) ; java . util . List < org . kaaproject . kaa . common . dto . VersionDto > found = schemaVersions . getLogSchemaVersions ( ) ; "<AssertPlaceHolder>" ; } getLogSchemaVersions ( ) { return logSchemaVersions ; }
org . junit . Assert . assertEquals ( 2 , found . size ( ) )
whenDefaults ( ) { final java . lang . Class < ? > cls = org . apache . isis . core . metamodel . facets . object . domainobjectlayout . DomainObjectLayoutFactoryTest . CustomerWithDefaults . class ; facetFactory . process ( new org . apache . isis . core . metamodel . facets . FacetFactory . ProcessClassContext ( cls , null , mockMethodRemover , facetHolder ) ) ; final org . apache . isis . core . metamodel . facetapi . Facet facet = facetHolder . getFacet ( org . apache . isis . core . metamodel . facets . object . bookmarkpolicy . BookmarkPolicyFacet . class ) ; "<AssertPlaceHolder>" ; expectNoMethodsRemoved ( ) ; } getFacet ( java . lang . Class ) { final org . apache . isis . core . metamodel . facetapi . FacetHolder facetHolder = getAction ( ) ; return facetHolder . getFacet ( facetType ) ; }
org . junit . Assert . assertNull ( facet )
testAdjustTLSContext ( ) { de . rub . nds . tlsattacker . core . protocol . message . extension . SRPExtensionMessage msg = new de . rub . nds . tlsattacker . core . protocol . message . extension . SRPExtensionMessage ( ) ; msg . setSrpIdentifier ( de . rub . nds . tlsattacker . core . protocol . handler . extension . SrpExtensionHandlerTest . SRP_IDENTIFIER ) ; msg . setSrpIdentifierLength ( de . rub . nds . tlsattacker . core . protocol . handler . extension . SrpExtensionHandlerTest . SRP_IDENTIFIER_LENGTH ) ; handler . adjustTLSContext ( msg ) ; "<AssertPlaceHolder>" ; } getSecureRemotePasswordExtensionIdentifier ( ) { return secureRemotePasswordExtensionIdentifier ; }
org . junit . Assert . assertArrayEquals ( de . rub . nds . tlsattacker . core . protocol . handler . extension . SrpExtensionHandlerTest . SRP_IDENTIFIER , context . getSecureRemotePasswordExtensionIdentifier ( ) )
testConsistentHash ( ) { int replicas = 100 ; com . cloudera . util . consistenthash . ConsistentHash < java . lang . String > hash = new com . cloudera . util . consistenthash . ConsistentHash < java . lang . String > ( replicas , machines ) ; java . util . List < java . lang . String > orig = new java . util . ArrayList < java . lang . String > ( 20 ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "Before:<sp>" ) ; for ( int i = 0 ; i < 20 ; i ++ ) { java . lang . String s = "this<sp>is<sp>a<sp>the<sp>key<sp>" + i ; java . lang . String bin = hash . getBinFor ( s ) ; sb . append ( ( bin + ",<sp>" ) ) ; orig . add ( bin ) ; } com . cloudera . util . consistenthash . TestConsistentHash . LOG . info ( sb . toString ( ) ) ; int diffs = 0 ; sb = new java . lang . StringBuilder ( ) ; sb . append ( "after<sp>adding<sp>a<sp>machine:<sp>" ) ; hash . addBin ( "machine<sp>F" ) ; for ( int i = 0 ; i < 20 ; i ++ ) { java . lang . String s = "this<sp>is<sp>a<sp>the<sp>key<sp>" + i ; java . lang . String bin = hash . getBinFor ( s ) ; sb . append ( ( bin + ",<sp>" ) ) ; if ( ! ( orig . get ( i ) . equals ( bin ) ) ) { diffs ++ ; } } com . cloudera . util . consistenthash . TestConsistentHash . LOG . info ( sb . toString ( ) ) ; com . cloudera . util . consistenthash . TestConsistentHash . LOG . info ( ( ( "Adding<sp>one<sp>caused<sp>" + diffs ) + "<sp>out<sp>of<sp>20<sp>to<sp>change" ) ) ; com . cloudera . util . consistenthash . TestConsistentHash . LOG . info ( "after<sp>adding<sp>a<sp>machine:<sp>" ) ; hash . removeBin ( "machine<sp>F" ) ; sb = new java . lang . StringBuilder ( ) ; for ( int i = 0 ; i < 20 ; i ++ ) { java . lang . String s = "this<sp>is<sp>a<sp>the<sp>key<sp>" + i ; java . lang . String bin = hash . getBinFor ( s ) ; sb . append ( ( bin + ",<sp>" ) ) ; "<AssertPlaceHolder>" ; } com . cloudera . util . consistenthash . TestConsistentHash . LOG . info ( sb . toString ( ) ) ; } get ( T ) { assert val != null ; if ( hist . containsKey ( val ) ) { return hist . get ( val ) ; } return 0 ; }
org . junit . Assert . assertEquals ( orig . get ( i ) , bin )
debieraCrearProducto ( ) { mx . edu . um . mateo . general . model . Organizacion organizacion = new mx . edu . um . mateo . general . model . Organizacion ( "apPaterno" 0 , "apPaterno" 7 , "apPaterno" 7 ) ; currentSession ( ) . save ( organizacion ) ; mx . edu . um . mateo . general . model . Empresa empresa = new mx . edu . um . mateo . general . model . Empresa ( "apPaterno" 0 , "apPaterno" 7 , "apPaterno" 7 , "000000000001" , organizacion ) ; currentSession ( ) . save ( empresa ) ; mx . edu . um . mateo . general . model . Rol rol = new mx . edu . um . mateo . general . model . Rol ( "apPaterno" 9 ) ; currentSession ( ) . save ( rol ) ; java . util . Set < mx . edu . um . mateo . general . model . Rol > roles = new java . util . HashSet ( ) ; roles . add ( rol ) ; mx . edu . um . mateo . inventario . model . Almacen almacen = new mx . edu . um . mateo . inventario . model . Almacen ( "TST" , "apPaterno" 4 , empresa ) ; currentSession ( ) . save ( almacen ) ; mx . edu . um . mateo . inventario . model . TipoProducto tipoProducto = new mx . edu . um . mateo . inventario . model . TipoProducto ( "TEST-01" , "TEST-01" , almacen ) ; currentSession ( ) . save ( tipoProducto ) ; mx . edu . um . mateo . general . model . Usuario usuario = new mx . edu . um . mateo . general . model . Usuario ( "bugs@um.edu.mx" , "apPaterno" , "apMaterno" , "TEST-01" , "TEST-01" ) ; usuario . setEmpresa ( empresa ) ; usuario . setAlmacen ( almacen ) ; usuario . setRoles ( roles ) ; currentSession ( ) . save ( usuario ) ; java . lang . Long id = usuario . getId ( ) ; "<AssertPlaceHolder>" ; this . authenticate ( usuario , usuario . getPassword ( ) , new java . util . ArrayList < org . springframework . security . core . GrantedAuthority > ( usuario . getRoles ( ) ) ) ; this . mockMvc . perform ( fileUpload ( "apPaterno" 2 ) . param ( "apPaterno" 5 , "TST-01" ) . param ( "sku" , "apPaterno" 8 ) . param ( "apPaterno" 1 , "apPaterno" 8 ) . param ( "apPaterno" 6 , "apPaterno" 8 ) . param ( "tipoProducto.id" , tipoProducto . getId ( ) . toString ( ) ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( flash ( ) . attributeExists ( "message" ) ) . andExpect ( flash ( ) . attribute ( "message" , "apPaterno" 3 ) ) ; } getId ( ) { return id ; }
org . junit . Assert . assertNotNull ( id )
getCurrentStatusFailTest ( ) { com . cloud . hypervisor . ovm3 . resources . helpers . Ovm3Configuration config = new com . cloud . hypervisor . ovm3 . resources . helpers . Ovm3Configuration ( configTest . getParams ( ) ) ; con = support . prepConnectionResults ( ) ; con . setResult ( results . simpleResponseWrapWrapper ( "fail" ) ) ; con . removeMethodResponse ( "echo" ) ; hypervisor . setConnection ( con ) ; results . basicBooleanTest ( hypervisor . configure ( config . getAgentName ( ) , configTest . getParams ( ) ) ) ; "<AssertPlaceHolder>" ; } getCurrentStatus ( long ) { try { com . cloud . hypervisor . ovm3 . objects . Common test = new com . cloud . hypervisor . ovm3 . objects . Common ( c ) ; java . lang . String ping = "put" ; java . lang . String pong = test . echo ( ping ) ; if ( pong . contains ( ping ) ) { hypervisorsupport . syncState ( ) ; com . cloud . hypervisor . ovm3 . objects . CloudstackPlugin cSp = new com . cloud . hypervisor . ovm3 . objects . CloudstackPlugin ( c ) ; if ( ( ! ( cSp . dom0CheckStorageHealthCheck ( configuration . getAgentScriptsDir ( ) , configuration . getAgentCheckStorageScript ( ) , configuration . getCsHostGuid ( ) , configuration . getAgentStorageCheckTimeout ( ) , configuration . getAgentStorageCheckInterval ( ) ) ) ) && ( ! ( cSp . dom0CheckStorageHealthCheck ( ) ) ) ) { com . cloud . hypervisor . ovm3 . resources . Ovm3HypervisorResource . LOGGER . error ( ( "Storage<sp>health<sp>check<sp>not<sp>running<sp>on<sp>" + ( configuration . getAgentHostname ( ) ) ) ) ; } else if ( cSp . dom0CheckStorageHealthCheck ( ) ) { com . cloud . hypervisor . ovm3 . resources . Ovm3HypervisorResource . LOGGER . error ( ( "Storage<sp>health<sp>check<sp>started<sp>on<sp>" + ( configuration . getAgentHostname ( ) ) ) ) ; } else { com . cloud . hypervisor . ovm3 . resources . Ovm3HypervisorResource . LOGGER . debug ( ( "Storage<sp>health<sp>check<sp>running<sp>on<sp>" + ( configuration . getAgentHostname ( ) ) ) ) ; } return new com . cloud . agent . api . PingRoutingCommand ( getType ( ) , id , hypervisorsupport . hostVmStateReport ( ) ) ; } else { com . cloud . hypervisor . ovm3 . resources . Ovm3HypervisorResource . LOGGER . debug ( ( ( ( "Agent<sp>did<sp>not<sp>respond<sp>correctly:<sp>" + ping ) + "<sp>but<sp>got<sp>" ) + pong ) ) ; } } catch ( com . cloud . hypervisor . ovm3 . objects . Ovm3ResourceException | java . lang . NullPointerException e ) { com . cloud . hypervisor . ovm3 . resources . Ovm3HypervisorResource . LOGGER . debug ( "Check<sp>agent<sp>status<sp>failed" , e ) ; return null ; } return null ; }
org . junit . Assert . assertNull ( hypervisor . getCurrentStatus ( 1L ) )
MustInCorrectPrepareWhenFieldInThrowInvlidArgumentException ( ) { info . smart_tools . smartactors . iobject . iobject . IObject query = mock ( info . smart_tools . smartactors . iobject . iobject . IObject . class ) ; when ( collectionNameField . in ( query ) ) . thenThrow ( new info . smart_tools . smartactors . base . exception . invalid_argument_exception . InvalidArgumentException ( "" ) ) ; info . smart_tools . smartactors . ioc . ikey . IKey upsertTaskKey = mock ( info . smart_tools . smartactors . ioc . ikey . IKey . class ) ; when ( info . smart_tools . smartactors . ioc . named_keys_storage . Keys . getOrAdd ( "db.collection.upsert" ) ) . thenReturn ( upsertTaskKey ) ; try { testTask . prepare ( query ) ; } catch ( info . smart_tools . smartactors . database . interfaces . idatabase_task . exception . TaskPrepareException e ) { verifyStatic ( ) ; info . smart_tools . smartactors . ioc . named_keys_storage . Keys . getOrAdd ( "db.collection.upsert" ) ; verify ( collectionNameField ) . in ( query ) ; return ; } "<AssertPlaceHolder>" ; } in ( info . smart_tools . smartactors . iobject . iobject . IObject ) { if ( null == obj ) { throw new info . smart_tools . smartactors . base . exception . invalid_argument_exception . InvalidArgumentException ( "Argument<sp>should<sp>not<sp>be<sp>null." ) ; } java . lang . Object value = obj . getValue ( fieldName ) ; if ( null == value ) { return null ; } return ( ( T ) ( value ) ) ; }
org . junit . Assert . assertTrue ( false )
testSetLowRed ( ) { com . opera . core . systems . model . OperaColor color = new com . opera . core . systems . model . OperaColor ( 120 , 110 , 100 ) ; color . setLowRed ( 255 ) ; "<AssertPlaceHolder>" ; } getLowRed ( ) { return lowRed ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Integer ) ( 255 ) ) , color . getLowRed ( ) )
testOnConnectionChangedUpdatePreWithObjectTypeErr ( ) { org . o3project . odenos . core . manager . system . ComponentConnection prev = new org . o3project . odenos . core . manager . system . ComponentConnection ( "logic_id" , "LogicAndNetwork" , "initializing" ) ; org . o3project . odenos . core . manager . system . ComponentConnection curr = new org . o3project . odenos . core . manager . system . ComponentConnection ( "logic_id" , "Original" , "running" ) ; org . o3project . odenos . core . manager . system . event . ComponentConnectionChanged msg = new org . o3project . odenos . core . manager . system . event . ComponentConnectionChanged ( "update" , prev , curr ) ; "<AssertPlaceHolder>" ; } onConnectionChangedUpdatePre ( org . o3project . odenos . core . manager . system . event . ComponentConnectionChanged ) { org . o3project . odenos . component . linklayerizer . LinkLayerizer . log . debug ( "" ) ; org . o3project . odenos . core . manager . system . ComponentConnection curr = message . curr ( ) ; if ( ! ( ComponentConnectionLogicAndNetwork . TYPE . equals ( curr . getObjectType ( ) ) ) ) { return false ; } java . lang . String logicId = curr . getProperty ( ComponentConnectionLogicAndNetwork . LOGIC_ID ) ; if ( ! ( getObjectId ( ) . equals ( logicId ) ) ) { return false ; } return true ; }
org . junit . Assert . assertThat ( target . onConnectionChangedUpdatePre ( msg ) , org . hamcrest . CoreMatchers . is ( false ) )
testCoverageView ( ) { org . geoserver . catalog . Catalog catalog = new org . geoserver . catalog . impl . CatalogImpl ( ) ; org . geoserver . catalog . CatalogFactory cFactory = catalog . getFactory ( ) ; org . geoserver . catalog . CoverageInfo coverage = cFactory . createCoverage ( ) ; org . geoserver . catalog . MetadataMap metadata = coverage . getMetadata ( ) ; coverage . setName ( "test" ) ; coverage . setEnabled ( true ) ; coverage . getAlias ( ) . add ( "EPSG:4326" 1 ) ; coverage . getKeywords ( ) . add ( new org . geoserver . catalog . Keyword ( "key" ) ) ; org . geoserver . catalog . impl . MetadataLinkInfoImpl metadataLink = new org . geoserver . catalog . impl . MetadataLinkInfoImpl ( ) ; metadataLink . setAbout ( "about" ) ; coverage . getMetadataLinks ( ) . add ( metadataLink ) ; org . geoserver . catalog . impl . CoverageDimensionImpl coverageDimension = new org . geoserver . catalog . impl . CoverageDimensionImpl ( "time" ) ; coverageDimension . setNullValues ( java . util . Collections . singletonList ( new java . lang . Double ( 0 ) ) ) ; coverage . getDimensions ( ) . add ( coverageDimension ) ; coverage . getInterpolationMethods ( ) . add ( "EPSG:4326" 0 ) ; coverage . getParameters ( ) . put ( "ParameterKey" , "EPSG:4326" 6 ) ; coverage . getSupportedFormats ( ) . add ( "EPSG:4326" 4 ) ; coverage . getRequestSRS ( ) . add ( "EPSG:4326" ) ; coverage . getResponseSRS ( ) . add ( "EPSG:4326" ) ; final org . geoserver . catalog . CoverageView . InputCoverageBand band_u = new org . geoserver . catalog . CoverageView . InputCoverageBand ( "EPSG:4326" 5 , "0" ) ; final org . geoserver . catalog . CoverageView . CoverageBand outputBand_u = new org . geoserver . catalog . CoverageView . CoverageBand ( java . util . Collections . singletonList ( band_u ) , "EPSG:4326" 2 , 0 , org . geoserver . catalog . CoverageView . CompositionType . BAND_SELECT ) ; final org . geoserver . catalog . CoverageView . InputCoverageBand band_v = new org . geoserver . catalog . CoverageView . InputCoverageBand ( "v-component_of_current_surface" , "0" ) ; final org . geoserver . catalog . CoverageView . CoverageBand outputBand_v = new org . geoserver . catalog . CoverageView . CoverageBand ( java . util . Collections . singletonList ( band_v ) , "v-component_of_current_surface@0" , 1 , org . geoserver . catalog . CoverageView . CompositionType . BAND_SELECT ) ; final java . util . List < org . geoserver . catalog . CoverageView . CoverageBand > coverageBands = new java . util . ArrayList < org . geoserver . catalog . CoverageView . CoverageBand > ( 2 ) ; coverageBands . add ( outputBand_u ) ; coverageBands . add ( outputBand_v ) ; org . geoserver . catalog . CoverageView coverageView = new org . geoserver . catalog . CoverageView ( "regional_currents" , coverageBands ) ; metadata . put ( "EPSG:4326" 3 , coverageView ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; persister . save ( coverage , out ) ; org . geoserver . catalog . CoverageInfo coverage2 = persister . load ( in ( out ) , org . geoserver . catalog . CoverageInfo . class ) ; "<AssertPlaceHolder>" ; } in ( java . io . ByteArrayOutputStream ) { return new java . io . ByteArrayInputStream ( in . toByteArray ( ) ) ; }
org . junit . Assert . assertEquals ( coverage , coverage2 )
testWritableOutputStreamWithAutoCreateOnNonExistantBlob ( ) { java . lang . String location = "gs://test-spring/test" ; com . google . cloud . storage . Storage storage = mock ( com . google . cloud . storage . Storage . class ) ; com . google . cloud . storage . BlobId blobId = com . google . cloud . storage . BlobId . of ( "test-spring" , "test" ) ; com . google . cloud . storage . Blob nonExistantBlob = mock ( com . google . cloud . storage . Blob . class ) ; when ( nonExistantBlob . exists ( ) ) . thenReturn ( false ) ; when ( storage . get ( blobId ) ) . thenReturn ( nonExistantBlob ) ; com . google . cloud . storage . BlobInfo blobInfo = com . google . cloud . storage . BlobInfo . newBuilder ( blobId ) . build ( ) ; com . google . cloud . WriteChannel writeChannel = mock ( com . google . cloud . WriteChannel . class ) ; com . google . cloud . storage . Blob blob = mock ( com . google . cloud . storage . Blob . class ) ; when ( blob . writer ( ) ) . thenReturn ( writeChannel ) ; when ( storage . create ( blobInfo ) ) . thenReturn ( blob ) ; org . springframework . cloud . gcp . storage . GoogleStorageResource resource = new org . springframework . cloud . gcp . storage . GoogleStorageResource ( storage , location ) ; org . springframework . cloud . gcp . storage . GoogleStorageResource spyResource = spy ( resource ) ; java . io . OutputStream os = spyResource . getOutputStream ( ) ; "<AssertPlaceHolder>" ; } getOutputStream ( ) { if ( isBucket ( ) ) { throw new java . lang . IllegalStateException ( ( ( "Cannot<sp>open<sp>an<sp>output<sp>stream<sp>to<sp>a<sp>bucket:<sp>'" + ( getURI ( ) ) ) + "'" ) ) ; } else { com . google . cloud . storage . Blob blob = getBlob ( ) ; if ( ( blob == null ) || ( ! ( blob . exists ( ) ) ) ) { if ( ! ( this . autoCreateFiles ) ) { throw new java . io . FileNotFoundException ( ( "The<sp>blob<sp>was<sp>not<sp>found:<sp>" + ( getURI ( ) ) ) ) ; } blob = createBlob ( ) ; } return java . nio . channels . Channels . newOutputStream ( blob . writer ( ) ) ; } }
org . junit . Assert . assertNotNull ( os )
testLogResetResetsRootLoggerIfSet ( ) { try ( org . apache . storm . utils . Time . SimulatedTime t = new org . apache . storm . utils . Time . SimulatedTime ( ) ) { long past = ( org . apache . storm . utils . Time . currentTimeMillis ( ) ) - 1000 ; java . util . TreeMap < java . lang . String , org . apache . storm . generated . LogLevel > config = new java . util . TreeMap ( ) ; config . put ( LogManager . ROOT_LOGGER_NAME , org . apache . storm . daemon . worker . LogConfigManagerTest . ll ( "DEBUG" , "WARN" , past ) ) ; java . util . concurrent . atomic . AtomicReference < java . util . TreeMap < java . lang . String , org . apache . storm . generated . LogLevel > > atomConf = new java . util . concurrent . atomic . AtomicReference ( config ) ; org . apache . storm . daemon . worker . LogConfigManager underTest = spy ( new org . apache . storm . daemon . worker . LogConfigManagerTest . LogConfigManagerUnderTest ( atomConf ) ) ; underTest . resetLogLevels ( ) ; "<AssertPlaceHolder>" ; verify ( underTest ) . setLoggerLevel ( anyObject ( ) , eq ( LogManager . ROOT_LOGGER_NAME ) , eq ( "WARN" ) ) ; } } get ( ) { return isExpired ( ) ? 0L : mem ; }
org . junit . Assert . assertEquals ( new java . util . TreeMap ( ) , atomConf . get ( ) )
testClear ( ) { java . lang . Object service = new java . lang . Object ( ) ; mockServiceReference ( service ) ; container . add ( serviceReference ) ; container . clear ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return services . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , container . size ( ) )