input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testEndMS ( ) { com . bixly . pastevid . models . AudioFileItemTest . log ( "AudioFileItem.endMS" ) ; com . bixly . pastevid . models . AudioFileItem instance = new com . bixly . pastevid . models . AudioFileItem ( ) ; long expResult = java . lang . System . currentTimeMillis ( ) ; instance . setEndMS ( expResult ) ; long result = instance . getEndMS ( ) ; "<AssertPlaceHolder>" ; } getEndMS ( ) { return endMS ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testGetArgumentNames ( ) { "<AssertPlaceHolder>" ; } getArgumentNames ( ) { return java . util . Arrays . asList ( org . oscm . operatorsvc . client . commands . AddAvailablePaymentTypesCommand . ARG_ORGID , org . oscm . operatorsvc . client . commands . AddAvailablePaymentTypesCommand . ARG_PAYMENTTYPES ) ; }
|
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( ) , command . getArgumentNames ( ) )
|
testTransactionActive ( ) { "<AssertPlaceHolder>" ; } isTransactionActive ( ) { if ( ( ctx ) == null ) { return false ; } try { ctx . getRollbackOnly ( ) ; return true ; } catch ( java . lang . IllegalStateException e ) { return false ; } }
|
org . junit . Assert . assertTrue ( converter . isTransactionActive ( ) )
|
testExample ( ) { java . lang . String expectedTable = ( ( ( ( ( ( ( ( "Prnom<sp>Nom<sp>" + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ) + "-------------------" ) + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ) + "Idphonse<sp>Laporte" ) + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ) + "Sarah<sp>Coursi<sp>" ) + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ) + "Yvan<sp>Dubois<sp>" ) + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ; java . io . StringWriter writer = new java . io . StringWriter ( ) ; org . geotools . util . TableWriter out = new org . geotools . util . TableWriter ( writer , 3 ) ; out . write ( ( "Prénom\tNom" + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ) ) ; out . nextLine ( '-' ) ; out . write ( ( ( ( ( "Idéphonse\tLaporte" + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ) + "Sarah\tCoursi" ) + ( org . geotools . util . TableWriterTest . LINE_SEPARATOR ) ) + "Yvan\tDubois" ) ) ; out . flush ( ) ; out . close ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( eIsProxy ( ) ) return super . toString ( ) ; java . lang . StringBuffer result = new java . lang . StringBuffer ( super . toString ( ) ) ; result . append ( "<sp>(actuate:<sp>" ) ; if ( actuateESet ) result . append ( actuate ) ; else result . append ( "<unset>" ) ; result . append ( ",<sp>arcrole:<sp>" ) ; result . append ( arcrole ) ; result . append ( ",<sp>href:<sp>" ) ; result . append ( href ) ; result . append ( ",<sp>remoteSchema:<sp>" ) ; result . append ( remoteSchema ) ; result . append ( ",<sp>arcrole:<sp>" 0 ) ; result . append ( role ) ; result . append ( ",<sp>show:<sp>" ) ; if ( showESet ) result . append ( show ) ; else result . append ( "<unset>" ) ; result . append ( ",<sp>title:<sp>" ) ; result . append ( title ) ; result . append ( ",<sp>type:<sp>" ) ; if ( typeESet ) result . append ( type ) ; else result . append ( "<unset>" ) ; result . append ( ",<sp>updateSequence:<sp>" ) ; result . append ( updateSequence ) ; result . append ( ",<sp>version:<sp>" ) ; if ( versionESet ) result . append ( version ) ; else result . append ( "<unset>" ) ; result . append ( ')' ) ; return result . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expectedTable , writer . toString ( ) )
|
testUpdatePeriodicReservation ( ) { org . apache . hadoop . yarn . server . resourcemanager . reservation . Plan plan = new org . apache . hadoop . yarn . server . resourcemanager . reservation . InMemoryPlan ( queueMetrics , policy , agent , totalCapacity , 1L , resCalc , minAlloc , maxAlloc , planName , replanner , true , context ) ; org . apache . hadoop . yarn . api . records . ReservationId reservationID = org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . getNewReservationId ( ) ; int [ ] alloc = new int [ ] { 10 , 20 } ; int start = 100 ; org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationAllocation rAllocation = createReservationAllocation ( reservationID , start , alloc ) ; long period = 3600000 ; rAllocation . getReservationDefinition ( ) . setRecurrenceExpression ( java . lang . String . valueOf ( period ) ) ; rAllocation . setPeriodicity ( period ) ; "<AssertPlaceHolder>" ; try { plan . addReservation ( rAllocation , false ) ; } catch ( org . apache . hadoop . yarn . server . resourcemanager . reservation . exceptions . PlanningException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } System . out . println ( plan . toString ( ) ) ; doAssertions ( plan , rAllocation ) ; checkAllocation ( plan , alloc , start , period ) ; start = 110 ; int [ ] updatedAlloc = new int [ ] { 30 , 40 , 50 } ; rAllocation = createReservationAllocation ( reservationID , start , updatedAlloc ) ; rAllocation . getReservationDefinition ( ) . setRecurrenceExpression ( java . lang . String . valueOf ( period ) ) ; rAllocation . setPeriodicity ( period ) ; try { plan . updateReservation ( rAllocation ) ; } catch ( org . apache . hadoop . yarn . server . resourcemanager . reservation . exceptions . PlanningException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } doAssertions ( plan , rAllocation ) ; checkAllocation ( plan , updatedAlloc , start , period ) ; } getReservationById ( org . apache . hadoop . yarn . api . records . ReservationId ) { if ( reservationID == null ) { return null ; } readLock . lock ( ) ; try { return reservationTable . get ( reservationID ) ; } finally { readLock . unlock ( ) ; } }
|
org . junit . Assert . assertNull ( plan . getReservationById ( reservationID ) )
|
testReadLine ( ) { int index = 1 ; ucar . nc2 . ft2 . simpgeometry . adapter . SimpleGeometryCS cs = mock ( ucar . nc2 . ft2 . simpgeometry . adapter . SimpleGeometryCS . class ) ; ucar . nc2 . ft2 . simpgeometry . Line line = mock ( ucar . nc2 . ft2 . simpgeometry . CFLine . class ) ; given ( cs . getLine ( name , index ) ) . willReturn ( line ) ; ucar . nc2 . ft2 . simpgeometry . SimpleGeometryFeature cov = new ucar . nc2 . ft2 . simpgeometry . SimpleGeometryFeature ( name , dt , att , coordSysName , units , description , user , ucar . nc2 . ft2 . simpgeometry . GeometryType . LINE ) ; cov . setCoordSys ( cs ) ; "<AssertPlaceHolder>" ; } readGeometry ( int ) { ucar . nc2 . ft2 . simpgeometry . SimpleGeometry geom = null ; switch ( geometryType ) { case POINT : ucar . nc2 . ft2 . simpgeometry . Point point = coordSys . getPoint ( name , index ) ; geom = point ; break ; case LINE : ucar . nc2 . ft2 . simpgeometry . Line line = coordSys . getLine ( name , index ) ; geom = line ; break ; case POLYGON : ucar . nc2 . ft2 . simpgeometry . Polygon poly = coordSys . getPolygon ( name , index ) ; geom = poly ; break ; default : break ; } return geom ; }
|
org . junit . Assert . assertEquals ( cov . readGeometry ( index ) , cs . getLine ( name , index ) )
|
test ( ) { org . eclipse . ice . iclient . IClient client = org . eclipse . ice . iclient . IClient . getClient ( ) ; "<AssertPlaceHolder>" ; return ; } getClient ( ) { return org . eclipse . ice . client . common . internal . ClientHolder . client ; }
|
org . junit . Assert . assertNotNull ( client )
|
testFormatterFuzz ( ) { java . text . SimpleDateFormat df = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" ) ; df . setTimeZone ( java . util . TimeZone . getTimeZone ( "GMT" ) ) ; org . geoserver . util . ISO8601Formatter fmt = new org . geoserver . util . ISO8601Formatter ( ) ; java . util . GregorianCalendar cal = new java . util . GregorianCalendar ( ) ; java . util . Random r = new java . util . Random ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { cal . set ( Calendar . YEAR , ( 1 + ( r . nextInt ( 3000 ) ) ) ) ; cal . set ( Calendar . DAY_OF_YEAR , ( 1 + ( r . nextInt ( 365 ) ) ) ) ; cal . set ( Calendar . HOUR_OF_DAY , r . nextInt ( 24 ) ) ; cal . set ( Calendar . MINUTE , r . nextInt ( 60 ) ) ; cal . set ( Calendar . SECOND , r . nextInt ( 60 ) ) ; cal . set ( Calendar . MILLISECOND , r . nextInt ( 1000 ) ) ; "<AssertPlaceHolder>" ; } } format ( java . util . Date ) { return format ( date , new java . lang . StringBuilder ( ) ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( df . format ( cal . getTime ( ) ) , fmt . format ( cal . getTime ( ) ) )
|
testRun ( ) { org . apache . commons . functor . core . composite . TransformedBinaryFunction < java . lang . Integer , java . lang . Integer , java . lang . Integer > transform = new org . apache . commons . functor . core . composite . TransformedBinaryFunction < java . lang . Integer , java . lang . Integer , java . lang . Integer > ( new org . apache . commons . functor . core . composite . TestTransformedBinaryFunction . Sum ( ) , new org . apache . commons . functor . core . composite . TestTransformedBinaryFunction . AddOne ( ) ) ; "<AssertPlaceHolder>" ; } evaluate ( java . lang . Character , java . lang . Integer ) { return java . lang . Character . valueOf ( ( ( char ) ( ( left . charValue ( ) ) + ( right . intValue ( ) ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 4 ) , transform . evaluate ( 1 , 2 ) )
|
exclusiveLockMustBeAvailableAfterWriteLock ( ) { pageList . unlockExclusive ( pageRef ) ; pageList . tryWriteLock ( pageRef ) ; pageList . unlockWrite ( pageRef ) ; "<AssertPlaceHolder>" ; } tryExclusiveLock ( long ) { long s = org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . getState ( address ) ; boolean res = ( ( s & ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . UNL_MASK ) ) == 0 ) && ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . compareAndSetState ( address , s , ( s + ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . EXL_MASK ) ) ) ) ; org . neo4j . unsafe . impl . internal . dragons . UnsafeUtil . storeFence ( ) ; return res ; }
|
org . junit . Assert . assertTrue ( pageList . tryExclusiveLock ( pageRef ) )
|
testConvertAllocationsToReservationInfoEmptySet ( ) { java . util . List < org . apache . hadoop . yarn . api . records . ReservationAllocationState > infoList = org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemUtil . convertAllocationsToReservationInfo ( java . util . Collections . < org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationAllocation > emptySet ( ) , false ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( ( java . lang . Integer ) ( new io . hops . transaction . handler . LightWeightRequestHandler ( io . hops . transaction . handler . HDFSOperationType . COUNT_CORRUPT_REPLICAS ) { @ io . hops . metadata . blockmanagement . Override public java . lang . Object performTask ( ) throws java . io . IOException { io . hops . metadata . hdfs . dal . ExcessReplicaDataAccess da = ( ( io . hops . metadata . hdfs . dal . ExcessReplicaDataAccess ) ( io . hops . metadata . HdfsStorageFactory . getDataAccess ( io . hops . metadata . hdfs . dal . ExcessReplicaDataAccess . class ) ) ) ; return da . countAllUniqueBlk ( ) ; } } . handle ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( infoList . size ( ) , 0 )
|
to_array ( ) { final java . util . List < com . groupon . lex . metrics . timeseries . TimeSeriesCollection > tsdata = create_tsdata_ ( 2 ) . collect ( java . util . stream . Collectors . toList ( ) ) ; file_support . create_file ( tmpfile , tsdata ) ; final com . groupon . lex . metrics . history . TSData fd = com . groupon . lex . metrics . history . TSData . readonly ( tmpfile ) ; "<AssertPlaceHolder>" ; } toArray ( ) { try ( final java . util . stream . Stream < T > s = stream . get ( ) ) { return s . toArray ( ) ; } }
|
org . junit . Assert . assertArrayEquals ( tsdata . toArray ( ) , fd . toArray ( ) )
|
testReplaceAllTableReferencesNoTables ( ) { java . lang . String input = "Should<sp>not<sp>match<sp>to<sp>T<sp>or<sp>'T'" ; java . lang . String results = org . sagebionetworks . repo . model . dbo . dao . table . TableExceptionTranslatorImpl . replaceAllTableReferences ( input ) ; "<AssertPlaceHolder>" ; } replaceAllTableReferences ( java . lang . String ) { java . util . regex . Matcher matcher = org . sagebionetworks . repo . model . dbo . dao . table . TableExceptionTranslatorImpl . PATTERN_TABLE_NAME . matcher ( input ) ; java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; while ( matcher . find ( ) ) { java . lang . String group = matcher . group ( ) ; java . lang . Long id = java . lang . Long . parseLong ( group . substring ( 1 , group . length ( ) ) ) ; java . lang . String tableName = org . sagebionetworks . repo . model . jdo . KeyFactory . keyToString ( id ) ; matcher . appendReplacement ( sb , tableName ) ; } matcher . appendTail ( sb ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( input , results )
|
testNonExistentEntry ( ) { com . twelvemonkeys . imageio . metadata . Entry entry = createEntry ( "foo" , new java . lang . Object ( ) ) ; com . twelvemonkeys . imageio . metadata . Directory directory = createDirectory ( com . twelvemonkeys . imageio . metadata . Collections . singleton ( entry ) ) ; "<AssertPlaceHolder>" ; } getEntryById ( java . lang . Object ) { for ( com . twelvemonkeys . imageio . metadata . Entry entry : this ) { if ( entry . getIdentifier ( ) . equals ( identifier ) ) { return entry ; } } return null ; }
|
org . junit . Assert . assertNull ( directory . getEntryById ( "bar" ) )
|
shouldAllowOptionalOptions ( ) { class SUT { @ dmg . util . command . Command ( name = "test" ) class TestCommand implements java . util . concurrent . Callable < java . lang . String > { @ dmg . util . command . Option ( name = "foo" ) int bar ; @ org . dcache . util . cli . Override public java . lang . String call ( ) { "<AssertPlaceHolder>" ; return null ; } } } java . util . Map < java . util . List < java . lang . String > , ? extends org . dcache . util . cli . CommandExecutor > commands = _scanner . scan ( new SUT ( ) ) ; commands . get ( asList ( "test" ) ) . execute ( new org . dcache . util . Args ( "" ) ) ; } call ( ) { reload ( ) ; return "" ; }
|
org . junit . Assert . assertThat ( bar , is ( 0 ) )
|
TestIsJobExecutorActivatedFalse ( ) { when ( jobExecutor . isActive ( ) ) . thenReturn ( false ) ; boolean result = jobExecutorMbean . isJobExecutorActivated ( ) ; verify ( jobExecutor ) . isActive ( ) ; "<AssertPlaceHolder>" ; } isActive ( ) { return true ; }
|
org . junit . Assert . assertFalse ( result )
|
testInvokeVarargsCoerce20 ( ) { javax . el . BeanELResolver resolver = new javax . el . BeanELResolver ( ) ; javax . el . ELContext context = new javax . el . StandardELContext ( javax . el . ELManager . getExpressionFactory ( ) ) ; java . lang . Object result = resolver . invoke ( context , new javax . el . TesterBean ( javax . el . TestBeanELResolver . BEAN_NAME ) , "getNameVarargs" , new java . lang . Class < ? > [ ] { java . lang . String . class , java . lang . String . class , java . lang . String . class } , new java . lang . Object [ ] { "true" , "10" , "11" , "12" } ) ; "<AssertPlaceHolder>" ; } getExpressionFactory ( ) { return javax . el . Util . getExpressionFactory ( ) ; }
|
org . junit . Assert . assertEquals ( javax . el . TestBeanELResolver . BEAN_NAME , result )
|
testExists_False ( ) { initializeExpectedAddress ( 3 ) ; com . google . cloud . compute . deprecated . Compute [ ] expectedOptions = new Compute . AddressOption [ ] { Compute . AddressOption . fields ( ) } ; expect ( compute . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( compute . getAddress ( com . google . cloud . compute . deprecated . AddressTest . REGION_ADDRESS_ID , expectedOptions ) ) . andReturn ( null ) ; replay ( compute ) ; initializeAddress ( ) ; "<AssertPlaceHolder>" ; verify ( compute ) ; } exists ( ) { boolean exists = bucket . exists ( ) ; if ( exists ) { } else { } return exists ; }
|
org . junit . Assert . assertFalse ( address . exists ( ) )
|
markdownFalsy ( ) { com . github . jknack . handlebars . Handlebars handlebars = new com . github . jknack . handlebars . Handlebars ( ) ; handlebars . registerHelper ( "markdown" , new com . github . jknack . handlebars . MarkdownHelper ( ) ) ; com . github . jknack . handlebars . Template template = handlebars . compileInline ( "{{markdown<sp>this}}" ) ; "<AssertPlaceHolder>" ; } apply ( T ) { return "" ; }
|
org . junit . Assert . assertEquals ( "" , template . apply ( null ) )
|
does_not_matches_pickles_not_on_any_line_of_the_predicate ( ) { gherkin . events . PickleEvent pickleEvent = createPickleEventWithLocations ( "path/file.feature" , asList ( pickleLocation ( 4 ) , pickleLocation ( 8 ) ) ) ; cucumber . runtime . filter . LinePredicate predicate = new cucumber . runtime . filter . LinePredicate ( singletonMap ( java . net . URI . create ( "path/file.feature" ) , asList ( 10 ) ) ) ; "<AssertPlaceHolder>" ; } apply ( gherkin . events . PickleEvent ) { java . net . URI picklePath = java . net . URI . create ( pickleEvent . uri ) ; if ( ! ( lineFilters . containsKey ( picklePath ) ) ) { return true ; } for ( java . lang . Integer line : lineFilters . get ( picklePath ) ) { for ( gherkin . pickles . PickleLocation location : pickleEvent . pickle . getLocations ( ) ) { if ( line == ( location . getLine ( ) ) ) { return true ; } } } return false ; }
|
org . junit . Assert . assertFalse ( predicate . apply ( pickleEvent ) )
|
testGetUsernameWhenNoSessionSet ( ) { command . setSession ( null ) ; "<AssertPlaceHolder>" ; } getUsername ( ) { if ( ( session ) != null ) { return session . getUsername ( ) ; } else { return null ; } }
|
org . junit . Assert . assertNull ( command . getUsername ( ) )
|
testConvertOutboundConnectionToBucketName_UsesNamespaceAndIsLowerCase ( ) { com . streamreduce . core . model . OutboundConfiguration mockOutboundConfiguration = mock ( com . streamreduce . core . model . OutboundConfiguration . class ) ; when ( mockOutboundConfiguration . getNamespace ( ) ) . thenReturn ( "Foo" ) ; java . lang . String bucketName = awsClientUnderTest . convertOutboundConnectionToBucketName ( mockOutboundConfiguration ) ; "<AssertPlaceHolder>" ; } convertOutboundConnectionToBucketName ( com . streamreduce . util . OutboundConfiguration ) { if ( org . springframework . util . StringUtils . hasText ( outboundConfiguration . getNamespace ( ) ) ) { return outboundConfiguration . getNamespace ( ) . toLowerCase ( ) ; } else { return ( ( com . streamreduce . util . AWSClient . BUCKET_PREFIX ) + "." ) + ( outboundConfiguration . getOriginatingConnection ( ) . getAccount ( ) . getId ( ) . toString ( ) . toLowerCase ( ) ) ; } }
|
org . junit . Assert . assertEquals ( "foo" , bucketName )
|
testFailPartWayThroughInsertStatementOn ( ) { getConnection ( ) . createStatement ( ) . execute ( "SET<sp>transactionPeriodicallyCommit<sp>TO<sp>'on'" ) ; getConnection ( ) . setAutoCommit ( false ) ; getConnection ( ) . createStatement ( ) . execute ( "DROP<sp>TABLE<sp>fake.T1" ) ; getConnection ( ) . createStatement ( ) . execute ( "CREATE<sp>TABLE<sp>fake.T1<sp>(c1<sp>integer<sp>not<sp>null<sp>primary<sp>key,<sp>c2<sp>varchar(100))" ) ; try { getConnection ( ) . createStatement ( ) . execute ( ( ( ( ( "insert<sp>into<sp>fake.T1<sp>VALUES<sp>(0,<sp>'" + ( com . foundationdb . sql . pg . TransactionPeriodicallyCommitIT . SAMPLE_STRING ) ) + "'),(NULL,<sp>'" ) + ( com . foundationdb . sql . pg . TransactionPeriodicallyCommitIT . SAMPLE_STRING ) ) + "');" ) ) ; org . junit . Assert . fail ( "Expected<sp>exception" ) ; } catch ( java . sql . SQLException e ) { } getConnection ( ) . rollback ( ) ; "<AssertPlaceHolder>" ; } getCount ( ) { java . sql . ResultSet resultSet = getConnection ( ) . createStatement ( ) . executeQuery ( "SELECT<sp>COUNT(*)<sp>FROM<sp>fake.T1" ) ; org . junit . Assert . assertTrue ( resultSet . next ( ) ) ; return resultSet . getInt ( 1 ) ; }
|
org . junit . Assert . assertEquals ( 0 , getCount ( ) )
|
addMessageSetsPropertiesCorrectlyWhenNoPropertiesPresent ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsSingleMessage ) { final java . lang . String propertiesKeyword = "properties" ; final java . lang . String msgBody = "test-msg-body" ; final boolean isBase64Encoded = false ; final com . microsoft . azure . sdk . iot . device . MessageProperty [ ] properties = new com . microsoft . azure . sdk . iot . device . MessageProperty [ ] { } ; new mockit . NonStrictExpectations ( ) { { mockMsg . getBodyAsString ( ) ; result = msgBody ; mockMsg . getProperties ( ) ; result = properties ; mockMsg . isBase64Encoded ( ) ; result = isBase64Encoded ; } } ; com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage batchMsg = new com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage ( ) ; batchMsg . addMessage ( mockMsg ) ; java . lang . String testBatchBody = new java . lang . String ( batchMsg . getBody ( ) , tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessageTest . UTF8 ) . replaceAll ( "\\s" , "" ) ; "<AssertPlaceHolder>" ; } getBody ( ) { return java . util . Arrays . copyOf ( this . body , this . body . length ) ; }
|
org . junit . Assert . assertFalse ( testBatchBody . contains ( propertiesKeyword ) )
|
getInodeByInvalidId ( ) { mThrown . expect ( alluxio . exception . FileDoesNotExistException . class ) ; mThrown . expectMessage ( ExceptionMessage . INODE_DOES_NOT_EXIST . getMessage ( 1 ) ) ; "<AssertPlaceHolder>" ; try ( alluxio . master . file . meta . LockedInodePath inodePath = mTree . lockFullInodePath ( 1 , LockPattern . READ ) ) { } } inodeIdExists ( long ) { return mInodeStore . get ( id ) . isPresent ( ) ; }
|
org . junit . Assert . assertFalse ( mTree . inodeIdExists ( 1 ) )
|
testUnorderedLookupFindLast ( ) { System . out . println ( "testUnorderedLookupFindLast" ) ; java . lang . String BNumber ; java . lang . String result ; java . lang . String expResult ; java . lang . String Group ; long eventDate = 0 ; Group = "Default" ; BNumber = "0470000001" ; java . text . SimpleDateFormat sdfEvt = new java . text . SimpleDateFormat ( "yyyyMMddhhmmss" ) ; try { eventDate = ( sdfEvt . parse ( "20160301120000" ) . getTime ( ) ) / 1000 ; } catch ( java . lang . Exception ex ) { OpenRate . process . AbstractValidityFromLookupTest . message = "Error<sp>getting<sp>event<sp>date<sp>in<sp>test<sp><AbstractNPLookupTest>" ; org . junit . Assert . fail ( OpenRate . process . AbstractValidityFromLookupTest . message ) ; } result = OpenRate . process . AbstractValidityFromLookupTest . instance . getValidityFromMatch ( Group , BNumber , eventDate ) ; expResult = "VOXB" ; "<AssertPlaceHolder>" ; } getValidityFromMatch ( java . lang . String , java . lang . String , long ) { return NPC . getValiditySegmentMatch ( Group , resourceId , time ) ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
shouldReturnTrueWhenValidateTransferAndAllFieldsArentNull ( ) { given ( transfer . getStringField ( com . qcadoo . mes . materialFlow . hooks . TYPE ) ) . willReturn ( com . qcadoo . mes . materialFlow . hooks . TRANSPORT . getStringValue ( ) ) ; given ( transfer . getField ( com . qcadoo . mes . materialFlow . hooks . TIME ) ) . willReturn ( time ) ; given ( transfer . getBelongsToField ( com . qcadoo . mes . materialFlow . hooks . LOCATION_FROM ) ) . willReturn ( locationFrom ) ; given ( transfer . getBelongsToField ( com . qcadoo . mes . materialFlow . hooks . LOCATION_TO ) ) . willReturn ( locationTo ) ; boolean result = transferModelValidators . validateTransfer ( transferDD , transfer ) ; "<AssertPlaceHolder>" ; verify ( transfer , never ( ) ) . addError ( org . mockito . Mockito . any ( com . qcadoo . model . api . FieldDefinition . class ) , org . mockito . Mockito . anyString ( ) ) ; } validateTransfer ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { boolean isValid = true ; boolean result = true ; java . lang . String type = transfer . getStringField ( com . qcadoo . mes . materialFlow . hooks . TYPE ) ; java . util . Date time = ( ( java . util . Date ) ( transfer . getField ( com . qcadoo . mes . materialFlow . hooks . TIME ) ) ) ; if ( type == null ) { transfer . addError ( transferDD . getField ( com . qcadoo . mes . materialFlow . hooks . TYPE ) , com . qcadoo . mes . materialFlow . hooks . TransferModelValidators . L_MATERIAL_FLOW_VALIDATE_GLOBAL_ERROR_FILL_TYPE ) ; isValid = false ; } else { result = validateLocation ( transferDD , transfer , type ) ; } if ( time == null ) { transfer . addError ( transferDD . getField ( com . qcadoo . mes . materialFlow . hooks . TIME ) , com . qcadoo . mes . materialFlow . hooks . TransferModelValidators . L_MATERIAL_FLOW_VALIDATE_GLOBAL_ERROR_FILL_DATE ) ; isValid = false ; } if ( isValid ) { isValid = result ; } return isValid ; }
|
org . junit . Assert . assertTrue ( result )
|
lazyLoading ( ) { javax . persistence . EntityManager em = factory . createEntityManager ( ) ; org . meri . jpa . relationships . entities . manytomany . MtmOwner owner = em . find ( org . meri . jpa . relationships . entities . manytomany . MtmOwner . class , 1 ) ; em . close ( ) ; "<AssertPlaceHolder>" ; } getInverses ( ) { return inverses ; }
|
org . junit . Assert . assertNull ( owner . getInverses ( ) )
|
testNoLabel ( ) { java . util . Map < java . lang . String , java . lang . String > labels = new java . util . HashMap ( io . strimzi . kafka . init . InitWriterTest . labels ) ; labels . remove ( "failure-domain.beta.kubernetes.io/zone" ) ; io . strimzi . kafka . init . InitWriterConfig config = io . strimzi . kafka . init . InitWriterConfig . fromMap ( io . strimzi . kafka . init . InitWriterTest . envVars ) ; io . fabric8 . kubernetes . client . KubernetesClient client = mockKubernetesClient ( config . getNodeName ( ) , labels , Collections . EMPTY_LIST ) ; io . strimzi . kafka . init . InitWriter writer = new io . strimzi . kafka . init . InitWriter ( client , config ) ; "<AssertPlaceHolder>" ; } writeRack ( ) { java . util . Map < java . lang . String , java . lang . String > nodeLabels = client . nodes ( ) . withName ( config . getNodeName ( ) ) . get ( ) . getMetadata ( ) . getLabels ( ) ; io . strimzi . kafka . init . InitWriter . log . info ( "NodeLabels<sp>=<sp>{}" , nodeLabels ) ; java . lang . String rackId = nodeLabels . get ( config . getRackTopologyKey ( ) ) ; io . strimzi . kafka . init . InitWriter . log . info ( "Rack:<sp>{}<sp>=<sp>{}" , config . getRackTopologyKey ( ) , rackId ) ; if ( rackId == null ) { io . strimzi . kafka . init . InitWriter . log . error ( "Node<sp>{}<sp>doesn't<sp>have<sp>the<sp>label<sp>{}<sp>for<sp>getting<sp>the<sp>rackid" , config . getNodeName ( ) , config . getRackTopologyKey ( ) ) ; return false ; } return write ( io . strimzi . kafka . init . InitWriter . FILE_RACK_ID , rackId ) ; }
|
org . junit . Assert . assertFalse ( writer . writeRack ( ) )
|
testSplit5 ( ) { final org . eclipse . kapua . client . gateway . Topic topic = org . eclipse . kapua . client . gateway . Topic . split ( "//" ) ; "<AssertPlaceHolder>" ; } split ( java . lang . String ) { if ( path == null ) { return null ; } path = path . replaceAll ( "(^/+|/$)+" , "" ) ; if ( path . isEmpty ( ) ) { return null ; } return new org . eclipse . kapua . client . gateway . Topic ( java . util . Arrays . asList ( path . split ( "\\/+" ) ) ) ; }
|
org . junit . Assert . assertNull ( topic )
|
testHandleResponseThrowsIOException ( ) { com . amazonaws . Request < ? > request = new com . amazonaws . DefaultRequest < java . lang . String > ( "ServiceName" ) ; final com . amazonaws . http . HttpResponse httpResponse = new com . amazonaws . http . HttpResponse . Builder ( ) . statusText ( "TestResponse" ) . statusCode ( 200 ) . build ( ) ; com . amazonaws . http . HttpResponseHandler < com . amazonaws . AmazonWebServiceResponse < java . lang . String > > responseHandler = new com . amazonaws . http . HttpResponseHandler < com . amazonaws . AmazonWebServiceResponse < java . lang . String > > ( ) { @ com . amazonaws . http . Override public com . amazonaws . AmazonWebServiceResponse < java . lang . String > handle ( com . amazonaws . http . HttpResponse response ) throws com . amazonaws . http . Exception { "<AssertPlaceHolder>" ; throw new java . io . IOException ( "test" ) ; } @ com . amazonaws . http . Override public boolean needsConnectionLeftOpen ( ) { return false ; } } ; client . handleResponse ( request , responseHandler , httpResponse , new com . amazonaws . http . ExecutionContext ( ) ) ; } handle ( com . amazonaws . http . HttpResponse ) { com . amazonaws . AmazonServiceException ase = new com . amazonaws . AmazonServiceException ( "Fake<sp>service<sp>exception." ) ; ase . setStatusCode ( response . getStatusCode ( ) ) ; ase . setErrorCode ( response . getStatusText ( ) ) ; return ase ; }
|
org . junit . Assert . assertSame ( response , httpResponse )
|
selectKeysValues ( ) { com . gs . collections . impl . multimap . bag . HashBagMultimap < java . lang . String , java . lang . Integer > mutableMultimap = com . gs . collections . impl . multimap . bag . HashBagMultimap . newMultimap ( ) ; mutableMultimap . putAll ( "One" , com . gs . collections . impl . list . mutable . FastList . newListWith ( 1 , 2 , 3 , 4 , 2 ) ) ; mutableMultimap . putAll ( "Two" , com . gs . collections . impl . list . mutable . FastList . newListWith ( 2 , 3 , 4 , 5 , 2 ) ) ; com . gs . collections . api . multimap . bag . ImmutableBagMultimap < java . lang . String , java . lang . Integer > immutableMap = mutableMultimap . toImmutable ( ) ; com . gs . collections . api . multimap . bag . ImmutableBagMultimap < java . lang . String , java . lang . Integer > selectedMultimap = immutableMap . selectKeysValues ( ( key , value ) -> ( "Two" . equals ( key ) ) && ( ( value % 2 ) == 0 ) ) ; com . gs . collections . impl . multimap . bag . HashBagMultimap < java . lang . String , java . lang . Integer > expectedMultimap = com . gs . collections . impl . multimap . bag . HashBagMultimap . newMultimap ( ) ; expectedMultimap . putAll ( "Two" , com . gs . collections . impl . list . mutable . FastList . newListWith ( 2 , 4 , 2 ) ) ; com . gs . collections . api . multimap . bag . ImmutableBagMultimap < java . lang . String , java . lang . Integer > expectedImmutableMultimap = expectedMultimap . toImmutable ( ) ; "<AssertPlaceHolder>" ; } toImmutable ( ) { return this ; }
|
org . junit . Assert . assertEquals ( expectedImmutableMultimap , selectedMultimap )
|
testConvertAll ( ) { java . lang . Long id = 1L ; java . lang . String abbrName = "abbr<sp>Name" ; java . lang . String name = "n<sp>a<sp>m<sp>e" ; org . lnu . is . resource . address . type . AddressTypeResource source = new org . lnu . is . resource . address . type . AddressTypeResource ( ) ; source . setId ( id ) ; source . setAbbrName ( abbrName ) ; source . setName ( name ) ; java . util . List < org . lnu . is . resource . address . type . AddressTypeResource > sources = java . util . Arrays . asList ( source ) ; org . lnu . is . domain . address . type . AddressType expected = new org . lnu . is . domain . address . type . AddressType ( ) ; expected . setId ( id ) ; expected . setAbbrName ( abbrName ) ; expected . setName ( name ) ; java . util . List < org . lnu . is . domain . address . type . AddressType > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . domain . address . type . AddressType > 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 )
|
shouldThrowIllegalStateExceptionOnMissingDeploymentGenerator ( ) { java . lang . System . setProperty ( ArchiveDeploymentToolingExporter . ARQUILLIAN_TOOLING_DEPLOYMENT_FOLDER , org . jboss . arquillian . container . test . impl . client . deployment . tool . ArchiveDeploymentToolingExporterTestCase . EXPORT_FOLDER ) ; fire ( new org . jboss . arquillian . container . spi . event . container . BeforeDeploy ( deployableContainer , deployment ) ) ; java . io . File exportedFile = new java . io . File ( ( ( ( org . jboss . arquillian . container . test . impl . client . deployment . tool . ArchiveDeploymentToolingExporterTestCase . EXPORT_FOLDER ) + ( getClass ( ) . getName ( ) ) ) + ".xml" ) ) ; "<AssertPlaceHolder>" ; exportedFile . delete ( ) ; } getName ( ) { return testClass . getName ( ) ; }
|
org . junit . Assert . assertTrue ( exportedFile . exists ( ) )
|
testMatches ( ) { java . lang . String header = "<?xml<sp>version=\"\"?><PC-Compound/>" ; "<AssertPlaceHolder>" ; } matches ( org . openscience . cdk . interfaces . IAtom ) { return ! ( symbols . contains ( atom . getSymbol ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( matches ( header ) )
|
testUint24 ( ) { byte [ ] buf = new byte [ 3 ] ; for ( int x = 0 ; x < 10000 ; x ++ ) { int i = org . jitsi . util . RTPUtilsTest . random . nextInt ( 16777215 ) ; org . jitsi . util . RTPUtils . writeUint24 ( buf , 0 , i ) ; int j = org . jitsi . util . RTPUtils . readUint24AsInt ( buf , 0 ) ; "<AssertPlaceHolder>" ; } } readUint24AsInt ( byte [ ] , int ) { int b1 = 255 & ( buf [ ( off + 0 ) ] ) ; int b2 = 255 & ( buf [ ( off + 1 ) ] ) ; int b3 = 255 & ( buf [ ( off + 2 ) ] ) ; return ( ( b1 << 16 ) | ( b2 << 8 ) ) | b3 ; }
|
org . junit . Assert . assertEquals ( i , j )
|
getPcjMetadata ( ) { try ( final org . apache . rya . indexing . pcj . storage . PrecomputedJoinStorage pcjStorage = new org . apache . rya . indexing . pcj . storage . mongo . MongoPcjStorage ( getMongoClient ( ) , conf . getRyaInstanceName ( ) ) ) { final org . apache . rya . mongodb . instance . MongoRyaInstanceDetailsRepository detailsRepo = new org . apache . rya . mongodb . instance . MongoRyaInstanceDetailsRepository ( getMongoClient ( ) , conf . getRyaInstanceName ( ) ) ; detailsRepo . initialize ( org . apache . rya . api . instance . RyaDetails . builder ( ) . setRyaInstanceName ( conf . getRyaInstanceName ( ) ) . setRyaVersion ( "test" ) . setEntityCentricIndexDetails ( new org . apache . rya . api . instance . RyaDetails . EntityCentricIndexDetails ( false ) ) . setTemporalIndexDetails ( new org . apache . rya . api . instance . RyaDetails . TemporalIndexDetails ( false ) ) . setFreeTextDetails ( new org . apache . rya . api . instance . RyaDetails . FreeTextIndexDetails ( false ) ) . setProspectorDetails ( new org . apache . rya . api . instance . RyaDetails . ProspectorDetails ( com . google . common . base . Optional . absent ( ) ) ) . setJoinSelectivityDetails ( new org . apache . rya . api . instance . RyaDetails . JoinSelectivityDetails ( com . google . common . base . Optional . absent ( ) ) ) . setPCJIndexDetails ( org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . builder ( ) . setEnabled ( true ) ) . build ( ) ) ; final java . lang . String sparql = "SELECT<sp>*<sp>WHERE<sp>{<sp>?a<sp><http://isA><sp>?b<sp>}" ; final java . lang . String pcjId = pcjStorage . createPcj ( sparql ) ; final org . apache . rya . indexing . pcj . storage . PcjMetadata metadata = pcjStorage . getPcjMetadata ( pcjId ) ; final java . util . Set < org . apache . rya . indexing . pcj . storage . accumulo . VariableOrder > varOrders = new org . apache . rya . indexing . pcj . storage . accumulo . ShiftVarOrderFactory ( ) . makeVarOrders ( sparql ) ; final org . apache . rya . indexing . pcj . storage . PcjMetadata expectedMetadata = new org . apache . rya . indexing . pcj . storage . PcjMetadata ( sparql , 0L , varOrders ) ; "<AssertPlaceHolder>" ; } } makeVarOrders ( java . lang . String ) { requireNonNull ( sparql ) ; final java . util . Set < java . lang . String > bindingNames = new org . eclipse . rdf4j . query . parser . sparql . SPARQLParser ( ) . parseQuery ( sparql , null ) . getTupleExpr ( ) . getBindingNames ( ) ; return makeVarOrders ( new org . apache . rya . indexing . pcj . storage . accumulo . VariableOrder ( bindingNames ) ) ; }
|
org . junit . Assert . assertEquals ( expectedMetadata , metadata )
|
testBadFactory ( ) { org . pentaho . platform . engine . core . system . objfac . references . PrototypePentahoObjectReference . Builder < java . lang . String > builder = new org . pentaho . platform . engine . core . system . objfac . references . PrototypePentahoObjectReference . Builder < java . lang . String > ( . class ) ; builder . creator ( new org . pentaho . platform . api . engine . IObjectCreator < java . lang . String > ( ) { @ org . pentaho . platform . engine . core . system . objfac . Override public java . lang . String create ( org . pentaho . platform . api . engine . IPentahoSession session ) { throw new java . lang . RuntimeException ( "I<sp>am<sp>bad" ) ; } } ) ; org . pentaho . platform . engine . core . system . objfac . references . PrototypePentahoObjectReference < java . lang . String > factoryReference = builder . build ( ) ; "<AssertPlaceHolder>" ; } getObject ( ) { org . pentaho . platform . plugin . services . security . userrole . memory . UserRoleListEnhancedUserMap userRoleListEnhanceduserMap = new org . pentaho . platform . plugin . services . security . userrole . memory . UserRoleListEnhancedUserMap ( ) ; org . pentaho . platform . plugin . services . security . userrole . memory . UserRoleListEnhancedUserMapEditor . addUsersFromProperties ( userRoleListEnhanceduserMap , userMap ) ; return userRoleListEnhanceduserMap ; }
|
org . junit . Assert . assertNull ( factoryReference . getObject ( ) )
|
testLastDLSN ( ) { org . apache . distributedlog . DLSN dlsn = mock ( org . apache . distributedlog . DLSN . class ) ; when ( impl . getLastDLSN ( ) ) . thenReturn ( dlsn ) ; "<AssertPlaceHolder>" ; verify ( impl , times ( 1 ) ) . getLastDLSN ( ) ; } getLastDLSN ( ) { return lastDLSN ; }
|
org . junit . Assert . assertEquals ( dlsn , manager . getLastDLSN ( ) )
|
testGetServerJar ( ) { System . out . println ( "getServerJar" ) ; com . espirit . moddev . cli . commands . server . ServerStartCommand instance = createTestling ( ) ; instance . setServerJar ( "test" ) ; java . lang . String expResult = "test" ; java . lang . String result = instance . getServerJar ( ) ; "<AssertPlaceHolder>" ; } getServerJar ( ) { return serverJar ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testDataForSQLQueryWithSequences ( ) { java . lang . String ddl = ( "CREATE<sp>TABLE<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoaderIT . TABLE_FULL_NAME ) ) + "<sp>(ID<sp>INTEGER<sp>NOT<sp>NULL<sp>PRIMARY<sp>KEY,<sp>NAME<sp>VARCHAR,<sp>AGE<sp>INTEGER)<sp>" ; org . apache . phoenix . pig . PhoenixHBaseLoaderIT . conn . createStatement ( ) . execute ( ddl ) ; java . lang . String sequenceDdl = "CREATE<sp>SEQUENCE<sp>my_sequence" ; org . apache . phoenix . pig . PhoenixHBaseLoaderIT . conn . createStatement ( ) . execute ( sequenceDdl ) ; final java . lang . String dml = ( "UPSERT<sp>INTO<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoaderIT . TABLE_FULL_NAME ) ) + "<sp>VALUES(?,?,?)" ; java . sql . PreparedStatement stmt = org . apache . phoenix . pig . PhoenixHBaseLoaderIT . conn . prepareStatement ( dml ) ; int rows = 20 ; for ( int i = 0 ; i < rows ; i ++ ) { stmt . setInt ( 1 , i ) ; stmt . setString ( 2 , ( "a" + i ) ) ; stmt . setInt ( 3 , ( ( i % 2 ) == 0 ? 25 : 30 ) ) ; stmt . execute ( ) ; } org . apache . phoenix . pig . PhoenixHBaseLoaderIT . conn . commit ( ) ; final java . lang . String sqlQuery = ( "<sp>SELECT<sp>NEXT<sp>VALUE<sp>FOR<sp>my_sequence<sp>AS<sp>my_seq,ID,NAME,AGE<sp>FROM<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoaderIT . TABLE_FULL_NAME ) ) + "('%s');" 0 ; org . apache . phoenix . pig . PhoenixHBaseLoaderIT . pigServer . registerQuery ( java . lang . String . format ( ( ( "A<sp>=<sp>load<sp>'hbase://query/%s'<sp>using<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoader . class . getName ( ) ) ) + "('%s');" ) , sqlQuery , org . apache . phoenix . pig . PhoenixHBaseLoaderIT . zkQuorum ) ) ; java . util . Iterator < org . apache . pig . data . Tuple > iterator = org . apache . phoenix . pig . PhoenixHBaseLoaderIT . pigServer . openIterator ( "A" ) ; int recordsRead = 0 ; while ( iterator . hasNext ( ) ) { iterator . next ( ) ; recordsRead ++ ; } "<AssertPlaceHolder>" ; } next ( ) { if ( atEnd ) { return false ; } while ( true ) { boolean b = delegate . next ( ) ; if ( ! b ) { atEnd = true ; return b ; } if ( isSatisfiedMidKeyCondition ( delegate . getKeyValue ( ) ) ) { return true ; } } }
|
org . junit . Assert . assertEquals ( ( rows / 2 ) , recordsRead )
|
testBuildURIInvalidScheme ( ) { try { org . hl7 . fhir . instance . client . ResourceAddress . buildAbsoluteURI ( "urn://hl7connect.healthintersections.com.au/svc/fhir" ) ; org . junit . Assert . fail ( "Should<sp>not<sp>be<sp>here<sp>as<sp>scheme<sp>is<sp>invalid" ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } buildAbsoluteURI ( java . lang . String ) { if ( org . apache . commons . lang3 . StringUtils . isBlank ( absoluteURI ) ) { throw new org . hl7 . fhir . client . EFhirClientException ( "Invalid<sp>URI" , new java . net . URISyntaxException ( absoluteURI , "URI/URL<sp>cannot<sp>be<sp>blank" ) ) ; } java . lang . String endpoint = org . hl7 . fhir . client . ResourceAddress . appendForwardSlashToPath ( absoluteURI ) ; return org . hl7 . fhir . client . ResourceAddress . buildEndpointUriFromString ( endpoint ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testGetService ( ) { java . lang . Object result = mock ( java . lang . Object . class ) ; when ( bc . getServiceReference ( java . lang . Object . class . getName ( ) ) ) . thenReturn ( rf ) ; when ( bc . getService ( rf ) ) . thenReturn ( result ) ; java . lang . Object S = org . cytoscape . service . util . internal . utils . ServiceUtil . getService ( bc , java . lang . Object . class , ( ( java . util . List < org . osgi . framework . ServiceReference < ? > > ) ( mock ( java . util . List . class ) ) ) ) ; "<AssertPlaceHolder>" ; } getService ( org . osgi . framework . BundleContext , java . lang . Class , java . util . List ) { try { org . osgi . framework . ServiceReference < ? > ref = bc . getServiceReference ( serviceClass . getName ( ) ) ; if ( ref == null ) throw new java . lang . NullPointerException ( ( "ServiceReference<sp>is<sp>null<sp>for:<sp>" + ( serviceClass . getName ( ) ) ) ) ; if ( gottenServices != null ) gottenServices . add ( ref ) ; return serviceClass . cast ( bc . getService ( ref ) ) ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( ( "Couldn't<sp>find<sp>service:<sp>" + ( serviceClass . getName ( ) ) ) , e ) ; } }
|
org . junit . Assert . assertEquals ( result , S )
|
testAnyIteratorExp01 ( ) { testpackage . Class1 class1 ; class1 = new testpackage . Class1 ( ) ; "<AssertPlaceHolder>" ; } testAnyIteratorExp01 ( ) { testpackage . Class1 class1 ; class1 = new testpackage . Class1 ( ) ; org . junit . Assert . assertEquals ( new java . lang . Integer ( 2 ) , class1 . testAnyIteratorExp01 ( ) ) ; }
|
org . junit . Assert . assertEquals ( new java . lang . Integer ( 2 ) , class1 . testAnyIteratorExp01 ( ) )
|
testSimpleFields ( ) { java . lang . ClassLoader classLoader = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; org . kie . soup . project . datamodel . commons . types . TypeResolver typeResolver = new org . kie . soup . project . datamodel . commons . types . ClassTypeResolver ( new java . util . HashSet < java . lang . String > ( ) , classLoader ) ; typeResolver . addImport ( "org.drools.workbench.models.testscenarios.backend.Cheese" ) ; org . drools . workbench . models . testscenarios . backend . Mouse mouse = new org . drools . workbench . models . testscenarios . backend . Mouse ( ) ; org . drools . workbench . models . testscenarios . shared . FactAssignmentField factAssignmentField = new org . drools . workbench . models . testscenarios . shared . FactAssignmentField ( "cheese" , "Cheese" ) ; factAssignmentField . getFact ( ) . getFieldData ( ) . add ( new org . drools . workbench . models . testscenarios . shared . FieldData ( "type" , "Best<sp>cheddar<sp>EVER!<sp>(tm)" ) ) ; org . drools . workbench . models . testscenarios . backend . populators . FactAssignmentFieldPopulator factAssignmentFieldPopulator = new org . drools . workbench . models . testscenarios . backend . populators . FactAssignmentFieldPopulator ( mouse , factAssignmentField , typeResolver ) ; factAssignmentFieldPopulator . populate ( new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; "<AssertPlaceHolder>" ; } getCheese ( ) { return this . cheese ; }
|
org . junit . Assert . assertEquals ( "Best<sp>cheddar<sp>EVER!<sp>(tm)" , mouse . getCheese ( ) . getType ( ) )
|
syncSensorsMetadataWithError ( ) { final long count = 10L ; final java . lang . String collectionName = "sensor" ; when ( mongoOps . getCollectionName ( eq ( org . sentilo . web . catalog . domain . Sensor . class ) ) ) . thenReturn ( collectionName ) ; when ( mongoOps . count ( any ( org . springframework . data . mongodb . core . query . Query . class ) , eq ( org . sentilo . web . catalog . domain . Sensor . class ) ) ) . thenReturn ( count ) ; when ( mongoOps . find ( any ( org . springframework . data . mongodb . core . query . Query . class ) , eq ( org . sentilo . web . catalog . domain . Sensor . class ) , eq ( collectionName ) ) ) . thenReturn ( buildMockList ( sensor , count ) ) ; doThrow ( org . sentilo . common . exception . RESTClientException . class ) . doNothing ( ) . when ( platformService ) . saveResources ( any ( org . sentilo . web . catalog . domain . PlatformAdminInputMessage . class ) ) ; service . syncSensorsMetadata ( ) ; final boolean syncSensorsIsRunning = ( ( java . lang . Boolean ) ( org . springframework . test . util . ReflectionTestUtils . getField ( service , "syncSensorsIsRunning" ) ) ) ; "<AssertPlaceHolder>" ; verify ( mongoOps ) . count ( any ( org . springframework . data . mongodb . core . query . Query . class ) , eq ( org . sentilo . web . catalog . domain . Sensor . class ) ) ; verify ( platformService , times ( 2 ) ) . saveResources ( any ( org . sentilo . web . catalog . domain . PlatformAdminInputMessage . class ) ) ; verify ( mongoOps , times ( 2 ) ) . updateMulti ( any ( org . springframework . data . mongodb . core . query . Query . class ) , any ( org . springframework . data . mongodb . core . query . Update . class ) , eq ( sensor . getClass ( ) ) ) ; } syncSensorsMetadata ( ) { if ( syncSensorsIsRunning ) { org . sentilo . web . catalog . admin . service . impl . SynchronizationServiceImpl . LOGGER . warn ( "Previous<sp>sync<sp>sensors<sp>job<sp>is<sp>already<sp>running!" ) ; return ; } try { final long startTime = java . lang . System . currentTimeMillis ( ) ; syncSensorsIsRunning = true ; final int resourcesSync = syncResourcesMetadata ( org . sentilo . web . catalog . domain . Sensor . class , "providerId" , "sensorId" , "state" , "ttl" ) ; if ( resourcesSync > 0 ) { org . sentilo . web . catalog . admin . service . impl . SynchronizationServiceImpl . LOGGER . info ( "Process<sp>finished.<sp>{}<sp>sensors<sp>synchronized<sp>in<sp>{}<sp>ms" , resourcesSync , ( ( java . lang . System . currentTimeMillis ( ) ) - startTime ) ) ; } } catch ( final java . lang . Exception e ) { org . sentilo . web . catalog . admin . service . impl . SynchronizationServiceImpl . LOGGER . error ( "Sync<sp>process<sp>aborted<sp>due<sp>to<sp>an<sp>error<sp>(it<sp>will<sp>restart<sp>shortly):<sp>{}<sp>" , e . getMessage ( ) , e ) ; } finally { syncSensorsIsRunning = false ; } }
|
org . junit . Assert . assertFalse ( syncSensorsIsRunning )
|
validateServiceImpl ( ) { java . lang . Class < ? > svcImplClass = org . ebayopensource . turmeric . tools . codegen . SimpleServiceImpl . class ; java . lang . Class < ? > svcInterfaceClass = org . ebayopensource . turmeric . tools . codegen . SimpleServiceInterface . class ; java . util . List < org . ebayopensource . turmeric . tools . codegen . validator . MessageObject > errMsgList = org . ebayopensource . turmeric . tools . codegen . validator . SourceValidator . validateServiceImpl ( svcImplClass , svcInterfaceClass ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( ( ( null == ( m_adapter ) ) || ( null == ( m_boundTypes ) ) ) || ( null == ( m_valueTypes ) ) ) || ( ( m_boundTypes . size ( ) ) == 0 ) ) || ( ( m_valueTypes . size ( ) ) == 0 ) ; }
|
org . junit . Assert . assertTrue ( errMsgList . isEmpty ( ) )
|
testRemoveAll2 ( ) { java . util . Map < java . lang . String , java . lang . String > oldMap = new com . cedarsoftware . util . CaseInsensitiveMap ( ) ; java . util . Map < java . lang . String , java . lang . String > newMap = new com . cedarsoftware . util . CaseInsensitiveMap ( ) ; oldMap . put ( "bart" , null ) ; oldMap . put ( "qux" , null ) ; newMap . put ( "foo" , null ) ; newMap . put ( "bar" , null ) ; newMap . put ( "qux" , null ) ; java . util . Set < java . lang . String > oldKeys = oldMap . keySet ( ) ; java . util . Set < java . lang . String > newKeys = newMap . keySet ( ) ; boolean ret = newKeys . removeAll ( oldKeys ) ; "<AssertPlaceHolder>" ; } removeAll ( java . util . Collection ) { int size = map . size ( ) ; for ( java . lang . Object elem : c ) { map . remove ( elem ) ; } return ( map . size ( ) ) != size ; }
|
org . junit . Assert . assertTrue ( ret )
|
decreasingSizeMustEventuallyDeallocateSurplusObjects ( ) { int startingSize = 5 ; int newSize = 1 ; allocator = allocator ( ) ; config . setSize ( startingSize ) ; config . setAllocator ( allocator ) ; createPool ( ) ; java . util . List < stormpot . GenericPoolable > objs = new java . util . ArrayList ( ) ; while ( ( allocator . countAllocations ( ) ) != startingSize ) { objs . add ( pool . claim ( stormpot . PoolTest . longTimeout ) ) ; } pool . setTargetSize ( newSize ) ; while ( ( allocator . countDeallocations ( ) ) != ( startingSize - newSize ) ) { if ( ( objs . size ( ) ) > 0 ) { objs . remove ( 0 ) . release ( ) ; } else { pool . claim ( stormpot . PoolTest . longTimeout ) . release ( ) ; } java . util . concurrent . locks . LockSupport . parkNanos ( 10000000 ) ; } int actualSize = ( allocator . countAllocations ( ) ) - ( allocator . countDeallocations ( ) ) ; try { "<AssertPlaceHolder>" ; } finally { for ( stormpot . GenericPoolable obj : objs ) { obj . release ( ) ; } } } release ( ) { lastReleaseBy = java . lang . Thread . currentThread ( ) ; slot . release ( this ) ; }
|
org . junit . Assert . assertThat ( actualSize , is ( newSize ) )
|
testParsingOfNoGroupBy ( ) { final net . meisen . dissertation . impl . parser . query . select . SelectQuery query = q ( "select<sp>timeSeries<sp>from<sp>\"model\"<sp>in<sp>[03.03.2014,05.03.2014)" ) ; final net . meisen . dissertation . impl . parser . query . select . group . GroupExpression group = query . getGroup ( ) ; final java . util . Set < java . lang . Object > descriptors = group . getSelectors ( ) ; "<AssertPlaceHolder>" ; } size ( ) { idxLock . readLock ( ) . lock ( ) ; try { return getDescriptorIndex ( ) . size ( ) ; } finally { idxLock . readLock ( ) . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( 0 , descriptors . size ( ) )
|
testFormat_PositionalArguments ( ) { java . lang . String n = "n" ; java . lang . String p = "p" ; java . lang . String expected = "n:p" ; java . lang . String actual = org . stringtemplate . v4 . ST . format ( "<%1>:<%2>" , n , p ) ; "<AssertPlaceHolder>" ; } format ( int , java . lang . String , java . lang . Object [ ] ) { template = template . replaceAll ( "%([0-9]+)" , "arg$1" ) ; org . stringtemplate . v4 . ST st = new org . stringtemplate . v4 . ST ( template ) ; int i = 1 ; for ( java . lang . Object a : attributes ) { st . add ( ( "arg" + i ) , a ) ; i ++ ; } return st . render ( lineWidth ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
count_A$Function1_Nil ( ) { com . m3 . scalaflavor4j . Seq < java . lang . Integer > seq = com . m3 . scalaflavor4j . IndexedSeq . apply ( ) ; java . lang . Integer actual = seq . count ( new com . m3 . scalaflavor4j . F1 < java . lang . Integer , java . lang . Boolean > ( ) { public com . m3 . scalaflavor4j . Boolean apply ( java . lang . Integer v1 ) { return v1 < 3 ; } } ) ; java . lang . Integer expected = 0 ; "<AssertPlaceHolder>" ; } apply ( ) { com . m3 . scalaflavor4j . MainFunction main = new com . m3 . scalaflavor4j . MainFunction ( ) { public void apply ( java . lang . String [ ] args ) throws com . m3 . scalaflavor4j . Exception { print . apply ( args . length ) ; com . m3 . scalaflavor4j . Seq . apply ( args ) . foreach ( new com . m3 . scalaflavor4j . VoidF1 < java . lang . String > ( ) { public void apply ( java . lang . String arg ) throws com . m3 . scalaflavor4j . Exception { print . apply ( arg ) ; } } ) ; } } ; main . apply ( new java . lang . String [ ] { "a" , "b" } ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testWordNet ( ) { edu . illinois . cs . cogcomp . sim . WordSim ws = new edu . illinois . cs . cogcomp . sim . WordSim ( edu . illinois . cs . cogcomp . wordSim . WordSimTest . rm_ , "wordnet" ) ; edu . illinois . cs . cogcomp . sim . MetricResponse m1 = ws . compare ( "word" , "sentence" , "wordnet" ) ; edu . illinois . cs . cogcomp . sim . MetricResponse m2 = ws . compare ( "word" , "wife" , "wordnet" ) ; "<AssertPlaceHolder>" ; } compare ( java . lang . String , java . lang . String , java . lang . String ) { double score = 0 ; if ( method . equals ( EmbeddingConstant . word2vec ) ) { score = word2vec . simScore ( small , big ) ; } else if ( method . equals ( EmbeddingConstant . paragram ) ) { score = paragram . simScore ( small , big ) ; } else if ( method . equals ( EmbeddingConstant . glove ) ) { score = glove . simScore ( small , big ) ; } else if ( method . equals ( EmbeddingConstant . phrase2vec ) ) { score = phrase2vec . simScore ( small , big ) ; } else if ( method . equals ( EmbeddingConstant . memorybasedESA ) ) { score = esa . cosine ( small , big ) ; } else if ( method . equals ( EmbeddingConstant . wordnet ) ) { return wnsim . compare ( small , big ) ; } else throw new java . lang . IllegalArgumentException ( "Requires<sp>an<sp>argument" ) ; return new edu . illinois . cs . cogcomp . sim . MetricResponse ( score , method ) ; }
|
org . junit . Assert . assertTrue ( ( ( m1 . score ) > ( m2 . score ) ) )
|
testIncorrectFilterString ( ) { java . lang . String filterString = "()" ; byte [ ] filterStringAsByteArray = org . apache . hadoop . hbase . util . Bytes . toBytes ( filterString ) ; try { filter = f . parseFilterString ( filterStringAsByteArray ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . IllegalArgumentException e ) { System . out . println ( e . getMessage ( ) ) ; } } parseFilterString ( java . lang . String ) { return parseFilterString ( org . apache . hadoop . hbase . util . Bytes . toBytes ( filterString ) ) ; }
|
org . junit . Assert . assertTrue ( false )
|
testGetLog ( ) { org . apache . ambari . server . controller . ivory . Instance instance = new org . apache . ambari . server . controller . ivory . Instance ( "Feed1" , "Instance1" , "SUBMITTED" , "start" , "end" , "details" , "log" ) ; "<AssertPlaceHolder>" ; } getLog ( ) { return log ; }
|
org . junit . Assert . assertEquals ( "log" , instance . getLog ( ) )
|
testModifyTicketAddHostEmptyHost ( ) { org . irods . jargon . ticket . packinstr . TicketAdminInp pi = org . irods . jargon . ticket . packinstr . TicketAdminInp . instanceForModifyAddAccess ( ticketId , TicketModifyAddOrRemoveTypeEnum . TICKET_MODIFY_HOST , "" ) ; "<AssertPlaceHolder>" ; } instanceForModifyAddAccess ( java . lang . String , org . irods . jargon . ticket . packinstr . TicketModifyAddOrRemoveTypeEnum , java . lang . String ) { if ( ( ticketId == null ) || ( ticketId . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "null<sp>or<sp>empty<sp>ticket<sp>id" ) ; } if ( addTypeEnum == null ) { throw new java . lang . IllegalArgumentException ( "null<sp>modify<sp>add<sp>permission<sp>type<sp>not<sp>set" ) ; } if ( ( modObject == null ) || ( modObject . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "null<sp>or<sp>empty<sp>modify<sp>add<sp>-<sp>user,<sp>group,<sp>or<sp>host" ) ; } return new org . irods . jargon . ticket . packinstr . TicketAdminInp ( TICKET_ADMIN_INP_API_NBR , "mod" , ticketId , "add" , addTypeEnum . getTextValue ( ) , modObject , BLANK ) ; }
|
org . junit . Assert . assertNotNull ( pi )
|
testTranslateTextSuccessfull3 ( ) { java . lang . String result = im . translateText ( "group<sp>1" , "rule<sp>4" , null ) ; java . lang . String expResult = "donet<sp>je<sp>zakljucak<sp>4" ; "<AssertPlaceHolder>" ; } translateText ( java . lang . String , java . lang . String , java . lang . Object [ ] ) { if ( ( rule == null ) || ( rule . equals ( "" ) ) ) { throw new org . goodoldai . jeff . explanation . ExplanationException ( "You<sp>must<sp>enter<sp>a<sp>non-null,<sp>non-empty<sp>rule<sp>identifier" ) ; } java . util . ResourceBundle translationBundle = null ; if ( text . containsKey ( group ) ) { translationBundle = text . get ( group ) ; } if ( translationBundle == null ) { java . lang . String resourceBundleFile = "text" ; if ( ! ( ( group == null ) || ( group . equals ( "" ) ) ) ) { resourceBundleFile = ( group . trim ( ) . replace ( '<sp>' , '_' ) ) + "_text" ; } try { translationBundle = java . util . ResourceBundle . getBundle ( resourceBundleFile , locale ) ; text . put ( group , translationBundle ) ; } catch ( java . lang . Exception e ) { throw new org . goodoldai . jeff . explanation . ExplanationException ( e . getMessage ( ) ) ; } } if ( ! ( translationBundle . containsKey ( rule ) ) ) { return null ; } else { if ( arguments == null ) { return translationBundle . getString ( rule ) ; } else { java . text . MessageFormat mf = new java . text . MessageFormat ( translationBundle . getString ( rule ) , locale ) ; return mf . format ( arguments , new java . lang . StringBuffer ( ) , null ) . toString ( ) ; } } }
|
org . junit . Assert . assertEquals ( expResult , result )
|
addScheduledOrderTest ( ) { java . util . List < org . threadly . concurrent . AbstractPriorityScheduler . TaskWrapper > orderedList = new java . util . ArrayList ( TEST_QTY ) ; for ( int i = 0 ; i < ( TEST_QTY ) ; i ++ ) { orderedList . add ( new org . threadly . concurrent . AbstractPriorityScheduler . OneTimeTaskWrapper ( org . threadly . concurrent . DoNothingRunnable . instance ( ) , null , ( ( org . threadly . util . Clock . accurateForwardProgressingMillis ( ) ) + i ) ) ) ; } java . util . List < org . threadly . concurrent . AbstractPriorityScheduler . TaskWrapper > randomList = new java . util . ArrayList ( orderedList ) ; java . util . Collections . shuffle ( randomList ) ; java . util . Iterator < org . threadly . concurrent . AbstractPriorityScheduler . TaskWrapper > it = randomList . iterator ( ) ; while ( it . hasNext ( ) ) { queueSet . addScheduled ( it . next ( ) ) ; } java . util . Iterator < org . threadly . concurrent . AbstractPriorityScheduler . TaskWrapper > expectedIt = orderedList . iterator ( ) ; java . util . Iterator < org . threadly . concurrent . AbstractPriorityScheduler . TaskWrapper > resultIt = queueSet . scheduleQueue . iterator ( ) ; while ( expectedIt . hasNext ( ) ) { "<AssertPlaceHolder>" ; } } next ( ) { if ( null == ( next ) ) { throw new java . util . NoSuchElementException ( ) ; } org . threadly . util . debug . ThreadSample toReturn = next ; findNext ( ) ; return toReturn ; }
|
org . junit . Assert . assertTrue ( ( ( expectedIt . next ( ) ) == ( resultIt . next ( ) ) ) )
|
sslRootCert ( ) { final java . io . File file = new java . io . File ( "test" ) ; final io . trane . ndbc . Config . SSL ssl = Config . SSL . create ( Mode . REQUIRE ) . rootCert ( file ) ; "<AssertPlaceHolder>" ; } rootCert ( ) { return rootCert ; }
|
org . junit . Assert . assertEquals ( ssl . rootCert ( ) , java . util . Optional . of ( file ) )
|
testTroubleMaker ( ) { com . aliyun . odps . commons . util . RetryStrategyTest . trouble = 0 ; while ( true ) { try { com . aliyun . odps . commons . util . RetryStrategyTest . troubleMaker ( 5 ) ; } catch ( java . lang . RuntimeException e ) { continue ; } break ; } "<AssertPlaceHolder>" ; } troubleMaker ( int ) { if ( ( ( com . aliyun . odps . commons . util . RetryStrategyTest . trouble ) ++ ) != troubles ) { throw new java . lang . RuntimeException ( ( "I<sp>have<sp>trouble!!!<sp>" + ( com . aliyun . odps . commons . util . RetryStrategyTest . trouble ) ) , new java . lang . RuntimeException ( "cauze<sp>I<sp>am<sp>cool" ) ) ; } }
|
org . junit . Assert . assertEquals ( 6 , com . aliyun . odps . commons . util . RetryStrategyTest . trouble )
|
get_partition_names ( ) { java . util . List < java . lang . String > partitions = com . google . common . collect . Lists . newArrayList ( ) ; when ( primaryMapping . transformInboundDatabaseName ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P ) ) . thenReturn ( "inbound" ) ; when ( primaryClient . get_partition_names ( "inbound" , "table" , ( ( short ) ( 10 ) ) ) ) . thenReturn ( partitions ) ; java . util . List < java . lang . String > result = handler . get_partition_names ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P , "table" , ( ( short ) ( 10 ) ) ) ; "<AssertPlaceHolder>" ; verify ( primaryMapping , never ( ) ) . checkWritePermissions ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P ) ; } get_partition_names ( java . lang . String , java . lang . String , short ) { com . hotels . bdp . waggledance . mapping . model . DatabaseMapping mapping = databaseMappingService . databaseMapping ( db_name ) ; return mapping . getClient ( ) . get_partition_names ( mapping . transformInboundDatabaseName ( db_name ) , tbl_name , max_parts ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( partitions ) )
|
testAdminUser ( ) { codeine . permissions . UserPermissions newUserPermissions = new codeine . permissions . UserPermissions ( createUser ( "user" ) , true ) ; userPermissionsJson . permissions ( ) . add ( newUserPermissions ) ; codeine . permissions . IUserWithPermissions userPermissions = tested . getUserPermissions ( createUser ( "user" ) ) ; "<AssertPlaceHolder>" ; } isAdministrator ( ) { return administer ; }
|
org . junit . Assert . assertTrue ( userPermissions . isAdministrator ( ) )
|
shouldReturnFalseIfLexemesAreDifferent ( ) { com . github . zafarkhaja . semver . expr . Lexer . Token t1 = new com . github . zafarkhaja . semver . expr . Lexer . Token ( NUMERIC , "1" , 0 ) ; com . github . zafarkhaja . semver . expr . Lexer . Token t2 = new com . github . zafarkhaja . semver . expr . Lexer . Token ( NUMERIC , "2" , 0 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == other ) { return true ; } if ( ! ( other instanceof com . github . zafarkhaja . semver . Version ) ) { return false ; } return ( compareTo ( ( ( com . github . zafarkhaja . semver . Version ) ( other ) ) ) ) == 0 ; }
|
org . junit . Assert . assertFalse ( t1 . equals ( t2 ) )
|
testVariableInstanceString ( ) { com . effektif . workflow . api . workflowinstance . VariableInstance v = serializeVariableInstance ( "hello" ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertEquals ( "hello" , v . getValue ( ) )
|
testGetImageFile ( ) { net . sourceforge . tess4j . util . ImageIOHelperTest . logger . info ( "getImageFile" ) ; java . io . File inputFile = new java . io . File ( net . sourceforge . tess4j . util . ImageIOHelperTest . TEST_RESOURCES_DATA_PATH , "eurotext.png" ) ; java . io . File expResult = new java . io . File ( net . sourceforge . tess4j . util . ImageIOHelperTest . TEST_RESOURCES_DATA_PATH , "eurotext.png" ) ; java . io . File result = net . sourceforge . tess4j . util . ImageIOHelper . getImageFile ( inputFile ) ; "<AssertPlaceHolder>" ; } getImageFile ( java . io . File ) { java . io . File imageFile = inputFile ; if ( inputFile . getName ( ) . toLowerCase ( ) . endsWith ( ".pdf" ) ) { imageFile = net . sourceforge . tess4j . util . PdfUtilities . convertPdf2Tiff ( inputFile ) ; } return imageFile ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testShutdownOther ( ) { createMetaServers ( serverCount ) ; sleep ( sleepForBalance ) ; for ( com . ctrip . xpipe . redis . meta . server . TestMetaServer server : getServers ( ) ) { if ( ! ( server . isLeader ( ) ) ) { logger . info ( remarkableMessage ( "[testShutdownOther][begin]{}" ) , server ) ; server . stop ( ) ; logger . info ( remarkableMessage ( "[testShutdownOther][<sp>end<sp>]{}" ) , server ) ; break ; } } sleep ( ( ( com . ctrip . xpipe . redis . meta . server . TestMetaServer . getWaitforrestarttimemills ( ) ) + 1000 ) ) ; com . ctrip . xpipe . redis . meta . server . TestMetaServer leader = getLeader ( ) ; com . ctrip . xpipe . redis . meta . server . cluster . SlotManager slotManager = leader . getContext ( ) . getBean ( com . ctrip . xpipe . redis . meta . server . cluster . SlotManager . class ) ; slotManager . refresh ( ) ; "<AssertPlaceHolder>" ; AssertBalance ( slotManager ) ; } allServers ( ) { try { lock . readLock ( ) . lock ( ) ; return new java . util . HashSet ( serverMap . keySet ( ) ) ; } finally { lock . readLock ( ) . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( ( ( serverCount ) - 1 ) , slotManager . allServers ( ) . size ( ) )
|
testBuildWithParameters ( ) { java . lang . String abbrName = "AN" ; java . lang . String name = "name" ; org . lnu . is . domain . address . type . AddressType context = new org . lnu . is . domain . address . type . AddressType ( ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>AddressType<sp>e<sp>WHERE<sp>(<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . address . type . AddressType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testSetUrl ( ) { org . messic . server . datamodel . datasource . MessicDataSource mds = new org . messic . server . datamodel . datasource . MessicDataSource ( ) ; java . lang . String urlTest = "jdbc:h2:MESSIC_PATH/db;DB_CLOSE_DELAY=-1" ; mds . setUrl ( urlTest ) ; "<AssertPlaceHolder>" ; } getUrl ( ) { return url ; }
|
org . junit . Assert . assertTrue ( ( ! ( mds . getUrl ( ) . equals ( urlTest ) ) ) )
|
validateSecondFieldEmpty ( ) { mFirstField . setText ( "abcdef" ) ; mSecondField . setText ( "" ) ; com . throrinstudio . android . common . libs . validator . validate . OrTwoRequiredValidate orTwoRequiredValidate = new com . throrinstudio . android . common . libs . validator . validate . OrTwoRequiredValidate ( mFirstField , mSecondField ) ; "<AssertPlaceHolder>" ; } isValid ( ) { for ( com . throrinstudio . android . common . libs . validator . AbstractValidator validator : mValidators ) { try { if ( ! ( validator . isValid ( mSourceView . getText ( ) . toString ( ) ) ) ) { if ( ( mCustomErrorNotification ) != null ) { mCustomErrorNotification . onInvalid ( this ) ; } else { setSourceViewError ( validator . getMessage ( ) , validator . getErrorDrawable ( ) ) ; } return false ; } else { if ( ( mCustomErrorNotification ) != null ) mCustomErrorNotification . onValid ( this ) ; } } catch ( com . throrinstudio . android . common . libs . validator . ValidatorException e ) { e . printStackTrace ( ) ; if ( ( mCustomErrorNotification ) != null ) { mCustomErrorNotification . onInvalid ( this ) ; } else { setSourceViewError ( e . getMessage ( ) , validator . getErrorDrawable ( ) ) ; } return false ; } } mSourceView . setError ( null ) ; return true ; }
|
org . junit . Assert . assertTrue ( orTwoRequiredValidate . isValid ( ) )
|
decreaseConcurrentOperationCountNegativeTest ( ) { com . vmware . vrack . hms . node . NodeMetaInfoProvider . increaseConcurrentOperationCount ( "N1" ) ; com . vmware . vrack . hms . node . NodeMetaInfoProvider . decreaseConcurrentOperationCount ( "N1" ) ; java . lang . Boolean lockAcquired = com . vmware . vrack . hms . node . NodeMetaInfoProvider . decreaseConcurrentOperationCount ( "N1" ) ; "<AssertPlaceHolder>" ; } decreaseConcurrentOperationCount ( java . lang . String ) { boolean relasedLockForOperationOnNode = false ; com . vmware . vrack . hms . node . NodeMetaInfoProvider . nodeServiceLock . lock ( ) ; try { com . vmware . vrack . hms . node . NodeMetaInfoProvider . logger . debug ( ( "Got<sp>the<sp>lock<sp>descreasing<sp>operation<sp>count<sp>for<sp>node:" + nodeId ) ) ; java . lang . Integer currentOperationCount = ( ( java . lang . Integer ) ( com . vmware . vrack . hms . node . NodeMetaInfoProvider . nodeMetaInfoMap . get ( nodeId ) ) ) ; if ( currentOperationCount == null ) { com . vmware . vrack . hms . node . NodeMetaInfoProvider . logger . warn ( ( ( "Strange!!<sp>Operation<sp>count<sp>for<sp>Node:" + nodeId ) + "<sp>is<sp>NOT<sp>present" ) ) ; } else if ( currentOperationCount > 0 ) { -- currentOperationCount ; com . vmware . vrack . hms . node . NodeMetaInfoProvider . logger . debug ( ( ( ( "Decreasing<sp>concurrent<sp>operation<sp>count<sp>for<sp>Node:" + nodeId ) + "<sp>to:" ) + currentOperationCount ) ) ; com . vmware . vrack . hms . node . NodeMetaInfoProvider . nodeMetaInfoMap . put ( nodeId , currentOperationCount ) ; relasedLockForOperationOnNode = true ; } else { com . vmware . vrack . hms . node . NodeMetaInfoProvider . logger . warn ( ( ( ( "Not<sp>resetting<sp>Concurrent<sp>operation<sp>count<sp>for<sp>Node:" + nodeId ) + "<sp>as<sp>it<sp>is:" ) + currentOperationCount ) ) ; } } catch ( java . lang . Exception ex ) { com . vmware . vrack . hms . node . NodeMetaInfoProvider . logger . warn ( ( "Error<sp>while<sp>decreasing<sp>for<sp>current<sp>operation<sp>count<sp>for<sp>Node:" + nodeId ) , ex ) ; } finally { com . vmware . vrack . hms . node . NodeMetaInfoProvider . nodeServiceLock . unlock ( ) ; } return relasedLockForOperationOnNode ; }
|
org . junit . Assert . assertFalse ( lockAcquired )
|
notifyCreate ( ) { final java . util . concurrent . atomic . AtomicBoolean shutdownSignal = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; final java . util . concurrent . BlockingQueue < org . apache . rya . streams . querymanager . QueryManager . QueryEvent > queue = new java . util . concurrent . ArrayBlockingQueue ( 1 ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; latch . countDown ( ) ; final org . apache . rya . streams . querymanager . QueryManager . QueryEventWorkGenerator generator = new org . apache . rya . streams . querymanager . QueryManager . QueryEventWorkGenerator ( "rya" , latch , queue , 50 , java . util . concurrent . TimeUnit . MILLISECONDS , shutdownSignal ) ; final java . util . UUID queryId = java . util . UUID . randomUUID ( ) ; final org . apache . rya . streams . api . entity . StreamsQuery query = new org . apache . rya . streams . api . entity . StreamsQuery ( queryId , "query" , true , false ) ; final java . lang . Thread notifyThread = new java . lang . Thread ( ( ) -> { final org . apache . rya . streams . api . queries . QueryChange change = org . apache . rya . streams . api . queries . QueryChange . create ( queryId , query . getSparql ( ) , query . isActive ( ) , query . isInsert ( ) ) ; final ChangeLogEntry < org . apache . rya . streams . api . queries . QueryChange > entry = new org . apache . rya . streams . querymanager . ChangeLogEntry < > ( 0 , change ) ; generator . notify ( entry , java . util . Optional . of ( query ) ) ; } ) ; notifyThread . start ( ) ; try { final org . apache . rya . streams . querymanager . QueryManager . QueryEvent event = queue . poll ( 500 , TimeUnit . MILLISECONDS ) ; final org . apache . rya . streams . querymanager . QueryManager . QueryEvent expected = org . apache . rya . streams . querymanager . QueryManager . QueryEvent . executing ( "rya" , new org . apache . rya . streams . api . entity . StreamsQuery ( queryId , query . getSparql ( ) , query . isActive ( ) , query . isInsert ( ) ) ) ; "<AssertPlaceHolder>" ; } finally { shutdownSignal . set ( true ) ; notifyThread . join ( ) ; } } isInsert ( ) { return isInsert ; }
|
org . junit . Assert . assertEquals ( expected , event )
|
g_V_selectXall_a_bX ( ) { final org . apache . tinkerpop . gremlin . process . traversal . Traversal < org . apache . tinkerpop . gremlin . structure . Vertex , java . util . Map < java . lang . String , java . lang . Object > > traversal = get_g_V_selectXall_a_bX ( ) ; printTraversalForm ( traversal ) ; "<AssertPlaceHolder>" ; } toList ( ) { return this . fill ( new java . util . ArrayList ( ) ) ; }
|
org . junit . Assert . assertEquals ( java . util . Collections . emptyList ( ) , traversal . toList ( ) )
|
join_two_primitive_arrays_in_java_with_guava ( ) { int [ ] allStateCapitalsByIndex = com . google . common . primitives . Ints . concat ( firstHalfStateCapitalByIndex , secondHalfStateCapitalByIndex ) ; java . util . Arrays . toString ( allStateCapitalsByIndex ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 50 , allStateCapitalsByIndex . length )
|
testCreateFilter ( ) { final java . util . function . Predicate < io . vertigo . dynamo . domain . model . DtObject > predicate = collectionsManager . filter ( io . vertigo . dynamo . collections . ListFilter . of ( ( "LABEL" + ":[a<sp>TO<sp>b]" ) ) ) ; "<AssertPlaceHolder>" ; } of ( java . lang . String ) { return new io . vertigo . dynamo . collections . ListFilter ( filterValue ) ; }
|
org . junit . Assert . assertNotNull ( predicate )
|
testOverwriteParam ( ) { final org . apache . hadoop . hdfs . web . resources . OverwriteParam p = new org . apache . hadoop . hdfs . web . resources . OverwriteParam ( OverwriteParam . DEFAULT ) ; "<AssertPlaceHolder>" ; new org . apache . hadoop . hdfs . web . resources . OverwriteParam ( "trUe" ) ; try { new org . apache . hadoop . hdfs . web . resources . OverwriteParam ( "abc" ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . IllegalArgumentException e ) { org . apache . hadoop . hdfs . web . resources . TestParam . LOG . info ( ( "EXPECTED:<sp>" + e ) ) ; } } getValue ( ) { return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( false , p . getValue ( ) )
|
testTautomerizationMechanism ( ) { org . openscience . cdk . reaction . IReactionMechanism mechanism = new org . openscience . cdk . reaction . mechanism . TautomerizationMechanism ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( mechanism )
|
testDeleteTriggerDefinition_wrong_authorization ( ) { container . login ( supplier1Key , org . oscm . triggerdefinitionservice . bean . ROLE_ORGANIZATION_ADMIN ) ; org . oscm . internal . vo . VOTriggerDefinition def1 = buildTriggerVO ( true ) ; createTriggerDefinition ( def1 ) ; java . util . List < org . oscm . internal . vo . VOTriggerDefinition > list = triggerDefinitionService . getTriggerDefinitions ( ) ; "<AssertPlaceHolder>" ; org . oscm . internal . vo . VOTriggerDefinition trigger = list . get ( 0 ) ; container . login ( supplier3Key , org . oscm . triggerdefinitionservice . bean . ROLE_ORGANIZATION_ADMIN ) ; deleteTriggerDefinition ( trigger . getKey ( ) ) ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , list . size ( ) )
|
givenExistingUser_whenAuthenticate_thenRetrieveFromDb ( ) { org . baeldung . custom . persistence . model . User user = new org . baeldung . custom . persistence . model . User ( ) ; user . setUsername ( org . baeldung . web . CustomUserDetailsServiceIntegrationTest . USERNAME ) ; user . setPassword ( passwordEncoder . encode ( org . baeldung . web . CustomUserDetailsServiceIntegrationTest . PASSWORD ) ) ; myUserRepository . save ( user ) ; org . springframework . security . authentication . UsernamePasswordAuthenticationToken auth = new org . springframework . security . authentication . UsernamePasswordAuthenticationToken ( org . baeldung . web . CustomUserDetailsServiceIntegrationTest . USERNAME , org . baeldung . web . CustomUserDetailsServiceIntegrationTest . PASSWORD ) ; org . springframework . security . core . Authentication authentication = authenticationProvider . authenticate ( auth ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertEquals ( authentication . getName ( ) , org . baeldung . web . CustomUserDetailsServiceIntegrationTest . USERNAME )
|
isResellerRevenueSharePercentVisible_notReadonly_noRevenueShare ( ) { org . oscm . ui . model . Marketplace m = new org . oscm . ui . model . Marketplace ( ) ; m . setRevenueSharesReadOnly ( true ) ; m . setResellerRevenueShareObject ( null ) ; "<AssertPlaceHolder>" ; } isResellerRevenueShareVisible ( ) { return ( isRevenueSharesReadOnly ( ) ) && ( ( resellerRevenueShare ) != null ) ; }
|
org . junit . Assert . assertFalse ( m . isResellerRevenueShareVisible ( ) )
|
checkXMLPersistence ( ) { int id = 20110901 ; java . lang . String name = "September<sp>1st<sp>2011" ; java . lang . String description = "The<sp>1st<sp>day<sp>of<sp>the<sp>ninth<sp>month<sp>in<sp>the<sp>year<sp>of<sp>" + "our<sp>Lord<sp>2011" ; org . eclipse . ice . datastructures . ICEObject . ICEJAXBHandler xmlHandler = new org . eclipse . ice . datastructures . ICEObject . ICEJAXBHandler ( ) ; java . util . ArrayList < java . lang . Class > classList = new java . util . ArrayList < java . lang . Class > ( ) ; classList . add ( org . eclipse . ice . datastructures . form . TimeDataComponent . class ) ; classList . add ( org . eclipse . ice . datastructures . entry . StringEntry . class ) ; classList . add ( org . eclipse . ice . datastructures . entry . DiscreteEntry . class ) ; classList . add ( org . eclipse . ice . datastructures . entry . ContinuousEntry . class ) ; org . eclipse . ice . datastructures . form . TimeDataComponent dataComponent = new org . eclipse . ice . datastructures . form . TimeDataComponent ( ) ; org . eclipse . ice . datastructures . form . TimeDataComponent loadDataComponent = new org . eclipse . ice . datastructures . form . TimeDataComponent ( ) ; dataComponent . setId ( id ) ; dataComponent . setDescription ( description ) ; dataComponent . setName ( name ) ; java . io . ByteArrayOutputStream outputStream = new java . io . ByteArrayOutputStream ( ) ; xmlHandler . write ( dataComponent , classList , outputStream ) ; java . io . ByteArrayInputStream inputStream = new java . io . ByteArrayInputStream ( outputStream . toByteArray ( ) ) ; loadDataComponent = new org . eclipse . ice . datastructures . form . TimeDataComponent ( ) ; loadDataComponent = ( ( org . eclipse . ice . datastructures . form . TimeDataComponent ) ( xmlHandler . read ( classList , inputStream ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { boolean equal = false ; if ( ( other != null ) && ( other instanceof org . eclipse . ice . reflectivity . MaterialSelection ) ) { if ( ( this ) == other ) { equal = true ; } else { org . eclipse . ice . reflectivity . MaterialSelection selection = ( ( org . eclipse . ice . reflectivity . MaterialSelection ) ( other ) ) ; equal = ( this . material . equals ( selection . material ) ) && ( this . selectedProperty . equals ( selection . selectedProperty ) ) ; } } return equal ; }
|
org . junit . Assert . assertTrue ( dataComponent . equals ( loadDataComponent ) )
|
checkNumberNotNUll ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( a )
|
testSortedGeoRanges ( ) { logic . setSortGeoWaveQueryRanges ( true ) ; java . util . Iterator < datawave . webservice . query . configuration . QueryData > queryIter = initializeGeoQuery ( ) ; datawave . query . jexl . visitors . GeoWaveQueryInfoVisitor visitor = new datawave . query . jexl . visitors . GeoWaveQueryInfoVisitor ( java . util . Arrays . asList ( datawave . query . planner . GeoSortedQueryDataTest . FIELD_NAME ) ) ; datawave . query . jexl . visitors . GeoWaveQueryInfoVisitor . GeoWaveQueryInfo prevQueryInfo = null ; while ( queryIter . hasNext ( ) ) { datawave . webservice . query . configuration . QueryData qd = queryIter . next ( ) ; org . apache . commons . jexl2 . parser . ASTJexlScript queryTree = datawave . query . jexl . JexlASTHelper . parseJexlQuery ( qd . getQuery ( ) ) ; datawave . query . jexl . visitors . GeoWaveQueryInfoVisitor . GeoWaveQueryInfo queryInfo = visitor . parseGeoWaveQueryInfo ( queryTree ) ; if ( prevQueryInfo != null ) "<AssertPlaceHolder>" ; prevQueryInfo = queryInfo ; } } compareTo ( datawave . data . type . Type ) { return this . getDelegate ( ) . compareTo ( o . getDelegate ( ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( prevQueryInfo . compareTo ( queryInfo ) ) <= 0 ) )
|
signatureWithoutMatchingPublicKeyRaisesException ( ) { java . util . HashMap < java . lang . String , java . lang . String > sampleNotification = this . gateway . webhookTesting ( ) . sampleNotification ( WebhookNotification . Kind . SUBSCRIPTION_WENT_PAST_DUE , "my_id" ) ; try { this . gateway . webhookNotification ( ) . parse ( "unknown_public_key|signature" , sampleNotification . get ( "bt_payload" ) ) ; org . junit . Assert . fail ( "Should<sp>have<sp>throw<sp>exception,<sp>but<sp>did<sp>not." ) ; } catch ( final com . braintreegateway . exceptions . InvalidSignatureException e ) { final java . lang . String expectedMessage = "no<sp>matching<sp>public<sp>key" ; "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
|
org . junit . Assert . assertEquals ( expectedMessage , e . getMessage ( ) )
|
uzeri ( ) { zemberek . morphology . analysis . RuleBasedAnalyzer analyzer = getAnalyzer ( "zeri<sp>[A:CompoundP3sg;Roots:zer]" ) ; java . lang . String in = "zeri" ; java . util . List < zemberek . morphology . analysis . SingleAnalysis > results = analyzer . analyze ( in ) ; "<AssertPlaceHolder>" ; } size ( ) { return itemSet . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , results . size ( ) )
|
closeOnce ( ) { final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; final javax . json . stream . JsonGenerator generator = javax . json . Json . createGenerator ( baos ) . writeStartObject ( ) . writeEnd ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { generator . close ( ) ; "<AssertPlaceHolder>" ; } } getBufferSize ( javax . json . stream . JsonGenerator ) { final java . lang . reflect . Field bufferProvider = generator . getClass ( ) . getDeclaredField ( "bufferProvider" ) ; if ( ! ( bufferProvider . isAccessible ( ) ) ) { bufferProvider . setAccessible ( true ) ; } final java . lang . Object provider = bufferProvider . get ( generator ) ; final java . lang . reflect . Field queue = provider . getClass ( ) . getSuperclass ( ) . getDeclaredField ( "queue" ) ; if ( ! ( queue . isAccessible ( ) ) ) { queue . setAccessible ( true ) ; } return java . util . Queue . class . cast ( queue . get ( provider ) ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , getBufferSize ( generator ) )
|
testPastLastNumber ( ) { when ( mockChgDAO . listChanges ( 100L , null , 100 ) ) . thenReturn ( new java . util . LinkedList < org . sagebionetworks . repo . model . message . ChangeMessage > ( ) ) ; java . lang . Long next = msgSyndicationImpl . rebroadcastChangeMessages ( 100L , 100L ) ; java . lang . Long expecedNext = - 1L ; "<AssertPlaceHolder>" ; verify ( mockMsgPublisher , never ( ) ) . fireChangeMessage ( any ( org . sagebionetworks . repo . model . message . ChangeMessage . class ) ) ; } rebroadcastChangeMessages ( java . lang . Long , java . lang . Long ) { if ( startChangeNumber == null ) throw new java . lang . IllegalArgumentException ( "startChangeNumber<sp>cannot<sp>be<sp>null" ) ; long nextNumber = - 1 ; java . util . List < org . sagebionetworks . repo . model . message . ChangeMessage > list = changeDAO . listChanges ( startChangeNumber , null , limit ) ; for ( org . sagebionetworks . repo . model . message . ChangeMessage change : list ) { messagePublisher . fireChangeMessage ( change ) ; nextNumber = ( change . getChangeNumber ( ) ) + 1 ; } long currentChangeNumber = changeDAO . getCurrentChangeNumber ( ) ; if ( nextNumber > currentChangeNumber ) { nextNumber = - 1 ; } return nextNumber ; }
|
org . junit . Assert . assertEquals ( expecedNext , next )
|
testFindByProviderStringString ( ) { java . lang . String serviceCode1 = "101" ; java . lang . String serviceCode2 = "181" ; java . lang . String providerNo1 = "1" ; java . lang . String providerNo2 = "2" ; org . oscarehr . common . model . BatchBilling bBilling1 = new org . oscarehr . common . model . BatchBilling ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( bBilling1 ) ; bBilling1 . setCreateDate ( currentTimestamp ) ; bBilling1 . setBillingProviderNo ( providerNo1 ) ; bBilling1 . setServiceCode ( serviceCode1 ) ; dao . persist ( bBilling1 ) ; org . oscarehr . common . model . BatchBilling bBilling2 = new org . oscarehr . common . model . BatchBilling ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( bBilling2 ) ; bBilling2 . setCreateDate ( currentTimestamp ) ; bBilling2 . setBillingProviderNo ( providerNo2 ) ; bBilling2 . setServiceCode ( serviceCode2 ) ; dao . persist ( bBilling2 ) ; org . oscarehr . common . model . BatchBilling bBilling3 = new org . oscarehr . common . model . BatchBilling ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( bBilling3 ) ; bBilling3 . setCreateDate ( currentTimestamp ) ; bBilling3 . setBillingProviderNo ( providerNo1 ) ; bBilling3 . setServiceCode ( serviceCode1 ) ; dao . persist ( bBilling3 ) ; java . util . List < org . oscarehr . common . model . BatchBilling > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . BatchBilling > ( java . util . Arrays . asList ( bBilling1 , bBilling3 ) ) ; java . util . List < org . oscarehr . common . model . BatchBilling > result = dao . findByProvider ( providerNo1 , serviceCode1 ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
|
org . junit . Assert . assertTrue ( true )
|
willSoonExpireFalseTest1 ( ) { com . aliyuncs . auth . BasicSessionCredentials credentials = new com . aliyuncs . auth . BasicSessionCredentials ( "ak" , "sk" , "token" ) ; "<AssertPlaceHolder>" ; } willSoonExpire ( ) { long now = java . lang . System . currentTimeMillis ( ) ; return ( ( this . roleSessionDurationSeconds ) * ( 1 - ( expireFact ) ) ) > ( ( ( expiration ) - now ) / 1000 ) ; }
|
org . junit . Assert . assertFalse ( credentials . willSoonExpire ( ) )
|
testGetFieldsAndValues ( ) { java . util . Map < java . lang . String , java . lang . Object > map = new java . util . HashMap ( ) ; map . put ( "a" , "aval" ) ; map . put ( "b" , "bval" ) ; com . hortonworks . streamline . streams . StreamlineEvent event = com . hortonworks . streamline . streams . common . StreamlineEventImpl . builder ( ) . fieldsAndValues ( map ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { if ( ( bytesCalculator ) != null ) { com . hortonworks . streamline . cache . view . impl . redis . RedisStringsCache . LOG . debug ( "Setting<sp>" ) ; } return null ; }
|
org . junit . Assert . assertEquals ( map , event )
|
testDeleteAllUsesViewWithConfiguredConsistency ( ) { java . lang . String expectedQueryParams = "ViewQuery(string/all){params=\"reduce=false&stale=false\"}" ; repository . deleteAll ( ) ; verify ( couchbaseOperations , never ( ) ) . findByView ( any ( com . couchbase . client . java . view . ViewQuery . class ) , any ( java . lang . Class . class ) ) ; verify ( couchbaseOperations , never ( ) ) . findByN1QL ( any ( com . couchbase . client . java . query . N1qlQuery . class ) , any ( java . lang . Class . class ) ) ; verify ( couchbaseOperations , never ( ) ) . queryN1QL ( any ( com . couchbase . client . java . query . N1qlQuery . class ) ) ; org . mockito . ArgumentCaptor < com . couchbase . client . java . view . ViewQuery > queryCaptor = org . mockito . ArgumentCaptor . forClass ( com . couchbase . client . java . view . ViewQuery . class ) ; verify ( couchbaseOperations ) . queryView ( queryCaptor . capture ( ) ) ; java . lang . String sQuery = queryCaptor . getValue ( ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( "Beer<sp>[id=" + ( id ) ) + ",<sp>name=" ) + ( name ) ) + ",<sp>active=" ) + ( active ) ) + ",<sp>description=" ) + ( description ) ) + "]" ; }
|
org . junit . Assert . assertEquals ( expectedQueryParams , sQuery )
|
encodeTest ( ) { org . kaaproject . kaa . server . sync . platform . AvroEncDec encDec = new org . kaaproject . kaa . server . sync . platform . AvroEncDec ( ) ; "<AssertPlaceHolder>" ; } encode ( T extends org . apache . avro . generic . GenericContainer ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; binaryEncoder = org . apache . avro . io . EncoderFactory . get ( ) . binaryEncoder ( baos , binaryEncoder ) ; datumWriter . write ( record , binaryEncoder ) ; binaryEncoder . flush ( ) ; baos . flush ( ) ; return baos . toByteArray ( ) ; }
|
org . junit . Assert . assertNull ( encDec . encode ( null ) )
|
testConsume ( ) { int countBefore = countRowsInTable ( org . sculptor . example . ejb . helloworld . milkyway . domain . Planet . class ) ; java . lang . String message = "Jupiter" ; javax . jms . Destination replyTo = sendMessage ( queue , message ) ; waitForReply ( replyTo ) ; int countAfter = countRowsInTable ( org . sculptor . example . ejb . helloworld . milkyway . domain . Planet . class ) ; "<AssertPlaceHolder>" ; } countRowsInTable ( java . lang . Class ) { javax . persistence . Query query = getEntityManager ( ) . createQuery ( ( ( "select<sp>count(e)<sp>from<sp>" + ( domainObjectClass . getSimpleName ( ) ) ) + "<sp>e" ) ) ; return ( ( java . lang . Integer ) ( query . getSingleResult ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( ( countBefore + 1 ) , countAfter )
|
testRemovingNonExistingRole ( ) { org . jboss . forge . addon . javaee . servlet . ServletFacet_3_1 servletFacet = installServlet ( org . jboss . forge . addon . javaee . servlet . ServletFacet_3_1 . class ) ; addInitialRoles ( servletFacet ) ; removeRole ( "blah" , false ) ; "<AssertPlaceHolder>" ; } getSecurityRoles ( org . jboss . forge . addon . javaee . servlet . ServletFacet ) { org . jboss . shrinkwrap . descriptor . api . webapp . WebAppCommonDescriptor webXml = servletFacet . getConfig ( ) ; return webXml . getAllSecurityRole ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , getSecurityRoles ( servletFacet ) . size ( ) )
|
UmlLinkType_NotFromClassVariable ( ) { java . lang . String fromClass = "domain.direct.violating.DeclarationVariableStatic" ; java . lang . String toClass = "technology.direct.dao.ProfileDAO" ; "<AssertPlaceHolder>" ; } isUmlLinkNotDetected ( java . lang . String , java . lang . String ) { boolean umlLinkDetected = true ; husaccttest . analyse . Java_AccuracyTestDependencyDetection . analyseService = husacct . ServiceProvider . getInstance ( ) . getAnalyseService ( ) ; husacct . common . dto . UmlLinkDTO [ ] umlLinkDTOs = husaccttest . analyse . Java_AccuracyTestDependencyDetection . analyseService . getUmlLinksFromClassToToClass ( classFrom , classTo ) ; for ( husacct . common . dto . UmlLinkDTO linkDTO : umlLinkDTOs ) { if ( ( linkDTO . from . equals ( classFrom ) ) && ( linkDTO . to . equals ( classTo ) ) ) { umlLinkDetected = false ; } } return umlLinkDetected ; }
|
org . junit . Assert . assertTrue ( isUmlLinkNotDetected ( fromClass , toClass ) )
|
parseBeyondFilter ( ) { org . deegree . filter . Filter filter = testImportExportImport ( "testfilter15.xml" ) ; "<AssertPlaceHolder>" ; } testImportExportImport ( java . lang . String ) { java . net . URL url = org . deegree . filter . xml . Filter110XMLEncoderTest . class . getResource ( ( "v110/" + resource ) ) ; javax . xml . stream . XMLStreamReader in = javax . xml . stream . XMLInputFactory . newInstance ( ) . createXMLStreamReader ( url . toString ( ) , url . openStream ( ) ) ; in . nextTag ( ) ; org . deegree . filter . Filter filter = org . deegree . filter . xml . Filter110XMLDecoder . parse ( in ) ; java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; javax . xml . stream . XMLStreamWriter out = javax . xml . stream . XMLOutputFactory . newInstance ( ) . createXMLStreamWriter ( bos ) ; org . deegree . filter . xml . Filter110XMLEncoder . export ( filter , out ) ; out . close ( ) ; in = javax . xml . stream . XMLInputFactory . newInstance ( ) . createXMLStreamReader ( new java . io . ByteArrayInputStream ( bos . toByteArray ( ) ) ) ; in . nextTag ( ) ; System . out . println ( new java . lang . String ( bos . toByteArray ( ) ) ) ; return org . deegree . filter . xml . Filter110XMLDecoder . parse ( in ) ; }
|
org . junit . Assert . assertNotNull ( filter )
|
test_success_get_principal_by_name_like_bad_bname ( ) { java . util . List < org . ikasan . security . model . IkasanPrincipal > principals = this . xaSecurityDao . getPrincipalByNameLike ( "bad<sp>name" ) ; "<AssertPlaceHolder>" ; } size ( ) { logger . debug ( "Size!<sp>" ) ; return 15000 ; }
|
org . junit . Assert . assertTrue ( ( ( principals . size ( ) ) == 0 ) )
|
testEqualsSelf ( ) { com . twelvemonkeys . util . MappedBeanFactoryTestCase . Foo foo = com . twelvemonkeys . util . MappedBeanFactory . as ( com . twelvemonkeys . util . MappedBeanFactoryTestCase . DefaultFoo . class , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { @ com . twelvemonkeys . util . SuppressWarnings ( { "EqualsWhichDoesntCheckParameterClass" } ) @ com . twelvemonkeys . util . Override public boolean equals ( java . lang . Object o ) { throw new junit . framework . AssertionFailedError ( "Don't<sp>need<sp>to<sp>test<sp>map<sp>for<sp>equals<sp>if<sp>same<sp>object" ) ; } } ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( pOther == ( this ) ) { return true ; } if ( pOther instanceof com . twelvemonkeys . lang . DuckType . MethodProxy ) { com . twelvemonkeys . lang . DuckType . MethodProxy other = ( ( com . twelvemonkeys . lang . DuckType . MethodProxy ) ( pOther ) ) ; return ( mMethod . equals ( other . mMethod ) ) && ( mDelegate . equals ( other . mDelegate ) ) ; } return false ; }
|
org . junit . Assert . assertTrue ( foo . equals ( foo ) )
|
shouldSapperMoveToUp ( ) { int oldYPosition = sapper . getY ( ) ; board . sapperMoveTo ( Direction . UP ) ; "<AssertPlaceHolder>" ; } getY ( ) { return getHead ( ) . getY ( ) ; }
|
org . junit . Assert . assertEquals ( sapper . getY ( ) , ( oldYPosition + 1 ) )
|
testGetURI ( ) { final java . lang . String prefix = "test" ; final java . lang . String uri = ( ( Prefixes . BASE_URI ) + prefix ) + "#" ; "<AssertPlaceHolder>" ; } getURI ( java . lang . String ) { return ( ( org . apache . tinkerpop . gremlin . sparql . Prefixes . BASE_URI ) + prefix ) + "#" ; }
|
org . junit . Assert . assertEquals ( uri , org . apache . tinkerpop . gremlin . sparql . Prefixes . getURI ( prefix ) )
|
whenTimeout ( ) { barrier = new org . multiverse . commitbarriers . VetoCommitBarrier ( ) ; org . multiverse . TestThread thread = new org . multiverse . TestThread ( ) { @ org . multiverse . commitbarriers . Override public void doRun ( ) throws org . multiverse . commitbarriers . Exception { boolean result = barrier . tryAwaitOpen ( 1 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } } ; thread . setPrintStackTrace ( false ) ; thread . start ( ) ; joinAll ( thread ) ; } tryAwaitOpen ( long , java . util . concurrent . TimeUnit ) { if ( unit == null ) { throw new java . lang . NullPointerException ( ) ; } if ( ( status ) == ( org . multiverse . commitbarriers . CommitBarrier . Status . Closed ) ) { long timeoutNs = unit . toNanos ( timeout ) ; lock . lockInterruptibly ( ) ; try { while ( ( status ) == ( org . multiverse . commitbarriers . CommitBarrier . Status . Closed ) ) { timeoutNs = statusCondition . awaitNanos ( timeoutNs ) ; if ( timeoutNs <= 0 ) { return false ; } } } finally { lock . unlock ( ) ; } } return true ; }
|
org . junit . Assert . assertFalse ( result )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.