input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testHasIndexHashKeyEqualCondition_WhenConditionCriteriaIsEqualityOnAPropertyWhichIsNeitherAnIndexHashKeyOrAHashKeyButIsRangeKey ( ) { org . mockito . Mockito . when ( entityInformation . isGlobalIndexHashKeyProperty ( "playlistName" ) ) . thenReturn ( false ) ; criteria . withPropertyEquals ( "playlistName" , "some<sp>playlist<sp>name" , java . lang . String . class ) ; boolean hasIndexHashKeyEqualCondition = criteria . hasIndexHashKeyEqualCondition ( ) ; "<AssertPlaceHolder>" ; } hasIndexHashKeyEqualCondition ( ) { boolean hasCondition = super . hasIndexHashKeyEqualCondition ( ) ; if ( ! hasCondition ) { if ( ( ( rangeKeyAttributeValue ) != null ) && ( entityInformation . isGlobalIndexHashKeyProperty ( rangeKeyPropertyName ) ) ) { hasCondition = true ; } } return hasCondition ; } | org . junit . Assert . assertFalse ( hasIndexHashKeyEqualCondition ) |
apiUrl ( ) { uc . setApiUrl ( "some-fake-url" ) ; "<AssertPlaceHolder>" ; } getApiUrl ( ) { return prefixUrlApi ; } | org . junit . Assert . assertEquals ( "some-fake-url" , uc . getApiUrl ( ) ) |
toObjectType_BooleanTrue ( ) { "<AssertPlaceHolder>" ; } toObjectType ( java . lang . String , java . lang . Class ) { if ( com . adobe . acs . commons . util . Double . class . equals ( klass ) ) { try { return klass . cast ( java . lang . Double . parseDouble ( data ) ) ; } catch ( java . lang . NumberFormatException ex ) { return null ; } } else if ( com . adobe . acs . commons . util . Long . class . equals ( klass ) ) { try { return klass . cast ( java . lang . Long . parseLong ( data ) ) ; } catch ( java . lang . NumberFormatException ex ) { return null ; } } else if ( com . adobe . acs . commons . util . Integer . class . equals ( klass ) ) { try { return klass . cast ( java . lang . Long . parseLong ( data ) ) ; } catch ( java . lang . NumberFormatException ex ) { return null ; } } else if ( org . apache . commons . lang . StringUtils . equalsIgnoreCase ( "true" , data ) ) { return klass . cast ( Boolean . TRUE ) ; } else if ( org . apache . commons . lang . StringUtils . equalsIgnoreCase ( "false" , data ) ) { return klass . cast ( Boolean . FALSE ) ; } else if ( com . adobe . acs . commons . util . TypeUtil . JSON_DATE . matcher ( data ) . matches ( ) ) { return klass . cast ( org . joda . time . format . ISODateTimeFormat . dateTimeParser ( ) . parseDateTime ( data ) . toDate ( ) ) ; } else { return klass . cast ( data ) ; } } | org . junit . Assert . assertEquals ( Boolean . TRUE , com . adobe . acs . commons . util . TypeUtil . toObjectType ( "true" , com . adobe . acs . commons . util . Boolean . class ) ) |
testGetFileError ( ) { when ( workspaceClient . getObject ( any ( ) , any ( ) ) ) . thenThrow ( new fr . gouv . vitam . workspace . api . exception . ContentAddressableStorageNotFoundException ( "" ) ) ; try ( final fr . gouv . vitam . worker . common . HandlerIO io = new fr . gouv . vitam . worker . core . impl . HandlerIOImpl ( workspaceClientFactory , logbookLifeCyclesClientFactory , "containerName" , "workerId" , fr . gouv . vitam . worker . core . api . HandlerIOImplTest . OBJECT_IDS ) ) { "<AssertPlaceHolder>" ; final java . util . List < fr . gouv . vitam . common . model . processing . IOParameter > in = new java . util . ArrayList ( ) ; in . add ( new fr . gouv . vitam . common . model . processing . IOParameter ( ) . setUri ( new fr . gouv . vitam . common . model . processing . ProcessingUri ( fr . gouv . vitam . common . model . processing . UriPrefix . WORKSPACE , "objectName" ) ) . setOptional ( false ) ) ; io . addInIOParameters ( in ) ; } } checkHandlerIO ( int , java . util . List ) { throw new java . lang . RuntimeException ( "Not<sp>implemented" ) ; } | org . junit . Assert . assertTrue ( io . checkHandlerIO ( 0 , new java . util . ArrayList ( ) ) ) |
testGetFcWWNN ( ) { java . lang . String nodeName = com . iwave . ext . netapp . MiscTests . netAppFacade . getFcWWNN ( ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "WWNN:<sp>" + nodeName ) ) ; } getFcWWNN ( ) { java . lang . String nodeName = null ; netapp . manage . NaElement result = server . invoke ( "fcp-node-get-name" ) ; if ( result != null ) { nodeName = result . getChildContent ( "node-name" ) ; } return nodeName ; } | org . junit . Assert . assertNotNull ( nodeName ) |
testRemoveDescriptor ( ) { deviceFlowRegistry . addMark ( key ) ; "<AssertPlaceHolder>" ; } getAllFlowDescriptors ( ) { return flowRegistry ; } | org . junit . Assert . assertEquals ( 0 , deviceFlowRegistry . getAllFlowDescriptors ( ) . size ( ) ) |
getDeviceConnectionString_return_ok_withX509 ( ) { java . lang . String deviceId = "somedevice" ; java . lang . String hostName = "aaa.bbb.ccc" ; java . lang . String nullDeviceKey = null ; java . lang . String validThumbprint = "thumbrpint" ; java . lang . String expectedDeviceConnectionString = ( ( ( "HostName=" + hostName ) + ";DeviceId=" ) + deviceId ) + ";x509=true" ; java . lang . String connectionString = ( "HostName=" + hostName ) + ";SharedAccessKeyName=XXX;SharedAccessKey=YYY" ; new tests . unit . com . microsoft . azure . sdk . iot . service . NonStrictExpectations ( ) { { iotHubConnectionString . getHostName ( ) ; result = hostName ; device . getDeviceId ( ) ; result = deviceId ; device . getPrimaryThumbprint ( ) ; result = validThumbprint ; device . getPrimaryKey ( ) ; result = nullDeviceKey ; } } ; commonExpectations ( connectionString , deviceId ) ; tests . unit . com . microsoft . azure . sdk . iot . service . RegistryManager registryManager = tests . unit . com . microsoft . azure . sdk . iot . service . RegistryManager . createFromConnectionString ( connectionString ) ; tests . unit . com . microsoft . azure . sdk . iot . service . Device returnDevice = registryManager . getDevice ( deviceId ) ; java . lang . String returnDeviceConnectionString = registryManager . getDeviceConnectionString ( returnDevice ) ; "<AssertPlaceHolder>" ; } getDeviceConnectionString ( com . microsoft . azure . sdk . iot . service . Device ) { if ( device == null ) { throw new java . lang . IllegalArgumentException ( "device<sp>cannot<sp>be<sp>null" ) ; } if ( ( com . microsoft . azure . sdk . iot . service . Tools . isNullOrEmpty ( device . getDeviceId ( ) ) ) || ( ( com . microsoft . azure . sdk . iot . service . Tools . isNullOrEmpty ( device . getPrimaryKey ( ) ) ) && ( com . microsoft . azure . sdk . iot . service . Tools . isNullOrEmpty ( device . getPrimaryThumbprint ( ) ) ) ) ) { throw new java . lang . IllegalArgumentException ( "device<sp>is<sp>not<sp>valid" ) ; } java . lang . StringBuilder stringBuilder = new java . lang . StringBuilder ( ) ; stringBuilder . append ( java . lang . String . format ( "HostName=%s;" , iotHubConnectionString . getHostName ( ) ) ) ; stringBuilder . append ( java . lang . String . format ( "DeviceId=%s;" , device . getDeviceId ( ) ) ) ; if ( ( device . getPrimaryKey ( ) ) == null ) { stringBuilder . append ( "x509=true" ) ; } else { stringBuilder . append ( java . lang . String . format ( "SharedAccessKey=%s" , device . getPrimaryKey ( ) ) ) ; } return stringBuilder . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedDeviceConnectionString , returnDeviceConnectionString ) |
testClone ( ) { java . lang . Object clone = noneCloneProcess . clone ( def1 ) ; "<AssertPlaceHolder>" ; } clone ( org . kie . workbench . common . stunner . core . graph . content . view . Point2D ) { return new org . kie . workbench . common . stunner . core . graph . content . view . Point2D ( point . getX ( ) , point . getY ( ) ) ; } | org . junit . Assert . assertEquals ( clone , def1 ) |
testVertexSetIteratorTooFar ( ) { edu . ucla . sspace . graph . DirectedMultigraph < java . lang . String > g = new edu . ucla . sspace . graph . DirectedMultigraph < java . lang . String > ( ) ; edu . ucla . sspace . graph . Set < java . lang . Integer > control = new edu . ucla . sspace . graph . HashSet < java . lang . Integer > ( ) ; for ( int i = 0 ; i < 100 ; ++ i ) { g . add ( i ) ; control . add ( i ) ; } edu . ucla . sspace . graph . Set < java . lang . Integer > vertices = g . vertices ( ) ; edu . ucla . sspace . graph . Iterator < java . lang . Integer > iter = vertices . iterator ( ) ; int i = 0 ; while ( iter . hasNext ( ) ) { i ++ ; iter . next ( ) ; } "<AssertPlaceHolder>" ; iter . next ( ) ; } size ( ) { return assignments . length ; } | org . junit . Assert . assertEquals ( vertices . size ( ) , i ) |
buildRevenueShareDetail_resellerOldXML ( ) { org . oscm . reportingservice . dao . PartnerRevenueDao sqlResult = givenReportData3 ( ) ; org . oscm . reportingservice . business . model . supplierrevenushare . RDOSupplierRevenueShareReport supplierReport = new org . oscm . reportingservice . business . SupplierRevenueShareBuilder ( java . util . Locale . ENGLISH , sqlResult . getReportData ( ) , serviceIdMap , marketplaceNameMap , serviceNameMap ) . buildSingleReport ( ) ; org . oscm . reportingservice . business . model . supplierrevenushare . RDOSupplierRevenueShareCurrency currencyUSD = supplierReport . getCurrencies ( ) . get ( 1 ) ; java . util . List < org . oscm . reportingservice . business . model . supplierrevenushare . RDORevenueShareDetail > resellerDetails = currencyUSD . getResellerRevenueShareDetails ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , resellerDetails . size ( ) ) |
parsePermissions ( ) { final java . lang . String json = "{\"permissions\":[{\"source\":\"prov1\",\"target\":\"prov1\",\"type\":\"WRITE\"},{\"source\":\"prov2\",\"target\":\"prov2\",\"type\":\"WRITE\"}]}" ; final org . sentilo . platform . common . domain . PermissionsMessage message = ( ( org . sentilo . platform . common . domain . PermissionsMessage ) ( converter . unmarshal ( json , org . sentilo . platform . common . domain . PermissionsMessage . class ) ) ) ; "<AssertPlaceHolder>" ; } getPermissions ( ) { final java . lang . String path = "catalog" ; when ( fConfig . getSourceEndpoint ( ) ) . thenReturn ( org . sentilo . agent . federation . test . service . RemotePlatformServiceImplTest . MOCK_ENDPOINT ) ; when ( fConfig . getAppClientToken ( ) ) . thenReturn ( org . sentilo . agent . federation . test . service . RemotePlatformServiceImplTest . MOCK_TOKEN ) ; remoteService . getPermissions ( fConfig ) ; verify ( remoteRestClient ) . get ( argThat ( new org . sentilo . agent . federation . test . service . RemotePlatformServiceImplTest . RequestContextMatcher ( path , org . sentilo . agent . federation . test . service . RemotePlatformServiceImplTest . MOCK_ENDPOINT , org . sentilo . agent . federation . test . service . RemotePlatformServiceImplTest . MOCK_TOKEN ) ) ) ; } | org . junit . Assert . assertTrue ( ( ( ( message . getPermissions ( ) ) != null ) && ( ( message . getPermissions ( ) . size ( ) ) == 2 ) ) ) |
should_not_accept_valid_application_file ( ) { org . w3c . dom . Element element = mock ( org . w3c . dom . Element . class ) ; when ( element . getNamespaceURI ( ) ) . thenReturn ( "invalid_namespace" ) ; org . bonitasoft . studio . ui . validator . NamespaceXMLFileValidator validator = new org . bonitasoft . studio . ui . validator . NamespaceXMLFileValidator . Builder ( "valid_namespace" ) . create ( ) ; "<AssertPlaceHolder>" ; } isValid ( java . util . Optional ) { return value . map ( ( path ) -> java . nio . file . Paths . get ( new java . io . File ( path ) . toURI ( ) ) . toFile ( ) . exists ( ) ) . orElse ( false ) ; } | org . junit . Assert . assertFalse ( validator . isValid ( element ) ) |
testIterator ( ) { org . apache . commons . math . linear . RealVector v = new org . apache . commons . math . linear . AbstractRealVectorTest . TestVectorImpl ( vec2 . clone ( ) ) ; org . apache . commons . math . linear . RealVector . Entry e ; int i = 0 ; for ( java . util . Iterator < org . apache . commons . math . linear . RealVector . Entry > it = v . iterator ( ) ; ( it . hasNext ( ) ) && ( ( e = it . next ( ) ) != null ) ; i ++ ) { "<AssertPlaceHolder>" ; } } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( vec2 [ i ] , e . getValue ( ) , 0 ) |
subPoint3DPoint3D ( ) { org . arakhne . afc . math . geometry . d3 . continuous . Point3f v1 = new org . arakhne . afc . math . geometry . d3 . continuous . Point3f ( this . random . nextDouble ( ) , this . random . nextDouble ( ) , this . random . nextDouble ( ) ) ; org . arakhne . afc . math . geometry . d3 . continuous . Point3f v2 = new org . arakhne . afc . math . geometry . d3 . continuous . Point3f ( this . random . nextDouble ( ) , this . random . nextDouble ( ) , this . random . nextDouble ( ) ) ; org . arakhne . afc . math . geometry . d3 . continuous . Vector3f temp = new org . arakhne . afc . math . geometry . d3 . continuous . Vector3f ( ) ; org . arakhne . afc . math . geometry . d3 . continuous . Point3f sum = new org . arakhne . afc . math . geometry . d3 . continuous . Point3f ( ( ( v1 . getX ( ) ) - ( v2 . getX ( ) ) ) , ( ( v1 . getY ( ) ) - ( v2 . getY ( ) ) ) , ( ( v1 . getZ ( ) ) - ( v2 . getZ ( ) ) ) ) ; temp . sub ( v1 , v2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( object instanceof org . arakhne . afc . vmutil . MACNumber ) ) { return false ; } final byte [ ] bao = ( ( org . arakhne . afc . vmutil . MACNumber ) ( object ) ) . bytes ; if ( ( bao . length ) != ( this . bytes . length ) ) { return false ; } for ( int i = 0 ; i < ( bao . length ) ; ++ i ) { if ( ( bao [ i ] ) != ( this . bytes [ i ] ) ) { return false ; } } return true ; } | org . junit . Assert . assertTrue ( sum . equals ( temp ) ) |
testBulkPushLimit ( ) { com . devwebsphere . wxsutils . WXSMapOfLists < java . lang . String , java . lang . String > map = com . devwebsphere . wxsutils . TestClientAPIs . utils . getMapOfLists ( "BigListLimit" ) ; java . lang . String key = "BULK_LIST" ; "<AssertPlaceHolder>" ; java . util . List < java . lang . String > items = new java . util . ArrayList < java . lang . String > ( ) ; items . add ( "0" ) ; items . add ( "1" ) ; items . add ( "2" ) ; int previousLimit = com . devwebsphere . wxsutils . wxsmap . BigListPushAgent . LIMIT ; try { com . devwebsphere . wxsutils . wxsmap . BigListPushAgent . LIMIT = 1 ; map . lpush ( key , items ) ; org . junit . Assert . fail ( "Limit<sp>not<sp>engaged" ) ; } catch ( com . ibm . websphere . objectgrid . ObjectGridRuntimeException e ) { } finally { com . devwebsphere . wxsutils . wxsmap . BigListPushAgent . LIMIT = previousLimit ; } } llen ( K ) { com . devwebsphere . wxsutils . jmx . listset . WXSMapOfListsMBeanImpl mbean = com . devwebsphere . wxsutils . wxsmap . WXSMapOfListsImpl . wxsMapOfListsMBeanManager . getLazyRef ( ) . getBean ( grid . getName ( ) , mapName ) ; long start = java . lang . System . nanoTime ( ) ; try { com . devwebsphere . wxsutils . wxsmap . ListLenAgent < V > a = new com . devwebsphere . wxsutils . wxsmap . ListLenAgent < V > ( ) ; java . util . Map < K , java . lang . Object > rc = tls . getMap ( mapName ) . getAgentManager ( ) . callMapAgent ( a , java . util . Collections . singletonList ( key ) ) ; java . lang . Object rcV = rc . get ( key ) ; if ( ( rcV != null ) && ( rcV instanceof com . ibm . websphere . objectgrid . datagrid . EntryErrorValue ) ) { com . devwebsphere . wxsutils . wxsmap . WXSMapOfListsImpl . logger . log ( Level . SEVERE , "put(K,V)<sp>failed" ) ; throw new com . ibm . websphere . objectgrid . ObjectGridRuntimeException ( rcV . toString ( ) ) ; } java . lang . Integer size = ( ( java . lang . Integer ) ( rcV ) ) ; mbean . getLenMetrics ( ) . logTime ( ( ( java . lang . System . nanoTime ( ) ) - start ) ) ; return size ; } catch ( java . lang . Exception e ) { com . devwebsphere . wxsutils . wxsmap . WXSMapOfListsImpl . logger . log ( Level . SEVERE , "Exception" , e ) ; mbean . getLenMetrics ( ) . logException ( e ) ; throw new com . ibm . websphere . objectgrid . ObjectGridRuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( 0 , map . llen ( key ) ) |
testImgToTensorDirectTyped ( ) { "<AssertPlaceHolder>" ; final long [ ] dims = new long [ ] { 20 , 10 , 3 } ; final int n = dims . length ; testImg2TensorDirectTyped ( new net . imglib2 . img . array . ArrayImgFactory < net . imglib2 . type . numeric . integer . ByteType > ( ) . create ( dims , new net . imglib2 . type . numeric . integer . ByteType ( ) ) , n , dims , org . tensorflow . types . UInt8 . class , ( i ) -> net . imagej . tensorflow . Tensors . tensorByteDirect ( i ) ) ; testImg2TensorDirectTyped ( new net . imglib2 . img . array . ArrayImgFactory < net . imglib2 . type . numeric . real . DoubleType > ( ) . create ( dims , new net . imglib2 . type . numeric . real . DoubleType ( ) ) , n , dims , net . imagej . tensorflow . Double . class , ( i ) -> net . imagej . tensorflow . Tensors . tensorDoubleDirect ( i ) ) ; testImg2TensorDirectTyped ( new net . imglib2 . img . array . ArrayImgFactory < net . imglib2 . type . numeric . real . FloatType > ( ) . create ( dims , new net . imglib2 . type . numeric . real . FloatType ( ) ) , n , dims , net . imagej . tensorflow . Float . class , ( i ) -> net . imagej . tensorflow . Tensors . tensorFloatDirect ( i ) ) ; testImg2TensorDirectTyped ( new net . imglib2 . img . array . ArrayImgFactory < net . imglib2 . type . numeric . integer . IntType > ( ) . create ( dims , new net . imglib2 . type . numeric . integer . IntType ( ) ) , n , dims , java . lang . Integer . class , ( i ) -> net . imagej . tensorflow . Tensors . tensorIntDirect ( i ) ) ; testImg2TensorDirectTyped ( new net . imglib2 . img . array . ArrayImgFactory < net . imglib2 . type . numeric . integer . LongType > ( ) . create ( dims , new net . imglib2 . type . numeric . integer . LongType ( ) ) , n , dims , net . imagej . tensorflow . Long . class , ( i ) -> net . imagej . tensorflow . Tensors . tensorLongDirect ( i ) ) ; } | org . junit . Assert . assertEquals ( 1 , 1 ) |
testUpdateScrollBarOnClearAll ( ) { tree . setSize ( 100 , 100 ) ; org . eclipse . swt . widgets . TreeItem item = new org . eclipse . swt . widgets . TreeItem ( tree , org . eclipse . swt . SWT . NONE ) ; item . setText ( "Very<sp>long<sp>long<sp>long<sp>long<sp>long<sp>long<sp>long<sp>long<sp>text" ) ; tree . clearAll ( true ) ; "<AssertPlaceHolder>" ; } hasHScrollBar ( ) { return hasHScrollBar ; } | org . junit . Assert . assertFalse ( tree . hasHScrollBar ( ) ) |
test_executeTask_ValidHost_NoBoardMapping ( ) { com . vmware . vrack . hms . task . oob . ipmi . AcpiPowerStateTaskTest . logger . info ( "TS:<sp>AcpiPowerStateTaskTest:<sp>test_executeTask_ValidHost_NoBoardMapping" ) ; com . vmware . vrack . hms . common . notification . TaskResponse taskResponse = getTaskResponse ( ) ; com . vmware . vrack . hms . task . oob . ipmi . AcpiPowerStateTask acpiPowerStateTask = new com . vmware . vrack . hms . task . oob . ipmi . AcpiPowerStateTask ( taskResponse ) ; acpiPowerStateTask . executeTask ( ) ; com . vmware . vrack . hms . common . servernodes . api . ServerNode node = ( ( com . vmware . vrack . hms . common . servernodes . api . ServerNode ) ( taskResponse . getNode ( ) ) ) ; "<AssertPlaceHolder>" ; } getAcpiPowerState ( ) { return acpiPowerState ; } | org . junit . Assert . assertNotNull ( node . getAcpiPowerState ( ) ) |
sendMessageAndGetDeliveryHashReturnsNull ( ) { tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceAuthenticationX509 auth = new tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceAuthenticationX509 ( mockDeviceClientConfig ) ; tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsSendReturnValue result = tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . Deencapsulation . invoke ( auth , "sendMessageAndGetDeliveryHash" , new java . lang . Class [ ] { com . microsoft . azure . sdk . iot . device . MessageType . class , byte [ ] . class , int . class , int . class , byte [ ] . class } , null , null , 0 , 0 , null ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNull ( result ) |
testCustomOrdering ( ) { java . util . LinkedHashSet < org . apache . tomcat . util . net . jsse . openssl . Cipher > result = org . apache . tomcat . util . net . jsse . openssl . OpenSSLCipherConfigurationParser . parse ( ( "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:" + "DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DES-CBC3-SHA" ) ) ; java . util . LinkedHashSet < org . apache . tomcat . util . net . jsse . openssl . Cipher > expected = new java . util . LinkedHashSet ( ) ; expected . add ( Cipher . TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 ) ; expected . add ( Cipher . TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA ) ; expected . add ( Cipher . TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA ) ; expected . add ( Cipher . TLS_DHE_RSA_WITH_AES_256_CBC_SHA ) ; expected . add ( Cipher . TLS_DHE_RSA_WITH_AES_128_CBC_SHA ) ; expected . add ( Cipher . TLS_RSA_WITH_3DES_EDE_CBC_SHA ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuffer buf = new java . lang . StringBuffer ( org . apache . tomcat . jdbc . pool . interceptor . StatementDecoratorInterceptor . StatementProxy . class . getName ( ) ) ; buf . append ( "[Proxy=" ) ; buf . append ( java . lang . System . identityHashCode ( this ) ) ; buf . append ( ";<sp>Sql=" ) ; buf . append ( getSql ( ) ) ; buf . append ( ";<sp>Delegate=" ) ; buf . append ( getDelegate ( ) ) ; buf . append ( ";<sp>Connection=" ) ; buf . append ( getConnection ( ) ) ; buf . append ( "]" ) ; return buf . toString ( ) ; } | org . junit . Assert . assertEquals ( expected . toString ( ) , result . toString ( ) ) |
testGather ( ) { org . nd4j . autodiff . opvalidation . List < org . nd4j . linalg . api . ndarray . INDArray > inArrs = new org . nd4j . autodiff . opvalidation . ArrayList ( ) ; org . nd4j . autodiff . opvalidation . List < java . lang . Integer > axis = new org . nd4j . autodiff . opvalidation . ArrayList ( ) ; org . nd4j . autodiff . opvalidation . List < org . nd4j . linalg . api . ndarray . INDArray > indices = new org . nd4j . autodiff . opvalidation . ArrayList ( ) ; inArrs . add ( org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 48 , 48 ) . reshape ( 2 , 4 , 3 , 2 ) ) ; indices . add ( org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 0 } ) . castTo ( DataType . INT ) ) ; axis . add ( ( - 2 ) ) ; for ( int i = 0 ; i < ( inArrs . size ( ) ) ; i ++ ) { org . nd4j . linalg . api . ndarray . INDArray in = inArrs . get ( i ) ; org . nd4j . linalg . api . ndarray . INDArray idx = indices . get ( i ) ; int a = axis . get ( i ) ; int aNorm = ( a >= 0 ) ? a : a + ( in . rank ( ) ) ; org . nd4j . linalg . api . ndarray . INDArray expOut ; if ( ( idx . rank ( ) ) == 0 ) { org . nd4j . linalg . indexing . INDArrayIndex [ ] get = new org . nd4j . linalg . indexing . INDArrayIndex [ in . rank ( ) ] ; for ( int j = 0 ; j < aNorm ; j ++ ) { get [ j ] = org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ; } get [ aNorm ] = org . nd4j . linalg . indexing . NDArrayIndex . point ( idx . getInt ( 0 ) ) ; for ( int j = aNorm + 1 ; j < ( in . rank ( ) ) ; j ++ ) { get [ j ] = org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ; } expOut = in . get ( get ) ; } else if ( ( idx . rank ( ) ) == 1 ) { long [ ] shape = in . shape ( ) . clone ( ) ; shape [ aNorm ] = idx . length ( ) ; expOut = org . nd4j . linalg . factory . Nd4j . create ( shape ) ; org . nd4j . linalg . indexing . INDArrayIndex [ ] get = new org . nd4j . linalg . indexing . INDArrayIndex [ in . rank ( ) ] ; org . nd4j . linalg . indexing . INDArrayIndex [ ] put = new org . nd4j . linalg . indexing . INDArrayIndex [ in . rank ( ) ] ; for ( int j = 0 ; j < aNorm ; j ++ ) { get [ j ] = org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ; put [ j ] = org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ; } for ( int j = aNorm + 1 ; j < ( in . rank ( ) ) ; j ++ ) { get [ j ] = org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ; put [ j ] = org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ; } for ( int j = 0 ; j < ( idx . length ( ) ) ; j ++ ) { get [ aNorm ] = org . nd4j . linalg . indexing . NDArrayIndex . point ( idx . getInt ( j ) ) ; put [ aNorm ] = org . nd4j . linalg . indexing . NDArrayIndex . point ( j ) ; expOut . put ( put , in . get ( get ) ) ; } } else { throw new java . lang . RuntimeException ( "Rank<sp>2+<sp>tests<sp>not<sp>yet<sp>implemented" ) ; } org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . SDVariable sdIn = sd . var ( "in" , in ) ; org . nd4j . autodiff . samediff . SDVariable sdIdx = sd . constant ( "idx" , idx ) ; org . nd4j . autodiff . samediff . SDVariable gather = sd . gather ( sdIn , sdIdx , a ) ; org . nd4j . autodiff . samediff . SDVariable loss = gather . std ( true ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( new org . nd4j . autodiff . validation . TestCase ( sd ) . expected ( gather , expOut ) . gradCheckSkipVariables ( "idx" ) ) ; "<AssertPlaceHolder>" ; } } gradCheckSkipVariables ( java . lang . String [ ] ) { if ( ( gradCheckSkipVariables ) == null ) gradCheckSkipVariables = new org . nd4j . autodiff . validation . LinkedHashSet ( ) ; org . nd4j . autodiff . validation . Collections . addAll ( gradCheckSkipVariables , toSkip ) ; return this ; } | org . junit . Assert . assertNull ( err ) |
testNegAllValuesFrom ( ) { org . semanticweb . owlapi . model . OWLObjectProperty property = ObjectProperty ( iri ( "p" ) ) ; org . semanticweb . owlapi . model . OWLClass filler = Class ( iri ( "A" ) ) ; org . semanticweb . owlapi . model . OWLObjectAllValuesFrom allValuesFrom = ObjectAllValuesFrom ( property , filler ) ; org . semanticweb . owlapi . model . OWLClassExpression cls = allValuesFrom . getObjectComplementOf ( ) ; org . semanticweb . owlapi . model . OWLClassExpression nnf = ObjectSomeValuesFrom ( property , filler . getObjectComplementOf ( ) ) ; "<AssertPlaceHolder>" ; } getNNF ( ) { return this ; } | org . junit . Assert . assertEquals ( cls . getNNF ( ) , nnf ) |
testGetAllAttributes ( ) { org . hisp . dhis . attribute . Attribute attribute1 = new org . hisp . dhis . attribute . Attribute ( ) ; attribute1 . setValueType ( ValueType . TEXT ) ; attribute1 . setName ( "attribute1" ) ; org . hisp . dhis . attribute . Attribute attribute2 = new org . hisp . dhis . attribute . Attribute ( ) ; attribute2 . setValueType ( ValueType . TEXT ) ; attribute2 . setName ( "attribute2" ) ; attributeService . addAttribute ( attribute1 ) ; attributeService . addAttribute ( attribute2 ) ; "<AssertPlaceHolder>" ; } getAllAttributes ( ) { return new java . util . ArrayList ( attributeStore . getAll ( ) ) ; } | org . junit . Assert . assertEquals ( 2 , attributeService . getAllAttributes ( ) . size ( ) ) |
testListBySearchOICR ( ) { java . util . List < uk . ac . bbsrc . tgac . miso . core . data . Study > runs = dao . listBySearch ( "OICR" ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , runs . size ( ) ) |
testRemoveMaterialCategory ( ) { org . libreplan . business . materials . entities . MaterialCategory materialCategory = createValidMaterialCategory ( ) ; materialCategoryDAO . save ( materialCategory ) ; materialCategoryDAO . remove ( materialCategory . getId ( ) ) ; "<AssertPlaceHolder>" ; } exists ( PK extends java . io . Serializable ) { return ( getSession ( ) . createCriteria ( entityClass ) . add ( org . hibernate . criterion . Restrictions . idEq ( id ) ) . setProjection ( org . hibernate . criterion . Projections . id ( ) ) . uniqueResult ( ) ) != null ; } | org . junit . Assert . assertFalse ( materialCategoryDAO . exists ( materialCategory . getId ( ) ) ) |
testGetURLsForClasspathWithSingleJAR ( ) { final java . lang . String jarFilePath = "src/test/resources/TestClassLoaderUtils/TestSuccess.jar" ; java . net . URL [ ] urls = org . apache . nifi . util . file . classloader . ClassLoaderUtils . getURLsForClasspath ( jarFilePath , null , false ) ; "<AssertPlaceHolder>" ; } getURLsForClasspath ( java . lang . String , java . io . FilenameFilter , boolean ) { return org . apache . nifi . util . file . classloader . ClassLoaderUtils . getURLsForClasspath ( ( modulePath == null ? java . util . Collections . emptySet ( ) : java . util . Collections . singleton ( modulePath ) ) , filenameFilter , suppressExceptions ) ; } | org . junit . Assert . assertEquals ( 1 , urls . length ) |
testRun_propagatesToSubProgram ( ) { org . apache . calcite . rel . RelNode node2 = org . mockito . Mockito . mock ( org . apache . calcite . rel . RelNode . class ) ; org . mockito . Mockito . doReturn ( node2 ) . when ( subProgram ) . run ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . same ( inNode ) , org . mockito . Mockito . any ( ) , org . mockito . Mockito . anyList ( ) , org . mockito . Mockito . anyList ( ) ) ; org . apache . calcite . rel . RelNode result = program . run ( planner , inNode , relTraitSet , relOptMaterializationList , relOptLatticeList ) ; "<AssertPlaceHolder>" ; } run ( org . apache . calcite . plan . RelOptPlanner , org . apache . calcite . rel . RelNode , org . apache . calcite . plan . RelTraitSet , java . util . List , java . util . List ) { for ( org . apache . calcite . tools . Program program : programs ) { relNode = program . run ( relOptPlanner , relNode , relTraitSet , relOptMaterializationList , relOptLatticeList ) ; org . apache . calcite . adapter . jdbc . programs . SequenceProgram . logger . debug ( ( ( ( "After<sp>running<sp>" + program ) + ":\n" ) + ( org . apache . calcite . plan . RelOptUtil . toString ( relNode ) ) ) ) ; } return relNode ; } | org . junit . Assert . assertSame ( node2 , result ) |
testUsernameExtractionEnvVarOverrride ( ) { java . lang . String whoami = org . apache . hadoop . registry . client . binding . RegistryUtils . getCurrentUsernameUnencoded ( "drwho" ) ; "<AssertPlaceHolder>" ; } getCurrentUsernameUnencoded ( java . lang . String ) { java . lang . String shortUserName = null ; if ( ! ( org . apache . hadoop . security . UserGroupInformation . isSecurityEnabled ( ) ) ) { shortUserName = env_hadoop_username ; } if ( org . apache . commons . lang . StringUtils . isEmpty ( shortUserName ) ) { try { shortUserName = org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) . getShortUserName ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } return shortUserName ; } | org . junit . Assert . assertEquals ( "drwho" , whoami ) |
testTimeout ( ) { com . ctrip . xpipe . netty . commands . RequestResponseCommandTest . TestCommand testCommand = new com . ctrip . xpipe . netty . commands . RequestResponseCommandTest . TestCommand ( "sleep<sp>5000\r\n" , 1000 , clientPool , scheduled , null ) ; com . ctrip . xpipe . api . command . CommandFuture < java . lang . String > future = testCommand . execute ( ) ; final java . util . concurrent . atomic . AtomicReference < com . ctrip . xpipe . api . command . CommandFuture < java . lang . String > > listenerFuture = new java . util . concurrent . atomic . AtomicReference < com . ctrip . xpipe . api . command . CommandFuture < java . lang . String > > ( null ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; future . addListener ( new com . ctrip . xpipe . api . command . CommandFutureListener < java . lang . String > ( ) { @ com . ctrip . xpipe . netty . commands . Override public void operationComplete ( com . ctrip . xpipe . api . command . CommandFuture < java . lang . String > commandFuture ) throws com . ctrip . xpipe . netty . commands . Exception { try { listenerFuture . set ( commandFuture ) ; } finally { latch . countDown ( ) ; } } } ) ; try { future . get ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . InterruptedException e ) { org . junit . Assert . fail ( ) ; } catch ( java . util . concurrent . ExecutionException e ) { if ( ! ( ( e . getCause ( ) ) instanceof com . ctrip . xpipe . command . CommandTimeoutException ) ) { org . junit . Assert . fail ( ) ; } } latch . await ( ) ; "<AssertPlaceHolder>" ; } get ( ) { await ( ) ; java . lang . Throwable cause = cause ( ) ; if ( cause == null ) { return getNow ( ) ; } if ( cause instanceof com . ctrip . xpipe . command . CancellationException ) { throw ( ( com . ctrip . xpipe . command . CancellationException ) ( cause ) ) ; } throw new com . ctrip . xpipe . command . ExecutionException ( cause ) ; } | org . junit . Assert . assertTrue ( ( ( listenerFuture . get ( ) ) != null ) ) |
testFromMethodWithoutDescriptionHasAbsentOptional ( ) { org . eclipse . jdt . core . IMethod method = mock ( org . eclipse . jdt . core . IMethod . class ) ; when ( method . getElementName ( ) ) . thenReturn ( "getFoo" ) ; org . eclipse . jdt . core . IAnnotation required = mock ( org . eclipse . jdt . core . IAnnotation . class ) ; when ( method . getAnnotation ( com . google . cloud . tools . eclipse . dataflow . core . launcher . options . PipelineOptionsNamespaces . validationRequired ( version ) ) ) . thenReturn ( required ) ; when ( required . exists ( ) ) . thenReturn ( false ) ; when ( required . getElementName ( ) ) . thenReturn ( com . google . cloud . tools . eclipse . dataflow . core . launcher . options . PipelineOptionsNamespaces . validationRequired ( version ) ) ; when ( method . getAnnotations ( ) ) . thenReturn ( new org . eclipse . jdt . core . IAnnotation [ ] { required } ) ; org . eclipse . jdt . core . IAnnotation description = mock ( org . eclipse . jdt . core . IAnnotation . class ) ; when ( description . exists ( ) ) . thenReturn ( false ) ; when ( method . getAnnotation ( com . google . cloud . tools . eclipse . dataflow . core . launcher . options . PipelineOptionsNamespaces . descriptionAnnotation ( version ) ) ) . thenReturn ( description ) ; com . google . cloud . tools . eclipse . dataflow . core . launcher . options . PipelineOptionsProperty property = com . google . cloud . tools . eclipse . dataflow . core . launcher . options . PipelineOptionsProperty . fromMethod ( method , version ) ; "<AssertPlaceHolder>" ; } getDescription ( ) { return description ; } | org . junit . Assert . assertNull ( property . getDescription ( ) ) |
model_2 ( ) { com . hp . hpl . jena . rdf . model . Model assem = com . hp . hpl . jena . util . FileManager . get ( ) . loadModel ( ( ( com . talis . hbase . rdf . test . misc . TestAssembler . dir ) + "graph-assembler.ttl" ) ) ; com . hp . hpl . jena . rdf . model . Resource x = assem . getResource ( "http://example/test#graphNamed" ) ; com . hp . hpl . jena . rdf . model . Model model = ( ( com . hp . hpl . jena . rdf . model . Model ) ( Assembler . general . open ( x ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( model ) |
testDefaultIsFollowRedirects ( ) { org . apache . shindig . gadgets . http . HttpRequest request = new org . apache . shindig . gadgets . http . HttpRequest ( org . apache . shindig . gadgets . http . HttpRequestTest . DEFAULT_URI ) ; "<AssertPlaceHolder>" ; } getFollowRedirects ( ) { return followRedirects ; } | org . junit . Assert . assertTrue ( request . getFollowRedirects ( ) ) |
testEasyUtf8 ( ) { java . lang . String input = "abcdefghijklm" ; byte [ ] bytes = software . amazon . ion . impl . PrivateUtils . utf8 ( input ) ; byte [ ] direct = input . getBytes ( "UTF-8" ) ; "<AssertPlaceHolder>" ; } getBytes ( java . io . OutputStream ) { com . amazon . ion . impl . lite . ReverseBinaryEncoder encoder = new com . amazon . ion . impl . lite . ReverseBinaryEncoder ( com . amazon . ion . impl . lite . IonDatagramLite . REVERSE_BINARY_ENCODER_INITIAL_SIZE ) ; encoder . serialize ( this ) ; return encoder . writeBytes ( out ) ; } | org . junit . Assert . assertArrayEquals ( direct , bytes ) |
testGetByteArrayDoesNotAlterMessage ( ) { org . eclipse . californium . core . coap . Request req = org . eclipse . californium . core . coap . Request . newGet ( ) ; req . setToken ( new byte [ ] { 0 } ) ; req . getOptions ( ) . setObserve ( 0 ) ; req . setDestination ( java . net . InetAddress . getLoopbackAddress ( ) ) ; serializer . getByteArray ( req ) ; "<AssertPlaceHolder>" ; } getBytes ( ) { return value . getBytes ( StandardCharsets . UTF_8 ) ; } | org . junit . Assert . assertNull ( req . getBytes ( ) ) |
testCurlyBrace ( ) { java . lang . String source = "(NP<sp>(DT<sp>an)<sp>(-LRB-<sp>-LCB-)<sp>(VBG<sp>offending)<sp>(-RRB-<sp>-RCB-)<sp>(NN<sp>country))" ; java . lang . String expected = "an<sp>{offending}<sp>country" ; edu . nyu . jet . format . PTBReader parser = new edu . nyu . jet . format . PTBReader ( ) ; edu . nyu . jet . tipster . Document doc = parser . load ( new java . io . StringReader ( source ) ) . getDocument ( ) ; "<AssertPlaceHolder>" ; } text ( ) { return text . toString ( ) ; } | org . junit . Assert . assertEquals ( ( expected + "\n" ) , doc . text ( ) ) |
colnullNullPointerException ( ) { com . fujitsu . dc . core . model . impl . es . accessor . DavNodeAccessor col = com . fujitsu . dc . core . model . impl . es . EsModel . col ( null ) ; "<AssertPlaceHolder>" ; } col ( com . fujitsu . dc . core . model . Cell ) { return new com . fujitsu . dc . core . model . impl . es . accessor . DavNodeAccessor ( com . fujitsu . dc . core . model . impl . es . EsModel . idxUser ( cell . getOwner ( ) ) , "dav" , cell . getId ( ) ) ; } | org . junit . Assert . assertNotNull ( col ) |
createEndInboundProcessing ( ) { gov . hhs . fha . nhinc . event . Event event = eventFactory . createEndInboundProcessing ( ) ; "<AssertPlaceHolder>" ; } createEndInboundProcessing ( ) { return new gov . hhs . fha . nhinc . event . responder . EndInboundProcessingEvent ( ) ; } | org . junit . Assert . assertTrue ( ( event instanceof gov . hhs . fha . nhinc . event . responder . EndInboundProcessingEvent ) ) |
createOrUpdateEnrollmentGroupSucceed ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . EnrollmentGroup ) { tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . ProvisioningServiceClient provisioningServiceClient = createClient ( ) ; new mockit . NonStrictExpectations ( ) { { mockit . Deencapsulation . invoke ( mockedEnrollmentGroupManager , "createOrUpdate" , mockedEnrollmentGroup ) ; result = mockedEnrollmentGroup ; times = 1 ; } } ; tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . EnrollmentGroup result = provisioningServiceClient . createOrUpdateEnrollmentGroup ( mockedEnrollmentGroup ) ; "<AssertPlaceHolder>" ; } createOrUpdateEnrollmentGroup ( com . microsoft . azure . sdk . iot . provisioning . service . EnrollmentGroup ) { return enrollmentGroupManager . createOrUpdate ( enrollmentGroup ) ; } | org . junit . Assert . assertNotNull ( result ) |
testConstructorParameterTypes ( ) { com . thoughtworks . qdox . model . JavaClass cls = com . thoughtworks . qdox . model . JavaConstructorTest . mock ( com . thoughtworks . qdox . model . JavaClass . class ) ; when ( cls . getFullyQualifiedName ( ) ) . thenReturn ( "a.b.Executor" ) ; D constructor = newJavaConstructor ( "Executor" ) ; setParameters ( constructor , java . util . Collections . singletonList ( newJavaParameter ( newType ( "a.b.C" ) , "param" ) ) ) ; setDeclaringClass ( constructor , cls ) ; "<AssertPlaceHolder>" ; } getParameterTypes ( ) { return getParameterTypes ( false ) ; } | org . junit . Assert . assertEquals ( "a.b.C" , constructor . getParameterTypes ( ) . get ( 0 ) . getFullyQualifiedName ( ) ) |
testAsort ( ) { logger . info ( "asort" ) ; java . lang . Double [ ] array = new com . datumbox . framework . core . common . utilities . Double [ ] { 1.1 , 1.2 , 1.3 , 1.4 , 1.0 } ; java . lang . Integer [ ] expResult = new java . lang . Integer [ ] { 4 , 0 , 1 , 2 , 3 } ; java . lang . Integer [ ] result = com . datumbox . framework . core . common . utilities . PHPMethods . < java . lang . Double > asort ( array ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertArrayEquals ( expResult , result ) |
testReadMultiple ( ) { try ( com . syncleus . ferma . tx . Tx tx = tx ( ) ) { java . lang . String etag = callETag ( ( ) -> client ( ) . findBranches ( com . gentics . mesh . core . branch . PROJECT_NAME ) ) ; "<AssertPlaceHolder>" ; callETag ( ( ) -> client ( ) . findBranches ( com . gentics . mesh . core . branch . PROJECT_NAME ) , etag , true , 304 ) ; callETag ( ( ) -> client ( ) . findBranches ( com . gentics . mesh . core . branch . PROJECT_NAME , new com . gentics . mesh . parameter . impl . PagingParametersImpl ( ) . setPage ( 2 ) ) , etag , true , 200 ) ; } } client ( ) { return client ; } | org . junit . Assert . assertNotNull ( etag ) |
shortValue ( ) { final org . jboss . msc . value . Value < java . lang . Short > value = new org . jboss . msc . value . DefaultValue < java . lang . Short > ( new org . jboss . msc . value . ImmediateValue < java . lang . Short > ( ( ( short ) ( 10 ) ) ) , new org . jboss . msc . value . ImmediateValue < java . lang . Short > ( ( ( short ) ( 0 ) ) ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return ( count ) ++ ; } | org . junit . Assert . assertEquals ( 10 , ( ( short ) ( value . getValue ( ) ) ) ) |
getBooleanTrue ( ) { final java . lang . Integer value = 1 ; final io . trane . ndbc . value . IntegerValue wrapper = new io . trane . ndbc . value . IntegerValue ( value ) ; "<AssertPlaceHolder>" ; } getBoolean ( ) { return ( get ( ) ) == 1 ; } | org . junit . Assert . assertEquals ( true , wrapper . getBoolean ( ) ) |
testMeanNumber ( ) { org . springframework . data . solr . core . query . result . SimpleStatsResult stats = new org . springframework . data . solr . core . query . result . SimpleStatsResult ( ) ; java . util . Date date = new java . util . Date ( ) ; stats . setMean ( 1L ) ; "<AssertPlaceHolder>" ; } getMeanAsDouble ( ) { return ( mean ) instanceof java . lang . Number ? ( ( java . lang . Number ) ( mean ) ) . doubleValue ( ) : null ; } | org . junit . Assert . assertEquals ( 1.0 , stats . getMeanAsDouble ( ) , 0.0 ) |
optional_long_of ( ) { java . util . OptionalLong optionalLong = java . util . OptionalLong . of ( 89 ) ; "<AssertPlaceHolder>" ; } getAsLong ( ) { return 10 ; } | org . junit . Assert . assertEquals ( 89 , optionalLong . getAsLong ( ) , 0 ) |
equals_differentValue ( ) { com . icantrap . collections . dawg . Node lhs = new com . icantrap . collections . dawg . Node ( 'x' ) ; com . icantrap . collections . dawg . Node rhs = new com . icantrap . collections . dawg . Node ( 'y' ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; com . icantrap . collections . dawg . Dawg . Result other = ( ( com . icantrap . collections . dawg . Dawg . Result ) ( obj ) ) ; return word . equals ( other . word ) ; } | org . junit . Assert . assertFalse ( lhs . equals ( rhs ) ) |
testGet ( ) { org . onlab . util . ExtendedSet < org . onlab . util . ExtendedSetTest . TestValue > set = new org . onlab . util . ExtendedSet ( com . google . common . collect . Maps . newConcurrentMap ( ) ) ; org . onlab . util . ExtendedSetTest . TestValue e1 = new org . onlab . util . ExtendedSetTest . TestValue ( "foo" , 1 ) ; set . add ( e1 ) ; org . onlab . util . ExtendedSetTest . TestValue lookupValue = new org . onlab . util . ExtendedSetTest . TestValue ( "foo" , 2 ) ; org . onlab . util . ExtendedSetTest . TestValue setEntry = set . get ( lookupValue ) ; "<AssertPlaceHolder>" ; } get ( int ) { return org . onosproject . isis . controller . IsisRouterType . LOOKUP . get ( routerTypeValue ) ; } | org . junit . Assert . assertEquals ( e1 , setEntry ) |
_shouldBeAbleToDeclareHelperMethods ( ) { final java . lang . String spec = "\r\n\t\t\tpackage<sp>bootstrap\r\n\r\n\t\t\tdescribe<sp>\"ExampleGroup\"<sp>{\r\n\t\t\t\r\n\t\t\t\tint<sp>i<sp>=<sp>0\r\n\t\t\t\r\n\t\t\t\tfact<sp>\"should<sp>be<sp>able<sp>to<sp>declare<sp>void<sp>helper<sp>methods\"{\r\n\t\t\t\t\tinc()\r\n\t\t\t\t\ti<sp>=><sp>1\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdef<sp>void<sp>inc(){\r\n\t\t\t\t\ti<sp>=<sp>i<sp>+<sp>1<sp>\r\n\t\t\t\t}<sp>\r\n\t\t\t\t\r\n\t\t\t\tfact<sp>\"should<sp>be<sp>able<sp>to<sp>declare<sp>helper<sp>methods<sp>with<sp>parameter<sp>and<sp>return<sp>type\"{\r\n\t\t\t\t\tinc2(i)<sp>=><sp>1<sp>\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfact<sp>\"should<sp>be<sp>able<sp>to<sp>use<sp>helper<sp>methods<sp>as<sp>extensions\"{\r\n\t\t\t\t\ti.inc2<sp>=><sp>1<sp>\r\n\t\t\t\t}\r\n\t\t\t\t<sp>\r\n\t\t\t\tdef<sp>int<sp>inc2(int<sp>value){\r\n\t\t\t\t\tvalue<sp>+<sp>1<sp>\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfact<sp>\"should<sp>be<sp>able<sp>to<sp>declare<sp>helper<sp>methods<sp>with<sp>inferred<sp>return<sp>type\"{\r\n\t\t\t\t\t//<sp>will<sp>not<sp>compile<sp>otherwise\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdef<sp>int<sp>inc3(){\r\n\t\t\t\t\t5\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfact<sp>\"should<sp>automatically<sp>rethrow<sp>all<sp>exceptions\"{\r\n\t\t\t\t\t//<sp>will<sp>not<sp>compile<sp>otherwise\r\n\t\t\t\t}\r\n\t\t\t\t<sp>\r\n\t\t\t\tdef<sp>inc4(){\r\n\t\t\t\t\tthrow<sp>new<sp>java.io.IOException()\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\tdescribe<sp>\"Nested<sp>Examples\"{\r\n\t\t\t\t\t\r\n\t\t\t\t\tfact<sp>\"should<sp>support<sp>extensions<sp>methods<sp>from<sp>parent<sp>example<sp>group\"{\r\n\t\t\t\t\t\ti.inc2<sp>=><sp>1<sp>\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfact<sp>\"should<sp>support<sp>extension<sp>methods<sp>from<sp>nested<sp>example<sp>group\"{\r\n\t\t\t\t\t\ti.inc5<sp>=><sp>1<sp>\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tdef<sp>inc5(int<sp>value){\r\n\t\t\t\t\t\tvalue<sp>+<sp>1<sp>\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t<sp>\r\n\t\t\t}<sp>\r\n\t\t" ; org . junit . runner . Result _execute = this . _behaviorExecutor . execute ( spec ) ; org . hamcrest . Matcher < org . junit . runner . Result > _isSuccessful = org . jnario . jnario . test . util . ResultMatchers . isSuccessful ( ) ; "<AssertPlaceHolder>" ; } isSuccessful ( ) { return org . jnario . jnario . test . util . ResultMatchers . failureCountIs ( 0 ) ; } | org . junit . Assert . < org . junit . runner . Result > assertThat ( _execute , _isSuccessful ) |
testSetGetMaxBuckets ( ) { org . apache . druid . indexer . path . GranularUnprocessedPathSpec granularUnprocessedPathSpec = new org . apache . druid . indexer . path . GranularUnprocessedPathSpec ( ) ; int maxBuckets = 5 ; granularUnprocessedPathSpec . setMaxBuckets ( maxBuckets ) ; "<AssertPlaceHolder>" ; } getMaxBuckets ( ) { return maxBuckets ; } | org . junit . Assert . assertEquals ( maxBuckets , granularUnprocessedPathSpec . getMaxBuckets ( ) ) |
testParseNegativeZ ( ) { java . lang . String source = ( ( ( "{1" + ( getDecimalCharacter ( ) ) ) + "2323;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "4343}" ; org . hipparchus . geometry . euclidean . twod . Vector2D expected = new org . hipparchus . geometry . euclidean . twod . Vector2D ( 1.2323 , 1.4343 ) ; org . hipparchus . geometry . euclidean . twod . Vector2D actual = vector2DFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . hipparchus . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . hipparchus . exception . MathIllegalStateException ( org . hipparchus . exception . LocalizedCoreFormats . CANNOT_PARSE_AS_TYPE , source , parsePosition . getErrorIndex ( ) , org . hipparchus . geometry . euclidean . twod . Vector2D . class ) ; } return result ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetCreationTime ( ) { long start = java . lang . System . currentTimeMillis ( ) ; java . lang . Thread . sleep ( 100 ) ; java . lang . String path = "/a" ; _client . createPersistent ( path ) ; java . lang . Thread . sleep ( 100 ) ; long end = java . lang . System . currentTimeMillis ( ) ; long creationTime = _client . getCreationTime ( path ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( ( ( start < creationTime ) && ( end > creationTime ) ) ) |
testTritium ( ) { java . lang . String filename = "data/mdl/chemblMolregno7039.mol" ; java . io . InputStream ins = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; org . openscience . cdk . io . MDLV2000Reader reader = new org . openscience . cdk . io . MDLV2000Reader ( ins ) ; org . openscience . cdk . interfaces . IAtomContainer molecule = new org . openscience . cdk . AtomContainer ( ) ; molecule = reader . read ( molecule ) ; reader . close ( ) ; int tritiumCount = 0 ; for ( org . openscience . cdk . interfaces . IAtom atom : molecule . atoms ( ) ) if ( ( ( atom . getSymbol ( ) . equals ( "H" ) ) && ( ( atom . getMassNumber ( ) ) != null ) ) && ( ( atom . getMassNumber ( ) ) == 3 ) ) tritiumCount ++ ; "<AssertPlaceHolder>" ; } getMassNumber ( ) { return this . massNumber ; } | org . junit . Assert . assertEquals ( 1 , tritiumCount ) |
mountAlternateUfs ( ) { java . lang . String alternateUfsRoot = createAlternateUfs ( ) ; try { java . lang . String filePath = alluxio . util . io . PathUtils . concatPath ( alternateUfsRoot , "file1" ) ; alluxio . util . UnderFileSystemUtils . touch ( mUfs , filePath ) ; mFileSystem . mount ( new alluxio . AlluxioURI ( "/d1" ) , new alluxio . AlluxioURI ( alternateUfsRoot ) ) ; "<AssertPlaceHolder>" ; } finally { destroyAlternateUfs ( alternateUfsRoot ) ; } } listStatus ( java . lang . String ) { org . apache . hadoop . fs . FileStatus [ ] files = listStatusInternal ( path ) ; if ( files == null ) { return null ; } alluxio . underfs . UfsStatus [ ] rtn = new alluxio . underfs . UfsStatus [ files . length ] ; int i = 0 ; for ( org . apache . hadoop . fs . FileStatus status : files ) { alluxio . underfs . UfsStatus retStatus ; if ( ! ( status . isDir ( ) ) ) { java . lang . String contentHash = alluxio . util . UnderFileSystemUtils . approximateContentHash ( status . getLen ( ) , status . getModificationTime ( ) ) ; retStatus = new alluxio . underfs . UfsFileStatus ( status . getPath ( ) . getName ( ) , contentHash , status . getLen ( ) , status . getModificationTime ( ) , status . getOwner ( ) , status . getGroup ( ) , status . getPermission ( ) . toShort ( ) ) ; } else { retStatus = new alluxio . underfs . UfsDirectoryStatus ( status . getPath ( ) . getName ( ) , status . getOwner ( ) , status . getGroup ( ) , status . getPermission ( ) . toShort ( ) , status . getModificationTime ( ) ) ; } rtn [ ( i ++ ) ] = retStatus ; } return rtn ; } | org . junit . Assert . assertEquals ( "file1" , mFileSystem . listStatus ( new alluxio . AlluxioURI ( "/d1" ) ) . get ( 0 ) . getName ( ) ) |
testPutGetMultipleModifiesMultipleClients ( ) { int conurrencyFactor = ( org . hive2hive . core . network . data . vdht . VersionManagerTest . random . nextInt ( 2 ) ) + 2 ; java . lang . String locationKey = randomString ( ) ; java . lang . String contentKey = randomString ( ) ; java . util . ArrayList < org . hive2hive . core . network . NetworkManager > nodes = new java . util . ArrayList < org . hive2hive . core . network . NetworkManager > ( conurrencyFactor ) ; java . util . ArrayList < org . hive2hive . core . network . data . vdht . VersionManager < org . hive2hive . core . H2HTestData > > versionManagers = new java . util . ArrayList < org . hive2hive . core . network . data . vdht . VersionManager < org . hive2hive . core . H2HTestData > > ( conurrencyFactor ) ; for ( int i = 0 ; i < conurrencyFactor ; i ++ ) { org . hive2hive . core . network . NetworkManager node = org . hive2hive . core . utils . NetworkTestUtil . getRandomNode ( org . hive2hive . core . network . data . vdht . VersionManagerTest . network ) ; nodes . add ( node ) ; org . hive2hive . core . network . data . vdht . VersionManager < org . hive2hive . core . H2HTestData > versionManager = new org . hive2hive . core . network . data . vdht . VersionManager < org . hive2hive . core . H2HTestData > ( node . getDataManager ( ) , locationKey , contentKey ) ; versionManagers . add ( versionManager ) ; } org . hive2hive . core . H2HTestData initialVersion = new org . hive2hive . core . H2HTestData ( randomString ( ) ) ; java . util . ArrayList < java . lang . String > versions = new java . util . ArrayList < java . lang . String > ( ) ; versions . add ( initialVersion . getTestString ( ) ) ; versionManagers . get ( 0 ) . put ( initialVersion , org . hive2hive . core . network . data . vdht . VersionManagerTest . protectionKeys ) ; for ( int i = 1 ; i < 10 ; i ++ ) { int puttingClient = org . hive2hive . core . network . data . vdht . VersionManagerTest . random . nextInt ( conurrencyFactor ) ; org . hive2hive . core . H2HTestData version = versionManagers . get ( puttingClient ) . get ( ) ; "<AssertPlaceHolder>" ; version . setTestString ( randomString ( ) ) ; versions . add ( version . getTestString ( ) ) ; versionManagers . get ( puttingClient ) . put ( version , org . hive2hive . core . network . data . vdht . VersionManagerTest . protectionKeys ) ; } } get ( org . hive2hive . core . network . data . parameters . IParameters ) { net . tomp2p . dht . FutureGet futureGet = getUnblocked ( parameters ) ; org . hive2hive . core . network . data . futures . FutureGetListener listener = new org . hive2hive . core . network . data . futures . FutureGetListener ( parameters , serializer ) ; futureGet . addListener ( listener ) ; return listener . awaitAndGet ( ) ; } | org . junit . Assert . assertEquals ( versions . get ( ( i - 1 ) ) , version . getTestString ( ) ) |
testSkippedAlertWithNoCurrentAlert ( ) { java . lang . String definitionName = ( org . apache . ambari . server . state . alerts . AlertReceivedListenerTest . ALERT_DEFINITION ) + "1" ; java . lang . String serviceName = "HDFS" ; java . lang . String componentName = "NAMENODE" ; org . apache . ambari . server . state . Alert alert = new org . apache . ambari . server . state . Alert ( definitionName , null , serviceName , componentName , org . apache . ambari . server . state . alerts . AlertReceivedListenerTest . HOST1 , org . apache . ambari . server . state . AlertState . SKIPPED ) ; alert . setClusterId ( m_cluster . getClusterId ( ) ) ; alert . setLabel ( org . apache . ambari . server . state . alerts . AlertReceivedListenerTest . ALERT_LABEL ) ; alert . setText ( ( ( ( serviceName + "<sp>" ) + componentName ) + "<sp>is<sp>OK" ) ) ; alert . setTimestamp ( 1L ) ; org . apache . ambari . server . events . listeners . alerts . AlertReceivedListener listener = m_injector . getInstance ( org . apache . ambari . server . events . listeners . alerts . AlertReceivedListener . class ) ; org . apache . ambari . server . events . AlertReceivedEvent event = new org . apache . ambari . server . events . AlertReceivedEvent ( m_cluster . getClusterId ( ) , alert ) ; listener . onAlertEvent ( event ) ; java . util . List < org . apache . ambari . server . orm . entities . AlertCurrentEntity > allCurrent = m_dao . findCurrent ( ) ; "<AssertPlaceHolder>" ; } size ( ) { java . util . Set < java . lang . String > nodes = new java . util . HashSet < java . lang . String > ( ) ; for ( org . apache . ambari . eventdb . model . WorkflowDag . WorkflowDagEntry entry : entries ) { nodes . add ( entry . getSource ( ) ) ; nodes . addAll ( entry . getTargets ( ) ) ; } return nodes . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , allCurrent . size ( ) ) |
warningMessageTest ( ) { boolean warningFound = false ; try ( final java . io . BufferedReader reader = java . nio . file . Files . newBufferedReader ( org . jboss . as . test . integration . logging . profiles . NonExistingProfileTestCase . loggingTestLog , StandardCharsets . UTF_8 ) ) { java . lang . String line ; while ( ( line = reader . readLine ( ) ) != null ) { if ( line . contains ( "non-existing-profile" ) ) { warningFound = true ; break ; } } } "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return registrations . containsKey ( host ) ; } | org . junit . Assert . assertTrue ( warningFound ) |
isNeverEnding ( ) { org . optaplanner . core . impl . heuristic . selector . entity . EntitySelector childEntitySelector = org . optaplanner . core . impl . heuristic . selector . SelectorTestUtils . mockEntitySelector ( org . optaplanner . core . impl . testdata . domain . TestdataEntity . class ) ; org . optaplanner . core . impl . heuristic . selector . entity . EntitySelector entitySelector = new org . optaplanner . core . impl . heuristic . selector . entity . decorator . ProbabilityEntitySelector ( childEntitySelector , org . optaplanner . core . config . heuristic . selector . common . SelectionCacheType . STEP , null ) ; "<AssertPlaceHolder>" ; } isNeverEnding ( ) { return valueMimicRecorder . isNeverEnding ( ) ; } | org . junit . Assert . assertTrue ( entitySelector . isNeverEnding ( ) ) |
testOIDUniquness ( ) { for ( java . lang . String table : new java . lang . String [ ] { "pg_type" , "pg_attribute" , "pg_namespace" , "pg_index" } ) { execute ( ( "select<sp>count(distinct<sp>oid),<sp>count(*)<sp>from<sp>" + table ) ) ; internalResultSet . next ( ) ; "<AssertPlaceHolder>" ; } } getInt ( java . lang . String ) { return getInt ( findColumn ( columnName ) ) ; } | org . junit . Assert . assertEquals ( internalResultSet . getInt ( 2 ) , internalResultSet . getInt ( 1 ) ) |
testInputValidatorSimpleWithWhere ( ) { java . lang . String userInput = "\"bvv:gmd_ex\"<sp>WHERE<sp>bvv:objid=\'DEBYBDLMjK0001Ia\'" ; boolean result = controller . validateEcqlUserInput ( userInput , false ) ; "<AssertPlaceHolder>" ; } validateEcqlUserInput ( java . lang . String , boolean ) { if ( overallQueries ) { java . lang . String [ ] userInputLines = userInput . split ( "\n" ) ; for ( java . lang . String userInputLine : userInputLines ) { boolean lineContainsNoWhere = ! ( userInputLine . toLowerCase ( ) . contains ( "where" ) ) ; if ( lineContainsNoWhere ) { setStatusTextUI ( de . bayern . gdi . utils . I18n . format ( "status.sql.validation.error.overall.where" ) ) ; return false ; } boolean lineContainsSupportedFeatureType = featureTypeWithNameExists ( userInputLine ) ; if ( ! lineContainsSupportedFeatureType ) { setStatusTextUI ( de . bayern . gdi . utils . I18n . format ( "status.sql.validation.error.overall.featureTypes" ) ) ; return false ; } } } else { boolean filterContainsWhere = userInput . toLowerCase ( ) . contains ( "where" ) ; if ( filterContainsWhere ) { setStatusTextUI ( de . bayern . gdi . utils . I18n . format ( "status.sql.validation.error.simple.where" ) ) ; return false ; } boolean filterContiansLineBreak = userInput . toLowerCase ( ) . contains ( "\n" ) ; if ( filterContiansLineBreak ) { setStatusTextUI ( de . bayern . gdi . utils . I18n . format ( "status.sql.validation.error.simple.lineBreak" ) ) ; return false ; } } return true ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) ) |
testBuildGarage ( ) { com . baidu . unbiz . fluentvalidator . demo . dto . Garage garage = getValidGarage ( ) ; com . baidu . unbiz . fluentvalidator . ComplexResult result = garageService . buildGarage ( garage ) ; System . out . println ( result ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return isSuccess ; } | org . junit . Assert . assertThat ( result . isSuccess ( ) , org . hamcrest . core . Is . is ( true ) ) |
testGetValueNormal ( ) { new mockit . Expectations ( ) { { request . getParameter ( "name" ) ; result = "value" ; } } ; org . apache . servicecomb . common . rest . codec . param . ParamValueProcessor processor = createProcessor ( "name" , java . lang . String . class , "multi" ) ; java . lang . Object value = processor . getValue ( request ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . Object [ ] ) { return ( ( T ) ( args [ paramIndex ] ) ) ; } | org . junit . Assert . assertEquals ( "value" , value ) |
testSetCommunityId ( ) { try { gov . hhs . fha . nhinc . connectmgr . ConnectionManagerCache connectionManager = createConnectionManager ( ) ; org . uddi . api_v3 . BusinessEntity businessEntity = connectionManager . getBusinessEntity ( gov . hhs . fha . nhinc . connectmgr . HCID_1 ) ; gov . hhs . fha . nhinc . connectmgr . ConnectionManagerCacheHelper helper = new gov . hhs . fha . nhinc . connectmgr . ConnectionManagerCacheHelper ( ) ; java . lang . String HCID_3 = "3.3" ; connectionManager . setCommunityId ( businessEntity , HCID_3 ) ; java . lang . String newHCID = helper . getCommunityId ( businessEntity ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Throwable t ) { t . printStackTrace ( ) ; org . junit . Assert . fail ( ( "Error<sp>running<sp>testSetCommunityId<sp>test:<sp>" + ( t . getMessage ( ) ) ) ) ; } } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof gov . hhs . fha . nhinc . mpilib . Identifier ) ) { return false ; } gov . hhs . fha . nhinc . mpilib . Identifier rhs = ( ( gov . hhs . fha . nhinc . mpilib . Identifier ) ( obj ) ) ; if ( ( ( ( gov . hhs . fha . nhinc . nhinclib . NullChecker . isNullish ( this . getId ( ) ) ) || ( ( this . getOrganizationId ( ) ) == null ) ) || ( gov . hhs . fha . nhinc . nhinclib . NullChecker . isNullish ( rhs . getId ( ) ) ) ) || ( ( rhs . getOrganizationId ( ) ) == null ) ) { return false ; } return ( this . getId ( ) . contentEquals ( rhs . getId ( ) ) ) && ( this . getOrganizationId ( ) . contentEquals ( rhs . getOrganizationId ( ) ) ) ; } | org . junit . Assert . assertTrue ( newHCID . equals ( HCID_3 ) ) |
testClampSectorWithNullSource ( ) { gov . nasa . worldwind . geom . Sector source = null ; gov . nasa . worldwind . geom . Sector extents = new gov . nasa . worldwind . geom . Sector ( gov . nasa . worldwind . geom . Angle . NEG90 , gov . nasa . worldwind . geom . Angle . POS90 , gov . nasa . worldwind . geom . Angle . NEG90 , gov . nasa . worldwind . geom . Angle . POS90 ) ; gov . nasa . worldwind . geom . Sector result = au . gov . ga . worldwind . common . util . Util . clampSector ( source , extents ) ; "<AssertPlaceHolder>" ; } clampSector ( gov . nasa . worldwind . geom . Sector , gov . nasa . worldwind . geom . Sector ) { if ( ( source == null ) || ( extents == null ) ) { return source ; } double minLat = au . gov . ga . worldwind . common . util . Util . clamp ( source . getMinLatitude ( ) . degrees , extents . getMinLatitude ( ) . degrees , extents . getMaxLatitude ( ) . degrees ) ; double maxLat = au . gov . ga . worldwind . common . util . Util . clamp ( source . getMaxLatitude ( ) . degrees , extents . getMinLatitude ( ) . degrees , extents . getMaxLatitude ( ) . degrees ) ; double minLon = au . gov . ga . worldwind . common . util . Util . clamp ( source . getMinLongitude ( ) . degrees , extents . getMinLongitude ( ) . degrees , extents . getMaxLongitude ( ) . degrees ) ; double maxLon = au . gov . ga . worldwind . common . util . Util . clamp ( source . getMaxLongitude ( ) . degrees , extents . getMinLongitude ( ) . degrees , extents . getMaxLongitude ( ) . degrees ) ; return gov . nasa . worldwind . geom . Sector . fromDegrees ( minLat , maxLat , minLon , maxLon ) ; } | org . junit . Assert . assertEquals ( null , result ) |
testConvertReplyToManyDocs ( ) { final java . util . List < com . allanbank . mongodb . bson . Document > docs = java . util . Arrays . asList ( com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . addInteger ( "ok" , 1 ) . addInteger ( "n" , 44 ) . build ( ) , com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . build ( ) ) ; final com . allanbank . mongodb . client . message . Reply reply = new com . allanbank . mongodb . client . message . Reply ( 0 , 0 , 0 , docs , false , false , false , true ) ; final com . allanbank . mongodb . Callback < java . lang . Integer > mockCallback = createMock ( com . allanbank . mongodb . Callback . class ) ; replay ( mockCallback ) ; final com . allanbank . mongodb . client . callback . ReplyIntegerCallback callback = new com . allanbank . mongodb . client . callback . ReplyIntegerCallback ( "n" , mockCallback ) ; "<AssertPlaceHolder>" ; verify ( mockCallback ) ; } valueOf ( java . lang . String ) { com . allanbank . mongodb . Durability result = null ; if ( ( "ACK" . equalsIgnoreCase ( value ) ) || ( "SAFE" . equalsIgnoreCase ( value ) ) ) { result = com . allanbank . mongodb . Durability . ACK ; } else if ( "NONE" . equalsIgnoreCase ( value ) ) { result = com . allanbank . mongodb . Durability . NONE ; } else { try { boolean waitForReply = false ; boolean waitForFsync = false ; boolean waitForJournal = false ; int waitForReplicas = 0 ; java . lang . String waitForReplicasByMode = null ; int waitTimeoutMillis = 0 ; final com . allanbank . mongodb . bson . Document d = com . allanbank . mongodb . bson . json . Json . parse ( value ) ; for ( final com . allanbank . mongodb . bson . Element e : d ) { if ( ! ( "getlasterror" . equalsIgnoreCase ( e . getName ( ) ) ) ) { if ( "w" . equalsIgnoreCase ( e . getName ( ) ) ) { waitForReply = true ; if ( e instanceof com . allanbank . mongodb . bson . NumericElement ) { waitForReplicas = ( ( com . allanbank . mongodb . bson . NumericElement ) ( e ) ) . getIntValue ( ) ; } else if ( e instanceof com . allanbank . mongodb . bson . element . StringElement ) { waitForReplicasByMode = ( ( com . allanbank . mongodb . bson . element . StringElement ) ( e ) ) . getValue ( ) ; } else if ( e instanceof com . allanbank . mongodb . bson . element . SymbolElement ) { waitForReplicasByMode = ( ( com . allanbank . mongodb . bson . element . SymbolElement ) ( e ) ) . getSymbol ( ) ; } else { return null ; } } else if ( "wtimeout" . equalsIgnoreCase ( e . getName ( ) ) ) { if ( e instanceof com . allanbank . mongodb . bson . NumericElement ) { waitTimeoutMillis = ( ( com . allanbank . mongodb . bson . NumericElement ) ( e ) ) . getIntValue ( ) ; } else { return null ; } } else if ( "fsync" . equalsIgnoreCase ( e . getName ( ) ) ) { waitForReply = true ; waitForFsync = true ; } else if ( "j" . equalsIgnoreCase ( e . getName ( ) ) ) { waitForReply = true ; waitForJournal = true ; } else { return null ; } } } result = new com . allanbank . mongodb . Durability ( waitForReply , waitForFsync , waitForJournal , waitForReplicas , waitForReplicasByMode , waitTimeoutMillis ) ; } catch ( final com . allanbank . mongodb . error . JsonParseException error ) { error . getCause ( ) ; } } return result ; } | org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( ( - 1 ) ) , callback . convert ( reply ) ) |
parseProviderWriteResponse ( ) { final java . lang . String [ ] parts = new java . lang . String [ ] { "prov1" } ; when ( resource . getParts ( ) ) . thenReturn ( parts ) ; final org . sentilo . platform . server . response . SentiloResponse response = org . sentilo . platform . server . response . SentiloResponse . build ( new org . apache . http . message . BasicHttpResponse ( new org . apache . http . message . BasicStatusLine ( org . apache . http . HttpVersion . HTTP_1_0 , 200 , "" ) ) ) ; parser . writeResponse ( sentiloRequest , response , getProviderOrders ( ) ) ; final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; ( ( org . apache . http . entity . ByteArrayEntity ) ( response . getHttpResponse ( ) . getEntity ( ) ) ) . writeTo ( baos ) ; final java . lang . String expected = "{\"sensors\":[{\"sensor\":\"sensor1\",\"orders\":[{\"order\":\"stop\",\"timestamp\":\"21/02/2013T17:49:24\",\"sender\":\"sender1\",\"time\":1361468964000}]},{\"sensor\":\"sensor2\",\"orders\":[{\"order\":\"stop\",\"timestamp\":\"21/02/2013T17:49:30\",\"sender\":\"sender1\",\"time\":1361468970000},{\"order\":\"start\",\"timestamp\":\"21/02/2013T17:49:30\",\"sender\":\"sender1\",\"time\":1361468970000}]}]}" ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "---<sp>Sensor<sp>observations<sp>---" ) ; sb . append ( "\n\t<sp>sensor:" ) . append ( sensor ) ; if ( org . springframework . util . StringUtils . hasText ( location ) ) { sb . append ( "\n\t<sp>location:" ) . append ( location ) ; } if ( ! ( org . springframework . util . CollectionUtils . isEmpty ( observations ) ) ) { sb . append ( observations . toString ( ) ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , baos . toString ( ) ) |
testDefaultScaleFactorIsZero ( ) { com . eclipsesource . tabris . tracking . TrackingInfo trackingInfo = new com . eclipsesource . tabris . tracking . TrackingInfo ( ) ; float scaleFactor = trackingInfo . getScaleFactor ( ) ; "<AssertPlaceHolder>" ; } getScaleFactor ( ) { return scaleFactor ; } | org . junit . Assert . assertEquals ( 0 , scaleFactor , 0 ) |
testIsSetForWorld ( ) { "<AssertPlaceHolder>" ; } isSetForWorld ( org . bukkit . World ) { if ( type . equals ( world . bentobox . bentobox . api . flags . Flag . Type . WORLD_SETTING ) ) { world . bentobox . bentobox . api . configuration . WorldSettings ws = world . bentobox . bentobox . BentoBox . getInstance ( ) . getIWM ( ) . getWorldSettings ( world ) ; if ( ws != null ) { ws . getWorldFlags ( ) . putIfAbsent ( getID ( ) , setting ) ; return ws . getWorldFlags ( ) . get ( getID ( ) ) ; } return false ; } else { return defaultWorldSettings . getOrDefault ( world . bentobox . bentobox . util . Util . getWorld ( world ) , setting ) ; } } | org . junit . Assert . assertFalse ( f . isSetForWorld ( world ) ) |
testHandlingOfMultipleFlowFilesWithSameId ( ) { for ( int i = 0 ; i < 2 ; i ++ ) { final org . apache . nifi . controller . repository . FlowFileRecord flowFileRecord = new org . apache . nifi . controller . repository . StandardFlowFileRecord . Builder ( ) . id ( 1000L ) . addAttribute ( "uuid" , "12345678-1234-1234-1234-123456789012" ) . entryDate ( java . lang . System . currentTimeMillis ( ) ) . size ( 0L ) . build ( ) ; flowFileQueue . put ( flowFileRecord ) ; } final org . apache . nifi . processor . Relationship relationship = new org . apache . nifi . processor . Relationship . Builder ( ) . name ( "A" ) . build ( ) ; org . apache . nifi . flowfile . FlowFile ff1 = session . get ( ) ; "<AssertPlaceHolder>" ; session . transfer ( ff1 , relationship ) ; try { session . get ( ) ; org . junit . Assert . fail ( "Should<sp>not<sp>have<sp>been<sp>able<sp>to<sp>poll<sp>second<sp>FlowFile<sp>with<sp>same<sp>ID" ) ; } catch ( final org . apache . nifi . processor . exception . FlowFileAccessException e ) { } } get ( ) { if ( ( instance ) == null ) { instance = loadDefault ( ) ; } return instance ; } | org . junit . Assert . assertNotNull ( ff1 ) |
canCreateSentences ( ) { org . apache . uima . jcas . JCas jCas = org . apache . uima . fit . factory . JCasFactory . createJCas ( ) ; uk . gov . dstl . baleen . odin . SentenceFactory factory = new uk . gov . dstl . baleen . odin . SentenceFactory ( jCas ) ; java . util . List < uk . gov . dstl . baleen . odin . OdinSentence > sentences = factory . create ( ) ; "<AssertPlaceHolder>" ; } create ( ) { return ( ( T ) ( org . apache . uima . fit . factory . CollectionReaderFactory . createReader ( clazz ) ) ) ; } | org . junit . Assert . assertNotNull ( sentences ) |
notifyPrivateMessageArrivedWhenGuiHiddenAndPrivateChatOutOfFocusShouldUpdateAndBeep ( ) { when ( kouChatFrame . isVisible ( ) ) . thenReturn ( false ) ; when ( kouChatFrame . isFocused ( ) ) . thenReturn ( false ) ; when ( privchat . isVisible ( ) ) . thenReturn ( true ) ; when ( privchat . isFocused ( ) ) . thenReturn ( false ) ; mediator . notifyPrivateMessageArrived ( user , null ) ; verify ( privchat ) . updateUserInformation ( ) ; verify ( beeper ) . beep ( ) ; verifyZeroInteractions ( sysTray ) ; "<AssertPlaceHolder>" ; } isNewMsg ( ) { return newMsg ; } | org . junit . Assert . assertFalse ( me . isNewMsg ( ) ) |
getModulesAndIncludes ( ) { org . erlide . engine . util . ErlideTestUtils . createInclude ( ErlModelTestBase . projects [ 0 ] , "bb.erl" , "-module(bb).\n" ) ; org . erlide . engine . util . ErlideTestUtils . createModule ( ErlModelTestBase . projects [ 0 ] , "cc.hrl" , "-define(A,<sp>hej).\n" ) ; final org . erlide . engine . model . root . IErlModule includeD = org . erlide . engine . util . ErlideTestUtils . createInclude ( ErlModelTestBase . projects [ 0 ] , "dd.hrl" , "-define(B,<sp>du).\n" ) ; final java . util . List < org . erlide . engine . model . root . IErlModule > expected = com . google . common . collect . Lists . newArrayList ( module , includeD ) ; final java . util . Collection < org . erlide . engine . model . root . IErlModule > includes = ErlModelTestBase . projects [ 0 ] . getModulesAndIncludes ( ) ; "<AssertPlaceHolder>" ; } createInclude ( org . erlide . engine . model . root . IErlProject , java . lang . String , java . lang . String ) { final org . eclipse . core . resources . IFolder folder = project . getWorkspaceProject ( ) . getFolder ( "include" ) ; final org . erlide . engine . model . root . IErlModule module = org . erlide . engine . util . ErlideTestUtils . createModule ( moduleName , moduleContents , folder ) ; org . erlide . engine . util . ErlideTestUtils . modulesAndIncludes . add ( module ) ; return module ; } | org . junit . Assert . assertEquals ( expected , includes ) |
toArray ( ) { com . cloudhopper . commons . util . ByteBuffer buffer = new com . cloudhopper . commons . util . ByteBuffer ( com . cloudhopper . commons . util . ByteBufferTest . TEST_BYTES1 ) ; byte [ ] copyArray = buffer . toArray ( ) ; "<AssertPlaceHolder>" ; } toArray ( ) { return toArray ( 0 , size ( ) ) ; } | org . junit . Assert . assertArrayEquals ( com . cloudhopper . commons . util . ByteBufferTest . TEST_BYTES1 , copyArray ) |
testBuildWithParameters ( ) { java . lang . String docNum = "doc<sp>num" ; java . lang . String email = "email@email.com" ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date birthDate = new java . util . Date ( ) ; java . lang . String docSeries = "doc<sp>series" ; java . lang . String surname = "surname" ; java . lang . Double rate = 1.0 ; java . lang . String phone = "phone" ; java . lang . String name = "name" ; java . lang . Integer isPlurality = 11 ; java . lang . Integer isPensioner = 12 ; java . lang . String invNum = "invNum" ; java . lang . String firstName = "first<sp>name" ; java . lang . String fatherName = "father<sp>name" ; java . util . Date endDate = new java . util . Date ( ) ; org . lnu . is . domain . department . Department department = new org . lnu . is . domain . department . Department ( ) ; department . setId ( 1L ) ; org . lnu . is . domain . employee . Employee context = new org . lnu . is . domain . employee . Employee ( ) ; org . lnu . is . domain . employee . status . EmployeeStatus employeeStatus = new org . lnu . is . domain . employee . status . EmployeeStatus ( ) ; employeeStatus . setId ( 4L ) ; org . lnu . is . domain . employee . type . EmployeeType employeeType = new org . lnu . is . domain . employee . type . EmployeeType ( ) ; employeeType . setId ( 5L ) ; org . lnu . is . domain . post . Post post = new org . lnu . is . domain . post . Post ( ) ; post . setId ( 7L ) ; org . lnu . is . domain . person . Person person = new org . lnu . is . domain . person . Person ( ) ; person . setId ( 9L ) ; org . lnu . is . domain . employee . Employee parent = new org . lnu . is . domain . employee . Employee ( ) ; parent . setId ( 11L ) ; org . lnu . is . domain . order . Order order = new org . lnu . is . domain . order . Order ( ) ; order . setId ( 12L ) ; org . lnu . is . domain . job . type . JobType jobType = new org . lnu . is . domain . job . type . JobType ( ) ; jobType . setId ( 13L ) ; org . lnu . is . domain . gender . type . GenderType genderType = new org . lnu . is . domain . gender . type . GenderType ( ) ; genderType . setId ( 15L ) ; context . setPost ( post ) ; context . setPerson ( person ) ; context . setParent ( parent ) ; context . setOrder ( order ) ; context . setJobType ( jobType ) ; context . setGenderType ( genderType ) ; context . setEmployeeType ( employeeType ) ; context . setEmployeeStatus ( employeeStatus ) ; context . setDepartment ( department ) ; context . setSurname ( surname ) ; context . setRate ( rate ) ; context . setPhone ( phone ) ; context . setName ( name ) ; context . setIsPlurality ( isPlurality ) ; context . setIsPensioner ( isPensioner ) ; context . setInvNum ( invNum ) ; context . setFirstName ( firstName ) ; context . setFatherName ( fatherName ) ; context . setEndDate ( endDate ) ; context . setDocSeries ( docSeries ) ; context . setDocNum ( docNum ) ; context . setBegDate ( begDate ) ; context . setBirthDate ( birthDate ) ; context . setEmail ( email ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>Employee<sp>e<sp>WHERE<sp>(<sp>e.employeeType<sp>=<sp>:employeeType<sp>AND<sp>e.person<sp>=<sp>:person<sp>AND<sp>e.genderType<sp>=<sp>:genderType<sp>AND<sp>e.department<sp>=<sp>:department<sp>AND<sp>e.post<sp>=:post<sp>AND<sp>e.jobType<sp>=<sp>:jobType<sp>AND<sp>e.employeeStatus<sp>=<sp>:employeeStatus<sp>AND<sp>e.order<sp>=:order<sp>AND<sp>e.parent<sp>=<sp>:parent<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.firstName<sp>LIKE<sp>CONCAT('%',:firstName,'%')<sp>AND<sp>e.fatherName<sp>LIKE<sp>CONCAT('%',:fatherName,'%')<sp>AND<sp>e.surname<sp>LIKE<sp>CONCAT('%',:surname,'%')<sp>AND<sp>e.birthDate<sp>=<sp>:birthDate<sp>AND<sp>e.invNum<sp>=<sp>:invNum<sp>AND<sp>e.rate<sp>=<sp>:rate<sp>AND<sp>e.isPlurality<sp>=:isPlurality<sp>AND<sp>e.isPensioner<sp>=:isPensioner<sp>AND<sp>e.begDate<sp><=<sp>:begDate<sp>AND<sp>e.endDate<sp>>=<sp>:endDate<sp>AND<sp>e.docSeries<sp>LIKE<sp>CONCAT('%',:docSeries,'%')<sp>AND<sp>e.docNum<sp>LIKE<sp>CONCAT('%',:docNum,'%')<sp>AND<sp>e.phone<sp>LIKE<sp>CONCAT('%',:phone,'%')<sp>AND<sp>e.email<sp>LIKE<sp>CONCAT('%',:email,'%')<sp>)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . employee . Employee > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expected , actualQuery ) |
roundtripOfDateIntervalSince ( ) { net . time4j . PlainDate start = net . time4j . PlainDate . of ( 2014 , 2 , 27 ) ; java . lang . Object interval = net . time4j . range . DateInterval . since ( start ) ; java . lang . Object ser = net . time4j . range . SerializationTest . roundtrip ( interval ) ; "<AssertPlaceHolder>" ; } roundtrip ( java . lang . Object ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream oos = new java . io . ObjectOutputStream ( baos ) ; oos . writeObject ( obj ) ; byte [ ] data = baos . toByteArray ( ) ; oos . close ( ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( data ) ; java . io . ObjectInputStream ois = new java . io . ObjectInputStream ( bais ) ; java . lang . Object ser = ois . readObject ( ) ; ois . close ( ) ; return ser ; } | org . junit . Assert . assertThat ( interval , org . hamcrest . CoreMatchers . is ( ser ) ) |
testNoMatch03 ( ) { boolean matchResult = simpleNamePatternMatcher . matchesEndToEnd ( "a$" ) ; "<AssertPlaceHolder>" ; } matchesEndToEnd ( java . lang . String ) { return pattern . matcher ( input ) . matches ( ) ; } | org . junit . Assert . assertFalse ( matchResult ) |
testSerialization ( ) { org . jfree . chart . renderer . category . WaterfallBarRenderer r1 = new org . jfree . chart . renderer . category . WaterfallBarRenderer ( ) ; org . jfree . chart . renderer . category . WaterfallBarRenderer r2 = ( ( org . jfree . chart . renderer . category . WaterfallBarRenderer ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( r1 , r2 ) |
getFileConfigShouldReturnFileConfigWithEmptyValuesWhenEditorConfigHasNoProperties ( ) { when ( mockEditorConfig . getProperties ( "path" ) ) . thenReturn ( java . util . Collections . < org . editorconfig . core . EditorConfig . OutPair > emptyList ( ) ) ; final org . eclipse . editorconfig . core . EditorFileConfig fileConfig = editorConfigService . getEditorConfig ( "path" ) ; "<AssertPlaceHolder>" ; } getConfigProperties ( ) { return configProperties ; } | org . junit . Assert . assertThat ( fileConfig . getConfigProperties ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . empty ( ) ) ) |
getTermWithEmptyMarkerInCacheReturnsNull ( ) { when ( this . cache . get ( "NOTHING" ) ) . thenReturn ( this . emptyMarker ) ; org . phenotips . vocabulary . VocabularyTerm result = this . mocker . getComponentUnderTest ( ) . getTerm ( "NOTHING" ) ; verify ( this . client , never ( ) ) . execute ( any ( org . apache . http . client . methods . HttpUriRequest . class ) ) ; "<AssertPlaceHolder>" ; } getTerm ( java . lang . String ) { org . phenotips . vocabulary . VocabularyTerm result = super . getTerm ( id ) ; if ( result == null ) { java . lang . String optionalPrefix = ( org . phenotips . vocabulary . internal . solr . MendelianInheritanceInMan . STANDARD_NAME ) + ":" ; if ( org . apache . commons . lang3 . StringUtils . startsWith ( id , optionalPrefix ) ) { result = getTerm ( org . apache . commons . lang3 . StringUtils . substringAfter ( id , optionalPrefix ) ) ; } } return result ; } | org . junit . Assert . assertNull ( result ) |
validateFromAndToDate ( ) { javax . faces . component . UIComponent dateComponent = mock ( javax . faces . component . UIComponent . class ) ; javax . faces . context . FacesContext facesContext = mock ( javax . faces . context . FacesContext . class ) ; model . setFailedDateComponentId ( null ) ; doReturn ( "toDate" ) . when ( dateComponent ) . getClientId ( facesContext ) ; doThrow ( new javax . faces . validator . ValidatorException ( new javax . faces . application . FacesMessage ( "failed" ) ) ) . when ( ctrl . validator ) . validate ( any ( javax . faces . context . FacesContext . class ) , any ( javax . faces . component . UIComponent . class ) , any ( java . util . Date . class ) ) ; ctrl . validateFromAndToDate ( facesContext , dateComponent , new java . util . Date ( ) ) ; "<AssertPlaceHolder>" ; verify ( facesContext , times ( 1 ) ) . addMessage ( anyString ( ) , any ( javax . faces . application . FacesMessage . class ) ) ; } getFailedDateComponentId ( ) { return this . failedDateComponentId ; } | org . junit . Assert . assertEquals ( "toDate" , ctrl . model . getFailedDateComponentId ( ) ) |
testToAndFromJsonString ( ) { java . lang . String json = net . casper . io . file . tests . CDataFileDefLoaderTest . loader . toJsonString ( net . casper . io . file . tests . CDataFileDefLoaderTest . adultsDef ) ; System . out . println ( json ) ; net . casper . io . file . def . CDataFileDef builtCDF = net . casper . io . file . tests . CDataFileDefLoaderTest . loader . fromJsonString ( json ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . String newline = java . lang . System . getProperty ( "line.separator" ) ; java . lang . StringBuffer result = new java . lang . StringBuffer ( 512 ) ; result . append ( getClass ( ) . getName ( ) ) . append ( newline ) ; result . append ( "Name:<sp>" ) . append ( name ) . append ( newline ) ; result . append ( "Columns:<sp>" ) . append ( java . util . Arrays . toString ( columns ) ) . append ( newline ) ; result . append ( "Cell<sp>readers:<sp>" ) . append ( java . util . Arrays . toString ( cellReaders ) ) . append ( newline ) ; result . append ( "Primary<sp>key(s):<sp>" ) . append ( java . util . Arrays . toString ( primaryKey ) ) . append ( newline ) ; return result . toString ( ) ; } | org . junit . Assert . assertEquals ( net . casper . io . file . tests . CDataFileDefLoaderTest . adultsDef . toString ( ) , builtCDF . toString ( ) ) |
shouldFindStreamOfSimples ( ) { java . lang . String name = "something" ; org . apache . deltaspike . data . test . java8 . entity . Simple s = new org . apache . deltaspike . data . test . java8 . entity . Simple ( name ) ; entityManager . persist ( s ) ; java . util . stream . Stream < org . apache . deltaspike . data . test . java8 . entity . Simple > found = simpleRepository . findByName ( name ) ; "<AssertPlaceHolder>" ; } count ( ) { org . apache . deltaspike . data . impl . builder . postprocessor . CountQueryPostProcessor counter = new org . apache . deltaspike . data . impl . builder . postprocessor . CountQueryPostProcessor ( ) ; context . addJpaQueryPostProcessor ( counter ) ; try { java . lang . Long result = ( ( java . lang . Long ) ( ( ( javax . persistence . Query ) ( builder . executeQuery ( context ) ) ) . getSingleResult ( ) ) ) ; return result . intValue ( ) ; } catch ( java . lang . RuntimeException e ) { throw e ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } finally { context . removeJpaQueryPostProcessor ( counter ) ; } } | org . junit . Assert . assertEquals ( 1 , found . count ( ) ) |
testCluster2 ( ) { org . infinispan . server . RestClient restClient = org . infinispan . server . ClusteredServerTest . serverTestRule . restClient ( ) ; restClient . put ( "k2" , "v2" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { try { if ( ( readTimeout ) > 0 ) return wrap ( nativeCache . getAsync ( key ) . get ( readTimeout , TimeUnit . MILLISECONDS ) ) ; else return wrap ( nativeCache . get ( key ) ) ; } catch ( java . lang . InterruptedException e ) { java . lang . Thread . currentThread ( ) . interrupt ( ) ; throw new org . infinispan . commons . CacheException ( e ) ; } catch ( java . util . concurrent . ExecutionException | java . util . concurrent . TimeoutException e ) { throw new org . infinispan . commons . CacheException ( e ) ; } } | org . junit . Assert . assertEquals ( "v2" , restClient . get ( "k2" ) ) |
testNoPlacements ( ) { doDelete ( com . vmware . xenon . common . UriUtils . buildUri ( host , GroupResourcePlacementService . DEFAULT_RESOURCE_PLACEMENT_LINK ) , false ) ; java . util . List < java . lang . String > links = getDocumentLinksOfType ( com . vmware . admiral . compute . container . GroupResourcePlacementService . GroupResourcePlacementState . class ) ; "<AssertPlaceHolder>" ; doOperation ( new com . vmware . xenon . common . ServiceDocument ( ) , com . vmware . xenon . common . UriUtils . buildUri ( host , ComputePlacementPoolRelationTransformationService . SELF_LINK ) , false , Service . Action . POST ) ; } isEmpty ( ) { return ( ( serviceSelfLink ) == null ) || ( com . vmware . admiral . service . common . ServiceTaskCallback . EMPTY_CALLBACK_LINK . equals ( serviceSelfLink ) ) ; } | org . junit . Assert . assertTrue ( links . isEmpty ( ) ) |
testToStringNullConfig ( ) { org . eclipse . kura . core . net . NetInterfaceAddressConfigImpl value = createConfig ( ) ; java . util . ArrayList < org . eclipse . kura . net . NetConfig > configs = new java . util . ArrayList ( ) ; configs . add ( null ) ; value . setNetConfigs ( configs ) ; java . lang . String expected = "NetConfig:<sp>null<sp>-<sp>" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( "]" 1 ) . append ( this . id ) . append ( "]" 0 ) . append ( this . topic ) . append ( ",<sp>qos=" ) . append ( this . qos ) . append ( ",<sp>retain=" ) . append ( this . retain ) . append ( ",<sp>createdOn=" ) . append ( this . createdOn ) . append ( ",<sp>publishedOn=" ) . append ( this . publishedOn ) . append ( ",<sp>publishedMessageId=" ) . append ( this . publishedMessageId ) . append ( ",<sp>confirmedOn=" ) . append ( this . confirmedOn ) . append ( ",<sp>payload=" ) . append ( java . util . Arrays . toString ( this . payload ) ) . append ( ",<sp>priority=" ) . append ( this . priority ) . append ( ",<sp>sessionId=" ) . append ( this . sessionId ) . append ( "]" 2 ) . append ( this . droppedOn ) . append ( "]" ) ; return builder . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , value . toString ( ) ) |
testComputeSpanningHierarchyForward ( ) { com . google . devtools . depan . model . GraphNode [ ] nodeArray = com . google . devtools . depan . test . TestUtils . buildNodes ( 5 ) ; com . google . devtools . depan . model . GraphModel test = com . google . devtools . depan . test . TestUtils . buildComplete ( nodeArray , TestUtils . RELATION ) ; java . util . Map < com . google . devtools . depan . model . GraphNode , ? extends com . google . devtools . depan . nodes . trees . SuccessorEdges > result = com . google . devtools . depan . nodes . trees . Trees . computeSpanningHierarchy ( test , TestUtils . FORWARD ) ; "<AssertPlaceHolder>" ; } buildAllNodes ( java . util . Map ) { java . util . Set < com . google . devtools . depan . model . GraphNode > result = com . google . common . collect . Sets . newHashSet ( ) ; for ( java . util . Map . Entry < com . google . devtools . depan . model . GraphNode , ? extends com . google . devtools . depan . nodes . trees . SuccessorEdges > entry : map . entrySet ( ) ) { result . add ( entry . getKey ( ) ) ; result . addAll ( entry . getValue ( ) . computeSuccessorNodes ( ) ) ; } return result ; } | org . junit . Assert . assertEquals ( 5 , buildAllNodes ( result ) . size ( ) ) |
testGetReceivedMessageGaps_NoGaps_OutOfOrder ( ) { for ( int i = 9 ; i >= 0 ; i -- ) { net . xenqtt . client . PublishMessage message = new net . xenqtt . client . PublishMessage ( "a/b/c" , net . xenqtt . message . QoS . AT_MOST_ONCE , createPayload ( i ) ) ; stats . messageReceived ( message ) ; } "<AssertPlaceHolder>" ; } getReceivedMessageGaps ( ) { java . util . concurrent . locks . Lock lock = subscribeLock ; lock . lock ( ) ; try { return findGaps ( receivedMessageIds ) ; } finally { lock . unlock ( ) ; } } | org . junit . Assert . assertTrue ( stats . getReceivedMessageGaps ( ) . isEmpty ( ) ) |
testWriteReadSeq ( ) { useFCOption = false ; positionReadOption = false ; java . lang . String fname = filenameOption ; long rdBeginPos = 0 ; int stat = testWriteAndRead ( fname , org . apache . hadoop . hdfs . TestWriteRead . WR_NTIMES , org . apache . hadoop . hdfs . TestWriteRead . WR_CHUNK_SIZE , rdBeginPos ) ; org . apache . hadoop . hdfs . TestWriteRead . LOG . info ( ( "Summary<sp>status<sp>from<sp>test1:<sp>status=<sp>" + stat ) ) ; "<AssertPlaceHolder>" ; } info ( java . lang . String ) { return new org . apache . hadoop . yarn . webapp . ResponseInfo ( ) . about ( about ) ; } | org . junit . Assert . assertEquals ( 0 , stat ) |
testTableWithMultilineHeader ( ) { java . lang . String expectedCsv = technology . tabula . UtilsForTesting . loadCsv ( "src/test/resources/technology/tabula/csv/us-020.csv" ) ; technology . tabula . Page page = technology . tabula . UtilsForTesting . getAreaFromPage ( "src/test/resources/technology/tabula/us-020.pdf" , 2 , 103.0F , 35.0F , 641.0F , 560.0F ) ; technology . tabula . extractors . BasicExtractionAlgorithm bea = new technology . tabula . extractors . BasicExtractionAlgorithm ( ) ; technology . tabula . Table table = bea . extract ( page ) . get ( 0 ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; new technology . tabula . writers . CSVWriter ( ) . write ( sb , table ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; java . lang . String s = super . toString ( ) ; sb . append ( s , 0 , ( ( s . length ( ) ) - 1 ) ) ; sb . append ( ",chunks=" ) ; for ( technology . tabula . TextChunk te : this . textChunks ) { sb . append ( ( ( "'" + ( te . getText ( ) ) ) + "',<sp>" ) ) ; } sb . append ( ']' ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedCsv , sb . toString ( ) ) |
isNotSameWhenAnUpdatedMetacardMethodReturnsNull ( ) { updatedMetacard . setModifiedDate ( null ) ; "<AssertPlaceHolder>" ; } isSame ( ddf . catalog . data . Metacard , ddf . catalog . data . Metacard ) { if ( ( cachedMetacard == null ) && ( updatedMetacard == null ) ) { return true ; } if ( ( cachedMetacard == null ) || ( updatedMetacard == null ) ) { return false ; } if ( ! ( java . util . Objects . equals ( cachedMetacard . getId ( ) , updatedMetacard . getId ( ) ) ) ) { return false ; } if ( ! ( java . util . Objects . equals ( cachedMetacard . getAttribute ( Core . CHECKSUM ) , updatedMetacard . getAttribute ( Core . CHECKSUM ) ) ) ) { return false ; } return ddf . catalog . cache . impl . CachedResourceMetacardComparator . allMetacardMethodsReturnMatchingAttributes ( cachedMetacard , updatedMetacard ) ; } | org . junit . Assert . assertThat ( ddf . catalog . cache . impl . CachedResourceMetacardComparator . isSame ( cachedMetacard , updatedMetacard ) , org . hamcrest . CoreMatchers . is ( false ) ) |
testRegisterUserInvalidPassword ( ) { com . sap . pto . dao . entities . User user = new com . sap . pto . dao . entities . User ( com . sap . pto . services . AnonUserServiceTest . TEST_USER_EMAIL , com . sap . pto . services . AnonUserServiceTest . TEST_USER_EMAIL ) ; try { anonUserService . registerUser ( user ) ; org . junit . Assert . fail ( "should<sp>have<sp>thrown<sp>an<sp>exception" ) ; } catch ( javax . ws . rs . WebApplicationException e ) { com . sap . pto . dao . entities . User newUser = com . sap . pto . dao . UserDAO . getUserByUserName ( com . sap . pto . services . AnonUserServiceTest . TEST_USER_NAME ) ; "<AssertPlaceHolder>" ; } } getUserByUserName ( java . lang . String ) { javax . persistence . EntityManager em = com . sap . pto . adapters . PersistenceAdapter . getEntityManager ( ) ; com . sap . pto . dao . entities . User user = com . sap . pto . dao . UserDAO . getUserByUserName ( userName , em ) ; return user ; } | org . junit . Assert . assertNull ( newUser ) |
shouldConditionallyChooseFirst ( ) { final java . lang . String expected = "SELECT<sp>*<sp>FROM<sp>BLOG<sp>WHERE<sp>CATEGORY<sp>=<sp>?" ; org . apache . ibatis . scripting . xmltags . DynamicSqlSource source = createDynamicSqlSource ( new org . apache . ibatis . scripting . xmltags . TextSqlNode ( "SELECT<sp>*<sp>FROM<sp>BLOG" ) , new org . apache . ibatis . scripting . xmltags . ChooseSqlNode ( new java . util . ArrayList < org . apache . ibatis . scripting . xmltags . SqlNode > ( ) { { add ( new org . apache . ibatis . scripting . xmltags . IfSqlNode ( mixedContents ( new org . apache . ibatis . scripting . xmltags . TextSqlNode ( "WHERE<sp>CATEGORY<sp>=<sp>?" ) ) , "true" ) ) ; add ( new org . apache . ibatis . scripting . xmltags . IfSqlNode ( mixedContents ( new org . apache . ibatis . scripting . xmltags . TextSqlNode ( "WHERE<sp>CATEGORY<sp>=<sp>'NONE'" ) ) , "false" ) ) ; } } , mixedContents ( new org . apache . ibatis . scripting . xmltags . TextSqlNode ( "WHERE<sp>CATEGORY<sp>=<sp>'DEFAULT'" ) ) ) ) ; org . apache . ibatis . mapping . BoundSql boundSql = source . getBoundSql ( null ) ; "<AssertPlaceHolder>" ; } getSql ( ) { return sql ; } | org . junit . Assert . assertEquals ( expected , boundSql . getSql ( ) ) |
testToBuilder ( ) { initializeExpectedNetwork ( 9 ) ; compareNetwork ( standardNetwork , standardNetwork . toBuilder ( ) . build ( ) ) ; com . google . cloud . compute . deprecated . Network newNetwork = standardNetwork . toBuilder ( ) . setDescription ( "newDescription" ) . build ( ) ; "<AssertPlaceHolder>" ; newNetwork = newNetwork . toBuilder ( ) . setDescription ( "description" ) . build ( ) ; compareNetwork ( standardNetwork , newNetwork ) ; } getDescription ( ) { return proto . getDescription ( ) ; } | org . junit . Assert . assertEquals ( "newDescription" , newNetwork . getDescription ( ) ) |
testMatrix ( ) { owltools . gaf . inference . ClassTaxonMatrix m = owltools . gaf . inference . ClassTaxonMatrix . create ( owltools . gaf . inference . ClassTaxonMatrixTest . all , owltools . gaf . inference . ClassTaxonMatrixTest . classes , java . util . Arrays . asList ( owltools . gaf . inference . ClassTaxonMatrixTest . rat , owltools . gaf . inference . ClassTaxonMatrixTest . yeast ) ) ; java . io . StringWriter stringWriter = new java . io . StringWriter ( ) ; java . io . BufferedWriter writer = new java . io . BufferedWriter ( stringWriter ) ; owltools . gaf . inference . ClassTaxonMatrix . write ( m , owltools . gaf . inference . ClassTaxonMatrixTest . all , writer ) ; writer . close ( ) ; java . lang . String writtenMatrix = stringWriter . getBuffer ( ) . toString ( ) ; "<AssertPlaceHolder>" ; checkTerm ( m , "GO:0051300" , false , true ) ; checkTerm ( m , "GO:0052541" , false , false ) ; checkTerm ( m , "GO:0030879" , true , false ) ; } length ( ) { return ( text ) == null ? 0 : text . length ( ) ; } | org . junit . Assert . assertTrue ( ( ( writtenMatrix . length ( ) ) > 0 ) ) |
asLazyValues ( ) { org . eclipse . collections . api . list . MutableList < java . lang . Integer > values = Maps . fixedSize . of ( 1 , 1 ) . valuesView ( ) . toSortedList ( ) ; "<AssertPlaceHolder>" ; } newListWith ( E [ ] ) { return new org . eclipse . collections . impl . list . mutable . FastList < > ( elements ) ; } | org . junit . Assert . assertEquals ( org . eclipse . collections . impl . list . mutable . FastList . newListWith ( 1 ) , values ) |
testGetSubscriptionId ( ) { org . jinstagram . realtime . SubscriptionResponseObject fixture = new org . jinstagram . realtime . SubscriptionResponseObject ( ) ; fixture . setObjectId ( "" ) ; fixture . setEpochTime ( 1L ) ; fixture . setChangedAspect ( "" ) ; fixture . setObject ( "" ) ; fixture . setSubscriptionId ( "" ) ; java . lang . String result = fixture . getSubscriptionId ( ) ; "<AssertPlaceHolder>" ; } getSubscriptionId ( ) { return subscriptionId ; } | org . junit . Assert . assertEquals ( "" , result ) |
shouldUseExistingManaToPayColorless ( ) { mage . Mana available = new mage . Mana ( ) ; available . setRed ( 7 ) ; mage . Mana cost = new mage . Mana ( ) ; cost . setRed ( 4 ) ; cost . setGeneric ( 2 ) ; available . subtractCost ( cost ) ; "<AssertPlaceHolder>" ; } getRed ( ) { return red ; } | org . junit . Assert . assertEquals ( 1 , available . getRed ( ) ) |
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . kernel . model . BrowserTracker > browserTrackers = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( browserTrackers . isEmpty ( ) ) |
testDecodeEndpointOpStripped ( ) { java . lang . String result = org . hawkular . apm . api . utils . EndpointUtil . encodeEndpoint ( org . hawkular . apm . api . utils . EndpointUtilTest . URI , org . hawkular . apm . api . utils . EndpointUtilTest . OPERATION ) ; "<AssertPlaceHolder>" ; } decodeEndpointOperation ( java . lang . String , boolean ) { int ind = endpoint . indexOf ( '[' ) ; if ( ind != ( - 1 ) ) { if ( stripped ) { return endpoint . substring ( ( ind + 1 ) , ( ( endpoint . length ( ) ) - 1 ) ) ; } return endpoint . substring ( ind ) ; } return null ; } | org . junit . Assert . assertEquals ( org . hawkular . apm . api . utils . EndpointUtilTest . OPERATION , org . hawkular . apm . api . utils . EndpointUtil . decodeEndpointOperation ( result , true ) ) |
size_bicyclo ( ) { int [ ] [ ] bicyclo = org . openscience . cdk . graph . InitialCyclesTest . bicyclo ( ) ; org . openscience . cdk . graph . RelevantCycles relevant = new org . openscience . cdk . graph . RelevantCycles ( bicyclo ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; } | org . junit . Assert . assertThat ( relevant . size ( ) , org . hamcrest . CoreMatchers . is ( 3 ) ) |
testDeleteProcessInstanceInfoLogByProcessId ( ) { int p = 0 ; java . lang . String processId = pilTestData [ ( p ++ ) ] . getProcessId ( ) ; java . lang . String processId2 = pilTestData [ ( p ++ ) ] . getProcessId ( ) ; org . kie . internal . runtime . manager . audit . query . ProcessInstanceLogDeleteBuilder updateBuilder = this . processInstanceLogDelete ( ) . processId ( processId , processId2 ) ; int result = updateBuilder . build ( ) . execute ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return new org . kie . internal . query . ParametrizedQuery < org . kie . api . task . model . TaskSummary > ( ) { private org . jbpm . query . jpa . data . QueryWhere queryWhere = new org . jbpm . query . jpa . data . QueryWhere ( getQueryWhere ( ) ) ; @ org . jbpm . services . task . impl . Override public java . util . List < org . kie . api . task . model . TaskSummary > getResultList ( ) { org . jbpm . services . task . commands . TaskSummaryQueryCommand cmd = new org . jbpm . services . task . commands . TaskSummaryQueryCommand ( queryWhere ) ; cmd . setUserId ( userId ) ; return executor . execute ( cmd ) ; } } ; } | org . junit . Assert . assertEquals ( 2 , result ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.