input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testIsRedirectedMovedTemporaryNoLocation ( ) { final org . apache . hc . client5 . http . impl . DefaultRedirectStrategy redirectStrategy = new org . apache . hc . client5 . http . impl . DefaultRedirectStrategy ( ) ; final org . apache . hc . client5 . http . protocol . HttpClientContext context = org . apache . hc . client5 . http . protocol . HttpClientContext . create ( ) ; final org . apache . hc . client5 . http . classic . methods . HttpGet httpget = new org . apache . hc . client5 . http . classic . methods . HttpGet ( "http://localhost/" ) ; final org . apache . hc . core5 . http . HttpResponse response = new org . apache . hc . core5 . http . message . BasicHttpResponse ( org . apache . hc . core5 . http . HttpStatus . SC_MOVED_TEMPORARILY , "Redirect" ) ; "<AssertPlaceHolder>" ; } isRedirected ( org . apache . hc . core5 . http . HttpRequest , org . apache . hc . core5 . http . HttpResponse , org . apache . hc . core5 . http . protocol . HttpContext ) { org . apache . hc . core5 . util . Args . notNull ( request , "HTTP<sp>request" ) ; org . apache . hc . core5 . util . Args . notNull ( response , "HTTP<sp>response" ) ; if ( ! ( response . containsHeader ( HttpHeaders . LOCATION ) ) ) { return false ; } final int statusCode = response . getCode ( ) ; switch ( statusCode ) { case org . apache . hc . core5 . http . HttpStatus . SC_MOVED_PERMANENTLY : case org . apache . hc . core5 . http . HttpStatus . SC_MOVED_TEMPORARILY : case org . apache . hc . core5 . http . HttpStatus . SC_SEE_OTHER : case org . apache . hc . core5 . http . HttpStatus . SC_TEMPORARY_REDIRECT : case org . apache . hc . core5 . http . HttpStatus . SC_PERMANENT_REDIRECT : return true ; default : return false ; } }
org . junit . Assert . assertFalse ( redirectStrategy . isRedirected ( httpget , response , context ) )
shouldRaiseConstraintViolationValidatingNumberOfCDsPropertyValue ( ) { java . util . Set < org . agoncal . book . javaee7 . chapter03 . ex21 . ConstraintViolation < org . agoncal . book . javaee7 . chapter03 . ex21 . CD21 > > violations = org . agoncal . book . javaee7 . chapter03 . ex21 . CD21Test . validator . validateValue ( org . agoncal . book . javaee7 . chapter03 . ex21 . CD21 . class , "numberOfCDs" , 7 ) ; displayContraintViolations ( violations ) ; "<AssertPlaceHolder>" ; } displayContraintViolations ( java . util . Set ) { for ( org . agoncal . book . javaee7 . chapter03 . ex12 . ConstraintViolation constraintViolation : constraintViolations ) { System . out . println ( ( ( ( ( ( ( ( "###<sp>" + ( constraintViolation . getRootBeanClass ( ) . getSimpleName ( ) ) ) + "." ) + ( constraintViolation . getPropertyPath ( ) ) ) + "<sp>-<sp>Invalid<sp>Value<sp>=<sp>" ) + ( constraintViolation . getInvalidValue ( ) ) ) + "<sp>-<sp>Error<sp>Msg<sp>=<sp>" ) + ( constraintViolation . getMessage ( ) ) ) ) ; } }
org . junit . Assert . assertEquals ( 1 , violations . size ( ) )
testValidButOutOfPlaceChar ( ) { java . lang . String templates = "foo()<sp>::=<sp><<hi<sp><.><sp>mom>>\n" ; writeFile ( tmpdir , "t.stg" , templates ) ; org . stringtemplate . v4 . STErrorListener errors = new org . stringtemplate . v4 . misc . ErrorBuffer ( ) ; org . stringtemplate . v4 . STGroupFile group = new org . stringtemplate . v4 . STGroupFile ( ( ( ( tmpdir ) + "/" ) + "t.stg" ) ) ; group . setListener ( errors ) ; group . load ( ) ; java . lang . String expected = "t.stg<sp>1:15:<sp>doesn't<sp>look<sp>like<sp>an<sp>expression" + ( newline ) ; java . lang . String result = errors . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( getClass ( ) . getSimpleName ( ) ) + "{" ) + "self=" ) + ( scope . st ) ) + ",<sp>start=" ) + ( outputStartChar ) ) + ",<sp>stop=" ) + ( outputStopChar ) ) + '}' ; }
org . junit . Assert . assertEquals ( expected , result )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . document . library . opener . model . DLOpenerFileEntryReference > dlOpenerFileEntryReferences = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( dlOpenerFileEntryReferences . isEmpty ( ) )
validate_statusIsNotSet_returnsFalse ( ) { boolean result = confirmation . validate ( ) ; "<AssertPlaceHolder>" ; } validate ( ) { return true ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
restGetShouldParseResponseOnNullContent ( ) { org . apache . metron . stellar . dsl . functions . RestFunctions . RestGet restGet = new org . apache . metron . stellar . dsl . functions . RestFunctions . RestGet ( ) ; org . apache . metron . stellar . dsl . functions . RestConfig restConfig = new org . apache . metron . stellar . dsl . functions . RestConfig ( ) ; org . apache . http . client . methods . HttpGet httpGet = mock ( org . apache . http . client . methods . HttpGet . class ) ; org . apache . http . HttpEntity httpEntity = mock ( org . apache . http . HttpEntity . class ) ; when ( httpEntity . getContent ( ) ) . thenReturn ( null ) ; "<AssertPlaceHolder>" ; } parseResponse ( org . apache . metron . stellar . dsl . functions . RestConfig , org . apache . http . client . methods . HttpGet , org . apache . http . HttpEntity ) { java . util . Optional < java . lang . Object > parsedResponse = java . util . Optional . empty ( ) ; if ( httpEntity != null ) { int actualContentLength = 0 ; java . lang . String json = org . apache . http . util . EntityUtils . toString ( httpEntity ) ; if ( ( json != null ) && ( ! ( json . isEmpty ( ) ) ) ) { actualContentLength = json . length ( ) ; parsedResponse = java . util . Optional . of ( JSONUtils . INSTANCE . load ( json , JSONUtils . MAP_SUPPLIER ) ) ; } if ( ( restConfig . verifyContentLength ( ) ) && ( actualContentLength != ( httpEntity . getContentLength ( ) ) ) ) { throw new java . io . IOException ( java . lang . String . format ( ( "Stellar<sp>REST<sp>request<sp>to<sp>%s<sp>returned<sp>incorrect<sp>or<sp>missing<sp>content<sp>length.<sp>" + "Content<sp>length<sp>in<sp>the<sp>response<sp>was<sp>%d<sp>but<sp>the<sp>actual<sp>body<sp>content<sp>length<sp>was<sp>%d." ) , httpGet . getURI ( ) . toString ( ) , httpEntity . getContentLength ( ) , actualContentLength ) ) ; } } return parsedResponse ; }
org . junit . Assert . assertEquals ( java . util . Optional . empty ( ) , restGet . parseResponse ( restConfig , httpGet , httpEntity ) )
client_registration_sets_time_to_live ( ) { givenASimpleRegistration ( lifetime ) ; store . addRegistration ( registration ) ; "<AssertPlaceHolder>" ; } isAlive ( ) { return isAlive ( 0 ) ; }
org . junit . Assert . assertTrue ( registration . isAlive ( ) )
testTryLockAndRelockAndPass ( ) { instance . lock ( ) ; "<AssertPlaceHolder>" ; } tryLock ( ) { return lock . tryLock ( ) ; }
org . junit . Assert . assertTrue ( instance . tryLock ( ) )
shouldDecreaseMinesCountAfterForgotCharge ( ) { scores = new com . codenjoy . dojo . minesweeper . services . Scores ( 0 , parameters ) ; minesweeperDestroyMine ( ) ; minesweeperDestroyMine ( ) ; minesweeperForgetCharge ( ) ; minesweeperDestroyMine ( ) ; "<AssertPlaceHolder>" ; } getScore ( ) { return score ; }
org . junit . Assert . assertEquals ( 1 , scores . getScore ( ) )
serialize ( ) { com . google . gson . Gson gson = com . github . seratch . jslack . common . json . GsonFactory . createSnakeCase ( ) ; com . github . seratch . jslack . api . model . event . GroupLeftEvent event = new com . github . seratch . jslack . api . model . event . GroupLeftEvent ( ) ; java . lang . String generatedJson = gson . toJson ( event ) ; java . lang . String expectedJson = "{\"type\":\"group_left\"}" ; "<AssertPlaceHolder>" ; } createSnakeCase ( ) { return new com . google . gson . GsonBuilder ( ) . setFieldNamingPolicy ( FieldNamingPolicy . LOWER_CASE_WITH_UNDERSCORES ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . LayoutBlock . class , new com . github . seratch . jslack . common . json . GsonLayoutBlockFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . composition . TextObject . class , new com . github . seratch . jslack . common . json . GsonTextObjectFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . ContextBlockElement . class , new com . github . seratch . jslack . common . json . GsonContextBlockElementFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . element . BlockElement . class , new com . github . seratch . jslack . common . json . GsonBlockElementFactory ( ) ) . create ( ) ; }
org . junit . Assert . assertThat ( generatedJson , org . hamcrest . CoreMatchers . is ( expectedJson ) )
testUndefinedAsBytes ( ) { org . jboss . dmr . ModelNode testee = org . jboss . dmr . test . ModelNodeTest . testUndefinedConversion ( ModelNode :: asBytes ) ; "<AssertPlaceHolder>" ; } asBytesOrNull ( ) { return isDefined ( ) ? value . asBytes ( ) : null ; }
org . junit . Assert . assertNull ( testee . asBytesOrNull ( ) )
statechartNamingRegressionTest ( ) { org . yakindu . sct . model . sgraph . Statechart toTest = getNamingServiceStatechart ( ) ; java . util . List < java . lang . String > names = new java . util . ArrayList ( ) ; java . util . List < java . lang . String > expectedNames = new java . util . ArrayList ( java . util . Arrays . asList ( "mrgn_StA" , "mrgn_StteB" , "s_SA" , "t_SA" , "t_SA_AR_SA" , "t_SA_AR_StB" , "s_SA_AR_SA" , "s_SA_AR_StB" ) ) ; org . yakindu . sct . model . sexec . ExecutionFlow flow = optimizer . transform ( sequencer . transform ( toTest ) ) ; executionflowNamingService . setMaxLength ( 15 ) ; executionflowNamingService . setSeparator ( '_' ) ; executionflowNamingService . initializeNamingService ( flow ) ; for ( org . yakindu . sct . model . sexec . ExecutionState state : flow . getStates ( ) ) { java . lang . String name = executionflowNamingService . getShortName ( state ) ; "<AssertPlaceHolder>" ; names . add ( name ) ; } stringListsEqual ( expectedNames , names ) ; } contains ( java . lang . Object ) { if ( ( sourceFeatureIDs ) != null ) { for ( int i = 0 ; i < ( sourceFeatureIDs . length ) ; i ++ ) { int sourceFeatureID = sourceFeatureIDs [ i ] ; if ( owner . eIsSet ( sourceFeatureID ) ) { org . eclipse . emf . ecore . EStructuralFeature sourceFeature = getEStructuralFeature ( sourceFeatureID ) ; java . lang . Object value = owner . eGet ( sourceFeatureID , true , true ) ; if ( org . eclipse . emf . ecore . util . FeatureMapUtil . isFeatureMap ( sourceFeature ) ) { org . eclipse . emf . ecore . util . FeatureMap featureMap = ( ( org . eclipse . emf . ecore . util . FeatureMap ) ( value ) ) ; for ( int j = 0 , size = featureMap . size ( ) ; j < size ; j ++ ) { value = featureMap . getValue ( j ) ; if ( isIncluded ( featureMap . getEStructuralFeature ( j ) ) ? value == object : ( isIncluded ( value ) ) && ( ( derive ( value ) ) == object ) ) { return true ; } } } else if ( isIncluded ( sourceFeature ) ) { if ( sourceFeature . isMany ( ) ? ( ( java . util . List < ? > ) ( value ) ) . contains ( object ) : value == object ) { return true ; } } else { if ( sourceFeature . isMany ( ) ) { org . eclipse . emf . ecore . util . InternalEList < ? > valuesList = ( ( org . eclipse . emf . ecore . util . InternalEList < ? > ) ( value ) ) ; if ( valuesList instanceof java . util . RandomAccess ) { for ( int j = 0 , size = valuesList . size ( ) ; j < size ; j ++ ) { value = valuesList . basicGet ( j ) ; if ( ( isIncluded ( value ) ) && ( ( derive ( value ) ) == object ) ) { return true ; } } } else { for ( java . util . Iterator < ? > v = valuesList . basicIterator ( ) ; v . hasNext ( ) ; ) { value = v . next ( ) ; if ( ( isIncluded ( value ) ) && ( ( derive ( value ) ) == object ) ) { return true ; } } } } else if ( ( isIncluded ( value ) ) && ( ( derive ( value ) ) == object ) ) { return true ; } } } } } return false ; }
org . junit . Assert . assertEquals ( names . contains ( name ) , false )
testCopyFile ( ) { org . finra . herd . model . dto . S3FileCopyRequestParamsDto s3FileCopyRequestParamsDto = new org . finra . herd . model . dto . S3FileCopyRequestParamsDto ( ) ; org . finra . herd . model . dto . S3FileTransferResultsDto s3FileTransferResultsDto = new org . finra . herd . model . dto . S3FileTransferResultsDto ( ) ; when ( s3Dao . copyFile ( s3FileCopyRequestParamsDto ) ) . thenReturn ( s3FileTransferResultsDto ) ; org . finra . herd . model . dto . S3FileTransferResultsDto result = s3Service . copyFile ( s3FileCopyRequestParamsDto ) ; verify ( s3Dao ) . copyFile ( s3FileCopyRequestParamsDto ) ; verifyNoMoreInteractions ( s3Dao ) ; "<AssertPlaceHolder>" ; } copyFile ( org . finra . herd . model . dto . S3FileCopyRequestParamsDto ) { org . finra . herd . dao . impl . S3DaoImpl . LOGGER . info ( "Copying<sp>S3<sp>object...<sp>sourceS3Key=\"{}\"<sp>sourceS3BucketName=\"{}\"<sp>targetS3Key=\"{}\"<sp>targetS3BucketName=\"{}\"" , params . getSourceObjectKey ( ) , params . getSourceBucketName ( ) , params . getTargetObjectKey ( ) , params . getTargetBucketName ( ) ) ; org . finra . herd . model . dto . S3FileTransferResultsDto results = performTransfer ( params , new org . finra . herd . dao . impl . S3DaoImpl . Transferer ( ) { @ org . finra . herd . dao . impl . Override public com . amazonaws . services . s3 . transfer . Transfer performTransfer ( com . amazonaws . services . s3 . transfer . TransferManager transferManager ) { com . amazonaws . services . s3 . model . CopyObjectRequest copyObjectRequest = new com . amazonaws . services . s3 . model . CopyObjectRequest ( params . getSourceBucketName ( ) , params . getSourceObjectKey ( ) , params . getTargetBucketName ( ) , params . getTargetObjectKey ( ) ) ; if ( org . apache . commons . lang3 . StringUtils . isNotBlank ( params . getKmsKeyId ( ) ) ) { copyObjectRequest . withSSEAwsKeyManagementParams ( new com . amazonaws . services . s3 . model . SSEAwsKeyManagementParams ( params . getKmsKeyId ( ) ) ) ; } else { com . amazonaws . services . s3 . model . ObjectMetadata metadata = new com . amazonaws . services . s3 . model . ObjectMetadata ( ) ; metadata . setSSEAlgorithm ( ObjectMetadata . AES_256_SERVER_SIDE_ENCRYPTION ) ; copyObjectRequest . setNewObjectMetadata ( metadata ) ; } return s3Operations . copyFile ( copyObjectRequest , transferManager ) ; } } ) ; org . finra . herd . dao . impl . S3DaoImpl . LOGGER . info ( ( "Copied<sp>S3<sp>object.<sp>sourceS3Key=\"{}\"<sp>sourceS3BucketName=\"{}\"<sp>targetS3Key=\"{}\"<sp>targetS3BucketName=\"{}\"<sp>" + "totalBytesTransferred={}<sp>transferDuration=\"{}\"" ) , params . getSourceObjectKey ( ) , params . getSourceBucketName ( ) , params . getTargetObjectKey ( ) , params . getTargetBucketName ( ) , results . getTotalBytesTransferred ( ) , org . finra . herd . core . HerdDateUtils . formatDuration ( results . getDurationMillis ( ) ) ) ; logOverallTransferRate ( results ) ; return results ; }
org . junit . Assert . assertEquals ( s3FileTransferResultsDto , result )
equalsWhenIDsAndNamesAreEqual ( ) { com . fiveamsolutions . plc . jaas . UserPrincipal testUserPrincipal1 = createTestUserPrincipal ( com . fiveamsolutions . plc . jaas . UserPrincipalTest . TEST_ID , com . fiveamsolutions . plc . jaas . UserPrincipalTest . TEST_USERNAME ) ; com . fiveamsolutions . plc . jaas . UserPrincipal testUserPrincipal2 = createTestUserPrincipal ( com . fiveamsolutions . plc . jaas . UserPrincipalTest . TEST_ID , com . fiveamsolutions . plc . jaas . UserPrincipalTest . TEST_USERNAME ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( obj instanceof com . fiveamsolutions . plc . jaas . UserPrincipal ) ) { return false ; } if ( ( this ) == obj ) { return true ; } com . fiveamsolutions . plc . jaas . UserPrincipal rhs = ( ( com . fiveamsolutions . plc . jaas . UserPrincipal ) ( obj ) ) ; return new org . apache . commons . lang3 . builder . EqualsBuilder ( ) . appendSuper ( super . equals ( obj ) ) . append ( user . getId ( ) , rhs . user . getId ( ) ) . isEquals ( ) ; }
org . junit . Assert . assertTrue ( testUserPrincipal1 . equals ( testUserPrincipal2 ) )
shouldDecodeHexStringToByteArrayUsingDataTypeConverter ( ) { byte [ ] bytes = getSampleBytes ( ) ; java . lang . String hexString = getSampleHexString ( ) ; byte [ ] output = hexStringConverter . decodeUsingDataTypeConverter ( hexString ) ; "<AssertPlaceHolder>" ; } decodeUsingDataTypeConverter ( java . lang . String ) { return javax . xml . bind . DatatypeConverter . parseHexBinary ( hexString ) ; }
org . junit . Assert . assertArrayEquals ( bytes , output )
getFilterEntityIdWithNoTypeTest ( ) { com . orange . ngsi . model . EntityId entityIdRegisterOrSubscribe = new com . orange . ngsi . model . EntityId ( "B" , "" , false ) ; com . orange . ngsi . model . EntityId entityIdsearch = new com . orange . ngsi . model . EntityId ( "A|B" , "string" , true ) ; com . orange . cepheus . broker . Patterns patterns = new com . orange . cepheus . broker . Patterns ( ) ; java . util . function . Predicate < com . orange . ngsi . model . EntityId > entityIdPredicate = patterns . getFilterEntityId ( entityIdsearch ) ; "<AssertPlaceHolder>" ; } getFilterEntityId ( com . orange . ngsi . model . EntityId ) { final boolean searchType = hasType ( searchEntityId ) ; final java . util . regex . Pattern pattern = getPattern ( searchEntityId ) ; java . util . function . Predicate < com . orange . ngsi . model . EntityId > filterEntityId = ( entityId ) -> { if ( ! searchType ) { if ( hasType ( entityId ) ) { return false ; } } else if ( ! ( searchEntityId . getType ( ) . equals ( entityId . getType ( ) ) ) ) { return false ; } if ( pattern != null ) { if ( entityId . getIsPattern ( ) ) { return searchEntityId . getId ( ) . equals ( entityId . getId ( ) ) ; } return pattern . matcher ( entityId . getId ( ) ) . find ( ) ; } else { if ( entityId . getIsPattern ( ) ) { return getPattern ( entityId ) . matcher ( searchEntityId . getId ( ) ) . find ( ) ; } return searchEntityId . getId ( ) . equals ( entityId . getId ( ) ) ; } } ; return filterEntityId ; }
org . junit . Assert . assertFalse ( entityIdPredicate . test ( entityIdRegisterOrSubscribe ) )
test18 ( ) { long modulus = 17 ; cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 f = cc . redberry . rings . poly . univar . UnivariatePolynomialZ64 . create ( 7 , 12 , 12 , 12 , 13 , 2 , 7 , 10 , 7 , 15 , 13 , 1 , 10 , 16 , 6 , 1 ) . modulus ( modulus ) . reverse ( ) ; int modDegree = 9 ; cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 invmod = cc . redberry . rings . poly . univar . UnivariateDivisionTest . inverseModMonomial0 ( f , modDegree ) ; cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 r = cc . redberry . rings . poly . univar . UnivariateDivisionTest . polyMultiplyMod ( f , invmod , cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 . monomial ( modulus , 1 , modDegree ) , true ) ; "<AssertPlaceHolder>" ; } isOne ( ) { return ( ( ( mag . length ) == 1 ) && ( ( mag [ 0 ] ) == 1 ) ) && ( ( signum ) == 1 ) ; }
org . junit . Assert . assertTrue ( r . isOne ( ) )
abstractClass ( ) { java . lang . Object o = createMock ( java . util . AbstractList . class ) ; "<AssertPlaceHolder>" ; } createMock ( java . lang . Class ) { return org . easymock . EasyMock . mock ( toMock ) ; }
org . junit . Assert . assertTrue ( ( o instanceof java . util . AbstractList < ? > ) )
failMaxRetriesZero ( ) { java . util . concurrent . atomic . AtomicInteger counter = new java . util . concurrent . atomic . AtomicInteger ( ) ; java . util . function . Supplier < java . lang . Boolean > supplier = ( ) -> { if ( ( counter . incrementAndGet ( ) ) < 10 ) throw new ca . uhn . fhir . jpa . searchparam . retry . RetryRuntimeException ( "test" ) ; return true ; } ; myExpectedException . expect ( ca . uhn . fhir . jpa . searchparam . retry . IllegalArgumentException . class ) ; myExpectedException . expectMessage ( "maxRetries<sp>must<sp>be<sp>above<sp>zero." ) ; ca . uhn . fhir . jpa . searchparam . retry . Retrier < java . lang . Boolean > retrier = new ca . uhn . fhir . jpa . searchparam . retry . Retrier ( supplier , 0 ) ; "<AssertPlaceHolder>" ; } get ( ) { return myCapabilityStatement . get ( ) ; }
org . junit . Assert . assertEquals ( 0 , counter . get ( ) )
testNotSetListLabelInLoop ( ) { org . antlr . tool . Grammar g = new org . antlr . tool . Grammar ( ( "grammar<sp>P;\n" + "a<sp>:<sp>x+=~(A|B)+;\n" ) ) ; java . lang . String expecting = "(rule<sp>a<sp>ARG<sp>RET<sp>scope<sp>(BLOCK<sp>(ALT<sp>(+<sp>(BLOCK<sp>(ALT<sp>(+=<sp>x<sp>(~<sp>(BLOCK<sp>(ALT<sp>A<sp><end-of-alt>)<sp>(ALT<sp>B<sp><end-of-alt>)<sp><end-of-block>)))<sp><end-of-alt>)<sp><end-of-block>))<sp><end-of-alt>)<sp><end-of-block>)<sp><end-of-rule>)" ; java . lang . String found = g . getRule ( "a" ) . tree . toStringTree ( ) ; "<AssertPlaceHolder>" ; } toStringTree ( ) { if ( ( ( children ) == null ) || ( children . isEmpty ( ) ) ) { return this . toString ( ) ; } java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; if ( ! ( isNil ( ) ) ) { buf . append ( "(" ) ; buf . append ( this . toString ( ) ) ; buf . append ( '<sp>' ) ; } for ( int i = 0 ; ( ( children ) != null ) && ( i < ( children . size ( ) ) ) ; i ++ ) { org . antlr . runtime . tree . Tree t = ( ( org . antlr . runtime . tree . Tree ) ( children . get ( i ) ) ) ; if ( i > 0 ) { buf . append ( '<sp>' ) ; } buf . append ( t . toStringTree ( ) ) ; } if ( ! ( isNil ( ) ) ) { buf . append ( ")" ) ; } return buf . toString ( ) ; }
org . junit . Assert . assertEquals ( expecting , found )
testCreate ( ) { org . oscarehr . common . model . ScheduleTemplateCode entity = new org . oscarehr . common . model . ScheduleTemplateCode ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setCode ( 'A' ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
org . junit . Assert . assertNotNull ( entity . getId ( ) )
shouldUpdateUserTotalPost ( ) { final net . jforum . entities . Post post = this . newPost ( ) ; post . getUser ( ) . setTotalPosts ( 5 ) ; when ( repository . getTotalPosts ( post . getTopic ( ) ) ) . thenReturn ( 1 ) ; when ( userRepository . getTotalPosts ( post . getUser ( ) ) ) . thenReturn ( 2 ) ; when ( repository . getFirstPost ( any ( net . jforum . entities . Topic . class ) ) ) . thenReturn ( newPost ( ) ) ; event . deleted ( post ) ; "<AssertPlaceHolder>" ; } getUser ( ) { return this . user ; }
org . junit . Assert . assertEquals ( 2 , post . getUser ( ) . getTotalPosts ( ) )
testReturnTypeExceptionWithFalse ( ) { boolean expected = false ; boolean result = org . slieb . throwables . PredicateWithThrowable . castPredicateWithThrowable ( ( v1 ) -> { throw new java . lang . Exception ( "expect<sp>exception" ) ; } ) . thatReturnsOnCatch ( expected ) . test ( null ) ; "<AssertPlaceHolder>" ; } test ( long ) { try { return testWithThrowable ( v1 ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } }
org . junit . Assert . assertEquals ( expected , result )
groupByEach ( ) { org . eclipse . collections . api . set . ImmutableSet < java . lang . Integer > undertest = this . classUnderTest ( ) ; org . eclipse . collections . impl . block . function . NegativeIntervalFunction function = new org . eclipse . collections . impl . block . function . NegativeIntervalFunction ( ) ; org . eclipse . collections . api . multimap . set . ImmutableSetMultimap < java . lang . Integer , java . lang . Integer > actual = undertest . groupByEach ( function ) ; org . eclipse . collections . impl . multimap . set . UnifiedSetMultimap < java . lang . Integer , java . lang . Integer > expected = org . eclipse . collections . impl . set . mutable . UnifiedSet . newSet ( undertest ) . groupByEach ( function ) ; "<AssertPlaceHolder>" ; } groupByEach ( org . eclipse . collections . api . block . function . Function ) { return ( ( org . eclipse . collections . api . multimap . MutableMultimap < V , T > ) ( super . groupByEach ( function ) ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
deveObterDataHoraRecebimentoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . evento . inutilizacao . NFRetornoEventoInutilizacaoDados dados = new com . fincatto . documentofiscal . nfe310 . classes . evento . inutilizacao . NFRetornoEventoInutilizacaoDados ( ) ; final java . time . LocalDateTime datahoraRecebimento = java . time . LocalDateTime . parse ( "2010-10-10<sp>10:10:10" , java . time . format . DateTimeFormatter . ofPattern ( "yyyy-MM-dd<sp>HH:mm:ss" ) ) ; dados . setDatahoraRecebimento ( datahoraRecebimento ) ; "<AssertPlaceHolder>" ; } getDatahoraRecebimento ( ) { return this . datahoraRecebimento ; }
org . junit . Assert . assertEquals ( datahoraRecebimento , dados . getDatahoraRecebimento ( ) )
supportsUIRootNode ( ) { com . vaadin . flow . dom . impl . BasicElementStateProvider provider = com . vaadin . flow . dom . impl . BasicElementStateProvider . get ( ) ; com . vaadin . flow . component . UI ui = new com . vaadin . flow . component . UI ( ) { @ com . vaadin . flow . dom . Override protected void init ( com . vaadin . flow . server . VaadinRequest request ) { } } ; com . vaadin . flow . internal . StateNode rootNode = ui . getInternals ( ) . getStateTree ( ) . getRootNode ( ) ; "<AssertPlaceHolder>" ; } supports ( com . vaadin . flow . internal . StateNode ) { return node . hasFeature ( com . vaadin . flow . internal . nodefeature . TextNodeMap . class ) ; }
org . junit . Assert . assertTrue ( provider . supports ( rootNode ) )
should_return_empty_list_because_there_is_no_commiter_infos_in_rest_api ( ) { fr . norad . visuwall . api . domain . SoftwareProjectId softwareProjectId = new fr . norad . visuwall . api . domain . SoftwareProjectId ( "projectId" ) ; java . util . List < fr . norad . visuwall . api . domain . Commiter > buildCommiters = bambooConnection . getBuildCommiters ( softwareProjectId , "" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return false ; }
org . junit . Assert . assertTrue ( buildCommiters . isEmpty ( ) )
testGet ( ) { org . sagebionetworks . repo . model . Team participantTeam = createTeam ( participantId . toString ( ) ) ; createNodeAndChallenge ( participantTeam ) ; challenge = challengeDAO . create ( challenge ) ; org . sagebionetworks . repo . model . Challenge retrieved = challengeDAO . get ( java . lang . Long . parseLong ( challenge . getId ( ) ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( challenge , retrieved )
getAttributeAsIntList_should_allow_string_list ( ) { au . edu . wehi . idsv . IdsvVariantContextTest . TestIdsvVariantContext vc = new au . edu . wehi . idsv . IdsvVariantContextTest . TestIdsvVariantContext ( minimalVariant ( ) . attribute ( "intlist" , L ( "1" , "2" ) ) . make ( ) ) ; "<AssertPlaceHolder>" ; } getAttributeAsIntList ( java . lang . String ) { return au . edu . wehi . idsv . AttributeConverter . asIntList ( getAttribute ( attrName ) ) ; }
org . junit . Assert . assertEquals ( 2 , vc . getAttributeAsIntList ( "intlist" ) . size ( ) )
ringSmallest ( ) { org . openscience . cdk . isomorphism . matchers . Expr actual = org . openscience . cdk . smarts . SmartsExprReadTest . getAtomExpr ( "[r5]" ) ; org . openscience . cdk . isomorphism . matchers . Expr expected = org . openscience . cdk . smarts . SmartsExprReadTest . expr ( org . openscience . cdk . smarts . RING_SMALLEST , 5 ) ; "<AssertPlaceHolder>" ; } expr ( org . openscience . cdk . isomorphism . matchers . Expr$Type , int ) { return new org . openscience . cdk . isomorphism . matchers . Expr ( type , val ) ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( expected ) )
inPlaceRewrite ( ) { java . io . File f = org . apache . poi . util . TempFile . createTempFile ( "protected_agile" , ".docx" ) ; try ( java . io . FileOutputStream fos = new java . io . FileOutputStream ( f ) ; java . io . InputStream fis = org . apache . poi . POIDataSamples . getPOIFSInstance ( ) . openResourceAsStream ( "protected_agile.docx" ) ) { org . apache . poi . util . IOUtils . copy ( fis , fos ) ; } try ( org . apache . poi . poifs . filesystem . POIFSFileSystem fs = new org . apache . poi . poifs . filesystem . POIFSFileSystem ( f , false ) ) { org . apache . poi . poifs . crypt . EncryptionInfo encInfo = new org . apache . poi . poifs . crypt . EncryptionInfo ( fs ) ; org . apache . poi . poifs . crypt . Decryptor d = encInfo . getDecryptor ( ) ; boolean b = d . verifyPassword ( Decryptor . DEFAULT_PASSWORD ) ; "<AssertPlaceHolder>" ; try ( java . io . InputStream docIS = d . getDataStream ( fs ) ; org . apache . poi . xwpf . usermodel . XWPFDocument docx = new org . apache . poi . xwpf . usermodel . XWPFDocument ( docIS ) ) { org . apache . poi . xwpf . usermodel . XWPFParagraph p = docx . getParagraphArray ( 0 ) ; p . insertNewRun ( 0 ) . setText ( "POI<sp>was<sp>here!<sp>All<sp>your<sp>base<sp>are<sp>belong<sp>to<sp>us!" ) ; p . insertNewRun ( 1 ) . addBreak ( ) ; org . apache . poi . poifs . crypt . Encryptor e = encInfo . getEncryptor ( ) ; e . confirmPassword ( "AYBABTU" ) ; try ( java . io . OutputStream os = e . getDataStream ( fs ) ) { docx . write ( os ) ; } } } } verifyPassword ( java . lang . String ) { org . apache . poi . poifs . crypt . EncryptionVerifier ver = getEncryptionInfo ( ) . getVerifier ( ) ; javax . crypto . SecretKey skey = org . apache . poi . poifs . crypt . standard . StandardDecryptor . generateSecretKey ( password , ver , getKeySizeInBytes ( ) ) ; javax . crypto . Cipher cipher = getCipher ( skey ) ; try { byte [ ] encryptedVerifier = ver . getEncryptedVerifier ( ) ; byte [ ] verifier = cipher . doFinal ( encryptedVerifier ) ; setVerifier ( verifier ) ; java . security . MessageDigest sha1 = org . apache . poi . poifs . crypt . CryptoFunctions . getMessageDigest ( ver . getHashAlgorithm ( ) ) ; byte [ ] calcVerifierHash = sha1 . digest ( verifier ) ; byte [ ] encryptedVerifierHash = ver . getEncryptedVerifierHash ( ) ; byte [ ] decryptedVerifierHash = cipher . doFinal ( encryptedVerifierHash ) ; byte [ ] verifierHash = java . util . Arrays . copyOf ( decryptedVerifierHash , calcVerifierHash . length ) ; if ( java . util . Arrays . equals ( calcVerifierHash , verifierHash ) ) { setSecretKey ( skey ) ; return true ; } else { return false ; } } catch ( java . security . GeneralSecurityException e ) { throw new org . apache . poi . EncryptedDocumentException ( e ) ; } }
org . junit . Assert . assertTrue ( b )
testGetAsObjectThreeByteSpaceMiddle ( ) { java . lang . String in = "one" + ( " " + "two" ) ; java . lang . String out = ( ( java . lang . String ) ( converter . getAsObject ( context , component , in ) ) ) ; "<AssertPlaceHolder>" ; } getAsObject ( javax . faces . context . FacesContext , javax . faces . component . UIComponent , java . lang . String ) { org . oscm . internal . vo . VOPaymentInfo retVal = null ; for ( org . oscm . internal . vo . VOPaymentInfo vopsp : accountingService . getPaymentInfos ( ) ) { if ( java . lang . Long . valueOf ( vopsp . getKey ( ) ) . toString ( ) . equals ( value ) ) { retVal = vopsp ; } } return retVal ; }
org . junit . Assert . assertEquals ( ( "one" + ( " " + "two" ) ) , out )
isInvalid ( ) { javax . validation . Validator validator = javax . validation . Validation . buildDefaultValidatorFactory ( ) . getValidator ( ) ; org . greenbuttonalliance . espi . common . domain . ApplicationInformation applicationInformation = new org . greenbuttonalliance . espi . common . domain . ApplicationInformation ( ) ; java . util . Set < javax . validation . ConstraintViolation < org . greenbuttonalliance . espi . common . domain . ApplicationInformation > > violations = validator . validate ( applicationInformation ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return new org . greenbuttonalliance . espi . common . test . IsEmpty ( ) ; }
org . junit . Assert . assertFalse ( violations . isEmpty ( ) )
testClientInactivity ( ) { long maxInactivityPeriod = 4000 ; bayeux . addExtension ( new org . cometd . server . ext . ActivityExtension ( ActivityExtension . Activity . CLIENT , maxInactivityPeriod ) ) ; scheduler . scheduleWithFixedDelay ( ( ) -> org . cometd . client . ext . bayeux . getChannel ( channelName ) . publish ( null , "test" , org . cometd . bayeux . Promise . noop ( ) ) , 0 , ( ( timeout ) / 4 ) , TimeUnit . MILLISECONDS ) ; final org . cometd . client . BayeuxClient client = newBayeuxClient ( ) ; client . getChannel ( Channel . META_HANDSHAKE ) . addListener ( ( ( org . cometd . bayeux . client . ClientSessionChannel . MessageListener ) ( ( channel , message ) -> { if ( message . isSuccessful ( ) ) { client . getChannel ( channelName ) . subscribe ( ( c , m ) -> { } ) ; } } ) ) ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 2 ) ; client . getChannel ( Channel . META_CONNECT ) . addListener ( ( ( org . cometd . bayeux . client . ClientSessionChannel . MessageListener ) ( ( channel , message ) -> { Map < java . lang . String , java . lang . Object > advice = message . getAdvice ( ) ; if ( ( advice != null ) && ( Message . RECONNECT_NONE_VALUE . equals ( advice . get ( Message . RECONNECT_FIELD ) ) ) ) { latch . countDown ( ) ; } } ) ) ) ; client . getChannel ( Channel . META_DISCONNECT ) . addListener ( ( ( org . cometd . bayeux . client . ClientSessionChannel . MessageListener ) ( ( channel , message ) -> latch . countDown ( ) ) ) ) ; client . handshake ( ) ; "<AssertPlaceHolder>" ; } await ( long , java . util . concurrent . TimeUnit ) { return latch . await ( time , unit ) ; }
org . junit . Assert . assertTrue ( latch . await ( ( 2 * maxInactivityPeriod ) , TimeUnit . MILLISECONDS ) )
test_operatorFusionStartIndices_with_scheduleWhenAtLeastOneButSameNumberOfTuplesAvailableWithMultiplePorts ( ) { final cs . bilkent . joker . operator . scheduling . SchedulingStrategy [ ] schedulingStrategies = new cs . bilkent . joker . operator . scheduling . SchedulingStrategy [ ] { scheduleWhenTuplesAvailableOnDefaultPort ( 1 ) , scheduleWhenTuplesAvailableOnAll ( cs . bilkent . joker . engine . region . impl . AT_LEAST_BUT_SAME_ON_ALL_PORTS , 2 , 1 , 0 , 1 ) , scheduleWhenTuplesAvailableOnDefaultPort ( 1 ) } ; "<AssertPlaceHolder>" ; } findFusionStartIndices ( cs . bilkent . joker . operator . scheduling . SchedulingStrategy [ ] ) { final int [ ] indices = new int [ operatorSchedulingStrategies . length ] ; indices [ 0 ] = 0 ; int j = 1 ; for ( int i = 1 ; i < ( operatorSchedulingStrategies . length ) ; i ++ ) { if ( ! ( cs . bilkent . joker . engine . region . Region . isFusible ( operatorSchedulingStrategies [ i ] ) ) ) { indices [ ( j ++ ) ] = i ; } } return copyOf ( indices , j ) ; }
org . junit . Assert . assertArrayEquals ( new int [ ] { 0 , 1 } , cs . bilkent . joker . engine . region . Region . findFusionStartIndices ( schedulingStrategies ) )
testReturnGenericPair ( ) { org . apache . cxf . aegis . databinding . AegisDatabinding aegisBinding = new org . apache . cxf . aegis . databinding . AegisDatabinding ( ) ; org . apache . cxf . jaxws . JaxWsProxyFactoryBean proxyFactory = new org . apache . cxf . jaxws . JaxWsProxyFactoryBean ( ) ; proxyFactory . setDataBinding ( aegisBinding ) ; proxyFactory . setServiceClass ( org . apache . cxf . systest . aegis . SportsService . class ) ; proxyFactory . setAddress ( ( ( "http://localhost:" + ( org . apache . cxf . systest . aegis . AegisClientServerTest . PORT ) ) + "/jaxwsAndAegisSports" ) ) ; proxyFactory . getInInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingInInterceptor ( ) ) ; proxyFactory . getOutInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingOutInterceptor ( ) ) ; org . apache . cxf . systest . aegis . SportsService service = ( ( org . apache . cxf . systest . aegis . SportsService ) ( proxyFactory . create ( ) ) ) ; int ret = service . getGenericPair ( new org . apache . cxf . systest . aegis . SportsService . Pair < java . lang . Integer , java . lang . String > ( 111 , "String" ) ) ; "<AssertPlaceHolder>" ; } create ( ) { org . oasis_open . docs . wsn . b_2 . CreatePullPoint request = new org . oasis_open . docs . wsn . b_2 . CreatePullPoint ( ) ; org . oasis_open . docs . wsn . b_2 . CreatePullPointResponse response = createPullPoint . createPullPoint ( request ) ; return new org . apache . cxf . wsn . client . PullPoint ( response . getPullPoint ( ) ) ; }
org . junit . Assert . assertEquals ( 111 , ret )
testName ( ) { org . apache . ivy . plugins . resolver . ChainResolver chain = new org . apache . ivy . plugins . resolver . ChainResolver ( ) ; chain . setSettings ( settings ) ; chain . setName ( "chain" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( "chain" , chain . getName ( ) )
testEntryListenerNotifiedOfCreationUpdateAndDeletion ( ) { java . lang . Object value = new java . lang . Object ( ) ; java . lang . Object value2 = new java . lang . Object ( ) ; testSubject . put ( "test1" , value ) ; verify ( mockListener ) . onEntryCreated ( "test1" , value ) ; testSubject . put ( "test1" , value2 ) ; verify ( mockListener ) . onEntryUpdated ( "test1" , value2 ) ; testSubject . get ( "test1" ) ; verify ( mockListener ) . onEntryRead ( "test1" , value2 ) ; testSubject . remove ( "test1" ) ; verify ( mockListener ) . onEntryRemoved ( "test1" ) ; "<AssertPlaceHolder>" ; verifyNoMoreInteractions ( mockListener ) ; } get ( java . lang . Object ) { return values . get ( key ) ; }
org . junit . Assert . assertNull ( testSubject . get ( "test1" ) )
testConstructor_noThroughputProbe ( ) { com . hazelcast . simulator . probes . Probe tmpProbe = new com . hazelcast . simulator . probes . impl . HdrProbe ( false ) ; "<AssertPlaceHolder>" ; } isPartOfTotalThroughput ( ) { return partOfTotalThroughput ; }
org . junit . Assert . assertFalse ( tmpProbe . isPartOfTotalThroughput ( ) )
whenTaskIdDoesNotExistItReturnsEmptyList ( ) { com . fasterxml . jackson . databind . JsonNode list = queryTaskLogEntries ( "?taskId=FOOBAR_4242" ) ; "<AssertPlaceHolder>" ; } size ( ) { return acquiredJobs . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , list . size ( ) )
schemeWithMultipleTargetsBuildsInCorrectOrder ( ) { ImmutableMap . Builder < com . facebook . buck . apple . xcode . xcodeproj . PBXTarget , java . nio . file . Path > targetToProjectPathMapBuilder = com . google . common . collect . ImmutableMap . builder ( ) ; com . facebook . buck . apple . xcode . xcodeproj . PBXTarget rootTarget = new com . facebook . buck . apple . xcode . xcodeproj . PBXNativeTarget ( "left.a" 4 ) ; rootTarget . setGlobalID ( "rootGID" ) ; rootTarget . setProductReference ( new com . facebook . buck . apple . xcode . xcodeproj . PBXFileReference ( "left.a" 5 , "left.a" 5 , PBXReference . SourceTree . BUILT_PRODUCTS_DIR , java . util . Optional . empty ( ) ) ) ; rootTarget . setProductType ( ProductTypes . STATIC_LIBRARY ) ; com . facebook . buck . apple . xcode . xcodeproj . PBXTarget leftTarget = new com . facebook . buck . apple . xcode . xcodeproj . PBXNativeTarget ( "left.a" 2 ) ; leftTarget . setGlobalID ( "left.a" 0 ) ; leftTarget . setProductReference ( new com . facebook . buck . apple . xcode . xcodeproj . PBXFileReference ( "left.a" , "left.a" , PBXReference . SourceTree . BUILT_PRODUCTS_DIR , java . util . Optional . empty ( ) ) ) ; leftTarget . setProductType ( ProductTypes . STATIC_LIBRARY ) ; com . facebook . buck . apple . xcode . xcodeproj . PBXTarget rightTarget = new com . facebook . buck . apple . xcode . xcodeproj . PBXNativeTarget ( "rightRule" ) ; rightTarget . setGlobalID ( "rightGID" ) ; rightTarget . setProductReference ( new com . facebook . buck . apple . xcode . xcodeproj . PBXFileReference ( "right.a" , "right.a" , PBXReference . SourceTree . BUILT_PRODUCTS_DIR , java . util . Optional . empty ( ) ) ) ; rightTarget . setProductType ( ProductTypes . STATIC_LIBRARY ) ; com . facebook . buck . apple . xcode . xcodeproj . PBXTarget childTarget = new com . facebook . buck . apple . xcode . xcodeproj . PBXNativeTarget ( "left.a" 1 ) ; childTarget . setGlobalID ( "childGID" ) ; childTarget . setProductReference ( new com . facebook . buck . apple . xcode . xcodeproj . PBXFileReference ( "child.a" , "child.a" , PBXReference . SourceTree . BUILT_PRODUCTS_DIR , java . util . Optional . empty ( ) ) ) ; childTarget . setProductType ( ProductTypes . STATIC_LIBRARY ) ; java . nio . file . Path pbxprojectPath = java . nio . file . Paths . get ( "foo/Foo.xcodeproj/project.pbxproj" ) ; targetToProjectPathMapBuilder . put ( rootTarget , pbxprojectPath ) ; targetToProjectPathMapBuilder . put ( leftTarget , pbxprojectPath ) ; targetToProjectPathMapBuilder . put ( rightTarget , pbxprojectPath ) ; targetToProjectPathMapBuilder . put ( childTarget , pbxprojectPath ) ; com . facebook . buck . features . apple . project . SchemeGenerator schemeGenerator = new com . facebook . buck . features . apple . project . SchemeGenerator ( projectFilesystem , java . util . Optional . of ( childTarget ) , com . google . common . collect . ImmutableSet . of ( rootTarget , leftTarget , rightTarget , childTarget ) , com . google . common . collect . ImmutableSet . of ( ) , com . google . common . collect . ImmutableSet . of ( ) , "left.a" 3 , java . nio . file . Paths . get ( "_gen/Foo.xcworkspace/scshareddata/xcshemes" ) , false , java . util . Optional . empty ( ) , java . util . Optional . empty ( ) , java . util . Optional . empty ( ) , SchemeActionType . DEFAULT_CONFIG_NAMES , targetToProjectPathMapBuilder . build ( ) , java . util . Optional . empty ( ) , java . util . Optional . empty ( ) , XCScheme . LaunchAction . LaunchStyle . AUTO , java . util . Optional . empty ( ) , java . util . Optional . empty ( ) ) ; java . nio . file . Path schemePath = schemeGenerator . writeScheme ( ) ; java . lang . String schemeXml = projectFilesystem . readFileIfItExists ( schemePath ) . get ( ) ; System . out . println ( schemeXml ) ; javax . xml . parsers . DocumentBuilderFactory dbFactory = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) ; javax . xml . parsers . DocumentBuilder dBuilder = dbFactory . newDocumentBuilder ( ) ; org . w3c . dom . Document scheme = dBuilder . parse ( projectFilesystem . newFileInputStream ( schemePath ) ) ; javax . xml . xpath . XPathFactory xpathFactory = javax . xml . xpath . XPathFactory . newInstance ( ) ; javax . xml . xpath . XPath xpath = xpathFactory . newXPath ( ) ; javax . xml . xpath . XPathExpression expr = xpath . compile ( "//BuildAction//BuildableReference/@BlueprintIdentifier" ) ; org . w3c . dom . NodeList nodes = ( ( org . w3c . dom . NodeList ) ( expr . evaluate ( scheme , XPathConstants . NODESET ) ) ) ; java . util . List < java . lang . String > expectedOrdering = com . google . common . collect . ImmutableList . of ( "rootGID" , "left.a" 0 , "rightGID" , "childGID" ) ; java . util . List < java . lang . String > actualOrdering = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < ( nodes . getLength ( ) ) ; i ++ ) { actualOrdering . add ( nodes . item ( i ) . getNodeValue ( ) ) ; } "<AssertPlaceHolder>" ; } equalTo ( com . facebook . buck . query . QueryEnvironment$Argument ) { return ( ( ( type . equals ( other . type ) ) && ( ( integer ) == ( other . integer ) ) ) && ( java . util . Objects .
org . junit . Assert . assertThat ( actualOrdering , org . hamcrest . Matchers . equalTo ( expectedOrdering ) )
testTrunc ( ) { sql = "SELECT<sp>TRUNC(TO_DATE('2006-10-13','YYYY-MM-DD'),'Q')<sp>FROM<sp>DUAL" ; sqe = "SELECT<sp>TRUNC(TO_TIMESTAMP('2006-10-13','YYYY-MM-DD'),'Q')" ; convertResult = convert . convert ( sql ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { return getMap ( ) . get ( key ) ; }
org . junit . Assert . assertEquals ( sqe , convertResult . get ( 0 ) )
getContentTypeShouldReturnNullWhenNoContentTypeIsFoundInParamConfigMetas ( ) { java . util . Map < java . lang . String , java . lang . Object > metaDatas = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; org . codegist . crest . config . ParamConfig paramConfig = mock ( org . codegist . crest . config . ParamConfig . class ) ; when ( paramConfig . getMetaDatas ( ) ) . thenReturn ( metaDatas ) ; "<AssertPlaceHolder>" ; } getContentType ( org . codegist . crest . config . ParamConfig ) { return ( ( java . lang . String ) ( paramConfig . getMetaDatas ( ) . get ( org . codegist . crest . util . MultiParts . CONTENT_TYPE ) ) ) ; }
org . junit . Assert . assertNull ( org . codegist . crest . util . MultiParts . getContentType ( paramConfig ) )
testGetSortedEnergy ( ) { org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer target = sp . parseSmiles ( "C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C" ) ; org . openscience . cdk . interfaces . IAtomContainer queryac = sp . parseSmiles ( "Nc1ccccc1" ) ; org . openscience . cdk . smsd . Isomorphism smsd1 = new org . openscience . cdk . smsd . Isomorphism ( org . openscience . cdk . smsd . interfaces . Algorithm . DEFAULT , true ) ; smsd1 . init ( queryac , target , true , true ) ; smsd1 . setChemFilters ( false , false , true ) ; java . lang . Double score = 610.0 ; "<AssertPlaceHolder>" ; } getEnergyScore ( int ) { return ( ( bEnergies ) != null ) && ( ! ( bEnergies . isEmpty ( ) ) ) ? bEnergies . get ( key ) : null ; }
org . junit . Assert . assertEquals ( score , smsd1 . getEnergyScore ( 0 ) )
serviceRegistryOnBus ( ) { java . util . Map < java . lang . String , java . lang . String > m = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; m . put ( "sts.namespace" , "test" ) ; m . put ( "sts.service.name" , "test" ) ; m . put ( "sts.endpoint.name" , "test" ) ; org . talend . esb . security . saml . STSClientUtils u = new org . talend . esb . security . saml . STSClientUtils ( m ) ; org . talend . esb . job . controller . internal . RuntimeESBEndpointRegistry registry = new org . talend . esb . job . controller . internal . RuntimeESBEndpointRegistry ( ) ; java . util . Map < java . lang . String , java . lang . Object > ep = getDefaultEndpointProperties ( ) ; ep . put ( ESBEndpointConstants . USE_SERVICE_REGISTRY , true ) ; routines . system . api . ESBEndpointInfo i = getMockEndpointInfo ( ep ) ; registry . setBus ( createNiceMock ( org . apache . cxf . Bus . class ) ) ; registry . setClientProperties ( new java . util . HashMap < java . lang . String , java . lang . String > ( ) ) ; "<AssertPlaceHolder>" ; } createConsumer ( routines . system . api . ESBEndpointInfo ) { System . out . println ( ( "ESB<sp>[consumer]:<sp>Creating<sp>a<sp>consumer<sp>to<sp>communicate<sp>with<sp>service<sp>" + ( endpoint . getEndpointProperties ( ) . get ( "wsdlURL" ) ) ) ) ; System . out . println ( ( "ESB<sp>[consumer]:<sp>consumer<sp>endpoint<sp>info<sp>-<sp>key<sp>=<sp>" + ( endpoint . getEndpointKey ( ) ) ) ) ; System . out . println ( ( "ESB<sp>[consumer]:<sp>consumer<sp>endpoint<sp>info<sp>-<sp>uri<sp>=<sp>" + ( endpoint . getEndpointUri ( ) ) ) ) ; System . out . println ( ( "ESB<sp>[consumer]:<sp>consumer<sp>endpoint<sp>info<sp>-<sp>properties<sp>=<sp>" + ( endpoint . getEndpointProperties ( ) ) ) ) ; return new routines . system . api . ESBConsumer ( ) { public java . lang . Object invoke ( java . lang . Object payload ) throws org . talend . esb . job . api . test . Exception { System . out . println ( ( "ESB<sp>[consumer]:<sp>Job<sp>sent<sp>message<sp>to<sp>" + ( endpoint . getEndpointProperties ( ) . get ( "wsdlURL" ) ) ) ) ; try { java . lang . Thread . sleep ( 1000 ) ; } catch ( java . lang . InterruptedException e ) { } return getDocument ( "<GetWeatherResponse<sp>xmlns='http://litwinconsulting.com/webservices/'><GetWeatherResult>Sunny</GetWeatherResult></GetWeatherResponse>" ) ; } } ; }
org . junit . Assert . assertNotNull ( registry . createConsumer ( i ) )
testGetMimeTypeForEmptyFileExtension ( ) { ddf . mime . custom . CustomMimeTypeResolver resolver = new ddf . mime . custom . CustomMimeTypeResolver ( ) ; resolver . setCustomMimeTypes ( new java . lang . String [ ] { "nitf=image/nitf" , "ntf=image/nitf" } ) ; java . lang . String mimeType = resolver . getMimeTypeForFileExtension ( "" ) ; "<AssertPlaceHolder>" ; } getMimeTypeForFileExtension ( java . lang . String ) { ddf . mime . tika . TikaMimeTypeResolver . LOGGER . trace ( "ENTERING:<sp>getMimeTypeForFileExtension()" ) ; java . lang . String mimeType = null ; if ( org . apache . commons . lang . StringUtils . isNotEmpty ( fileExtension ) ) { try { java . lang . String filename = "dummy." + fileExtension ; mimeType = tika . detect ( filename ) ; } catch ( java . lang . Exception e ) { ddf . mime . tika . TikaMimeTypeResolver . LOGGER . debug ( "Exception<sp>caught<sp>getting<sp>mime<sp>type<sp>for<sp>file<sp>extension<sp>{}" , fileExtension , e ) ; } } ddf . mime . tika . TikaMimeTypeResolver . LOGGER . debug ( "mimeType<sp>=<sp>{},<sp>file<sp>extension<sp>=<sp>[{}]" , mimeType , fileExtension ) ; ddf . mime . tika . TikaMimeTypeResolver . LOGGER . trace ( "EXITING:<sp>getMimeTypeForFileExtension()" ) ; return mimeType ; }
org . junit . Assert . assertEquals ( null , mimeType )
testCreateRecursiveWithNonExistingDir ( ) { org . apache . hadoop . fs . Path f = getTestRootPath ( org . apache . hadoop . fs . FileContextCreateMkdirBaseTest . fc , "NonExisting/foo" ) ; createFile ( org . apache . hadoop . fs . FileContextCreateMkdirBaseTest . fc , f ) ; "<AssertPlaceHolder>" ; } isFile ( org . apache . hadoop . fs . FileContext , org . apache . hadoop . fs . Path ) { try { return fc . getFileStatus ( p ) . isFile ( ) ; } catch ( java . io . FileNotFoundException e ) { return false ; } }
org . junit . Assert . assertTrue ( isFile ( org . apache . hadoop . fs . FileContextCreateMkdirBaseTest . fc , f ) )
testMissedMatch ( ) { msg . addField ( "something" , "nonono" ) ; org . graylog2 . streams . matchers . StreamRuleMatcher matcher = getMatcher ( rule ) ; "<AssertPlaceHolder>" ; } match ( org . graylog2 . plugin . Message , org . graylog2 . plugin . streams . StreamRule ) { java . lang . Double msgVal = getDouble ( msg . getField ( rule . getField ( ) ) ) ; if ( msgVal == null ) { return false ; } java . lang . Double ruleVal = getDouble ( rule . getValue ( ) ) ; if ( ruleVal == null ) { return false ; } return ( rule . getInverted ( ) ) ^ ( msgVal > ruleVal ) ; }
org . junit . Assert . assertFalse ( matcher . match ( msg , rule ) )
testAvailableClass ( ) { org . openscience . cdk . qsar . DescriptorEngine engine = new org . openscience . cdk . qsar . DescriptorEngine ( org . openscience . cdk . qsar . IMolecularDescriptor . class , org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; java . lang . String [ ] availClasses = engine . getAvailableDictionaryClasses ( ) ; "<AssertPlaceHolder>" ; } getAvailableDictionaryClasses ( ) { java . util . List < java . lang . String > classList = new java . util . ArrayList < java . lang . String > ( ) ; for ( org . openscience . cdk . IImplementationSpecification spec : speclist ) { java . lang . String [ ] tmp = getDictionaryClass ( spec ) ; if ( tmp != null ) classList . addAll ( java . util . Arrays . asList ( tmp ) ) ; } java . util . Set < java . lang . String > uniqueClasses = new java . util . HashSet < java . lang . String > ( classList ) ; return ( ( java . lang . String [ ] ) ( uniqueClasses . toArray ( new java . lang . String [ ] { } ) ) ) ; }
org . junit . Assert . assertEquals ( 5 , availClasses . length )
testAddGroupAnd ( ) { builder . addGroup ( "id" , org . oscm . ui . menu . ALWAYS , org . oscm . ui . menu . NEVER ) ; final org . oscm . ui . menu . MenuGroup g = builder . getGroups ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } isVisible ( ) { return ( visibility . eval ( ) ) && ( ! ( uiStatus . isHidden ( id ) ) ) ; }
org . junit . Assert . assertFalse ( g . isVisible ( ) )
shouldNotBeSetOnEmptyByList ( ) { final java . util . List < java . lang . Object > value = new java . util . ArrayList ( ) ; "<AssertPlaceHolder>" ; } isSet ( java . lang . String ) { return ( value != null ) && ( ! ( value . isEmpty ( ) ) ) ; }
org . junit . Assert . assertThat ( isSet ( value ) , org . hamcrest . CoreMatchers . is ( false ) )
write_GeoJp2 ( ) { if ( ! ( isJp2KakDriverAvailable ) ) return ; it . geosolutions . imageio . plugins . jp2kakadu . JP2KWriteTest . LOGGER . info ( "Testing<sp>JP2<sp>Write<sp>operation<sp>with<sp>GeoJp2<sp>option<sp>setting" ) ; final java . io . File inputFile = it . geosolutions . resources . TestData . file ( this , "bogota.jp2" ) ; "<AssertPlaceHolder>" ; final java . io . File outputFile1 = it . geosolutions . resources . TestData . temp ( this , "GeoJp2-.jp2" , it . geosolutions . imageio . plugins . jp2kakadu . JP2KWriteTest . deleteTempFilesOnExit ) ; final java . io . File outputFile2 = it . geosolutions . resources . TestData . temp ( this , "NO-GeoJp2-.jp2" , it . geosolutions . imageio . plugins . jp2kakadu . JP2KWriteTest . deleteTempFilesOnExit ) ; final javax . media . jai . ParameterBlockJAI pbjImageRead = new javax . media . jai . ParameterBlockJAI ( "YES" 2 ) ; pbjImageRead . setParameter ( "Input" , inputFile ) ; if ( it . geosolutions . imageio . plugins . jp2kakadu . JP2KWriteTest . ENABLE_SUBSAMPLING ) { javax . imageio . ImageReadParam readParam = new javax . imageio . ImageReadParam ( ) ; readParam . setSourceSubsampling ( 4 , 4 , 0 , 0 ) ; pbjImageRead . setParameter ( "readParam" , readParam ) ; } pbjImageRead . setParameter ( "Reader" , new it . geosolutions . imageio . plugins . jp2kakadu . JP2GDALKakaduImageReaderSpi ( ) . createReaderInstance ( ) ) ; javax . media . jai . RenderedOp image = javax . media . jai . JAI . create ( "YES" 2 , pbjImageRead ) ; final javax . media . jai . ParameterBlockJAI pbjImageWrite = new javax . media . jai . ParameterBlockJAI ( "ImageWrite" ) ; pbjImageWrite . setParameter ( "Output" , new it . geosolutions . imageio . stream . output . FileImageOutputStreamExtImpl ( outputFile1 ) ) ; javax . imageio . ImageWriter writer = new it . geosolutions . imageio . plugins . jp2kakadu . JP2GDALKakaduImageWriterSpi ( ) . createWriterInstance ( ) ; pbjImageWrite . setParameter ( "YES" 0 , writer ) ; pbjImageWrite . addSource ( image ) ; javax . imageio . ImageWriteParam param = writer . getDefaultWriteParam ( ) ; ( ( it . geosolutions . imageio . plugins . jp2kakadu . JP2GDALKakaduImageWriteParam ) ( param ) ) . setGeoJp2 ( "YES" ) ; pbjImageWrite . setParameter ( "YES" 1 , param ) ; final javax . media . jai . RenderedOp op = javax . media . jai . JAI . create ( "ImageWrite" , pbjImageWrite ) ; final javax . media . jai . ParameterBlockJAI pbjImageWrite2 = new javax . media . jai . ParameterBlockJAI ( "ImageWrite" ) ; pbjImageWrite2 . setParameter ( "Output" , new it . geosolutions . imageio . stream . output . FileImageOutputStreamExtImpl ( outputFile2 ) ) ; javax . imageio . ImageWriter writer2 = new it . geosolutions . imageio . plugins . jp2kakadu . JP2GDALKakaduImageWriterSpi ( ) . createWriterInstance ( ) ; pbjImageWrite2 . setParameter ( "YES" 0 , writer2 ) ; pbjImageWrite2 . addSource ( image ) ; javax . imageio . ImageWriteParam param2 = writer2 . getDefaultWriteParam ( ) ; ( ( it . geosolutions . imageio . plugins . jp2kakadu . JP2GDALKakaduImageWriteParam ) ( param2 ) ) . setGeoJp2 ( "YES" 3 ) ; pbjImageWrite2 . setParameter ( "YES" 1 , param2 ) ; final javax . media . jai . RenderedOp op2 = javax . media . jai . JAI . create ( "ImageWrite" , pbjImageWrite2 ) ; } file ( java . lang . Object , java . lang . String ) { final java . net . URL url = it . geosolutions . resources . TestData . url ( caller , path ) ; final java . io . File file = it . geosolutions . imageio . utilities . Utilities . urlToFile ( url ) ; if ( ! ( file . exists ( ) ) ) { throw new java . io . FileNotFoundException ( ( "Could<sp>not<sp>locate<sp>test-data:<sp>" + path ) ) ; } return file ; }
org . junit . Assert . assertTrue ( inputFile . exists ( ) )
validatePersonName_shouldNotValidateAgainstRegexForBlankNames ( ) { personName . setGivenName ( "given" ) ; personName . setFamilyName ( "family" ) ; personName . setMiddleName ( "" ) ; personName . setFamilyName2 ( "" ) ; validator . validatePersonName ( personName , errors , false , true ) ; "<AssertPlaceHolder>" ; } hasErrors ( ) { return erroneous ; }
org . junit . Assert . assertFalse ( errors . hasErrors ( ) )
testGetValueExcludeStartIncludeEnd ( ) { when ( view . getIncludeStartValue ( ) ) . thenReturn ( false ) ; when ( view . getStartValue ( ) ) . thenReturn ( "1" ) ; when ( view . getEndValue ( ) ) . thenReturn ( "6" ) ; when ( view . getIncludeEndValue ( ) ) . thenReturn ( true ) ; final java . lang . String expected = "(1..6]" ; final java . lang . String actual = constraintRange . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return rootPath ; }
org . junit . Assert . assertEquals ( expected , actual )
testModifyEntryWithAncestorCoreAPIWithManageDsaIt ( ) { org . apache . directory . server . core . api . CoreSession session = getService ( ) . getAdminSession ( ) ; try { org . apache . directory . api . ldap . model . entry . Attribute attr = new org . apache . directory . api . ldap . model . entry . DefaultAttribute ( "Description" , "this<sp>is<sp>a<sp>test" ) ; org . apache . directory . api . ldap . model . entry . Modification mod = new org . apache . directory . api . ldap . model . entry . DefaultModification ( org . apache . directory . api . ldap . model . entry . ModificationOperation . ADD_ATTRIBUTE , attr ) ; java . util . List < org . apache . directory . api . ldap . model . entry . Modification > mods = new java . util . ArrayList < org . apache . directory . api . ldap . model . entry . Modification > ( ) ; mods . add ( mod ) ; session . modify ( new org . apache . directory . api . ldap . model . name . Dn ( "cn=Emmanuel<sp>Lecharny,ou=Roles,c=MNN,o=WW,ou=system" ) , mods , true ) ; org . junit . Assert . fail ( ) ; } catch ( org . apache . directory . api . ldap . model . exception . LdapNoSuchObjectException lnsoe ) { "<AssertPlaceHolder>" ; } } modify ( org . apache . directory . api . ldap . model . name . Dn , java . util . List , boolean ) { modify ( dn , mods , ignoreReferral , LogChange . TRUE ) ; }
org . junit . Assert . assertTrue ( true )
onConnectionLostMapsFailedAuthenticationException ( ) { new tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . NonStrictExpectations ( ) { { mockedMqttException . getReasonCode ( ) ; result = org . eclipse . paho . client . mqttv3 . MqttException . REASON_CODE_FAILED_AUTHENTICATION ; } } ; java . lang . Exception e = tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . PahoExceptionTranslator . convertToMqttException ( new org . eclipse . paho . client . mqttv3 . MqttException ( org . eclipse . paho . client . mqttv3 . MqttException . REASON_CODE_FAILED_AUTHENTICATION ) , "" ) ; "<AssertPlaceHolder>" ; } convertToMqttException ( org . eclipse . paho . client . mqttv3 . MqttException , java . lang . String ) { switch ( pahoException . getReasonCode ( ) ) { case REASON_CODE_CLIENT_EXCEPTION : if ( ( ( ( ( ( pahoException . getCause ( ) ) instanceof java . net . UnknownHostException ) || ( ( pahoException . getCause ( ) ) instanceof java . net . NoRouteToHostException ) ) || ( ( pahoException . getCause ( ) ) instanceof java . lang . InterruptedException ) ) || ( ( pahoException . getCause ( ) ) instanceof java . net . SocketTimeoutException ) ) || ( ( pahoException . getCause ( ) ) instanceof java . net . SocketException ) ) { com . microsoft . azure . sdk . iot . device . exceptions . ProtocolException connectionException = new com . microsoft . azure . sdk . iot . device . exceptions . ProtocolException ( errorMessage , pahoException ) ; connectionException . setRetryable ( true ) ; return connectionException ; } else { return new com . microsoft . azure . sdk . iot . device . exceptions . ProtocolException ( errorMessage , pahoException ) ; } case REASON_CODE_INVALID_PROTOCOL_VERSION : return new com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . MqttRejectedProtocolVersionException ( errorMessage , pahoException ) ; case REASON_CODE_INVALID_CLIENT_ID : return new com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . MqttIdentifierRejectedException ( errorMessage , pahoException ) ; case REASON_CODE_BROKER_UNAVAILABLE : return new com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . MqttServerUnavailableException ( errorMessage , pahoException ) ; case REASON_CODE_FAILED_AUTHENTICATION : return new com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . MqttBadUsernameOrPasswordException ( errorMessage , pahoException ) ; case REASON_CODE_NOT_AUTHORIZED : return new com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . MqttUnauthorizedException ( errorMessage , pahoException ) ; case REASON_CODE_SUBSCRIBE_FAILED : case REASON_CODE_CLIENT_NOT_CONNECTED : case REASON_CODE_TOKEN_INUSE : case REASON_CODE_CONNECTION_LOST : case REASON_CODE_SERVER_CONNECT_ERROR : case REASON_CODE_CLIENT_TIMEOUT : case REASON_CODE_WRITE_TIMEOUT : case REASON_CODE_MAX_INFLIGHT : case REASON_CODE_CONNECT_IN_PROGRESS : com . microsoft . azure . sdk . iot . device . exceptions . ProtocolException connectionException = new com . microsoft . azure . sdk . iot . device . exceptions . ProtocolException ( errorMessage , pahoException ) ; connectionException . setRetryable ( true ) ; return connectionException ; default : if ( ( ( pahoException . getReasonCode ( ) ) >= ( com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . PahoExceptionTranslator . UNDEFINED_MQTT_CONNECT_CODE_LOWER_BOUND ) ) && ( ( pahoException . getReasonCode ( ) ) <= ( com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . PahoExceptionTranslator . UNDEFINED_MQTT_CONNECT_CODE_UPPER_BOUND ) ) ) { return new com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . MqttUnexpectedErrorException ( errorMessage , pahoException ) ; } else { return new com . microsoft . azure . sdk . iot . device . exceptions . ProtocolException ( errorMessage , pahoException ) ; } } }
org . junit . Assert . assertTrue ( ( e instanceof tests . unit . com . microsoft . azure . sdk . iot . device . transport . mqtt . exceptions . MqttBadUsernameOrPasswordException ) )
empty ( ) { org . jboss . hal . meta . AddressTemplate input = org . jboss . hal . meta . AddressTemplate . of ( "" ) ; org . jboss . hal . meta . AddressTemplate result = processor . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( org . jboss . hal . meta . AddressTemplate ) { org . jboss . hal . meta . AddressTemplate modified = org . jboss . hal . meta . AddressTemplate . ROOT ; if ( ( template != null ) && ( ! ( AddressTemplate . ROOT . equals ( template ) ) ) ) { java . util . List < java . lang . String [ ] > segments = stream ( template . spliterator ( ) , false ) . map ( ( segment ) -> { if ( segment . contains ( "=" ) ) { return com . google . common . base . Splitter . on ( '=' ) . omitEmptyStrings ( ) . trimResults ( ) . limit ( 2 ) . splitToList ( segment ) . toArray ( new java . lang . String [ 2 ] ) ; } return new java . lang . String [ ] { segment , null } ; } ) . collect ( toList ( ) ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; org . jboss . hal . meta . description . SegmentProcessor . process ( segments , ( segment ) -> { builder . append ( "/" ) . append ( segment [ 0 ] ) ; if ( ( segment [ 1 ] ) != null ) { builder . append ( "=" ) . append ( segment [ 1 ] ) ; } } ) ; modified = org . jboss . hal . meta . AddressTemplate . of ( builder . toString ( ) ) ; } org . jboss . hal . meta . description . ResourceDescriptionTemplateProcessor . logger . debug ( "{}<sp>-><sp>{}" , template , modified ) ; return modified ; }
org . junit . Assert . assertEquals ( AddressTemplate . ROOT , result )
testFileWithErrors ( ) { sourceFile = org . fundacionjala . enforce . sonarqube . apex . ApexAstScanner . scanFile ( new java . io . File ( "src/test/resources/checks/recoveryClass.cls" ) , check ) ; "<AssertPlaceHolder>" ; org . sonar . squidbridge . checks . CheckMessagesVerifier . verify ( sourceFile . getCheckMessages ( ) ) . next ( ) . atLine ( 8 ) . withMessage ( "Parsing<sp>error<sp>found,<sp>the<sp>block<sp>was<sp>skipped<sp>during<sp>the<sp>analysis." ) . next ( ) . atLine ( 16 ) . withMessage ( "Parsing<sp>error<sp>found,<sp>the<sp>block<sp>was<sp>skipped<sp>during<sp>the<sp>analysis." ) . noMore ( ) ; } scanFile ( java . io . File , org . fundacionjala . enforce . sonarqube . apex . SquidAstVisitor [ ] ) { if ( ! ( file . isFile ( ) ) ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( org . fundacionjala . enforce . sonarqube . apex . ApexAstScanner . FILE_NOT_FOUND , file ) ) ; } org . fundacionjala . enforce . sonarqube . apex . AstScanner < com . sonar . sslr . api . Grammar > scanner = org . fundacionjala . enforce . sonarqube . apex . ApexAstScanner . create ( new org . fundacionjala . enforce . sonarqube . apex . ApexConfiguration ( com . google . common . base . Charsets . UTF_8 ) , visitors ) ; scanner . scanFile ( file ) ; java . util . Collection < org . fundacionjala . enforce . sonarqube . apex . SourceCode > sources = scanner . getIndex ( ) . search ( new org . sonar . squidbridge . indexer . QueryByType ( org . fundacionjala . enforce . sonarqube . apex . SourceFile . class ) ) ; if ( ( sources . size ( ) ) != 1 ) { throw new java . lang . IllegalStateException ( java . lang . String . format ( org . fundacionjala . enforce . sonarqube . apex . ApexAstScanner . ONE_SOURCE_FILE , sources . size ( ) ) ) ; } return ( ( org . fundacionjala . enforce . sonarqube . apex . SourceFile ) ( sources . iterator ( ) . next ( ) ) ) ; }
org . junit . Assert . assertFalse ( sourceFile . getCheckMessages ( ) . isEmpty ( ) )
testAvroToDiBytes ( ) { java . lang . String expectedType = "id_byte[]" ; org . apache . avro . Schema fieldSchema = org . talend . daikon . avro . AvroUtils . _bytes ( ) ; "<AssertPlaceHolder>" ; } avroToDi ( org . apache . avro . Schema ) { org . apache . avro . Schema typeSchema = org . talend . daikon . avro . AvroUtils . unwrapIfNullable ( fieldSchema ) ; java . lang . String logicalType = org . talend . daikon . avro . LogicalTypeUtils . getLogicalTypeName ( typeSchema ) ; if ( logicalType != null ) { return org . talend . codegen . converter . TypeConverter . getDiByLogicalType ( logicalType ) ; } java . lang . String javaClass = typeSchema . getProp ( SchemaConstants . JAVA_CLASS_FLAG ) ; if ( javaClass != null ) { return org . talend . codegen . converter . TypeConverter . getDiByJavaClass ( javaClass ) ; } return org . talend . codegen . converter . TypeConverter . getDiByAvroType ( typeSchema . getType ( ) ) ; }
org . junit . Assert . assertEquals ( expectedType , org . talend . codegen . converter . TypeConverter . avroToDi ( fieldSchema ) )
testFileStringAccept ( ) { org . locationtech . udig . project . ui . internal . actions . MapDropAction action = new org . locationtech . udig . project . ui . internal . actions . MapDropAction ( ) ; java . lang . Object layersView = org . eclipse . ui . PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) . findView ( LayersView . ID ) ; action . init ( null , null , ViewerDropLocation . NONE , layersView , getData ( ) . getFile ( ) ) ; boolean acceptable = action . accept ( ) ; "<AssertPlaceHolder>" ; } accept ( ) { java . lang . Object data = getData ( ) ; if ( data . getClass ( ) . isArray ( ) ) { java . lang . Object [ ] objects = ( ( java . lang . Object [ ] ) ( data ) ) ; for ( java . lang . Object object : objects ) { if ( canAccept ( object ) ) { return true ; } } return false ; } else if ( canAccept ( data ) ) { return true ; } return canAccept ( data ) ; }
org . junit . Assert . assertTrue ( acceptable )
updatePet ( ) { org . springframework . samples . petclinic . Pet p7 = this . clinic . loadPet ( 7 ) ; java . lang . String old = p7 . getName ( ) ; p7 . setName ( ( old + "X" ) ) ; this . clinic . storePet ( p7 ) ; p7 = this . clinic . loadPet ( 7 ) ; "<AssertPlaceHolder>" ; } getName ( ) { return this . name ; }
org . junit . Assert . assertEquals ( ( old + "X" ) , p7 . getName ( ) )
testEquals2 ( ) { org . jfree . chart . labels . IntervalCategoryToolTipGenerator g1 = new org . jfree . chart . labels . IntervalCategoryToolTipGenerator ( ) ; org . jfree . chart . labels . StandardCategoryToolTipGenerator g2 = new org . jfree . chart . labels . StandardCategoryToolTipGenerator ( IntervalCategoryToolTipGenerator . DEFAULT_TOOL_TIP_FORMAT_STRING , java . text . NumberFormat . getInstance ( ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == ( this ) ) { return true ; } if ( ! ( obj instanceof org . jfree . data . general . TestIntervalCategoryDataset ) ) { return false ; } org . jfree . data . general . TestIntervalCategoryDataset that = ( ( org . jfree . data . general . TestIntervalCategoryDataset ) ( obj ) ) ; if ( ! ( getRowKeys ( ) . equals ( that . getRowKeys ( ) ) ) ) { return false ; } if ( ! ( getColumnKeys ( ) . equals ( that . getColumnKeys ( ) ) ) ) { return false ; } int rowCount = getRowCount ( ) ; int colCount = getColumnCount ( ) ; for ( int r = 0 ; r < rowCount ; r ++ ) { for ( int c = 0 ; c < colCount ; c ++ ) { java . lang . Number v1 = getValue ( r , c ) ; java . lang . Number v2 = that . getValue ( r , c ) ; if ( v1 == null ) { if ( v2 != null ) { return false ; } } else if ( ! ( v1 . equals ( v2 ) ) ) { return false ; } } } return true ; }
org . junit . Assert . assertFalse ( g1 . equals ( g2 ) )
testPassVariableUnsetGood2 ( ) { final java . lang . String output = process . executeStringOutput ( "x" , false ) ; "<AssertPlaceHolder>" ; } executeStringOutput ( java . lang . String , boolean ) { uk . ac . ed . ph . jacomax . internal . Assert . notNull ( maximaExpression , "Maxima<sp>expression" ) ; uk . ac . ed . ph . qtiworks . mathassess . glue . maxima . QtiMaximaProcess . logger . trace ( "executeStringOutput:<sp>expr={},<sp>simp={}" , maximaExpression , simplify ) ; final java . lang . String result = uk . ac . ed . ph . jacomax . utilities . MaximaOutputUtilities . parseSingleLinearOutputResult ( maximaOutput ) ; if ( result == null ) { throw new uk . ac . ed . ph . qtiworks . mathassess . glue . MathAssessBadCasCodeException ( "Maxima<sp>call<sp>did<sp>not<sp>return<sp>a<sp>parseable<sp>result" , maximaInput , maximaOutput ) ; } return result ; }
org . junit . Assert . assertEquals ( "x" , output )
getPool ( ) { org . apache . commons . configuration . HierarchicalConfiguration configuration = prepareConfiguration ( org . oscm . app . ror . LServerConfigurationTest . POOL , org . oscm . app . ror . LServerConfigurationTest . POOL ) ; lServerConfiguration = new org . oscm . app . ror . data . LServerConfiguration ( configuration ) ; "<AssertPlaceHolder>" ; } getPool ( ) { return pool ; }
org . junit . Assert . assertEquals ( org . oscm . app . ror . LServerConfigurationTest . POOL , lServerConfiguration . getPool ( ) )
testRemoveSpecificQuery ( ) { java . lang . String query = "select<sp>count(data_id)<sp>from<sp>r_data_main" ; java . lang . String alias = "get_dataobject_ids" ; org . irods . jargon . core . pub . domain . SpecificQueryDefinition specificQuery = new org . irods . jargon . core . pub . domain . SpecificQueryDefinition ( query , alias ) ; org . irods . jargon . core . packinstr . GeneralAdminInpForSQ pi = org . irods . jargon . core . packinstr . GeneralAdminInpForSQ . instanceForRemoveSpecificQuery ( specificQuery ) ; "<AssertPlaceHolder>" ; } instanceForRemoveSpecificQuery ( org . irods . jargon . core . pub . domain . SpecificQueryDefinition ) { if ( specificQuery == null ) { throw new java . lang . IllegalArgumentException ( "null<sp>SpecificQueryDefinition<sp>object" ) ; } return org . irods . jargon . core . packinstr . GeneralAdminInpForSQ . instanceForRemoveSpecificQueryByAlias ( specificQuery . getAlias ( ) ) ; }
org . junit . Assert . assertNotNull ( pi )
testParseHL7PatientFromMessageWhenSubject1Null ( ) { gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser parser = new gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser ( ) ; org . hl7 . v3 . PRPAIN201301UV02 message = createMessageWhereSubject1Null ( ) ; "<AssertPlaceHolder>" ; } parseHL7PatientFromMessage ( org . hl7 . v3 . PRPAIN201301UV02 ) { org . hl7 . v3 . PRPAMT201301UV02Patient patient ; gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser . LOG . info ( "in<sp>ExtractPatient" ) ; org . hl7 . v3 . PRPAIN201301UV02MFMIMT700701UV01Subject1 subject = gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser . parseSubjectFromMessage ( message ) ; if ( subject == null ) { return null ; } org . hl7 . v3 . PRPAIN201301UV02MFMIMT700701UV01RegistrationEvent registrationevent = subject . getRegistrationEvent ( ) ; if ( registrationevent == null ) { gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser . LOG . info ( "registrationevent<sp>is<sp>null<sp>-<sp>no<sp>patient" ) ; return null ; } org . hl7 . v3 . PRPAIN201301UV02MFMIMT700701UV01Subject2 subject1 = registrationevent . getSubject1 ( ) ; if ( subject1 == null ) { gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser . LOG . info ( "subject1<sp>is<sp>null<sp>-<sp>no<sp>patient" ) ; return null ; } patient = subject1 . getPatient ( ) ; if ( patient == null ) { gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser . LOG . info ( "patient<sp>is<sp>null<sp>-<sp>no<sp>patient" ) ; return null ; } gov . hhs . fha . nhinc . patientcorrelation . nhinc . parsers . PRPAIN201301UV . PRPAIN201301UVParser . LOG . info ( "done<sp>with<sp>ExtractPatient" ) ; return patient ; }
org . junit . Assert . assertNull ( parser . parseHL7PatientFromMessage ( message ) )
shouldDelegateIsSortAscending ( ) { boolean sortAscending = false ; given ( this . delegate . isSortAscending ( ) ) . willReturn ( sortAscending ) ; "<AssertPlaceHolder>" ; } isSortAscending ( ) { return this . sortAscending ; }
org . junit . Assert . assertThat ( this . request . isSortAscending ( ) , org . hamcrest . CoreMatchers . is ( sortAscending ) )
testLastIndexOf ( ) { listenedList . add ( "A" ) ; listenedList . add ( "B" ) ; listenedList . add ( "C" ) ; "<AssertPlaceHolder>" ; } indexOf ( java . lang . String ) { for ( org . talend . core . model . metadata . designerproperties . PropertyConstants . CDCTypeMode mode : org . talend . core . model . metadata . designerproperties . PropertyConstants . CDCTypeMode . values ( ) ) { if ( mode . getName ( ) . equals ( value ) ) { return mode ; } } return null ; }
org . junit . Assert . assertEquals ( 1 , listenedList . indexOf ( "B" ) )
testToMapWithMultipleSeparators ( ) { java . lang . String [ ] values = new java . lang . String [ ] { "key1:value1" , "key2:val:ue2" , "key3:value3" } ; java . lang . String separator = ":" ; java . util . Map < java . lang . String , java . lang . String > expResult = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; expResult . put ( "key1" , "value1" ) ; expResult . put ( "key3" , "value3" ) ; java . util . Map < java . lang . String , java . lang . String > result = com . adobe . acs . commons . util . ParameterUtil . toMap ( values , separator ) ; "<AssertPlaceHolder>" ; } toMap ( java . lang . String [ ] , java . lang . String ) { return com . adobe . acs . commons . util . ParameterUtil . toMap ( values , separator , false , null ) ; }
org . junit . Assert . assertEquals ( expResult , result )
testDSAWrongPassphrase ( ) { java . security . KeyPair keyPair = instance . decodePrivateKey ( "src/test/resources/dsa_encrypted" , "wrong" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNull ( keyPair )
isNotNew ( ) { com . miracle . framework . repository . jpa . fixture . entity . TestEntity testEntity = new com . miracle . framework . repository . jpa . fixture . entity . TestEntity ( ) ; testEntity . setId ( "id" ) ; "<AssertPlaceHolder>" ; } isNew ( ) { return null == ( getId ( ) ) ; }
org . junit . Assert . assertFalse ( testEntity . isNew ( ) )
fail_inline ( ) { final io . grpc . Status error = Status . FAILED_PRECONDITION . withDescription ( "channel<sp>not<sp>secure<sp>for<sp>creds" ) ; when ( mockTransport . getAttributes ( ) ) . thenReturn ( Attributes . EMPTY ) ; doAnswer ( new org . mockito . stubbing . Answer < java . lang . Void > ( ) { @ io . grpc . internal . Override public io . grpc . internal . Void answer ( org . mockito . invocation . InvocationOnMock invocation ) throws java . lang . Throwable { io . grpc . CallCredentials . MetadataApplier applier = ( ( io . grpc . CallCredentials . MetadataApplier ) ( invocation . getArguments ( ) [ 2 ] ) ) ; applier . fail ( error ) ; return null ; } } ) . when ( mockCreds ) . applyRequestMetadata ( any ( io . grpc . CallCredentials . RequestInfo . class ) , same ( mockExecutor ) , any ( io . grpc . CallCredentials . MetadataApplier . class ) ) ; io . grpc . internal . FailingClientStream stream = ( ( io . grpc . internal . FailingClientStream ) ( transport . newStream ( io . grpc . internal . CallCredentials2ApplyingTest . method , origHeaders , callOptions ) ) ) ; verify ( mockTransport , never ( ) ) . newStream ( io . grpc . internal . CallCredentials2ApplyingTest . method , origHeaders , callOptions ) ; "<AssertPlaceHolder>" ; } getError ( ) { return error ; }
org . junit . Assert . assertSame ( error , stream . getError ( ) )
testIncompatibleVertical ( ) { final org . opengis . referencing . crs . CoordinateReferenceSystem sourceCRS = crsFactory . createFromWKT ( WKT . Z ) ; final org . opengis . referencing . crs . CoordinateReferenceSystem targetCRS = crsFactory . createFromWKT ( WKT . HEIGHT ) ; final org . opengis . referencing . operation . CoordinateOperation op = opFactory . createOperation ( sourceCRS , targetCRS ) ; "<AssertPlaceHolder>" ; } createOperation ( org . geotools . referencing . operation . CoordinateReferenceSystem , org . geotools . referencing . operation . CoordinateReferenceSystem ) { ensureNonNull ( "sourceCRS" , sourceCRS ) ; ensureNonNull ( "targetCRS" , targetCRS ) ; if ( org . geotools . referencing . CRS . equalsIgnoreMetadata ( sourceCRS , targetCRS ) ) { final int dim = getDimension ( sourceCRS ) ; assert dim == ( getDimension ( targetCRS ) ) : dim ; return createFromAffineTransform ( org . geotools . referencing . operation . IDENTITY , sourceCRS , targetCRS , org . geotools . referencing . operation . matrix . MatrixFactory . create ( ( dim + 1 ) ) ) ; } else { final org . geotools . referencing . operation . CoordinateOperation candidate = createFromDatabase ( sourceCRS , targetCRS ) ; if ( candidate != null ) { return candidate ; } } Generic -- > various CS Various CS -- > Generic if ( ( isWildcard ( sourceCRS ) ) || ( isWildcard ( targetCRS ) ) ) { final int dimSource = getDimension ( sourceCRS ) ; final int dimTarget = getDimension ( targetCRS ) ; if ( dimTarget == dimSource ) { final org . geotools . referencing . operation . Matrix matrix = org . geotools . referencing . operation . matrix . MatrixFactory . create ( ( dimTarget + 1 ) , ( dimSource + 1 ) ) ; return createFromAffineTransform ( org . geotools . referencing . operation . IDENTITY , sourceCRS , targetCRS , matrix ) ; } } if ( sourceCRS instanceof org . geotools . referencing . operation . CompoundCRS ) { final java . util . List < org . geotools . referencing . operation . SingleCRS > sources = org . geotools . referencing . crs . DefaultCompoundCRS . getSingleCRS ( sourceCRS ) ; final java . util . List < org . geotools . referencing . operation . SingleCRS > targets = org . geotools . referencing . crs . DefaultCompoundCRS . getSingleCRS ( targetCRS ) ; if ( org . geotools . referencing . operation . DefaultCoordinateOperationFactory . containsIgnoreMetadata ( sources , targets ) ) { final org . geotools . referencing . operation . CompoundCRS source = ( ( org . geotools . referencing . operation . CompoundCRS ) ( sourceCRS ) ) ; if ( targetCRS instanceof org . geotools . referencing . operation . CompoundCRS ) { final org . geotools . referencing . operation . CompoundCRS target = ( ( org . geotools . referencing . operation . CompoundCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } if ( targetCRS instanceof org . geotools . referencing . operation . SingleCRS ) { final org . geotools . referencing . operation . SingleCRS target = ( ( org . geotools . referencing . operation . SingleCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } } } Geographic -- > Geographic , Projected or Geocentric if ( sourceCRS instanceof org . geotools . referencing . operation . GeographicCRS ) { final org . geotools . referencing . operation . GeographicCRS source = ( ( org . geotools . referencing . operation . GeographicCRS ) ( sourceCRS ) ) ; if ( targetCRS instanceof org . geotools . referencing . operation . GeographicCRS ) { final org . geotools . referencing . operation . GeographicCRS target = ( ( org . geotools . referencing . operation . GeographicCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } if ( targetCRS instanceof org . geotools . referencing . operation . ProjectedCRS ) { final org . geotools . referencing . operation . ProjectedCRS target = ( ( org . geotools . referencing . operation . ProjectedCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } if ( targetCRS instanceof org . geotools . referencing . operation . GeocentricCRS ) { final org . geotools . referencing . operation . GeocentricCRS target = ( ( org . geotools . referencing . operation . GeocentricCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } if ( targetCRS instanceof org . geotools . referencing . operation . VerticalCRS ) { final org . geotools . referencing . operation . VerticalCRS target = ( ( org . geotools . referencing . operation . VerticalCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } } Projected -- > Projected or Geographic if ( sourceCRS instanceof org . geotools . referencing . operation . ProjectedCRS ) { final org . geotools . referencing . operation . ProjectedCRS source = ( ( org . geotools . referencing . operation . ProjectedCRS ) ( sourceCRS ) ) ; if ( targetCRS instanceof org . geotools . referencing . operation . ProjectedCRS ) { final org . geotools . referencing . operation . ProjectedCRS target = ( ( org . geotools . referencing . operation . ProjectedCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } if ( targetCRS instanceof org . geotools . referencing . operation . GeographicCRS ) { final org . geotools . referencing . operation . GeographicCRS target = ( ( org . geotools . referencing . operation . GeographicCRS ) ( targetCRS ) ) ; return createOperationStep ( source , target ) ; } } Geocentric -- > Geocentric or Geographic
org . junit . Assert . assertNull ( op )
testConcurrentReadWrite ( ) { java . lang . System . gc ( ) ; java . lang . System . runFinalization ( ) ; final java . io . File file = getTempFile ( ) ; java . lang . Runnable reader = new java . lang . Runnable ( ) { public void run ( ) { int cutoff = 0 ; java . io . FileInputStream fr = null ; try { fr = new java . io . FileInputStream ( file ) ; try { fr . read ( ) ; } catch ( java . io . IOException e1 ) { exception = e1 ; return ; } readStarted = true ; while ( cutoff < 10 ) { synchronized ( this ) { try { try { fr . read ( ) ; } catch ( java . io . IOException e ) { exception = e ; return ; } wait ( 500 ) ; cutoff ++ ; } catch ( java . lang . InterruptedException e ) { cutoff = 10 ; } } } } catch ( java . io . FileNotFoundException e ) { "<AssertPlaceHolder>" ; } finally { if ( fr != null ) { try { fr . close ( ) ; } catch ( java . io . IOException e ) { exception = e ; return ; } } } } } ; java . lang . Thread readThread = new java . lang . Thread ( reader ) ; readThread . start ( ) ; while ( ! ( readStarted ) ) { if ( ( exception ) != null ) { throw exception ; } java . lang . Thread . sleep ( 100 ) ; } test ( files [ 0 ] ) ; } read ( ) { java . lang . String fid = raf . readUTF ( ) ; for ( org . opengis . feature . type . AttributeDescriptor ad : schema . getAttributeDescriptors ( ) ) { java . lang . Object att = readAttribute ( ad ) ; builder . add ( att ) ; } return builder . buildFeature ( fid ) ; }
org . junit . Assert . assertTrue ( false )
testTableSink ( ) { final org . apache . flink . table . api . TableSchema schema = createTestSchema ( ) ; final org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkBase expectedSink = getExpectedTableSink ( false , schema , java . util . Collections . singletonList ( new org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkBase . Host ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . HOSTNAME , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . PORT , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . SCHEMA ) ) , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . INDEX , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . DOC_TYPE , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . KEY_DELIMITER , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . KEY_NULL_LITERAL , new org . apache . flink . formats . json . JsonRowSerializationSchema ( schema . toRowType ( ) ) , XContentType . JSON , new org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . DummyFailureHandler ( ) , createTestSinkOptions ( ) ) ; final org . apache . flink . table . descriptors . TestTableDescriptor testDesc = new org . apache . flink . table . descriptors . TestTableDescriptor ( new org . apache . flink . table . descriptors . Elasticsearch ( ) . version ( getElasticsearchVersion ( ) ) . host ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . HOSTNAME , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . PORT , org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . SCHEMA ) . index ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . INDEX ) . documentType ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . DOC_TYPE ) . keyDelimiter ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . KEY_DELIMITER ) . keyNullLiteral ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . KEY_NULL_LITERAL ) . bulkFlushBackoffExponential ( ) . bulkFlushBackoffDelay ( 123L ) . bulkFlushBackoffMaxRetries ( 3 ) . bulkFlushInterval ( 100L ) . bulkFlushMaxActions ( 1000 ) . bulkFlushMaxSize ( "1<sp>MB" ) . failureHandlerCustom ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . DummyFailureHandler . class ) . connectionMaxRetryTimeout ( 100 ) . connectionPathPrefix ( "/myapp" ) ) . withFormat ( new org . apache . flink . table . descriptors . Json ( ) . deriveSchema ( ) ) . withSchema ( new org . apache . flink . table . descriptors . Schema ( ) . field ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . FIELD_KEY , org . apache . flink . table . api . Types . LONG ( ) ) . field ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . FIELD_FRUIT_NAME , org . apache . flink . table . api . Types . STRING ( ) ) . field ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . FIELD_COUNT , org . apache . flink . table . api . Types . DECIMAL ( ) ) . field ( org . apache . flink . streaming . connectors . elasticsearch . ElasticsearchUpsertTableSinkFactoryTestBase . FIELD_TS , org . apache . flink . table . api . Types . SQL_TIMESTAMP ( ) ) ) . inUpsertMode ( ) ; final java . util . Map < java . lang . String , java . lang . String > propertiesMap = testDesc . toProperties ( ) ; final org . apache . flink . table . sinks . TableSink < ? > actualSink = org . apache . flink . table . factories . TableFactoryService . find ( org . apache . flink . table . factories . StreamTableSinkFactory . class , propertiesMap ) . createStreamTableSink ( propertiesMap ) ; "<AssertPlaceHolder>" ; } createStreamTableSink ( java . util . Map ) { final org . apache . flink . table . descriptors . DescriptorProperties params = new org . apache . flink . table . descriptors . DescriptorProperties ( true ) ; params . putProperties ( properties ) ; return new org . apache . flink . table . client . gateway . utils . TestTableSinkFactoryBase . TestTableSink ( org . apache . flink . table . descriptors . SchemaValidator . deriveTableSinkSchema ( params ) , properties . get ( testProperty ) ) ; }
org . junit . Assert . assertEquals ( expectedSink , actualSink )
deveObterMotivoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . evento . NFInfoEventoRetorno eventoRetorno = new com . fincatto . documentofiscal . nfe310 . classes . evento . NFInfoEventoRetorno ( ) ; final java . lang . String motivo = "motivo<sp>de<sp>teste" ; eventoRetorno . setMotivo ( motivo ) ; "<AssertPlaceHolder>" ; } getMotivo ( ) { return this . motivo ; }
org . junit . Assert . assertEquals ( motivo , eventoRetorno . getMotivo ( ) )
testConstructEmptyDocument ( ) { final com . allanbank . mongodb . bson . impl . RootDocument element = new com . allanbank . mongodb . bson . impl . RootDocument ( ) ; "<AssertPlaceHolder>" ; } getElements ( ) { return myElements ; }
org . junit . Assert . assertTrue ( element . getElements ( ) . isEmpty ( ) )
testGetRepositoryInfos ( ) { java . util . List < org . apache . chemistry . opencmis . commons . data . RepositoryInfo > infos = repoService . getRepositoryInfos ( null ) ; "<AssertPlaceHolder>" ; checkInfo ( infos . get ( 0 ) ) ; } size ( ) { return getCollectedDocumentIds ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , infos . size ( ) )
test1SeriesCreate ( ) { io . symcpe . hendrix . api . dao . PerformanceMonitor mon = new io . symcpe . hendrix . api . dao . PerformanceMonitor ( am ) ; mon . initIgniteCache ( ) ; org . apache . flume . Event event = new org . apache . flume . event . SimpleEvent ( ) ; com . google . gson . Gson gson = new com . google . gson . Gson ( ) ; com . google . gson . JsonObject obj = new com . google . gson . JsonObject ( ) ; obj . addProperty ( "name" , "mcm.rule.efficiency.10" ) ; obj . addProperty ( "seriesName" , "value" 4 ) ; obj . addProperty ( "value" 5 , "value" 3 ) ; obj . addProperty ( "tenantId" , "test" ) ; obj . addProperty ( "value" , ( ( java . lang . Number ) ( 10 ) ) ) ; event . getHeaders ( ) . put ( "value" 2 , java . lang . String . valueOf ( java . lang . System . currentTimeMillis ( ) ) ) ; event . setBody ( gson . toJson ( obj ) . getBytes ( ) ) ; final int limit = 7 ; int counter = 0 ; for ( int i = 0 ; i < limit ; i ++ ) { mon . processEvent ( event ) ; } System . err . println ( ( "Cache<sp>names:" + ( io . symcpe . hendrix . api . dao . TestPerformanceMonitor . ignite . cacheNames ( ) ) ) ) ; for ( javax . cache . Cache . Entry < java . lang . Object , java . lang . Object > entry : io . symcpe . hendrix . api . dao . TestPerformanceMonitor . ignite . cache ( "mcmMetrics" ) ) { System . err . println ( ( ( ( "\tMCM<sp>metric:" + ( entry . getKey ( ) ) ) + "value" 1 ) + ( entry . getValue ( ) ) ) ) ; java . util . Set < java . lang . String > set = ( ( java . util . Set < java . lang . String > ) ( entry . getValue ( ) ) ) ; for ( java . lang . String series : set ) { System . err . println ( ( "value" 0 + series ) ) ; org . apache . ignite . IgniteSet < java . lang . String > set2 = io . symcpe . hendrix . api . dao . TestPerformanceMonitor . ignite . set ( series , mon . getCfg ( ) ) ; for ( java . lang . String string : set2 ) { org . apache . ignite . IgniteQueue < java . lang . Object > queue = io . symcpe . hendrix . api . dao . TestPerformanceMonitor . ignite . queue ( string , 100 , mon . getColCfg ( ) ) ; for ( java . lang . Object object : queue ) { System . err . println ( ( "\t\t\tSeries<sp>values:" + object ) ) ; counter ++ ; } } } } "<AssertPlaceHolder>" ; } getColCfg ( ) { return colCfg ; }
org . junit . Assert . assertEquals ( limit , counter )
reset ( ) { liquibase . sqlgenerator . SqlGeneratorFactory . reset ( ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { org . junit . Assert . assertNotNull ( liquibase . sqlgenerator . SqlGeneratorFactory . getInstance ( ) ) ; org . junit . Assert . assertTrue ( ( ( liquibase . sqlgenerator . SqlGeneratorFactory . getInstance ( ) ) == ( liquibase . sqlgenerator . SqlGeneratorFactory . getInstance ( ) ) ) ) ; }
org . junit . Assert . assertFalse ( ( ( factory ) == ( liquibase . sqlgenerator . SqlGeneratorFactory . getInstance ( ) ) ) )
methodRuleIsIntroducedAndEvaluatedOnSubclass ( ) { org . junit . tests . experimental . rules . ClassRulesTest . MethodExampleTestWithClassRule . counter . count = 0 ; org . junit . runner . JUnitCore . runClasses ( org . junit . tests . experimental . rules . ClassRulesTest . MethodSubclassOfTestWithClassRule . class ) ; "<AssertPlaceHolder>" ; } runClasses ( java . lang . Class [ ] ) { return org . junit . runner . JUnitCore . runClasses ( org . junit . runner . JUnitCore . defaultComputer ( ) , classes ) ; }
org . junit . Assert . assertEquals ( 1 , org . junit . tests . experimental . rules . ClassRulesTest . MethodExampleTestWithClassRule . counter . count )
getAddreeStrArray ( ) { java . lang . String address = "1.1.1.{1,2,3,4}" ; java . lang . String [ ] addressArray = org . apache . rocketmq . acl . common . AclUtils . getAddreeStrArray ( address , "{1,2,3,4}" ) ; java . util . List < java . lang . String > newAddressList = new java . util . ArrayList ( ) ; for ( java . lang . String a : addressArray ) { newAddressList . add ( a ) ; } java . util . List < java . lang . String > addressList = new java . util . ArrayList ( ) ; addressList . add ( "1.1.1.1" ) ; addressList . add ( "1.1.1.2" ) ; addressList . add ( "1.1.1.3" ) ; addressList . add ( "1.1.1.4" ) ; "<AssertPlaceHolder>" ; } add ( org . apache . rocketmq . logging . inner . LoggingEvent ) { if ( ( event . getLevel ( ) . toInt ( ) ) > ( maxEvent . getLevel ( ) . toInt ( ) ) ) { maxEvent = event ; } ( count ) ++ ; }
org . junit . Assert . assertEquals ( newAddressList , addressList )
labelRecordTest ( ) { analyze . labeling . Labeler labeler = new analyze . labeling . Labeler ( ) ; model . SequentialData list = new model . SequentialData ( ) ; model . Record record = new model . Record ( java . time . LocalDateTime . ofEpochSecond ( 1430909359 , 0 , ZoneOffset . UTC ) ) ; list . add ( record ) ; labeler . label ( "labelTest" , "true" , null , list ) ; int number = analyze . labeling . LabelFactory . getInstance ( ) . getNumberOfLabel ( "labelTest" ) ; "<AssertPlaceHolder>" ; } containsLabel ( int ) { return labels . contains ( labelnumber ) ; }
org . junit . Assert . assertTrue ( record . containsLabel ( number ) )
testSimplifyAlgorithmIdentifier_unknown ( ) { de . persosim . simulator . tlv . ConstructedTlvDataObject unknownAlgIdentifier = new de . persosim . simulator . tlv . ConstructedTlvDataObject ( de . persosim . simulator . tlv . TlvConstants . TAG_SEQUENCE ) ; unknownAlgIdentifier . addTlvDataObject ( new de . persosim . simulator . tlv . PrimitiveTlvDataObject ( de . persosim . simulator . tlv . TlvConstants . TAG_OID , new byte [ ] { 0 } ) ) ; unknownAlgIdentifier . addTlvDataObject ( new de . persosim . simulator . tlv . PrimitiveTlvDataObject ( de . persosim . simulator . tlv . TlvConstants . TAG_INTEGER , new byte [ ] { 0 } ) ) ; "<AssertPlaceHolder>" ; } simplifyAlgorithmIdentifier ( de . persosim . simulator . tlv . ConstructedTlvDataObject ) { for ( de . persosim . simulator . crypto . StandardizedDomainParameterProvider provider : de . persosim . simulator . crypto . StandardizedDomainParameters . providers ) { java . lang . String algIdHexString = de . persosim . simulator . utils . HexString . encode ( algIdentifier . toByteArray ( ) ) ; java . lang . Integer current = provider . getSimplifiedAlgorithm ( algIdHexString ) ; if ( current != null ) { de . persosim . simulator . tlv . ConstructedTlvDataObject newAlgIdentifier = new de . persosim . simulator . tlv . ConstructedTlvDataObject ( de . persosim . simulator . tlv . TlvConstants . TAG_SEQUENCE ) ; newAlgIdentifier . addTlvDataObject ( new de . persosim . simulator . tlv . PrimitiveTlvDataObject ( de . persosim . simulator . tlv . TlvConstants . TAG_OID , de . persosim . simulator . crypto . StandardizedDomainParameters . OID ) ) ; newAlgIdentifier . addTlvDataObject ( new de . persosim . simulator . tlv . PrimitiveTlvDataObject ( de . persosim . simulator . tlv . TlvConstants . TAG_INTEGER , new byte [ ] { ( ( byte ) ( current . intValue ( ) ) ) } ) ) ; return newAlgIdentifier ; } } return algIdentifier ; }
org . junit . Assert . assertEquals ( unknownAlgIdentifier , de . persosim . simulator . crypto . StandardizedDomainParameters . simplifyAlgorithmIdentifier ( unknownAlgIdentifier ) )
testBuildWithDisabledStatusConsraintWithOrderBy ( ) { unit . setActive ( false ) ; org . lnu . is . domain . asset . Asset context = new org . lnu . is . domain . asset . Asset ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "name" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "invnum" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "serialnum" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy4 = new org . lnu . is . pagination . OrderBy ( "proddate" , org . lnu . is . pagination . OrderByType . ASC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 , orderBy3 , orderBy4 ) ; java . lang . String expectedSql = "SELECT<sp>e<sp>FROM<sp>Asset<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>ORDER<sp>BY<sp>e.name<sp>ASC,<sp>e.invnum<sp>ASC,<sp>e.serialnum<sp>ASC,<sp>e.proddate<sp>ASC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . asset . Asset > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; }
org . junit . Assert . assertEquals ( expectedSql , actualQuery )
getMosaicsReturnsNonXemMosaicsWhenXemMosaicsArePresent ( ) { final org . nem . core . model . TransferTransaction transaction = this . createTransferWithMosaics ( org . nem . core . model . TransferTransactionTest . AbstractTransferTransactionTest . ONE_POINT_TWO_XEM , true ) ; final org . nem . core . model . Collection < org . nem . core . model . Mosaic > mosaics = transaction . getMosaics ( ) ; final org . nem . core . model . Collection < org . nem . core . model . Mosaic > expectedMosaics = org . nem . core . model . Arrays . asList ( org . nem . core . model . Utils . createMosaic ( 7 , 14 ) , org . nem . core . model . Utils . createMosaic ( 9 , 28 ) ) ; "<AssertPlaceHolder>" ; } equivalentTo ( T [ ] ) { return new org . nem . core . test . IsEquivalent ( array ) ; }
org . junit . Assert . assertThat ( mosaics , org . nem . core . model . IsEquivalent . equivalentTo ( expectedMosaics ) )
filterServiceConfiguration_NoChange ( ) { org . oscm . internal . vo . VOServicePaymentConfiguration conf = org . oscm . accountservice . bean . PaymentConfigurationFilterTest . createServiceConfiguration ( product . getKey ( ) , PaymentType . INVOICE ) ; java . util . List < org . oscm . internal . vo . VOServicePaymentConfiguration > list = pcf . filterServiceConfiguration ( java . util . Arrays . asList ( conf ) ) ; "<AssertPlaceHolder>" ; } filterServiceConfiguration ( java . util . List ) { java . util . List < org . oscm . internal . vo . VOServicePaymentConfiguration > result = new java . util . ArrayList < org . oscm . internal . vo . VOServicePaymentConfiguration > ( ) ; if ( conf == null ) { return result ; } org . oscm . domobjects . Organization vendor = ds . getCurrentUser ( ) . getOrganization ( ) ; for ( org . oscm . internal . vo . VOServicePaymentConfiguration c : conf ) { org . oscm . domobjects . Product product = ds . getReference ( org . oscm . domobjects . Product . class , c . getService ( ) . getKey ( ) ) ; org . oscm . permission . PermissionCheck . owns ( product , vendor , org . oscm . accountservice . bean . PaymentConfigurationFilter . logger , null ) ; checkIsTemplate ( vendor , product ) ; if ( serviceConfigurationChanged ( c , product ) ) { result . add ( c ) ; } } return result ; }
org . junit . Assert . assertEquals ( new java . util . ArrayList < org . oscm . internal . vo . VOServicePaymentConfiguration > ( ) , list )
whenGetOnNullMap_thenMustReturnDefaultValue ( ) { java . lang . String defaultColorStr = "COLOR_NOT_FOUND" ; java . lang . String color = org . apache . commons . collections4 . MapUtils . getString ( null , "RED" , defaultColorStr ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( color , defaultColorStr )
testSearchCType ( ) { org . ebayopensource . turmeric . tools . annoparser . ComplexType ctype = xsdIntf . searchCType ( "FindBestMatchItemDetailsByKeywordsInternalResponse" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( "FindBestMatchItemDetailsByKeywordsInternalResponse" , ctype . getName ( ) )
bareSliceExpression ( ) { io . burt . jmespath . Expression < java . lang . Object > expected = Slice ( 0 , 1 , 2 ) ; io . burt . jmespath . Expression < java . lang . Object > actual = compile ( "[0:1:2]" ) ; "<AssertPlaceHolder>" ; } compile ( java . lang . String ) { return runtime . compile ( str ) ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) )
valueOf_int ( ) { for ( int i = 0 ; i < 4 ; i ++ ) { "<AssertPlaceHolder>" ; } } valueOf ( int ) { if ( ( quarter < 1 ) || ( quarter > 4 ) ) { throw new java . lang . IllegalArgumentException ( ( "Out<sp>of<sp>range:<sp>" + quarter ) ) ; } return net . time4j . Quarter . ENUMS [ ( quarter - 1 ) ] ; }
org . junit . Assert . assertThat ( net . time4j . Quarter . valueOf ( ( i + 1 ) ) , org . hamcrest . CoreMatchers . is ( net . time4j . Quarter . values ( ) [ i ] ) )
shouldDecodeLegacyDouble ( ) { byte [ ] bytes = com . couchbase . client . java . transcoder . LegacyTranscoder . encodeNum ( java . lang . Double . doubleToRawLongBits ( Double . MAX_VALUE ) , 8 ) ; com . couchbase . client . deps . io . netty . buffer . ByteBuf content = com . couchbase . client . deps . io . netty . buffer . Unpooled . buffer ( ) . writeBytes ( bytes ) ; com . couchbase . client . java . document . JsonDoubleDocument decoded = converter . decode ( "id" , content , 0 , 0 , ( 7 << 8 ) , ResponseStatus . SUCCESS ) ; "<AssertPlaceHolder>" ; } content ( ) { return content ; }
org . junit . Assert . assertEquals ( Double . MAX_VALUE , decoded . content ( ) , 0 )
findSessionsOnDayEdge ( ) { java . util . List < com . springsource . greenhouse . events . EventSession > sessions = eventRepository . findSessionsOnDay ( 1L , new org . joda . time . LocalDate ( 2010 , 10 , 19 ) , 1L ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 1 , sessions . size ( ) )
test2 ( ) { System . out . print ( "test2<sp>" ) ; final com . persistit . Exchange [ ] exchanges = new com . persistit . Exchange [ 1000 ] ; for ( int counter = 0 ; counter < 1000 ; counter ++ ) { exchanges [ counter ] = _persistit . getExchange ( "persistit" , ( "TreeTest1_" + counter ) , true ) ; } for ( int counter = 0 ; counter < 1000 ; counter ++ ) { exchanges [ counter ] . removeTree ( ) ; } final java . lang . String [ ] treeNames = exchanges [ 0 ] . getVolume ( ) . getTreeNames ( ) ; for ( int index = 0 ; index < ( treeNames . length ) ; index ++ ) { "<AssertPlaceHolder>" ; } System . out . println ( "-<sp>done" ) ; } getTreeNames ( ) { final java . util . List < java . lang . String > list = new java . util . ArrayList < java . lang . String > ( ) ; final com . persistit . Exchange ex = directoryExchange ( ) ; ex . clear ( ) . append ( com . persistit . VolumeStructure . DIRECTORY_TREE_NAME ) . append ( com . persistit . VolumeStructure . TREE_ROOT ) . append ( "" ) ; while ( ex . next ( ) ) { final java . lang . String treeName = ex . getKey ( ) . indexTo ( ( - 1 ) ) . decodeString ( ) ; list . add ( treeName ) ; } final java . lang . String [ ] names = list . toArray ( new java . lang . String [ list . size ( ) ] ) ; return names ; }
org . junit . Assert . assertTrue ( ( ! ( treeNames [ index ] . startsWith ( "TreeTest1_" ) ) ) )
testGetByteBuffer_Int8Array ( ) { com . eclipsesource . v8 . V8ArrayBuffer buffer = new com . eclipsesource . v8 . V8ArrayBuffer ( v8 , 8 ) ; com . eclipsesource . v8 . V8TypedArray v8Int8Array = new com . eclipsesource . v8 . V8TypedArray ( v8 , buffer , V8Value . BYTE , 0 , 2 ) ; com . eclipsesource . v8 . V8ArrayBuffer arrayBuffer = v8Int8Array . getBuffer ( ) ; "<AssertPlaceHolder>" ; buffer . close ( ) ; v8Int8Array . close ( ) ; arrayBuffer . close ( ) ; } getBuffer ( ) { return ( ( com . eclipsesource . v8 . V8ArrayBuffer ) ( get ( "buffer" ) ) ) ; }
org . junit . Assert . assertEquals ( arrayBuffer , buffer )
testFindJobExecutions ( ) { java . util . List < org . springframework . batch . mongo . dao . JobExecution > results = jobExecutionDao . findJobExecutions ( jobInstance ) ; "<AssertPlaceHolder>" ; validateJobExecution ( jobExecution , results . get ( 0 ) ) ; } findJobExecutions ( org . springframework . batch . core . JobInstance ) { org . springframework . util . Assert . notNull ( jobInstance , "Job<sp>cannot<sp>be<sp>null." ) ; java . lang . Long id = jobInstance . getId ( ) ; org . springframework . util . Assert . notNull ( id , "Job<sp>Id<sp>cannot<sp>be<sp>null." ) ; org . springframework . batch . mongo . dao . DBCursor dbCursor = getCollection ( ) . find ( org . springframework . batch . mongo . dao . MongoJobInstanceDao . jobInstanceIdObj ( id ) ) . sort ( new org . springframework . batch . mongo . dao . BasicDBObject ( org . springframework . batch . mongo . dao . MongoJobExecutionDao . JOB_EXECUTION_ID_KEY , ( - 1 ) ) ) ; org . springframework . batch . mongo . dao . List < org . springframework . batch . core . JobExecution > result = new org . springframework . batch . mongo . dao . ArrayList < org . springframework . batch . core . JobExecution > ( ) ; while ( dbCursor . hasNext ( ) ) { org . springframework . batch . mongo . dao . DBObject dbObject = dbCursor . next ( ) ; result . add ( mapJobExecution ( jobInstance , dbObject ) ) ; } return result ; }
org . junit . Assert . assertEquals ( results . size ( ) , 1 )
userShouldNotHasPermissionForRunProject ( ) { java . util . List < java . lang . String > permissions = java . util . Arrays . asList ( ) ; when ( projectDescriptor . getPermissions ( ) ) . thenReturn ( permissions ) ; "<AssertPlaceHolder>" ; } hasRunPermission ( ) { org . eclipse . che . ide . api . app . CurrentProject currentProject = appContext . getCurrentProject ( ) ; return ( currentProject != null ) && ( currentProject . getProjectDescription ( ) . getPermissions ( ) . contains ( "run" ) ) ; }
org . junit . Assert . assertThat ( util . hasRunPermission ( ) , org . hamcrest . CoreMatchers . is ( false ) )
testGetDateStringByte_IncompleteMonthRoundDown ( ) { java . util . Date dateReceived = de . persosim . simulator . utils . Utils . getDate ( "1964XX29" , ( ( byte ) ( - 1 ) ) ) ; java . util . Calendar calendar = java . util . Calendar . getInstance ( ) ; calendar . set ( Calendar . YEAR , 1964 ) ; calendar . set ( Calendar . MONTH , Calendar . JANUARY ) ; calendar . set ( Calendar . DATE , 29 ) ; calendar . set ( Calendar . HOUR_OF_DAY , 0 ) ; calendar . set ( Calendar . MINUTE , 0 ) ; calendar . set ( Calendar . SECOND , 0 ) ; calendar . set ( Calendar . MILLISECOND , 0 ) ; java . util . Date dateExpected = calendar . getTime ( ) ; "<AssertPlaceHolder>" ; } set ( java . lang . String , java . lang . String ) { org . globaltester . base . PreferenceHelper . setPreferenceValue ( "de.persosim.simulator" , key , value ) ; org . globaltester . base . PreferenceHelper . flush ( "de.persosim.simulator" ) ; }
org . junit . Assert . assertEquals ( dateExpected , dateReceived )
testDetectHyperlinksNoRegionAndTextViewer ( ) { org . eclipse . linuxtools . internal . rpm . ui . editor . hyperlink . SpecfileElementHyperlinkDetector elementDetector = new org . eclipse . linuxtools . internal . rpm . ui . editor . hyperlink . SpecfileElementHyperlinkDetector ( ) ; elementDetector . setSpecfile ( specfile ) ; org . eclipse . jface . text . hyperlink . IHyperlink [ ] returned = elementDetector . detectHyperlinks ( null , null , false ) ; "<AssertPlaceHolder>" ; } detectHyperlinks ( org . eclipse . jface . text . ITextViewer , org . eclipse . jface . text . IRegion , boolean ) { if ( ( region == null ) || ( textViewer == null ) ) { return null ; } org . eclipse . jface . text . IDocument document = textViewer . getDocument ( ) ; if ( document == null ) { return null ; } if ( ( specfile ) == null ) { org . eclipse . linuxtools . internal . rpm . ui . editor . SpecfileEditor a = this . getAdapter ( org . eclipse . linuxtools . internal . rpm . ui . editor . SpecfileEditor . class ) ; if ( ( a != null ) && ( ( a . getSpecfile ( ) ) != null ) ) { specfile = a . getSpecfile ( ) ; } else { org . eclipse . linuxtools . rpm . ui . editor . parser . SpecfileParser parser = new org . eclipse . linuxtools . rpm . ui . editor . parser . SpecfileParser ( ) ; specfile = parser . parse ( document ) ; } } int offset = region . getOffset ( ) ; org . eclipse . jface . text . IRegion lineInfo ; java . lang . String line ; try { lineInfo = document . getLineInformationOfOffset ( offset ) ; line = document . get ( lineInfo . getOffset ( ) , lineInfo . getLength ( ) ) ; } catch ( org . eclipse . jface . text . BadLocationException ex ) { return null ; } int offsetInLine = offset - ( lineInfo . getOffset ( ) ) ; com . ibm . icu . util . StringTokenizer tokens = new com . ibm . icu . util . StringTokenizer ( line ) ; java . lang . String word = "" ; int tempLineOffset = 0 ; int wordOffsetInLine = 0 ; while ( tokens . hasMoreTokens ( ) ) { java . lang . String tempWord = tokens . nextToken ( ) ; java . util . regex . Pattern defineRegexp = java . util . regex . Pattern . compile ( "%\\{(.*?)\\}" ) ; java . util . regex . Matcher fit = defineRegexp . matcher ( tempWord ) ; while ( fit . find ( ) ) { if ( ( ( ( fit . start ( ) ) + tempLineOffset ) <= offsetInLine ) && ( offsetInLine <= ( ( fit . end ( ) ) + tempLineOffset ) ) ) { tempWord = fit . group ( ) ; wordOffsetInLine = fit . start ( ) ; tempLineOffset += fit . start ( ) ; break ; } } tempLineOffset += tempWord . length ( ) ; word = tempWord ; if ( tempLineOffset > offsetInLine ) { break ; } } if ( word . startsWith ( org . eclipse . linuxtools . internal . rpm . ui . editor . hyperlink . SpecfileElementHyperlinkDetector . SOURCE_IDENTIFIER ) ) { int sourceNumber = java . lang . Integer . valueOf ( word . substring ( org . eclipse . linuxtools . internal . rpm . ui . editor . hyperlink . SpecfileElementHyperlinkDetector . SOURCE_IDENTIFIER . length ( ) , ( ( word . length ( ) ) - 1 ) ) ) . intValue ( ) ; org . eclipse . linuxtools . internal . rpm . ui . editor . parser . SpecfileSource source = specfile . getSource ( sourceNumber ) ; if ( source != null ) { return prepareHyperlink ( lineInfo , line , word , source ) ; } } else if ( word . startsWith ( org . eclipse . linuxtools . internal . rpm . ui . editor . hyperlink . SpecfileElementHyperlinkDetector . PATCH_IDENTIFIER ) ) { int sourceNumber = java . lang . Integer . valueOf ( word . substring ( org . eclipse . linuxtools . internal . rpm . ui . editor . hyperlink . SpecfileElementHyperlinkDetector . PATCH_IDENTIFIER . length ( ) , word . length ( ) ) ) . intValue ( ) ; org . eclipse . linuxtools . internal . rpm . ui . editor . parser . SpecfileSource source = specfile . getPatch ( sourceNumber ) ; if ( source != null ) { return prepareHyperlink ( lineInfo , line , word , source ) ; } } else { java . lang . String defineName = getDefineName ( word ) ; org . eclipse . linuxtools . rpm . ui . editor . parser . SpecfileDefine define = specfile . getDefine ( defineName ) ; if ( define != null ) { return prepareHyperlink ( lineInfo , line , defineName , define , wordOffsetInLine ) ; } } return null ; }
org . junit . Assert . assertNull ( returned )
getUrl_returnsFormattedUrlForDefect ( ) { jenkins . plugins . coverity . ws . TestWebServiceFactory . TestConfigurationService testConfigurationService = ( ( jenkins . plugins . coverity . ws . TestWebServiceFactory . TestConfigurationService ) ( jenkins . plugins . coverity . ws . WebServiceFactory . getInstance ( ) . getConfigurationService ( cimInstance ) ) ) ; testConfigurationService . setupProjects ( "project" , 1 , "stream" , 1 ) ; java . util . List < jenkins . plugins . coverity . CoverityDefect > defects = new java . util . ArrayList ( ) ; defects . add ( new jenkins . plugins . coverity . CoverityDefect ( java . lang . Long . valueOf ( 1234 ) , "CHECKER_NAME" , "functionDisplayName" , "/path/to/class" ) ) ; jenkins . plugins . coverity . CoverityBuildAction coverityBuildAction = new jenkins . plugins . coverity . CoverityBuildAction ( mock ( hudson . model . AbstractBuild . class ) , "project0" , "stream1" , cimInstance . getName ( ) , defects ) ; final java . lang . String url = coverityBuildAction . getURL ( defects . get ( 0 ) ) ; java . lang . String expectedUrl = java . lang . String . format ( "https://%s:%d/sourcebrowser.htm?projectId=%s&mergedDefectId=%d" , cimInstance . getHost ( ) , cimInstance . getPort ( ) , 0 , defects . get ( 0 ) . getCid ( ) ) ; "<AssertPlaceHolder>" ; } getCid ( ) { return cid ; }
org . junit . Assert . assertEquals ( expectedUrl , url )