input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testWhere1 ( ) { org . nd4j . linalg . api . ndarray . INDArray arr = org . nd4j . linalg . factory . Nd4j . create ( new boolean [ ] [ ] { new boolean [ ] { false , true , false } , new boolean [ ] { false , false , true } , new boolean [ ] { false , false , true } } ) ; org . nd4j . linalg . api . ndarray . INDArray [ ] exp = new org . nd4j . linalg . api . ndarray . INDArray [ ] { org . nd4j . linalg . factory . Nd4j . trueVector ( new long [ ] { 0 , 1 , 2 } ) , org . nd4j . linalg . factory . Nd4j . trueVector ( new long [ ] { 1 , 2 , 2 } ) } ; org . nd4j . linalg . api . ndarray . INDArray [ ] act = org . nd4j . linalg . factory . Nd4j . where ( arr , null , null ) ; "<AssertPlaceHolder>" ; } where ( org . nd4j . linalg . factory . INDArray , org . nd4j . linalg . factory . INDArray , org . nd4j . linalg . factory . INDArray ) { org . nd4j . base . Preconditions . checkState ( ( ( ( x == null ) && ( y == null ) ) || ( ( x != null ) && ( y != null ) ) ) , ( "Both<sp>X<sp>and<sp>Y<sp>must<sp>be" + "null,<sp>or<sp>neither<sp>must<sp>be<sp>null" ) ) ; org . nd4j . linalg . factory . INDArray out ; org . nd4j . linalg . api . ops . DynamicCustomOp . DynamicCustomOpsBuilder op = org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "where_np" ) ; org . nd4j . linalg . factory . List < org . nd4j . linalg . api . shape . LongShapeDescriptor > outShapes ; if ( x == null ) { op . addInputs ( condition ) ; } else { if ( ( ! ( x . equalShapes ( y ) ) ) || ( ! ( x . equalShapes ( condition ) ) ) ) { org . nd4j . base . Preconditions . throwStateEx ( "Shapes<sp>must<sp>be<sp>equal:<sp>condition=%s,<sp>x=%s,<sp>y=%s" , condition . shape ( ) , x . shape ( ) , y . shape ( ) ) ; } op . addInputs ( condition , x , y ) ; } org . nd4j . linalg . api . ops . DynamicCustomOp o = op . build ( ) ; outShapes = org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . calculateOutputShape ( o ) ; org . nd4j . linalg . factory . INDArray [ ] outputs = new org . nd4j . linalg . factory . INDArray [ outShapes . size ( ) ] ; if ( ( x == null ) && ( ( ( ( outShapes . get ( 0 ) ) == null ) || ( ( outShapes . get ( 0 ) . getShape ( ) . length ) == 0 ) ) || ( ( outShapes . get ( 0 ) . getShape ( ) [ 0 ] ) == 0 ) ) ) { for ( int i = 0 ; i < ( outputs . length ) ; i ++ ) { outputs [ i ] = org . nd4j . linalg . factory . Nd4j . empty ( ) ; } return outputs ; } for ( int i = 0 ; i < ( outputs . length ) ; i ++ ) { outputs [ i ] = org . nd4j . linalg . factory . Nd4j . create ( outShapes . get ( i ) , false ) ; } op . addOutputs ( outputs ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . execAndReturn ( op . build ( ) ) ; return outputs ; } | org . junit . Assert . assertArrayEquals ( exp , act ) |
c09_HttpEntity ( ) { java . lang . String o = org . apache . juneau . rest . client . remote . BodyAnnotationTest . c01 . postC09 ( new org . apache . juneau . rest . client . remote . StringEntity ( "xxx" , org . apache . juneau . rest . client . remote . ContentType . create ( "text/plain" ) ) ) ; "<AssertPlaceHolder>" ; } create ( org . apache . juneau . rest . client . remote . ParamInfo ) { int i = mpi . getIndex ( ) ; if ( mpi . hasAnnotation ( org . apache . juneau . rest . client . remote . Header . class ) ) { return new org . apache . juneau . rest . client . remote . RemoteMethodArg ( i , HEADER , org . apache . juneau . rest . client . remote . HttpPartSchema . create ( org . apache . juneau . rest . client . remote . Header . class , mpi ) ) ; } else if ( mpi . hasAnnotation ( org . apache . juneau . rest . client . remote . Query . class ) ) { return new org . apache . juneau . rest . client . remote . RemoteMethodArg ( i , QUERY , org . apache . juneau . rest . client . remote . HttpPartSchema . create ( org . apache . juneau . rest . client . remote . Query . class , mpi ) ) ; } else if ( mpi . hasAnnotation ( org . apache . juneau . rest . client . remote . FormData . class ) ) { return new org . apache . juneau . rest . client . remote . RemoteMethodArg ( i , FORMDATA , org . apache . juneau . rest . client . remote . HttpPartSchema . create ( org . apache . juneau . rest . client . remote . FormData . class , mpi ) ) ; } else if ( mpi . hasAnnotation ( org . apache . juneau . rest . client . remote . Path . class ) ) { return new org . apache . juneau . rest . client . remote . RemoteMethodArg ( i , PATH , org . apache . juneau . rest . client . remote . HttpPartSchema . create ( org . apache . juneau . rest . client . remote . Path . class , mpi ) ) ; } else if ( mpi . hasAnnotation ( org . apache . juneau . rest . client . remote . Body . class ) ) { return new org . apache . juneau . rest . client . remote . RemoteMethodArg ( i , BODY , org . apache . juneau . rest . client . remote . HttpPartSchema . create ( org . apache . juneau . rest . client . remote . Body . class , mpi ) ) ; } return null ; } | org . junit . Assert . assertEquals ( "xxx" , o ) |
getResourcesForTypeWhereTypeDoesNotExistsShouldReturnEmptyResult ( ) { java . lang . String typeName = "type" ; when ( resourceGroupLocatorMock . getGroupsForType ( typeName , Collections . EMPTY_LIST , true , true ) ) . thenReturn ( new java . util . ArrayList < ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceGroupEntity > ( ) ) ; java . util . List < ch . mobi . itc . mobiliar . rest . resources . ResourceGroupDTO > resourcesResult = rest . getResources ( typeName ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { if ( ( ( asProperties ) != null ) && ( ! ( asProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( nodeProperties ) != null ) && ( ! ( nodeProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( consumerUnit ) != null ) && ( ! ( consumerUnit . isEmpty ( ) ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( resourcesResult . isEmpty ( ) ) |
shouldSetErrorMessageIfConfirmPasswordIsNotSameAsPassword ( ) { userName = mock ( android . widget . EditText . class ) ; password = mock ( android . widget . EditText . class ) ; organisation = mock ( android . widget . EditText . class ) ; confirmPassword = mock ( android . widget . EditText . class ) ; password . setText ( "text" ) ; confirmPassword . setText ( "randomText" ) ; userName . setText ( "user" ) ; organisation . setText ( "org" ) ; doReturn ( userName ) . when ( signupActivity ) . findViewById ( R . id . username ) ; doReturn ( confirmPassword ) . when ( signupActivity ) . findViewById ( R . id . confirm_password ) ; doReturn ( organisation ) . when ( signupActivity ) . findViewById ( R . id . organisation ) ; doReturn ( "text" ) . when ( signupActivity ) . getEditText ( R . id . password ) ; doReturn ( "confirmText" ) . when ( signupActivity ) . getEditText ( R . id . confirm_password ) ; doReturn ( true ) . when ( signupActivity ) . validatesPresenceOfMandatoryFields ( ) ; "<AssertPlaceHolder>" ; verify ( confirmPassword ) . setError ( signupActivity . getString ( R . string . password_mismatch ) ) ; } isValid ( ) { int numberOfInternalFields = names ( ) . length ( ) ; for ( com . rapidftr . database . Database . EnquiryTableColumn field : Database . EnquiryTableColumn . internalFields ( ) ) { if ( has ( field . getColumnName ( ) ) ) { numberOfInternalFields -- ; } } return numberOfInternalFields > 0 ; } | org . junit . Assert . assertThat ( signupActivity . isValid ( ) , org . hamcrest . CoreMatchers . equalTo ( false ) ) |
shouldValidateSourceInfoSchema ( ) { org . apache . kafka . connect . data . Schema kafkaSchema = SourceInfo . SCHEMA ; org . apache . avro . Schema avroSchema = io . debezium . connector . mysql . SourceInfoTest . avroData . fromConnectSchema ( kafkaSchema ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( ( avroSchema != null ) ) |
testModifyOverrideForcesNameToLowercase ( ) { org . candlepin . model . activationkeys . ActivationKeyContentOverride override = new org . candlepin . model . activationkeys . ActivationKeyContentOverride ( key , "test-repo" , "gpgcheck" , "0" ) ; org . candlepin . model . activationkeys . ActivationKeyContentOverride created = this . activationKeyContentOverrideCurator . create ( override ) ; created . setName ( "GPGCHECK" ) ; org . candlepin . model . activationkeys . ActivationKeyContentOverride merged = this . activationKeyContentOverrideCurator . merge ( created ) ; "<AssertPlaceHolder>" ; } getName ( ) { if ( ( pool ) != null ) { return pool . getProductName ( ) ; } return null ; } | org . junit . Assert . assertEquals ( "gpgcheck" , merged . getName ( ) ) |
testGetArrayLengthForVariableLengthArray ( ) { java . lang . String [ ] strArr = new java . lang . String [ 5 ] ; strArr [ 0 ] = "abx" ; strArr [ 1 ] = "ereref" ; strArr [ 2 ] = "random" ; strArr [ 3 ] = "random12" ; strArr [ 4 ] = "ranzzz" ; org . apache . phoenix . schema . types . PhoenixArray arr = org . apache . phoenix . schema . types . PArrayDataType . instantiatePhoenixArray ( PVarchar . INSTANCE , strArr ) ; byte [ ] bytes = PVarcharArray . INSTANCE . toBytes ( arr ) ; org . apache . hadoop . hbase . io . ImmutableBytesWritable ptr = new org . apache . hadoop . hbase . io . ImmutableBytesWritable ( bytes ) ; int result = org . apache . phoenix . schema . types . PArrayDataType . getArrayLength ( ptr , PVarchar . INSTANCE , null ) ; "<AssertPlaceHolder>" ; } getArrayLength ( org . apache . hadoop . hbase . io . ImmutableBytesWritable , org . apache . phoenix . schema . types . PDataType , java . lang . Integer ) { byte [ ] bytes = ptr . get ( ) ; if ( ( ptr . getLength ( ) ) == 0 ) { return 0 ; } if ( baseType . isFixedWidth ( ) ) { int elemLength = ( maxLength == null ) ? baseType . getByteSize ( ) : maxLength ; return ( ptr . getLength ( ) ) / elemLength ; } return org . apache . hadoop . hbase . util . Bytes . toInt ( bytes , ( ( ( ptr . getOffset ( ) ) + ( ptr . getLength ( ) ) ) - ( ( org . apache . hadoop . hbase . util . Bytes . SIZEOF_BYTE ) + ( org . apache . hadoop . hbase . util . Bytes . SIZEOF_INT ) ) ) ) ; } | org . junit . Assert . assertEquals ( 5 , result ) |
saveRecipientPreferences ( ) { org . kuali . rice . kcb . service . RecipientPreferenceService impl = services . getRecipientPreferenceService ( ) ; org . kuali . rice . kcb . service . MessageDelivererRegistryService delivererService = services . getMessageDelivererRegistryService ( ) ; org . kuali . rice . kcb . deliverer . MessageDeliverer deliverer = delivererService . getDelivererByName ( org . kuali . rice . kcb . service . impl . RecipientPreferenceServiceTest . VALID_DELIVERER_NAME ) ; if ( deliverer == null ) { throw new java . lang . RuntimeException ( "Message<sp>deliverer<sp>could<sp>not<sp>be<sp>obtained" ) ; } java . util . HashMap < java . lang . String , java . lang . String > userprefs = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; userprefs . put ( org . kuali . rice . kcb . service . impl . RecipientPreferenceServiceTest . VALID_PROPERTY , org . kuali . rice . kcb . service . impl . RecipientPreferenceServiceTest . VALID_VALUE ) ; userprefs . put ( "Email.email_delivery_format" , "text" ) ; impl . saveRecipientPreferences ( org . kuali . rice . kcb . service . impl . RecipientPreferenceServiceTest . VALID_USER_ID , userprefs , deliverer ) ; org . kuali . rice . core . api . criteria . QueryByCriteria . Builder criteria = QueryByCriteria . Builder . create ( ) ; criteria . setPredicates ( equal ( "recipientId" , org . kuali . rice . kcb . service . impl . RecipientPreferenceServiceTest . VALID_USER_ID ) ) ; java . util . List < org . kuali . rice . kcb . bo . RecipientPreference > prefs = org . kuali . rice . krad . service . KRADServiceLocator . getDataObjectService ( ) . findMatching ( org . kuali . rice . kcb . bo . RecipientPreference . class , criteria . build ( ) ) . getResults ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . delegate . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , prefs . size ( ) ) |
testComponentCanBeStartedAgainAfterBeingStopped ( ) { com . picocontainer . behaviors . Caching . Cached adapter = new com . picocontainer . behaviors . Caching . Cached ( mockComponentAdapterSupportingLifecycleStrategy ( true , true , false , false , false ) ) ; com . picocontainer . PicoContainer pico = new com . picocontainer . DefaultPicoContainer ( ) ; adapter . start ( pico ) ; java . lang . Object instanceAfterFirstStart = adapter . getComponentInstance ( pico , ComponentAdapter . NOTHING . class ) ; adapter . stop ( pico ) ; adapter . start ( pico ) ; java . lang . Object instanceAfterSecondStart = adapter . getComponentInstance ( pico , ComponentAdapter . NOTHING . class ) ; "<AssertPlaceHolder>" ; } getComponentInstance ( com . picocontainer . PicoContainer , java . lang . reflect . Type ) { return null ; } | org . junit . Assert . assertSame ( instanceAfterFirstStart , instanceAfterSecondStart ) |
convertToShortNull ( ) { java . lang . Boolean t = null ; java . lang . Short s = converter . toShort ( t ) ; "<AssertPlaceHolder>" ; } toShort ( java . lang . Long ) { if ( value == null ) { return null ; } if ( ( value > ( Short . MAX_VALUE ) ) || ( value < ( Short . MIN_VALUE ) ) ) { throw new io . atlasmap . api . AtlasConversionException ( java . lang . String . format ( "Long<sp>%s<sp>is<sp>greater<sp>than<sp>Short.MAX_VALUE<sp>or<sp>less<sp>than<sp>Short.MIN_VALUE" , value ) ) ; } return value . shortValue ( ) ; } | org . junit . Assert . assertNull ( s ) |
shouldGetTimesheetEntriesBefore ( ) { net . rrm . ehour . persistence . timesheet . dao . List < net . rrm . ehour . domain . TimesheetEntry > res = timesheetDAO . getTimesheetEntriesBefore ( new net . rrm . ehour . domain . ProjectAssignment ( 1 ) , new net . rrm . ehour . persistence . timesheet . dao . Date ( ( 2006 - 1900 ) , Calendar . OCTOBER , 3 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return joinTables . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , res . size ( ) ) |
testScalarMultiply ( ) { org . jbasics . math . BigDecimalMatrix input = org . jbasics . math . BigDecimalMatrix . create ( ) . withRowFromLongs ( 1 , ( - 3 ) , 2 ) . withRowFromLongs ( 1 , 2 , 7 ) . build ( ) ; org . jbasics . math . BigDecimalMatrix expected = org . jbasics . math . BigDecimalMatrix . create ( ) . withRowFromLongs ( 5 , ( - 15 ) , 10 ) . withRowFromLongs ( 5 , 10 , 35 ) . build ( ) ; org . jbasics . math . BigDecimalMatrix calculated = input . multiply ( 5 ) ; "<AssertPlaceHolder>" ; } multiply ( org . jbasics . math . polynom . Polynom ) { org . jbasics . math . BigRational [ ] a = this . coefficients ; org . jbasics . math . BigRational [ ] b = q . coefficients ; org . jbasics . math . BigRational [ ] result = new org . jbasics . math . BigRational [ ( ( a . length ) + ( b . length ) ) - 1 ] ; for ( int i = 0 ; i < ( a . length ) ; i ++ ) { for ( int j = 0 ; j < ( b . length ) ; j ++ ) { if ( ( result [ ( i + j ) ] ) == null ) { result [ ( i + j ) ] = a [ i ] . multiply ( b [ j ] ) ; } else { result [ ( i + j ) ] = result [ ( i + j ) ] . add ( a [ i ] . multiply ( b [ j ] ) ) ; } } } return new org . jbasics . math . polynom . Polynom ( result ) ; } | org . junit . Assert . assertEquals ( expected , calculated ) |
newInstance_path_no_env_sh ( ) { putExec ( "bin/hadoop" ) ; putConf ( "conf/core-site.xml" ) ; java . util . Map < java . lang . String , java . lang . String > envp = new java . util . HashMap ( ) ; envp . put ( "PATH" , new java . io . File ( folder . getRoot ( ) , "bin" ) . getAbsolutePath ( ) ) ; org . apache . hadoop . conf . Configuration conf = new com . asakusafw . runtime . util . hadoop . ConfigurationProvider ( envp ) . newInstance ( ) ; "<AssertPlaceHolder>" ; } isLoaded ( org . apache . hadoop . conf . Configuration ) { return c . get ( "testing.conf" , "not<sp>added" ) . equals ( "added" ) ; } | org . junit . Assert . assertThat ( isLoaded ( conf ) , is ( false ) ) |
testFilterGreaterEqual ( ) { io . katharsis . queryspec . QuerySpec querySpec = new io . katharsis . queryspec . QuerySpec ( io . katharsis . jpa . model . TestEntity . class ) ; querySpec . addFilter ( new io . katharsis . queryspec . FilterSpec ( java . util . Arrays . asList ( "longValue" ) , io . katharsis . queryspec . FilterOperator . GE , 1 ) ) ; java . util . List < io . katharsis . jpa . model . TestEntity > list = repo . findAll ( querySpec ) ; "<AssertPlaceHolder>" ; } size ( ) { return list . size ( ) ; } | org . junit . Assert . assertEquals ( 4 , list . size ( ) ) |
testFetchByPrimaryKeyExisting ( ) { com . liferay . document . library . kernel . model . DLFolder newDLFolder = addDLFolder ( ) ; com . liferay . document . library . kernel . model . DLFolder existingDLFolder = _persistence . fetchByPrimaryKey ( newDLFolder . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingDLFolder , newDLFolder ) |
hasPropertyValueForExistingPropertyWithValue ( ) { map . getProperty ( "foo" ) . setValue ( "bar" ) ; "<AssertPlaceHolder>" ; } hasPropertyValue ( java . lang . String ) { if ( ! ( properties . has ( name ) ) ) { return false ; } return properties . get ( name ) . hasValue ( ) ; } | org . junit . Assert . assertTrue ( map . hasPropertyValue ( "foo" ) ) |
keep_successTest ( ) { datawave . query . predicate . EventDataQueryFilter mockFilter1 = org . easymock . EasyMock . createMock ( datawave . query . predicate . EventDataQueryFilter . class ) ; datawave . query . predicate . EventDataQueryFilter mockFilter2 = org . easymock . EasyMock . createMock ( datawave . query . predicate . EventDataQueryFilter . class ) ; org . apache . accumulo . core . data . Key key = new org . apache . accumulo . core . data . Key ( ) ; org . easymock . EasyMock . expect ( mockFilter1 . keep ( key ) ) . andReturn ( true ) ; org . easymock . EasyMock . expect ( mockFilter2 . keep ( key ) ) . andReturn ( true ) ; org . easymock . EasyMock . replay ( mockFilter1 , mockFilter2 ) ; filter . addFilter ( mockFilter1 ) ; filter . addFilter ( mockFilter2 ) ; boolean result = filter . keep ( key ) ; org . easymock . EasyMock . verify ( mockFilter1 , mockFilter2 ) ; "<AssertPlaceHolder>" ; } verify ( java . lang . String , int ) { if ( name . equals ( "between" ) ) { if ( numArgs != 3 ) { throw new java . lang . IllegalArgumentException ( "Wrong<sp>number<sp>of<sp>arguments<sp>to<sp>between<sp>function" ) ; } } else if ( name . equals ( "length" ) ) { if ( numArgs != 3 ) { throw new java . lang . IllegalArgumentException ( "Wrong<sp>number<sp>of<sp>arguments<sp>to<sp>length<sp>function" ) ; } } else if ( name . equals ( QueryFunctions . OPTIONS_FUNCTION ) ) { if ( ( numArgs % 2 ) != 0 ) { throw new java . lang . IllegalArgumentException ( "Expected<sp>even<sp>number<sp>of<sp>arguments<sp>to<sp>options<sp>function" ) ; } } else if ( ( name . equals ( QueryFunctions . UNIQUE_FUNCTION ) ) || ( name . equals ( QueryFunctions . GROUPBY_FUNCTION ) ) ) { if ( numArgs == 0 ) { throw new java . lang . IllegalArgumentException ( ( ( "Expected<sp>at<sp>least<sp>one<sp>argument<sp>to<sp>the<sp>" + name ) + "<sp>function" ) ) ; } } else { throw new java . lang . IllegalArgumentException ( ( "Unknown<sp>Query<sp>function:<sp>" + name ) ) ; } } | org . junit . Assert . assertTrue ( result ) |
test2502355_zoomOutDomain ( ) { org . jfree . data . xy . DefaultXYDataset dataset = new org . jfree . data . xy . DefaultXYDataset ( ) ; org . jfree . chart . JFreeChart chart = org . jfree . chart . ChartFactory . createXYLineChart ( "TestChart" , "X" , "Y" , dataset , PlotOrientation . VERTICAL , false , false , false ) ; org . jfree . chart . plot . XYPlot plot = ( ( org . jfree . chart . plot . XYPlot ) ( chart . getPlot ( ) ) ) ; plot . setDomainAxis ( 1 , new org . jfree . chart . axis . NumberAxis ( "X2" ) ) ; org . jfree . chart . ChartPanel panel = new org . jfree . chart . ChartPanel ( chart ) ; chart . addChangeListener ( this ) ; this . chartChangeEvents . clear ( ) ; panel . zoomOutDomain ( 1.0 , 2.0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return queue . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , this . chartChangeEvents . size ( ) ) |
resolve_by_range_b_e ( ) { final com . groupon . lex . metrics . transformers . IdentifierNameResolver resolver = new com . groupon . lex . metrics . transformers . IdentifierNameResolver ( com . groupon . lex . metrics . transformers . IdentifierNameResolverTest . IDENTIFIER , java . util . Optional . of ( new com . groupon . lex . metrics . transformers . IdentifierNameResolver . SubSelectRange ( java . util . Optional . of ( 0 ) , java . util . Optional . of ( 1 ) ) ) ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String [ ] ) { return com . groupon . lex . metrics . SimpleGroupPath . CACHE . apply ( new com . groupon . lex . metrics . PathArray ( path ) ) ; } | org . junit . Assert . assertEquals ( com . groupon . lex . metrics . SimpleGroupPath . valueOf ( "foo" ) , resolver . apply ( ctx ) . map ( ( p ) -> com . groupon . lex . metrics . SimpleGroupPath . valueOf ( p . getPath ( ) ) ) . get ( ) ) |
testFiltered ( ) { final com . persistit . Exchange exchange = _persistit . getExchange ( _volumeName , "HistogramTestTestFiltered" , true ) ; final int total = 100000 ; final int samples = 10 ; exchange . removeAll ( ) ; for ( int i = 0 ; i < total ; i ++ ) { exchange . getValue ( ) . put ( java . lang . String . format ( "Record<sp>%08d" , i ) ) ; exchange . clear ( ) . append ( i ) ; if ( ( i % 100 ) == 0 ) { exchange . store ( ) ; } exchange . append ( i ) . store ( ) ; } final com . persistit . KeyFilter keyFilter = new com . persistit . KeyFilter ( new com . persistit . KeyFilter . Term [ ] { KeyFilter . ALL } , 0 , 1 ) ; final com . persistit . KeyHistogram histogram = exchange . computeHistogram ( null , null , samples , 1 , keyFilter , 0 ) ; "<AssertPlaceHolder>" ; } getSampleSize ( ) { return _keys . size ( ) ; } | org . junit . Assert . assertEquals ( samples , histogram . getSampleSize ( ) ) |
testDelete_ListOfObjects ( ) { java . util . List < com . jmethods . catatumbo . entities . LongId > entities = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { entities . add ( new com . jmethods . catatumbo . entities . LongId ( ) ) ; } entities = com . jmethods . catatumbo . DatastoreBatchTest . em . insert ( entities ) ; java . util . List < java . lang . Long > identifiers = new java . util . ArrayList ( ) ; for ( com . jmethods . catatumbo . entities . LongId entity : entities ) { identifiers . add ( entity . getId ( ) ) ; } com . jmethods . catatumbo . DatastoreBatch batch = com . jmethods . catatumbo . DatastoreBatchTest . em . newBatch ( ) ; batch . delete ( entities ) ; batch . submit ( ) ; java . util . List < com . jmethods . catatumbo . entities . LongId > retrievedEntities = com . jmethods . catatumbo . DatastoreBatchTest . em . loadById ( com . jmethods . catatumbo . entities . LongId . class , identifiers ) ; "<AssertPlaceHolder>" ; } get ( K ) { return map . get ( key ) ; } | org . junit . Assert . assertTrue ( ( ( ( ( ( ( retrievedEntities . get ( 0 ) ) == null ) && ( ( retrievedEntities . get ( 1 ) ) == null ) ) && ( ( retrievedEntities . get ( 2 ) ) == null ) ) && ( ( retrievedEntities . get ( 3 ) ) == null ) ) && ( ( retrievedEntities . get ( 4 ) ) == null ) ) ) |
testTryWithSwitch ( ) { int x = 0 ; int y = 0 ; int z = 0 ; try { switch ( x ) { case 0 : { y ++ ; } case 1 : { y += 3 ; } } } catch ( final java . lang . RuntimeException e ) { if ( x > 0 ) { y = 10 ; doSomething ( ) ; y = 15 ; } else { y = 20 ; doSomething ( ) ; y = 25 ; } x = - 1 ; } finally { z ++ ; if ( z > 0 ) { z = 12 ; } else { z = 13 ; } doSomething ( ) ; } "<AssertPlaceHolder>" ; } doSomething ( ) { } | org . junit . Assert . assertEquals ( 4 , y , 0 ) |
testSetAllSendBufferSize ( ) { org . kaazing . mina . netty . socket . nio . DefaultNioSocketChannelIoSessionConfig config = new org . kaazing . mina . netty . socket . nio . DefaultNioSocketChannelIoSessionConfig ( ) ; config . init ( new org . kaazing . mina . netty . socket . nio . NioSocketChannelIoAcceptor ( config ) ) ; config . setSendBufferSize ( 2048 ) ; org . kaazing . mina . netty . socket . nio . NioSocketChannelIoSessionConfig acceptedConfig = new org . kaazing . mina . netty . socket . nio . NioSocketChannelIoSessionConfig ( new org . kaazing . mina . netty . socket . nio . DefaultNioSocketChannelIoSessionConfigTest . DefaultNioSocketChannelConfig ( new java . net . Socket ( ) ) ) ; acceptedConfig . setAll ( config ) ; "<AssertPlaceHolder>" ; } getSendBufferSize ( ) { return sendBufferSize ; } | org . junit . Assert . assertEquals ( config . getSendBufferSize ( ) , acceptedConfig . getSendBufferSize ( ) ) |
shouldReturnTrueWhenCheckIfTransfersAreValidAndTransfersArentNull ( ) { com . qcadoo . model . api . Entity transferConsumption = mockTransfer ( com . qcadoo . mes . materialFlow . hooks . TransformationsModelValidatorsTest . L_NUMBER_CONSUMPTION_1 , productProduction , BigDecimal . ONE ) ; com . qcadoo . model . api . Entity transferProduction = mockTransfer ( com . qcadoo . mes . materialFlow . hooks . TransformationsModelValidatorsTest . L_NUMBER_PRODUCTION_1 , productProduction , BigDecimal . ONE ) ; stubHasManyField ( transformations , com . qcadoo . mes . materialFlow . hooks . TRANSFERS_CONSUMPTION , com . google . common . collect . Lists . newArrayList ( transferConsumption ) ) ; stubHasManyField ( transformations , com . qcadoo . mes . materialFlow . hooks . TRANSFERS_PRODUCTION , com . google . common . collect . Lists . newArrayList ( transferProduction ) ) ; boolean result = transformationsModelValidators . checkIfTransfersAreValid ( transformationsDD , transformations ) ; "<AssertPlaceHolder>" ; } checkIfTransfersAreValid ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { java . util . List < com . qcadoo . model . api . Entity > transfersConsumption = transformations . getHasManyField ( com . qcadoo . mes . materialFlow . hooks . TRANSFERS_CONSUMPTION ) ; java . util . List < com . qcadoo . model . api . Entity > transfersProduction = transformations . getHasManyField ( com . qcadoo . mes . materialFlow . hooks . TRANSFERS_PRODUCTION ) ; java . lang . Iterable < java . lang . Boolean > validationResults = com . google . common . collect . Lists . newArrayList ( areTransfersValid ( transfersConsumption ) , areTransfersValid ( transfersProduction ) , checkIfTransfersNumbersAreDistinct ( transfersConsumption , transfersProduction ) , checkIfTransfersNumbersAreDistinct ( transfersProduction , transfersConsumption ) ) ; return com . google . common . collect . Iterables . all ( validationResults , com . google . common . base . Predicates . equalTo ( true ) ) ; } | org . junit . Assert . assertTrue ( result ) |
testJsonElementToObject ( ) { com . google . gson . Gson gson = new com . google . gson . Gson ( ) ; org . eclipse . lsp4j . Position position = new org . eclipse . lsp4j . Position ( 5 , 5 ) ; com . google . gson . JsonElement element = gson . toJsonTree ( position ) ; org . eclipse . lsp4j . Position position2 = org . eclipse . jdt . ls . core . internal . JSONUtility . toModel ( element , org . eclipse . lsp4j . Position . class ) ; "<AssertPlaceHolder>" ; } toModel ( java . lang . Object , java . lang . Class ) { if ( object == null ) { return null ; } if ( clazz == null ) { throw new java . lang . IllegalArgumentException ( "Class<sp>can<sp>not<sp>be<sp>null" ) ; } if ( object instanceof com . google . gson . JsonElement ) { com . google . gson . Gson gson = new com . google . gson . Gson ( ) ; return gson . fromJson ( ( ( com . google . gson . JsonElement ) ( object ) ) , clazz ) ; } if ( object instanceof java . lang . String ) { com . google . gson . Gson gson = new com . google . gson . Gson ( ) ; return gson . fromJson ( ( ( java . lang . String ) ( object ) ) , clazz ) ; } if ( clazz . isInstance ( object ) ) { return clazz . cast ( object ) ; } return null ; } | org . junit . Assert . assertEquals ( position , position2 ) |
getResultingSize2WithNonAspectFillAndUpscaling ( ) { final edu . illinois . library . cantaloupe . image . Dimension fullSize = new edu . illinois . library . cantaloupe . image . Dimension ( 600 , 400 ) ; final edu . illinois . library . cantaloupe . operation . ReductionFactor rf = new edu . illinois . library . cantaloupe . operation . ReductionFactor ( 1 ) ; final edu . illinois . library . cantaloupe . image . ScaleConstraint sc = new edu . illinois . library . cantaloupe . image . ScaleConstraint ( 1 , 2 ) ; instance . setMode ( Scale . Mode . NON_ASPECT_FILL ) ; instance . setWidth ( 1200 ) ; instance . setHeight ( 600 ) ; "<AssertPlaceHolder>" ; } getResultingSize ( edu . illinois . library . cantaloupe . image . Dimension , edu . illinois . library . cantaloupe . operation . ReductionFactor , edu . illinois . library . cantaloupe . image . ScaleConstraint ) { final edu . illinois . library . cantaloupe . image . Dimension size = new edu . illinois . library . cantaloupe . image . Dimension ( imageSize ) ; final double rfScale = reductionFactor . getScale ( ) ; final double scScale = scaleConstraint . getRational ( ) . doubleValue ( ) ; if ( ( getPercent ( ) ) != null ) { final double scalePct = ( getPercent ( ) ) * ( scScale / rfScale ) ; size . setWidth ( ( ( size . width ( ) ) * scalePct ) ) ; size . setHeight ( ( ( size . height ( ) ) * scalePct ) ) ; } else { switch ( getMode ( ) ) { case FULL : double scalePct = scScale / rfScale ; size . setWidth ( ( ( size . width ( ) ) * scalePct ) ) ; size . setHeight ( ( ( size . height ( ) ) * scalePct ) ) ; break ; case ASPECT_FIT_HEIGHT : scalePct = ( getHeight ( ) ) / ( size . height ( ) ) ; size . setWidth ( ( ( size . width ( ) ) * scalePct ) ) ; size . setHeight ( ( ( size . height ( ) ) * scalePct ) ) ; break ; case ASPECT_FIT_WIDTH : scalePct = ( getWidth ( ) ) / ( size . width ( ) ) ; size . setWidth ( ( ( size . width ( ) ) * scalePct ) ) ; size . setHeight ( ( ( size . height ( ) ) * scalePct ) ) ; break ; case ASPECT_FIT_INSIDE : scalePct = java . lang . Math . min ( ( ( getWidth ( ) ) / ( size . width ( ) ) ) , ( ( getHeight ( ) ) / ( size . height ( ) ) ) ) ; size . setWidth ( ( ( size . width ( ) ) * scalePct ) ) ; size . setHeight ( ( ( size . height ( ) ) * scalePct ) ) ; if ( ( ( ( size . width ( ) ) / ( imageSize . width ( ) ) ) > ( maxScale ) ) || ( ( ( size . height ( ) ) / ( imageSize . height ( ) ) ) > ( maxScale ) ) ) { size . setWidth ( imageSize . width ( ) ) ; size . setHeight ( imageSize . height ( ) ) ; } break ; case NON_ASPECT_FILL : size . setWidth ( getWidth ( ) ) ; size . setHeight ( getHeight ( ) ) ; break ; } } return size ; } | org . junit . Assert . assertEquals ( new edu . illinois . library . cantaloupe . image . Dimension ( 1200 , 600 ) , instance . getResultingSize ( fullSize , rf , sc ) ) |
testGetLabel ( ) { java . lang . String label = "R3" ; org . openscience . smsd . helper . LabelContainer instance = new org . openscience . smsd . helper . LabelContainer ( ) ; instance . addLabel ( label ) ; java . lang . Integer index = 2 ; java . lang . String result = instance . getLabel ( index ) ; "<AssertPlaceHolder>" ; } getLabel ( java . lang . Integer ) { return labelMap . get ( labelID ) ; } | org . junit . Assert . assertEquals ( label , result ) |
testEqualsAfterFirstHashCode ( ) { de . vksi . c4j . acceptancetest . point . Point point1 = new de . vksi . c4j . acceptancetest . point . Point ( 3 , 4 ) ; de . vksi . c4j . acceptancetest . point . Point point2 = new de . vksi . c4j . acceptancetest . point . Point ( 4 , 4 ) ; point2 . setX ( 3 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return set . equals ( obj ) ; } | org . junit . Assert . assertTrue ( point1 . equals ( point2 ) ) |
testCollectOneFoundNothing ( ) { java . lang . String jsonPathFoundNothing = "$..authors" ; java . lang . Object expireNull = surfer . collectOne ( read ( "sample.json" ) , jsonPathFoundNothing ) ; "<AssertPlaceHolder>" ; } read ( java . lang . String ) { com . fasterxml . jackson . databind . ObjectMapper om = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; com . fasterxml . jackson . databind . JsonNode node = om . readTree ( this . readAsString ( resourceName ) ) ; com . fasterxml . jackson . dataformat . smile . SmileFactory f = new com . fasterxml . jackson . dataformat . smile . SmileFactory ( ) ; com . fasterxml . jackson . databind . ObjectMapper cborMapper = new com . fasterxml . jackson . databind . ObjectMapper ( f ) ; byte [ ] smileData = cborMapper . writeValueAsBytes ( node ) ; return new java . io . ByteArrayInputStream ( smileData ) ; } | org . junit . Assert . assertNull ( expireNull ) |
testConvertAllWithNoRelations ( ) { java . lang . String name = "first<sp>blood" ; java . lang . String abbrName = "fb" ; org . lnu . is . domain . paper . type . PaperType source = new org . lnu . is . domain . paper . type . PaperType ( ) ; source . setName ( name ) ; source . setAbbrName ( abbrName ) ; org . lnu . is . resource . paper . type . PaperTypeResource expected = new org . lnu . is . resource . paper . type . PaperTypeResource ( ) ; expected . setName ( name ) ; expected . setAbbrName ( abbrName ) ; java . util . List < org . lnu . is . domain . paper . type . PaperType > sources = java . util . Arrays . asList ( source ) ; java . util . List < org . lnu . is . resource . paper . type . PaperTypeResource > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . resource . paper . type . PaperTypeResource > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; } | org . junit . Assert . assertEquals ( expecteds , actuals ) |
testLookupKnownCRSFromGML ( ) { org . deegree . cs . coordinatesystems . ICRS crs = org . deegree . cs . persistence . CRSManager . lookup ( org . deegree . cs . persistence . WorkspaceTest . STORE_GML1 , org . deegree . cs . persistence . WorkspaceTest . CRS_FROM_GML1 ) ; "<AssertPlaceHolder>" ; } lookup ( java . lang . String , boolean ) { return org . deegree . cs . persistence . CRSManager . lookup ( null , name , forceXY ) ; } | org . junit . Assert . assertNotNull ( crs ) |
testTreeGetString ( ) { org . jdesktop . swingx . decorator . ComponentAdapterTest . JXTreeT tree = new org . jdesktop . swingx . decorator . ComponentAdapterTest . JXTreeT ( org . jdesktop . test . AncientSwingTeam . createNamedColorTreeModel ( ) ) ; tree . expandAll ( ) ; tree . setCellRenderer ( new org . jdesktop . swingx . renderer . DefaultTreeRenderer ( sv ) ) ; java . lang . String text = sv . getString ( ( ( javax . swing . tree . DefaultMutableTreeNode ) ( tree . getPathForRow ( 2 ) . getLastPathComponent ( ) ) ) . getUserObject ( ) ) ; org . jdesktop . swingx . decorator . ComponentAdapter adapter = tree . getComponentAdapter ( 2 ) ; "<AssertPlaceHolder>" ; } getComponentAdapter ( int ) { org . jdesktop . swingx . decorator . ComponentAdapter adapter = getComponentAdapter ( ) ; adapter . column = 0 ; adapter . row = index ; return adapter ; } | org . junit . Assert . assertEquals ( text , adapter . getString ( ) ) |
testNoLoopback ( ) { if ( ( nonLoopBackInterfaces . size ( ) ) < 1 ) { return ; } java . net . InetAddress target = java . net . InetAddress . getByName ( "127.0.0.2" ) ; org . jboss . as . controller . interfaces . LoopbackAddressInterfaceCriteria testee = new org . jboss . as . controller . interfaces . LoopbackAddressInterfaceCriteria ( target ) ; java . util . Map < java . net . NetworkInterface , java . util . Set < java . net . InetAddress > > candidates = new java . util . HashMap < java . net . NetworkInterface , java . util . Set < java . net . InetAddress > > ( ) ; for ( java . net . NetworkInterface ni : nonLoopBackInterfaces ) { candidates . put ( ni , allCandidates . get ( ni ) ) ; } java . util . Map < java . net . NetworkInterface , java . util . Set < java . net . InetAddress > > result = testee . getAcceptableAddresses ( candidates ) ; "<AssertPlaceHolder>" ; } size ( ) { return definitions . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testFailureCompressionNotWorking ( ) { if ( skip ) return ; long rawDataSize = writeRecords ( 10000 , false , false , false ) ; if ( ! ( compression . equalsIgnoreCase ( Compression . Algorithm . NONE . getName ( ) ) ) ) { "<AssertPlaceHolder>" ; } closeOutput ( ) ; } getPos ( ) { return currentPos ; } | org . junit . Assert . assertTrue ( ( ( out . getPos ( ) ) < rawDataSize ) ) |
testDataDictionaryBuilder_source_unknownPackage ( ) { java . lang . String UNKNOWN_PACKAGE = ( org . kuali . rice . krad . datadictionary . DataDictionaryBuilderTest . TESTPACKAGE_INVALID ) + "foo/" ; boolean failedAsExpected = false ; try { dd . addConfigFileLocation ( "KR-SAP" , UNKNOWN_PACKAGE ) ; } catch ( org . kuali . rice . krad . datadictionary . DataDictionaryException e ) { failedAsExpected = true ; } "<AssertPlaceHolder>" ; } addConfigFileLocation ( java . lang . String , java . lang . String ) { if ( ! ( moduleLoadOrder . contains ( namespaceCode ) ) ) { moduleLoadOrder . add ( namespaceCode ) ; } indexSource ( namespaceCode , location ) ; } | org . junit . Assert . assertTrue ( failedAsExpected ) |
testErrorInListenerWithExceptionHandler ( ) { getApplicationContext ( ) . setExceptionHandler ( exceptionHandler ) ; java . lang . Error error = new java . lang . Error ( ) ; addMaliciousListener ( SWT . Resize , error ) ; generateEvent ( shell , SWT . Resize ) ; try { display . readAndDispatch ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Error expected ) { "<AssertPlaceHolder>" ; } verify ( exceptionHandler ) . handleException ( error ) ; } readAndDispatch ( ) { checkDevice ( ) ; return safeReadAndDispatch ( ) ; } | org . junit . Assert . assertSame ( error , expected ) |
testPasteWithKeyFrameInClipboardDoesAttemptInsert ( ) { setCurrentFrame ( au . gov . ga . worldwind . animator . application . KeyFrameClipboardTest . FRAME_WITH_KEY ) ; classToBeTested . copySelectedKeyFrame ( ) ; "<AssertPlaceHolder>" ; expectCallToInsertKeyFrame ( ) ; classToBeTested . pasteSelectedKeyFrame ( ) ; } isKeyFrameInClipboard ( ) { return ( clipboardKeyFrame ) != null ; } | org . junit . Assert . assertTrue ( classToBeTested . isKeyFrameInClipboard ( ) ) |
testStrangeRetainAllCase ( ) { final it . unimi . dsi . fastutil . ints . IntArrayList initialElements = it . unimi . dsi . fastutil . ints . IntArrayList . wrap ( new int [ ] { 586 , 940 , 1086 , 1110 , 1168 , 1184 , 1185 , 1191 , 1196 , 1229 , 1237 , 1241 , 1277 , 1282 , 1284 , 1299 , 1308 , 1309 , 1310 , 1314 , 1328 , 1360 , 1366 , 1370 , 1378 , 1388 , 1392 , 1402 , 1406 , 1411 , 1426 , 1437 , 1455 , 1476 , 1489 , 1513 , 1533 , 1538 , 1540 , 1541 , 1543 , 1547 , 1548 , 1551 , 1557 , 1568 , 1575 , 1577 , 1582 , 1583 , 1584 , 1588 , 1591 , 1592 , 1601 , 1610 , 1618 , 1620 , 1633 , 1635 , 1653 , 1654 , 1655 , 1660 , 1661 , 1665 , 1674 , 1686 , 1688 , 1693 , 1700 , 1705 , 1717 , 1720 , 1732 , 1739 , 1740 , 1745 , 1746 , 1752 , 1754 , 1756 , 1765 , 1766 , 1767 , 1771 , 1772 , 1781 , 1789 , 1790 , 1793 , 1801 , 1806 , 1823 , 1825 , 1827 , 1828 , 1829 , 1831 , 1832 , 1837 , 1839 , 1844 , 2962 , 2969 , 2974 , 2990 , 3019 , 3023 , 3029 , 3030 , 3052 , 3072 , 3074 , 3075 , 3093 , 3109 , 3110 , 3115 , 3116 , 3125 , 3137 , 3142 , 3156 , 3160 , 3176 , 3180 , 3188 , 3193 , 3198 , 3207 , 3209 , 3210 , 3213 , 3214 , 3221 , 3225 , 3230 , 3231 , 3236 , 3240 , 3247 , 3261 , 4824 , 4825 , 4834 , 4845 , 4852 , 4858 , 4859 , 4867 , 4871 , 4883 , 4886 , 4887 , 4905 , 4907 , 4911 , 4920 , 4923 , 4924 , 4925 , 4934 , 4942 , 4953 , 4957 , 4965 , 4973 , 4976 , 4980 , 4982 , 4990 , 4993 , 6938 , 6949 , 6953 , 7010 , 7012 , 7034 , 7037 , 7049 , 7076 , 7094 , 7379 , 7384 , 7388 , 7394 , 7414 , 7419 , 7458 , 7459 , 7466 , 7467 } ) ; final it . unimi . dsi . fastutil . ints . IntArrayList retainElements = it . unimi . dsi . fastutil . ints . IntArrayList . wrap ( new int [ ] { 586 } ) ; final it . unimi . dsi . fastutil . ints . Int2IntOpenHashMap instance = new it . unimi . dsi . fastutil . ints . Int2IntOpenHashMap ( initialElements . elements ( ) , new int [ initialElements . size ( ) ] ) ; final it . unimi . dsi . fastutil . ints . IntRBTreeSet referenceInstance = new it . unimi . dsi . fastutil . ints . IntRBTreeSet ( initialElements ) ; instance . keySet ( ) . retainAll ( retainElements ) ; referenceInstance . retainAll ( retainElements ) ; "<AssertPlaceHolder>" ; } keySet ( ) { return delegate . keySet ( ) ; } | org . junit . Assert . assertEquals ( referenceInstance , instance . keySet ( ) ) |
testExplicitRouteParser ( ) { final org . opendaylight . protocol . rsvp . parser . impl . te . ExplicitRouteObjectParser parser = new org . opendaylight . protocol . rsvp . parser . impl . te . ExplicitRouteObjectParser ( this . context . getEROSubobjectHandlerRegistry ( ) ) ; final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . rsvp . rev150820 . RsvpTeObject obj = parser . parseObject ( io . netty . buffer . Unpooled . copiedBuffer ( org . opendaylight . protocol . util . ByteArray . subByte ( TEObjectUtil . TE_LSP_EXPLICIT , 4 , ( ( TEObjectUtil . TE_LSP_EXPLICIT . length ) - 4 ) ) ) ) ; final io . netty . buffer . ByteBuf output = io . netty . buffer . Unpooled . buffer ( ) ; parser . serializeObject ( obj , output ) ; "<AssertPlaceHolder>" ; } getAllBytes ( io . netty . buffer . ByteBuf ) { return org . opendaylight . protocol . util . ByteArray . getBytes ( buffer , buffer . readableBytes ( ) ) ; } | org . junit . Assert . assertArrayEquals ( TEObjectUtil . TE_LSP_EXPLICIT , org . opendaylight . protocol . util . ByteArray . getAllBytes ( output ) ) |
CannotRemoveStudents ( ) { cruise . associations . MentorT m = new cruise . associations . MentorT ( "blah" ) ; cruise . associations . StudentT s = new cruise . associations . StudentT ( 99 ) ; cruise . associations . StudentT s2 = new cruise . associations . StudentT ( 98 ) ; cruise . associations . StudentT s3 = new cruise . associations . StudentT ( 97 ) ; m . setStudents ( s , s2 , s3 ) ; "<AssertPlaceHolder>" ; } removeStudent ( Student ) { boolean wasRemoved = false ; if ( ! ( students . contains ( aStudent ) ) ) { return wasRemoved ; } int oldIndex = students . indexOf ( aStudent ) ; students . remove ( oldIndex ) ; if ( ( aStudent . indexOfProgram ( this ) ) == ( - 1 ) ) { wasRemoved = true ; } else { wasRemoved = aStudent . removeProgram ( this ) ; if ( ! wasRemoved ) { students . add ( oldIndex , aStudent ) ; } } return wasRemoved ; } | org . junit . Assert . assertEquals ( false , m . removeStudent ( s3 ) ) |
getFormattedElement ( ) { org . apache . servicecomb . transport . rest . vertx . accesslog . AccessLogParam < io . vertx . ext . web . RoutingContext > param = new org . apache . servicecomb . transport . rest . vertx . accesslog . AccessLogParam ( ) ; io . vertx . ext . web . RoutingContext mockContext = org . mockito . Mockito . mock ( io . vertx . ext . web . RoutingContext . class ) ; java . util . HashSet < io . vertx . ext . web . Cookie > cookieSet = new java . util . HashSet ( ) ; java . lang . String cookieValue = "cookieValue" ; io . vertx . ext . web . impl . CookieImpl cookie = new io . vertx . ext . web . impl . CookieImpl ( org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . CookieItemTest . COOKIE_NAME , cookieValue ) ; cookieSet . add ( cookie ) ; org . mockito . Mockito . when ( mockContext . cookieCount ( ) ) . thenReturn ( 1 ) ; org . mockito . Mockito . when ( mockContext . cookies ( ) ) . thenReturn ( cookieSet ) ; param . setContextData ( mockContext ) ; java . lang . String result = org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . CookieItemTest . ELEMENT . getFormattedItem ( param ) ; "<AssertPlaceHolder>" ; } getFormattedItem ( org . apache . servicecomb . transport . rest . vertx . accesslog . AccessLogParam ) { java . util . Set < io . vertx . ext . web . Cookie > cookieSet = accessLogParam . getContextData ( ) . cookies ( ) ; if ( null == cookieSet ) { return org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . CookieItem . RESULT_NOT_FOUND ; } java . lang . String result = null ; for ( io . vertx . ext . web . Cookie cookie : cookieSet ) { if ( varName . equals ( cookie . getName ( ) ) ) { result = cookie . getValue ( ) ; } } if ( null == result ) { return org . apache . servicecomb . transport . rest . vertx . accesslog . element . impl . CookieItem . RESULT_NOT_FOUND ; } return result ; } | org . junit . Assert . assertEquals ( cookieValue , result ) |
testGetJobExecutionsNoTran ( ) { final javax . batch . operations . JobOperator mockJobOperator = mockery . mock ( javax . batch . operations . JobOperator . class ) ; final javax . transaction . TransactionManager mockTranMgr = mockery . mock ( javax . transaction . TransactionManager . class ) ; final java . util . List < javax . batch . runtime . JobExecution > retMe = new java . util . ArrayList < javax . batch . runtime . JobExecution > ( ) ; mockery . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockTranMgr ) . suspend ( ) ; will ( returnValue ( null ) ) ; oneOf ( mockJobOperator ) . getJobExecutions ( null ) ; will ( returnValue ( retMe ) ) ; } } ) ; "<AssertPlaceHolder>" ; } buildJobOperator ( javax . batch . operations . JobOperator , javax . transaction . TransactionManager ) { com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran retMe = new com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran ( ) ; retMe . setTransactionManager ( mockTranMgr ) ; retMe . setJobOperator ( mockJobOperator ) ; return retMe ; } | org . junit . Assert . assertEquals ( retMe , buildJobOperator ( mockJobOperator , mockTranMgr ) . getJobExecutions ( null ) ) |
When_fluid_set_group_Should_set_group ( ) { class TestSystem extends com . artemis . BaseSystem { public com . artemis . managers . GroupManager groupManager ; @ com . artemis . generator . strategy . e . Override protected void processSystem ( ) { com . artemis . Entity entity = com . artemis . E . E ( ) . group ( "test" ) . entity ( ) ; "<AssertPlaceHolder>" ; } } runFluidWorld ( new TestSystem ( ) , new com . artemis . managers . GroupManager ( ) ) ; } isInGroup ( int , java . lang . String ) { final com . artemis . Entity e = world . getEntity ( entityId ) ; return isInGroup ( e , group ) ; } | org . junit . Assert . assertTrue ( groupManager . isInGroup ( entity , "test" ) ) |
getServiceParameterList_subscriptionParameter_valueNotSet_noFilter ( ) { parameters . add ( createParameter ( 1L , false , "param<sp>value<sp>one_time<sp>(not<sp>set)" , createParameterDefinition ( 1001L , ParameterModificationType . ONE_TIME , "one_time<sp>parameterId" , true ) ) ) ; java . util . List < org . oscm . provisioning . data . ServiceParameter > parameterList = org . oscm . applicationservice . filter . ParameterFilter . getServiceParameterList ( product , false ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , parameterList . size ( ) ) |
testDropThenQuery ( ) { com . j256 . ormlite . dao . Dao < com . j256 . ormlite . table . TableUtilsTest . LocalFoo , java . lang . Integer > fooDao = createDao ( com . j256 . ormlite . table . TableUtilsTest . LocalFoo . class , true ) ; "<AssertPlaceHolder>" ; dropTable ( com . j256 . ormlite . table . TableUtilsTest . LocalFoo . class , true ) ; try { fooDao . queryForAll ( ) ; org . junit . Assert . fail ( "Should<sp>have<sp>thrown" ) ; } catch ( java . sql . SQLException e ) { } } queryForAll ( ) { try { return dao . queryForAll ( ) ; } catch ( java . sql . SQLException e ) { logMessage ( e , "queryForAll<sp>threw<sp>exception" ) ; throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( 0 , fooDao . queryForAll ( ) . size ( ) ) |
testMergeAclEntriesAutomaticDefaultGroup ( ) { java . util . List < org . apache . hadoop . fs . permission . AclEntry > existing = new com . google . common . collect . ImmutableList . Builder < org . apache . hadoop . fs . permission . AclEntry > ( ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . ALL ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . GROUP , org . apache . hadoop . hdfs . server . namenode . READ ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . OTHER , org . apache . hadoop . hdfs . server . namenode . READ ) ) . build ( ) ; java . util . List < org . apache . hadoop . fs . permission . AclEntry > aclSpec = com . google . common . collect . Lists . newArrayList ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . READ_EXECUTE ) , aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . OTHER , org . apache . hadoop . hdfs . server . namenode . READ ) ) ; java . util . List < org . apache . hadoop . fs . permission . AclEntry > expected = new com . google . common . collect . ImmutableList . Builder < org . apache . hadoop . fs . permission . AclEntry > ( ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . ALL ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . GROUP , org . apache . hadoop . hdfs . server . namenode . READ ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . OTHER , org . apache . hadoop . hdfs . server . namenode . READ ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . READ_EXECUTE ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . GROUP , org . apache . hadoop . hdfs . server . namenode . READ ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . OTHER , org . apache . hadoop . hdfs . server . namenode . READ ) ) . build ( ) ; "<AssertPlaceHolder>" ; } mergeAclEntries ( java . util . List , java . util . List ) { org . apache . hadoop . hdfs . server . namenode . AclTransformation . ValidatedAclSpec aclSpec = new org . apache . hadoop . hdfs . server . namenode . AclTransformation . ValidatedAclSpec ( inAclSpec ) ; java . util . ArrayList < org . apache . hadoop . fs . permission . AclEntry > aclBuilder = com . google . common . collect . Lists . newArrayListWithCapacity ( org . apache . hadoop . hdfs . server . namenode . AclTransformation . MAX_ENTRIES ) ; java . util . List < org . apache . hadoop . fs . permission . AclEntry > foundAclSpecEntries = com . google . common . collect . Lists . newArrayListWithCapacity ( org . apache . hadoop . hdfs . server . namenode . AclTransformation . MAX_ENTRIES ) ; java . util . EnumMap < org . apache . hadoop . hdfs . server . namenode . AclEntryScope , org . apache . hadoop . fs . permission . AclEntry > providedMask = com . google . common . collect . Maps . newEnumMap ( org . apache . hadoop . hdfs . server . namenode . AclEntryScope . class ) ; java . util . EnumSet < org . apache . hadoop . hdfs . server . namenode . AclEntryScope > maskDirty = java . util . EnumSet . noneOf ( org . apache . hadoop . hdfs . server . namenode . AclEntryScope . class ) ; java . util . EnumSet < org . apache . hadoop . hdfs . server . namenode . AclEntryScope > scopeDirty = java . util . EnumSet . noneOf ( org . apache . hadoop . hdfs . server . namenode . AclEntryScope . class ) ; for ( org . apache . hadoop . fs . permission . AclEntry existingEntry : existingAcl ) { org . apache . hadoop . fs . permission | org . junit . Assert . assertEquals ( expected , mergeAclEntries ( existing , aclSpec ) ) |
getString_test ( ) { pref . edit ( ) . putString ( "string" , "value" ) . commit ( ) ; com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . core . system . AndroidPreferences preferences = new com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . core . system . AndroidPreferences ( context , com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . core . system . AndroidPreferencesTest . preferencesKey ) ; java . lang . String value = preferences . getString ( "string" , "other" ) ; "<AssertPlaceHolder>" ; } getString ( java . lang . String , java . lang . String ) { return preferences . getString ( key , optValue ) ; } | org . junit . Assert . assertThat ( value , org . hamcrest . Matchers . is ( "value" ) ) |
testIsShowFunction ( ) { java . util . List < org . talend . core . model . process . IElementParameter > parameters = new java . util . ArrayList < org . talend . core . model . process . IElementParameter > ( ) ; param1 = createMockParameter ( "PARA1" , false , "isShow[PARA3]" ) ; param2 = createMockParameter ( "PARA2" , false , "isShow[PARA1]" ) ; param3 = createMockParameter ( "PARA3" , false , "isShow[PARA2]" ) ; updateParameters ( parameters , param1 , param2 , param3 ) ; "<AssertPlaceHolder>" ; } evaluate ( java . lang . String , java . util . List , org . talend . designer . core . model . components . ElementParameter ) { if ( Boolean . FALSE . toString ( ) . equals ( string ) ) { return false ; } if ( Boolean . TRUE . toString ( ) . equals ( string ) ) { return true ; } if ( ( string . contains ( "(" ) ) && ( ( org . talend . designer . core . model . components . Expression . isThereCondition ( string , org . talend . designer . core . model . components . Expression . AND ) ) || ( org . talend . designer . core . model . components . Expression . isThereCondition ( string , org . talend . designer . core . model . components . Expression . OR ) ) ) ) { return org . talend . designer . core . model . components . Expression . evaluateExpression ( new org . talend . designer . core . model . components . Expression ( string ) , listParam , curParam ) . isValid ( ) ; } else { java . lang . String newValue ; newValue = string . replace ( "(" , "" ) ; newValue = newValue . replace ( ")" , "" ) ; return org . talend . designer . core . model . components . Expression . evaluateSimpleExpression ( newValue , listParam , curParam ) ; } } | org . junit . Assert . assertFalse ( org . talend . designer . core . model . components . Expression . evaluate ( "isShow[PARA2]" , parameters , param3 ) ) |
query1 ( ) { for ( java . lang . String s : query ( ) . from ( survey ) . select ( survey . name ) . fetch ( ) ) { "<AssertPlaceHolder>" ; } } fetch ( ) { return innerList ( ) ; } | org . junit . Assert . assertNotNull ( s ) |
createWithClause_whenTableSupportsOidsButDoesNotHaveOids_shouldNotDisplayWithClause ( ) { setupGeneralWhenMocks ( false ) ; java . lang . String withClause = serverExtension . createWithClause ( table , null ) ; "<AssertPlaceHolder>" ; } createWithClause ( org . jkiss . dbeaver . ext . greenplum . model . PostgreTableRegular , org . jkiss . dbeaver . ext . greenplum . model . PostgreTableBase ) { return org . jkiss . dbeaver . ext . greenplum . model . GreenplumWithClauseBuilder . generateWithClause ( table , tableBase ) ; } | org . junit . Assert . assertEquals ( "" , withClause ) |
test_zero_long_long ( ) { long result = server . bounce_long_long ( 0L ) ; "<AssertPlaceHolder>" ; } bounce_long_long ( long ) { return x ; } | org . junit . Assert . assertEquals ( 0L , result ) |
should_send_email_when_contract_expires_in_1_month ( ) { com . autentia . tnt . businessobject . User user = com . autentia . tnt . test . utils . SpringUtilsForTesting . createUser ( "contract-1m" ) ; user . setEndContractDate ( java . util . Date . from ( java . time . LocalDate . now ( ) . plusMonths ( 1 ) . atStartOfDay ( java . time . ZoneId . systemDefault ( ) ) . toInstant ( ) ) ) ; com . autentia . tnt . dao . hibernate . UserDAO userDAO = ( ( com . autentia . tnt . dao . hibernate . UserDAO ) ( com . autentia . tnt . util . SpringUtils . getSpringBean ( "daoUser" ) ) ) ; userDAO . insert ( user ) ; com . autentia . tnt . bean . ContractExpirationNotificationBean sut = new com . autentia . tnt . bean . ContractExpirationNotificationBean ( mailService ) ; int userCount = sut . checkExpirationDate ( ) ; "<AssertPlaceHolder>" ; } checkExpirationDate ( ) { authenticateAs ( com . autentia . tnt . util . ConfigurationUtil . getDefault ( ) . getAdminUser ( ) ) ; java . util . Date today = java . util . Date . from ( java . time . LocalDate . now ( ) . atStartOfDay ( java . time . ZoneId . systemDefault ( ) ) . toInstant ( ) ) ; java . util . Date inThreeMonths = java . util . Date . from ( java . time . LocalDate . now ( ) . plusMonths ( 3 ) . atStartOfDay ( java . time . ZoneId . systemDefault ( ) ) . toInstant ( ) ) ; com . autentia . tnt . dao . search . UserSearch search = new com . autentia . tnt . dao . search . UserSearch ( ) ; search . setActive ( true ) ; search . setStartEndContractDate ( today ) ; search . setEndEndContractDate ( inThreeMonths ) ; java . util . List < com . autentia . tnt . businessobject . User > users = com . autentia . tnt . manager . admin . UserManager . getDefault ( ) . getAllEntities ( search , null ) ; search . reset ( ) ; search . setActive ( true ) ; search . setStartEndTestPeriodDate ( today ) ; search . setEndEndTestPeriodDate ( inThreeMonths ) ; users . addAll ( com . autentia . tnt . manager . admin . UserManager . getDefault ( ) . getAllEntities ( search , null ) ) ; com . autentia . tnt . bean . ContractExpirationNotificationBean . log . info ( ( "Number<sp>of<sp>users<sp>with<sp>contract<sp>or<sp>probation<sp>to<sp>be<sp>expired:<sp>" + ( users . size ( ) ) ) ) ; if ( ! ( users . isEmpty ( ) ) ) { java . lang . String emailSubject = com . autentia . tnt . util . ConfigurationUtil . getDefault ( ) . getMailNotificationContractSubject ( ) ; java . lang . StringBuilder emailContent = new java . lang . StringBuilder ( ) ; for ( com . autentia . tnt . businessobject . User user : users ) { emailContent . append ( ( ( ( ( ( "\nUserId:<sp>" + ( user . getId ( ) ) ) + ",<sp>Nombre:<sp>" ) + ( user . getName ( ) ) ) + ",<sp>Email:<sp>" ) + ( user . getEmail ( ) ) ) ) ; } com . autentia . tnt . bean . ContractExpirationNotificationBean . log . info ( ( "Email<sp>content:<sp>" + emailContent ) ) ; for ( java . lang . String recipient : com . autentia . tnt . util . ConfigurationUtil . getDefault ( ) . getMailNotificationContractSendTo ( ) ) { mailService . send ( recipient , emailSubject , emailContent . toString ( ) ) ; com . autentia . tnt . bean . ContractExpirationNotificationBean . log . info ( ( "Email<sp>sent<sp>to:<sp>" + recipient ) ) ; } } return users . size ( ) ; } | org . junit . Assert . assertThat ( userCount , is ( 1 ) ) |
testBlockingCache ( ) { java . util . concurrent . ExecutorService defaultThreadPool = java . util . concurrent . Executors . newFixedThreadPool ( 2 ) ; long init = java . lang . System . currentTimeMillis ( ) ; for ( int i = 0 ; i < 2 ; i ++ ) { defaultThreadPool . execute ( new java . lang . Runnable ( ) { @ org . apache . ibatis . submitted . blocking_cache . Override public void run ( ) { accessDB ( ) ; } } ) ; } defaultThreadPool . shutdown ( ) ; while ( ! ( defaultThreadPool . isTerminated ( ) ) ) { } long totalTime = ( java . lang . System . currentTimeMillis ( ) ) - init ; "<AssertPlaceHolder>" ; } shutdown ( ) { java . io . File file = new java . io . File ( dir , filename ) ; if ( file . exists ( ) ) { System . out . println ( "Deleting<sp>temporary<sp>file." ) ; file . delete ( ) ; } } | org . junit . Assert . assertTrue ( ( totalTime > 1000 ) ) |
testBasicTitleSearch ( ) { createContent ( ) ; closeTransaction ( ) ; openTransaction ( ) ; final cc . kune . core . server . manager . SearchResult < cc . kune . domain . Content > search = contentManager . search ( cc . kune . core . server . manager . ContentManagerDefaultTest . TITLE ) ; contentManager . reIndex ( ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return size ; } | org . junit . Assert . assertEquals ( 1 , search . getSize ( ) ) |
testSimpleNoDecimals ( ) { org . apache . commons . numbers . complex . Complex c = org . apache . commons . numbers . complex . Complex . ofCartesian ( 1 , 2 ) ; java . lang . String expected = "1<sp>+<sp>2i" ; java . lang . String actual = complexFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( org . apache . commons . math4 . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testClearOnNonEmptyMap ( ) { if ( ! ( doesMapSupportRemove ( ) ) ) return ; java . util . Map originalMap = createEmptyMap ( ) ; addGlobalsToMap ( originalMap ) ; originalMap . clear ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return unsortedList . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( originalMap . isEmpty ( ) ) |
testGetTableDelayMillis ( ) { classUnderTest . setTableDelayMillis ( 10 ) ; "<AssertPlaceHolder>" ; } getTableDelayMillis ( ) { return tableDelayMillis ; } | org . junit . Assert . assertEquals ( 10 , classUnderTest . getTableDelayMillis ( ) ) |
basicFunctionTest1 ( ) { java . util . List < com . navercorp . pinpoint . profiler . receiver . service . WaitingJob > waitingJobList = this . waitingJobListFactory . createList ( com . navercorp . pinpoint . profiler . receiver . service . ActiveThreadLightDumpServiceTest . CREATE_SIZE , com . navercorp . pinpoint . profiler . receiver . service . ActiveThreadLightDumpServiceTest . JOB_TIMEOUT ) ; java . util . List < com . navercorp . pinpoint . profiler . context . active . ActiveTraceSnapshot > activeTraceInfoList = createMockActiveTraceInfoList ( com . navercorp . pinpoint . profiler . receiver . service . ActiveThreadLightDumpServiceTest . CREATE_SIZE , com . navercorp . pinpoint . profiler . receiver . service . ActiveThreadLightDumpServiceTest . DEFAULT_TIME_MILLIS , com . navercorp . pinpoint . profiler . receiver . service . ActiveThreadLightDumpServiceTest . TIME_DIFF_INTERVAL , waitingJobList ) ; com . navercorp . pinpoint . profiler . receiver . service . ActiveThreadLightDumpService service = createService ( activeTraceInfoList ) ; com . navercorp . pinpoint . thrift . dto . command . TCmdActiveThreadLightDumpRes response = ( ( com . navercorp . pinpoint . thrift . dto . command . TCmdActiveThreadLightDumpRes ) ( service . requestCommandService ( createRequest ( 0 , null , null ) ) ) ) ; "<AssertPlaceHolder>" ; } getThreadDumpsSize ( ) { return ( this . threadDumps ) == null ? 0 : this . threadDumps . size ( ) ; } | org . junit . Assert . assertEquals ( com . navercorp . pinpoint . profiler . receiver . service . ActiveThreadLightDumpServiceTest . CREATE_SIZE , response . getThreadDumpsSize ( ) ) |
getContextMenuMouseDownHandler ( ) { final com . google . gwt . event . dom . client . MouseDownHandler handler = contextMenuSupport . getContextMenuMouseDownHandler ( ) ; "<AssertPlaceHolder>" ; } getContextMenuMouseDownHandler ( ) { return new org . drools . workbench . screens . guided . dtable . client . widget . table . GuidedDecisionTableModellerContextMenuSupport . GuidedDecisionTableModellerContextMenuMouseDownHandler ( cellContextMenu , rowContextMenu ) ; } | org . junit . Assert . assertNotNull ( handler ) |
defaultJSONFromPositionShouldReturnJSON ( ) { org . apache . storm . tuple . Tuple tuple = mock ( org . apache . storm . tuple . Tuple . class ) ; when ( tuple . getBinary ( 0 ) ) . thenReturn ( "{\"field\":\"value\"}" . getBytes ( org . apache . metron . common . message . UTF_8 ) ) ; org . json . simple . JSONObject expected = new org . json . simple . JSONObject ( ) ; expected . put ( "field" , "value" ) ; org . apache . metron . common . message . MessageGetStrategy messageGetStrategy = MessageGetters . DEFAULT_JSON_FROM_POSITION . get ( ) ; "<AssertPlaceHolder>" ; } get ( org . apache . metron . performance . load . CommandLine ) { return cli . getOptionValue ( shortCode ) ; } | org . junit . Assert . assertEquals ( expected , messageGetStrategy . get ( tuple ) ) |
testNewProjectsApi ( ) { com . google . api . services . cloudresourcemanager . CloudResourceManager . Projects projects = googleApiFactory . newProjectsApi ( mock ( com . google . api . client . auth . oauth2 . Credential . class ) ) ; "<AssertPlaceHolder>" ; } newProjectsApi ( com . google . api . client . auth . oauth2 . Credential ) { com . google . common . base . Preconditions . checkNotNull ( transportCache , "transportCache<sp>is<sp>null" ) ; com . google . api . client . http . HttpTransport transport = transportCache . getUnchecked ( GoogleApi . CLOUDRESOURCE_MANAGER_API ) ; com . google . common . base . Preconditions . checkNotNull ( transport , "transport<sp>is<sp>null" ) ; com . google . common . base . Preconditions . checkNotNull ( jsonFactory , "jsonFactory<sp>is<sp>null" ) ; com . google . api . services . cloudresourcemanager . CloudResourceManager resourceManager = new com . google . api . services . cloudresourcemanager . CloudResourceManager . Builder ( transport , jsonFactory , credential ) . setApplicationName ( CloudToolsInfo . USER_AGENT ) . build ( ) ; return resourceManager . projects ( ) ; } | org . junit . Assert . assertNotNull ( projects ) |
equalsContent_shouldReturnFalseIfPrefixesAreNotEqual ( ) { org . openmrs . PersonName nameWithVanDer = new org . openmrs . PersonName ( 1 ) ; org . openmrs . PersonName nameWithDe = new org . openmrs . PersonName ( 2 ) ; nameWithVanDer . setFamilyNamePrefix ( "van<sp>der" ) ; nameWithDe . setFamilyNamePrefix ( "de" ) ; "<AssertPlaceHolder>" ; } equalsContent ( org . openmrs . PersonAttribute ) { boolean returnValue = true ; java . lang . String [ ] methods = new java . lang . String [ ] { "getAttributeType" , "getValue" , "getVoided" } ; java . lang . Class attributeClass = this . getClass ( ) ; for ( java . lang . String methodAttribute : methods ) { try { java . lang . reflect . Method method = attributeClass . getMethod ( methodAttribute ) ; java . lang . Object thisValue = method . invoke ( this ) ; java . lang . Object otherValue = method . invoke ( otherAttribute ) ; if ( otherValue != null ) { returnValue &= otherValue . equals ( thisValue ) ; } } catch ( java . lang . NoSuchMethodException e ) { org . openmrs . PersonAttribute . log . warn ( ( "No<sp>such<sp>method<sp>for<sp>comparison<sp>" + methodAttribute ) , e ) ; } catch ( java . lang . IllegalAccessException | java . lang . reflect . InvocationTargetException e ) { org . openmrs . PersonAttribute . log . error ( "Error<sp>while<sp>comparing<sp>attributes" , e ) ; } } return returnValue ; } | org . junit . Assert . assertThat ( nameWithVanDer . equalsContent ( nameWithDe ) , org . hamcrest . CoreMatchers . is ( false ) ) |
testRemove ( ) { com . liferay . portal . tools . service . builder . test . model . UADPartialEntry newUADPartialEntry = addUADPartialEntry ( ) ; _persistence . remove ( newUADPartialEntry ) ; com . liferay . portal . tools . service . builder . test . model . UADPartialEntry existingUADPartialEntry = _persistence . fetchByPrimaryKey ( newUADPartialEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertNull ( existingUADPartialEntry ) |
testInitThemeDisplayPlidVirtualHostLayoutComposite ( ) { long plid = getThemeDisplayPlid ( true , false ) ; com . liferay . portal . events . ServicePreAction . LayoutComposite defaultLayoutComposite = com . liferay . portal . kernel . test . ReflectionTestUtil . invoke ( _servicePreAction , "_getDefaultVirtualHostLayoutComposite" , new java . lang . Class < ? > [ ] { javax . servlet . http . HttpServletRequest . class } , _request ) ; com . liferay . portal . kernel . model . Layout layout = defaultLayoutComposite . getLayout ( ) ; "<AssertPlaceHolder>" ; } getPlid ( ) { return _plid ; } | org . junit . Assert . assertEquals ( layout . getPlid ( ) , plid ) |
testNewLogger ( ) { nl . moderniseringgba . migratie . logging . Logger logger = nl . moderniseringgba . migratie . logging . LoggerFactory . getLogger ( ) ; "<AssertPlaceHolder>" ; nl . moderniseringgba . migratie . logging . LoggerFactoryTest . LOG . info ( "LOG<sp>doet<sp>het" ) ; } getName ( ) { java . lang . StringBuilder name = new java . lang . StringBuilder ( ) ; name . append ( firstName ) ; name . append ( "<sp>" ) ; name . append ( lastName ) ; return name . toString ( ) ; } | org . junit . Assert . assertEquals ( this . getClass ( ) . getName ( ) , logger . getName ( ) ) |
testVectorBinarizerSparse ( ) { int [ ] sparseArray1 = new int [ ] { 5 , 6 , 11 , 4 , 7 , 9 , 8 , 14 , 13 } ; double [ ] sparseArray1Values = new double [ ] { - 5.0 , 7.0 , 1.0 , - 2.0 , - 4.0 , - 1.0 , 31.0 , - 1.0 , - 3.0 } ; int [ ] sparseArray2 = new int [ ] { 2 , 6 , 1 } ; double [ ] sparseArray2Values = new double [ ] { 1.0 , 11.0 , 2.0 } ; int [ ] sparseArray3 = new int [ ] { 4 , 6 , 1 } ; double [ ] sparseArray3Values = new double [ ] { 52.0 , 71.0 , 11.0 } ; int [ ] sparseArray4 = new int [ ] { 4 , 1 , 2 } ; double [ ] sparseArray4Values = new double [ ] { 17.0 , 7.0 , 9.0 } ; org . apache . spark . api . java . JavaRDD < org . apache . spark . sql . Row > jrdd = sc . parallelize ( java . util . Arrays . asList ( org . apache . spark . sql . RowFactory . create ( 3.0 , 4.0 , new org . apache . spark . mllib . linalg . SparseVector ( 20 , sparseArray1 , sparseArray1Values ) ) , org . apache . spark . sql . RowFactory . create ( 4.0 , 5.0 , new org . apache . spark . mllib . linalg . SparseVector ( 20 , sparseArray2 , sparseArray2Values ) ) , org . apache . spark . sql . RowFactory . create ( 5.0 , 5.0 , new org . apache . spark . mllib . linalg . SparseVector ( 20 , sparseArray3 , sparseArray3Values ) ) , org . apache . spark . sql . RowFactory . create ( 6.0 , 5.0 , new org . apache . spark . mllib . linalg . SparseVector ( 20 , sparseArray4 , sparseArray4Values ) ) ) ) ; org . apache . spark . sql . types . StructType schema = new org . apache . spark . sql . types . StructType ( new org . apache . spark . sql . types . StructField [ ] { new org . apache . spark . sql . types . StructField ( "id" , org . apache . spark . sql . types . DataTypes . DoubleType , false , org . apache . spark . sql . types . Metadata . empty ( ) ) , new org . apache . spark . sql . types . StructField ( "value1" , org . apache . spark . sql . types . DataTypes . DoubleType , false , org . apache . spark . sql . types . Metadata . empty ( ) ) , new org . apache . spark . sql . types . StructField ( "vector1" , new org . apache . spark . mllib . linalg . VectorUDT ( ) , false , org . apache . spark . sql . types . Metadata . empty ( ) ) } ) ; org . apache . spark . sql . DataFrame df = sqlContext . createDataFrame ( jrdd , schema ) ; org . apache . spark . ml . feature . VectorBinarizer vectorBinarizer = new org . apache . spark . ml . feature . VectorBinarizer ( ) . setInputCol ( "vector1" ) . setOutputCol ( "binarized" ) ; byte [ ] exportedModel = com . flipkart . fdp . ml . export . ModelExporter . export ( vectorBinarizer , null ) ; com . flipkart . fdp . ml . transformer . Transformer transformer = com . flipkart . fdp . ml . importer . ModelImporter . importAndGetTransformer ( exportedModel ) ; org . apache . spark . sql . Row [ ] sparkOutput = vectorBinarizer . transform ( df ) . orderBy ( "id" ) . select ( "id" , "value1" , "vector1" , "binarized" ) . collect ( ) ; for ( org . apache . spark . sql . Row row : sparkOutput ) { java . util . Map < java . lang . String , java . lang . Object > data = new java . util . HashMap ( ) ; data . put ( vectorBinarizer . getInputCol ( ) , ( ( org . apache . spark . mllib . linalg . SparseVector ) ( row . get ( 2 ) ) ) . toArray ( ) ) ; transformer . transform ( data ) ; double [ ] output = ( ( double [ ] ) ( data . get ( vectorBinarizer . getOutputCol ( ) ) ) ) ; "<AssertPlaceHolder>" ; } } transform ( com . flipkart . fdp . ml . transformer . Map ) { java . lang . String inp = ( ( java . lang . String ) ( input . get ( modelInfo . getInputKeys ( ) . iterator ( ) . next ( ) ) ) ) ; input . put ( modelInfo . getOutputKeys ( ) . iterator ( ) . next ( ) , predict ( inp ) ) ; } | org . junit . Assert . assertArrayEquals ( output , ( ( org . apache . spark . mllib . linalg . SparseVector ) ( row . get ( 3 ) ) ) . toArray ( ) , 0.0 ) |
shouldUseCorrectWroManagerFactoryWhenOneIsSet ( ) { final java . lang . Class < ? > managerClass = ro . isdc . wro . http . TestWroFilter . TestWroManagerFactory . class ; victim . setWroManagerFactory ( null ) ; when ( mockFilterConfig . getInitParameter ( ConfigConstants . managerFactoryClassName . name ( ) ) ) . thenReturn ( managerClass . getName ( ) ) ; victim . init ( mockFilterConfig ) ; final java . lang . Class < ? > actualClass = ( ( ro . isdc . wro . manager . factory . DefaultWroManagerFactory ) ( ro . isdc . wro . util . AbstractDecorator . getOriginalDecoratedObject ( victim . getWroManagerFactory ( ) ) ) ) . getFactory ( ) . getClass ( ) ; "<AssertPlaceHolder>" ; } getFactory ( ) { return factory ; } | org . junit . Assert . assertSame ( managerClass , actualClass ) |
testAggregate5 ( ) { final org . apache . calcite . tools . RelBuilder builder = org . apache . calcite . tools . RelBuilder . create ( org . apache . calcite . test . RelBuilderTest . config ( ) . build ( ) ) ; org . apache . calcite . rel . RelNode root = builder . scan ( "EMP" ) . aggregate ( builder . groupKey ( ) , builder . count ( ) . as ( "C" ) ) . project ( builder . literal ( 4 ) , builder . literal ( 2 ) , builder . field ( 0 ) ) . aggregate ( builder . groupKey ( builder . field ( 0 ) , builder . field ( 1 ) ) ) . build ( ) ; final java . lang . String expected = "" + ( ( "LogicalProject($f0=[4],<sp>$f1=[2])\n" + "<sp>LogicalAggregate(group=[{}],<sp>C=[COUNT()])\n" ) + "<sp>LogicalTableScan(table=[[scott,<sp>EMP]])\n" ) ; "<AssertPlaceHolder>" ; } hasTree ( java . lang . String ) { return org . apache . calcite . test . Matchers . compose ( org . hamcrest . core . Is . is ( value ) , ( input ) -> { return org . apache . calcite . util . Util . toLinux ( org . apache . calcite . plan . RelOptUtil . toString ( input ) ) ; } ) ; } | org . junit . Assert . assertThat ( root , org . apache . calcite . test . Matchers . hasTree ( expected ) ) |
testLeeg ( ) { final nl . bzk . brp . util . hisvolledig . kern . PersoonHisVolledigImplBuilder builder = new nl . bzk . brp . util . hisvolledig . kern . PersoonHisVolledigImplBuilder ( nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortPersoon . INGESCHREVENE ) ; final nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView persoonHisVolledig = new nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView ( builder . build ( ) , null ) ; final nl . bzk . migratiebrp . conversie . model . brp . BrpStapel < nl . bzk . migratiebrp . conversie . model . brp . groep . BrpBijhoudingInhoud > brpBijhoudingsaard = mapper . map ( persoonHisVolledig , new nl . bzk . brp . levering . lo3 . mapper . OnderzoekMapper ( persoonHisVolledig ) , new nl . bzk . brp . levering . lo3 . mapper . TestActieHisVolledigLocator ( ) ) ; "<AssertPlaceHolder>" ; } map ( B , nl . bzk . brp . levering . lo3 . mapper . OnderzoekMapper , nl . bzk . brp . levering . lo3 . mapper . ActieHisVolledigLocator ) { final java . util . List < nl . bzk . migratiebrp . conversie . model . brp . BrpGroep < G > > groepen = new java . util . ArrayList ( ) ; final java . lang . Iterable < H > histories = getHistorieIterable ( volledig ) ; if ( histories != null ) { for ( final H historie : histories ) { if ( historie != null ) { if ( ! ( behoortTotStatischePersoonlijst ( historie ) ) ) { continue ; } final nl . bzk . migratiebrp . conversie . model . brp . BrpGroep < G > groep = mapGroep ( historie , onderzoekMapper , actieHisVolledigLocator ) ; if ( groep != null ) { groepen . add ( groep ) ; } } } } if ( groepen . isEmpty ( ) ) { return null ; } else { return new nl . bzk . migratiebrp . conversie . model . brp . BrpStapel < G > ( groepen ) ; } } | org . junit . Assert . assertNull ( brpBijhoudingsaard ) |
given_ObjectBWithDefaultConstructor_when_CreatingSourceWithFilter_then_GettingOriginalResult ( ) { com . javax0 . djcproxy . ProxyFactoryTest . B a = new com . javax0 . djcproxy . ProxyFactoryTest . B ( ) ; com . javax0 . djcproxy . ProxyFactory < com . javax0 . djcproxy . ProxyFactoryTest . B > factory = new com . javax0 . djcproxy . ProxyFactory ( ) ; factory . setCallbackFilter ( new com . javax0 . djcproxy . CallbackFilter ( ) { @ com . javax0 . djcproxy . Override public boolean accept ( java . lang . reflect . Method method ) { return false ; } } ) ; com . javax0 . djcproxy . ProxyFactoryTest . B s = factory . create ( a , new com . javax0 . djcproxy . ProxyFactoryTest . Interceptor ( ) ) ; "<AssertPlaceHolder>" ; } method ( ) { return 1 ; } | org . junit . Assert . assertEquals ( 1 , s . method ( ) ) |
isOpen ( ) { when ( base . isOpen ( ) ) . thenReturn ( true ) ; com . hotels . bdp . waggledance . client . CloseableThriftHiveMetastoreIface iface = factory . newInstance ( "name" , com . hotels . bdp . waggledance . client . DefaultMetaStoreClientFactoryTest . RECONNECTION_RETRIES , base ) ; boolean result = iface . isOpen ( ) ; "<AssertPlaceHolder>" ; verify ( base , never ( ) ) . reconnect ( ) ; } isOpen ( ) { return ( ( transport ) != null ) && ( transport . isOpen ( ) ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( true ) ) |
testValidateUpgradeReply_websocketupgrade_null ( ) { java . nio . ByteBuffer buffer = java . nio . ByteBuffer . allocate ( 10 ) ; byte [ ] data = new byte [ buffer . remaining ( ) ] ; com . microsoft . azure . sdk . iot . deps . ws . impl . WebSocketHandlerImpl webSocketHandler = new com . microsoft . azure . sdk . iot . deps . ws . impl . WebSocketHandlerImpl ( ) ; com . microsoft . azure . sdk . iot . deps . ws . impl . WebSocketHandlerImpl spyWebSocketHandler = spy ( webSocketHandler ) ; com . microsoft . azure . sdk . iot . deps . ws . impl . WebSocketUpgrade mockWebSocketUpgrade = mock ( com . microsoft . azure . sdk . iot . deps . ws . impl . WebSocketUpgrade . class ) ; "<AssertPlaceHolder>" ; verify ( mockWebSocketUpgrade , times ( 0 ) ) . validateUpgradeReply ( data ) ; } validateUpgradeReply ( java . nio . ByteBuffer ) { java . lang . Boolean retVal = false ; if ( ( _webSocketUpgrade ) != null ) { int size = buffer . remaining ( ) ; if ( size > 0 ) { byte [ ] data = new byte [ buffer . remaining ( ) ] ; buffer . get ( data ) ; retVal = _webSocketUpgrade . validateUpgradeReply ( data ) ; _webSocketUpgrade = null ; } } return retVal ; } | org . junit . Assert . assertFalse ( spyWebSocketHandler . validateUpgradeReply ( buffer ) ) |
testGetReloadRule ( ) { org . netbeans . modules . gradle . actions . DefaultActionMapping instance = new org . netbeans . modules . gradle . actions . DefaultActionMapping ( ) ; org . netbeans . modules . gradle . api . execute . ActionMapping . ReloadRule expResult = ActionMapping . ReloadRule . DEFAULT ; org . netbeans . modules . gradle . api . execute . ActionMapping . ReloadRule result = instance . getReloadRule ( ) ; "<AssertPlaceHolder>" ; } getReloadRule ( ) { return reloadRule ; } | org . junit . Assert . assertEquals ( expResult , result ) |
test_Bool ( ) { com . alibaba . dubbo . common . serialize . ObjectOutput objectOutput = serialization . serialize ( url , byteArrayOutputStream ) ; objectOutput . writeBool ( false ) ; objectOutput . flushBuffer ( ) ; java . io . ByteArrayInputStream byteArrayInputStream = new java . io . ByteArrayInputStream ( byteArrayOutputStream . toByteArray ( ) ) ; com . alibaba . dubbo . common . serialize . ObjectInput deserialize = serialization . deserialize ( url , byteArrayInputStream ) ; "<AssertPlaceHolder>" ; try { deserialize . readBool ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . io . IOException expected ) { } } readBool ( ) { byte b = read0 ( ) ; switch ( b ) { case VARINT_0 : return false ; case VARINT_1 : return true ; default : throw new java . io . IOException ( ( "Tag<sp>error,<sp>expect<sp>BYTE_TRUE|BYTE_FALSE,<sp>but<sp>get<sp>" + b ) ) ; } } | org . junit . Assert . assertFalse ( deserialize . readBool ( ) ) |
testRuleBuilderDefaultsToAlwaysPerform ( ) { "<AssertPlaceHolder>" ; } define ( ) { return new org . ocpsoft . rewrite . config . RuleBuilder ( ) ; } | org . junit . Assert . assertTrue ( org . ocpsoft . rewrite . config . RuleBuilder . define ( ) . evaluate ( null , context ) ) |
testEmptyNode ( ) { org . apache . jackrabbit . oak . spi . state . NodeState before = EMPTY_NODE ; org . apache . jackrabbit . oak . spi . state . NodeState after = new org . apache . jackrabbit . oak . segment . SegmentNodeState ( store . getReader ( ) , writer , store . getBlobStore ( ) , writer . writeNode ( before ) ) ; "<AssertPlaceHolder>" ; } getBlobStore ( ) { return org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreUtils . getBlobStore ( org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreUtils . getHomeDir ( ) ) ; } | org . junit . Assert . assertEquals ( before , after ) |
testPolynomialEvalutaionProofSystem4 ( ) { final ch . bfh . unicrypt . math . algebra . general . interfaces . CyclicGroup G_q = ch . bfh . unicrypt . math . algebra . multiplicative . classes . GStarModSafePrime . getInstance ( new java . math . BigInteger ( ch . bfh . unicrypt . crypto . proofsystem . PolynomialEvaluationProofSystemTest . P2 , 10 ) ) ; final ch . bfh . unicrypt . math . algebra . dualistic . classes . ZModPrime Z_q = ( ( ch . bfh . unicrypt . math . algebra . dualistic . classes . ZModPrime ) ( G_q . getZModOrder ( ) ) ) ; ch . bfh . unicrypt . crypto . schemes . commitment . classes . PedersenCommitmentScheme pedersenCS = ch . bfh . unicrypt . crypto . schemes . commitment . classes . PedersenCommitmentScheme . getInstance ( G_q ) ; int size = 100 ; ch . bfh . unicrypt . math . algebra . dualistic . classes . PolynomialRing pr = ch . bfh . unicrypt . math . algebra . dualistic . classes . PolynomialRing . getInstance ( Z_q ) ; ch . bfh . unicrypt . math . algebra . dualistic . classes . PolynomialElement poly = pr . getElement ( ch . bfh . unicrypt . math . algebra . general . classes . ProductGroup . getInstance ( Z_q , ( size + 1 ) ) . getRandomElement ( ) ) ; ch . bfh . unicrypt . math . algebra . dualistic . classes . ZModElement u = Z_q . getRandomElement ( ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element v = poly . evaluate ( u ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element r0 = Z_q . getRandomElement ( ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element t = Z_q . getRandomElement ( ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element cu = pedersenCS . commit ( u , r0 ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element cv = pedersenCS . commit ( v , t ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple secretInput = ch . bfh . unicrypt . math . algebra . general . classes . Tuple . getInstance ( u , v , r0 , t ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple publicInput = ch . bfh . unicrypt . math . algebra . general . classes . Tuple . getInstance ( cu , cv ) ; ch . bfh . unicrypt . crypto . proofsystem . classes . PolynomialEvaluationProofSystem peps = ch . bfh . unicrypt . crypto . proofsystem . classes . PolynomialEvaluationProofSystem . getInstance ( poly , pedersenCS ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple proof = peps . generate ( secretInput , publicInput ) ; boolean verify = peps . verify ( proof , publicInput ) ; "<AssertPlaceHolder>" ; } verify ( ch . bfh . unicrypt . math . algebra . general . interfaces . Element , ch . bfh . unicrypt . math . algebra . general . interfaces . Element ) { if ( ( ! ( this . getProofSpace ( ) . contains ( proof ) ) ) || ( ! ( this . getPublicInputSpace ( ) . contains ( publicInput ) ) ) ) { throw new java . lang . IllegalArgumentException ( ) ; } return this . abstractVerify ( ( ( PE ) ( proof ) ) , ( ( PUE ) ( publicInput ) ) ) ; } | org . junit . Assert . assertTrue ( verify ) |
testWriteExistingSnapshot ( ) { final java . lang . String fileBaseName = "overrideMe" ; snap . setTestMode ( PmSnapshotTestTool . TestMode . AUTO_CREATE ) ; java . io . File expectedStateFileSrc = null ; java . io . File expectedStateFile = getExpectedFile ( fileBaseName ) ; try { expectedStateFileSrc = snap . snapshot ( pm , fileBaseName ) ; "<AssertPlaceHolder>" ; org . pm4j . tools . test . PmAssert . setValue ( pm . stringAttr , "hi" ) ; org . pm4j . common . util . io . FileUtil . copyFile ( expectedStateFileSrc , expectedStateFile ) ; snap . setTestMode ( PmSnapshotTestTool . TestMode . WRITE ) ; snap . snapshot ( pm , fileBaseName ) ; org . pm4j . common . util . io . FileUtil . copyFile ( expectedStateFileSrc , expectedStateFile ) ; snap . setTestMode ( PmSnapshotTestTool . TestMode . STRICT ) ; snap . snapshot ( pm , "overrideMe" ) ; } finally { org . pm4j . common . util . io . FileUtil . deleteFileAndEmptyParentDirs ( expectedStateFile ) ; org . pm4j . common . util . io . FileUtil . deleteFileAndEmptyParentDirs ( expectedStateFileSrc ) ; } } snapshot ( org . pm4j . core . pm . PmObject , java . lang . String ) { java . io . File expectedFile = getExpectedStateFile ( fileNameBase ) ; switch ( testMode ) { case STRICT : return compare ( rootPm , fileNameBase , expectedFile ) ; case WRITE : return writeSnapshot ( rootPm , fileNameBase ) ; case AUTO_CREATE : if ( ( expectedFile != null ) && ( expectedFile . exists ( ) ) ) { return compare ( rootPm , fileNameBase , expectedFile ) ; } else { return writeSnapshot ( rootPm , fileNameBase ) ; } default : throw new java . lang . UnsupportedOperationException ( ( "Unsupported<sp>TestMode:<sp>" + ( testMode ) ) ) ; } } | org . junit . Assert . assertTrue ( expectedStateFileSrc . exists ( ) ) |
testIsGerritSnapshotVersion ( ) { java . lang . String version = "2.2.2.1-340-g47084d4" ; when ( gerritServerOne . getGerritVersion ( ) ) . thenReturn ( version ) ; listener . checkGerritVersionFeatures ( ) ; "<AssertPlaceHolder>" ; } isGerritSnapshotVersion ( ) { if ( ( ( gerritConnectionListener ) != null ) && ( gerritConnectionListener . isConnected ( ) ) ) { if ( gerritConnectionListener . isSnapShotGerrit ( ) ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( gerritServerOne . isGerritSnapshotVersion ( ) ) |
testClusterResourcesPage ( ) { final java . lang . String jndiName = "jdbcResource" + ( generateRandomString ( ) ) ; java . lang . String target = "cluster" + ( generateRandomString ( ) ) ; final java . lang . String description = "devtest<sp>test<sp>for<sp>cluster->resources<sp>page-<sp>" + jndiName ; final java . lang . String tableID = "cluster" 2 ; org . glassfish . admingui . devtests . JdbcTest jdbcTest = new org . glassfish . admingui . devtests . JdbcTest ( ) ; jdbcTest . createJDBCResource ( jndiName , description , target , "cluster" ) ; clickAndWait ( "treeForm:tree:clusterTreeNode:clusterTreeNode_link" ) ; java . lang . String prefix = getTableRowByValue ( org . glassfish . admingui . devtests . ClusterTest . ID_CLUSTERS_TABLE , target , "col1" ) ; java . lang . String clickId = prefix + "cluster" 0 ; clickByIdAction ( clickId ) ; clickAndWait ( "propertyForm:clusterTabs:clusterResources" ) ; java . lang . String resourcePrefix = getTableRowByValue ( tableID , jndiName , "col1" ) ; "<AssertPlaceHolder>" ; int jdbcCount = getTableRowCountByValue ( tableID , "cluster" 1 , "col3:type" ) ; int customCount = getTableRowCountByValue ( tableID , "Custom<sp>Resources" , "col3:type" ) ; org . glassfish . admingui . devtests . EnterpriseServerTest adminServerTest = new org . glassfish . admingui . devtests . EnterpriseServerTest ( ) ; org . openqa . selenium . support . ui . Select select = new org . openqa . selenium . support . ui . Select ( driver . findElement ( org . openqa . selenium . By . id ( "propertyForm:resourcesTable:topActionsGroup1:filter_list" ) ) ) ; select . selectByVisibleText ( "Custom<sp>Resources" ) ; adminServerTest . waitForTableRowCount ( tableID , customCount ) ; select = new org . openqa . selenium . support . ui . Select ( driver . findElement ( org . openqa . selenium . By . id ( "propertyForm:resourcesTable:topActionsGroup1:filter_list" ) ) ) ; select . selectByVisibleText ( "cluster" 1 ) ; adminServerTest . waitForTableRowCount ( tableID , jdbcCount ) ; clickId = ( getTableRowByValue ( tableID , jndiName , "col1" ) ) + "cluster" 0 ; clickByIdAction ( clickId ) ; waitForButtonEnabled ( "propertyForm:propertyContentPage:topButtons:saveButton" ) ; clickByIdAction ( "propertyForm:propertyContentPage:topButtons:saveButton" ) ; jdbcTest . deleteJDBCResource ( jndiName , target , "cluster" ) ; } isTextPresent ( java . lang . String , java . lang . String , java . lang . String ) { if ( ( getTableRowCount ( tableId ) ) == 0 ) { return false ; } try { if ( ! ( getText ( ( prefix + "col1:link" ) ) . equals ( name ) ) ) { return false ; } else return true ; } catch ( org . openqa . selenium . NoSuchElementException e ) { return false ; } } | org . junit . Assert . assertTrue ( isTextPresent ( resourcePrefix , jndiName , tableID ) ) |
testBuildWithDisabledSecurityConstraint ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . asset . status . AssetStatus context = new org . lnu . is . domain . asset . status . AssetStatus ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>AssetStatus<sp>e<sp>WHERE<sp>e.status=:status<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . asset . status . AssetStatus > 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 ) |
testGet_InvalidFormat ( ) { org . apache . accumulo . core . conf . Property badProp = org . apache . accumulo . core . conf . Property . MASTER_CLIENTPORT ; expect ( zc . get ( ( ( ( org . apache . accumulo . server . conf . ZooCachePropertyAccessorTest . PATH ) + "/" ) + ( badProp . getKey ( ) ) ) ) ) . andReturn ( org . apache . accumulo . server . conf . ZooCachePropertyAccessorTest . VALUE_BYTES ) ; replay ( zc ) ; org . apache . accumulo . core . conf . AccumuloConfiguration parent = createMock ( org . apache . accumulo . core . conf . AccumuloConfiguration . class ) ; expect ( parent . get ( badProp ) ) . andReturn ( "12345" ) ; replay ( parent ) ; "<AssertPlaceHolder>" ; } get ( org . apache . accumulo . core . conf . Property , java . lang . String , org . apache . accumulo . core . conf . AccumuloConfiguration ) { java . lang . String key = property . getKey ( ) ; java . lang . String value = get ( ( ( path + "/" ) + key ) ) ; if ( ( value == null ) || ( ! ( property . getType ( ) . isValidFormat ( value ) ) ) ) { if ( value != null ) { org . apache . accumulo . server . conf . ZooCachePropertyAccessor . log . error ( "Using<sp>default<sp>value<sp>for<sp>{}<sp>due<sp>to<sp>improperly<sp>formatted<sp>{}:<sp>{}" , key , property . getType ( ) , value ) ; } if ( parent != null ) { value = parent . get ( property ) ; } } return value ; } | org . junit . Assert . assertEquals ( "12345" , a . get ( badProp , org . apache . accumulo . server . conf . ZooCachePropertyAccessorTest . PATH , parent ) ) |
multiply34 ( ) { ch02 . Calculator calc = new ch02 . Calculator ( ) ; int expected = 12 ; int actual = calc . multiply ( 3 , 4 ) ; "<AssertPlaceHolder>" ; } multiply ( int , int ) { return x * y ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( expected ) ) |
testConnAck_BrokerConnection_ConnectionNotAccepted ( ) { attachClientAndBroker ( ) ; net . xenqtt . message . ConnAckMessage message = new net . xenqtt . message . ConnAckMessage ( net . xenqtt . message . ConnectReturnCode . BAD_CREDENTIALS ) ; session . connAck ( channelToBroker , message ) ; verify ( channelToClient1 ) . send ( messageCaptor . capture ( ) ) ; "<AssertPlaceHolder>" ; } getReturnCode ( ) { return net . xenqtt . message . ConnectReturnCode . lookup ( ( ( buffer . get ( 3 ) ) & 255 ) ) ; } | org . junit . Assert . assertEquals ( ConnectReturnCode . BAD_CREDENTIALS , ( ( net . xenqtt . message . ConnAckMessage ) ( messageCaptor . getValue ( ) ) ) . getReturnCode ( ) ) |
testTestJedisConnection_Fail ( ) { final redis . clients . jedis . Jedis jedis = net . greghaines . jesque . TestUtils . createJedis ( net . greghaines . jesque . utils . TestJedisUtils . CONFIG ) ; jedis . disconnect ( ) ; "<AssertPlaceHolder>" ; } testJedisConnection ( redis . clients . jedis . Jedis ) { boolean jedisOK = false ; try { jedisOK = ( jedis . isConnected ( ) ) && ( net . greghaines . jesque . utils . JedisUtils . PONG . equals ( jedis . ping ( ) ) ) ; } catch ( java . lang . Exception e ) { jedisOK = false ; } return jedisOK ; } | org . junit . Assert . assertFalse ( net . greghaines . jesque . utils . JedisUtils . testJedisConnection ( jedis ) ) |
shouldSetType ( ) { final com . calclab . emite . core . stanzas . Presence presence = new com . calclab . emite . core . stanzas . Presence ( ) ; for ( final com . calclab . emite . core . stanzas . Presence . Type type : com . calclab . emite . core . stanzas . Presence . Type . values ( ) ) { presence . setType ( type ) ; "<AssertPlaceHolder>" ; } } getType ( ) { return com . calclab . emite . core . stanzas . IQ . getType ( result ) ; } | org . junit . Assert . assertEquals ( type , presence . getType ( ) ) |
testPermissionsAPI ( ) { org . nuxeo . ecm . core . api . security . ACL acl = new org . nuxeo . ecm . core . api . security . impl . ACLImpl ( "acl1" ) ; org . nuxeo . ecm . core . api . security . ACE bart = new org . nuxeo . ecm . core . api . security . ACE ( "bart" , org . nuxeo . ecm . core . api . security . SecurityConstants . EVERYTHING , true ) ; org . nuxeo . ecm . core . api . security . ACE notbart = new org . nuxeo . ecm . core . api . security . ACE ( "notbart" , org . nuxeo . ecm . core . api . security . SecurityConstants . EVERYTHING , false ) ; org . nuxeo . ecm . core . api . security . ACE homer = new org . nuxeo . ecm . core . api . security . ACE ( "homer" , org . nuxeo . ecm . core . api . security . SecurityConstants . BROWSE , true ) ; org . nuxeo . ecm . core . api . security . ACE lisa = new org . nuxeo . ecm . core . api . security . ACE ( "lisa" , org . nuxeo . ecm . core . api . security . SecurityConstants . BROWSE , true ) ; acl . add ( bart ) ; acl . add ( notbart ) ; acl . add ( homer ) ; acl . add ( lisa ) ; acp . addACL ( acl ) ; java . util . Set < java . lang . String > perms = new java . util . HashSet ( 3 ) ; perms . add ( org . nuxeo . ecm . core . api . security . SecurityConstants . BROWSE ) ; perms . add ( org . nuxeo . ecm . core . api . security . SecurityConstants . READ ) ; perms . add ( org . nuxeo . ecm . core . api . security . SecurityConstants . WRITE ) ; java . lang . String [ ] usernames = acp . listUsernamesForAnyPermission ( perms ) ; "<AssertPlaceHolder>" ; } listUsernamesForAnyPermission ( java . util . Set ) { java . util . List < java . lang . String > usernames = new java . util . ArrayList ( ) ; org . nuxeo . ecm . core . api . security . ACL merged = getMergedACLs ( "merged" ) ; for ( org . nuxeo . ecm . core . api . security . ACE ace : merged . getACEs ( ) ) { if ( ( perms . contains ( ace . getPermission ( ) ) ) && ( ace . isGranted ( ) ) ) { java . lang . String username = ace . getUsername ( ) ; if ( ! ( usernames . contains ( username ) ) ) { usernames . add ( username ) ; } } } return usernames . toArray ( new java . lang . String [ usernames . size ( ) ] ) ; } | org . junit . Assert . assertEquals ( 2 , usernames . length ) |
getProjectKey_forUnknownProject ( ) { jenkins . plugins . coverity . Utils . CredentialUtil . setCredentialManager ( "admin" , "password" ) ; jenkins . plugins . coverity . CIMInstance cimInstance = new jenkins . plugins . coverity . Utils . CIMInstanceBuilder ( ) . withName ( "test" ) . withHost ( "test.coverity" ) . withPort ( 8080 ) . withUseSSL ( false ) . withDefaultCredentialId ( ) . build ( ) ; jenkins . plugins . coverity . ws . TestWebServiceFactory . TestConfigurationService testConfigurationService = ( ( jenkins . plugins . coverity . ws . TestWebServiceFactory . TestConfigurationService ) ( jenkins . plugins . coverity . WebServiceFactory . getInstance ( ) . getConfigurationService ( cimInstance ) ) ) ; testConfigurationService . setupProjects ( "project" , 3 , "stream" , 1 ) ; java . lang . Long result = cimInstance . getProjectKey ( "unknown-project" ) ; "<AssertPlaceHolder>" ; } getProjectKey ( java . lang . String ) { if ( ( projectKeys ) == null ) { projectKeys = new java . util . concurrent . ConcurrentHashMap < java . lang . String , java . lang . Long > ( ) ; } java . lang . Long result = projectKeys . get ( projectId ) ; if ( result == null ) { com . coverity . ws . v9 . ProjectDataObj project = getProject ( projectId ) ; if ( project != null ) { result = project . getProjectKey ( ) ; projectKeys . put ( projectId , result ) ; } } return result ; } | org . junit . Assert . assertNull ( result ) |
testDefaultBeanObserverMethods ( ) { org . jboss . weld . extensions . test . defaultbean . WriteEvent event = new org . jboss . weld . extensions . test . defaultbean . WriteEvent ( ) ; manager . fireEvent ( event , DefaultLiteral . INSTANCE ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return count ; } | org . junit . Assert . assertEquals ( 1 , event . getCount ( ) ) |
testList ( ) { com . riversoft . weixin . mp . user . bean . UserPagination list = com . riversoft . weixin . mp . user . BlackLists . defaultBlackLists ( ) . list ( ) ; "<AssertPlaceHolder>" ; } list ( ) { java . lang . String url = com . riversoft . weixin . mp . base . WxEndpoint . get ( "url.care.account.list" ) ; java . lang . String response = wxClient . get ( url ) ; com . riversoft . weixin . mp . care . Accounts . logger . debug ( "list<sp>care<sp>accounts<sp>:{}" , response ) ; com . riversoft . weixin . mp . care . Accounts . CareListResponse careListResponse = com . riversoft . weixin . common . util . JsonMapper . defaultMapper ( ) . fromJson ( response , com . riversoft . weixin . mp . care . Accounts . CareListResponse . class ) ; return careListResponse . getList ( ) ; } | org . junit . Assert . assertNotNull ( list ) |
testGetCombiner ( ) { this . handler = new org . apache . hadoop . mapred . nativetask . handlers . NativeCollectorOnlyHandler ( taskContext , nativeHandler , pusher , combiner ) ; org . mockito . Mockito . when ( combiner . getId ( ) ) . thenReturn ( 100L ) ; final org . apache . hadoop . mapred . nativetask . util . ReadWriteBuffer result = handler . onCall ( NativeCollectorOnlyHandler . GET_COMBINE_HANDLER , null ) ; "<AssertPlaceHolder>" ; } readLong ( ) { return readLong ( null ) ; } | org . junit . Assert . assertEquals ( 100L , result . readLong ( ) ) |
testNumLeavesEven ( ) { org . provebit . merkle . FileMerkle mTree = new org . provebit . merkle . FileMerkle ( HashType . SHA256 ) ; mTree . addTracking ( org . provebit . merkle . FileMerkleTest . completeDirPath , false ) ; mTree . makeTree ( ) ; "<AssertPlaceHolder>" ; } getNumLeaves ( ) { return numLeaves ; } | org . junit . Assert . assertTrue ( ( ( mTree . getNumLeaves ( ) ) == 8 ) ) |
testSetHardTimeout ( ) { org . o3project . odenos . core . component . network . flow . ofpflow . OFPFlow target = new org . o3project . odenos . core . component . network . flow . ofpflow . OFPFlow ( ) ; target . setHardTimeout ( 15L ) ; "<AssertPlaceHolder>" ; } getHardTimeout ( ) { return hardTimeout ; } | org . junit . Assert . assertThat ( target . getHardTimeout ( ) , org . hamcrest . CoreMatchers . is ( 15L ) ) |
lookup ( ) { victim . addLookupEntry ( "this" , "that" ) ; victim . addLookupEntry ( "this1" , "that1" ) ; victim . addLookupEntry ( "this2" , "that2" ) ; "<AssertPlaceHolder>" ; } lookup ( I ) { return oldToNew . get ( item ) ; } | org . junit . Assert . assertEquals ( "that2" , victim . lookup ( "this2" ) ) |
sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked ( ) { channel . send ( new org . springframework . integration . message . GenericMessage < org . opencredo . esper . sample . SampleEvent > ( new org . opencredo . esper . sample . SampleEvent ( ) ) , 500L ) ; "<AssertPlaceHolder>" ; } getNumberOfTimesInvoked ( ) { return numberOfTimesInvoked ; } | org . junit . Assert . assertEquals ( 1 , listener . getNumberOfTimesInvoked ( ) ) |
autoTemplateNaming ( ) { when ( context . getContextPath ( ) ) . thenReturn ( "/context" ) ; when ( templateEngineHelper . getTemplateForResult ( context . getRoute ( ) , result , ".rocker.html" ) ) . thenReturn ( "views/context_path.rocker.html" ) ; java . lang . String out = invoke ( context , result ) ; "<AssertPlaceHolder>" ; } invoke ( ninja . Context , ninja . Result ) { templateEngine . invoke ( context , result ) ; return output . toString ( "UTF-8" ) ; } | org . junit . Assert . assertThat ( out , org . hamcrest . CoreMatchers . is ( "/context" ) ) |
testFindBestMatchingWavelength_exactValues ( ) { int [ ] actualIndices = org . esa . s3tbx . owt . HyperspectralAuxdataFactory . findWavelengthIndices ( new float [ ] { 400 , 427 , 490 , 556 , 667 , 799 } , org . esa . s3tbx . owt . HyperspectralAuxdataFactoryTest . HYPER_WAVELENGTHS , 1.5F ) ; int [ ] expectedIndices = new int [ ] { 0 , 9 , 30 , 52 , 89 , 133 } ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertArrayEquals ( expectedIndices , actualIndices ) |
testGetTestID ( ) { System . out . println ( "getTestID" ) ; org . loadosophia . jmeter . LoadosophiaUploadResults instance = new org . loadosophia . jmeter . LoadosophiaUploadResults ( ) ; int expResult = 0 ; int result = instance . getTestID ( ) ; "<AssertPlaceHolder>" ; } getTestID ( ) { return testID ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testEmpty ( ) { final org . constretto . resolver . PredefinedConfigurationContextResolver contextResolver = org . constretto . resolver . PredefinedConfigurationContextResolver . empty ( ) ; "<AssertPlaceHolder>" ; } getTags ( ) { return org . constretto . resolver . PredefinedConfigurationContextResolver . cloneTagList ( this . tags ) ; } | org . junit . Assert . assertEquals ( 0 , contextResolver . getTags ( ) . size ( ) ) |
testApisApiIdRatingsRatingIdGet ( ) { org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImplTestCase . printTestMethodName ( ) ; java . lang . String apiId = java . util . UUID . randomUUID ( ) . toString ( ) ; java . lang . String rateId = java . util . UUID . randomUUID ( ) . toString ( ) ; org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImpl apisApiService = new org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImpl ( ) ; org . wso2 . carbon . apimgt . core . api . APIStore apiStore = org . mockito . Mockito . mock ( org . wso2 . carbon . apimgt . core . impl . APIStoreImpl . class ) ; org . powermock . api . mockito . PowerMockito . mockStatic ( org . wso2 . carbon . apimgt . rest . api . common . util . RestApiUtil . class ) ; org . powermock . api . mockito . PowerMockito . when ( org . wso2 . carbon . apimgt . rest . api . common . util . RestApiUtil . getConsumer ( org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImplTestCase . USER ) ) . thenReturn ( apiStore ) ; org . wso2 . msf4j . Request request = getRequest ( ) ; org . powermock . api . mockito . PowerMockito . when ( org . wso2 . carbon . apimgt . rest . api . common . util . RestApiUtil . getLoggedInUsername ( request ) ) . thenReturn ( org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImplTestCase . USER ) ; java . time . Instant time = org . wso2 . carbon . apimgt . core . util . APIUtils . getCurrentUTCTime ( ) ; org . wso2 . carbon . apimgt . core . models . Rating rating = new org . wso2 . carbon . apimgt . core . models . Rating ( ) ; rating . setApiId ( apiId ) ; rating . setRating ( 5 ) ; rating . setUsername ( org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImplTestCase . USER ) ; rating . setUuid ( rateId ) ; rating . setCreatedUser ( org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImplTestCase . USER ) ; rating . setCreatedTime ( time ) ; rating . setLastUpdatedUser ( org . wso2 . carbon . apimgt . rest . api . store . impl . ApisApiServiceImplTestCase . USER ) ; rating . setLastUpdatedTime ( time ) ; org . mockito . Mockito . when ( apiStore . getRatingByUUID ( apiId , rateId ) ) . thenReturn ( rating ) ; javax . ws . rs . core . Response response = apisApiService . apisApiIdRatingsGet ( apiId , 10 , 0 , request ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; } | org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.