input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testEmptyPasswordIsSameAsNullPassword ( ) { client . setAuthorizationRealm ( "Donald" , null ) ; java . lang . String ar1 = client . getAuthorizationRealm ( ) ; client . setAuthorizationRealm ( "Donald" , "" ) ; java . lang . String ar2 = client . getAuthorizationRealm ( ) ; "<AssertPlaceHolder>" ; } getAuthorizationRealm ( ) { return authorizationRealm ; }
|
org . junit . Assert . assertEquals ( ar1 , ar2 )
|
testStringInjectConfigurationBuilder ( ) { final org . apache . reef . tang . JavaClassHierarchy namespace = Tang . Factory . getTang ( ) . getDefaultClassHierarchy ( ) ; final org . apache . reef . tang . types . NamedParameterNode < java . util . List < java . lang . String > > np = ( ( org . apache . reef . tang . types . NamedParameterNode ) ( namespace . getNode ( org . apache . reef . tang . StringList . class ) ) ) ; final java . util . List < java . lang . String > injected = new java . util . ArrayList ( ) ; injected . add ( "hi" ) ; injected . add ( "hello" ) ; injected . add ( "bye" ) ; final org . apache . reef . tang . ConfigurationBuilder cb = Tang . Factory . getTang ( ) . newConfigurationBuilder ( ) ; cb . bindList ( np , injected ) ; final java . util . List < java . lang . String > actual = Tang . Factory . getTang ( ) . newInjector ( cb . build ( ) ) . getInstance ( org . apache . reef . tang . StringClass . class ) . getStringList ( ) ; final java . util . List < java . lang . String > expected = new java . util . ArrayList ( ) ; expected . add ( "hi" ) ; expected . add ( "hello" ) ; expected . add ( "bye" ) ; "<AssertPlaceHolder>" ; } add ( org . apache . reef . wake . remote . impl . RemoteEvent ) { queue . add ( event ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testCheckNotAllowedMethod ( ) { java . lang . String blockedMethodListAsText = STRING_VALUE ; java . util . List < java . lang . String > blockedMethods = java . util . Arrays . asList ( org . finra . herd . service . helper . METHOD_NAME ) ; org . finra . herd . model . jpa . ConfigurationEntity configurationEntity = mock ( org . finra . herd . model . jpa . ConfigurationEntity . class ) ; when ( configurationEntity . getValueClob ( ) ) . thenReturn ( blockedMethodListAsText ) ; when ( configurationDao . getConfigurationByKey ( ConfigurationValue . NOT_ALLOWED_HERD_ENDPOINTS . getKey ( ) ) ) . thenReturn ( configurationEntity ) ; when ( herdStringHelper . splitStringWithDefaultDelimiter ( blockedMethodListAsText ) ) . thenReturn ( blockedMethods ) ; try { configurationDaoHelper . checkNotAllowedMethod ( org . finra . herd . service . helper . METHOD_NAME ) ; org . junit . Assert . fail ( ) ; } catch ( org . finra . herd . model . MethodNotAllowedException e ) { "<AssertPlaceHolder>" ; } verify ( configurationDao ) . getConfigurationByKey ( ConfigurationValue . NOT_ALLOWED_HERD_ENDPOINTS . getKey ( ) ) ; verify ( herdStringHelper ) . splitStringWithDefaultDelimiter ( blockedMethodListAsText ) ; verifyNoMoreInteractionsHelper ( ) ; } checkNotAllowedMethod ( java . lang . String ) { boolean needToBlock = false ; org . finra . herd . model . jpa . ConfigurationEntity configurationEntity = configurationDao . getConfigurationByKey ( ConfigurationValue . NOT_ALLOWED_HERD_ENDPOINTS . getKey ( ) ) ; if ( ( configurationEntity != null ) && ( org . apache . commons . lang3 . StringUtils . isNotBlank ( configurationEntity . getValueClob ( ) ) ) ) { java . util . List < java . lang . String > methodsToBeBlocked = herdStringHelper . splitStringWithDefaultDelimiter ( configurationEntity . getValueClob ( ) ) ; needToBlock = methodsToBeBlocked . contains ( methodName ) ; } if ( needToBlock ) { throw new org . finra . herd . model . MethodNotAllowedException ( "The<sp>requested<sp>method<sp>is<sp>not<sp>allowed." ) ; } }
|
org . junit . Assert . assertEquals ( "The<sp>requested<sp>method<sp>is<sp>not<sp>allowed." , e . getMessage ( ) )
|
testToMatchLineAcl_0 ( ) { org . batfish . datamodel . IpAccessList matchLine0Acl = org . batfish . datamodel . IpAccessList . builder ( ) . setName ( org . batfish . question . searchfilters . SearchFiltersAnswerer . MATCH_LINE_RENAMER . apply ( 0 , _acl . getName ( ) ) ) . setLines ( com . google . common . collect . ImmutableList . of ( org . batfish . datamodel . IpAccessListLine . accepting ( ) . setMatchCondition ( matchDstIp ( "1.1.1.1" ) ) . build ( ) ) ) . build ( ) ; "<AssertPlaceHolder>" ; } toMatchLineAcl ( java . lang . Integer , org . batfish . datamodel . IpAccessList ) { java . util . List < org . batfish . datamodel . IpAccessListLine > lines = com . google . common . collect . Streams . concat ( acl . getLines ( ) . subList ( 0 , lineNumber ) . stream ( ) . map ( ( l ) -> l . toBuilder ( ) . setAction ( LineAction . DENY ) . build ( ) ) , java . util . stream . Stream . of ( acl . getLines ( ) . get ( lineNumber ) . toBuilder ( ) . setAction ( LineAction . PERMIT ) . build ( ) ) ) . collect ( com . google . common . collect . ImmutableList . toImmutableList ( ) ) ; return org . batfish . datamodel . IpAccessList . builder ( ) . setName ( org . batfish . question . searchfilters . SearchFiltersAnswerer . MATCH_LINE_RENAMER . apply ( lineNumber , acl . getName ( ) ) ) . setLines ( lines ) . build ( ) ; }
|
org . junit . Assert . assertThat ( org . batfish . question . searchfilters . SearchFiltersAnswerer . toMatchLineAcl ( 0 , _acl ) , org . hamcrest . Matchers . equalTo ( matchLine0Acl ) )
|
sendWritesBodyToOutputStream ( ) { final com . microsoft . azure . sdk . iot . deps . transport . http . HttpMethod httpsMethod = com . microsoft . azure . sdk . iot . deps . transport . http . HttpMethod . POST ; final byte [ ] expectedBody = new byte [ ] { 1 , 2 , 3 } ; new tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . MockUp < com . microsoft . azure . sdk . iot . deps . transport . http . HttpConnection > ( ) { byte [ ] testBody ; @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public void $init ( java . net . URL url , com . microsoft . azure . sdk . iot . deps . transport . http . HttpMethod method ) { } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public void connect ( ) throws java . io . IOException { "<AssertPlaceHolder>" ; } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public void writeOutput ( byte [ ] body ) { this . testBody = body ; } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public void setRequestHeader ( java . lang . String field , java . lang . String value ) { } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public void setRequestMethod ( com . microsoft . azure . sdk . iot . deps . transport . http . HttpMethod method ) { } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public byte [ ] readInput ( ) throws java . io . IOException { return new byte [ 0 ] ; } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public byte [ ] readError ( ) throws java . io . IOException { return new byte [ 0 ] ; } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public int getResponseStatus ( ) throws java . io . IOException { return 0 ; } @ tests . unit . com . microsoft . azure . sdk . iot . deps . transport . http . Mock public java . util . Map < java . lang . String , java . util . List < java . lang . String > > getResponseHeaders ( ) throws java . io . IOException { return new java . util . HashMap ( ) ; } } ; com . microsoft . azure . sdk . iot . deps . transport . http . HttpRequest request = new com . microsoft . azure . sdk . iot . deps . transport . http . HttpRequest ( new java . net . URL ( "http://www.microsoft.com" ) , httpsMethod , expectedBody ) ; request . send ( ) ; } connect ( ) { if ( ( this . body . length ) > 0 ) { this . connection . setDoOutput ( true ) ; this . connection . getOutputStream ( ) . write ( this . body ) ; } this . connection . connect ( ) ; }
|
org . junit . Assert . assertThat ( testBody , org . hamcrest . CoreMatchers . is ( expectedBody ) )
|
testConvertWithEmptyFields ( ) { org . lnu . is . domain . department . contact . DepartmentContact expected = new org . lnu . is . domain . department . contact . DepartmentContact ( ) ; org . lnu . is . resource . department . contact . DepartmentContactResource source = new org . lnu . is . resource . department . contact . DepartmentContactResource ( ) ; org . lnu . is . domain . department . contact . DepartmentContact actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testRemove ( ) { com . liferay . portal . kernel . model . Image newImage = addImage ( ) ; _persistence . remove ( newImage ) ; com . liferay . portal . kernel . model . Image existingImage = _persistence . fetchByPrimaryKey ( newImage . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertNull ( existingImage )
|
should_execute_function_for_each_element_of_SQObject ( ) { org . openqa . selenium . WebElement someSpan = testinfrastructure . testdouble . org . openqa . selenium . WebElementMother . createWebElementWithTag ( "span" ) ; org . openqa . selenium . WebElement someDiv = testinfrastructure . testdouble . org . openqa . selenium . WebElementMother . createWebElementWithTag ( "div" ) ; io . github . seleniumquery . SeleniumQueryObject targetSQO = createStubSeleniumQueryObjectWithElements ( someSpan , someDiv ) ; final java . util . Map < java . lang . Integer , org . openqa . selenium . WebElement > actual = new java . util . HashMap ( ) ; io . github . seleniumquery . SeleniumQueryObject . EachFunction eachFunctionSpy = new io . github . seleniumquery . SeleniumQueryObject . EachFunction ( ) { @ io . github . seleniumquery . functions . jquery . traversing . Override public boolean apply ( int index , org . openqa . selenium . WebElement element ) { actual . put ( index , element ) ; return true ; } } ; sqEachFunction . each ( targetSQO , eachFunctionSpy ) ; java . util . Map < java . lang . Integer , org . openqa . selenium . WebElement > expected = new java . util . HashMap ( ) ; expected . put ( 1 , someDiv ) ; expected . put ( 0 , someSpan ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { return isAnd ( IsEvaluator . IS_EVALUATOR , selector ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) )
|
givenAuthors_whenUpdadingByNameEJBQL_thenWeGetTheUpdatedAuthor ( ) { com . baeldung . apachecayenne . EJBQLQuery query = new com . baeldung . apachecayenne . EJBQLQuery ( "UPDATE<sp>Author<sp>AS<sp>a<sp>SET<sp>a.name<sp>=<sp>'Vicky<sp>Edison'<sp>WHERE<sp>a.name<sp>=<sp>'Vicky<sp>Sarra'" ) ; org . apache . cayenne . QueryResponse queryResponse = com . baeldung . apachecayenne . CayenneAdvancedOperationLiveTest . context . performGenericQuery ( query ) ; com . baeldung . apachecayenne . EJBQLQuery queryUpdatedAuthor = new com . baeldung . apachecayenne . EJBQLQuery ( "select<sp>a<sp>FROM<sp>Author<sp>a<sp>WHERE<sp>a.name<sp>=<sp>'Vicky<sp>Edison'" ) ; java . util . List < com . baeldung . apachecayenne . persistent . Author > authors = com . baeldung . apachecayenne . CayenneAdvancedOperationLiveTest . context . performQuery ( queryUpdatedAuthor ) ; com . baeldung . apachecayenne . persistent . Author author = authors . get ( 0 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Integer ) { return emf . unwrap ( org . hibernate . SessionFactory . class ) . getCurrentSession ( ) . get ( org . baeldung . demo . model . Foo . class , id ) ; }
|
org . junit . Assert . assertNotNull ( author )
|
testClose ( ) { java . lang . String userHome = java . lang . System . getProperty ( "user.home" ) ; java . lang . String dir = userHome . concat ( "/.knowledge/tmp/" ) ; java . io . File tmpdir = new java . io . File ( dir ) ; if ( ! ( tmpdir . exists ( ) ) ) { tmpdir . mkdirs ( ) ; } java . io . File tmp = java . io . File . createTempFile ( "test-" , ".txt" , tmpdir ) ; System . out . println ( tmp . getAbsolutePath ( ) ) ; java . io . PrintWriter p_writer = new java . io . PrintWriter ( new java . io . BufferedWriter ( new java . io . OutputStreamWriter ( new java . io . FileOutputStream ( tmp ) , "UTF-8" ) ) ) ; p_writer . println ( "sample" ) ; p_writer . close ( ) ; org . support . project . common . wrapper . FileInputStreamWithDeleteWrapper inputStream = new org . support . project . common . wrapper . FileInputStreamWithDeleteWrapper ( tmp ) ; "<AssertPlaceHolder>" ; java . io . BufferedReader b_reader = new java . io . BufferedReader ( new java . io . InputStreamReader ( inputStream , "UTF-8" ) ) ; java . lang . String s ; while ( ( s = b_reader . readLine ( ) ) != null ) { System . out . println ( s ) ; } b_reader . close ( ) ; if ( tmp . exists ( ) ) { org . junit . Assert . fail ( "" ) ; } } size ( ) { return _map . size ( ) ; }
|
org . junit . Assert . assertEquals ( 7 , inputStream . size ( ) )
|
emptyQuery ( ) { java . util . List < org . jboss . hal . ballroom . autocomplete . ReadChildrenResult > results = resultProcessor . processToModel ( "" , compositeResult ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ( ) ) == 0 ; }
|
org . junit . Assert . assertTrue ( results . isEmpty ( ) )
|
testAddTwoRenderersSetsCurrentToLast ( ) { com . eclipsesource . tabris . internal . ui . PageFlow flow = new com . eclipsesource . tabris . internal . ui . PageFlow ( mock ( com . eclipsesource . tabris . internal . ui . RemotePage . class ) ) ; com . eclipsesource . tabris . internal . ui . RemotePage renderer1 = mock ( com . eclipsesource . tabris . internal . ui . RemotePage . class ) ; com . eclipsesource . tabris . internal . ui . RemotePage renderer2 = mock ( com . eclipsesource . tabris . internal . ui . RemotePage . class ) ; flow . add ( renderer1 ) ; flow . add ( renderer2 ) ; "<AssertPlaceHolder>" ; } getCurrentRenderer ( ) { return renderers . get ( getIndexOfLastRenderer ( ) ) ; }
|
org . junit . Assert . assertSame ( renderer2 , flow . getCurrentRenderer ( ) )
|
shouldReturnTrueIfEntryIsNotAlreadyInList ( ) { java . lang . String oldValue = "Technical<sp>Key:<sp>appLogLevel-tmp" ; java . lang . String newValue = "Technical<sp>Key:<sp>appLogLevel" ; ch . puzzle . itc . mobiliar . business . database . entity . MyRevisionEntity revisionEntity = new ch . puzzle . itc . mobiliar . business . database . entity . MyRevisionEntity ( ) ; ch . puzzle . itc . mobiliar . business . auditview . entity . AuditViewEntry entryInList = ch . puzzle . itc . mobiliar . business . auditview . entity . AuditViewEntry . builder ( revisionEntity , RevisionType . MOD ) . oldValue ( oldValue ) . value ( newValue ) . type ( ch . puzzle . itc . mobiliar . business . auditview . control . EMPTY ) . build ( ) ; ch . puzzle . itc . mobiliar . business . auditview . entity . AuditViewEntry newEntry = ch . puzzle . itc . mobiliar . business . auditview . entity . AuditViewEntry . builder ( revisionEntity , RevisionType . MOD ) . oldValue ( ( oldValue + "." ) ) . value ( newValue ) . type ( ch . puzzle . itc . mobiliar . business . auditview . control . EMPTY ) . build ( ) ; java . util . Map < java . lang . Integer , ch . puzzle . itc . mobiliar . business . auditview . entity . AuditViewEntry > allAuditViewEntries = new java . util . HashMap ( 1 ) ; allAuditViewEntries . put ( entryInList . hashCode ( ) , entryInList ) ; boolean relevant = auditService . isAuditViewEntryRelevant ( newEntry , allAuditViewEntries ) ; "<AssertPlaceHolder>" ; } isAuditViewEntryRelevant ( ch . puzzle . itc . mobiliar . business . auditview . entity . AuditViewEntry , ch . puzzle . itc . mobiliar . business . auditview . control . Map ) { if ( entry == null ) { return false ; } if ( ( ( entry . getMode ( ) ) == ( org . hibernate . envers . RevisionType . ADD ) ) || ( ( entry . getMode ( ) ) == ( org . hibernate . envers . RevisionType . DEL ) ) ) { return true ; } if ( ( allAuditViewEntries . get ( entry . hashCode ( ) ) ) != null ) { return false ; } if ( entry . getType ( ) . equals ( Auditable . TYPE_TEMPLATE_DESCRIPTOR ) ) { return true ; } if ( entry . isObfuscatedValue ( ) ) { return true ; } return ! ( org . apache . commons . lang . StringUtils . equals ( entry . getOldValue ( ) , entry . getValue ( ) ) ) ; }
|
org . junit . Assert . assertThat ( relevant , org . hamcrest . Matchers . is ( true ) )
|
testCreatesObjectFromClassName ( ) { java . lang . Object convertedObject = converter . convert ( java . lang . String . class . getName ( ) ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertTrue ( ( convertedObject instanceof java . lang . String ) )
|
testSingleUrlParsing ( ) { org . apache . calcite . avatica . remote . AlternatingRemoteMetaTest . AlternatingDriver d = new org . apache . calcite . avatica . remote . AlternatingRemoteMetaTest . AlternatingDriver ( ) ; java . util . List < java . net . URL > urls = d . parseUrls ( "http://localhost:1234" ) ; "<AssertPlaceHolder>" ; } parseUrls ( java . lang . String ) { final java . util . List < java . net . URL > urls = new java . util . ArrayList ( ) ; final char comma = ',' ; int prevIndex = 0 ; int index = urlStr . indexOf ( comma ) ; if ( ( - 1 ) == index ) { try { return java . util . Collections . singletonList ( new java . net . URL ( urlStr ) ) ; } catch ( java . net . MalformedURLException e ) { throw new java . lang . RuntimeException ( e ) ; } } while ( ( - 1 ) != index ) { try { urls . add ( new java . net . URL ( urlStr . substring ( prevIndex , index ) ) ) ; } catch ( java . net . MalformedURLException e ) { throw new java . lang . RuntimeException ( e ) ; } prevIndex = index + 1 ; index = urlStr . indexOf ( comma , prevIndex ) ; } try { urls . add ( new java . net . URL ( urlStr . substring ( prevIndex ) ) ) ; } catch ( java . net . MalformedURLException e ) { throw new java . lang . RuntimeException ( e ) ; } return urls ; }
|
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( new java . net . URL ( "http://localhost:1234" ) ) , urls )
|
testAddMessage ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsSingleMessage ) { final byte [ ] validSizeBody = new byte [ ( 255 * 1024 ) - 1 ] ; new mockit . NonStrictExpectations ( ) { { mockMsg . getBody ( ) ; result = validSizeBody ; } } ; boolean httpsBatchMessageSizeLimitVerified = false ; try { com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage batchMsg = new com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage ( ) ; batchMsg . addMessage ( mockMsg ) ; } catch ( com . microsoft . azure . sdk . iot . device . exceptions . IotHubSizeExceededException e ) { httpsBatchMessageSizeLimitVerified = true ; } "<AssertPlaceHolder>" ; } addMessage ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsSingleMessage ) { java . lang . String jsonMsg = com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage . msgToJson ( msg ) ; java . lang . String newBatchBody = com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage . addJsonObjToArray ( jsonMsg , this . batchBody ) ; byte [ ] newBatchBodyBytes = newBatchBody . getBytes ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage . BATCH_CHARSET ) ; if ( ( newBatchBodyBytes . length ) > ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage . SERVICEBOUND_MESSAGE_MAX_SIZE_BYTES ) ) { java . lang . String errMsg = java . lang . String . format ( "Service-bound<sp>message<sp>size<sp>(%d<sp>bytes)<sp>cannot<sp>exceed<sp>%d<sp>bytes." , newBatchBodyBytes . length , com . microsoft . azure . sdk . iot . device . transport . https . HttpsBatchMessage . SERVICEBOUND_MESSAGE_MAX_SIZE_BYTES ) ; throw new com . microsoft . azure . sdk . iot . device . exceptions . IotHubSizeExceededException ( errMsg ) ; } this . batchBody = newBatchBody ; ( this . numMsgs ) ++ ; }
|
org . junit . Assert . assertThat ( httpsBatchMessageSizeLimitVerified , org . hamcrest . CoreMatchers . is ( true ) )
|
testMoreHotpIMF ( ) { byte [ ] key = new byte [ ] { 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 } ; byte [ ] imf = new byte [ ] { 0 , 0 , 0 , 1 } ; byte [ ] name = "kaka" . getBytes ( ) ; byte [ ] buf = new byte [ 256 ] ; buf [ 1 ] = pkgYkneoOath . YkneoOath . PUT_INS ; int offs = 5 ; buf [ ( offs ++ ) ] = pkgYkneoOath . YkneoOath . NAME_TAG ; buf [ ( offs ++ ) ] = ( ( byte ) ( name . length ) ) ; java . lang . System . arraycopy ( name , 0 , buf , offs , name . length ) ; offs += name . length ; buf [ ( offs ++ ) ] = pkgYkneoOath . YkneoOath . KEY_TAG ; buf [ ( offs ++ ) ] = ( ( byte ) ( ( key . length ) + 2 ) ) ; buf [ ( offs ++ ) ] = ( pkgYkneoOath . OathObj . HMAC_SHA1 ) | ( pkgYkneoOath . OathObj . HOTP_TYPE ) ; buf [ ( offs ++ ) ] = 6 ; java . lang . System . arraycopy ( key , 0 , buf , offs , key . length ) ; offs += key . length ; buf [ ( offs ++ ) ] = pkgYkneoOath . YkneoOath . IMF_TAG ; buf [ ( offs ++ ) ] = ( ( byte ) ( imf . length ) ) ; java . lang . System . arraycopy ( imf , 0 , buf , offs , imf . length ) ; offs += imf . length ; buf [ 4 ] = ( ( byte ) ( offs - 5 ) ) ; byte [ ] apdu = new byte [ offs ] ; java . lang . System . arraycopy ( buf , 0 , apdu , 0 , offs ) ; simulator . transmitCommand ( apdu ) ; byte [ ] calc = new byte [ ] { 0 , pkgYkneoOath . YkneoOath . CALCULATE_INS , 0 , 1 , ( ( byte ) ( ( name . length ) + 2 ) ) , pkgYkneoOath . YkneoOath . NAME_TAG , ( ( byte ) ( name . length ) ) , 'k' , 'a' , 'k' , 'a' , pkgYkneoOath . YkneoOath . CHALLENGE_TAG } ; byte [ ] resp = simulator . transmitCommand ( calc ) ; byte [ ] expected = new byte [ ] { pkgYkneoOath . YkneoOath . T_RESPONSE_TAG , 5 , 6 , 65 , 57 , 126 , ( ( byte ) ( 234 ) ) , ( ( byte ) ( 144 ) ) , 0 } ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertArrayEquals ( expected , resp )
|
testGetPackageName1 ( ) { org . jacoco . core . internal . analysis . ClassCoverageImpl node = new org . jacoco . core . internal . analysis . ClassCoverageImpl ( "ClassInDefaultPackage" , 0 , false ) ; "<AssertPlaceHolder>" ; } getPackageName ( ) { return packagename ; }
|
org . junit . Assert . assertEquals ( "" , node . getPackageName ( ) )
|
testPrintable ( ) { org . apache . flume . event . SimpleEvent event = new org . apache . flume . event . SimpleEvent ( ) ; event . setBody ( "Some<sp>text" . getBytes ( ) ) ; java . lang . String eventDump = org . apache . flume . event . EventHelper . dumpEvent ( event ) ; System . out . println ( eventDump ) ; "<AssertPlaceHolder>" ; } dumpEvent ( org . apache . flume . Event ) { return org . apache . flume . event . EventHelper . dumpEvent ( event , org . apache . flume . event . EventHelper . DEFAULT_MAX_BYTES ) ; }
|
org . junit . Assert . assertTrue ( eventDump , eventDump . contains ( "Some<sp>text" ) )
|
whenFileIsModified_getFileModeShouldReturnItsNewFileMode ( ) { writeToCache ( "/some_file.txt" , someBytes ( ) , com . beijunyi . parallelgit . filesystem . io . REGULAR_FILE ) ; initGitFileSystem ( ) ; open ( "/some_file.txt" ) . setFileMode ( com . beijunyi . parallelgit . filesystem . io . EXECUTABLE_FILE ) ; "<AssertPlaceHolder>" ; } fileMode ( java . lang . String ) { return ( ( org . eclipse . jgit . lib . FileMode ) ( readAttribute ( path , com . beijunyi . parallelgit . filesystem . io . FILE_MODE ) ) ) ; }
|
org . junit . Assert . assertEquals ( com . beijunyi . parallelgit . filesystem . io . EXECUTABLE_FILE , fileMode ( "/some_file.txt" ) )
|
extendedInjection ( ) { java . util . Collection < java . lang . Class < ? > > classes = new java . util . ArrayList < java . lang . Class < ? > > ( ) ; classes . add ( org . apache . webbeans . test . decorators . generic . ExtendedDecoratedBean . class ) ; classes . add ( org . apache . webbeans . test . decorators . generic . ExtendedGenericInterface . class ) ; classes . add ( org . apache . webbeans . test . decorators . generic . ExtendedSampleDecorator . class ) ; java . util . Collection < java . lang . String > xmls = new java . util . ArrayList < java . lang . String > ( ) ; xmls . add ( getXmlPath ( org . apache . webbeans . test . decorators . tests . GenericDecoratorTest . PACKAGE_NAME , "GenericDecoratorTest" ) ) ; startContainer ( classes , xmls ) ; org . apache . webbeans . test . decorators . generic . ExtendedDecoratedBean decoratedBean = getInstance ( org . apache . webbeans . test . decorators . generic . ExtendedDecoratedBean . class ) ; "<AssertPlaceHolder>" ; } isDecoratorCalled ( ) { if ( delegate . isDecoratorCalled ( ) ) { throw new java . lang . IllegalStateException ( ) ; } return true ; }
|
org . junit . Assert . assertTrue ( decoratedBean . isDecoratorCalled ( ) )
|
testGetType_1 ( ) { org . jinstagram . entity . oembed . OembedInformation fixture = new org . jinstagram . entity . oembed . OembedInformation ( ) ; fixture . setVersion ( "" ) ; fixture . setTitle ( "" ) ; fixture . setProviderUrl ( "" ) ; fixture . setUrl ( "" ) ; fixture . setAuthorName ( "" ) ; fixture . setHeight ( "" ) ; fixture . setMediaId ( "" ) ; fixture . setProviderName ( "" ) ; fixture . setType ( "" ) ; fixture . setWidth ( "" ) ; fixture . setAuthorUrl ( "" ) ; java . lang . String result = fixture . getType ( ) ; "<AssertPlaceHolder>" ; } getType ( ) { return type ; }
|
org . junit . Assert . assertEquals ( "" , result )
|
testSouthNeighbour ( ) { this . constructPopulation ( ) ; org . evosuite . ga . Neighbourhood < org . evosuite . ga . Chromosome > neighbourhood = new org . evosuite . ga . Neighbourhood ( org . evosuite . Properties . POPULATION ) ; java . util . List < org . evosuite . ga . Chromosome > neighbors = new java . util . ArrayList ( ) ; neighbors = neighbourhood . linearFive ( population , 5 ) ; org . evosuite . ga . Chromosome exepcted_individual = population . get ( 9 ) ; org . evosuite . ga . Chromosome returned_individual = neighbors . get ( 1 ) ; "<AssertPlaceHolder>" ; } get ( int ) { return this . pathCondition . get ( index ) ; }
|
org . junit . Assert . assertEquals ( exepcted_individual , returned_individual )
|
getPartijTestOK ( ) { final java . lang . String partijCode = "001401" ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij expectedPartij = new nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij ( "Groningen" , partijCode ) ; final java . lang . String expected = java . lang . String . format ( nl . bzk . migratiebrp . ggo . viewer . service . impl . BrpStamtabelServiceTest . STRING_FORMAT , expectedPartij . getCode ( ) , expectedPartij . getNaam ( ) ) ; org . mockito . Mockito . doReturn ( expectedPartij ) . when ( dynamischeStamtabelRepository ) . getPartijByCode ( partijCode ) ; final java . lang . String resultPartij = brpStamtabelService . getPartij ( partijCode ) ; "<AssertPlaceHolder>" ; } getPartij ( int ) { final int partijCodeSize = 4 ; java . lang . String result ; try { final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Partij partij = getDynamischeStamtabelRepository ( ) . getPartijByCode ( brpPartijCode ) ; final java . lang . String partijCode = nl . bzk . migratiebrp . ggo . viewer . util . VerwerkerUtil . zeroPad ( java . lang . Integer . toString ( partij . getCode ( ) ) , partijCodeSize ) ; result = java . lang . String . format ( nl . bzk . migratiebrp . ggo . viewer . service . impl . STRING_FORMAT , partijCode , partij . getNaam ( ) ) ; } catch ( final java . lang . IllegalArgumentException iae ) { final java . lang . String logMsg = java . lang . String . format ( nl . bzk . migratiebrp . ggo . viewer . service . impl . LOG_MSG_FORMAT , "PartijCode" , brpPartijCode ) ; nl . bzk . migratiebrp . ggo . viewer . service . impl . BrpStamtabelServiceImpl . LOG . warn ( logMsg ) ; result = java . lang . String . valueOf ( brpPartijCode ) ; } return result ; }
|
org . junit . Assert . assertEquals ( expected , resultPartij )
|
testConcurrentGrantLeadershipAndShutdown ( ) { final org . apache . flink . runtime . highavailability . nonha . embedded . EmbeddedLeaderService embeddedLeaderService = new org . apache . flink . runtime . highavailability . nonha . embedded . EmbeddedLeaderService ( org . apache . flink . runtime . testingUtils . TestingUtils . defaultExecutor ( ) ) ; try { final org . apache . flink . runtime . leaderelection . LeaderElectionService leaderElectionService = embeddedLeaderService . createLeaderElectionService ( ) ; final org . apache . flink . runtime . highavailability . nonha . embedded . TestingLeaderContender contender = new org . apache . flink . runtime . highavailability . nonha . embedded . TestingLeaderContender ( ) ; leaderElectionService . start ( contender ) ; leaderElectionService . stop ( ) ; try { contender . getLeaderSessionFuture ( ) . get ( 10L , TimeUnit . MILLISECONDS ) ; } catch ( java . util . concurrent . TimeoutException ignored ) { } "<AssertPlaceHolder>" ; } finally { embeddedLeaderService . shutdown ( ) ; } } isShutdown ( ) { synchronized ( lock ) { return isShutdown ; } }
|
org . junit . Assert . assertThat ( embeddedLeaderService . isShutdown ( ) , org . hamcrest . Matchers . is ( false ) )
|
shouldReturnSix ( ) { "<AssertPlaceHolder>" ; } strongPasswordChecker ( java . lang . String ) { int length = s . length ( ) ; boolean containsLowerCase = false ; boolean containsUpperCase = false ; boolean containsDigit = false ; boolean containsThreeRepeatingInARow = false ; int counterOfRepeatedPatterns = 0 ; int counter = 0 ; if ( length == 0 ) { return 6 ; } if ( length < 6 ) { counter = counter + ( 6 - length ) ; return counter ; } else if ( length > 20 ) { counter = counter + ( length - 20 ) ; } for ( int i = 0 ; i < length ; i ++ ) { char character = s . charAt ( i ) ; if ( ( ( ( i > 1 ) && ( ( length - i ) > 2 ) ) && ( character == ( s . charAt ( ( i + 1 ) ) ) ) ) && ( ( s . charAt ( ( i + 1 ) ) ) == ( s . charAt ( ( i + 2 ) ) ) ) ) { containsThreeRepeatingInARow = true ; counterOfRepeatedPatterns ++ ; } if ( java . lang . Character . isDigit ( character ) ) { containsDigit = true ; } else if ( java . lang . Character . isLowerCase ( character ) ) { containsLowerCase = true ; } else if ( java . lang . Character . isUpperCase ( character ) ) { containsUpperCase = true ; } if ( ( ( ( ( ( ! containsThreeRepeatingInARow ) && containsDigit ) && containsUpperCase ) && containsLowerCase ) && ( length > 5 ) ) && ( length < 21 ) ) { return 0 ; } } if ( containsThreeRepeatingInARow ) { counter = counter + counterOfRepeatedPatterns ; } if ( ! containsDigit ) { counter ++ ; } if ( ! containsLowerCase ) { counter ++ ; } if ( ! containsUpperCase ) { counter ++ ; } return counter ; }
|
org . junit . Assert . assertEquals ( strongPasswordChecker . strongPasswordChecker ( "" ) , 6 )
|
parseIfWithElseIf ( ) { java . lang . String code = "BEGIN\nIF<sp>1<sp>=<sp>1<sp>THEN<sp>null;\nELSIF<sp>(2<sp>=<sp>2)<sp>THEN<sp>null;\nELSE<sp>null;\nEND<sp>IF;\nEND;\n/\n" ; net . sourceforge . pmd . lang . plsql . ast . ASTInput input = parsePLSQL ( code ) ; "<AssertPlaceHolder>" ; } parsePLSQL ( java . lang . String ) { return parsePLSQL ( net . sourceforge . pmd . lang . LanguageRegistry . getLanguage ( PLSQLLanguageModule . NAME ) . getDefaultVersion ( ) , code ) ; }
|
org . junit . Assert . assertNotNull ( input )
|
testScenarioWithIgnore ( ) { com . intuit . karate . core . FeatureResult result = com . intuit . karate . core . FeatureParserTest . execute ( "test-ignore-scenario.feature" ) ; "<AssertPlaceHolder>" ; } getScenarioResults ( ) { return scenarioResults ; }
|
org . junit . Assert . assertEquals ( 1 , result . getScenarioResults ( ) . size ( ) )
|
fetchMethods ( ) { javax . json . JsonObject methodsOfBean = this . cut . fetchMethods ( "lightfish" , "Configurator" ) ; "<AssertPlaceHolder>" ; System . out . println ( methodsOfBean ) ; } fetchMethods ( java . lang . String , java . lang . String ) { javax . ws . rs . client . WebTarget target = client . target ( ( ( getUri ( ) ) + "{application}/{bean}/bean-methods/" ) ) ; javax . ws . rs . core . Response response = target . resolveTemplate ( "application" , applicationName ) . resolveTemplate ( "bean" , ejbName ) . request ( MediaType . APPLICATION_JSON ) . get ( javax . ws . rs . core . Response . class ) ; if ( ( response . getStatus ( ) ) == 404 ) { return null ; } javax . json . JsonObject rawStatistics = response . readEntity ( javax . json . JsonObject . class ) ; return preprocessChildResource ( rawStatistics ) ; }
|
org . junit . Assert . assertNotNull ( methodsOfBean )
|
testAsTypeString ( ) { "<AssertPlaceHolder>" ; } asType ( java . lang . Class , java . lang . String ) { if ( de . escalon . hypermedia . affordance . DataType . isBoolean ( type ) ) { return java . lang . Boolean . parseBoolean ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isInteger ( type ) ) { return java . lang . Integer . parseInt ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isLong ( type ) ) { return java . lang . Long . parseLong ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isDouble ( type ) ) { return java . lang . Double . parseDouble ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isFloat ( type ) ) { return java . lang . Float . parseFloat ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isByte ( type ) ) { return java . lang . Byte . parseByte ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isShort ( type ) ) { return java . lang . Short . parseShort ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isBigInteger ( type ) ) { return new java . math . BigInteger ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isBigDecimal ( type ) ) { return new java . math . BigDecimal ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isCalendar ( type ) ) { return javax . xml . bind . DatatypeConverter . parseDateTime ( string ) ; } else if ( de . escalon . hypermedia . affordance . DataType . isDate ( type ) ) { if ( de . escalon . hypermedia . affordance . DataType . isIsoLatin1Number ( string ) ) { return new java . util . Date ( java . lang . Long . parseLong ( string ) ) ; } else { return javax . xml . bind . DatatypeConverter . parseDateTime ( string ) . getTime ( ) ; } } else if ( de . escalon . hypermedia . affordance . DataType . isCurrency ( type ) ) { return java . util . Currency . getInstance ( string ) ; } else if ( type . isEnum ( ) ) { return java . lang . Enum . valueOf ( ( ( java . lang . Class < ? extends java . lang . Enum > ) ( type ) ) , string ) ; } else { return string ; } }
|
org . junit . Assert . assertEquals ( "foo" , de . escalon . hypermedia . affordance . DataType . asType ( java . lang . String . class , "foo" ) )
|
includedBasedOnCustomExpressionSyntax ( ) { org . apache . deltaspike . test . core . api . exclude . CustomExpressionBasedBean bean = org . apache . deltaspike . core . api . provider . BeanProvider . getContextualReference ( org . apache . deltaspike . test . core . api . exclude . CustomExpressionBasedBean . class , true ) ; "<AssertPlaceHolder>" ; } getContextualReference ( java . lang . Class , java . lang . annotation . Annotation [ ] ) { return org . apache . deltaspike . core . api . provider . BeanProvider . getContextualReference ( type , false , qualifiers ) ; }
|
org . junit . Assert . assertNotNull ( bean )
|
testClassnameAssigned ( ) { final java . lang . String proxyClassName = "org.hyalinedto.MyClass2" ; final org . hyalinedto . test . domainclasses . Person dto = org . hyalinedto . api . Hyaline . dtoFromClass ( john , new org . hyalinedto . api . DTO ( ) { @ org . hyalinedto . test . annotations . TestFieldAnnotation private java . lang . String firstName ; } , proxyClassName ) ; "<AssertPlaceHolder>" ; } dtoFromClass ( T , org . hyalinedto . api . DTO , java . lang . String ) { try { return org . hyalinedto . api . Hyaline . createDTO ( entity , dtoTemplate , false , proxyClassName ) ; } catch ( org . hyalinedto . core . exception . CannotInstantiateProxyException | org . hyalinedto . exception . DTODefinitionException e ) { e . printStackTrace ( ) ; throw new org . hyalinedto . exception . HyalineException ( ) ; } }
|
org . junit . Assert . assertEquals ( proxyClassName , dto . getClass ( ) . getName ( ) )
|
testGetParametersWithDisabledDEfaults ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String name = "name1" ; java . lang . Integer priority = 5 ; org . lnu . is . domain . benefit . BenefitType entity = new org . lnu . is . domain . benefit . BenefitType ( ) ; entity . setName ( name ) ; entity . setPriority ( priority ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "name" , name ) ; expected . put ( "priority" , priority ) ; 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 )
|
testSerialization ( ) { org . jfree . chart . needle . PinNeedle n1 = new org . jfree . chart . needle . PinNeedle ( ) ; org . jfree . chart . needle . PinNeedle n2 = ( ( org . jfree . chart . needle . PinNeedle ) ( org . jfree . chart . TestUtilities . serialised ( n1 ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org . jfree . base . modules . PackageState ) ) { return false ; } final org . jfree . base . modules . PackageState packageState = ( ( org . jfree . base . modules . PackageState ) ( o ) ) ; if ( ! ( this . module . getModuleClass ( ) . equals ( packageState . module . getModuleClass ( ) ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertTrue ( n1 . equals ( n2 ) )
|
testAtan2_1 ( ) { org . nd4j . linalg . api . ndarray . INDArray x = org . nd4j . linalg . factory . Nd4j . create ( 10 ) . assign ( ( - 1.0 ) ) ; org . nd4j . linalg . api . ndarray . INDArray y = org . nd4j . linalg . factory . Nd4j . create ( 10 ) . assign ( 0.0 ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( 10 ) . assign ( Math . PI ) ; org . nd4j . linalg . api . ndarray . INDArray z = org . nd4j . linalg . ops . transforms . Transforms . atan2 ( x , y ) ; "<AssertPlaceHolder>" ; } atan2 ( org . nd4j . linalg . api . ndarray . INDArray , org . nd4j . linalg . api . ndarray . INDArray ) { return org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . execAndReturn ( new org . nd4j . linalg . api . ops . impl . transforms . OldAtan2Op ( x , y , org . nd4j . linalg . factory . Nd4j . createUninitialized ( x . shape ( ) , x . ordering ( ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( exp , z )
|
create ( ) { char [ ] letters = array ( 'a' , 'b' , 'c' , 'd' ) ; "<AssertPlaceHolder>" ; } len ( java . lang . Object ) { return org . boon . core . Conversions . len ( obj ) ; }
|
org . junit . Assert . assertEquals ( 4 , len ( letters ) )
|
testListPageSize ( ) { java . util . Map < java . lang . String , java . lang . Object > objectMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; objectMap . put ( "results" , "1" ) ; objectMap . put ( "page" , "1" ) ; com . shippo . model . CustomsItemCollection CustomsItemCollection = com . shippo . model . CustomsItem . all ( objectMap ) ; "<AssertPlaceHolder>" ; } getData ( ) { return results ; }
|
org . junit . Assert . assertEquals ( CustomsItemCollection . getData ( ) . size ( ) , 1 )
|
shouldSerialiseWithJsonSerialiser ( ) { uk . gov . gchq . gaffer . cache . impl . HashMapCache < java . lang . String , uk . gov . gchq . gaffer . graph . GraphSerialisable > cache = new uk . gov . gchq . gaffer . cache . impl . HashMapCache ( false ) ; java . lang . String key = "key" ; uk . gov . gchq . gaffer . graph . GraphSerialisable expected = new uk . gov . gchq . gaffer . graph . GraphSerialisable . Builder ( ) . config ( config ) . schema ( schema ) . properties ( properties ) . build ( ) ; cache . put ( key , expected ) ; uk . gov . gchq . gaffer . graph . GraphSerialisable actual = cache . get ( key ) ; "<AssertPlaceHolder>" ; } get ( K ) { try { return ( ( V ) ( useJavaSerialisation ? uk . gov . gchq . gaffer . cache . impl . HashMapCache . JAVA_SERIALISER . deserialise ( ( ( byte [ ] ) ( cache . get ( key ) ) ) ) : cache . get ( key ) ) ) ; } catch ( final uk . gov . gchq . gaffer . exception . SerialisationException e ) { throw new java . lang . RuntimeException ( e ) ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
deleteAll ( ) { java . util . List < org . apache . commons . lang3 . tuple . Pair < org . xwiki . model . reference . DocumentReference , java . lang . String > > previous = new java . util . ArrayList < org . apache . commons . lang3 . tuple . Pair < org . xwiki . model . reference . DocumentReference , java . lang . String > > ( ) ; previous . add ( new org . apache . commons . lang3 . tuple . ImmutablePair < org . xwiki . model . reference . DocumentReference , java . lang . String > ( new org . xwiki . model . reference . DocumentReference ( "wiki" , "A" , "B" ) , "3.1" ) ) ; previous . add ( new org . apache . commons . lang3 . tuple . ImmutablePair < org . xwiki . model . reference . DocumentReference , java . lang . String > ( new org . xwiki . model . reference . DocumentReference ( "wiki" , "X" , "Y" ) , "5.2" ) ) ; org . xwiki . search . solr . internal . job . DocumentIterator < java . lang . String > previousIterator = new org . xwiki . search . solr . internal . job . DiffDocumentIteratorTest . DocumentIteratorStub < java . lang . String > ( previous ) ; java . util . List < org . apache . commons . lang3 . tuple . Pair < org . xwiki . model . reference . DocumentReference , java . lang . String > > next = java . util . Collections . emptyList ( ) ; org . xwiki . search . solr . internal . job . DocumentIterator < java . lang . String > nextIterator = new org . xwiki . search . solr . internal . job . DiffDocumentIteratorTest . DocumentIteratorStub < java . lang . String > ( next ) ; org . xwiki . search . solr . internal . job . DiffDocumentIterator < java . lang . String > iterator = new org . xwiki . search . solr . internal . job . DiffDocumentIterator < java . lang . String > ( previousIterator , nextIterator ) ; java . util . List < org . apache . commons . lang3 . tuple . Pair < org . xwiki . model . reference . DocumentReference , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action > > actualResult = new java . util . ArrayList < org . apache . commons . lang3 . tuple . Pair < org . xwiki . model . reference . DocumentReference , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action > > ( ) ; while ( iterator . hasNext ( ) ) { actualResult . add ( iterator . next ( ) ) ; } java . util . List < org . apache . commons . lang3 . tuple . Pair < org . xwiki . model . reference . DocumentReference , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action > > expectedResult = new java . util . ArrayList < org . apache . commons . lang3 . tuple . Pair < org . xwiki . model . reference . DocumentReference , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action > > ( ) ; expectedResult . add ( new org . apache . commons . lang3 . tuple . ImmutablePair < org . xwiki . model . reference . DocumentReference , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action > ( previous . get ( 0 ) . getKey ( ) , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action . DELETE ) ) ; expectedResult . add ( new org . apache . commons . lang3 . tuple . ImmutablePair < org . xwiki . model . reference . DocumentReference , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action > ( previous . get ( 1 ) . getKey ( ) , org . xwiki . search . solr . internal . job . DiffDocumentIterator . Action . DELETE ) ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return this . key ; }
|
org . junit . Assert . assertEquals ( expectedResult , actualResult )
|
testApplyTrue1 ( ) { com . liferay . dynamic . data . mapping . form . evaluator . internal . function . IsDecimalFunction isDecimalFunction = new com . liferay . dynamic . data . mapping . form . evaluator . internal . function . IsDecimalFunction ( ) ; java . lang . Boolean result = isDecimalFunction . apply ( "1.2" ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . String ) { return _getUrlTitle ( languageId ) ; }
|
org . junit . Assert . assertTrue ( result )
|
testDeleteTemplatesFailFast ( ) { com . github . tlrx . elasticsearch . test . EsSetup esSetup = new com . github . tlrx . elasticsearch . test . EsSetup ( ) ; esSetup . execute ( com . github . tlrx . elasticsearch . test . EsSetup . createTemplate ( com . github . tlrx . elasticsearch . test . request . DeleteTemplatesTest . TEST_TEMPLATE_NAME ) . withSource ( com . github . tlrx . elasticsearch . test . request . DeleteTemplatesTest . TEST_TEMPLATE_SOURCE ) ) ; esSetup . execute ( com . github . tlrx . elasticsearch . test . EsSetup . deleteTemplates ( "test-fail" , com . github . tlrx . elasticsearch . test . request . DeleteTemplatesTest . TEST_TEMPLATE_NAME ) . failFast ( ) ) ; "<AssertPlaceHolder>" ; } existsTemplate ( java . lang . String ) { org . elasticsearch . action . admin . cluster . state . ClusterStateRequestBuilder clusterStateRequestBuilder = ClusterStateAction . INSTANCE . newRequestBuilder ( esSetup . client ( ) . admin ( ) . cluster ( ) ) . all ( ) . setMetaData ( false ) ; org . elasticsearch . action . admin . cluster . state . ClusterStateResponse clusterStateResponse = clusterStateRequestBuilder . execute ( ) . actionGet ( ) ; org . elasticsearch . cluster . metadata . IndexTemplateMetaData indexTemplateMetaData = clusterStateResponse . getState ( ) . getMetaData ( ) . getTemplates ( ) . get ( templateName ) ; return indexTemplateMetaData != null ; }
|
org . junit . Assert . assertTrue ( existsTemplate ( com . github . tlrx . elasticsearch . test . request . DeleteTemplatesTest . TEST_TEMPLATE_NAME ) )
|
testType ( ) { for ( Map . Entry < com . google . cloud . datastore . ValueType , com . google . cloud . datastore . Value < ? > > entry : typeToValue . entrySet ( ) ) { "<AssertPlaceHolder>" ; } } getKey ( ) { return key ; }
|
org . junit . Assert . assertEquals ( entry . getKey ( ) , entry . getValue ( ) . getType ( ) )
|
testIsEmpty ( ) { java . util . Map < java . lang . String , java . lang . String > map = org . apache . activemq . artemis . utils . collections . NoOpMap . instance ( ) ; map . put ( "hello" , "world" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return consumers . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( map . isEmpty ( ) )
|
testEmpty ( ) { com . supaham . commons . bukkit . commands . flags . FlagParseResult result = parser . parse ( com . supaham . commons . bukkit . commands . FlagParserTest . NO_ARGS ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { try { source = ( "<span>" + source ) + "</span>" ; javax . xml . bind . JAXBContext context = javax . xml . bind . JAXBContext . newInstance ( com . supaham . commons . bukkit . text . xml . Element . class ) ; javax . xml . bind . Unmarshaller unmarshaller = context . createUnmarshaller ( ) ; com . supaham . commons . bukkit . text . xml . Element tag = ( ( com . supaham . commons . bukkit . text . xml . Element ) ( unmarshaller . unmarshal ( new java . io . StringReader ( source ) ) ) ) ; net . kyori . text . TextComponent . Builder builder = net . kyori . text . TextComponent . builder ( ) . content ( "" ) ; tag . apply ( builder ) ; tag . loop ( builder ) ; return builder . build ( ) ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( ( "Failed<sp>to<sp>parse:<sp>" + source ) , e ) ; } }
|
org . junit . Assert . assertNotNull ( result )
|
testBgpMessageRegistry ( ) { final org . opendaylight . protocol . bgp . parser . spi . MessageRegistry msgRegistry = this . ctx . getMessageRegistry ( ) ; "<AssertPlaceHolder>" ; } getBgpMessageRegistry ( ) { return this . bgpMssageRegistry ; }
|
org . junit . Assert . assertEquals ( msgRegistry , this . parser . getBgpMessageRegistry ( ) )
|
givenObservable_whenAssembled_shouldExecuteTheHook ( ) { io . reactivex . plugins . RxJavaPlugins . setOnObservableAssembly ( ( observable ) -> { hookCalled = true ; return observable ; } ) ; io . reactivex . Observable . range ( 1 , 10 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( hookCalled )
|
serialize ( ) { com . google . gson . Gson gson = com . github . seratch . jslack . common . json . GsonFactory . createSnakeCase ( ) ; com . github . seratch . jslack . api . model . event . ImCloseEvent event = new com . github . seratch . jslack . api . model . event . ImCloseEvent ( ) ; java . lang . String generatedJson = gson . toJson ( event ) ; java . lang . String expectedJson = "{\"type\":\"im_close\"}" ; "<AssertPlaceHolder>" ; } createSnakeCase ( ) { return new com . google . gson . GsonBuilder ( ) . setFieldNamingPolicy ( FieldNamingPolicy . LOWER_CASE_WITH_UNDERSCORES ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . LayoutBlock . class , new com . github . seratch . jslack . common . json . GsonLayoutBlockFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . composition . TextObject . class , new com . github . seratch . jslack . common . json . GsonTextObjectFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . ContextBlockElement . class , new com . github . seratch . jslack . common . json . GsonContextBlockElementFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . element . BlockElement . class , new com . github . seratch . jslack . common . json . GsonBlockElementFactory ( ) ) . create ( ) ; }
|
org . junit . Assert . assertThat ( generatedJson , org . hamcrest . CoreMatchers . is ( expectedJson ) )
|
shouldConvert ( ) { br . com . uol . pagseguro . api . utils . RequestMap expectedMap = new br . com . uol . pagseguro . api . utils . RequestMap ( ) ; expectedMap . putMap ( new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "initialDate" , "2016-11-09T00:00" ) ; put ( "finalDate" , "2016-11-09T23:59" ) ; put ( "reference" , "reference" ) ; put ( "page" , "1" ) ; put ( "maxPageResults" , "5" ) ; } } ) ; br . com . uol . pagseguro . api . utils . RequestMap map = mapConverter . convert ( transactionSearch ) ; "<AssertPlaceHolder>" ; } convert ( br . com . uol . pagseguro . api . common . domain . AccountRegisterSuggestion ) { if ( account == null ) { return null ; } br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter convertedAccount = new br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter ( ) ; convertedAccount . setEmail ( account . getEmail ( ) ) ; convertedAccount . setType ( account . getType ( ) ) ; convertedAccount . setPerson ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . PERSON_V_2_XML_CONVERTER . convert ( account . getPerson ( ) ) ) ; convertedAccount . setCompany ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . COMPANY_V_2_XML_CONVERTER . convert ( account . getCompany ( ) ) ) ; return convertedAccount ; }
|
org . junit . Assert . assertEquals ( expectedMap , map )
|
testKeepFormatting ( ) { java . lang . String act = mig . migrate ( "<sp>foo<sp>bar<sp>" , "<sp>foo<sp>bar<sp>" , ws ) ; "<AssertPlaceHolder>" ; } migrate ( java . lang . String , java . lang . String , java . util . regex . Pattern ) { if ( ( org . eclipse . xtext . util . Strings . isEmpty ( toBeFormattedString ) ) || ( org . eclipse . xtext . util . Strings . isEmpty ( formattedString ) ) ) return toBeFormattedString ; org . eclipse . xtext . util . internal . FormattingMigrator . FormattedString formatted = createFormattedString ( formattedString , format ) ; org . eclipse . xtext . util . internal . FormattingMigrator . FormattedString toBeFormatted = createFormattedString ( toBeFormattedString , format ) ; if ( formatted . semantic . equals ( toBeFormatted . semantic ) ) return formattedString ; java . util . List < org . eclipse . xtext . util . internal . FormattingMigrator . Mapping > mappings = com . google . common . collect . Lists . newArrayList ( ) ; java . util . List < org . eclipse . xtext . util . internal . FormattingMigrator . Region > remainingRegions = com . google . common . collect . Lists . newArrayList ( ) ; findLinearMatches ( formatted , toBeFormatted , mappings , remainingRegions ) ; for ( org . eclipse . xtext . util . internal . FormattingMigrator . Mapping m : mappings ) toBeFormatted . migrateFrom ( formatted , m ) ; return toBeFormatted . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "<sp>foo<sp>bar<sp>" , act )
|
testOverlapGelijkeHistories ( ) { final nl . bzk . migratiebrp . conversie . model . brp . BrpHistorie een = nl . bzk . migratiebrp . conversie . model . brp . BrpHistorieTest . createInhoud ( 20000101 , 20020101 , 20000101 , 20020101 ) ; "<AssertPlaceHolder>" ; } geldigheidOverlapt ( nl . moderniseringgba . migratie . conversie . model . brp . BrpHistorie ) { final nl . moderniseringgba . migratie . conversie . model . brp . attribuut . BrpDatum andereAanvang = andere . getDatumAanvangGeldigheid ( ) ; final nl . moderniseringgba . migratie . conversie . model . brp . attribuut . BrpDatum anderEinde = andere . getDatumEindeGeldigheid ( ) ; final boolean anderStartGelijkOfEerderEnHeeftOverlap = ( ( andereAanvang . getDatum ( ) ) <= ( datumAanvangGeldigheid . getDatum ( ) ) ) && ( ( anderEinde == null ) || ( ( anderEinde . getDatum ( ) ) > ( datumAanvangGeldigheid . getDatum ( ) ) ) ) ; final boolean anderStartGelijkOfLaterEnHeeftOverlap = ( ( andereAanvang . getDatum ( ) ) >= ( datumAanvangGeldigheid . getDatum ( ) ) ) && ( ( ( datumEindeGeldigheid ) == null ) || ( ( datumEindeGeldigheid . getDatum ( ) ) > ( andereAanvang . getDatum ( ) ) ) ) ; return anderStartGelijkOfEerderEnHeeftOverlap || anderStartGelijkOfLaterEnHeeftOverlap ; }
|
org . junit . Assert . assertTrue ( een . geldigheidOverlapt ( een ) )
|
testNonDominationRankMaximize ( ) { org . evosuite . ga . metaheuristics . NSGAII < org . evosuite . ga . NSGAChromosome > ga = new org . evosuite . ga . metaheuristics . NSGAII < org . evosuite . ga . NSGAChromosome > ( null ) ; org . evosuite . ga . operators . selection . BinaryTournamentSelectionCrowdedComparison ts = new org . evosuite . ga . operators . selection . BinaryTournamentSelectionCrowdedComparison ( true ) ; ts . setMaximize ( true ) ; ga . setSelectionFunction ( ts ) ; org . evosuite . ga . NSGAChromosome c1 = new org . evosuite . ga . NSGAChromosome ( ) ; org . evosuite . ga . NSGAChromosome c2 = new org . evosuite . ga . NSGAChromosome ( ) ; c1 . setRank ( 1 ) ; c2 . setRank ( 0 ) ; java . util . List < org . evosuite . ga . NSGAChromosome > population = new java . util . ArrayList < org . evosuite . ga . NSGAChromosome > ( ) ; population . add ( c1 ) ; population . add ( c2 ) ; "<AssertPlaceHolder>" ; } getIndex ( org . evosuite . utils . List ) { double r = org . evosuite . utils . Randomness . nextDouble ( ) ; double d = ( java . util . Properties . RANK_BIAS ) - ( java . lang . Math . sqrt ( ( ( ( java . util . Properties . RANK_BIAS ) * ( java . util . Properties . RANK_BIAS ) ) - ( ( 4.0 * ( ( java . util . Properties . RANK_BIAS ) - 1.0 ) ) * r ) ) ) ) ; int length = population . size ( ) ; d = ( d / 2.0 ) / ( ( java . util . Properties . RANK_BIAS ) - 1.0 ) ; int index = ( ( int ) ( length * d ) ) ; return index ; }
|
org . junit . Assert . assertTrue ( ( ( ts . getIndex ( population ) ) == 0 ) )
|
testConfigOSDSelectionPolicyNotSet ( ) { java . util . List < org . xtreemfs . pbrpc . generatedinterfaces . GlobalTypes . KeyValuePair > volumeAttributes = new java . util . ArrayList < org . xtreemfs . pbrpc . generatedinterfaces . GlobalTypes . KeyValuePair > ( ) ; client . createVolume ( authNone , org . xtreemfs . common . benchmark . ControllerIntegrationTest . userCredentials , "BenchVolA" , 511 , "test" , "test" , GlobalTypes . AccessControlPolicyType . ACCESS_CONTROL_POLICY_POSIX , GlobalTypes . StripingPolicyType . STRIPING_POLICY_RAID0 , 128 , 1 , volumeAttributes ) ; org . xtreemfs . common . libxtreemfs . Volume volume = client . openVolume ( "BenchVolA" , null , new org . xtreemfs . common . libxtreemfs . Options ( ) ) ; volume . setOSDSelectionPolicy ( org . xtreemfs . common . benchmark . ControllerIntegrationTest . userCredentials , "1001,3003" ) ; volume . close ( ) ; configBuilder . setUserName ( "test" ) . setGroup ( "test" ) ; org . xtreemfs . common . libxtreemfs . Volume volumeA = performBenchmark ( ( 10L * ( org . xtreemfs . common . benchmark . BenchmarkUtils . MiB_IN_BYTES ) ) , configBuilder , BenchmarkType . SEQ_WRITE ) ; "<AssertPlaceHolder>" ; deleteVolumes ( "BenchVolA" ) ; } getOSDSelectionPolicy ( org . xtreemfs . foundation . pbrpc . generatedinterfaces . RPC . UserCredentials ) { return getXAttr ( userCreds , "/" , org . xtreemfs . common . libxtreemfs . jni . NativeVolume . OSD_SELECTION_POLICY ) ; }
|
org . junit . Assert . assertEquals ( "1001,3003" , volumeA . getOSDSelectionPolicy ( org . xtreemfs . common . benchmark . ControllerIntegrationTest . userCredentials ) )
|
testExpenseMetric ( ) { reachability . setExpenseMetric ( ( ( byte ) ( 0 ) ) ) ; result2 = reachability . expenseMetric ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
|
org . junit . Assert . assertThat ( result2 , org . hamcrest . CoreMatchers . is ( ( ( byte ) ( 0 ) ) ) )
|
testSorted ( ) { org . apache . commons . validator . routines . IBANValidator validator = new org . apache . commons . validator . routines . IBANValidator ( ) ; org . apache . commons . validator . routines . IBANValidator . Validator [ ] vals = validator . getDefaultValidators ( ) ; "<AssertPlaceHolder>" ; System . out . println ( ) ; for ( int i = 1 ; i < ( vals . length ) ; i ++ ) { if ( ( vals [ i ] . countryCode . compareTo ( vals [ ( i - 1 ) ] . countryCode ) ) <= 0 ) { org . junit . Assert . fail ( ( ( ( "Not<sp>sorted:<sp>" + ( vals [ i ] . countryCode ) ) + "<sp><=<sp>" ) + ( vals [ ( i - 1 ) ] . countryCode ) ) ) ; } } } getDefaultValidators ( ) { return java . util . Arrays . copyOf ( org . apache . commons . validator . routines . IBANValidator . DEFAULT_FORMATS , org . apache . commons . validator . routines . IBANValidator . DEFAULT_FORMATS . length ) ; }
|
org . junit . Assert . assertNotNull ( vals )
|
testAddLayoutPageTemplateEntry ( ) { com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group . getGroupId ( ) , com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) ) ; com . liferay . layout . page . template . model . LayoutPageTemplateCollection layoutPageTemplateCollection = com . liferay . layout . page . template . service . LayoutPageTemplateCollectionServiceUtil . addLayoutPageTemplateCollection ( _group . getGroupId ( ) , "Layout<sp>Page<sp>Template<sp>Collection" , null , serviceContext ) ; com . liferay . layout . page . template . model . LayoutPageTemplateEntry layoutPageTemplateEntry = com . liferay . layout . page . template . service . LayoutPageTemplateEntryServiceUtil . addLayoutPageTemplateEntry ( _group . getGroupId ( ) , layoutPageTemplateCollection . getLayoutPageTemplateCollectionId ( ) , "Layout<sp>Page<sp>Template<sp>Entry" , serviceContext ) ; "<AssertPlaceHolder>" ; } getName ( ) { return _name ; }
|
org . junit . Assert . assertEquals ( "Layout<sp>Page<sp>Template<sp>Entry" , layoutPageTemplateEntry . getName ( ) )
|
test_sendMessage ( ) { createTopic ( topic ) ; java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; com . github . milenkovicm . kafka . ProducerProperties properties = new com . github . milenkovicm . kafka . ProducerProperties ( ) ; properties . override ( ProducerProperties . NETTY_DEBUG_PIPELINE , true ) ; com . github . milenkovicm . kafka . connection . DataKafkaBroker dataChannel = new com . github . milenkovicm . kafka . connection . DataKafkaBroker ( "localhost" , START_PORT , 0 , topic , new io . netty . channel . nio . NioEventLoopGroup ( ) , properties ) ; dataChannel . connect ( ) . sync ( ) ; dataChannel . send ( freeLaterBuffer ( "1" . getBytes ( ) ) , 0 , freeLaterBuffer ( com . github . milenkovicm . kafka . DataBrokerTest . TEST_MESSAGE . getBytes ( ) ) ) ; final kafka . consumer . KafkaStream < byte [ ] , byte [ ] > stream = consume ( topic ) . get ( 0 ) ; final kafka . consumer . ConsumerIterator < byte [ ] , byte [ ] > messages = stream . iterator ( ) ; "<AssertPlaceHolder>" ; dataChannel . disconnect ( ) ; } get ( com . github . milenkovicm . kafka . ProducerProperties$ProducerProperty ) { java . util . Objects . requireNonNull ( property , "property" ) ; V v = ( ( V ) ( properties . get ( property ) ) ) ; return v == null ? property . defaultValue ( ) : v ; }
|
org . junit . Assert . assertThat ( new java . lang . String ( messages . next ( ) . message ( ) ) , org . hamcrest . CoreMatchers . is ( com . github . milenkovicm . kafka . DataBrokerTest . TEST_MESSAGE ) )
|
upToAndThrow_does_not_throw_an_exception_if_all_results_compute_successfully ( ) { java . util . Collection < java . net . URI > result = uris . stream ( ) . limit ( 2 ) . map ( lazy ( URI :: create ) ) . collect ( upToAndThrow ( me . hgwood . bulky . IllegalArgumentException . class ) ) . collect ( toList ( ) ) ; "<AssertPlaceHolder>" ; } upToAndThrow ( me . hgwood . bulky . Class [ ] ) { return java . util . stream . Collector . of ( ImmutableList :: builder , ( accumulator , element ) -> { try { accumulator . add ( element . get ( ) ) ; } catch ( e ) { if ( asList ( failures ) . contains ( me . hgwood . bulky . e . getClass ( ) ) ) throw new < me . hgwood . bulky . e > me . hgwood . bulky . FailFastCollectException ( accumulator . build ( ) ) ; } } , ( left , right ) -> { left . addAll ( right . build ( ) ) ; return left ; } , ( result ) -> result . build ( ) . stream ( ) ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . contains ( new java . net . URI ( uris . get ( 0 ) ) , new java . net . URI ( uris . get ( 1 ) ) ) )
|
manageCreationProcess_VSERVER_RETRIEVEGUEST_manualOperation ( ) { parameters . put ( PropertyHandler . MAIL_FOR_COMPLETION , new org . oscm . app . v2_0 . data . Setting ( PropertyHandler . MAIL_FOR_COMPLETION , "test@email.com" ) ) ; org . oscm . app . iaas . data . FlowState newState = vServerProcessor . manageCreationProcess ( null , null , paramHandler , FlowState . VSERVER_RETRIEVEGUEST , null ) ; "<AssertPlaceHolder>" ; } manageCreationProcess ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , org . oscm . app . iaas . data . FlowState ) { boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; org . oscm . app . iaas . data . FlowState newState = newStateParam ; java . lang . String fwStatus = fwComm . getFirewallStatus ( paramHandler ) ; switch ( flowState ) { case VSERVER_CREATION_REQUESTED : if ( FWStatus . RUNNING . equals ( fwStatus ) ) { if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_CREATING , paramHandler ) ) ) { vserverComm . createVServer ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_CREATING ; } } else { if ( checkNextStatus ( controllerId , instanceId , FlowState . FW_STARTING_FOR_VSERVER_CREATION , paramHandler ) ) { fwComm . startFirewall ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . FW_STARTING_FOR_VSERVER_CREATION ; } } break ; case FW_STARTING_FOR_VSERVER_CREATION : if ( FWStatus . RUNNING . equals ( fwStatus ) ) { if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . FW_STARTED_FOR_VSERVER_CREATION , paramHandler ) ) ) { vserverComm . createVServer ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_CREATING ; } } break ; case VSERVER_CREATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_CREATED , paramHandler ) ) { java . lang . String vServerStatus = vserverComm . getVServerStatus ( paramHandler ) ; if ( ( ( VServerStatus . STOPPED . equals ( vServerStatus ) ) || ( VServerStatus . RUNNING . equals ( vServerStatus ) ) ) || ( VServerStatus . STARTING . equals ( vServerStatus ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_CREATED ; } } break ; case VSERVER_CREATED : if ( vdiskInfo . isAdditionalDiskSelected ( paramHandler ) ) { if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATION_REQUESTED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATION_REQUESTED ; } } else { java . lang . String vServerStatus = vserverComm . getVServerStatus ( paramHandler ) ; if ( VServerStatus . STOPPED . equals ( vServerStatus ) ) { if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) { vserverComm . startVServer ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } } else if ( VServerStatus . STARTING . equals ( vServerStatus ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } else if ( VServerStatus . RUNNING . equals ( vServerStatus ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_RETRIEVEGUEST ; } } break ; case VSERVER_RETRIEVEGUEST : java . lang . String mail = paramHandler . getMailForCompletion ( ) ; if ( mail != null ) { newState = dispatchVServerManualOperation ( controllerId , instanceId , paramHandler , mail ) ; } else if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; case VSDISK_CREATION_REQUESTED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATING , paramHandler ) ) ) { vdiskInfo . createVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATING ; } break ; case VSDISK_CREATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATED , paramHandler ) ) { if ( vdiskInfo . isVDiskDeployed ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATED ; } } break ; case VSDISK_CREATED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHING , paramHandler ) ) ) { vdiskInfo . attachVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHING ; } break ; case VSDISK_ATTACHING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHED , paramHandler ) ) { if ( vdiskInfo . isVDiskAttached ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHED ; } } break ; case VSDISK_ATTACHED : if ( checkNextStatus ( controllerId , instanceId , FlowState .
|
org . junit . Assert . assertEquals ( FlowState . FINISHED , newState )
|
testNoFilteringIfNotOverlapping ( ) { java . util . List < org . languagetool . rules . patterns . PatternToken > fakePatternTokens = new java . util . ArrayList ( ) ; org . languagetool . rules . patterns . PatternRule rule1 = new org . languagetool . rules . patterns . PatternRule ( "id1" , org . languagetool . rules . RuleWithMaxFilterTest . language , fakePatternTokens , "desc1" , "msg1" , "shortMsg1" ) ; org . languagetool . rules . patterns . PatternRule rule2 = new org . languagetool . rules . patterns . PatternRule ( "id1" , org . languagetool . rules . RuleWithMaxFilterTest . language , fakePatternTokens , "desc2" , "msg2" , "shortMsg2" ) ; org . languagetool . rules . RuleMatch match1 = new org . languagetool . rules . RuleMatch ( rule1 , null , 10 , 20 , "Match1" ) ; org . languagetool . rules . RuleMatch match2 = new org . languagetool . rules . RuleMatch ( rule2 , null , 21 , 25 , "Match2" ) ; org . languagetool . rules . RuleWithMaxFilter filter = new org . languagetool . rules . RuleWithMaxFilter ( ) ; java . util . List < org . languagetool . rules . RuleMatch > filteredMatches = filter . filter ( java . util . Arrays . asList ( match1 , match2 ) ) ; "<AssertPlaceHolder>" ; } filter ( java . util . List , java . util . regex . Pattern ) { return analyzedTokens . stream ( ) . filter ( ( token ) -> hasPosTag ( token , posTag ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; }
|
org . junit . Assert . assertEquals ( 2 , filteredMatches . size ( ) )
|
testConstructorWithoutV8 ( ) { com . eclipsesource . v8 . utils . ConcurrentV8 concurrentV8 = new com . eclipsesource . v8 . utils . ConcurrentV8 ( ) ; "<AssertPlaceHolder>" ; concurrentV8 . release ( ) ; } getV8 ( ) { return v8 ; }
|
org . junit . Assert . assertNotNull ( concurrentV8 . getV8 ( ) )
|
testAddParts ( ) { org . apache . hadoop . hive . metastore . api . Table table = createTable ( ) ; java . util . List < org . apache . hadoop . hive . metastore . api . Partition > partitions = new java . util . ArrayList ( ) ; org . apache . hadoop . hive . metastore . api . Partition partition1 = buildPartition ( com . google . common . collect . Lists . newArrayList ( "2017" ) , org . apache . hadoop . hive . metastore . client . TestAddPartitions . getYearPartCol ( ) , 1 ) ; org . apache . hadoop . hive . metastore . api . Partition partition2 = buildPartition ( com . google . common . collect . Lists . newArrayList ( "2016" ) , org . apache . hadoop . hive . metastore . client . TestAddPartitions . getYearPartCol ( ) , 2 ) ; org . apache . hadoop . hive . metastore . api . Partition partition3 = buildPartition ( com . google . common . collect . Lists . newArrayList ( "2015" ) , org . apache . hadoop . hive . metastore . client . TestAddPartitions . getYearPartCol ( ) , 3 ) ; partitions . add ( partition1 ) ; partitions . add ( partition2 ) ; partitions . add ( partition3 ) ; java . util . List < org . apache . hadoop . hive . metastore . api . Partition > addedPartitions = client . add_partitions ( partitions , false , false ) ; "<AssertPlaceHolder>" ; verifyPartition ( table , "year=2017" , com . google . common . collect . Lists . newArrayList ( "2017" ) , 1 ) ; verifyPartition ( table , "year=2016" , com . google . common . collect . Lists . newArrayList ( "2016" ) , 2 ) ; verifyPartition ( table , "year=2015" , com . google . common . collect . Lists . newArrayList ( "2015" ) , 3 ) ; } add_partitions ( java . util . List , boolean , boolean ) { if ( ( parts == null ) || ( parts . contains ( null ) ) ) { throw new org . apache . hadoop . hive . metastore . MetaException ( "Partitions<sp>cannot<sp>be<sp>null." ) ; } if ( parts . isEmpty ( ) ) { return needResults ? new java . util . ArrayList ( ) : null ; } org . apache . hadoop . hive . metastore . Partition part = parts . get ( 0 ) ; if ( ! ( part . isSetCatName ( ) ) ) { final java . lang . String defaultCat = getDefaultCatalog ( conf ) ; parts . forEach ( ( p ) -> p . setCatName ( defaultCat ) ) ; } org . apache . hadoop . hive . metastore . AddPartitionsRequest req = new org . apache . hadoop . hive . metastore . AddPartitionsRequest ( part . getDbName ( ) , part . getTableName ( ) , parts , ifNotExists ) ; req . setCatName ( ( part . isSetCatName ( ) ? part . getCatName ( ) : getDefaultCatalog ( conf ) ) ) ; req . setNeedResult ( needResults ) ; org . apache . hadoop . hive . metastore . AddPartitionsResult result = client . add_partitions_req ( req ) ; return needResults ? org . apache . hadoop . hive . metastore . utils . FilterUtils . filterPartitionsIfEnabled ( isClientFilterEnabled , filterHook , result . getPartitions ( ) ) : null ; }
|
org . junit . Assert . assertNull ( addedPartitions )
|
testBindInputNullResult ( ) { java . util . List < io . cloudslang . lang . entities . bindings . Result > results = asList ( createResult ( ScoreLangConstants . SUCCESS_RESULT , io . cloudslang . lang . entities . bindings . values . ValueFactory . create ( "${<sp>int(status)<sp>==<sp>1<sp>}" ) ) , createResult ( ScoreLangConstants . FAILURE_RESULT , null ) ) ; java . util . HashMap < java . lang . String , io . cloudslang . lang . entities . bindings . values . Value > context = new java . util . HashMap ( ) ; context . put ( "status" , io . cloudslang . lang . entities . bindings . values . ValueFactory . create ( "-1" ) ) ; java . lang . String result = resultsBinding . resolveResult ( new java . util . HashMap < java . lang . String , io . cloudslang . lang . entities . bindings . values . Value > ( ) , context , io . cloudslang . lang . runtime . bindings . ResultBindingTest . EMPTY_SET , results , null ) ; "<AssertPlaceHolder>" ; } create ( java . io . Serializable ) { return io . cloudslang . lang . entities . bindings . values . ValueFactory . create ( content , false ) ; }
|
org . junit . Assert . assertEquals ( ScoreLangConstants . FAILURE_RESULT , result )
|
testEmptyInputMap ( ) { java . util . Map < java . lang . String , java . lang . Integer > returnMap = com . feilong . core . bean . ConvertUtil . toMap ( new java . util . HashMap < java . lang . String , java . lang . String > ( ) , com . feilong . core . bean . convertutiltest . Integer . class ) ; "<AssertPlaceHolder>" ; } toMap ( java . util . Map , java . lang . Class , java . lang . Class ) { if ( com . feilong . core . Validator . isNullOrEmpty ( inputMap ) ) { return java . util . Collections . emptyMap ( ) ; } org . apache . commons . collections4 . Transformer < K , I > keyTransformer = ( null == keyTargetType ) ? null : new com . feilong . core . util . transformer . SimpleClassTransformer < K , I > ( keyTargetType ) ; org . apache . commons . collections4 . Transformer < V , J > valueTransformer = ( null == valueTargetType ) ? null : new com . feilong . core . util . transformer . SimpleClassTransformer < V , J > ( valueTargetType ) ; return com . feilong . core . bean . ConvertUtil . toMap ( inputMap , keyTransformer , valueTransformer ) ; }
|
org . junit . Assert . assertEquals ( emptyMap ( ) , returnMap )
|
testUnmarshalOtherSchema ( ) { ddf . catalog . transform . InputTransformer mockInputTransformer = mock ( ddf . catalog . transform . InputTransformer . class ) ; when ( mockInputManager . getTransformerBySchema ( org . codice . ddf . spatial . ogc . csw . catalog . converter . TestCswTransformProvider . OTHER_SCHEMA ) ) . thenReturn ( mockInputTransformer ) ; when ( mockInputTransformer . transform ( any ( java . io . InputStream . class ) ) ) . thenReturn ( getMetacard ( ) ) ; com . thoughtworks . xstream . io . HierarchicalStreamReader reader = new com . thoughtworks . xstream . io . xml . XppReader ( new java . io . StringReader ( getRecord ( ) ) , org . xmlpull . v1 . XmlPullParserFactory . newInstance ( ) . newPullParser ( ) ) ; org . codice . ddf . spatial . ogc . csw . catalog . converter . CswTransformProvider provider = new org . codice . ddf . spatial . ogc . csw . catalog . converter . CswTransformProvider ( null , mockInputManager ) ; com . thoughtworks . xstream . converters . UnmarshallingContext context = new com . thoughtworks . xstream . core . TreeUnmarshaller ( null , null , null , null ) ; context . put ( CswConstants . OUTPUT_SCHEMA_PARAMETER , org . codice . ddf . spatial . ogc . csw . catalog . converter . TestCswTransformProvider . OTHER_SCHEMA ) ; org . mockito . ArgumentCaptor < java . lang . String > captor = org . mockito . ArgumentCaptor . forClass ( java . lang . String . class ) ; ddf . catalog . data . Metacard metacard = ( ( ddf . catalog . data . Metacard ) ( provider . unmarshal ( reader , context ) ) ) ; verify ( mockInputManager , times ( 1 ) ) . getTransformerBySchema ( captor . capture ( ) ) ; java . lang . String outputSchema = captor . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertThat ( outputSchema , org . hamcrest . core . Is . is ( org . codice . ddf . spatial . ogc . csw . catalog . converter . TestCswTransformProvider . OTHER_SCHEMA ) )
|
shouldSetFlushListenerOnWrappedCachingStore ( ) { final org . apache . kafka . streams . state . internals . MeteredSessionStoreTest . CachedSessionStore cachedSessionStore = mock ( org . apache . kafka . streams . state . internals . MeteredSessionStoreTest . CachedSessionStore . class ) ; expect ( cachedSessionStore . setFlushListener ( anyObject ( org . apache . kafka . streams . state . internals . CacheFlushListener . class ) , eq ( false ) ) ) . andReturn ( true ) ; replay ( cachedSessionStore ) ; metered = new org . apache . kafka . streams . state . internals . MeteredSessionStore ( cachedSessionStore , "scope" , org . apache . kafka . common . serialization . Serdes . String ( ) , org . apache . kafka . common . serialization . Serdes . String ( ) , new org . apache . kafka . common . utils . MockTime ( ) ) ; "<AssertPlaceHolder>" ; verify ( cachedSessionStore ) ; } setFlushListener ( org . apache . kafka . streams . state . internals . CacheFlushListener , boolean ) { final org . apache . kafka . streams . state . WindowStore < org . apache . kafka . common . utils . Bytes , byte [ ] > wrapped = org . apache . kafka . streams . state . internals . MeteredWindowStore . wrapped ( ) ; if ( wrapped instanceof org . apache . kafka . streams . state . internals . CachedStateStore ) { return ( ( org . apache . kafka . streams . state . internals . CachedStateStore < byte [ ] , byte [ ] > ) ( wrapped ) ) . setFlushListener ( ( key , newValue , oldValue , timestamp ) -> listener . apply ( org . apache . kafka . streams . state . internals . WindowKeySchema . fromStoreKey ( key , windowSizeMs , serdes . keyDeserializer ( ) , serdes . topic ( ) ) , ( newValue != null ? serdes . valueFrom ( newValue ) : null ) , ( oldValue != null ? serdes . valueFrom ( oldValue ) : null ) , timestamp ) , sendOldValues ) ; } return false ; }
|
org . junit . Assert . assertTrue ( metered . setFlushListener ( null , false ) )
|
test ( ) { uk . me . rkd . jsipp . runtime . network . SocketManager sm = mock ( uk . me . rkd . jsipp . runtime . network . SocketManager . class ) ; uk . me . rkd . jsipp . compiler . Scenario s = uk . me . rkd . jsipp . compiler . Scenario . fromXMLFilename ( "resources/message-uas.xml" ) ; uk . me . rkd . jsipp . runtime . Scheduler sched = new uk . me . rkd . jsipp . runtime . Scheduler ( 1 ) ; uk . me . rkd . jsipp . runtime . Call c = new uk . me . rkd . jsipp . runtime . Call ( 1 , "1" , "Test<sp>Scenario" , s . phases ( ) , sm , sched . getTimer ( ) ) ; c . registerSocket ( ) ; sched . add ( c , 0 ) ; c . process_incoming ( uk . me . rkd . jsipp . runtime . CallTest . p . parseSIPMessage ( message_req . getBytes ( ) , true , true , null ) ) ; java . lang . Thread . sleep ( 50 ) ; verify ( sm ) . send ( eq ( 1 ) , anyString ( ) ) ; java . lang . Thread . sleep ( 50 ) ; "<AssertPlaceHolder>" ; verify ( sm ) . remove ( c ) ; sched . stop ( ) ; } hasCompleted ( ) { return ( this . phaseIndex ) >= ( this . phases . size ( ) ) ; }
|
org . junit . Assert . assertTrue ( c . hasCompleted ( ) )
|
testRewriteCookieMatchingPathBug1 ( ) { javax . servlet . http . HttpServletRequest request = buildRequestBug1 ( ) ; java . net . URL redirectUrl = new java . net . URL ( "http://localhost:8180/services/" ) ; com . woonoz . proxy . servlet . UrlRewriter rewriter = new com . woonoz . proxy . servlet . UrlRewriterImpl ( request , redirectUrl ) ; java . lang . String cookie = "JSESSIONID=F39EC36E999C90604EAFF7A87F88DA58;<sp>Path=/services;" ; java . lang . String expected = "JSESSIONID=F39EC36E999C90604EAFF7A87F88DA58;<sp>path=/wol-wnz-pro/com.woonoz.gwt.woonoz.Woonoz/proxy;" ; "<AssertPlaceHolder>" ; org . easymock . EasyMock . verify ( request ) ; } rewriteCookie ( java . lang . String ) { org . apache . http . impl . cookie . BestMatchSpec parser = new org . apache . http . impl . cookie . BestMatchSpec ( ) ; java . util . List < org . apache . http . cookie . Cookie > cookies ; try { cookies = parser . parse ( new org . apache . http . message . BasicHeader ( "Set-Cookie" , headerValue ) , new org . apache . http . cookie . CookieOrigin ( targetServer . getHost ( ) , getPortOrDefault ( targetServer ) , targetServer . getPath ( ) , false ) ) ; } catch ( org . apache . http . cookie . MalformedCookieException e ) { throw new com . woonoz . proxy . servlet . InvalidCookieException ( e ) ; } if ( ( cookies . size ( ) ) != 1 ) { throw new com . woonoz . proxy . servlet . InvalidCookieException ( ) ; } org . apache . http . cookie . Cookie cookie = rewriteCookiePathIfNeeded ( cookies . get ( 0 ) ) ; com . woonoz . proxy . servlet . CookieFormatter cookieFormatter = com . woonoz . proxy . servlet . CookieFormatter . createFromApacheCookie ( cookie ) ; return cookieFormatter . asString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , rewriter . rewriteCookie ( cookie ) )
|
getConnectionOptionsSucceeds ( ) { final com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttConnection mqttConnection = mockit . Deencapsulation . newInstance ( com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttConnection . class , new java . lang . Class [ ] { java . lang . String . class , java . lang . String . class , java . lang . String . class , java . lang . String . class , javax . net . ssl . SSLContext . class } , tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttConnectionTest . SERVER_URI , tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttConnectionTest . CLIENT_ID , tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttConnectionTest . USER_NAME , tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttConnectionTest . PWORD , mockIotHubSSLContext ) ; tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . MqttConnectOptions mqttConnectOptions = mockit . Deencapsulation . invoke ( mqttConnection , "getConnectionOptions" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( mqttConnectOptions )
|
testConvert ( ) { java . lang . String content = "content" ; java . lang . String topic = "topic" ; java . lang . String recipient1 = "recipient1@gmail.com" ; java . lang . String recipient2 = "recipient2@gmail.com" ; java . util . List < java . lang . String > recipient = java . util . Arrays . asList ( recipient1 , recipient2 ) ; java . lang . Long groupId1 = 1L ; org . lnu . is . domain . group . Group group1 = new org . lnu . is . domain . group . Group ( ) ; group1 . setId ( groupId1 ) ; java . lang . Long groupId2 = 2L ; org . lnu . is . domain . group . Group group2 = new org . lnu . is . domain . group . Group ( ) ; group2 . setId ( groupId2 ) ; java . util . List < java . lang . Long > groupIds = java . util . Arrays . asList ( groupId1 , groupId2 ) ; java . util . List < org . lnu . is . domain . group . Group > groups = java . util . Arrays . asList ( group1 , group2 ) ; org . lnu . is . resource . broadcasting . BroadcastingMessageResource source = new org . lnu . is . resource . broadcasting . BroadcastingMessageResource ( ) ; source . setContent ( content ) ; source . setTopic ( topic ) ; source . setRecipients ( recipient ) ; source . setGroups ( groupIds ) ; org . lnu . is . domain . broadcasting . BroadcastingMessage expected = new org . lnu . is . domain . broadcasting . BroadcastingMessage ( ) ; expected . setTopic ( topic ) ; expected . setContent ( content ) ; expected . setRecipients ( recipient ) ; expected . setGroups ( groups ) ; org . lnu . is . domain . broadcasting . BroadcastingMessage actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
suppliedSearchedEntityTypesIsCopied ( ) { java . util . Set < org . semanticweb . owlapi . model . EntityType < ? > > types = new java . util . HashSet < org . semanticweb . owlapi . model . EntityType < ? > > ( ) ; types . add ( EntityType . CLASS ) ; java . util . Set < org . semanticweb . owlapi . model . EntityType < ? > > typesCopy = new java . util . HashSet < org . semanticweb . owlapi . model . EntityType < ? > > ( types ) ; edu . stanford . bmir . protege . web . shared . entity . EntityLookupRequest request = new edu . stanford . bmir . protege . web . shared . entity . EntityLookupRequest ( "Test" , edu . stanford . bmir . protege . web . shared . search . SearchType . SUB_STRING_MATCH_IGNORE_CASE , 20 , types ) ; types . add ( EntityType . OBJECT_PROPERTY ) ; "<AssertPlaceHolder>" ; } getSearchedEntityTypes ( ) { return searchedEntityTypes ; }
|
org . junit . Assert . assertEquals ( typesCopy , request . getSearchedEntityTypes ( ) )
|
testIncoherentRBox ( ) { org . obolibrary . robot . OWLOntology ontology = loadOntology ( "/incoherent-rbox.owl" ) ; org . semanticweb . owlapi . reasoner . OWLReasonerFactory reasonerFactory = new org . semanticweb . elk . owlapi . ElkReasonerFactory ( ) ; org . semanticweb . owlapi . reasoner . OWLReasoner reasoner = reasonerFactory . createReasoner ( ontology ) ; boolean isCaughtException = false ; try { org . obolibrary . robot . ReasonerHelper . validate ( reasoner ) ; } catch ( org . obolibrary . robot . exceptions . IncoherentRBoxException e ) { isCaughtException = true ; } "<AssertPlaceHolder>" ; } validate ( org . semanticweb . owlapi . reasoner . OWLReasoner ) { org . obolibrary . robot . ReasonerHelper . validate ( reasoner , null , null ) ; }
|
org . junit . Assert . assertTrue ( isCaughtException )
|
cancelRunsListenersTest ( ) { org . threadly . test . concurrent . TestRunnable tr = new org . threadly . test . concurrent . TestRunnable ( ) ; slf . listener ( tr ) ; slf . cancel ( false ) ; "<AssertPlaceHolder>" ; } ranOnce ( ) { return ( runCount . get ( ) ) == 1 ; }
|
org . junit . Assert . assertTrue ( tr . ranOnce ( ) )
|
testMergeShiftedTimestamp ( ) { org . apache . druid . query . Result < org . apache . druid . query . timeseries . TimeseriesResultValue > result1 = new org . apache . druid . query . Result < org . apache . druid . query . timeseries . TimeseriesResultValue > ( currTime , new org . apache . druid . query . timeseries . TimeseriesResultValue ( com . google . common . collect . ImmutableMap . of ( "rows" , 1L , "index" , 2L ) ) ) ; org . apache . druid . query . Result < org . apache . druid . query . timeseries . TimeseriesResultValue > result2 = new org . apache . druid . query . Result < org . apache . druid . query . timeseries . TimeseriesResultValue > ( currTime . plusHours ( 2 ) , new org . apache . druid . query . timeseries . TimeseriesResultValue ( com . google . common . collect . ImmutableMap . of ( "rows" , 2L , "index" , 3L ) ) ) ; org . apache . druid . query . Result < org . apache . druid . query . timeseries . TimeseriesResultValue > expected = new org . apache . druid . query . Result < org . apache . druid . query . timeseries . TimeseriesResultValue > ( currTime , new org . apache . druid . query . timeseries . TimeseriesResultValue ( com . google . common . collect . ImmutableMap . of ( "rows" , 3L , "index" , 5L ) ) ) ; org . apache . druid . query . Result < org . apache . druid . query . timeseries . TimeseriesResultValue > actual = new org . apache . druid . query . timeseries . TimeseriesBinaryFn ( org . apache . druid . java . util . common . granularity . Granularities . ALL , aggregatorFactories ) . apply ( result1 , result2 ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Integer , java . lang . Integer ) { return arg1 == null ? arg2 : arg2 == null ? arg1 : arg1 + arg2 ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testCheckSimpleRequestTypeAnyOrigin ( ) { com . erudika . para . utils . filters . MockHttpServletRequest request = new com . erudika . para . utils . filters . MockHttpServletRequest ( ) ; request . setHeader ( CORSFilter . REQUEST_HEADER_ORIGIN , "http://www.w3.org" ) ; request . setMethod ( "GET" ) ; com . erudika . para . utils . filters . CORSFilter corsFilter = new com . erudika . para . utils . filters . CORSFilter ( ) ; corsFilter . init ( com . erudika . para . utils . filters . TestConfigs . getDefaultFilterConfig ( ) ) ; com . erudika . para . utils . filters . CORSFilter . CORSRequestType requestType = corsFilter . checkRequestType ( request ) ; "<AssertPlaceHolder>" ; } checkRequestType ( javax . servlet . http . HttpServletRequest ) { com . erudika . para . utils . filters . CORSFilter . CORSRequestType requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; if ( request == null ) { throw new java . lang . IllegalArgumentException ( "HttpServletRequest<sp>object<sp>is<sp>null" ) ; } java . lang . String originHeader = request . getHeader ( com . erudika . para . utils . filters . CORSFilter . REQUEST_HEADER_ORIGIN ) ; if ( originHeader != null ) { if ( originHeader . isEmpty ( ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else if ( ! ( com . erudika . para . utils . filters . CORSFilter . isValidOrigin ( originHeader ) ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else { java . lang . String method = org . apache . commons . lang3 . StringUtils . trimToEmpty ( request . getMethod ( ) ) ; if ( com . erudika . para . utils . filters . CORSFilter . HTTP_METHODS . contains ( method ) ) { if ( "OPTIONS" . equals ( method ) ) { java . lang . String accessControlRequestMethodHeader = request . getHeader ( com . erudika . para . utils . filters . CORSFilter . REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD ) ; if ( org . apache . commons . lang3 . StringUtils . isNotBlank ( accessControlRequestMethodHeader ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . PRE_FLIGHT ; } else if ( org . apache . commons . lang3 . StringUtils . isWhitespace ( accessControlRequestMethodHeader ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } else if ( ( "GET" . equals ( method ) ) || ( "HEAD" . equals ( method ) ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . SIMPLE ; } else if ( "POST" . equals ( method ) ) { java . lang . String contentType = request . getContentType ( ) ; if ( contentType != null ) { contentType = contentType . toLowerCase ( ) . trim ( ) ; if ( com . erudika . para . utils . filters . CORSFilter . SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES . contains ( contentType ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . SIMPLE ; } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } } else if ( com . erudika . para . utils . filters . CORSFilter . COMPLEX_HTTP_METHODS . contains ( method ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } } } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . NOT_CORS ; } return requestType ; }
|
org . junit . Assert . assertEquals ( CORSFilter . CORSRequestType . SIMPLE , requestType )
|
testClean ( ) { ( ( org . onosproject . vpls . cli . TestVpls ) ( vplsCommand . vpls ) ) . initSampleData ( ) ; vplsCommand . command = VplsCommandEnum . CLEAN . toString ( ) ; vplsCommand . doExecute ( ) ; java . util . Collection < org . onosproject . vpls . api . VplsData > vplss = vplsCommand . vpls . getAllVpls ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , vplss . size ( ) )
|
referenceToAssociatedEntityDesciptorPointsToRepresentationDescriptor ( ) { org . springframework . hateoas . Link profileLink = client . discoverUnique ( "profile" ) ; org . springframework . hateoas . Link usersLink = client . discoverUnique ( profileLink , "people" , MediaType . ALL ) ; java . lang . String jsonPath = "$.alps." ; jsonPath += "descriptor[?(@.id<sp>==<sp>'person-representation')]." ; jsonPath += "descriptor[?(@.name<sp>==<sp>'father')]." ; jsonPath += "rt" ; java . lang . String result = client . follow ( usersLink , RestMediaTypes . ALPS_JSON ) . andReturn ( ) . getResponse ( ) . getContentAsString ( ) ; java . lang . String rt = com . jayway . jsonpath . JsonPath . < net . minidev . json . JSONArray > read ( result , jsonPath ) . get ( 0 ) . toString ( ) ; "<AssertPlaceHolder>" . contains ( ProfileController . PROFILE_ROOT_MAPPING ) . endsWith ( "-representation" ) ; } toString ( ) { return value ; }
|
org . junit . Assert . assertThat ( rt )
|
sourcePathsToOutputsGivenByDefault ( ) { com . facebook . buck . core . model . targetgraph . TargetNode < ? > depNode = com . facebook . buck . jvm . java . JavaLibraryBuilder . createBuilder ( com . facebook . buck . core . model . BuildTargetFactory . newInstance ( filesystem . getRootPath ( ) , "//some:dep" ) , filesystem ) . addSrc ( java . nio . file . Paths . get ( "Dep.java" ) ) . build ( ) ; com . facebook . buck . core . model . targetgraph . TargetNode < ? > targetNode = com . facebook . buck . jvm . java . JavaLibraryBuilder . createBuilder ( com . facebook . buck . core . model . BuildTargetFactory . newInstance ( filesystem . getRootPath ( ) , "//some:target" ) , filesystem ) . addSrc ( java . nio . file . Paths . get ( "Target.java" ) ) . addDep ( depNode . getBuildTarget ( ) ) . build ( ) ; com . facebook . buck . core . model . targetgraph . TargetGraph targetGraph = com . facebook . buck . core . model . targetgraph . TargetGraphFactory . newInstance ( depNode , targetNode ) ; com . facebook . buck . core . rules . ActionGraphBuilder graphBuilder = new com . facebook . buck . core . rules . resolver . impl . TestActionGraphBuilder ( targetGraph , filesystem ) ; com . facebook . buck . core . rules . BuildRule rule = graphBuilder . requireRule ( targetNode . getBuildTarget ( ) ) ; com . facebook . buck . rules . macros . QueryPathsMacroExpander expander = new com . facebook . buck . rules . macros . QueryPathsMacroExpander ( java . util . Optional . of ( targetGraph ) ) ; com . facebook . buck . rules . macros . StringWithMacrosConverter converter = com . facebook . buck . rules . macros . StringWithMacrosConverter . builder ( ) . setBuildTarget ( targetNode . getBuildTarget ( ) ) . setCellPathResolver ( cellPathResolver ) . addExpanders ( expander ) . build ( ) ; java . lang . String input = "$(query_paths<sp>'deps(//some:target)')" ; java . lang . String expanded = coerceAndStringify ( filesystem , cellPathResolver , graphBuilder , converter , input , rule ) ; com . facebook . buck . core . sourcepath . resolver . impl . DefaultSourcePathResolver pathResolver = com . facebook . buck . core . sourcepath . resolver . impl . DefaultSourcePathResolver . from ( new com . facebook . buck . core . rules . SourcePathRuleFinder ( graphBuilder ) ) ; java . lang . String expected = java . util . stream . Stream . of ( depNode , targetNode ) . map ( TargetNode :: getBuildTarget ) . map ( graphBuilder :: requireRule ) . map ( BuildRule :: getSourcePathToOutput ) . map ( pathResolver :: getAbsolutePath ) . map ( Object :: toString ) . collect ( java . util . stream . Collectors . joining ( "<sp>" ) ) ; "<AssertPlaceHolder>" ; } collect ( java . util . stream . Collector ) { return delegate . collect ( collector ) ; }
|
org . junit . Assert . assertEquals ( expected , expanded )
|
not_isKeysOnly ( ) { net . ripe . db . whois . query . query . Query query = net . ripe . db . whois . query . query . Query . parse ( "foo" ) ; "<AssertPlaceHolder>" ; } isKeysOnly ( ) { net . ripe . db . whois . query . query . Query query = net . ripe . db . whois . query . query . Query . parse ( "-K<sp>10.0.0.0" ) ; org . junit . Assert . assertThat ( query . isKeysOnly ( ) , org . hamcrest . Matchers . is ( true ) ) ; }
|
org . junit . Assert . assertThat ( query . isKeysOnly ( ) , org . hamcrest . Matchers . is ( false ) )
|
testMinutesOfYearWithWrongOffsetBugWithCalendar ( ) { final java . util . Calendar c = java . util . Calendar . getInstance ( ) ; c . set ( Calendar . MONTH , Calendar . JANUARY ) ; c . set ( Calendar . DAY_OF_YEAR , 1 ) ; c . set ( Calendar . HOUR_OF_DAY , 0 ) ; c . set ( Calendar . MINUTE , 0 ) ; c . set ( Calendar . SECOND , 0 ) ; c . set ( Calendar . MILLISECOND , 0 ) ; final long testResult = org . apache . commons . lang3 . time . DateUtils . getFragmentInMinutes ( c , Calendar . YEAR ) ; "<AssertPlaceHolder>" ; } getFragmentInMinutes ( java . util . Date , int ) { return org . apache . commons . lang3 . time . DateUtils . getFragment ( date , fragment , TimeUnit . MINUTES ) ; }
|
org . junit . Assert . assertEquals ( 0 , testResult )
|
testMetrics ( ) { dagger . ObjectGraph og = dagger . ObjectGraph . create ( com . streamsets . datacollector . main . RuntimeModule . class ) ; com . streamsets . datacollector . main . RuntimeInfo info = og . get ( com . streamsets . datacollector . main . RuntimeInfo . class ) ; "<AssertPlaceHolder>" ; } getMetrics ( ) { return metrics ; }
|
org . junit . Assert . assertNotNull ( info . getMetrics ( ) )
|
testDomainAttributes ( ) { clickAndWait ( "treeForm:tree:nodes:nodes_link" , org . glassfish . admingui . devtests . ApplicationTest . TRIGGER_DOMAIN_ATTRIBUTES ) ; setFieldValue ( "propertyForm:propertySheet:propertSectionTextField:localeProp:Locale" , "en_UK" ) ; clickAndWait ( "propertyForm:propertyContentPage:topButtons:saveButton" , org . glassfish . admingui . devtests . ApplicationTest . TRIGGER_SUCCESS ) ; "<AssertPlaceHolder>" ; } getFieldValue ( java . lang . String ) { waitForElement ( elem ) ; return org . glassfish . admingui . devtests . BaseSeleniumTestClass . selenium . getValue ( elem ) ; }
|
org . junit . Assert . assertEquals ( "en_UK" , getFieldValue ( "propertyForm:propertySheet:propertSectionTextField:localeProp:Locale" ) )
|
generate_random_number_with_java ( ) { java . util . Random random = new java . util . Random ( ) ; double randomNumber = random . nextInt ( 10 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( ( randomNumber <= 10 ) )
|
testClosed ( ) { final it . unimi . dsi . fastutil . io . InspectableFileCachedInputStream icis = new it . unimi . dsi . fastutil . io . InspectableFileCachedInputStream ( 4 ) ; final byte [ ] data = new byte [ ] { 1 , 2 } ; icis . write ( java . nio . ByteBuffer . wrap ( data ) ) ; icis . close ( ) ; "<AssertPlaceHolder>" ; icis . read ( ) ; } isOpen ( ) { return ( position ) != ( - 1 ) ; }
|
org . junit . Assert . assertFalse ( icis . isOpen ( ) )
|
canGenerateLowMolecularTumorPercentage ( ) { net . sf . dynamicreports . jasper . builder . JasperReportBuilder report = com . hartwig . hmftools . patientreporter . report . PDFWriterTest . generateQCFailCPCTReport ( null , 0.15 , QCFailReason . SHALLOW_SEQ_LOW_PURITY ) ; "<AssertPlaceHolder>" ; if ( com . hartwig . hmftools . patientreporter . report . PDFWriterTest . WRITE_TO_PDF ) { report . toPdf ( new java . io . FileOutputStream ( ( ( ( com . hartwig . hmftools . patientreporter . report . PDFWriterTest . REPORT_BASE_DIR ) + ( java . io . File . separator ) ) + "hmf_low_molecular_tumor_percentage_report.pdf" ) ) ) ; } } generateQCFailCPCTReport ( java . lang . Double , java . lang . Double , com . hartwig . hmftools . patientreporter . qcfail . QCFailReason ) { com . hartwig . hmftools . patientreporter . SampleReport sampleReport = com . hartwig . hmftools . patientreporter . ImmutableSampleReport . builder ( ) . sampleId ( "Melanoma" 0 ) . barcodeTumor ( "Melanoma" 1 ) . barcodeReference ( "FR12123488" ) . patientTumorLocation ( com . hartwig . hmftools . common . ecrf . projections . ImmutablePatientTumorLocation . of ( "CPCT02991111" , "Skin" , "Melanoma" ) ) . purityShallowSeq ( ( shallowSeqPurity != null ? com . hartwig . hmftools . patientreporter . report . util . PatientReportFormat . formatPercent ( shallowSeqPurity ) : "Melanoma" 5 ) ) . pathologyTumorPercentage ( ( pathologyTumorPercentage != null ? com . hartwig . hmftools . patientreporter . report . util . PatientReportFormat . formatPercent ( pathologyTumorPercentage ) : "Melanoma" 5 ) ) . tumorArrivalDate ( java . time . LocalDate . parse ( "Melanoma" 6 , com . hartwig . hmftools . patientreporter . report . PDFWriterTest . DATE_FORMATTER ) ) . bloodArrivalDate ( java . time . LocalDate . parse ( "Melanoma" 3 , com . hartwig . hmftools . patientreporter . report . PDFWriterTest . DATE_FORMATTER ) ) . labProcedures ( "PREP013V23-QC037V20-SEQ008V25" ) . addressee ( "HMF<sp>Testing<sp>Center" ) . projectName ( "Melanoma" 4 ) . requesterName ( "ContactMe" ) . requesterEmail ( "contact@me.com" ) . submissionId ( "ABC" ) . hospitalPatientId ( "123456" ) . hospitalPaSampleIdWIDE ( "Melanoma" 2 ) . build ( ) ; com . hartwig . hmftools . patientreporter . QCFailReport patientReport = com . hartwig . hmftools . patientreporter . ImmutableQCFailReport . of ( sampleReport , reason , QCFailStudy . CPCT , java . util . Optional . empty ( ) , com . hartwig . hmftools . patientreporter . PatientReporterTestUtil . testBaseReportData ( ) . signaturePath ( ) , com . hartwig . hmftools . patientreporter . PatientReporterTestUtil . testBaseReportData ( ) . logoRVAPath ( ) ) ; return com . hartwig . hmftools . patientreporter . report . PDFWriter . generateQCFailReport ( patientReport ) ; }
|
org . junit . Assert . assertNotNull ( report )
|
testSort ( ) { int maxiter = 10 ; int maxint = 999 ; java . util . ArrayList < java . lang . Integer > toSort = new java . util . ArrayList < java . lang . Integer > ( maxiter ) ; java . util . Random rnd = new java . util . Random ( ) ; for ( int i = 0 ; i < maxiter ; ++ i ) toSort . add ( rnd . nextInt ( maxint ) ) ; final java . util . ArrayList < java . util . concurrent . atomic . AtomicInteger > counterArray = new java . util . ArrayList < java . util . concurrent . atomic . AtomicInteger > ( maxint ) ; for ( int i = 0 ; i < maxint ; ++ i ) counterArray . add ( new java . util . concurrent . atomic . AtomicInteger ( 0 ) ) ; final java . util . ArrayList < java . util . concurrent . atomic . AtomicInteger > counterArray2 = new java . util . ArrayList < java . util . concurrent . atomic . AtomicInteger > ( maxint ) ; for ( int i = 0 ; i < maxint ; ++ i ) counterArray2 . add ( new java . util . concurrent . atomic . AtomicInteger ( 0 ) ) ; com . intel . hadoop . graphbuilder . util . Parallel parfor = new com . intel . hadoop . graphbuilder . util . Parallel ( ) ; parfor . For ( toSort , new com . intel . hadoop . graphbuilder . util . Parallel . Operation < java . lang . Integer > ( ) { @ com . intel . hadoop . graphbuilder . test . util . Override public void perform ( java . lang . Integer p , int idx ) { counterArray . get ( p ) . incrementAndGet ( ) ; } } ) ; parfor . close ( ) ; for ( int i = 0 ; i < ( toSort . size ( ) ) ; ++ i ) { counterArray2 . get ( toSort . get ( i ) ) . incrementAndGet ( ) ; } for ( int i = 0 ; i < ( counterArray . size ( ) ) ; ++ i ) "<AssertPlaceHolder>" ; } size ( ) { return ( sources ) == null ? 0 : sources . size ( ) ; }
|
org . junit . Assert . assertEquals ( counterArray . get ( i ) . get ( ) , counterArray2 . get ( i ) . get ( ) )
|
ConcurrentSubmitJobsTooManyRequestsException ( ) { try { org . apache . hive . hcatalog . templeton . JobRunnable jobRunnable = SubmitConcurrentJobs ( 6 , org . apache . hive . hcatalog . templeton . TestConcurrentJobRequestsThreadsAndTimeout . config , false , false , submitJobHelper . getDelayedResonseAnswer ( 4 , 0 ) , killJobHelper . getDelayedResonseAnswer ( 0 , org . apache . hive . hcatalog . templeton . TestConcurrentJobRequestsThreadsAndTimeout . statusBean ) , "job_1000" ) ; verifyTooManyRequestsException ( jobRunnable . exception , this . submitTooManyRequestsExceptionMessage ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } verifyTooManyRequestsException ( java . lang . Throwable , java . lang . String ) { org . junit . Assert . assertTrue ( ( exception != null ) ) ; org . junit . Assert . assertTrue ( ( exception instanceof org . apache . hive . hcatalog . templeton . TooManyRequestsException ) ) ; org . apache . hive . hcatalog . templeton . TooManyRequestsException ex = ( ( org . apache . hive . hcatalog . templeton . TooManyRequestsException ) ( exception ) ) ; org . junit . Assert . assertTrue ( ( ( ex . httpCode ) == ( TooManyRequestsException . TOO_MANY_REQUESTS_429 ) ) ) ; org . junit . Assert . assertTrue ( exception . getMessage ( ) . contains ( expectedMessage ) ) ; }
|
org . junit . Assert . assertTrue ( false )
|
buildAuthRequestUrl ( ) { java . lang . String expectedUrl = "https://server.example.com/authorize?" + ( ( ( ( ( ( "bar" 2 + "&client_id=s6BhdRkqt3" ) + "&scope=openid+profile" ) + "&redirect_uri=https%3A%2F%2Fclient.example.org%2F" ) + "&nonce=34fasf3ds" ) + "&state=af0ifjsldkj" ) + "&foo=bar" ) ; java . util . Map < java . lang . String , java . lang . String > options = com . google . common . collect . ImmutableMap . of ( "bar" 0 , "bar" ) ; java . lang . String actualUrl = urlBuilder . buildAuthRequestUrl ( serverConfig , clientConfig , "bar" 1 , "34fasf3ds" , "af0ifjsldkj" , options , null ) ; "<AssertPlaceHolder>" ; } buildAuthRequestUrl ( org . mitre . openid . connect . config . ServerConfiguration , org . mitre . oauth2 . model . RegisteredClient , java . lang . String , java . lang . String , java . lang . String , java . util . Map , java . lang . String ) { com . nimbusds . jwt . JWTClaimsSet . Builder claims = new com . nimbusds . jwt . JWTClaimsSet . Builder ( ) ; claims . claim ( "code" 0 , "code" ) ; claims . claim ( "client_id" , clientConfig . getClientId ( ) ) ; claims . claim ( "scope" , com . google . common . base . Joiner . on ( "<sp>" ) . join ( clientConfig . getScope ( ) ) ) ; claims . claim ( "redirect_uri" , redirectUri ) ; claims . claim ( "nonce" , nonce ) ; claims . claim ( "state" , state ) ; for ( java . util . Map . Entry < java . lang . String , java . lang . String > option : options . entrySet ( ) ) { claims . claim ( option . getKey ( ) , option . getValue ( ) ) ; } if ( ! ( com . google . common . base . Strings . isNullOrEmpty ( loginHint ) ) ) { claims . claim ( "login_hint" , loginHint ) ; } com . nimbusds . jwt . EncryptedJWT jwt = new com . nimbusds . jwt . EncryptedJWT ( new com . nimbusds . jose . JWEHeader ( alg , enc ) , claims . build ( ) ) ; org . mitre . jwt . encryption . service . JWTEncryptionAndDecryptionService encryptor = encrypterService . getEncrypter ( serverConfig . getJwksUri ( ) ) ; encryptor . encryptJwt ( jwt ) ; try { org . apache . http . client . utils . URIBuilder uriBuilder = new org . apache . http . client . utils . URIBuilder ( serverConfig . getAuthorizationEndpointUri ( ) ) ; uriBuilder . addParameter ( "request" , jwt . serialize ( ) ) ; return uriBuilder . build ( ) . toString ( ) ; } catch ( java . net . URISyntaxException e ) { throw new org . springframework . security . authentication . AuthenticationServiceException ( "Malformed<sp>Authorization<sp>Endpoint<sp>Uri" , e ) ; } }
|
org . junit . Assert . assertThat ( actualUrl , org . hamcrest . CoreMatchers . equalTo ( expectedUrl ) )
|
testWillNotSendImmediatlyWhenDailyCalled ( ) { codeine . jsons . project . ProjectJson projectJson = createProject ( "myproject" ) ; createNotification ( projectJson ) ; java . util . List < codeine . mail . NotificationContent > result = tested . prepareMailsToUsers ( AlertsCollectionType . Daily , projectNameToItems , projects ) ; "<AssertPlaceHolder>" ; } size ( ) { return original . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testAggregateDistinctValue ( ) { try { agg = new com . huawei . streaming . process . agg . aggregator . AggregateDistinctValue ( null ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } fail ( ) { com . huawei . streaming . support . SupportHelper . fail ( null ) ; }
|
org . junit . Assert . assertTrue ( true )
|
ensureInterceptorCountIsConstant ( ) { gov . hhs . fha . nhinc . messaging . client . CONNECTClient < gov . hhs . fha . nhinc . messaging . service . port . TestServicePortType > client = createClient ( ) ; org . apache . cxf . endpoint . Client cxfClient = org . apache . cxf . frontend . ClientProxy . getClient ( client . getPort ( ) ) ; int numInInterceptors = cxfClient . getInInterceptors ( ) . size ( ) ; createClient ( ) ; createClient ( ) ; gov . hhs . fha . nhinc . messaging . client . CONNECTClient < gov . hhs . fha . nhinc . messaging . service . port . TestServicePortType > client2 = createClient ( ) ; org . apache . cxf . endpoint . Client cxfClient2 = org . apache . cxf . frontend . ClientProxy . getClient ( client2 . getPort ( ) ) ; "<AssertPlaceHolder>" ; } getPort ( ) { return null ; }
|
org . junit . Assert . assertEquals ( numInInterceptors , cxfClient2 . getInInterceptors ( ) . size ( ) )
|
usersInNorthRegion ( ) { com . aerospike . client . query . Statement stmt = new com . aerospike . client . query . Statement ( ) ; stmt . setNamespace ( TestQueryEngine . NAMESPACE ) ; stmt . setSetName ( "users" ) ; com . aerospike . helper . query . KeyRecordIterator it = queryEngine . select ( stmt , new com . aerospike . helper . query . Qualifier ( "region" , com . aerospike . helper . query . Qualifier . FilterOperation . EQ , com . aerospike . client . Value . get ( "n" ) ) ) ; try { while ( it . hasNext ( ) ) { com . aerospike . client . query . KeyRecord rec = it . next ( ) ; java . lang . String region = rec . record . getString ( "region" ) ; "<AssertPlaceHolder>" ; } } finally { it . close ( ) ; } } getString ( java . lang . String ) { return ( ( java . lang . String ) ( getValue ( name ) ) ) ; }
|
org . junit . Assert . assertEquals ( "n" , region )
|
testToExpression ( ) { com . dremio . dac . explore . model . FieldTransformationBase exp = new com . dremio . dac . proto . model . dataset . FieldConvertToJSON ( ) ; com . dremio . dac . explore . model . FieldTransformationBase actual = com . dremio . dac . explore . model . FieldTransformationBase . unwrap ( exp . wrap ( ) ) ; "<AssertPlaceHolder>" ; } wrap ( ) { return com . dremio . dac . explore . model . ExtractListRuleBase . acceptor . wrap ( this ) ; }
|
org . junit . Assert . assertSame ( exp , actual )
|
newKeySelector_x509 ( ) { java . io . FileInputStream in = null ; org . w3c . dom . Document document = null ; try { in = new java . io . FileInputStream ( FILE_OPENAM_RESPONSE ) ; document = org . oscm . converter . XMLConverter . convertToDocument ( in ) ; } finally { if ( in != null ) { in . close ( ) ; } } org . w3c . dom . NodeList nl = document . getElementsByTagNameNS ( XMLSignature . XMLNS , "Signature" ) ; javax . xml . crypto . KeySelector keySelector = factory . newKeySelector ( nl . item ( 0 ) ) ; "<AssertPlaceHolder>" ; } newKeySelector ( org . w3c . dom . Node ) { org . w3c . dom . Node nodeKeyinfo = getKeyInfoNode ( nodeSignature ) ; if ( nodeKeyinfo == null ) { throw new org . oscm . internal . types . exception . DigitalSignatureValidationException ( "No<sp>KeyInfo<sp>element<sp>found<sp>in<sp>SAML<sp>assertion" ) ; } org . w3c . dom . NodeList children = nodeKeyinfo . getChildNodes ( ) ; for ( int i = 0 ; i < ( children . getLength ( ) ) ; i ++ ) { org . w3c . dom . Node node = children . item ( i ) ; if ( SamlXmlTags . NODE_KEY_VALUE . equals ( node . getLocalName ( ) ) ) { return new org . oscm . saml2 . api . KeyValueKeySelector ( ) ; } else if ( SamlXmlTags . NODE_X509DATA . equals ( node . getLocalName ( ) ) ) { return new org . oscm . saml2 . api . X509KeySelector ( keystore ) ; } } throw new org . oscm . internal . types . exception . DigitalSignatureValidationException ( "Only<sp>RSA/DSA<sp>KeyValue<sp>and<sp>are<sp>X509Data<sp>supported" ) ; }
|
org . junit . Assert . assertTrue ( ( keySelector instanceof org . oscm . saml2 . api . X509KeySelector ) )
|
testParameterValue_twoElementsList ( ) { com . thoughtworks . qdox . model . expression . AnnotationValue value1 = mock ( com . thoughtworks . qdox . model . expression . AnnotationValue . class ) ; when ( value1 . getParameterValue ( ) ) . thenReturn ( "2" ) ; com . thoughtworks . qdox . model . expression . AnnotationValue value2 = mock ( com . thoughtworks . qdox . model . expression . AnnotationValue . class ) ; when ( value2 . getParameterValue ( ) ) . thenReturn ( "3" ) ; java . util . List < com . thoughtworks . qdox . model . expression . AnnotationValue > actualList = new java . util . LinkedList < com . thoughtworks . qdox . model . expression . AnnotationValue > ( ) ; actualList . add ( value1 ) ; actualList . add ( value2 ) ; com . thoughtworks . qdox . model . expression . AnnotationValueList expr = new com . thoughtworks . qdox . model . expression . AnnotationValueList ( actualList ) ; java . util . List < java . lang . String > expectedParameterValue = new java . util . LinkedList < java . lang . String > ( ) ; expectedParameterValue . add ( "2" ) ; expectedParameterValue . add ( "3" ) ; "<AssertPlaceHolder>" ; } getParameterValue ( ) { return ( ( getLeft ( ) . getParameterValue ( ) ) + "<sp><<sp>" ) + ( getRight ( ) . getParameterValue ( ) ) ; }
|
org . junit . Assert . assertEquals ( expectedParameterValue , expr . getParameterValue ( ) )
|
test_calculateStockCost ( ) { double cost = com . levelup . java . exercises . beginner . StockCommission . calculateStockCost ( 10 , 0.1 ) ; "<AssertPlaceHolder>" ; } calculateStockCost ( double , double ) { return stockPrice * commission ; }
|
org . junit . Assert . assertEquals ( 1 , cost , 0 )
|
testCharTypeIllegalParameters ( ) { int count = 0 ; int [ ] illegalLength = new int [ ] { 0 , - 10 , ( CharTypeInfo . MAX_CHAR_LENGTH ) + 1 } ; for ( int i : illegalLength ) { try { com . aliyun . odps . type . CharTypeInfo type = new com . aliyun . odps . type . CharTypeInfo ( i ) ; } catch ( java . lang . IllegalArgumentException e ) { count ++ ; } } "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( illegalLength . length , count )
|
testProcessorEvents5 ( ) { java . lang . String events = recordRichStringProcessorEvents ( ( "\t\'\'\'\n" + ( ( ( "acceptTemplateText(\t)" 1 + "\n" ) + "acceptTemplateText(\t)" 0 ) + "acceptTemplateText(\t)" 2 ) ) ) ; java . lang . String expected = "announceNextLiteral()\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "acceptTemplateText()\n" + "acceptTemplateText(\t)" 3 ) + "acceptTemplateText(\t)\n" ) + "acceptIfCondition()\n" ) + "announceNextLiteral()\n" ) + "acceptTemplateText()\n" ) + "acceptTemplateText(\t)" 3 ) + "acceptSemanticText()\n" ) + "acceptSemanticText()\n" ) + "acceptSemanticLineBreak()\n" ) + "acceptTemplateText(\t)\n" ) + "acceptEndIf()\n" ) + "announceNextLiteral()\n" ) + "acceptTemplateText()\n" ) + "acceptTemplateText(\t)" 3 ) + "acceptTemplateText(\t)" ) ; "<AssertPlaceHolder>" ; } recordRichStringProcessorEvents ( java . lang . String ) { org . eclipse . xtend . core . xtend . RichString richString = richString ( string ) ; org . eclipse . xtend . core . richstring . RichStringProcessor processor = new org . eclipse . xtend . core . richstring . RichStringProcessor ( ) ; org . eclipse . xtend . core . tests . richstring . RichStringProcessorTest . RecordingRichStringPartAcceptor acceptor = new org . eclipse . xtend . core . tests . richstring . RichStringProcessorTest . RecordingRichStringPartAcceptor ( ) ; processor . process ( richString , acceptor , new org . eclipse . xtend . core . richstring . DefaultIndentationHandler ( ) ) ; return acceptor . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , events )
|
testInOutIdent ( ) { org . mp4parser . IsoFile isoFile = new org . mp4parser . IsoFile ( new org . mp4parser . tools . ByteBufferByteChannel ( in ) ) ; org . mp4parser . boxes . iso14496 . part15 . HevcConfigurationBox hevC = org . mp4parser . tools . Path . getPath ( isoFile , "hvc1/hvcC" ) ; assert hevC != null ; hevC . parseDetails ( ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; isoFile . getBox ( java . nio . channels . Channels . newChannel ( baos ) ) ; "<AssertPlaceHolder>" ; } toByteArray ( ) { return java . util . Arrays . copyOf ( buf , count ) ; }
|
org . junit . Assert . assertArrayEquals ( in , baos . toByteArray ( ) )
|
testNoArgs ( ) { org . eclipse . ceylon . common . tool . ToolModel < org . eclipse . ceylon . tools . war . CeylonWarTool > model = pluginLoader . loadToolModel ( "war" ) ; "<AssertPlaceHolder>" ; try { pluginFactory . bindArguments ( model , getMainTool ( ) , java . util . Collections . < java . lang . String > emptyList ( ) ) ; org . junit . Assert . fail ( ) ; } catch ( org . eclipse . ceylon . common . tool . OptionArgumentException e ) { } }
|
org . junit . Assert . assertNotNull ( model )
|
xmlResponseShouldBeParsedObject ( ) { java . lang . String responseBody = "<xml><name>Hello<sp>World</name></xml>" ; responseProvider . expect ( com . github . kristofa . test . http . Method . GET , "/" ) . respondWith ( 200 , "application/xml" , responseBody ) ; com . navercorp . volleyextensions . volleyer . mock . ResponseHoldListener < com . navercorp . volleyextensions . volleyer . VolleyerIntegrationTest . Person > listener = new com . navercorp . volleyextensions . volleyer . mock . ResponseHoldListener < com . navercorp . volleyextensions . volleyer . VolleyerIntegrationTest . Person > ( ) ; java . lang . Class < com . navercorp . volleyextensions . volleyer . VolleyerIntegrationTest . Person > clazz = com . navercorp . volleyextensions . volleyer . VolleyerIntegrationTest . Person . class ; volleyer ( requestQueue ) . get ( com . navercorp . volleyextensions . volleyer . VolleyerIntegrationTest . url ) . withTargetClass ( clazz ) . withListener ( listener ) . execute ( ) ; with ( ) . await ( "xmlResponseShouldBeParsedObject" ) . until ( wasListenerCalled ( listener ) ) ; com . navercorp . volleyextensions . volleyer . VolleyerIntegrationTest . Person person = listener . getLastResponse ( ) ; "<AssertPlaceHolder>" ; } getLastResponse ( ) { return this . response ; }
|
org . junit . Assert . assertNotNull ( person . name )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.