input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testGetHeaderWordWrap_Initial ( ) { "<AssertPlaceHolder>" ; } getHeaderWordWrap ( ) { checkWidget ( ) ; return headerWordWrap ; }
|
org . junit . Assert . assertFalse ( column . getHeaderWordWrap ( ) )
|
testCheckTimeoutPreparing ( ) { final java . lang . Exception [ ] checkTimeoutException = new com . sun . sgs . test . impl . service . transaction . Exception [ ] { null } ; com . sun . sgs . test . util . DummyTransactionParticipant [ ] participants = new com . sun . sgs . test . util . DummyTransactionParticipant [ ] { new com . sun . sgs . test . util . DummyNonDurableTransactionParticipant ( ) { public boolean prepare ( com . sun . sgs . service . Transaction txn ) throws com . sun . sgs . test . impl . service . transaction . Exception { try { txn . checkTimeout ( ) ; return super . prepare ( txn ) ; } catch ( java . lang . RuntimeException e ) { checkTimeoutException [ 0 ] = e ; throw e ; } } } , new com . sun . sgs . test . util . DummyTransactionParticipant ( ) } ; for ( com . sun . sgs . test . util . DummyTransactionParticipant participant : participants ) { txn . join ( participant ) ; } handle . commit ( ) ; "<AssertPlaceHolder>" ; } commit ( ) { isCommitted = true ; checkFlush ( ) ; }
|
org . junit . Assert . assertNull ( checkTimeoutException [ 0 ] )
|
entityMapping_shouldThrowPersistenceExceptionOnDuplicateBook ( ) { com . kiroule . example . springjpaunitils . domain . Book book = em . find ( com . kiroule . example . springjpaunitils . domain . Book . class , com . kiroule . example . springjpaunitils . persistence . ID ) ; "<AssertPlaceHolder>" ; em . persist ( getNewBook ( ) ) ; }
|
org . junit . Assert . assertNotNull ( book )
|
itCorrectlyMarshalsAndUnmarshalsAnEntry ( ) { hudson . plugins . cigame . model . ScoreHistoryEntry unmarshaled = umarshal ( marshal ( ) ) ; "<AssertPlaceHolder>" ; } marshal ( ) { com . thoughtworks . xstream . XStream xStream = createXStream ( null ) ; java . lang . String xml = xStream . toXML ( this . entry ) ; return xml ; }
|
org . junit . Assert . assertEquals ( this . entry , unmarshaled )
|
isLeaseEnteringDangerZone_whenThereAreZeroOrLessMillisUntilEnterDangerZone_returnTrue ( ) { com . amazonaws . services . dynamodbv2 . SessionMonitor sut = org . powermock . api . mockito . PowerMockito . spy ( new com . amazonaws . services . dynamodbv2 . SessionMonitor ( 1000 , java . util . Optional . empty ( ) ) ) ; when ( sut . millisecondsUntilLeaseEntersDangerZone ( 25L ) ) . thenReturn ( 0L ) ; "<AssertPlaceHolder>" ; } isLeaseEnteringDangerZone ( long ) { return ( this . millisecondsUntilLeaseEntersDangerZone ( lastAbsoluteTimeUpdatedMillis ) ) <= 0 ; }
|
org . junit . Assert . assertTrue ( sut . isLeaseEnteringDangerZone ( 25L ) )
|
testParseFTPEntry ( ) { final int EXPECTED_RECORD_COUNT = 4 ; long i = listing . stream ( ) . map ( parser :: parseFTPEntry ) . filter ( Objects :: nonNull ) . count ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( EXPECTED_RECORD_COUNT , i )
|
testUnsupportedTypeCollection ( ) { org . switchyard . serial . jackson . JacksonSerializationData . Car car = new org . switchyard . serial . jackson . JacksonSerializationData . Car ( ) ; java . util . Collection < org . switchyard . serial . jackson . JacksonSerializationData . Part > ep = new java . util . ArrayList < org . switchyard . serial . jackson . JacksonSerializationData . Part > ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { ep . add ( new org . switchyard . serial . jackson . JacksonSerializationData . Wheel ( ) ) ; } ep . add ( new org . switchyard . serial . jackson . JacksonSerializationData . ExpiredPart ( new java . util . Date ( ) ) ) ; car . setExpensiveParts ( ep ) ; car = serDeser ( car , org . switchyard . serial . jackson . JacksonSerializationData . Car . class ) ; "<AssertPlaceHolder>" ; } getExpensiveParts ( ) { return _expensiveParts ; }
|
org . junit . Assert . assertEquals ( 4 , car . getExpensiveParts ( ) . size ( ) )
|
runMatcherTests ( ) { nl . basjes . parse . useragent . debug . UserAgentAnalyzerTester uaa = new nl . basjes . parse . useragent . debug . UserAgentAnalyzerTester ( "classpath*:Matcher-tests.yaml" ) ; "<AssertPlaceHolder>" ; } runTests ( boolean , boolean ) { return runTests ( showAll , failOnUnexpected , null , false , false ) ; }
|
org . junit . Assert . assertTrue ( uaa . runTests ( false , false ) )
|
testToString ( ) { subject = new org . gitlab . runner . GitlabCIv1 ( org . gitlab . runner . GitlabCIv1Test . conf ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( "GitlabCI:<sp>(" ) ; sb . append ( config . apiUrl ( ) ) . append ( ")" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertNotNull ( subject . toString ( ) )
|
shouldReturnOriginalValueIfInputIsAnEntitySeed ( ) { final uk . gov . gchq . gaffer . operation . data . EntitySeed input = new uk . gov . gchq . gaffer . operation . data . EntitySeed ( "item" ) ; final uk . gov . gchq . gaffer . operation . function . ToElementId function = new uk . gov . gchq . gaffer . operation . function . ToElementId ( ) ; final uk . gov . gchq . gaffer . data . element . id . ElementId output = function . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Object ) { if ( null == value ) { return null ; } if ( value instanceof java . lang . Number ) { return ( ( java . lang . Number ) ( value ) ) . intValue ( ) ; } if ( value instanceof java . lang . String ) { return java . lang . Integer . valueOf ( ( ( java . lang . String ) ( value ) ) ) ; } throw new java . lang . IllegalArgumentException ( ( "Could<sp>not<sp>convert<sp>value<sp>to<sp>Integer:<sp>" + value ) ) ; }
|
org . junit . Assert . assertSame ( input , output )
|
getColorTestRight ( ) { classUnderTest = new de . vksi . c4j . acceptancetest . point . ColoredPoint ( 1 , 0 , de . vksi . c4j . acceptancetest . point . Color . GREEN ) ; "<AssertPlaceHolder>" ; } getColor ( ) { if ( de . vksi . c4j . Condition . postCondition ( ) ) { de . vksi . c4j . acceptancetest . point . Color result = de . vksi . c4j . Condition . result ( de . vksi . c4j . acceptancetest . point . Color . class ) ; assert result != null : "result<sp>not<sp>null" ; } return de . vksi . c4j . Condition . ignored ( ) ; }
|
org . junit . Assert . assertTrue ( classUnderTest . getColor ( ) . equals ( Color . GREEN ) )
|
testGreaterEquals ( ) { java . lang . String o = "foo" ; com . gigaspaces . internal . query . predicate . comparison . GreaterEqualsSpacePredicate p = com . gigaspaces . internal . query . predicate . SpacePredicates . greaterEqual ( o ) ; "<AssertPlaceHolder>" ; } getExpectedValue ( ) { return this . _expectedValue ; }
|
org . junit . Assert . assertSame ( o , p . getExpectedValue ( ) )
|
testGetTemplateResource ( ) { com . liferay . portal . kernel . template . TemplateResource templateResource = com . liferay . portal . kernel . template . TemplateResourceLoaderUtil . getTemplateResource ( TestTemplateResourceLoader . TEST_TEMPLATE_RESOURCE_LOADER_NAME , TestTemplateResource . TEST_TEMPLATE_RESOURCE_TEMPLATE_ID ) ; java . lang . Class < ? > clazz = templateResource . getClass ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return com . liferay . portal . kernel . template . bundle . templateresourceloaderutil . TestTemplateResourceLoader . TEST_TEMPLATE_RESOURCE_LOADER_NAME ; }
|
org . junit . Assert . assertEquals ( com . liferay . portal . kernel . template . bundle . templateresourceloaderutil . TestTemplateResource . class . getName ( ) , clazz . getName ( ) )
|
getsControlPath ( ) { org . hamcrest . Matcher < org . eclipse . swt . widgets . Button > withText = withText ( "One" ) ; java . util . List < org . eclipse . swt . widgets . Button > labels = controlFinder . findControls ( org . hamcrest . Matchers . allOf ( widgetOfType ( org . eclipse . swt . widgets . Button . class ) , withText ) ) ; org . eclipse . swt . widgets . Widget w = labels . get ( 0 ) ; org . eclipse . swtbot . swt . finder . utils . TreePath path = controlFinder . getPath ( w ) ; "<AssertPlaceHolder>" ; } getSegmentCount ( ) { return segments . length ; }
|
org . junit . Assert . assertEquals ( 7 , path . getSegmentCount ( ) )
|
testCreateCertificate ( ) { com . myjeeva . digitalocean . pojo . Certificate certificate = new com . myjeeva . digitalocean . pojo . Certificate ( "my-cert" , "privateKey" , "leafCertificate" , "certificateChain" ) ; com . myjeeva . digitalocean . pojo . Certificate result = apiClient . createCertificate ( certificate ) ; "<AssertPlaceHolder>" ; log . info ( result . toString ( ) ) ; } createCertificate ( com . myjeeva . digitalocean . pojo . Certificate ) { if ( ( ( ( ( null == certificate ) || ( org . apache . commons . lang3 . StringUtils . isBlank ( certificate . getName ( ) ) ) ) || ( org . apache . commons . lang3 . StringUtils . isBlank ( certificate . getPrivateKey ( ) ) ) ) || ( org . apache . commons . lang3 . StringUtils . isBlank ( certificate . getLeafCertificate ( ) ) ) ) || ( org . apache . commons . lang3 . StringUtils . isBlank ( certificate . getCertificateChain ( ) ) ) ) { throw new java . lang . IllegalArgumentException ( "Missing<sp>required<sp>parameters<sp>[Name,<sp>Private<sp>Key,<sp>Leaf<sp>Certificate,<sp>Certificate<sp>Chain]<sp>for<sp>create<sp>certificate." ) ; } return ( ( com . myjeeva . digitalocean . pojo . Certificate ) ( perform ( new com . myjeeva . digitalocean . impl . ApiRequest ( com . myjeeva . digitalocean . common . ApiAction . CREATE_CERTIFICATE , certificate ) ) . getData ( ) ) ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testConvertWithDisabledStatusConstraint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . benefit . BenefitType context = new org . lnu . is . domain . benefit . BenefitType ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>BenefitType<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . benefit . BenefitType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
testDecode ( ) { org . traccar . protocol . Gl200ProtocolDecoder decoder = new org . traccar . protocol . Gl200ProtocolDecoder ( null ) ; decoder . setDataManager ( new org . traccar . helper . TestDataManager ( ) ) ; "<AssertPlaceHolder>" ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,04040C,359231038939904,,,10,1,2,0.0,117,346.0,8.924243,50.798077,20130618122040,0262,0002,0299,109C,00,0.0,,,,,,,,,20130618122045,00F6" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 3 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTINF,359464030073766,8938003990320469804f,18,99,100,1,0,+2.00,0,20131018084015,00EE,0103090402" 0 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 7 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 6 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 9 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,07000D,868487001005941,,0,0,1,1,0.0,0,46.3,-77.039627,38.907573,20120731175232,0310,0260,B44B,EBC9,0015e96913a7,-58,,100,20120731175244,0114" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 2 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 8 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTIOB,0F0100,135790246811220,,,10,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,2000.0,20090214093254,11F0$" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTGEO,0F0100,135790246811220,,,00,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,2000.0,20090214093254,11F0$" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTINF,359464030073766,8938003990320469804f,18,99,100,1,0,+2.00,0,20131018084015,00EE,0103090402" 1 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 4 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTRTL,0F0100,135790246811220,,,00,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,2000.0,20090214093254,11F0$" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTDOG,0F0100,135790246811220,,,01,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,2000.0,20090214093254,11F0$" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTINF,359464030073766,8938003990320469804f,18,99,100,1,0,+2.00,0,20131018084015,00EE,0103090402" 2 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTHBM,0F0100,135790246811220,,,10,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,2000.0,20090214093254,11F0$" ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 1 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 0 ) ) ; verify ( decoder . decode ( null , null , "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0" 5 ) ) ; } decode ( org . jboss . netty . channel . ChannelHandlerContext , org . jboss . netty . channel . Channel , java . lang . Object ) { return null ; }
|
org . junit . Assert . assertNull ( decoder . decode ( null , null , "+RESP:GTINF,359464030073766,8938003990320469804f,18,99,100,1,0,+2.00,0,20131018084015,00EE,0103090402" ) )
|
testApplyEvil ( ) { com . sun . mail . util . logging . SeverityComparator a = new com . sun . mail . util . logging . SeverityComparator ( ) ; final int len = 7 ; final java . lang . Class < ? extends java . lang . Throwable > type = com . sun . mail . util . logging . Exception . class ; java . lang . Throwable l = a . apply ( createEvilThrowable ( type , len ) ) ; "<AssertPlaceHolder>" ; } createEvilThrowable ( java . lang . Class , int ) { java . lang . Throwable tail = create ( t , null ) ; java . lang . Throwable head = tail ; for ( int i = 1 ; i < len ; i ++ ) { head = create ( t , head ) ; } tail . initCause ( head ) ; return head ; }
|
org . junit . Assert . assertEquals ( type , l . getClass ( ) )
|
testBuildWithDisabledDefaultConstraint ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . optype . OperationType context = new org . lnu . is . domain . optype . OperationType ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>OperationType<sp>e<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . optype . OperationType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testEncode ( ) { org . mobicents . media . server . impl . rtp . RtpHeader h = new org . mobicents . media . server . impl . rtp . RtpHeader ( ) ; h . init ( false , ( ( byte ) ( 3 ) ) , 2072 , ( ( int ) ( 2770325173L ) ) , 1463638458L ) ; byte [ ] res = h . toByteArray ( ) ; for ( int i = 0 ; i < 12 ; i ++ ) { "<AssertPlaceHolder>" ; } } toByteArray ( ) { java . io . ByteArrayOutputStream bout = new java . io . ByteArrayOutputStream ( ) ; bout . write ( 128 ) ; bout . write ( payloadType ) ; bout . write ( ( ( byte ) ( ( ( seqNumber ) & 65280 ) > > 8 ) ) ) ; bout . write ( ( ( byte ) ( ( seqNumber ) & 255 ) ) ) ; bout . write ( ( ( byte ) ( ( ( timestamp ) & - 16777216 ) > > 24 ) ) ) ; bout . write ( ( ( byte ) ( ( ( timestamp ) & 16711680 ) > > 16 ) ) ) ; bout . write ( ( ( byte ) ( ( ( timestamp ) & 65280 ) > > 8 ) ) ) ; bout . write ( ( ( byte ) ( ( timestamp ) & 255 ) ) ) ; bout . write ( ( ( byte ) ( ( ( ssrc ) & - 16777216 ) > > 24 ) ) ) ; bout . write ( ( ( byte ) ( ( ( ssrc ) & 16711680 ) > > 16 ) ) ) ; bout . write ( ( ( byte ) ( ( ( ssrc ) & 65280 ) > > 8 ) ) ) ; bout . write ( ( ( byte ) ( ( ssrc ) & 255 ) ) ) ; bout . write ( payload , offset , length ) ; return bout . toByteArray ( ) ; }
|
org . junit . Assert . assertEquals ( packet [ i ] , res [ i ] )
|
shouldFormatNullStatusMessage ( ) { java . lang . String message = null ; java . lang . String expected = "" ; java . lang . String formatted = writer . formatStatusMessage ( message ) ; "<AssertPlaceHolder>" ; } formatStatusMessage ( java . lang . String ) { if ( message == null ) { return "" ; } java . lang . String formatted = message . replaceAll ( "\"" , "" ) ; return stripTrailingLineFeedAndSurroundWithDoubleQuotes ( formatted ) ; }
|
org . junit . Assert . assertThat ( formatted , org . hamcrest . CoreMatchers . is ( expected ) )
|
getLongRunningTasksWrappedFutureTest ( ) { statWrapper . submit ( new org . threadly . test . concurrent . TestRunnable ( ) { @ org . threadly . concurrent . wrapper . statistics . Override public void handleRunStart ( ) { "<AssertPlaceHolder>" ; } } ) ; } getLongRunningTasks ( long ) { java . util . List < org . threadly . util . Pair < java . lang . Runnable , java . lang . StackTraceElement [ ] > > result = new java . util . ArrayList ( ) ; if ( statsContainer . accurateTime ) { org . threadly . util . Clock . accurateForwardProgressingMillis ( ) ; } for ( Map . Entry < org . threadly . util . Pair < java . lang . Thread , java . lang . Runnable > , java . lang . Long > e : statsContainer . runningTasks . entrySet ( ) ) { if ( ( ( org . threadly . util . Clock . lastKnownForwardProgressingMillis ( ) ) - ( e . getValue ( ) ) ) > durationLimitMillis ) { java . lang . Runnable task = e . getKey ( ) . getRight ( ) ; if ( task instanceof org . threadly . concurrent . future . ListenableFutureTask ) { org . threadly . concurrent . future . ListenableFutureTask < ? > lft = ( ( org . threadly . concurrent . future . ListenableFutureTask < ? > ) ( task ) ) ; if ( ( lft . getContainedCallable ( ) ) instanceof org . threadly . concurrent . RunnableCallableAdapter ) { org . threadly . concurrent . RunnableCallableAdapter < ? > rca = ( ( org . threadly . concurrent . RunnableCallableAdapter < ? > ) ( lft . getContainedCallable ( ) ) ) ; task = rca . getContainedRunnable ( ) ; } } java . lang . StackTraceElement [ ] stack = e . getKey ( ) . getLeft ( ) . getStackTrace ( ) ; if ( statsContainer . runningTasks . containsKey ( e . getKey ( ) ) ) { result . add ( new org . threadly . util . Pair ( task , stack ) ) ; } } } return result ; }
|
org . junit . Assert . assertTrue ( ( ( statWrapper . getLongRunningTasks ( ( - 1 ) ) . get ( 0 ) . getLeft ( ) ) == ( this ) ) )
|
testCheckMetadataNotWhenUpdatePolicyIsNeverAndTimestampIsUnavailable ( ) { org . sonatype . aether . impl . UpdateCheck < org . sonatype . aether . metadata . Metadata , org . sonatype . aether . transfer . MetadataTransferException > check = newMetadataCheck ( ) ; check . setPolicy ( RepositoryPolicy . UPDATE_POLICY_NEVER ) ; session . setNotFoundCachingEnabled ( true ) ; manager . checkMetadata ( session , check ) ; "<AssertPlaceHolder>" ; } isRequired ( ) { return required ; }
|
org . junit . Assert . assertEquals ( false , check . isRequired ( ) )
|
testEqualScreenshotsMaskedPass ( ) { com . vaadin . testbench . screenshot . ImageComparison ic = new com . vaadin . testbench . screenshot . ImageComparison ( ) ; java . awt . image . BufferedImage screenshotImage = com . vaadin . testbench . testutils . ImageLoader . loadImage ( com . vaadin . testbench . screenshot . ScreenshotMaskingTest . FOLDER , "google1.png" ) ; java . awt . image . BufferedImage referenceImage = com . vaadin . testbench . testutils . ImageLoader . loadImage ( com . vaadin . testbench . screenshot . ScreenshotMaskingTest . FOLDER , "google1-masked.png" ) ; "<AssertPlaceHolder>" ; } imageEqualToReference ( java . awt . image . BufferedImage , java . awt . image . BufferedImage , java . lang . String , double ) { com . vaadin . testbench . screenshot . ImageFileUtil . createScreenshotDirectoriesIfNeeded ( ) ; com . vaadin . testbench . screenshot . ImageComparison . ComparisonParameters param = com . vaadin . testbench . screenshot . ImageComparison . createParameters ( referenceImage , screenshotImage , errorTolerance ) ; com . vaadin . testbench . screenshot . ScreenShotFailureReporter failureReporter = compareImages ( param ) ; if ( failureReporter != null ) { failureReporter . createErrorImageAndHTML ( referenceFileName , screenshotImage ) ; return false ; } return true ; }
|
org . junit . Assert . assertTrue ( ic . imageEqualToReference ( screenshotImage , referenceImage , "google1-masked.png" , 0 ) )
|
testEmptyDirectory ( ) { java . nio . file . Path rootDir = java . nio . file . Paths . get ( "root" ) ; java . nio . file . Path tmp = temporaryFolder . getRoot ( ) . toPath ( ) ; java . nio . file . Files . createDirectory ( tmp . resolve ( rootDir ) ) ; try ( org . apache . flink . runtime . rest . handler . FileUploads fileUploads = new org . apache . flink . runtime . rest . handler . FileUploads ( tmp . resolve ( rootDir ) ) ) { java . util . Collection < java . io . File > detectedFiles = fileUploads . getUploadedFiles ( ) ; "<AssertPlaceHolder>" ; } } size ( ) { return routes . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , detectedFiles . size ( ) )
|
testStarted ( ) { ch . qos . logback . core . pattern . PatternLayoutBase < E > plb = getPatternLayoutBase ( ) ; ch . qos . logback . core . Context context = new ch . qos . logback . core . ContextBase ( ) ; plb . setContext ( context ) ; java . lang . String s = plb . doLayout ( getEventObject ( ) ) ; "<AssertPlaceHolder>" ; ch . qos . logback . core . status . StatusManager sm = context . getStatusManager ( ) ; ch . qos . logback . core . util . StatusPrinter . print ( sm ) ; } getEventObject ( ) { return makeLoggingEvent ( "Some<sp>message" , null ) ; }
|
org . junit . Assert . assertEquals ( "" , s )
|
testServiceProviderGetAnalyseService ( ) { husacct . ServiceProvider provider1 = husacct . ServiceProvider . getInstance ( ) ; husacct . ServiceProvider provider2 = husacct . ServiceProvider . getInstance ( ) ; "<AssertPlaceHolder>" ; } getAnalyseService ( ) { return analyseService ; }
|
org . junit . Assert . assertSame ( provider1 . getAnalyseService ( ) , provider2 . getAnalyseService ( ) )
|
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . ratings . kernel . model . RatingsStats . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "statsId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "statsId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
test53109a ( ) { org . apache . poi . hssf . usermodel . HSSFWorkbook wb1 = org . apache . poi . hssf . usermodel . TestBugs . openSample ( "com.aida-tour.www_SPO_files_maldives%20august%20october.xls" ) ; org . apache . poi . ss . usermodel . Workbook wb2 = org . apache . poi . hssf . usermodel . TestBugs . writeOutAndReadBack ( wb1 ) ; "<AssertPlaceHolder>" ; wb2 . close ( ) ; wb1 . close ( ) ; } writeOutAndReadBack ( org . apache . poi . hssf . usermodel . HSSFWorkbook ) { return HSSFITestDataProvider . instance . writeOutAndReadBack ( original ) ; }
|
org . junit . Assert . assertNotNull ( wb2 )
|
testBytes2Int ( ) { int [ ] testVals = new int [ ] { Integer . MIN_VALUE , - 1 , 0 , 1 , Integer . MAX_VALUE } ; for ( int testVal : testVals ) { try { byte [ ] convertedBytes = com . tc . util . Conversion . int2Bytes ( testVal ) ; int convertedInt = com . tc . util . Conversion . bytes2Int ( convertedBytes ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . RuntimeException e ) { throw new java . lang . AssertionError ( ( ( ( "Failed<sp>to<sp>convert:<sp>" + testVal ) + "<sp>:<sp>" ) + e ) ) ; } } } bytes2Int ( byte [ ] ) { return com . tc . util . Conversion . makeInt ( bytes [ 0 ] , bytes [ 1 ] , bytes [ 2 ] , bytes [ 3 ] ) ; }
|
org . junit . Assert . assertEquals ( testVal , convertedInt )
|
testCreate ( ) { org . yes . cart . domain . dto . ProductDTO dto = getDto ( ) ; dto = dtoService . create ( dto ) ; "<AssertPlaceHolder>" ; } getProductId ( ) { return productId ; }
|
org . junit . Assert . assertTrue ( ( ( dto . getProductId ( ) ) > 0 ) )
|
testBasicLoginSessionTimeout ( ) { setAlwaysUseSession ( ) ; setRapidSessionTimeout ( ) ; doTestBasic ( ( ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . CONTEXT_PATH_LOGIN ) + ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . URI_PROTECTED ) ) , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_CREDENTIALS , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_COOKIES , HttpServletResponse . SC_UNAUTHORIZED ) ; doTestBasic ( ( ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . CONTEXT_PATH_LOGIN ) + ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . URI_PROTECTED ) ) , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . GOOD_CREDENTIALS , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_COOKIES , HttpServletResponse . SC_OK ) ; java . util . List < java . lang . String > originalCookies = cookies ; doTestBasic ( ( ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . CONTEXT_PATH_LOGIN ) + ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . URI_PROTECTED ) ) , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_CREDENTIALS , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . USE_COOKIES , HttpServletResponse . SC_OK ) ; java . lang . Thread . sleep ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . TIMEOUT_DELAY_MSECS ) ; doTestBasic ( ( ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . CONTEXT_PATH_LOGIN ) + ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . URI_PROTECTED ) ) , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_CREDENTIALS , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . USE_COOKIES , HttpServletResponse . SC_UNAUTHORIZED ) ; doTestBasic ( ( ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . CONTEXT_PATH_LOGIN ) + ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . URI_PROTECTED ) ) , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_CREDENTIALS , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_COOKIES , HttpServletResponse . SC_UNAUTHORIZED ) ; doTestBasic ( ( ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . CONTEXT_PATH_LOGIN ) + ( org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . URI_PROTECTED ) ) , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . GOOD_CREDENTIALS , org . apache . catalina . authenticator . TestNonLoginAndBasicAuthenticator . NO_COOKIES , HttpServletResponse . SC_OK ) ; boolean sameCookies = originalCookies . equals ( cookies ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; org . apache . tomcat . jdbc . pool . interceptor . StatementCache . CacheKey other = ( ( org . apache . tomcat . jdbc . pool . interceptor . StatementCache . CacheKey ) ( obj ) ) ; if ( ! ( java . util . Arrays . equals ( args , other . args ) ) ) return false ; if ( ( stmtType ) == null ) { if ( ( other . stmtType ) != null ) return false ; } else if ( ! ( stmtType . equals ( other . stmtType ) ) ) return false ; return true ; }
|
org . junit . Assert . assertTrue ( ( ! sameCookies ) )
|
newResponse ( ) { org . jboss . elasticsearch . river . jira . mgm . state . JRStateResponse rb = JRStateAction . INSTANCE . newResponse ( ) ; "<AssertPlaceHolder>" ; } newResponse ( ) { return new org . jboss . elasticsearch . river . jira . mgm . state . JRStateResponse ( ) ; }
|
org . junit . Assert . assertNotNull ( rb )
|
testNextTreatmentSimpleOutput ( ) { org . onosproject . net . flow . TrafficTreatment treatment = org . onosproject . net . flow . DefaultTrafficTreatment . builder ( ) . setOutput ( org . onosproject . pipelines . fabric . FabricInterpreterTest . PORT_1 ) . build ( ) ; org . onosproject . net . pi . runtime . PiAction mappedAction = interpreter . mapTreatment ( treatment , FabricConstants . FABRIC_INGRESS_NEXT_SIMPLE ) ; org . onosproject . net . pi . runtime . PiActionParam param = new org . onosproject . net . pi . runtime . PiActionParam ( FabricConstants . PORT_NUM , org . onosproject . pipelines . fabric . FabricInterpreterTest . PORT_1 . toLong ( ) ) ; org . onosproject . net . pi . runtime . PiAction expectedAction = org . onosproject . net . pi . runtime . PiAction . builder ( ) . withId ( FabricConstants . FABRIC_INGRESS_NEXT_OUTPUT_SIMPLE ) . withParameter ( param ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return new org . onosproject . drivers . lisp . extensions . LispAppDataAddress ( protocol , ipTos , localPortLow , localPortHigh , remotePortLow , remotePortHigh , address ) ; }
|
org . junit . Assert . assertEquals ( expectedAction , mappedAction )
|
testOnPortUpdatePre ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
|
testGetQueues ( ) { final java . util . Collection < java . lang . String > queues = java . util . Arrays . asList ( "queue1" , "queue2" ) ; this . mockCtx . checking ( new org . jmock . Expectations ( ) { { oneOf ( workers . get ( 0 ) ) . getQueues ( ) ; will ( returnValue ( queues ) ) ; } } ) ; "<AssertPlaceHolder>" ; } getQueues ( ) { return this . workers . get ( 0 ) . getQueues ( ) ; }
|
org . junit . Assert . assertEquals ( queues , this . pool . getQueues ( ) )
|
shouldIndicateActiveAfterStart ( ) { redisServer = new redis . embedded . RedisServer ( 6379 ) ; redisServer . start ( ) ; "<AssertPlaceHolder>" ; redisServer . stop ( ) ; } isActive ( ) { return active ; }
|
org . junit . Assert . assertTrue ( redisServer . isActive ( ) )
|
testGevondenNietActueel ( ) { final nl . bzk . brp . gba . domain . bevraging . Persoonsantwoord antwoord = new nl . bzk . brp . gba . domain . bevraging . Persoonsantwoord ( ) ; antwoord . setInhoud ( "00000000Ha01R20150101000270101701100101234567890" ) ; org . mockito . Mockito . when ( message . getText ( ) ) . thenReturn ( nl . bzk . algemeenbrp . util . common . serialisatie . JsonMapper . writer ( ) . writeValueAsString ( antwoord ) ) ; subject . onMessage ( message ) ; org . mockito . ArgumentCaptor < nl . bzk . migratiebrp . bericht . model . sync . impl . AdHocZoekPersoonAntwoordBericht > berichtArgumentCaptor = org . mockito . ArgumentCaptor . forClass ( nl . bzk . migratiebrp . bericht . model . sync . impl . AdHocZoekPersoonAntwoordBericht . class ) ; org . mockito . Mockito . verify ( iscVerzender ) . verstuurAdHocZoekenAntwoord ( berichtArgumentCaptor . capture ( ) ) ; nl . bzk . migratiebrp . bericht . model . sync . impl . AdHocZoekPersoonAntwoordBericht bericht = berichtArgumentCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; } getInhoud ( ) { return adHocZoekPersonenOpAdresAntwoordType . getInhoud ( ) ; }
|
org . junit . Assert . assertEquals ( "00000000Ha01R20150101000270101701100101234567890" , bericht . getInhoud ( ) )
|
testGetCompletionCountForPrincipal ( ) { org . hawkular . apm . api . model . events . CompletionTime ct1 = new org . hawkular . apm . api . model . events . CompletionTime ( ) ; ct1 . setTransaction ( org . hawkular . apm . server . elasticsearch . AnalyticsServiceElasticsearchTest . TXN ) ; ct1 . setTimestamp ( 1000 ) ; ct1 . getProperties ( ) . add ( new org . hawkular . apm . api . model . Property ( org . hawkular . apm . api . model . Constants . PROP_PRINCIPAL , "p1" ) ) ; org . hawkular . apm . api . model . events . CompletionTime ct2 = new org . hawkular . apm . api . model . events . CompletionTime ( ) ; ct2 . setTransaction ( org . hawkular . apm . server . elasticsearch . AnalyticsServiceElasticsearchTest . TXN ) ; ct2 . setTimestamp ( 2000 ) ; ct2 . getProperties ( ) . add ( new org . hawkular . apm . api . model . Property ( org . hawkular . apm . api . model . Constants . PROP_PRINCIPAL , "p2" ) ) ; ct2 . getProperties ( ) . add ( new org . hawkular . apm . api . model . Property ( org . hawkular . apm . api . model . Constants . PROP_FAULT , "TestFault1" ) ) ; org . hawkular . apm . api . model . events . CompletionTime ct3 = new org . hawkular . apm . api . model . events . CompletionTime ( ) ; ct3 . setTransaction ( org . hawkular . apm . server . elasticsearch . AnalyticsServiceElasticsearchTest . TXN ) ; ct3 . setTimestamp ( 2000 ) ; ct3 . getProperties ( ) . add ( new org . hawkular . apm . api . model . Property ( org . hawkular . apm . api . model . Constants . PROP_PRINCIPAL , "p1" ) ) ; ct3 . getProperties ( ) . add ( new org . hawkular . apm . api . model . Property ( org . hawkular . apm . api . model . Constants . PROP_FAULT , "TestFault2" ) ) ; analytics . storeTraceCompletions ( null , java . util . Arrays . asList ( ct1 , ct2 , ct3 ) ) ; org . hawkular . apm . api . services . Criteria criteria = new org . hawkular . apm . api . services . Criteria ( ) ; criteria . addProperty ( Constants . PROP_PRINCIPAL , "p1" , Operator . HAS ) ; criteria . setTransaction ( org . hawkular . apm . server . elasticsearch . AnalyticsServiceElasticsearchTest . TXN ) . setStartTime ( 1 ) . setEndTime ( 0 ) ; org . hawkular . apm . tests . common . Wait . until ( ( ) -> ( analytics . getTraceCompletionCount ( null , criteria ) ) == 2 ) ; "<AssertPlaceHolder>" ; } getTraceCompletionCount ( java . lang . String , org . hawkular . apm . api . services . Criteria ) { if ( org . hawkular . apm . analytics . service . rest . client . AnalyticsServiceRESTClient . log . isLoggable ( Level . FINEST ) ) { org . hawkular . apm . analytics . service . rest . client . AnalyticsServiceRESTClient . log . finest ( ( ( ( "Get<sp>completion<sp>count:<sp>tenantId=[" + tenantId ) + "]<sp>criteria=" ) + criteria ) ) ; } java . lang . String path = "analytics/trace/completion/count?criteria=%s" ; return getResultsForUrl ( tenantId , org . hawkular . apm . analytics . service . rest . client . AnalyticsServiceRESTClient . LONG , path , criteria ) ; }
|
org . junit . Assert . assertEquals ( 2 , analytics . getTraceCompletionCount ( null , criteria ) )
|
testEquals ( ) { org . opencastproject . job . api . Job equalJob = new org . opencastproject . job . api . JobImpl ( 3L , "test" , "test_org" , 0L , "simple" , "do" , arguments , Status . DISPATCHING , "localhost" , "remotehost" , created , started , completed , 100L , 200L , "result" , 3L , 1L , true , uri , 1.5F ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( job , equalJob )
|
testServerAllName ( ) { append ( "[groups]" , globalPolicyFile ) ; append ( "group<sp>=<sp>malicious_role" , globalPolicyFile ) ; append ( "[roles]" , globalPolicyFile ) ; append ( "malicious_role<sp>=<sp>server=*" , globalPolicyFile ) ; org . apache . sentry . policy . common . PolicyEngine policy = org . apache . sentry . policy . sqoop . SqoopPolicyTestUtil . createPolicyEngineForTest ( "server1" , globalPolicyFile . getPath ( ) ) ; com . google . common . collect . ImmutableSet < java . lang . String > permissions = policy . getAllPrivileges ( com . google . common . collect . Sets . newHashSet ( "group" ) , ActiveRoleSet . ALL ) ; "<AssertPlaceHolder>" ; } toString ( ) { return SentryConstants . AUTHORIZABLE_JOINER . join ( parts ) ; }
|
org . junit . Assert . assertTrue ( permissions . toString ( ) , permissions . isEmpty ( ) )
|
testWithOut ( ) { at . favre . tools . apksigner . ui . Arg parsedArg = at . favre . tools . apksigner . ui . CLIParser . parse ( at . favre . tools . apksigner . ui . CLIParserTest . asArgArray ( ( ( ( ( "-" + ( CLIParser . ARG_APK_FILE ) ) + "<sp>./<sp>-" ) + ( CLIParser . ARG_APK_OUT ) ) + "<sp>./test" ) ) ) ; at . favre . tools . apksigner . ui . Arg expectedArg = new at . favre . tools . apksigner . ui . Arg ( new java . lang . String [ ] { "./" } , "./test" , java . util . Collections . emptyList ( ) , false , false , false , false , false , false , null , false , false , null ) ; "<AssertPlaceHolder>" ; } asArgArray ( java . lang . String ) { return org . apache . tools . ant . types . Commandline . translateCommandline ( cmd ) ; }
|
org . junit . Assert . assertEquals ( expectedArg , parsedArg )
|
testFormeelHistorischLeverenMag ( ) { final java . util . Set < nl . bzk . brp . model . algemeen . stamgegeven . autaut . DienstbundelGroep > dienstbundelGroepen = new java . util . HashSet ( ) ; final nl . bzk . brp . model . hisvolledig . predikaat . MagHistorieTonenPredikaat predikaat = new nl . bzk . brp . model . hisvolledig . predikaat . MagHistorieTonenPredikaat ( dienstbundelGroepen , false ) ; final nl . bzk . brp . model . algemeen . stamgegeven . kern . ElementAttribuut element = new nl . bzk . brp . model . algemeen . stamgegeven . kern . ElementAttribuut ( nl . bzk . brp . model . algemeen . stamgegeven . kern . TestElementBuilder . maker ( ) . metNaam ( ElementEnum . PERSOON_GEBOORTE ) . maak ( ) ) ; final nl . bzk . brp . model . algemeen . stamgegeven . autaut . DienstbundelGroep dienstbundelGroep = nl . bzk . brp . model . algemeen . stamgegeven . autaut . TestDienstbundelGroepBuilder . maker ( ) . metGroep ( element . getWaarde ( ) ) . metIndicatieFormeleHistorie ( true ) . metIndicatieMaterieleHistorie ( false ) . metIndicatieVerantwoording ( false ) . maak ( ) ; dienstbundelGroepen . add ( dienstbundelGroep ) ; final java . util . Set < nl . bzk . brp . model . operationeel . kern . HisPersoonGeboorteModel > alleModellen = maakTestPersoon ( ) . getPersoonGeboorteHistorie ( ) . getHistorie ( ) ; final java . util . Collection gefilterdeModellen = org . apache . commons . collections . CollectionUtils . select ( alleModellen , predikaat ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertThat ( gefilterdeModellen . size ( ) , org . hamcrest . Matchers . is ( 2 ) )
|
rejectBeforeFailHandlerAdded ( ) { final com . b2international . snowowl . core . events . util . Promise < java . lang . Object > p = new com . b2international . snowowl . core . events . util . Promise ( ) ; p . reject ( rejection ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; p . fail ( new com . google . common . base . Function < java . lang . Throwable , java . lang . Object > ( ) { @ com . b2international . snowowl . core . events . util . Override public java . lang . Object apply ( java . lang . Throwable input ) { "<AssertPlaceHolder>" ; latch . countDown ( ) ; return null ; } } ) ; latch . await ( 100 , TimeUnit . MILLISECONDS ) ; } apply ( org . eclipse . core . runtime . IConfigurationElement ) { try { return ( ( org . eclipse . spi . net4j . ClientProtocolFactory ) ( input . createExecutableExtension ( com . b2international . snowowl . datastore . ClientProtocolFactoryRegistry . CLASS_ATTRIBUTE ) ) ) ; } catch ( final org . eclipse . core . runtime . CoreException e ) { throw new java . lang . RuntimeException ( ( "Error<sp>while<sp>creating<sp>executable<sp>extension<sp>from<sp>the<sp>passed<sp>in<sp>configuration<sp>element:<sp>" + input ) , e ) ; } }
|
org . junit . Assert . assertEquals ( rejection , input )
|
testDownload ( ) { de . dimaki . refuel . appcast . entity . Appcast appcast = getAppcast ( ) ; appcast . getChannel ( ) . getItems ( ) . get ( 0 ) . getEnclosure ( ) . setUrl ( getClass ( ) . getResource ( "/jartest.zip" ) . toURI ( ) . toURL ( ) . toString ( ) ) ; java . nio . file . Path createdTempDirectory = null ; try { createdTempDirectory = java . nio . file . Files . createTempDirectory ( "ac-" ) ; } catch ( java . io . IOException ex ) { org . junit . Assert . fail ( ex . toString ( ) ) ; } java . nio . file . Path downloaded = null ; try { downloaded = manager . download ( appcast , createdTempDirectory ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "Downloaded:<sp>" + downloaded ) ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Could<sp>not<sp>download<sp>update<sp>package:<sp>" + ( e . toString ( ) ) ) ) ; } finally { try { java . nio . file . Files . deleteIfExists ( downloaded ) ; } catch ( java . lang . Exception exception ) { } try { java . nio . file . Files . deleteIfExists ( createdTempDirectory ) ; } catch ( java . io . IOException iOException ) { } } } download ( de . dimaki . refuel . appcast . entity . Appcast , java . nio . file . Path ) { java . nio . file . Path downloaded = null ; de . dimaki . refuel . appcast . entity . Enclosure enclosure = appcast . getLatestEnclosure ( ) ; if ( enclosure != null ) { java . lang . String url = enclosure . getUrl ( ) ; if ( ( url != null ) && ( ! ( url . isEmpty ( ) ) ) ) { java . net . URL enclosureUrl = new java . net . URL ( url ) ; java . lang . String targetName = url . substring ( ( ( url . lastIndexOf ( '/' ) ) + 1 ) , url . length ( ) ) ; long length = enclosure . getLength ( ) ; java . io . File tmpFile = null ; java . nio . channels . ReadableByteChannel rbc = null ; java . io . FileOutputStream fos = null ; try { tmpFile = java . io . File . createTempFile ( "ac-" , ".part" ) ; rbc = java . nio . channels . Channels . newChannel ( enclosureUrl . openStream ( ) ) ; fos = new java . io . FileOutputStream ( tmpFile ) ; fos . getChannel ( ) . transferFrom ( rbc , 0 , Long . MAX_VALUE ) ; if ( length > 0 ) { long size = java . nio . file . Files . size ( tmpFile . toPath ( ) ) ; if ( length != size ) { throw new java . lang . Exception ( ( ( ( "Downloaded<sp>file<sp>has<sp>wrong<sp>size!<sp>Expected:<sp>" + length ) + "<sp>--<sp>Actual:<sp>" ) + size ) ) ; } } java . lang . String md5 = enclosure . getMd5 ( ) ; if ( md5 != null ) { java . security . MessageDigest md = java . security . MessageDigest . getInstance ( "MD5" ) ; md . reset ( ) ; byte [ ] bytes = new byte [ 2048 ] ; int numBytes ; try ( java . io . FileInputStream is = new java . io . FileInputStream ( tmpFile ) ) { while ( ( numBytes = is . read ( bytes ) ) != ( - 1 ) ) { md . update ( bytes , 0 , numBytes ) ; } } java . lang . String hash = de . dimaki . refuel . appcast . boundary . AppcastManager . toHex ( md . digest ( ) ) ; if ( ! ( md5 . equalsIgnoreCase ( hash ) ) ) { throw new java . lang . Exception ( ( ( ( "Downloaded<sp>file<sp>has<sp>wrong<sp>MD5<sp>hash!<sp>Expected:<sp>" + md5 ) + "<sp>--<sp>Actual:<sp>" ) + hash ) ) ; } } downloaded = java . nio . file . Files . copy ( tmpFile . toPath ( ) , targetDir . resolve ( targetName ) , StandardCopyOption . REPLACE_EXISTING ) ; } finally { try { if ( fos != null ) fos . close ( ) ; } catch ( java . io . IOException e ) { } if ( tmpFile != null ) { java . nio . file . Files . deleteIfExists ( tmpFile . toPath ( ) ) ; } } } } return downloaded ; }
|
org . junit . Assert . assertNotNull ( downloaded )
|
invalid_null ( ) { java . lang . String result = emit ( null , ( w ) -> { w . putField ( com . asakusafw . runtime . io . text . csv . CsvFieldWriterTest . wrap ( null ) ) ; com . asakusafw . runtime . io . text . csv . CsvFieldWriterTest . expectUnmappable ( w , ErrorCode . UNDEFINED_NULL_SEQUENCE ) ; } ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; }
|
org . junit . Assert . assertThat ( result , is ( "\n" ) )
|
shipmentViolationAtStart_shouldWork ( ) { buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore ( ) ; jsprit . core . reporting . SolutionPrinter . print ( vrp , solution , SolutionPrinter . Print . VERBOSE ) ; jsprit . core . analysis . SolutionAnalyser analyser = new jsprit . core . analysis . SolutionAnalyser ( vrp , solution , new jsprit . core . problem . cost . TransportDistance ( ) { @ jsprit . core . analysis . Override public double getDistance ( jsprit . core . problem . Location from , jsprit . core . problem . Location to ) { return vrp . getTransportCosts ( ) . getTransportCost ( from , to , 0.0 , null , null ) ; } } ) ; jsprit . core . problem . solution . route . VehicleRoute route = solution . getRoutes ( ) . iterator ( ) . next ( ) ; java . lang . Boolean violation = analyser . hasShipmentConstraintViolationAtActivity ( route . getStart ( ) , route ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertFalse ( violation )
|
testWrappingFromSpan ( ) { org . apache . htrace . core . HTraceConfiguration conf = org . apache . htrace . core . HTraceConfiguration . fromKeyValuePairs ( "sampler.classes" , "AlwaysSampler" ) ; java . util . concurrent . ExecutorService es = java . util . concurrent . Executors . newSingleThreadExecutor ( ) ; try ( org . apache . htrace . core . Tracer tracer = new org . apache . htrace . core . Tracer . Builder ( "TestTraceExecutor" ) . conf ( conf ) . build ( ) ) { org . apache . htrace . core . SpanId random = org . apache . htrace . core . SpanId . fromRandom ( ) ; try ( org . apache . htrace . core . TraceScope parentScope = tracer . newScope ( "parent" ) ) { java . util . concurrent . Callable < org . apache . htrace . core . SpanId > callable = new org . apache . htrace . core . TraceCallable < org . apache . htrace . core . SpanId > ( tracer , random , new java . util . concurrent . Callable < org . apache . htrace . core . SpanId > ( ) { @ org . apache . htrace . core . Override public org . apache . htrace . core . SpanId call ( ) throws org . apache . htrace . core . Exception { return org . apache . htrace . core . Tracer . getCurrentSpan ( ) . getParents ( ) [ 0 ] ; } } , "child" ) ; org . apache . htrace . core . SpanId result = es . submit ( callable ) . get ( org . apache . htrace . core . TestTraceExecutor . WAIT_TIME_SECONDS , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } } finally { es . shutdown ( ) ; } } get ( java . lang . String , java . lang . String ) { java . lang . String val = get ( key ) ; return val != null ? val : defaultValue ; }
|
org . junit . Assert . assertEquals ( random , result )
|
entrySetContains ( ) { for ( java . util . Map . Entry < java . lang . Integer , jenkins . model . lazy . Build > e : a . entrySet ( ) ) { "<AssertPlaceHolder>" ; } } entrySet ( ) { return null ; }
|
org . junit . Assert . assertTrue ( a . entrySet ( ) . contains ( e ) )
|
testDoGetRootTree ( ) { java . lang . Integer depth = 0 ; java . lang . String filter = "filter" ; java . lang . Boolean showHidden = Boolean . TRUE ; java . lang . Boolean includeAcls = Boolean . TRUE ; org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileTreeDto mockRepositoryFileTreeDto = mock ( org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileTreeDto . class ) ; doReturn ( mockRepositoryFileTreeDto ) . when ( fileResource . fileService ) . doGetTree ( FileUtils . PATH_SEPARATOR , depth , filter , showHidden , includeAcls ) ; org . pentaho . platform . api . repository2 . unified . webservices . RepositoryFileTreeDto testDto = fileResource . doGetRootTree ( depth , filter , showHidden , includeAcls ) ; "<AssertPlaceHolder>" ; verify ( fileResource . fileService , times ( 1 ) ) . doGetTree ( FileUtils . PATH_SEPARATOR , depth , filter , showHidden , includeAcls ) ; } doGetRootTree ( java . lang . Integer , java . lang . String , java . lang . Boolean , java . lang . Boolean ) { return fileService . doGetTree ( FileUtils . PATH_SEPARATOR , depth , filter , showHidden , includeAcls ) ; }
|
org . junit . Assert . assertEquals ( mockRepositoryFileTreeDto , testDto )
|
testRecordWithoutFactory ( ) { final java . lang . String recordClassName = kieker . test . common . util . record . factory . TestRecord . class . getName ( ) ; @ kieker . test . common . junit . record . factory . SuppressWarnings ( "unused" ) final kieker . common . record . factory . IRecordFactory < ? extends kieker . common . record . IMonitoringRecord > recordFactory = this . recordFactoryResolver . get ( recordClassName ) ; "<AssertPlaceHolder>" ; } get ( java . io . File ) { return this . repository . get ( directory . getAbsolutePath ( ) ) ; }
|
org . junit . Assert . assertNull ( recordFactory )
|
valuesView ( ) { org . eclipse . collections . api . set . MutableSet < java . lang . String > actualValues = org . eclipse . collections . impl . set . mutable . UnifiedSet . newSet ( ) ; for ( java . lang . String eachValue : this . classUnderTest ( ) . valuesView ( ) ) { actualValues . add ( eachValue ) ; } org . eclipse . collections . api . set . MutableSet < java . lang . String > expectedValues = this . expectedValues ( ) ; "<AssertPlaceHolder>" ; } add ( org . eclipse . collections . api . tuple . Pair ) { return this . putPair ( keyValuePair ) ; }
|
org . junit . Assert . assertEquals ( expectedValues , actualValues )
|
testDeleteOnlyDeleteOneIfThereAreMoreThanMaxChildren ( ) { com . github . davidmoten . rtree3d . Entry < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > e1 = com . github . davidmoten . rtree3d . RTreeTest . e ( 1 ) ; int count = com . github . davidmoten . rtree3d . RTree . maxChildren ( 4 ) . create ( ) . add ( e1 ) . add ( e1 ) . add ( e1 ) . add ( e1 ) . add ( e1 ) . delete ( e1 ) . search ( e1 . geometry ( ) . mbb ( ) ) . count ( ) . toBlocking ( ) . single ( ) ; "<AssertPlaceHolder>" ; } count ( ) { return entries . size ( ) ; }
|
org . junit . Assert . assertEquals ( 4 , count )
|
testReturnNetworkdaysWithManyHolidays ( ) { java . util . Calendar expCal = org . apache . poi . util . LocaleUtil . getLocaleCalendar ( 2009 , 4 , 5 ) ; java . util . Date expDate = expCal . getTime ( ) ; org . apache . poi . ss . formula . eval . ValueEval [ ] ve = new org . apache . poi . ss . formula . eval . ValueEval [ ] { new org . apache . poi . ss . formula . eval . StringEval ( org . apache . poi . ss . formula . atp . TestWorkdayFunction . STARTING_DATE ) , new org . apache . poi . ss . formula . eval . NumberEval ( 151 ) , new org . apache . poi . ss . formula . atp . TestWorkdayFunction . MockAreaEval ( org . apache . poi . ss . formula . atp . TestWorkdayFunction . FIRST_HOLIDAY , org . apache . poi . ss . formula . atp . TestWorkdayFunction . SECOND_HOLIDAY , org . apache . poi . ss . formula . atp . TestWorkdayFunction . THIRD_HOLIDAY ) } ; double numberValue = ( ( org . apache . poi . ss . formula . eval . NumberEval ) ( WorkdayFunction . instance . evaluate ( ve , org . apache . poi . ss . formula . atp . TestWorkdayFunction . EC ) ) ) . getNumberValue ( ) ; java . util . Date actDate = org . apache . poi . ss . usermodel . DateUtil . getJavaDate ( numberValue ) ; "<AssertPlaceHolder>" ; } getJavaDate ( double ) { return org . apache . poi . ss . usermodel . DateUtil . getJavaDate ( date , false , null , false ) ; }
|
org . junit . Assert . assertEquals ( expDate , actDate )
|
testLookupDefinitionsByLabelsWithFiltering ( ) { java . util . Set < java . lang . String > expected = new java . util . HashSet < java . lang . String > ( 1 ) { { add ( org . kie . workbench . common . stunner . core . lookup . domain . DomainLookupFunctionsTest . DEF_ID1 ) ; } } ; when ( cache . getDefinitions ( eq ( org . kie . workbench . common . stunner . core . lookup . domain . DomainLookupFunctionsTest . ROLE2 ) ) ) . thenReturn ( expected ) ; org . kie . workbench . common . stunner . core . lookup . domain . DomainLookupFunctions . LookupDefinitionsByLabels function = new org . kie . workbench . common . stunner . core . lookup . domain . DomainLookupFunctions . LookupDefinitionsByLabels ( new java . util . HashSet < java . lang . String > ( 1 ) { { add ( org . kie . workbench . common . stunner . core . lookup . domain . DomainLookupFunctionsTest . ROLE2 ) ; } } , org . kie . workbench . common . stunner . core . lookup . domain . DomainLookupFunctionsTest . DEF_ID2 :: equals ) ; "<AssertPlaceHolder>" ; } execute ( org . kie . workbench . common . stunner . core . graph . command . GraphCommandExecutionContext ) { function . getFormalParameter ( ) . add ( parameter ) ; parameter . getName ( ) . setValue ( org . kie . workbench . common . dmn . client . editors . expressions . types . function . FunctionDefaultValueUtilities . getNewParameterName ( function ) ) ; parameter . setParent ( function ) ; return org . kie . workbench . common . stunner . core . graph . command . GraphCommandResultBuilder . SUCCESS ; }
|
org . junit . Assert . assertFalse ( function . execute ( context ) . contains ( org . kie . workbench . common . stunner . core . lookup . domain . DomainLookupFunctionsTest . DEF_ID1 ) )
|
testInvokeAndWait01 ( ) { final boolean [ ] done = new boolean [ ] { false } ; final java . lang . Runnable clientAction = new java . lang . Runnable ( ) { public void run ( ) { System . err . println ( "CA.1" ) ; done [ 0 ] = true ; System . err . println ( "CA.X" ) ; } } ; final com . jogamp . common . util . RunnableTask rTask = new com . jogamp . common . util . RunnableTask ( clientAction , new java . lang . Object ( ) , false , null ) ; System . err . println ( ( "BB.0:<sp>" + ( rTask . getSyncObject ( ) ) ) ) ; synchronized ( rTask . getSyncObject ( ) ) { System . err . println ( ( "BB.1:<sp>" + ( rTask . getSyncObject ( ) ) ) ) ; new com . jogamp . common . util . InterruptSource . Thread ( null , rTask , ( ( java . lang . Thread . currentThread ( ) . getName ( ) ) + "-clientAction" ) ) . start ( ) ; try { System . err . println ( "BB.2" ) ; rTask . getSyncObject ( ) . wait ( ) ; System . err . println ( "BB.3" ) ; } catch ( final java . lang . InterruptedException e ) { throw new java . lang . RuntimeException ( e ) ; } "<AssertPlaceHolder>" ; System . err . println ( "BB.X" ) ; } } getSyncObject ( ) { return syncObject ; }
|
org . junit . Assert . assertTrue ( done [ 0 ] )
|
testStoreAndGetDocumentWithArrays ( ) { org . modeshape . jcr . index . elasticsearch . client . EsRequest doc = new org . modeshape . jcr . index . elasticsearch . client . EsRequest ( ) ; doc . put ( "field1" , new java . lang . String [ ] { "1" , "2" , "3" } ) ; client . storeDocument ( org . modeshape . jcr . index . elasticsearch . client . EsClientTest . INDEX_NAME , org . modeshape . jcr . index . elasticsearch . client . EsClientTest . TYPE_NAME , "1" , doc ) ; org . modeshape . jcr . index . elasticsearch . client . EsRequest doc1 = client . getDocument ( org . modeshape . jcr . index . elasticsearch . client . EsClientTest . INDEX_NAME , org . modeshape . jcr . index . elasticsearch . client . EsClientTest . TYPE_NAME , "1" ) ; "<AssertPlaceHolder>" ; } equals ( javax . jcr . SimpleCredentials , javax . jcr . SimpleCredentials ) { if ( ! ( equals ( o1 . getUserID ( ) , o2 . getUserID ( ) ) ) ) { return false ; } if ( ! ( equals ( o1 . getPassword ( ) , o2 . getPassword ( ) ) ) ) { return false ; } java . util . Map < java . lang . String , java . lang . Object > m1 = getAttributeMap ( o1 ) ; java . util . Map < java . lang . String , java . lang . Object > m2 = getAttributeMap ( o2 ) ; return m1 . equals ( m2 ) ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( ( ( java . lang . Object [ ] ) ( doc . get ( "field1" ) ) ) , ( ( java . lang . Object [ ] ) ( doc1 . get ( "field1" ) ) ) ) )
|
shouldNotFindTaskFinishedActionForMissingParent ( ) { org . jenkinsci . plugins . workflow . graph . FlowNode flowNode = mock ( org . jenkinsci . plugins . workflow . graph . FlowNode . class ) ; when ( flowNode . getParents ( ) ) . thenReturn ( java . util . Collections . emptyList ( ) ) ; "<AssertPlaceHolder>" ; } isAnyParentNodeContainingTaskFinishedAction ( org . jenkinsci . plugins . workflow . graph . FlowNode ) { if ( ( taskNode != null ) && ( ! ( taskNode . getParents ( ) . isEmpty ( ) ) ) ) { java . util . Optional < org . jenkinsci . plugins . workflow . graph . FlowNode > parentWithTaskFinishedAction = se . diabol . jenkins . workflow . util . Util . getParentNodeWithTaskFinishedAction ( taskNode ) ; return parentWithTaskFinishedAction . isPresent ( ) ; } return false ; }
|
org . junit . Assert . assertThat ( se . diabol . jenkins . workflow . util . Util . isAnyParentNodeContainingTaskFinishedAction ( flowNode ) , org . hamcrest . CoreMatchers . is ( false ) )
|
testSetGetId ( ) { org . apache . ambari . server . orm . entities . ViewEntityEntity viewEntityEntity = new org . apache . ambari . server . orm . entities . ViewEntityEntity ( ) ; viewEntityEntity . setId ( 99L ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( 99L , ( ( long ) ( viewEntityEntity . getId ( ) ) ) )
|
writePlainPath ( ) { org . apache . servicecomb . common . rest . definition . path . PathVarParamWriter pathVarParamWriter = createPathVarParamWriter ( ) ; org . apache . servicecomb . common . rest . definition . path . URLPathBuilder . URLPathStringBuilder pathBuilder = new org . apache . servicecomb . common . rest . definition . path . URLPathBuilder . URLPathStringBuilder ( ) ; pathVarParamWriter . write ( pathBuilder , new java . lang . Object [ ] { "abc" } ) ; "<AssertPlaceHolder>" ; } build ( ) { return stringBuilder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "abc" , pathBuilder . build ( ) )
|
testGetFileCharset_UTF16_BE ( ) { java . io . File file = org . apache . commons . io . FileUtils . toFile ( CLASS . getResource ( "russian-utf16-be.srt" ) ) ; "<AssertPlaceHolder>" . isEqualTo ( net . pms . util . CHARSET_UTF_16BE ) ; } getFileCharsetName ( net . pms . util . File ) { if ( file == null ) { return null ; } com . ibm . icu . text . CharsetMatch match = net . pms . util . FileUtil . getFileCharsetMatch ( file ) ; try { if ( java . nio . charset . Charset . isSupported ( match . getName ( ) ) ) { net . pms . util . FileUtil . LOGGER . debug ( "Detected<sp>charset<sp>\"{}\"<sp>in<sp>file<sp>\"{}\"" , match . getName ( ) , file . getAbsolutePath ( ) ) ; return match . getName ( ) . toUpperCase ( Locale . ROOT ) ; } net . pms . util . FileUtil . LOGGER . debug ( "Detected<sp>charset<sp>\"{}\"<sp>in<sp>file<sp>\"{}\",<sp>but<sp>cannot<sp>use<sp>it<sp>because<sp>it\'s<sp>not<sp>supported<sp>by<sp>the<sp>Java<sp>Virual<sp>Machine" , match . getName ( ) , file . getAbsolutePath ( ) ) ; return null ; } catch ( java . nio . charset . IllegalCharsetNameException e ) { net . pms . util . FileUtil . LOGGER . debug ( "Illegal<sp>charset<sp>\"{}\"<sp>deteceted<sp>in<sp>file<sp>\"{}\"" , match . getName ( ) , file . getAbsolutePath ( ) ) ; } net . pms . util . FileUtil . LOGGER . debug ( "Found<sp>no<sp>matching<sp>charset<sp>for<sp>file<sp>\"{}\"" , file . getAbsolutePath ( ) ) ; return null ; }
|
org . junit . Assert . assertThat ( net . pms . util . FileUtil . getFileCharsetName ( file ) )
|
should_return_this ( ) { org . fest . assertions . api . StringAssert returned = assertions . doesNotMatch ( pattern ) ; "<AssertPlaceHolder>" ; } doesNotMatch ( java . lang . String ) { strings . assertDoesNotMatch ( description , actual , regex ) ; return this ; }
|
org . junit . Assert . assertSame ( assertions , returned )
|
testLANG1055 ( ) { java . lang . System . setProperty ( "test_key" , "test_value" ) ; final java . lang . String expected = org . apache . commons . lang3 . text . StrSubstitutor . replace ( "test_key=${test_key}" , java . lang . System . getProperties ( ) ) ; final java . lang . String actual = org . apache . commons . lang3 . text . StrSubstitutor . replaceSystemProperties ( "test_key=${test_key}" ) ; "<AssertPlaceHolder>" ; } replaceSystemProperties ( java . lang . Object ) { return new org . apache . commons . lang3 . text . StrSubstitutor ( org . apache . commons . lang3 . text . StrLookup . systemPropertiesLookup ( ) ) . replace ( source ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testDecode ( ) { org . traccar . protocol . M2mProtocolDecoder decoder = new org . traccar . protocol . M2mProtocolDecoder ( null ) ; decoder . setDataManager ( new org . traccar . helper . TestDataManager ( ) ) ; int [ ] buf1 = new int [ ] { 35 , 90 , 60 , 42 , 38 , 36 , 33 , 92 , 40 , 125 , 112 , 33 , 42 , 33 , 37 , 76 , 124 , 100 , 33 , 34 , 11 , 11 , 11 } ; "<AssertPlaceHolder>" ; int [ ] buf2 = new int [ ] { 166 , 225 , 44 , 42 , 170 , 218 , 70 , 40 , 50 , 107 , 32 , 89 , 87 , 110 , 48 , 32 , 42 , 47 , 232 , 93 , 32 , 32 , 11 } ; verify ( decoder . decode ( null , null , org . jboss . netty . buffer . ChannelBuffers . wrappedBuffer ( org . traccar . helper . ChannelBufferTools . convertArray ( buf2 ) ) ) ) ; } decode ( org . jboss . netty . channel . ChannelHandlerContext , org . jboss . netty . channel . Channel , java . lang . Object ) { return null ; }
|
org . junit . Assert . assertNull ( decoder . decode ( null , null , org . jboss . netty . buffer . ChannelBuffers . wrappedBuffer ( org . traccar . helper . ChannelBufferTools . convertArray ( buf1 ) ) ) )
|
testPostDocument ( ) { long current = ru . ydn . wicket . wicketorientdb . rest . TestRestApi . wicket . getTester ( ) . getDatabase ( ) . countClass ( ru . ydn . wicket . wicketorientdb . rest . TestRestApi . TEST_REST_CLASS ) ; java . lang . String content = "{\"@class\":\"TestRest\",\"a\":\"test2\",\"b\":11,\"c\":false}" ; ru . ydn . wicket . wicketorientdb . rest . TestRestApi . wicket . getTester ( ) . executeUrl ( "orientdb/document/db/" , "POST" , content ) ; "<AssertPlaceHolder>" ; } getTester ( ) { return ( ( ru . ydn . wicket . wicketorientdb . junit . WicketOrientDbTester ) ( super . getTester ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( ( current + 1 ) , ru . ydn . wicket . wicketorientdb . rest . TestRestApi . wicket . getTester ( ) . getDatabase ( ) . countClass ( ru . ydn . wicket . wicketorientdb . rest . TestRestApi . TEST_REST_CLASS ) )
|
whenReadUsingCharStream_thenRead ( ) { final java . lang . String expectedValue = "Hello<sp>world" ; final java . io . FileReader reader = new java . io . FileReader ( "src/test/resources/test1.in" ) ; final java . lang . String result = com . google . common . io . CharStreams . toString ( reader ) ; "<AssertPlaceHolder>" ; reader . close ( ) ; } toString ( com . github . mysite . common . payonline . alipay . util . httpclient . NameValuePair [ ] ) { if ( ( nameValues == null ) || ( ( nameValues . length ) == 0 ) ) { return "null" ; } java . lang . StringBuilder buffer = new java . lang . StringBuilder ( ) ; for ( int i = 0 ; i < ( nameValues . length ) ; i ++ ) { com . github . mysite . common . payonline . alipay . util . httpclient . NameValuePair nameValue = nameValues [ i ] ; if ( i == 0 ) { buffer . append ( nameValue . getName ( ) ) . append ( "=" ) . append ( nameValue . getValue ( ) ) ; } else { buffer . append ( "&" ) . append ( nameValue . getName ( ) ) . append ( "=" ) . append ( nameValue . getValue ( ) ) ; } } return buffer . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expectedValue , result )
|
getEnvShouldSetNaming ( ) { java . util . Hashtable < java . lang . String , java . lang . String > env = microsoft . exchange . webservices . data . dns . DnsClient . getEnv ( "" ) ; "<AssertPlaceHolder>" ; } getEnv ( java . lang . String ) { java . util . Hashtable < java . lang . String , java . lang . String > env = new java . util . Hashtable < java . lang . String , java . lang . String > ( ) ; env . put ( "java.naming.factory.initial" , "com.sun.jndi.dns.DnsContextFactory" ) ; if ( ( dnsServerAddress != null ) && ( ! ( dnsServerAddress . isEmpty ( ) ) ) ) { env . put ( "java.naming.provider.url" , ( "dns://" + dnsServerAddress ) ) ; } return env ; }
|
org . junit . Assert . assertEquals ( env . get ( "java.naming.factory.initial" ) , "com.sun.jndi.dns.DnsContextFactory" )
|
testGetters ( ) { org . eurekastreams . server . persistence . mappers . requests . PersistenceRequest < org . eurekastreams . server . domain . stream . Activity > sut = new org . eurekastreams . server . persistence . mappers . requests . PersistenceRequest < org . eurekastreams . server . domain . stream . Activity > ( domainEntity ) ; "<AssertPlaceHolder>" ; } getDomainEnity ( ) { return entity ; }
|
org . junit . Assert . assertEquals ( domainEntity , sut . getDomainEnity ( ) )
|
testGetFacetsResponseIncludingTag ( ) { org . finra . herd . model . dto . ElasticsearchResponseDto elasticsearchResponseDto = new org . finra . herd . model . dto . ElasticsearchResponseDto ( ) ; java . util . List < org . finra . herd . model . dto . TagTypeIndexSearchResponseDto > nestTagTypeIndexSearchResponseDtos = new java . util . ArrayList ( ) ; org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagType1 = new org . finra . herd . model . dto . TagTypeIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE , null , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME ) ; org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagType2 = new org . finra . herd . model . dto . TagTypeIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE_2 , java . util . Collections . singletonList ( new org . finra . herd . model . dto . TagIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE , 1 , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_DISPLAY_NAME ) ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME_2 ) ; nestTagTypeIndexSearchResponseDtos . add ( tagType1 ) ; nestTagTypeIndexSearchResponseDtos . add ( tagType2 ) ; elasticsearchResponseDto . setNestTagTypeIndexSearchResponseDtos ( nestTagTypeIndexSearchResponseDtos ) ; org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagType3 = new org . finra . herd . model . dto . TagTypeIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE_2 , java . util . Collections . singletonList ( new org . finra . herd . model . dto . TagIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE , 1 , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_DISPLAY_NAME ) ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME_2 ) ; java . util . List < org . finra . herd . model . dto . TagTypeIndexSearchResponseDto > tagTypeIndexSearchResponseDtos = new java . util . ArrayList ( ) ; tagTypeIndexSearchResponseDtos . add ( tagType3 ) ; elasticsearchResponseDto . setTagTypeIndexSearchResponseDtos ( tagTypeIndexSearchResponseDtos ) ; java . util . List < org . finra . herd . model . api . xml . Facet > facets = elasticsearchHelper . getFacetsResponse ( elasticsearchResponseDto , org . finra . herd . dao . helper . BUSINESS_OBJECT_DEFINITION_SEARCH_INDEX_NAME , org . finra . herd . dao . helper . TAG_SEARCH_INDEX_NAME ) ; java . util . List < org . finra . herd . model . api . xml . Facet > expectedFacets = new java . util . ArrayList ( ) ; expectedFacets . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME , null , FacetTypeEnum . TAG_TYPE . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE , new java . util . ArrayList ( ) ) ) ; java . util . List < org . finra . herd . model . api . xml . Facet > tagFacet = new java . util . ArrayList ( ) ; tagFacet . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_DISPLAY_NAME , 1L , FacetTypeEnum . TAG . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE , null ) ) ; expectedFacets . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME_2 , null , FacetTypeEnum . TAG_TYPE . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE_2 , tagFacet ) ) ; "<AssertPlaceHolder>" ; } getFacetsResponse ( org . finra . herd . model . dto . ElasticsearchResponseDto , java . lang . String , java . lang . String ) { java . util . List < org . finra . herd . model . api . xml . Facet > facets = new java . util . ArrayList ( ) ; java . util . List < org . finra . herd . model . api . xml . Facet > tagTypeFacets ; if ( ( elasticsearchResponseDto . getNestTagTypeIndexSearchResponseDtos ( ) ) != null ) { tagTypeFacets = new java . util . ArrayList ( ) ; for ( org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagTypeIndexSearchResponseDto : elasticsearchResponseDto . getNestTagTypeIndexSearchResponseDtos ( ) ) { tagTypeFacets . add ( createTagTypeFacet ( tagTypeIndexSearchResponseDto ) ) ; } facets . addAll ( tagTypeFacets ) ; } if ( ( elasticsearchResponseDto . getTagTypeIndexSearchResponseDtos ( ) ) != null ) { for ( org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagTypeIndexDto : elasticsearchResponseDto . getTagTypeIndexSearchResponseDtos ( ) ) { boolean foundMatchingTagType = false ; for ( org . finra . herd . model . api . xml . Facet tagFacet : facets ) { if ( tagFacet . getFacetId ( ) . equals ( tagTypeIndexDto . getCode ( ) ) ) { foundMatchingTagType = true ; boolean foundMatchingTagCode = false ; for ( org . finra . herd . model . dto . TagIndexSearchResponseDto tagIndexDto : tagTypeIndexDto . getTagIndexSearchResponseDtos ( ) ) { for ( org . finra . herd . model . api . xml . Facet nestedTagIndexDto : tagFacet . getFacets ( ) ) { if ( tagIndexDto . getTagCode ( ) . equals ( nestedTagIndexDto . getFacetId ( ) )
|
org . junit . Assert . assertEquals ( expectedFacets , facets )
|
test_plusMajor_zero ( ) { org . joda . money . Money test = org . joda . money . TestMoney . GBP_2_34 . plusMajor ( 0 ) ; "<AssertPlaceHolder>" ; } plusMajor ( long ) { return with ( money . plusMajor ( amountToAdd ) ) ; }
|
org . junit . Assert . assertSame ( org . joda . money . TestMoney . GBP_2_34 , test )
|
getByGetter ( ) { com . linkedpipes . etl . rdf . utils . pojo . FieldUtilsTest . TestClass entity = new com . linkedpipes . etl . rdf . utils . pojo . FieldUtilsTest . TestClass ( ) ; entity . setProtectedValue ( "value" ) ; java . lang . reflect . Field field = com . linkedpipes . etl . rdf . utils . pojo . FieldUtilsTest . TestClass . class . getDeclaredField ( "protectedValue" ) ; com . linkedpipes . etl . rdf . utils . pojo . FieldUtils . getValue ( entity , field ) ; java . lang . String actualValue = ( ( java . lang . String ) ( com . linkedpipes . etl . rdf . utils . pojo . FieldUtils . getValue ( entity , field ) ) ) ; "<AssertPlaceHolder>" ; } getProtectedValue ( ) { return protectedValue ; }
|
org . junit . Assert . assertEquals ( entity . getProtectedValue ( ) , actualValue )
|
testParseString ( ) { java . lang . String test = "2006-01-12<sp>00:00:00" ; java . sql . Date testDate = ( ( java . sql . Date ) ( handler . parse ( test ) ) ) ; "<AssertPlaceHolder>" ; } parseString ( java . math . BigInteger ) { return value . toString ( ) ; }
|
org . junit . Assert . assertEquals ( handler . parseString ( testDate ) , test )
|
restoreSuccessfullyWithoutChecksum ( ) { entry = new org . codice . ddf . configuration . migration . ImportMigrationExternalEntryImpl ( mockContext , com . google . common . collect . ImmutableMap . of ( MigrationEntryImpl . METADATA_NAME , org . codice . ddf . configuration . migration . ImportMigrationExternalEntryImplTest . ENTRY_NAME , MigrationEntryImpl . METADATA_SOFTLINK , false ) ) ; "<AssertPlaceHolder>" ; } restore ( org . codice . ddf . util . function . BiThrowingConsumer ) { org . apache . commons . lang . Validate . notNull ( consumer , "invalid<sp>null<sp>consumer" ) ; if ( ( restored ) == null ) { this . restored = false ; java . util . Optional < java . io . InputStream > is = java . util . Optional . empty ( ) ; try { is = getInputStream ( true ) ; final java . util . Optional < java . io . InputStream > fis = is ; this . restored = getReport ( ) . wasIOSuccessful ( ( ) -> consumer . accept ( getReport ( ) , fis ) ) ; } catch ( java . io . IOException e ) { getReport ( ) . record ( new org . codice . ddf . migration . MigrationException ( Messages . IMPORT_PATH_COPY_ERROR , path , context . getPathUtils ( ) . getDDFHome ( ) , e ) ) ; } finally { is . ifPresent ( org . apache . commons . io . IOUtils :: closeQuietly ) ; } } return restored ; }
|
org . junit . Assert . assertThat ( entry . restore ( true ) , org . hamcrest . CoreMatchers . equalTo ( true ) )
|
groupCardinalityZeroToOneWithDefaultAttributeCardinality ( ) { generateDrugsWithGroups ( ) ; final com . b2international . index . query . Expression actual = eval ( java . lang . String . format ( "<%s:<sp>[0..1]<sp>{<sp>%s<sp>=<sp><%s<sp>}" , com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . DRUG_ROOT , com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . HAS_ACTIVE_INGREDIENT , com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . SUBSTANCE ) ) ; final com . b2international . index . query . Expression expected = com . b2international . index . query . Expressions . builder ( ) . filter ( descendantsOf ( com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . DRUG_ROOT ) ) . mustNot ( ids ( com . google . common . collect . ImmutableSet . of ( com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . ALGOFLEX_TABLET ) ) ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return build ( ( ( java . lang . Void ) ( null ) ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
shouldReturnFalseForOpenSquareBracket ( ) { boolean start = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isWordStart ( "[" , 0 ) ; "<AssertPlaceHolder>" ; } isWordStart ( java . lang . String , int ) { checkNotNull ( entityName ) ; int length = entityName . length ( ) ; checkElementIndex ( index , length ) ; edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType indexCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , index ) ; if ( ! ( indexCharType . isWordLetter ( ) ) ) { return false ; } if ( index == 0 ) { return true ; } edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType prevCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index - 1 ) ) ; if ( prevCharType != indexCharType ) { return ! ( ( indexCharType == ( EntityNameCharType . LETTER ) ) && ( prevCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) ) ; } if ( indexCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) { boolean hasFollowingCharacter = index < ( length - 1 ) ; return hasFollowingCharacter && ( ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index + 1 ) ) ) == ( EntityNameCharType . LETTER ) ) ; } return false ; }
|
org . junit . Assert . assertEquals ( false , start )
|
testSetCommandValue ( ) { com . impetus . ankush . agent . utils . Result fixture = new com . impetus . ankush . agent . utils . Result ( ) ; fixture . setError ( "" ) ; fixture . setOutput ( "" ) ; fixture . setCommand ( "" ) ; fixture . setExitVal ( 1 ) ; java . lang . String command = "ls" ; fixture . setCommand ( command ) ; "<AssertPlaceHolder>" ; } getCommand ( ) { return ( ( "echo<sp>\"" + ( this . line ) ) + "\"<sp>>><sp>" ) + ( this . filePath ) ; }
|
org . junit . Assert . assertEquals ( command , fixture . getCommand ( ) )
|
testCaseInsensitiveLocalLookup ( ) { System . out . println ( "<sp>test<sp>case-insensitive<sp>local<sp>lookup" ) ; final java . lang . String varName = "foo" ; final java . lang . String altVarName = "FoO" ; final java . lang . String varValue = "localCaseTest" ; org . geotools . filter . function . EnvFunction . setLocalValue ( varName , varValue ) ; java . lang . Object result = ff . function ( "env" , ff . literal ( altVarName ) ) . evaluate ( null ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( eIsProxy ( ) ) return super . toString ( ) ; java . lang . StringBuffer result = new java . lang . StringBuffer ( super . toString ( ) ) ; result . append ( "<sp>(actuate:<sp>" ) ; if ( actuateESet ) result . append ( actuate ) ; else result . append ( "<unset>" ) ; result . append ( ",<sp>arcrole:<sp>" ) ; result . append ( arcrole ) ; result . append ( ",<sp>href:<sp>" ) ; result . append ( href ) ; result . append ( ",<sp>remoteSchema:<sp>" ) ; result . append ( remoteSchema ) ; result . append ( ",<sp>arcrole:<sp>" 0 ) ; result . append ( role ) ; result . append ( ",<sp>show:<sp>" ) ; if ( showESet ) result . append ( show ) ; else result . append ( "<unset>" ) ; result . append ( ",<sp>title:<sp>" ) ; result . append ( title ) ; result . append ( ",<sp>type:<sp>" ) ; if ( typeESet ) result . append ( type ) ; else result . append ( "<unset>" ) ; result . append ( ",<sp>updateSequence:<sp>" ) ; result . append ( updateSequence ) ; result . append ( ",<sp>version:<sp>" ) ; if ( versionESet ) result . append ( version ) ; else result . append ( "<unset>" ) ; result . append ( ')' ) ; return result . toString ( ) ; }
|
org . junit . Assert . assertEquals ( varValue , result . toString ( ) )
|
testAccessBasicValue_wchar ( ) { org . omg . CORBA . TypeCode tc = orb . get_primitive_tc ( org . omg . CORBA . TCKind . tk_wchar ) ; org . omg . DynamicAny . DynAny dynAny = createDynAnyFromTypeCode ( tc ) ; java . lang . String msg = "Value<sp>inserted<sp>into<sp>DynAny<sp>object<sp>is<sp>not<sp>equal<sp>to<sp>value<sp>" ; msg += "extracted<sp>from<sp>same<sp>DynAny<sp>object" ; dynAny . insert_wchar ( org . jacorb . test . orb . dynany . DynAnyBaseTest . EURO_SIGN ) ; "<AssertPlaceHolder>" ; } get_wchar ( ) { checkDestroyed ( ) ; org . omg . CORBA . Any any = getRepresentation ( ) ; try { return any . extract_wchar ( ) ; } catch ( org . jacorb . orb . dynany . org . omg b ) { throw new org . omg . DynamicAny . DynAnyPackage . TypeMismatch ( ) ; } }
|
org . junit . Assert . assertEquals ( msg , org . jacorb . test . orb . dynany . DynAnyBaseTest . EURO_SIGN , dynAny . get_wchar ( ) )
|
boundaryParameterWithQuotes ( ) { final java . lang . String boundary = "batch_1.2+34:2j)0?" ; final java . lang . String contentType = ( ( ( org . apache . olingo . server . core . deserializer . batch . BatchParserCommonTest . MULTIPART_MIXED ) + ";<sp>boundary=\"" ) + boundary ) + "\"" ; "<AssertPlaceHolder>" ; } getBoundary ( java . lang . String , int ) { final org . apache . olingo . commons . api . format . ContentType type = org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . parseContentType ( contentType , ContentType . MULTIPART_MIXED , line ) ; final java . lang . String boundary = type . getParameter ( org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . BOUNDARY ) ; if ( boundary == null ) { throw new org . apache . olingo . server . api . deserializer . batch . BatchDeserializerException ( "Missing<sp>boundary." , BatchDeserializerException . MessageKeys . MISSING_BOUNDARY_DELIMITER , java . lang . Integer . toString ( line ) ) ; } final java . util . regex . Matcher matcher = org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . PATTERN_BOUNDARY . matcher ( boundary ) ; if ( matcher . matches ( ) ) { return ( matcher . group ( 1 ) ) == null ? matcher . group ( 2 ) : matcher . group ( 1 ) ; } else { throw new org . apache . olingo . server . api . deserializer . batch . BatchDeserializerException ( "Invalid<sp>boundary<sp>format" , BatchDeserializerException . MessageKeys . INVALID_BOUNDARY , java . lang . Integer . toString ( line ) ) ; } }
|
org . junit . Assert . assertEquals ( boundary , org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . getBoundary ( contentType , 0 ) )
|
testReadFromWithTimeoutExceptionOnInitialRead ( ) { inputStreamStub . addPacket ( new java . net . SocketTimeoutException ( "Fake<sp>Timeout<sp>Exception" ) ) ; try { endpoint . setReceiveTimeout ( 500 ) ; endpoint . setReadTimeout ( 100 ) ; instance . readFrom ( socketStub ) ; org . junit . Assert . fail ( "Should<sp>have<sp>thrown<sp>and<sp>exception" ) ; } catch ( java . net . SocketTimeoutException expectedEx ) { "<AssertPlaceHolder>" ; } } toByteArray ( ) { if ( ( availableByteCount ) > 0 ) { return java . util . Arrays . copyOf ( buffer , availableByteCount ) ; } return null ; }
|
org . junit . Assert . assertNull ( instance . toByteArray ( ) )
|
testIssue99 ( ) { org . zoodb . jdo . ZooJdoProperties props = org . zoodb . test . testutil . TestTools . getProps ( ) ; props . setZooAutoCreateSchema ( true ) ; javax . jdo . PersistenceManager pm = org . zoodb . test . testutil . TestTools . openPM ( props ) ; final java . lang . String str = "abcdefghijklmnopqrstuvwxyz" ; pm . currentTransaction ( ) . begin ( ) ; for ( char c : str . toCharArray ( ) ) { org . zoodb . test . jdo . TestClass i = new org . zoodb . test . jdo . TestClass ( ) ; i . setChar ( c ) ; pm . makePersistent ( i ) ; } pm . currentTransaction ( ) . commit ( ) ; pm . currentTransaction ( ) . begin ( ) ; org . zoodb . jdo . ZooJdoHelper . createIndex ( pm , org . zoodb . test . jdo . TestClass . class , "_char" , true ) ; pm . currentTransaction ( ) . commit ( ) ; pm . currentTransaction ( ) . begin ( ) ; javax . jdo . Query q = pm . newQuery ( org . zoodb . test . jdo . TestClass . class ) ; q . declareParameters ( "Character<sp>ch1,<sp>Character<sp>ch2" ) ; q . setFilter ( "_char<sp>==<sp>ch1<sp>||<sp>_char<sp>==<sp>ch2" ) ; java . util . Collection < org . zoodb . test . jdo . TestClass > rslt = ( ( java . util . Collection < org . zoodb . test . jdo . TestClass > ) ( q . execute ( 'a' , 'z' ) ) ) ; "<AssertPlaceHolder>" ; q . closeAll ( ) ; pm . currentTransaction ( ) . commit ( ) ; org . zoodb . test . testutil . TestTools . closePM ( ) ; } iterator ( ) { return ext . iterator ( ) ; }
|
org . junit . Assert . assertTrue ( rslt . iterator ( ) . hasNext ( ) )
|
shouldFindTestsInJUnitTheoryTest ( ) { final java . util . Collection < org . pitest . testapi . TestUnit > actual = findWithTestee ( com . example . TheoryTest . class ) ; "<AssertPlaceHolder>" ; } findWithTestee ( java . lang . Class ) { return this . testee . findTestUnits ( clazz ) ; }
|
org . junit . Assert . assertEquals ( 3 , actual . size ( ) )
|
testConstructor_ExprList ( ) { org . apache . jena . sparql . expr . Expr e = new org . apache . jena . sparql . expr . E_FunctionDynamic ( new org . apache . jena . sparql . expr . ExprList ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( ( e instanceof org . apache . jena . sparql . expr . E_FunctionDynamic ) )
|
testSetPath ( ) { final java . lang . String newPath = "/newpath" ; org . pentaho . platform . plugin . services . importexport . RepositoryFileBundleTest . repositoryFileBundle . setPath ( newPath ) ; "<AssertPlaceHolder>" ; } getPath ( ) { return path ; }
|
org . junit . Assert . assertEquals ( org . pentaho . platform . plugin . services . importexport . RepositoryFileBundleTest . repositoryFileBundle . getPath ( ) , newPath )
|
testInvokeOccurResourcenotfoundexceptionInNestedMethod02 ( ) { org . terasoluna . gfw . common . exception . ResourceNotFoundException occurException = new org . terasoluna . gfw . common . exception . ResourceNotFoundException ( org . terasoluna . gfw . common . message . ResultMessages . error ( ) . add ( "e.cm.xxx1" , "args1" , "args2" ) ) ; org . terasoluna . gfw . common . exception . test . TestService service = getApplicationContext ( ) . getBean ( org . terasoluna . gfw . common . exception . test . TestService . class ) ; service . setResultMessagesNotificationException ( occurException ) ; try { org . terasoluna . gfw . common . exception . test . TestFacade facade = getApplicationContext ( ) . getBean ( org . terasoluna . gfw . common . exception . test . TestFacade . class ) ; facade . getMessage ( ) ; org . junit . Assert . fail ( "don't<sp>occur<sp>ResourceNotFoundException." ) ; } catch ( org . terasoluna . gfw . common . exception . ResourceNotFoundException e ) { "<AssertPlaceHolder>" ; verify ( mockExceptionLogger , times ( 1 ) ) . warn ( occurException ) ; verify ( mockExceptionLogger , times ( 1 ) ) . warn ( any ( org . terasoluna . gfw . common . exception . Exception . class ) ) ; } } getMessage ( ) { return resultMessages . toString ( ) ; }
|
org . junit . Assert . assertThat ( e , org . hamcrest . CoreMatchers . is ( occurException ) )
|
testScanFrom ( ) { java . util . List < java . util . Map < java . lang . String , java . lang . Object > > expected = com . google . common . collect . ImmutableList . < java . util . Map < java . lang . String , java . lang . Object > > of ( com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( Intrinsic . ID , "key1" , Intrinsic . DELETED , false , "count" , 1234 ) , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( Intrinsic . ID , "key2" , Intrinsic . DELETED , false , "count" , 5678 ) ) ; when ( _server . scan ( "table-name" , "from-key" , Long . MAX_VALUE , true , ReadConsistency . STRONG ) ) . thenReturn ( expected . iterator ( ) ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > actual = com . google . common . collect . Lists . newArrayList ( com . bazaarvoice . emodb . sor . client . DataStoreStreaming . scan ( sorClient ( test . integration . sor . DataStoreJerseyTest . APIKEY_TABLE ) , "table-name" , "from-key" , 9876L , false , ReadConsistency . STRONG ) ) ; "<AssertPlaceHolder>" ; verify ( _server ) . scan ( "table-name" , "from-key" , Long . MAX_VALUE , true , ReadConsistency . STRONG ) ; verifyNoMoreInteractions ( _server ) ; } sorClient ( java . lang . String ) { return com . bazaarvoice . emodb . sor . client . DataStoreAuthenticator . proxied ( new com . bazaarvoice . emodb . sor . client . DataStoreClient ( java . net . URI . create ( "/sor/1" ) , new com . bazaarvoice . emodb . common . jersey . dropwizard . JerseyEmoClient ( _resourceTestRule . client ( ) ) ) ) . usingCredentials ( apiKey ) ; }
|
org . junit . Assert . assertEquals ( actual , expected )
|
testPingCommandStatusFail ( ) { resource . configure ( "NiciraNvpResource" , parameters ) ; final com . cloud . network . nicira . ControlClusterStatus ccs = mock ( com . cloud . network . nicira . ControlClusterStatus . class ) ; when ( ccs . getClusterStatus ( ) ) . thenReturn ( "unstable" ) ; when ( nvpApi . getControlClusterStatus ( ) ) . thenReturn ( ccs ) ; final com . cloud . legacymodel . communication . command . PingCommand ping = resource . getCurrentStatus ( 42 ) ; "<AssertPlaceHolder>" ; } getCurrentStatus ( long ) { return new com . cloud . legacymodel . communication . command . PingStorageCommand ( com . cloud . model . enumeration . HostType . Storage , id , new java . util . HashMap ( ) ) ; }
|
org . junit . Assert . assertTrue ( ( ping == null ) )
|
epollAdd0_Remove ( ) { final com . barchart . udt . SocketUDT socket = new com . barchart . udt . SocketUDT ( TypeUDT . DATAGRAM ) ; final int epollID = com . barchart . udt . SocketUDT . epollCreate0 ( ) ; "<AssertPlaceHolder>" ; com . barchart . udt . SocketUDT . epollAdd0 ( epollID , socket . id ( ) , EpollUDT . Opt . BOTH . code ) ; com . barchart . udt . SocketUDT . epollRemove0 ( epollID , socket . id ( ) ) ; com . barchart . udt . SocketUDT . epollRelease0 ( epollID ) ; } epollCreate0 ( ) { final int epollID = com . barchart . udt . SocketUDT . epollCreate0 ( ) ; com . barchart . udt . SocketUDT . epollRelease0 ( epollID ) ; }
|
org . junit . Assert . assertTrue ( ( epollID > 0 ) )
|
error_field_in_result_docment_should_not_cause_exception ( ) { org . ektorp . ViewResult result = null ; try { result = readResult ( "impl/view_result_with_nested_error.json" ) ; } catch ( org . ektorp . ViewResultException e ) { org . junit . Assert . fail ( "nested<sp>error<sp>field<sp>should<sp>cause<sp>ViewResultException" ) ; } "<AssertPlaceHolder>" ; } getSize ( ) { return rows . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , result . getSize ( ) )
|
testGetGid ( ) { org . dcache . chimera . posix . Stat stat = new org . dcache . chimera . posix . Stat ( ) ; stat . setGid ( 1 ) ; "<AssertPlaceHolder>" ; } getGid ( ) { return _gid ; }
|
org . junit . Assert . assertEquals ( 1 , stat . getGid ( ) )
|
testGetScreenWidth ( ) { try { java . awt . Dimension screenSize = java . awt . Toolkit . getDefaultToolkit ( ) . getScreenSize ( ) ; "<AssertPlaceHolder>" ; } catch ( java . awt . HeadlessException e ) { warnHeadless ( ) ; } } getScreenWidth ( ) { return org . esa . snap . ui . UIUtils . getScreenSize ( ) . width ; }
|
org . junit . Assert . assertEquals ( org . esa . snap . ui . UIUtils . getScreenWidth ( ) , screenSize . width )
|
adderObject ( ) { final org . apache . johnzon . mapper . AdderTest . MyMapOfObjects map = new org . apache . johnzon . mapper . MapperBuilder ( ) . build ( ) . readObject ( "{\"foo\":{\"value\":\"bar\"}}" , org . apache . johnzon . mapper . AdderTest . MyMapOfObjects . class ) ; "<AssertPlaceHolder>" ; } get ( int ) { return unmodifieableBackingList . get ( index ) ; }
|
org . junit . Assert . assertEquals ( "bar" , map . get ( "foo" ) . value )
|
testRun ( ) { try ( sqlite . feature . immutable . pagedresult . BindAppDataSource dataSource = sqlite . feature . immutable . pagedresult . BindAppDataSource . open ( ) ; sqlite . feature . immutable . pagedresult . DaoPersonImpl dao = dataSource . getDaoPerson ( ) ) { dao . deleteAll ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { dao . insertOne ( java . util . UUID . randomUUID ( ) . toString ( ) , java . lang . String . format ( "name%03d" , i ) , java . lang . String . format ( "surname%03d" , i ) , java . lang . String . format ( "birthCity%03d" , i ) , new java . util . Date ( ) ) ; } com . abubusoft . kripton . android . sqlite . PagedResultImpl < sqlite . feature . immutable . pagedresult . Person > result = dao . select ( ) ; result . execute ( ) ; for ( int i = 0 ; i < ( result . getTotalPages ( ) ) ; i ++ ) { result . setPage ( i ) ; result . execute ( ) ; com . abubusoft . kripton . android . Logger . info ( "---------------" ) ; com . abubusoft . kripton . android . Logger . info ( ( "\tPage<sp>" + i ) ) ; com . abubusoft . kripton . android . Logger . info ( "---------------" ) ; for ( sqlite . feature . immutable . pagedresult . Person item : result . getList ( ) ) { com . abubusoft . kripton . android . Logger . info ( item . getName ( ) ) ; } "<AssertPlaceHolder>" ; } } } get ( int ) { if ( ( i < 0 ) || ( i >= ( size ( ) ) ) ) { throw new java . lang . IndexOutOfBoundsException ( ( ( ( "Index:<sp>" + i ) + ",<sp>Size:<sp>" ) + ( size ( ) ) ) ) ; } int localIndex = i - ( mLeadingNullCount ) ; if ( ( localIndex < 0 ) || ( localIndex >= ( mStorageCount ) ) ) { return null ; } int localPageIndex ; int pageInternalIndex ; if ( isTiled ( ) ) { localPageIndex = localIndex / ( mPageSize ) ; pageInternalIndex = localIndex % ( mPageSize ) ; } else { pageInternalIndex = localIndex ; final int localPageCount = mPages . size ( ) ; for ( localPageIndex = 0 ; localPageIndex < localPageCount ; localPageIndex ++ ) { int pageSize = mPages . get ( localPageIndex ) . size ( ) ; if ( pageSize > pageInternalIndex ) { break ; } pageInternalIndex -= pageSize ; } } java . util . List < T > page = mPages . get ( localPageIndex ) ; if ( ( page == null ) || ( ( page . size ( ) ) == 0 ) ) { return null ; } return page . get ( pageInternalIndex ) ; }
|
org . junit . Assert . assertTrue ( result . getList ( ) . get ( 0 ) . getName ( ) . equals ( java . lang . String . format ( "name%03d" , ( i * 10 ) ) ) )
|
testCustomErrorPageMissing ( ) { java . io . File appDir = new java . io . File ( getTemporaryDirectory ( ) , "]" 4 ) ; java . io . File webInf = new java . io . File ( appDir , "]" 5 ) ; addDeleteOnTearDown ( appDir ) ; if ( ( ! ( webInf . mkdirs ( ) ) ) && ( ! ( webInf . isDirectory ( ) ) ) ) { org . junit . Assert . fail ( ( ( "Unable<sp>to<sp>create<sp>directory<sp>[" + webInf ) + "]" ) ) ; } java . io . Writer w = new java . io . OutputStreamWriter ( new java . io . FileOutputStream ( new java . io . File ( appDir , "WEB-INF/web.xml" ) ) , "]" 2 ) ; try { w . write ( ( "<?xml<sp>version=\'1.0\'<sp>encoding=\'UTF-8\'?>\n" + ( ( ( ( ( ( ( "]" 0 + "]" 6 ) + "<sp>xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee<sp>" ) + "]" 3 ) + "<sp>version=\'2.4\'>\n" ) + "<error-page>\n<error-code>404</error-code>\n" ) + "<location>/404-absent.html</location>\n</error-page>\n" ) + "</web-app>\n" ) ) ) ; w . flush ( ) ; } finally { w . close ( ) ; } org . apache . catalina . startup . Tomcat tomcat = getTomcatInstance ( ) ; java . lang . String contextPath = "/MyApp" ; tomcat . addWebapp ( null , contextPath , appDir . getAbsolutePath ( ) ) ; tomcat . start ( ) ; org . apache . catalina . servlets . TestDefaultServlet . TestCustomErrorClient client = new org . apache . catalina . servlets . TestDefaultServlet . TestCustomErrorClient ( tomcat . getConnector ( ) . getLocalPort ( ) ) ; client . reset ( ) ; client . setRequest ( new java . lang . String [ ] { ( "]" 1 + ( CRLF ) ) + ( CRLF ) } ) ; client . connect ( ) ; client . processRequest ( ) ; "<AssertPlaceHolder>" ; } isResponse404 ( ) { return getResponseLine ( ) . startsWith ( org . apache . catalina . startup . SimpleHttpClient . FAIL_404 ) ; }
|
org . junit . Assert . assertTrue ( client . isResponse404 ( ) )
|
testEmptyConfig ( ) { org . dcache . gplazma . strategies . SessionStrategy strategy = strategyFactory . newSessionStrategy ( ) ; "<AssertPlaceHolder>" ; strategy . setPlugins ( emptyList ) ; java . util . Set < java . security . Principal > authorizedPrincipals = com . google . common . collect . Sets . newHashSet ( ) ; java . util . Set < java . lang . Object > sessionAttributes = com . google . common . collect . Sets . newHashSet ( ) ; strategy . session ( org . dcache . gplazma . strategies . SessionStrategyTests . IGNORING_LOGIN_MONITOR , authorizedPrincipals , sessionAttributes ) ; } newSessionStrategy ( ) { return new org . dcache . gplazma . strategies . DefaultSessionStrategy ( ) ; }
|
org . junit . Assert . assertNotNull ( strategy )
|
testOnBlockPlaceNotAllowed ( ) { when ( island . isAllowed ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . any ( ) ) ) . thenReturn ( false ) ; org . bukkit . block . Block placedBlock = mock ( org . bukkit . block . Block . class ) ; when ( placedBlock . getType ( ) ) . thenReturn ( Material . STONE ) ; when ( placedBlock . getLocation ( ) ) . thenReturn ( location ) ; org . bukkit . block . BlockState replacedBlockState = mock ( org . bukkit . block . BlockState . class ) ; org . bukkit . block . Block placedAgainst = mock ( org . bukkit . block . Block . class ) ; org . bukkit . inventory . ItemStack itemInHand = mock ( org . bukkit . inventory . ItemStack . class ) ; org . bukkit . inventory . EquipmentSlot hand = org . bukkit . inventory . EquipmentSlot . HAND ; org . bukkit . event . block . BlockPlaceEvent e = new org . bukkit . event . block . BlockPlaceEvent ( placedBlock , replacedBlockState , placedAgainst , itemInHand , player , true , hand ) ; pbl . onBlockPlace ( e ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( notifier ) . notify ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . eq ( "protection.protected" ) ) ; } isCancelled ( ) { return cancelled ; }
|
org . junit . Assert . assertTrue ( e . isCancelled ( ) )
|
testSpacesInChunkSizeHeader ( ) { final java . lang . String msg = "abc" ; final java . lang . String msgLen = java . lang . Integer . toHexString ( msg . length ( ) ) ; httpRequestCheckFilter . setCheckParameters ( org . glassfish . grizzly . memory . Buffers . wrap ( connection . getMemoryManager ( ) , msg ) , java . util . Collections . < java . lang . String , org . glassfish . grizzly . utils . Pair < java . lang . String , java . lang . String > > emptyMap ( ) ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "POST<sp>/<sp>HTTP/1.1\r\n" ) ; sb . append ( "Host:<sp>localhost:" ) . append ( org . glassfish . grizzly . http . ChunkedTransferEncodingTest . PORT ) . append ( "\r\n" ) ; sb . append ( "Transfer-Encoding:<sp>chunked\r\n\r\n" ) ; sb . append ( "<sp>" ) . append ( msgLen ) . append ( "<sp>" ) . append ( eol ) . append ( msg ) . append ( eol ) ; sb . append ( "<sp>0<sp>" ) . append ( eol ) . append ( eol ) ; org . glassfish . grizzly . Buffer b = org . glassfish . grizzly . memory . Buffers . wrap ( MemoryManager . DEFAULT_MEMORY_MANAGER , sb . toString ( ) , Charsets . ASCII_CHARSET ) ; java . util . concurrent . Future f = connection . write ( b ) ; f . get ( 10 , TimeUnit . SECONDS ) ; java . util . concurrent . Future < java . lang . Boolean > result = resultQueue . poll ( 10 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } get ( org . glassfish . grizzly . filterchain . FilterChainContext . Operation , int ) { final int opIdx = operation . ordinal ( ) ; final org . glassfish . grizzly . filterchain . DefaultFilterChain . FilterStateElement elem = state [ opIdx ] [ filterIndex ] ; if ( ( elem != null ) && ( elem . isValid ) ) { return elem ; } return null ; }
|
org . junit . Assert . assertTrue ( result . get ( 10 , TimeUnit . SECONDS ) )
|
shouldReturnDefaultValueInCaseOfDefaults ( ) { final java . lang . String value = org . arquillian . cube . docker . impl . util . ContainerObjectUtil . getTopCubeAttribute ( org . arquillian . cube . docker . impl . util . ContainerObjectUtilTest . DefaultAnnotation . class , "value" , org . arquillian . cube . containerobject . Cube . class , "" ) ; "<AssertPlaceHolder>" ; } getTopCubeAttribute ( java . lang . Class , java . lang . String , java . lang . Class , T ) { return java . security . AccessController . doPrivileged ( ( ( java . security . PrivilegedAction < T > ) ( ( ) -> { java . lang . reflect . Method field = null ; try { field = annotationClass . getMethod ( nameField ) ; } catch ( e ) { throw new < org . arquillian . cube . docker . impl . util . e > java . lang . IllegalArgumentException ( ) ; } Class < ? > nextSource = source ; boolean foundAnnotation = false ; while ( nextSource != ( . class ) ) { if ( nextSource . isAnnotationPresent ( annotationClass ) ) { foundAnnotation = true ; final java . lang . annotation . Annotation annotation = nextSource . getAnnotation ( annotationClass ) ; final org . arquillian . cube . docker . impl . util . T value = getValue ( annotation , field ) ; if ( defaultValue . getClass ( ) . isArray ( ) ) { if ( defaultValue . getClass ( ) . getComponentType ( ) . isPrimitive ( ) ) { if ( ! ( java . util . Arrays . equals ( ( ( int [ ] ) ( value ) ) , ( ( int [ ] ) ( defaultValue ) ) ) ) ) { return value ; } } else { if ( ! ( java . util . Arrays . equals ( ( ( java . lang . Object [ ] ) ( value ) ) , ( ( java . lang . Object [ ] ) ( defaultValue ) ) ) ) ) { return value ; } } } else { if ( ! ( value . equals ( defaultValue ) ) ) { return value ; } } } nextSource = nextSource . getSuperclass ( ) ; } return foundAnnotation ? defaultValue : null ; } ) ) ) ; }
|
org . junit . Assert . assertThat ( value , org . hamcrest . core . Is . is ( "" ) )
|
test_subDays ( ) { com . baeldung . gregorian . calendar . GregorianCalendarExample calendarDemo = new com . baeldung . gregorian . calendar . GregorianCalendarExample ( ) ; java . util . GregorianCalendar calendarActual = new java . util . GregorianCalendar ( 2018 , 6 , 28 ) ; java . util . GregorianCalendar calendarExpected = new java . util . GregorianCalendar ( 2018 , 6 , 28 ) ; calendarExpected . add ( Calendar . DATE , ( - 1 ) ) ; java . util . Date expectedDate = calendarExpected . getTime ( ) ; "<AssertPlaceHolder>" ; } subtractDays ( java . util . GregorianCalendar , int ) { java . util . GregorianCalendar cal = calendar ; cal . add ( Calendar . DATE , ( - daysToSubtract ) ) ; return cal . getTime ( ) ; }
|
org . junit . Assert . assertEquals ( expectedDate , calendarDemo . subtractDays ( calendarActual , 1 ) )
|
nullFormatCharge ( ) { org . openscience . cdk . interfaces . IAtomContainer container = mock ( org . openscience . cdk . interfaces . IAtomContainer . class ) ; org . openscience . cdk . interfaces . IAtom atom = mock ( org . openscience . cdk . interfaces . IAtom . class ) ; when ( atom . getAtomicNumber ( ) ) . thenReturn ( 6 ) ; when ( atom . getMassNumber ( ) ) . thenReturn ( 12 ) ; when ( atom . getImplicitHydrogenCount ( ) ) . thenReturn ( 0 ) ; when ( atom . getFormalCharge ( ) ) . thenReturn ( null ) ; org . openscience . cdk . renderer . RendererModel model = new org . openscience . cdk . renderer . RendererModel ( ) ; model . registerParameters ( new org . openscience . cdk . renderer . generators . standard . StandardGenerator ( new java . awt . Font ( java . awt . Font . SANS_SERIF , java . awt . Font . PLAIN , 12 ) ) ) ; org . openscience . cdk . renderer . generators . standard . AtomSymbol atomSymbol = atomGenerator . generateSymbol ( container , atom , HydrogenPosition . Left , model ) ; java . util . List < java . awt . Shape > shapes = atomSymbol . getOutlines ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; }
|
org . junit . Assert . assertThat ( shapes . size ( ) , org . hamcrest . CoreMatchers . is ( 2 ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.