input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testGetProtocolLocation ( ) { java . lang . String result = org . eclipse . rdf4j . http . protocol . Protocol . getProtocolLocation ( org . eclipse . rdf4j . http . protocol . ProtocolTest . serverLocation ) ; "<AssertPlaceHolder>" ; } getProtocolLocation ( java . lang . String ) { return ( org . eclipse . rdf4j . http . protocol . Protocol . getServerDir ( serverLocation ) ) + ( org . eclipse . rdf4j . http . protocol . Protocol . PROTOCOL ) ; } | org . junit . Assert . assertEquals ( result , ( ( ( org . eclipse . rdf4j . http . protocol . ProtocolTest . serverLocation ) + "/" ) + ( org . eclipse . rdf4j . http . protocol . Protocol . PROTOCOL ) ) ) |
testMysqlLoader ( ) { com . mchange . v2 . c3p0 . ComboPooledDataSource ds = new com . mchange . v2 . c3p0 . ComboPooledDataSource ( ) ; ds . setJdbcUrl ( "jdbc:mysql://localhost:3306/nd4j?user=nd4j&password=nd4j" ) ; org . nd4j . jdbc . mysql . MysqlLoader loader = new org . nd4j . jdbc . mysql . MysqlLoader ( ds , "jdbc:mysql://localhost:3306/nd4j?user=nd4j&password=nd4j" , "ndarrays" , "array" ) ; loader . delete ( "1" ) ; org . nd4j . linalg . api . ndarray . INDArray load = loader . load ( loader . loadForID ( "1" ) ) ; if ( load != null ) { loader . delete ( "1" ) ; } loader . save ( org . nd4j . linalg . factory . Nd4j . create ( new float [ ] { 1 , 2 , 3 } ) , "1" ) ; java . sql . Blob b = loader . loadForID ( "1" ) ; org . nd4j . linalg . api . ndarray . INDArray loaded = loader . load ( b ) ; "<AssertPlaceHolder>" ; } create ( float [ ] , int [ ] , long ) { shape = org . nd4j . linalg . factory . Nd4j . getEnsuredShape ( shape ) ; if ( ( shape . length ) == 1 ) { if ( ( shape [ 0 ] ) == ( data . length ) ) { shape = new int [ ] { 1 , data . length } ; } else throw new org . nd4j . linalg . exception . ND4JIllegalStateException ( ( ( ( "Shape<sp>of<sp>the<sp>new<sp>array<sp>" + ( org . nd4j . linalg . factory . Arrays . toString ( shape ) ) ) + "<sp>doesn't<sp>match<sp>data<sp>length:<sp>" ) + ( data . length ) ) ) ; } org . nd4j . linalg . factory . Nd4j . checkShapeValues ( data . length , shape ) ; org . nd4j . linalg . factory . INDArray ret = org . nd4j . linalg . factory . Nd4j . INSTANCE . create ( data , shape , offset , org . nd4j . linalg . factory . Nd4j . order ( ) ) ; org . nd4j . linalg . factory . Nd4j . logCreationIfNecessary ( ret ) ; return ret ; } | org . junit . Assert . assertEquals ( org . nd4j . linalg . factory . Nd4j . create ( new float [ ] { 1 , 2 , 3 } ) , loaded ) |
testEmpty ( ) { java . nio . ByteBuffer bb = java . nio . ByteBuffer . allocate ( 0 ) ; java . io . InputStream is = new org . apache . mina . util . ByteBufferInputStream ( bb ) ; "<AssertPlaceHolder>" ; is . close ( ) ; } read ( ) { return hasRemaining ( ) ? ( get ( ) ) & ( org . apache . mina . codec . IoBuffer . BYTE_MASK ) : - 1 ; } | org . junit . Assert . assertEquals ( ( - 1 ) , is . read ( ) ) |
testIsCollapsedWhenArrowIsARightArrow ( ) { final elemental2 . dom . DOMTokenList classList = mock ( elemental2 . dom . DOMTokenList . class ) ; final elemental2 . dom . HTMLElement arrow = mock ( elemental2 . dom . HTMLElement . class ) ; arrow . classList = classList ; when ( classList . contains ( org . kie . workbench . common . dmn . client . editors . types . listview . RIGHT_ARROW_CSS_CLASS ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } isCollapsed ( elemental2 . dom . Element ) { return isRightArrow ( arrow ) ; } | org . junit . Assert . assertTrue ( view . isCollapsed ( arrow ) ) |
modifyAttributes_2 ( ) { com . ibm . ws . security . wim . adapter . ldap . context . TimedDirContext ctx = null ; try { ctx = new com . ibm . ws . security . wim . adapter . ldap . context . TimedDirContext ( getEnvironment ( ) , null , 0 ) ; javax . naming . directory . Attributes attrs = new javax . naming . directory . BasicAttributes ( ) ; attrs . put ( new javax . naming . directory . BasicAttribute ( "employeeType" , "new<sp>employee<sp>type" ) ) ; org . apache . directory . api . ldap . model . entry . Entry user = com . ibm . ws . security . wim . adapter . ldap . context . TimedDirContextTest . ldapServer . lookup ( com . ibm . ws . security . wim . adapter . ldap . context . TimedDirContextTest . USER_1_DN ) ; "<AssertPlaceHolder>" ; } finally { if ( ctx != null ) { ctx . close ( ) ; } } } get ( java . lang . String ) { return meters . get ( key ) ; } | org . junit . Assert . assertEquals ( "new<sp>employee<sp>type" , user . get ( "employeeType" ) . get ( ) . toString ( ) ) |
testSetScaleMode ( ) { scanner . setScaleMode ( BarcodeScanner . ScaleMode . FILL ) ; "<AssertPlaceHolder>" ; } getScaleMode ( ) { checkWidget ( ) ; return scaleMode ; } | org . junit . Assert . assertEquals ( BarcodeScanner . ScaleMode . FILL , scanner . getScaleMode ( ) ) |
testGetVacanciesByName ( ) { java . lang . String name1 = "alpha" ; java . lang . String name2 = "charlie" ; org . oscarehr . PMmodule . model . Vacancy vacancy1 = new org . oscarehr . PMmodule . model . Vacancy ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( vacancy1 ) ; vacancy1 . setName ( name1 ) ; dao . persist ( vacancy1 ) ; org . oscarehr . PMmodule . model . Vacancy vacancy2 = new org . oscarehr . PMmodule . model . Vacancy ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( vacancy2 ) ; vacancy2 . setName ( name2 ) ; dao . persist ( vacancy2 ) ; org . oscarehr . PMmodule . model . Vacancy vacancy3 = new org . oscarehr . PMmodule . model . Vacancy ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( vacancy3 ) ; vacancy3 . setName ( name1 ) ; dao . persist ( vacancy3 ) ; org . oscarehr . PMmodule . model . Vacancy vacancy4 = new org . oscarehr . PMmodule . model . Vacancy ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( vacancy4 ) ; vacancy4 . setName ( name2 ) ; dao . persist ( vacancy4 ) ; org . oscarehr . PMmodule . model . Vacancy vacancy5 = new org . oscarehr . PMmodule . model . Vacancy ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( vacancy5 ) ; vacancy5 . setName ( name1 ) ; dao . persist ( vacancy5 ) ; java . util . List < org . oscarehr . PMmodule . model . Vacancy > expectedResult = new java . util . ArrayList < org . oscarehr . PMmodule . model . Vacancy > ( java . util . Arrays . asList ( vacancy1 , vacancy3 , vacancy5 ) ) ; java . util . List < org . oscarehr . PMmodule . model . Vacancy > result = dao . getVacanciesByName ( name1 ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } } | org . junit . Assert . assertTrue ( true ) |
shouldSapperDestroyMine_whenMineExistInGivenDirection ( ) { for ( com . codenjoy . dojo . minesweeper . model . Direction direction : com . codenjoy . dojo . minesweeper . model . Direction . values ( ) ) { board . useMineDetectorToGivenDirection ( direction ) ; boolean isMineInDirection = board . getMines ( ) . contains ( board . getCellPossiblePosition ( direction ) ) ; "<AssertPlaceHolder>" ; } } getCellPossiblePosition ( com . codenjoy . dojo . services . Direction ) { return direction . change ( sapper ( ) . copy ( ) ) ; } | org . junit . Assert . assertTrue ( ( ! isMineInDirection ) ) |
testBigDecConvertEmpty ( ) { org . apache . hadoop . mapreduce . lib . db . TextSplitter splitter = new org . apache . hadoop . mapreduce . lib . db . TextSplitter ( ) ; java . lang . String emptyStr = splitter . bigDecimalToString ( BigDecimal . ZERO ) ; "<AssertPlaceHolder>" ; } bigDecimalToString ( java . math . BigDecimal ) { java . math . BigDecimal cur = bd . stripTrailingZeros ( ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; for ( int numConverted = 0 ; numConverted < ( org . apache . hadoop . mapreduce . lib . db . TextSplitter . MAX_CHARS ) ; numConverted ++ ) { cur = cur . multiply ( org . apache . hadoop . mapreduce . lib . db . TextSplitter . ONE_PLACE ) ; int curCodePoint = cur . intValue ( ) ; if ( 0 == curCodePoint ) { break ; } cur = cur . subtract ( new java . math . BigDecimal ( curCodePoint ) ) ; sb . append ( java . lang . Character . toChars ( curCodePoint ) ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( "" , emptyStr ) |
testTransition2 ( ) { byte chr = 3 ; jannovar . exome . Variant v = new jannovar . exome . Variant ( chr , 13 , "A" , "T" , null , dummyPhred ) ; boolean b = v . isTransition ( ) ; "<AssertPlaceHolder>" ; } isTransition ( ) { if ( ! ( is_single_nucleotide_variant ( ) ) ) return false ; return false ; } | org . junit . Assert . assertEquals ( false , b ) |
shouldDoGetMaxIndexWithAddedElementsNumber ( ) { int addedElementsNumber = 1 ; int windowSize = 3 ; com . orange . dgil . trail . core . common . TrailPoint [ ] points = new com . orange . dgil . trail . core . common . TrailPoint [ windowSize ] ; com . orange . dgil . trail . TestTools . setObj ( "addedElementsNumber" , com . orange . dgil . trail . core . vecto . SlidingWindow . class , slidingWindow , addedElementsNumber ) ; com . orange . dgil . trail . TestTools . setObj ( "points" , com . orange . dgil . trail . core . vecto . SlidingWindow . class , slidingWindow , points ) ; org . mockito . Mockito . doCallRealMethod ( ) . when ( slidingWindow ) . getMaxIndex ( ) ; int ret = slidingWindow . getMaxIndex ( ) ; "<AssertPlaceHolder>" ; } getMaxIndex ( ) { return ( java . lang . Math . min ( addedElementsNumber , points . length ) ) - 1 ; } | org . junit . Assert . assertEquals ( 0 , ret ) |
doesNotMatchNonExistentComposedTerm ( ) { final com . hartwig . hmftools . patientdb . curators . TreatmentCurator curator = com . hartwig . hmftools . patientdb . curators . TestCuratorFactory . treatmentCurator ( ) ; final java . util . List < com . hartwig . hmftools . patientdb . data . CuratedDrug > curatedDrugs = curator . search ( "amlodipine<sp>phosphate" ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( maxheap . size ( ) ) + ( minheap . size ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , curatedDrugs . size ( ) ) |
whenArrayIndexIsCorrect_thenPerformOperation ( ) { int [ ] numbers = new int [ ] { 0 , 1 } ; numbers [ 1 ] += 5 ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 6 , numbers [ 1 ] ) |
getSoortVerbintenisNOkTest ( ) { final java . lang . String code = "X" ; final java . lang . String resultNat = lo3StamtabelService . getSoortVerbintenis ( code ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( code , resultNat ) |
testChildNamespaceModified ( ) { long childNamespaceId = 1 ; long parentNamespaceId = 2 ; com . ctrip . framework . apollo . biz . entity . Namespace childNamespace = createNamespace ( childNamespaceId ) ; com . ctrip . framework . apollo . biz . entity . Namespace parentNamespace = createNamespace ( parentNamespaceId ) ; com . ctrip . framework . apollo . biz . entity . Release childRelease = createRelease ( "{\"k1\":\"v1\",<sp>\"k2\":\"v2\"}" ) ; java . util . List < com . ctrip . framework . apollo . biz . entity . Item > childItems = java . util . Arrays . asList ( createItem ( "k1" , "v3" ) ) ; com . ctrip . framework . apollo . biz . entity . Release parentRelease = createRelease ( "{\"k1\":\"v1\",<sp>\"k2\":\"v2\"}" ) ; when ( releaseService . findLatestActiveRelease ( childNamespace ) ) . thenReturn ( childRelease ) ; when ( releaseService . findLatestActiveRelease ( parentNamespace ) ) . thenReturn ( parentRelease ) ; when ( itemService . findItemsWithoutOrdered ( childNamespaceId ) ) . thenReturn ( childItems ) ; when ( namespaceService . findParentNamespace ( childNamespace ) ) . thenReturn ( parentNamespace ) ; boolean isModified = namespaceUnlockAspect . isModified ( childNamespace ) ; "<AssertPlaceHolder>" ; } isModified ( com . ctrip . framework . apollo . biz . entity . Namespace ) { com . ctrip . framework . apollo . biz . entity . Release release = releaseService . findLatestActiveRelease ( namespace ) ; java . util . List < com . ctrip . framework . apollo . biz . entity . Item > items = itemService . findItemsWithoutOrdered ( namespace . getId ( ) ) ; if ( release == null ) { return hasNormalItems ( items ) ; } java . util . Map < java . lang . String , java . lang . String > releasedConfiguration = gson . fromJson ( release . getConfigurations ( ) , GsonType . CONFIG ) ; java . util . Map < java . lang . String , java . lang . String > configurationFromItems = generateConfigurationFromItems ( namespace , items ) ; com . google . common . collect . MapDifference < java . lang . String , java . lang . String > difference = com . google . common . collect . Maps . difference ( releasedConfiguration , configurationFromItems ) ; return ! ( difference . areEqual ( ) ) ; } | org . junit . Assert . assertTrue ( isModified ) |
testNullString ( ) { "<AssertPlaceHolder>" ; } isNumeric ( java . lang . String ) { return com . opera . core . systems . common . lang . OperaStrings . isDouble ( string ) ; } | org . junit . Assert . assertEquals ( false , com . opera . core . systems . common . lang . OperaStrings . isNumeric ( null ) ) |
testRangedAnd ( ) { int length = 1000 ; int NUM_ITER = 10 ; java . util . Random random = new java . util . Random ( 1234 ) ; for ( int test = 0 ; test < 50 ; ++ test ) { final org . roaringbitmap . RoaringBitmap rb1 = new org . roaringbitmap . RoaringBitmap ( ) ; final org . roaringbitmap . RoaringBitmap rb2 = new org . roaringbitmap . RoaringBitmap ( ) ; java . util . Set < java . lang . Integer > set1 = new java . util . HashSet ( ) ; java . util . Set < java . lang . Integer > set2 = new java . util . HashSet ( ) ; int numBitsToSet = length / 2 ; for ( int i = 0 ; i < numBitsToSet ; i ++ ) { int val1 = random . nextInt ( length ) ; int val2 = random . nextInt ( length ) ; rb1 . add ( val1 ) ; set1 . add ( val1 ) ; rb2 . add ( val2 ) ; set2 . add ( val2 ) ; } java . util . Set < java . lang . Integer > intersectionSet = new java . util . TreeSet ( set1 ) ; intersectionSet . retainAll ( set2 ) ; for ( int iter = 0 ; iter < NUM_ITER ; iter ++ ) { int rangeStart = random . nextInt ( ( length - 1 ) ) ; int rangeLength = ( random . nextInt ( ( length - rangeStart ) ) ) + 1 ; int rangeEnd = rangeStart + rangeLength ; java . util . Set < java . lang . Integer > expectedResultSet = new java . util . TreeSet ( ) ; for ( int i = rangeStart ; i < rangeEnd ; i ++ ) { if ( intersectionSet . contains ( i ) ) { expectedResultSet . add ( i ) ; } } java . util . List < org . roaringbitmap . RoaringBitmap > list = new java . util . ArrayList ( ) ; list . add ( rb1 ) ; list . add ( rb2 ) ; org . roaringbitmap . RoaringBitmap result = org . roaringbitmap . RoaringBitmap . and ( list . iterator ( ) , ( ( long ) ( rangeStart ) ) , ( ( long ) ( rangeEnd ) ) ) ; java . util . Set < java . lang . Integer > actualResultSet = new java . util . TreeSet ( ) ; org . roaringbitmap . IntIterator intIterator = result . getIntIterator ( ) ; while ( intIterator . hasNext ( ) ) { actualResultSet . add ( intIterator . next ( ) ) ; } "<AssertPlaceHolder>" ; } } } next ( ) { return iterator . next ( ) ; } | org . junit . Assert . assertEquals ( expectedResultSet , actualResultSet ) |
testIndent_1Level_MultiLine ( ) { java . lang . String expected = "\tmulti\n\tline\n\tstring" ; java . lang . String input = "multi\nline\nstring" ; java . lang . String actual = it . indent ( input ) ; "<AssertPlaceHolder>" ; } indent ( java . lang . String ) { if ( ( count ) > 0 ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "\n" ) ; sb . append ( getIndentation ( ) ) ; java . lang . StringBuilder r = new java . lang . StringBuilder ( ) ; r . append ( getIndentation ( ) ) ; r . append ( s . replaceAll ( "\n" , sb . toString ( ) ) ) ; return r . toString ( ) ; } else { return s ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
testCreateOfferId ( ) { com . google . api . ads . adwords . axis . v201809 . cm . ProductOfferId offerId = com . google . api . ads . adwords . axis . utils . v201809 . shopping . ProductDimensions . createOfferId ( com . google . api . ads . adwords . axis . utils . v201809 . shopping . ProductDimensionsTest . STRING_VALUE ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( com . google . api . ads . adwords . axis . utils . v201809 . shopping . ProductDimensionsTest . STRING_VALUE , offerId . getValue ( ) ) |
testInterpolation2 ( ) { final int sz = 21 ; double [ ] xval = new double [ sz ] ; double [ ] yval = new double [ sz ] ; final double delta = 1.0 / ( sz - 1 ) ; for ( int i = 0 ; i < sz ; i ++ ) { xval [ i ] = ( - 1 ) + ( ( 15 * i ) * delta ) ; yval [ i ] = ( - 20 ) + ( ( 30 * i ) * delta ) ; } org . hipparchus . analysis . BivariateFunction f = new org . hipparchus . analysis . BivariateFunction ( ) { @ org . hipparchus . analysis . interpolation . Override public double value ( double x , double y ) { return ( ( ( ( 2 * x ) * x ) - ( ( 3 * y ) * y ) ) + ( ( 4 * x ) * y ) ) - 5 ; } } ; double [ ] [ ] zval = new double [ xval . length ] [ yval . length ] ; for ( int i = 0 ; i < ( xval . length ) ; i ++ ) { for ( int j = 0 ; j < ( yval . length ) ; j ++ ) { zval [ i ] [ j ] = f . value ( xval [ i ] , yval [ j ] ) ; } } org . hipparchus . analysis . interpolation . BivariateGridInterpolator interpolator = new org . hipparchus . analysis . interpolation . PiecewiseBicubicSplineInterpolator ( ) ; org . hipparchus . analysis . BivariateFunction p = interpolator . interpolate ( xval , yval , zval ) ; double x ; double y ; final org . hipparchus . random . RandomDataGenerator gen = new org . hipparchus . random . RandomDataGenerator ( 1234567L ) ; final int numSamples = 50 ; final double tol = 5.0E-13 ; for ( int i = 0 ; i < numSamples ; i ++ ) { x = gen . nextUniform ( xval [ 0 ] , xval [ ( ( xval . length ) - 1 ) ] ) ; for ( int j = 0 ; j < numSamples ; j ++ ) { y = gen . nextUniform ( yval [ 0 ] , yval [ ( ( yval . length ) - 1 ) ] ) ; "<AssertPlaceHolder>" ; } } } value ( double , double [ ] ) { double v = Double . POSITIVE_INFINITY ; try { v = super . value ( x , p ) ; } catch ( org . hipparchus . exception . MathIllegalArgumentException e ) { } return v ; } | org . junit . Assert . assertEquals ( f . value ( x , y ) , p . value ( x , y ) , tol ) |
testCreateSecurityGroupIPSet ( ) { com . fit2cloud . qingcloud . wsclient . CreateSecurityGroupIPSetRequest createSecurityGroupIPSetRequest = new com . fit2cloud . qingcloud . wsclient . CreateSecurityGroupIPSetRequest ( ) ; createSecurityGroupIPSetRequest . setZone ( QingCloudZone . PEK1 ) ; createSecurityGroupIPSetRequest . setIpset_type ( 0 ) ; createSecurityGroupIPSetRequest . setSecurity_group_ipset_name ( "test" ) ; createSecurityGroupIPSetRequest . setVal ( "192.168.0.9/32" ) ; com . fit2cloud . qingcloud . wsclient . CreateSecurityGroupIPSetResponse createSecurityGroupIPSetResponse = com . fit2cloud . qingcloud . wsclient . QingCloudSecurityGroupAPITest . qingCloudWSClient . createSecurityGroupIPSet ( createSecurityGroupIPSetRequest ) ; "<AssertPlaceHolder>" ; } getRet_code ( ) { return ret_code ; } | org . junit . Assert . assertTrue ( ( ( createSecurityGroupIPSetResponse . getRet_code ( ) ) == 0 ) ) |
testDeleteDirectoryIgnoreExceptionWithException ( ) { final java . io . File testFile = createLocalFile ( localTempPath . toString ( ) , "SOME_FILE" , org . finra . herd . core . FILE_SIZE_1_KB ) ; executeWithoutLogging ( org . finra . herd . core . HerdFileUtils . class , new org . finra . herd . core . Command ( ) { @ org . finra . herd . core . Override public void execute ( ) throws org . finra . herd . core . Exception { org . finra . herd . core . HerdFileUtils . deleteDirectoryIgnoreException ( testFile ) ; } } ) ; "<AssertPlaceHolder>" ; } deleteDirectoryIgnoreException ( java . io . File ) { try { org . apache . commons . io . FileUtils . deleteDirectory ( directory ) ; } catch ( java . lang . Exception e ) { org . finra . herd . core . HerdFileUtils . LOGGER . warn ( java . lang . String . format ( "Failed<sp>to<sp>delete<sp>\"%s\"<sp>directory." , directory ) , e ) ; } } | org . junit . Assert . assertTrue ( testFile . exists ( ) ) |
testWatchClusterAssignmentData ( ) { org . apache . bookkeeper . stream . proto . cluster . ClusterAssignmentData assignmentData = org . apache . bookkeeper . stream . proto . cluster . ClusterAssignmentData . newBuilder ( ) . putServers ( "server-0" , org . apache . bookkeeper . stream . proto . cluster . ServerAssignmentData . newBuilder ( ) . addContainers ( 1L ) . addContainers ( 2L ) . build ( ) ) . build ( ) ; @ lombok . Cleanup ( "shutdown" ) java . util . concurrent . ExecutorService executor = java . util . concurrent . Executors . newSingleThreadExecutor ( ) ; java . util . concurrent . CompletableFuture < java . lang . Void > watchFuture = new java . util . concurrent . CompletableFuture ( ) ; store . watchClusterAssignmentData ( ( data ) -> { org . apache . bookkeeper . common . concurrent . FutureUtils . complete ( watchFuture , null ) ; } , executor ) ; store . updateClusterAssignmentData ( assignmentData ) ; watchFuture . join ( ) ; "<AssertPlaceHolder>" ; } getClusterAssignmentData ( ) { return assignmentData ; } | org . junit . Assert . assertEquals ( assignmentData , store . getClusterAssignmentData ( ) ) |
newDocumentWebHomeButTerminalFromURL ( ) { org . xwiki . model . reference . DocumentReference documentReference = new org . xwiki . model . reference . DocumentReference ( "xwiki" , java . util . Arrays . asList ( "X" , "Y" ) , "WebHome" ) ; com . xpn . xwiki . doc . XWikiDocument document = mock ( com . xpn . xwiki . doc . XWikiDocument . class ) ; when ( document . getDocumentReference ( ) ) . thenReturn ( documentReference ) ; when ( document . isNew ( ) ) . thenReturn ( true ) ; context . setDoc ( document ) ; when ( mockRequest . getParameter ( "tocreate" ) ) . thenReturn ( "terminal" ) ; java . lang . String result = action . render ( context ) ; "<AssertPlaceHolder>" ; verify ( mockURLFactory ) . createURL ( "X" , "Y" , "edit" , "template=&parent=Main.WebHome&title=Y" , null , "xwiki" , context ) ; } render ( com . xpn . xwiki . XWikiContext ) { com . xpn . xwiki . web . XWikiRequest request = context . getRequest ( ) ; java . lang . String path = request . getRequestURI ( ) ; java . lang . String filename = com . xpn . xwiki . util . Util . decodeURI ( path . substring ( ( ( path . lastIndexOf ( "/" ) ) + 1 ) ) , context ) ; try { ( ( com . xpn . xwiki . plugin . charts . ChartingPluginApi ) ( context . getWiki ( ) . getPluginApi ( "charting" , context ) ) ) . outputFile ( filename , context ) ; } catch ( java . io . IOException e ) { throw new com . xpn . xwiki . XWikiException ( com . xpn . xwiki . XWikiException . MODULE_XWIKI_APP , com . xpn . xwiki . XWikiException . ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION , "Exception<sp>while<sp>sending<sp>response" , e ) ; } return null ; } | org . junit . Assert . assertNull ( result ) |
testGetMessageBoardMessageMyRating ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( true ) |
testMinFunction ( ) { com . srotya . sidewinder . core . functions . list . MinFunction f = new com . srotya . sidewinder . core . functions . list . MinFunction ( ) ; double [ ] values = new double [ ] { 2.2 , 1.1 , 3.3 , 4.4 } ; java . util . List < com . srotya . sidewinder . core . storage . DataPoint > dps = new java . util . ArrayList ( ) ; long ts = java . lang . System . currentTimeMillis ( ) ; for ( double d : values ) { dps . add ( com . srotya . sidewinder . core . utils . MiscUtils . buildDataPoint ( ts , d ) ) ; } com . srotya . sidewinder . core . storage . SeriesOutput series = new com . srotya . sidewinder . core . storage . SeriesOutput ( ) ; series . setDataPoints ( dps ) ; com . srotya . sidewinder . core . storage . SeriesOutput result = f . apply ( series ) ; "<AssertPlaceHolder>" ; } getDataPoints ( ) { return dataPoints ; } | org . junit . Assert . assertEquals ( 1.1 , result . getDataPoints ( ) . get ( 0 ) . getValue ( ) , 0 ) |
testProbability ( ) { int [ ] points = new int [ ] { - 2 , - 1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ; double [ ] results = new double [ ] { 0 , 0.2 , 0 , 0 , 0 , 0.5 , 0 , 0 , 0 , 0.3 , 0 } ; for ( int p = 0 ; p < ( points . length ) ; p ++ ) { double probability = testDistribution . probability ( points [ p ] ) ; "<AssertPlaceHolder>" ; } } probability ( int ) { if ( ( x < 1 ) || ( x > 6 ) ) { return 0 ; } else { return p ; } } | org . junit . Assert . assertEquals ( results [ p ] , probability , 0.0 ) |
testOsp2ChargeSingleB ( ) { org . openscience . cdk . interfaces . IAtomContainer molecule = builder . newInstance ( org . openscience . cdk . interfaces . IAtomContainer . class ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "C" ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "O" ) ) ; molecule . getAtom ( 1 ) . setFormalCharge ( ( + 1 ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "C" ) ) ; molecule . addBond ( 0 , 1 , IBond . Order . SINGLE ) ; molecule . addBond ( 1 , 2 , IBond . Order . SINGLE ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "H" ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "H" ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "H" ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "H" ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "H" ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "H" ) ) ; molecule . addAtom ( builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class , "H" ) ) ; molecule . addBond ( 0 , 3 , IBond . Order . SINGLE ) ; molecule . addBond ( 0 , 4 , IBond . Order . SINGLE ) ; molecule . addBond ( 0 , 5 , IBond . Order . SINGLE ) ; molecule . addBond ( 1 , 6 , IBond . Order . SINGLE ) ; molecule . addBond ( 2 , 7 , IBond . Order . SINGLE ) ; molecule . addBond ( 2 , 8 , IBond . Order . SINGLE ) ; molecule . addBond ( 2 , 9 , IBond . Order . SINGLE ) ; org . openscience . cdk . tools . manipulator . AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( molecule ) ; lpcheck . saturate ( molecule ) ; molecule . getAtom ( 1 ) . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; molecule . getAtom ( 2 ) . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; molecule . getBond ( 1 ) . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; org . openscience . cdk . interfaces . IAtomContainerSet setOfReactants = builder . newInstance ( org . openscience . cdk . interfaces . IAtomContainerSet . class ) ; setOfReactants . addAtomContainer ( molecule ) ; org . openscience . cdk . reaction . IReactionProcess type = new org . openscience . cdk . reaction . type . HomolyticCleavageReaction ( ) ; java . util . List < org . openscience . cdk . reaction . type . parameters . IParameterReact > paramList = new java . util . ArrayList < org . openscience . cdk . reaction . type . parameters . IParameterReact > ( ) ; org . openscience . cdk . reaction . type . parameters . IParameterReact param = new org . openscience . cdk . reaction . type . parameters . SetReactionCenter ( ) ; param . setParameter ( Boolean . TRUE ) ; paramList . add ( param ) ; type . setParameterList ( paramList ) ; org . openscience . cdk . interfaces . IReactionSet setOfReactions = type . initiate ( setOfReactants , null ) ; "<AssertPlaceHolder>" ; } getReactionCount ( ) { return this . reactionCount ; } | org . junit . Assert . assertEquals ( 0 , setOfReactions . getReactionCount ( ) ) |
testNestedIf4 ( ) { instrument ( org . jacoco . core . test . validation . java5 . CyclomaticComplexityTest . NestedIf . class ) ; target . test ( ( - 1 ) ) ; target . test ( 0 ) ; target . test ( ( + 1 ) ) ; final org . jacoco . core . analysis . ICounter complexity = analyze ( ) ; "<AssertPlaceHolder>" ; } getInstance ( int , int ) { if ( ( missed <= ( org . jacoco . core . internal . analysis . CounterImpl . SINGLETON_LIMIT ) ) && ( covered <= ( org . jacoco . core . internal . analysis . CounterImpl . SINGLETON_LIMIT ) ) ) { return org . jacoco . core . internal . analysis . CounterImpl . SINGLETONS [ missed ] [ covered ] ; } else { return new org . jacoco . core . internal . analysis . CounterImpl . Var ( missed , covered ) ; } } | org . junit . Assert . assertEquals ( org . jacoco . core . internal . analysis . CounterImpl . getInstance ( 0 , 3 ) , complexity ) |
testGetExpectedPartitionValue ( ) { int offset = 1 ; java . lang . String partitionOffset = expectedPartitionValueDaoTestHelper . getTestSortedExpectedPartitionValues ( ) . get ( offset ) ; org . finra . herd . model . api . xml . ExpectedPartitionValueKey expectedPartitionValueKey = new org . finra . herd . model . api . xml . ExpectedPartitionValueKey ( PARTITION_KEY_GROUP , partitionOffset ) ; org . finra . herd . model . api . xml . ExpectedPartitionValueInformation expectedPartitionValuesInformation = new org . finra . herd . model . api . xml . ExpectedPartitionValueInformation ( expectedPartitionValueKey ) ; when ( expectedPartitionValueService . getExpectedPartitionValue ( expectedPartitionValueKey , offset ) ) . thenReturn ( expectedPartitionValuesInformation ) ; org . finra . herd . model . api . xml . ExpectedPartitionValueInformation resultPartitionValueInformation = expectedPartitionValueRestController . getExpectedPartitionValue ( org . finra . herd . rest . PARTITION_KEY_GROUP , partitionOffset , offset ) ; verify ( expectedPartitionValueService ) . getExpectedPartitionValue ( expectedPartitionValueKey , offset ) ; verifyNoMoreInteractions ( expectedPartitionValueService ) ; "<AssertPlaceHolder>" ; } getExpectedPartitionValue ( org . finra . herd . model . api . xml . ExpectedPartitionValueKey , int ) { javax . persistence . criteria . CriteriaBuilder builder = entityManager . getCriteriaBuilder ( ) ; javax . persistence . criteria . CriteriaQuery < org . finra . herd . model . jpa . ExpectedPartitionValueEntity > criteria = builder . createQuery ( org . finra . herd . model . jpa . ExpectedPartitionValueEntity . class ) ; javax . persistence . criteria . Root < org . finra . herd . model . jpa . ExpectedPartitionValueEntity > expectedPartitionValueEntity = criteria . from ( org . finra . herd . model . jpa . ExpectedPartitionValueEntity . class ) ; javax . persistence . criteria . Join < org . finra . herd . model . jpa . ExpectedPartitionValueEntity , org . finra . herd . model . jpa . PartitionKeyGroupEntity > partitionKeyGroupEntity = expectedPartitionValueEntity . join ( ExpectedPartitionValueEntity_ . partitionKeyGroup ) ; javax . persistence . criteria . Predicate whereRestriction = builder . equal ( builder . upper ( partitionKeyGroupEntity . get ( PartitionKeyGroupEntity_ . partitionKeyGroupName ) ) , expectedPartitionValueKey . getPartitionKeyGroupName ( ) . toUpperCase ( ) ) ; javax . persistence . criteria . Order orderByExpectedPartitionValue = null ; if ( offset == 0 ) { whereRestriction = builder . and ( whereRestriction , builder . equal ( expectedPartitionValueEntity . get ( ExpectedPartitionValueEntity_ . partitionValue ) , expectedPartitionValueKey . getExpectedPartitionValue ( ) ) ) ; } else if ( offset > 0 ) { whereRestriction = builder . and ( whereRestriction , builder . greaterThanOrEqualTo ( expectedPartitionValueEntity . get ( ExpectedPartitionValueEntity_ . partitionValue ) , expectedPartitionValueKey . getExpectedPartitionValue ( ) ) ) ; orderByExpectedPartitionValue = builder . asc ( expectedPartitionValueEntity . get ( ExpectedPartitionValueEntity_ . partitionValue ) ) ; } else { whereRestriction = builder . and ( whereRestriction , builder . lessThanOrEqualTo ( expectedPartitionValueEntity . get ( ExpectedPartitionValueEntity_ . partitionValue ) , expectedPartitionValueKey . getExpectedPartitionValue ( ) ) ) ; orderByExpectedPartitionValue = builder . desc ( expectedPartitionValueEntity . get ( ExpectedPartitionValueEntity_ . partitionValue ) ) ; } if ( offset == 0 ) { criteria . select ( expectedPartitionValueEntity ) . where ( whereRestriction ) ; return executeSingleResultQuery ( criteria , java . lang . String . format ( "Found<sp>more<sp>than<sp>one<sp>expected<sp>partition<sp>value<sp>with<sp>parameters<sp>{partitionKeyGroupName=\"%s\",<sp>expectedPartitionValue=\"%s\"}." , expectedPartitionValueKey . getPartitionKeyGroupName ( ) , expectedPartitionValueKey . getExpectedPartitionValue ( ) ) ) ; } else { criteria . select ( expectedPartitionValueEntity ) . where ( whereRestriction ) . orderBy ( orderByExpectedPartitionValue ) ; java . util . List < org . finra . herd . model . jpa . ExpectedPartitionValueEntity > resultList = entityManager . createQuery ( criteria ) . setFirstResult ( java . lang . Math . abs ( offset ) ) . setMaxResults ( 1 ) . getResultList ( ) ; return ( resultList . size ( ) ) > 0 ? resultList . get ( 0 ) : null ; } } | org . junit . Assert . assertEquals ( expectedPartitionValuesInformation , resultPartitionValueInformation ) |
withClosedEnd ( ) { net . time4j . PlainDate start = net . time4j . PlainDate . of ( 2014 , 2 , 27 ) ; net . time4j . PlainDate end = net . time4j . PlainDate . of ( 2014 , 5 , 14 ) ; net . time4j . range . DateInterval interval = net . time4j . range . DateInterval . between ( start , end ) ; "<AssertPlaceHolder>" ; } withClosedEnd ( ) { if ( this . end . isInfinite ( ) ) { throw new java . lang . IllegalStateException ( "Infinite<sp>future<sp>cannot<sp>be<sp>included." ) ; } else if ( this . end . isClosed ( ) ) { return this . getContext ( ) ; } else { net . time4j . range . Boundary < T > b = net . time4j . range . Boundary . of ( IntervalEdge . CLOSED , this . end . getTemporal ( ) ) ; return this . getFactory ( ) . between ( this . start , b ) ; } } | org . junit . Assert . assertThat ( interval . withClosedEnd ( ) , org . hamcrest . CoreMatchers . is ( interval ) ) |
testReadOnlyReplicaCorrupt ( ) { client . reportBadBlocks ( new org . apache . hadoop . hdfs . protocol . LocatedBlock [ ] { new org . apache . hadoop . hdfs . protocol . LocatedBlock ( extendedBlock , new org . apache . hadoop . hdfs . protocol . DatanodeInfo [ ] { readOnlyDataNode } ) } ) ; waitForLocations ( 1 ) ; org . apache . hadoop . hdfs . server . blockmanagement . NumberReplicas numberReplicas = org . apache . hadoop . hdfs . server . datanode . TestReadOnlySharedStorage . countReplicas ( namesystem , block ) ; "<AssertPlaceHolder>" ; } corruptReplicas ( ) { return corruptReplicas ; } | org . junit . Assert . assertThat ( numberReplicas . corruptReplicas ( ) , org . hamcrest . CoreMatchers . is ( 0 ) ) |
getFirst_A$ ( ) { java . lang . String _1 = "foo" ; java . lang . Integer _2 = 123 ; java . lang . Long _3 = 456L ; java . lang . Boolean _4 = true ; java . lang . Double _5 = 7.8 ; com . m3 . scalaflavor4j . Tuple5 < java . lang . String , java . lang . Integer , java . lang . Long , java . lang . Boolean , java . lang . Double > tuple = com . m3 . scalaflavor4j . Tuple . apply ( _1 , _2 , _3 , _4 , _5 ) ; java . lang . String actual = tuple . getFirst ( ) ; java . lang . String expected = "foo" ; "<AssertPlaceHolder>" ; } getFirst ( ) { return _1 ( ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) ) |
testPutAndGetObject ( ) { java . lang . String myObj = "This<sp>is<sp>a<sp>test" ; storage . putObject ( "test-obj" , "test-key" , myObj ) ; java . lang . String s = storage . getObject ( "test-obj" , "test-key" ) ; storage . shutdown ( ) ; "<AssertPlaceHolder>" ; } shutdown ( ) { for ( java . io . ObjectInputStream ois : oiss . values ( ) ) { try { ois . close ( ) ; } catch ( java . io . IOException e ) { } } for ( java . io . ObjectOutputStream oos : ooss . values ( ) ) { try { oos . close ( ) ; } catch ( java . io . IOException e ) { } } } | org . junit . Assert . assertThat ( s , org . hamcrest . core . Is . is ( myObj ) ) |
testSyslogStart ( ) { ch . qos . logback . core . pattern . DynamicConverter < ch . qos . logback . classic . spi . ILoggingEvent > converter = new ch . qos . logback . classic . pattern . SyslogStartConverter ( ) ; this . optionList . clear ( ) ; this . optionList . add ( "MAIL" ) ; converter . setOptionList ( this . optionList ) ; converter . start ( ) ; ch . qos . logback . classic . spi . ILoggingEvent event = makeLoggingEvent ( null ) ; java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; converter . write ( buf , event ) ; java . lang . String expected = ( "<" + ( ( ch . qos . logback . core . net . SyslogConstants . LOG_MAIL ) + ( ch . qos . logback . core . net . SyslogConstants . INFO_SEVERITY ) ) ) + ">" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . String result = ( "Token{" + "type=" ) + ( type ) ; if ( ( payload ) != null ) result += ( ",<sp>payload='" + ( payload ) ) + '\'' ; result += '}' ; return result ; } | org . junit . Assert . assertTrue ( buf . toString ( ) . startsWith ( expected ) ) |
testAbsDelete ( ) { java . util . Random r = new java . util . Random ( ) ; long seed = r . nextLong ( ) ; r . setSeed ( seed ) ; System . out . println ( ( "SEED:<sp>" + seed ) ) ; java . util . List < org . apache . hadoop . fs . Path > dirs = buildDirs ( r , org . apache . hadoop . yarn . server . nodemanager . TestDeletionService . base , 20 ) ; createDirs ( new org . apache . hadoop . fs . Path ( "." ) , dirs ) ; org . apache . hadoop . yarn . server . nodemanager . TestDeletionService . FakeDefaultContainerExecutor exec = new org . apache . hadoop . yarn . server . nodemanager . TestDeletionService . FakeDefaultContainerExecutor ( ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; exec . setConf ( conf ) ; org . apache . hadoop . yarn . server . nodemanager . DeletionService del = new org . apache . hadoop . yarn . server . nodemanager . DeletionService ( exec ) ; del . init ( conf ) ; del . start ( ) ; try { for ( org . apache . hadoop . fs . Path p : dirs ) { del . delete ( ( ( ( java . lang . Long . parseLong ( p . getName ( ) ) ) % 2 ) == 0 ? null : "dingo" ) , p , null ) ; } int msecToWait = 20 * 1000 ; for ( org . apache . hadoop . fs . Path p : dirs ) { while ( ( msecToWait > 0 ) && ( org . apache . hadoop . yarn . server . nodemanager . TestDeletionService . lfs . util ( ) . exists ( p ) ) ) { java . lang . Thread . sleep ( 100 ) ; msecToWait -= 100 ; } "<AssertPlaceHolder>" ; } } finally { del . stop ( ) ; } } util ( ) { return util ; } | org . junit . Assert . assertFalse ( org . apache . hadoop . yarn . server . nodemanager . TestDeletionService . lfs . util ( ) . exists ( p ) ) |
testHaalPersoonOpMetAdresViaBetrokkenheid ( ) { nl . bzk . brp . model . objecttype . operationeel . BetrokkenheidModel betrokkenheid = em . find ( nl . bzk . brp . model . objecttype . operationeel . BetrokkenheidModel . class , 1 ) ; nl . bzk . brp . model . objecttype . operationeel . PersoonModel persoon = persoonRepository . haalPersoonOpMetAdresViaBetrokkenheid ( betrokkenheid ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( persoon ) |
testSortMixed ( ) { com . googlecode . cqengine . resultset . order . List < com . googlecode . cqengine . testutil . Car > cars = com . googlecode . cqengine . resultset . order . Arrays . asList ( new com . googlecode . cqengine . testutil . Car ( 0 , "Ford" , "Taurus" , Car . Color . BLACK , 4 , 2000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) , new com . googlecode . cqengine . testutil . Car ( 1 , "Ford" , "Taurus" , Car . Color . BLACK , 4 , 1000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) , new com . googlecode . cqengine . testutil . Car ( 3 , "Honda" , "Civic" , Car . Color . BLACK , 4 , 4000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) , new com . googlecode . cqengine . testutil . Car ( 3 , "Honda" , "Civic" , Car . Color . BLACK , 4 , 3000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) ) ; com . googlecode . cqengine . query . option . OrderByOption < com . googlecode . cqengine . testutil . Car > ordering = orderBy ( descending ( Car . MANUFACTURER ) , ascending ( Car . PRICE ) ) ; com . googlecode . cqengine . resultset . order . Collections . sort ( cars , new com . googlecode . cqengine . resultset . order . AttributeOrdersComparator < com . googlecode . cqengine . testutil . Car > ( ordering . getAttributeOrders ( ) , noQueryOptions ( ) ) ) ; com . googlecode . cqengine . resultset . order . List < com . googlecode . cqengine . testutil . Car > expected = com . googlecode . cqengine . resultset . order . Arrays . asList ( new com . googlecode . cqengine . testutil . Car ( 3 , "Honda" , "Civic" , Car . Color . BLACK , 4 , 3000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) , new com . googlecode . cqengine . testutil . Car ( 3 , "Honda" , "Civic" , Car . Color . BLACK , 4 , 4000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) , new com . googlecode . cqengine . testutil . Car ( 1 , "Ford" , "Taurus" , Car . Color . BLACK , 4 , 1000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) , new com . googlecode . cqengine . testutil . Car ( 0 , "Ford" , "Taurus" , Car . Color . BLACK , 4 , 2000.0 , com . googlecode . cqengine . resultset . order . Collections . < java . lang . String > emptyList ( ) ) ) ; "<AssertPlaceHolder>" ; } noQueryOptions ( ) { return new com . googlecode . cqengine . query . QueryOptions ( ) ; } | org . junit . Assert . assertEquals ( expected , cars ) |
shouldBeAbleToAddASingleNonZeroLengthFile ( ) { java . io . File reference = java . io . File . createTempFile ( "reference" , ".zip" ) ; try ( com . facebook . buck . util . zip . CustomZipOutputStream out = com . facebook . buck . util . zip . ZipOutputStreams . newOutputStream ( output , mode ) ; java . util . zip . ZipOutputStream ref = new java . util . zip . ZipOutputStream ( new java . io . FileOutputStream ( reference ) ) ) { byte [ ] bytes = "cheese" . getBytes ( ) ; java . util . zip . ZipEntry entry = new java . util . zip . ZipEntry ( "example.txt" ) ; entry . setTime ( java . lang . System . currentTimeMillis ( ) ) ; out . putNextEntry ( entry ) ; ref . putNextEntry ( entry ) ; out . write ( bytes ) ; ref . write ( bytes ) ; } byte [ ] seen = java . nio . file . Files . readAllBytes ( output ) ; byte [ ] expected = java . nio . file . Files . readAllBytes ( reference . toPath ( ) ) ; "<AssertPlaceHolder>" ; } write ( int ) { } | org . junit . Assert . assertArrayEquals ( expected , seen ) |
returnPendingIfNullIsPassedIntoParseLineMulti ( ) { java . lang . String [ ] nextLine = csvParser . parseLineMulti ( "This,\"is<sp>a<sp>\"goo\\d\"<sp>line\\\\<sp>to<sp>parse\\" ) ; org . junit . Assert . assertEquals ( 1 , nextLine . length ) ; org . junit . Assert . assertEquals ( "This" , nextLine [ 0 ] ) ; org . junit . Assert . assertTrue ( csvParser . isPending ( ) ) ; nextLine = csvParser . parseLineMulti ( null ) ; org . junit . Assert . assertEquals ( 1 , nextLine . length ) ; org . junit . Assert . assertEquals ( "is<sp>a<sp>\"good\"<sp>line\\<sp>to<sp>parse\n" , nextLine [ 0 ] ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( csvParser . isPending ( ) ) |
testGetByName ( ) { java . lang . String name = "theone" ; com . xiaomi . shepher . model . Team team = teamMapper . getByName ( name ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( 5 , team . getId ( ) ) |
testLateServerStart ( ) { final int numServer = 3 ; org . apache . ratis . server . impl . LOG . info ( "Running<sp>testLateServerStart" ) ; final org . apache . ratis . MiniRaftCluster cluster = org . apache . ratis . server . impl . LeaderElectionTests . newCluster ( numServer ) ; cluster . initServers ( ) ; final java . util . Iterator < org . apache . ratis . server . impl . RaftServerProxy > i = cluster . getServers ( ) . iterator ( ) ; for ( int j = 1 ; j < numServer ; j ++ ) { i . next ( ) . start ( ) ; } final org . apache . ratis . server . impl . RaftServerImpl leader = org . apache . ratis . RaftTestUtil . waitForLeader ( cluster ) ; final org . apache . ratis . util . TimeDuration sleepTime = org . apache . ratis . util . TimeDuration . valueOf ( 3 , TimeUnit . SECONDS ) ; org . apache . ratis . server . impl . LOG . info ( ( "sleep<sp>" + sleepTime ) ) ; sleepTime . sleep ( ) ; final org . apache . ratis . server . impl . RaftServerProxy lastServer = i . next ( ) ; lastServer . start ( ) ; final org . apache . ratis . protocol . RaftPeerId lastServerLeaderId = org . apache . ratis . util . JavaUtils . attempt ( ( ) -> java . util . Optional . ofNullable ( lastServer . getImpls ( ) . iterator ( ) . next ( ) . getState ( ) . getLeaderId ( ) ) . orElseThrow ( ( ) -> new java . lang . IllegalStateException ( "No<sp>leader<sp>yet" ) ) , 10 , org . apache . ratis . server . impl . ONE_SECOND , "getLeaderId" , org . apache . ratis . server . impl . LOG ) ; org . apache . ratis . server . impl . LOG . info ( cluster . printServers ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return null ; } | org . junit . Assert . assertEquals ( leader . getId ( ) , lastServerLeaderId ) |
testLessThanEquals ( ) { com . mongodb . DBObject actual = parse ( "number<sp><=<sp>?" ) . getQuery ( ) ; com . mongodb . DBObject expected = com . mongodb . QueryBuilder . start ( "number" ) . lessThanEquals ( com . gigaspaces . persistency . qa . utest . parser . SQL2MongoBaseVisitorTest . PARAMETER_PLACEHOLDER ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { synchronized ( org . openspaces . rest . utils . ControllerUtils . XapConnectionCache . cache ) { log . finest ( "getting<sp>space" ) ; org . openspaces . core . GigaSpace gs = getSpace ( ) ; if ( gs != null ) return gs ; log . finest ( ( "lookupgroups:<sp>" + ( org . openspaces . rest . utils . ControllerUtils . lookupGroups ) ) ) ; log . finest ( ( "lookupLocators:<sp>" + ( org . openspaces . rest . utils . ControllerUtils . lookupLocators ) ) ) ; log . finest ( ( "spaceName:<sp>" + ( org . openspaces . rest . utils . ControllerUtils . spaceName ) ) ) ; java . lang . String url = "jini://*/*/" + ( org . openspaces . rest . utils . ControllerUtils . spaceName ) ; if ( ( ( ( org . openspaces . rest . utils . ControllerUtils . lookupGroups ) != null ) && ( ( org . openspaces . rest . utils . ControllerUtils . lookupGroups . length ( ) ) > 0 ) ) || ( ( ( org . openspaces . rest . utils . ControllerUtils . lookupLocators ) != null ) && ( ( org . openspaces . rest . utils . ControllerUtils . lookupLocators . length ( ) ) > 0 ) ) ) { url += "lookupLocators:<sp>" 0 ; boolean lookupGroupsSetted = false ; if ( ( ( org . openspaces . rest . utils . ControllerUtils . lookupGroups ) != null ) && ( ( org . openspaces . rest . utils . ControllerUtils . lookupGroups . length ( ) ) > 0 ) ) { url += "groups=" + ( org . openspaces . rest . utils . ControllerUtils . lookupGroups ) ; lookupGroupsSetted = true ; } if ( ( ( org . openspaces . rest . utils . ControllerUtils . lookupLocators ) != null ) && ( ( org . openspaces . rest . utils . ControllerUtils . lookupLocators . length ( ) ) > 0 ) ) { if ( lookupGroupsSetted ) { url += "&" ; } url += "locators=" + ( org . openspaces . rest . utils . ControllerUtils . lookupLocators ) ; } } log . info ( ( "<sp>connecting<sp>to<sp>" + url ) ) ; org . openspaces . core . space . UrlSpaceConfigurer usc = new org . openspaces . core . space . UrlSpaceConfigurer ( url ) ; gs = new org . openspaces . core . GigaSpaceConfigurer ( usc . space ( ) ) . gigaSpace ( ) ; org . openspaces . rest . utils . ControllerUtils . XapConnectionCache . cache . set ( new org . openspaces . rest . utils . ControllerUtils . XapEndpoint ( gs , usc ) ) ; log . finest ( "<sp>returning<sp>space" ) ; return gs ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
testLeeg ( ) { final nl . bzk . migratiebrp . conversie . model . brp . BrpStapel < nl . bzk . migratiebrp . conversie . model . brp . groep . BrpIstRelatieGroepInhoud > brpInhoud = mapper . map ( new java . util . HashSet < nl . bzk . brp . model . logisch . ist . Stapel > ( ) ) ; "<AssertPlaceHolder>" ; } map ( java . util . Set ) { if ( ( persoonAdresSet == null ) || ( persoonAdresSet . isEmpty ( ) ) ) { return null ; } else { return mapper . map ( persoonAdresSet . iterator ( ) . next ( ) . getPersoonAdresHistorieSet ( ) ) ; } } | org . junit . Assert . assertNull ( brpInhoud ) |
testGetConvFlowId ( ) { java . lang . String nwId = "network01" ; java . lang . String flowId = "flow01" ; java . util . ArrayList < java . lang . String > flowList = new java . util . ArrayList < java . lang . String > ( ) { { add ( "flow01" ) ; add ( "flow02" ) ; } } ; org . o3project . odenos . core . component . ConversionTable conversionTable = org . powermock . api . mockito . PowerMockito . spy ( new org . o3project . odenos . core . component . ConversionTable ( ) ) ; org . powermock . api . mockito . PowerMockito . doReturn ( flowList ) . when ( conversionTable , "getFlow" , nwId , flowId ) ; org . powermock . api . mockito . PowerMockito . doReturn ( conversionTable ) . when ( target , "conversionTable" ) ; "<AssertPlaceHolder>" ; } getConvFlowId ( java . lang . String , java . lang . String ) { if ( ( networkId == null ) || ( flowId == null ) ) { return null ; } java . util . ArrayList < java . lang . String > convFlowId = conversionTable . getFlow ( networkId , flowId ) ; if ( ( convFlowId . size ( ) ) == 0 ) { return null ; } java . lang . String [ ] fedFlowIds = convFlowId . get ( 0 ) . split ( Federator . SEPARATOR ) ; return fedFlowIds [ 1 ] ; } | org . junit . Assert . assertThat ( target . getConvFlowId ( nwId , flowId ) , org . hamcrest . CoreMatchers . is ( "flow01" ) ) |
testPackageName1 ( ) { java . lang . String voice = "cmu-slt-hsmm" ; java . lang . String expected = "CmuSltHsmm" ; java . lang . String actual = marytts . tools . voiceimport . VoiceCompiler . toPackageName ( voice ) ; "<AssertPlaceHolder>" ; } toPackageName ( java . lang . String ) { java . lang . String regexLCLetter = "[a-z]" ; java . lang . String regexLetter = "[a-zA-Z]" ; java . lang . String invalidChars = "[^_a-zA-Z0-9]" ; java . lang . String [ ] parts = voiceName . split ( invalidChars ) ; java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; for ( java . lang . String part : parts ) { if ( part . isEmpty ( ) ) { continue ; } java . lang . String firstChar = part . substring ( 0 , 1 ) ; if ( java . util . regex . Pattern . matches ( regexLCLetter , firstChar ) ) { result . append ( firstChar . toUpperCase ( ) ) . append ( part . substring ( 1 ) ) ; } else { result . append ( part ) ; } } if ( ! ( java . util . regex . Pattern . matches ( regexLetter , result . subSequence ( 0 , 1 ) ) ) ) { result . insert ( 0 , "V" ) ; } return result . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
shouldInvalidateSchemaStateOnDropConstraint ( ) { org . neo4j . internal . kernel . api . schema . constraints . ConstraintDescriptor descriptor = createConstraint ( ) ; commitToSchemaState ( "test" , "before" ) ; dropConstraint ( descriptor ) ; java . lang . String after = commitToSchemaState ( "test" , "after" ) ; "<AssertPlaceHolder>" ; } commitToSchemaState ( java . lang . String , java . lang . String ) { try ( org . neo4j . internal . kernel . api . Transaction transaction = kernel . beginTransaction ( implicit , org . neo4j . kernel . impl . api . AUTH_DISABLED ) ) { java . lang . String result = getOrCreateFromState ( transaction , key , value ) ; transaction . success ( ) ; return result ; } } | org . junit . Assert . assertEquals ( "after" , after ) |
testSortDifferentMediaByOneAttribute ( ) { com . liferay . adaptive . media . AdaptiveMedia < com . liferay . adaptive . media . image . processor . AMImageProcessor > adaptiveMedia1 = _createAdaptiveMedia ( com . liferay . adaptive . media . AMAttribute . getContentLengthAMAttribute ( ) , 10L ) ; com . liferay . adaptive . media . AdaptiveMedia < com . liferay . adaptive . media . image . processor . AMImageProcessor > adaptiveMedia2 = _createAdaptiveMedia ( com . liferay . adaptive . media . AMAttribute . getContentLengthAMAttribute ( ) , 20L ) ; long result = _singleAMAttributeDistanceComparator . compare ( adaptiveMedia1 , adaptiveMedia2 ) ; "<AssertPlaceHolder>" ; } compare ( V , V ) { return _amDistanceComparator . compare ( value1 , value2 ) ; } | org . junit . Assert . assertEquals ( ( - 10 ) , result ) |
whenPreviouslyReadByOtherThread_thenNoProblems ( ) { org . multiverse . stms . gamma . transactionalobjects . GammaTxnLong ref = new org . multiverse . stms . gamma . transactionalobjects . GammaTxnLong ( stm , 10 ) ; org . multiverse . stms . gamma . transactions . GammaTxn otherTx = stm . newDefaultTxn ( ) ; ref . get ( otherTx ) ; org . multiverse . stms . gamma . transactions . GammaTxn tx = stm . newDefaultTxn ( ) ; ref . getLock ( ) . acquire ( tx , LockMode . Read ) ; long result = ref . get ( otherTx ) ; "<AssertPlaceHolder>" ; } get ( int ) { return get ( org . multiverse . collections . NaiveTxnLinkedList . getThreadLocalTxn ( ) , index ) ; } | org . junit . Assert . assertEquals ( 10 , result ) |
shouldAddAnAttributeToAVisit ( ) { int before = service . getVisitByUuid ( RestTestConstants1_9 . VISIT_UUID ) . getAttributes ( ) . size ( ) ; java . lang . String json = "{\"attributeType\":\"6770f6d6-7673-11e0-8f03-001e378eb67g\",<sp>\"value\":\"2012-08-25\"}" ; handle ( newPostRequest ( getURI ( ) , json ) ) ; int after = service . getVisitByUuid ( RestTestConstants1_9 . VISIT_UUID ) . getAttributes ( ) . size ( ) ; "<AssertPlaceHolder>" ; } getURI ( ) { return "orderfrequency" ; } | org . junit . Assert . assertEquals ( ( before + 1 ) , after ) |
deveObterNumeroFaturaComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoFatura fatura = new com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoFatura ( ) ; final java . lang . String numeroFatura = "KDVAp0aewPjmHaTsjbDX1O6NOR9tc7TxGflFLXsMZt2hEKar3oqzZ11uzEQF" ; fatura . setNumeroFatura ( numeroFatura ) ; "<AssertPlaceHolder>" ; } getNumeroFatura ( ) { return this . numeroFatura ; } | org . junit . Assert . assertEquals ( numeroFatura , fatura . getNumeroFatura ( ) ) |
test07OnlyProjectAggr ( ) { raptorContext . setAllowFullTableScan ( true ) ; java . lang . String query = "ServiceInstance<@https,<sp>@activeManifestDiff>{$max(@port)}" ; com . ebay . cloud . cms . query . service . IQueryResult result = queryService . query ( query , raptorContext ) ; "<AssertPlaceHolder>" ; } getEntities ( ) { return entities ; } | org . junit . Assert . assertEquals ( 2 , result . getEntities ( ) . size ( ) ) |
testHeightImmutable ( ) { org . gedcom4j . model . thirdpartyadapters . FamilyTreeMaker3Adapter a = new org . gedcom4j . model . thirdpartyadapters . FamilyTreeMaker3Adapter ( ) ; java . util . List < org . gedcom4j . model . CustomFact > cfs = a . getHeights ( jesse ) ; "<AssertPlaceHolder>" ; cfs . clear ( ) ; } getHeights ( org . gedcom4j . model . Individual ) { return i . getCustomFactsWithTag ( "_HEIG" ) ; } | org . junit . Assert . assertNotNull ( cfs ) |
testGetTarget ( ) { org . oryxeditor . server . diagram . basic . BasicEdge e = new org . oryxeditor . server . diagram . basic . BasicEdge ( "anEdge" ) ; org . oryxeditor . server . diagram . basic . BasicShape target = getBasicShapeOfRandomType ( "target" ) ; e . setTargetAndUpdateOutgoings ( target ) ; "<AssertPlaceHolder>" ; } getTarget ( ) { return target ; } | org . junit . Assert . assertEquals ( target , e . getTarget ( ) ) |
testRead ( ) { java . nio . channels . FileLock lock = null ; java . io . RandomAccessFile randomAccessFile = null ; try { readData ( sample ) ; java . io . File fileAfterRead = new java . io . File ( sample ) ; randomAccessFile = new java . io . RandomAccessFile ( fileAfterRead , "rw" ) ; java . nio . channels . FileChannel fileChannel = randomAccessFile . getChannel ( ) ; lock = fileChannel . tryLock ( ) ; "<AssertPlaceHolder>" ; } finally { if ( lock != null ) { lock . release ( ) ; } if ( randomAccessFile != null ) { randomAccessFile . close ( ) ; } } } isValid ( ) { return ( ( ( ( ( ( url ) != null ) && ( ( url . length ( ) ) > 0 ) ) && ( ( id ) != null ) ) && ( ( id . length ( ) ) > 0 ) ) && ( ( name ) != null ) ) && ( ( name . length ( ) ) > 0 ) ; } | org . junit . Assert . assertTrue ( lock . isValid ( ) ) |
validUnversionedNoVersioner ( ) { org . apache . shindig . common . uri . Uri uri = makeValidationTestUri ( ( ( org . apache . shindig . gadgets . uri . DefaultIframeUriManagerTest . LD_PREFIX ) + ( org . apache . shindig . gadgets . uri . DefaultIframeUriManagerTest . LD_SUFFIX ) ) , "version" ) ; org . apache . shindig . gadgets . uri . DefaultIframeUriManager manager = makeManager ( false , false ) ; "<AssertPlaceHolder>" ; } validateRenderingUri ( org . apache . shindig . common . uri . Uri ) { org . apache . shindig . common . uri . UriBuilder uri = new org . apache . shindig . common . uri . UriBuilder ( inUri ) ; java . lang . String gadgetStr = uri . getQueryParameter ( Param . URL . getKey ( ) ) ; org . apache . shindig . common . uri . Uri gadgetUri = null ; try { gadgetUri = org . apache . shindig . common . uri . Uri . parse ( gadgetStr ) ; } catch ( java . lang . Exception e ) { return UriStatus . BAD_URI ; } java . lang . String container = uri . getQueryParameter ( Param . CONTAINER . getKey ( ) ) ; if ( container == null ) { container = org . apache . shindig . config . ContainerConfig . DEFAULT_CONTAINER ; } java . lang . String host = uri . getAuthority ( ) . toLowerCase ( ) ; java . lang . String gadgetLdPrefix = ldGen . getLockedDomainPrefix ( gadgetUri ) . toLowerCase ( ) ; if ( ( ldEnabled ) && ( ! ( lockedDomainExclusion ( ) ) ) ) { if ( host . startsWith ( gadgetLdPrefix ) ) { host = host . substring ( gadgetLdPrefix . length ( ) ) ; java . lang . String ldSuffix = getReqVal ( container , org . apache . shindig . gadgets . uri . DefaultIframeUriManager . LOCKED_DOMAIN_SUFFIX_KEY ) ; if ( ! ( ldSuffix . equalsIgnoreCase ( host ) ) ) { return UriStatus . INVALID_DOMAIN ; } } else { for ( java . lang . String ldSuffix : ldSuffixes ) { if ( host . endsWith ( ldSuffix ) ) { return UriStatus . INVALID_DOMAIN ; } } } } java . lang . String version = uri . getQueryParameter ( Param . VERSION . getKey ( ) ) ; if ( ( ( versioner ) == null ) || ( version == null ) ) { return UriStatus . VALID_UNVERSIONED ; } return versioner . validate ( gadgetUri , container , version ) ; } | org . junit . Assert . assertEquals ( UriStatus . VALID_UNVERSIONED , manager . validateRenderingUri ( uri ) ) |
testRawFilter ( ) { java . lang . String expected = "nodeList:{<sp>[0]<sp>[5]<sp>}" ; java . util . List < org . opennms . netmgt . model . OnmsNode > nodeList = org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . getMockNodeList ( ) ; java . lang . String s1 = org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . nodelistToString ( nodeList ) ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( ( ( ( "Start<sp>testRawFilter()<sp>before:" + s1 ) + "<sp>expected:" ) + expected ) ) ; java . util . Map < java . lang . String , org . opennms . features . topology . plugins . topo . asset . filter . Filter > filterMap = new java . util . HashMap < java . lang . String , org . opennms . features . topology . plugins . topo . asset . filter . Filter > ( ) ; filterMap . put ( NodeParamLabels . ASSET_DISPLAYCATEGORY , new org . opennms . features . topology . plugins . topo . asset . filter . NotFilter ( new org . opennms . features . topology . plugins . topo . asset . filter . OrFilter ( new org . opennms . features . topology . plugins . topo . asset . filter . EqFilter ( "asset-displaycategory_0" ) , new org . opennms . features . topology . plugins . topo . asset . filter . EqFilter ( "asset-displaycategory_5" ) ) ) ) ; java . util . List < org . opennms . netmgt . model . OnmsNode > filteredNodeList = testFilterCode ( nodeList , filterMap ) ; java . lang . String s2 = org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . nodelistToString ( filteredNodeList ) ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( ( "End<sp>testRawFilter()<sp>after:" + s2 ) ) ; "<AssertPlaceHolder>" ; } debug ( java . lang . String ) { logMsg ( org . opennms . features . vaadin . mibcompiler . MibConsolePanel . DEBUG , message ) ; } | org . junit . Assert . assertEquals ( expected , s2 ) |
validate_shouldPassValidationIfFieldLengthsAreCorrect ( ) { org . openmrs . Role role = new org . openmrs . Role ( ) ; role . setRole ( "Bowling<sp>race<sp>car<sp>driver" ) ; role . setDescription ( "description" ) ; org . springframework . validation . Errors errors = new org . springframework . validation . BindException ( role , "type" ) ; new org . openmrs . validator . RoleValidator ( ) . validate ( role , errors ) ; "<AssertPlaceHolder>" ; } hasErrors ( ) { return erroneous ; } | org . junit . Assert . assertFalse ( errors . hasErrors ( ) ) |
testNoUnConvertLt ( ) { java . lang . String testString = "<" ; "<AssertPlaceHolder>" ; } unescapeToXML ( java . lang . String ) { if ( com . github . bordertech . wcomponents . util . Util . empty ( input ) ) { return input ; } java . lang . String encoded = com . github . bordertech . wcomponents . WebUtilities . doubleEncodeBrackets ( input ) ; java . lang . String unescaped = com . github . bordertech . wcomponents . util . HtmlToXMLUtil . UNESCAPE_HTML_TO_XML . translate ( encoded ) ; java . lang . String decoded = com . github . bordertech . wcomponents . WebUtilities . doubleDecodeBrackets ( unescaped ) ; return decoded ; } | org . junit . Assert . assertEquals ( testString , com . github . bordertech . wcomponents . util . HtmlToXMLUtil . unescapeToXML ( testString ) ) |
testHasColor ( ) { org . eclipse . swt . graphics . Color color = org . eclipse . swt . widgets . Display . getCurrent ( ) . getSystemColor ( SWT . COLOR_BLACK ) ; com . eclipsesource . tabris . passepartout . internal . instruction . BackgroundInstruction instruction = new com . eclipsesource . tabris . passepartout . internal . instruction . BackgroundInstruction ( color ) ; org . eclipse . swt . graphics . Color actualColor = instruction . getColor ( ) ; "<AssertPlaceHolder>" ; } getColor ( ) { return color ; } | org . junit . Assert . assertSame ( color , actualColor ) |
testGetSigner ( ) { com . aliyuncs . profile . DefaultProfile profile = com . aliyuncs . profile . DefaultProfile . getProfile ( "cn-hangzhou" ) ; "<AssertPlaceHolder>" ; } getSigner ( ) { return null ; } | org . junit . Assert . assertNull ( profile . getSigner ( ) ) |
test_unmodifiableNavigableSet_pass2 ( ) { java . util . NavigableSet < java . util . Date > set1 = new java . util . TreeSet < java . util . Date > ( ) ; set1 . add ( new bb . util . Date2 ( 0 ) ) ; java . util . NavigableSet < java . util . Date > set2 = bb . util . Collections2 . unmodifiableNavigableSet ( set1 ) ; "<AssertPlaceHolder>" ; } add ( E ) { stock . put ( quantity ) ; } | org . junit . Assert . assertEquals ( set1 , set2 ) |
check ( ) { "<AssertPlaceHolder>" ; validator . validOS ( "Linux" ) ; validator . validOS ( "windows" ) ; validator . validOS ( "Mac<sp>OS" ) ; } | org . junit . Assert . assertNotNull ( validator ) |
testSerialization ( ) { org . jfree . chart . axis . NumberTickUnit t1 = new org . jfree . chart . axis . NumberTickUnit ( 1.23 , new java . text . DecimalFormat ( "0.00" ) ) ; org . jfree . chart . axis . NumberTickUnit t2 = ( ( org . jfree . chart . axis . NumberTickUnit ) ( org . jfree . chart . TestUtils . serialised ( t1 ) ) ) ; "<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 ( t1 , t2 ) |
coreSimulatorServicePathFetchedFromLaunchctlPrint ( ) { ImmutableList . Builder < Map . Entry < com . facebook . buck . util . ProcessExecutorParams , com . facebook . buck . util . FakeProcess > > fakeProcessesBuilder = com . google . common . collect . ImmutableList . builder ( ) ; fakeProcessesBuilder . add ( new java . util . AbstractMap . SimpleImmutableEntry ( com . facebook . buck . apple . simulator . AppleCoreSimulatorServiceControllerTest . LAUNCHCTL_LIST_PARAMS , new com . facebook . buck . util . FakeProcess ( 0 , "87823\t0\tcom.apple.CoreSimulator.CoreSimulatorService.117.15.1.lkhDXxRPp5yy\n" , "" ) ) ) ; fakeProcessesBuilder . add ( new java . util . AbstractMap . SimpleImmutableEntry ( com . facebook . buck . util . ProcessExecutorParams . builder ( ) . setCommand ( com . google . common . collect . ImmutableList . of ( "launchctl" , "print" , "user/42/com.apple.CoreSimulator.CoreSimulatorService.117.15.1.lkhDXxRPp5yy" ) ) . build ( ) , new com . facebook . buck . util . FakeProcess ( 0 , ( "Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc" 0 + ( ( "<sp>path<sp>=<sp>xcode-dir/Developer/Library/PrivateFrameworks/CoreSimulator.framework" + "/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc\n" ) + "}\n" ) ) , "" ) ) ) ; com . facebook . buck . util . FakeProcessExecutor fakeProcessExecutor = new com . facebook . buck . util . FakeProcessExecutor ( fakeProcessesBuilder . build ( ) ) ; com . facebook . buck . apple . simulator . AppleCoreSimulatorServiceController appleCoreSimulatorServiceController = new com . facebook . buck . apple . simulator . AppleCoreSimulatorServiceController ( fakeProcessExecutor ) ; java . util . Optional < java . nio . file . Path > coreSimulatorServicePath = appleCoreSimulatorServiceController . getCoreSimulatorServicePath ( new com . facebook . buck . util . FakeUserIdFetcher ( 42 ) ) ; java . util . Optional < java . nio . file . Path > expected = java . util . Optional . of ( java . nio . file . Paths . get ( ( "xcode-dir/Developer/Library/PrivateFrameworks/CoreSimulator.framework/" + "Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc" ) ) ) ; "<AssertPlaceHolder>" ; } equalTo ( com . facebook . buck . query . QueryEnvironment$Argument ) { return ( ( ( type . equals ( other . type ) ) && ( ( integer ) == ( other . integer ) ) ) && ( java . util . Objects . equals ( expression , other . expression ) ) ) && ( java . util . Objects . equals ( word , other . word ) ) ; } | org . junit . Assert . assertThat ( coreSimulatorServicePath , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( expected ) ) ) |
addBranchWithInstruction_should_not_increment_branches_when_only_one_branch_is_added ( ) { instruction . addBranch ( new org . jacoco . core . internal . analysis . Instruction ( 122 ) , 0 ) ; "<AssertPlaceHolder>" ; } getBranchCounter ( ) { if ( ( branches ) < 2 ) { return CounterImpl . COUNTER_0_0 ; } final int covered = coveredBranches . cardinality ( ) ; return org . jacoco . core . internal . analysis . CounterImpl . getInstance ( ( ( branches ) - covered ) , covered ) ; } | org . junit . Assert . assertEquals ( CounterImpl . COUNTER_0_0 , instruction . getBranchCounter ( ) ) |
testExecuteUpdate ( ) { com . taobao . tddl . group . jdbc . TGroupConnection conn = null ; java . sql . PreparedStatement stat = null ; try { conn = com . taobao . tddl . group . jdbc . TGroupStatementTest . tgds . getConnection ( ) ; stat = conn . prepareStatement ( "update<sp>xxxx<sp>set<sp>name<sp>=<sp>'newname'" ) ; int affect = stat . executeUpdate ( ) ; "<AssertPlaceHolder>" ; com . taobao . tddl . common . mock . MockDataSource . showTrace ( ) ; } finally { if ( conn != null ) { try { conn . close ( ) ; } catch ( java . sql . SQLException e ) { } if ( stat != null ) { try { stat . close ( ) ; } catch ( java . sql . SQLException e ) { } } } } } executeUpdate ( ) { checkClosed ( ) ; ensureResultSetIsEmpty ( ) ; java . sql . Connection conn = tGroupConnection . getBaseConnection ( sql , false ) ; if ( conn != null ) { sql = com . taobao . tddl . group . utils . GroupHintParser . removeTddlGroupHint ( sql ) ; int updateCount = executeUpdateOnConnection ( conn ) ; super . updateCount = updateCount ; return updateCount ; } else { com . taobao . tddl . group . config . GroupIndex dataSourceIndex = com . taobao . tddl . group . utils . GroupHintParser . convertHint2Index ( sql ) ; sql = com . taobao . tddl . group . utils . GroupHintParser . removeTddlGroupHint ( sql ) ; if ( dataSourceIndex == null ) { dataSourceIndex = com . taobao . tddl . group . jdbc . ThreadLocalDataSourceIndex . getIndex ( ) ; } int updateCount = tGroupDataSource . getDBSelector ( false ) . tryExecute ( null , executeUpdateTryer , retryingTimes , sql , dataSourceIndex ) ; super . updateCount = updateCount ; return updateCount ; } } | org . junit . Assert . assertEquals ( affect , 1 ) |
testGetAllDatabasesForMetaException ( ) { given ( client . getAllDatabases ( ) ) . willThrow ( org . apache . hadoop . hive . metastore . api . MetaException . class ) ; doNothing ( ) . when ( client ) . reconnect ( ) ; "<AssertPlaceHolder>" ; verify ( client ) . getAllDatabases ( ) ; verify ( client ) . reconnect ( ) ; service . getAllDatabases ( ) ; verify ( client , times ( 2 ) ) . reconnect ( ) ; verify ( client , times ( 2 ) ) . getAllDatabases ( ) ; } getAllDatabases ( ) { return hiveMetaStoreService . getAllDatabases ( ) ; } | org . junit . Assert . assertTrue ( ( ( service . getAllDatabases ( ) ) == null ) ) |
fromRollupTypeClassSimpleNumberYieldsBasic ( ) { "<AssertPlaceHolder>" ; } fromRollupTypeClass ( java . lang . Class ) { if ( ( ( rollupTypeClass . equals ( com . rackspacecloud . blueflood . types . SimpleNumber . class ) ) || ( rollupTypeClass . equals ( com . rackspacecloud . blueflood . types . BasicRollup . class ) ) ) || ( rollupTypeClass . equals ( java . lang . String . class ) ) ) { return com . rackspacecloud . blueflood . types . RollupType . BF_BASIC ; } else if ( rollupTypeClass . equals ( com . rackspacecloud . blueflood . types . BluefloodCounterRollup . class ) ) { return com . rackspacecloud . blueflood . types . RollupType . COUNTER ; } else if ( rollupTypeClass . equals ( com . rackspacecloud . blueflood . types . BluefloodSetRollup . class ) ) { return com . rackspacecloud . blueflood . types . RollupType . SET ; } else if ( rollupTypeClass . equals ( com . rackspacecloud . blueflood . types . BluefloodTimerRollup . class ) ) { return com . rackspacecloud . blueflood . types . RollupType . TIMER ; } else if ( rollupTypeClass . equals ( com . rackspacecloud . blueflood . types . BluefloodGaugeRollup . class ) ) { return com . rackspacecloud . blueflood . types . RollupType . GAUGE ; } else throw new java . lang . Error ( java . lang . String . format ( "Cannot<sp>discern<sp>RollupType<sp>from<sp>%s" , rollupTypeClass . getSimpleName ( ) ) ) ; } | org . junit . Assert . assertEquals ( RollupType . BF_BASIC , com . rackspacecloud . blueflood . types . RollupType . fromRollupTypeClass ( com . rackspacecloud . blueflood . types . SimpleNumber . class ) ) |
createDynamicModule ( ) { de . devsurf . injection . guice . scanner . StartupModule startup = de . devsurf . injection . guice . scanner . StartupModule . create ( de . devsurf . injection . guice . scanner . asm . ASMClasspathScanner . class , de . devsurf . injection . guice . scanner . PackageFilter . create ( de . devsurf . injection . guice . test . aop . annotated . AnnotatedInterceptorTests . class ) ) ; startup . addFeature ( de . devsurf . injection . guice . aop . feature . InterceptorFeature . class ) ; com . google . inject . Injector injector = com . google . inject . Guice . createInjector ( startup ) ; "<AssertPlaceHolder>" ; } addFeature ( de . devsurf . injection . guice . scanner . features . ScannerFeature ) { _collector . addScannerFeature ( listener ) ; } | org . junit . Assert . assertNotNull ( injector ) |
test47 ( ) { com . spatial4j . core . context . SpatialContext ctx = com . spatial4j . core . context . SpatialContext . GEO ; int maxLevels = 11 ; org . apache . lucene . spatial . prefix . tree . SpatialPrefixTree grid = new org . apache . lucene . spatial . prefix . tree . GeohashPrefixTree ( ctx , maxLevels ) ; org . apache . blur . analysis . type . spatial . lucene . RecursivePrefixTreeStrategy strategy = new org . apache . blur . analysis . type . spatial . lucene . RecursivePrefixTreeStrategy ( grid , "a.id_gis" , false ) ; com . spatial4j . core . shape . Circle circle = ctx . makeCircle ( ( - 80.0 ) , 33.0 , com . spatial4j . core . distance . DistanceUtils . dist2Degrees ( 10 , DistanceUtils . EARTH_MEAN_RADIUS_MI ) ) ; org . apache . lucene . spatial . query . SpatialArgs args = new org . apache . lucene . spatial . query . SpatialArgs ( org . apache . lucene . spatial . query . SpatialOperation . Intersects , circle ) ; org . apache . lucene . search . Query q1 = sq ( strategy . makeQuery ( args ) ) ; org . apache . lucene . search . Query q = parseSq ( "<a.id_gis:\"Intersects(Circle(33.000000,-80.000000<sp>d=10.0m))\">" ) ; boolean equals = q1 . equals ( q ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( other == null ) { return false ; } if ( other instanceof org . apache . blur . kvs . BytesRef ) { return this . bytesEquals ( ( ( org . apache . blur . kvs . BytesRef ) ( other ) ) ) ; } return false ; } | org . junit . Assert . assertTrue ( equals ) |
testLastMoveWasCapture_WasACapture ( ) { eubos . position . TrackedMove tm = new eubos . position . TrackedMove ( new com . fluxchess . jcpi . models . GenericMove ( "a2b3" ) , new eubos . board . pieces . Pawn ( eubos . board . pieces . Piece . Colour . black , com . fluxchess . jcpi . models . GenericPosition . b3 ) , null ) ; classUnderTest . add ( tm ) ; "<AssertPlaceHolder>" ; } lastMoveWasCapture ( ) { boolean wasCapture = false ; if ( ! ( this . isEmpty ( ) ) ) { wasCapture = this . peek ( ) . isCapture ( ) ; } return wasCapture ; } | org . junit . Assert . assertTrue ( classUnderTest . lastMoveWasCapture ( ) ) |
testGetRestrictionForEmpty ( ) { javax . jcr . Value val = createEntry ( java . util . Collections . < org . apache . jackrabbit . oak . spi . security . authorization . restriction . Restriction > emptySet ( ) ) . getRestriction ( AccessControlConstants . REP_GLOB ) ; "<AssertPlaceHolder>" ; } getRestriction ( java . lang . String ) { return null ; } | org . junit . Assert . assertNull ( val ) |
testGetVerticesByLabel ( ) { java . util . List < org . s1ck . gdl . model . Vertex > bVertices = com . google . common . collect . Lists . newArrayList ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . QUERY_HANDLER . getVerticesByLabel ( "B" ) ) ; java . util . List < org . s1ck . gdl . model . Vertex > expected = com . google . common . collect . Lists . newArrayList ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . GDL_HANDLER . getVertexCache ( ) . get ( "v2" ) , org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . GDL_HANDLER . getVertexCache ( ) . get ( "v3" ) ) ; "<AssertPlaceHolder>" ; } elementsEqual ( java . util . List , java . util . List ) { boolean equal = ( list . size ( ) ) == ( expected . size ( ) ) ; if ( equal ) { list . sort ( java . util . Comparator . comparingLong ( Element :: getId ) ) ; expected . sort ( java . util . Comparator . comparingLong ( Element :: getId ) ) ; for ( int i = 0 ; i < ( list . size ( ) ) ; i ++ ) { if ( ! ( list . get ( i ) . equals ( expected . get ( i ) ) ) ) { equal = false ; break ; } } } return equal ; } | org . junit . Assert . assertTrue ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . elementsEqual ( bVertices , expected ) ) |
testCos ( ) { final org . apache . commons . math4 . analysis . UnivariateFunction cos = new org . apache . commons . math4 . analysis . function . Cos ( ) ; final org . apache . commons . math4 . analysis . integration . gauss . GaussIntegrator integrator = org . apache . commons . math4 . analysis . integration . gauss . LegendreHighPrecisionTest . factory . legendreHighPrecision ( 7 , 0 , ( ( Math . PI ) / 2 ) ) ; final double s = integrator . integrate ( cos ) ; "<AssertPlaceHolder>" ; } ulp ( float ) { if ( java . lang . Float . isInfinite ( x ) ) { return Float . POSITIVE_INFINITY ; } return org . apache . commons . math4 . util . FastMath . abs ( ( x - ( java . lang . Float . intBitsToFloat ( ( ( java . lang . Float . floatToIntBits ( x ) ) ^ 1 ) ) ) ) ) ; } | org . junit . Assert . assertEquals ( 1 , s , java . lang . Math . ulp ( 1.0 ) ) |
testParameters ( ) { "<AssertPlaceHolder>" ; } getParameters ( ) { if ( ( parameters ) == null ) { parameters = new ch . qos . logback . core . net . ssl . SSLParametersConfiguration ( ) ; } return parameters ; } | org . junit . Assert . assertNotNull ( configuration . getParameters ( ) ) |
testFailureIfThetaisNull ( ) { aima . core . logic . fol . parsing . ast . Variable var = new aima . core . logic . fol . parsing . ast . Variable ( "x" ) ; aima . core . logic . fol . parsing . ast . Sentence sentence = parser . parse ( "Knows(x)" ) ; theta = null ; java . util . Map < aima . core . logic . fol . parsing . ast . Variable , aima . core . logic . fol . parsing . ast . Term > result = unifier . unify ( var , sentence , theta ) ; "<AssertPlaceHolder>" ; } unify ( java . util . List , java . util . List , java . util . Map ) { if ( theta == null ) { return null ; } else if ( ( x . size ( ) ) != ( y . size ( ) ) ) { return null ; } else if ( ( ( x . size ( ) ) == 0 ) && ( ( y . size ( ) ) == 0 ) ) { return theta ; } else if ( ( ( x . size ( ) ) == 1 ) && ( ( y . size ( ) ) == 1 ) ) { return unify ( x . get ( 0 ) , y . get ( 0 ) , theta ) ; } else { return unify ( x . subList ( 1 , x . size ( ) ) , y . subList ( 1 , y . size ( ) ) , unify ( x . get ( 0 ) , y . get ( 0 ) , theta ) ) ; } } | org . junit . Assert . assertNull ( result ) |
testConst ( ) { org . roaringbitmap . ArrayContainer ac1 = new org . roaringbitmap . ArrayContainer ( 5 , 15 ) ; short [ ] data = new short [ ] { 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 } ; org . roaringbitmap . ArrayContainer ac2 = new org . roaringbitmap . ArrayContainer ( data ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( ac1 , ac2 ) |
testZipFile_fixture_2 ( ) { com . impetus . ankush . agent . utils . ZipFiles fixture2 = getFixture ( ) ; java . lang . String filePath = "0123456789" ; java . lang . String result = fixture2 . zipFile ( filePath ) ; java . io . File file = new java . io . File ( ( filePath + ".zip" ) ) ; file . delete ( ) ; "<AssertPlaceHolder>" ; } zipFile ( java . lang . String ) { try { zipOutput . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( e . getMessage ( ) ) ; return null ; } return filePath + ".zip" ; } | org . junit . Assert . assertEquals ( null , result ) |
testRequireCapabilityHeaderEquality ( ) { java . lang . String headerStr1 = "osgi.ee;<sp>filter:=\"(osgi.ee=*)\",screen.size;<sp>filter:=\"(&(width>=800)(height>=600))\"" ; java . lang . String headerStr2 = "screen.size;<sp>filter:=\"(&(width>=800)(height>=600))\",osgi.ee;<sp>filter:=\"(osgi.ee=*)\"" ; org . apache . aries . subsystem . core . archive . RequireCapabilityHeader header1 = new org . apache . aries . subsystem . core . archive . RequireCapabilityHeader ( headerStr1 ) ; org . apache . aries . subsystem . core . archive . RequireCapabilityHeader header2 = new org . apache . aries . subsystem . core . archive . RequireCapabilityHeader ( headerStr2 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( header1 , header2 ) |
putsChar ( ) { char [ ] array = new char [ 5 ] ; java . nio . CharBuffer buffer = java . nio . CharBuffer . wrap ( array ) ; buffer . put ( 'T' ) . put ( 'e' ) . put ( 'a' ) . put ( 'V' ) . put ( 'M' ) ; "<AssertPlaceHolder>" ; } put ( E ) { java . util . Objects . requireNonNull ( e ) ; while ( isFull ( ) ) { waitForChange ( 0 ) ; } addImpl ( e ) ; } | org . junit . Assert . assertThat ( array , org . hamcrest . CoreMatchers . is ( new char [ ] { 'T' , 'e' , 'a' , 'V' , 'M' } ) ) |
testCollectionTimeValid ( ) { long currentTime = new com . rackspacecloud . blueflood . utils . DefaultClockImpl ( ) . now ( ) . getMillis ( ) ; metric . setCollectionTime ( currentTime ) ; java . util . Set < javax . validation . ConstraintViolation < com . rackspacecloud . blueflood . inputs . formats . JSONMetric > > constraintViolations = validator . validate ( metric ) ; "<AssertPlaceHolder>" ; } size ( ) { return array . length ; } | org . junit . Assert . assertEquals ( 0 , constraintViolations . size ( ) ) |
testGetLegendItems ( ) { org . jfree . data . xy . XYDataset d0 = createDataset1 ( ) ; org . jfree . data . xy . XYDataset d1 = createDataset2 ( ) ; org . jfree . chart . renderer . xy . XYItemRenderer r0 = new org . jfree . chart . renderer . xy . XYLineAndShapeRenderer ( ) ; org . jfree . chart . plot . XYPlot plot = new org . jfree . chart . plot . XYPlot ( ) ; plot . setDataset ( 0 , d0 ) ; plot . setDataset ( 1 , d1 ) ; plot . setRenderer ( 0 , r0 ) ; org . jfree . chart . LegendItemCollection items = plot . getLegendItems ( ) ; "<AssertPlaceHolder>" ; } getItemCount ( ) { if ( ( this . xPoints ) == null ) { return 0 ; } else { return this . xPoints . size ( ) ; } } | org . junit . Assert . assertEquals ( 2 , items . getItemCount ( ) ) |
isEmpty ( ) { com . psddev . dari . util . ObjectMap objmap = new com . psddev . dari . util . ObjectMap ( new java . lang . Object ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return false ; } | org . junit . Assert . assertTrue ( objmap . isEmpty ( ) ) |
givenValidURI_whenGetResource_thenResultsEqualsExpected ( ) { com . brandwatch . robots . cli . Result result = new com . brandwatch . robots . cli . Result ( com . brandwatch . robots . cli . ResultTest . VALID_RESOURCE , true ) ; "<AssertPlaceHolder>" ; } getResource ( ) { return resource ; } | org . junit . Assert . assertThat ( result . getResource ( ) , org . hamcrest . CoreMatchers . equalTo ( com . brandwatch . robots . cli . ResultTest . VALID_RESOURCE ) ) |
writeCounters ( ) { eu . dnetlib . iis . common . counter . NamedCounters namedCounters = new eu . dnetlib . iis . common . counter . NamedCounters ( new java . lang . String [ ] { counterName1 , counterName2 } ) ; namedCounters . increment ( counterName1 , 4L ) ; namedCounters . increment ( counterName2 , 2L ) ; countersFileWriter . writeCounters ( namedCounters , ( ( tempFolder . getRoot ( ) . getPath ( ) ) + "/counters.properties" ) ) ; java . util . Properties actualProperties = loadProperties ( new java . io . File ( tempFolder . getRoot ( ) , "counters.properties" ) ) ; java . util . Properties expectedProperties = new java . util . Properties ( ) ; expectedProperties . put ( counterName1 , "4" ) ; expectedProperties . put ( counterName2 , "2" ) ; "<AssertPlaceHolder>" ; } put ( java . lang . Object , java . lang . Object ) { return linkMap . put ( key , value ) ; } | org . junit . Assert . assertEquals ( expectedProperties , actualProperties ) |
testGetElement ( ) { System . out . println ( "getElement" ) ; long value = 0L ; kg . apc . charting . AbstractGraphRow instance = new kg . apc . charting . AbstractGraphRowTest . AbstractGraphRowImpl ( ) ; kg . apc . charting . AbstractGraphPanelChartElement result = instance . getElement ( value ) ; "<AssertPlaceHolder>" ; } getElement ( long ) { return graphRow . getElement ( value ) ; } | org . junit . Assert . assertNotNull ( result ) |
timezoneOffsetSpecificValues ( ) { java . lang . String n = "" ; for ( int i = 1 ; i <= 9 ; i ++ ) { n += ( ( char ) ( 48 + i ) ) ; com . dslplatform . json . OffsetDateTime value = com . dslplatform . json . OffsetDateTime . parse ( ( ( "1919-03-05T04:51:49." + n ) + "+01:00" ) ) ; com . dslplatform . json . JsonWriter jw = new com . dslplatform . json . JsonWriter ( null ) ; com . dslplatform . json . JavaTimeConverter . serialize ( value , jw ) ; com . dslplatform . json . JsonReader jr = new com . dslplatform . json . JsonReader ( jw . toString ( ) . getBytes ( "UTF-8" ) , null ) ; jr . read ( ) ; com . dslplatform . json . OffsetDateTime deser = com . dslplatform . json . JavaTimeConverter . deserializeDateTime ( jr ) ; "<AssertPlaceHolder>" ; } } deserializeDateTime ( com . dslplatform . json . JsonReader ) { final char [ ] tmp = reader . readSimpleQuote ( ) ; final int len = ( ( reader . getCurrentIndex ( ) ) - ( reader . getTokenStart ( ) ) ) - 1 ; if ( ( ( ( ( ( ( ( ( len > 19 ) && ( len < 31 ) ) && ( ( tmp [ ( len - 1 ) ] ) == 'Z' ) ) && ( ( tmp [ 4 ] ) == '-' ) ) && ( ( tmp [ 7 ] ) == '-' ) ) && ( ( ( ( tmp [ 10 ] ) == 'T' ) || ( ( tmp [ 10 ] ) == 't' ) ) || ( ( tmp [ 10 ] ) == '<sp>' ) ) ) && ( ( tmp [ 13 ] ) == ':' ) ) && ( ( tmp [ 16 ] ) == ':' ) ) && ( com . dslplatform . json . JavaTimeConverter . allDigits ( tmp , 20 , ( len - 1 ) ) ) ) { final int year = com . dslplatform . json . NumberConverter . read4 ( tmp , 0 ) ; final int month = com . dslplatform . json . NumberConverter . read2 ( tmp , 5 ) ; final int day = com . dslplatform . json . NumberConverter . read2 ( tmp , 8 ) ; final int hour = com . dslplatform . json . NumberConverter . read2 ( tmp , 11 ) ; final int min = com . dslplatform . json . NumberConverter . read2 ( tmp , 14 ) ; final int sec = com . dslplatform . json . NumberConverter . read2 ( tmp , 17 ) ; if ( ( tmp [ 19 ] ) == '.' ) { final int nanos = com . dslplatform . json . JavaTimeConverter . readNanos ( tmp , ( len - 1 ) ) ; return com . dslplatform . json . OffsetDateTime . of ( year , month , day , hour , min , sec , nanos , ZoneOffset . UTC ) ; } return com . dslplatform . json . OffsetDateTime . of ( year , month , day , hour , min , sec , 0 , ZoneOffset . UTC ) ; } else if ( ( ( ( ( ( ( ( ( ( ( len > 22 ) && ( len < 36 ) ) && ( ( tmp [ ( len - 3 ) ] ) == ':' ) ) && ( ( ( tmp [ ( len - 6 ) ] ) == '+' ) || ( ( tmp [ ( len - 6 ) ] ) == '-' ) ) ) && ( ( tmp [ 4 ] ) == '-' ) ) && ( ( tmp [ 7 ] ) == '-' ) ) && ( ( ( ( tmp [ 10 ] ) == 'T' ) || ( ( tmp [ 10 ] ) == 't' ) ) || ( ( tmp [ 10 ] ) == '<sp>' ) ) ) && ( ( tmp [ 13 ] ) == ':' ) ) && ( ( tmp [ 16 ] ) == ':' ) ) && ( com . dslplatform . json . JavaTimeConverter . allDigits ( tmp , ( len - 2 ) , len ) ) ) && ( com . dslplatform . json . JavaTimeConverter . allDigits ( tmp , ( len - 5 ) , ( len - 3 ) ) ) ) { final int year = com . dslplatform . json . NumberConverter . read4 ( tmp , 0 ) ; final int month = com . dslplatform . json . NumberConverter . read2 ( tmp , 5 ) ; final int day = com . dslplatform . json . NumberConverter . read2 ( tmp , 8 ) ; final int hour = com . dslplatform . json . NumberConverter . read2 ( tmp , 11 ) ; final int min = com . dslplatform . json . NumberConverter . read2 ( tmp , 14 ) ; final int sec = com . dslplatform . json . NumberConverter . read2 ( tmp , 17 ) ; final int offHour = com . dslplatform . json . NumberConverter . read2 ( tmp , ( len - 5 ) ) ; final int offMin = com . dslplatform . json . NumberConverter . read2 ( tmp , ( len - 2 ) ) ; final com . dslplatform . json . ZoneOffset offset = com . dslplatform . json . ZoneOffset . ofHoursMinutes ( ( ( tmp [ ( len - 6 ) ] ) == '+' ? offHour : - offHour ) , offMin ) ; if ( ( tmp [ 19 ] ) | org . junit . Assert . assertEquals ( value , deser ) |
testGetParameters ( ) { java . lang . Long personPaperId = 1L ; org . lnu . is . domain . person . paper . PersonPaper personPaper = new org . lnu . is . domain . person . paper . PersonPaper ( ) ; personPaper . setId ( personPaperId ) ; java . lang . Long benefitId = 2L ; org . lnu . is . domain . benefit . Benefit benefit = new org . lnu . is . domain . benefit . Benefit ( ) ; benefit . setId ( benefitId ) ; java . lang . Long enrolmentId = 3L ; org . lnu . is . domain . enrolment . Enrolment enrolment = new org . lnu . is . domain . enrolment . Enrolment ( ) ; enrolment . setId ( enrolmentId ) ; org . lnu . is . domain . enrolment . benefit . EnrolmentBenefit entity = new org . lnu . is . domain . enrolment . benefit . EnrolmentBenefit ( ) ; entity . setPersonPaper ( personPaper ) ; entity . setBenefit ( benefit ) ; entity . setEnrolment ( enrolment ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "enrolment" , enrolment ) ; expected . put ( "benefit" , benefit ) ; expected . put ( "personPaper" , personPaper ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; when ( personPaperDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( personPaper ) ; when ( enrolmentDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( enrolment ) ; when ( benefitDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( benefit ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; verify ( personPaperDao ) . getEntityById ( personPaperId ) ; verify ( enrolmentDao ) . getEntityById ( enrolmentId ) ; verify ( benefitDao ) . getEntityById ( benefitId ) ; "<AssertPlaceHolder>" ; } getEntityById ( KEY ) { org . lnu . is . dao . dao . DefaultDao . LOG . info ( "Getting<sp>{}.entity<sp>wit<sp>id" , getEntityClass ( ) . getSimpleName ( ) , id ) ; return persistenceManager . findById ( getEntityClass ( ) , id ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testTimeout ( ) { io . craft . atom . io . IoConnector connector = io . craft . atom . nio . api . NioFactory . newTcpConnector ( new io . craft . atom . nio . NioConnectorHandler ( ) ) ; java . util . concurrent . Future < io . craft . atom . io . Channel < byte [ ] > > future = connector . connect ( "127.0.0.1" , io . craft . atom . test . AvailablePortFinder . getNextAvailable ( ) ) ; try { future . get ( 200 , TimeUnit . MILLISECONDS ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . InterruptedException e ) { } catch ( java . util . concurrent . ExecutionException e ) { } catch ( java . util . concurrent . TimeoutException e ) { io . craft . atom . nio . TestNioTcpConnector . LOG . debug ( "[CRAFT-ATOM-NIO]<sp>Test<sp>catch<sp>timeout<sp>exception" ) ; "<AssertPlaceHolder>" ; } System . out . println ( java . lang . String . format ( "[CRAFT-ATOM-NIO]<sp>(^_^)<sp><%s><sp>Case<sp>-><sp>test<sp>nio<sp>tcp<sp>connector<sp>timeout.<sp>" , io . craft . atom . test . CaseCounter . incr ( 1 ) ) ) ; } get ( java . lang . String , java . lang . String ) { return sharded . shard ( shardkey ) . get ( key ) ; } | org . junit . Assert . assertTrue ( true ) |
testDestroyingInterceptedDependentBean ( javax . enterprise . inject . Instance ) { org . jboss . weld . tests . instance . destroy . dependent . Intercepted reference = instance . get ( ) ; reference . foo ( ) ; org . jboss . weld . tests . instance . destroy . dependent . Interceptor . reset ( ) ; instance . destroy ( reference ) ; "<AssertPlaceHolder>" ; } isDestroyed ( ) { return org . jboss . weld . tests . instance . destroy . dependent . Interceptor . destroyed ; } | org . junit . Assert . assertTrue ( org . jboss . weld . tests . instance . destroy . dependent . Interceptor . isDestroyed ( ) ) |
invalidStringGreaterThanConstraintShouldCreateViolations ( ) { java . util . Set < javax . validation . ConstraintViolation < org . alien4cloud . tosca . model . definitions . PropertyDefinition > > violations = validator . validate ( createGreaterThanDefinition ( ToscaTypes . STRING . toString ( ) , "value" ) , alien4cloud . tosca . container . validation . ToscaSequence . class ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "name:<sp>[" + ( name ) ) + "],<sp>value:<sp>[" ) + ( value ) ) + "]" ; } | org . junit . Assert . assertEquals ( 2 , violations . size ( ) ) |
isCancelledTrueSuccess ( ) { final java . util . Map < java . lang . String , java . lang . Object > context = new java . util . HashMap ( ) ; com . microsoft . azure . sdk . iot . device . fileupload . FileUploadInProgress fileUploadInProgress = mockit . Deencapsulation . newInstance ( com . microsoft . azure . sdk . iot . device . fileupload . FileUploadInProgress . class , new java . lang . Class [ ] { com . microsoft . azure . sdk . iot . device . IotHubEventCallback . class , java . lang . Object . class } , mockIotHubEventCallback , context ) ; mockit . Deencapsulation . invoke ( fileUploadInProgress , "setTask" , new java . lang . Class [ ] { java . util . concurrent . Future . class } , mockFuture ) ; new mockit . NonStrictExpectations ( ) { { mockFuture . isCancelled ( ) ; result = true ; times = 1 ; } } ; boolean result = ( ( boolean ) ( mockit . Deencapsulation . invoke ( fileUploadInProgress , "isCancelled" ) ) ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return this . task . isCancelled ( ) ; } | org . junit . Assert . assertTrue ( result ) |
testComposite ( ) { org . apache . activemq . command . ActiveMQDestination q1 = new org . apache . activemq . command . ActiveMQQueue ( "queue1,topic://topic1" ) ; java . util . Set < org . apache . activemq . jaas . GroupPrincipal > aclsq1 = org . apache . activemq . security . LDAPAuthorizationMapTest . authMap . getWriteACLs ( q1 ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , aclsq1 . size ( ) ) |
generatesRgroupPseudoAtom ( ) { org . openscience . cdk . interfaces . IAtomContainer container = mock ( org . openscience . cdk . interfaces . IAtomContainer . class ) ; org . openscience . cdk . interfaces . IPseudoAtom atom = mock ( org . openscience . cdk . interfaces . IPseudoAtom . class ) ; when ( atom . getLabel ( ) ) . thenReturn ( "R1" ) ; org . openscience . cdk . renderer . generators . standard . AtomSymbol atomSymbol = atomGenerator . generateSymbol ( container , atom , HydrogenPosition . Left , new org . openscience . cdk . renderer . RendererModel ( ) ) ; 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 ( 2 ) ) |
testCreate ( ) { org . oscarehr . common . model . LabTestResults entity = new org . oscarehr . common . model . LabTestResults ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; } | org . junit . Assert . assertNotNull ( entity . getId ( ) ) |
testUnassignedAction ( ) { org . eclipse . xtend2 . lib . StringConcatenation _builder = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder . append ( "Rule:<sp>{Action};" ) ; _builder . newLine ( ) ; final java . lang . String actual = this . toPda ( _builder ) ; org . eclipse . xtend2 . lib . StringConcatenation _builder_1 = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder_1 . append ( "Rule:" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "start<sp>-><sp>{Action}" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "{Action}<sp>-><sp>stop" ) ; _builder_1 . newLine ( ) ; final java . lang . String expected = _builder_1 . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . Joiner . on ( "\n" ) . join ( getList ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
takingWriteLockMustInvalidateOptimisticReadLock ( ) { long r = pageList . tryOptimisticReadLock ( pageRef ) ; pageList . tryWriteLock ( pageRef ) ; "<AssertPlaceHolder>" ; } validateReadLock ( long , long ) { org . neo4j . unsafe . impl . internal . dragons . UnsafeUtil . loadFence ( ) ; return ( ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . getState ( address ) ) & ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . CHK_MASK ) ) == stamp ; } | org . junit . Assert . assertFalse ( pageList . validateReadLock ( pageRef , r ) ) |
testSetGetClientIdNewContext ( ) { final java . lang . String id = "123" ; javax . jms . JMSContext c = context ; c . setClientID ( id ) ; javax . jms . JMSContext c2 = addContext ( c . createContext ( Session . CLIENT_ACKNOWLEDGE ) ) ; "<AssertPlaceHolder>" ; } getClientID ( ) { return null ; } | org . junit . Assert . assertEquals ( id , c2 . getClientID ( ) ) |
shouldGetCredentialsFromJvmEnv ( ) { br . com . uol . pagseguro . api . PagSeguroEnv expectedEnv = br . com . uol . pagseguro . api . PagSeguroEnv . SANDBOX ; when ( jvmEnvVariableEnvironmentProvider . getEnvironment ( ) ) . thenReturn ( expectedEnv ) ; br . com . uol . pagseguro . api . PagSeguroEnv env = providerChain . getEnvironment ( ) ; "<AssertPlaceHolder>" ; org . mockito . InOrder inOrder = inOrder ( jvmEnvVariableEnvironmentProvider , systemPropEnvironmentProvider , systemEnvVariableEnvironmentProvider ) ; inOrder . verify ( jvmEnvVariableEnvironmentProvider , times ( 1 ) ) . getEnvironment ( ) ; inOrder . verify ( systemPropEnvironmentProvider , times ( 0 ) ) . getEnvironment ( ) ; inOrder . verify ( systemEnvVariableEnvironmentProvider , times ( 0 ) ) . getEnvironment ( ) ; inOrder . verifyNoMoreInteractions ( ) ; } getEnvironment ( ) { br . com . uol . pagseguro . api . environment . JVMEnvVariableEnvironmentProvider . LOGGER . info ( "Lendo<sp>configuracoes<sp>de<sp>ambiente" ) ; final br . com . uol . pagseguro . api . PagSeguroEnv environment ; if ( ( java . lang . System . getProperty ( "pagseguro.environment" ) ) != null ) { environment = br . com . uol . pagseguro . api . PagSeguroEnv . fromName ( java . lang . System . getProperty ( "pagseguro.environment" ) ) ; } else { throw new java . lang . IllegalArgumentException ( "Environment<sp>property<sp>not<sp>found" ) ; } br . com . uol . pagseguro . api . environment . JVMEnvVariableEnvironmentProvider . LOGGER . info ( "Configuracoes<sp>de<sp>ambiente<sp>lidas" ) ; return environment ; } | org . junit . Assert . assertEquals ( expectedEnv , env ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.