input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testSearchCountByNameAndDescription2 ( ) { java . lang . String name = com . liferay . portal . kernel . util . StringUtil . randomString ( ) ; java . lang . String description = com . liferay . portal . kernel . util . StringUtil . randomString ( ) ; com . liferay . dynamic . data . mapping . model . DDMStructure structure = addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _recordSetClassNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; java . lang . String language = com . liferay . portal . kernel . template . TemplateConstants . LANG_TYPE_FTL ; java . lang . String script = getTestTemplateScript ( language ) ; java . lang . String type = null ; java . lang . String mode = null ; addTemplate ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _structureClassNameId , structure . getStructureId ( ) , com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _recordSetClassNameId , null , name , description , type , mode , language , script , WorkflowConstants . STATUS_ANY ) ; addTemplate ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _structureClassNameId , structure . getStructureId ( ) , com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _recordSetClassNameId , null , name , com . liferay . portal . kernel . util . StringUtil . randomString ( ) , type , mode , language , script , WorkflowConstants . STATUS_ANY ) ; addTemplate ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _structureClassNameId , structure . getStructureId ( ) , com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _recordSetClassNameId , null , com . liferay . portal . kernel . util . StringUtil . randomString ( ) , description , type , mode , language , script , WorkflowConstants . STATUS_ANY ) ; long [ ] groupIds = new long [ ] { group . getGroupId ( ) , _group . getGroupId ( ) } ; int count = com . liferay . dynamic . data . mapping . service . DDMTemplateServiceUtil . searchCount ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , groupIds , new long [ ] { com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _structureClassNameId } , new long [ ] { structure . getStructureId ( ) } , com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _recordSetClassNameId , name , description , type , mode , language , WorkflowConstants . STATUS_ANY , false ) ; "<AssertPlaceHolder>" ; } getStructureId ( ) { return structureId ; }
org . junit . Assert . assertEquals ( 3 , count )
input_multiple ( ) { com . asakusafw . runtime . io . json . directio . AbstractJsonStreamFormatTest . MockFormat format = format ( 3 ) ; int [ ] [ ] data = new int [ ] [ ] { new int [ ] { 11 , 12 , 13 } , new int [ ] { 22 , 22 , 23 } , new int [ ] { 33 , 32 , 33 } } ; try ( com . asakusafw . runtime . io . ModelInput < int [ ] > in = format . createInput ( int [ ] . class , "dummy" , com . asakusafw . runtime . io . json . directio . AbstractJsonStreamFormatTest . input ( data ) ) ) { int [ ] [ ] result = collect ( 3 , in ) ; "<AssertPlaceHolder>" ; } } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; }
org . junit . Assert . assertThat ( result , is ( data ) )
testWaitUntilExists ( ) { final java . lang . String path = "/test4" ; java . lang . Thread thread = new java . lang . Thread ( new java . lang . Runnable ( ) { @ com . api6 . zkclient . Override public void run ( ) { try { java . lang . Thread . sleep ( ( 1000 * 3 ) ) ; zkClient . create ( path , "111" , CreateMode . PERSISTENT ) ; } catch ( java . lang . InterruptedException e ) { e . printStackTrace ( ) ; } } } ) ; thread . start ( ) ; boolean flag = zkClient . waitUntilExists ( path , TimeUnit . MILLISECONDS , ( 1000 * 5 ) ) ; "<AssertPlaceHolder>" ; } waitUntilExists ( java . lang . String , java . util . concurrent . TimeUnit , long ) { java . util . Date timeout = new java . util . Date ( ( ( java . lang . System . currentTimeMillis ( ) ) + ( timeUnit . toMillis ( time ) ) ) ) ; com . api6 . zkclient . ZKClient . LOG . debug ( ( ( "Waiting<sp>until<sp>node<sp>'" + path ) + "'<sp>becomes<sp>available." ) ) ; if ( exists ( path ) ) { return true ; } acquireEventLockInterruptibly ( ) ; try { while ( ! ( exists ( path , true ) ) ) { boolean gotSignal = getEventLock ( ) . getNodeEventCondition ( ) . awaitUntil ( timeout ) ; if ( ! gotSignal ) { return false ; } } com . api6 . zkclient . ZKClient . LOG . debug ( ( ( "Node<sp>'" + path ) + "'<sp>is<sp>available." ) ) ; return true ; } catch ( java . lang . InterruptedException e ) { throw new com . api6 . zkclient . exception . ZKInterruptedException ( e ) ; } finally { releaseEventLock ( ) ; } }
org . junit . Assert . assertTrue ( flag )
testMemberCount_13_02 ( ) { java . lang . String typeName = Fields . Inner . class . getName ( ) . replace ( '$' , '.' ) ; org . eclipse . xtext . common . types . JvmGenericType type = ( ( org . eclipse . xtext . common . types . JvmGenericType ) ( getTypeProvider ( ) . findTypeByName ( typeName , true ) ) ) ; "<AssertPlaceHolder>" ; } findTypeByName ( java . lang . String , boolean ) { return null ; }
org . junit . Assert . assertNull ( type )
testFindByHash ( ) { java . util . List < org . kaaproject . kaa . server . common . nosql . cassandra . dao . model . CassandraEndpointConfiguration > configs = generateConfiguration ( 3 ) ; org . kaaproject . kaa . server . common . nosql . cassandra . dao . model . CassandraEndpointConfiguration expected = configs . get ( 0 ) ; org . kaaproject . kaa . server . common . nosql . cassandra . dao . model . CassandraEndpointConfiguration found = endpointConfigurationDao . findByHash ( expected . getConfigurationHash ( ) . array ( ) ) ; "<AssertPlaceHolder>" ; } getConfigurationHash ( ) { return org . kaaproject . kaa . common . hash . EndpointObjectHash . fromSha1 ( getConfigurationData ( ) ) ; }
org . junit . Assert . assertEquals ( expected , found )
testClientAreaIsZeroWithPadding ( ) { org . eclipse . swt . widgets . Composite scrollable = new org . eclipse . swt . widgets . Composite ( shell , org . eclipse . swt . SWT . BORDER ) { @ org . eclipse . swt . widgets . Override int getVScrollBarWidth ( ) { return 20 ; } @ org . eclipse . swt . widgets . Override int getHScrollBarHeight ( ) { return 20 ; } @ org . eclipse . swt . widgets . Override org . eclipse . rap . rwt . theme . BoxDimensions getPadding ( ) { return new org . eclipse . rap . rwt . theme . BoxDimensions ( 10 , 0 , 0 , 10 ) ; } } ; scrollable . setSize ( 25 , 25 ) ; org . eclipse . swt . graphics . Rectangle expected = new org . eclipse . swt . graphics . Rectangle ( 10 , 10 , 0 , 0 ) ; "<AssertPlaceHolder>" ; } getClientArea ( ) { return clientComposite . getClientArea ( ) ; }
org . junit . Assert . assertEquals ( expected , scrollable . getClientArea ( ) )
testFetchByPrimaryKeyExisting ( ) { com . liferay . sync . model . SyncDevice newSyncDevice = addSyncDevice ( ) ; com . liferay . sync . model . SyncDevice existingSyncDevice = _persistence . fetchByPrimaryKey ( newSyncDevice . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingSyncDevice , newSyncDevice )
createReferencesEmpty2 ( ) { java . util . GregorianCalendar cal = new java . util . GregorianCalendar ( 2014 , 10 , 22 , 11 , 30 , 0 ) ; cal . set ( GregorianCalendar . MILLISECOND , 999 ) ; java . time . Instant start = cal . getTime ( ) . toInstant ( ) ; org . diirt . util . time . TimeInterval timeInterval = org . diirt . util . time . TimeInterval . between ( start , start . plus ( java . time . Duration . ofMillis ( 3 ) ) ) ; java . util . List < java . time . Instant > references = org . diirt . graphene . TimeScales . createReferences ( timeInterval , new org . diirt . graphene . TimeScales . TimePeriod ( SECOND , 3 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return values . size ( ) ; }
org . junit . Assert . assertThat ( references . size ( ) , equalTo ( 0 ) )
testAssetNameSad ( ) { org . sonatype . nexus . selector . Selector selector = buildSelector ( "asset.name<sp>=~<sp>'^jun.+'<sp>and<sp>asset.group<sp>=~<sp>'^jun.+'" ) ; "<AssertPlaceHolder>" ; } evaluate ( org . sonatype . nexus . selector . VariableSource ) { return java . lang . Boolean . TRUE . equals ( expression . evaluate ( org . sonatype . nexus . selector . JexlSelector . asJexlContext ( source ) ) ) ; }
org . junit . Assert . assertFalse ( selector . evaluate ( source ) )
testWithTimestampDataLoader ( ) { eu . europa . esig . dss . client . tsp . OnlineTSPSource tspSource = new eu . europa . esig . dss . client . tsp . OnlineTSPSource ( "http://demo.sk.ee/tsa/" ) ; tspSource . setPolicyOid ( "0.4.0.2023.1.1" ) ; tspSource . setDataLoader ( new eu . europa . esig . dss . client . http . commons . TimestampDataLoader ( ) ) ; byte [ ] digest = eu . europa . esig . dss . DSSUtils . digest ( DigestAlgorithm . SHA512 , "Hello<sp>world" . getBytes ( ) ) ; org . bouncycastle . tsp . TimeStampToken timeStampResponse = tspSource . getTimeStampResponse ( DigestAlgorithm . SHA512 , digest ) ; "<AssertPlaceHolder>" ; } getTimeStampResponse ( eu . europa . esig . dss . DigestAlgorithm , byte [ ] ) { try { if ( eu . europa . esig . dss . client . tsp . OnlineTSPSource . LOG . isTraceEnabled ( ) ) { eu . europa . esig . dss . client . tsp . OnlineTSPSource . LOG . trace ( "Timestamp<sp>digest<sp>algorithm:<sp>{}" , digestAlgorithm . getName ( ) ) ; eu . europa . esig . dss . client . tsp . OnlineTSPSource . LOG . trace ( "Timestamp<sp>digest<sp>value<sp>:<sp>{}" , eu . europa . esig . dss . utils . Utils . toHex ( digest ) ) ; } final org . bouncycastle . tsp . TimeStampRequestGenerator tsqGenerator = new org . bouncycastle . tsp . TimeStampRequestGenerator ( ) ; tsqGenerator . setCertReq ( true ) ; if ( ( policyOid ) != null ) { tsqGenerator . setReqPolicy ( policyOid ) ; } org . bouncycastle . asn1 . ASN1ObjectIdentifier asn1ObjectIdentifier = new org . bouncycastle . asn1 . ASN1ObjectIdentifier ( digestAlgorithm . getOid ( ) ) ; org . bouncycastle . tsp . TimeStampRequest timeStampRequest = null ; if ( ( nonceSource ) == null ) { timeStampRequest = tsqGenerator . generate ( asn1ObjectIdentifier , digest ) ; } else { timeStampRequest = tsqGenerator . generate ( asn1ObjectIdentifier , digest , nonceSource . getNonce ( ) ) ; } final byte [ ] requestBytes = timeStampRequest . getEncoded ( ) ; if ( ( dataLoader ) == null ) { dataLoader = new eu . europa . esig . dss . client . http . NativeHTTPDataLoader ( ) ; } byte [ ] respBytes = dataLoader . post ( tspServer , requestBytes ) ; final org . bouncycastle . tsp . TimeStampResponse timeStampResponse = new org . bouncycastle . tsp . TimeStampResponse ( respBytes ) ; timeStampResponse . validate ( timeStampRequest ) ; java . lang . String statusString = timeStampResponse . getStatusString ( ) ; if ( statusString != null ) { eu . europa . esig . dss . client . tsp . OnlineTSPSource . LOG . info ( "TSP<sp>Status:<sp>{}" , statusString ) ; } org . bouncycastle . asn1 . cmp . PKIFailureInfo failInfo = timeStampResponse . getFailInfo ( ) ; if ( failInfo != null ) { eu . europa . esig . dss . client . tsp . OnlineTSPSource . LOG . warn ( "TSP<sp>Failure<sp>info:<sp>{}" , failInfo ) ; } final org . bouncycastle . tsp . TimeStampToken timeStampToken = timeStampResponse . getTimeStampToken ( ) ; if ( timeStampToken != null ) { eu . europa . esig . dss . client . tsp . OnlineTSPSource . LOG . info ( "TSP<sp>SID<sp>:<sp>SN<sp>{},<sp>Issuer<sp>{}" , timeStampToken . getSID ( ) . getSerialNumber ( ) , timeStampToken . getSID ( ) . getIssuer ( ) ) ; } else { throw new eu . europa . esig . dss . DSSException ( ( ( ( ( "No<sp>retrieved<sp>timestamp<sp>token<sp>(TSP<sp>Status<sp>:<sp>" + statusString ) + "<sp>/<sp>" ) + failInfo ) + ")" ) ) ; } return timeStampToken ; } catch ( org . bouncycastle . tsp . TSPException e ) { throw new eu . europa . esig . dss . DSSException ( "Invalid<sp>TSP<sp>response" , e ) ; } catch ( java . io . IOException e ) { throw new eu . europa . esig . dss . DSSException ( e ) ; } }
org . junit . Assert . assertNotNull ( timeStampResponse )
whenWriteUsingByteSink_thenWritten ( ) { java . lang . String expectedValue = "Hello<sp>world" ; java . io . File file = new java . io . File ( "test.txt" ) ; com . github . mysite . common . guava . ByteSink sink = com . github . mysite . common . guava . Files . asByteSink ( file ) ; sink . write ( expectedValue . getBytes ( ) ) ; java . lang . String result = com . github . mysite . common . guava . Files . toString ( file , Charsets . UTF_8 ) ; "<AssertPlaceHolder>" ; } write ( java . io . OutputStream ) { wb . write ( os ) ; return this ; }
org . junit . Assert . assertEquals ( expectedValue , result )
testReset ( ) { action . reset ( ) ; "<AssertPlaceHolder>" ; } isExecuted ( ) { if ( ( executed ) == null ) { return de . rub . nds . tlsattacker . core . workflow . action . TlsAction . EXECUTED_DEFAULT ; } return executed ; }
org . junit . Assert . assertFalse ( action . isExecuted ( ) )
deletionValidationFail ( ) { org . candlepin . model . User user = new org . candlepin . model . User ( "guy" , "pass" ) ; org . candlepin . service . model . UserInfo created = this . service . createUser ( user ) ; this . service . deleteUser ( user . getUsername ( ) ) ; "<AssertPlaceHolder>" ; } validateUser ( java . lang . String , java . lang . String ) { org . candlepin . model . User user = this . userCurator . findByLogin ( username ) ; java . lang . String hashedPassword = org . candlepin . util . Util . hash ( password ) ; if ( ( ( user != null ) && ( password != null ) ) && ( hashedPassword != null ) ) { return hashedPassword . equals ( user . getHashedPassword ( ) ) ; } return false ; }
org . junit . Assert . assertFalse ( this . service . validateUser ( "guy" , "pass" ) )
writeBean_hasSeveralBindings_singleEvent ( ) { binder . forField ( nameField ) . bind ( Person :: getFirstName , Person :: setFirstName ) ; binder . forField ( ageField ) . withConverter ( new com . vaadin . data . converter . StringToIntegerConverter ( "" ) ) . bind ( Person :: getAge , Person :: setAge ) ; binder . readBean ( item ) ; binder . addStatusChangeListener ( this :: statusChanged ) ; "<AssertPlaceHolder>" ; binder . writeBean ( item ) ; verifyEvent ( ) ; } get ( ) { return com . vaadin . event . dd . acceptcriteria . SourceIsTarget . INSTANCE ; }
org . junit . Assert . assertNull ( event . get ( ) )
testRequestWithWeekETagForPUTOrDELETEIfMatchAllowed ( ) { final org . apache . hc . core5 . http . HttpRequest req = new org . apache . hc . core5 . http . message . BasicHttpRequest ( "PUT" , "http://example.com/" ) ; req . setHeader ( "If-Match" , "W/\"weak\"" ) ; impl = new org . apache . hc . client5 . http . impl . cache . RequestProtocolCompliance ( true ) ; "<AssertPlaceHolder>" ; } requestIsFatallyNonCompliant ( org . apache . hc . core5 . http . HttpRequest ) { final java . util . List < org . apache . hc . client5 . http . impl . cache . RequestProtocolError > theErrors = new java . util . ArrayList ( ) ; org . apache . hc . client5 . http . impl . cache . RequestProtocolError anError = requestHasWeakETagAndRange ( request ) ; if ( anError != null ) { theErrors . add ( anError ) ; } if ( ! ( weakETagOnPutDeleteAllowed ) ) { anError = requestHasWeekETagForPUTOrDELETEIfMatch ( request ) ; if ( anError != null ) { theErrors . add ( anError ) ; } } anError = requestContainsNoCacheDirectiveWithFieldName ( request ) ; if ( anError != null ) { theErrors . add ( anError ) ; } return theErrors ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( ) , impl . requestIsFatallyNonCompliant ( req ) )
testGenerateName_withTwoLength ( ) { final java . lang . String result = nameGenerator . generateName ( 2 ) ; "<AssertPlaceHolder>" ; } generateName ( int ) { if ( length < 2 ) { length = 2 ; } final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; final java . util . concurrent . ThreadLocalRandom rand = java . util . concurrent . ThreadLocalRandom . current ( ) ; while ( ( sb . length ( ) ) < length ) { if ( ( length % 2 ) == 0 ) { sb . append ( vowels [ rand . nextInt ( vowels . length ) ] ) ; } else { sb . append ( consonants [ rand . nextInt ( consonants . length ) ] ) ; } } if ( ( sb . length ( ) ) > length ) { sb . deleteCharAt ( ( ( sb . length ( ) ) - ( ( sb . length ( ) ) - length ) ) ) ; } return capitalizeFirstCharacter ( sb . toString ( ) ) ; }
org . junit . Assert . assertEquals ( 2 , result . length ( ) )
testNullConversion ( ) { "<AssertPlaceHolder>" ; } convertToModel ( java . lang . Enum , java . lang . Class , java . util . Locale ) { if ( value == null ) { return null ; } return value . toString ( ) ; }
org . junit . Assert . assertEquals ( null , converter . convertToModel ( null , java . lang . Enum . class , null ) )
one_$parent_regex_expr_without_case_insensitive_returns_false ( ) { com . redhat . lightblue . query . QueryExpression q = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'field':'field2.$parent.field1','regex':'Val.*'}" ) ; com . redhat . lightblue . eval . QueryEvaluator qe = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( q , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext ctx = qe . evaluate ( jsonDoc ) ; ctx = qe . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
org . junit . Assert . assertFalse ( ctx . getResult ( ) )
testLookup ( ) { final ch . cyberduck . core . Cache < ch . cyberduck . core . transfer . TransferItem > c = new ch . cyberduck . core . ReverseLookupCache < ch . cyberduck . core . transfer . TransferItem > ( new ch . cyberduck . core . TransferItemCache ( 1 ) , 1 ) ; final ch . cyberduck . core . AttributedList < ch . cyberduck . core . transfer . TransferItem > list = new ch . cyberduck . core . AttributedList ( ) ; list . add ( new ch . cyberduck . core . transfer . TransferItem ( new ch . cyberduck . core . Path ( "/r2" , java . util . EnumSet . of ( Path . Type . file ) ) , new ch . cyberduck . core . Local ( "/l2" ) ) ) ; c . put ( new ch . cyberduck . core . transfer . TransferItem ( new ch . cyberduck . core . Path ( "/r" , java . util . EnumSet . of ( Path . Type . directory ) ) , new ch . cyberduck . core . Local ( "/l" ) ) , list ) ; final ch . cyberduck . core . NSObjectTransferItemReference reference = new ch . cyberduck . core . NSObjectTransferItemReference ( ch . cyberduck . core . NSObjectTransferItemReference . get ( new ch . cyberduck . core . Path ( "/r2" , java . util . EnumSet . of ( Path . Type . file ) ) ) ) ; "<AssertPlaceHolder>" ; } lookup ( ch . cyberduck . core . CacheReference ) { return delegate . lookup ( reference ) ; }
org . junit . Assert . assertNotNull ( c . lookup ( reference ) )
testCreateComplexJobTriggerYearlyRecurrences ( ) { "<AssertPlaceHolder>" ; } createComplexJobTriggerYearlyRecurrences ( ) { return new org . pentaho . platform . plugin . services . importexport . exportManifest . bindings . ComplexJobTrigger . YearlyRecurrences ( ) ; }
org . junit . Assert . assertNotNull ( factory . createComplexJobTriggerYearlyRecurrences ( ) )
testAnnotatedMockSingleton ( org . jukito . NoModuleTest$MyAnnotatedMockSingleton , org . jukito . NoModuleTest$MyAnnotatedMockSingleton ) { "<AssertPlaceHolder>" ; a . dummy ( ) ; verify ( a ) . dummy ( ) ; verify ( b ) . dummy ( ) ; }
org . junit . Assert . assertSame ( a , b )
testFastEntrySetEmptyIteratorRemove ( ) { final it . unimi . dsi . fastutil . objects . ObjectSet < it . unimi . dsi . fastutil . ints . Int2IntMap . Entry > entries = m . int2IntEntrySet ( ) ; org . junit . Assume . assumeTrue ( ( entries instanceof it . unimi . dsi . fastutil . ints . Int2IntMap . FastEntrySet ) ) ; final it . unimi . dsi . fastutil . objects . ObjectIterator < it . unimi . dsi . fastutil . ints . Int2IntMap . Entry > iterator = ( ( it . unimi . dsi . fastutil . ints . Int2IntMap . FastEntrySet ) ( entries ) ) . fastIterator ( ) ; "<AssertPlaceHolder>" ; iterator . remove ( ) ; } int2IntEntrySet ( ) { return delegate . int2IntEntrySet ( ) ; }
org . junit . Assert . assertFalse ( iterator . hasNext ( ) )
testRMDownRestoreForJobStatusBeforeGetAMReport ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . yarn . conf . YarnConfiguration ( ) ; conf . setInt ( MRJobConfig . MR_CLIENT_MAX_RETRIES , 3 ) ; conf . set ( MRConfig . FRAMEWORK_NAME , MRConfig . YARN_FRAMEWORK_NAME ) ; conf . setBoolean ( MRJobConfig . JOB_AM_ACCESS_DISABLED , ( ! ( isAMReachableFromClient ) ) ) ; org . apache . hadoop . mapreduce . v2 . api . MRClientProtocol historyServerProxy = mock ( org . apache . hadoop . mapreduce . v2 . api . MRClientProtocol . class ) ; when ( historyServerProxy . getJobReport ( any ( org . apache . hadoop . mapreduce . v2 . api . protocolrecords . GetJobReportRequest . class ) ) ) . thenReturn ( getJobReportResponse ( ) ) ; org . apache . hadoop . mapred . ResourceMgrDelegate rmDelegate = mock ( org . apache . hadoop . mapred . ResourceMgrDelegate . class ) ; try { when ( rmDelegate . getApplicationReport ( jobId . getAppId ( ) ) ) . thenThrow ( new java . lang . reflect . UndeclaredThrowableException ( new java . io . IOException ( "Connection<sp>refuced1" ) ) ) . thenThrow ( new java . lang . reflect . UndeclaredThrowableException ( new java . io . IOException ( "Connection<sp>refuced2" ) ) ) . thenReturn ( getFinishedApplicationReport ( ) ) ; org . apache . hadoop . mapred . ClientServiceDelegate clientServiceDelegate = new org . apache . hadoop . mapred . ClientServiceDelegate ( conf , rmDelegate , oldJobId , historyServerProxy ) ; org . apache . hadoop . mapreduce . JobStatus jobStatus = clientServiceDelegate . getJobStatus ( oldJobId ) ; verify ( rmDelegate , times ( 3 ) ) . getApplicationReport ( any ( org . apache . hadoop . yarn . api . records . ApplicationId . class ) ) ; "<AssertPlaceHolder>" ; } catch ( org . apache . hadoop . yarn . exceptions . YarnException e ) { throw new java . io . IOException ( e ) ; } } getApplicationReport ( org . apache . hadoop . yarn . api . records . ApplicationId ) { org . apache . hadoop . yarn . api . ApplicationClientProtocol client = getClientRMService ( ) ; org . apache . hadoop . yarn . api . protocolrecords . GetApplicationReportResponse response = client . getApplicationReport ( org . apache . hadoop . yarn . api . protocolrecords . GetApplicationReportRequest . newInstance ( appId ) ) ; return response . getApplicationReport ( ) ; }
org . junit . Assert . assertNotNull ( jobStatus )
testURLTitleIsNotUpdatedWhenUpdatingEntryTitle ( ) { com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group , _user . getUserId ( ) ) ; com . liferay . blogs . model . BlogsEntry entry = com . liferay . blogs . service . BlogsEntryLocalServiceUtil . addEntry ( _user . getUserId ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , serviceContext ) ; java . lang . String urlTitle = entry . getUrlTitle ( ) ; entry = com . liferay . blogs . service . BlogsEntryLocalServiceUtil . updateEntry ( _user . getUserId ( ) , entry . getEntryId ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , serviceContext ) ; "<AssertPlaceHolder>" ; } getUrlTitle ( ) { if ( ( _urlTitle ) == null ) { return "" ; } else { return _urlTitle ; } }
org . junit . Assert . assertEquals ( urlTitle , entry . getUrlTitle ( ) )
toOutputStreamImageFormatMatchesOutputFormatForPngWithBufferedImageInput ( ) { java . awt . image . BufferedImage img = new net . coobird . thumbnailator . builders . BufferedImageBuilder ( 200 , 200 ) . build ( ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; net . coobird . thumbnailator . Thumbnails . of ( img ) . size ( 100 , 100 ) . outputFormat ( "png" ) . toOutputStream ( baos ) ; "<AssertPlaceHolder>" ; } getFormatName ( java . io . InputStream ) { return javax . imageio . ImageIO . getImageReaders ( javax . imageio . ImageIO . createImageInputStream ( is ) ) . next ( ) . getFormatName ( ) ; }
org . junit . Assert . assertEquals ( "png" , net . coobird . thumbnailator . TestUtils . getFormatName ( new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ) )
testXml ( ) { final org . esa . beam . visat . actions . masktools . MagicWandModel model = new org . esa . beam . visat . actions . masktools . MagicWandModel ( ) ; model . setTolerance ( 0.005 ) ; model . setMinTolerance ( 0.0 ) ; model . setMaxTolerance ( 0.01 ) ; model . setNormalize ( true ) ; model . setMode ( MagicWandModel . Mode . PLUS ) ; model . addSpectrum ( 1 , 2 , 3 , 4 , 5 , 6 ) ; model . addSpectrum ( 2 , 3 , 4 , 5 , 6 , 7 ) ; model . setMode ( MagicWandModel . Mode . MINUS ) ; model . addSpectrum ( 3 , 4 , 5 , 6 , 7 , 8 ) ; model . addSpectrum ( 4 , 5 , 6 , 7 , 8 , 9 ) ; final java . lang . String xml = model . toXml ( ) ; final org . esa . beam . visat . actions . masktools . MagicWandModel modelCopy = org . esa . beam . visat . actions . masktools . MagicWandModel . fromXml ( xml ) ; "<AssertPlaceHolder>" ; } fromXml ( java . lang . String ) { return ( ( org . esa . beam . visat . actions . masktools . MagicWandModel ) ( org . esa . beam . visat . actions . masktools . MagicWandModel . createXStream ( ) . fromXML ( xml ) ) ) ; }
org . junit . Assert . assertEquals ( model , modelCopy )
primaryShouldBeTrue ( ) { org . w3c . dom . Element itemElement = initialiseElement ( ) ; itemElement . setAttribute ( "primaryKey" , "true" ) ; org . schemaspy . input . dbms . xml . TableColumnMeta tableColumnMeta = new org . schemaspy . input . dbms . xml . TableColumnMeta ( itemElement ) ; "<AssertPlaceHolder>" ; } isPrimary ( ) { if ( ( table . getPrimaryColumns ( ) ) != null ) { return table . getPrimaryColumns ( ) . contains ( this ) ; } return false ; }
org . junit . Assert . assertEquals ( true , tableColumnMeta . isPrimary ( ) )
localizePriceModel_SaveWithNoOperation ( ) { org . oscm . domobjects . Subscription sub = givenSubscription ( ) ; originalLocalization = givenPriceModelLocalization ( null ) ; newLocalization = givenPriceModelLocalization ( "" ) ; localizeService ( sub , originalLocalization , newLocalization ) ; java . util . List < org . oscm . auditlog . model . AuditLogEntry > logEntries = org . oscm . auditlog . AuditLogData . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return org . oscm . auditlog . AuditLogData . auditLogData . get ( ) ; }
org . junit . Assert . assertNull ( logEntries )
executeValidHttpRequest ( ) { byte [ ] inputData = new byte [ ] { 100 , 101 , 102 } ; org . kaaproject . kaa . client . transport . DesktopHttpClient client = new org . kaaproject . kaa . client . transport . DesktopHttpClient ( org . kaaproject . kaa . client . transport . DesktopHttpClientTest . URL , org . kaaproject . kaa . client . transport . DesktopHttpClientTest . privateKey , org . kaaproject . kaa . client . transport . DesktopHttpClientTest . publicKey , org . kaaproject . kaa . client . transport . DesktopHttpClientTest . remotePublicKey ) ; org . apache . http . impl . client . CloseableHttpClient httpClientMock = mockForHttpClient ( org . kaaproject . kaa . client . transport . DesktopHttpClientTest . OK , true , inputData ) ; org . springframework . test . util . ReflectionTestUtils . setField ( client , org . kaaproject . kaa . client . transport . DesktopHttpClientTest . HTTP_CLIENT_FIELD_NAME , httpClientMock ) ; byte [ ] body = client . executeHttpRequest ( org . kaaproject . kaa . client . transport . DesktopHttpClientTest . URL , org . kaaproject . kaa . client . transport . DesktopHttpClientTest . entities , false ) ; "<AssertPlaceHolder>" ; verify ( httpResponse ) . close ( ) ; } executeHttpRequest ( java . lang . String , java . util . LinkedHashMap , boolean ) { byte [ ] responseDataRaw = null ; method = new org . apache . http . client . methods . HttpPost ( ( ( url ) + uri ) ) ; org . apache . http . entity . mime . MultipartEntityBuilder builder = org . apache . http . entity . mime . MultipartEntityBuilder . create ( ) ; for ( java . lang . String key : entity . keySet ( ) ) { builder . addBinaryBody ( key , entity . get ( key ) ) ; } org . apache . http . HttpEntity requestEntity = builder . build ( ) ; method . setEntity ( requestEntity ) ; if ( ! ( java . lang . Thread . currentThread ( ) . isInterrupted ( ) ) ) { org . kaaproject . kaa . client . transport . DesktopHttpClient . LOG . debug ( "Executing<sp>request<sp>{}" , method . getRequestLine ( ) ) ; org . apache . http . client . methods . CloseableHttpResponse response = httpClient . execute ( method ) ; try { org . kaaproject . kaa . client . transport . DesktopHttpClient . LOG . debug ( "Received<sp>{}" , response . getStatusLine ( ) ) ; int status = response . getStatusLine ( ) . getStatusCode ( ) ; if ( ( status >= 200 ) && ( status < 300 ) ) { responseDataRaw = getResponseBody ( response , verifyResponse ) ; } else { throw new org . kaaproject . kaa . client . transport . TransportException ( status ) ; } } finally { response . close ( ) ; method = null ; } } else { method = null ; throw new java . lang . InterruptedException ( ) ; } return responseDataRaw ; }
org . junit . Assert . assertArrayEquals ( inputData , body )
testSearchCount ( ) { int initialCount = com . liferay . dynamic . data . mapping . service . DDMStructureLocalServiceUtil . searchCount ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , new long [ ] { group . getGroupId ( ) } , com . liferay . dynamic . data . mapping . service . test . DDMStructureLocalServiceTest . _classNameId , "Test<sp>Structure" , null , null , DDMStructureConstants . TYPE_DEFAULT , WorkflowConstants . STATUS_APPROVED , false ) ; addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMStructureLocalServiceTest . _classNameId , "Test<sp>Structure" ) ; int count = com . liferay . dynamic . data . mapping . service . DDMStructureLocalServiceUtil . searchCount ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , new long [ ] { group . getGroupId ( ) } , com . liferay . dynamic . data . mapping . service . test . DDMStructureLocalServiceTest . _classNameId , "Test<sp>Structure" , null , null , DDMStructureConstants . TYPE_DEFAULT , WorkflowConstants . STATUS_APPROVED , false ) ; "<AssertPlaceHolder>" ; } getGroupId ( ) { return _groupId ; }
org . junit . Assert . assertEquals ( ( initialCount + 1 ) , count )
testGetByCode ( ) { try { net . magja . model . product . ProductAttribute pa = service . getByCode ( "description" ) ; "<AssertPlaceHolder>" ; } catch ( net . magja . service . ServiceException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } getId ( ) { return id ; }
org . junit . Assert . assertTrue ( ( ( pa . getId ( ) ) != null ) )
generateCertificateNameWithAllParameters ( ) { java . lang . String expectedName = ( ( ( ( loadBalancer . getAccountId ( ) ) + "_" ) + ( loadBalancer . getId ( ) ) ) + "_" ) + ( certMapping . getId ( ) ) ; java . lang . String generatedName = org . openstack . atlas . adapter . helpers . ZxtmNameBuilder . generateCertificateName ( loadBalancer . getId ( ) , loadBalancer . getAccountId ( ) , certMapping . getId ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( expectedName , generatedName )
returnsAllFilesInDirectory ( ) { final java . util . List < java . io . File > files = com . amazonaws . codepipeline . jenkinsplugin . CompressionTools . addFilesToCompress ( testDir , null ) ; "<AssertPlaceHolder>" ; } addFilesToCompress ( java . nio . file . Path , hudson . model . BuildListener ) { final java . util . List < java . io . File > files = new java . util . ArrayList ( ) ; if ( pathToCompress != null ) { java . nio . file . Files . walkFileTree ( pathToCompress , java . util . EnumSet . of ( FileVisitOption . FOLLOW_LINKS ) , Integer . MAX_VALUE , new java . nio . file . SimpleFileVisitor < java . nio . file . Path > ( ) { @ com . amazonaws . codepipeline . jenkinsplugin . Override public java . nio . file . FileVisitResult visitFile ( final java . nio . file . Path file , final java . nio . file . attribute . BasicFileAttributes attrs ) throws java . io . IOException { files . add ( file . toFile ( ) ) ; return java . nio . file . FileVisitResult . CONTINUE ; } @ com . amazonaws . codepipeline . jenkinsplugin . Override public java . nio . file . FileVisitResult visitFileFailed ( final java . nio . file . Path file , final java . io . IOException e ) throws java . io . IOException { if ( e != null ) { com . amazonaws . codepipeline . jenkinsplugin . LoggingHelper . log ( listener , "Failed<sp>to<sp>visit<sp>file<sp>'%s'.<sp>Error:<sp>%s." , file . toString ( ) , e . getMessage ( ) ) ; com . amazonaws . codepipeline . jenkinsplugin . LoggingHelper . log ( listener , e ) ; throw e ; } return java . nio . file . FileVisitResult . CONTINUE ; } } ) ; } return files ; }
org . junit . Assert . assertEquals ( 5 , files . size ( ) )
testAddMember ( ) { org . apache . jackrabbit . api . security . user . User u = new org . apache . jackrabbit . oak . security . user . autosave . UserImpl ( getTestUser ( ) , autosaveMgr ) ; "<AssertPlaceHolder>" ; verify ( dlg , times ( 1 ) ) . addMember ( getTestUser ( ) ) ; verify ( autosaveMgr , times ( 1 ) ) . autosave ( ) ; } addMember ( java . security . Principal ) { if ( isMember ( user ) ) { return false ; } else { throw new java . lang . UnsupportedOperationException ( "Adding<sp>members<sp>to<sp>external<sp>group<sp>principals<sp>is<sp>not<sp>supported." ) ; } }
org . junit . Assert . assertTrue ( group . addMember ( u ) )
test ( ) { "<AssertPlaceHolder>" ; } loadVisibilityManagement ( ) { java . util . Iterator < org . locationtech . geowave . adapter . vector . plugin . visibility . ColumnVisibilityManagementSpi > managers = new org . locationtech . geowave . core . index . SPIServiceRegistry ( org . locationtech . geowave . adapter . vector . plugin . visibility . VisibilityManagementHelper . class ) . load ( org . locationtech . geowave . adapter . vector . plugin . visibility . ColumnVisibilityManagementSpi . class ) ; if ( ! ( managers . hasNext ( ) ) ) return new org . locationtech . geowave . adapter . vector . plugin . visibility . JsonDefinitionColumnVisibilityManagement < T > ( ) ; return ( ( org . locationtech . geowave . adapter . vector . plugin . visibility . ColumnVisibilityManagementSpi < T > ) ( managers . next ( ) ) ) ; }
org . junit . Assert . assertNotNull ( org . locationtech . geowave . adapter . vector . plugin . visibility . VisibilityManagementHelper . loadVisibilityManagement ( ) )
deveObterUFComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroSituacaoCadastral retorno = new com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroSituacaoCadastral ( ) ; retorno . setUf ( DFUnidadeFederativa . SC ) ; "<AssertPlaceHolder>" ; } getUf ( ) { return this . uf ; }
org . junit . Assert . assertEquals ( DFUnidadeFederativa . SC , retorno . getUf ( ) )
selectUnique ( ) { super . selectUnique ( ) ; org . eclipse . collections . api . bag . ImmutableBag < java . lang . String > bag = this . newBag ( ) ; org . eclipse . collections . api . set . ImmutableSet < java . lang . String > expected = Sets . immutable . empty ( ) ; org . eclipse . collections . api . set . ImmutableSet < java . lang . String > actual = bag . selectUnique ( ) ; "<AssertPlaceHolder>" ; } selectUnique ( ) { org . eclipse . collections . api . bag . MutableBag < java . lang . String > bag = this . newWith ( "0" , "1" , "1" , "1" , "1" , "2" , "2" , "2" , "3" , "3" , "4" , "5" ) ; org . eclipse . collections . api . set . MutableSet < java . lang . String > expected = Sets . mutable . with ( "0" , "4" , "5" ) ; org . eclipse . collections . api . set . MutableSet < java . lang . String > actual = bag . selectUnique ( ) ; org . junit . Assert . assertEquals ( expected , actual ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testUnionFindStream ( ) { org . neo4j . graphdb . Result result = org . neo4j . graphalgo . algo . EmptyGraphIntegrationTest . db . execute ( ( ( "CALL<sp>algo.unionFind.stream('',<sp>'',{graph:'" + ( graphImpl ) ) + "'})" ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( offset ) < ( nodeCount ) ; }
org . junit . Assert . assertFalse ( result . hasNext ( ) )
testDefaultCluster ( ) { java . lang . String className = "testDefaultCluster" ; com . orientechnologies . orient . core . metadata . schema . OSchema schema = com . orientechnologies . orient . core . sql . executor . OAlterClassStatementExecutionTest . db . getMetadata ( ) . getSchema ( ) ; com . orientechnologies . orient . core . metadata . schema . OClass clazz = schema . createClass ( className ) ; int [ ] clusterIds = clazz . getClusterIds ( ) ; if ( ( clusterIds . length ) < 2 ) { clazz . addCluster ( ( className + "_1" ) ) ; clusterIds = clazz . getClusterIds ( ) ; } int currentDefault = clazz . getDefaultClusterId ( ) ; int firstNonDefault = - 1 ; for ( int clusterId : clusterIds ) { if ( clusterId != currentDefault ) { firstNonDefault = clusterId ; } } try { com . orientechnologies . orient . core . sql . executor . OAlterClassStatementExecutionTest . db . command ( ( ( ( "alter<sp>class<sp>" + className ) + "<sp>defaultcluster<sp>" ) + firstNonDefault ) ) . close ( ) ; } catch ( com . orientechnologies . orient . core . exception . OCommandExecutionException ex ) { } schema . reload ( ) ; "<AssertPlaceHolder>" ; } getClass ( java . lang . Class ) { if ( iClass == null ) return null ; return getClass ( iClass . getSimpleName ( ) ) ; }
org . junit . Assert . assertEquals ( firstNonDefault , schema . getClass ( className ) . getDefaultClusterId ( ) )
testSet ( ) { java . util . regex . Matcher m = StatementImpl . SET_STATEMENT . matcher ( "set<sp>foo<sp>to<sp>1" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( m . matches ( ) )
testGetPatternFinderFunctionStringEListOfCharactersMappingCase1 ( ) { java . lang . String expectedResult = "TRANSLATE(name<sp>,<sp>\'abcdefghijklmnopqrstuvwxyzçâêîôûéèùïöüABCDEFGHIJKLMNOPQRSTUVWXYZÇÂÊÎÔÛÉÈÙÏÖÜ0123456789Netezza\'<sp>,<sp>\'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9999999999Netezza\')" ; org . talend . dq . dbms . NetezzaDbmsLanguage netezzaDbmsLanguage = ( ( org . talend . dq . dbms . NetezzaDbmsLanguage ) ( org . talend . dq . dbms . DbmsLanguageFactory . createDbmsLanguage ( SupportDBUrlType . NETEZZADEFAULTURL ) ) ) ; org . talend . dataquality . indicators . definition . IndicatorDefinition createIndicatorDefinition = DefinitionFactory . eINSTANCE . createIndicatorDefinition ( ) ; org . eclipse . emf . common . util . EList < org . talend . dataquality . indicators . definition . CharactersMapping > charactersMapping = createIndicatorDefinition . getCharactersMapping ( ) ; org . talend . dataquality . indicators . definition . CharactersMapping createCharactersMapping = DefinitionFactory . eINSTANCE . createCharactersMapping ( ) ; createCharactersMapping . setLanguage ( SupportDBUrlType . MYSQLDEFAULTURL . getLanguage ( ) ) ; createCharactersMapping . setCharactersToReplace ( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789MySql" ) ; createCharactersMapping . setReplacementCharacters ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9999999999MySql" ) ; charactersMapping . add ( createCharactersMapping ) ; createCharactersMapping . setLanguage ( DbmsLanguage . SQL ) ; createCharactersMapping . setCharactersToReplace ( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789Default" ) ; createCharactersMapping . setReplacementCharacters ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9999999999Default" ) ; charactersMapping . add ( createCharactersMapping ) ; createCharactersMapping . setLanguage ( SupportDBUrlType . NETEZZADEFAULTURL . getLanguage ( ) ) ; createCharactersMapping . setCharactersToReplace ( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789Netezza" ) ; createCharactersMapping . setReplacementCharacters ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9999999999Netezza" ) ; charactersMapping . add ( createCharactersMapping ) ; java . lang . String patternFinderFunction = netezzaDbmsLanguage . getPatternFinderFunction ( "name" , charactersMapping ) ; "<AssertPlaceHolder>" ; } getPatternFinderFunction ( java . lang . String , org . eclipse . emf . common . util . EList ) { org . talend . dataquality . indicators . definition . CharactersMapping charactersMap = adaptCharactersMapping ( charactersMapping ) ; if ( charactersMap == null ) { return null ; } return this . getPatternFinderFunction ( colName , charactersMap . getCharactersToReplace ( ) , charactersMap . getReplacementCharacters ( ) ) ; }
org . junit . Assert . assertEquals ( expectedResult , patternFinderFunction )
testWriteToFile ( ) { logger . warn ( "Test<sp>writeToFile<sp>.." ) ; java . lang . String fileDir = null ; java . lang . String filename = "evidence.txt" ; java . lang . Boolean deleteFile = false ; instance . writeToFile ( evidences , fileDir , filename , deleteFile ) ; java . lang . String userHome = java . lang . System . getProperty ( "user.home" ) ; java . lang . String filePath = ( fileDir + "/" ) + filename ; if ( org . springframework . util . StringUtils . isEmpty ( fileDir ) ) { filePath = ( userHome + "/" ) + filename ; } java . io . File file = new java . io . File ( filePath ) ; "<AssertPlaceHolder>" ; try { if ( file . isFile ( ) ) { java . nio . file . Path path = java . nio . file . Paths . get ( filePath ) ; java . nio . file . Files . deleteIfExists ( path ) ; } } catch ( java . io . IOException ex ) { logger . error ( ex ) ; } } writeToFile ( java . util . List , java . lang . String , java . lang . String , java . lang . Boolean ) { java . util . List < java . lang . String > dataList = new java . util . concurrent . CopyOnWriteArrayList ( ) ; enzymeEvidences . stream ( ) . map ( ( ev ) -> { java . lang . String acc = ev . getAccession ( ) ; java . lang . String evidence = ev . getEvidenceLine ( ) ; return ( ( "Accession<sp>:<sp>" + acc ) + "<sp>:<sp>EvidenType<sp>:<sp>" ) + evidence ; } ) . forEach ( ( data ) -> dataList . add ( data ) ) ; if ( ! ( uk . ac . ebi . biobabel . util . StringUtil . isNullOrEmpty ( fileDir ) ) ) { createDirAndFile ( dataList , fileDir , filename , deleteFile ) ; } else { createFile ( dataList , filename , deleteFile ) ; } }
org . junit . Assert . assertTrue ( file . isFile ( ) )
test ( ) { uk . me . rkd . jsipp . runtime . Scheduler sched = new uk . me . rkd . jsipp . runtime . Scheduler ( 50 ) ; uk . me . rkd . jsipp . compiler . Scenario uasScenario = uk . me . rkd . jsipp . compiler . Scenario . fromXMLFilename ( "resources/message-uas.xml" ) ; uk . me . rkd . jsipp . compiler . Scenario uacScenario = uk . me . rkd . jsipp . compiler . Scenario . fromXMLFilename ( "resources/message.xml" ) ; uk . me . rkd . jsipp . runtime . network . SocketManager uasSM = new uk . me . rkd . jsipp . runtime . network . TCPMultiplexingSocketManager ( null , 0 , 0 ) ; java . net . InetSocketAddress bindAddr = new java . net . InetSocketAddress ( "127.0.0.1" , 15060 ) ; uasSM . setListener ( bindAddr ) ; uk . me . rkd . jsipp . runtime . network . SocketManager uacSM = new uk . me . rkd . jsipp . runtime . network . TCPMultiplexingSocketManager ( "127.0.0.1" , 15060 , 1 ) ; uk . me . rkd . jsipp . runtime . CallOpeningTask opentask = uk . me . rkd . jsipp . runtime . CallOpeningTask . getInstance ( uasScenario , uasSM , 0 , sched . getTimer ( ) ) ; uasSM . start ( ) ; uacSM . start ( ) ; uk . me . rkd . jsipp . runtime . Call call = new uk . me . rkd . jsipp . runtime . Call ( 8 , "uac1" , "Test<sp>Scenario" , uacScenario . phases ( ) , uacSM , sched . getTimer ( ) ) ; call . registerSocket ( ) ; sched . getTimer ( ) . newTimeout ( call , 10 , TimeUnit . MILLISECONDS ) ; java . lang . Thread . sleep ( 1000 ) ; "<AssertPlaceHolder>" ; opentask . stop ( ) ; uk . me . rkd . jsipp . runtime . CallOpeningTask . reset ( ) ; sched . stop ( ) ; } hasCompleted ( ) { return ( this . phaseIndex ) >= ( this . phases . size ( ) ) ; }
org . junit . Assert . assertTrue ( call . hasCompleted ( ) )
convertToDoubleNull ( ) { java . lang . Boolean t = null ; java . lang . Double d = converter . toDouble ( t ) ; "<AssertPlaceHolder>" ; } toDouble ( java . lang . Long ) { if ( value == null ) { return null ; } return value . doubleValue ( ) ; }
org . junit . Assert . assertNull ( d )
useTsConfigInsteadOfFileList_returnsTrue_ifPathToTsConfigSet ( ) { com . pablissimo . sonar . TsLintExecutorConfig config = getNewConfig ( ) ; config . setPathToTsConfig ( "My<sp>path" ) ; "<AssertPlaceHolder>" ; } useTsConfigInsteadOfFileList ( ) { return ( ( this . pathToTsConfig ) != null ) && ( ! ( this . pathToTsConfig . isEmpty ( ) ) ) ; }
org . junit . Assert . assertTrue ( config . useTsConfigInsteadOfFileList ( ) )
testInvalidCapacityZero ( ) { backingStore . close ( ) ; java . io . File checkpoint = backingStoreSupplier . getCheckpoint ( ) ; "<AssertPlaceHolder>" ; backingStore = new org . apache . flume . channel . file . EventQueueBackingStoreFileV2 ( checkpoint , 0 , "test" , new org . apache . flume . channel . file . instrumentation . FileChannelCounter ( "test" ) ) ; queue = new org . apache . flume . channel . file . FlumeEventQueue ( backingStore , backingStoreSupplier . getInflightTakes ( ) , backingStoreSupplier . getInflightPuts ( ) , backingStoreSupplier . getQueueSetDir ( ) ) ; } delete ( ) { org . apache . commons . io . FileUtils . deleteQuietly ( baseDir ) ; }
org . junit . Assert . assertTrue ( checkpoint . delete ( ) )
writeEmptyComponent ( ) { java . io . StringWriter sw = new java . io . StringWriter ( ) ; biweekly . io . json . JCalRawWriter writer = new biweekly . io . json . JCalRawWriter ( sw , false ) ; writer . writeStartComponent ( "comp" ) ; writer . close ( ) ; java . lang . String actual = sw . toString ( ) ; java . lang . String expected = "[\"comp\"," + ( ( ( ( "[" + "]," ) + "[" ) + "]" ) + "]" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return getValue ( ICalVersion . V2_0 ) ; }
org . junit . Assert . assertEquals ( expected , actual )
add ( ) { final org . milyn . container . MockApplicationContext context = new org . milyn . container . MockApplicationContext ( ) ; final org . milyn . rules . RuleProviderAccessorTest . MockProvider provider = new org . milyn . rules . RuleProviderAccessorTest . MockProvider ( ) ; org . milyn . rules . RuleProviderAccessor . add ( context , provider ) ; "<AssertPlaceHolder>" ; } getRuleProviders ( org . milyn . container . ApplicationContext ) { return ( ( java . util . Map < java . lang . String , org . milyn . rules . RuleProvider > ) ( context . getAttribute ( org . milyn . rules . RuleProvider . class ) ) ) ; }
org . junit . Assert . assertNotNull ( org . milyn . rules . RuleProviderAccessor . getRuleProviders ( context ) )
equalityOfNodeTypeIds ( ) { org . eclipse . winery . common . ids . definitions . NodeTypeId id1 = new org . eclipse . winery . common . ids . definitions . NodeTypeId ( "ns1" , "id1" , false ) ; org . eclipse . winery . common . ids . definitions . NodeTypeId id2 = new org . eclipse . winery . common . ids . definitions . NodeTypeId ( "ns1" , "id1" , false ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( id1 , id2 )
testTopIndex_ValueOutOfBounds ( ) { org . eclipse . swt . widgets . Table_Test . createTableItems ( table , 5 ) ; int previousTopIndex = table . getTopIndex ( ) ; table . setTopIndex ( 10000 ) ; "<AssertPlaceHolder>" ; } getTopIndex ( ) { checkWidget ( ) ; if ( ( topIndex ) == ( - 1 ) ) { updateScrollBars ( ) ; if ( vScroll . getVisible ( ) ) { int firstVisibleIndex = vScroll . getSelection ( ) ; if ( isTree ) { java . util . Iterator < org . eclipse . nebula . widgets . grid . GridItem > iterator = items . iterator ( ) ; int row = firstVisibleIndex + 1 ; while ( ( row > 0 ) && ( iterator . hasNext ( ) ) ) { org . eclipse . nebula . widgets . grid . GridItem item = iterator . next ( ) ; if ( item . isVisible ( ) ) { row -- ; if ( row == 0 ) { firstVisibleIndex = items . indexOf ( item ) ; } } } } topIndex = firstVisibleIndex ; } else { topIndex = 0 ; } } return topIndex ; }
org . junit . Assert . assertEquals ( previousTopIndex , table . getTopIndex ( ) )
testGetEmptyRestrictions ( ) { javax . jcr . Value [ ] vs = createEntry ( java . util . Collections . < org . apache . jackrabbit . oak . spi . security . authorization . restriction . Restriction > emptySet ( ) ) . getRestrictions ( AccessControlConstants . REP_GLOB ) ; "<AssertPlaceHolder>" ; } getRestrictions ( java . lang . String ) { return null ; }
org . junit . Assert . assertNull ( vs )
testMath340 ( ) { org . hipparchus . fraction . BigFraction fractionA = new org . hipparchus . fraction . BigFraction ( 0.00131 ) ; org . hipparchus . fraction . BigFraction fractionB = new org . hipparchus . fraction . BigFraction ( 0.37 ) . reciprocal ( ) ; org . hipparchus . fraction . BigFraction errorResult = fractionA . multiply ( fractionB ) ; org . hipparchus . fraction . BigFraction correctResult = new org . hipparchus . fraction . BigFraction ( fractionA . getNumerator ( ) . multiply ( fractionB . getNumerator ( ) ) , fractionA . getDenominator ( ) . multiply ( fractionB . getDenominator ( ) ) ) ; "<AssertPlaceHolder>" ; } getDenominator ( ) { return denominator ; }
org . junit . Assert . assertEquals ( correctResult , errorResult )
testMetadataPickedUp ( ) { try ( org . jboss . windup . graph . GraphContext context = contextFactory . create ( true ) ) { org . jboss . windup . exec . configuration . WindupConfiguration windupConfig = new org . jboss . windup . exec . configuration . WindupConfiguration ( ) ; windupConfig . setGraphContext ( context ) ; windupConfig . setRuleProviderFilter ( new org . jboss . windup . engine . predicates . RuleProviderWithDependenciesPredicate ( org . jboss . windup . config . metadata . MetadataTestRuleProvider4 . class ) ) ; windupConfig . addInputPath ( java . nio . file . Paths . get ( "src/test/resources/empty.war" ) ) ; windupConfig . setOutputDirectory ( java . nio . file . Paths . get ( "target/WindupReport" ) ) ; processor . execute ( windupConfig ) ; "<AssertPlaceHolder>" ; } } getProviders ( ) { return org . jboss . windup . config . metadata . ExecutedProviders . providers ; }
org . junit . Assert . assertEquals ( 3 , org . jboss . windup . config . metadata . ExecutedProviders . getProviders ( ) . size ( ) )
testRunPipelineNotRunning ( ) { com . streamsets . datacollector . config . PipelineConfiguration pipelineConf = com . streamsets . datacollector . runner . MockStages . createPipelineConfigurationComplexSourceProcessorTarget ( ) ; com . streamsets . datacollector . main . RuntimeInfo runtimeInfo = org . mockito . Mockito . mock ( com . streamsets . datacollector . main . RuntimeInfo . class ) ; com . streamsets . datacollector . execution . Runner runner = org . mockito . Mockito . mock ( com . streamsets . datacollector . execution . Runner . class ) ; org . mockito . Mockito . when ( runner . getToken ( ) ) . thenReturn ( "hello" ) ; com . streamsets . datacollector . util . Configuration conf = new com . streamsets . datacollector . util . Configuration ( ) ; com . streamsets . datacollector . execution . PipelineState state = org . mockito . Mockito . mock ( com . streamsets . datacollector . execution . PipelineState . class ) ; org . mockito . Mockito . when ( state . getStatus ( ) ) . thenReturn ( PipelineStatus . STOPPED ) ; org . mockito . Mockito . when ( runner . getState ( ) ) . thenReturn ( state ) ; com . streamsets . datacollector . updatechecker . UpdateChecker checker = new com . streamsets . datacollector . updatechecker . UpdateChecker ( runtimeInfo , conf , pipelineConf , runner ) ; checker . run ( ) ; java . util . Map updateInfo = checker . getUpdateInfo ( ) ; "<AssertPlaceHolder>" ; } getUpdateInfo ( ) { return updateInfo ; }
org . junit . Assert . assertNull ( updateInfo )
readerTurnsCorrectlyNotWellFormattedValueInDictionary_01 ( ) { java . lang . String inPath = ( com . itextpdf . kernel . pdf . PdfDictionaryTokenizerTest . sourceFolder ) + "documentWithMalformedNumberOnDictionary.pdf" ; java . lang . String EXPECTED = "-12." ; java . lang . String result = getItalicAngleValue ( inPath ) ; "<AssertPlaceHolder>" ; } getItalicAngleValue ( java . lang . String ) { java . lang . String result = "" ; com . itextpdf . kernel . pdf . PdfReader pdfR = new com . itextpdf . kernel . pdf . PdfReader ( inPath ) ; com . itextpdf . kernel . pdf . PdfDocument attachmentPDF = new com . itextpdf . kernel . pdf . PdfDocument ( pdfR ) ; int max = attachmentPDF . getNumberOfPdfObjects ( ) ; for ( int i = 0 ; i < max ; i ++ ) { com . itextpdf . kernel . pdf . PdfObject obj = attachmentPDF . getPdfObject ( i ) ; if ( obj != null ) { com . itextpdf . kernel . pdf . PdfDictionary pdfDict = ( ( com . itextpdf . kernel . pdf . PdfDictionary ) ( obj ) ) ; com . itextpdf . kernel . pdf . PdfObject x = pdfDict . get ( PdfName . Type ) ; if ( ( x != null ) && ( x . equals ( PdfName . FontDescriptor ) ) ) { com . itextpdf . kernel . pdf . PdfObject italicAngle = pdfDict . get ( PdfName . ItalicAngle ) ; result = italicAngle . toString ( ) ; } } } attachmentPDF . close ( ) ; return result ; }
org . junit . Assert . assertEquals ( EXPECTED , result )
testGetByCode ( ) { char code1 = 's' ; char code2 = 'a' ; char code3 = 'b' ; org . oscarehr . common . model . ScheduleTemplateCode scheduleTempCode1 = new org . oscarehr . common . model . ScheduleTemplateCode ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( scheduleTempCode1 ) ; scheduleTempCode1 . setCode ( code1 ) ; dao . persist ( scheduleTempCode1 ) ; org . oscarehr . common . model . ScheduleTemplateCode scheduleTempCode2 = new org . oscarehr . common . model . ScheduleTemplateCode ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( scheduleTempCode2 ) ; scheduleTempCode2 . setCode ( code2 ) ; dao . persist ( scheduleTempCode2 ) ; org . oscarehr . common . model . ScheduleTemplateCode scheduleTempCode3 = new org . oscarehr . common . model . ScheduleTemplateCode ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( scheduleTempCode3 ) ; scheduleTempCode3 . setCode ( code3 ) ; dao . persist ( scheduleTempCode3 ) ; org . oscarehr . common . model . ScheduleTemplateCode expectedResult = scheduleTempCode2 ; org . oscarehr . common . model . ScheduleTemplateCode result = dao . getByCode ( code2 ) ; "<AssertPlaceHolder>" ; } getByCode ( char ) { javax . persistence . Query query = entityManager . createQuery ( "select<sp>s<sp>from<sp>ScheduleTemplateCode<sp>s<sp>where<sp>s.code=?" ) ; query . setParameter ( 1 , code ) ; @ org . oscarehr . common . dao . SuppressWarnings ( "unchecked" ) java . util . List < org . oscarehr . common . model . ScheduleTemplateCode > results = query . getResultList ( ) ; if ( ! ( results . isEmpty ( ) ) ) { return results . get ( 0 ) ; } return null ; }
org . junit . Assert . assertEquals ( expectedResult , result )
isEnabledReturnsFalseForFalseSetting ( ) { this . parameters . put ( "enabled" , "false" ) ; org . phenotips . configuration . RecordElement s = new org . phenotips . configuration . spi . UIXRecordElement ( this . uiExtension , this . recordSection ) ; "<AssertPlaceHolder>" ; } isEnabled ( ) { return this . enabled ; }
org . junit . Assert . assertFalse ( s . isEnabled ( ) )
testThrowableCtor ( ) { java . lang . Throwable t = mock ( java . lang . Throwable . class ) ; exception = new org . pentaho . di . core . lifecycle . LifecycleException ( t , true ) ; "<AssertPlaceHolder>" ; } getCause ( ) { return cause ; }
org . junit . Assert . assertEquals ( t , exception . getCause ( ) )
shouldReportInitialStateAsPopulatingIfPopulationStartedButIncomplete ( ) { provider = newProvider ( ) ; org . neo4j . kernel . api . index . IndexPopulator populator = provider . getPopulator ( descriptor ( ) , samplingConfig ( ) ) ; populator . create ( ) ; org . neo4j . internal . kernel . api . InternalIndexState state = provider . getInitialState ( descriptor ( ) ) ; "<AssertPlaceHolder>" ; populator . close ( true ) ; } getInitialState ( org . neo4j . storageengine . api . schema . StoreIndexDescriptor ) { org . neo4j . kernel . api . impl . index . storage . PartitionedIndexStorage indexStorage = getIndexStorage ( descriptor . getId ( ) ) ; java . lang . String failure = indexStorage . getStoredIndexFailure ( ) ; if ( failure != null ) { return org . neo4j . internal . kernel . api . InternalIndexState . FAILED ; } try { return indexIsOnline ( indexStorage , descriptor ) ? org . neo4j . internal . kernel . api . InternalIndexState . ONLINE : org . neo4j . internal . kernel . api . InternalIndexState . POPULATING ; } catch ( java . io . IOException e ) { return org . neo4j . internal . kernel . api . InternalIndexState . POPULATING ; } }
org . junit . Assert . assertEquals ( InternalIndexState . POPULATING , state )
testUpdateBucketAllocationPercentage ( ) { com . intuit . wasabi . experimentobjects . Bucket bucket = mock ( com . intuit . wasabi . experimentobjects . Bucket . class , com . intuit . wasabi . repository . database . RETURNS_DEEP_STUBS ) ; when ( transaction . update ( anyString ( ) , org . mockito . Matchers . anyVararg ( ) ) ) . thenReturn ( 1 ) ; com . intuit . wasabi . experimentobjects . Bucket result = repository . updateBucketAllocationPercentage ( bucket , 1.0 ) ; "<AssertPlaceHolder>" ; } updateBucketAllocationPercentage ( com . intuit . wasabi . experimentobjects . Bucket , java . lang . Double ) { final java . lang . String SQL = "update<sp>bucket<sp>" + ( "set<sp>allocation_percent=?<sp>" + "where<sp>experiment_id=?<sp>and<sp>label=?" ) ; newTransaction ( ) . update ( SQL , desiredAllocationPercentage . toString ( ) , bucket . getExperimentID ( ) , bucket . getLabel ( ) . toString ( ) ) ; return bucket ; }
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( bucket ) )
testNewPipeline ( ) { org . guvnor . ala . pipeline . PipelineConfig pipelineConfig = mock ( org . guvnor . ala . pipeline . PipelineConfig . class ) ; when ( pipelineService . newPipeline ( pipelineConfig ) ) . thenReturn ( org . guvnor . ala . services . backend . impl . PipelineServiceBackendImplTest . PIPELINE_NAME ) ; java . lang . String result = pipelineServiceBackend . newPipeline ( pipelineConfig ) ; verify ( pipelineService , times ( 1 ) ) . newPipeline ( pipelineConfig ) ; "<AssertPlaceHolder>" ; } newPipeline ( org . guvnor . ala . pipeline . PipelineConfig ) { return pipelineService . newPipeline ( config ) ; }
org . junit . Assert . assertEquals ( org . guvnor . ala . services . backend . impl . PipelineServiceBackendImplTest . PIPELINE_NAME , result )
getMessageFromReceiverLinkNotAuthenticating ( ) { final java . lang . String linkName = "linkName" ; final java . lang . String propertyKey = "status-code" ; final java . lang . Integer propertyValue = 200 ; final java . util . List < java . util . UUID > cbsCorrelationIdList = java . util . Collections . synchronizedList ( new java . util . ArrayList < java . util . UUID > ( ) ) ; cbsCorrelationIdList . add ( mockUUID ) ; final tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsSessionDeviceOperation amqpsSessionDeviceOperation = new tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsSessionDeviceOperation ( mockDeviceClientConfig , mockAmqpsDeviceAuthentication ) ; mockit . Deencapsulation . setField ( amqpsSessionDeviceOperation , "amqpsAuthenticatorState" , AmqpsDeviceAuthenticationState . UNKNOWN ) ; java . util . ArrayList < tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsDeviceOperations > operationList = new java . util . ArrayList ( ) ; operationList . add ( mockAmqpsDeviceTelemetry ) ; mockit . Deencapsulation . setField ( amqpsSessionDeviceOperation , "amqpsDeviceOperationsList" , operationList ) ; new mockit . NonStrictExpectations ( ) { { mockit . Deencapsulation . invoke ( mockAmqpsDeviceTelemetry , "getMessageFromReceiverLink" , linkName ) ; result = mockAmqpsMessage ; } } ; tests . unit . com . microsoft . azure . sdk . iot . device . transport . amqps . AmqpsMessage actualAmqpsMessage = mockit . Deencapsulation . invoke ( amqpsSessionDeviceOperation , "getMessageFromReceiverLink" , linkName ) ; "<AssertPlaceHolder>" ; new mockit . Verifications ( ) { { mockit . Deencapsulation . invoke ( mockAmqpsDeviceTelemetry , "getMessageFromReceiverLink" , linkName ) ; times = 1 ; } } ; }
org . junit . Assert . assertEquals ( actualAmqpsMessage , mockAmqpsMessage )
testGetELResolver ( ) { replay ( resolver ) ; "<AssertPlaceHolder>" ; verify ( resolver ) ; } getELResolver ( ) { return this . resolver ; }
org . junit . Assert . assertEquals ( resolver , context . getELResolver ( ) )
testIndexReload ( ) { final com . orientechnologies . orient . core . record . impl . ODocument docToStore = propertyIndex . toStream ( ) ; final com . orientechnologies . orient . core . index . OPropertyIndexDefinition result = new com . orientechnologies . orient . core . index . OPropertyIndexDefinition ( ) ; result . fromStream ( docToStore ) ; "<AssertPlaceHolder>" ; } fromStream ( com . orientechnologies . orient . enterprise . channel . binary . OChannelDataInput ) { com . orientechnologies . orient . core . serialization . serializer . record . binary . BytesContainer bytes = new com . orientechnologies . orient . core . serialization . serializer . record . binary . BytesContainer ( ) ; bytes . bytes = channel . readBytes ( ) ; return this . deserialize ( bytes ) ; }
org . junit . Assert . assertEquals ( result , propertyIndex )
getgid ( ) { "<AssertPlaceHolder>" ; } getgid ( ) { org . junit . Assert . assertEquals ( "Java<sp>posix<sp>did<sp>not<sp>return<sp>same<sp>value<sp>as<sp>native<sp>posix" , jnr . posix . IDTest . nativePosix . getgid ( ) , jnr . posix . IDTest . javaPosix . getgid ( ) ) ; }
org . junit . Assert . assertEquals ( "Java<sp>posix<sp>did<sp>not<sp>return<sp>same<sp>value<sp>as<sp>native<sp>posix" , jnr . posix . IDTest . nativePosix . getgid ( ) , jnr . posix . IDTest . javaPosix . getgid ( ) )
test ( ) { hivemall . sketch . bloom . BloomNotUDF udf = new hivemall . sketch . bloom . BloomNotUDF ( ) ; org . apache . hadoop . util . bloom . DynamicBloomFilter bf1 = hivemall . sketch . bloom . BloomNotUDFTest . createBloomFilter ( 1L , 10000 ) ; org . apache . hadoop . io . Text bf1str = hivemall . sketch . bloom . BloomFilterUtils . serialize ( bf1 , new org . apache . hadoop . io . Text ( ) ) ; org . apache . hadoop . io . Text result = udf . evaluate ( bf1str ) ; org . apache . hadoop . util . bloom . DynamicBloomFilter actual = hivemall . sketch . bloom . BloomFilterUtils . deserialize ( result , new org . apache . hadoop . util . bloom . DynamicBloomFilter ( ) ) ; bf1 . not ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "[port=" + ( port ) ) + ",<sp>numWorkers=" ) + ( numWorkers ) ) + ",<sp>ssl=" ) + ( ssl ) ) + ",<sp>scale=" ) + ( scale ) ) + ",<sp>syncThreshold=" ) + ( syncThreshold ) ) + ",<sp>sessionTTLinSec=" ) + ( sessionTTLinSec ) ) + ",<sp>sweepIntervalInSec=" ) + ( sweepIntervalInSec ) ) + ",<sp>jmx=" ) + ( jmx ) ) + ",<sp>state=" ) + ( state ) ) + "]" ; }
org . junit . Assert . assertEquals ( bf1 . toString ( ) , actual . toString ( ) )
testEquals_instance ( ) { "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; final net . ripe . db . whois . query . QueryParser that = ( ( net . ripe . db . whois . query . QueryParser ) ( o ) ) ; return java . util . Objects . equals ( originalStringQuery , that . originalStringQuery ) ; }
org . junit . Assert . assertThat ( subject . equals ( subject ) , org . hamcrest . Matchers . is ( true ) )
editEventPrice_samePrice ( ) { org . oscm . domobjects . PricedEvent pricedEvent = new org . oscm . domobjects . PricedEvent ( ) ; pricedEvent . setEventPrice ( BigDecimal . TEN ) ; org . oscm . serviceprovisioningservice . auditlog . PriceModelAuditLogCollector_EditEventPricesTest . logCollector . editEventPrice ( org . oscm . serviceprovisioningservice . auditlog . PriceModelAuditLogCollector_EditEventPricesTest . dsMock , pricedEvent , BigDecimal . TEN ) ; "<AssertPlaceHolder>" ; } auditLogDataIsEmpty ( ) { return ( ( org . oscm . auditlog . AuditLogData . get ( ) ) == null ) || ( org . oscm . auditlog . AuditLogData . get ( ) . isEmpty ( ) ) ; }
org . junit . Assert . assertTrue ( auditLogDataIsEmpty ( ) )
testUnification_EXACT_BinaryRelationWithTypes_SomeVarsHaveTypes_UnifierMatchesTypes ( ) { try ( grakn . core . server . session . TransactionOLTP tx = grakn . core . graql . reasoner . query . AtomicQueryUnificationIT . unificationWithTypesSession . transaction ( ) . read ( ) ) { grakn . core . graql . reasoner . query . ReasonerAtomicQuery parentQuery = grakn . core . graql . reasoner . query . ReasonerQueries . atomic ( conjunction ( "{<sp>$x1<sp>isa<sp>twoRoleEntity;($x1,<sp>$x2)<sp>isa<sp>binary;<sp>};" ) , tx ) ; grakn . core . graql . reasoner . query . ReasonerAtomicQuery childQuery = grakn . core . graql . reasoner . query . ReasonerQueries . atomic ( conjunction ( "{<sp>$y1<sp>isa<sp>twoRoleEntity;($y1,<sp>$y2)<sp>isa<sp>binary;<sp>};" ) , tx ) ; grakn . core . graql . reasoner . unifier . MultiUnifier unifier = childQuery . getMultiUnifier ( parentQuery ) ; grakn . core . graql . reasoner . unifier . MultiUnifier correctUnifier = new grakn . core . graql . reasoner . unifier . MultiUnifierImpl ( com . google . common . collect . ImmutableMultimap . of ( new graql . lang . statement . Variable ( "y1" ) , new graql . lang . statement . Variable ( "x1" ) , new graql . lang . statement . Variable ( "y2" ) , new graql . lang . statement . Variable ( "x2" ) ) ) ; "<AssertPlaceHolder>" ; } } equals ( java . lang . Object ) { if ( ( obj == null ) || ( ( this . getClass ( ) ) != ( obj . getClass ( ) ) ) ) return false ; if ( obj == ( this ) ) return true ; grakn . core . graql . reasoner . unifier . UnifierImpl u2 = ( ( grakn . core . graql . reasoner . unifier . UnifierImpl ) ( obj ) ) ; return this . unifier . equals ( u2 . unifier ) ; }
org . junit . Assert . assertTrue ( unifier . equals ( correctUnifier ) )
whenQueryingWithReasoningOff_explanationsAreEmpty ( ) { try ( grakn . core . server . session . TransactionOLTP tx = grakn . core . graql . reasoner . query . ExplanationIT . geoSession . transaction ( ) . read ( ) ) { java . lang . String queryString = "match<sp>$x<sp>isa<sp>city,<sp>has<sp>name<sp>$n;<sp>get;" ; graql . lang . query . GraqlGet query = graql . lang . Graql . parse ( queryString ) ; java . util . List < grakn . core . concept . answer . ConceptMap > answers = tx . execute ( query , false ) ; answers . forEach ( ( ans ) -> "<AssertPlaceHolder>" ) ; } } explanation ( ) { return explanation ; }
org . junit . Assert . assertTrue ( ans . explanation ( ) . isEmpty ( ) )
testVerifyInactive ( ) { _user = com . liferay . portal . kernel . test . util . UserTestUtil . addUser ( ) ; com . liferay . portal . kernel . service . UserLocalServiceUtil . updateStatus ( _user . getUserId ( ) , WorkflowConstants . STATUS_INACTIVE , new com . liferay . portal . kernel . service . ServiceContext ( ) ) ; com . liferay . portal . kernel . model . Group group = _user . getGroup ( ) ; group . setActive ( true ) ; com . liferay . portal . kernel . service . GroupLocalServiceUtil . updateGroup ( group ) ; doVerify ( ) ; group = _user . getGroup ( ) ; "<AssertPlaceHolder>" ; } isLiveGroupActive ( com . liferay . portal . kernel . model . Group ) { return com . liferay . portal . kernel . service . GroupLocalServiceUtil . getService ( ) . isLiveGroupActive ( group ) ; }
org . junit . Assert . assertFalse ( com . liferay . portal . kernel . service . GroupLocalServiceUtil . isLiveGroupActive ( group ) )
getCompressionTypeTarGzFromMetadataSuccess ( ) { when ( obj . getKey ( ) ) . thenReturn ( ( ( ( ( "A" + ( java . io . File . separator ) ) + "File" ) + ( java . io . File . separator ) ) + "XK321K" ) ) ; when ( metadata . getContentType ( ) ) . thenReturn ( "application/gzip" ) ; final com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType compressionType = com . amazonaws . codepipeline . jenkinsplugin . ExtractionTools . getCompressionType ( obj , null ) ; "<AssertPlaceHolder>" ; } getCompressionType ( com . amazonaws . services . s3 . model . S3Object , hudson . model . TaskListener ) { final java . lang . String key = sessionObject . getKey ( ) ; com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType compressionType = com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . None ; if ( com . amazonaws . codepipeline . jenkinsplugin . ExtractionTools . endsWithLowerCase ( key , ".zip" ) ) { compressionType = com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . Zip ; } else if ( com . amazonaws . codepipeline . jenkinsplugin . ExtractionTools . endsWithLowerCase ( key , ".tar.gz" ) ) { compressionType = com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . TarGz ; } else if ( com . amazonaws . codepipeline . jenkinsplugin . ExtractionTools . endsWithLowerCase ( key , ".tar" ) ) { compressionType = com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . Tar ; } if ( compressionType == ( com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . None ) ) { final java . lang . String contentType = sessionObject . getObjectMetadata ( ) . getContentType ( ) ; if ( "application/zip" . equalsIgnoreCase ( contentType ) ) { compressionType = com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . Zip ; } else if ( ( "application/gzip" . equalsIgnoreCase ( contentType ) ) || ( "application/x-gzip" . equalsIgnoreCase ( contentType ) ) ) { compressionType = com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . TarGz ; } else if ( ( "application/tar" . equalsIgnoreCase ( contentType ) ) || ( "application/x-tar" . equalsIgnoreCase ( contentType ) ) ) { compressionType = com . amazonaws . codepipeline . jenkinsplugin . CodePipelineStateModel . CompressionType . Tar ; } } com . amazonaws . codepipeline . jenkinsplugin . LoggingHelper . log ( l , "Detected<sp>compression<sp>type:<sp>%s" , compressionType . name ( ) ) ; return compressionType ; }
org . junit . Assert . assertEquals ( CompressionType . TarGz , compressionType )
testAvgWithValidRangeWithNullCF ( ) { org . apache . hadoop . hbase . client . coprocessor . AggregationClient aClient = new org . apache . hadoop . hbase . client . coprocessor . AggregationClient ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . conf ) ; org . apache . hadoop . hbase . client . Scan scan = new org . apache . hadoop . hbase . client . Scan ( ) ; final org . apache . hadoop . hbase . coprocessor . ColumnInterpreter < java . lang . Long , java . lang . Long > ci = new org . apache . hadoop . hbase . client . coprocessor . LongColumnInterpreter ( ) ; java . lang . Double avg = null ; try { avg = aClient . avg ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . TEST_TABLE , ci , scan ) ; } catch ( java . lang . Throwable e ) { } "<AssertPlaceHolder>" ; } avg ( byte [ ] , org . apache . hadoop . hbase . coprocessor . ColumnInterpreter , org . apache . hadoop . hbase . client . Scan ) { org . apache . hadoop . hbase . util . Pair < S , java . lang . Long > p = getAvgArgs ( tableName , ci , scan ) ; return ci . divideForAvg ( p . getFirst ( ) , p . getSecond ( ) ) ; }
org . junit . Assert . assertEquals ( null , avg )
lookupHashMismatch ( ) { com . facebook . buck . core . rulekey . RuleKey key = new com . facebook . buck . core . rulekey . RuleKey ( "aa" ) ; com . facebook . buck . core . sourcepath . SourcePath input = com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "input.h" ) ; com . facebook . buck . core . build . engine . manifest . Manifest manifest = com . facebook . buck . core . build . engine . manifest . ManifestUtil . fromMap ( new com . facebook . buck . core . rulekey . RuleKey ( "cc" ) , com . google . common . collect . ImmutableMap . of ( key , com . google . common . collect . ImmutableMap . of ( com . facebook . buck . core . build . engine . manifest . ManifestTest . RESOLVER . getRelativePath ( input ) . toString ( ) , com . google . common . hash . HashCode . fromInt ( 1 ) ) ) ) ; com . facebook . buck . util . cache . FileHashCache fileHashCache = new com . facebook . buck . testutil . FakeFileHashCache ( com . google . common . collect . ImmutableMap . of ( com . facebook . buck . core . build . engine . manifest . ManifestTest . RESOLVER . getAbsolutePath ( input ) , com . google . common . hash . HashCode . fromInt ( 2 ) ) ) ; "<AssertPlaceHolder>" ; } lookup ( com . facebook . buck . util . hashing . FileHashLoader , com . facebook . buck . core . sourcepath . resolver . SourcePathResolver , com . google . common . collect . ImmutableSet ) { com . google . common . collect . ImmutableSet . Builder < java . lang . String > interestingPathsBuilder = new com . google . common . collect . ImmutableSet . Builder < > ( ) ; for ( com . facebook . buck . util . types . Pair < ? , int [ ] > entry : entries ) { for ( int hashIndex : entry . getSecond ( ) ) { interestingPathsBuilder . add ( inputs . get ( hashes . get ( hashIndex ) . getFirst ( ) ) ) ; } } com . google . common . collect . ImmutableSet < java . lang . String > interestingPaths = interestingPathsBuilder . build ( ) ; com . google . common . collect . ImmutableListMultimap < java . lang . String , com . facebook . buck . core . sourcepath . SourcePath > mappedUniverse = com . facebook . buck . core . build . engine . manifest . Manifest . index ( universe , ( path ) -> sourcePathToManifestHeader ( path , resolver ) , interestingPaths :: contains ) ; for ( com . facebook . buck . util . types . Pair < com . facebook . buck . core . rulekey . RuleKey , int [ ] > entry : entries ) { if ( hashesMatch ( fileHashLoader , resolver , mappedUniverse , entry . getSecond ( ) ) ) { return java . util . Optional . of ( entry . getFirst ( ) ) ; } } return java . util . Optional . empty ( ) ; }
org . junit . Assert . assertThat ( manifest . lookup ( fileHashCache , com . facebook . buck . core . build . engine . manifest . ManifestTest . RESOLVER , com . google . common . collect . ImmutableSet . of ( input ) ) , org . hamcrest . Matchers . equalTo ( java . util . Optional . empty ( ) ) )
testGetGroupId ( ) { org . owasp . dependencycheck . xml . pom . Model instance = new org . owasp . dependencycheck . xml . pom . Model ( ) ; instance . setGroupId ( "" ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getGroupId ( ) ; "<AssertPlaceHolder>" ; } getGroupId ( ) { return groupId ; }
org . junit . Assert . assertEquals ( expResult , result )
testEmptyAuthenticationMethodAttribute ( ) { final java . util . Map map = this . authentication . getAttributes ( ) ; when ( map . containsKey ( any ( java . lang . Object . class ) ) ) . thenReturn ( false ) ; final java . util . Collection c = this . authentication . getSatisfiedAuthenticationMethods ( ) ; "<AssertPlaceHolder>" ; } getSatisfiedAuthenticationMethods ( ) { return net . unicon . cas . mfa . util . MultiFactorUtils . getSatisfiedAuthenticationMethods ( this ) ; }
org . junit . Assert . assertEquals ( c . size ( ) , 0 )
testStartNoTran ( ) { final javax . batch . operations . JobOperator mockJobOperator = mockery . mock ( javax . batch . operations . JobOperator . class ) ; final javax . transaction . TransactionManager mockTranMgr = mockery . mock ( javax . transaction . TransactionManager . class ) ; final long retMe = 1 ; mockery . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockTranMgr ) . suspend ( ) ; will ( returnValue ( null ) ) ; oneOf ( mockJobOperator ) . start ( null , null ) ; will ( returnValue ( retMe ) ) ; } } ) ; "<AssertPlaceHolder>" ; } buildJobOperator ( javax . batch . operations . JobOperator , javax . transaction . TransactionManager ) { com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran retMe = new com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran ( ) ; retMe . setTransactionManager ( mockTranMgr ) ; retMe . setJobOperator ( mockJobOperator ) ; return retMe ; }
org . junit . Assert . assertEquals ( retMe , buildJobOperator ( mockJobOperator , mockTranMgr ) . start ( null , null ) )
testIteratorFullyFannedOut ( ) { org . eclipse . jgit . revwalk . RevBlob a = tr . blob ( "a" ) ; org . eclipse . jgit . revwalk . RevBlob b = tr . blob ( "b" ) ; org . eclipse . jgit . revwalk . RevBlob data1 = tr . blob ( "data1" ) ; org . eclipse . jgit . revwalk . RevBlob data2 = tr . blob ( "data2" ) ; org . eclipse . jgit . revwalk . RevBlob nonNote = tr . blob ( "non<sp>note" ) ; org . eclipse . jgit . revwalk . RevCommit r = tr . commit ( ) . add ( org . eclipse . jgit . notes . NoteMapTest . fanout ( 38 , a . name ( ) ) , data1 ) . add ( org . eclipse . jgit . notes . NoteMapTest . fanout ( 38 , b . name ( ) ) , data2 ) . add ( "nonNote" , nonNote ) . create ( ) ; tr . parseBody ( r ) ; java . util . Iterator it = org . eclipse . jgit . notes . NoteMap . read ( reader , r ) . iterator ( ) ; "<AssertPlaceHolder>" ; } count ( java . util . Iterator ) { int c = 0 ; while ( it . hasNext ( ) ) { c ++ ; it . next ( ) ; } return c ; }
org . junit . Assert . assertEquals ( 2 , org . eclipse . jgit . notes . NoteMapTest . count ( it ) )
testInsertRetrieveString ( ) { org . mongojack . mock . MockObject object = new org . mongojack . mock . MockObject ( ) ; object . string = "a<sp>string" ; coll . insert ( object ) ; org . mongojack . mock . MockObject result = coll . findOne ( ) ; "<AssertPlaceHolder>" ; } findOne ( ) { return findOne ( new org . bson . Document ( ) ) ; }
org . junit . Assert . assertEquals ( object . string , result . string )
resolveSnapshotWhenSnapshotsEnabled ( ) { java . lang . System . setProperty ( "org.ops4j.pax.url.mvn.repositories" , "https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j-snapshots@snapshots" ) ; java . net . URL url = new java . net . URL ( "mvn:org.ops4j/master/2.0.1-SNAPSHOT/pom" ) ; url . openStream ( ) . close ( ) ; java . io . File artifact = new java . io . File ( localRepo , "org/ops4j/master/2.0.1-SNAPSHOT/master-2.0.1-SNAPSHOT.pom" ) ; "<AssertPlaceHolder>" ; } close ( ) { m_client . close ( ) ; }
org . junit . Assert . assertThat ( artifact . exists ( ) , org . hamcrest . CoreMatchers . is ( true ) )
testSearchDescBillingCode ( ) { java . lang . String serviceCode = "service001" ; java . lang . String region = "ON" ; org . oscarehr . common . model . BillingService billingService1 = createBillingServiceWithDesc ( "service001" , "ON" , "Service<sp>1<sp>description." 3 , "Service<sp>1<sp>description." ) ; org . oscarehr . common . model . BillingService billingService2 = createBillingServiceWithDesc ( "service001" , "ON" , "Service<sp>1<sp>description." 3 , "-----" ) ; org . oscarehr . common . model . BillingService billingService3 = createBillingServiceWithDesc ( "service001" , "ON" , "Service<sp>1<sp>description." 3 , "" ) ; org . oscarehr . common . model . BillingService billingService4 = createBillingServiceWithDesc ( "service001" , "ON" , "Service<sp>1<sp>description." 3 , "----" ) ; org . oscarehr . common . model . BillingService billingService5 = createBillingServiceWithDesc ( "service001" , "BC" , "Service<sp>1<sp>description." 3 , "Service<sp>1<sp>description." 0 ) ; org . oscarehr . common . model . BillingService billingService6 = createBillingServiceWithDesc ( "Service<sp>1<sp>description." 2 , "ON" , "Service<sp>1<sp>description." 3 , "Service<sp>1<sp>description." 0 ) ; org . oscarehr . common . model . BillingService billingService7 = createBillingServiceWithDesc ( "service001" , "ON" , "20100101" , "Service<sp>7<sp>description." ) ; org . oscarehr . common . model . BillingService billingService8 = createBillingServiceWithDesc ( "service001" , "ON" , "20110101" , "Service<sp>1<sp>description." 1 ) ; dao . persist ( billingService1 ) ; dao . persist ( billingService2 ) ; dao . persist ( billingService3 ) ; dao . persist ( billingService4 ) ; dao . persist ( billingService5 ) ; dao . persist ( billingService6 ) ; dao . persist ( billingService7 ) ; dao . persist ( billingService8 ) ; java . lang . String result = dao . searchDescBillingCode ( serviceCode , region ) ; java . lang . String expectedResult = "Service<sp>1<sp>description." 1 ; "<AssertPlaceHolder>" ; } searchDescBillingCode ( java . lang . String , java . lang . String ) { javax . persistence . Query query = entityManager . createQuery ( "select<sp>bs<sp>from<sp>BillingService<sp>bs<sp>where<sp>bs.description<sp><><sp>''<sp>AND<sp>bs.description<sp><><sp>'----'<sp>AND<sp>bs.region<sp>=<sp>(:region)<sp>and<sp>bs.serviceCode<sp>like<sp>(:code)<sp>and<sp>bs.billingserviceDate<sp>=<sp>(select<sp>max(b2.billingserviceDate)<sp>from<sp>BillingService<sp>b2<sp>where<sp>b2.serviceCode<sp>=<sp>bs.serviceCode<sp>and<sp>b2.billingserviceDate<sp><=<sp>(:billDate))<sp>order<sp>by<sp>bs.billingserviceDate<sp>desc" ) ; query . setParameter ( "region" , region ) ; query . setParameter ( "code" , ( code + "%" ) ) ; query . setParameter ( "billDate" , java . util . Calendar . getInstance ( ) . getTime ( ) ) ; java . util . List < org . oscarehr . common . model . BillingService > list = query . getResultList ( ) ; if ( ( list . size ( ) ) == 0 ) { return "----" ; } return list . get ( 0 ) . getDescription ( ) ; }
org . junit . Assert . assertEquals ( expectedResult , result )
testUpdateEntity ( ) { handler . addRequest ( false , "><Value>Closed</Value></Field></Fields></Entity>" 0 , "/qcbin/rest/domains/domain/projects/project/defects/86" , 200 ) . expectXmlBody ( "<Entity<sp>Type=\"defect\"><Fields><Field<sp>Name=\"status\"><Value>Closed</Value></Field></Fields></Entity>" ) . content ( "entityServiceTest_entity.xml" ) ; handler . async ( ) ; addEntityListener ( new com . hp . alm . ali . idea . services . EntityLoaded ( handler , "defect" , 86 , EntityListener . Event . GET ) ) ; com . hp . alm . ali . idea . model . Entity defect = new com . hp . alm . ali . idea . model . Entity ( "defect" , 86 ) ; defect . setProperty ( "priority" , "1-Critical" ) ; defect . setProperty ( "status" , "Closed" ) ; com . hp . alm . ali . idea . model . Entity updated = entityService . updateEntity ( defect , java . util . Collections . singleton ( "status" ) , true , false , true ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( 86 , updated . getId ( ) )
checkMessageMethod ( ) { java . lang . String str = "test" ; info . smart_tools . smartactors . iobject . iobject . exception . DeleteValueException exception = new info . smart_tools . smartactors . iobject . iobject . exception . DeleteValueException ( str ) ; "<AssertPlaceHolder>" ; throw exception ; } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( exception . getMessage ( ) , str )
testConvertAll ( ) { java . lang . Long id = 1L ; java . lang . String name = "n<sp>a<sp>m<sp>e" ; org . lnu . is . resource . education . form . type . EducationFormTypeResource source = new org . lnu . is . resource . education . form . type . EducationFormTypeResource ( ) ; source . setId ( id ) ; source . setName ( name ) ; java . util . List < org . lnu . is . resource . education . form . type . EducationFormTypeResource > sources = java . util . Arrays . asList ( source ) ; org . lnu . is . domain . education . form . type . EducationFormType expected = new org . lnu . is . domain . education . form . type . EducationFormType ( ) ; expected . setId ( id ) ; expected . setName ( name ) ; java . util . List < org . lnu . is . domain . education . form . type . EducationFormType > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . domain . education . form . type . EducationFormType > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
org . junit . Assert . assertEquals ( expecteds , actuals )
closeAllEditors ( ) { new org . eclipse . reddeer . workbench . impl . editor . TextEditor ( ) ; requirement . fulfill ( ) ; try { new org . eclipse . reddeer . workbench . impl . editor . TextEditor ( ) ; org . junit . Assert . fail ( "All<sp>editors<sp>should<sp>be<sp>closed" ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } fulfill ( ) { runSafely ( Requirement :: fulfill ) ; }
org . junit . Assert . assertTrue ( true )
testListenerIsSerializable ( ) { widget . addListener ( SWT . Dispose , new org . eclipse . swt . widgets . WidgetSerialization_Test . TestListener ( ) ) ; org . eclipse . swt . widgets . Widget deserializedWidget = serializeAndDeserialize ( widget ) ; org . eclipse . swt . widgets . Listener [ ] listeners = deserializedWidget . getListeners ( SWT . Dispose ) ; "<AssertPlaceHolder>" ; } getListeners ( int ) { checkWidget ( ) ; return ( eventTable ) == null ? org . eclipse . swt . widgets . Widget . EMPTY_LISTENERS : eventTable . getListeners ( eventType ) ; }
org . junit . Assert . assertEquals ( 1 , listeners . length )
firstCoversSecondValueMatch ( ) { com . fasterxml . jackson . databind . JsonNode node1 = new com . fasterxml . jackson . databind . node . TextNode ( "abc" ) ; com . fasterxml . jackson . databind . JsonNode node2 = new com . fasterxml . jackson . databind . node . TextNode ( "abc" ) ; boolean result = org . batfish . datamodel . questions . Exclusion . firstCoversSecond ( node1 , node2 ) ; "<AssertPlaceHolder>" ; } firstCoversSecond ( com . fasterxml . jackson . databind . JsonNode , com . fasterxml . jackson . databind . JsonNode ) { if ( first . isValueNode ( ) ) { return ( second . isValueNode ( ) ) && ( first . equals ( second ) ) ; } else if ( first . isArray ( ) ) { if ( ! ( second . isArray ( ) ) ) { return false ; } for ( com . fasterxml . jackson . databind . JsonNode firstElement : first ) { boolean covered = false ; for ( com . fasterxml . jackson . databind . JsonNode secondElement : second ) { if ( org . batfish . datamodel . questions . Exclusion . firstCoversSecond ( firstElement , secondElement ) ) { covered = true ; break ; } } if ( ! covered ) { return false ; } } return true ; } else if ( first . isObject ( ) ) { if ( ! ( second . isObject ( ) ) ) { return false ; } java . util . Iterator < java . lang . String > firstKeys = first . fieldNames ( ) ; while ( firstKeys . hasNext ( ) ) { java . lang . String key = firstKeys . next ( ) ; if ( ( second . get ( key ) ) == null ) { return false ; } if ( ! ( org . batfish . datamodel . questions . Exclusion . firstCoversSecond ( first . get ( key ) , second . get ( key ) ) ) ) { return false ; } } return true ; } else { throw new org . batfish . common . BatfishException ( ( "Missed<sp>some<sp>JsonNode<sp>type:<sp>" + ( first . getNodeType ( ) ) ) ) ; } }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( true ) )
testDirtyPostInitialization ( ) { _routingProcess . initialize ( ) ; "<AssertPlaceHolder>" ; } isDirty ( ) { return ( ( ( ( ( ( ! ( _changeset . build ( ) . isEmpty ( ) ) ) || ( ! ( _queuedForRedistribution . isEmpty ( ) ) ) ) || ( ! ( _activatedGeneratedRoutes . isEmpty ( ) ) ) ) || ( ! ( _interAreaIncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ) || ( ! ( _intraAreaIncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ) || ( ! ( _type1IncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ) || ( ! ( _type2IncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ; }
org . junit . Assert . assertTrue ( _routingProcess . isDirty ( ) )
testRead ( ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; baos . write ( aceis . read ( ) ) ; baos . write ( aceis . read ( ) ) ; baos . write ( aceis . read ( ) ) ; byte [ ] buf = new byte [ 2048 ] ; int read = - 1 ; while ( ( read = aceis . read ( buf ) ) != ( - 1 ) ) { baos . write ( buf , 0 , read ) ; } aceis . close ( ) ; baos . flush ( ) ; "<AssertPlaceHolder>" ; } getExpectedOutput ( ) { java . io . File written = new java . io . File ( getClass ( ) . getResource ( "/com/amazonaws/auth/SignedTestData.txt" ) . getPath ( ) ) ; java . io . ByteArrayOutputStream expected = new java . io . ByteArrayOutputStream ( ) ; java . io . FileInputStream writtenFis = new java . io . FileInputStream ( written ) ; int transferred = - 1 ; byte [ ] transferBuf = new byte [ 2048 ] ; while ( ( transferred = writtenFis . read ( transferBuf ) ) != ( - 1 ) ) { expected . write ( transferBuf , 0 , transferred ) ; } expected . flush ( ) ; writtenFis . close ( ) ; return expected . toByteArray ( ) ; }
org . junit . Assert . assertArrayEquals ( getExpectedOutput ( ) , baos . toByteArray ( ) )
testWebServiceContextAppearsInTheSummary ( ) { java . net . URL url = new java . net . URL ( _url , "/api/jsonws" ) ; java . lang . String body = com . liferay . portal . kernel . util . StringUtil . read ( url . openStream ( ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return com . liferay . segments . service . util . ServiceProps . _instance . _configuration . contains ( key ) ; }
org . junit . Assert . assertTrue ( body , body . contains ( "test" ) )
testExceptionInExceptionHandler ( ) { getApplicationContext ( ) . setExceptionHandler ( exceptionHandler ) ; java . lang . RuntimeException exceptionInHandler = new java . lang . RuntimeException ( ) ; doThrow ( exceptionInHandler ) . when ( exceptionHandler ) . handleException ( any ( java . lang . Throwable . class ) ) ; addMaliciousListener ( SWT . Resize , exceptionInHandler ) ; generateEvent ( shell , SWT . Resize ) ; try { display . readAndDispatch ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception expected ) { "<AssertPlaceHolder>" ; } } readAndDispatch ( ) { checkDevice ( ) ; return safeReadAndDispatch ( ) ; }
org . junit . Assert . assertSame ( exceptionInHandler , expected )
testEmptyJoin ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; org . apache . hadoop . fs . Path base = org . apache . hadoop . mapreduce . lib . join . TestJoinDatamerge . cluster . getFileSystem ( ) . makeQualified ( new org . apache . hadoop . fs . Path ( "/empty" ) ) ; org . apache . hadoop . fs . Path [ ] src = new org . apache . hadoop . fs . Path [ ] { new org . apache . hadoop . fs . Path ( base , "i0" ) , new org . apache . hadoop . fs . Path ( "i1" ) , new org . apache . hadoop . fs . Path ( "i2" ) } ; conf . set ( CompositeInputFormat . JOIN_EXPR , org . apache . hadoop . mapreduce . lib . join . CompositeInputFormat . compose ( "outer" , MapReduceTestUtil . Fake_IF . class , src ) ) ; MapReduceTestUtil . Fake_IF . setKeyClass ( conf , MapReduceTestUtil . IncomparableKey . class ) ; org . apache . hadoop . mapreduce . lib . join . Job job = org . apache . hadoop . mapreduce . lib . join . Job . getInstance ( conf ) ; job . setInputFormatClass ( org . apache . hadoop . mapreduce . lib . join . CompositeInputFormat . class ) ; org . apache . hadoop . mapreduce . lib . output . FileOutputFormat . setOutputPath ( job , new org . apache . hadoop . fs . Path ( base , "out" ) ) ; job . setMapperClass ( org . apache . hadoop . mapreduce . lib . join . Mapper . class ) ; job . setReducerClass ( org . apache . hadoop . mapreduce . lib . join . Reducer . class ) ; job . setOutputKeyClass ( MapReduceTestUtil . IncomparableKey . class ) ; job . setOutputValueClass ( org . apache . hadoop . io . NullWritable . class ) ; job . waitForCompletion ( true ) ; "<AssertPlaceHolder>" ; base . getFileSystem ( conf ) . delete ( base , true ) ; } isSuccessful ( ) { if ( lost ) { throw new java . io . IOException ( "Test<sp>failure!" ) ; } return isSuccessful ; }
org . junit . Assert . assertTrue ( job . isSuccessful ( ) )
processOptionsName ( ) { org . apache . hadoop . fs . shell . find . Find find = new org . apache . hadoop . fs . shell . find . Find ( ) ; find . setConf ( org . apache . hadoop . fs . shell . find . TestFind . conf ) ; java . lang . String args = "path<sp>-name<sp>namemask" ; java . lang . String expected = "And(;Name(namemask;),Print(;))" ; find . processOptions ( getArgs ( args ) ) ; org . apache . hadoop . fs . shell . find . Expression expression = find . getRootExpression ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( "OzoneFileSystem{URI=" + ( uri ) ) + ",<sp>" ) + "workingDir=" ) + ( workingDir ) ) + ",<sp>" ) + "userName=" ) + ( userName ) ) + ",<sp>" ) + "statistics=" ) + ( statistics ) ) + "}" ; }
org . junit . Assert . assertEquals ( expected , expression . toString ( ) )
testComputeCount ( ) { com . clearspring . analytics . stream . cardinality . HyperLogLog hyperLogLog = new com . clearspring . analytics . stream . cardinality . HyperLogLog ( 16 ) ; hyperLogLog . offer ( 0 ) ; hyperLogLog . offer ( 1 ) ; hyperLogLog . offer ( 2 ) ; hyperLogLog . offer ( 3 ) ; hyperLogLog . offer ( 16 ) ; hyperLogLog . offer ( 17 ) ; hyperLogLog . offer ( 18 ) ; hyperLogLog . offer ( 19 ) ; hyperLogLog . offer ( 19 ) ; "<AssertPlaceHolder>" ; } cardinality ( ) { double registerSum = 0 ; int count = registerSet . count ; double zeros = 0.0 ; for ( int j = 0 ; j < ( registerSet . count ) ; j ++ ) { int val = registerSet . get ( j ) ; registerSum += 1.0 / ( 1 << val ) ; if ( val == 0 ) { zeros ++ ; } } double estimate = ( alphaMM ) * ( 1 / registerSum ) ; if ( estimate <= ( ( 5.0 / 2.0 ) * count ) ) { return java . lang . Math . round ( com . clearspring . analytics . stream . cardinality . HyperLogLog . linearCounting ( count , zeros ) ) ; } else { return java . lang . Math . round ( estimate ) ; } }
org . junit . Assert . assertEquals ( 8 , hyperLogLog . cardinality ( ) )
testFactoryCreation ( ) { javax . xml . stream . XMLStreamReader reader = org . apache . cxf . staxutils . StaxUtils . createXMLStreamReader ( getTestStream ( "./resources/amazon.xml" ) ) ; "<AssertPlaceHolder>" ; } getTestStream ( java . lang . String ) { return getClass ( ) . getResourceAsStream ( resource ) ; }
org . junit . Assert . assertNotNull ( reader )
testHadoopCodecFactoryFail ( ) { org . apache . avro . file . CodecFactory hadoopSnappyCodec = org . apache . avro . hadoop . file . HadoopCodecFactory . fromHadoopString ( "org.apache.hadoop.io.compress.FooCodec" ) ; "<AssertPlaceHolder>" ; } fromHadoopString ( java . lang . String ) { org . apache . avro . file . CodecFactory o = null ; try { java . lang . String avroCodec = org . apache . avro . hadoop . file . HadoopCodecFactory . HADOOP_AVRO_NAME_MAP . get ( hadoopCodecClass ) ; if ( avroCodec != null ) { o = org . apache . avro . file . CodecFactory . fromString ( avroCodec ) ; } } catch ( java . lang . Exception e ) { throw new org . apache . avro . AvroRuntimeException ( ( "Unrecognized<sp>hadoop<sp>codec:<sp>" + hadoopCodecClass ) , e ) ; } return o ; }
org . junit . Assert . assertTrue ( ( hadoopSnappyCodec == null ) )
should_count_with_attributes ( ) { com . ctp . cdi . query . test . domain . Simple simple = createSimple ( "testFindAll1" , java . lang . Integer . valueOf ( 55 ) ) ; createSimple ( "testFindAll2" , java . lang . Integer . valueOf ( 55 ) ) ; java . lang . Long result = dao . count ( simple , Simple_ . name , Simple_ . counter ) ; "<AssertPlaceHolder>" ; } createSimple ( java . lang . String , java . lang . Integer ) { com . ctp . cdi . query . test . domain . Simple result = new com . ctp . cdi . query . test . domain . Simple ( name ) ; result . setCounter ( counter ) ; entityManager . persist ( result ) ; entityManager . flush ( ) ; return result ; }
org . junit . Assert . assertEquals ( java . lang . Long . valueOf ( 1 ) , result )
testValues_emptyTree ( ) { java . util . Collection values = tree . values ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return this . delegate . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( values . isEmpty ( ) )
testEmpty ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( empty )
canConstructAPersonWithAName ( ) { org . gradle . Person person = new org . gradle . Person ( "Larry" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return "objc" ; }
org . junit . Assert . assertEquals ( "Larry" , person . getName ( ) )