input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
determinesFacingUp ( ) { com . fundynamic . d2tm . math . Vector2D coordinatesToFaceTo = unitAbsoluteMapCoordinates . add ( create ( 0 , ( - 1 ) ) ) ; "<AssertPlaceHolder>" ; } determine ( com . fundynamic . d2tm . math . Vector2D , com . fundynamic . d2tm . math . Vector2D ) { boolean left = ( to . getXAsInt ( ) ) < ( from . getXAsInt ( ) ) ; boolean right = ( to . getXAsInt ( ) ) > ( from . getXAsInt ( ) ) ; boolean up = ( to . getYAsInt ( ) ) < ( from . getYAsInt ( ) ) ; boolean down = ( to . getYAsInt ( ) ) > ( from . getYAsInt ( ) ) ; if ( up && left ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . LEFT_UP ; if ( up && right ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT_UP ; if ( down && left ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . LEFT_DOWN ; if ( down && right ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT_DOWN ; if ( up ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . UP ; if ( down ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . DOWN ; if ( left ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . LEFT ; if ( right ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT ; return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT ; } | org . junit . Assert . assertEquals ( com . fundynamic . d2tm . game . entities . units . UP , determine ( unitAbsoluteMapCoordinates , coordinatesToFaceTo ) ) |
testExecuteUserStringListOfStringNoSchemsFolder ( ) { "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( user ) . sendMessage ( "commands.admin.schem.list.no-schems" ) ; } execute ( world . bentobox . bentobox . api . user . User , java . lang . String , java . util . List ) { if ( ! ( args . isEmpty ( ) ) ) { showHelp ( this , user ) ; return false ; } if ( ! ( getIslands ( ) . hasIsland ( getWorld ( ) , user . getUniqueId ( ) ) ) ) { user . sendMessage ( "general.errors.no-island" ) ; return false ; } world . bentobox . bentobox . database . objects . Island island = getIslands ( ) . getIsland ( getWorld ( ) , user . getUniqueId ( ) ) ; if ( island . getBanned ( ) . isEmpty ( ) ) { user . sendMessage ( "commands.island.banlist.noone" ) ; return true ; } user . sendMessage ( "commands.island.banlist.the-following" ) ; java . util . List < java . lang . String > names = island . getBanned ( ) . stream ( ) . map ( ( u ) -> getPlayers ( ) . getName ( u ) ) . sorted ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . List < java . lang . String > lines = new java . util . ArrayList ( ) ; java . lang . StringBuilder line = new java . lang . StringBuilder ( ) ; names . forEach ( ( n ) -> { if ( ( ( line . length ( ) ) + ( n . length ( ) ) ) < 41 ) { line . append ( n ) ; } else { lines . add ( line . toString ( ) . trim ( ) ) ; line . setLength ( 0 ) ; line . append ( n ) ; } line . append ( ",<sp>" ) ; } ) ; line . setLength ( ( ( line . length ( ) ) - 2 ) ) ; if ( ( line . length ( ) ) > 0 ) { lines . add ( line . toString ( ) ) ; } lines . forEach ( ( l ) -> user . sendMessage ( "commands.island.banlist.names" , "[line]" , l ) ) ; int banLimit = user . getPermissionValue ( ( ( getPermissionPrefix ( ) ) + "ban.maxlimit" ) , getIWM ( ) . getBanLimit ( getWorld ( ) ) ) ; if ( ( banLimit <= ( - 1 ) ) || ( ( island . getBanned ( ) . size ( ) ) < banLimit ) ) { user . sendMessage ( "commands.island.banlist.you-can-ban" , TextVariables . NUMBER , java . lang . String . valueOf ( ( banLimit - ( island . getBanned ( ) . size ( ) ) ) ) ) ; } return true ; } | org . junit . Assert . assertFalse ( list . execute ( user , "" , java . util . Collections . emptyList ( ) ) ) |
past_major ( ) { hdr . version_number = ( VERSION ) - 65536 ; "<AssertPlaceHolder>" ; } validateHeader ( com . groupon . lex . metrics . history . xdr . tsfile_mimeheader ) { if ( ! ( java . util . Arrays . equals ( com . groupon . lex . metrics . history . xdr . Const . MAGIC , hdr . magic ) ) ) return com . groupon . lex . metrics . history . xdr . Const . Validation . INVALID_MAGIC ; if ( ( hdr . version_number ) < 0 ) return com . groupon . lex . metrics . history . xdr . Const . Validation . INVALID_NEG_VERSION ; int maj_cmp = java . lang . Short . compare ( com . groupon . lex . metrics . history . xdr . Const . version_major ( hdr . version_number ) , com . groupon . lex . metrics . history . xdr . Const . MAJOR ) ; int min_cmp = java . lang . Short . compare ( com . groupon . lex . metrics . history . xdr . Const . version_minor ( hdr . version_number ) , com . groupon . lex . metrics . history . xdr . Const . MINOR ) ; if ( maj_cmp != 0 ) return maj_cmp < 0 ? com . groupon . lex . metrics . history . xdr . Const . Validation . OLD_MAJOR : com . groupon . lex . metrics . history . xdr . Const . Validation . NEW_MAJOR ; if ( min_cmp != 0 ) return min_cmp < 0 ? com . groupon . lex . metrics . history . xdr . Const . Validation . OLD_MINOR : com . groupon . lex . metrics . history . xdr . Const . Validation . NEW_MINOR ; return com . groupon . lex . metrics . history . xdr . Const . Validation . CURRENT ; } | org . junit . Assert . assertEquals ( Const . Validation . OLD_MAJOR , com . groupon . lex . metrics . history . xdr . Const . validateHeader ( hdr ) ) |
shouldBindResponseParam ( ) { com . threewks . thundr . introspection . ParameterDescription responseParameter = new com . threewks . thundr . introspection . ParameterDescription ( "response" , com . threewks . thundr . request . Response . class ) ; parameterDescriptions . put ( responseParameter , null ) ; binder . bindAll ( parameterDescriptions , request , response ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return delegate . get ( java . util . Collections . singletonList ( arg0 ) ) ; } | org . junit . Assert . assertThat ( parameterDescriptions . get ( responseParameter ) , org . hamcrest . Matchers . is ( ( ( java . lang . Object ) ( response ) ) ) ) |
should_return_this ( ) { org . fest . assertions . api . BigDecimalAssert returned = assertions . isGreaterThan ( expected ) ; "<AssertPlaceHolder>" ; } isGreaterThan ( byte ) { bytes . assertGreaterThan ( description , actual , expected ) ; return this ; } | org . junit . Assert . assertSame ( returned , assertions ) |
testChecksumFailure ( ) { com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . setChecksumMode ( OChecksumMode . StoreAndThrow ) ; final long fileId = com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . addFile ( com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . fileName ) ; "<AssertPlaceHolder>" ; final com . orientechnologies . orient . core . storage . cache . OCachePointer cachePointer = com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . load ( fileId , 0 , 1 , new com . orientechnologies . common . types . OModifiableBoolean ( ) , false ) [ 0 ] ; cachePointer . acquireExclusiveLock ( ) ; final java . nio . ByteBuffer buffer = cachePointer . getBufferDuplicate ( ) ; buffer . position ( com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . systemOffset ) ; buffer . put ( new byte [ buffer . remaining ( ) ] ) ; cachePointer . releaseExclusiveLock ( ) ; com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . store ( fileId , 0 , cachePointer ) ; cachePointer . decrementReadersReferrer ( ) ; com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . flush ( ) ; final java . nio . file . Path path = com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . storagePath . resolve ( com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . nativeFileNameById ( fileId ) ) ; final com . orientechnologies . orient . core . storage . fs . OFileClassic file = new com . orientechnologies . orient . core . storage . fs . OFileClassic ( path ) ; file . open ( ) ; file . writeByte ( com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . systemOffset , ( ( byte ) ( 1 ) ) ) ; file . close ( ) ; try { com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . load ( fileId , 0 , 1 , new com . orientechnologies . common . types . OModifiableBoolean ( ) , true ) ; org . junit . Assert . fail ( ) ; } catch ( com . orientechnologies . orient . core . exception . OStorageException e ) { } } allocateNewPage ( long ) { final int intId = extractFileId ( fileId ) ; filesLock . acquireReadLock ( ) ; try { final com . orientechnologies . common . collection . closabledictionary . OClosableEntry < java . lang . Long , com . orientechnologies . orient . core . storage . fs . OFileClassic > entry = files . acquire ( fileId ) ; try { final com . orientechnologies . orient . core . storage . fs . OFileClassic fileClassic = entry . get ( ) ; long allocationIndex = ( fileClassic . getFileSize ( ) ) / ( pageSize ) ; while ( true ) { final java . util . concurrent . locks . Lock lock = lockManager . acquireExclusiveLock ( new com . orientechnologies . orient . core . storage . cache . local . OWOWCache . PageKey ( intId , allocationIndex ) ) ; try { if ( ( fileClassic . getFileSize ( ) ) == ( allocationIndex * ( pageSize ) ) ) { final long allocatedPosition = fileClassic . allocateSpace ( pageSize ) ; assert ( allocationIndex * ( pageSize ) ) == allocatedPosition ; freeSpaceCheckAfterNewPageAdd ( ) ; return ( ( int ) ( allocationIndex ) ) ; } else { allocationIndex = ( fileClassic . getFileSize ( ) ) / ( pageSize ) ; } } finally { lock . unlock ( ) ; } } } finally { files . release ( entry ) ; } } catch ( final java . lang . InterruptedException e ) { throw com . orientechnologies . common . exception . OException . wrapException ( new com . orientechnologies . orient . core . exception . OStorageException ( "Allocation<sp>of<sp>page<sp>was<sp>interrupted" ) , e ) ; } finally { filesLock . releaseReadLock ( ) ; } } | org . junit . Assert . assertEquals ( 0 , com . orientechnologies . orient . core . storage . index . hashindex . local . cache . WOWCacheTestIT . wowCache . allocateNewPage ( fileId ) ) |
followsSymlinksOutsideTheWorkspace ( ) { com . amazonaws . codepipeline . jenkinsplugin . TestUtils . addSymlinkToFolderOutsideWorkspace ( ) ; final java . util . List < java . io . File > files = com . amazonaws . codepipeline . jenkinsplugin . CompressionTools . addFilesToCompress ( testDir , null ) ; "<AssertPlaceHolder>" ; } addFilesToCompress ( java . nio . file . Path , hudson . model . BuildListener ) { final java . util . List < java . io . File > files = new java . util . ArrayList ( ) ; if ( pathToCompress != null ) { java . nio . file . Files . walkFileTree ( pathToCompress , java . util . EnumSet . of ( FileVisitOption . FOLLOW_LINKS ) , Integer . MAX_VALUE , new java . nio . file . SimpleFileVisitor < java . nio . file . Path > ( ) { @ com . amazonaws . codepipeline . jenkinsplugin . Override public java . nio . file . FileVisitResult visitFile ( final java . nio . file . Path file , final java . nio . file . attribute . BasicFileAttributes attrs ) throws java . io . IOException { files . add ( file . toFile ( ) ) ; return java . nio . file . FileVisitResult . CONTINUE ; } @ com . amazonaws . codepipeline . jenkinsplugin . Override public java . nio . file . FileVisitResult visitFileFailed ( final java . nio . file . Path file , final java . io . IOException e ) throws java . io . IOException { if ( e != null ) { com . amazonaws . codepipeline . jenkinsplugin . LoggingHelper . log ( listener , "Failed<sp>to<sp>visit<sp>file<sp>'%s'.<sp>Error:<sp>%s." , file . toString ( ) , e . getMessage ( ) ) ; com . amazonaws . codepipeline . jenkinsplugin . LoggingHelper . log ( listener , e ) ; throw e ; } return java . nio . file . FileVisitResult . CONTINUE ; } } ) ; } return files ; } | org . junit . Assert . assertEquals ( 7 , files . size ( ) ) |
testSerialization ( ) { org . jfree . chart . renderer . xy . YIntervalRenderer r1 = new org . jfree . chart . renderer . xy . YIntervalRenderer ( ) ; org . jfree . chart . renderer . xy . YIntervalRenderer r2 = ( ( org . jfree . chart . renderer . xy . YIntervalRenderer ) ( org . jfree . chart . TestUtilities . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( r1 , r2 ) |
basicLogSchemaTest ( ) { org . kaaproject . kaa . server . common . dao . model . sql . LogSchema logSchema = new org . kaaproject . kaa . server . common . dao . model . sql . LogSchema ( org . kaaproject . kaa . server . common . dao . model . sql . LogSchemaTest . TEST_ID ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( ( ( java . lang . Long ) ( org . kaaproject . kaa . server . common . dao . model . sql . LogSchemaTest . TEST_ID ) ) , logSchema . getId ( ) ) |
testCatListAndSingleAttribute ( ) { org . stringtemplate . v4 . org . stringtemplate . v4 . ST e = new org . stringtemplate . v4 . org . stringtemplate . v4 . ST ( "<[mine,yours];<sp>separator=\",<sp>\">" ) ; e . add ( "mine" , "1" ) ; e . add ( "mine" , "2" ) ; e . add ( "mine" , "3" ) ; e . add ( "yours" , "a" ) ; java . lang . String expecting = "1,<sp>2,<sp>3,<sp>a" ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; } | org . junit . Assert . assertEquals ( expecting , e . render ( ) ) |
testBlobCopyNoZeroBytes ( ) { byte [ ] val = new byte [ ] { 1 , 2 , 0 , 3 } ; byte [ ] ascExpected = new byte [ ] { 56 , 1 , 2 , 0 , 3 } ; org . apache . hadoop . hbase . util . PositionedByteRange buf = new org . apache . hadoop . hbase . util . SimplePositionedMutableByteRange ( ( ( val . length ) + 1 ) ) ; org . apache . hadoop . hbase . util . OrderedBytes . encodeBlobCopy ( buf , val , Order . ASCENDING ) ; "<AssertPlaceHolder>" ; buf . set ( ( ( val . length ) + 2 ) ) ; org . apache . hadoop . hbase . util . OrderedBytes . encodeBlobCopy ( buf , val , Order . DESCENDING ) ; org . junit . Assert . fail ( "test<sp>should<sp>never<sp>get<sp>here." ) ; } getBytes ( ) { return bytes ; } | org . junit . Assert . assertArrayEquals ( ascExpected , buf . getBytes ( ) ) |
checkSerialization ( ) { com . orsoncharts . data . category . StandardCategoryDataset3D < java . lang . String , java . lang . String , java . lang . String > d1 = new com . orsoncharts . data . category . StandardCategoryDataset3D < java . lang . String , java . lang . String , java . lang . String > ( ) ; d1 . addValue ( 1.0 , "S1" , "R1" , "C1" ) ; com . orsoncharts . data . category . StandardCategoryDataset3D < java . lang . String , java . lang . String , java . lang . String > d2 = ( ( com . orsoncharts . data . category . StandardCategoryDataset3D ) ( com . orsoncharts . TestUtils . serialized ( d1 ) ) ) ; "<AssertPlaceHolder>" ; } serialized ( java . io . Serializable ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( d1 , d2 ) |
testUpdateStatementsReturnsSuccess ( ) { com . iciql . test . ProductDaoTest . ProductDao dao = db . open ( com . iciql . test . ProductDaoTest . ProductDao . class ) ; boolean success = dao . setProductNameReturnsSuccess ( 1 , "Tea" ) ; "<AssertPlaceHolder>" ; } open ( java . lang . Class ) { return new com . iciql . DaoProxy < X > ( this , daoClass ) . build ( ) ; } | org . junit . Assert . assertTrue ( success ) |
testValideerNaderebijhoudingsaardOntbrekend ( ) { final nl . bzk . brp . business . regels . context . HuidigeSituatieRegelContext regelContext = new nl . bzk . brp . business . regels . context . HuidigeSituatieRegelContext ( maakHuidigeSituatie ( SoortPersoon . INGESCHREVENE , null ) ) ; final boolean resultaat = new nl . bzk . brp . business . regels . impl . levering . BRLV0022 ( ) . valideer ( regelContext ) ; "<AssertPlaceHolder>" ; } valideer ( javax . xml . transform . stream . StreamSource ) { valideerTegenSchema ( streamSource ) ; } | org . junit . Assert . assertTrue ( resultaat ) |
testEquals ( ) { javax . measure . Quantity < javax . measure . quantity . Length > q1 = tec . units . ri . quantity . NumberQuantity . of ( 10 , Units . METRE ) ; javax . measure . Quantity < javax . measure . quantity . Length > q2 = tec . units . ri . quantity . Quantities . getQuantity ( 10 , Units . METRE ) ; "<AssertPlaceHolder>" ; } getQuantity ( java . lang . Number , javax . measure . Unit ) { if ( value == null ) throw new java . lang . NullPointerException ( ) ; if ( unit == null ) throw new java . lang . NullPointerException ( ) ; if ( tec . units . ri . quantity . Double . class . isInstance ( value ) ) { return new tec . units . ri . quantity . DoubleQuantity < Q > ( value . doubleValue ( ) , unit ) ; } else if ( tec . units . ri . quantity . Long . class . isInstance ( value ) ) { return new tec . units . ri . quantity . LongQuantity < Q > ( tec . units . ri . quantity . Long . class . cast ( value ) , unit ) ; } else if ( tec . units . ri . quantity . Short . class . isInstance ( value ) ) { return new tec . units . ri . quantity . ShortQuantity < Q > ( tec . units . ri . quantity . Short . class . cast ( value ) , unit ) ; } else if ( tec . units . ri . quantity . Integer . class . isInstance ( value ) ) { return new tec . units . ri . quantity . IntegerQuantity < Q > ( tec . units . ri . quantity . Integer . class . cast ( value ) , unit ) ; } else if ( tec . units . ri . quantity . Float . class . isInstance ( value ) ) { return new tec . units . ri . quantity . FloatQuantity < Q > ( tec . units . ri . quantity . Float . class . cast ( value ) , unit ) ; } return new tec . units . ri . quantity . NumberQuantity < Q > ( value , unit ) ; } | org . junit . Assert . assertEquals ( q1 , q2 ) |
testPostAction ( ) { io . cdap . cdap . etl . proto . v2 . ETLBatchConfig etlConfig = io . cdap . cdap . etl . proto . v2 . ETLBatchConfig . builder ( ) . addStage ( new io . cdap . cdap . etl . proto . v2 . ETLStage ( "source" , io . cdap . cdap . etl . mock . batch . MockSource . getPlugin ( "samuel" 0 ) ) ) . addStage ( new io . cdap . cdap . etl . proto . v2 . ETLStage ( "sink" , io . cdap . cdap . etl . mock . batch . MockSink . getPlugin ( "actionOutput" ) ) ) . addPostAction ( new io . cdap . cdap . etl . proto . v2 . ETLStage ( "tokenWriter" , io . cdap . cdap . etl . mock . batch . NodeStatesAction . getPlugin ( "tokenTable" ) ) ) . addConnection ( "source" , "sink" ) . build ( ) ; io . cdap . cdap . proto . artifact . AppRequest < io . cdap . cdap . etl . proto . v2 . ETLBatchConfig > appRequest = new io . cdap . cdap . proto . artifact . AppRequest ( io . cdap . cdap . datapipeline . DataPipelineTest . APP_ARTIFACT , etlConfig ) ; io . cdap . cdap . proto . id . ApplicationId appId = NamespaceId . DEFAULT . app ( "ActionApp" ) ; io . cdap . cdap . test . ApplicationManager appManager = deployApplication ( appId , appRequest ) ; io . cdap . cdap . api . data . schema . Schema schema = io . cdap . cdap . api . data . schema . Schema . recordOf ( "samuel" 2 , Schema . Field . of ( "name" , io . cdap . cdap . api . data . schema . Schema . of ( Schema . Type . STRING ) ) ) ; io . cdap . cdap . api . data . format . StructuredRecord recordSamuel = io . cdap . cdap . api . data . format . StructuredRecord . builder ( schema ) . set ( "name" , "samuel" ) . build ( ) ; io . cdap . cdap . api . data . format . StructuredRecord recordBob = io . cdap . cdap . api . data . format . StructuredRecord . builder ( schema ) . set ( "name" , "bob" ) . build ( ) ; io . cdap . cdap . api . data . format . StructuredRecord recordJane = io . cdap . cdap . api . data . format . StructuredRecord . builder ( schema ) . set ( "name" , "samuel" 3 ) . build ( ) ; io . cdap . cdap . test . DataSetManager < io . cdap . cdap . api . dataset . table . Table > inputManager = getDataset ( NamespaceId . DEFAULT . dataset ( "samuel" 0 ) ) ; io . cdap . cdap . etl . mock . batch . MockSource . writeInput ( inputManager , com . google . common . collect . ImmutableList . of ( recordSamuel , recordBob , recordJane ) ) ; io . cdap . cdap . test . WorkflowManager workflowManager = appManager . getWorkflowManager ( SmartWorkflow . NAME ) ; workflowManager . start ( ) ; workflowManager . waitForRun ( ProgramRunStatus . COMPLETED , 5 , TimeUnit . MINUTES ) ; io . cdap . cdap . test . DataSetManager < io . cdap . cdap . api . dataset . table . Table > tokenTableManager = getDataset ( NamespaceId . DEFAULT . dataset ( "tokenTable" ) ) ; io . cdap . cdap . api . dataset . table . Table tokenTable = tokenTableManager . get ( ) ; io . cdap . cdap . api . workflow . NodeStatus status = io . cdap . cdap . api . workflow . NodeStatus . valueOf ( io . cdap . cdap . api . common . Bytes . toString ( tokenTable . get ( io . cdap . cdap . api . common . Bytes . toBytes ( "samuel" 1 ) , io . cdap . cdap . api . common . Bytes . toBytes ( "status" ) ) ) ) ; "<AssertPlaceHolder>" ; } toBytes ( java . nio . ByteBuffer ) { int length = bb . remaining ( ) ; byte [ ] result = new byte [ length ] ; int pos = bb . position ( ) ; bb . get ( result ) ; bb . position ( pos ) ; return result ; } | org . junit . Assert . assertEquals ( NodeStatus . COMPLETED , status ) |
shouldNotHaveChecksumIfFileNotInWorkspace ( ) { "<AssertPlaceHolder>" ; } getChecksum ( ) { checksumLock . readLock ( ) . lock ( ) ; try { return checksum ; } finally { checksumLock . readLock ( ) . unlock ( ) ; } } | org . junit . Assert . assertThat ( entry . getChecksum ( ) , org . hamcrest . core . Is . is ( 0L ) ) |
incrementIsThreadSafe ( ) { final int THREADS = 5 ; final int ITERATIONS = 100000 ; java . util . concurrent . ExecutorService executor = java . util . concurrent . Executors . newCachedThreadPool ( ) ; for ( int i = 0 ; i < THREADS ; i ++ ) { executor . execute ( new java . lang . Runnable ( ) { @ org . dcache . util . Override public void run ( ) { for ( int i = 0 ; i < ITERATIONS ; i ++ ) { counter . increment ( ) ; } } } ) ; } executor . shutdown ( ) ; executor . awaitTermination ( 5 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } get ( ) { try { return manager . createContext ( credential ) ; } catch ( org . ietf . jgss . GSSException e ) { throw new org . dcache . dss . KerberosDssContextFactory . WrappedGssException ( e ) ; } } | org . junit . Assert . assertEquals ( ( THREADS * ITERATIONS ) , counter . get ( ) ) |
testCreateFromString ( ) { java . lang . String [ ] split = org . boon . StringScanner . splitByCharsNoneEmpty ( org . boon . StringScannerTest . TEST_STRING , '[' , ',' , '"' , '\\' , ':' , ']' , '/' ) ; java . lang . String first = idx ( split , 0 ) ; java . lang . String second = idx ( split , 1 ) ; java . lang . String third = idx ( split , 2 ) ; java . lang . String fourth = idx ( split , 3 ) ; java . lang . String fifth = idx ( split , 4 ) ; java . lang . String sixth = idx ( split , 5 ) ; java . lang . String seventh = idx ( split , 6 ) ; java . lang . String last = idx ( split , ( - 1 ) ) ; org . junit . Assert . assertEquals ( "199984" , first ) ; org . junit . Assert . assertEquals ( "1384795052823" , second ) ; org . junit . Assert . assertEquals ( "127.0.0.1" , third ) ; org . junit . Assert . assertEquals ( "51706" , fourth ) ; org . junit . Assert . assertEquals ( "abc123" , fifth ) ; org . junit . Assert . assertEquals ( "rickHigh" , sixth ) ; org . junit . Assert . assertEquals ( "217.0.0.1" , seventh ) ; org . junit . Assert . assertEquals ( "asdfasdf" , last ) ; "<AssertPlaceHolder>" ; } len ( java . lang . Object ) { return org . boon . core . Conversions . len ( obj ) ; } | org . junit . Assert . assertEquals ( 12 , len ( split ) ) |
itShouldRemoveWorst ( ) { com . graphhopper . jsprit . core . problem . job . Service s1 = Service . Builder . newInstance ( "s1" ) . setLocation ( Location . Builder . newInstance ( ) . setCoordinate ( com . graphhopper . jsprit . core . util . Coordinate . newInstance ( 1 , 1 ) ) . build ( ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . job . Service s2 = Service . Builder . newInstance ( "s2" ) . setLocation ( Location . Builder . newInstance ( ) . setCoordinate ( com . graphhopper . jsprit . core . util . Coordinate . newInstance ( 3 , 1 ) ) . build ( ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . job . Service s3 = Service . Builder . newInstance ( "s3" ) . setLocation ( Location . Builder . newInstance ( ) . setCoordinate ( com . graphhopper . jsprit . core . util . Coordinate . newInstance ( 10 , 10 ) ) . build ( ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . vehicle . VehicleImpl v = VehicleImpl . Builder . newInstance ( "v" ) . setStartLocation ( Location . Builder . newInstance ( ) . setCoordinate ( com . graphhopper . jsprit . core . util . Coordinate . newInstance ( 0 , 0 ) ) . build ( ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . VehicleRoutingProblem vrp = VehicleRoutingProblem . Builder . newInstance ( ) . addJob ( s1 ) . addJob ( s2 ) . addJob ( s3 ) . addVehicle ( v ) . build ( ) ; com . graphhopper . jsprit . core . algorithm . ruin . RuinWorst worst = new com . graphhopper . jsprit . core . algorithm . ruin . RuinWorst ( vrp , 1 ) ; com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route = VehicleRoute . Builder . newInstance ( v ) . addService ( s1 ) . addService ( s2 ) . addService ( s3 ) . setJobActivityFactory ( vrp . getJobActivityFactory ( ) ) . build ( ) ; java . util . Collection < com . graphhopper . jsprit . core . problem . job . Job > unassigned = worst . ruinRoutes ( java . util . Arrays . asList ( route ) ) ; "<AssertPlaceHolder>" ; } iterator ( ) { return tourActivities . iterator ( ) ; } | org . junit . Assert . assertEquals ( s3 , unassigned . iterator ( ) . next ( ) ) |
currency_symbol_is_generic_for_no_country ( ) { com . teamunify . i18n . I . setLanguage ( "en" ) ; "<AssertPlaceHolder>" ; } currencySign ( ) { com . teamunify . i18n . LanguageSetting s = com . teamunify . i18n . I . languageProvider . vend ( ) ; java . text . NumberFormat fmt = java . text . NumberFormat . getCurrencyInstance ( s . locale ) ; java . text . DecimalFormat d = ( ( java . text . DecimalFormat ) ( fmt ) ) ; return d . getDecimalFormatSymbols ( ) . getCurrencySymbol ( ) ; } | org . junit . Assert . assertEquals ( "" , com . teamunify . i18n . I . currencySign ( ) ) |
shouldCountAllChildrenIncludingActualType ( ) { final org . openspotlight . bundle . language . java . metamodel . node . JavaType type = org . openspotlight . bundle . language . java . resolver . JavaTypeResolverTest . javaTypeFinder . getType ( "com.crud.dao.Dao" ) ; final int size = org . openspotlight . bundle . language . java . resolver . JavaTypeResolverTest . javaTypeFinder . countAllChildren ( type , IncludedResult . INCLUDE_ACTUAL_TYPE_ON_RESULT ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( size , org . hamcrest . core . Is . is ( 5 ) ) |
testClearWarnings ( ) { connection = new org . xenei . jdbc4sparql . J4SConnection ( driver , url , properties ) ; connection . clearWarnings ( ) ; "<AssertPlaceHolder>" ; } getWarnings ( ) { return sqlWarnings ; } | org . junit . Assert . assertNull ( connection . getWarnings ( ) ) |
derivePasswordsFromConfiguration ( ) { java . util . Properties props = new java . util . Properties ( ) ; props . setProperty ( "server.2" 6 , "io.fabric8.zookeeper.server-0001" ) ; props . setProperty ( "initLimit" , "server.3" 9 ) ; props . setProperty ( "server.2" 9 , "server.3" 0 ) ; props . setProperty ( "quorum.auth.enableSasl" , "server.3" 5 ) ; props . setProperty ( "server.3" 6 , "io.fabric8.zookeeper.server" 4 ) ; props . setProperty ( "server.2" , "server.3" 4 ) ; props . setProperty ( "server.3" , "server.2" 5 ) ; props . setProperty ( "io.fabric8.zookeeper.server" 1 , "io.fabric8.zookeeper.server" ) ; props . setProperty ( "server.3" 1 , "server.3" 7 ) ; props . setProperty ( "io.fabric8.zookeeper.server" 5 , "5" ) ; props . setProperty ( "server.3" 3 , "server.2" 4 ) ; java . util . Properties props1 = new java . util . Properties ( props ) ; props1 . setProperty ( "io.fabric8.zookeeper.server" 6 , "server.2" 0 ) ; props1 . setProperty ( "server.2" 1 , "server.3" 8 ) ; props1 . setProperty ( "server.2" 2 , "server.3" 2 ) ; props1 . setProperty ( "server.2" 7 , "server.3" 8 ) ; props1 . setProperty ( "clientPortAddress" 0 , "io.fabric8.zookeeper.server" 3 ) ; props1 . setProperty ( "clientPortAddress" , "0.0.0.0" ) ; java . util . Properties props2 = new java . util . Properties ( props ) ; props2 . setProperty ( "io.fabric8.zookeeper.server" 6 , "server.2" 8 ) ; props2 . setProperty ( "server.2" 1 , "io.fabric8.zookeeper.server" 0 ) ; props2 . setProperty ( "server.2" 2 , "io.fabric8.zookeeper.server" 8 ) ; props2 . setProperty ( "server.2" 7 , "io.fabric8.zookeeper.server" 0 ) ; props2 . setProperty ( "clientPortAddress" 0 , "clientPortAddress" 1 ) ; props2 . setProperty ( "clientPortAddress" , "0.0.0.0" ) ; java . util . Properties props3 = new java . util . Properties ( props ) ; props3 . setProperty ( "io.fabric8.zookeeper.server" 6 , "io.fabric8.zookeeper.server" 2 ) ; props3 . setProperty ( "server.2" 1 , "server.3" 7 ) ; props3 . setProperty ( "server.2" 2 , "server.2" 3 ) ; props3 . setProperty ( "server.2" 7 , "server.3" 7 ) ; props3 . setProperty ( "clientPortAddress" 0 , "io.fabric8.zookeeper.server" 7 ) ; props3 . setProperty ( "clientPortAddress" , "192.168.0.1" ) ; java . util . Set < java . lang . String > passwords = new java . util . LinkedHashSet ( ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props1 , 1 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props1 , 2 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props1 , 3 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props2 , 1 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props2 , 2 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props2 , 3 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props3 , 1 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props3 , 2 ) ) ; passwords . add ( io . fabric8 . zookeeper . utils . ZooKeeperUtils . derivePeerPassword ( props3 , 3 ) ) ; "<AssertPlaceHolder>" ; int i = 1 ; for ( java . lang . String p : passwords ) { io . fabric8 . zookeeper . utils . ZookeeperUtilsTest . LOG . info ( ( ( ( "io.fabric8.zookeeper.server" 9 + ( i ++ ) ) + "clientPortAddress" 2 ) + p ) ) ; } } size ( ) { int size = 0 ; { try { if ( ( exists ( curator , ZkPath . CLOUD_NODES . getPath ( ) ) ) != null ) { size = getChildren ( curator , ZkPath . CLOUD_NODES . getPath ( ) ) . size ( ) ; } } catch ( java . lang . Exception ex ) { size = ( ( int ) ( cache . size ( ) ) ) ; } } return size ; } | org . junit . Assert . assertThat ( passwords . size ( ) , org . hamcrest . CoreMatchers . equalTo ( 3 ) ) |
noActions ( ) { actionEvaluator . setAction ( generateText ( ) ) ; "<AssertPlaceHolder>" ; } evaluate ( org . json . simple . JSONObject ) { return ! ( super . evaluate ( jsonObject ) ) ; } | org . junit . Assert . assertFalse ( actionEvaluator . evaluate ( mock ( org . json . simple . JSONObject . class ) ) ) |
testGetCollectionOutput ( ) { org . eclipse . bpmn2 . ItemAwareElement item = org . kie . workbench . common . stunner . bpmn . backend . converters . tostunner . properties . ActivityPropertyReaderTest . mockItemAwareElement ( org . kie . workbench . common . stunner . bpmn . backend . converters . tostunner . properties . MultipleInstanceActivityPropertyReaderTest . ITEM_ID ) ; when ( miloop . getLoopDataOutputRef ( ) ) . thenReturn ( item ) ; java . util . List < org . eclipse . bpmn2 . DataOutputAssociation > outputAssociations = java . util . Collections . singletonList ( org . kie . workbench . common . stunner . bpmn . backend . converters . tostunner . properties . ActivityPropertyReaderTest . mockDataOutputAssociation ( org . kie . workbench . common . stunner . bpmn . backend . converters . tostunner . properties . MultipleInstanceActivityPropertyReaderTest . ITEM_ID , org . kie . workbench . common . stunner . bpmn . backend . converters . tostunner . properties . MultipleInstanceActivityPropertyReaderTest . PROPERTY_ID ) ) ; when ( activity . getDataOutputAssociations ( ) ) . thenReturn ( outputAssociations ) ; "<AssertPlaceHolder>" ; } getCollectionOutput ( ) { java . lang . String ieDataOutputId = getLoopDataOutputRefId ( ) ; return super . getDataOutputAssociations ( ) . stream ( ) . filter ( ( doa ) -> hasSourceRef ( doa , ieDataOutputId ) ) . map ( ( doa ) -> org . kie . workbench . common . stunner . bpmn . backend . converters . tostunner . properties . ItemNameReader . from ( doa . getTargetRef ( ) ) . getName ( ) ) . findFirst ( ) . orElse ( null ) ; } | org . junit . Assert . assertEquals ( org . kie . workbench . common . stunner . bpmn . backend . converters . tostunner . properties . MultipleInstanceActivityPropertyReaderTest . PROPERTY_ID , reader . getCollectionOutput ( ) ) |
testNormalRunMergeWithTopK ( ) { int pageSize = 128 ; int numRuns = 2 ; int numFramesPerRun = 2 ; int minRecordSize = pageSize / 10 ; int maxRecordSize = pageSize / 8 ; for ( int topK = 1 ; topK < ( ( ( ( pageSize * numRuns ) * numFramesPerRun ) / maxRecordSize ) / 2 ) ; topK ++ ) { org . apache . hyracks . api . context . IHyracksTaskContext ctx = org . apache . hyracks . tests . unit . AbstractRunGeneratorTest . testUtils . create ( pageSize ) ; java . util . List < java . util . Map < java . lang . Integer , java . lang . String > > keyValueMapList = new java . util . ArrayList ( numRuns ) ; java . util . List < org . apache . hyracks . tests . unit . RunMergingFrameReaderTest . TestFrameReader > readerList = new java . util . ArrayList ( numRuns ) ; java . util . List < org . apache . hyracks . api . comm . IFrame > frameList = new java . util . ArrayList ( numRuns ) ; org . apache . hyracks . tests . unit . RunMergingFrameReaderTest . prepareRandomInputRunList ( ctx , pageSize , numRuns , numFramesPerRun , minRecordSize , maxRecordSize , readerList , frameList , keyValueMapList ) ; org . apache . hyracks . dataflow . std . sort . RunMergingFrameReader reader = new org . apache . hyracks . dataflow . std . sort . RunMergingFrameReader ( ctx , readerList , frameList , org . apache . hyracks . tests . unit . AbstractRunGeneratorTest . SortFields , org . apache . hyracks . tests . unit . RunMergingFrameReaderTest . Comparators , null , org . apache . hyracks . tests . unit . AbstractRunGeneratorTest . RecordDesc , topK ) ; int totoalCount = testMergeSucceedInner ( ctx , reader , keyValueMapList ) ; int newCount = 0 ; for ( java . util . Map < java . lang . Integer , java . lang . String > x : keyValueMapList ) { newCount += x . size ( ) ; } "<AssertPlaceHolder>" ; } } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertEquals ( ( topK + newCount ) , totoalCount ) |
nullProjectIsReturnedIfNoProjectIsConfigured ( ) { final com . espirit . moddev . cli . configuration . GlobalConfig config = new com . espirit . moddev . cli . configuration . GlobalConfig ( ) ; config . getEnvironment ( ) . clear ( ) ; "<AssertPlaceHolder>" ; } getProject ( ) { if ( ( ( project ) == null ) || ( project . isEmpty ( ) ) ) { boolean environmentContainsProject = getEnvironment ( ) . containsKey ( CliConstants . KEY_FS_PROJECT . value ( ) ) ; if ( environmentContainsProject ) { return getEnvironment ( ) . get ( CliConstants . KEY_FS_PROJECT . value ( ) ) . trim ( ) ; } } return project ; } | org . junit . Assert . assertNull ( config . getProject ( ) ) |
deleteNonExistentCommandTag ( ) { cern . c2mon . shared . client . configuration . api . tag . CommandTag dataTag = new cern . c2mon . shared . client . configuration . api . tag . CommandTag ( ) ; dataTag . setId ( 20L ) ; dataTag . setDeleted ( true ) ; cern . c2mon . server . configuration . parser . configuration . List < cern . c2mon . shared . client . configuration . api . tag . Tag > tagUpdateList = cern . c2mon . server . configuration . parser . configuration . Arrays . asList ( dataTag ) ; cern . c2mon . shared . client . configuration . api . Configuration config = new cern . c2mon . shared . client . configuration . api . Configuration ( 1L ) ; config . setEntities ( tagUpdateList ) ; org . easymock . EasyMock . expect ( commandTagCache . hasKey ( 20L ) ) . andReturn ( false ) ; org . easymock . EasyMock . replay ( commandTagCache ) ; "<AssertPlaceHolder>" ; org . easymock . EasyMock . verify ( commandTagCache ) ; } parse ( cern . c2mon . shared . client . configuration . api . Configuration ) { if ( ( ( configuration . getEntities ( ) ) != null ) && ( ! ( configuration . getEntities ( ) . isEmpty ( ) ) ) ) { return parseConfigurationList ( configuration . getEntities ( ) ) ; } else { throw new cern . c2mon . server . configuration . parser . exception . ConfigurationParseException ( "Empty<sp>configuration<sp>received!" ) ; } } | org . junit . Assert . assertEquals ( 0 , parser . parse ( config ) . size ( ) ) |
testValidateThrowsException ( ) { org . apache . directory . ldap . client . api . LdapConnection connection = org . mockito . Mockito . mock ( org . apache . directory . ldap . client . api . LdapConnection . class ) ; doThrow ( org . apache . directory . api . ldap . model . exception . LdapException . class ) . when ( connection ) . lookup ( Dn . ROOT_DSE , SchemaConstants . NO_ATTRIBUTE ) ; "<AssertPlaceHolder>" ; } validate ( java . lang . String ) { if ( ( path . isEmpty ( ) ) || ( org . apache . jackrabbit . oak . commons . PathUtils . denotesRootPath ( path ) ) ) { return ; } else if ( ( path . charAt ( ( ( path . length ( ) ) - 1 ) ) ) == '/' ) { throw new java . lang . IllegalArgumentException ( ( "Path<sp>may<sp>not<sp>end<sp>with<sp>'/':<sp>" + path ) ) ; } char last = 0 ; for ( int index = 0 , len = path . length ( ) ; index < len ; index ++ ) { char c = path . charAt ( index ) ; if ( c == '/' ) { if ( last == '/' ) { throw new java . lang . IllegalArgumentException ( ( "Path<sp>may<sp>not<sp>contains<sp>'//':<sp>" + path ) ) ; } } last = c ; } } | org . junit . Assert . assertFalse ( validator . validate ( connection ) ) |
shouldAutotypeStringProperties ( ) { final org . apache . tinkerpop . gremlin . structure . Vertex v = graph . addVertex ( ) ; v . property ( VertexProperty . Cardinality . single , "string" , "marko" ) ; final java . lang . String name = v . value ( "string" ) ; "<AssertPlaceHolder>" ; } value ( java . lang . String ) { return this . element . value ( key ) ; } | org . junit . Assert . assertEquals ( name , "marko" ) |
testVoerStapUitMetExceptie ( ) { maakBericht ( 123550394 , nl . bzk . brp . levering . synchronisatie . stappen . persoon . MaakUitgaandBerichtStapTest . LEVERINGSAUTORISATIE_NAAM , 123 , nl . bzk . brp . levering . synchronisatie . stappen . persoon . MaakUitgaandBerichtStapTest . AGV ) ; when ( marshallService . maakBericht ( any ( nl . bzk . brp . model . levering . VolledigBericht . class ) ) ) . thenThrow ( org . jibx . runtime . JiBXException . class ) ; final boolean stapResultaat = maakUitgaandBerichtStap . voerStapUit ( getOnderwerp ( ) , getBerichtContext ( ) , getResultaat ( ) ) ; "<AssertPlaceHolder>" ; } getResultaat ( ) { return resultaat ; } | org . junit . Assert . assertFalse ( stapResultaat ) |
generatesCarbon12 ( ) { org . openscience . cdk . interfaces . IAtomContainer container = mock ( org . openscience . cdk . interfaces . IAtomContainer . class ) ; org . openscience . cdk . interfaces . IAtom atom = mock ( org . openscience . cdk . interfaces . IAtom . class ) ; when ( atom . getAtomicNumber ( ) ) . thenReturn ( 6 ) ; when ( atom . getMassNumber ( ) ) . thenReturn ( 12 ) ; when ( atom . getImplicitHydrogenCount ( ) ) . thenReturn ( 0 ) ; when ( atom . getFormalCharge ( ) ) . thenReturn ( 0 ) ; org . openscience . cdk . renderer . RendererModel model = new org . openscience . cdk . renderer . RendererModel ( ) ; model . registerParameters ( new org . openscience . cdk . renderer . generators . standard . StandardGenerator ( new java . awt . Font ( java . awt . Font . SANS_SERIF , java . awt . Font . PLAIN , 12 ) ) ) ; model . set ( StandardGenerator . OmitMajorIsotopes . class , true ) ; org . openscience . cdk . renderer . generators . standard . AtomSymbol atomSymbol = atomGenerator . generateSymbol ( container , atom , HydrogenPosition . Left , model ) ; java . util . List < java . awt . Shape > shapes = atomSymbol . getOutlines ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; } | org . junit . Assert . assertThat ( shapes . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
shouldMarkTransitionFromNullToSuperadminAsValidWhenPerformedByShopDuringCreation ( ) { stubSecurityContextWithAuthentication ( ) ; stubCurrentUserRole ( com . qcadoo . security . internal . validators . ROLE_SUPERADMIN ) ; stubRoleTransition ( null , com . qcadoo . security . internal . validators . ROLE_SUPERADMIN ) ; given ( userEntityMock . getId ( ) ) . willReturn ( null ) ; final boolean isValid = userRoleValidationService . checkUserCreatingSuperadmin ( userDataDefMock , userEntityMock ) ; "<AssertPlaceHolder>" ; } checkUserCreatingSuperadmin ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { java . lang . Boolean isRoleSuperadminInNewGroup = securityService . hasRole ( entity , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; java . lang . Boolean isRoleSuperadminInOldGroup = ( ( entity . getId ( ) ) == null ) ? false : securityService . hasRole ( dataDefinition . get ( entity . getId ( ) ) , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; if ( ( com . google . common . base . Objects . equal ( isRoleSuperadminInOldGroup , isRoleSuperadminInNewGroup ) ) || ( isCurrentUserShopOrSuperAdmin ( dataDefinition ) ) ) { return true ; } entity . addError ( dataDefinition . getField ( UserFields . GROUP ) , "qcadooUsers.validate.global.error.forbiddenRole" ) ; return false ; } | org . junit . Assert . assertTrue ( isValid ) |
testLength ( ) { final java . lang . String theTest = de . mirkosertic . bytecoder . core . StringTest . getString ( ) ; "<AssertPlaceHolder>" ; } length ( ) { float theSquareSum = 0.0F ; theSquareSum += ( s0 ) * ( s0 ) ; theSquareSum += ( s1 ) * ( s1 ) ; return ( ( float ) ( java . lang . Math . sqrt ( theSquareSum ) ) ) ; } | org . junit . Assert . assertEquals ( 3 , theTest . length ( ) , 0 ) |
testCreate ( ) { final net . imglib2 . loops . ClassCopyProvider < java . util . function . IntSupplier > provider = new net . imglib2 . loops . ClassCopyProvider ( net . imglib2 . loops . ClassCopyProviderTest . MyRunnable . class , java . util . function . IntSupplier . class ) ; final java . util . function . IntSupplier supplier = provider . newInstanceForKey ( "key" , 42 ) ; "<AssertPlaceHolder>" ; } getAsInt ( ) { return 12 ; } | org . junit . Assert . assertEquals ( 12 , supplier . getAsInt ( ) ) |
testFromCamelContext ( ) { java . lang . String schema = new org . apache . camel . impl . DefaultCamelContext ( ) . getExtension ( org . apache . camel . runtimecatalog . RuntimeCamelCatalog . class ) . modelJSonSchema ( "choice" ) ; "<AssertPlaceHolder>" ; } modelJSonSchema ( java . lang . String ) { return camelCatalog . modelJSonSchema ( name ) ; } | org . junit . Assert . assertNotNull ( schema ) |
shouldInjectHighlightStyle ( ) { com . couchbase . client . java . search . SearchQuery p = new com . couchbase . client . java . search . SearchQuery ( null , null ) . highlight ( HighlightStyle . HTML ) ; com . couchbase . client . java . document . json . JsonObject result = com . couchbase . client . java . document . json . JsonObject . empty ( ) ; p . injectParams ( result ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "highlight" , com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "style" , "html" ) ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , V ) { if ( key == null ) { throw new java . lang . NullPointerException ( "Unsupported<sp>null<sp>key" ) ; } if ( ! ( com . couchbase . client . java . document . json . JsonValue . checkType ( value ) ) ) { throw new java . lang . IllegalArgumentException ( "Unsupported<sp>value<sp>type." ) ; } for ( int i = 0 ; i < ( com . couchbase . client . java . datastructures . collections . CouchbaseMap . MAX_OPTIMISTIC_LOCKING_ATTEMPTS ) ; i ++ ) { try { com . couchbase . client . java . subdoc . DocumentFragment < com . couchbase . client . core . message . kv . subdoc . multi . Lookup > current = bucket . lookupIn ( id ) . get ( key ) . execute ( ) ; long returnCas = current . cas ( ) ; java . lang . Object result = null ; if ( current . exists ( key ) ) { result = current . content ( key ) ; } bucket . mutateIn ( id ) . upsert ( key , value , false ) . withCas ( returnCas ) . execute ( ) ; return ( ( V ) ( result ) ) ; } catch ( com . couchbase . client . java . error . CASMismatchException ex ) { } } throw new java . util . ConcurrentModificationException ( ( ( "Couldn't<sp>perform<sp>put<sp>in<sp>less<sp>than<sp>" + ( com . couchbase . client . java . datastructures . collections . CouchbaseMap . MAX_OPTIMISTIC_LOCKING_ATTEMPTS ) ) + "<sp>iterations" ) ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
testHITValidCompletedOverlap ( ) { java . lang . String hitId = "testHITId" ; edu . harvard . econcs . turkserver . schema . Session s = new edu . harvard . econcs . turkserver . schema . Session ( ) ; s . setHitId ( hitId ) ; s . setWorkerId ( "someOtherWorker" ) ; s . setInactivePercent ( 0.0 ) ; "<AssertPlaceHolder>" ; tracker . saveSession ( s ) ; workerAuth . checkHITValid ( hitId , "thisWorker" , tracker . getStoredSessionInfo ( hitId ) ) ; } status ( edu . harvard . econcs . turkserver . schema . Session ) { if ( session == null ) return edu . harvard . econcs . turkserver . server . SessionRecord . SessionStatus . UNASSIGNED ; if ( ( session . getInactivePercent ( ) ) != null ) { return edu . harvard . econcs . turkserver . server . SessionRecord . SessionStatus . COMPLETED ; } else if ( ( session . getExperimentId ( ) ) != null ) { return edu . harvard . econcs . turkserver . server . SessionRecord . SessionStatus . EXPERIMENT ; } else if ( ( session . getLobbyTime ( ) ) != null ) { return edu . harvard . econcs . turkserver . server . SessionRecord . SessionStatus . LOBBY ; } else if ( ( session . getWorkerId ( ) ) != null ) { return edu . harvard . econcs . turkserver . server . SessionRecord . SessionStatus . ASSIGNED ; } else { return edu . harvard . econcs . turkserver . server . SessionRecord . SessionStatus . UNASSIGNED ; } } | org . junit . Assert . assertEquals ( SessionStatus . COMPLETED , edu . harvard . econcs . turkserver . server . SessionRecord . status ( s ) ) |
testZeroPartitions ( ) { de . hub . cs . dbis . aeolus . spouts . TestOrderedFileInputSpout spout = new de . hub . cs . dbis . aeolus . spouts . TestOrderedFileInputSpout ( ) ; backtype . storm . Config conf = new backtype . storm . Config ( ) ; conf . put ( TestOrderedFileInputSpout . NUMBER_OF_PARTITIONS , new java . lang . Integer ( 0 ) ) ; de . hub . cs . dbis . aeolus . testUtils . TestSpoutOutputCollector col = new de . hub . cs . dbis . aeolus . testUtils . TestSpoutOutputCollector ( ) ; spout . open ( conf , mock ( backtype . storm . task . TopologyContext . class ) , new backtype . storm . spout . SpoutOutputCollector ( col ) ) ; spout . nextTuple ( ) ; spout . nextTuple ( ) ; spout . nextTuple ( ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertEquals ( col . output . size ( ) , 0 ) |
testEqualsNull ( ) { org . hipparchus . complex . Complex x = new org . hipparchus . complex . Complex ( 3.0 , 4.0 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == other ) { return true ; } if ( other instanceof org . hipparchus . stat . fitting . MultivariateNormalMixtureExpectationMaximization . DataRow ) { return org . hipparchus . util . MathArrays . equals ( row , ( ( org . hipparchus . stat . fitting . MultivariateNormalMixtureExpectationMaximization . DataRow ) ( other ) ) . row ) ; } return false ; } | org . junit . Assert . assertFalse ( x . equals ( null ) ) |
testCommitOperator ( ) { com . github . davidmoten . rx . jdbc . Database db = db ( ) ; rx . Observable < java . lang . Boolean > begin = db . beginTransaction ( ) ; java . lang . String name = rx . Observable . just ( "FRED" ) . compose ( db . update ( "update<sp>person<sp>set<sp>score=1<sp>where<sp>name=?" ) . dependsOn ( begin ) . parameterTransformer ( ) ) . compose ( db . commit_ ( ) ) . compose ( db . select ( "select<sp>name<sp>from<sp>person<sp>where<sp>score=1" ) . dependsOnTransformer ( ) . getAs ( java . lang . String . class ) ) . first ( ) . toBlocking ( ) . single ( ) ; "<AssertPlaceHolder>" ; } getAs ( java . lang . Class ) { return get ( com . github . davidmoten . rx . jdbc . tuple . Tuples . single ( cls ) ) ; } | org . junit . Assert . assertEquals ( "FRED" , name ) |
not_eq__should_return_null_when_eq_is_applied_to_index_outside_not_result_size ( ) { java . lang . String text = io . github . seleniumquery . SeleniumQuery . $ ( "div:not(.w00t):eq(1)" ) . text ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { return isAnd ( IsEvaluator . IS_EVALUATOR , selector ) ; } | org . junit . Assert . assertThat ( text , org . hamcrest . Matchers . is ( "" ) ) |
testSameElementLookedUpDifferentWaysUsingFindElementsShouldHaveSameHashCode ( ) { java . util . List < org . openqa . selenium . WebElement > body = driver . findElements ( org . openqa . selenium . By . tagName ( "TextInput" ) ) ; java . util . List < org . openqa . selenium . WebElement > xbody = driver . findElements ( org . openqa . selenium . By . xpath ( "//TextInput" ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return options . get ( key ) ; } | org . junit . Assert . assertEquals ( body . get ( 0 ) . hashCode ( ) , xbody . get ( 0 ) . hashCode ( ) ) |
testCrc ( ) { final byte [ ] data = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ; final int correctCrc = 64700 ; final int calcCrc = tuwien . auto . calimero . link . medium . RFLData . crc16 ( data , 0 , data . length ) ; "<AssertPlaceHolder>" ; } crc16 ( byte [ ] , int , int ) { final int pn = 81253 ; int crc = 0 ; for ( int i = offset ; i < ( offset + length ) ; i ++ ) { final int bite = ( data [ i ] ) & 255 ; for ( int b = 8 ; ( b -- ) > 0 ; ) { final boolean bit = ( ( bite > > b ) & 1 ) == 1 ; final boolean one = ( ( crc > > 15 ) & 1 ) == 1 ; crc <<= 1 ; if ( one ^ bit ) crc ^= pn ; } } return ( ~ crc ) & 65535 ; } | org . junit . Assert . assertEquals ( correctCrc , calcCrc ) |
testGetStackTraces ( ) { org . apache . hadoop . mapred . JobConf jobConf = new org . apache . hadoop . mapred . JobConf ( ) ; org . apache . hadoop . hive . conf . HiveConf . setQueryString ( jobConf , "select<sp>*<sp>from<sp>foo<sp>group<sp>by<sp>moo;" ) ; final org . apache . hadoop . hive . ql . exec . errors . TaskLogProcessor taskLogProcessor = new org . apache . hadoop . hive . ql . exec . errors . TaskLogProcessor ( jobConf ) ; java . lang . Throwable oome = new java . lang . OutOfMemoryError ( "java<sp>heap<sp>space" ) ; java . lang . String oomeStr = writeThrowableAsFile ( "Some<sp>line<sp>in<sp>the<sp>beginning\n" , oome , null , "1" , taskLogProcessor ) ; java . lang . Throwable compositeException = new java . lang . reflect . InvocationTargetException ( new java . io . IOException ( new java . lang . NullPointerException ( ) ) ) ; java . lang . String compositeStr = writeThrowableAsFile ( null , compositeException , "Some<sp>line<sp>in<sp>the<sp>end.\n" , "2" , taskLogProcessor ) ; java . lang . Throwable eofe = new java . io . EOFException ( ) ; java . lang . String eofeStr = writeThrowableAsFile ( "line<sp>a\nlineb\n" , eofe , "<sp>line<sp>c\nlineD\n" , "3" , taskLogProcessor ) ; java . util . List < java . util . List < java . lang . String > > stackTraces = taskLogProcessor . getStackTraces ( ) ; "<AssertPlaceHolder>" ; checkException ( oomeStr , stackTraces . get ( 0 ) ) ; checkException ( compositeStr , stackTraces . get ( 1 ) ) ; checkException ( eofeStr , stackTraces . get ( 2 ) ) ; } size ( ) { return size ; } | org . junit . Assert . assertEquals ( 3 , stackTraces . size ( ) ) |
lessThanThreshold ( ) { org . candlepin . model . Owner owner = new org . candlepin . model . Owner ( "owner" ) ; ownerCurator . create ( owner ) ; for ( int i = 0 ; i < 7 ; i ++ ) { org . candlepin . model . ImportRecord record = new org . candlepin . model . ImportRecord ( owner ) ; record . recordStatus ( ImportRecord . Status . SUCCESS , "great!" ) ; this . importRecordCurator . create ( record ) ; } org . quartz . JobExecutionContext context = mock ( org . quartz . JobExecutionContext . class ) ; this . job . execute ( context ) ; java . util . List < org . candlepin . model . ImportRecord > records = this . importRecordCurator . findRecords ( owner ) . list ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return virtUuidToConsumerMap . keySet ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 7 , records . size ( ) ) |
testSetup ( ) { final org . jbpm . workbench . wi . dd . model . DeploymentDescriptorModel model = new org . jbpm . workbench . wi . dd . model . DeploymentDescriptorModel ( ) ; presenter . setup ( model ) ; "<AssertPlaceHolder>" ; verify ( eventListenersListPresenter ) . setup ( any ( ) , any ( ) , any ( ) ) ; } getEventListeners ( ) { return eventListeners ; } | org . junit . Assert . assertNotNull ( model . getEventListeners ( ) ) |
onMessage1 ( ) { org . darkphoenixs . rocketmq . listener . RocketmqMessageConsumerListener < java . lang . String > listener = new org . darkphoenixs . rocketmq . listener . RocketmqMessageConsumerListener < java . lang . String > ( ) ; try { listener . onMessage ( "test" ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } listener . setConsumer ( new org . darkphoenixs . rocketmq . consumer . MessageConsumer < java . lang . String > ( ) ) ; listener . onMessage ( "test" ) ; } onMessage ( T ) { if ( ( consumer ) != null ) if ( ( threadPool ) != null ) threadPool . execute ( new java . lang . Runnable ( ) { @ org . darkphoenixs . activemq . listener . Override public void run ( ) { try { consumer . receive ( message ) ; } catch ( org . darkphoenixs . mq . exception . MQException e ) { logger . error ( "Receive<sp>message<sp>failed." , e ) ; } } } ) ; else consumer . receive ( message ) ; else throw new org . darkphoenixs . mq . exception . MQException ( "MQConsumer<sp>is<sp>null<sp>!" ) ; } | org . junit . Assert . assertNotNull ( e ) |
testCalculateTagName_hotfix_release2_Major_rule ( ) { org . bsc . maven . reporting . renderer . GitLogJiraIssuesRenderer renderer = org . bsc . maven . reporting . renderer . GitLogJiraIssuesRendererTest . createRendererWithParams ( "11.0.2" , org . bsc . maven . reporting . renderer . CURRENT_MAJOR_VERSION ) ; java . lang . String result = org . bsc . maven . reporting . renderer . GitLogJiraIssuesRendererTest . calculateSinceTagName ( renderer ) ; "<AssertPlaceHolder>" ; } calculateSinceTagName ( org . bsc . maven . reporting . renderer . GitLogJiraIssuesRenderer ) { java . util . List < java . lang . String > list = asList ( "10.0.0" , "10.1.9" , "11.0.0" , "11.0.1" , "11.1.10" , "12.0.0" ) ; renderer . overrideGitLogSinceTagNameIfNeeded ( list ) ; return renderer . getGitLogSinceTagName ( ) ; } | org . junit . Assert . assertEquals ( "10.1.9" , result ) |
getOnly ( ) { org . eclipse . collections . api . list . ImmutableList < java . lang . Integer > list = new org . eclipse . collections . impl . list . immutable . ImmutableSingletonList ( 3 ) ; "<AssertPlaceHolder>" ; } valueOf ( K ) { return this . multimap . get ( subject ) ; } | org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 3 ) , list . getOnly ( ) ) |
getOperationDescription ( ) { java . lang . String desc = row . getOperationDescription ( ) ; "<AssertPlaceHolder>" ; } getOperationDescription ( ) { return operation . getOperationDescription ( ) ; } | org . junit . Assert . assertEquals ( operation . getOperationDescription ( ) , desc ) |
timeoutWithoutCallingCleanup ( ) { clock . stop ( ) ; cloud . orbit . actors . Stage stage1 = createStage ( ) ; cloud . orbit . actors . test . actors . SomeActor actor = cloud . orbit . actors . Actor . getReference ( cloud . orbit . actors . test . actors . SomeActor . class , "1" ) ; java . util . UUID uuid = actor . getUniqueActivationId ( 0 ) . join ( ) ; "<AssertPlaceHolder>" ; final cloud . orbit . concurrent . Task < java . util . UUID > timeoutCall = actor . getUniqueActivationId ( TimeUnit . MINUTES . toNanos ( 2 ) ) ; clock . incrementTime ( 60 , TimeUnit . MINUTES ) ; eventuallyTrue ( ( ) -> timeoutCall . isCompletedExceptionally ( ) ) ; } getUniqueActivationId ( long ) { java . lang . Thread . yield ( ) ; long start = java . lang . System . nanoTime ( ) ; if ( sleepNanos >= 1000 ) { try { java . lang . Thread . sleep ( ( sleepNanos / 1000 ) ) ; } catch ( java . lang . InterruptedException e ) { getLogger ( ) . error ( "Error<sp>sleeping" , e ) ; } } while ( ( start + sleepNanos ) >= ( java . lang . System . nanoTime ( ) ) ) { } return cloud . orbit . concurrent . Task . fromValue ( uuid ) ; } | org . junit . Assert . assertEquals ( uuid , actor . getUniqueActivationId ( 0 ) . join ( ) ) |
renderConfluencePage_asciiDocWithSourceListingOfUnsupportedLanguage_returnsConfluencePageContentWithMacroWithoutLanguageElement ( ) { java . lang . String adocContent = "[source,unsupported]\n" + ( ( ( "----\n" + "GET<sp>/events?param1=value1¶m2=value2<sp>HTTP/1.1\n" ) + "Host:<sp>localhost:8080\n" ) + "----" ) ; org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage asciiDocConfluencePage = org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage . newAsciidocConfluencePage ( asciidocPage ( org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . prependTitle ( adocContent ) ) , org . sahli . asciidoc . confluence . publisher . converter . UTF_8 , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . TEMPLATES_FOLDER , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . dummyAssetsTargetPath ( ) ) ; java . lang . String expectedContent = "<ac:structured-macro<sp>ac:name=\"code\">" + ( ( ( "<ac:plain-text-body>" + "<![CDATA[GET<sp>/events?param1=value1¶m2=value2<sp>HTTP/1.1\nHost:<sp>localhost:8080]]>" ) + "</ac:plain-text-body>" ) + "<ac:plain-text-body>" 0 ) ; "<AssertPlaceHolder>" ; } content ( ) { return this . htmlContent ; } | org . junit . Assert . assertThat ( asciiDocConfluencePage . content ( ) , org . hamcrest . Matchers . is ( expectedContent ) ) |
testBrowsing ( ) { int messageToSend = 370 ; org . apache . activemq . command . ActiveMQQueue queue = new org . apache . activemq . command . ActiveMQQueue ( "TEST" ) ; javax . jms . Connection connection = factory . createConnection ( ) ; connection . start ( ) ; javax . jms . Session session = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; javax . jms . MessageProducer producer = session . createProducer ( queue ) ; java . lang . String data = "" ; for ( int i = 0 ; i < ( 1024 * 2 ) ; i ++ ) { data += "x" ; } for ( int i = 0 ; i < messageToSend ; i ++ ) { producer . send ( session . createTextMessage ( data ) ) ; } javax . jms . QueueBrowser browser = session . createBrowser ( queue ) ; java . util . Enumeration < ? > enumeration = browser . getEnumeration ( ) ; int received = 0 ; while ( enumeration . hasMoreElements ( ) ) { javax . jms . Message m = ( ( javax . jms . Message ) ( enumeration . nextElement ( ) ) ) ; received ++ ; org . apache . activemq . usecases . QueueBrowsingTest . LOG . info ( ( ( ( "Browsed<sp>message<sp>" + received ) + ":<sp>" ) + ( m . getJMSMessageID ( ) ) ) ) ; } browser . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { queue . close ( ) ; } | org . junit . Assert . assertEquals ( messageToSend , received ) |
adsDetailsPage_withClickOnMoPubLeaderboardSample_shouldLoadMoPubLeaderboard ( ) { final com . mopub . framework . pages . AdListPage adListPage = new com . mopub . framework . pages . AdListPage ( ) ; final com . mopub . framework . pages . AdDetailPage adDetailPage = adListPage . clickCell ( com . mopub . tests . LeaderboardAdTests . TITLE ) ; final android . support . test . espresso . ViewInteraction bannerElement = onView ( org . hamcrest . Matchers . allOf ( withId ( R . id . banner_mopubview ) , hasChildCount ( 1 ) ) ) ; "<AssertPlaceHolder>" ; } waitForElement ( android . support . test . espresso . ViewInteraction ) { return waitForElement ( element , com . mopub . framework . base . BasePage . DEFAULT_TIMEOUT_SECS ) ; } | org . junit . Assert . assertTrue ( adDetailPage . waitForElement ( bannerElement ) ) |
testAsMapPreservesLetterCase ( ) { java . util . Map < java . lang . String , java . lang . String > map = java . util . Collections . singletonMap ( "sTRangE-KEy" , "value" ) ; com . spotify . apollo . Headers headers = com . spotify . apollo . Headers . create ( map ) ; Map . Entry < java . lang . String , java . lang . String > asMapResult = headers . asMap ( ) . entrySet ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return key ; } | org . junit . Assert . assertThat ( asMapResult . getKey ( ) , org . hamcrest . CoreMatchers . is ( "sTRangE-KEy" ) ) |
describeDirectories_InvalidNextToken_ThrowsExceptionWithRequestIdPresent ( ) { try { dsClient . describeDirectories ( software . amazon . awssdk . services . directory . model . DescribeDirectoriesRequest . builder ( ) . nextToken ( "invalid" ) . build ( ) ) ; } catch ( software . amazon . awssdk . services . directory . model . InvalidNextTokenException e ) { "<AssertPlaceHolder>" ; } } requestId ( ) { return getValue ( software . amazon . awssdk . awscore . AWS_REQUEST_ID ) ; } | org . junit . Assert . assertNotNull ( e . requestId ( ) ) |
testNoExtensionIfNoBlocks ( ) { cluster . getConfiguration ( 0 ) . setInt ( DFSConfigKeys . DFS_NAMENODE_SAFEMODE_EXTENSION_KEY , 60000 ) ; cluster . restartNameNode ( ) ; java . lang . String status = cluster . getNameNode ( ) . getNamesystem ( ) . getSafemode ( ) ; "<AssertPlaceHolder>" ; } getSafemode ( ) { if ( ! ( this . isInSafeMode ( ) ) ) return "" ; return "Safe<sp>mode<sp>is<sp>ON.<sp>" + ( this . getSafeModeTip ( ) ) ; } | org . junit . Assert . assertEquals ( "" , status ) |
testNoPackage ( ) { org . androidtransfuse . adapter . PackageClass packageClass = new org . androidtransfuse . adapter . PackageClass ( org . androidtransfuse . adapter . PackageClassTest . CLASS_NAME ) ; "<AssertPlaceHolder>" ; } getCanonicalName ( ) { if ( ( pkg ) == null ) { return fileName ; } return ( ( pkg ) + "." ) + ( fileName ) ; } | org . junit . Assert . assertEquals ( org . androidtransfuse . adapter . PackageClassTest . CLASS_NAME , packageClass . getCanonicalName ( ) ) |
testFastutilFloatList ( ) { it . unimi . dsi . fastutil . floats . FloatArrayList list = new it . unimi . dsi . fastutil . floats . FloatArrayList ( ) ; list . add ( 6L ) ; it . unimi . dsi . fastutil . floats . FloatArrayList deser = org . apache . giraph . writable . kryo . KryoWritableWrapperTest . kryoSerDeser ( list ) ; deser . add ( 5L ) ; list . add ( 5L ) ; "<AssertPlaceHolder>" ; } add ( org . apache . giraph . block_app . framework . block . PieceCount ) { if ( ( ! ( this . known ) ) || ( ! ( other . known ) ) ) { known = false ; } else { count += other . count ; } return this ; } | org . junit . Assert . assertEquals ( list , deser ) |
whenIteratorHasNextIsCalledTwice_thenTheSecondReturnsFalse ( ) { java . util . List < java . lang . Object > list = new com . baeldung . java . list . CustomList ( ) ; list . add ( "baeldung" ) ; java . util . Iterator < java . lang . Object > iterator = list . iterator ( ) ; iterator . next ( ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { if ( ( checkedHasNext ) == null ) theNext ( ) ; return checkedHasNext ; } | org . junit . Assert . assertFalse ( iterator . hasNext ( ) ) |
userAdminHasNotPermissionToDeleteModule ( ) { log . debug ( "userAdminHasNotPermissionToDeleteModule()" ) ; com . abixen . platform . core . domain . model . User admin = userRepository . findOne ( 1L ) ; com . abixen . platform . core . domain . model . Module module = moduleRepository . findOne ( 2L ) ; java . lang . Boolean hasPermission = securityService . hasUserPermissionToObject ( admin , PermissionName . MODULE_DELETE , module ) ; "<AssertPlaceHolder>" ; } hasUserPermissionToObject ( com . abixen . platform . core . domain . model . User , com . abixen . platform . common . domain . model . enumtype . PermissionName , com . abixen . platform . core . domain . model . SecurableModel ) { if ( user == null ) { throw new java . lang . IllegalArgumentException ( "User<sp>can<sp>not<sp>be<sp>null." ) ; } if ( permissionName == null ) { throw new java . lang . IllegalArgumentException ( "Permission<sp>Name<sp>can<sp>not<sp>be<sp>null." ) ; } if ( securableModel == null ) { throw new java . lang . IllegalArgumentException ( "SecurableModel<sp>can<sp>not<sp>be<sp>null." ) ; } if ( hasUserPermissionToClass ( user , permissionName , securableModel . getClass ( ) . getCanonicalName ( ) ) ) { return true ; } final java . util . List < java . lang . Long > userRoleIds = new java . util . ArrayList ( ) ; for ( com . abixen . platform . core . domain . model . Role role : user . getRoles ( ) ) { userRoleIds . add ( role . getId ( ) ) ; } final java . util . List < com . abixen . platform . core . domain . model . AclEntry > rolesAclEntries = aclEntryService . findAll ( permissionName , AclSidType . ROLE , userRoleIds , com . abixen . platform . common . domain . model . enumtype . AclClassName . getByName ( securableModel . getClass ( ) . getCanonicalName ( ) ) , securableModel . getId ( ) ) ; if ( ( rolesAclEntries . size ( ) ) > 0 ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ( ( ( ( ( ( ( ( "User<sp>" + ( user . getUsername ( ) ) ) + "]<sp>based<sp>on<sp>that<sp>he<sp>is<sp>the<sp>owner." 0 ) + permissionName ) + "<sp>to<sp>object<sp>" ) + ( securableModel . getClass ( ) . getCanonicalName ( ) ) ) + "[id=" ) + ( securableModel . getId ( ) ) ) + "]<sp>based<sp>on<sp>the<sp>ACL<sp>security<sp>settings." ) ) ; } return true ; } if ( ( ( securableModel . getCreatedBy ( ) ) != null ) && ( securableModel . getCreatedBy ( ) . getId ( ) . equals ( user . getId ( ) ) ) ) { java . util . List < com . abixen . platform . core . domain . model . AclEntry > ownerAclEntries = aclEntryService . findAll ( permissionName , AclSidType . OWNER , 0L , com . abixen . platform . common . domain . model . enumtype . AclClassName . getByName ( securableModel . getClass ( ) . getCanonicalName ( ) ) , securableModel . getId ( ) ) ; if ( ( ownerAclEntries . size ( ) ) > 0 ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ( ( ( ( ( ( ( ( "User<sp>" + ( user . getUsername ( ) ) ) + "]<sp>based<sp>on<sp>that<sp>he<sp>is<sp>the<sp>owner." 0 ) + permissionName ) + "<sp>to<sp>object<sp>" ) + ( securableModel . getClass ( ) . getCanonicalName ( ) ) ) + "[id=" ) + ( securableModel . getId ( ) ) ) + "]<sp>based<sp>on<sp>that<sp>he<sp>is<sp>the<sp>owner." ) ) ; } return true ; } } if ( log . isDebugEnabled ( ) ) { log . debug ( ( ( ( ( ( ( ( ( "User<sp>" + ( user . getUsername ( ) ) ) + "<sp>has<sp>not<sp>permission<sp>" ) + permissionName ) + "<sp>to<sp>object<sp>" ) + ( securableModel . getClass ( ) . getCanonicalName ( ) ) ) + "[id=" ) + ( securableModel . getId ( ) ) ) + "]." ) ) ; } return false ; } | org . junit . Assert . assertTrue ( hasPermission ) |
shouldParseOntologyThatworked ( ) { java . lang . String working = "@prefix<sp>rdfs:<sp><http://www.w3.org/2000/01/rdf-schema#><sp>.\n<sp>@prefix<sp>foaf:<sp><http://xmlns.com/foaf/0.1/><sp>.\n<sp>foaf:fundedBy<sp>rdfs:isDefinedBy<sp><http://xmlns.com/foaf/0.1/><sp>." ; org . semanticweb . owlapi . model . OWLAxiom expected = AnnotationAssertion ( df . getRDFSIsDefinedBy ( ) , IRI ( "http://xmlns.com/foaf/0.1/" , "fundedBy" ) , IRI ( "http://xmlns.com/foaf/0.1/" , "" ) ) ; org . semanticweb . owlapi . model . OWLOntology o = loadOntologyFromString ( working ) ; "<AssertPlaceHolder>" ; } containsAxiom ( org . semanticweb . owlapi . model . OWLAxiom ) { return uk . ac . manchester . cs . owl . owlapi . Internals . contains ( ints . getAxiomsByType ( ) , axiom . getAxiomType ( ) , axiom ) ; } | org . junit . Assert . assertTrue ( o . containsAxiom ( expected ) ) |
testBuild ( ) { org . lnu . is . domain . degree . Degree context = new org . lnu . is . domain . degree . Degree ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>Degree<sp>e<sp>WHERE<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . degree . Degree > 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 ) |
testForLctRecognition ( ) { org . sweble . wikitext . parser . utils . NonExpandingParser parser = new org . sweble . wikitext . parser . utils . NonExpandingParser ( true , true , false , true ) ; org . sweble . wikitext . parser . nodes . WtNode article = parser . parseArticle ( "IUPACName=<small>4-(2-{4-[(11''R'')-3,10-dibromo-8-chloro-6,11-dihydro-5H-benzo[5,6]cyclohepta[1,2-''b'']pyridin-11-yl]piperidin-1-yl}-2-oxoethyl)piperidine-1-carboxamide</small>" , "title" ) ; "<AssertPlaceHolder>" ; } scanForLct ( org . sweble . wikitext . parser . nodes . WtNode ) { if ( node . getClass ( ) . getSimpleName ( ) . toLowerCase ( ) . startsWith ( "wtlct" ) ) return node ; for ( org . sweble . wikitext . parser . nodes . WtNode child : node ) { org . sweble . wikitext . parser . nodes . WtNode lct = scanForLct ( child ) ; if ( lct != null ) return lct ; } return null ; } | org . junit . Assert . assertNotNull ( scanForLct ( article ) ) |
instantiation ( ) { java . lang . String line = null ; com . github . seratch . taskun . scheduler . crond . RawCrontabLine target = new com . github . seratch . taskun . scheduler . crond . RawCrontabLine ( line ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( target ) |
testCopyUsingCloningWithDataTableSucceeds ( ) { org . kuali . rice . krad . uif . control . CheckboxControl dataTableOriginal = new org . kuali . rice . krad . uif . control . CheckboxControl ( ) ; initializeClass ( dataTableOriginal ) ; org . kuali . rice . krad . uif . control . CheckboxControl dataTableCopy = org . kuali . rice . krad . uif . util . CopyUtils . copy ( dataTableOriginal ) ; "<AssertPlaceHolder>" ; } propertiesMatch ( java . lang . Object , java . lang . Object ) { java . lang . Class originalClass = originalObject . getClass ( ) ; java . lang . Class copiedClass = copiedObject . getClass ( ) ; for ( java . lang . reflect . Field field : originalClass . getDeclaredFields ( ) ) { if ( field . isAnnotationPresent ( org . kuali . rice . krad . uif . component . ReferenceCopy . class ) ) { continue ; } if ( field . getType ( ) . equals ( java . lang . String . class ) ) { boolean propertiesMatch = stringPropertiesMatch ( originalObject , copiedObject , copiedClass , field ) ; if ( ! propertiesMatch ) { return false ; } } if ( field . getType ( ) . equals ( long . class ) ) { boolean propertiesMatch = longPropertiesMatch ( originalObject , copiedObject , copiedClass , field ) ; if ( ! propertiesMatch ) { return false ; } } if ( field . getType ( ) . equals ( int . class ) ) { boolean propertiesMatch = intPropertiesMatch ( originalObject , copiedObject , copiedClass , field ) ; if ( ! propertiesMatch ) { return false ; } } } return true ; } | org . junit . Assert . assertTrue ( propertiesMatch ( dataTableOriginal , dataTableCopy ) ) |
testXPathExpressionComparator ( ) { java . lang . String control = "<HTML><head><title>Test</title></head><body>test</body><HTML>" ; java . lang . String test = "<HTML><head><title>Test</title></head><body>test</body><HTML>" ; "<AssertPlaceHolder>" ; com . crawljax . oracle . XPathExpressionComparator oracle = new com . crawljax . oracle . XPathExpressionComparator ( ) ; compareTwoDOMsWithComparatorEqual ( control , test , oracle ) ; compareTwoDOMsWithComparatorEqual ( control , test , new com . crawljax . oracle . XPathExpressionComparator ( ) ) ; test = "<HTML><head><title>Test</title></head><body>test<div<sp>id='ignoreme'>" + "ignoreme</div></body><HTML>" ; compareTwoDOMsWithComparatorNotEqual ( control , test , oracle ) ; compareTwoDOMsWithComparatorNotEqual ( control , test , new com . crawljax . oracle . XPathExpressionComparator ( ) ) ; oracle = new com . crawljax . oracle . XPathExpressionComparator ( "//*[@id='ignoreme']" ) ; compareTwoDOMsWithComparatorEqual ( control , test , oracle ) ; compareTwoDOMsWithComparatorEqual ( test , control , oracle ) ; control = "<HTML><head><title>Test</title></head><body>test<div<sp>id='ignoreme'>" + "ignoreme123</div></body><HTML>" ; compareTwoDOMsWithComparatorEqual ( control , test , oracle ) ; compareTwoDOMsWithComparatorEqual ( test , control , oracle ) ; } equals ( java . lang . Object ) { if ( object instanceof com . crawljax . plugins . crawloverview . model . CandidateElementPosition ) { com . crawljax . plugins . crawloverview . model . CandidateElementPosition that = ( ( com . crawljax . plugins . crawloverview . model . CandidateElementPosition ) ( object ) ) ; return ( ( ( ( com . google . common . base . Objects . equal ( this . top , that . top ) ) && ( com . google . common . base . Objects . equal ( this . left , that . left ) ) ) && ( com . google . common . base . Objects . equal ( this . xpath , that . xpath ) ) ) && ( com . google . common . base . Objects . equal ( this . width , that . width ) ) ) && ( com . google . common . base . Objects . equal ( this . height , that . height ) ) ; } return false ; } | org . junit . Assert . assertTrue ( control . equals ( test ) ) |
testRemoveAttr ( ) { java . lang . String expectedJavascript = "$('div').removeAttr('title');" ; java . lang . String generatedJavascript = new org . odlabs . wiquery . core . javascript . JsStatement ( ) . $ ( null , "div" ) . chain ( org . odlabs . wiquery . core . javascript . helper . AttributesHelper . removeAttr ( "title" ) ) . render ( ) . toString ( ) ; org . odlabs . wiquery . core . javascript . helper . AttributesHelperTestCase . log . info ( expectedJavascript ) ; org . odlabs . wiquery . core . javascript . helper . AttributesHelperTestCase . log . info ( generatedJavascript ) ; "<AssertPlaceHolder>" ; } toString ( ) { return super . toString ( ) . toLowerCase ( ) ; } | org . junit . Assert . assertEquals ( generatedJavascript , expectedJavascript ) |
testSimple7 ( ) { org . apache . catalina . ssi . SSIExternalResolver r = new org . apache . catalina . ssi . TestExpressionParseTree . TesterSSIExternalResolver ( ) ; r . setVariableValue ( "QUERY_STRING" , "a" ) ; org . apache . catalina . ssi . SSIMediator mediator = new org . apache . catalina . ssi . SSIMediator ( r , org . apache . catalina . ssi . TestExpressionParseTree . LAST_MODIFIED ) ; org . apache . catalina . ssi . ExpressionParseTree ept = new org . apache . catalina . ssi . ExpressionParseTree ( "$QUERY_STRING<sp>=<sp>/a/" , mediator ) ; "<AssertPlaceHolder>" ; } evaluateTree ( ) { return root . evaluate ( ) ; } | org . junit . Assert . assertTrue ( ept . evaluateTree ( ) ) |
cutSpace ( ) { java . util . List < java . lang . String > output = new org . kitteh . irc . client . library . util . Cutter . DefaultWordCutter ( ) . split ( "<sp>" , 3 ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . map . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , output . size ( ) ) |
testGetAliasName ( ) { classUnderTest . setAliasName ( "aTestString" ) ; "<AssertPlaceHolder>" ; } getAliasName ( ) { return _aliasName ; } | org . junit . Assert . assertEquals ( "aTestString" , classUnderTest . getAliasName ( ) ) |
testJson ( ) { io . vertx . core . json . JsonObject obj = new io . vertx . core . json . JsonObject ( ) ; obj . put ( "numb" , "one" ) ; java . lang . String url = ( base ) + "count/json/" ; try { url += java . net . URLEncoder . encode ( obj . encode ( ) , "utf-8" ) ; } catch ( java . io . UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } tests . ParamTypeTests . say ( ( "url<sp>=<sp>" + url ) ) ; java . lang . String result = utils . TestUtility . get ( url ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { org . apache . http . client . fluent . Content result = null ; try { result = org . apache . http . client . fluent . Request . Get ( location ) . execute ( ) . returnContent ( ) ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } System . out . println ( ( "Test<sp>Utility<sp>result<sp>=<sp>" + ( result . toString ( ) ) ) ) ; return result == null ? null : result . toString ( ) ; } | org . junit . Assert . assertEquals ( result , "one" ) |
testSourceRepair ( ) { io . hops . erasure_coding . Codec . initializeCodecs ( getConfig ( ) ) ; io . hops . metadata . hdfs . entity . EncodingPolicy policy = new io . hops . metadata . hdfs . entity . EncodingPolicy ( "src" , ( ( short ) ( 1 ) ) ) ; io . hops . erasure_coding . Util . createRandomFile ( dfs , testFile , seed , io . hops . erasure_coding . TestErasureCodingManager . TEST_BLOCK_COUNT , io . hops . erasure_coding . DFS_TEST_BLOCK_SIZE , policy ) ; org . apache . hadoop . fs . FileStatus testFileStatus = dfs . getFileStatus ( testFile ) ; while ( ! ( dfs . getEncodingStatus ( testFile . toUri ( ) . getPath ( ) ) . isEncoded ( ) ) ) { try { java . lang . Thread . sleep ( 1000 ) ; } catch ( java . lang . InterruptedException e ) { io . hops . erasure_coding . TestErasureCodingManager . LOG . error ( "Wait<sp>for<sp>encoding<sp>thread<sp>was<sp>interrupted." ) ; } } java . lang . Thread . sleep ( ( 2 * ( conf . getLong ( DFSConfigKeys . DFS_BLOCKREPORT_INTERVAL_MSEC_KEY , DFSConfigKeys . DFS_BLOCKREPORT_INTERVAL_MSEC_DEFAULT ) ) ) ) ; io . hops . metadata . hdfs . entity . EncodingStatus status = dfs . getEncodingStatus ( testFile . toUri ( ) . getPath ( ) ) ; org . apache . hadoop . fs . Path parityPath = new org . apache . hadoop . fs . Path ( ( "/parity/" + ( status . getParityFileName ( ) ) ) ) ; org . apache . hadoop . fs . FileStatus parityStatus = dfs . getFileStatus ( parityPath ) ; "<AssertPlaceHolder>" ; try { org . apache . hadoop . fs . FSDataInputStream in = dfs . open ( parityPath ) ; byte [ ] buff = new byte [ ( ( io . hops . erasure_coding . TestErasureCodingManager . TEST_STRIPE_COUNT ) * ( io . hops . erasure_coding . TestErasureCodingManager . TEST_PARITY_LENGTH ) ) * ( DFS_TEST_BLOCK_SIZE ) ] ; in . readFully ( 0 , buff ) ; } catch ( org . apache . hadoop . hdfs . BlockMissingException e ) { io . hops . erasure_coding . TestErasureCodingManager . LOG . error ( "Reading<sp>parity<sp>failed" , e ) ; org . junit . Assert . fail ( "Parity<sp>could<sp>not<sp>be<sp>read." ) ; } java . lang . String path = testFileStatus . getPath ( ) . toUri ( ) . getPath ( ) ; int blockToLoose = new java . util . Random ( seed ) . nextInt ( ( ( int ) ( ( testFileStatus . getLen ( ) ) / ( testFileStatus . getBlockSize ( ) ) ) ) ) ; org . apache . hadoop . hdfs . protocol . LocatedBlock lb = dfs . getClient ( ) . getLocatedBlocks ( path , 0 , Long . MAX_VALUE ) . get ( blockToLoose ) ; org . apache . hadoop . hdfs . server . datanode . DataNodeUtil . loseBlock ( cluster , lb ) ; io . hops . erasure_coding . TestErasureCodingManager . LOG . info ( ( "Losing<sp>block<sp>" + ( lb . toString ( ) ) ) ) ; java . lang . Thread . sleep ( ( ( 2 * ( conf . getLong ( DFSConfigKeys . DFS_BLOCKREPORT_INTERVAL_MSEC_KEY , DFSConfigKeys . DFS_BLOCKREPORT_INTERVAL_MSEC_DEFAULT ) ) ) + ( 2 * ( conf . getInt ( DFSConfigKeys . RECHECK_INTERVAL_KEY , 0 ) ) ) ) ) ; while ( true ) { java . lang . Thread . sleep ( 10000 ) ; io . hops . metadata . hdfs . entity . EncodingStatus status2 = dfs . getEncodingStatus ( testFile . toUri ( ) . getPath ( ) ) ; io . hops . erasure_coding . TestErasureCodingManager . LOG . info ( ( "Current<sp>status<sp>is<sp>" + ( status2 . getStatus ( ) ) ) ) ; if ( ( status2 . getStatus ( ) ) == ( EncodingStatus . Status . ENCODED ) ) { break ; } } try { org . apache . hadoop . fs . FSDataInputStream in = dfs . open ( testFile ) ; byte [ ] buff = new byte [ ( io . hops . erasure_coding . TestErasureCodingManager . TEST_BLOCK_COUNT ) * ( DFS_TEST_BLOCK_SIZE ) ] ; in . readFully ( 0 , buff ) ; } catch ( org . apache . hadoop . hdfs . BlockMissingException e ) { org . junit . Assert . fail ( "Repair<sp>failed.<sp>Missing<sp>a<sp>block." ) ; } } getLen ( ) { return length ; } | org . junit . Assert . assertEquals ( ( ( ( io . hops . erasure_coding . TestErasureCodingManager . TEST_STRIPE_COUNT ) * ( io . hops . erasure_coding . TestErasureCodingManager . TEST_PARITY_LENGTH ) ) * ( DFS_TEST_BLOCK_SIZE ) ) , parityStatus . getLen ( ) ) |
testFirst ( ) { java . lang . String template = "<first(names)>" ; org . stringtemplate . v4 . org . stringtemplate . v4 . ST st = new org . stringtemplate . v4 . ST ( template ) ; java . util . List < java . lang . String > names = new java . util . ArrayList < java . lang . String > ( ) { { add ( "Ter" ) ; add ( "Tom" ) ; } } ; st . add ( "names" , names ) ; java . lang . String expected = "Ter" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
defaultUseFallbackRepositories ( ) { org . ops4j . util . property . PropertyResolver propertyResolver = createMock ( org . ops4j . util . property . PropertyResolver . class ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.localRepository" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.settings" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.useFallbackRepositories" ) ) . andReturn ( null ) ; replay ( propertyResolver ) ; org . ops4j . pax . url . mvn . internal . config . MavenConfiguration config = new org . ops4j . pax . url . mvn . internal . config . MavenConfigurationImpl ( propertyResolver , org . ops4j . pax . url . mvn . internal . config . ConfigurationImplTest . PID ) ; "<AssertPlaceHolder>" ; verify ( propertyResolver ) ; } useFallbackRepositories ( ) { org . ops4j . util . property . PropertyResolver propertyResolver = createMock ( org . ops4j . util . property . PropertyResolver . class ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.localRepository" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.settings" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.useFallbackRepositories" ) ) . andReturn ( "true" ) ; replay ( propertyResolver ) ; org . ops4j . pax . url . mvn . internal . config . MavenConfiguration config = new org . ops4j . pax . url . mvn . internal . config . MavenConfigurationImpl ( propertyResolver , org . ops4j . pax . url . mvn . internal . config . ConfigurationImplTest . PID ) ; org . junit . Assert . assertEquals ( "Use<sp>Fallback<sp>Repositories" , true , config . useFallbackRepositories ( ) ) ; verify ( propertyResolver ) ; } | org . junit . Assert . assertEquals ( "Use<sp>Fallback<sp>Repositories" , true , config . useFallbackRepositories ( ) ) |
testCompositeComponentFacelets ( ) { com . gargoylesoftware . htmlunit . html . HtmlPage page = webClient . getPage ( ( ( webUrl ) + "faces/component.xhtml" ) ) ; java . lang . String pageAsXml = page . asXml ( ) ; int id11 = pageAsXml . indexOf ( "id1-1:component1" ) ; int id21 = pageAsXml . indexOf ( "id2-1:componentA" ) ; int id12 = pageAsXml . indexOf ( "id1-2:component1" ) ; int id13 = pageAsXml . indexOf ( "id1-3:component2" ) ; int id22 = pageAsXml . indexOf ( "id2-2:componentA" ) ; int id14 = pageAsXml . indexOf ( "id1-4:component2" ) ; "<AssertPlaceHolder>" ; } getPage ( java . lang . String ) { lastpage = ( ( com . gargoylesoftware . htmlunit . html . HtmlPage ) ( client . getPage ( getURL ( path ) ) ) ) ; if ( ( sessionId ) == null ) { parseSession ( lastpage ) ; } return lastpage ; } | org . junit . Assert . assertTrue ( ( ( ( ( ( ( id11 > ( - 1 ) ) && ( id21 > id11 ) ) && ( id12 > id21 ) ) && ( id13 > id12 ) ) && ( id22 > id13 ) ) && ( id14 > id22 ) ) ) |
testCapitalizeFirstLetterWithEmpty ( ) { "<AssertPlaceHolder>" ; } capitalizeFirstLetter ( java . lang . String ) { if ( au . gov . ga . worldwind . common . util . Util . isBlank ( s ) ) { return s ; } return ( s . substring ( 0 , 1 ) . toUpperCase ( ) ) + ( s . substring ( 1 ) ) ; } | org . junit . Assert . assertEquals ( "" , au . gov . ga . worldwind . common . util . Util . capitalizeFirstLetter ( "" ) ) |
testCreateMetaFileWithBadName ( ) { org . json . JSONObject jsonObject = new org . json . JSONObject ( ) ; jsonObject . put ( "int" , 1 ) ; java . io . File parent = getTempDir ( ) ; java . lang . String name = "this//is//bad" ; "<AssertPlaceHolder>" ; } createMetaFile ( java . io . File , java . lang . String , org . json . JSONObject ) { try { if ( org . eclipse . orion . internal . server . core . metastore . SimpleMetaStoreUtil . isMetaFile ( parent , name ) ) { java . io . File savedFile = org . eclipse . orion . internal . server . core . metastore . SimpleMetaStoreUtil . retrieveMetaFile ( parent , name ) ; throw new java . lang . RuntimeException ( ( ( "Meta<sp>File<sp>Error,<sp>file<sp>" + ( savedFile . toString ( ) ) ) + "<sp>already<sp>exists,<sp>use<sp>update" ) ) ; } if ( ! ( parent . exists ( ) ) ) { throw new java . lang . RuntimeException ( "Meta<sp>File<sp>Error,<sp>parent<sp>folder<sp>does<sp>not<sp>exist" ) ; } if ( ! ( parent . isDirectory ( ) ) ) { throw new java . lang . RuntimeException ( "Meta<sp>File<sp>Error,<sp>parent<sp>is<sp>not<sp>a<sp>folder" ) ; } java . io . File newFile = org . eclipse . orion . internal . server . core . metastore . SimpleMetaStoreUtil . retrieveMetaFile ( parent , name ) ; java . io . FileOutputStream fileOutputStream = new java . io . FileOutputStream ( newFile ) ; java . nio . charset . Charset utf8 = java . nio . charset . Charset . forName ( "<sp>already<sp>exists,<sp>use<sp>update" 1 ) ; java . io . OutputStreamWriter outputStreamWriter = new java . io . OutputStreamWriter ( fileOutputStream , utf8 ) ; outputStreamWriter . write ( jsonObject . toString ( 4 ) ) ; outputStreamWriter . write ( "\n" ) ; outputStreamWriter . flush ( ) ; outputStreamWriter . close ( ) ; fileOutputStream . close ( ) ; } catch ( java . io . FileNotFoundException e ) { org . slf4j . Logger logger = org . slf4j . LoggerFactory . getLogger ( "<sp>already<sp>exists,<sp>use<sp>update" 2 ) ; logger . error ( ( ( ( "Meta<sp>File<sp>Error,<sp>cannot<sp>create<sp>file<sp>under<sp>" + ( parent . toString ( ) ) ) + ":<sp>invalid<sp>file<sp>name:<sp>" ) + name ) ) ; return false ; } catch ( java . io . IOException e ) { org . slf4j . Logger logger = org . slf4j . LoggerFactory . getLogger ( "<sp>already<sp>exists,<sp>use<sp>update" 2 ) ; logger . error ( "<sp>already<sp>exists,<sp>use<sp>update" 0 , e ) ; throw new java . lang . RuntimeException ( "<sp>already<sp>exists,<sp>use<sp>update" 0 , e ) ; } catch ( org . json . JSONException e ) { org . slf4j . Logger logger = org . slf4j . LoggerFactory . getLogger ( "<sp>already<sp>exists,<sp>use<sp>update" 2 ) ; logger . error ( ( ( ( ( ( ( "Meta<sp>File<sp>Error,<sp>cannot<sp>create<sp>JSON<sp>file<sp>" + ( parent . toString ( ) ) ) + ( java . io . File . separator ) ) + name ) + ( org . eclipse . orion . internal . server . core . metastore . SimpleMetaStoreUtil . METAFILE_EXTENSION ) ) + "<sp>from<sp>disk,<sp>reason:<sp>" ) + ( e . getLocalizedMessage ( ) ) ) ) ; throw new java . lang . RuntimeException ( "Meta<sp>File<sp>Error,<sp>JSON<sp>error" , e ) ; } return true ; } | org . junit . Assert . assertFalse ( org . eclipse . orion . internal . server . core . metastore . SimpleMetaStoreUtil . createMetaFile ( parent , name , jsonObject ) ) |
testReturnsCorrectBeforeAndAfterContext ( ) { org . apache . storm . utils . Utils prevUtils = null ; try { org . apache . storm . utils . Utils mockedUtil = mock ( org . apache . storm . utils . Utils . class ) ; prevUtils = org . apache . storm . utils . Utils . setInstance ( mockedUtil ) ; when ( mockedUtil . hostname ( ) ) . thenReturn ( expectedHost ) ; final java . io . File file = new java . io . File ( java . lang . String . join ( File . separator , "src" , "test" , "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 4 ) , "logviewer-search-context-tests.log.test" ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap ( ) ; expected . put ( "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 7 , "no" ) ; expected . put ( "searchString" , pattern ) ; expected . put ( "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 6 , 0 ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > matches = new java . util . ArrayList ( ) ; matches . add ( buildMatchData ( 0 , "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 0 , "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" , pattern , ( ( ( ( ( "/api/v1/log?file=test" + ( encodedFileSeparator ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 4 ) + ( encodedFileSeparator ( ) ) ) + ( file . getName ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 3 ) ) ) ; matches . add ( buildMatchData ( 7 , "needle<sp>" , "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>needle\n" , pattern , ( ( ( ( ( "/api/v1/log?file=test" + ( encodedFileSeparator ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 4 ) + ( encodedFileSeparator ( ) ) ) + ( file . getName ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 3 ) ) ) ; matches . add ( buildMatchData ( 127 , "needle<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" , "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 1 , pattern , ( ( ( ( ( "/api/v1/log?file=test" + ( encodedFileSeparator ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 4 ) + ( encodedFileSeparator ( ) ) ) + ( file . getName ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 3 ) ) ) ; matches . add ( buildMatchData ( 134 , "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" , "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 2 , pattern , ( ( ( ( ( "/api/v1/log?file=test" + ( encodedFileSeparator ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 4 ) + ( encodedFileSeparator ( ) ) ) + ( file . getName ( ) ) ) + "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 3 ) ) ) ; expected . put ( "<sp>needle000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000needle<sp>" 5 , matches ) ; org . apache . storm . daemon . logviewer . handler . LogviewerLogSearchHandler handler = org . apache . storm . daemon . logviewer . handler . LogviewerLogSearchHandlerTest . getSearchHandlerWithPort ( expectedPort ) ; java . util . Map < java . lang . String , java . lang . Object > searchResult = handler . substringSearch ( file . toPath ( ) , pattern ) ; "<AssertPlaceHolder>" ; } finally { org . apache . storm . utils . Utils . setInstance ( prevUtils ) ; } } substringSearch ( java . nio . file . Path , java . lang . String ) { return substringSearch ( file , searchString , false , 10 , 0 ) ; } | org . junit . Assert . assertEquals ( expected , searchResult ) |
testGetWaitersNotWaiting ( ) { java . util . List < com . sun . sgs . impl . util . lock . LockRequest < java . lang . String > > waiters = lockManager . getOwners ( "unknownLock" ) ; "<AssertPlaceHolder>" ; } getOwners ( K ) { java . util . Map < K , com . sun . sgs . impl . util . lock . Lock < K > > keyMap = getKeyMap ( key ) ; assert noteKeySync ( key ) ; try { synchronized ( keyMap ) { return getLock ( key , keyMap ) . copyOwners ( this ) ; } } finally { assert noteKeyUnsync ( key ) ; } } | org . junit . Assert . assertEquals ( java . util . Collections . emptyList ( ) , waiters ) |
testTestBitPositive1 ( ) { byte [ ] aBytes = new byte [ ] { - 1 , - 128 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 3 , - 15 , 35 , 26 } ; int aSign = 1 ; int number = 7 ; java . math . BigInteger aNumber = new java . math . BigInteger ( aSign , aBytes ) ; "<AssertPlaceHolder>" ; } testBit ( int ) { if ( n == 0 ) { return ( ( digits [ 0 ] ) & 1 ) != 0 ; } if ( n < 0 ) { throw new java . lang . ArithmeticException ( "Negative<sp>bit<sp>address" ) ; } int intCount = n > > 5 ; if ( intCount >= ( numberLength ) ) { return ( sign ) < 0 ; } int digit = digits [ intCount ] ; n = 1 << ( n & 31 ) ; if ( ( sign ) < 0 ) { int firstNonZeroDigit = getFirstNonzeroDigit ( ) ; if ( intCount < firstNonZeroDigit ) { return false ; } else if ( firstNonZeroDigit == intCount ) { digit = - digit ; } else { digit = ~ digit ; } } return ( digit & n ) != 0 ; } | org . junit . Assert . assertTrue ( ( ! ( aNumber . testBit ( number ) ) ) ) |
testSerialization ( ) { org . jfree . chart . labels . ItemLabelPosition p1 = new org . jfree . chart . labels . ItemLabelPosition ( ) ; org . jfree . chart . labels . ItemLabelPosition p2 = ( ( org . jfree . chart . labels . ItemLabelPosition ) ( org . jfree . chart . TestUtils . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( p1 , p2 ) |
testException02 ( ) { java . lang . String source = "func($f1,<sp>$f2)" ; com . ebay . cloud . cms . expression . IExpression expr = getEngine ( ) . compile ( source ) ; com . ebay . cloud . cms . expression . entity . SampleEntity entity = new com . ebay . cloud . cms . expression . entity . SampleEntity ( ) ; entity . addFieldValue ( "f1" , new java . lang . String ( "abc" ) ) ; entity . addFieldValue ( "f3" , new java . lang . String ( "abc" ) ) ; com . ebay . cloud . cms . expression . IExpressionContext context = new com . ebay . cloud . cms . expression . entity . SampleEntityExpressionContext ( entity ) ; java . lang . Object result = getEngine ( ) . evaluate ( expr , context ) ; "<AssertPlaceHolder>" ; } evaluate ( com . ebay . cloud . cms . dal . search . impl . criteria . FieldSearchCriteria , java . util . List ) { java . util . List < java . lang . Object > criteriaValueList = criteria . getValueList ( ) ; boolean evalRes = false ; com . ebay . cloud . cms . dal . search . impl . criteria . FieldSearchCriteria . FieldOperatorEnum op = criteria . getOperator ( ) ; switch ( op ) { case IN : evalRes = evalIn ( fieldValues , criteriaValueList ) ; break ; case NIN : evalRes = evalNotIn ( fieldValues , criteriaValueList ) ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Unsupport<sp>comparision<sp>operator:<sp>" + op ) ) ; } return evalRes ; } | org . junit . Assert . assertEquals ( true , result ) |
testLastSpdyHeadersFrame ( ) { short type = 8 ; byte flags = 1 ; int length = 4 ; int streamId = ( ( io . netty . handler . codec . spdy . SpdyFrameDecoderTest . RANDOM . nextInt ( ) ) & 2147483647 ) | 1 ; io . netty . buffer . ByteBuf buf = io . netty . buffer . Unpooled . buffer ( ( ( io . netty . handler . codec . spdy . SpdyCodecUtil . SPDY_HEADER_SIZE ) + length ) ) ; io . netty . handler . codec . spdy . SpdyFrameDecoderTest . encodeControlFrameHeader ( buf , type , flags , length ) ; buf . writeInt ( streamId ) ; decoder . decode ( buf ) ; verify ( delegate ) . readHeadersFrame ( streamId , true ) ; verify ( delegate ) . readHeaderBlockEnd ( ) ; "<AssertPlaceHolder>" ; buf . release ( ) ; } isReadable ( ) { return ( writerIndex ) > ( readerIndex ) ; } | org . junit . Assert . assertFalse ( buf . isReadable ( ) ) |
testGetImageName ( ) { parameters . put ( PropertyHandler . IMAGE_NAME , new org . oscm . app . v2_0 . data . Setting ( PropertyHandler . IMAGE_NAME , "Image1" ) ) ; propertyHandler = new org . oscm . app . aws . controller . PropertyHandler ( settings ) ; "<AssertPlaceHolder>" ; } getImageName ( ) { return getValue ( org . oscm . app . aws . controller . PropertyHandler . IMAGE_NAME , settings . getParameters ( ) ) ; } | org . junit . Assert . assertEquals ( "Image1" , propertyHandler . getImageName ( ) ) |
sendFeedback ( ) { java . util . List < fi . helsinki . cs . tmc . core . domain . submission . FeedbackAnswer > answers = null ; java . net . URI feedbackUri = new java . net . URI ( "www.abc.org" ) ; when ( mockCore . sendFeedback ( any ( fi . helsinki . cs . tmc . core . domain . ProgressObserver . class ) , eq ( answers ) , eq ( feedbackUri ) ) ) . thenReturn ( createReturningCallback ( true ) ) ; "<AssertPlaceHolder>" ; } sendFeedback ( fi . helsinki . cs . tmc . cli . core . CliContext , java . util . List , java . net . URI ) { try { fi . helsinki . cs . tmc . core . TmcCore core = ctx . getTmcCore ( ) ; return core . sendFeedback ( ProgressObserver . NULL_OBSERVER , answers , feedbackUri ) . call ( ) ; } catch ( java . lang . Exception e ) { fi . helsinki . cs . tmc . cli . backend . TmcUtil . handleTmcExceptions ( ctx , e ) ; fi . helsinki . cs . tmc . cli . backend . TmcUtil . logger . error ( "Couldn't<sp>send<sp>feedback" , e ) ; return false ; } } | org . junit . Assert . assertTrue ( fi . helsinki . cs . tmc . cli . backend . TmcUtil . sendFeedback ( ctx , answers , feedbackUri ) ) |
write_and_get ( ) { java . lang . String text = "this<sp>is<sp>some<sp>long<sp>text<sp>that<sp>should<sp>be<sp>saved<sp>and<sp>loaded" ; infoTextManager . setNewsText ( text ) ; "<AssertPlaceHolder>" ; } getNewsText ( ) { try { return com . google . common . io . Files . toString ( new java . io . File ( fi . om . initiative . service . InfoTextManager . NEWS_FILE ) , java . nio . charset . Charset . forName ( "UTF-8" ) ) ; } catch ( java . io . FileNotFoundException e ) { return "" ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertThat ( infoTextManager . getNewsText ( ) , org . hamcrest . core . Is . is ( text ) ) |
testBerichtMetExceptieInStap2 ( ) { nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht bericht = maakNieuwBericht ( new nl . bzk . brp . model . logisch . BRPActie ( ) ) ; bericht . getBrpActies ( ) . get ( 0 ) . voegRootObjectToe ( new nl . bzk . brp . model . logisch . Persoon ( ) ) ; org . mockito . Mockito . doThrow ( new java . lang . IllegalStateException ( "Test" ) ) . when ( stap2 ) . voerVerwerkingsStapUitVoorBericht ( org . mockito . Mockito . any ( nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtContext . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtResultaat . class ) ) ; nl . bzk . brp . business . dto . BerichtResultaat resultaat = berichtVerwerker . verwerkBericht ( bericht , bouwBerichtContext ( ) ) ; org . mockito . Mockito . verify ( stap1 ) . voerVerwerkingsStapUitVoorBericht ( org . mockito . Mockito . any ( nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtContext . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtResultaat . class ) ) ; org . mockito . Mockito . verify ( stap2 ) . voerVerwerkingsStapUitVoorBericht ( org . mockito . Mockito . any ( nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtContext . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtResultaat . class ) ) ; org . mockito . Mockito . verify ( stap3 , org . mockito . Mockito . never ( ) ) . voerVerwerkingsStapUitVoorBericht ( org . mockito . Mockito . any ( nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtContext . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtResultaat . class ) ) ; "<AssertPlaceHolder>" ; org . mockito . InOrder naverwerkingVolgorde = org . mockito . Mockito . inOrder ( stap1 , stap2 , stap3 ) ; naverwerkingVolgorde . verify ( stap3 , org . mockito . Mockito . never ( ) ) . naVerwerkingsStapVoorBericht ( org . mockito . Mockito . any ( nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtContext . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtResultaat . class ) ) ; naverwerkingVolgorde . verify ( stap2 ) . naVerwerkingsStapVoorBericht ( org . mockito . Mockito . any ( nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtContext . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtResultaat . class ) ) ; naverwerkingVolgorde . verify ( stap1 ) . naVerwerkingsStapVoorBericht ( org . mockito . Mockito . any ( nl . bzk . brp . business . dto . bijhouding . BijhoudingsBericht . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtContext . class ) , org . mockito . Mockito . any ( nl . bzk . brp . business . dto . BerichtResultaat . class ) ) ; } getMeldingen ( ) { return java . util . Collections . unmodifiableSet ( meldingen ) ; } | org . junit . Assert . assertFalse ( resultaat . getMeldingen ( ) . isEmpty ( ) ) |
readFullyTooShortThrows ( ) { sink . writeUtf8 ( "Hi" ) ; sink . emit ( ) ; okio . Buffer sink = new okio . Buffer ( ) ; try { source . readFully ( sink , 5 ) ; org . junit . Assert . fail ( ) ; } catch ( java . io . EOFException ignored ) { } "<AssertPlaceHolder>" ; } readUtf8 ( ) { buffer . write ( decode ) ; return buffer . readUtf8 ( ) ; } | org . junit . Assert . assertEquals ( "Hi" , sink . readUtf8 ( ) ) |
validateLostPasswordHashUsingBadDataExpectFail ( ) { net . jforum . repository . UserRepository dao = this . newDao ( ) ; net . jforum . entities . User user = dao . validateLostPasswordHash ( "bad<sp>username" , "bad<sp>hash" ) ; "<AssertPlaceHolder>" ; } validateLostPasswordHash ( java . lang . String , java . lang . String ) { return ( ( net . jforum . entities . User ) ( session . createCriteria ( this . persistClass ) . add ( org . hibernate . criterion . Restrictions . eq ( "activationKey" , hash ) ) . add ( org . hibernate . criterion . Restrictions . eq ( "username" , username ) ) . uniqueResult ( ) ) ) ; } | org . junit . Assert . assertNull ( user ) |
testOnPlayerInteractFarmlandPermission ( ) { when ( player . hasPermission ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( true ) ; when ( clickedBlock . getType ( ) ) . thenReturn ( Material . FARMLAND ) ; org . bukkit . event . player . PlayerInteractEvent e = new org . bukkit . event . player . PlayerInteractEvent ( player , org . bukkit . event . block . Action . PHYSICAL , item , clickedBlock , org . bukkit . block . BlockFace . UP ) ; world . bentobox . bentobox . listeners . flags . protection . PhysicalInteractionListener i = new world . bentobox . bentobox . listeners . flags . protection . PhysicalInteractionListener ( ) ; i . onPlayerInteract ( e ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return cancelled ; } | org . junit . Assert . assertFalse ( e . isCancelled ( ) ) |
testFilterCollection ( ) { java . util . List < org . gradoop . common . model . impl . pojo . Vertex > result = getExecutionEnvironment ( ) . fromCollection ( inputVertices ) . filter ( new org . gradoop . flink . model . impl . functions . epgm . LabelIsIn ( java . util . Arrays . asList ( "a" , "b" , "a" , null ) ) ) . collect ( ) ; result . sort ( comparator ) ; "<AssertPlaceHolder>" ; } getExecutionEnvironment ( ) { return env ; } | org . junit . Assert . assertArrayEquals ( expected . toArray ( ) , result . toArray ( ) ) |
testWidgetTypeExport ( ) { org . nuxeo . ecm . platform . forms . layout . api . WidgetTypeDefinition wTypeDef = service . getWidgetTypeDefinition ( WebLayoutManager . JSF_CATEGORY , "test" ) ; "<AssertPlaceHolder>" ; java . io . File file = org . nuxeo . runtime . api . Framework . createTempFile ( "widgettype-export" , ".json" ) ; java . io . FileOutputStream out = new java . io . FileOutputStream ( file ) ; org . nuxeo . ecm . platform . forms . layout . io . JSONLayoutExporter . export ( wTypeDef , out ) ; try ( java . io . InputStream written = new java . io . FileInputStream ( file ) ; java . io . InputStream expected = new java . io . FileInputStream ( org . nuxeo . common . utils . FileUtils . getResourcePathFromContext ( "widgettype-export.json" ) ) ) { checkEquals ( expected , written ) ; } } getWidgetTypeDefinition ( java . lang . String , java . lang . String ) { org . nuxeo . ecm . platform . forms . layout . core . registries . WidgetTypeDefinitionRegistry reg = widgetTypeDefsByCat . get ( category ) ; if ( reg != null ) { return reg . getDefinition ( typeName ) ; } return null ; } | org . junit . Assert . assertNotNull ( wTypeDef ) |
testContextOnShutdownFromBackgroundThread ( ) { final java . util . concurrent . atomic . AtomicBoolean hasContext = new java . util . concurrent . atomic . AtomicBoolean ( ) ; getApplicationContext ( ) . getLifeCycleFactory ( ) . deactivate ( ) ; getApplicationContext ( ) . getLifeCycleFactory ( ) . activate ( ) ; org . eclipse . rap . rwt . internal . lifecycle . SimpleLifeCycle_Test . registerEntryPoint ( org . eclipse . rap . rwt . internal . lifecycle . SimpleLifeCycle_Test . TestEntryPoint . class ) ; final org . eclipse . rap . rwt . internal . service . UISessionImpl uiSession = ( ( org . eclipse . rap . rwt . internal . service . UISessionImpl ) ( org . eclipse . rap . rwt . RWT . getUISession ( ) ) ) ; uiSession . addUISessionListener ( new org . eclipse . rap . rwt . service . UISessionListener ( ) { @ org . eclipse . rap . rwt . internal . lifecycle . Override public void beforeDestroy ( org . eclipse . rap . rwt . service . UISessionEvent event ) { hasContext . set ( org . eclipse . rap . rwt . internal . service . ContextProvider . hasContext ( ) ) ; } } ) ; getApplicationContext ( ) . getLifeCycleFactory ( ) . getLifeCycle ( ) . execute ( ) ; java . lang . Thread thread = new java . lang . Thread ( new java . lang . Runnable ( ) { @ org . eclipse . rap . rwt . internal . lifecycle . Override public void run ( ) { uiSession . getShutdownAdapter ( ) . interceptShutdown ( ) ; uiSession . setShutdownAdapter ( null ) ; } } ) ; thread . setDaemon ( true ) ; thread . start ( ) ; thread . join ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return RWT . NLS . getISO8859_1Encoded ( org . eclipse . ui . internal . cheatsheets . Messages . BUNDLE_NAME , org . eclipse . ui . internal . cheatsheets . Messages . class ) ; } | org . junit . Assert . assertTrue ( hasContext . get ( ) ) |
testRemoveRequiredProductsWithNullValue ( ) { org . candlepin . dto . manifest . v1 . ContentDTO dto = new org . candlepin . dto . manifest . v1 . ContentDTO ( ) ; dto . setRequiredProductIds ( java . util . Arrays . asList ( "1" , "2" ) ) ; "<AssertPlaceHolder>" ; dto . removeRequiredProductId ( null ) ; } getRequiredProductIds ( ) { return ( this . requiredProductIds ) != null ? new org . candlepin . util . SetView ( this . requiredProductIds ) : null ; } | org . junit . Assert . assertEquals ( new java . util . HashSet ( java . util . Arrays . asList ( "1" , "2" ) ) , dto . getRequiredProductIds ( ) ) |
shouldApplyFallbackToAnyException ( ) { com . google . common . util . concurrent . AsyncFunction < java . lang . Throwable , java . lang . String > function = new com . google . common . util . concurrent . AsyncFunction < java . lang . Throwable , java . lang . String > ( ) { @ com . spotify . trickle . Override public com . google . common . util . concurrent . ListenableFuture < java . lang . String > apply ( java . lang . Throwable input ) throws com . spotify . trickle . Exception { return immediateFuture ( "all<sp>is<sp>well,<sp>nothing<sp>to<sp>see<sp>here" ) ; } } ; when ( graphBuilder . getFallback ( ) ) . thenReturn ( com . google . common . base . Optional . of ( function ) ) ; java . lang . Throwable expected = new com . spotify . trickle . GraphExecutionException ( null , currentCallInfo , com . spotify . trickle . NodeExecutionFallbackTest . NO_CALLS ) ; com . google . common . util . concurrent . ListenableFuture < java . lang . String > future = fallback . create ( expected ) ; "<AssertPlaceHolder>" ; } create ( java . lang . Throwable ) { if ( graph . getFallback ( ) . isPresent ( ) ) { try { return graph . getFallback ( ) . get ( ) . apply ( t ) ; } catch ( java . lang . Exception e ) { return immediateFailedFuture ( wrapIfNeeded ( e ) ) ; } } return immediateFailedFuture ( wrapIfNeeded ( t ) ) ; } | org . junit . Assert . assertThat ( future . get ( ) , org . hamcrest . CoreMatchers . equalTo ( "all<sp>is<sp>well,<sp>nothing<sp>to<sp>see<sp>here" ) ) |
invocationWithArgumentsToFunctionWithoutInputs ( ) { fr . inria . lille . commons . synthesis . expression . Expression < ? > output = new fr . inria . lille . commons . synthesis . expression . Expression ( fr . inria . lille . commons . synthesis . smt . constraint . Short . class , "a" ) ; fr . inria . lille . commons . synthesis . smt . locationVariables . LocationVariableContainer containerWithoutOperands = new fr . inria . lille . commons . synthesis . smt . locationVariables . LocationVariableContainer ( ( ( java . util . List ) ( asList ( ) ) ) , ( ( java . util . List ) ( asList ( ) ) ) , output ) ; fr . inria . lille . commons . synthesis . smt . constraint . Constraint verification = new fr . inria . lille . commons . synthesis . smt . constraint . VerificationConstraint ( fr . inria . lille . commons . synthesis . smt . SMTLib . smtlib ( ) ) ; org . smtlib . IExpr actualInvocation = verification . invocation ( containerWithoutOperands ) ; org . smtlib . IExpr smtInvocation = fr . inria . lille . commons . synthesis . smt . SMTLibParser . expressionFrom ( java . lang . String . format ( "(%s<sp>L@out<sp>out)" , verification . nameSymbol ( ) ) ) ; "<AssertPlaceHolder>" ; } areEquals ( fr . inria . lille . commons . synthesis . smt . IAccept , fr . inria . lille . commons . synthesis . smt . IAccept ) { boolean areEquals = false ; try { fr . inria . lille . commons . synthesis . smt . SMTLibEqualVisitor visitor = new fr . inria . lille . commons . synthesis . smt . SMTLibEqualVisitor ( expected ) ; areEquals = visitor . sortComparison ( expected , actual ) ; if ( actual . getClass ( ) . isAssignableFrom ( expected . getClass ( ) ) ) { areEquals = actual . accept ( visitor ) ; } } catch ( java . lang . AssertionError ae ) { } catch ( fr . inria . lille . commons . synthesis . smt . VisitorException ve ) { ve . printStackTrace ( ) ; } return areEquals ; } | org . junit . Assert . assertTrue ( fr . inria . lille . commons . synthesis . smt . SMTLibEqualVisitor . areEquals ( actualInvocation , smtInvocation ) ) |
makeDomainSuccess ( ) { final com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceAuthentication amqpsDeviceAuthentication = mockit . Deencapsulation . newInstance ( com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceAuthentication . class , mockDeviceClientConfig ) ; new mockit . NonStrictExpectations ( ) { { mockProton . sslDomain ( ) ; result = mockDomain ; } } ; org . apache . qpid . proton . engine . SslDomain actualDomain = mockit . Deencapsulation . invoke ( amqpsDeviceAuthentication , "makeDomain" , mockSSLContext ) ; "<AssertPlaceHolder>" ; new mockit . Verifications ( ) { { mockit . Deencapsulation . invoke ( mockProton , "sslDomain" ) ; times = 1 ; mockDomain . setSslContext ( mockSSLContext ) ; times = 1 ; mockDomain . setPeerAuthentication ( SslDomain . VerifyMode . VERIFY_PEER ) ; times = 1 ; mockDomain . init ( SslDomain . Mode . CLIENT ) ; times = 1 ; } } ; } | org . junit . Assert . assertEquals ( mockDomain , actualDomain ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.