input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
validate_clearChargingProfileRequestIsEmpty_returnTrue ( ) { boolean isValid = request . validate ( ) ; "<AssertPlaceHolder>" ; } validate ( ) { return true ; }
org . junit . Assert . assertThat ( isValid , org . hamcrest . CoreMatchers . is ( true ) )
testParseNegativeZ ( ) { java . lang . String source = ( ( ( "{1" + ( getDecimalCharacter ( ) ) ) + "2323;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "4343}" ; org . apache . commons . math3 . geometry . euclidean . twod . Vector2D expected = new org . apache . commons . math3 . geometry . euclidean . twod . Vector2D ( 1.2323 , 1.4343 ) ; org . apache . commons . math3 . geometry . euclidean . twod . Vector2D actual = vector2DFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( com . google . javascript . jscomp . AbstractCompiler ) { try { com . google . javascript . jscomp . JsAst . logger_ . fine ( ( "Parsing:<sp>" + ( sourceFile . getName ( ) ) ) ) ; com . google . javascript . jscomp . parsing . ParserRunner . ParseResult result = com . google . javascript . jscomp . parsing . ParserRunner . parse ( sourceFile , sourceFile . getCode ( ) , compiler . getParserConfig ( ) , compiler . getDefaultErrorReporter ( ) , com . google . javascript . jscomp . JsAst . logger_ ) ; root = result . ast ; compiler . setOldParseTree ( sourceFile . getName ( ) , result . oldAst ) ; } catch ( java . io . IOException e ) { compiler . report ( com . google . javascript . jscomp . JSError . make ( AbstractCompiler . READ_ERROR , sourceFile . getName ( ) ) ) ; } if ( ( ( root ) == null ) || ( compiler . hasHaltingErrors ( ) ) ) { root = com . google . javascript . rhino . IR . script ( ) ; } else { compiler . prepareAst ( root ) ; } root . setStaticSourceFile ( sourceFile ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetters ( ) { org . ff4j . property . store . InMemoryPropertyStore ips = new org . ff4j . property . store . InMemoryPropertyStore ( ) ; ips . setLocation ( "ff4j.xml" ) ; ips . setFileName ( "invalid.xml" ) ; "<AssertPlaceHolder>" ; } getFileName ( ) { return fileName ; }
org . junit . Assert . assertEquals ( "invalid.xml" , ips . getFileName ( ) )
testWrongCountry ( ) { net . canadensys . processor . AbstractDataProcessor dataProcessor = new net . canadensys . processor . geography . CountryProcessor ( ) ; net . canadensys . processor . dwc . mock . MockOccurrenceModel mockRawModel = new net . canadensys . processor . dwc . mock . MockOccurrenceModel ( ) ; net . canadensys . processor . dwc . mock . MockOccurrenceModel mockModel = new net . canadensys . processor . dwc . mock . MockOccurrenceModel ( ) ; mockRawModel . setCountry ( "xyz" ) ; net . canadensys . processor . ProcessingResult pr = new net . canadensys . processor . ProcessingResult ( ) ; dataProcessor . processBean ( mockRawModel , mockModel , null , pr ) ; "<AssertPlaceHolder>" ; } getCountry ( ) { return country ; }
org . junit . Assert . assertEquals ( "xyz" , mockModel . getCountry ( ) )
testSerialization ( ) { org . jfree . data . xy . XYSeries s1 = new org . jfree . data . xy . XYSeries ( "Series" ) ; s1 . add ( 1.0 , 1.1 ) ; org . jfree . data . xy . XYSeriesCollection c1 = new org . jfree . data . xy . XYSeriesCollection ( ) ; c1 . addSeries ( s1 ) ; org . jfree . data . xy . XYSeriesCollection c2 = ( ( org . jfree . data . xy . XYSeriesCollection ) ( org . jfree . chart . TestUtils . serialised ( c1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( c1 , c2 )
subgraph_all ( ) { com . asakusafw . utils . graph . Graph < java . lang . Integer > graph = com . asakusafw . utils . graph . Graphs . newInstance ( ) ; com . asakusafw . utils . graph . GraphsTest . addPath ( graph , 1 , 2 , 3 , 4 , 5 , 1 ) ; com . asakusafw . utils . graph . GraphsTest . addPath ( graph , 1 , 3 , 5 , 2 , 4 , 1 ) ; com . asakusafw . utils . graph . Graph < java . lang . Integer > sub = com . asakusafw . utils . graph . Graphs . subgraph ( graph , ( object ) -> true ) ; "<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 ( sub , is ( graph ) )
testGeenStandaardGroep ( ) { final nl . bzk . brp . model . bericht . kern . PersoonBericht persoonBericht = new nl . bzk . brp . model . bericht . kern . PersoonBericht ( ) ; persoonBericht . setReisdocumenten ( new java . util . ArrayList < nl . bzk . brp . model . bericht . kern . PersoonReisdocumentBericht > ( ) ) ; persoonBericht . getReisdocumenten ( ) . add ( new nl . bzk . brp . model . bericht . kern . PersoonReisdocumentBericht ( ) ) ; final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > berichtEntiteits = brby0045 . voerRegelUit ( null , persoonBericht , null , null ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( berichtEntiteits . isEmpty ( ) )
numberOfPages ( ) { try ( org . sejda . impl . sambox . component . PdfMixFragment victim = org . sejda . impl . sambox . component . PdfMixFragment . newInstance ( new org . sejda . model . input . PdfMixInput ( org . sejda . model . input . PdfStreamSource . newInstanceNoPassword ( getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "pdf/2_pages.pdf" ) , "test.pdf" ) ) ) ) { "<AssertPlaceHolder>" ; } } getNumberOfPages ( ) { return document . getNumberOfPages ( ) ; }
org . junit . Assert . assertEquals ( 2 , victim . getNumberOfPages ( ) )
testFilterByNoStamp ( ) { org . unitedinternet . cosmo . model . CollectionItem calendar1 = ( ( org . unitedinternet . cosmo . model . CollectionItem ) ( contentDao . findItemByUid ( org . unitedinternet . cosmo . dao . hibernate . HibernateItemDaoFilterTest . CALENDAR_UID_1 ) ) ) ; org . unitedinternet . cosmo . model . filter . ItemFilter filter = new org . unitedinternet . cosmo . model . filter . NoteItemFilter ( ) ; filter . setParent ( calendar1 ) ; org . unitedinternet . cosmo . model . filter . StampFilter missingStamp = new org . unitedinternet . cosmo . model . filter . StampFilter ( ) ; missingStamp . setStampClass ( org . unitedinternet . cosmo . model . EventStamp . class ) ; missingStamp . setMissing ( true ) ; filter . getStampFilters ( ) . add ( missingStamp ) ; java . util . Set < org . unitedinternet . cosmo . model . Item > results = contentDao . findItems ( filter ) ; "<AssertPlaceHolder>" ; verifyItemInSet ( results , org . unitedinternet . cosmo . dao . hibernate . HibernateItemDaoFilterTest . NOTE_UID ) ; } findItems ( org . unitedinternet . cosmo . model . filter . ItemFilter ) { return contentDao . findItems ( filter ) ; }
org . junit . Assert . assertEquals ( 2 , results . size ( ) )
removeTable ( ) { org . apache . poi . xslf . usermodel . XMLSlideShow ss = org . apache . poi . xslf . XSLFTestDataSamples . openSampleDocument ( "shapes.pptx" ) ; org . apache . poi . xslf . usermodel . XSLFSlide sl = ss . getSlides ( ) . get ( 0 ) ; org . apache . poi . xslf . usermodel . XSLFTable tab = ( ( org . apache . poi . xslf . usermodel . XSLFTable ) ( sl . getShapes ( ) . get ( 4 ) ) ) ; sl . removeShape ( tab ) ; org . apache . poi . xslf . usermodel . XMLSlideShow ss2 = org . apache . poi . xslf . XSLFTestDataSamples . writeOutAndReadBack ( ss ) ; ss . close ( ) ; sl = ss2 . getSlides ( ) . get ( 0 ) ; for ( org . apache . poi . xslf . usermodel . XSLFShape s : sl . getShapes ( ) ) { "<AssertPlaceHolder>" ; } ss2 . close ( ) ; } getShapes ( ) { java . util . List < org . apache . poi . hslf . usermodel . HSLFShape > shapeList = new java . util . ArrayList ( ) ; boolean isFirst = true ; for ( org . apache . poi . ddf . EscherRecord r : getSpContainer ( ) ) { if ( isFirst ) { isFirst = false ; continue ; } if ( r instanceof org . apache . poi . ddf . EscherContainerRecord ) { org . apache . poi . ddf . EscherContainerRecord container = ( ( org . apache . poi . ddf . EscherContainerRecord ) ( r ) ) ; org . apache . poi . hslf . usermodel . HSLFShape shape = org . apache . poi . hslf . usermodel . HSLFShapeFactory . createShape ( container , this ) ; shape . setSheet ( getSheet ( ) ) ; shapeList . add ( shape ) ; } else { org . apache . poi . hslf . usermodel . HSLFGroupShape . LOG . log ( POILogger . ERROR , ( "Shape<sp>contained<sp>non<sp>container<sp>escher<sp>record,<sp>was<sp>" + ( r . getClass ( ) . getName ( ) ) ) ) ; } } return shapeList ; }
org . junit . Assert . assertFalse ( ( s instanceof org . apache . poi . xslf . usermodel . XSLFTable ) )
testSmartDataThreshold4 ( ) { com . vmware . vrack . hms . boardservice . ib . api . HddInfoHelperTest . logger . info ( "Testing<sp>hms-inband<sp>HddInfoHelperTest::isSmartDataBeyondThreshold4" ) ; try { com . vmware . vrack . hms . common . servernodes . api . hdd . HddSMARTData hddSMARTData = new com . vmware . vrack . hms . common . servernodes . api . hdd . HddSMARTData ( ) ; hddSMARTData . setParameter ( "Raw<sp>Read<sp>Error<sp>Rate" ) ; hddSMARTData . setValue ( "N/A" ) ; hddSMARTData . setThreshold ( "N/A" ) ; hddSMARTData . setWorst ( "0" ) ; boolean isDataConcerning = com . vmware . vrack . hms . boardservice . ib . api . HddInfoHelper . isSmartDataBeyondThreshold ( hddSMARTData , false ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { com . vmware . vrack . hms . boardservice . ib . api . HddInfoHelperTest . logger . info ( "Test<sp>hms-inband<sp>HddInfoHelperTest::isSmartDataBeyondThreshold4<sp>Failed" ) ; e . printStackTrace ( ) ; } } isSmartDataBeyondThreshold ( com . vmware . vrack . hms . common . servernodes . api . hdd . HddSMARTData , boolean ) { boolean isDataConcerning = false ; if ( hddSMARTData != null ) { java . lang . String thresholdString = hddSMARTData . getThreshold ( ) ; java . lang . String valueString = hddSMARTData . getValue ( ) ; if ( valueString != null ) { if ( thresholdString != null ) { java . lang . Integer value = null ; java . lang . Integer threshold = null ; try { value = java . lang . Integer . parseInt ( valueString ) ; threshold = java . lang . Integer . parseInt ( thresholdString ) ; } catch ( java . lang . Exception e ) { return false ; } if ( isValueGreaterThanThresholdConcerning ) { if ( ( value >= threshold ) && ( threshold != 0 ) ) { isDataConcerning = true ; } } else { if ( ( value <= threshold ) && ( threshold != 0 ) ) { isDataConcerning = true ; } } } } } return isDataConcerning ; }
org . junit . Assert . assertFalse ( isDataConcerning )
should_not_find_address_by_zip_code_in_wrong_format ( ) { when ( restfulie . at ( "http://cep.republicavirtual.com.br/web_cep.php?cep=qdqwdqdqqdw&formato=xml" ) ) . thenReturn ( request ) ; br . com . caelum . vraptor . cep . DefaultAddress defaultObject = new br . com . caelum . vraptor . cep . DefaultAddress ( "" , "" , "" , "" , "" , 0 , "servio<sp>indisponvel/cep<sp>invlido" ) ; when ( response . getResource ( ) ) . thenReturn ( defaultObject ) ; java . lang . String [ ] resultAddress = new java . lang . String [ ] { "" , "" , "" , "" , "" } ; java . lang . String [ ] address = searcher . findAddressByZipCode ( "qdqwdqdqqdw" ) . asAddressArray ( ) ; "<AssertPlaceHolder>" ; } asAddressArray ( ) { return address . asAddressArray ( ) ; }
org . junit . Assert . assertArrayEquals ( resultAddress , address )
testAllDescriptorFilter ( ) { org . glassfish . hk2 . api . Descriptor predicate = org . glassfish . hk2 . utilities . BuilderHelper . link ( "empty" ) . build ( ) ; org . glassfish . hk2 . api . Filter allFilter = org . glassfish . hk2 . utilities . BuilderHelper . allFilter ( ) ; "<AssertPlaceHolder>" ; } matches ( org . glassfish . hk2 . api . Descriptor ) { if ( ! ( d . getLocatorId ( ) . equals ( localLocator . getLocatorId ( ) ) ) ) return false ; return true ; }
org . junit . Assert . assertTrue ( allFilter . matches ( predicate ) )
test_deserialize_string_object ( ) { java . lang . String input = "{\"name\":\"Aidan\",\"_id\":2,\"age\":22," + "\"spouse\":{\"name\":\"Nina\",\"_id\":6,\"age\":22}}" ; com . afollestad . ason . AsonSerializeTest . Person object = com . afollestad . ason . Ason . deserialize ( input , com . afollestad . ason . AsonSerializeTest . Person . class ) ; "<AssertPlaceHolder>" ; } deserialize ( java . lang . String , java . lang . Class ) { return com . afollestad . ason . Ason . deserialize ( json , cls , false ) ; }
org . junit . Assert . assertNotNull ( object )
joinDataSourceListBoList2Test ( ) { final java . lang . String id = "test_app" ; final long currentTime = java . lang . System . currentTimeMillis ( ) ; final java . util . List < com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo > joinDataSourceListBoList = new java . util . ArrayList < com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo > ( 0 ) ; final com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo joinDataSourceListBo = com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo . joinDataSourceListBoList ( joinDataSourceListBoList , currentTime ) ; "<AssertPlaceHolder>" ; } joinDataSourceListBoList ( com . navercorp . pinpoint . common . server . bo . stat . join . List , java . lang . Long ) { if ( joinDataSourceListBoList . isEmpty ( ) ) { return com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo . EMPTY_JOIN_DATA_SOURCE_LIST_BO ; } com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo newJoinDataSourceListBo = new com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo ( ) ; com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo initJoinDataSourceListBo = joinDataSourceListBoList . get ( 0 ) ; newJoinDataSourceListBo . setId ( initJoinDataSourceListBo . getId ( ) ) ; newJoinDataSourceListBo . setTimestamp ( timestamp ) ; newJoinDataSourceListBo . setJoinDataSourceBoList ( com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo . joinDatasourceBo ( joinDataSourceListBoList ) ) ; return newJoinDataSourceListBo ; }
org . junit . Assert . assertEquals ( joinDataSourceListBo , JoinDataSourceListBo . EMPTY_JOIN_DATA_SOURCE_LIST_BO )
testCallOverridenMethodFromObjC ( ) { org . robovm . objc . CustomClassTest . SubClass1 o = new org . robovm . objc . CustomClassTest . SubClass1 ( ) ; org . robovm . apple . foundation . NSString description = ( ( org . robovm . apple . foundation . NSString ) ( o . performSelector ( org . robovm . objc . Selector . register ( "description" ) ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return org . robovm . compiler . Symbols . trampolineFieldSymbol ( this , getCallingClass ( ) , getTarget ( ) , getFieldName ( ) , getFieldDesc ( ) , runtimeClass ) ; }
org . junit . Assert . assertEquals ( o . description ( ) , description . toString ( ) )
testGetDeploymentDmnXmlResourceData ( ) { org . camunda . bpm . engine . rest . Resource resource = org . camunda . bpm . engine . rest . helper . MockProvider . createMockDeploymentDmnXmlResource ( ) ; org . camunda . bpm . engine . rest . List < org . camunda . bpm . engine . rest . Resource > resources = new org . camunda . bpm . engine . rest . ArrayList < org . camunda . bpm . engine . rest . Resource > ( ) ; resources . add ( resource ) ; java . io . InputStream input = new java . io . ByteArrayInputStream ( createMockDeploymentResourceByteData ( ) ) ; when ( mockRepositoryService . getDeploymentResources ( eq ( org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_ID ) ) ) . thenReturn ( resources ) ; when ( mockRepositoryService . getResourceAsStreamById ( eq ( org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_ID ) , eq ( org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_DMN_XML_RESOURCE_ID ) ) ) . thenReturn ( input ) ; io . restassured . response . Response response = io . restassured . RestAssured . given ( ) . pathParam ( "id" , org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_ID ) . pathParam ( "resourceId" , org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_DMN_XML_RESOURCE_ID ) . then ( ) . expect ( ) . statusCode ( Status . OK . getStatusCode ( ) ) . contentType ( ContentType . XML ) . header ( "Content-Disposition" , ( "attachment;<sp>filename=" + ( org . camunda . bpm . engine . rest . helper . MockProvider . EXAMPLE_DEPLOYMENT_DMN_XML_RESOURCE_NAME ) ) ) . when ( ) . get ( org . camunda . bpm . engine . rest . DeploymentRestServiceInteractionTest . SINGLE_RESOURCE_DATA_URL ) ; java . lang . String responseContent = response . asString ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { org . camunda . bpm . engine . rest . hal . cache . HalResourceCacheEntry cacheEntry = cache . get ( id ) ; if ( cacheEntry != null ) { if ( expired ( cacheEntry ) ) { remove ( cacheEntry . getId ( ) ) ; return null ; } else { return cacheEntry . getResource ( ) ; } } else { return null ; } }
org . junit . Assert . assertNotNull ( responseContent )
forwardSchemaChangeWorks ( ) { org . apache . storm . hdfs . bolt . AvroGenericRecordBolt bolt = makeAvroBolt ( hdfsURI , 1 , 1000.0F , org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . schemaV1 ) ; bolt . prepare ( new org . apache . storm . Config ( ) , topologyContext , collector ) ; bolt . execute ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . tuple1 ) ; bolt . execute ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . tuple2 ) ; "<AssertPlaceHolder>" ; verifyAllAvroFiles ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . testRoot ) ; } countNonZeroLengthFiles ( java . lang . String ) { org . apache . hadoop . fs . Path p = new org . apache . hadoop . fs . Path ( path ) ; int nonZero = 0 ; for ( org . apache . hadoop . fs . FileStatus file : fs . listStatus ( p ) ) { if ( ( file . getLen ( ) ) > 0 ) { nonZero ++ ; } } return nonZero ; }
org . junit . Assert . assertEquals ( 2 , countNonZeroLengthFiles ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . testRoot ) )
testIsDownloadPopupRequiredHasTermsOfUseAndCc0License ( ) { edu . harvard . iq . dataverse . DatasetVersion dsv1 = new edu . harvard . iq . dataverse . DatasetVersion ( ) ; dsv1 . setVersionState ( DatasetVersion . VersionState . RELEASED ) ; edu . harvard . iq . dataverse . TermsOfUseAndAccess termsOfUseAndAccess = new edu . harvard . iq . dataverse . TermsOfUseAndAccess ( ) ; termsOfUseAndAccess . setLicense ( TermsOfUseAndAccess . License . CC0 ) ; termsOfUseAndAccess . setTermsOfUse ( "be<sp>excellent<sp>to<sp>each<sp>other" ) ; dsv1 . setTermsOfUseAndAccess ( termsOfUseAndAccess ) ; "<AssertPlaceHolder>" ; } isDownloadPopupRequired ( edu . harvard . iq . dataverse . DatasetVersion ) { if ( datasetVersion == null ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>datasetVersion<sp>is<sp>null." ) ; return false ; } if ( ! ( datasetVersion . isReleased ( ) ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>datasetVersion<sp>has<sp>not<sp>been<sp>released." ) ; return false ; } if ( ( datasetVersion . getTermsOfUseAndAccess ( ) ) != null ) { if ( ( ! ( TermsOfUseAndAccess . License . CC0 . equals ( datasetVersion . getTermsOfUseAndAccess ( ) . getLicense ( ) ) ) ) && ( ! ( ( ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfUse ( ) ) == null ) || ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfUse ( ) . equals ( "" ) ) ) ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>of<sp>license<sp>or<sp>terms<sp>of<sp>use." ) ; return true ; } if ( ( ! ( ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfAccess ( ) ) == null ) ) && ( ! ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfAccess ( ) . equals ( "" ) ) ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>of<sp>terms<sp>of<sp>access." ) ; return true ; } } if ( ( ( ( ( datasetVersion . getDataset ( ) ) != null ) && ( ( datasetVersion . getDataset ( ) . getGuestbook ( ) ) != null ) ) && ( datasetVersion . getDataset ( ) . getGuestbook ( ) . isEnabled ( ) ) ) && ( ( datasetVersion . getDataset ( ) . getGuestbook ( ) . getDataverse ( ) ) != null ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>of<sp>guestbook." ) ; return true ; } edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>is<sp>not<sp>required." ) ; return false ; }
org . junit . Assert . assertEquals ( false , edu . harvard . iq . dataverse . util . FileUtil . isDownloadPopupRequired ( dsv1 ) )
testCompareDynAnyNamedMember ( ) { java . lang . String msg ; org . jacorb . test . UnionDefaultType type ; org . omg . CORBA . Any any = null ; org . omg . DynamicAny . DynUnion dynAny = null ; org . omg . DynamicAny . DynUnion dynAny2 = null ; type = new org . jacorb . test . UnionDefaultType ( ) ; type . win ( 10 ) ; any = orb . create_any ( ) ; org . jacorb . test . UnionDefaultTypeHelper . insert ( any , type ) ; dynAny = createDynAnyFromAny ( any ) ; dynAny2 = createDynAnyFromAny ( any ) ; msg = "Comparing<sp>two<sp>equal<sp>DynAny<sp>values<sp>using<sp>DynAny::equal<sp>failed" ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
org . junit . Assert . assertTrue ( msg , dynAny . equal ( dynAny2 ) )
testDeleteClient ( ) { page . clickDeleteButton ( ) ; page . confirmDelete ( ) ; "<AssertPlaceHolder>" ; } checkDeleteSuccess ( ) { boolean deleted = false ; ca . corefacility . bioinformatics . irida . ria . integration . pages . clients . ClientDetailsPage . logger . debug ( "Checking<sp>for<sp>client<sp>existence" ) ; if ( driver . getCurrentUrl ( ) . contains ( ca . corefacility . bioinformatics . irida . ria . integration . pages . clients . ClientDetailsPage . RELATIVE_URL ) ) { ca . corefacility . bioinformatics . irida . ria . integration . pages . clients . ClientDetailsPage . logger . debug ( "Succesfully<sp>loaded<sp>client<sp>list<sp>page" ) ; waitForAjax ( ) ; ca . corefacility . bioinformatics . irida . ria . integration . pages . clients . ClientDetailsPage . logger . debug ( "Table<sp>loaded" ) ; java . util . List < org . openqa . selenium . WebElement > findElements = driver . findElements ( org . openqa . selenium . By . className ( "clientIdCol" ) ) ; deleted = true ; for ( org . openqa . selenium . WebElement ele : findElements ) { if ( ele . getText ( ) . equals ( clientId ) ) { deleted = false ; } } } return deleted ; }
org . junit . Assert . assertTrue ( page . checkDeleteSuccess ( ) )
testPortMapToList ( ) { com . google . common . collect . ImmutableSortedMap < java . lang . String , java . util . Map < ? , ? > > input = com . google . common . collect . ImmutableSortedMap . of ( "1000" , com . google . common . collect . ImmutableMap . of ( ) , "2000/tcp" , com . google . common . collect . ImmutableMap . of ( ) , "3000/udp" , com . google . common . collect . ImmutableMap . of ( ) ) ; com . google . common . collect . ImmutableSet < com . google . cloud . tools . jib . configuration . Port > expected = com . google . common . collect . ImmutableSet . of ( com . google . cloud . tools . jib . configuration . Port . tcp ( 1000 ) , com . google . cloud . tools . jib . configuration . Port . tcp ( 2000 ) , com . google . cloud . tools . jib . configuration . Port . udp ( 3000 ) ) ; "<AssertPlaceHolder>" ; com . google . common . collect . ImmutableList < java . util . Map < java . lang . String , java . util . Map < ? , ? > > > badInputs = com . google . common . collect . ImmutableList . of ( com . google . common . collect . ImmutableMap . of ( "abc" , com . google . common . collect . ImmutableMap . of ( ) ) , com . google . common . collect . ImmutableMap . of ( "1000-2000" , com . google . common . collect . ImmutableMap . of ( ) ) , com . google . common . collect . ImmutableMap . of ( "/udp" , com . google . common . collect . ImmutableMap . of ( ) ) , com . google . common . collect . ImmutableMap . of ( "123/xxx" , com . google . common . collect . ImmutableMap . of ( ) ) ) ; for ( java . util . Map < java . lang . String , java . util . Map < ? , ? > > badInput : badInputs ) { try { com . google . cloud . tools . jib . image . json . JsonToImageTranslator . portMapToSet ( badInput ) ; org . junit . Assert . fail ( ) ; } catch ( com . google . cloud . tools . jib . image . json . BadContainerConfigurationFormatException ignored ) { } } } portMapToSet ( java . util . Map ) { if ( portMap == null ) { return com . google . common . collect . ImmutableSet . of ( ) ; } com . google . common . collect . ImmutableSet . Builder < com . google . cloud . tools . jib . configuration . Port > ports = new com . google . common . collect . ImmutableSet . Builder < > ( ) ; for ( Map . Entry < java . lang . String , java . util . Map < ? , ? > > entry : portMap . entrySet ( ) ) { java . lang . String port = entry . getKey ( ) ; java . util . regex . Matcher matcher = com . google . cloud . tools . jib . image . json . JsonToImageTranslator . PORT_PATTERN . matcher ( port ) ; if ( ! ( matcher . matches ( ) ) ) { throw new com . google . cloud . tools . jib . image . json . BadContainerConfigurationFormatException ( ( ( "Invalid<sp>port<sp>configuration:<sp>'" + port ) + "'." ) ) ; } int portNumber = java . lang . Integer . parseInt ( matcher . group ( "portNum" ) ) ; java . lang . String protocol = matcher . group ( "protocol" ) ; ports . add ( com . google . cloud . tools . jib . configuration . Port . parseProtocol ( portNumber , protocol ) ) ; } return ports . build ( ) ; }
org . junit . Assert . assertEquals ( expected , com . google . cloud . tools . jib . image . json . JsonToImageTranslator . portMapToSet ( input ) )
testWriteNullBatchSuccess ( ) { com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducer pulsarMessageProducer = org . mockito . Mockito . mock ( com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducer . class ) ; org . mockito . Mockito . when ( pulsarMessageProducer . init ( org . mockito . Mockito . any ( ) ) ) . thenReturn ( java . util . Collections . emptyList ( ) ) ; com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducerFactory pulsarMessageProducerFactory = org . mockito . Mockito . mock ( com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducerFactory . class ) ; org . mockito . Mockito . when ( pulsarMessageProducerFactory . create ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . any ( ) ) ) . thenReturn ( pulsarMessageProducer ) ; com . streamsets . pipeline . stage . destination . pulsar . PulsarTarget pulsarTarget = new com . streamsets . pipeline . stage . destination . pulsar . PulsarTarget ( getTargetConfig ( ) , pulsarMessageProducerFactory ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = pulsarTarget . init ( ) ; "<AssertPlaceHolder>" ; try { pulsarTarget . write ( null ) ; } catch ( com . streamsets . pipeline . api . StageException e ) { org . junit . Assert . fail ( ) ; } } isEmpty ( ) { return false ; }
org . junit . Assert . assertTrue ( issues . isEmpty ( ) )
createNeedWithShapesModel ( ) { org . apache . jena . query . Dataset ds = won . protocol . message . Utils . createTestDataset ( "/needmodel/needwithshapes.trig" ) ; won . protocol . util . NeedModelWrapper needModelWrapper = new won . protocol . util . NeedModelWrapper ( ds , false ) ; "<AssertPlaceHolder>" ; } createTestDataset ( java . lang . String ) { java . io . InputStream is = won . protocol . message . Utils . class . getResourceAsStream ( resourceName ) ; org . apache . jena . query . Dataset dataset = org . apache . jena . query . DatasetFactory . createGeneral ( ) ; dataset . begin ( ReadWrite . WRITE ) ; org . apache . jena . riot . RDFDataMgr . read ( dataset , is , RDFFormat . TRIG . getLang ( ) ) ; is . close ( ) ; dataset . commit ( ) ; return dataset ; }
org . junit . Assert . assertNotNull ( needModelWrapper )
getTaggedCommit_shouldReturnTheIdOfTheTaggedCommit ( ) { writeSomethingToCache ( ) ; org . eclipse . jgit . lib . AnyObjectId commitId = commitToMaster ( ) ; com . beijunyi . parallelgit . utils . TagUtils . tagCommit ( "test_tag" , commitId , repo ) ; "<AssertPlaceHolder>" ; } getTaggedCommit ( java . lang . String , com . beijunyi . parallelgit . utils . Repository ) { com . beijunyi . parallelgit . utils . Ref tagRef = com . beijunyi . parallelgit . utils . RefUtils . getTagRef ( name , repo ) ; if ( tagRef == null ) throw new com . beijunyi . parallelgit . utils . exceptions . NoSuchTagException ( name ) ; com . beijunyi . parallelgit . utils . ObjectId ret = tagRef . getPeeledObjectId ( ) ; return ret != null ? ret : com . beijunyi . parallelgit . utils . CommitUtils . getCommit ( tagRef . getObjectId ( ) , repo ) ; }
org . junit . Assert . assertEquals ( commitId , com . beijunyi . parallelgit . utils . TagUtils . getTaggedCommit ( "test_tag" , repo ) )
deleteWithBody ( ) { final java . lang . String path = "/data" ; final java . lang . String body = "body" ; final org . sentilo . common . rest . RequestContext rc = new org . sentilo . common . rest . RequestContext ( path , body ) ; final java . lang . String responseContent = "Lorem<sp>ipsum" ; final org . apache . http . StatusLine statusLine = new org . apache . http . message . BasicStatusLine ( org . apache . http . HttpVersion . HTTP_1_0 , org . apache . http . HttpStatus . SC_OK , "" ) ; when ( httpClient . execute ( notNull ( org . apache . http . client . methods . HttpPut . class ) ) ) . thenReturn ( httpResponse ) ; when ( httpResponse . getStatusLine ( ) ) . thenReturn ( statusLine ) ; when ( httpResponse . getEntity ( ) ) . thenReturn ( new org . apache . http . entity . StringEntity ( responseContent ) ) ; final java . lang . String result = restClient . delete ( rc ) ; verify ( httpClient ) . execute ( any ( org . apache . http . client . methods . HttpPut . class ) ) ; "<AssertPlaceHolder>" ; } execute ( org . sentilo . platform . service . dao . JedisCallback ) { org . springframework . util . Assert . notNull ( action , "Callback<sp>object<sp>must<sp>not<sp>be<sp>null" ) ; redis . clients . jedis . Jedis conn = null ; boolean broken = false ; try { conn = jedisPoolUtils . getResource ( ) ; return action . doInRedis ( conn ) ; } catch ( final java . lang . Exception e ) { if ( e instanceof redis . clients . jedis . exceptions . JedisConnectionException ) { broken = true ; } throw jedisPoolUtils . convertJedisAccessException ( e ) ; } finally { jedisPoolUtils . releaseConnection ( conn , broken ) ; } }
org . junit . Assert . assertEquals ( responseContent , result )
testPerfecteRelatie ( ) { final nl . bzk . brp . model . bericht . kern . PersoonBericht berichtMoeder = maakMoeder ( ) ; final nl . bzk . brp . util . RelatieBuilder < nl . bzk . brp . model . bericht . kern . FamilierechtelijkeBetrekkingBericht > relBuilder = new nl . bzk . brp . util . RelatieBuilder < nl . bzk . brp . model . bericht . kern . FamilierechtelijkeBetrekkingBericht > ( ) ; final nl . bzk . brp . model . bericht . kern . FamilierechtelijkeBetrekkingBericht nieuweSituatie = relBuilder . bouwFamilieRechtelijkeBetrekkingRelatie ( ) . voegOuderToe ( berichtMoeder ) . voegOuderToe ( maakVader ( ) ) . voegKindToe ( maakKind ( ) ) . getRelatie ( ) ; zetOuderAlsIndicatieAdresHoudend ( nieuweSituatie , berichtMoeder ) ; final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > objectenDieDeRegelOvertreden = brpuc00112 . voerRegelUit ( null , nieuweSituatie , null , bestaandeBetrokkenen ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , objectenDieDeRegelOvertreden . size ( ) )
testGetNumBands ( ) { "<AssertPlaceHolder>" ; } getNumBands ( ) { return 0 ; }
org . junit . Assert . assertEquals ( 3 , metadata . getNumBands ( ) )
testContextInitializedServletContextEvent ( ) { org . mifos . reports . MifosViewerServletContextListener listener = new org . mifos . reports . MifosViewerServletContextListener ( ) ; java . io . File dir = listener . copyBIRTResourcesFromClassPathToFilesystemDirectory ( null ) ; java . util . Collection < java . io . File > files = org . apache . commons . io . FileUtils . listFiles ( dir , null , true ) ; "<AssertPlaceHolder>" ; } size ( ) { return fieldErrors . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( files . size ( ) ) > 5 ) )
applyTest ( ) { java . lang . String [ ] [ ] tests = new java . lang . String [ ] [ ] { new java . lang . String [ ] { "42" 1 , "42" 0 , "{<sp>\"x\"42" 2 } , new java . lang . String [ ] { "{{<sp>false<sp>|<sp>sort_natural<sp>}}" , "false" , "{<sp>\"x\"42" 2 } , new java . lang . String [ ] { "{{<sp>x<sp>|<sp>sort_natural<sp>}}" , "42" , "{<sp>\"x\":<sp>42<sp>}" } , new java . lang . String [ ] { "{{<sp>x<sp>|<sp>sort_natural<sp>}}" , "42" 0 , "{<sp>\"x\"42" 2 } , new java . lang . String [ ] { "{{<sp>x<sp>|<sp>sort_natural<sp>}}" , "99<sp>A00000.0001<sp>a01.1<sp>a04<sp>a1<sp>a10<sp>" , "{<sp>\"x\":<sp>[\"a1<sp>\",<sp>\"A00000.0001<sp>\",<sp>\"a01.1<sp>\",<sp>\"a10<sp>\",<sp>\"a04<sp>\",<sp>\"99<sp>\"]<sp>}" } , new java . lang . String [ ] { "{{<sp>x<sp>|<sp>sort_natural<sp>}}" , "42" 3 , "{<sp>\"x\":<sp>[\"b<sp>\",<sp>\"A<sp>\",<sp>\"Cccc<sp>\",<sp>\"cccccccc<sp>\",<sp>\"Ddd<sp>\",<sp>\"d<sp>\",<sp>\"01<sp>\",<sp>\"02<sp>\",<sp>\"10<sp>\",<sp>\"100<sp>\"]<sp>}" } } ; for ( java . lang . String [ ] test : tests ) { liqp . Template template = liqp . Template . parse ( test [ 0 ] ) ; java . lang . String rendered = java . lang . String . valueOf ( template . render ( test [ 2 ] ) ) ; "<AssertPlaceHolder>" ; } } render ( java . util . Map ) { if ( this . protectionSettings . isRenderTimeLimited ( ) ) { return render ( variables , liqp . Executors . newSingleThreadExecutor ( ) , true ) ; } else { if ( ( this . templateSize ) > ( this . protectionSettings . maxTemplateSizeBytes ) ) { throw new java . lang . RuntimeException ( ( ( "template<sp>exceeds<sp>" + ( this . protectionSettings . maxTemplateSizeBytes ) ) + "<sp>bytes" ) ) ; } return renderUnguarded ( variables ) ; } }
org . junit . Assert . assertThat ( rendered , org . hamcrest . CoreMatchers . is ( test [ 1 ] ) )
emptyNodeTypeList ( ) { org . apache . jackrabbit . oak . spi . state . NodeState node = org . apache . jackrabbit . oak . plugins . observation . filter . NodeTypePredicateTest . createNodeOfType ( org . apache . jackrabbit . JcrConstants . NT_BASE ) ; org . apache . jackrabbit . oak . plugins . nodetype . TypePredicate p = new org . apache . jackrabbit . oak . plugins . nodetype . TypePredicate ( node , new java . lang . String [ ] { } ) ; "<AssertPlaceHolder>" ; } apply ( org . apache . jackrabbit . oak . plugins . document . NodeDocument ) { return ( input . getSplitDocType ( ) ) == ( org . apache . jackrabbit . oak . plugins . document . NodeDocument . SplitDocType . INTERMEDIATE ) ; }
org . junit . Assert . assertFalse ( p . apply ( node ) )
REG_BINARY_getData ( ) { final byte [ ] data = new byte [ ] { ( ( byte ) ( 255 ) ) } ; final com . rapid7 . client . dcerpc . msrrp . dto . RegistryValue value = new com . rapid7 . client . dcerpc . msrrp . dto . RegistryValue ( "test" , com . rapid7 . client . dcerpc . msrrp . dto . RegistryValueType . REG_BINARY , data ) ; "<AssertPlaceHolder>" ; } getData ( ) { return data ; }
org . junit . Assert . assertArrayEquals ( data , value . getData ( ) )
testEmpty ( ) { setupOutputFile ( ) ; construct ( "" ) ; fmt . format ( ) ; java . lang . String [ ] string = outToStrings ( outBytes . toString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return name ; }
org . junit . Assert . assertEquals ( 1 , string . length )
testConnectionSslOptions ( ) { org . eclipse . kura . core . ssl . SslManagerServiceOptions serviceOptions = mock ( org . eclipse . kura . core . ssl . SslManagerServiceOptions . class ) ; org . eclipse . kura . core . ssl . ConnectionSslOptions sslOptions = new org . eclipse . kura . core . ssl . ConnectionSslOptions ( serviceOptions ) ; "<AssertPlaceHolder>" ; } getSslManagerOpts ( ) { return this . sslManagerOpts ; }
org . junit . Assert . assertEquals ( serviceOptions , sslOptions . getSslManagerOpts ( ) )
testSerialization ( ) { org . jfree . chart . renderer . xy . XYAreaRenderer2 r1 = new org . jfree . chart . renderer . xy . XYAreaRenderer2 ( ) ; org . jfree . chart . renderer . xy . XYAreaRenderer2 r2 = ( ( org . jfree . chart . renderer . xy . XYAreaRenderer2 ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( r1 , r2 )
testFulltextOnProxy ( ) { org . nuxeo . ecm . core . api . DocumentModel doc = createFileWithBlob ( ) ; createSectionAndPublishFile ( doc ) ; java . lang . String nxql = "SELECT<sp>*<sp>FROM<sp>Document<sp>WHERE<sp>ecm:fulltext='search'<sp>AND<sp>ecm:isProxy<sp>=<sp>1" ; org . nuxeo . ecm . core . api . DocumentModelList esRet = ess . query ( new org . nuxeo . elasticsearch . query . NxQueryBuilder ( session ) . nxql ( nxql ) ) ; "<AssertPlaceHolder>" ; exception . expect ( org . nuxeo . ecm . core . query . QueryParseException . class ) ; org . nuxeo . ecm . core . api . DocumentModelList coreRet = session . query ( nxql ) ; } totalSize ( ) { return response . getHits ( ) . getTotalHits ( ) ; }
org . junit . Assert . assertEquals ( 0 , esRet . totalSize ( ) )
testCreateTemporaryTopicNotAuthorized ( ) { connection = JMSClientContext . INSTANCE . createConnection ( amqpURI , "user" , "userPassword" ) ; javax . jms . Session session = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; try { session . createTemporaryTopic ( ) ; } catch ( javax . jms . JMSSecurityException jmsse ) { } catch ( javax . jms . JMSException jmse ) { org . apache . activemq . transport . amqp . JMSClientSimpleAuthTest . LOG . info ( "Client<sp>should<sp>have<sp>thrown<sp>a<sp>JMSSecurityException<sp>but<sp>only<sp>threw<sp>JMSException" ) ; } "<AssertPlaceHolder>" ; } createSession ( java . lang . String , int ) { connection = createConnection ( ) ; connection . setClientID ( clientID ) ; connection . start ( ) ; session = connection . createSession ( false , ackMode ) ; destination = createDestination ( ) ; }
org . junit . Assert . assertNotNull ( connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) )
testSetJobIdManually ( ) { final org . apache . flink . api . common . JobID jobId = new org . apache . flink . api . common . JobID ( ) ; final java . lang . String [ ] args = new java . lang . String [ ] { "--configDir" , "/foo/bar" , "--job-classname" , "foobar" , "--job-id" , jobId . toString ( ) } ; final org . apache . flink . container . entrypoint . StandaloneJobClusterConfiguration standaloneJobClusterConfiguration = org . apache . flink . container . entrypoint . StandaloneJobClusterConfigurationParserFactoryTest . commandLineParser . parse ( args ) ; "<AssertPlaceHolder>" ; } getJobId ( ) { return jobId ; }
org . junit . Assert . assertThat ( standaloneJobClusterConfiguration . getJobId ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( jobId ) ) )
extendReference ( ) { com . linkedpipes . etl . executor . api . v1 . rdf . pojo . FieldLoaderTest . TestClass instance = new com . linkedpipes . etl . executor . api . v1 . rdf . pojo . FieldLoaderTest . TestClass ( ) ; java . lang . reflect . Field field = com . linkedpipes . etl . executor . api . v1 . rdf . pojo . FieldLoaderTest . TestClass . class . getDeclaredField ( "reference" ) ; com . linkedpipes . etl . executor . api . v1 . rdf . model . RdfValue value = org . mockito . Mockito . mock ( com . linkedpipes . etl . executor . api . v1 . rdf . model . RdfValue . class ) ; org . mockito . Mockito . when ( value . asString ( ) ) . thenReturn ( "http://localhost" ) ; com . linkedpipes . etl . executor . api . v1 . rdf . pojo . FieldLoader loader = new com . linkedpipes . etl . executor . api . v1 . rdf . pojo . FieldLoader ( ) ; java . lang . Object firstReference = loader . set ( instance , field , value , true ) ; java . lang . Object secondReference = loader . set ( instance , field , value , true ) ; "<AssertPlaceHolder>" ; } set ( java . lang . Object , java . lang . reflect . Field , com . linkedpipes . etl . rdf . utils . model . BackendRdfValue , boolean ) { java . lang . Class < ? > fieldType = field . getType ( ) ; if ( java . util . Collection . class . isAssignableFrom ( fieldType ) ) { return com . linkedpipes . etl . rdf . utils . pojo . FieldLoader . setCollection ( target , field , value , extendExisting ) ; } else if ( com . linkedpipes . etl . rdf . utils . pojo . FieldLoader . isPrimitive ( fieldType ) ) { com . linkedpipes . etl . rdf . utils . pojo . FieldUtils . setValue ( target , field , com . linkedpipes . etl . rdf . utils . pojo . FieldLoader . valueToPrimitive ( fieldType , value ) ) ; } else if ( fieldType . isEnum ( ) ) { com . linkedpipes . etl . rdf . utils . pojo . FieldUtils . setValue ( target , field , com . linkedpipes . etl . rdf . utils . pojo . FieldLoader . valueToEnum ( fieldType , value ) ) ; } else if ( fieldType . isArray ( ) ) { throw new com . linkedpipes . etl . rdf . utils . pojo . LoaderException ( "Arrays<sp>are<sp>not<sp>supported." ) ; } else { if ( com . linkedpipes . etl . rdf . utils . pojo . LangString . class . isAssignableFrom ( fieldType ) ) { com . linkedpipes . etl . rdf . utils . pojo . FieldUtils . setValue ( target , field , com . linkedpipes . etl . rdf . utils . pojo . FieldLoader . valueToStringLang ( fieldType , value ) ) ; return null ; } if ( extendExisting ) { final java . lang . Object currentObject = com . linkedpipes . etl . rdf . utils . pojo . FieldUtils . getValue ( target , field ) ; if ( currentObject != null ) { return currentObject ; } } java . lang . Object newObject = com . linkedpipes . etl . rdf . utils . pojo . FieldLoader . createInstance ( fieldType ) ; com . linkedpipes . etl . rdf . utils . pojo . FieldUtils . setValue ( target , field , newObject ) ; return newObject ; } return null ; }
org . junit . Assert . assertEquals ( firstReference , secondReference )
assertDecode ( ) { when ( byteBuf . markReaderIndex ( ) ) . thenReturn ( byteBuf ) ; when ( byteBuf . readMediumLE ( ) ) . thenReturn ( 50 ) ; when ( byteBuf . readRetainedSlice ( 51 ) ) . thenReturn ( byteBuf ) ; java . util . List < java . lang . Object > out = new java . util . LinkedList ( ) ; new org . apache . shardingsphere . shardingproxy . transport . mysql . codec . MySQLPacketCodecEngine ( ) . decode ( context , byteBuf , out , 54 ) ; "<AssertPlaceHolder>" ; } decode ( io . netty . channel . ChannelHandlerContext , io . netty . buffer . ByteBuf , java . util . List , int ) { int messageTypeLength = 0 ; if ( '
org . junit . Assert . assertThat ( out . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
executeWithStringForFail ( ) { setupValuesWithString ( ) ; when ( currentStep . getAllData ( eq ( "context" ) ) ) . then ( ( invocation ) -> { LinkedList < IData < ai . labs . models . Context > > ret = new ai . labs . behavior . impl . conditions . LinkedList < > ( ) ; ret . add ( new ai . labs . behavior . impl . conditions . MockData < > ( "context:someContextKey" , new ai . labs . models . Context ( Context . ContextType . string , "someStringOtherString" ) ) ) ; return ret ; } ) ; ai . labs . behavior . impl . conditions . IBehaviorCondition . ExecutionState actualExecutionState = contextMatcher . execute ( conversationMemory , new ai . labs . behavior . impl . conditions . LinkedList ( ) ) ; "<AssertPlaceHolder>" ; } execute ( ai . labs . memory . IConversationMemory , java . util . List ) { if ( trace . contains ( this ) ) { throw throwInfiniteLoopError ( trace ) ; } else { trace . add ( this ) ; ai . labs . behavior . impl . conditions . IBehaviorCondition . ExecutionState state = IBehaviorCondition . ExecutionState . NOT_EXECUTED ; for ( ai . labs . behavior . impl . conditions . IBehaviorCondition condition : conditions ) { condition . execute ( memory , trace ) ; if ( ( condition . getExecutionState ( ) ) == ( IBehaviorCondition . ExecutionState . FAIL ) ) { state = IBehaviorCondition . ExecutionState . FAIL ; break ; } else if ( ( condition . getExecutionState ( ) ) == ( IBehaviorCondition . ExecutionState . ERROR ) ) { state = IBehaviorCondition . ExecutionState . ERROR ; break ; } } java . util . List < ai . labs . behavior . impl . BehaviorRule > tmp = new java . util . LinkedList ( trace ) ; trace . clear ( ) ; trace . addAll ( tmp . subList ( 0 , tmp . indexOf ( this ) ) ) ; if ( state != ( IBehaviorCondition . ExecutionState . NOT_EXECUTED ) ) return state ; return IBehaviorCondition . ExecutionState . SUCCESS ; } }
org . junit . Assert . assertEquals ( IBehaviorCondition . ExecutionState . FAIL , actualExecutionState )
testGetHistorySync ( ) { try { java . lang . String jsonString = com . simplegeo . client . SimpleGeoStorageClientTest . client . getHistory ( "casey.testing.layer" , "simplegeo-boulder" , null ) ; com . simplegeo . client . types . GeometryCollection geoColl = com . simplegeo . client . types . GeometryCollection . fromJSONString ( jsonString ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } catch ( org . json . JSONException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } getGeometries ( ) { return geometries ; }
org . junit . Assert . assertNotNull ( geoColl . getGeometries ( ) )
testTokens_ignoreFieldsSyntax___fieldsFirst ( ) { java . util . List < org . apache . ambari . server . api . predicate . Token > listTokens = new java . util . ArrayList ( ) ; listTokens . add ( new org . apache . ambari . server . api . predicate . Token ( Token . TYPE . RELATIONAL_OPERATOR , "=" ) ) ; listTokens . add ( new org . apache . ambari . server . api . predicate . Token ( Token . TYPE . PROPERTY_OPERAND , "foo" ) ) ; listTokens . add ( new org . apache . ambari . server . api . predicate . Token ( Token . TYPE . VALUE_OPERAND , "1" ) ) ; org . apache . ambari . server . api . predicate . QueryLexer lexer = new org . apache . ambari . server . api . predicate . QueryLexer ( ) ; org . apache . ambari . server . api . predicate . Token [ ] tokens = lexer . tokens ( "fields=foo,bar&foo=1" ) ; "<AssertPlaceHolder>" ; } size ( ) { java . util . Set < java . lang . String > nodes = new java . util . HashSet < java . lang . String > ( ) ; for ( org . apache . ambari . eventdb . model . WorkflowDag . WorkflowDagEntry entry : entries ) { nodes . add ( entry . getSource ( ) ) ; nodes . addAll ( entry . getTargets ( ) ) ; } return nodes . size ( ) ; }
org . junit . Assert . assertArrayEquals ( listTokens . toArray ( new org . apache . ambari . server . api . predicate . Token [ listTokens . size ( ) ] ) , tokens )
testDataTypesRecursive ( ) { java . lang . String name = "data_types-recursive" ; java . lang . String namespace = "http://www.example.com/DataTypesRecursive" ; org . eclipse . winery . model . tosca . yaml . TServiceTemplate serviceTemplate = readServiceTemplate ( name , namespace ) ; org . eclipse . winery . model . tosca . Definitions definitions = convert ( serviceTemplate , name , namespace ) ; writeXml ( definitions , name , namespace ) ; "<AssertPlaceHolder>" ; } writeXml ( org . eclipse . winery . model . tosca . Definitions , java . lang . String , java . lang . String ) { org . eclipse . winery . yaml . common . writer . WriterUtils . saveDefinitions ( definitions , this . outPath , namespace , name ) ; }
org . junit . Assert . assertNotNull ( definitions )
testParseApplicationIdentifier ( ) { java . lang . String tobeParsed = "int.name.version" ; com . t1t . apim . beans . apps . AppIdentifier appExpectedId = new com . t1t . apim . beans . apps . AppIdentifier ( ) ; appExpectedId . setPrefix ( "int" ) ; appExpectedId . setAppId ( "name" ) ; appExpectedId . setVersion ( "version" ) ; java . util . List < java . lang . String > availableScopes = new java . util . ArrayList ( ) ; availableScopes . add ( "int" ) ; com . t1t . apim . beans . apps . AppIdentifier appIdentifier = com . t1t . util . ConsumerConventionUtil . parseApplicationIdentifier ( tobeParsed ) ; "<AssertPlaceHolder>" ; } parseApplicationIdentifier ( java . lang . String ) { if ( org . apache . commons . lang3 . StringUtils . isEmpty ( appId ) ) return null ; com . t1t . apim . beans . apps . AppIdentifier appIdBean = new com . t1t . apim . beans . apps . AppIdentifier ( ) ; java . lang . String [ ] splitResult = appId . split ( "\\." ) ; if ( ( splitResult . length ) == 3 ) { appIdBean . setPrefix ( splitResult [ 0 ] ) ; appIdBean . setAppId ( splitResult [ 1 ] ) ; appIdBean . setVersion ( splitResult [ 2 ] ) ; } else if ( ( splitResult . length ) == 2 ) { appIdBean . setPrefix ( splitResult [ 0 ] ) ; appIdBean . setAppId ( splitResult [ 1 ] ) ; } else { return null ; } return appIdBean ; }
org . junit . Assert . assertEquals ( appExpectedId , appIdentifier )
testReplaceCompoundProperties ( ) { java . util . Properties custom = new java . util . Properties ( ) ; custom . setProperty ( "foo" , "bar" ) ; custom . setProperty ( "emotion" , "loves" ) ; final java . lang . String original = "${user.name}<sp>has<sp>a<sp>${foo},<sp>and<sp>he<sp>${emotion:hates}<sp>it,<sp>unlike<sp>his<sp>${sibling:sister}." ; final java . lang . String expected = ( java . lang . System . getProperty ( "user.name" ) ) + "<sp>has<sp>a<sp>bar,<sp>and<sp>he<sp>loves<sp>it,<sp>unlike<sp>his<sp>sister." ; final java . lang . String actual = org . switchyard . common . lang . Strings . replaceProperties ( original , SystemPropertyResolver . INSTANCE , new org . switchyard . common . property . PropertiesPropertyResolver ( custom ) ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return getProperty ( name , Scope . EXCHANGE ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetFooter ( ) { javax . faces . component . UIOutput component = new javax . faces . component . UIOutput ( ) ; table . getFacets ( ) . put ( "footer" , component ) ; "<AssertPlaceHolder>" ; } getFooter ( ) { return org . jboss . arquillian . graphene . Graphene . createPageFragment ( footerClass , advanced ( ) . getWholeTableFooterElement ( ) ) ; }
org . junit . Assert . assertSame ( component , table . getFooter ( ) )
testInputSize2FilterSize1FilterAll ( ) { final java . io . StringReader input = new java . io . StringReader ( "aa" ) ; try ( org . apache . commons . io . input . CharacterFilterReader reader = new org . apache . commons . io . input . CharacterFilterReader ( input , 'a' ) ) { "<AssertPlaceHolder>" ; } } read ( ) { if ( ( currentNumberOfBytes ) <= 0 ) { throw new java . lang . IllegalStateException ( "No<sp>bytes<sp>available." ) ; } final byte b = buffer [ startOffset ] ; -- ( currentNumberOfBytes ) ; if ( ( ++ ( startOffset ) ) == ( buffer . length ) ) { startOffset = 0 ; } return b ; }
org . junit . Assert . assertEquals ( ( - 1 ) , reader . read ( ) )
testAsyncReceiveWithExpirationChecks ( ) { org . apache . activemq . ActiveMQConnectionFactory factory = new org . apache . activemq . ActiveMQConnectionFactory ( brokerURI ) ; final java . util . concurrent . CountDownLatch received = new java . util . concurrent . CountDownLatch ( 1 ) ; javax . jms . Connection connection = factory . createConnection ( ) ; javax . jms . Session session = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; javax . jms . Destination destination = session . createQueue ( name . getMethodName ( ) ) ; javax . jms . MessageConsumer consumer = session . createConsumer ( destination ) ; consumer . setMessageListener ( new javax . jms . MessageListener ( ) { @ org . apache . activemq . Override public void onMessage ( javax . jms . Message message ) { received . countDown ( ) ; } } ) ; javax . jms . MessageProducer producer = session . createProducer ( destination ) ; producer . setTimeToLive ( TimeUnit . SECONDS . toMillis ( 2 ) ) ; producer . send ( session . createTextMessage ( "test" ) ) ; TimeUnit . SECONDS . sleep ( 4 ) ; connection . start ( ) ; "<AssertPlaceHolder>" ; connection . close ( ) ; } await ( int , java . util . concurrent . TimeUnit ) { ActiveMQServerLogger . LOGGER . waitingForQuorumVoteResults ( latchTimeout , unit . toString ( ) . toLowerCase ( ) ) ; if ( latch . await ( latchTimeout , unit ) ) ActiveMQServerLogger . LOGGER . receivedAllQuorumVotes ( ) ; else ActiveMQServerLogger . LOGGER . timeoutWaitingForQuorumVoteResponses ( ) ; }
org . junit . Assert . assertFalse ( received . await ( 1 , TimeUnit . SECONDS ) )
testGetImageDataWhenDisposed ( ) { org . eclipse . swt . graphics . Image image = createImage ( device , Fixture . IMAGE1 ) ; image . dispose ( ) ; try { image . getImageData ( ) ; org . junit . Assert . fail ( ) ; } catch ( org . eclipse . swt . SWTException e ) { "<AssertPlaceHolder>" ; } } getImageData ( ) { if ( isDisposed ( ) ) { org . eclipse . swt . SWT . error ( SWT . ERROR_GRAPHIC_DISPOSED ) ; } org . eclipse . swt . graphics . ImageData result ; if ( ( device ) != null ) { org . eclipse . rap . rwt . internal . application . ApplicationContextImpl applicationContext = getApplicationContext ( ) ; result = applicationContext . getImageDataFactory ( ) . findImageData ( internalImage ) ; } else { result = internalImage . getImageData ( ) ; } return result ; }
org . junit . Assert . assertEquals ( SWT . ERROR_GRAPHIC_DISPOSED , e . code )
getEObject ( ) { org . eclipse . emf . ecore . resource . ResourceSet other = getPapyrusRepository ( ) . createTransaction ( new org . eclipse . emf . ecore . resource . impl . ResourceSetImpl ( ) ) ; org . eclipse . emf . ecore . resource . Resource resource = getTransaction ( other ) . getOrCreateResource ( getResourcePath ( "other.uml" ) ) ; org . eclipse . uml2 . uml . Model model = UMLFactory . eINSTANCE . createModel ( ) ; model . setName ( "test" ) ; resource . getContents ( ) . add ( model ) ; getPapyrusRepository ( ) . commit ( other ) ; org . eclipse . emf . common . util . URI uri = org . eclipse . emf . ecore . util . EcoreUtil . getURI ( model ) ; getPapyrusRepository ( ) . close ( other ) ; org . eclipse . emf . ecore . EObject retrieved = fixture . getEObject ( uri , true ) ; model = cast ( retrieved , org . eclipse . uml2 . uml . Model . class ) ; "<AssertPlaceHolder>" ; } getName ( ) { return constraint . getName ( ) ; }
org . junit . Assert . assertThat ( model . getName ( ) , org . hamcrest . CoreMatchers . equalTo ( "test" ) )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . knowledge . base . model . KBArticle > kbArticles = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( kbArticles . isEmpty ( ) )
startsWith_A$Seq_true ( ) { com . m3 . scalaflavor4j . Seq < java . lang . Integer > seq = com . m3 . scalaflavor4j . Seq . apply ( 1 , 2 , 3 ) ; com . m3 . scalaflavor4j . Seq < java . lang . Integer > that = com . m3 . scalaflavor4j . Seq . apply ( 1 , 2 ) ; boolean actual = seq . startsWith ( that ) ; boolean expected = true ; "<AssertPlaceHolder>" ; } startsWith ( com . m3 . scalaflavor4j . Seq ) { return false ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . security . wedeploy . auth . model . WeDeployAuthApp > weDeployAuthApps = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( weDeployAuthApps . isEmpty ( ) )
shouldMarkTransitionFromNonSuperadminToSuperadminAsValidWhenPerformedByShop ( ) { stubRoleTransition ( "99anyOtherRole" , com . qcadoo . security . internal . validators . ROLE_SUPERADMIN ) ; final boolean isValid = userRoleValidationService . checkUserCreatingSuperadmin ( userDataDefMock , userEntityMock ) ; "<AssertPlaceHolder>" ; } checkUserCreatingSuperadmin ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { java . lang . Boolean isRoleSuperadminInNewGroup = securityService . hasRole ( entity , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; java . lang . Boolean isRoleSuperadminInOldGroup = ( ( entity . getId ( ) ) == null ) ? false : securityService . hasRole ( dataDefinition . get ( entity . getId ( ) ) , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; if ( ( com . google . common . base . Objects . equal ( isRoleSuperadminInOldGroup , isRoleSuperadminInNewGroup ) ) || ( isCurrentUserShopOrSuperAdmin ( dataDefinition ) ) ) { return true ; } entity . addError ( dataDefinition . getField ( UserFields . GROUP ) , "qcadooUsers.validate.global.error.forbiddenRole" ) ; return false ; }
org . junit . Assert . assertTrue ( isValid )
testSerialization ( ) { org . jfree . data . ComparableObjectSeriesTest . MyComparableObjectSeries s1 = new org . jfree . data . ComparableObjectSeriesTest . MyComparableObjectSeries ( "A" ) ; s1 . add ( new java . lang . Integer ( 1 ) , "ABC" ) ; org . jfree . data . ComparableObjectSeriesTest . MyComparableObjectSeries s2 = ( ( org . jfree . data . ComparableObjectSeriesTest . MyComparableObjectSeries ) ( org . jfree . chart . TestUtilities . serialised ( s1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( s1 , s2 )
mapping ( ) { org . pentaho . di . trans . steps . csvinput . NamedFieldsMapping mapping = org . pentaho . di . trans . steps . csvinput . NamedFieldsMapping . mapping ( new java . lang . String [ ] { "FIRST" , "SECOND" , "THIRD" } , new java . lang . String [ ] { "SECOND" , "THIRD" } ) ; "<AssertPlaceHolder>" ; } fieldMetaIndex ( int ) { if ( ( index >= ( size ( ) ) ) || ( index < 0 ) ) { return FIELD_DOES_NOT_EXIST ; } return actualToMetaFieldMapping [ index ] ; }
org . junit . Assert . assertEquals ( 0 , mapping . fieldMetaIndex ( 1 ) )
testGetAccountCount_threeAccounts ( ) { when ( loginService . getAccounts ( ) ) . thenReturn ( new java . util . HashSet ( java . util . Arrays . asList ( account1 , account2 , account3 ) ) ) ; com . google . cloud . tools . eclipse . login . ui . AccountSelector selector = new com . google . cloud . tools . eclipse . login . ui . AccountSelector ( shell , loginService ) ; "<AssertPlaceHolder>" ; } getAccountCount ( ) { return ( combo . getItemCount ( ) ) - 1 ; }
org . junit . Assert . assertEquals ( 3 , selector . getAccountCount ( ) )
getChildrenInstanceIdsOfUnknownProcessInstance ( ) { final org . bonitasoft . engine . bpm . process . DesignProcessDefinition designProcessDefinition = org . bonitasoft . engine . test . BuildTestUtil . buildProcessDefinitionWithHumanAndAutomaticSteps ( java . util . Arrays . asList ( "step1" , "step2" ) , java . util . Arrays . asList ( true , true ) ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition processDefinition = deployAndEnableProcessWithActor ( designProcessDefinition , org . bonitasoft . engine . process . instance . ACTOR_NAME , user ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance = getProcessAPI ( ) . startProcess ( processDefinition . getId ( ) ) ; final java . util . List < java . lang . Long > childrenInstanceIds = getProcessAPI ( ) . getChildrenInstanceIdsOfProcessInstance ( ( ( processInstance . getId ( ) ) + 1 ) , 0 , 10 , ProcessInstanceCriterion . DEFAULT ) ; "<AssertPlaceHolder>" ; disableAndDeleteProcess ( processDefinition ) ; } getId ( ) { return id ; }
org . junit . Assert . assertTrue ( childrenInstanceIds . isEmpty ( ) )
testInheritedSuppression ( ) { net . sourceforge . pmd . Report rpt = new net . sourceforge . pmd . Report ( ) ; runTestFromString ( net . sourceforge . pmd . lang . java . SuppressWarningsTest . TEST3 , new net . sourceforge . pmd . FooRule ( ) , rpt , net . sourceforge . pmd . lang . LanguageRegistry . getLanguage ( JavaLanguageModule . NAME ) . getVersion ( "1.5" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return rules . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , rpt . size ( ) )
test_getManifest_null ( ) { java . util . jar . Manifest manifest = org . talend . commons . utils . resource . BundleFileUtil . getManifest ( null ) ; "<AssertPlaceHolder>" ; } getManifest ( java . io . File ) { if ( ( ( ( f == null ) || ( ! ( f . exists ( ) ) ) ) || ( ! ( f . isFile ( ) ) ) ) || ( ! ( f . getName ( ) . endsWith ( FileExtensions . JAR_FILE_SUFFIX ) ) ) ) { return null ; } java . util . jar . JarFile jarFile = null ; try { jarFile = new java . util . jar . JarFile ( f ) ; return jarFile . getManifest ( ) ; } finally { if ( jarFile != null ) { try { jarFile . close ( ) ; } catch ( java . io . IOException e ) { } } } }
org . junit . Assert . assertNull ( manifest )
testGetDefinitions_1 ( ) { org . eclipse . tracecompass . ctf . core . event . types . IDefinition result = fixture . getDefinition ( "_id" ) ; "<AssertPlaceHolder>" ; } getDefinition ( int ) { org . eclipse . tracecompass . tmf . core . parsers . custom . CustomTxtTraceDefinition [ ] definitions = org . eclipse . tracecompass . tmf . core . parsers . custom . CustomTxtTraceDefinition . loadAll ( new java . io . File ( org . eclipse . tracecompass . tmf . core . tests . parsers . custom . CustomTxtTraceDataTest . DEFINITION_PATH ) . toString ( ) ) ; return definitions [ index ] ; }
org . junit . Assert . assertNotNull ( result )
testCompareToSmallerWipVersion ( ) { org . eclipse . winery . common . version . WineryVersion smaller = new org . eclipse . winery . common . version . WineryVersion ( "1.0.0" , 1 , 1 ) ; org . eclipse . winery . common . version . WineryVersion greater = new org . eclipse . winery . common . version . WineryVersion ( "1.0.0" , 1 , 5 ) ; "<AssertPlaceHolder>" ; } compareTo ( java . lang . Object ) { if ( o instanceof org . eclipse . winery . accountability . model . BlockchainElement ) { return java . lang . Long . compare ( this . unixTimestamp , ( ( org . eclipse . winery . accountability . model . BlockchainElement ) ( o ) ) . unixTimestamp ) ; } else { throw new java . lang . IllegalArgumentException ( ) ; } }
org . junit . Assert . assertEquals ( 1 , greater . compareTo ( smaller ) )
matchXPathStartsWith ( ) { java . lang . String xmlString = "<xml><doc><id>US123456789</id></doc></xml>" ; gov . uspto . bulkdata . find . PatternXPath pattern = new gov . uspto . bulkdata . find . PatternXPath ( "//doc/id[starts-with(.,'US1234')]" ) ; gov . uspto . bulkdata . find . PatternMatcher matcher = new gov . uspto . bulkdata . find . PatternMatcher ( ) ; matcher . add ( pattern ) ; "<AssertPlaceHolder>" ; } match ( java . lang . String ) { if ( xmlDocStr == null ) { return false ; } javax . xml . parsers . DocumentBuilderFactory dbfact = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) ; dbfact . setAttribute ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ; try { javax . xml . parsers . DocumentBuilder builder = dbfact . newDocumentBuilder ( ) ; org . xml . sax . InputSource inputSource = new org . xml . sax . InputSource ( new java . io . StringReader ( xmlDocStr ) ) ; org . w3c . dom . Document document = builder . parse ( inputSource ) ; javax . xml . xpath . XPathFactory fact = javax . xml . xpath . XPathFactory . newInstance ( ) ; javax . xml . xpath . XPath xpath = fact . newXPath ( ) ; java . lang . String value = ( ( java . lang . String ) ( xpath . evaluate ( xPathExpression , document , XPathConstants . STRING ) ) ) ; java . util . regex . Matcher matcher = regexPattern . matcher ( value ) ; if ( matcher . matches ( ) ) { return true ; } } catch ( javax . xml . xpath . XPathExpressionException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>XPathExpressionException<sp>on<sp>doc:{}" , xmlDocStr , e ) ; return false ; } catch ( javax . xml . parsers . ParserConfigurationException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>ParserConfigurationException" , e ) ; return false ; } catch ( org . xml . sax . SAXException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>SAXException<sp>on<sp>doc:{}" , xmlDocStr , e ) ; return false ; } catch ( java . io . IOException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "IOException" , e ) ; return false ; } return false ; }
org . junit . Assert . assertTrue ( matcher . match ( xmlString ) )
testPut_SplitEdge ( ) { com . googlecode . concurrenttrees . radix . ConcurrentRadixTree < java . lang . Integer > tree = new com . googlecode . concurrenttrees . radix . ConcurrentRadixTree < java . lang . Integer > ( getNodeFactory ( ) ) ; tree . put ( "FOOBAR" , 1 ) ; tree . put ( "FOO" , 2 ) ; java . lang . String expected = "○\n" + ( "└──<sp>○<sp>FOO<sp>(2)\n" + "<sp>└──<sp>○<sp>BAR<sp>(1)\n" ) ; java . lang . String actual = com . googlecode . concurrenttrees . common . PrettyPrinter . prettyPrint ( tree ) ; "<AssertPlaceHolder>" ; } prettyPrint ( com . googlecode . concurrenttrees . radix . node . util . PrettyPrintable ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; com . googlecode . concurrenttrees . common . PrettyPrinter . prettyPrint ( tree . getNode ( ) , sb , "" , true , true ) ; return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
test ( ) { name . dlazerka . gm . util . ListMap < java . lang . String , java . lang . Object > map = new name . dlazerka . gm . util . ListMap < java . lang . String , java . lang . Object > ( ) ; java . lang . String key = "asdfasdf" ; map . put ( key , "fgh" ) ; map . put ( key , "h" ) ; "<AssertPlaceHolder>" ; } put ( K , V ) { V result ; name . dlazerka . gm . util . ListMap < K , V > . Entry < K , V > entry = new Entry < K , V > ( key , value ) ; int index = entrySet . indexOf ( entry ) ; if ( index != ( - 1 ) ) { result = entrySet . get ( index ) . getValue ( ) ; entrySet . get ( index ) . setValue ( value ) ; } else { entrySet . add ( entry ) ; result = null ; } return result ; }
org . junit . Assert . assertEquals ( "h" , map . get ( key ) )
runTest ( ) { org . apache . apex . malhar . lib . appdata . query . WindowBoundedServiceTest . CounterRunnable counterRunnable = new org . apache . apex . malhar . lib . appdata . query . WindowBoundedServiceTest . CounterRunnable ( ) ; org . apache . apex . malhar . lib . appdata . query . WindowBoundedService wbs = new org . apache . apex . malhar . lib . appdata . query . WindowBoundedService ( 1 , counterRunnable ) ; wbs . setup ( null ) ; wbs . beginWindow ( 0 ) ; java . lang . Thread . sleep ( 500 ) ; wbs . endWindow ( ) ; wbs . teardown ( ) ; "<AssertPlaceHolder>" ; } getCounter ( ) { return counter ; }
org . junit . Assert . assertTrue ( ( ( counterRunnable . getCounter ( ) ) > 0 ) )
lookUpTest ( ) { final nlp . WordDictionary dictionary = new nlp . WordDictionary ( ) ; final java . lang . String [ ] words = new java . lang . String [ ] { "a" 0 , "am" , "kenny" , "and" , "i'm" , "a" 1 , "to" , "be" , "a" , "metroid" , "hunter" } ; for ( java . lang . String word : words ) { dictionary . add ( word ) ; } for ( java . lang . String word : words ) { final math . Matrix m = dictionary . getVector ( word ) ; final java . lang . String prediction = dictionary . getClosestWord ( m ) ; nlp . TestWordDictionary . LOGGER . info ( ( ( word + "<sp>-><sp>" ) + prediction ) ) ; "<AssertPlaceHolder>" ; } } getClosestWord ( math . Matrix ) { final math . functions . distance . DistanceFunction distanceFunction = new math . functions . distance . EuclideanDistanceFunction ( ) ; java . lang . String closest = null ; double minDistance = Double . MAX_VALUE ; for ( Map . Entry < java . lang . String , math . Matrix > entry : this . wordVectors . entrySet ( ) ) { final double distance = distanceFunction . distance ( entry . getValue ( ) , wordVector ) ; if ( distance < minDistance ) { minDistance = distance ; closest = entry . getKey ( ) ; } } return closest ; }
org . junit . Assert . assertEquals ( word , prediction )
testExpand ( ) { org . locationtech . geogig . model . Node node = org . locationtech . geogig . model . RevObjectFactory . defaultInstance ( ) . createNode ( "Points.1" , org . locationtech . geogig . model . ObjectId . valueOf ( "abc123000000000000001234567890abcdef0000" ) , ObjectId . NULL , TYPE . FEATURE , new org . locationtech . jts . geom . Envelope ( 0 , 1 , 2 , 3 ) , null ) ; org . locationtech . geogig . model . NodeRef nodeRef = org . locationtech . geogig . model . NodeRef . create ( "Points" , node ) ; org . locationtech . jts . geom . Envelope env = new org . locationtech . jts . geom . Envelope ( 1 , 3 , 1 , 2 ) ; nodeRef . expand ( env ) ; "<AssertPlaceHolder>" ; } expand ( org . locationtech . jts . geom . Envelope ) { node . expand ( env ) ; }
org . junit . Assert . assertEquals ( new org . locationtech . jts . geom . Envelope ( 0 , 3 , 1 , 3 ) , env )
testRemoveObsFromEmpty ( ) { org . apache . commons . math4 . stat . regression . SimpleRegression regression = new org . apache . commons . math4 . stat . regression . SimpleRegression ( ) ; regression . removeData ( removeX , removeY ) ; "<AssertPlaceHolder>" ; } getN ( ) { return n ; }
org . junit . Assert . assertEquals ( regression . getN ( ) , 0 )
shouldFilterFeaturesWithSkipTag ( ) { final com . github . bmsantos . core . cola . formatter . FeatureDetails feature = test . utils . TestUtils . loadFeatures ( "com.github.bmsantos.core.cola.filters.TagFilterTest$SkipFeatureClass" ) . get ( 0 ) ; final boolean result = uut . filtrate ( feature ) ; "<AssertPlaceHolder>" ; } filtrate ( java . util . List ) { return new com . github . bmsantos . core . cola . filters . FilterProcessor ( features ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( true ) )
testArrayCreationCase ( ) { org . eclipse . xtend2 . lib . StringConcatenation _builder = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder . append ( "import<sp>java.util.Arrays" ) ; _builder . newLine ( ) ; _builder . append ( "import<sp>java.util.HashSet" ) ; _builder . newLine ( ) ; _builder . append ( "};" 1 ) ; _builder . newLine ( ) ; _builder . append ( "};" 6 ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "int<sp>as[]<sp>=<sp>new<sp>int[1];" ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "};" 0 ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "//<sp>int[][]<sp>as4;" ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "};" 4 ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "int[]<sp>as2,as4[],as5<sp>=<sp>as[];" ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "final<sp>int<sp>callCount[]<sp>=<sp>new<sp>int[]{0};" ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "};" 5 ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "String[]<sp>arr<sp>=<sp>new<sp>String[]{\"\",\"\"};" ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . newLine ( ) ; _builder . append ( "};" 3 ) ; _builder . append ( "Class<?>[]<sp>argTypes<sp>=<sp>new<sp>Class[arr.length];" ) ; _builder . newLine ( ) ; _builder . append ( "};" 2 ) ; org . eclipse . xtend . core . xtend . XtendClass clazz = this . toValidXtendClass ( _builder ) ; "<AssertPlaceHolder>" ; } toValidXtendClass ( java . lang . CharSequence ) { org . eclipse . xtend . core . xtend . XtendTypeDeclaration _validTypeDeclaration = this . toValidTypeDeclaration ( "Clazz" , javaCode ) ; return ( ( org . eclipse . xtend . core . xtend . XtendClass ) ( _validTypeDeclaration ) ) ; }
org . junit . Assert . assertNotNull ( clazz )
shouldReturnOnlyMatchesToPredicate ( ) { final java . util . function . Predicate < java . lang . Integer > p = ( a ) -> a <= 2 ; final java . util . List < java . lang . Integer > expected = java . util . Arrays . asList ( 1 , 2 ) ; "<AssertPlaceHolder>" ; } filter ( java . lang . Iterable , java . util . function . Predicate ) { final java . util . List < T > dest = org . pitest . functional . FCollection . emptyList ( ) ; org . pitest . functional . FCollection . filter ( xs , predicate , dest ) ; return dest ; }
org . junit . Assert . assertEquals ( expected , org . pitest . functional . FCollection . filter ( this . is , p ) )
removeAllColumns ( ) { grid . removeAllColumns ( ) ; "<AssertPlaceHolder>" ; } getColumns ( ) { openTestURL ( ) ; org . junit . Assert . assertEquals ( 1 , $ ( com . vaadin . testbench . elements . GridLayoutElement . class ) . id ( GridLayoutUI . ONE_ROW_ONE_COL ) . getColumnCount ( ) ) ; org . junit . Assert . assertEquals ( 10 , $ ( com . vaadin . testbench . elements . GridLayoutElement . class ) . id ( GridLayoutUI . TEN_ROWS_TEN_COLS ) . getColumnCount ( ) ) ; }
org . junit . Assert . assertEquals ( java . util . Collections . emptyList ( ) , grid . getColumns ( ) )
groupingByCollectInt ( ) { java . util . Map < java . lang . Integer , org . eclipse . collections . api . collection . primitive . MutableIntCollection > expected = org . eclipse . collections . impl . list . Interval . oneTo ( 100 ) . stream ( ) . collect ( java . util . stream . Collectors . groupingBy ( ( each ) -> each % 2 , org . eclipse . collections . impl . collector . Collectors2 . collectInt ( Integer :: intValue , org . eclipse . collections . impl . factory . primitive . IntBags . mutable :: empty ) ) ) ; java . util . Map < java . lang . Integer , org . eclipse . collections . api . collection . primitive . MutableIntCollection > actual = org . eclipse . collections . impl . list . Interval . oneTo ( 100 ) . reduceInPlace ( java . util . stream . Collectors . groupingBy ( ( each ) -> each % 2 , org . eclipse . collections . impl . collector . Collectors2 . collectInt ( Integer :: intValue , org . eclipse . collections . impl . factory . primitive . IntBags . mutable :: empty ) ) ) ; "<AssertPlaceHolder>" ; } collectInt ( org . eclipse . collections . api . block . function . primitive . IntFunction , java . util . function . Supplier ) { return java . util . stream . Collector . of ( supplier , ( collection , each ) -> collection . add ( function . intValueOf ( each ) ) , ( collection1 , collection2 ) -> { collection1 . addAll ( collection2 ) ; return collection1 ; } , org . eclipse . collections . impl . collector . Collectors2 . EMPTY_CHARACTERISTICS ) ; }
org . junit . Assert . assertEquals ( expected , actual )
whenDecrypting_cacheMiss ( ) { com . amazonaws . encryptionsdk . model . DecryptionMaterialsRequest request = com . amazonaws . encryptionsdk . caching . CacheTestFixtures . createDecryptRequest ( 0 ) ; com . amazonaws . encryptionsdk . model . DecryptionMaterials result = com . amazonaws . encryptionsdk . caching . CacheTestFixtures . createDecryptResult ( request ) ; doReturn ( result ) . when ( delegate ) . decryptMaterials ( any ( ) ) ; com . amazonaws . encryptionsdk . model . DecryptionMaterials actual = cmm . decryptMaterials ( request ) ; "<AssertPlaceHolder>" ; verify ( cache ) . putEntryForDecrypt ( any ( ) , eq ( result ) , any ( ) ) ; } decryptMaterials ( com . amazonaws . encryptionsdk . model . DecryptionMaterialsRequest ) { byte [ ] cacheId = getCacheIdentifier ( request ) ; com . amazonaws . encryptionsdk . caching . CryptoMaterialsCache . DecryptCacheEntry entry = cache . getEntryForDecrypt ( cacheId ) ; if ( ( entry != null ) && ( ! ( isEntryExpired ( entry . getEntryCreationTime ( ) ) ) ) ) { return entry . getResult ( ) ; } com . amazonaws . encryptionsdk . model . DecryptionMaterials result = backingCMM . decryptMaterials ( request ) ; cache . putEntryForDecrypt ( cacheId , result , hint ) ; return result ; }
org . junit . Assert . assertEquals ( result , actual )
initializesProviderBinderOnFirstCallAndReusesSameInstance ( ) { org . everrest . core . impl . ProviderBinder providerBinder = org . everrest . core . impl . ProviderBinder . getInstance ( ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { org . everrest . core . impl . ProviderBinder providerBinder = org . everrest . core . impl . ProviderBinder . INSTANCE . get ( ) ; if ( providerBinder == null ) { org . everrest . core . impl . ProviderBinder newProviderBinder = new org . everrest . core . impl . ProviderBinder ( ) ; if ( org . everrest . core . impl . ProviderBinder . INSTANCE . compareAndSet ( null , newProviderBinder ) ) { providerBinder = newProviderBinder ; providerBinder . init ( ) ; } else { providerBinder = org . everrest . core . impl . ProviderBinder . INSTANCE . get ( ) ; } } return providerBinder ; }
org . junit . Assert . assertSame ( providerBinder , org . everrest . core . impl . ProviderBinder . getInstance ( ) )
testReplaceTwoWithOneAtLeft ( ) { org . antlr . runtime . tree . CommonTree t = new org . antlr . runtime . tree . CommonTree ( new org . antlr . runtime . CommonToken ( 99 , "a" ) ) ; t . addChild ( new org . antlr . runtime . tree . CommonTree ( new org . antlr . runtime . CommonToken ( 99 , "b" ) ) ) ; t . addChild ( new org . antlr . runtime . tree . CommonTree ( new org . antlr . runtime . CommonToken ( 99 , "c" ) ) ) ; t . addChild ( new org . antlr . runtime . tree . CommonTree ( new org . antlr . runtime . CommonToken ( 99 , "d" ) ) ) ; org . antlr . runtime . tree . CommonTree newChild = new org . antlr . runtime . tree . CommonTree ( new org . antlr . runtime . CommonToken ( 99 , "x" ) ) ; t . replaceChildren ( 0 , 1 , newChild ) ; java . lang . String expecting = "(a<sp>x<sp>d)" ; "<AssertPlaceHolder>" ; t . sanityCheckParentAndChildIndexes ( ) ; } toStringTree ( ) { if ( ( ( children ) == null ) || ( children . isEmpty ( ) ) ) { return this . toString ( ) ; } java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; if ( ! ( isNil ( ) ) ) { buf . append ( "(" ) ; buf . append ( this . toString ( ) ) ; buf . append ( '<sp>' ) ; } for ( int i = 0 ; ( ( children ) != null ) && ( i < ( children . size ( ) ) ) ; i ++ ) { org . antlr . runtime . tree . Tree t = ( ( org . antlr . runtime . tree . Tree ) ( children . get ( i ) ) ) ; if ( i > 0 ) { buf . append ( '<sp>' ) ; } buf . append ( t . toStringTree ( ) ) ; } if ( ! ( isNil ( ) ) ) { buf . append ( ")" ) ; } return buf . toString ( ) ; }
org . junit . Assert . assertEquals ( expecting , t . toStringTree ( ) )
testNothing ( ) { org . jboss . msc . service . ServiceController < ? > serviceController = this . registry . getService ( org . jboss . msc . service . ServiceName . parse ( "org.wildfly.io.worker.default" ) ) ; "<AssertPlaceHolder>" ; } parse ( java . net . URL ) { final java . util . List < org . jboss . dmr . ModelNode > operationList = new java . util . ArrayList ( ) ; try ( java . io . InputStream input = xml . openStream ( ) ) { final javax . xml . stream . XMLStreamReader reader = javax . xml . stream . XMLInputFactory . newInstance ( ) . createXMLStreamReader ( input ) ; org . wildfly . swarm . container . runtime . xmlconfig . WrappedXMLStreamReader wrappedReader = new org . wildfly . swarm . container . runtime . xmlconfig . WrappedXMLStreamReader ( reader , this . recognizedNames , xmlMapper ) ; xmlMapper . parseDocument ( operationList , wrappedReader ) ; } return operationList ; }
org . junit . Assert . assertNotNull ( serviceController )
test200 ( ) { net . jadler . Jadler . onRequest ( ) . respond ( ) . withStatus ( 200 ) ; final int status = org . apache . http . client . fluent . Executor . newInstance ( ) . execute ( org . apache . http . client . fluent . Request . Get ( jadlerUri ( ) ) ) . handleResponse ( net . jadler . STATUS_RETRIEVER ) ; "<AssertPlaceHolder>" ; net . jadler . Jadler . verifyThatRequest ( ) . receivedOnce ( ) ; } handleResponse ( org . apache . http . HttpResponse ) { return response . getStatusLine ( ) . getStatusCode ( ) ; }
org . junit . Assert . assertThat ( status , org . hamcrest . Matchers . is ( 200 ) )
testGeboorteDatumKindNaAanvAdreshoudingMoeder ( ) { java . util . List < nl . bzk . brp . model . validatie . Melding > melding = brpuc00120 . executeer ( null , nieuweSituatie , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( melding . size ( ) ) == 0 ) )
gotLocalAPK_pushApk ( ) { when ( device . getSyncService ( ) ) . thenThrow ( new java . io . IOException ( ) ) ; when ( filemanager . fileExist ( any ( java . lang . String . class ) ) ) . thenReturn ( true ) ; boolean testResult = rootedAndroidCollectorImpl . pushApk ( device ) ; "<AssertPlaceHolder>" ; } pushApk ( com . android . ddmlib . IDevice ) { java . lang . ClassLoader loader = com . att . aro . datacollector . norootedandroidcollector . impl . NorootedAndroidCollectorImpl . class . getClassLoader ( ) ; for ( int i = 0 ; i < 500 ; i ++ ) { java . lang . String tempFile = java . lang . String . format ( com . att . aro . datacollector . norootedandroidcollector . impl . NorootedAndroidCollectorImpl . APK_FILE_NAME , i ) ; if ( ( loader . getResource ( tempFile ) ) != null ) { com . att . aro . datacollector . norootedandroidcollector . impl . NorootedAndroidCollectorImpl . APK_FILE_NAME = tempFile ; break ; } } if ( ! ( isAPKInstallationRequired ( ) ) ) { return true ; } java . lang . String filepath = ( ( localTraceFolder ) + ( com . att . aro . core . util . Util . FILE_SEPARATOR ) ) + ( com . att . aro . datacollector . norootedandroidcollector . impl . NorootedAndroidCollectorImpl . APK_FILE_NAME ) ; boolean gotlocalapk = true ; if ( ! ( filemanager . fileExist ( filepath ) ) ) { if ( ! ( extractor . extractFiles ( filepath , com . att . aro . datacollector . norootedandroidcollector . impl . NorootedAndroidCollectorImpl . APK_FILE_NAME , loader ) ) ) { gotlocalapk = false ; } } if ( gotlocalapk ) { try { device . installPackage ( filepath , true ) ; com . att . aro . datacollector . norootedandroidcollector . impl . NorootedAndroidCollectorImpl . LOG . debug ( "installed<sp>apk<sp>in<sp>device" ) ; filemanager . deleteFile ( filepath ) ; } catch ( com . android . ddmlib . InstallException e ) { com . att . aro . datacollector . norootedandroidcollector . impl . NorootedAndroidCollectorImpl . LOG . error ( e . getMessage ( ) ) ; return false ; } } else { return false ; } return true ; }
org . junit . Assert . assertEquals ( true , testResult )
testGetProperty ( ) { cn . jimmyshi . beanquery . example . Book book = new cn . jimmyshi . beanquery . example . Book ( ) ; book . setName ( "bookName" ) ; java . lang . Object result = cn . jimmyshi . beanquery . DefaultNullValuePropertyValueGetter . getProperty ( book , "name" ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . Object , java . lang . String ) { if ( ( null == from ) || ( org . apache . commons . lang3 . StringUtils . isBlank ( propertyName ) ) ) { org . slf4j . LoggerFactory . getLogger ( cn . jimmyshi . beanquery . DefaultNullValuePropertyValueGetter . class ) . info ( "Object<sp>is<sp>null<sp>or<sp>the<sp>property<sp>[{}]<sp>is<sp>blank,<sp>returning<sp>null" , propertyName ) ; return null ; } try { return org . apache . commons . beanutils . PropertyUtils . getProperty ( from , propertyName ) ; } catch ( java . lang . Exception e ) { org . slf4j . LoggerFactory . getLogger ( cn . jimmyshi . beanquery . DefaultNullValuePropertyValueGetter . class ) . info ( "Exception<sp>[{}]<sp>when<sp>fetching<sp>property<sp>[{}]<sp>from<sp>object<sp>[{}],<sp>returning<sp>null<sp>as<sp>the<sp>value." , e . toString ( ) , propertyName , from ) ; return null ; } }
org . junit . Assert . assertEquals ( "bookName" , result )
ProviderShouldProvide ( ) { com . salesforce . grpc . contrib . NameResolverProvider provider = com . salesforce . grpc . contrib . StaticResolver . provider ( staticAddress ) ; com . salesforce . grpc . contrib . NameResolver resolver = provider . newNameResolver ( java . net . URI . create ( "mesh://some.service" ) , Attributes . EMPTY ) ; "<AssertPlaceHolder>" . isNotNull ( ) ; } newNameResolver ( java . net . URI , com . salesforce . grpc . contrib . Attributes ) { for ( com . salesforce . grpc . contrib . NameResolverProvider provider : providers ) { com . salesforce . grpc . contrib . NameResolver resolver = provider . newNameResolver ( targetUri , params ) ; if ( resolver != null ) { return resolver ; } } return null ; }
org . junit . Assert . assertThat ( resolver )
testEdgelessGraphSame ( ) { edu . ucla . sspace . graph . isomorphism . Graph < edu . ucla . sspace . graph . isomorphism . Edge > g1 = new edu . ucla . sspace . graph . isomorphism . SparseUndirectedGraph ( ) ; for ( int i = 0 ; i < 3 ; ++ i ) g1 . add ( i ) ; edu . ucla . sspace . graph . isomorphism . Graph < edu . ucla . sspace . graph . isomorphism . Edge > g2 = new edu . ucla . sspace . graph . isomorphism . SparseUndirectedGraph ( ) ; for ( int i = 3 ; i < 6 ; ++ i ) g2 . add ( i ) ; edu . ucla . sspace . graph . isomorphism . IsomorphismTester isoTest = new edu . ucla . sspace . graph . isomorphism . VF2IsomorphismTester ( ) ; "<AssertPlaceHolder>" ; } areIsomorphic ( edu . ucla . sspace . graph . isomorphism . Graph , edu . ucla . sspace . graph . isomorphism . Graph ) { edu . ucla . sspace . graph . isomorphism . Graph < ? extends edu . ucla . sspace . graph . isomorphism . Edge > g1mapped = remap ( g1 , null ) ; edu . ucla . sspace . graph . isomorphism . Graph < ? extends edu . ucla . sspace . graph . isomorphism . Edge > g2mapped = remap ( g2 , null ) ; edu . ucla . sspace . graph . isomorphism . State state = makeInitialState ( g1mapped , g2mapped ) ; return match ( state ) ; }
org . junit . Assert . assertTrue ( isoTest . areIsomorphic ( g1 , g2 ) )
testGetMapByIds ( ) { java . util . Map < java . lang . Integer , com . baidu . beidou . sample . annotation . vo . Company > result = companyMgr . getMapByIds ( java . util . Arrays . asList ( new java . lang . Integer [ ] { 88 , 99 } ) ) ; System . out . println ( result ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . Matchers . is ( 2 ) )
test2 ( ) { com . examples . with . different . packagename . testcarver . ConcreteSubClassWithFields foo = new com . examples . with . different . packagename . testcarver . ConcreteSubClassWithFields ( 42 , 100 ) ; "<AssertPlaceHolder>" ; } testMe ( java . util . List ) { if ( ( list . size ( ) ) == 2 ) return true ; else return false ; }
org . junit . Assert . assertTrue ( foo . testMe ( 42 ) )
testEncodeEID ( ) { org . eclipse . kura . internal . ble . eddystone . BluetoothLeEddystoneEncoderImpl encoder = new org . eclipse . kura . internal . ble . eddystone . BluetoothLeEddystoneEncoderImpl ( ) ; org . eclipse . kura . ble . eddystone . BluetoothLeEddystone beacon = new org . eclipse . kura . ble . eddystone . BluetoothLeEddystone ( ) ; beacon . setBrEdrSupported ( true ) ; beacon . setLeBrController ( true ) ; beacon . setLeBrHost ( true ) ; beacon . setLeGeneral ( true ) ; beacon . setLeLimited ( true ) ; beacon . setTxPower ( ( ( short ) ( 50 ) ) ) ; beacon . setFrameType ( EddystoneFrameType . EID . name ( ) ) ; byte [ ] encoded = encoder . encode ( beacon ) ; byte [ ] expected = new byte [ ] { 0 } ; "<AssertPlaceHolder>" ; } encode ( org . eclipse . kura . ble . eddystone . BluetoothLeEddystone ) { byte flags = encodeFlags ( beacon ) ; org . eclipse . kura . internal . ble . eddystone . EddystoneFrameType frameType = org . eclipse . kura . internal . ble . eddystone . EddystoneFrameType . valueOf ( beacon . getFrameType ( ) ) ; if ( frameType . equals ( EddystoneFrameType . UID ) ) { return encodeUID ( flags , beacon ) ; } else if ( frameType . equals ( EddystoneFrameType . URL ) ) { return encodeURL ( flags , beacon ) ; } else if ( frameType . equals ( EddystoneFrameType . TLM ) ) { return encodeTLM ( flags , beacon ) ; } else if ( frameType . equals ( EddystoneFrameType . EID ) ) { return encodeEID ( flags , beacon ) ; } else { return new byte [ 1 ] ; } }
org . junit . Assert . assertArrayEquals ( expected , encoded )
testKeySet ( ) { java . util . HashSet < java . lang . String > keySet = new java . util . HashSet ( java . util . Arrays . asList ( "foo" , "bar" , "baz" ) ) ; for ( java . lang . String key : keySet ) jsonMap . put ( key , testJsonable ) ; "<AssertPlaceHolder>" ; } keySet ( ) { return java . nio . file . Files . list ( directory ) . map ( Path :: getFileName ) . map ( Path :: toString ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; }
org . junit . Assert . assertEquals ( keySet , jsonMap . keySet ( ) )
itShouldFetchValueWithDecimalPoint4 ( ) { java . lang . String inputValue = "0123456.90" ; java . lang . String actual = hydrograph . engine . transformation . standardfunctions . NumericFunctions . decimalStrip ( inputValue , "." ) ; java . lang . String expected = "123456.90" ; "<AssertPlaceHolder>" ; } decimalStrip ( T , T ) { if ( inputValue == null ) return null ; java . lang . String input = hydrograph . engine . transformation . standardfunctions . helper . StandardFunctionHelper . convertComparableObjectToString ( inputValue ) ; java . lang . String filter = input . replaceAll ( ( ( "[^0-9-\\" + decimal_point ) + "]" ) , "" ) ; if ( ! ( filter . equals ( "" ) ) ) { java . lang . String regx = "^(-)(0+)(.*)|^(0+)(.*)" ; java . util . regex . Matcher match = java . util . regex . Pattern . compile ( regx ) . matcher ( filter ) ; if ( match . find ( ) ) { if ( ( match . group ( 1 ) ) != null ) return ( ( T ) ( ( match . group ( 1 ) ) + ( match . group ( 3 ) ) ) ) ; else return ( ( T ) ( match . group ( 5 ) ) ) ; } return ( ( T ) ( filter ) ) ; } return ( ( T ) ( "0" ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testHashCode ( ) { org . bff . javampd . MPDItem item1 = new org . bff . javampd . MPDItemTest . TestItem ( "item1" ) ; org . bff . javampd . MPDItem item2 = new org . bff . javampd . MPDItemTest . TestItem ( "item1" ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int result = super . hashCode ( ) ; result = ( 31 * result ) + ( artistName . hashCode ( ) ) ; result = ( 31 * result ) + ( date . hashCode ( ) ) ; result = ( 31 * result ) + ( genre . hashCode ( ) ) ; return result ; }
org . junit . Assert . assertEquals ( item1 . hashCode ( ) , item2 . hashCode ( ) )
testKeyValueMatch ( ) { java . lang . String [ ] data = createData ( ) ; createTestTable ( data ) ; try ( com . questdb . store . MMappedSymbolTable tab = getReader ( ) ) { for ( int i = 0 ; i < ( tab . size ( ) ) ; i ++ ) { "<AssertPlaceHolder>" ; } } } value ( int ) { if ( key < 0 ) { return null ; } if ( key < ( size ) ) { java . lang . String value = ( key < ( keyCache . size ( ) ) ) ? keyCache . getQuick ( key ) : null ; if ( value == null ) { cache ( key , ( value = data . getStr ( key ) ) ) ; } return value ; } throw new com . questdb . store . JournalRuntimeException ( ( "Invalid<sp>symbol<sp>key:<sp>" + key ) ) ; }
org . junit . Assert . assertEquals ( data [ i ] , tab . value ( i ) )
handle_shouldNotReplaceTagsWithoutIdsThatAreNotInTheDatabase ( ) { org . openmrs . api . handler . ConceptNameSaveHandler handler = new org . openmrs . api . handler . ConceptNameSaveHandler ( ) ; org . openmrs . ConceptName name = new org . openmrs . ConceptName ( ) ; name . addTag ( new org . openmrs . ConceptNameTag ( "Some<sp>randome<sp>tag<sp>name" , "" ) ) ; handler . handle ( name , null , null , null ) ; org . openmrs . ConceptNameTag newTag = name . getTags ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } getConceptNameTagId ( ) { return conceptNameTagId ; }
org . junit . Assert . assertNull ( newTag . getConceptNameTagId ( ) )
testInsideString ( ) { org . hibernate . checkstyle . checks . regexp . StringSuppressor suppressor = new org . hibernate . checkstyle . checks . regexp . StringSuppressor ( ) ; suppressor . setCurrentContents ( content ( "\"<sp>\"" ) ) ; "<AssertPlaceHolder>" ; } shouldSuppress ( int , int , int , int ) { return false ; }
org . junit . Assert . assertTrue ( suppressor . shouldSuppress ( 1 , 4 , 0 , 6 ) )
testLoadFromSerialized ( ) { byte [ ] serialized = opennlp . tools . langdetect . LanguageDetectorMETest . serializeModel ( model ) ; opennlp . tools . langdetect . LanguageDetectorModel myModel = new opennlp . tools . langdetect . LanguageDetectorModel ( new java . io . ByteArrayInputStream ( serialized ) ) ; "<AssertPlaceHolder>" ; } serializeModel ( opennlp . tools . langdetect . LanguageDetectorModel ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; model . serialize ( out ) ; return out . toByteArray ( ) ; }
org . junit . Assert . assertNotNull ( myModel )
testNearestHonoursUnsubscribeJustBeforeCompletion ( ) { java . lang . Object value = new java . lang . Object ( ) ; com . github . davidmoten . rtree . RTree < java . lang . Object , com . github . davidmoten . rtree . geometry . Geometry > tree = com . github . davidmoten . rtree . RTree . create ( ) . add ( value , point ( 1 , 1 ) ) ; final java . util . concurrent . atomic . AtomicBoolean completeCalled = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; tree . nearest ( point ( 0 , 0 ) , 10 , 10 ) . subscribe ( new rx . Subscriber < java . lang . Object > ( ) { @ com . github . davidmoten . rtree . Override public void onCompleted ( ) { completeCalled . set ( true ) ; } @ com . github . davidmoten . rtree . Override public void onError ( java . lang . Throwable e ) { } @ com . github . davidmoten . rtree . Override public void onNext ( java . lang . Object t ) { unsubscribe ( ) ; } } ) ; "<AssertPlaceHolder>" ; } onNext ( com . github . davidmoten . rtree . Entry ) { collection . add ( t ) ; request ( 1 ) ; }
org . junit . Assert . assertFalse ( completeCalled . get ( ) )
testGT_4 ( ) { org . ethereum . vm . VM vm = new org . ethereum . vm . VM ( ) ; program = new org . ethereum . vm . Program ( org . spongycastle . util . encoders . Hex . decode ( "622A3B4C0B" ) , invoke ) ; try { vm . step ( program ) ; vm . step ( program ) ; vm . step ( program ) ; } finally { "<AssertPlaceHolder>" ; } } isStopped ( ) { return stopped ; }
org . junit . Assert . assertTrue ( program . isStopped ( ) )
startEditingCellMouseClick ( ) { final com . ait . lienzo . client . core . types . Point2D rp = new com . ait . lienzo . client . core . types . Point2D ( 10 , 20 ) ; gridWidget . startEditingCell ( rp ) ; final org . mockito . ArgumentCaptor < com . ait . lienzo . client . core . types . Point2D > pointArgumentCaptor = org . mockito . ArgumentCaptor . forClass ( com . ait . lienzo . client . core . types . Point2D . class ) ; verify ( cellSelectionManager , times ( 1 ) ) . startEditingCell ( pointArgumentCaptor . capture ( ) ) ; final com . ait . lienzo . client . core . types . Point2D point = pointArgumentCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return select . getValue ( ) ; }
org . junit . Assert . assertEquals ( rp , point )
mockNonAbstractMethodsInEnumWithAbstractMethod ( mockit . TimeUnit ) { new mockit . Expectations ( ) { { tm . convert ( anyLong , TimeUnit . SECONDS ) ; result = 1L ; tm . sleep ( anyLong ) ; } } ; "<AssertPlaceHolder>" ; tm . sleep ( 10000 ) ; }
org . junit . Assert . assertEquals ( 1 , tm . convert ( 1000 , TimeUnit . SECONDS ) )
testCollectEmptyList ( ) { java . util . List < java . util . concurrent . CompletableFuture < java . lang . Integer > > futures = com . google . common . collect . Lists . newArrayList ( ) ; java . util . List < java . lang . Integer > result = org . apache . distributedlog . common . concurrent . FutureUtils . result ( org . apache . distributedlog . common . concurrent . FutureUtils . collect ( futures ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return map . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( result . isEmpty ( ) )