input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testFilterProjectMembers ( ) { java . util . List < com . onboard . domain . model . User > list1 = new java . util . ArrayList < com . onboard . domain . model . User > ( ) ; java . util . List < com . onboard . domain . model . User > list2 = new java . util . ArrayList < com . onboard . domain . model . User > ( ) ; list1 . add ( getASampleUser ( 0 ) ) ; list1 . add ( getASampleUser ( 1 ) ) ; list1 . add ( getASampleUser ( 2 ) ) ; list2 . add ( getASampleUser ( 1 ) ) ; list2 . add ( getASampleUser ( 2 ) ) ; list2 . add ( getASampleUser ( 3 ) ) ; com . google . common . collect . Sets . SetView < com . onboard . domain . model . User > intersection = com . google . common . collect . Sets . intersection ( new java . util . HashSet < com . onboard . domain . model . User > ( list1 ) , new java . util . HashSet < com . onboard . domain . model . User > ( list2 ) ) ; com . onboard . service . account . impl . UserServiceImpl spyUserServiceImpl = org . mockito . Mockito . spy ( testedUserServiceImpl ) ; org . mockito . Mockito . doReturn ( list2 ) . when ( spyUserServiceImpl ) . getUserByProjectId ( ModuleHelper . projectId ) ; java . util . List < com . onboard . domain . model . User > user = spyUserServiceImpl . filterProjectMembers ( list1 , ModuleHelper . projectId ) ; org . mockito . Mockito . verify ( spyUserServiceImpl ) . filterProjectMembers ( list1 , ModuleHelper . projectId ) ; org . mockito . Mockito . verify ( spyUserServiceImpl ) . getUserByProjectId ( ModuleHelper . projectId ) ; org . mockito . Mockito . verifyNoMoreInteractions ( spyUserServiceImpl ) ; "<AssertPlaceHolder>" ; } getUserByProjectId ( int ) { com . onboard . domain . model . UserProject sample = new com . onboard . domain . model . UserProject ( ) ; sample . setProjectId ( projectId ) ; com . onboard . domain . mapper . model . UserProjectExample example = new com . onboard . domain . mapper . model . UserProjectExample ( sample ) ; java . util . List < com . onboard . domain . model . UserProject > userProjectList = userProjectMapper . selectByExample ( example ) ; com . google . common . base . Function < com . onboard . domain . model . UserProject , com . onboard . domain . model . User > mapping = new com . google . common . base . Function < com . onboard . domain . model . UserProject , com . onboard . domain . model . User > ( ) { @ com . onboard . service . account . impl . Override public com . onboard . domain . model . User apply ( com . onboard . domain . model . UserProject input ) { return getById ( input . getUserId ( ) ) ; } } ; return com . google . common . collect . Lists . transform ( userProjectList , mapping ) ; }
org . junit . Assert . assertEquals ( intersection . size ( ) , com . google . common . collect . Sets . intersection ( intersection , new java . util . HashSet < com . onboard . domain . model . User > ( user ) ) . size ( ) )
getServiceParameterList_productParameter_valueNotSet ( ) { parameters . add ( createParameter ( 1L , false , "param<sp>value<sp>one_time<sp>(not<sp>set)" , createParameterDefinition ( 1001L , ParameterModificationType . ONE_TIME , "one_time<sp>parameterId" , true ) ) ) ; java . util . List < org . oscm . provisioning . data . ServiceParameter > parameterList = org . oscm . applicationservice . filter . ParameterFilter . getServiceParameterList ( product , true ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , parameterList . size ( ) )
testTake ( ) { no . tv2 . serf . client . ResponseHandler responseHandler = new no . tv2 . serf . client . ResponseHandler ( 1L , true ) ; no . tv2 . serf . client . RawSerfResponse expectedResponse = new no . tv2 . serf . client . RawSerfResponse ( 1L , null ) ; responseHandler . addResponse ( expectedResponse ) ; no . tv2 . serf . client . RawSerfResponse actualResponse = responseHandler . take ( ) ; "<AssertPlaceHolder>" ; } take ( ) { no . tv2 . serf . client . RawSerfResponse response = handler . take ( ) ; return new no . tv2 . serf . client . Log ( response . getSeq ( ) , response . getError ( ) , response . getBody ( ) ) ; }
org . junit . Assert . assertEquals ( expectedResponse , actualResponse )
testAttrSoortAutorisatieOngeldig_Optioneel ( ) { final nl . bzk . brp . domain . leveringmodel . MetaObject persoon = nl . bzk . brp . domain . leveringmodel . MetaObject . maakBuilder ( ) . metObjectElement ( getObjectElement ( Element . PERSOON . getId ( ) ) ) . metObject ( ) . metId ( 111 ) . metObjectElement ( getObjectElement ( Element . PERSOON_ADRES ) ) . metGroep ( ) . metGroepElement ( getGroepElement ( Element . PERSOON_ADRES_IDENTITEIT ) ) . eindeGroep ( ) . metGroep ( ) . metGroepElement ( getGroepElement ( Element . PERSOON_ADRES_STANDAARD ) ) . metRecord ( ) . metId ( 1 ) . metActieInhoud ( nl . bzk . brp . service . maakbericht . filterstappen . GeefDetailsPersoonCorrigeerVoorScopingTest . actieInhoud ) . metAttribuut ( getAttribuutElement ( Element . PERSOON_ADRES_HUISNUMMER ) , 1 ) . eindeRecord ( ) . eindeGroep ( ) . eindeObject ( ) . eindeObject ( ) . build ( ) ; scopingElementen = com . google . common . collect . Sets . newHashSet ( getAttribuutElement ( Element . PERSOON_GEBOORTE_WOONPLAATSNAAM ) ) ; maakBerichtParameters . setGevraagdeElementen ( scopingElementen ) ; berichtgegevens = maakBerichtgegevens ( maakBerichtParameters , persoon ) ; geefDetailsPersoonCorrigeerVoorScoping . execute ( berichtgegevens ) ; "<AssertPlaceHolder>" ; } isAttribuutGeautoriseerd ( nl . bzk . algemeenbrp . dal . domein . brp . enums . Element ) { return berichtgegevens . isGeautoriseerd ( com . google . common . collect . Iterables . getOnlyElement ( berichtgegevens . getPersoonslijst ( ) . getModelIndex ( ) . geefAttributen ( getAttribuutElement ( attribuutElement ) ) ) ) ; }
org . junit . Assert . assertFalse ( isAttribuutGeautoriseerd ( Element . PERSOON_ADRES_HUISNUMMER ) )
testGetColumnHeaders_Returns_Correct_Size ( ) { mmarquee . automation . AutomationElement element = org . mockito . Mockito . mock ( mmarquee . automation . AutomationElement . class ) ; mmarquee . automation . pattern . Value value = org . mockito . Mockito . mock ( mmarquee . automation . pattern . Value . class ) ; mmarquee . automation . pattern . Grid grid = org . mockito . Mockito . mock ( mmarquee . automation . pattern . Grid . class ) ; mmarquee . automation . pattern . Table table = org . mockito . Mockito . mock ( mmarquee . automation . pattern . Table . class ) ; mmarquee . automation . pattern . Selection selection = org . mockito . Mockito . mock ( mmarquee . automation . pattern . Selection . class ) ; when ( grid . isAvailable ( ) ) . thenReturn ( true ) ; when ( table . isAvailable ( ) ) . thenReturn ( true ) ; java . util . List < mmarquee . automation . AutomationElement > elementList = new java . util . ArrayList ( ) ; mmarquee . automation . AutomationElement element1 = org . mockito . Mockito . mock ( mmarquee . automation . AutomationElement . class ) ; mmarquee . automation . AutomationElement element2 = org . mockito . Mockito . mock ( mmarquee . automation . AutomationElement . class ) ; elementList . add ( element1 ) ; elementList . add ( element2 ) ; when ( table . getCurrentColumnHeaders ( ) ) . thenReturn ( elementList ) ; mmarquee . automation . uiautomation . IUIAutomation mocked_automation = org . mockito . Mockito . mock ( mmarquee . automation . uiautomation . IUIAutomation . class ) ; mmarquee . automation . UIAutomation instance = new mmarquee . automation . UIAutomation ( mocked_automation ) ; mmarquee . automation . controls . AutomationDataGrid dataGrid = new mmarquee . automation . controls . AutomationDataGrid ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( value , grid , table , selection ) . automation ( instance ) ) ; java . util . List < mmarquee . automation . controls . AutomationDataGridCell > list = dataGrid . getColumnHeaders ( ) ; "<AssertPlaceHolder>" ; } getColumnHeaders ( ) { return this . getCurrentColumnHeaders ( ) ; }
org . junit . Assert . assertTrue ( ( ( list . size ( ) ) == 2 ) )
testFindElementsByName ( ) { java . util . Random random = new java . util . Random ( ) ; org . openqa . selenium . WebElement text = driver . findElements ( org . openqa . selenium . By . name ( "TextField1" ) ) . get ( 0 ) ; int number = ( random . nextInt ( ( ( ( com . sugarcrm . candybean . examples . mobile . AppiumAndroidTest . MAXIMUM ) - ( com . sugarcrm . candybean . examples . mobile . AppiumAndroidTest . MINIMUM ) ) + 1 ) ) ) + ( com . sugarcrm . candybean . examples . mobile . AppiumAndroidTest . MINIMUM ) ; text . sendKeys ( java . lang . String . valueOf ( number ) ) ; org . openqa . selenium . WebElement sumLabel = driver . findElements ( org . openqa . selenium . By . name ( "SumLabel" ) ) . get ( 0 ) ; driver . findElements ( org . openqa . selenium . By . name ( "ComputeSumButton" ) ) . get ( 0 ) . click ( ) ; "<AssertPlaceHolder>" ; } getText ( ) { logger . info ( ( "Getting<sp>text<sp>for<sp>element:<sp>" + ( this . toString ( ) ) ) ) ; if ( "input" . equals ( we . getTagName ( ) ) ) { return this . we . getAttribute ( "value" ) ; } return this . we . getText ( ) ; }
org . junit . Assert . assertEquals ( sumLabel . getText ( ) , java . lang . String . valueOf ( number ) )
reportGenerator_IOException ( ) { com . att . aro . core . pojo . AROTraceData results = new com . att . aro . core . pojo . AROTraceData ( ) ; results . setSuccess ( true ) ; when ( filereader . createFile ( any ( java . lang . String . class ) ) ) . thenThrow ( java . io . IOException . class ) ; boolean testResult = jsonreport . reportGenerator ( "abc.json" , results ) ; "<AssertPlaceHolder>" ; } reportGenerator ( java . lang . String , com . att . aro . core . pojo . AROTraceData ) { if ( ( resultFilePath == null ) || ( results == null ) ) { return false ; } com . fasterxml . jackson . databind . ObjectMapper mapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; mapper . enableDefaultTyping ( ) ; try { mapper . writeValue ( filereader . createFile ( resultFilePath ) , results ) ; return true ; } catch ( com . fasterxml . jackson . core . JsonGenerationException e ) { com . att . aro . core . report . impl . JSonReportImpl . LOGGER . error ( e . getMessage ( ) ) ; } catch ( com . fasterxml . jackson . databind . JsonMappingException e ) { com . att . aro . core . report . impl . JSonReportImpl . LOGGER . error ( e . getMessage ( ) ) ; } catch ( java . io . IOException e ) { com . att . aro . core . report . impl . JSonReportImpl . LOGGER . error ( e . getMessage ( ) ) ; } return false ; }
org . junit . Assert . assertFalse ( testResult )
testCurrentTimestamp ( ) { java . util . List < com . zendesk . maxwell . schema . ddl . SchemaChange > changes = parse ( "CREATE<sp>TABLE<sp>`foo`<sp>(<sp>`id`<sp>timestamp<sp>NOT<sp>NULL<sp>DEFAULT<sp>CURRENT_TIMESTAMP<sp>ON<sp>UPDATE<sp>CURRENT_TIMESTAMP<sp>)" ) ; "<AssertPlaceHolder>" ; } size ( ) { return columns . size ( ) ; }
org . junit . Assert . assertThat ( changes . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
testRewritePomWithInheritedVersion ( ) { java . util . List < org . apache . maven . project . MavenProject > reactorProjects = createReactorProjects ( "pom-with-inherited-version" ) ; org . apache . maven . shared . release . config . ReleaseDescriptorBuilder builder = createConfigurationForWithParentNextVersion ( reactorProjects , "pom-with-inherited-version" ) ; phase . execute ( org . apache . maven . shared . release . config . ReleaseUtils . buildReleaseDescriptor ( builder ) , new org . apache . maven . shared . release . env . DefaultReleaseEnvironment ( ) , reactorProjects ) ; "<AssertPlaceHolder>" ; } comparePomFiles ( java . util . List ) { return comparePomFiles ( reactorProjects , true ) ; }
org . junit . Assert . assertTrue ( comparePomFiles ( reactorProjects ) )
shouldReturnInitialInputForNullOperations ( ) { final java . lang . Object input = java . util . Arrays . asList ( new uk . gov . gchq . gaffer . operation . data . EntitySeed ( "1" ) , new uk . gov . gchq . gaffer . operation . data . EntitySeed ( "2" ) ) ; final uk . gov . gchq . gaffer . operation . util . Conditional conditional = mock ( uk . gov . gchq . gaffer . operation . util . Conditional . class ) ; final java . util . function . Predicate < java . lang . Object > predicate = mock ( java . util . function . Predicate . class ) ; final uk . gov . gchq . gaffer . operation . impl . GetWalks then = null ; final uk . gov . gchq . gaffer . operation . impl . get . GetElements otherwise = null ; final uk . gov . gchq . gaffer . operation . impl . If filter = new uk . gov . gchq . gaffer . operation . impl . If . Builder < > ( ) . input ( input ) . conditional ( conditional ) . then ( then ) . otherwise ( otherwise ) . build ( ) ; given ( conditional . getPredicate ( ) ) . willReturn ( predicate ) ; given ( predicate . test ( input ) ) . willReturn ( true ) ; final uk . gov . gchq . gaffer . store . operation . handler . IfHandler handler = new uk . gov . gchq . gaffer . store . operation . handler . IfHandler ( ) ; final java . lang . Object result = handler . doOperation ( filter , context , store ) ; "<AssertPlaceHolder>" ; verify ( predicate ) . test ( input ) ; verify ( store , never ( ) ) . execute ( then , context ) ; verify ( store , never ( ) ) . execute ( otherwise , context ) ; } doOperation ( uk . gov . gchq . gaffer . operation . impl . ForEach , uk . gov . gchq . gaffer . store . Context , uk . gov . gchq . gaffer . store . Store ) { if ( null == ( forEach . getOperation ( ) ) ) { throw new uk . gov . gchq . gaffer . operation . OperationException ( "Operation<sp>cannot<sp>be<sp>null" ) ; } if ( null == ( forEach . getInput ( ) ) ) { throw new uk . gov . gchq . gaffer . operation . OperationException ( "Inputs<sp>cannot<sp>be<sp>null" ) ; } final java . util . List < O > results = new java . util . ArrayList ( ) ; for ( final I input : forEach . getInput ( ) ) { final uk . gov . gchq . gaffer . operation . Operation clonedOperation = forEach . getOperation ( ) . shallowClone ( ) ; uk . gov . gchq . gaffer . store . operation . handler . util . OperationHandlerUtil . updateOperationInput ( clonedOperation , input ) ; results . add ( executeOperation ( clonedOperation , context , store ) ) ; } return results ; }
org . junit . Assert . assertEquals ( result , input )
testAutoTemplateWithParam ( ) { com . sun . jersey . api . client . WebResource r = resource ( ) . queryParam ( "user" , "Paul" ) ; r . addFilter ( new com . sun . jersey . api . client . filter . LoggingFilter ( ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { return core . get ( key ) ; }
org . junit . Assert . assertTrue ( r . get ( java . lang . String . class ) . contains ( "Paul" ) )
serializeRequest ( ) { joynr . types . Localisation . GpsPosition [ ] parameter = new joynr . types . Localisation . GpsPosition [ ] { new joynr . types . Localisation . GpsPosition ( 49.0065 , 11.65 ) } ; java . lang . Object [ ] parameters = new java . lang . Object [ ] { parameter } ; java . lang . Class < ? > [ ] parameterTypes = new java . lang . Class < ? > [ ] { joynr . types . Localisation . GpsPosition [ ] . class } ; joynr . Request request = new joynr . Request ( "updateRoute" , parameters , parameterTypes ) ; java . lang . String writeValueAsString = objectMapper . writeValueAsString ( request ) ; joynr . Request receivedRequest = objectMapper . readValue ( writeValueAsString , joynr . Request . class ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( request , receivedRequest )
testTopic ( ) { javax . jms . Topic topic = ( ( javax . jms . Topic ) ( context . lookup ( "java:/jms/topic/my-topic" ) ) ) ; "<AssertPlaceHolder>" ; } lookup ( java . lang . String ) { return new org . wildfly . swarm . microprofile . faulttolerance . deployment . MicroProfileFaultToleranceExtension . ResourceLiteral ( null , lookup , null , null , null , null , null ) ; }
org . junit . Assert . assertNotNull ( topic )
test_intersection_same ( ) { org . threeten . extra . LocalDateRange test = org . threeten . extra . LocalDateRange . of ( org . threeten . extra . TestLocalDateRange . DATE_2012_07_28 , org . threeten . extra . TestLocalDateRange . DATE_2012_07_31 ) ; "<AssertPlaceHolder>" ; } intersection ( org . threeten . extra . LocalDateRange ) { java . util . Objects . requireNonNull ( other , "other" ) ; if ( ( isConnected ( other ) ) == false ) { throw new java . time . DateTimeException ( ( ( ( "Ranges<sp>do<sp>not<sp>connect:<sp>" + ( this ) ) + "<sp>and<sp>" ) + other ) ) ; } int cmpStart = start . compareTo ( other . start ) ; int cmpEnd = end . compareTo ( other . end ) ; if ( ( cmpStart >= 0 ) && ( cmpEnd <= 0 ) ) { return this ; } else if ( ( cmpStart <= 0 ) && ( cmpEnd >= 0 ) ) { return other ; } else { java . time . LocalDate newStart = ( cmpStart >= 0 ) ? start : other . start ; java . time . LocalDate newEnd = ( cmpEnd <= 0 ) ? end : other . end ; return org . threeten . extra . LocalDateRange . of ( newStart , newEnd ) ; } }
org . junit . Assert . assertEquals ( test , test . intersection ( test ) )
testPolynomialGCD2 ( ) { cc . redberry . rings . poly . multivar . IntegersZp64 domain = new cc . redberry . rings . poly . multivar . IntegersZp64 ( 19 ) ; java . lang . String [ ] vars = new java . lang . String [ ] { "a" , "b" } ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 a = cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "a^2<sp>+<sp>b*a" , domain , vars ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 b = cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "b<sp>+<sp>1" , domain , vars ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 gcd = cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "2<sp>+<sp>b" , domain , vars ) ; a = a . multiply ( gcd ) ; b = b . multiply ( gcd ) ; for ( int i = 0 ; i < 1000 ; i ++ ) "<AssertPlaceHolder>" ; } PolynomialGCD ( Poly extends cc . redberry . rings . poly . IPolynomial , Poly extends cc . redberry . rings . poly . IPolynomial ) { if ( a instanceof cc . redberry . rings . poly . IUnivariatePolynomial ) return ( ( Poly ) ( cc . redberry . rings . poly . UnivariateGCD . PolynomialGCD ( ( ( cc . redberry . rings . poly . IUnivariatePolynomial ) ( a ) ) , ( ( cc . redberry . rings . poly . IUnivariatePolynomial ) ( b ) ) ) ) ) ; else if ( a instanceof cc . redberry . rings . poly . AMultivariatePolynomial ) return ( ( Poly ) ( cc . redberry . rings . poly . MultivariateGCD . PolynomialGCD ( ( ( cc . redberry . rings . poly . AMultivariatePolynomial ) ( a ) ) , ( ( cc . redberry . rings . poly . AMultivariatePolynomial ) ( b ) ) ) ) ) ; else throw new java . lang . RuntimeException ( ) ; }
org . junit . Assert . assertEquals ( gcd , PolynomialGCD ( a , b ) )
testAddPosition_03 ( ) { acceptor . addPosition ( 2 , 4 , "1" , "2" ) ; acceptor . addPosition ( 0 , 1 , "3" , "4" ) ; java . util . List < org . eclipse . xtext . ide . editor . syntaxcoloring . LightweightPosition > positions = acceptor . getPositions ( ) ; "<AssertPlaceHolder>" ; checkPosition ( positions . get ( 0 ) , 2 , 4 , 0 , "1" , "2" ) ; checkPosition ( positions . get ( 1 ) , 0 , 1 , 1 , "3" , "4" ) ; } size ( ) { return 1 ; }
org . junit . Assert . assertEquals ( 2 , positions . size ( ) )
testCallMethodOnClientObjectReturningLong ( ) { final org . bonitasoft . engine . expression . model . SExpression expression = new org . bonitasoft . engine . expression . model . impl . SExpressionImpl ( "exp1" , "getReferenceNumber" , org . bonitasoft . engine . expression . ExpressionExecutorStrategy . TYPE_JAVA_METHOD_CALL , org . bonitasoft . engine . expression . impl . Long . class . getName ( ) , null , java . util . Collections . singletonList ( orderDep ) ) ; final java . lang . Object result = methodCall . evaluate ( expression , java . util . Collections . < java . lang . String , java . lang . Object > emptyMap ( ) , orderResolvedExp , ContainerState . ACTIVE ) ; "<AssertPlaceHolder>" ; } getReferenceNumber ( ) { return referenceNumber ; }
org . junit . Assert . assertEquals ( order . getReferenceNumber ( ) , result )
testDeleteSearchIndex ( ) { org . finra . herd . model . api . xml . SearchIndexKey searchIndexKey = new org . finra . herd . model . api . xml . SearchIndexKey ( SEARCH_INDEX_NAME ) ; org . finra . herd . model . api . xml . SearchIndex searchIndex = new org . finra . herd . model . api . xml . SearchIndex ( searchIndexKey , SEARCH_INDEX_TYPE , SEARCH_INDEX_STATUS , SEARCH_INDEX_DEFAULT_ACTIVE_FLAG , NO_SEARCH_INDEX_STATISTICS , USER_ID , CREATED_ON , UPDATED_ON ) ; when ( searchIndexService . deleteSearchIndex ( searchIndexKey ) ) . thenReturn ( searchIndex ) ; org . finra . herd . model . api . xml . SearchIndex response = searchIndexRestController . deleteSearchIndex ( org . finra . herd . rest . SEARCH_INDEX_NAME ) ; verify ( searchIndexService , times ( 1 ) ) . deleteSearchIndex ( new org . finra . herd . model . api . xml . SearchIndexKey ( SEARCH_INDEX_NAME ) ) ; "<AssertPlaceHolder>" ; } deleteSearchIndex ( org . finra . herd . model . api . xml . SearchIndexKey ) { validateSearchIndexKey ( searchIndexKey ) ; org . finra . herd . model . jpa . SearchIndexEntity searchIndexEntity = searchIndexDaoHelper . getSearchIndexEntity ( searchIndexKey ) ; deleteSearchIndexHelper ( searchIndexEntity . getName ( ) ) ; searchIndexDao . delete ( searchIndexEntity ) ; return createSearchIndexFromEntity ( searchIndexEntity ) ; }
org . junit . Assert . assertEquals ( searchIndex , response )
deveObterAssinaturaComoFoiObtida ( ) { final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNota nota = new com . fincatto . documentofiscal . nfe400 . classes . nota . NFNota ( ) ; final com . fincatto . documentofiscal . nfe400 . classes . nota . assinatura . NFSignature assinatura = new com . fincatto . documentofiscal . nfe400 . classes . nota . assinatura . NFSignature ( ) ; nota . setAssinatura ( assinatura ) ; "<AssertPlaceHolder>" ; } getAssinatura ( ) { return this . assinatura ; }
org . junit . Assert . assertEquals ( assinatura , nota . getAssinatura ( ) )
testFromSimpleString2 ( ) { javax . ws . rs . core . Link l = javax . ws . rs . core . Link . valueOf ( "</>" ) ; "<AssertPlaceHolder>" ; } getUri ( ) { return uri ; }
org . junit . Assert . assertEquals ( "/" , l . getUri ( ) . toString ( ) )
parseCacheHeaders_cacheControlNoCache ( ) { long now = java . lang . System . currentTimeMillis ( ) ; headers . put ( "Date" , com . android . volley . toolbox . HttpHeaderParserTest . rfc1123Date ( now ) ) ; headers . put ( "Expires" , com . android . volley . toolbox . HttpHeaderParserTest . rfc1123Date ( ( now + ( com . android . volley . toolbox . HttpHeaderParserTest . ONE_HOUR_MILLIS ) ) ) ) ; headers . put ( "Cache-Control" , "no-cache" ) ; com . android . volley . Cache . Entry entry = com . android . volley . toolbox . HttpHeaderParser . parseCacheHeaders ( response ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , java . lang . String ) { java . net . HttpURLConnection urlConnection = null ; try { urlConnection = ( ( java . net . HttpURLConnection ) ( new java . net . URL ( ( ( backEndUrl ) + endpoint ) ) . openConnection ( ) ) ) ; try { urlConnection . setRequestMethod ( "PUT" ) ; } catch ( java . net . ProtocolException e ) { throw new java . lang . Exception ( ( "Shouldn\'t<sp>happen:<sp>HttpURLConnection<sp>doesn\'t<sp>support<sp>POST??<sp>" + ( e . getMessage ( ) ) ) , e ) ; } urlConnection . setDoOutput ( true ) ; urlConnection . setDoInput ( true ) ; urlConnection . setUseCaches ( false ) ; urlConnection . setAllowUserInteraction ( false ) ; java . util . Iterator entryIterator = this . requestHeaders . entrySet ( ) . iterator ( ) ; while ( entryIterator . hasNext ( ) ) { java . util . Map . Entry sb = ( ( java . util . Map . Entry ) ( entryIterator . next ( ) ) ) ; urlConnection . setRequestProperty ( ( ( java . lang . String ) ( sb . getKey ( ) ) ) , ( ( java . lang . String ) ( sb . getValue ( ) ) ) ) ; } org . wso2 . mdm . integration . common . OutputStream outputStream = urlConnection . getOutputStream ( ) ; try { org . wso2 . mdm . integration . common . OutputStreamWriter sb1 = new org . wso2 . mdm . integration . common . OutputStreamWriter ( outputStream , "UTF-8" ) ; sb1 . write ( body ) ; sb1 . close ( ) ; } catch ( org . wso2 . mdm . integration . common . IOException e ) { throw new java . lang . Exception ( ( "IOException<sp>while<sp>sending<sp>data<sp>" + ( e . getMessage ( ) ) ) , e ) ; } finally { if ( outputStream != null ) { outputStream . close ( ) ; } } java . lang . StringBuilder sb2 = new java . lang . StringBuilder ( ) ; org . wso2 . mdm . integration . common . BufferedReader rd = null ; try { rd = new org . wso2 . mdm . integration . common . BufferedReader ( new org . wso2 . mdm . integration . common . InputStreamReader ( urlConnection . getInputStream ( ) , java . nio . charset . Charset . defaultCharset ( ) ) ) ; java . lang . String itr ; while ( ( itr = rd . readLine ( ) ) != null ) { sb2 . append ( itr ) ; } } catch ( org . wso2 . mdm . integration . common . FileNotFoundException e ) { throw new java . lang . Exception ( ( "IOException<sp>while<sp>reading<sp>put<sp>request<sp>data<sp>" + ( e . getMessage ( ) ) ) , e ) ; } finally { if ( rd != null ) { rd . close ( ) ; } } java . util . Iterator iterator = urlConnection . getHeaderFields ( ) . keySet ( ) . iterator ( ) ; java . util . HashMap responseHeaders = new java . util . HashMap ( ) ; while ( iterator . hasNext ( ) ) { java . lang . String key = ( ( java . lang . String ) ( iterator . next ( ) ) ) ; if ( key != null ) { responseHeaders . put ( key , urlConnection . getHeaderField ( key ) ) ; } } org . wso2 . carbon . automation . test . utils . http . client . HttpResponse httpResponse = new org . wso2 . carbon . automation . test . utils . http . client . HttpResponse ( sb2 . toString ( ) , urlConnection . getResponseCode ( ) , responseHeaders ) ; return httpResponse ; } catch ( org . wso2 . mdm . integration . common . IOException e ) { throw new java . lang . Exception ( ( ( ( "Connection<sp>error<sp>(Is<sp>server<sp>running<sp>at<sp>" + endpoint ) + "<sp>?):<sp>" ) + ( e . getMessage ( ) ) ) , e ) ; } finally { if ( urlConnection != null ) { urlConnection . disconnect ( ) ; } } }
org . junit . Assert . assertNull ( entry )
testBuildBathPath ( ) { org . apache . eagle . service . client . impl . EagleServiceBaseClient eagleServiceBaseClient = new org . apache . eagle . service . client . impl . EagleServiceClientImpl ( "localhost" , 9090 , "admin" , "secret" ) ; java . lang . String expectedPath = "http://localhost:9090/rest" ; "<AssertPlaceHolder>" ; } buildBathPath ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "http://" ) ; sb . append ( host ) ; sb . append ( ":" ) ; sb . append ( port ) ; sb . append ( basePath ) ; return sb ; }
org . junit . Assert . assertEquals ( expectedPath , eagleServiceBaseClient . buildBathPath ( ) . toString ( ) )
readers_see_what_is_written_to_the_pipe ( ) { net . orfjackal . sbt . runner . Reader reader = pipe . subscribe ( ) ; pipe . write ( 'A' ) ; "<AssertPlaceHolder>" ; } write ( int ) { char ch = ( ( char ) ( b ) ) ; if ( ch == '\n' ) { sbt . executeInBackground ( buildCommand ( ) ) ; } else { commandBuffer . append ( ch ) ; } }
org . junit . Assert . assertEquals ( 'A' , reader . read ( ) )
readsDocumentCorrectly ( ) { org . bson . Document document = new org . bson . Document ( ) ; document . put ( "foo" , "bar" ) ; org . bson . Document result = converter . read ( org . springframework . data . mongodb . core . mapping . Document . class , document ) ; "<AssertPlaceHolder>" ; } read ( java . lang . Class , org . bson . conversions . Bson ) { return ( ( S ) ( person ) ) ; }
org . junit . Assert . assertThat ( result , is ( document ) )
testConvertTweet ( ) { org . apache . streams . twitter . pojo . Tweet tweet = mapper . readValue ( tweetJson , org . apache . streams . twitter . pojo . Tweet . class ) ; java . util . List < org . apache . streams . pojo . json . Activity > activityList = activityConverterUtil . convert ( tweet ) ; "<AssertPlaceHolder>" ; org . apache . streams . pojo . json . Activity activity = activityList . get ( 0 ) ; if ( ! ( org . apache . streams . data . util . ActivityUtil . isValid ( activity ) ) ) { org . junit . Assert . fail ( ) ; } } size ( ) { return queue . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( activityList . size ( ) ) == 1 ) )
testParse4 ( ) { java . lang . String parseStr = "select<sp>rid<sp>as<sp>id,rname,rtype<sp>from<sp>rdbtable<sp>where<sp>id<sp>=<sp>'${s.id+${udf(a,b,c}}'" ; com . huawei . streaming . util . DataSourceTokenReplacedHandler handler = new com . huawei . streaming . util . DataSourceTokenReplacedHandler ( com . huawei . streaming . util . DataSourceTokenReplacedHandlerTest . expValues ) ; com . huawei . streaming . util . GenericTokenParser parser = new com . huawei . streaming . util . GenericTokenParser ( "${" , "}" , handler ) ; try { parser . parse ( parseStr ) ; } catch ( com . huawei . streaming . exception . StreamingException e ) { "<AssertPlaceHolder>" ; } } parse ( java . lang . String ) { com . huawei . streaming . cql . semanticanalyzer . parser . CQLErrorListener errorListener = new com . huawei . streaming . cql . semanticanalyzer . parser . CQLErrorListener ( ) ; com . huawei . streaming . cql . semanticanalyzer . parser . CQLLexer lexer = new com . huawei . streaming . cql . semanticanalyzer . parser . CQLLexer ( new com . huawei . streaming . cql . semanticanalyzer . parser . ANTLRIgnoreCaseStringStream ( cql ) ) ; lexer . removeErrorListeners ( ) ; lexer . addErrorListener ( errorListener ) ; org . antlr . v4 . runtime . CommonTokenStream tokens = new org . antlr . v4 . runtime . CommonTokenStream ( lexer ) ; com . huawei . streaming . cql . semanticanalyzer . parser . CQLParser parser = new com . huawei . streaming . cql . semanticanalyzer . parser . CQLParser ( tokens ) ; com . huawei . streaming . cql . semanticanalyzer . parser . CQLErrorStrategy errorHandler = new com . huawei . streaming . cql . semanticanalyzer . parser . CQLErrorStrategy ( ) ; parser . setErrorHandler ( errorHandler ) ; parser . removeErrorListeners ( ) ; parser . addErrorListener ( errorListener ) ; org . antlr . v4 . runtime . ParserRuleContext tree = parser . subSelectClause ( ) ; if ( ( errorListener . getRecException ( ) ) != null ) { errorListener . getRecException ( ) . setCql ( cql ) ; throw errorListener . getRecException ( ) ; } com . huawei . streaming . cql . semanticanalyzer . parser . SelectClauseParser . LOG . info ( "Parse<sp>Completed,<sp>cql<sp>:<sp>{}" , cql . replace ( "\n" , "<sp>" ) ) ; com . huawei . streaming . cql . semanticanalyzer . parser . visitor . SelectClauseVisitor visitor = new com . huawei . streaming . cql . semanticanalyzer . parser . visitor . SelectClauseVisitor ( ) ; return visitor . visit ( tree ) ; }
org . junit . Assert . assertTrue ( true )
testDerivedPrimitiveCollection ( ) { com . google . auto . value . AutoAnnotationTest . IntList intList = new com . google . auto . value . AutoAnnotationTest . IntList ( com . google . common . collect . ImmutableList . of ( 1 , 2 , 3 ) ) ; com . google . auto . value . AutoAnnotationTest . IntArray actual = com . google . auto . value . AutoAnnotationTest . newIntArray ( intList ) ; com . google . auto . value . AutoAnnotationTest . IntArray expected = com . google . auto . value . AutoAnnotationTest . AnnotatedWithIntArray . class . getAnnotation ( com . google . auto . value . AutoAnnotationTest . IntArray . class ) ; "<AssertPlaceHolder>" ; } getAnnotation ( java . lang . Class ) { return null ; }
org . junit . Assert . assertEquals ( expected , actual )
testCreateDot ( ) { boolean check = autB . createDotFile ( "autb" , "" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( check )
testReduceRight21 ( ) { org . stjs . javascript . Array < java . lang . Integer > arr = org . stjs . javascript . JSCollections . $array ( 11 , 12 , 13 ) ; final java . util . concurrent . atomic . AtomicBoolean testResult = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; org . stjs . javascript . functions . Function4 < java . lang . Integer , java . lang . Integer , java . lang . Long , org . stjs . javascript . Array < java . lang . Integer > , java . lang . Integer > callbackfn = new org . stjs . javascript . functions . Function4 < java . lang . Integer , java . lang . Integer , java . lang . Long , org . stjs . javascript . Array < java . lang . Integer > , java . lang . Integer > ( ) { @ org . stjs . javascript . Override public org . stjs . javascript . Integer $invoke ( java . lang . Integer prevVal , java . lang . Integer curVal , java . lang . Long idx , org . stjs . javascript . Array < java . lang . Integer > obj ) { if ( idx == 1 ) { testResult . set ( ( prevVal == 13 ) ) ; } return curVal ; } } ; arr . reduceRight ( callbackfn ) ; "<AssertPlaceHolder>" ; } get ( ) { return this ; }
org . junit . Assert . assertTrue ( testResult . get ( ) )
AllIds ( ) { System . out . println ( "allIds" ) ; instances = session . from ( com . mysema . rdfbean . query . SimpleQueriesTest . var ) . list ( com . mysema . rdfbean . query . SimpleQueriesTest . var ) ; java . util . List < java . lang . String > ids = java . util . Arrays . asList ( instances . get ( 0 ) . getId ( ) , instances . get ( 1 ) . getId ( ) ) ; "<AssertPlaceHolder>" ; } from ( com . mysema . query . types . EntityPath [ ] ) { return queryMixin . from ( o ) ; }
org . junit . Assert . assertEquals ( ids , session . from ( com . mysema . rdfbean . query . SimpleQueriesTest . var ) . list ( com . mysema . rdfbean . query . SimpleQueriesTest . var . id ) )
testSetGetExceptionListener ( ) { pcf = new org . apache . activemq . jms . pool . PooledConnectionFactory ( ) ; pcf . setConnectionFactory ( new org . apache . activemq . ActiveMQConnectionFactory ( "vm://test?broker.persistent=false&broker.useJmx=false" ) ) ; connection = ( ( javax . jms . TopicConnection ) ( pcf . createConnection ( ) ) ) ; javax . jms . ExceptionListener listener = new javax . jms . ExceptionListener ( ) { @ org . apache . activemq . jms . pool . Override public void onException ( javax . jms . JMSException exception ) { } } ; connection . setExceptionListener ( listener ) ; "<AssertPlaceHolder>" ; } getExceptionListener ( ) { return pool . getParentExceptionListener ( ) ; }
org . junit . Assert . assertEquals ( listener , connection . getExceptionListener ( ) )
testInitDynAnyFromAny ( ) { java . lang . String msg ; java . math . BigDecimal fixedVal ; org . omg . CORBA . Any any = null ; org . omg . CORBA . TypeCode tc = null ; org . omg . DynamicAny . DynFixed dynAny = null ; org . omg . DynamicAny . DynFixed dynAny2 = null ; tc = orb . create_fixed_tc ( ( ( short ) ( 2 ) ) , ( ( short ) ( 1 ) ) ) ; dynAny = createDynAnyFromTypeCode ( tc ) ; fixedVal = new java . math . BigDecimal ( "1.0" ) ; any = orb . create_any ( ) ; any . insert_fixed ( fixedVal , tc ) ; dynAny2 = createDynAnyFromAny ( any ) ; msg = "Failed<sp>to<sp>initialize<sp>a<sp>DynAny<sp>object<sp>from<sp>an<sp>Any<sp>object<sp>" ; msg += "using<sp>the<sp>DynAny::from_any<sp>operation" ; dynAny . from_any ( any ) ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
org . junit . Assert . assertTrue ( msg , dynAny . equal ( dynAny2 ) )
shouldGetCachedResult ( ) { final java . io . File newFolder = temporaryFolder . newFolder ( ) ; org . arquillian . cube . impl . shrinkwrap . asset . CacheUrlAsset cacheUrlAsset = new org . arquillian . cube . impl . shrinkwrap . asset . CacheUrlAsset ( new java . net . URL ( "http://arquillian.org/images/arq.txt" ) ) ; CacheUrlAsset . TEMP_LOCATION = newFolder . getAbsolutePath ( ) ; final java . nio . file . Path path = java . nio . file . Paths . get ( newFolder . getAbsolutePath ( ) , "arq.txt" ) ; java . nio . file . Files . write ( path , "Hello" . getBytes ( "UTF-8" ) ) ; java . io . InputStream is = cacheUrlAsset . openStream ( ) ; java . lang . String content = org . arquillian . cube . impl . shrinkwrap . asset . CacheUrlAssetTest . slurp ( is ) ; "<AssertPlaceHolder>" ; } slurp ( java . io . InputStream ) { final java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; final byte [ ] buffer = new byte [ 1024 ] ; int length ; while ( ( length = in . read ( buffer ) ) != ( - 1 ) ) { out . write ( buffer , 0 , length ) ; } out . flush ( ) ; return new java . lang . String ( out . toByteArray ( ) ) ; }
org . junit . Assert . assertThat ( content , org . hamcrest . core . Is . is ( "Hello" ) )
deleteTest ( ) { com . stylefeng . guns . common . persistence . model . Dept dept = deptMapper . selectByPrimaryKey ( 24 ) ; java . lang . Integer integer = deptMapper . deleteByPrimaryKey ( dept ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( ( integer > 0 ) )
testClosePartitions ( ) { com . taobao . metamorphosis . server . utils . MetaConfig metaConfig = new com . taobao . metamorphosis . server . utils . MetaConfig ( ) ; metaConfig . setTopics ( java . util . Arrays . asList ( "topic1" ) ) ; metaConfig . closePartitions ( "topic1" , 1 , 2 ) ; "<AssertPlaceHolder>" ; } isClosedPartition ( java . lang . String , int ) { final java . util . Set < java . lang . Integer > closedPartitions = this . closedPartitionMap . get ( topic ) ; return closedPartitions == null ? false : closedPartitions . contains ( partition ) ; }
org . junit . Assert . assertTrue ( metaConfig . isClosedPartition ( "topic1" , 1 ) )
testServeStaticSecurityClassesAbsolute ( ) { when ( contextRenderable . getRequestPath ( ) ) . thenReturn ( "/ninja/Ninja.class" ) ; ninja . Result result2 = assetsController . serveStatic ( ) ; ninja . Renderable renderable = ( ( ninja . Renderable ) ( result2 . getRenderable ( ) ) ) ; ninja . Result result = ninja . Results . ok ( ) ; renderable . render ( contextRenderable , result ) ; verify ( contextRenderable ) . finalizeHeadersWithoutFlashAndSessionCookie ( resultCaptor . capture ( ) ) ; "<AssertPlaceHolder>" ; } notFound ( ) { return ninja . Results . status ( Result . SC_404_NOT_FOUND ) ; }
org . junit . Assert . assertEquals ( ninja . Results . notFound ( ) . getStatusCode ( ) , resultCaptor . getValue ( ) . getStatusCode ( ) )
testGrandParentPrimaryKeyNames ( ) { try { java . lang . String [ ] columnNames = getPrimaryKeyNames ( grandParentClass ) ; java . util . List < java . lang . String > actualColumnNames = java . util . Arrays . asList ( columnNames ) ; java . util . Collections . sort ( actualColumnNames ) ; java . util . List < java . lang . String > expectedColumnNames = getExpectedPrimaryKeyNamesOfGrandParent ( ) ; java . util . Collections . sort ( expectedColumnNames ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ) ; } } getExpectedPrimaryKeyNamesOfGrandParent ( ) { java . util . List < java . lang . String > expectedNames = new java . util . ArrayList ( ) ; expectedNames . add ( "grandParentId" ) ; return expectedNames ; }
org . junit . Assert . assertEquals ( actualColumnNames , expectedColumnNames )
testStoreObjectData ( ) { int lines = cern . c2mon . pmanager . persistence . impl . PersistenceManagerTest . persistenceManager . getFallbackManager ( ) . getFallbackFileController ( ) . getNumberOfLines ( ) ; cern . c2mon . pmanager . IFallback fallback = new cern . c2mon . pmanager . mock . FallbackImpl ( ) ; cern . c2mon . pmanager . persistence . impl . PersistenceManagerTest . persistenceManager . storeData ( fallback ) ; "<AssertPlaceHolder>" ; } getFallbackManager ( ) { return fallbackManager ; }
org . junit . Assert . assertEquals ( lines , cern . c2mon . pmanager . persistence . impl . PersistenceManagerTest . persistenceManager . getFallbackManager ( ) . getFallbackFileController ( ) . getNumberOfLines ( ) )
countCrossingsBetweenLayers_moreComplexThreeLayerGraph ( ) { getMoreComplexThreeLayerGraph ( ) ; org . eclipse . elk . alg . layered . p3order . GraphInfoHolder gd = new org . eclipse . elk . alg . layered . p3order . GraphInfoHolder ( graph , org . eclipse . elk . alg . layered . p3order . LayerSweepCrossingMinimizer . CrossMinType . BARYCENTER , null ) ; gd . portDistributor ( ) . distributePortsWhileSweeping ( order ( ) , 1 , true ) ; counter = new org . eclipse . elk . alg . layered . p3order . counting . CrossingsCounter ( new int [ getNumPorts ( order ( ) ) ] ) ; "<AssertPlaceHolder>" ; } countCrossingsBetweenLayers ( org . eclipse . elk . alg . layered . graph . LNode [ ] , org . eclipse . elk . alg . layered . graph . LNode [ ] ) { java . util . List < org . eclipse . elk . alg . layered . graph . LPort > ports = initPortPositionsCounterClockwise ( leftLayerNodes , rightLayerNodes ) ; indexTree = new org . eclipse . elk . alg . layered . p3order . counting . BinaryIndexedTree ( ports . size ( ) ) ; return countCrossingsOnPorts ( ports ) ; }
org . junit . Assert . assertThat ( counter . countCrossingsBetweenLayers ( order ( ) [ 0 ] , order ( ) [ 1 ] ) , org . hamcrest . CoreMatchers . is ( 1 ) )
testStringMerge ( ) { org . apache . spark . api . java . JavaRDD < org . apache . spark . sql . Row > rdd = jsc . parallelize ( com . flipkart . fdp . ml . adapter . Arrays . asList ( org . apache . spark . sql . RowFactory . create ( 1 , "string1" , "string2" ) , org . apache . spark . sql . RowFactory . create ( 1 , "first<sp>part<sp>of<sp>string" , "second<sp>part<sp>of<sp>string" ) ) ) ; com . flipkart . fdp . ml . adapter . StructType schema = new com . flipkart . fdp . ml . adapter . StructType ( new com . flipkart . fdp . ml . adapter . StructField [ ] { new com . flipkart . fdp . ml . adapter . StructField ( "id" , DataTypes . IntegerType , false , com . flipkart . fdp . ml . adapter . Metadata . empty ( ) ) , new com . flipkart . fdp . ml . adapter . StructField ( "input1" , DataTypes . StringType , true , com . flipkart . fdp . ml . adapter . Metadata . empty ( ) ) , new com . flipkart . fdp . ml . adapter . StructField ( "input2" , DataTypes . StringType , true , com . flipkart . fdp . ml . adapter . Metadata . empty ( ) ) } ) ; org . apache . spark . sql . Dataset < org . apache . spark . sql . Row > df = spark . createDataFrame ( rdd , schema ) ; com . flipkart . transformer . ml . StringMerge sparkModel = new com . flipkart . transformer . ml . StringMerge ( ) . setInputCol1 ( "input1" ) . setInputCol2 ( "input2" ) . setOutputCol ( "output" ) ; byte [ ] exportedModel = com . flipkart . fdp . ml . export . ModelExporter . export ( sparkModel ) ; com . flipkart . fdp . ml . transformer . Transformer transformer = com . flipkart . fdp . ml . importer . ModelImporter . importAndGetTransformer ( exportedModel ) ; com . flipkart . fdp . ml . adapter . List < org . apache . spark . sql . Row > sparkOutput = sparkModel . transform ( df ) . orderBy ( "id" ) . select ( "input1" , "input2" , "output" ) . collectAsList ( ) ; for ( org . apache . spark . sql . Row row : sparkOutput ) { com . flipkart . fdp . ml . adapter . Map < java . lang . String , java . lang . Object > data = new com . flipkart . fdp . ml . adapter . HashMap < java . lang . String , java . lang . Object > ( ) ; data . put ( sparkModel . getInputCol1 ( ) , row . get ( 0 ) ) ; data . put ( sparkModel . getInputCol2 ( ) , row . get ( 1 ) ) ; transformer . transform ( data ) ; java . lang . String actual = ( ( java . lang . String ) ( data . get ( sparkModel . getOutputCol ( ) ) ) ) ; "<AssertPlaceHolder>" ; } } transform ( com . flipkart . fdp . ml . transformer . Map ) { java . lang . String inp = ( ( java . lang . String ) ( input . get ( modelInfo . getInputKeys ( ) . iterator ( ) . next ( ) ) ) ) ; input . put ( modelInfo . getOutputKeys ( ) . iterator ( ) . next ( ) , predict ( inp ) ) ; }
org . junit . Assert . assertEquals ( actual , row . get ( 2 ) )
nodeHasCapabilitiesEvenWhenUrlCallFails ( ) { try { de . zalando . ep . zalenium . util . CommonProxyUtilities commonProxyUtilities = mock ( de . zalando . ep . zalenium . util . CommonProxyUtilities . class ) ; when ( commonProxyUtilities . readJSONFromUrl ( anyString ( ) , anyString ( ) , anyString ( ) ) ) . thenReturn ( null ) ; de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . setCommonProxyUtilities ( commonProxyUtilities ) ; org . openqa . grid . common . RegistrationRequest request = de . zalando . ep . zalenium . util . TestUtils . getRegistrationRequestForTesting ( 30001 , de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . class . getCanonicalName ( ) ) ; request = de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . updateSLCapabilities ( request , "" ) ; "<AssertPlaceHolder>" ; } finally { de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . restoreCommonProxyUtilities ( ) ; } } updateSLCapabilities ( org . openqa . grid . common . RegistrationRequest , java . lang . String ) { java . lang . String currentName = java . lang . Thread . currentThread ( ) . getName ( ) ; java . lang . Thread . currentThread ( ) . setName ( "SauceLabs" ) ; com . google . gson . JsonElement slAccountInfo = getCommonProxyUtilities ( ) . readJSONFromUrl ( url , de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . SAUCE_LABS_USER_NAME , de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . SAUCE_LABS_ACCESS_KEY ) ; try { registrationRequest . getConfiguration ( ) . capabilities . clear ( ) ; java . lang . String logMessage = java . lang . String . format ( "Account<sp>max.<sp>concurrency<sp>fetched<sp>from<sp>%s" , url ) ; int sauceLabsAccountConcurrency ; if ( slAccountInfo == null ) { logMessage = java . lang . String . format ( "Account<sp>max.<sp>concurrency<sp>was<sp>NOT<sp>fetched<sp>from<sp>%s" , url ) ; sauceLabsAccountConcurrency = 1 ; } else { sauceLabsAccountConcurrency = slAccountInfo . getAsJsonObject ( ) . getAsJsonObject ( "concurrency_limit" ) . get ( "overall" ) . getAsInt ( ) ; } de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . LOGGER . info ( logMessage ) ; java . lang . Thread . currentThread ( ) . setName ( currentName ) ; return addCapabilitiesToRegistrationRequest ( registrationRequest , sauceLabsAccountConcurrency , de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . SAUCE_LABS_PROXY_NAME ) ; } catch ( java . lang . Exception e ) { de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . LOGGER . warn ( e . toString ( ) , e ) ; getGa ( ) . trackException ( e ) ; } java . lang . Thread . currentThread ( ) . setName ( currentName ) ; return addCapabilitiesToRegistrationRequest ( registrationRequest , 1 , de . zalando . ep . zalenium . proxy . SauceLabsRemoteProxy . SAUCE_LABS_PROXY_NAME ) ; }
org . junit . Assert . assertFalse ( request . getConfiguration ( ) . capabilities . isEmpty ( ) )
test1622302 ( ) { sql = "DELETE<sp>FROM<sp>M_InOutLineMA<sp>ma<sp>WHERE<sp>EXISTS<sp>" + ( "(SELECT<sp>*<sp>FROM<sp>M_InOutLine<sp>l<sp>WHERE<sp>l.M_InOutLine_ID=ma.M_InOutLine_ID" + "<sp>AND<sp>M_InOut_ID=0)" ) ; sqe = "DELETE<sp>FROM<sp>M_InOutLineMA<sp>WHERE<sp>EXISTS<sp>(SELECT<sp>*<sp>FROM<sp>M_InOutLine<sp>l<sp>WHERE<sp>l.M_InOutLine_ID=M_InOutLineMA.M_InOutLine_ID<sp>AND<sp>M_InOut_ID=0)" ; convertResult = convert . convert ( sql ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { return getMap ( ) . get ( key ) ; }
org . junit . Assert . assertEquals ( sqe , convertResult . get ( 0 ) )
testGetWidgetInfo ( ) { com . agiletec . aps . system . services . user . UserDetails user = new org . entando . entando . web . utils . OAuth2TestUtils . UserBuilder ( "jack_bauer" , "0x24" ) . grantedToRoleAdmin ( ) . build ( ) ; java . lang . String accessToken = mockOAuthInterceptor ( user ) ; org . springframework . test . web . servlet . ResultActions result = mockMvc . perform ( get ( "/widgets/login_form/info" ) . header ( HttpHeaders . AUTHORIZATION , ( "Bearer<sp>" + accessToken ) ) ) ; java . lang . String response = result . andReturn ( ) . getResponse ( ) . getContentAsString ( ) ; "<AssertPlaceHolder>" ; result . andExpect ( jsonPath ( "$.payload.publishedUtilizers" , org . hamcrest . Matchers . hasSize ( 2 ) ) ) ; } getResponse ( ) { return _response ; }
org . junit . Assert . assertNotNull ( response )
testAttribute ( ) { java . lang . String doc = "<?xml<sp>version=\"1.0\"<sp>encoding=\"utf-8\"<sp>?><a><b<sp>c=\"test\"></b></a>" ; java . lang . String xpath = "a/b/@c" ; java . lang . String value = org . teiid . xquery . saxon . XMLFunctions . xpathValue ( doc , xpath ) ; "<AssertPlaceHolder>" ; } xpathValue ( java . lang . Object , java . lang . String ) { javax . xml . transform . Source s = null ; try { s = org . teiid . query . function . source . XMLSystemFunctions . convertToSource ( doc ) ; net . sf . saxon . sxpath . XPathEvaluator eval = new net . sf . saxon . sxpath . XPathEvaluator ( ) ; net . sf . saxon . sxpath . XPathExpression expr = eval . createExpression ( xpath ) ; net . sf . saxon . sxpath . XPathDynamicContext context = expr . createDynamicContext ( eval . getConfiguration ( ) . buildDocumentTree ( s ) . getRootNode ( ) ) ; java . lang . Object o = expr . evaluateSingle ( context ) ; if ( o == null ) { return null ; } if ( o instanceof net . sf . saxon . om . Item ) { net . sf . saxon . om . Item i = ( ( net . sf . saxon . om . Item ) ( o ) ) ; if ( org . teiid . xquery . saxon . XMLFunctions . isNull ( i ) ) { return null ; } return i . getStringValue ( ) ; } return o . toString ( ) ; } finally { org . teiid . util . WSUtil . closeSource ( s ) ; } }
org . junit . Assert . assertEquals ( "test" , value )
scopeForOptions ( ) { org . eclipse . emf . common . util . EList < com . github . jknack . antlr4ide . lang . Option > optionList = new org . eclipse . emf . common . util . BasicEList < com . github . jknack . antlr4ide . lang . Option > ( ) ; org . eclipse . emf . common . util . EList < com . github . jknack . antlr4ide . lang . Rule > rules = new org . eclipse . emf . common . util . BasicEList < com . github . jknack . antlr4ide . lang . Rule > ( ) ; org . eclipse . emf . common . util . EList < com . github . jknack . antlr4ide . lang . LexerRule > mRules = new org . eclipse . emf . common . util . BasicEList < com . github . jknack . antlr4ide . lang . LexerRule > ( ) ; org . eclipse . emf . common . util . EList < com . github . jknack . antlr4ide . lang . Mode > modes = new org . eclipse . emf . common . util . BasicEList < com . github . jknack . antlr4ide . lang . Mode > ( ) ; org . eclipse . emf . common . util . EList < com . github . jknack . antlr4ide . lang . PrequelConstruct > prequels = new org . eclipse . emf . common . util . BasicEList < com . github . jknack . antlr4ide . lang . PrequelConstruct > ( ) ; com . github . jknack . antlr4ide . lang . Options options = createMock ( com . github . jknack . antlr4ide . lang . Options . class ) ; com . github . jknack . antlr4ide . lang . TokenVocab tokenVocab = createMock ( com . github . jknack . antlr4ide . lang . TokenVocab . class ) ; com . github . jknack . antlr4ide . lang . Grammar grammar = createMock ( com . github . jknack . antlr4ide . lang . Grammar . class ) ; com . github . jknack . antlr4ide . lang . Rule r1 = createMock ( com . github . jknack . antlr4ide . lang . LexerRule . class ) ; com . github . jknack . antlr4ide . lang . Mode mode = createMock ( com . github . jknack . antlr4ide . lang . Mode . class ) ; com . github . jknack . antlr4ide . lang . LexerRule mr1 = createMock ( com . github . jknack . antlr4ide . lang . LexerRule . class ) ; expect ( options . getOptions ( ) ) . andReturn ( optionList ) ; expect ( tokenVocab . getImportURI ( ) ) . andReturn ( grammar ) ; expect ( grammar . getRules ( ) ) . andReturn ( rules ) ; expect ( grammar . getModes ( ) ) . andReturn ( modes ) ; expect ( grammar . getPrequels ( ) ) . andReturn ( prequels ) ; expect ( mode . getRules ( ) ) . andReturn ( mRules ) ; optionList . add ( tokenVocab ) ; rules . add ( r1 ) ; modes . add ( mode ) ; mRules . add ( mr1 ) ; java . lang . Object [ ] mocks = new java . lang . Object [ ] { options , tokenVocab , grammar , r1 , mode , mr1 } ; replay ( mocks ) ; java . util . List < org . eclipse . emf . ecore . EObject > scopes = com . google . common . collect . Lists . newArrayList ( ) ; new com . github . jknack . antlr4ide . scoping . Antlr4ScopeProvider ( ) . scopeFor ( options , scopes , com . github . jknack . antlr4ide . lang . LexerRule . class ) ; "<AssertPlaceHolder>" ; verify ( mocks ) ; }
org . junit . Assert . assertEquals ( com . google . common . collect . Lists . < org . eclipse . emf . ecore . EObject > newArrayList ( r1 , mode , mr1 ) , scopes )
testBuildWithDisabledStatusConstraint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . timeperiod . TimePeriod context = new org . lnu . is . domain . timeperiod . TimePeriod ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>TimePeriod<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . timeperiod . TimePeriod > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
testLocalOverSizedResponseMsgAsync ( ) { final java . lang . String message = runLocalMessageResponseTest ( org . apache . flink . runtime . rpc . akka . AkkaRpcActorOversizedResponseMessageTest . OVERSIZED_PAYLOAD , this :: requestMessageAsync ) ; "<AssertPlaceHolder>" ; } equalTo ( org . apache . flink . api . java . functions . KeySelector ) { org . apache . flink . api . common . typeinfo . TypeInformation < K > keyType = org . apache . flink . api . java . typeutils . TypeExtractor . getKeySelectorTypes ( keyExtractor , input2 . getType ( ) ) ; return createCoGroupOperator ( new org . apache . flink . api . common . operators . Keys . SelectorFunctionKeys ( input1 . clean ( keyExtractor ) , input2 . getType ( ) , keyType ) ) ; }
org . junit . Assert . assertThat ( message , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( org . apache . flink . runtime . rpc . akka . AkkaRpcActorOversizedResponseMessageTest . OVERSIZED_PAYLOAD ) ) )
testPathTo_Int_Norbornane ( ) { org . openscience . cdk . interfaces . IAtomContainer norbornane = org . openscience . cdk . graph . ShortestPathsTest . norbornane ( ) ; org . openscience . cdk . graph . ShortestPaths paths = new org . openscience . cdk . graph . ShortestPaths ( norbornane , norbornane . getAtom ( 0 ) ) ; "<AssertPlaceHolder>" ; } pathTo ( org . openscience . cdk . interfaces . IAtom ) { return pathTo ( container . indexOf ( end ) ) ; }
org . junit . Assert . assertArrayEquals ( new int [ ] { 0 , 1 , 2 , 3 } , paths . pathTo ( 3 ) )
testEnumPath ( ) { org . apache . cayenne . ejbql . EJBQLExpression select = parser . parse ( "select<sp>p<sp>from<sp>Painting<sp>p<sp>WHERE<sp>p.toArtist.ARTIST_NAME<sp>=<sp>enum:org.apache.cayenne.ejbql.EJBQLEnum1.X" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { org . apache . velocity . runtime . parser . node . SimpleNode nodeTree ; try { nodeTree = velocityRuntime . parse ( new java . io . StringReader ( template ) , new org . apache . velocity . Template ( ) ) ; } catch ( org . apache . velocity . runtime . parser . ParseException pex ) { throw new org . apache . cayenne . CayenneRuntimeException ( "Error<sp>parsing<sp>template<sp>'%s'<sp>:<sp>%s" , template , pex . getMessage ( ) ) ; } if ( nodeTree == null ) { throw new org . apache . cayenne . CayenneRuntimeException ( "Error<sp>parsing<sp>template<sp>%s" , template ) ; } return nodeTree ; }
org . junit . Assert . assertNotNull ( select )
customAdapterShouldBeUsed ( ) { final eu . inmite . android . lib . validations . CustomAdapterForSupportedViewTest . ModelWithValidation model = new eu . inmite . android . lib . validations . CustomAdapterForSupportedViewTest . ModelWithValidation ( ) ; model . view . setText ( "" ) ; final boolean valid = eu . inmite . android . lib . validations . form . FormValidator . validate ( Robolectric . application , model , null ) ; "<AssertPlaceHolder>" ; } validate ( android . content . Context , java . lang . Object , eu . inmite . android . lib . validations . form . iface . IValidationCallback ) { if ( context == null ) { throw new java . lang . IllegalArgumentException ( "context<sp>cannot<sp>ben<sp>null" ) ; } if ( target == null ) { throw new java . lang . IllegalArgumentException ( "target<sp>cannot<sp>be<sp>null" ) ; } final java . util . List < eu . inmite . android . lib . validations . form . FormValidator . ValidationFail > failedValidations = new java . util . ArrayList ( ) ; final java . util . List < android . view . View > passedValidations = new java . util . ArrayList ( ) ; boolean result = true ; final java . util . Map < android . view . View , eu . inmite . android . lib . validations . form . FormValidator . FieldInfo > infoMap = eu . inmite . android . lib . validations . form . FieldFinder . getFieldsForTarget ( target ) ; for ( Map . Entry < android . view . View , eu . inmite . android . lib . validations . form . FormValidator . FieldInfo > entry : infoMap . entrySet ( ) ) { final eu . inmite . android . lib . validations . form . FormValidator . FieldInfo fieldInfo = entry . getValue ( ) ; final android . view . View view = entry . getKey ( ) ; if ( ( ( view . getVisibility ( ) ) == ( android . view . View . GONE ) ) || ( ( view . getVisibility ( ) ) == ( android . view . View . INVISIBLE ) ) ) { continue ; } eu . inmite . android . lib . validations . form . FormValidator . ValidationFail fieldResult = eu . inmite . android . lib . validations . form . FormValidator . performFieldValidations ( context , fieldInfo , view ) ; if ( fieldResult != null ) { failedValidations . add ( fieldResult ) ; result = false ; } else { passedValidations . add ( view ) ; } } if ( callback != null ) { java . util . Collections . sort ( failedValidations , new java . util . Comparator < eu . inmite . android . lib . validations . form . FormValidator . ValidationFail > ( ) { @ eu . inmite . android . lib . validations . form . Override public int compare ( eu . inmite . android . lib . validations . form . FormValidator . ValidationFail lhs , eu . inmite . android . lib . validations . form . FormValidator . ValidationFail rhs ) { return ( lhs . order ) < ( rhs . order ) ? - 1 : ( lhs . order ) == ( rhs . order ) ? 0 : 1 ; } } ) ; callback . validationComplete ( result , java . util . Collections . unmodifiableList ( failedValidations ) , java . util . Collections . unmodifiableList ( passedValidations ) ) ; } return result ; }
org . junit . Assert . assertTrue ( valid )
testCreateWithMetadata ( ) { repository . deleteAll ( "student" , null ) ; org . slc . sli . dal . repository . Map < java . lang . String , java . lang . Object > studentBody = buildTestStudentEntity ( ) ; org . slc . sli . dal . repository . Map < java . lang . String , java . lang . Object > studentMetaData = new org . slc . sli . dal . repository . HashMap < java . lang . String , java . lang . Object > ( ) ; repository . create ( "student" , studentBody , studentMetaData , "student" ) ; "<AssertPlaceHolder>" ; } count ( java . lang . String , org . slc . sli . domain . NeutralQuery ) { return 0 ; }
org . junit . Assert . assertEquals ( 1 , repository . count ( "student" , new org . slc . sli . domain . NeutralQuery ( ) ) )
testAfterLast ( ) { org . teiid . jdbc . ResultSetImpl cs = helpExecuteQuery ( ) ; cs . afterLast ( ) ; "<AssertPlaceHolder>" ; cs . close ( ) ; } isAfterLast ( ) { if ( ( getFinalRowNumber ( ) ) == ( - 1 ) ) { return false ; } return ( ( ! ( hasNext ( ) ) ) && ( ( this . getAbsoluteRowNumber ( ) ) > ( org . teiid . jdbc . ResultSetImpl . BEFORE_FIRST_ROW ) ) ) && ( ( this . getAbsoluteRowNumber ( ) ) > ( getFinalRowNumber ( ) ) ) ; }
org . junit . Assert . assertTrue ( cs . isAfterLast ( ) )
testShouldVerifyIfStopSyncReturnFalseIfStopSyncIsNotSet ( ) { java . lang . String versionSnapshot = "{\"system:\":<sp>{\"date\":\"2016-05-24T05:27:25.128+0000\",<sp>\"version\":<sp>\"2.26\"},<sp>\"name\":\"testVersion\",\"created\":\"2016-05-26T11:43:59.787+0000\",\"type\":\"BEST_EFFORT\",\"id\":\"ktwh8PHNwtB\",\"hashCode\":\"12wa32d4f2et3tyt5yu6i\"}" ; org . hisp . dhis . system . SystemInfo systemInfo = new org . hisp . dhis . system . SystemInfo ( ) ; systemInfo . setVersion ( "2.26" ) ; when ( systemService . getSystemInfo ( ) ) . thenReturn ( systemInfo ) ; when ( metadataSystemSettingService . getStopMetadataSyncSetting ( ) ) . thenReturn ( false ) ; boolean shouldStopSync = metadataSyncDelegate . shouldStopSync ( versionSnapshot ) ; "<AssertPlaceHolder>" ; } shouldStopSync ( java . lang . String ) { org . hisp . dhis . system . SystemInfo systemInfo = systemService . getSystemInfo ( ) ; java . lang . String systemVersion = systemInfo . getVersion ( ) ; if ( ( org . apache . commons . lang3 . StringUtils . isEmpty ( systemVersion ) ) || ( ! ( metadataSystemSettingService . getStopMetadataSyncSetting ( ) ) ) ) { return false ; } java . io . ByteArrayInputStream byteArrayInputStream = new java . io . ByteArrayInputStream ( metadataVersionSnapshot . getBytes ( StandardCharsets . UTF_8 ) ) ; java . lang . String remoteVersion = "" ; try { com . fasterxml . jackson . databind . JsonNode systemObject = renderService . getSystemObject ( byteArrayInputStream , RenderFormat . JSON ) ; if ( systemObject == null ) { return false ; } remoteVersion = systemObject . get ( "version" ) . textValue ( ) ; if ( org . apache . commons . lang3 . StringUtils . isEmpty ( remoteVersion ) ) { return false ; } } catch ( java . io . IOException e ) { org . hisp . dhis . dxf2 . metadata . sync . MetadataSyncDelegate . log . error ( ( "Exception<sp>occurred<sp>when<sp>parsing<sp>the<sp>metadata<sp>snapshot" + ( e . getMessage ( ) ) ) ) ; } return ! ( systemVersion . trim ( ) . equals ( remoteVersion . trim ( ) ) ) ; }
org . junit . Assert . assertFalse ( shouldStopSync )
testProcessAction ( ) { System . out . println ( "processAction" ) ; javax . portlet . ActionRequest request = null ; javax . portlet . ActionResponse response = null ; org . jboss . gatein . analyticportal . GAPortlet instance = new org . jboss . gatein . analyticportal . GAPortlet ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( true )
testGetMarketplaceBrandUrl_BrandingUrlSet ( ) { doReturn ( org . oscm . ui . beans . SessionBeanTest . BRANDING_URL ) . when ( marketplaceServiceMock ) . getBrandingUrl ( org . oscm . ui . beans . SessionBeanTest . MARKETPLACE_ID ) ; java . lang . String result = sessionBean . getMarketplaceBrandUrl ( ) ; "<AssertPlaceHolder>" ; } getMarketplaceBrandUrl ( ) { java . lang . String marketplaceBrandUrl = brandUrlMidMapping . get ( getMarketplaceId ( ) ) ; if ( marketplaceBrandUrl == null ) { try { marketplaceBrandUrl = getMarketplaceService ( ) . getBrandingUrl ( getMarketplaceId ( ) ) ; if ( marketplaceBrandUrl == null ) { marketplaceBrandUrl = getWhiteLabelBrandingUrl ( ) ; } } catch ( org . oscm . internal . types . exception . ObjectNotFoundException e ) { marketplaceBrandUrl = getWhiteLabelBrandingUrl ( ) ; } setMarketplaceBrandUrl ( marketplaceBrandUrl ) ; } return marketplaceBrandUrl ; }
org . junit . Assert . assertEquals ( org . oscm . ui . beans . SessionBeanTest . BRANDING_URL , result )
rejectKeysValues ( ) { com . gs . collections . api . multimap . Multimap < java . lang . String , java . lang . Integer > multimap = this . newMultimapWithKeysValues ( "One" , 1 , "One" , 12 , "Two" , 2 , "Two" , 4 ) ; com . gs . collections . api . multimap . Multimap < java . lang . String , java . lang . Integer > rejectedMultimap = multimap . rejectKeysValues ( ( key , value ) -> ( "Two" . equals ( key ) ) || ( ( value % 2 ) == 0 ) ) ; "<AssertPlaceHolder>" ; } newMultimapWithKeyValue ( K , V ) { com . gs . collections . api . multimap . bag . MutableBagMultimap < K , V > mutableMultimap = this . newMultimap ( ) ; mutableMultimap . put ( key , value ) ; return mutableMultimap ; }
org . junit . Assert . assertEquals ( this . newMultimapWithKeyValue ( "One" , 1 ) , rejectedMultimap )
returnsUnknownFlowcellName ( ) { final java . lang . String flowcellName = com . hartwig . hmftools . fastqstats . FastqStatsRunner . getFlowcellName ( "whoops" ) ; "<AssertPlaceHolder>" ; } getFlowcellName ( java . lang . String ) { final java . io . File runInfoXml = new java . io . File ( ( ( dirPath + ( java . io . File . separator ) ) + "RunInfo.xml" ) ) ; final javax . xml . parsers . DocumentBuilderFactory domFactory = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) ; try { final javax . xml . parsers . DocumentBuilder documentBuilder = domFactory . newDocumentBuilder ( ) ; final org . w3c . dom . Document xmlDoc = documentBuilder . parse ( runInfoXml ) ; final javax . xml . xpath . XPath xPath = javax . xml . xpath . XPathFactory . newInstance ( ) . newXPath ( ) ; return ( ( java . lang . String ) ( xPath . evaluate ( "//Flowcell/text()" , xmlDoc , XPathConstants . STRING ) ) ) ; } catch ( java . lang . Exception e ) { com . hartwig . hmftools . fastqstats . FastqStatsRunner . LOGGER . warn ( ( "Could<sp>not<sp>extract<sp>flowcell<sp>name<sp>from<sp>" + ( runInfoXml . getPath ( ) ) ) ) ; return "Unknown" ; } }
org . junit . Assert . assertEquals ( "Unknown" , flowcellName )
testHelp ( ) { at . favre . tools . apksigner . ui . Arg parsedArg = at . favre . tools . apksigner . ui . CLIParser . parse ( at . favre . tools . apksigner . ui . CLIParserTest . asArgArray ( "--help" ) ) ; "<AssertPlaceHolder>" ; } asArgArray ( java . lang . String ) { return org . apache . tools . ant . types . Commandline . translateCommandline ( cmd ) ; }
org . junit . Assert . assertNull ( parsedArg )
testNotSingletonBlockSet ( ) { org . antlr . tool . Grammar g = new org . antlr . tool . Grammar ( ( "parser<sp>grammar<sp>P;\n" + ( "tokens<sp>{<sp>A;<sp>B;<sp>C;<sp>}\n" + "a<sp>:<sp>~(A)<sp>;\n" ) ) ) ; java . lang . String expecting = ".s0->.s1\n" + ( ( ( ".s1->.s2\n" + ".s2-B..C->.s3\n" ) + ".s3->:s4\n" ) + ".s2-B..C->.s3\n" 0 ) ; checkRule ( g , "a" , expecting ) ; java . lang . String expectingGrammarStr = "1:8:<sp>parser<sp>grammar<sp>P;\n" + "a<sp>:<sp>~<sp>(<sp>A<sp>)<sp>;" ; "<AssertPlaceHolder>" ; } toString ( ) { return new java . lang . String ( data ) ; }
org . junit . Assert . assertEquals ( expectingGrammarStr , g . toString ( ) )
testAddWReferralWithFilters ( ) { addReferralEntry ( ) ; javax . naming . directory . Attributes attrs = new javax . naming . directory . BasicAttributes ( true ) ; javax . naming . directory . Attribute oc = new javax . naming . directory . BasicAttribute ( "ObjectClass" , "top" ) ; oc . add ( "extensibleObject" ) ; oc . add ( "referral" ) ; attrs . put ( oc ) ; javax . naming . directory . Attribute ref = new javax . naming . directory . BasicAttribute ( "ref" , "ldap://localhost/cn=RefWithFilter???(cn=*)" ) ; attrs . put ( ref ) ; attrs . put ( "cn" , "RefWithFilter" ) ; java . lang . String base = "cn=RefWithFilter" ; try { getSystemContext ( getService ( ) ) . createSubcontext ( base , attrs ) ; org . junit . Assert . fail ( "Should<sp>not<sp>reach<sp>this<sp>state" ) ; } catch ( javax . naming . NamingException ne ) { "<AssertPlaceHolder>" ; } } createSubcontext ( java . lang . String , javax . naming . directory . Attributes ) { throw new javax . naming . ServiceUnavailableException ( org . apache . directory . server . core . jndi . DeadContext . EXCEPTION_MSG ) ; }
org . junit . Assert . assertTrue ( true )
shouldGetDefaultScoreWithNoOperationScores ( ) { final uk . gov . gchq . gaffer . store . operation . resolver . WhileScoreResolver resolver = new uk . gov . gchq . gaffer . store . operation . resolver . WhileScoreResolver ( ) ; final uk . gov . gchq . gaffer . store . operation . resolver . DefaultScoreResolver defaultResolver = new uk . gov . gchq . gaffer . store . operation . resolver . DefaultScoreResolver ( new java . util . LinkedHashMap ( ) ) ; final uk . gov . gchq . gaffer . operation . impl . While operation = new uk . gov . gchq . gaffer . operation . impl . While ( ) ; final int score = resolver . getScore ( operation , defaultResolver ) ; "<AssertPlaceHolder>" ; } getScore ( uk . gov . gchq . gaffer . operation . Operation , uk . gov . gchq . gaffer . store . operation . resolver . ScoreResolver ) { return defaultScoreResolver . getScore ( operation ) ; }
org . junit . Assert . assertEquals ( 0 , score )
testSetHeader ( ) { java . util . Map < java . lang . String , java . util . List < java . lang . String > > httpHeaders = new java . util . HashMap ( ) ; org . apache . servicecomb . foundation . vertx . http . HttpServletRequestEx request = new org . apache . servicecomb . provider . springmvc . reference . CommonToHttpServletRequest ( null , null , httpHeaders , null , false ) ; request . setHeader ( "name" , "v1" ) ; request . setHeader ( "name" , "v2" ) ; "<AssertPlaceHolder>" ; } getHeader ( java . lang . String ) { return "ms" ; }
org . junit . Assert . assertEquals ( "v2" , request . getHeader ( "name" ) )
testEmptyPoolDoesNotBlockForever ( ) { int CAPACITY = 3 ; int NUM_CONSUMERS = 6 ; java . util . concurrent . atomic . AtomicInteger numStartedWorkers = new java . util . concurrent . atomic . AtomicInteger ( ) ; java . util . concurrent . ConcurrentHashMap < java . lang . Thread , com . facebook . buck . worker . WorkerProcess > usedWorkers = new java . util . concurrent . ConcurrentHashMap ( ) ; java . util . concurrent . Phaser phaser = new java . util . concurrent . Phaser ( ( CAPACITY + 1 ) ) ; com . facebook . buck . worker . WorkerProcessPool pool = com . facebook . buck . worker . WorkerProcessPoolTest . createPool ( CAPACITY , ( ) -> { phaser . awaitAdvance ( phaser . arriveAndDeregister ( ) ) ; numStartedWorkers . incrementAndGet ( ) ; throw new java . io . IOException ( "failed<sp>to<sp>start<sp>worker<sp>process" ) ; } ) ; for ( int i = 0 ; i < NUM_CONSUMERS ; ++ i ) { java . lang . Thread thread = testThreads . startThread ( com . facebook . buck . worker . WorkerProcessPoolTest . borrowAndReturnWorkerProcess ( pool , usedWorkers ) ) ; thread . setUncaughtExceptionHandler ( ( t , e ) -> { } ) ; } phaser . awaitAdvance ( phaser . arriveAndDeregister ( ) ) ; testThreads . join ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return value ; }
org . junit . Assert . assertThat ( numStartedWorkers . get ( ) , org . hamcrest . Matchers . equalTo ( NUM_CONSUMERS ) )
getConnectionProperties ( ) { org . oscm . domobjects . BillingAdapter ba = spy ( new org . oscm . domobjects . BillingAdapter ( ) ) ; java . util . Properties props = createConnectionProperties ( "FileAdapter" ) ; try ( java . io . ByteArrayOutputStream stream = new java . io . ByteArrayOutputStream ( ) ) { props . storeToXML ( stream , null , StandardCharsets . UTF_8 . toString ( ) ) ; ba . setConnectionProperties ( stream . toString ( ) ) ; } java . util . Properties p = org . oscm . billing . application . bean . PluginServiceFactory . getConnectionProperties ( ba ) ; "<AssertPlaceHolder>" ; } createConnectionProperties ( java . lang . String ) { java . util . Properties testProperties = new java . util . Properties ( ) ; testProperties . put ( Context . INITIAL_CONTEXT_FACTORY , "com.sun.enterprise.naming.SerialInitContextFactory" ) ; testProperties . put ( org . oscm . billing . application . bean . PluginServiceFactoryTest . ORBINITIALHOST , "testHost" ) ; testProperties . put ( org . oscm . billing . application . bean . PluginServiceFactoryTest . ORBINITIALPORT , "1354" ) ; testProperties . put ( Context . PROVIDER_URL , "http://test:1354" ) ; if ( jndiName != null ) { testProperties . put ( PluginServiceFactory . JNDI_NAME , jndiName ) ; } return testProperties ; }
org . junit . Assert . assertEquals ( createConnectionProperties ( "FileAdapter" ) , p )
testDeployDataSource ( ) { setupDrivers ( ) ; deployDataSource ( dataSourceDef ) ; org . kie . workbench . common . screens . datasource . management . model . DataSourceDeploymentInfo deploymentInfo = dataSourceProvider . getDeploymentInfo ( dataSourceDef . getUuid ( ) ) ; "<AssertPlaceHolder>" ; } getUuid ( ) { return uuid ; }
org . junit . Assert . assertNotNull ( deploymentInfo )
formatAbsoluteUrl ( ) { final java . lang . String base = "http://localhost:12345" ; final java . lang . String path = "/api/path/to/something" ; final java . lang . String url = new org . commonjava . indy . bind . jaxrs . util . JaxRsUriFormatter ( ) . formatAbsolutePathTo ( base , path ) ; "<AssertPlaceHolder>" ; } formatAbsolutePathTo ( java . lang . String , java . lang . String [ ] ) { logger . debug ( "Formatting<sp>URL<sp>from<sp>base:<sp>'{}'<sp>and<sp>parts:<sp>{}" , base , new org . commonjava . atlas . maven . ident . util . JoinString ( ",<sp>" , parts ) ) ; java . lang . String url = null ; try { url = org . commonjava . maven . galley . util . UrlUtils . buildUrl ( base , parts ) ; } catch ( final java . net . MalformedURLException e ) { logger . warn ( "Failed<sp>to<sp>use<sp>UrlUtils<sp>to<sp>build<sp>URL<sp>from<sp>base:<sp>{}<sp>and<sp>parts:<sp>{}" , base , join ( parts , ",<sp>" ) ) ; url = org . commonjava . maven . galley . util . PathUtils . normalize ( base , org . commonjava . maven . galley . util . PathUtils . normalize ( parts ) ) ; } if ( ( ( ( url . length ( ) ) > 0 ) && ( ! ( url . matches ( "[a-zA-Z0-9]+\\:\\/\\/.+" ) ) ) ) && ( ( url . charAt ( 0 ) ) != '/' ) ) { url = "/" + url ; } logger . debug ( "Resulting<sp>URL:<sp>'{}'" , url ) ; return url ; }
org . junit . Assert . assertThat ( url , org . hamcrest . CoreMatchers . equalTo ( ( base + path ) ) )
stringListTest ( ) { java . util . List < java . lang . String > stringList = toList ( getRandomStringArray ( ) ) ; java . lang . String expected = getExpectedStringListResult ( stringList , separator ) ; java . lang . String phrase = phraseFrom ( "{string_list}" ) . putList ( "string_list" , stringList , separator ) . formatString ( ) ; printResult ( "stringListTest()" , phrase , expected ) ; "<AssertPlaceHolder>" ; } printResult ( java . lang . String , java . lang . String , java . lang . String ) { System . out . println ( ( ( ( ( ( ( ( "====<sp>Test<sp>Method:<sp>" + methodName ) + "<sp>Test<sp>KeyIdentifier:<sp>" ) + ( phraseKeyIdentifier . name ( ) ) ) + "<sp>" ) + ( phraseKeyIdentifier . getOpenCharString ( ) ) ) + ( phraseKeyIdentifier . getCloseCharString ( ) ) ) + "<sp>====" ) ) ; java . lang . StringBuilder message = new java . lang . StringBuilder ( ) ; int remainingWhitespaces = ( methodNameCount ) - ( methodName . length ( ) ) ; if ( remainingWhitespaces < 0 ) { remainingWhitespaces = 0 ; message . append ( "[EXPECTED]<sp>:<sp>" ) . append ( methodName . substring ( 0 , ( ( methodNameCount ) - 3 ) ) ) . append ( "..." ) ; } else { message . append ( "[EXPECTED]<sp>:<sp>" ) . append ( methodName ) ; } for ( int i = 0 ; i < remainingWhitespaces ; i ++ ) { message . append ( "<sp>" ) ; } message . append ( "<sp>><sp>" ) . append ( expected ) ; System . out . println ( message . toString ( ) ) ; printResult ( methodName , result ) ; }
org . junit . Assert . assertEquals ( phrase , expected )
testEquals_same_codepoints_other_class ( ) { org . terasoluna . gfw . common . codepoints . CodePoints cp1 = new org . terasoluna . gfw . common . codepoints . catalog . ABCD ( ) ; org . terasoluna . gfw . common . codepoints . CodePoints cp2 = new org . terasoluna . gfw . common . codepoints . CodePoints ( "ABCD" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) { return false ; } org . terasoluna . gfw . common . codepoints . CodePoints that = ( ( org . terasoluna . gfw . common . codepoints . CodePoints ) ( o ) ) ; return set . equals ( that . set ) ; }
org . junit . Assert . assertThat ( cp1 . equals ( cp2 ) , org . hamcrest . CoreMatchers . is ( false ) )
testCreateReferenceExisting ( ) { com . sun . sgs . test . impl . service . data . TestDataServiceImpl . txnScheduler . runTask ( new com . sun . sgs . test . impl . service . data . TestDataServiceImpl . InitialTestRunnable ( ) , com . sun . sgs . test . impl . service . data . TestDataServiceImpl . taskOwner ) ; com . sun . sgs . test . impl . service . data . TestDataServiceImpl . txnScheduler . runTask ( new com . sun . sgs . test . util . TestAbstractKernelRunnable ( ) { public void run ( ) { com . sun . sgs . test . util . DummyManagedObject dummy = ( ( com . sun . sgs . test . util . DummyManagedObject ) ( com . sun . sgs . test . impl . service . data . TestDataServiceImpl . service . getBinding ( "dummy" ) ) ) ; com . sun . sgs . app . ManagedReference < com . sun . sgs . test . util . DummyManagedObject > ref = com . sun . sgs . test . impl . service . data . TestDataServiceImpl . service . createReference ( dummy ) ; "<AssertPlaceHolder>" ; } } , com . sun . sgs . test . impl . service . data . TestDataServiceImpl . taskOwner ) ; } get ( ) { return object ; }
org . junit . Assert . assertEquals ( dummy , ref . get ( ) )
testMatchesDifferentMicro ( ) { com . eclipsesource . tabris . internal . DefaultVersionCheck versionCheck = new com . eclipsesource . tabris . internal . DefaultVersionCheck ( ) ; boolean matches = versionCheck . accept ( "1.3.1" , "1.3.0" ) ; "<AssertPlaceHolder>" ; } accept ( java . lang . String , java . lang . String ) { return getShortVersion ( serverVersion ) . equals ( getShortVersion ( clientVersion ) ) ; }
org . junit . Assert . assertTrue ( matches )
testGetTextParagraphs_2 ( ) { final java . lang . String input = "<div<sp>class=\"dog-park\"><p>ira<sp>is<sp>a<sp>dog</p><p><sp>she<sp>barks<sp>a<sp>lot</p></div>" ; final java . lang . String [ ] expected = new java . lang . String [ ] { "<div<sp>class=\"dog-park\"><p>ira<sp>is<sp>a<sp>dog</p><p><sp>she<sp>barks<sp>a<sp>" + "lot</p></div>" } ; final java . lang . String [ ] result = longFormTextComponent . getTextParagraphs ( input ) ; "<AssertPlaceHolder>" ; } getTextParagraphs ( java . lang . String ) { java . util . List < java . lang . String > paragraphs = new java . util . ArrayList < java . lang . String > ( ) ; try { final org . w3c . dom . Document doc = htmlParser . parse ( null , org . apache . commons . io . IOUtils . toInputStream ( text , "UTF-8" ) , "UTF-8" ) ; doc . getDocumentElement ( ) . normalize ( ) ; javax . xml . transform . TransformerFactory tf = javax . xml . transform . TransformerFactory . newInstance ( ) ; tf . setFeature ( XMLConstants . FEATURE_SECURE_PROCESSING , true ) ; javax . xml . transform . Transformer transformer = tf . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "yes" ) ; final org . w3c . dom . NodeList bodies = doc . getElementsByTagName ( "body" ) ; if ( ( bodies != null ) && ( ( bodies . getLength ( ) ) == 1 ) ) { final org . w3c . dom . Node body = bodies . item ( 0 ) ; final org . w3c . dom . NodeList children = body . getChildNodes ( ) ; for ( int i = 0 ; i < ( children . getLength ( ) ) ; i ++ ) { java . io . StringWriter writer = new java . io . StringWriter ( ) ; javax . xml . transform . stream . StreamResult result = new javax . xml . transform . stream . StreamResult ( writer ) ; final org . w3c . dom . Node child = children . item ( i ) ; if ( child == null ) { com . adobe . acs . commons . components . longformtext . impl . LongFormTextComponentImpl . log . warn ( "Found<sp>a<sp>null<sp>dom<sp>node." ) ; continue ; } else if ( ( child . getNodeType ( ) ) != javax . jcr . org . w3c . dom . Node ) { com . adobe . acs . commons . components . longformtext . impl . LongFormTextComponentImpl . log . warn ( "Found<sp>a<sp>dom<sp>node<sp>is<sp>not<sp>an<sp>element;<sp>skipping" ) ; continue ; } stripNamespaces ( child ) ; transformer . transform ( new javax . xml . transform . dom . DOMSource ( child ) , result ) ; writer . flush ( ) ; final java . lang . String outerHTML = writer . toString ( ) ; if ( org . apache . commons . lang . StringUtils . isNotBlank ( outerHTML ) ) { paragraphs . add ( outerHTML ) ; } } } else { com . adobe . acs . commons . components . longformtext . impl . LongFormTextComponentImpl . log . debug ( "HTML<sp>does<sp>not<sp>have<sp>a<sp>single<sp>body<sp>tag.<sp>Cannot<sp>parse<sp>as<sp>expected." ) ; } } catch ( java . lang . Exception e ) { com . adobe . acs . commons . components . longformtext . impl . LongFormTextComponentImpl . log . warn ( "Long<sp>Form<sp>Text<sp>encountered<sp>a<sp>parser<sp>error:<sp>{}" , e ) ; } return paragraphs . toArray ( new java . lang . String [ paragraphs . size ( ) ] ) ; }
org . junit . Assert . assertArrayEquals ( expected , result )
givenUserService_whenSearchForUserByAgeLessThan_thenFound ( ) { expect ( userService . findByAge ( lt ( 100.0 ) ) ) . andReturn ( java . util . Collections . emptyList ( ) ) ; replay ( userService ) ; java . util . List < com . baeldung . easymock . User > result = userService . findByAge ( 20 ) ; verify ( userService ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testFindByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . LayoutRevision newLayoutRevision = addLayoutRevision ( ) ; com . liferay . portal . kernel . model . LayoutRevision existingLayoutRevision = _persistence . findByPrimaryKey ( newLayoutRevision . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingLayoutRevision , newLayoutRevision )
testNorm1AlongDimension ( ) { org . nd4j . linalg . api . ndarray . INDArray arr = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 8 , 8 , DataType . DOUBLE ) . reshape ( 2 , 4 ) ; org . nd4j . linalg . api . ndarray . INDArray arrNorm1 = arr . norm2 ( 1 ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 5.47722558 , 13.19090596 } ) ; "<AssertPlaceHolder>" ; } create ( int [ ] , float [ ] [ ] ) { int slices = arrays . length ; org . nd4j . linalg . factory . INDArray ret = org . nd4j . linalg . factory . Nd4j . create ( org . nd4j . linalg . util . ArrayUtil . combine ( new int [ ] { slices } , sliceShape ) ) ; for ( int i = 0 ; i < ( ret . slices ( ) ) ; i ++ ) ret . putSlice ( i , org . nd4j . linalg . factory . Nd4j . create ( arrays [ i ] ) . reshape ( org . nd4j . linalg . util . ArrayUtil . toLongArray ( sliceShape ) ) ) ; return ret ; }
org . junit . Assert . assertEquals ( assertion , arrNorm1 )
testParseNegativeX ( ) { java . lang . String source = ( ( ( ( ( "{-1" + ( getDecimalCharacter ( ) ) ) + "2323;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "4343;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "6333}" ; org . hipparchus . geometry . euclidean . threed . Vector3D expected = new org . hipparchus . geometry . euclidean . threed . Vector3D ( ( - 1.2323 ) , 1.4343 , 1.6333 ) ; org . hipparchus . geometry . euclidean . threed . Vector3D actual = vector3DFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . hipparchus . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . hipparchus . exception . MathIllegalStateException ( org . hipparchus . exception . LocalizedCoreFormats . CANNOT_PARSE_AS_TYPE , source , parsePosition . getErrorIndex ( ) , org . hipparchus . geometry . euclidean . twod . Vector2D . class ) ; } return result ; }
org . junit . Assert . assertEquals ( expected , actual )
isStatic ( ) { populate ( false ) ; "<AssertPlaceHolder>" ; } isDynamic ( ) { return resolverSet . isDynamic ( ) ; }
org . junit . Assert . assertThat ( builder . isDynamic ( ) , org . hamcrest . CoreMatchers . is ( false ) )
testAddChainTransformation ( ) { java . util . Map < java . lang . String , java . lang . String > params = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; params . put ( "refactoringConfigFile" , "src/conf/refactoring-methods.json" ) ; org . walkmod . commands . AddTransformationCommand command = new org . walkmod . commands . AddTransformationCommand ( "walkmod:commons:method-refactor" , null , false , null , null , null , params , false ) ; java . io . File file = new java . io . File ( "src/test/resources/yaml/addchain.yml" ) ; if ( file . exists ( ) ) { file . delete ( ) ; } file . createNewFile ( ) ; org . apache . commons . io . FileUtils . write ( file , "" ) ; try { org . walkmod . conf . providers . YAMLConfigurationProvider provider = new org . walkmod . conf . providers . YAMLConfigurationProvider ( file . getPath ( ) ) ; org . walkmod . conf . entities . Configuration conf = new org . walkmod . conf . entities . impl . ConfigurationImpl ( ) ; provider . init ( conf ) ; org . walkmod . conf . entities . TransformationConfig transformationCfg = command . buildTransformationCfg ( ) ; provider . addTransformationConfig ( null , null , transformationCfg , false , null , null ) ; java . lang . String output = org . apache . commons . io . FileUtils . readFileToString ( file ) ; java . lang . String desiredOutput = "transformations:\n" ; desiredOutput += "-<sp>type:<sp>\"walkmod:commons:method-refactor\"\n" ; desiredOutput += "<sp>params:\n" ; desiredOutput += "<sp>refactoringConfigFile:<sp>\"src/conf/refactoring-methods.json\"" ; "<AssertPlaceHolder>" ; } finally { if ( file . exists ( ) ) { file . delete ( ) ; } } } addTransformationConfig ( java . lang . String , java . lang . String , org . walkmod . conf . entities . TransformationConfig , boolean , java . lang . Integer , java . lang . String ) { if ( transformationCfg != null ) { org . walkmod . conf . providers . yml . AddTransformationYMLAction action = new org . walkmod . conf . providers . yml . AddTransformationYMLAction ( chain , path , transformationCfg , this , recursive , order , before ) ; action . execute ( ) ; } return ; }
org . junit . Assert . assertEquals ( desiredOutput , output )
mergeWithDouble ( ) { puck . thrifty . datatype . LongElement elem = new puck . thrifty . datatype . LongElement ( "test" ) ; puck . thrifty . datatype . DoubleElement dElem = new puck . thrifty . datatype . DoubleElement ( "test" ) ; puck . thrifty . datatype . Element mergeElem = elem . merge ( dElem ) ; "<AssertPlaceHolder>" ; } merge ( puck . thrifty . datatype . Element ) { if ( ( ( ( element == null ) || ( ( this ) == element ) ) || ( element . isUnknown ( ) ) ) || ( this . getClass ( ) . equals ( element . getClass ( ) ) ) ) { return this ; } else if ( element instanceof puck . thrifty . datatype . NumberElement ) { return element ; } throw new puck . thrifty . MergerException ( this , element ) ; }
org . junit . Assert . assertSame ( dElem , mergeElem )
testGetModelByID ( ) { try { qa . qcri . aidr . dbmanager . dto . ModelDTO modelDTO = qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestModelResourceFacadeImp . modelResourceFacadeImp . getModelByID ( modelID ) ; "<AssertPlaceHolder>" ; } catch ( qa . qcri . aidr . common . exception . PropertyNotSetException e ) { qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestModelResourceFacadeImp . logger . error ( ( "PropertyNotSetException<sp>while<sp>executing<sp>testGetModelByID<sp>" + ( e . getMessage ( ) ) ) ) ; } } getModelByID ( java . lang . Long ) { return new qa . qcri . aidr . dbmanager . dto . ModelDTO ( getById ( id ) ) ; }
org . junit . Assert . assertNotNull ( modelDTO )
testGetFieldValue_ID ( ) { com . archimatetool . model . IBusinessActor element = IArchimateFactory . eINSTANCE . createBusinessActor ( ) ; element . setId ( "1234" ) ; java . lang . Object o = com . archimatetool . jasperreports . data . FieldDataFactory . getFieldValue ( element , "id" ) ; "<AssertPlaceHolder>" ; } getFieldValue ( java . lang . Object , java . lang . String ) { if ( "this" . equals ( fieldName ) ) { return dataElement ; } if ( ( "id" . equals ( fieldName ) ) && ( dataElement instanceof com . archimatetool . model . IIdentifier ) ) { return ( ( com . archimatetool . model . IIdentifier ) ( dataElement ) ) . getId ( ) ; } if ( ( "name" . equals ( fieldName ) ) && ( dataElement instanceof com . archimatetool . model . INameable ) ) { java . lang . String name = ( ( com . archimatetool . model . INameable ) ( dataElement ) ) . getName ( ) ; if ( ( name == null ) || ( "" . equals ( name ) ) ) { name = ArchiLabelProvider . INSTANCE . getDefaultName ( ( ( org . eclipse . emf . ecore . EObject ) ( dataElement ) ) . eClass ( ) ) ; } return name ; } if ( ( "type" . equals ( fieldName ) ) && ( dataElement instanceof org . eclipse . emf . ecore . EObject ) ) { return ArchiLabelProvider . INSTANCE . getDefaultName ( ( ( org . eclipse . emf . ecore . EObject ) ( dataElement ) ) . eClass ( ) ) ; } if ( ( "documentation" . equals ( fieldName ) ) && ( dataElement instanceof com . archimatetool . model . IDocumentable ) ) { java . lang . String s = ( ( com . archimatetool . model . IDocumentable ) ( dataElement ) ) . getDocumentation ( ) ; return com . archimatetool . editor . utils . StringUtils . isSet ( s ) ? s : null ; } if ( ( "purpose" . equals ( fieldName ) ) && ( dataElement instanceof com . archimatetool . model . IArchimateModel ) ) { java . lang . String s = ( ( com . archimatetool . model . IArchimateModel ) ( dataElement ) ) . getPurpose ( ) ; return com . archimatetool . editor . utils . StringUtils . isSet ( s ) ? s : null ; } if ( ( "relation_source" . equals ( fieldName ) ) && ( dataElement instanceof com . archimatetool . model . IArchimateRelationship ) ) { com . archimatetool . model . IArchimateRelationship relation = ( ( com . archimatetool . model . IArchimateRelationship ) ( dataElement ) ) ; com . archimatetool . model . IArchimateConcept source = relation . getSource ( ) ; java . lang . String s = source . getName ( ) ; return com . archimatetool . editor . utils . StringUtils . isSet ( s ) ? s : null ; } if ( ( "relation_target" . equals ( fieldName ) ) && ( dataElement instanceof com . archimatetool . model . IArchimateRelationship ) ) { com . archimatetool . model . IArchimateRelationship relation = ( ( com . archimatetool . model . IArchimateRelationship ) ( dataElement ) ) ; com . archimatetool . model . IArchimateConcept target = relation . getTarget ( ) ; java . lang . String s = target . getName ( ) ; return com . archimatetool . editor . utils . StringUtils . isSet ( s ) ? s : null ; } return null ; }
org . junit . Assert . assertEquals ( "1234" , o )
test_AT_119_1_RemoteConsumerFailWithAllocatedWorkerBeforeToBeDeliveredWithJDL ( ) { org . ourgrid . acceptance . util . PeerAcceptanceUtil . copyTrustFile ( ( ( org . ourgrid . acceptance . peer . Req_119_Test . COMM_FILE_PATH ) + "119_blank.xml" ) ) ; br . edu . ufcg . lsd . commune . container . logging . CommuneLogger loggerMock = getMock ( org . ourgrid . acceptance . peer . NOT_NICE , br . edu . ufcg . lsd . commune . container . logging . CommuneLogger . class ) ; component . setLogger ( loggerMock ) ; org . ourgrid . common . specification . worker . WorkerSpecification workerSpecA = workerAcceptanceUtil . createClassAdWorkerSpec ( "U1" , "><sp>(IDLE)<sp>changed<sp>its<sp>status" 0 , null , null ) ; java . lang . String workerAPublicKey = "><sp>(IDLE)<sp>changed<sp>its<sp>status" 1 ; br . edu . ufcg . lsd . commune . identification . DeploymentID workerADID = req_019_Util . createAndPublishWorkerManagement ( component , workerSpecA , workerAPublicKey ) ; req_010_Util . workerLogin ( component , workerSpecA , workerADID ) ; req_025_Util . changeWorkerStatusToIdle ( component , workerADID ) ; java . lang . String remoteClientPublicKey = "consumerPublicKey" ; br . edu . ufcg . lsd . commune . identification . DeploymentID remoteClientOID = new br . edu . ufcg . lsd . commune . identification . DeploymentID ( new br . edu . ufcg . lsd . commune . identification . ContainerID ( "rUserName" , "server" , "module" , remoteClientPublicKey ) , org . ourgrid . peer . PeerConstants . REMOTE_WORKER_MANAGEMENT_CLIENT ) ; int request1ID = 1 ; org . ourgrid . common . interfaces . to . RequestSpecification requestSpec1 = new org . ourgrid . common . interfaces . to . RequestSpecification ( 0 , new org . ourgrid . common . specification . job . JobSpecification ( "label" ) , request1ID , buildRequirements ( null ) , 1 , 0 , 0 ) ; org . ourgrid . acceptance . util . WorkerAllocation workerAllocationA = new org . ourgrid . acceptance . util . WorkerAllocation ( workerADID ) ; req_011_Util . requestForRemoteClient ( component , remoteClientOID , requestSpec1 , 0 , workerAllocationA ) ; "<AssertPlaceHolder>" ; org . ourgrid . common . interfaces . status . ConsumerInfo remoteConsumerInfo = new org . ourgrid . common . interfaces . status . ConsumerInfo ( 1 , remoteClientOID . getServiceID ( ) . toString ( ) ) ; req_034_Util . getRemoteConsumersStatus ( br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . createList ( remoteConsumerInfo ) ) ; org . ourgrid . acceptance . util . WorkerAllocation allocationA = new org . ourgrid . acceptance . util . WorkerAllocation ( workerADID ) ; req_119_Util . notifyRemoteConsumerFailure ( component , null , remoteClientOID , false , allocationA ) ; peerAcceptanceUtil . isPeerInterestedOnRemoteWorker ( remoteClientOID . getServiceID ( ) ) ; req_034_Util . getRemoteConsumersStatus ( new java . util . LinkedList < org . ourgrid . common . interfaces . status . ConsumerInfo > ( ) ) ; org . ourgrid . common . interfaces . to . WorkerInfo workerInfoA = new org . ourgrid . common . interfaces . to . WorkerInfo ( workerSpecA , org . ourgrid . common . interfaces . to . LocalWorkerState . IDLE ) ; java . util . List < org . ourgrid . common . interfaces . to . WorkerInfo > localWorkersInfo = br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . createList ( workerInfoA ) ; req_036_Util . getLocalWorkersStatus ( localWorkersInfo ) ; org . ourgrid . common . interfaces . management . RemoteWorkerManagement worker = org . easymock . classextension . EasyMock . createMock ( org . ourgrid . common . interfaces . management . RemoteWorkerManagement . class ) ; br . edu . ufcg . lsd . commune . identification . DeploymentID remoteWorkerID = new br . edu . ufcg . lsd . commune . identification . DeploymentID ( new br . edu . ufcg . lsd . commune . identification . ContainerID ( "rUserName" , "server" , "module" , workerAPublicKey ) , org . ourgrid . worker . WorkerConstants . REMOTE_WORKER_MANAGEMENT ) ; peerAcceptanceUtil . createStub ( worker , org . ourgrid . common . interfaces . management . RemoteWorkerManagement . class , remoteWorkerID ) ; org . easymock . classextension . EasyMock . reset ( loggerMock ) ; loggerMock . warn ( ( ( ( "The<sp>worker<sp><" + ( workerADID . getContainerID ( ) ) ) + "><sp>(IDLE)<sp>changed<sp>its<sp>status" ) + "<sp>to<sp>ALLOCATED_FOR_PEER.<sp>This<sp>status<sp>change<sp>was<sp>ignored." ) ) ; replayActiveMocks ( ) ; req_025_Util . changeStatusAllocatedForPeer ( workerADID , null , component ) ; verifyActiveMocks ( ) ; } isPeerInterestedOnRemoteWorker ( br . edu . ufcg . lsd . commune . identification . ServiceID ) { br . edu . ufcg . lsd . commune . container . ObjectDeployment deployment = getContainerObject ( application , org . ourgrid . acceptance . util . REMOTE_WORKER_MANAGEMENT_CLIENT ) ; return br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . isInterested ( application , rwmOID , deployment . getDeploymentID ( ) ) ; }
org . junit . Assert . assertFalse ( peerAcceptanceUtil . isPeerInterestedOnRemoteWorker ( remoteClientOID . getServiceID ( ) ) )
testDeleteQuestion ( ) { org . batfish . datamodel . pojo . Analysis a = new org . batfish . datamodel . pojo . Analysis ( "analysis" , com . google . common . collect . Maps . newHashMap ( java . util . Collections . singletonMap ( "question" , "questionContent" ) ) ) ; a . deleteQuestion ( "question" ) ; "<AssertPlaceHolder>" ; _thrown . expect ( org . batfish . common . BatfishException . class ) ; _thrown . expectMessage ( org . hamcrest . Matchers . equalTo ( "Question<sp>question<sp>does<sp>not<sp>exist<sp>for<sp>analysis<sp>analysis" ) ) ; a . deleteQuestion ( "question" ) ; } getQuestions ( ) { java . util . SortedSet < java . lang . String > result = ( ( _analysis ) != null ) ? org . batfish . coordinator . Main . getWorkMgr ( ) . listAnalysisQuestions ( _network , _analysis ) : org . batfish . coordinator . Main . getWorkMgr ( ) . listQuestions ( _network , false ) ; if ( result == null ) { return javax . ws . rs . core . Response . status ( Status . NOT_FOUND ) . build ( ) ; } return javax . ws . rs . core . Response . ok ( ) . entity ( result ) . build ( ) ; }
org . junit . Assert . assertThat ( a . getQuestions ( ) . size ( ) , org . hamcrest . Matchers . is ( 0 ) )
getLandTestOK ( ) { final java . lang . String landCode = "6037" ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . LandOfGebied expectedLandOfGebied = new nl . bzk . algemeenbrp . dal . domein . brp . entity . LandOfGebied ( landCode , "Spanje" ) ; final java . lang . String expected = java . lang . String . format ( nl . bzk . migratiebrp . ggo . viewer . service . impl . BrpStamtabelServiceTest . STRING_FORMAT , expectedLandOfGebied . getCode ( ) , expectedLandOfGebied . getNaam ( ) ) ; org . mockito . Mockito . doReturn ( expectedLandOfGebied ) . when ( dynamischeStamtabelRepository ) . getLandOfGebiedByCode ( landCode ) ; final java . lang . String resultLand = brpStamtabelService . getLandOfGebied ( java . lang . String . valueOf ( landCode ) ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { final nl . bzk . brp . domain . expressie . Datumdeel datumdeel = new nl . bzk . brp . domain . expressie . Datumdeel ( ) ; datumdeel . waarde = waarde ; datumdeel . type = nl . bzk . brp . domain . expressie . Datumdeel . Type . WAARDE ; return datumdeel ; }
org . junit . Assert . assertEquals ( expected , resultLand )
testGetAllNotAllowedCodePoint_allAllowedCodePoints ( ) { java . lang . String testStr = ( ( org . terasoluna . gfw . common . codepoints . CodePointsTest . SURROGATE_PAIR_CHAR_2000B ) + "" ) + ( org . terasoluna . gfw . common . codepoints . CodePointsTest . SURROGATE_PAIR_CHAR_2000B ) ; org . terasoluna . gfw . common . codepoints . Set < java . lang . Integer > allowedCodePointSet = new org . terasoluna . gfw . common . codepoints . HashSet < java . lang . Integer > ( ) ; allowedCodePointSet . add ( "" . codePointAt ( 0 ) ) ; allowedCodePointSet . add ( "" . codePointAt ( 0 ) ) ; allowedCodePointSet . add ( "" . codePointAt ( 0 ) ) ; allowedCodePointSet . add ( "" . codePointAt ( 0 ) ) ; allowedCodePointSet . add ( "" . codePointAt ( 0 ) ) ; allowedCodePointSet . add ( 131083 ) ; org . terasoluna . gfw . common . codepoints . Set < java . lang . Integer > result = new org . terasoluna . gfw . common . codepoints . CodePoints ( allowedCodePointSet ) . allExcludedCodePoints ( testStr ) ; "<AssertPlaceHolder>" ; } size ( ) { return java . lang . reflect . Array . getLength ( arrayObject ) ; }
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithNullBody ( ) { final com . azure . common . entities . HttpBinJSON result = createService ( com . azure . common . implementation . RestProxyTests . Service19 . class ) . putWithHeaderApplicationOctetStreamContentTypeAndStringBody ( null ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( "" , result . data )
numberOfActorsShouldBeOneMoreIfInitiatorIsNotAnActor ( ) { org . bonitasoft . engine . core . process . definition . model . SActorDefinition initiator = mock ( org . bonitasoft . engine . core . process . definition . model . SActorDefinition . class ) ; org . bonitasoft . engine . core . process . definition . model . SActorDefinition actor = mock ( org . bonitasoft . engine . core . process . definition . model . SActorDefinition . class ) ; when ( org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . definition . getActorInitiator ( ) ) . thenReturn ( initiator ) ; when ( org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . definition . getActors ( ) ) . thenReturn ( java . util . Collections . singleton ( actor ) ) ; org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . getNumberOfActors . execute ( ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return number ; }
org . junit . Assert . assertThat ( org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . getNumberOfActors . getResult ( ) , org . hamcrest . core . Is . is ( 2 ) )
colinearTestWithColinearPoints ( ) { javax . vecmath . Point3d pointA = new javax . vecmath . Point3d ( 1 , 1 , 1 ) ; javax . vecmath . Point3d pointB = new javax . vecmath . Point3d ( 2 , 2 , 2 ) ; javax . vecmath . Point3d pointC = new javax . vecmath . Point3d ( 3 , 3 , 3 ) ; "<AssertPlaceHolder>" ; } isColinear ( javax . vecmath . Point3d , javax . vecmath . Point3d , javax . vecmath . Point3d ) { javax . vecmath . Vector3d vectorAB = new javax . vecmath . Vector3d ( ) ; javax . vecmath . Vector3d vectorAC = new javax . vecmath . Vector3d ( ) ; javax . vecmath . Vector3d normal = new javax . vecmath . Vector3d ( ) ; org . openscience . cdk . stereo . StereoTool . getRawNormal ( ptA , ptB , ptC , normal , vectorAB , vectorAC ) ; return org . openscience . cdk . stereo . StereoTool . isColinear ( normal ) ; }
org . junit . Assert . assertTrue ( org . openscience . cdk . stereo . StereoTool . isColinear ( pointA , pointB , pointC ) )
testSerialization ( ) { org . jfree . data . time . ohlc . OHLCSeriesCollection c1 = new org . jfree . data . time . ohlc . OHLCSeriesCollection ( ) ; org . jfree . data . time . ohlc . OHLCSeries s1 = new org . jfree . data . time . ohlc . OHLCSeries ( "Series" ) ; s1 . add ( new org . jfree . data . time . Year ( 2006 ) , 1.0 , 1.1 , 1.2 , 1.3 ) ; c1 . addSeries ( s1 ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( c1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . data . time . ohlc . OHLCSeriesCollection c2 = ( ( org . jfree . data . time . ohlc . OHLCSeriesCollection ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } }
org . junit . Assert . assertEquals ( c1 , c2 )
rasterizePoints ( ) { org . geotools . geometry . jts . ReferencedEnvelope bounds = new org . geotools . geometry . jts . ReferencedEnvelope ( ( - 10 ) , 10 , ( - 20 ) , 20 , org . geotools . referencing . crs . DefaultEngineeringCRS . GENERIC_2D ) ; java . awt . Dimension gridDim = new java . awt . Dimension ( 100 , 100 ) ; org . geotools . data . simple . SimpleFeatureCollection features = createPoints ( bounds , gridDim ) ; java . lang . String covName = "Test" ; org . opengis . util . ProgressListener monitor = null ; org . geotools . coverage . grid . GridCoverage2D cov = org . geotools . process . vector . VectorToRasterProcess . process ( features , "value" , gridDim , bounds , covName , monitor ) ; org . geotools . data . simple . SimpleFeatureIterator iter = features . features ( ) ; int [ ] covValues = new int [ 1 ] ; try { while ( iter . hasNext ( ) ) { org . opengis . feature . simple . SimpleFeature feature = iter . next ( ) ; org . locationtech . jts . geom . Coordinate coord = ( ( org . locationtech . jts . geom . Geometry ) ( feature . getDefaultGeometry ( ) ) ) . getCoordinate ( ) ; java . awt . geom . Point2D worldPos = new java . awt . geom . Point2D . Double ( coord . x , coord . y ) ; int value = ( ( java . lang . Integer ) ( feature . getAttribute ( "value" ) ) ) ; cov . evaluate ( worldPos , covValues ) ; "<AssertPlaceHolder>" ; } } finally { iter . close ( ) ; } } evaluate ( org . opengis . geometry . DirectPosition , java . util . Collection ) { return gridCoverage . evaluate ( p , list ) ; }
org . junit . Assert . assertEquals ( value , covValues [ 0 ] )
normalizeSpaces_shouldCompressTabs ( ) { final java . lang . String input = "a\t\tb\tc" ; final java . lang . String value = org . erlide . util . StringUtils . normalizeSpaces ( input ) ; final java . lang . String expected = "a<sp>b<sp>c" ; "<AssertPlaceHolder>" ; } normalizeSpaces ( java . lang . String ) { return string . replaceAll ( "[\t\n\r<sp>]+" , "<sp>" ) ; }
org . junit . Assert . assertEquals ( value , expected )
shouldExportRegexpQuery ( ) { com . couchbase . client . java . search . queries . RegexpQuery fts = com . couchbase . client . java . search . SearchQuery . regexp ( "someregexp" ) ; com . couchbase . client . java . search . SearchQuery query = new com . couchbase . client . java . search . SearchQuery ( "foo" , fts ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "query" , com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "regexp" , "someregexp" ) ) ; "<AssertPlaceHolder>" ; } export ( ) { return "INSERT<sp>INTO<sp>" + ( bucket . toString ( ) ) ; }
org . junit . Assert . assertEquals ( expected , query . export ( ) )
testEmptyDatapointSet ( ) { com . salesforce . dva . argus . service . metric . transform . Transform propagateTransform = new com . salesforce . dva . argus . service . metric . transform . PropagateTransform ( ) ; com . salesforce . dva . argus . entity . Metric metric = new com . salesforce . dva . argus . entity . Metric ( com . salesforce . dva . argus . service . metric . transform . PropagateTransformTest . TEST_SCOPE , com . salesforce . dva . argus . service . metric . transform . PropagateTransformTest . TEST_METRIC ) ; metric . setDatapoints ( java . util . Collections . < java . lang . Long , java . lang . Double > emptyMap ( ) ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > metrics = java . util . Arrays . asList ( metric ) ; java . util . List < java . lang . String > constants = java . util . Arrays . asList ( "1m" ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > result = propagateTransform . transform ( null , metrics , constants ) ; "<AssertPlaceHolder>" ; } transform ( com . salesforce . dva . argus . util . QueryContext , java . util . List , java . util . List ) { com . salesforce . dva . argus . system . SystemAssert . requireArgument ( ( metrics != null ) , "Cannot<sp>transform<sp>null<sp>metrics" ) ; com . salesforce . dva . argus . system . SystemAssert . requireArgument ( ( ( constants != null ) && ( ( constants . size ( ) ) >= 2 ) ) , "Constants<sp>list<sp>cannot<sp>be<sp>null<sp>and<sp>its<sp>size<sp>must<sp>be<sp>2<sp>or<sp>more." ) ; com . salesforce . dva . argus . service . metric . transform . TransformFactory . Function functionName = null ; int functionElementId = - 1 ; for ( int i = ( constants . size ( ) ) - 1 ; i >= 0 ; i -- ) { java . lang . String constant = constants . get ( i ) ; try { functionName = TransformFactory . Function . valueOf ( constant ) ; functionElementId = i ; break ; } catch ( java . lang . IllegalArgumentException ex ) { } } if ( functionName == null ) { throw new java . lang . UnsupportedOperationException ( "GroupByTag<sp>needs<sp>a<sp>function<sp>name<sp>to<sp>be<sp>provided" ) ; } java . util . List < java . lang . String > tags = constants . subList ( 0 , functionElementId ) ; if ( tags . isEmpty ( ) ) { throw new java . lang . UnsupportedOperationException ( "GroupByTag<sp>needs<sp>at<sp>least<sp>one<sp>tag<sp>to<sp>be<sp>provided" ) ; } java . util . List < java . lang . String > transformConstants = ( functionElementId == ( ( constants . size ( ) ) - 1 ) ) ? new java . util . ArrayList ( ) : constants . subList ( ( functionElementId + 1 ) , constants . size ( ) ) ; java . util . Map < java . lang . String , java . util . List < com . salesforce . dva . argus . entity . Metric > > groups = new java . util . HashMap ( ) ; for ( com . salesforce . dva . argus . entity . Metric metric : metrics ) { java . lang . String key = tags . stream ( ) . map ( metric :: getTag ) . filter ( Objects :: nonNull ) . collect ( java . util . stream . Collectors . joining ( "," ) ) ; groups . putIfAbsent ( key , new java . util . ArrayList ( ) ) ; groups . get ( key ) . add ( metric ) ; } com . salesforce . dva . argus . service . metric . transform . Transform transform = _factory . getTransform ( functionName . getName ( ) ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > result = new java . util . ArrayList ( ) ; for ( java . util . Map . Entry < java . lang . String , java . util . List < com . salesforce . dva . argus . entity . Metric > > entry : groups . entrySet ( ) ) { java . util . List < com . salesforce . dva . argus . entity . Metric > metricsInThisGroup = entry . getValue ( ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > reducedMetrics = ( transformConstants . isEmpty ( ) ) ? transform . transform ( null , metricsInThisGroup ) : transform . transform ( null , metricsInThisGroup , transformConstants ) ; for ( com . salesforce . dva . argus . entity . Metric reducedMetric : reducedMetrics ) { reducedMetric . setScope ( ( ( ( entry . getKey ( ) ) != null ) && ( ! ( entry . getKey ( ) . trim ( ) . isEmpty ( ) ) ) ? entry . getKey ( ) : "uncaptured-group" ) ) ; } result . addAll ( reducedMetrics ) ; } return result ; }
org . junit . Assert . assertEquals ( metrics , result )
isZipkinTracingReady_WhenZipkinDataHasBeenBuilt_ShouldReturnTrue ( ) { java . lang . String spanName = "Span<sp>Name" ; when ( zipkinDataBuilder . spanName ( spanName ) ) . thenReturn ( zipkinDataBuilder ) ; when ( zipkinDataBuilder . build ( ) ) . thenReturn ( zipkinData ) ; victim = new com . betfair . cougar . modules . zipkin . impl . ZipkinRequestUUIDImpl ( cougarUuid , zipkinDataBuilder ) ; victim . buildZipkinData ( spanName ) ; "<AssertPlaceHolder>" ; } isZipkinTracingReady ( ) { return ( zipkinData ) != null ; }
org . junit . Assert . assertTrue ( victim . isZipkinTracingReady ( ) )
toJavaUri ( ) { java . net . URI javaUri = java . net . URI . create ( "http://example.org/foo/bar/baz?blah=blah#boo" ) ; org . apache . shindig . common . uri . Uri uri = org . apache . shindig . common . uri . Uri . parse ( "http://example.org/foo/bar/baz?blah=blah#boo" ) ; "<AssertPlaceHolder>" ; } toJavaUri ( ) { java . net . URI javaUri = java . net . URI . create ( "http://example.org/foo/bar/baz?blah=blah#boo" ) ; org . apache . shindig . common . uri . Uri uri = org . apache . shindig . common . uri . Uri . parse ( "http://example.org/foo/bar/baz?blah=blah#boo" ) ; org . junit . Assert . assertEquals ( javaUri , uri . toJavaUri ( ) ) ; }
org . junit . Assert . assertEquals ( javaUri , uri . toJavaUri ( ) )
getAttributeThatIsNotPresent ( ) { java . lang . Integer value = container . getAttribute ( org . apache . mina . session . AttributeContainerTest . ATTRIBUTE_KEY , org . apache . mina . session . AttributeContainerTest . DEFAULT_VALUE ) ; "<AssertPlaceHolder>" ; } getAttribute ( org . jboss . netty . channel . ChannelHandlerContext , java . lang . String ) { return org . apache . mina . core . nio . tcp . Netty3TcpBenchmarkServer . getAttributesMap ( ctx ) . get ( name ) ; }
org . junit . Assert . assertThat ( value , org . hamcrest . CoreMatchers . is ( org . apache . mina . session . AttributeContainerTest . DEFAULT_VALUE ) )
resolving_second_request_as_no_specimen_returns_no_specimen ( ) { when ( mockSpecimenContext . resolve ( java . lang . String . class ) ) . thenReturn ( "string" ) ; when ( mockSpecimenContext . resolve ( int . class ) ) . thenReturn ( new com . flextrade . jfixture . NoSpecimen ( ) ) ; java . lang . Object result = this . relay . create ( new com . flextrade . jfixture . requests . KeyValueRequest ( java . lang . String . class , int . class ) , mockSpecimenContext ) ; "<AssertPlaceHolder>" ; } resolve ( java . lang . Object ) { return this . builder . create ( request , this ) ; }
org . junit . Assert . assertEquals ( new com . flextrade . jfixture . NoSpecimen ( ) , result )
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . segments . model . SegmentsEntryRel . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "segmentsEntryRelId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "segmentsEntryRelId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testGetSize ( ) { org . apache . accumulo . core . data . Value v = new org . apache . accumulo . core . data . Value ( org . apache . accumulo . core . data . ValueTest . DATA ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return size ; }
org . junit . Assert . assertEquals ( org . apache . accumulo . core . data . ValueTest . DATA . length , v . getSize ( ) )
pojoWithoutRelation ( ) { com . airhacks . enhydrator . out . CachingConsumer consumer = new com . airhacks . enhydrator . out . CachingConsumer ( ) ; com . airhacks . enhydrator . out . PojoSink sink = new com . airhacks . enhydrator . out . PojoSink ( com . airhacks . enhydrator . out . DeveloperWithoutKids . class , consumer , null ) ; final java . lang . String expected = "duke" ; com . airhacks . enhydrator . in . Row parent = new com . airhacks . enhydrator . in . Row ( ) ; parent . addColumn ( ( - 1 ) , "name" , expected ) ; final int expectedRanking = 2 ; final java . lang . String expectedLanguageName = "java" ; com . airhacks . enhydrator . in . Row programming = new com . airhacks . enhydrator . in . Row ( ) ; programming . addColumn ( ( - 1 ) , "name" , expectedLanguageName ) ; programming . addColumn ( ( - 1 ) , "ranking" , expectedRanking ) ; parent . add ( programming ) ; sink . processRow ( parent ) ; com . airhacks . enhydrator . out . DeveloperWithoutKids kidless = ( ( com . airhacks . enhydrator . out . DeveloperWithoutKids ) ( consumer . getObject ( ) ) ) ; "<AssertPlaceHolder>" ; } getObject ( ) { return object ; }
org . junit . Assert . assertNotNull ( kidless )
testQueryParamsWithUrlEncodedPlus ( ) { java . lang . String qlString = "select<sp>*<sp>where<sp>email='test+value@usergrid.com'" ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > queryParams = new java . util . HashMap ( ) ; queryParams . put ( "ql" , java . util . Collections . singletonList ( qlString . replace ( "+" , "%2b" ) ) ) ; org . apache . usergrid . persistence . Query query = org . apache . usergrid . persistence . Query . fromQueryParams ( queryParams ) ; "<AssertPlaceHolder>" ; } getQl ( ) { return ql ; }
org . junit . Assert . assertEquals ( qlString , query . getQl ( ) . get ( ) )