input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
shouldRejectIdIfTypeIsSet ( ) { vip2 . setId ( 12 ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = vipsValidator . validate ( vips , org . openstack . atlas . api . mgmt . validation . validators . VIPS_POST ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; }
org . junit . Assert . assertFalse ( resultMessage ( result , org . openstack . atlas . api . mgmt . validation . validators . VIPS_POST ) , result . passedValidation ( ) )
test ( ) { java . util . Properties properties = new java . util . Properties ( ) ; properties . setProperty ( "bootstrap.servers" , ( "localhost:" + ( port ) ) ) ; properties . setProperty ( "value.serializer" , "org.apache.kafka.common.serialization.ByteArraySerializer" ) ; properties . setProperty ( "key.serializer" , "org.apache.kafka.common.serialization.ByteArraySerializer" ) ; org . darkphoenixs . kafka . core . KafkaMessageNewSender < byte [ ] , byte [ ] > sender = new org . darkphoenixs . kafka . core . KafkaMessageNewSender ( properties ) ; "<AssertPlaceHolder>" ; sender . send ( topic , "hahah" . getBytes ( ) ) ; sender . sendWithKey ( topic , "key" . getBytes ( ) , "value" . getBytes ( ) ) ; sender . shutDown ( ) ; sender . sendCallback . onCompletion ( null , null ) ; sender . sendCallback . onCompletion ( null , new org . darkphoenixs . mq . exception . MQException ( "test" ) ) ; } getPartitions ( java . lang . String ) { return kafkaProducer . partitionsFor ( topic ) ; }
org . junit . Assert . assertEquals ( sender . getPartitions ( topic ) . size ( ) , 4 )
testExtractor_autoboxingByte ( ) { uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject domainObject = new uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject ( null , 0 ) ; uk . co . rockstable . experiements . codegen . reflection . extractors . Extractor < uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject > extractor = factory . create ( uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject . class , "_byte" ) ; java . lang . Byte extractedByte = extractor . extract ( domainObject ) ; "<AssertPlaceHolder>" ; } extract ( java . lang . Object ) { try { return field . get ( o ) ; } catch ( java . lang . IllegalAccessException e ) { throw new java . lang . RuntimeException ( e ) ; } }
org . junit . Assert . assertEquals ( ( ( java . lang . Byte ) ( Byte . MAX_VALUE ) ) , extractedByte )
test_add_nested ( ) { io . ebean . text . PathProperties root = io . ebean . text . PathProperties . parse ( "status,date" ) ; root . addNested ( "customer" , io . ebean . text . PathProperties . parse ( "id,name,address(line1,city)" ) ) ; io . ebean . FetchPath expect = io . ebean . text . PathProperties . parse ( "status,date,customer(id,name,address(line1,city))" ) ; "<AssertPlaceHolder>" . isEqualTo ( expect . toString ( ) ) ; } toString ( ) { return ( ( ( ( "beanType:" + ( beanType ) ) + "<sp>queryKey:" ) + ( queryKey ) ) + "<sp>sql:" ) + ( sql ) ; }
org . junit . Assert . assertThat ( root . toString ( ) )
testPrivateKey ( ) { java . io . File privateKeyFile = new java . io . File ( java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( "remote-download-source/id_rsa_test" ) . getPath ( ) ) ; com . streamsets . pipeline . lib . remote . TestSFTPRemoteConnector . SFTPRemoteConnectorForTest connector = new com . streamsets . pipeline . lib . remote . TestSFTPRemoteConnector . SFTPRemoteConnectorForTest ( getBean ( ( ( "sftp://localhost:" + ( port ) ) + "/" ) , true , false , com . streamsets . pipeline . lib . remote . TESTUSER , null , privateKeyFile . toString ( ) , "streamsets" , null , true , null ) ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = initWithNoIssues ( connector ) ; "<AssertPlaceHolder>" ; verifyConnection ( connector ) ; connector . close ( ) ; } size ( ) { return delegate . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , issues . size ( ) )
testExtentAcrossCommit ( ) { int N = 10000 ; javax . jdo . PersistenceManager pm = org . zoodb . test . testutil . TestTools . openPM ( ) ; pm . currentTransaction ( ) . begin ( ) ; for ( int i = 0 ; i < N ; i ++ ) { org . zoodb . test . jdo . TestClass tc = new org . zoodb . test . jdo . TestClass ( ) ; tc . setInt ( i ) ; pm . makePersistent ( tc ) ; } pm . currentTransaction ( ) . commit ( ) ; pm . currentTransaction ( ) . begin ( ) ; for ( org . zoodb . test . jdo . TestClass tc : pm . getExtent ( org . zoodb . test . jdo . TestClass . class ) ) { tc . setLong ( 12 ) ; } pm . currentTransaction ( ) . commit ( ) ; pm . currentTransaction ( ) . begin ( ) ; java . util . Iterator < org . zoodb . test . jdo . TestClass > it = pm . getExtent ( org . zoodb . test . jdo . TestClass . class ) . iterator ( ) ; int n = 0 ; while ( ( n < ( N / 2 ) ) && ( it . hasNext ( ) ) ) { n ++ ; it . next ( ) ; } pm . currentTransaction ( ) . commit ( ) ; pm . currentTransaction ( ) . begin ( ) ; try { "<AssertPlaceHolder>" ; } catch ( javax . jdo . JDOUserException e ) { } try { it . next ( ) ; org . junit . Assert . fail ( ) ; } catch ( javax . jdo . JDOUserException | java . util . NoSuchElementException e ) { } pm . currentTransaction ( ) . commit ( ) ; org . zoodb . test . testutil . TestTools . closePM ( ) ; } hasNext ( ) { if ( ( next ) == null ) { for ( ; ( pos ) < ( table . length ) ; ( pos ) ++ ) { if ( ( table [ pos ] ) != null ) { next = table [ pos ] ; ( pos ) ++ ; return true ; } } return false ; } return true ; }
org . junit . Assert . assertFalse ( it . hasNext ( ) )
testReadEmptyOptional ( ) { final com . spotify . google . cloud . pubsub . client . JsonTest . ValueWithOptional expected = new com . spotify . google . cloud . pubsub . client . ValueWithOptionalBuilder ( ) . build ( ) ; final com . spotify . google . cloud . pubsub . client . JsonTest . ValueWithOptional value = com . spotify . google . cloud . pubsub . client . Json . read ( "{}" . getBytes ( "UTF-8" ) , com . spotify . google . cloud . pubsub . client . JsonTest . ValueWithOptional . class ) ; "<AssertPlaceHolder>" ; } read ( byte [ ] , java . lang . Class ) { return com . spotify . google . cloud . pubsub . client . Json . MAPPER . readValue ( src , cls ) ; }
org . junit . Assert . assertThat ( value , org . hamcrest . Matchers . is ( expected ) )
getFeasibleLevelsSize ( ) { "<AssertPlaceHolder>" ; } getFeasibleLevelsSize ( ) { org . junit . Assert . assertEquals ( 1 , new org . optaplanner . core . impl . score . buildin . hardsoft . HardSoftScoreDefinition ( ) . getFeasibleLevelsSize ( ) ) ; }
org . junit . Assert . assertEquals ( 1 , new org . optaplanner . core . impl . score . buildin . hardsoft . HardSoftScoreDefinition ( ) . getFeasibleLevelsSize ( ) )
testIndentStyleTab ( ) { context . editorConfig ( "root<sp>=<sp>true" , "[*]" , "indent_style<sp>=<sp>tab" ) ; context . editFile ( fileName , "\t" ) ; "<AssertPlaceHolder>" ; } fileContents ( java . lang . String ) { byte [ ] bytes ; try { bytes = java . nio . file . Files . readAllBytes ( filePath ( fileName ) ) ; } catch ( final java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } return new java . lang . String ( bytes ) ; }
org . junit . Assert . assertThat ( context . fileContents ( fileName ) , org . hamcrest . Matchers . equalTo ( "\t" ) )
testGetListValueOutOfRange ( ) { java . util . Map < java . lang . String , java . util . List < java . lang . String > > map = new java . util . TreeMap < java . lang . String , java . util . List < java . lang . String > > ( ) ; org . ocpsoft . rewrite . util . Maps . addListValue ( map , "lincoln" , "baxter" ) ; "<AssertPlaceHolder>" ; } getListValue ( java . util . Map , java . lang . String , int ) { java . util . List < T > list = values . get ( name ) ; if ( ( list != null ) && ( ! ( list . isEmpty ( ) ) ) ) { T item = list . get ( index ) ; return item ; } return null ; }
org . junit . Assert . assertEquals ( null , org . ocpsoft . rewrite . util . Maps . getListValue ( map , "lincoln" , 1 ) )
testGetFrequency ( ) { bUDI . handle ( "1234" ) ; double fre = bUDI . getFrequency ( java . lang . Integer . valueOf ( "1" ) ) ; "<AssertPlaceHolder>" ; } getFrequency ( java . lang . Object ) { if ( ( this . count . compareTo ( 0L ) ) == 0 ) { return Double . NaN ; } return ( ( double ) ( getCount ( dataValue ) ) ) / ( this . count . longValue ( ) ) ; }
org . junit . Assert . assertTrue ( ( fre == 1.0 ) )
testFullDepthFetchPlan ( ) { com . orientechnologies . orient . core . db . document . ODatabaseDocument database = new com . orientechnologies . orient . core . db . document . ODatabaseDocumentTx ( ( "memory:" + ( com . orientechnologies . orient . core . sql . fetch . DepthFetchPlanTest . class . getSimpleName ( ) ) ) ) ; database . create ( ) ; try { database . getMetadata ( ) . getSchema ( ) . createClass ( "Test" ) ; com . orientechnologies . orient . core . record . impl . ODocument doc = new com . orientechnologies . orient . core . record . impl . ODocument ( "Test" ) ; com . orientechnologies . orient . core . record . impl . ODocument doc1 = new com . orientechnologies . orient . core . record . impl . ODocument ( "Test" ) ; com . orientechnologies . orient . core . record . impl . ODocument doc2 = new com . orientechnologies . orient . core . record . impl . ODocument ( "Test" ) ; com . orientechnologies . orient . core . record . impl . ODocument doc3 = new com . orientechnologies . orient . core . record . impl . ODocument ( "Test" ) ; doc . field ( "name" , "name" ) ; database . save ( doc ) ; doc1 . field ( "name" , "name1" ) ; doc1 . field ( "ref" , doc ) ; database . save ( doc1 ) ; doc2 . field ( "name" , "name2" ) ; doc2 . field ( "ref" , doc1 ) ; database . save ( doc2 ) ; doc3 . field ( "name" , "name2" ) ; doc3 . field ( "ref" , doc2 ) ; database . save ( doc3 ) ; com . orientechnologies . orient . core . fetch . OFetchContext context = new com . orientechnologies . orient . core . fetch . remote . ORemoteFetchContext ( ) ; com . orientechnologies . orient . core . sql . fetch . DepthFetchPlanTest . CountFetchListener listener = new com . orientechnologies . orient . core . sql . fetch . DepthFetchPlanTest . CountFetchListener ( ) ; com . orientechnologies . orient . core . fetch . OFetchHelper . fetch ( doc3 , doc3 , com . orientechnologies . orient . core . fetch . OFetchHelper . buildFetchPlan ( "[*]ref:-1" ) , listener , context , "" ) ; "<AssertPlaceHolder>" ; } finally { database . drop ( ) ; } } buildFetchPlan ( java . lang . String ) { if ( iFetchPlan == null ) return null ; if ( com . orientechnologies . orient . core . fetch . OFetchHelper . DEFAULT . equals ( iFetchPlan ) ) return com . orientechnologies . orient . core . fetch . OFetchHelper . DEFAULT_FETCHPLAN ; return new com . orientechnologies . orient . core . fetch . OFetchPlan ( iFetchPlan ) ; }
org . junit . Assert . assertEquals ( 3 , listener . count )
testCreateInitialOffsetMapTimestamp ( ) { com . streamsets . pipeline . stage . origin . s3 . AmazonS3SourceImpl amazonS3Source = new com . streamsets . pipeline . stage . origin . s3 . AmazonS3SourceImpl ( createConfigTimestamp ( ) ) ; java . lang . String offset1 = "FL_insurance.txt::1000::0dd65bf073ad0616a91901c9349dd5a4::1534360" ; java . lang . String offset2 = "FL_insurance.txt::1000::0dd65bf073ad0616a91901c9349dd5a4::1534362" ; java . lang . String offset3 = "FL_insurance.txt::1000::0dd65bf073ad0616a91901c9349dd5a4::1534361" ; java . util . List < com . streamsets . pipeline . stage . origin . s3 . S3Offset > listOfOffsets = new java . util . ArrayList ( ) ; listOfOffsets . add ( com . streamsets . pipeline . stage . origin . s3 . S3Offset . fromString ( offset1 ) ) ; listOfOffsets . add ( com . streamsets . pipeline . stage . origin . s3 . S3Offset . fromString ( offset2 ) ) ; listOfOffsets . add ( com . streamsets . pipeline . stage . origin . s3 . S3Offset . fromString ( offset3 ) ) ; java . util . Map < java . lang . String , java . lang . String > mapOfOffsets = new java . util . HashMap ( ) ; for ( int iterator = 0 ; iterator < ( listOfOffsets . size ( ) ) ; iterator ++ ) { mapOfOffsets . put ( java . lang . String . valueOf ( iterator ) , listOfOffsets . get ( iterator ) . toString ( ) ) ; } amazonS3Source . createInitialOffsetsMap ( mapOfOffsets ) ; java . util . List < com . streamsets . pipeline . stage . origin . s3 . S3Offset > expectedList = amazonS3Source . orderOffsets ( listOfOffsets ) ; java . util . List < com . streamsets . pipeline . stage . origin . s3 . S3Offset > resultList = new java . util . ArrayList ( amazonS3Source . offsetsMap . values ( ) ) ; for ( int iterator = 0 ; iterator < 3 ; iterator ++ ) { "<AssertPlaceHolder>" ; } } get ( java . lang . String ) { return null ; }
org . junit . Assert . assertEquals ( expectedList . get ( iterator ) . toString ( ) , resultList . get ( iterator ) . toString ( ) )
whenWriteMultipleLinesUsingCharSink_thenWritten ( ) { java . util . List < java . lang . String > names = com . google . common . collect . Lists . newArrayList ( "John" , "Jane" , "Adam" , "Tom" ) ; java . io . File file = new java . io . File ( "test.txt" ) ; com . github . mysite . common . guava . CharSink sink = com . github . mysite . common . guava . Files . asCharSink ( file , Charsets . UTF_8 ) ; sink . writeLines ( names , "<sp>" ) ; java . lang . String result = com . github . mysite . common . guava . Files . toString ( file , Charsets . UTF_8 ) ; java . lang . String expectedValue = com . google . common . base . Joiner . on ( "<sp>" ) . join ( names ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expectedValue , result . trim ( ) )
testOUWKIGRelatievoor306DagenBeeindigdDoorOverlijden ( ) { nl . bzk . brp . bijhouding . bericht . model . FamilierechtelijkeBetrekkingElement familierechtelijkeBetrekkingElement = maakFamilierechtelijkeBetrekkingElement ( 20160101 , 19890101 , nl . bzk . brp . bijhouding . bericht . model . FamilierechtelijkeBetrekkingElementTest . REDEN_BEEINDIGING_RELATIE_OUWKIG_OVERLEIDEN , 20150228 , true , false , null , "12345" , SoortPersoon . INGESCHREVENE , null , new java . lang . Integer [ ] { } , null , null ) ; java . util . List < nl . bzk . brp . bijhouding . bericht . model . MeldingElement > meldingen = familierechtelijkeBetrekkingElement . valideerSpecifiekeInhoud ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) )
readData ( ) { org . mockito . Mockito . when ( filereader . fileExist ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( filereader . readAllLine ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( new java . lang . String [ ] { "1.389038277403E9<sp>33<sp>37<sp>false" , "1.389038308374E9<sp>32<sp>37<sp>false" , "1.389038365419E9<sp>32<sp>37<sp>false" } ) ; java . util . List < com . att . aro . core . peripheral . pojo . BatteryInfo > batteryInfos = batteryreader . readData ( "/" , 0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return sessionTable . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( batteryInfos . size ( ) ) == 2 ) )
testThrowCheckedException ( ) { java . io . IOException expected = new java . io . IOException ( "EXPECTED<sp>ERROR" ) ; java . io . IOException actual = null ; try { org . slieb . throwables . LongPredicateWithThrowable . aLongPredicateThatUnsafelyThrowsUnchecked ( ( v1 ) -> { throw expected ; } ) . test ( 0 ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( java . io . IOException e ) { actual = e ; } "<AssertPlaceHolder>" ; } test ( long ) { try { return testWithThrowable ( v1 ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } }
org . junit . Assert . assertEquals ( expected , actual )
givenASortedArrayOfIntegers_whenTwoSum_thenPairExists ( ) { sortedArray = new int [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 5 , 6 , 7 , 8 , 9 , 9 } ; targetValue = 12 ; "<AssertPlaceHolder>" ; } twoSum ( int [ ] , int ) { int pointerOne = 0 ; int pointerTwo = ( input . length ) - 1 ; while ( pointerOne < pointerTwo ) { int sum = ( input [ pointerOne ] ) + ( input [ pointerTwo ] ) ; if ( sum == targetValue ) { return true ; } else if ( sum < targetValue ) { pointerOne ++ ; } else { pointerTwo -- ; } } return false ; }
org . junit . Assert . assertTrue ( twoSum . twoSum ( sortedArray , targetValue ) )
testNewCookie2 ( ) { boolean pass = true ; java . lang . String NewCookie_toParse = "Customer=WILE_E_COYOTE;<sp>Path=/acme;<sp>Version=1" ; java . lang . String name = "customer" ; java . lang . String value = "wile_e_coyote" ; java . lang . String path = "/acme" ; java . lang . String domain = "" ; int version = 1 ; javax . ws . rs . core . NewCookie nck27 = javax . ws . rs . core . NewCookie . valueOf ( NewCookie_toParse ) ; pass = verifyNewCookie ( nck27 , name , value , path , domain , version , "" , ( - 1 ) , null , false , false ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String ) { if ( qvalue == null ) return org . jboss . resteasy . core . request . QualityValue . DEFAULT ; return new org . jboss . resteasy . core . request . QualityValue ( org . jboss . resteasy . core . request . QualityValue . parseAsInteger ( qvalue ) ) ; }
org . junit . Assert . assertEquals ( nck27 , javax . ws . rs . core . NewCookie . valueOf ( nck27 . toString ( ) ) )
testGetClaimCount ( ) { long expected = 123L ; when ( _client . getClaimCount ( isSubject ( ) , eq ( "queue-name" ) ) ) . thenReturn ( expected ) ; long actual = databusClient ( false ) . getClaimCount ( "queue-name" ) ; "<AssertPlaceHolder>" ; verify ( _client ) . getClaimCount ( isSubject ( ) , eq ( "queue-name" ) ) ; verifyNoMoreInteractions ( _local , _client ) ; } getClaimCount ( java . lang . String , java . lang . String ) { checkNotNull ( subscription , "subscription" ) ; try { java . net . URI uri = _databus . clone ( ) . segment ( subscription , "claimcount" ) . queryParam ( "partitioned" , _partitionSafe ) . build ( ) ; return _client . resource ( uri ) . accept ( MediaType . APPLICATION_JSON_TYPE ) . header ( ApiKeyRequest . AUTHENTICATION_HEADER , apiKey ) . get ( com . bazaarvoice . emodb . databus . client . Long . class ) ; } catch ( com . bazaarvoice . emodb . client . EmoClientException e ) { throw convertException ( e ) ; } }
org . junit . Assert . assertEquals ( actual , expected )
testAcceptValidParameter ( ) { final org . openspotlight . graph . query . console . ConsoleState state = new org . openspotlight . graph . query . console . ConsoleState ( null ) ; state . setInput ( "remove<sp>property<sp>myProperty" ) ; "<AssertPlaceHolder>" ; } accept ( org . openspotlight . graph . query . console . ConsoleState ) { org . openspotlight . common . util . Assertions . checkNotNull ( "state" , state ) ; if ( ( ( state . getActiveCommand ( ) ) == null ) && ( state . getInput ( ) . trim ( ) . equals ( "display<sp>properties" ) ) ) { return true ; } return false ; }
org . junit . Assert . assertThat ( command . accept ( state ) , org . hamcrest . core . Is . is ( true ) )
testGet ( ) { io . jboot . Jboot . getCache ( ) . put ( "cachename" , "key" , "value" ) ; java . lang . String value = io . jboot . Jboot . getCache ( ) . get ( "cachename" , "key" ) ; "<AssertPlaceHolder>" ; } get ( com . jfinal . core . Controller , java . lang . String ) { java . lang . String encrypt_key = io . jboot . utils . CookieUtil . COOKIE_ENCRYPT_KEY ; java . lang . String cookieValue = ctr . getCookie ( key ) ; if ( cookieValue == null ) { return null ; } java . lang . String value = new java . lang . String ( com . jfinal . kit . Base64Kit . decode ( cookieValue ) ) ; return io . jboot . utils . CookieUtil . getFromCookieInfo ( encrypt_key , value ) ; }
org . junit . Assert . assertTrue ( "value" . equals ( value ) )
testConflict ( ) { eu . europa . esig . dss . validation . reports . wrapper . TrustedServiceWrapper service = new eu . europa . esig . dss . validation . reports . wrapper . TrustedServiceWrapper ( ) ; service . setCapturedQualifiers ( java . util . Arrays . asList ( ServiceQualification . QC_FOR_ESIG , ServiceQualification . QC_FOR_LEGAL_PERSON ) ) ; "<AssertPlaceHolder>" ; } isConsistent ( eu . europa . esig . dss . validation . reports . wrapper . TrustedServiceWrapper ) { java . util . Date startDate = trustedService . getStartDate ( ) ; if ( eu . europa . esig . dss . validation . process . qualification . EIDASUtils . isPreEIDAS ( startDate ) ) { java . util . List < java . lang . String > asis = trustedService . getAdditionalServiceInfos ( ) ; if ( ( eu . europa . esig . dss . validation . process . qualification . trust . AdditionalServiceInformation . isForeSealsOnly ( asis ) ) || ( eu . europa . esig . dss . validation . process . qualification . trust . AdditionalServiceInformation . isForWebAuthOnly ( asis ) ) ) { return false ; } java . util . List < java . lang . String > qualifiers = trustedService . getCapturedQualifiers ( ) ; if ( ( eu . europa . esig . dss . validation . process . qualification . trust . ServiceQualification . isQcForEseal ( qualifiers ) ) || ( eu . europa . esig . dss . validation . process . qualification . trust . ServiceQualification . isQcForWSA ( qualifiers ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertFalse ( condition . isConsistent ( service ) )
testAllUserIDsCSV ( ) { java . lang . String response = target ( "/user/allIDs" ) . request ( ) . get ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { java . util . Map < java . lang . String , java . lang . Integer > map = getModel ( ) . getWords ( ) ; java . lang . Integer count ; synchronized ( map ) { count = map . get ( word ) ; } if ( count == null ) { throw new com . cloudera . oryx . api . serving . OryxServingException ( Response . Status . BAD_REQUEST , "No<sp>such<sp>word" ) ; } return count ; }
org . junit . Assert . assertEquals ( 7 , response . split ( "\n" ) . length )
willCreateAnInstantPropertyWithADefaultValue ( ) { final java . lang . String key = "test.instant.property.with.default" ; final java . time . Instant defaultValue = java . time . Instant . now ( ) ; final org . jivesoftware . util . SystemProperty < java . time . Instant > property = SystemProperty . Builder . ofType ( java . time . Instant . class ) . setKey ( key ) . setDefaultValue ( defaultValue ) . setDynamic ( true ) . build ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertThat ( property . getValue ( ) , org . hamcrest . CoreMatchers . is ( defaultValue ) )
doubleQuotesSinbleInsideTest ( ) { final org . opendaylight . yangtools . yang . model . api . SchemaContext schemaContext = org . opendaylight . yangtools . yang . stmt . StmtTestUtils . parseYangSources ( new java . io . File ( getClass ( ) . getResource ( "/bugs/bug6180/double-quotes-single-inside.yang" ) . toURI ( ) ) ) ; "<AssertPlaceHolder>" ; org . opendaylight . yangtools . yang . stmt . Bug6180Test . verifySingleQuotesExpression ( schemaContext ) ; } parseYangSources ( org . opendaylight . yangtools . yang . parser . spi . source . StatementStreamSource [ ] ) { return org . opendaylight . yangtools . yang . stmt . StmtTestUtils . parseYangSources ( StatementParserMode . DEFAULT_MODE , null , sources ) ; }
org . junit . Assert . assertNotNull ( schemaContext )
testRegexExpectedRightValueHeader ( ) { final org . pac4j . core . matching . HeaderMatcher matcher = new org . pac4j . core . matching . HeaderMatcher ( NAME , ".*A.*" ) ; final org . pac4j . core . context . MockWebContext context = org . pac4j . core . context . MockWebContext . create ( ) . addRequestHeader ( org . pac4j . core . matching . NAME , "BAC" ) ; "<AssertPlaceHolder>" ; } matches ( org . pac4j . core . context . WebContext ) { org . pac4j . core . util . CommonHelper . assertNotNull ( "methods" , methods ) ; final java . lang . String requestMethod = context . getRequestMethod ( ) ; for ( final org . pac4j . core . matching . HTTP_METHOD method : methods ) { if ( method . name ( ) . equalsIgnoreCase ( requestMethod ) ) { return true ; } } return false ; }
org . junit . Assert . assertTrue ( matcher . matches ( context ) )
testRecipientDisabledFor2ResourcesPresence ( ) { java . lang . String recipient = "recipient-1@localhost" ; tigase . xmpp . JID recp1 = tigase . xmpp . JID . jidInstanceNS ( ( recipient + "/res1" ) ) ; tigase . xmpp . JID recp2 = tigase . xmpp . JID . jidInstanceNS ( ( recipient + "/res2" ) ) ; tigase . xmpp . JID connId1 = tigase . xmpp . JID . jidInstanceNS ( "c2s@localhost/recipient1-res1" ) ; tigase . xmpp . JID connId2 = tigase . xmpp . JID . jidInstanceNS ( "c2s@localhost/recipient1-res2" ) ; tigase . xmpp . XMPPResourceConnection session1 = getSession ( connId1 , recp1 ) ; getSession ( connId2 , recp2 ) ; tigase . server . Packet p = tigase . server . Packet . packetInstance ( "presence" , "sender-1@localhost/res1" , recp1 . toString ( ) , StanzaType . chat ) ; p . setPacketTo ( connId1 ) ; java . util . ArrayDeque < tigase . server . Packet > results = new java . util . ArrayDeque < tigase . server . Packet > ( ) ; results . offer ( p ) ; tigase . server . Packet [ ] expected = results . toArray ( new tigase . server . Packet [ 0 ] ) ; mobileV3 . filter ( p , session1 , null , results ) ; tigase . server . Packet [ ] processed = results . toArray ( new tigase . server . Packet [ 0 ] ) ; "<AssertPlaceHolder>" ; } filter ( tigase . server . Packet , tigase . xmpp . impl . XMPPResourceConnection , tigase . db . NonAuthUserRepository , java . util . Queue ) { if ( ( ( ( sessionFromSM == null ) || ( ! ( sessionFromSM . isAuthorized ( ) ) ) ) || ( results == null ) ) || ( ( results . size ( ) ) == 0 ) ) { return ; } for ( java . util . Iterator < tigase . server . Packet > it = results . iterator ( ) ; it . hasNext ( ) ; ) { tigase . server . Packet res = it . next ( ) ; if ( ( res == null ) || ( ( res . getPacketTo ( ) ) == null ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . finest ( "packet<sp>without<sp>destination" ) ; } continue ; } tigase . xmpp . impl . XMPPResourceConnection session = sessionFromSM . getParentSession ( ) . getResourceForConnectionId ( res . getPacketTo ( ) ) ; if ( session == null ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . log ( Level . FINEST , "no<sp>session<sp>for<sp>destination<sp>{0}<sp>for<sp>packet<sp>{1}" , new java . lang . Object [ ] { res . getPacketTo ( ) . toString ( ) , res . toString ( ) } ) ; } continue ; } if ( ! ( isQueueEnabled ( session ) ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . finest ( "queue<sp>is<sp>no<sp>enabled" ) ; } flushQueue ( session , results ) ; continue ; } java . util . Queue < tigase . server . Packet > queue = ( ( java . util . Queue < tigase . server . Packet > ) ( session . getSessionData ( tigase . xmpp . impl . MobileV1 . QUEUE_KEY ) ) ) ; if ( filter ( session , res , queue ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . log ( Level . FINEST , "queuing<sp>packet<sp>=<sp>{0}" , res . toString ( ) ) ; } it . remove ( ) ; if ( ( queue . size ( ) ) > ( maxQueueSize ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . finest ( "sending<sp>packets<sp>from<sp>queue<sp>(OVERFLOW)" ) ; } tigase . server . Packet p ; while ( ( p = queue . poll ( ) ) != null ) { try { p . setPacketTo ( session . getConnectionId ( ) ) ; results . offer ( p ) ; } catch ( tigase . xmpp . impl . NoConnectionIdException ex ) { tigase . xmpp . impl . MobileV1 . log . log ( Level . FINEST , "should<sp>not<sp>happen,<sp>as<sp>connection<sp>is<sp>ready" , ex ) ; } } } } } }
org . junit . Assert . assertArrayEquals ( expected , processed )
testGetRuntimePathNoDependencies ( ) { final org . oscm . build . ant . PathBuilderTest . ProjectStub projectA = new org . oscm . build . ant . PathBuilderTest . ProjectStub ( "project-a" ) ; projectA . addLibraries ( org . oscm . build . ant . PathBuilderTest . LIB ) ; org . apache . tools . ant . types . Path path = createBuilder ( projectA ) . getRuntimePath ( ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( absospath ( "resources/result/work/project-a/classes" ) , absospath ( org . oscm . build . ant . PathBuilderTest . LIB ) ) ; "<AssertPlaceHolder>" ; } absospath ( java . lang . String ) { return new java . io . File ( path ) . getAbsolutePath ( ) ; }
org . junit . Assert . assertEquals ( expected , java . util . Arrays . asList ( path . list ( ) ) )
restartMasterAndReregisterWorker ( ) { long jobId = mJobMaster . run ( new alluxio . job . SleepJobConfig ( 1 ) ) ; alluxio . job . util . JobTestUtils . waitForJobStatus ( mJobMaster , jobId , Status . COMPLETED ) ; mJobMaster . stop ( ) ; mJobMaster . start ( true ) ; alluxio . util . CommonUtils . waitFor ( "Worker<sp>to<sp>register<sp>with<sp>restarted<sp>job<sp>master" , ( ) -> ! ( mJobMaster . getWorkerInfoList ( ) . isEmpty ( ) ) , alluxio . util . WaitForOptions . defaults ( ) . setTimeoutMs ( ( 10 * ( alluxio . Constants . SECOND_MS ) ) ) ) ; final long firstWorkerId = mJobMaster . getWorkerInfoList ( ) . get ( 0 ) . getId ( ) ; mLocalAlluxioJobCluster . restartWorker ( ) ; alluxio . util . CommonUtils . waitFor ( "Restarted<sp>worker<sp>to<sp>register<sp>with<sp>job<sp>master" , ( ) -> { List < alluxio . wire . WorkerInfo > workerInfo = mJobMaster . getWorkerInfoList ( ) ; return ( ! ( workerInfo . isEmpty ( ) ) ) && ( ( workerInfo . get ( 0 ) . getId ( ) ) != firstWorkerId ) ; } , alluxio . util . WaitForOptions . defaults ( ) . setTimeoutMs ( ( 10 * ( alluxio . Constants . SECOND_MS ) ) ) ) ; "<AssertPlaceHolder>" ; } getWorkerInfoList ( ) { java . util . List < alluxio . wire . WorkerInfo > workerInfoList = new java . util . ArrayList ( mWorkers . size ( ) ) ; try ( alluxio . resource . LockResource workersLockShared = new alluxio . resource . LockResource ( mWorkerRWLock . readLock ( ) ) ) { for ( alluxio . job . meta . MasterWorkerInfo masterWorkerInfo : mWorkers ) { workerInfoList . add ( masterWorkerInfo . generateClientWorkerInfo ( ) ) ; } } return workerInfoList ; }
org . junit . Assert . assertEquals ( 1 , mJobMaster . getWorkerInfoList ( ) . size ( ) )
testWalk ( ) { java . nio . file . Path root = new java . io . File ( "ftp.ncdc.noaa.gov/pub/data/gsod/1988" ) . toPath ( ) ; java . lang . Iterable < java . nio . file . Path > paths = org . opennms . newts . gsod . FileIterable . fileTreeWalker ( root ) ; for ( java . nio . file . Path p : paths ) { System . err . println ( p ) ; } java . util . List < java . nio . file . Path > results = com . google . common . collect . Lists . newArrayList ( ) ; com . google . common . collect . Iterables . addAll ( results , paths ) ; "<AssertPlaceHolder>" ; } size ( ) { return m_results . size ( ) ; }
org . junit . Assert . assertEquals ( 6 , results . size ( ) )
testRemove ( ) { com . liferay . change . tracking . model . CTEntryAggregate newCTEntryAggregate = addCTEntryAggregate ( ) ; _persistence . remove ( newCTEntryAggregate ) ; com . liferay . change . tracking . model . CTEntryAggregate existingCTEntryAggregate = _persistence . fetchByPrimaryKey ( newCTEntryAggregate . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertNull ( existingCTEntryAggregate )
testUnknown ( ) { java . lang . String unknownVar = org . freedesktop . BaseDirectory . get ( "UNKNOWN_AND_IMPOSSIBLE_XDG_VARIABLE" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { switch ( name ) { case org . freedesktop . BaseDirectory . XDG_CACHE_HOME : return org . freedesktop . BaseDirectory . getCacheHome ( ) ; case org . freedesktop . BaseDirectory . XDG_CONFIG_HOME : return org . freedesktop . BaseDirectory . getConfigHome ( ) ; case org . freedesktop . BaseDirectory . XDG_CONFIG_DIRS : return org . freedesktop . BaseDirectory . getConfigDirs ( ) ; case org . freedesktop . BaseDirectory . XDG_DATA_HOME : return org . freedesktop . BaseDirectory . getDataHome ( ) ; case org . freedesktop . BaseDirectory . XDG_DATA_DIRS : return org . freedesktop . BaseDirectory . getDataDirs ( ) ; case org . freedesktop . BaseDirectory . XDG_RUNTIME_DIR : return org . freedesktop . BaseDirectory . getRuntimeDir ( ) ; default : return null ; } }
org . junit . Assert . assertEquals ( null , unknownVar )
getLong ( ) { final java . lang . Integer value = 44 ; final io . trane . ndbc . value . IntegerValue wrapper = new io . trane . ndbc . value . IntegerValue ( value ) ; "<AssertPlaceHolder>" ; } getLong ( ) { return new java . lang . Long ( get ( ) ) ; }
org . junit . Assert . assertEquals ( new java . lang . Long ( value ) , wrapper . getLong ( ) )
putItemWithHashKeyAndRangeKeyWithoutTableName ( ) { com . amazonaws . services . dynamodb . model . KeySchema schema = new com . amazonaws . services . dynamodb . model . KeySchema ( new com . amazonaws . services . dynamodb . model . KeySchemaElement ( ) . withAttributeName ( "id" ) . withAttributeType ( ScalarAttributeType . S ) ) ; schema . setRangeKeyElement ( new com . amazonaws . services . dynamodb . model . KeySchemaElement ( ) . withAttributeName ( "range" ) . withAttributeType ( ScalarAttributeType . S ) ) ; createTable ( tableName , schema ) ; com . amazonaws . services . dynamodb . model . PutItemRequest request = new com . amazonaws . services . dynamodb . model . PutItemRequest ( ) . withItem ( createGenericItem ( ) ) ; try { getClient ( ) . putItem ( request ) ; "<AssertPlaceHolder>" ; } catch ( com . amazonaws . AmazonServiceException ase ) { } } putItem ( com . amazonaws . services . dynamodb . model . PutItemRequest ) { com . amazonaws . http . ExecutionContext executionContext = createExecutionContext ( putItemRequest ) ; com . amazonaws . util . AWSRequestMetrics awsRequestMetrics = executionContext . getAwsRequestMetrics ( ) ; com . amazonaws . Request < com . amazonaws . services . dynamodb . model . PutItemRequest > request = marshall ( putItemRequest , new com . amazonaws . services . dynamodb . model . transform . PutItemRequestMarshaller ( ) , executionContext . getAwsRequestMetrics ( ) ) ; request . setAWSRequestMetrics ( awsRequestMetrics ) ; com . amazonaws . transform . Unmarshaller < com . amazonaws . services . dynamodb . model . PutItemResult , com . amazonaws . transform . JsonUnmarshallerContext > unmarshaller = new com . amazonaws . services . dynamodb . model . transform . PutItemResultJsonUnmarshaller ( ) ; com . amazonaws . http . JsonResponseHandler < com . amazonaws . services . dynamodb . model . PutItemResult > responseHandler = new com . amazonaws . http . JsonResponseHandler < com . amazonaws . services . dynamodb . model . PutItemResult > ( unmarshaller ) ; return invoke ( request , responseHandler , executionContext ) ; }
org . junit . Assert . assertTrue ( false )
experimentTypeLearningCurvedFixedTest ( ) { builder . experiment ( ExperimentType . LEARNING_CURVE_FIXED_TEST_SET , "fixedTest" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return name ; }
org . junit . Assert . assertEquals ( builder . type . toString ( ) , ExperimentType . LEARNING_CURVE_FIXED_TEST_SET . toString ( ) )
testSchemaValidation ( ) { io . cdap . cdap . etl . api . Transform < io . cdap . cdap . api . data . format . StructuredRecord , io . cdap . cdap . api . data . format . StructuredRecord > transform = new io . cdap . plugin . Hasher ( new io . cdap . plugin . Hasher . Config ( "SHA512" , "a,b,e" ) ) ; io . cdap . cdap . etl . mock . common . MockPipelineConfigurer mockPipelineConfigurer = new io . cdap . cdap . etl . mock . common . MockPipelineConfigurer ( io . cdap . plugin . HasherTest . INPUT ) ; transform . configurePipeline ( mockPipelineConfigurer ) ; "<AssertPlaceHolder>" ; } getOutputSchema ( ) { java . util . List < io . cdap . cdap . api . data . schema . Schema . Field > fields = new java . util . ArrayList ( ) ; java . lang . String [ ] mappings = fieldTypeMapping . split ( "," ) ; for ( java . lang . String mapping : mappings ) { java . lang . String [ ] params = mapping . split ( ":" ) ; java . lang . String fieldName = params [ 0 ] . trim ( ) ; if ( com . google . common . base . Strings . isNullOrEmpty ( fieldName ) ) { throw new java . lang . IllegalArgumentException ( "Field<sp>name<sp>cannot<sp>be<sp>null<sp>or<sp>empty." ) ; } else if ( ( ( params . length ) < 2 ) || ( com . google . common . base . Strings . isNullOrEmpty ( params [ 1 ] ) ) ) { throw new java . lang . IllegalArgumentException ( ( "Type<sp>cannot<sp>be<sp>null.<sp>Please<sp>specify<sp>type<sp>for<sp>" + fieldName ) ) ; } io . cdap . cdap . api . data . schema . Schema . Field field = Schema . Field . of ( fieldName , io . cdap . cdap . api . data . schema . Schema . nullableOf ( io . cdap . cdap . api . data . schema . Schema . of ( Schema . Type . valueOf ( params [ 1 ] . trim ( ) . toUpperCase ( ) ) ) ) ) ; if ( fields . contains ( field ) ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "Field<sp>%s<sp>already<sp>has<sp>type<sp>specified.<sp>Duplicate<sp>field<sp>%s" , fieldName , fieldName ) ) ; } else { fields . add ( field ) ; } } return io . cdap . cdap . api . data . schema . Schema . recordOf ( "record" , fields ) ; }
org . junit . Assert . assertEquals ( io . cdap . plugin . HasherTest . INPUT , mockPipelineConfigurer . getOutputSchema ( ) )
whenStringDuplicateRemoveFromStringArrayThenResultStringArrayWithoutDuplicates ( ) { vkaretko . Task_5_3 . StringDuplicates stringDup = new vkaretko . Task_5_3 . StringDuplicates ( ) ; java . lang . String [ ] array = new java . lang . String [ ] { "test1" , "test2" , "test1" , "test3" , "test2" , "test4" } ; java . lang . String [ ] arrayWithoutDuplicates = new java . lang . String [ ] { "test1" , "test2" , "test3" , "test4" } ; "<AssertPlaceHolder>" ; } remove ( java . lang . String [ ] ) { int countDuplicates = 0 ; for ( int i = 0 ; i < ( ( array . length ) - 1 ) ; i ++ ) { if ( ( array [ i ] ) != null ) { for ( int j = i + 1 ; j < ( array . length ) ; j ++ ) { if ( array [ i ] . equals ( array [ j ] ) ) { array [ j ] = null ; countDuplicates ++ ; } } } } java . lang . String [ ] resultArray = new java . lang . String [ ( array . length ) - countDuplicates ] ; int index = 0 ; for ( java . lang . String element : array ) { if ( element != null ) { resultArray [ index ] = element ; index ++ ; } } return resultArray ; }
org . junit . Assert . assertThat ( stringDup . remove ( array ) , org . hamcrest . core . Is . is ( arrayWithoutDuplicates ) )
encodeIntegerIntoBytes ( ) { stubValueMeta . setType ( 5 ) ; java . lang . Object str = stubValueMeta . encodeColumnValue ( 1L , stubValueMeta ) ; "<AssertPlaceHolder>" ; } encodeColumnValue ( java . lang . Object , org . pentaho . di . core . row . ValueMetaInterface ) { return org . pentaho . hbase . shim . api . HBaseValueMeta . encodeColumnValue ( o , valueMetaInterface , this , hBaseBytesUtilShim ) ; }
org . junit . Assert . assertNotNull ( str )
testMemberOverwriteDenies ( ) { discord4j . core . object . util . PermissionSet base = discord4j . core . object . util . PermissionSet . of ( discord4j . core . util . SEND_MESSAGES ) ; java . util . List < discord4j . core . object . PermissionOverwrite > roleOverwrites = java . util . Collections . emptyList ( ) ; discord4j . core . object . PermissionOverwrite memberOverwrite = discord4j . core . util . PermissionUtilTest . overwrite ( discord4j . core . object . util . PermissionSet . none ( ) , discord4j . core . object . util . PermissionSet . of ( discord4j . core . util . SEND_MESSAGES ) ) ; discord4j . core . object . util . PermissionSet actual = discord4j . core . util . PermissionUtil . computePermissions ( base , null , roleOverwrites , memberOverwrite ) ; discord4j . core . object . util . PermissionSet expected = discord4j . core . object . util . PermissionSet . none ( ) ; "<AssertPlaceHolder>" ; } none ( ) { return discord4j . core . object . util . PermissionSet . NONE ; }
org . junit . Assert . assertEquals ( expected , actual )
isElementConsentedConsentsAffectSomeFieldsButNotElement ( ) { final org . xwiki . uiextension . UIExtension extension = mock ( org . xwiki . uiextension . UIExtension . class ) ; when ( extension . getId ( ) ) . thenReturn ( org . phenotips . consents . internal . DefaultConsentAuthorizerTest . FIELD_D_LABEL ) ; final org . phenotips . configuration . RecordElement element = mock ( org . phenotips . configuration . RecordElement . class ) ; when ( element . getExtension ( ) ) . thenReturn ( extension ) ; final java . util . Set < org . phenotips . consents . Consent > missingConsents = new java . util . HashSet ( ) ; missingConsents . add ( this . consentA ) ; missingConsents . add ( this . consentB ) ; when ( this . consentManager . getMissingConsentsForPatient ( this . patient ) ) . thenReturn ( missingConsents ) ; when ( this . consentA . affectsAllFields ( ) ) . thenReturn ( false ) ; when ( this . consentB . affectsAllFields ( ) ) . thenReturn ( false ) ; when ( this . consentA . affectsSomeFields ( ) ) . thenReturn ( true ) ; when ( this . consentB . affectsSomeFields ( ) ) . thenReturn ( true ) ; when ( this . consentA . getFields ( ) ) . thenReturn ( java . util . Arrays . asList ( org . phenotips . consents . internal . DefaultConsentAuthorizerTest . FIELD_A_LABEL , org . phenotips . consents . internal . DefaultConsentAuthorizerTest . FIELD_B_LABEL ) ) ; when ( this . consentB . getFields ( ) ) . thenReturn ( java . util . Collections . singletonList ( org . phenotips . consents . internal . DefaultConsentAuthorizerTest . FIELD_C_LABEL ) ) ; final boolean isElementConsented = this . component . isElementConsented ( element , this . patient ) ; "<AssertPlaceHolder>" ; } isElementConsented ( org . phenotips . configuration . RecordElement , org . phenotips . data . Patient ) { java . util . Set < org . phenotips . consents . Consent > missingConsents = this . consentManager . getMissingConsentsForPatient ( patient ) ; return this . isElementEnabled ( element , this . getNonConsentedFieldSet ( missingConsents ) ) ; }
org . junit . Assert . assertTrue ( isElementConsented )
testSendGetParameterRequest ( ) { java . lang . String expected = "\r\n" 3 + ( ( ( ( ( ( ( "\r\n" 1 + "cseq:<sp>3\r\n" ) + "\r\n" 2 ) + "content-type:<sp>text/parameters\r\n" ) + "\r\n" ) + "stream_state\r\n" ) + "position\r\n" ) + "\r\n" 0 ) ; byte [ ] content = ( "stream_state\r\n" + ( "position\r\n" + "\r\n" 0 ) ) . getBytes ( CharsetUtil . UTF_8 ) ; io . netty . handler . codec . http . FullHttpRequest request = new io . netty . handler . codec . http . DefaultFullHttpRequest ( RtspVersions . RTSP_1_0 , RtspMethods . GET_PARAMETER , "rtsp://172.10.20.30:554" ) ; request . headers ( ) . add ( RtspHeaderNames . SESSION , "2547019973447939919" ) ; request . headers ( ) . add ( RtspHeaderNames . CSEQ , "3" ) ; request . headers ( ) . add ( RtspHeaderNames . CONTENT_LENGTH , ( "" + ( content . length ) ) ) ; request . headers ( ) . add ( RtspHeaderNames . CONTENT_TYPE , "text/parameters" ) ; request . content ( ) . writeBytes ( content ) ; io . netty . channel . embedded . EmbeddedChannel ch = new io . netty . channel . embedded . EmbeddedChannel ( new io . netty . handler . codec . rtsp . RtspEncoder ( ) ) ; ch . writeOutbound ( request ) ; io . netty . buffer . ByteBuf buf = ch . readOutbound ( ) ; java . lang . String actual = buf . toString ( CharsetUtil . UTF_8 ) ; buf . release ( ) ; "<AssertPlaceHolder>" ; } release ( ) { io . netty . util . internal . PlatformDependent . freeDirectBuffer ( byteBuffer ) ; return true ; }
org . junit . Assert . assertEquals ( expected , actual )
test3_3 ( ) { int v = calcHits ( 1 , new int [ ] { 1 , 2 , 3 } ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 0 , v )
testServerResourcesPage ( ) { final java . lang . String jndiName = "jdbcResource" + ( generateRandomString ( ) ) ; final java . lang . String description = "devtest<sp>test<sp>for<sp>server->resources<sp>page-<sp>" + jndiName ; final java . lang . String tableID = "jdbcResource" 1 ; org . glassfish . admingui . devtests . StandaloneTest standaloneTest = new org . glassfish . admingui . devtests . StandaloneTest ( ) ; org . glassfish . admingui . devtests . ClusterTest clusterTest = new org . glassfish . admingui . devtests . ClusterTest ( ) ; standaloneTest . deleteAllStandaloneInstances ( ) ; clusterTest . deleteAllClusters ( ) ; org . glassfish . admingui . devtests . JdbcTest jdbcTest = new org . glassfish . admingui . devtests . JdbcTest ( ) ; jdbcTest . createJDBCResource ( jndiName , description , "server" , MonitoringTest . TARGET_SERVER_TYPE ) ; gotoServerResourcesPage ( ) ; waitForPageLoad ( jndiName , org . glassfish . admingui . devtests . TIMEOUT ) ; "<AssertPlaceHolder>" ; int jdbcCount = getTableRowCountByValue ( tableID , "jdbcResource" 0 , "col3:type" ) ; int customCount = getTableRowCountByValue ( tableID , "Custom<sp>Resources" , "col3:type" ) ; selectDropdownOption ( "propertyForm:resourcesTable:topActionsGroup1:filter_list" , "Custom<sp>Resources" ) ; waitForTableRowCount ( tableID , customCount ) ; gotoServerResourcesPage ( ) ; selectDropdownOption ( "propertyForm:resourcesTable:topActionsGroup1:filter_list" , "jdbcResource" 0 ) ; waitForTableRowCount ( tableID , jdbcCount ) ; gotoServerResourcesPage ( ) ; selectTableRowByValue ( "jdbcResource" 1 , jndiName ) ; pressButton ( "propertyForm:resourcesTable:topActionsGroup1:button1" ) ; waitForButtonEnabledMessage ( "propertyForm:resourcesTable:topActionsGroup1:button1" ) ; gotoServerResourcesPage ( ) ; selectTableRowByValue ( "jdbcResource" 1 , jndiName ) ; pressButton ( "propertyForm:resourcesTable:topActionsGroup1:button2" ) ; waitForButtonDisabledMessage ( "propertyForm:resourcesTable:topActionsGroup1:button1" ) ; jdbcTest . deleteJDBCResource ( jndiName , "server" , MonitoringTest . TARGET_SERVER_TYPE ) ; } isTextPresent ( java . lang . String ) { boolean isTextPresent = false ; try { isTextPresent = super . isTextPresent ( string ) ; } catch ( java . lang . Exception e ) { sleep ( 1000 ) ; isTextPresent = super . isTextPresent ( string ) ; } return isTextPresent ; }
org . junit . Assert . assertTrue ( isTextPresent ( jndiName ) )
testParseFail ( ) { java . lang . String test = "2005-2-6" ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { try { if ( ( value == null ) || ( value . equals ( "" ) ) ) { return new java . math . BigInteger ( "0" ) ; } return new java . math . BigInteger ( value ) ; } catch ( java . lang . NumberFormatException e ) { throw new com . ewcms . common . convert . ConvertException ( e ) ; } }
org . junit . Assert . assertNull ( handler . parse ( test ) )
testGetExpressionVariableAsIntegerBlankValue ( ) { org . activiti . engine . delegate . Expression expression = mock ( org . activiti . engine . delegate . Expression . class ) ; org . activiti . engine . delegate . DelegateExecution execution = mock ( org . activiti . engine . delegate . DelegateExecution . class ) ; when ( expression . getValue ( execution ) ) . thenReturn ( org . finra . herd . service . activiti . BLANK_TEXT ) ; java . lang . Integer result = activitiHelper . getExpressionVariableAsInteger ( expression , execution , org . finra . herd . service . activiti . VARIABLE_NAME , org . finra . herd . service . activiti . NO_VARIABLE_REQUIRED ) ; "<AssertPlaceHolder>" ; } getExpressionVariableAsInteger ( org . activiti . engine . delegate . Expression , org . activiti . engine . delegate . DelegateExecution , java . lang . String , boolean ) { java . lang . Integer variableInteger = null ; java . lang . String variableString = getExpressionVariableAsString ( expression , execution ) ; if ( isRequired && ( org . apache . commons . lang3 . StringUtils . isBlank ( variableString ) ) ) { throw new java . lang . IllegalArgumentException ( ( ( "\"" + variableName ) + "\"<sp>must<sp>be<sp>specified." ) ) ; } if ( isRequired || ( org . apache . commons . lang3 . StringUtils . isNotBlank ( variableString ) ) ) { try { variableInteger = java . lang . Integer . parseInt ( getExpressionVariableAsString ( expression , execution ) ) ; } catch ( java . lang . Exception ex ) { throw new java . lang . IllegalArgumentException ( ( ( "\"" + variableName ) + "\"<sp>must<sp>be<sp>a<sp>valid<sp>integer<sp>value." ) , ex ) ; } } return variableInteger ; }
org . junit . Assert . assertNull ( result )
isNullOrWhiteSpace_input_null ( ) { java . lang . String value = null ; java . lang . Boolean expResult = true ; java . lang . Boolean result = com . microsoft . azure . sdk . iot . service . Tools . isNullOrWhiteSpace ( value ) ; "<AssertPlaceHolder>" ; } isNullOrWhiteSpace ( java . lang . String ) { java . lang . Boolean retVal ; if ( value == null ) { retVal = true ; } else { retVal = com . microsoft . azure . sdk . iot . service . Tools . isNullOrEmpty ( value . trim ( ) ) ; } return retVal ; }
org . junit . Assert . assertEquals ( expResult , result )
testTitle ( ) { com . urbanairship . api . push . parse . notification . ios . IOSDevicePayload payload = com . urbanairship . api . push . parse . notification . ios . IOSDevicePayload . newBuilder ( ) . setAlert ( "alert" ) . setTitle ( "title" ) . build ( ) ; java . lang . String json = com . urbanairship . api . push . parse . notification . ios . PayloadSerializerTest . mapper . writeValueAsString ( payload ) ; java . lang . String expected = "{\"alert\":\"alert\",\"title\":\"title\"}" ; "<AssertPlaceHolder>" ; } build ( ) { com . google . common . base . Preconditions . checkArgument ( argumentValidator ( scheduledTimestamp , bestTime ) , "Either<sp>scheduled_time<sp>or<sp>best_time<sp>must<sp>be<sp>set." ) ; return new com . urbanairship . api . schedule . model . Schedule ( this ) ; }
org . junit . Assert . assertEquals ( expected , json )
testTrackBotRequests ( ) { request . setTrackBotRequests ( true ) ; "<AssertPlaceHolder>" ; } getTrackBotRequests ( ) { return getBooleanParameter ( org . piwik . java . tracking . PiwikRequest . TRACK_BOT_REQUESTS ) ; }
org . junit . Assert . assertEquals ( true , request . getTrackBotRequests ( ) )
statusEverything ( ) { when ( bulletinRepo . findBulletins ( anyObject ( ) ) ) . thenReturn ( java . util . Collections . emptyList ( ) ) ; populateControllerService ( true , false ) ; populateInstance ( true ) ; populateSystemDiagnostics ( ) ; populateReportingTask ( false , true ) ; populateConnection ( ) ; populateProcessor ( true , false ) ; populateRemoteProcessGroup ( false , true ) ; java . lang . String statusRequest = "controllerServices:bulletins,health;<sp>processor:all:health,stats,bulletins;<sp>instance:bulletins,health,stats<sp>;<sp>systemDiagnostics:garbagecollection,<sp>heap,<sp>" + ( "processorstats,<sp>contentrepositoryusage,<sp>flowfilerepositoryusage;<sp>connection:all:health,stats;<sp>provenanceReporting:health,bulletins;<sp>remoteProcessGroup:all:health,<sp>" + "bulletins,<sp>inputPorts,<sp>outputPorts,<sp>stats" ) ; org . apache . nifi . minifi . commons . status . FlowStatusReport actual = org . apache . nifi . minifi . status . StatusConfigReporter . getStatus ( mockFlowController , statusRequest , org . slf4j . LoggerFactory . getLogger ( org . apache . nifi . minifi . status . StatusConfigReporterTest . class ) ) ; org . apache . nifi . minifi . commons . status . FlowStatusReport expected = new org . apache . nifi . minifi . commons . status . FlowStatusReport ( ) ; expected . setErrorsGeneratingReport ( Collections . EMPTY_LIST ) ; addControllerServiceStatus ( expected , true , true , true , false ) ; addInstanceStatus ( expected , true , true , true , true ) ; addSystemDiagnosticStatus ( expected , true , true , true , true , true ) ; addReportingTaskStatus ( expected , true , true , true , false ) ; addConnectionStatus ( expected , true , true ) ; addProcessorStatus ( expected , true , true , true , true , false ) ; addExpectedRemoteProcessGroupStatus ( expected , true , true , true , true , true , false ) ; "<AssertPlaceHolder>" ; } addExpectedRemoteProcessGroupStatus ( org . apache . nifi . minifi . commons . status . FlowStatusReport , boolean , boolean , boolean , boolean , boolean , boolean ) { org . apache . nifi . minifi . commons . status . rpg . RemoteProcessGroupStatusBean expectedRemoteProcessGroupStatus = new org . apache . nifi . minifi . commons . status . rpg . RemoteProcessGroupStatusBean ( ) ; expectedRemoteProcessGroupStatus . setName ( "rpg1" ) ; if ( addHealth ) { org . apache . nifi . minifi . commons . status . rpg . RemoteProcessGroupHealth remoteProcessGroupHealth = new org . apache . nifi . minifi . commons . status . rpg . RemoteProcessGroupHealth ( ) ; remoteProcessGroupHealth . setTransmissionStatus ( "Transmitting" ) ; remoteProcessGroupHealth . setHasBulletins ( populateBulletins ) ; remoteProcessGroupHealth . setActivePortCount ( 1 ) ; remoteProcessGroupHealth . setInactivePortCount ( 2 ) ; expectedRemoteProcessGroupStatus . setRemoteProcessGroupHealth ( remoteProcessGroupHealth ) ; } if ( addBulletins ) { if ( populateBulletins ) { org . apache . nifi . minifi . commons . status . common . BulletinStatus bulletinStatus = new org . apache . nifi . minifi . commons . status . common . BulletinStatus ( ) ; bulletinStatus . setMessage ( "Bulletin<sp>message" ) ; bulletinStatus . setTimestamp ( new java . util . Date ( 1464019245000L ) ) ; expectedRemoteProcessGroupStatus . setBulletinList ( java . util . Collections . singletonList ( bulletinStatus ) ) ; } else { expectedRemoteProcessGroupStatus . setBulletinList ( Collections . EMPTY_LIST ) ; } } if ( addInputPort ) { org . apache . nifi . minifi . commons . status . rpg . PortStatus expectedInputPortStatus = new org . apache . nifi . minifi . commons . status . rpg . PortStatus ( ) ; expectedInputPortStatus . setName ( "inputPort" ) ; expectedInputPortStatus . setTargetExists ( true ) ; expectedInputPortStatus . setTargetRunning ( false ) ; expectedRemoteProcessGroupStatus . setInputPortStatusList ( java . util . Collections . singletonList ( expectedInputPortStatus ) ) ; } if ( addOutputPort ) { org . apache . nifi . minifi . commons . status . rpg . PortStatus expectedOutputPortStatus = new org . apache . nifi . minifi . commons . status . rpg . PortStatus ( ) ; expectedOutputPortStatus . setName ( "outputPort" ) ; expectedOutputPortStatus . setTargetExists ( true ) ; expectedOutputPortStatus . setTargetRunning ( false ) ; expectedRemoteProcessGroupStatus . setOutputPortStatusList ( java . util . Collections . singletonList ( expectedOutputPortStatus ) ) ; } if ( addStats ) { org . apache . nifi . minifi . commons . status . rpg . RemoteProcessGroupStats remoteProcessGroupStats = new org . apache . nifi . minifi . commons . status . rpg . RemoteProcessGroupStats ( ) ; remoteProcessGroupStats . setActiveThreads ( 3 ) ; remoteProcessGroupStats . setSentContentSize ( 4L ) ; remoteProcessGroupStats . setSentCount ( 5 ) ; expectedRemoteProcessGroupStatus . setRemoteProcessGroupStats ( remoteProcessGroupStats ) ; } flowStatusReport . setRemoteProcessGroupStatusList ( java . util . Collections . singletonList ( expectedRemoteProcessGroupStatus ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
passOverTest ( ) { soot . jimple . infoflow . IInfoflow infoflow = initInfoflow ( ) ; java . util . List < java . lang . String > epoints = new java . util . ArrayList < java . lang . String > ( ) ; epoints . add ( "<soot.jimple.infoflow.test.OtherTestCode:<sp>void<sp>passOverTest()>" ) ; infoflow . computeInfoflow ( appPath , libPath , epoints , sources , sinks ) ; checkInfoflow ( infoflow , 1 ) ; "<AssertPlaceHolder>" ; } getResults ( ) { return this . results ; }
org . junit . Assert . assertEquals ( 1 , infoflow . getResults ( ) . size ( ) )
testUnion ( ) { java . lang . String s = "SELECT<sp>a,<sp>b<sp>from<sp>dbo.test<sp>union<sp>select<sp>c,d<sp>from<sp>dbo.test2" ; int result = calculate ( s ) ; "<AssertPlaceHolder>" ; } calculate ( java . lang . String ) { org . sonar . plugins . tsql . antlr . AntlrContext result = org . sonar . plugins . tsql . helpers . AntlrUtils . getRequest ( s ) ; org . sonar . plugins . tsql . antlr . visitors . CComplexityVisitor vv = new org . sonar . plugins . tsql . antlr . visitors . CComplexityVisitor ( ) ; org . sonar . plugins . tsql . antlr . visitors . CustomTreeVisitor visitor = new org . sonar . plugins . tsql . antlr . visitors . CustomTreeVisitor ( vv ) ; visitor . apply ( result . getRoot ( ) ) ; return vv . getMeasure ( ) ; }
org . junit . Assert . assertEquals ( 6 , result )
orAllOf ( ) { "<AssertPlaceHolder>" ; } or ( com . querydsl . core . types . dsl . Predicate ) { right = ( ( com . querydsl . core . types . dsl . Predicate ) ( com . querydsl . core . types . dsl . ExpressionUtils . extract ( right ) ) ) ; if ( right != null ) { return com . querydsl . core . types . dsl . Expressions . booleanOperation ( Ops . OR , mixin , right ) ; } else { return this ; } }
org . junit . Assert . assertEquals ( a . or ( b . and ( c ) ) , a . orAllOf ( b , c ) )
overlaps10 ( ) { net . time4j . PlainDate startA = net . time4j . PlainDate . of ( 2014 , 5 , 13 ) ; net . time4j . PlainDate endA = net . time4j . PlainDate . of ( 2014 , 5 , 15 ) ; net . time4j . PlainDate startB = net . time4j . PlainDate . of ( 2014 , 5 , 12 ) ; net . time4j . PlainDate endB = net . time4j . PlainDate . of ( 2014 , 5 , 17 ) ; net . time4j . range . DateInterval a = net . time4j . range . DateInterval . between ( startA , endA ) ; net . time4j . range . DateInterval b = net . time4j . range . DateInterval . between ( startB , endB ) ; "<AssertPlaceHolder>" ; } overlaps ( I extends net . time4j . range . IsoInterval ) { if ( ( other . getStart ( ) . isInfinite ( ) ) || ( this . end . isInfinite ( ) ) ) { return false ; } T startA = this . getClosedFiniteStart ( ) ; T startB = other . getClosedFiniteStart ( ) ; if ( ( startA != null ) && ( ! ( startA . isBefore ( startB ) ) ) ) { return false ; } T endA = this . end . getTemporal ( ) ; T endB = other . getEnd ( ) . getTemporal ( ) ; if ( this . getFactory ( ) . isCalendrical ( ) ) { if ( this . end . isOpen ( ) ) { endA = this . getTimeLine ( ) . stepBackwards ( endA ) ; } if ( ( endA == null ) || ( endA . isBefore ( startB ) ) ) { return false ; } else if ( endB == null ) { return true ; } if ( other . getEnd ( ) . isOpen ( ) ) { endB = this . getTimeLine ( ) . stepBackwards ( endB ) ; } } else { if ( this . end . isClosed ( ) ) { endA = this . getTimeLine ( ) . stepForward ( endA ) ; if ( endA == null ) { return endB == null ; } } if ( ! ( endA . isAfter ( startB ) ) ) { return false ; } if ( other . getEnd ( ) . isClosed ( ) ) { endB = this . getTimeLine ( ) . stepForward ( endB ) ; } } return ( endB == null ) || ( endA . isBefore ( endB ) ) ; }
org . junit . Assert . assertThat ( a . overlaps ( b ) , org . hamcrest . CoreMatchers . is ( false ) )
methodRuleIsIntroducedAndEvaluatedOnSubclass ( ) { org . junit . rules . ClassRulesTest . MethodExampleTestWithClassRule . counter . count = 0 ; org . junit . runner . JUnitCore . runClasses ( org . junit . rules . ClassRulesTest . MethodSubclassOfTestWithClassRule . class ) ; "<AssertPlaceHolder>" ; } runClasses ( java . lang . Class [ ] ) { return org . junit . runner . JUnitCore . runClasses ( org . junit . runner . JUnitCore . defaultComputer ( ) , classes ) ; }
org . junit . Assert . assertEquals ( 1 , org . junit . rules . ClassRulesTest . MethodExampleTestWithClassRule . counter . count )
shouldRebuildDeletedLabelScanStoreOnStartup ( ) { org . neo4j . graphdb . Node node1 = createLabeledNode ( org . neo4j . graphdb . NativeLabelScanStoreChaosIT . Labels . First ) ; org . neo4j . graphdb . Node node2 = createLabeledNode ( org . neo4j . graphdb . NativeLabelScanStoreChaosIT . Labels . First ) ; org . neo4j . graphdb . Node node3 = createLabeledNode ( org . neo4j . graphdb . NativeLabelScanStoreChaosIT . Labels . First ) ; deleteNode ( node2 ) ; dbRule . restartDatabase ( deleteTheLabelScanStoreIndex ( ) ) ; "<AssertPlaceHolder>" ; } getAllNodesWithLabel ( org . neo4j . graphdb . Label ) { try ( org . neo4j . graphdb . Transaction ignored = dbRule . getGraphDatabaseAPI ( ) . beginTx ( ) ) { return asSet ( dbRule . getGraphDatabaseAPI ( ) . findNodes ( label ) ) ; } }
org . junit . Assert . assertEquals ( asSet ( node1 , node3 ) , getAllNodesWithLabel ( org . neo4j . graphdb . NativeLabelScanStoreChaosIT . Labels . First ) )
shouldGetSessionFromSuppliedPippoWebContext ( ) { when ( mockRouteContext . getSession ( ) ) . thenReturn ( mockSession ) ; when ( mockPippoWebContext . getRouteContext ( ) ) . thenReturn ( mockRouteContext ) ; ro . pippo . pac4j . PippoSessionStore sessionStore = new ro . pippo . pac4j . PippoSessionStore ( ) ; ro . pippo . core . Session session = sessionStore . getSession ( mockPippoWebContext ) ; "<AssertPlaceHolder>" ; verify ( mockRouteContext , times ( 1 ) ) . getSession ( ) ; verify ( mockPippoWebContext , times ( 1 ) ) . getRouteContext ( ) ; } getSession ( boolean ) { if ( ( session ) == null ) { javax . servlet . http . HttpSession httpSession = httpServletRequest . getSession ( create ) ; if ( httpSession != null ) { session = new ro . pippo . core . Session ( httpSession ) ; } } return session ; }
org . junit . Assert . assertThat ( session , org . hamcrest . core . Is . is ( mockSession ) )
testGetParametersWithDefaultEntityAndDIsabledDefaults ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . asset . type . AssetType entity = new org . lnu . is . domain . asset . type . AssetType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . journal . model . JournalContentSearch missingJournalContentSearch = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
org . junit . Assert . assertNull ( missingJournalContentSearch )
testSubmitWithImmediateFlagAndCheckIfCollected ( ) { com . jitlogic . zorka . core . spy . SpyDefinition sdef = engine . add ( spy . instance ( "x" ) . onEnter ( spy . fetchTime ( "E0" ) ) ) . onSubmit ( collector ) ; com . jitlogic . zorka . core . spy . SpyContext ctx = engine . lookup ( new com . jitlogic . zorka . core . spy . SpyContext ( sdef , "com.TClass" , "tMethod" , "()V" , 1 ) ) ; submitter . submit ( com . jitlogic . zorka . core . test . spy . ON_ENTER , ctx . getId ( ) , com . jitlogic . zorka . core . test . spy . SF_IMMEDIATE , new java . lang . Object [ ] { 1L } ) ; "<AssertPlaceHolder>" ; } size ( ) { return sequence . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , collector . size ( ) )
resolvesTypeWithOneMatchingTransformer ( ) { org . mule . runtime . core . internal . registry . MuleRegistry muleRegistry = mock ( org . mule . runtime . core . internal . registry . MuleRegistry . class ) ; when ( muleContext . getRegistry ( ) ) . thenReturn ( muleRegistry ) ; org . mule . runtime . core . api . transformer . Transformer aToBConverter = new org . mule . runtime . core . internal . transformer . builder . MockConverterBuilder ( ) . from ( dataTypeA ) . to ( dataTypeB ) . build ( ) ; java . util . ArrayList < org . mule . runtime . core . api . transformer . Transformer > transformers = new java . util . ArrayList ( ) ; transformers . add ( aToBConverter ) ; when ( muleRegistry . lookupTransformers ( dataTypeA , dataTypeB ) ) . thenReturn ( transformers ) ; org . mule . runtime . core . internal . registry . TypeBasedTransformerResolver resolver = new org . mule . runtime . core . internal . registry . TypeBasedTransformerResolver ( ) ; resolver . setMuleContext ( muleContext ) ; org . mule . runtime . core . api . transformer . Transformer resolvedTransformer = resolver . resolve ( dataTypeA , dataTypeB ) ; "<AssertPlaceHolder>" ; } resolve ( org . mule . runtime . extension . api . runtime . operation . ExecutionContext , java . lang . Class [ ] ) { java . util . function . Supplier < java . lang . Object > [ ] parameterValues = new java . util . function . Supplier [ argumentResolvers . length ] ; int i = 0 ; for ( org . mule . runtime . module . extension . internal . runtime . resolver . ArgumentResolver < ? > argumentResolver : argumentResolvers ) { parameterValues [ i ] = wrapParameterResolution ( parameterTypes [ i ] , argumentResolver . resolve ( executionContext ) ) ; i ++ ; } return parameterValues ; }
org . junit . Assert . assertEquals ( aToBConverter , resolvedTransformer )
testConstructor ( ) { de . komoot . photon . query . TagFilterQueryBuilder photonQueryBuilder = de . komoot . photon . query . PhotonQueryBuilder . builder ( "berlin" , "en" ) ; java . io . InputStream resourceAsStream = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "json_queries/test_base_query.json" ) ; java . lang . String expectedJsonString = org . apache . commons . io . IOUtils . toString ( resourceAsStream ) ; java . lang . String actualJsonString = new de . komoot . photon . utils . QueryToJson ( ) . convert ( photonQueryBuilder . buildQuery ( ) ) ; org . codehaus . jackson . JsonNode actualJson = this . readJson ( actualJsonString ) ; org . codehaus . jackson . JsonNode expectedJson = this . readJson ( expectedJsonString ) ; "<AssertPlaceHolder>" ; } readJson ( java . lang . String ) { org . codehaus . jackson . map . ObjectMapper objectMapper = new org . codehaus . jackson . map . ObjectMapper ( ) ; objectMapper . configure ( SerializationConfig . Feature . INDENT_OUTPUT , true ) ; return objectMapper . readTree ( jsonString ) ; }
org . junit . Assert . assertEquals ( expectedJson , actualJson )
testSetAdjacencySids ( ) { config . setAdjacencySids ( adjacencySids2 ) ; "<AssertPlaceHolder>" ; } adjacencySids ( ) { if ( ! ( object . has ( org . onosproject . segmentrouting . config . SegmentRoutingDeviceConfig . ADJSIDS ) ) ) { return null ; } java . util . Map < java . lang . Integer , java . util . Set < java . lang . Integer > > adjacencySids = new java . util . HashMap ( ) ; com . fasterxml . jackson . databind . node . ArrayNode adjacencySidsNode = ( ( com . fasterxml . jackson . databind . node . ArrayNode ) ( object . path ( org . onosproject . segmentrouting . config . SegmentRoutingDeviceConfig . ADJSIDS ) ) ) ; for ( com . fasterxml . jackson . databind . JsonNode adjacencySidNode : adjacencySidsNode ) { int asid = adjacencySidNode . path ( org . onosproject . segmentrouting . config . SegmentRoutingDeviceConfig . ADJSID ) . asInt ( ( - 1 ) ) ; if ( asid == ( - 1 ) ) { return null ; } java . util . HashSet < java . lang . Integer > ports = new java . util . HashSet ( ) ; com . fasterxml . jackson . databind . node . ArrayNode portsNode = ( ( com . fasterxml . jackson . databind . node . ArrayNode ) ( adjacencySidNode . path ( org . onosproject . segmentrouting . config . SegmentRoutingDeviceConfig . PORTS ) ) ) ; for ( com . fasterxml . jackson . databind . JsonNode portNode : portsNode ) { int port = portNode . asInt ( ( - 1 ) ) ; if ( port == ( - 1 ) ) { return null ; } ports . add ( port ) ; } adjacencySids . put ( asid , ports ) ; } return com . google . common . collect . ImmutableMap . copyOf ( adjacencySids ) ; }
org . junit . Assert . assertThat ( config . adjacencySids ( ) , org . hamcrest . Matchers . is ( adjacencySids2 ) )
testDecorateGrid ( ) { org . kie . workbench . common . stunner . lienzo . toolbox . items . decorator . BoxDecorator decorator = spy ( ToolboxFactory . INSTANCE . decorators ( ) . box ( ) ) ; org . kie . workbench . common . stunner . lienzo . toolbox . items . impl . ButtonGridItemImpl cascade = tested . decorateGrid ( decorator ) ; "<AssertPlaceHolder>" ; verify ( toolbox , times ( 1 ) ) . decorate ( eq ( decorator ) ) ; verify ( registrations , times ( 4 ) ) . register ( any ( com . google . gwt . event . shared . HandlerRegistration . class ) ) ; } decorateGrid ( org . kie . workbench . common . stunner . lienzo . toolbox . items . DecoratorItem ) { removeDecoratorHandlers ( ) ; toolbox . decorate ( decorator ) ; if ( decorator instanceof org . kie . workbench . common . stunner . lienzo . toolbox . items . AbstractDecoratorItem ) { final org . kie . workbench . common . stunner . lienzo . toolbox . items . AbstractDecoratorItem instance = ( ( org . kie . workbench . common . stunner . lienzo . toolbox . items . AbstractDecoratorItem ) ( decorator ) ) ; decoratorHandlers [ 0 ] = instance . asPrimitive ( ) . setListening ( true ) . addNodeMouseEnterHandler ( ( event ) -> itemFocusCallback . run ( ) ) ; decoratorHandlers [ 1 ] = instance . asPrimitive ( ) . addNodeMouseExitHandler ( ( event ) -> itemUnFocusCallback . run ( ) ) ; registrations ( ) . register ( decoratorHandlers [ 0 ] ) ; registrations ( ) . register ( decoratorHandlers [ 1 ] ) ; } return this ; }
org . junit . Assert . assertEquals ( tested , cascade )
testWorkflowCleanUp ( ) { createWorkflowsThenWaitForCleanup ( ) ; org . nuxeo . ecm . core . api . DocumentModelList cancelled = session . query ( org . nuxeo . ecm . restapi . server . WorkflowEndpointTest . CANCELLED_WORKFLOWS ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return false ; }
org . junit . Assert . assertTrue ( cancelled . isEmpty ( ) )
getParentRegardlessOfScheme_priority ( ) { org . apache . hadoop . fs . Path path = new org . apache . hadoop . fs . Path ( "proto://host1/foo/bar/baz" ) ; java . util . ArrayList < org . apache . hadoop . fs . Path > candidates = new java . util . ArrayList ( ) ; org . apache . hadoop . fs . Path expectedPath ; candidates . add ( new org . apache . hadoop . fs . Path ( "proto://host1/" ) ) ; candidates . add ( ( expectedPath = new org . apache . hadoop . fs . Path ( "proto://host1/foo" ) ) ) ; org . apache . hadoop . fs . Path res = org . apache . hadoop . hive . common . FileUtils . getParentRegardlessOfScheme ( path , candidates ) ; "<AssertPlaceHolder>" ; } getParentRegardlessOfScheme ( org . apache . hadoop . fs . Path , java . util . Collection ) { org . apache . hadoop . fs . Path schemalessPath = org . apache . hadoop . fs . Path . getPathWithoutSchemeAndAuthority ( path ) ; for ( ; ( path != null ) && ( schemalessPath != null ) ; path = path . getParent ( ) , schemalessPath = schemalessPath . getParent ( ) ) { if ( candidates . contains ( path ) ) return path ; if ( candidates . contains ( schemalessPath ) ) return schemalessPath ; } return null ; }
org . junit . Assert . assertEquals ( expectedPath , res )
formsCanBeNull ( ) { org . wikidata . wdtk . datamodel . implementation . LexemeDocument doc = new org . wikidata . wdtk . datamodel . implementation . LexemeDocumentImpl ( lid , lexCat , language , lemmaList , statementGroups , null , senses , 1234 ) ; "<AssertPlaceHolder>" ; } getForms ( ) { return forms ; }
org . junit . Assert . assertTrue ( doc . getForms ( ) . isEmpty ( ) )
testToString ( ) { animation . addAnimation ( "fadeIn" , 2000 , "linear" ) ; java . lang . String expected = "CssAnimation{<sp>fadeIn<sp>2000ms<sp>linear<sp>}" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuffer buf = new java . lang . StringBuffer ( "CheatSheetCollection,<sp>" ) ; buf . append ( childCollections . size ( ) ) ; buf . append ( "<sp>children,<sp>" ) ; buf . append ( cheatsheets . size ( ) ) ; buf . append ( "<sp>cheatsheets" ) ; return buf . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , animation . toString ( ) )
testScalarMulCF2 ( ) { org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 12 , 12 , DataType . DOUBLE ) . reshape ( 'c' , 3 , 4 ) ; org . nd4j . linalg . api . ndarray . INDArray outC = org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . api . ops . impl . scalar . ScalarMultiplication ( in . dup ( 'c' ) , 2.0 ) ) ; org . nd4j . linalg . api . ndarray . INDArray outF = org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . api . ops . impl . scalar . ScalarMultiplication ( in . dup ( 'f' ) , 2.0 ) ) ; "<AssertPlaceHolder>" ; } dup ( org . nd4j . linalg . api . ndarray . INDArray [ ] ) { org . nd4j . linalg . api . ndarray . INDArray [ ] dupHistory = new org . nd4j . linalg . api . ndarray . INDArray [ history . length ] ; for ( int i = 0 ; i < ( history . length ) ; i ++ ) { dupHistory [ i ] = history [ i ] . dup ( ) ; } return dupHistory ; }
org . junit . Assert . assertEquals ( outC , outF )
testSDiff ( ) { doCmdTest ( new org . cyy . fw . nedis . test . cmd . TestAction ( ) { @ org . cyy . fw . nedis . test . cmd . Override public void doTest ( ) throws org . cyy . fw . nedis . test . cmd . InterruptedException , org . cyy . fw . nedis . util . NedisException { client . flushAll ( null ) ; java . lang . Thread . sleep ( org . cyy . fw . nedis . test . cmd . CMD_PAUSE_TIME ) ; client . sAdd ( null , "skey1" , "svalue1" , "svalue2" , "svalue3" ) ; java . lang . Thread . sleep ( org . cyy . fw . nedis . test . cmd . CMD_PAUSE_TIME ) ; client . sAdd ( null , "skey2" , "svalue4" , "svalue2" , "svalue3" ) ; java . lang . Thread . sleep ( org . cyy . fw . nedis . test . cmd . CMD_PAUSE_TIME ) ; client . sDiff ( new org . cyy . fw . nedis . ResponseCallback < java . lang . String [ ] > ( ) { @ org . cyy . fw . nedis . test . cmd . Override public void done ( java . lang . String [ ] result ) { "<AssertPlaceHolder>" ; for ( java . lang . String r : result ) { System . out . println ( r ) ; } controller . countDown ( ) ; } @ org . cyy . fw . nedis . test . cmd . Override public void failed ( java . lang . Throwable cause ) { fail ( cause ) ; controller . countDown ( ) ; } } , "skey1" , "skey2" ) ; } } ) ; } done ( java . lang . String ) { org . junit . Assert . assertEquals ( "OK" , result ) ; controller . countDown ( ) ; }
org . junit . Assert . assertEquals ( 1 , result . length )
cellContainerRemovalInHandlers ( ) { jetbrains . jetpad . cell . TextCell testCell = new jetbrains . jetpad . cell . TextCell ( ) ; testCell . addTrait ( new jetbrains . jetpad . cell . trait . CellTrait ( ) { @ jetbrains . jetpad . cell . toView . Override public void onMousePressed ( jetbrains . jetpad . cell . Cell cell , jetbrains . jetpad . event . MouseEvent event ) { targetViewContainer . contentRoot ( ) . children ( ) . clear ( ) ; event . consume ( ) ; } } ) ; cellView . cell . set ( testCell ) ; targetViewContainer . root ( ) . validate ( ) ; targetViewContainer . mousePressed ( new jetbrains . jetpad . event . MouseEvent ( testCell . getBounds ( ) . center ( ) ) ) ; "<AssertPlaceHolder>" ; } isAttached ( ) { return ( myContainer ) != null ; }
org . junit . Assert . assertFalse ( cellView . isAttached ( ) )
lastOption_A$_Nil ( ) { com . m3 . scalaflavor4j . Seq < java . lang . String > seq = com . m3 . scalaflavor4j . IndexedSeq . apply ( ) ; com . m3 . scalaflavor4j . Option < java . lang . String > actual = seq . lastOption ( ) ; "<AssertPlaceHolder>" ; } isDefined ( ) { return false ; }
org . junit . Assert . assertThat ( actual . isDefined ( ) , org . hamcrest . CoreMatchers . is ( false ) )
testDataObjectWithValidDependencyCheck ( ) { com . emc . storageos . db . common . DbSchemaCheckerTest . log . info ( "testDataObjectWithValidDependencyCheck()<sp>started..." ) ; com . emc . storageos . db . common . DataObjectScanner scanner = new com . emc . storageos . db . common . DataObjectScanner ( ) ; java . lang . String [ ] packages = new java . lang . String [ ] { "com.emc.storageos.db.common.model2" } ; scanner . setPackages ( packages ) ; boolean pass = true ; try { scanner . init ( ) ; com . emc . storageos . db . common . DbSchemaCheckerTest . log . info ( "testDataObjectWithValidDependencyCheck()<sp>passed." ) ; } catch ( java . lang . Exception ex ) { com . emc . storageos . db . common . DbSchemaCheckerTest . log . info ( ( "testDataObjectWithValidDependencyCheck(),<sp>dependency<sp>check<sp>failed<sp>-><sp>" + ( ex . getMessage ( ) ) ) ) ; pass = false ; } "<AssertPlaceHolder>" ; } getMessage ( ) { return getLocalizedMessage ( ) ; }
org . junit . Assert . assertTrue ( pass )
testDanglingReferenceOnModificationProxy ( ) { org . geoserver . catalog . LayerInfo li = getCatalog ( ) . getLayerByName ( getLayerId ( SystemTestData . BUILDINGS ) ) ; "<AssertPlaceHolder>" ; } getDefaultStyle ( ) { return defaultStyle ; }
org . junit . Assert . assertNull ( li . getDefaultStyle ( ) )
testLo3Gemeente ( ) { org . mockito . Mockito . when ( gemeenteService . geefStelselVoorGemeente ( 5678 ) ) . thenReturn ( Stelsel . GBA ) ; org . mockito . Mockito . when ( gemeenteService . geefStelselVoorGemeente ( 1234 ) ) . thenReturn ( Stelsel . BRP ) ; final nl . moderniseringgba . isc . esb . message . brp . generated . IscGemeenten iscGemeenten = new nl . moderniseringgba . isc . esb . message . brp . generated . IscGemeenten ( ) ; iscGemeenten . setBrpGemeente ( nl . moderniseringgba . isc . uc308 . ControleerBijhoudingGemeenteDecisionTest . BRP_GEMEENTE ) ; iscGemeenten . setLo3Gemeente ( nl . moderniseringgba . isc . uc308 . ControleerBijhoudingGemeenteDecisionTest . LO3_GEMEENTE ) ; final nl . moderniseringgba . isc . esb . message . brp . generated . ErkenningVerzoekType erkenningVerzoekType = new nl . moderniseringgba . isc . esb . message . brp . generated . ErkenningVerzoekType ( ) ; erkenningVerzoekType . setIscGemeenten ( iscGemeenten ) ; final nl . moderniseringgba . isc . esb . message . brp . BrpBijhoudingVerzoekBericht erkenningVerzoekBericht = new nl . moderniseringgba . isc . esb . message . brp . impl . ErkenningVerzoekBericht ( erkenningVerzoekType ) ; final java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; parameters . put ( UC308Constants . BRP_BIJHOUDING_VERZOEK_BERICHT , erkenningVerzoekBericht ) ; final java . lang . String result = controleerBijhoudingsGemeenteDecision . execute ( parameters ) ; "<AssertPlaceHolder>" ; } execute ( java . util . Map ) { nl . bzk . migratiebrp . isc . jbpm . uc1003 . MaakZoekPersoonBerichtAction . LOG . debug ( "execute(parameters={})" , parameters ) ; final java . lang . Long berichtId = ( ( java . lang . Long ) ( parameters . get ( "input" ) ) ) ; final nl . bzk . migratiebrp . bericht . model . lo3 . Lo3Bericht input = ( ( nl . bzk . migratiebrp . bericht . model . lo3 . Lo3Bericht ) ( berichtenDao . leesBericht ( berichtId ) ) ) ; final nl . bzk . migratiebrp . bericht . model . sync . SyncBericht verzoek = maakZoekPersoonVerzoekBericht ( input ) ; final java . lang . Long verzoekId = berichtenDao . bewaarBericht ( verzoek ) ; final java . util . Map < java . lang . String , java . lang . Object > result = new java . util . HashMap ( ) ; result . put ( "zoekPersoonVerzoek" , verzoekId ) ; nl . bzk . migratiebrp . isc . jbpm . uc1003 . MaakZoekPersoonBerichtAction . LOG . debug ( "result:<sp>{}" , result ) ; return result ; }
org . junit . Assert . assertNull ( result )
shouldReturnSignatureMethodString ( ) { final java . lang . String expected = "HMAC-SHA1" ; "<AssertPlaceHolder>" ; } getSignatureMethod ( ) { return com . github . scribejava . core . services . RSASha1SignatureService . METHOD ; }
org . junit . Assert . assertEquals ( expected , service . getSignatureMethod ( ) )
test_float ( ) { org . jerlang . type . Float expected = new org . jerlang . type . Float ( ( - 4.0 ) ) ; org . jerlang . type . List params = org . jerlang . type . List . of ( org . jerlang . type . Float . of ( 1.0 ) ) ; org . jerlang . type . Term result = org . jerlang . erts . Erlang . apply ( org . jerlang . type . Atom . of ( "float" ) , org . jerlang . type . Atom . of ( "test" ) , params ) ; "<AssertPlaceHolder>" ; } of ( byte [ ] ) { return org . jerlang . type . Atom . of ( new java . lang . String ( bytes , ISO_8859_1 ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
testPrimaryKeyDescList ( ) { org . seasar . extension . jdbc . EntityMeta entityMeta = entityMetaFactory . getEntityMeta ( org . seasar . extension . jdbc . gen . internal . desc . TableDescFactoryImplTest . Aaa . class ) ; org . seasar . extension . jdbc . gen . desc . TableDesc tableDesc = tableDescFactory . getTableDesc ( entityMeta ) ; "<AssertPlaceHolder>" ; } getPrimaryKeyDesc ( ) { return primaryKeyDesc ; }
org . junit . Assert . assertNotNull ( tableDesc . getPrimaryKeyDesc ( ) )
whenPolygonInteriorRingFullyContainsTileExtentThenFeatureIsIgnored ( ) { com . vividsolutions . jts . geom . GeometryFactory gf = new com . vividsolutions . jts . geom . GeometryFactory ( ) ; com . vividsolutions . jts . geom . Coordinate [ ] ca = new com . vividsolutions . jts . geom . Coordinate [ 5 ] ; ca [ 0 ] = new com . vividsolutions . jts . geom . Coordinate ( ( - 50 ) , ( - 50 ) ) ; ca [ 1 ] = new com . vividsolutions . jts . geom . Coordinate ( 150 , ( - 50 ) ) ; ca [ 2 ] = new com . vividsolutions . jts . geom . Coordinate ( 150 , 150 ) ; ca [ 3 ] = new com . vividsolutions . jts . geom . Coordinate ( ( - 50 ) , 150 ) ; ca [ 4 ] = new com . vividsolutions . jts . geom . Coordinate ( ( - 50 ) , ( - 50 ) ) ; com . vividsolutions . jts . geom . LinearRing exterior = gf . createLinearRing ( ca ) ; ca [ 0 ] = new com . vividsolutions . jts . geom . Coordinate ( ( - 10 ) , ( - 10 ) ) ; ca [ 1 ] = new com . vividsolutions . jts . geom . Coordinate ( ( - 10 ) , 110 ) ; ca [ 2 ] = new com . vividsolutions . jts . geom . Coordinate ( 110 , 110 ) ; ca [ 3 ] = new com . vividsolutions . jts . geom . Coordinate ( 110 , ( - 10 ) ) ; ca [ 4 ] = new com . vividsolutions . jts . geom . Coordinate ( ( - 10 ) , ( - 10 ) ) ; com . vividsolutions . jts . geom . LinearRing interior = gf . createLinearRing ( ca ) ; com . vividsolutions . jts . geom . Polygon p = gf . createPolygon ( exterior , new com . vividsolutions . jts . geom . LinearRing [ ] { interior } ) ; double [ ] bbox = new double [ ] { 0 , 0 , 100 , 100 } ; org . geotools . feature . simple . SimpleFeatureTypeBuilder tBuilder = new org . geotools . feature . simple . SimpleFeatureTypeBuilder ( ) ; tBuilder . setName ( "test" ) ; tBuilder . add ( "geom" , com . vividsolutions . jts . geom . Polygon . class ) ; org . opengis . feature . simple . SimpleFeatureType featureType = tBuilder . buildFeatureType ( ) ; org . geotools . feature . simple . SimpleFeatureBuilder fBuilder = new org . geotools . feature . simple . SimpleFeatureBuilder ( featureType ) ; fBuilder . set ( "geom" , p ) ; org . opengis . feature . simple . SimpleFeature f = fBuilder . buildFeature ( null ) ; org . geotools . feature . DefaultFeatureCollection fc = new org . geotools . feature . DefaultFeatureCollection ( "test" ) ; fc . add ( f ) ; java . util . List < com . vividsolutions . jts . geom . Geometry > geom = org . oskari . service . mvt . SimpleFeaturesMVTEncoder . asMVTGeoms ( fc , bbox , 4096 , 256 ) ; "<AssertPlaceHolder>" ; } size ( ) { return delegate . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , geom . size ( ) )
testGetV8ResultDouble ( ) { java . lang . Object result = com . eclipsesource . v8 . utils . V8ObjectUtils . getV8Result ( v8 , new java . lang . Double ( 77.7 ) ) ; "<AssertPlaceHolder>" ; } getV8Result ( com . eclipsesource . v8 . V8 , java . lang . Object ) { if ( value == null ) { return null ; } java . util . Map < java . lang . Object , com . eclipsesource . v8 . V8Value > cache = new java . util . Hashtable < java . lang . Object , com . eclipsesource . v8 . V8Value > ( ) ; try { java . lang . Object result = com . eclipsesource . v8 . utils . V8ObjectUtils . getV8Result ( v8 , value , cache ) ; if ( result instanceof com . eclipsesource . v8 . V8Value ) { return ( ( com . eclipsesource . v8 . V8Value ) ( result ) ) . twin ( ) ; } return result ; } finally { for ( com . eclipsesource . v8 . V8Value v8Object : cache . values ( ) ) { v8Object . close ( ) ; } } }
org . junit . Assert . assertEquals ( 77.7 , result )
testGenerateSignatureBaseString ( ) { java . util . Map < java . lang . String , java . lang . String > testParamMap = new java . util . HashMap ( ) ; testParamMap . put ( "status" , security . encode ( "1318622958" 6 ) ) ; testParamMap . put ( "include_entities" , "true" ) ; testParamMap . put ( "oauth_consumer_key" , "xvz1evFS4wEEPTGEFPHBog" ) ; testParamMap . put ( "1318622958" 5 , "kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg" ) ; testParamMap . put ( "1318622958" 3 , "HMAC-SHA1" ) ; testParamMap . put ( "1318622958" 0 , "1318622958" ) ; testParamMap . put ( "1318622958" 2 , "1318622958" 7 ) ; testParamMap . put ( "1318622958" 1 , "1.0" ) ; java . lang . String signature_parameter_string = security . generateSignatureParameterString ( testParamMap ) ; java . lang . String signature_base_string = security . generateSignatureBaseString ( "1318622958" 4 , "https://api.twitter.com/1/statuses/update.json" , signature_parameter_string ) ; java . lang . String expected = "1318622958" 8 ; "<AssertPlaceHolder>" ; } generateSignatureBaseString ( java . lang . String , java . lang . String , java . lang . String ) { java . lang . String signature_base_string = new java . lang . StringBuilder ( ) . append ( method ) . append ( "&" ) . append ( encode ( request_url ) ) . append ( "&" ) . append ( encode ( signature_parameter_string ) ) . toString ( ) ; return signature_base_string ; }
org . junit . Assert . assertEquals ( expected , signature_base_string )
smoke1 ( ) { java . util . List < java . lang . String > witnessList = new java . util . ArrayList < java . lang . String > ( ) ; witnessList . add ( "com" ) ; witnessList . add ( "foo" ) ; witnessList . add ( "Bar" ) ; java . util . List < java . lang . String > partList = ch . qos . logback . classic . util . LoggerNameUtil . computeNameParts ( "com.foo.Bar" ) ; "<AssertPlaceHolder>" ; } computeNameParts ( java . lang . String ) { java . util . List < java . lang . String > partList = new java . util . ArrayList < java . lang . String > ( ) ; int fromIndex = 0 ; while ( true ) { int index = ch . qos . logback . classic . util . LoggerNameUtil . getSeparatorIndexOf ( loggerName , fromIndex ) ; if ( index == ( - 1 ) ) { partList . add ( loggerName . substring ( fromIndex ) ) ; break ; } partList . add ( loggerName . substring ( fromIndex , index ) ) ; fromIndex = index + 1 ; } return partList ; }
org . junit . Assert . assertEquals ( witnessList , partList )
testIndexOfAfterDispose ( ) { for ( int i = 0 ; i < 10 ; i ++ ) { new org . eclipse . swt . widgets . TreeItem ( tree , org . eclipse . swt . SWT . NONE ) ; } org . eclipse . swt . widgets . TreeItem item8 = tree . getItem ( 8 ) ; tree . getItem ( 3 ) . dispose ( ) ; "<AssertPlaceHolder>" ; } indexOf ( org . eclipse . nebula . widgets . grid . GridItem ) { checkWidget ( ) ; if ( item == null ) { org . eclipse . swt . SWT . error ( SWT . ERROR_NULL_ARGUMENT ) ; } if ( item . isDisposed ( ) ) { org . eclipse . swt . SWT . error ( SWT . ERROR_INVALID_ARGUMENT ) ; } if ( ! ( hasChildren ) ) { throw new java . lang . IllegalArgumentException ( "GridItem<sp>has<sp>no<sp>children!" ) ; } return ( item . getParentItem ( ) ) == ( this ) ? item . index : - 1 ; }
org . junit . Assert . assertEquals ( 7 , tree . indexOf ( item8 ) )
testTextBytesToLongBytesNegative ( ) { try { org . apache . activemq . artemis . utils . ByteUtil . convertTextBytes ( "x" ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } fail ( ) { try { org . junit . Assert . fail ( ) ; } catch ( java . lang . AssertionError e ) { org . apache . activemq . artemis . jms . tests . util . ProxyAssertSupport . log . warn ( ( "AssertionFailure::" + ( e . toString ( ) ) ) , e ) ; throw e ; } }
org . junit . Assert . assertTrue ( ( e instanceof java . lang . IllegalArgumentException ) )
loadMessageProperties_LanguageCodeIsNull ( ) { doReturn ( new java . util . Properties ( ) ) . when ( localizer ) . loadLocalizedPropertiesFromDatabase ( anyLong ( ) , any ( org . oscm . domobjects . enums . LocalizedObjectTypes . class ) , anyString ( ) ) ; java . util . Map < java . lang . String , java . util . Properties > result = operatorServiceLocalBean . loadMessageProperties ( null ) ; "<AssertPlaceHolder>" ; verify ( localizer , times ( 3 ) ) . loadLocalizedPropertiesFromDatabase ( eq ( 0L ) , eq ( LocalizedObjectTypes . MESSAGE_PROPERTIES ) , anyString ( ) ) ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , result . size ( ) )
shouldReturnFalseForSingleSingleQuote ( ) { boolean quoted = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isQuoted ( "'" ) ; "<AssertPlaceHolder>" ; } isQuoted ( java . lang . String ) { checkNotNull ( entityName ) ; return ( ( ( entityName . length ( ) ) >= 2 ) && ( ( entityName . charAt ( 0 ) ) == ( edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . SINGLE_QUOTE ) ) ) && ( ( entityName . charAt ( ( ( entityName . length ( ) ) - 1 ) ) ) == ( edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . SINGLE_QUOTE ) ) ; }
org . junit . Assert . assertEquals ( false , quoted )
testGetMD5 ( ) { System . out . println ( "getMD5" ) ; java . lang . String plainText = "this<sp>is<sp>a<sp>test<sp>for<sp>md5<sp>hash" ; java . lang . String expResult = org . apache . commons . codec . digest . DigestUtils . md5Hex ( plainText ) ; java . lang . String result = com . microsoftopentechnologies . windowsazurestorage . helper . Utils . getMD5 ( plainText ) ; "<AssertPlaceHolder>" ; } getMD5 ( java . lang . String ) { try { java . security . MessageDigest md = java . security . MessageDigest . getInstance ( Constants . HASH_TYPE ) ; byte [ ] array = md . digest ( plainText . getBytes ( java . nio . charset . Charset . forName ( "UTF-8" ) ) ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; final int byteMask = 255 ; final int byteExtended = 256 ; final int length = 3 ; for ( int i = 0 ; i < ( array . length ) ; ++ i ) { sb . append ( java . lang . Integer . toHexString ( ( ( ( array [ i ] ) & byteMask ) | byteExtended ) ) . substring ( 1 , length ) ) ; } return sb . toString ( ) ; } catch ( com . microsoftopentechnologies . windowsazurestorage . helper . java e ) { } return null ; }
org . junit . Assert . assertEquals ( expResult , result )
testAsArrayTypeUsage ( ) { int exceptions = 0 ; for ( me . tomassetti . turin . typesystem . PrimitiveTypeUsage btu : PrimitiveTypeUsage . ALL ) { try { btu . asArrayTypeUsage ( ) ; } catch ( java . lang . UnsupportedOperationException uoe ) { exceptions ++ ; } } "<AssertPlaceHolder>" ; } asArrayTypeUsage ( ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertEquals ( PrimitiveTypeUsage . ALL . size ( ) , exceptions )
testConvertVector ( ) { org . datavec . api . transform . schema . Schema . Builder schema = new org . datavec . api . transform . schema . Schema . Builder ( ) ; org . datavec . arrow . List < org . datavec . arrow . List < org . datavec . arrow . List < java . lang . String > > > entries = new org . datavec . arrow . ArrayList ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { schema . addColumnInteger ( java . lang . String . valueOf ( i ) ) ; } for ( int i = 0 ; i < 5 ; i ++ ) { org . datavec . arrow . List < org . datavec . arrow . List < java . lang . String > > arr = org . datavec . arrow . Arrays . asList ( org . datavec . arrow . Arrays . asList ( java . lang . String . valueOf ( i ) , java . lang . String . valueOf ( i ) , java . lang . String . valueOf ( i ) ) ) ; entries . add ( arr ) ; } org . datavec . arrow . List < org . apache . arrow . vector . FieldVector > fieldVectors = org . datavec . arrow . ArrowConverter . toArrowColumnsStringTimeSeries ( org . datavec . arrow . ArrowConverterTest . bufferAllocator , schema . build ( ) , entries ) ; org . nd4j . linalg . api . ndarray . INDArray arr = org . datavec . arrow . ArrowConverter . convertArrowVector ( fieldVectors . get ( 0 ) , schema . build ( ) . getType ( 0 ) ) ; "<AssertPlaceHolder>" ; } length ( ) { return length ; }
org . junit . Assert . assertEquals ( 5 , arr . length ( ) )
testValidPort ( ) { node . getAttributes ( ) . put ( "port" , "10" ) ; "<AssertPlaceHolder>" ; } buildPlugin ( ) { return ( ( org . apache . logging . log4j . core . config . plugins . validation . HostAndPort ) ( new org . apache . logging . log4j . core . config . plugins . util . PluginBuilder ( plugin ) . setConfiguration ( new org . apache . logging . log4j . core . config . NullConfiguration ( ) ) . setConfigurationNode ( node ) . build ( ) ) ) ; }
org . junit . Assert . assertNotNull ( buildPlugin ( ) )
test_max_long ( ) { int result = server . bounce_long ( - 1 ) ; "<AssertPlaceHolder>" ; } bounce_long ( int ) { return x ; }
org . junit . Assert . assertEquals ( - 1 , result )
testQueryByLocalDate_PositionalBinding ( ) { com . jmethods . catatumbo . EntityManagerTest . em . deleteAll ( com . jmethods . catatumbo . entities . LocalDateField . class ) ; com . jmethods . catatumbo . entities . LocalDateField entity = new com . jmethods . catatumbo . entities . LocalDateField ( ) ; java . time . LocalDate birthDate = java . time . LocalDate . of ( 2007 , 1 , 12 ) ; entity . setBirthDate ( birthDate ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; java . lang . String query = "SELECT<sp>*<sp>FROM<sp>LocalDateField<sp>WHERE<sp>birthDate=@1" ; com . jmethods . catatumbo . EntityQueryRequest request = com . jmethods . catatumbo . EntityManagerTest . em . createEntityQueryRequest ( query ) ; request . addPositionalBindings ( birthDate ) ; com . jmethods . catatumbo . QueryResponse < com . jmethods . catatumbo . entities . LocalDateField > response = com . jmethods . catatumbo . EntityManagerTest . em . executeEntityQueryRequest ( com . jmethods . catatumbo . entities . LocalDateField . class , request ) ; java . util . List < com . jmethods . catatumbo . entities . LocalDateField > entities = response . getResults ( ) ; System . out . println ( entities ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( entities . size ( ) ) == 1 ) )
testGetArea ( ) { expect ( rect . getX ( ) ) . andReturn ( 4 ) ; expect ( rect . getY ( ) ) . andReturn ( 5 ) ; replayAll ( ) ; "<AssertPlaceHolder>" ; verifyAll ( ) ; } getArea ( ) { return ( getX ( ) ) * ( getY ( ) ) ; }
org . junit . Assert . assertEquals ( 20 , rect . getArea ( ) )
testExonOverlapNoFrameshiftOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t58946844\t.\tN\t<DUP>\t.\t.\tSVTYPE=DUP;END=58946946" ) ; final java . lang . String expected = "1\t58946844\t.\tN\t<DUP>\t.\t.\tEND=58946946;" + ( "SVANN=transcript_amplification&structural_variant&coding_transcript_variant|HIGH|OMA1|115209|transcript|NM_145243.3|Coding|;" + "SVTYPE=DUP" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testReadEntry ( ) { when ( ioService . readAllString ( path ) ) . thenReturn ( org . guvnor . ala . registry . vfs . VFSRegistryHelperTest . MARSHALLED_ENTRY ) ; when ( entryMarshaller . unmarshal ( org . guvnor . ala . registry . vfs . VFSRegistryHelperTest . MARSHALLED_ENTRY ) ) . thenReturn ( entry ) ; when ( entry . getContentType ( ) ) . thenReturn ( java . lang . Object . class . getName ( ) ) ; when ( entry . getContent ( ) ) . thenReturn ( org . guvnor . ala . registry . vfs . VFSRegistryHelperTest . MARSHALLED_VALUE ) ; when ( marshallerRegistry . get ( any ( java . lang . Class . class ) ) ) . thenReturn ( marshaller ) ; java . lang . Object unmarshalledValue = mock ( java . lang . Object . class ) ; when ( marshaller . unmarshal ( org . guvnor . ala . registry . vfs . VFSRegistryHelperTest . MARSHALLED_VALUE ) ) . thenReturn ( unmarshalledValue ) ; java . lang . Object result = registryHelper . readEntry ( path ) ; "<AssertPlaceHolder>" ; } readEntry ( org . uberfire . java . nio . file . Path ) { final java . lang . String entryContent = ioService . readAllString ( path ) ; final org . guvnor . ala . registry . vfs . VFSRegistryEntry entry = entryMarshaller . unmarshal ( entryContent ) ; final org . guvnor . ala . marshalling . Marshaller marshaller = marshallerRegistry . get ( java . lang . Class . forName ( entry . getContentType ( ) ) ) ; if ( marshaller == null ) { throw new java . lang . Exception ( ( "No<sp>marshaller<sp>was<sp>found<sp>for<sp>class:<sp>" + ( entry . getContentType ( ) ) ) ) ; } return marshaller . unmarshal ( entry . getContent ( ) ) ; }
org . junit . Assert . assertEquals ( unmarshalledValue , result )
getUniqueUserId ( ) { java . lang . String user = "persona1@ibm.com" ; java . lang . String uniqueUserId = "persona1@ibm.com" ; com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_SUNLDAPTest_URAttrMappingVar4 . c , "getUniqueUserId" , "Checking<sp>with<sp>a<sp>valid<sp>user." ) ; "<AssertPlaceHolder>" ; } getUniqueUserId ( java . lang . String ) { return userRegistry . getUniqueUserId ( securityName ) ; }
org . junit . Assert . assertEquals ( uniqueUserId , com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_SUNLDAPTest_URAttrMappingVar4 . servlet . getUniqueUserId ( user ) )
validate_shouldFailValidationIfFieldLengthsAreNotCorrect ( ) { org . openmrs . FieldType type = new org . openmrs . FieldType ( ) ; type . setName ( "too<sp>long<sp>text<sp>too<sp>long<sp>text<sp>too<sp>long<sp>text<sp>too<sp>long<sp>text" ) ; org . springframework . validation . Errors errors = new org . springframework . validation . BindException ( type , "type" ) ; new org . openmrs . validator . FieldTypeValidator ( ) . validate ( type , errors ) ; "<AssertPlaceHolder>" ; } hasFieldErrors ( java . lang . String ) { return new org . openmrs . test . matchers . HasFieldErrors ( field , null ) ; }
org . junit . Assert . assertTrue ( errors . hasFieldErrors ( "name" ) )
intersect_A$Seq_Nil ( ) { com . m3 . scalaflavor4j . IndexedSeq < java . lang . Integer > seq = com . m3 . scalaflavor4j . IndexedSeq . apply ( ) ; com . m3 . scalaflavor4j . IndexedSeq < java . lang . Integer > that = com . m3 . scalaflavor4j . IndexedSeq . apply ( 3 , 4 , 5 ) ; com . m3 . scalaflavor4j . Seq < java . lang . Integer > actual = seq . intersect ( that ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
org . junit . Assert . assertThat ( actual . size ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( 0 ) ) )
testSimpleNoDecimals ( ) { org . apache . commons . math4 . geometry . euclidean . oned . Cartesian1D c = new org . apache . commons . math4 . geometry . euclidean . oned . Cartesian1D ( 1 ) ; java . lang . String expected = "{1}" ; java . lang . String actual = vector1DFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( org . apache . commons . math4 . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetWifiModeIntf ( ) { org . eclipse . kura . net . admin . NetworkAdminServiceImpl svc = new org . eclipse . kura . net . admin . NetworkAdminServiceImpl ( ) ; java . lang . String interfaceName = "wlan3" ; java . util . List < ? extends org . eclipse . kura . net . NetInterfaceConfig < ? extends org . eclipse . kura . net . NetInterfaceAddressConfig > > netInterfaceConfigs ; org . eclipse . kura . net . admin . NetworkConfigurationService ncsMock = mock ( org . eclipse . kura . net . admin . NetworkConfigurationService . class ) ; svc . setNetworkConfigurationService ( ncsMock ) ; org . eclipse . kura . core . net . NetworkConfiguration nc = new org . eclipse . kura . core . net . NetworkConfiguration ( ) ; when ( ncsMock . getNetworkConfiguration ( ) ) . thenReturn ( nc ) ; java . util . List < org . eclipse . kura . net . wifi . WifiInterfaceAddressConfig > addresses = new java . util . ArrayList ( ) ; org . eclipse . kura . core . net . WifiInterfaceAddressConfigImpl iac = new org . eclipse . kura . core . net . WifiInterfaceAddressConfigImpl ( ) ; org . eclipse . kura . net . wifi . WifiMode mode = org . eclipse . kura . net . wifi . WifiMode . INFRA ; iac . setMode ( mode ) ; addresses . add ( iac ) ; iac = new org . eclipse . kura . core . net . WifiInterfaceAddressConfigImpl ( ) ; iac . setMode ( WifiMode . MASTER ) ; addresses . add ( iac ) ; org . eclipse . kura . core . net . WifiInterfaceConfigImpl nic = new org . eclipse . kura . core . net . WifiInterfaceConfigImpl ( "testwlan3" ) ; nc . addNetInterfaceConfig ( nic ) ; nic = new org . eclipse . kura . core . net . WifiInterfaceConfigImpl ( interfaceName ) ; nic . setNetInterfaceAddresses ( addresses ) ; nc . addNetInterfaceConfig ( nic ) ; org . eclipse . kura . net . wifi . WifiMode result = ( ( org . eclipse . kura . net . wifi . WifiMode ) ( org . eclipse . kura . core . testutil . TestUtil . invokePrivate ( svc , "getWifiMode" , new java . lang . Class [ ] { java . lang . String . class } , interfaceName ) ) ) ; "<AssertPlaceHolder>" ; } invokePrivate ( java . lang . Object , java . lang . String , org . eclipse . kura . core . testutil . Class [ ] , java . lang . Object [ ] ) { java . lang . reflect . Method method = org . eclipse . kura . core . testutil . TestUtil . getMethod ( svc , methodName , paramTypes ) ; method . setAccessible ( true ) ; try { java . lang . Object result = method . invoke ( svc , params ) ; return result ; } catch ( java . lang . IllegalAccessException e ) { org . eclipse . kura . core . testutil . TestUtil . logger . warn ( e . getMessage ( ) , e ) ; } catch ( java . lang . IllegalArgumentException e ) { org . eclipse . kura . core . testutil . TestUtil . logger . warn ( e . getMessage ( ) , e ) ; } catch ( java . lang . reflect . InvocationTargetException e ) { throw e . getCause ( ) ; } return null ; }
org . junit . Assert . assertEquals ( mode , result )