input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
shouldMatchIfFieldAndCodeAreNonNullAndContainedInGivenErrorsWithASingleFieldError ( ) { matcher = org . openmrs . test . matchers . HasFieldErrors . hasFieldErrors ( "uuid" , "duplicate.uuid" ) ; item . rejectValue ( "uuid" , "duplicate.uuid" ) ; "<AssertPlaceHolder>" ; } matchesSafely ( org . springframework . validation . Errors ) { if ( ( field ) == null ) { return item . hasFieldErrors ( ) ; } else if ( ( code ) == null ) { return item . hasFieldErrors ( field ) ; } else { return item . getFieldErrors ( field ) . stream ( ) . map ( DefaultMessageSourceResolvable :: getCode ) . anyMatch ( code :: equals ) ; } }
|
org . junit . Assert . assertTrue ( matcher . matchesSafely ( item ) )
|
testGetInnerExpression5 ( ) { java . lang . String backText = "update(m)<sp>{asdasdas==asdasd,<sp>asdasd" ; java . lang . String previous = "asdasd" ; "<AssertPlaceHolder>" ; } getInnerExpression ( java . lang . String ) { java . lang . String last = org . drools . eclipse . editors . completion . CompletionUtil . getLastExpression ( backText ) . trim ( ) ; char [ ] c = last . toCharArray ( ) ; int start = 0 ; for ( int i = ( c . length ) - 1 ; i >= 0 ; i -- ) { if ( ( ( ( ( ( ( ( ( ( ( ( ( java . lang . Character . isWhitespace ( c [ i ] ) ) || ( ( c [ i ] ) == '(' ) ) || ( ( c [ i ] ) == '+' ) ) || ( ( c [ i ] ) == ')' ) ) || ( ( c [ i ] ) == '[' ) ) || ( ( c [ i ] ) == ']' ) ) || ( ( c [ i ] ) == ':' ) ) || ( ( c [ i ] ) == '=' ) ) || ( ( c [ i ] ) == '<' ) ) || ( ( c [ i ] ) == '>' ) ) || ( ( c [ i ] ) == ',' ) ) || ( ( c [ i ] ) == '{' ) ) || ( ( c [ i ] ) == '}' ) ) { start = i + 1 ; break ; } } last = last . substring ( start ) ; return last ; }
|
org . junit . Assert . assertEquals ( previous , org . drools . eclipse . editors . completion . CompletionUtil . getInnerExpression ( backText ) )
|
setBaseListOfNumbers ( ) { graphics . setBase ( numberList ) ; "<AssertPlaceHolder>" ; } getBases ( ) { return null ; }
|
org . junit . Assert . assertEquals ( numberList , graphics . getBases ( ) )
|
testSerialization ( ) { org . jfree . chart . renderer . xy . GradientXYBarPainter p1 = new org . jfree . chart . renderer . xy . GradientXYBarPainter ( 0.1 , 0.2 , 0.3 ) ; org . jfree . chart . renderer . xy . GradientXYBarPainter p2 = ( ( org . jfree . chart . renderer . xy . GradientXYBarPainter ) ( org . jfree . chart . TestUtils . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( p1 , p2 )
|
testGroupByHavingAggregate ( ) { long results = streams . streamAll ( em , org . jinq . jpa . test . entities . Lineorder . class ) . where ( ( lo ) -> "Screws" . equals ( lo . getItem ( ) . getName ( ) ) ) . select ( ( lo ) -> lo . getSale ( ) ) . group ( ( s ) -> new Pair < java . lang . String , java . lang . Integer > ( s . getCustomer ( ) . getName ( ) , s . getCustomer ( ) . getSalary ( ) ) , ( c , stream ) -> ( c . getTwo ( ) ) + ( stream . count ( ) ) ) . where ( ( group ) -> ( group . getTwo ( ) ) < 220 ) . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { org . jinq . hibernate . HibernateQueryComposer < java . lang . Long > result = applyTransformWithLambda ( new org . jinq . jpa . transform . CountTransform ( getConfig ( ) ) ) ; if ( result != null ) return result . executeAndGetSingleResult ( ) ; translationFail ( ) ; return null ; }
|
org . junit . Assert . assertEquals ( 1 , results )
|
testAttenderingscriteriumZonderGevuldAttenderingsCriterium ( ) { final nl . bzk . brp . expressietaal . Expressie resultaat = expressieService . geefAttenderingsCriterium ( maakLeveringsAutorisatie ( SoortDienst . ATTENDERING , null , nl . bzk . brp . levering . business . expressietaal . impl . ExpressieServiceImplTest . ONWAAR , null ) ) ; "<AssertPlaceHolder>" ; } maakLeveringsAutorisatie ( nl . bzk . brp . model . algemeen . stamgegeven . autaut . SoortDienst , java . lang . String , java . lang . String , java . lang . String ) { final nl . bzk . brp . model . algemeen . stamgegeven . autaut . Leveringsautorisatie la = nl . bzk . brp . model . algemeen . stamgegeven . autaut . TestLeveringsautorisatieBuilder . maker ( ) . metPopulatiebeperking ( populatiebeperking ) . maak ( ) ; final nl . bzk . brp . model . algemeen . stamgegeven . autaut . ToegangLeveringsautorisatie tla = nl . bzk . brp . model . algemeen . stamgegeven . autaut . TestToegangLeveringautorisatieBuilder . maker ( ) . metLeveringsautorisatie ( la ) . maak ( ) ; final nl . bzk . brp . model . algemeen . stamgegeven . autaut . Dienst dienst = nl . bzk . brp . model . algemeen . stamgegeven . autaut . TestDienstBuilder . maker ( ) . metAttenderingscriterium ( attenderingscriterium ) . metSoortDienst ( soortDienst ) . maak ( ) ; nl . bzk . brp . model . algemeen . stamgegeven . autaut . TestDienstbundelBuilder . maker ( ) . metDiensten ( dienst ) . metNaderePopulatiebeperking ( naderePopulatiebeperking ) . maak ( ) ; return new nl . bzk . brp . levering . model . Leveringinformatie ( tla , dienst ) ; }
|
org . junit . Assert . assertNull ( resultaat )
|
should_run_as_first_test ( ) { ( org . arquillian . with . set . test . method . order . TestWithChangedTestMethodOrder . number ) ++ ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 1 , org . arquillian . with . set . test . method . order . TestWithChangedTestMethodOrder . number )
|
applyTest ( ) { java . lang . String [ ] [ ] tests = new java . lang . String [ ] [ ] { new java . lang . String [ ] { "{{<sp>'a'<sp>|<sp>prepend:<sp>'b'<sp>}}" , "ba" } , new java . lang . String [ ] { "{{<sp>''<sp>|<sp>prepend:<sp>''<sp>}}" , "" } , new java . lang . String [ ] { "{{<sp>1<sp>|<sp>prepend:<sp>23<sp>}}" , "231" } , new java . lang . String [ ] { "{{<sp>nil<sp>|<sp>prepend:<sp>'a'<sp>}}" , "a" } , new java . lang . String [ ] { "{{<sp>nil<sp>|<sp>prepend:<sp>nil<sp>}}" , "" } } ; for ( java . lang . String [ ] test : tests ) { liqp . Template template = liqp . Template . parse ( test [ 0 ] ) ; java . lang . String rendered = java . lang . String . valueOf ( template . render ( ) ) ; "<AssertPlaceHolder>" ; } } render ( ) { return render ( new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; }
|
org . junit . Assert . assertThat ( rendered , org . hamcrest . CoreMatchers . is ( test [ 1 ] ) )
|
test_getAdaptiveInstance_InjectNotExtFail ( ) { com . alibaba . cooma . ext6 . InjectExt ext = com . alibaba . cooma . ExtensionLoader . getExtensionLoader ( com . alibaba . cooma . ext6 . InjectExt . class ) . getExtension ( "impl2" ) ; com . alibaba . cooma . ext6 . impl . Ext6Impl2 impl = ( ( com . alibaba . cooma . ext6 . impl . Ext6Impl2 ) ( ext ) ) ; "<AssertPlaceHolder>" ; } getList ( ) { return list ; }
|
org . junit . Assert . assertNull ( impl . getList ( ) )
|
testBuildWithOrderByWithLambdaFunction ( ) { java . lang . String query = "SELECT<sp>FROM<sp>SMTH<sp>%s" ; java . lang . String condition = "condition<sp>" ; java . lang . Object parameter = new java . lang . Object ( ) ; java . lang . String condition1 = "condition1<sp>" ; java . lang . Object nullParameter = null ; java . lang . String condition3 = "condition2.name<sp>=<sp>''{0}''<sp>" ; java . util . List < java . lang . String > names = java . util . Arrays . asList ( "name1" , "name2" , "name3" ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "name1" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "name2" , org . lnu . is . pagination . OrderByType . DESC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 ) ; java . lang . String expected = "SELECT<sp>FROM<sp>SMTH<sp>WHERE<sp>condition<sp>AND<sp>(condition2.name<sp>=<sp>'name1'<sp>OR<sp>condition2.name<sp>=<sp>'name2'<sp>OR<sp>condition2.name<sp>=<sp>'name3'<sp>)<sp>ORDER<sp>BY<sp>e.name1<sp>ASC,<sp>e.name2<sp>DESC" ; java . lang . String actual = org . lnu . is . dao . builder . BaseQueryBuilder . getInstance ( query ) . where ( ) . addOrCondition ( condition , parameter ) . addOrCondition ( condition1 , nullParameter ) . addAndConditionForLoop ( ( o ) -> java . text . MessageFormat . format ( condition3 , o ) , names ) . orderBy ( orders ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return getFinalQuery ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
rebuildOneCollectionIndex ( ) { org . apache . usergrid . persistence . RebuildIndexTest . logger . info ( "catshepards" 4 ) ; java . lang . String rand = org . apache . commons . lang . RandomStringUtils . randomAlphanumeric ( 5 ) ; final org . apache . usergrid . persistence . UUID appId = setup . createApplication ( ( "catshepards" 0 + rand ) , ( "catshepards" 9 + rand ) ) ; final org . apache . usergrid . persistence . EntityManager em = setup . getEmf ( ) . getEntityManager ( appId ) ; final org . apache . usergrid . corepersistence . index . ReIndexService reIndexService = setup . getInjector ( ) . getInstance ( org . apache . usergrid . corepersistence . index . ReIndexService . class ) ; org . apache . usergrid . persistence . Map < java . lang . String , java . lang . Object > entityMap = new org . apache . usergrid . persistence . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( "catshepards" 7 , 1000 ) ; put ( "key2" , 2000 ) ; put ( "catshepards" 8 , "Some<sp>value" ) ; } } ; org . apache . usergrid . persistence . List < org . apache . usergrid . persistence . EntityRef > entityRefs = new org . apache . usergrid . persistence . ArrayList < org . apache . usergrid . persistence . EntityRef > ( ) ; int herderCount = 0 ; int shepardCount = 0 ; for ( int i = 0 ; i < ( org . apache . usergrid . persistence . RebuildIndexTest . ENTITIES_TO_INDEX ) ; i ++ ) { final org . apache . usergrid . persistence . Entity entity ; try { entityMap . put ( "key" , i ) ; if ( ( i % 2 ) == 0 ) { entity = em . create ( "catherder" , entityMap ) ; herderCount ++ ; } else { entity = em . create ( "catshepards" 6 , entityMap ) ; shepardCount ++ ; } } catch ( java . lang . Exception ex ) { throw new java . lang . RuntimeException ( "catshepards" 3 , ex ) ; } entityRefs . add ( new org . apache . usergrid . persistence . SimpleEntityRef ( entity . getType ( ) , entity . getUuid ( ) ) ) ; if ( ( i % 10 ) == 0 ) { org . apache . usergrid . persistence . RebuildIndexTest . logger . info ( "Created<sp>{}<sp>entities" , i ) ; } } org . apache . usergrid . persistence . RebuildIndexTest . logger . info ( "Created<sp>{}<sp>entities" , org . apache . usergrid . persistence . RebuildIndexTest . ENTITIES_TO_INDEX ) ; app . waitForQueueDrainAndRefreshIndex ( 1000 ) ; org . apache . usergrid . persistence . RebuildIndexTest . logger . debug ( "Created<sp>{}<sp>entities" 0 ) ; retryReadData ( em , "catshepards" 1 , herderCount , 0 , 10 ) ; retryReadData ( em , "catshepards" , shepardCount , 0 , 10 ) ; org . apache . usergrid . persistence . RebuildIndexTest . logger . debug ( "Deleting<sp>apps" ) ; deleteIndex ( em . getApplicationId ( ) ) ; org . apache . usergrid . persistence . RebuildIndexTest . logger . debug ( "Reading<sp>data,<sp>should<sp>fail<sp>this<sp>time<sp>" ) ; readData ( em , "catshepards" 2 , 0 , 0 ) ; org . apache . usergrid . persistence . RebuildIndexTest . logger . debug ( "Preparing<sp>to<sp>rebuild<sp>all<sp>indexes" ) ; final org . apache . usergrid . corepersistence . index . ReIndexRequestBuilder builder = reIndexService . getBuilder ( ) . withApplicationId ( em . getApplicationId ( ) ) . withCollection ( "catshepards" 1 ) ; org . apache . usergrid . corepersistence . index . ReIndexService . ReIndexStatus status = reIndexService . rebuildIndex ( builder ) ; "<AssertPlaceHolder>" ; org . apache . usergrid . persistence . RebuildIndexTest . logger . info ( "Rebuilt<sp>index" ) ; waitForRebuild ( em . getApplicationId ( ) . toString ( ) , status . getCollectionName ( ) , reIndexService ) ; retryReadData ( em , "catshepards" 1 , herderCount , 0 , 30 ) ; retryReadData ( em , "catshepards" , 0 , 0 , 30 ) ; } getCollectionName ( ) { return collectionName ; }
|
org . junit . Assert . assertNotNull ( status . getCollectionName ( ) , "catshepards" 5 )
|
testNoSuchNews ( ) { final net . violet . platform . api . actions . Action theAction = new net . violet . platform . api . actions . news . Delete ( ) ; final net . violet . platform . api . callers . APICaller caller = getPublicApplicationAPICaller ( ) ; final java . util . Map < java . lang . String , java . lang . Object > theParams = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; theParams . put ( "id" , "JPFR" ) ; final net . violet . platform . api . actions . ActionParam theActionParam = new net . violet . platform . api . actions . ActionParam ( caller , theParams ) ; final java . lang . Object theResult = theAction . processRequest ( theActionParam ) ; "<AssertPlaceHolder>" ; } put ( K , T ) { this . mMap . put ( theRef , new net . violet . db . cache . CacheReference < K , T > ( theRef , theRecord , this . mReferenceQueue ) ) ; this . mLinkedMap . put ( theRef , theRecord ) ; }
|
org . junit . Assert . assertNotNull ( theResult )
|
test_put_map_exact ( ) { org . jerlang . type . Map expected = new org . jerlang . type . Map ( ) ; expected . set ( org . jerlang . erts . emulator . op . PutMapExactTest . a , org . jerlang . type . Integer . of ( 2 ) ) ; expected . set ( org . jerlang . erts . emulator . op . PutMapExactTest . b , org . jerlang . type . Integer . of ( 3 ) ) ; org . jerlang . type . Term result = org . jerlang . erts . Erlang . apply ( org . jerlang . erts . emulator . op . PutMapExactTest . put_map_exact , org . jerlang . erts . emulator . op . PutMapExactTest . test , List . nil ) ; "<AssertPlaceHolder>" ; } apply ( org . jerlang . type . Term , org . jerlang . type . Term , org . jerlang . type . Term ) { return org . jerlang . erts . erlang . ErlangApply . apply_3 ( m , f , a ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testCreateQueryChainBlank ( ) { final java . util . List < org . apache . lucene . search . Query > query = new org . yes . cart . search . query . impl . ProductShopSearchQueryBuilder ( ) . createQueryChain ( null , "productShopId" , "<sp>" ) ; "<AssertPlaceHolder>" ; } createQueryChain ( org . yes . cart . search . dto . NavigationContext , java . lang . String , java . lang . Object ) { java . lang . String strValue = "1" ; if ( value instanceof java . util . Collection ) { if ( org . apache . commons . collections . CollectionUtils . isNotEmpty ( ( ( java . util . Collection ) ( value ) ) ) ) { strValue = ( "0" . equals ( ( ( java . util . Collection ) ( value ) ) . iterator ( ) . next ( ) ) ) ? "0" : "1" ; } } else { strValue = ( "0" . equals ( value ) ) ? "0" : "1" ; } return java . util . Collections . singletonList ( createNumericQuery ( ( ( PRODUCT_SHOP_INSTOCK_FLAG_FIELD ) + strValue ) , navigationContext . getCustomerShopId ( ) ) ) ; }
|
org . junit . Assert . assertNull ( query )
|
afterPropertiesSetCreatesSnapshotServiceAdapterButSuppressesImportOnInit ( ) { org . springframework . data . gemfire . snapshot . SnapshotServiceFactoryBean . SnapshotServiceAdapter mockSnapshotService = org . mockito . Mockito . mock ( org . springframework . data . gemfire . snapshot . SnapshotServiceFactoryBean . SnapshotServiceAdapter . class , "MockSnapshotServiceAdapter" ) ; org . springframework . data . gemfire . snapshot . SnapshotServiceFactoryBean factoryBean = new org . springframework . data . gemfire . snapshot . SnapshotServiceFactoryBean ( ) { @ org . springframework . data . gemfire . snapshot . Override protected org . springframework . data . gemfire . snapshot . SnapshotServiceFactoryBean . SnapshotServiceAdapter create ( ) { return mockSnapshotService ; } } ; factoryBean . setSuppressImportOnInit ( true ) ; factoryBean . afterPropertiesSet ( ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( mockSnapshotService , org . mockito . Mockito . never ( ) ) . doImport ( org . mockito . ArgumentMatchers . any ( org . springframework . data . gemfire . snapshot . SnapshotServiceFactoryBean . SnapshotMetadata [ ] . class ) ) ; } getSuppressImportOnInit ( ) { return Boolean . TRUE . equals ( suppressImportOnInit ) ; }
|
org . junit . Assert . assertThat ( factoryBean . getSuppressImportOnInit ( ) , org . hamcrest . CoreMatchers . is ( true ) )
|
testNothingComputedIfNoMeasuresFound ( ) { final com . hello2morrow . sonarplugin . measurecomputer . SonargraphAggregatedMeasureComputer computer = new com . hello2morrow . sonarplugin . measurecomputer . SonargraphAggregatedMeasureComputer ( ) ; final org . sonar . api . ce . measure . MeasureComputer . MeasureComputerDefinition . Builder builder = mock ( org . sonar . api . ce . measure . MeasureComputer . MeasureComputerDefinition . Builder . class ) ; when ( builder . setInputMetrics ( org . mockito . Matchers . < java . lang . String > anyVararg ( ) ) ) . thenReturn ( builder ) ; when ( builder . setOutputMetrics ( org . mockito . Matchers . < java . lang . String > anyVararg ( ) ) ) . thenReturn ( builder ) ; final org . sonar . api . ce . measure . MeasureComputer . MeasureComputerDefinitionContext defContext = mock ( org . sonar . api . ce . measure . MeasureComputer . MeasureComputerDefinitionContext . class ) ; when ( defContext . newDefinitionBuilder ( ) ) . thenReturn ( builder ) ; computer . define ( defContext ) ; final org . sonar . api . ce . measure . Component project = mock ( org . sonar . api . ce . measure . Component . class ) ; when ( project . getType ( ) ) . thenReturn ( Component . Type . PROJECT ) ; final org . sonar . api . ce . measure . MeasureComputer . MeasureComputerContext context = mock ( org . sonar . api . ce . measure . MeasureComputer . MeasureComputerContext . class ) ; when ( context . getComponent ( ) ) . thenReturn ( project ) ; final org . sonar . api . ce . measure . Measure measure = mock ( org . sonar . api . ce . measure . Measure . class ) ; when ( measure . getBooleanValue ( ) ) . thenReturn ( Boolean . TRUE ) ; when ( context . getMeasure ( SonargraphInternalMetrics . ROOT_PROJECT_TO_BE_PROCESSED . key ( ) ) ) . thenReturn ( measure ) ; "<AssertPlaceHolder>" ; computer . compute ( context ) ; verify ( context , never ( ) ) . addMeasure ( anyString ( ) , anyInt ( ) ) ; } needsProcessing ( com . hello2morrow . sonarplugin . measurecomputer . MeasureComputerContext ) { final org . sonar . api . ce . measure . Measure measure = context . getMeasure ( SonargraphInternalMetrics . ROOT_PROJECT_TO_BE_PROCESSED . key ( ) ) ; final boolean needsProcessing = ( measure != null ) && ( measure . getBooleanValue ( ) ) ; if ( ! needsProcessing ) { com . hello2morrow . sonarplugin . measurecomputer . SonargraphMeasureComputer . LOGGER . error ( ( "Not<sp>processing<sp>for<sp>module:<sp>" + ( context . getComponent ( ) . getKey ( ) ) ) ) ; } return needsProcessing ; }
|
org . junit . Assert . assertTrue ( computer . needsProcessing ( context ) )
|
testFetchAndParseJsonDocumentStream ( ) { try ( java . io . InputStream in = getJsonStream ( "org/ojai/test/data/manydocs.json" ) ; org . ojai . DocumentStream stream = org . ojai . json . Json . newDocumentStream ( in ) ) { int documentCount = 0 ; for ( org . ojai . DocumentReader reader : stream . documentReaders ( ) ) { documentCount ++ ; if ( documentCount == 1 ) { validateDocumentReaderOne ( reader ) ; } else if ( documentCount == 2 ) { validateDocumentReaderTwo ( reader ) ; } else { validateDocumentReaderThree ( reader ) ; } } "<AssertPlaceHolder>" ; } } validateDocumentReaderThree ( org . ojai . DocumentReader ) { org . junit . Assert . assertEquals ( EventType . START_MAP , r . next ( ) ) ; org . junit . Assert . assertEquals ( EventType . STRING , r . next ( ) ) ; org . junit . Assert . assertEquals ( "3" , r . getString ( ) ) ; org . junit . Assert . assertEquals ( EventType . START_ARRAY , r . next ( ) ) ; org . junit . Assert . assertEquals ( "name" , r . getFieldName ( ) ) ; org . junit . Assert . assertEquals ( EventType . STRING , r . next ( ) ) ; org . junit . Assert . assertEquals ( EventType . STRING , r . next ( ) ) ; org . junit . Assert . assertEquals ( EventType . STRING , r . next ( ) ) ; org . junit . Assert . assertTrue ( ( ! ( r . inMap ( ) ) ) ) ; org . junit . Assert . assertEquals ( EventType . STRING , r . next ( ) ) ; org . junit . Assert . assertEquals ( EventType . START_MAP , r . next ( ) ) ; org . junit . Assert . assertEquals ( EventType . DOUBLE , r . next ( ) ) ; org . junit . Assert . assertEquals ( "age" , r . getFieldName ( ) ) ; org . junit . Assert . assertEquals ( EventType . END_MAP , r . next ( ) ) ; org . junit . Assert . assertEquals ( EventType . END_ARRAY , r . next ( ) ) ; org . junit . Assert . assertEquals ( EventType . END_MAP , r . next ( ) ) ; org . junit . Assert . assertNull ( r . next ( ) ) ; }
|
org . junit . Assert . assertEquals ( 3 , documentCount )
|
testRobolectricAssetsDependenciesVmArgHasCorrectFormat ( ) { com . facebook . buck . io . filesystem . ProjectFilesystem filesystem = new com . facebook . buck . io . filesystem . impl . FakeProjectFilesystem ( temporaryFolder . getRoot ( ) ) ; filesystem . mkdirs ( java . nio . file . Paths . get ( "assets1/svg" ) ) ; filesystem . mkdirs ( java . nio . file . Paths . get ( "assets2/xml" ) ) ; filesystem . mkdirs ( java . nio . file . Paths . get ( "assets3_to_ignore" ) ) ; java . nio . file . Path assetsDep1 = java . nio . file . Paths . get ( "assets1" ) ; java . nio . file . Path assetsDep2 = java . nio . file . Paths . get ( "assets2" ) ; java . nio . file . Path assetsDep3 = java . nio . file . Paths . get ( "assets3_to_ignore" ) ; com . facebook . buck . core . model . BuildTarget robolectricBuildTarget = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//java/src/com/facebook/base/robolectricTest:robolectricTest" ) ; com . facebook . buck . core . model . targetgraph . TargetNode < ? > robolectricTestNode = com . facebook . buck . android . RobolectricTestBuilder . createBuilder ( robolectricBuildTarget , filesystem ) . build ( ) ; com . facebook . buck . core . model . targetgraph . TargetGraph targetGraph = com . facebook . buck . core . model . targetgraph . TargetGraphFactory . newInstance ( robolectricTestNode ) ; com . facebook . buck . core . rules . ActionGraphBuilder graphBuilder = new com . facebook . buck . core . rules . resolver . impl . TestActionGraphBuilder ( targetGraph , com . facebook . buck . android . RobolectricTestBuilder . createToolchainProviderForRobolectricTest ( ) ) ; com . facebook . buck . core . sourcepath . resolver . SourcePathResolver pathResolver = com . facebook . buck . core . sourcepath . resolver . impl . DefaultSourcePathResolver . from ( new com . facebook . buck . core . rules . SourcePathRuleFinder ( graphBuilder ) ) ; com . facebook . buck . android . RobolectricTest robolectricTest = ( ( com . facebook . buck . android . RobolectricTest ) ( graphBuilder . requireRule ( robolectricBuildTarget ) ) ) ; java . lang . String result = robolectricTest . getRobolectricAssetsDirectories ( pathResolver , com . google . common . collect . ImmutableList . of ( new com . facebook . buck . android . RobolectricTestRuleTest . ResourceRule ( null , com . facebook . buck . core . sourcepath . FakeSourcePath . of ( filesystem , assetsDep1 ) ) , new com . facebook . buck . android . RobolectricTestRuleTest . ResourceRule ( null , null ) , new com . facebook . buck . android . RobolectricTestRuleTest . ResourceRule ( null , com . facebook . buck . core . sourcepath . FakeSourcePath . of ( filesystem , assetsDep2 ) ) , new com . facebook . buck . android . RobolectricTestRuleTest . ResourceRule ( null , com . facebook . buck . core . sourcepath . FakeSourcePath . of ( filesystem , assetsDep3 ) ) ) ) ; java . lang . String expectedVmArgBuilder = ( ( ( ( "-D" + ( RobolectricTest . LIST_OF_ASSETS_DIRECTORIES_PROPERTY_NAME ) ) + "=" ) + assetsDep1 ) + ( java . io . File . pathSeparator ) ) + assetsDep2 ; "<AssertPlaceHolder>" ; } of ( com . facebook . buck . io . filesystem . ProjectFilesystem , java . lang . String ) { return com . facebook . buck . core . sourcepath . FakeSourcePath . of ( filesystem , filesystem . getPath ( path ) ) ; }
|
org . junit . Assert . assertEquals ( expectedVmArgBuilder , result )
|
testGetSetVendor ( ) { com . swingsane . preferences . model . Scanner scannerPreferences = new com . swingsane . preferences . model . Scanner ( ) ; scannerPreferences . setVendor ( com . swingsane . preferences . device . ScannerPreferencesTest . MOCK_VENDOR ) ; "<AssertPlaceHolder>" ; } getVendor ( ) { return vendor ; }
|
org . junit . Assert . assertEquals ( com . swingsane . preferences . device . ScannerPreferencesTest . MOCK_VENDOR , scannerPreferences . getVendor ( ) )
|
testSetNewbie ( ) { contact . setNewbie ( true ) ; "<AssertPlaceHolder>" ; } isNewbie ( ) { return newbie ; }
|
org . junit . Assert . assertEquals ( true , contact . isNewbie ( ) )
|
testRenderDataUnchanged ( ) { registerDataKeys ( new java . lang . String [ ] { "foo" } ) ; toolitem . setData ( "foo" , "string" ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . markInitialized ( display ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . markInitialized ( toolitem ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . preserveWidgets ( ) ; lca . renderChanges ( toolitem ) ; org . eclipse . rap . rwt . testfixture . internal . TestMessage message = org . eclipse . rap . rwt . testfixture . internal . Fixture . getProtocolMessage ( ) ; "<AssertPlaceHolder>" ; } getOperationCount ( ) { return getOperations ( ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , message . getOperationCount ( ) )
|
testActualPropertiesNamesEmptyList ( ) { java . util . List < java . lang . String > propertyNames = java . util . Collections . emptyList ( ) ; java . util . List < java . lang . String > result = org . locationtech . udig . core . internal . FeatureUtils . getActualPropertyName ( org . locationtech . udig . core . FeatureUtilsTest . featureType , propertyNames ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( file ) == null ; }
|
org . junit . Assert . assertTrue ( result . isEmpty ( ) )
|
testObjectIsReleased ( ) { com . eclipsesource . v8 . utils . MemoryManager memoryManager = new com . eclipsesource . v8 . utils . MemoryManager ( v8 ) ; com . eclipsesource . v8 . V8Object object = new com . eclipsesource . v8 . V8Object ( v8 ) ; memoryManager . release ( ) ; "<AssertPlaceHolder>" ; } isReleased ( ) { return false ; }
|
org . junit . Assert . assertTrue ( object . isReleased ( ) )
|
testWriteChars ( ) { java . io . RandomAccessFile file = file ( ) ; com . asakusafw . runtime . io . util . BufferedFileOutput buf = manage ( new com . asakusafw . runtime . io . util . BufferedFileOutput ( file , 100 ) ) ; buf . writeChars ( "Hello,<sp>world!" ) ; buf . flush ( ) ; file . seek ( 0 ) ; java . lang . String expect = "Hello,<sp>world!" ; for ( char e : expect . toCharArray ( ) ) { char c = file . readChar ( ) ; "<AssertPlaceHolder>" ; } eof ( file ) ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; }
|
org . junit . Assert . assertThat ( c , is ( e ) )
|
testSanitize2 ( ) { com . liferay . portal . sanitizer . SanitizerUtilTest . _atomicState . reset ( ) ; java . io . ByteArrayOutputStream byteArrayOutputStream = new java . io . ByteArrayOutputStream ( ) ; java . io . ByteArrayInputStream byteArrayInputStream = new java . io . ByteArrayInputStream ( byteArrayOutputStream . toByteArray ( ) ) ; com . liferay . portal . kernel . sanitizer . SanitizerUtil . sanitize ( 1 , 1 , 1 , com . liferay . portal . sanitizer . bundle . sanitizerimpl . TestSanitizer . class . getName ( ) , 1 , "contentType" , byteArrayInputStream , byteArrayOutputStream ) ; "<AssertPlaceHolder>" ; } isSet ( ) { if ( Boolean . TRUE . equals ( _atomicBoolean . get ( ) ) ) { return true ; } return false ; }
|
org . junit . Assert . assertTrue ( com . liferay . portal . sanitizer . SanitizerUtilTest . _atomicState . isSet ( ) )
|
emptyValueList ( ) { java . util . List < oasis . names . tc . ebxml_regrep . xsd . rim . _3 . SlotType1 > list = createList ( ) ; list . get ( 0 ) . setValueList ( new oasis . names . tc . ebxml_regrep . xsd . rim . _3 . ValueListType ( ) ) ; com . google . common . base . Optional < java . lang . String > result = gov . hhs . fha . nhinc . util . JaxbDocumentUtils . findSlotType ( list , "expected" ) ; "<AssertPlaceHolder>" ; } absent ( ) { oasis . names . tc . ebxml_regrep . xsd . rim . _3 . ExtrinsicObjectType extrinsicObject = createExtrinsicObject ( "test" , "value" ) ; javax . xml . bind . JAXBElement < oasis . names . tc . ebxml_regrep . xsd . rim . _3 . ExtrinsicObjectType > jaxbWrapper = wrapExtrinsicObject ( extrinsicObject ) ; gov . hhs . fha . nhinc . event . builder . PayloadSizeExtractor extractor = new gov . hhs . fha . nhinc . event . builder . PayloadSizeExtractor ( ) ; com . google . common . base . Optional < java . lang . String > payloadSize = extractor . apply ( jaxbWrapper ) ; org . junit . Assert . assertFalse ( payloadSize . isPresent ( ) ) ; }
|
org . junit . Assert . assertEquals ( com . google . common . base . Optional . absent ( ) , result )
|
convert_shouldReturnEqualsDateFromString ( ) { java . util . Date date = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSS" ) . parse ( "2011-05-01T00:00:00.000" ) ; java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . setTime ( date ) ; cal . setTimeZone ( java . util . TimeZone . getDefault ( ) ) ; java . util . Date expected = cal . getTime ( ) ; java . lang . String [ ] dateFormats = new java . lang . String [ ] { "2011-05-01" , "2011-05-01<sp>00:00:00" , "2011-05-01T00:00:00.000" , "2011-05-01T00:00:00.000" } ; for ( int i = 0 ; i < ( dateFormats . length ) ; i ++ ) { java . util . Date result = ( ( java . util . Date ) ( org . openmrs . module . webservices . rest . web . ConversionUtil . convert ( dateFormats [ i ] , java . util . Date . class ) ) ) ; "<AssertPlaceHolder>" ; } } convert ( java . lang . Object , java . lang . reflect . Type ) { if ( object == null ) return object ; java . lang . Class < ? > toClass = ( toType instanceof java . lang . Class ) ? ( ( java . lang . Class < ? > ) ( toType ) ) : ( ( java . lang . Class < ? > ) ( ( ( java . lang . reflect . ParameterizedType ) ( toType ) ) . getRawType ( ) ) ) ; if ( ( java . util . Collection . class . isAssignableFrom ( toClass ) ) || ( toClass . isArray ( ) ) ) { if ( ! ( object instanceof java . util . Collection ) ) throw new org . openmrs . module . webservices . rest . web . response . ConversionException ( ( ( ( "Can<sp>only<sp>convert<sp>a<sp>Collection<sp>to<sp>a<sp>Collection/Array.<sp>Not<sp>" + ( object . getClass ( ) ) ) + "Could<sp>not<sp>convert<sp>from<sp>" 1 ) + toType ) , null ) ; if ( toClass . isArray ( ) ) { java . lang . Class < ? > targetElementType = toClass . getComponentType ( ) ; java . util . Collection input = ( ( java . util . Collection ) ( object ) ) ; java . lang . Object ret = java . lang . reflect . Array . newInstance ( targetElementType , input . size ( ) ) ; int i = 0 ; for ( java . lang . Object element : ( ( java . util . Collection ) ( object ) ) ) { java . lang . reflect . Array . set ( ret , i , org . openmrs . module . webservices . rest . web . ConversionUtil . convert ( element , targetElementType ) ) ; ++ i ; } return ret ; } java . util . Collection ret = null ; if ( java . util . SortedSet . class . isAssignableFrom ( toClass ) ) { ret = new java . util . TreeSet ( ) ; } else if ( java . util . Set . class . isAssignableFrom ( toClass ) ) { ret = new java . util . HashSet ( ) ; } else if ( java . util . List . class . isAssignableFrom ( toClass ) ) { ret = new java . util . ArrayList ( ) ; } else { throw new org . openmrs . module . webservices . rest . web . response . ConversionException ( ( "Don't<sp>know<sp>how<sp>to<sp>handle<sp>collection<sp>class:<sp>" + toClass ) , null ) ; } if ( toType instanceof java . lang . reflect . ParameterizedType ) { java . lang . reflect . ParameterizedType toParameterizedType = ( ( java . lang . reflect . ParameterizedType ) ( toType ) ) ; java . lang . reflect . Type targetElementType = toParameterizedType . getActualTypeArguments ( ) [ 0 ] ; for ( java . lang . Object element : ( ( java . util . Collection ) ( object ) ) ) ret . add ( org . openmrs . module . webservices . rest . web . ConversionUtil . convert ( element , targetElementType ) ) ; } else { ret . addAll ( ( ( java . util . Collection ) ( object ) ) ) ; } return ret ; } if ( toClass . isAssignableFrom ( object . getClass ( ) ) ) return object ; if ( ( toClass . isAssignableFrom ( org . openmrs . module . webservices . rest . web . Float . class ) ) && ( object instanceof java . lang . Double ) ) { return new java . lang . Float ( ( ( java . lang . Double ) ( object ) ) ) ; } if ( object instanceof java . lang . String ) { java . lang . String string = ( ( java . lang . String ) ( object ) ) ; org . openmrs . module . webservices . rest . web . resource . api . Converter < ? > converter = org . openmrs . module . webservices . rest . web . ConversionUtil . getConverter ( toClass ) ; if ( converter != null ) return converter . getByUniqueId ( string ) ; if ( toClass . isAssignableFrom ( java . util . Date . class ) ) { java . lang . IllegalArgumentException pex = null ; java . lang . String [ ] supportedFormats = new java . lang . String [ ] { org . openmrs . module . webservices . rest . web . ConversionUtil . DATE_FORMAT , "yyyy-MM-dd'T'HH:mm:ss.SSS" , "yyyy-MM-dd'T'HH:mm:ssZ" , "Could<sp>not<sp>convert<sp>from<sp>" 0 , "Could<sp>not<sp>convert<sp>from<sp>" 2 , "yyyy-MM-dd<sp>HH:mm:ss" , "yyyy-MM-dd" } ; for ( int i = 0 ; i < ( supportedFormats . length ) ; i
|
org . junit . Assert . assertEquals ( result , expected )
|
testFindInstanceStaticMethod2 ( ) { java . lang . invoke . MethodHandle mh = com . jmethods . catatumbo . impl . IntrospectionUtils . findInstanceMethod ( ImmutablePhone . Builder . class , "setCountryCode" , null , java . lang . String . class ) ; "<AssertPlaceHolder>" ; } findInstanceMethod ( java . lang . Class , java . lang . String , java . lang . Class , com . jmethods . catatumbo . impl . Class [ ] ) { return com . jmethods . catatumbo . impl . IntrospectionUtils . findMethod ( clazz , methodName , false , expectedReturnType , expectedParameterTypes ) ; }
|
org . junit . Assert . assertNotNull ( mh )
|
initColumnsWithTaskVarColumnsTest ( ) { final org . jbpm . workbench . common . client . list . ListTable < org . jbpm . workbench . ht . model . TaskSummary > currentListGrid = spy ( new org . jbpm . workbench . common . client . list . ListTable ( new org . uberfire . ext . services . shared . preferences . GridGlobalPreferences ( ) ) ) ; doAnswer ( new org . mockito . stubbing . Answer ( ) { @ org . jbpm . workbench . ht . client . editors . taskslist . Override public org . jbpm . workbench . ht . client . editors . taskslist . Void answer ( org . mockito . invocation . InvocationOnMock invocationOnMock ) throws java . lang . Throwable { final java . util . List < org . uberfire . ext . widgets . table . client . ColumnMeta > columns = ( ( java . util . List < org . uberfire . ext . widgets . table . client . ColumnMeta > ) ( invocationOnMock . getArguments ( ) [ 0 ] ) ) ; "<AssertPlaceHolder>" ; return null ; } } ) . when ( currentListGrid ) . addColumns ( anyList ( ) ) ; java . util . ArrayList < org . uberfire . ext . services . shared . preferences . GridColumnPreference > columnPreferences = new java . util . ArrayList < org . uberfire . ext . services . shared . preferences . GridColumnPreference > ( ) ; columnPreferences . add ( new org . uberfire . ext . services . shared . preferences . GridColumnPreference ( "var1" , 0 , "40" ) ) ; columnPreferences . add ( new org . uberfire . ext . services . shared . preferences . GridColumnPreference ( "var2" , 1 , "40" ) ) ; columnPreferences . add ( new org . uberfire . ext . services . shared . preferences . GridColumnPreference ( "var3" , 1 , "40" ) ) ; when ( currentListGrid . getGridPreferencesStore ( ) ) . thenReturn ( gridPreferencesStore ) ; when ( gridPreferencesStore . getColumnPreferences ( ) ) . thenReturn ( columnPreferences ) ; getView ( ) . initColumns ( currentListGrid ) ; verify ( currentListGrid ) . addColumns ( anyList ( ) ) ; } answer ( org . mockito . invocation . InvocationOnMock ) { final java . util . List < org . uberfire . ext . widgets . table . client . ColumnMeta > columns = ( ( java . util . List < org . uberfire . ext . widgets . table . client . ColumnMeta > ) ( invocationOnMock . getArguments ( ) [ 0 ] ) ) ; for ( org . uberfire . ext . widgets . table . client . ColumnMeta columnMeta : columns ) { org . junit . Assert . assertNotNull ( columnMeta . getColumn ( ) . getDataStoreName ( ) ) ; } return null ; }
|
org . junit . Assert . assertEquals ( 20 , columns . size ( ) )
|
setDelegate_noExistingDelegate_shouldRegisterNewDelegate ( ) { com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQuery query = new com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQuery ( "SELECT<sp>*<sp>FROM<sp>people" , java . util . Arrays . asList ( "ID" ) , connectionPool ) ; com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQueryDelegate delegate = org . easymock . EasyMock . createMock ( com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQueryDelegate . class ) ; query . setDelegate ( delegate ) ; "<AssertPlaceHolder>" ; } getDelegate ( ) { return delegate ; }
|
org . junit . Assert . assertEquals ( delegate , query . getDelegate ( ) )
|
clientIsCalledWhenListenerIsNotified ( ) { org . appenders . log4j2 . elasticsearch . jest . BufferedJestHttpObjectFactory . Builder builder = org . appenders . log4j2 . elasticsearch . jest . BufferedJestHttpObjectFactoryTest . createTestObjectFactoryBuilder ( ) ; org . appenders . log4j2 . elasticsearch . ClientObjectFactory < io . searchbox . client . JestClient , io . searchbox . core . Bulk > config = spy ( builder . build ( ) ) ; io . searchbox . client . JestClient mockedJestClient = mock ( io . searchbox . client . JestClient . class ) ; when ( config . createClient ( ) ) . thenReturn ( mockedJestClient ) ; org . appenders . log4j2 . elasticsearch . FailoverPolicy failoverPolicy = spy ( new org . appenders . log4j2 . elasticsearch . NoopFailoverPolicy ( ) ) ; java . util . function . Function < io . searchbox . core . Bulk , java . lang . Boolean > listener = config . createBatchListener ( failoverPolicy ) ; org . appenders . log4j2 . elasticsearch . ItemSource < io . netty . buffer . ByteBuf > payload1 = createDefaultTestBuffereItemSource ( "test1" ) ; org . appenders . log4j2 . elasticsearch . ItemSource < io . netty . buffer . ByteBuf > payload2 = createDefaultTestBuffereItemSource ( "test2" ) ; io . searchbox . core . Bulk bulk = createTestBatch ( payload1 , payload2 ) ; listener . apply ( bulk ) ; org . mockito . ArgumentCaptor < io . searchbox . core . Bulk > captor = org . mockito . ArgumentCaptor . forClass ( io . searchbox . core . Bulk . class ) ; verify ( mockedJestClient , times ( 1 ) ) . executeAsync ( ( ( io . searchbox . core . Bulk ) ( captor . capture ( ) ) ) , org . mockito . Mockito . any ( ) ) ; "<AssertPlaceHolder>" ; } executeAsync ( org . appenders . log4j2 . elasticsearch . BulkEmitterTest$TestBatch , org . appenders . log4j2 . elasticsearch . TestResultHandler ) { }
|
org . junit . Assert . assertEquals ( bulk , captor . getValue ( ) )
|
testCompareToGreaterComponentVersion ( ) { org . eclipse . winery . common . version . WineryVersion smaller = new org . eclipse . winery . common . version . WineryVersion ( "1.0.0" , 7 , 1 ) ; org . eclipse . winery . common . version . WineryVersion greater = new org . eclipse . winery . common . version . WineryVersion ( "1.0.1" , 1 , 6 ) ; "<AssertPlaceHolder>" ; } compareTo ( java . lang . Object ) { if ( o instanceof org . eclipse . winery . accountability . model . BlockchainElement ) { return java . lang . Long . compare ( this . unixTimestamp , ( ( org . eclipse . winery . accountability . model . BlockchainElement ) ( o ) ) . unixTimestamp ) ; } else { throw new java . lang . IllegalArgumentException ( ) ; } }
|
org . junit . Assert . assertEquals ( ( - 1 ) , smaller . compareTo ( greater ) )
|
testDownloadMaxThreads ( ) { com . nincraft . modpackdownloader . cli . ModpackDownloaderCLI . main ( new java . lang . String [ ] { "-manifest" , ( RESOURCES ) + "download-test.json" , "-maxDownloadThreads" , "1" } ) ; java . io . File mod ; java . util . List < java . lang . String > mods = new java . util . ArrayList ( java . util . Arrays . asList ( "Thaumcraft-1.8.9-5.2.4.jar" , "DimensionalDoors-2.2.5-test9.jar" , "pants.jar" , "forge-1.8.9-11.15.1.1902-1.8.9-installer.jar" ) ) ; java . util . List < java . lang . String > checkFiles = addMods ( mods ) ; for ( java . lang . String fileCheck : checkFiles ) { mod = new java . io . File ( fileCheck ) ; "<AssertPlaceHolder>" ; mod . deleteOnExit ( ) ; } } addMods ( java . util . List ) { java . lang . String folder = "mods" + ( java . io . File . separator ) ; return mods . stream ( ) . map ( ( s ) -> folder + s ) . collect ( java . util . stream . Collectors . toList ( ) ) ; }
|
org . junit . Assert . assertTrue ( mod . exists ( ) )
|
testGetHistoriesForSubscriptionsAndBillingPeriodOlTerminatedHistory ( ) { createSubscriptionHistory ( 0L , "2012-09-10<sp>08:00:00" , 1 , ModificationType . MODIFY , SubscriptionStatus . DEACTIVATED ) ; final java . util . List < java . lang . Long > list = new java . util . ArrayList ( ) ; list . add ( java . lang . Long . valueOf ( 0 ) ) ; final java . util . List < org . oscm . domobjects . SubscriptionHistory > subscriptionHistories = new java . util . ArrayList ( ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . billingservice . dao . Override public org . oscm . billingservice . dao . Void call ( ) throws org . oscm . billingservice . dao . Exception { subscriptionHistories . addAll ( bdr . loadSubscriptionHistoriesForBillingPeriod ( list , new java . text . SimpleDateFormat ( org . oscm . billingservice . dao . BillingDataRetrievalServiceBeanSubscriptionIT . DATE_PATTERN ) . parse ( "2013-10-01<sp>08:00:00" ) . getTime ( ) , new java . text . SimpleDateFormat ( org . oscm . billingservice . dao . BillingDataRetrievalServiceBeanSubscriptionIT . DATE_PATTERN ) . parse ( "2013-11-01<sp>08:00:00" ) . getTime ( ) ) ) ; return null ; } } ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , subscriptionHistories . size ( ) )
|
testSerde ( ) { final com . fasterxml . jackson . databind . ObjectMapper objectMapper = org . apache . druid . segment . TestHelper . makeJsonMapper ( ) ; final org . apache . druid . indexing . overlord . setup . EqualDistributionWorkerSelectStrategy strategy = new org . apache . druid . indexing . overlord . setup . EqualDistributionWithAffinityWorkerSelectStrategy ( new org . apache . druid . indexing . overlord . setup . AffinityConfig ( com . google . common . collect . ImmutableMap . of ( "foo" , com . google . common . collect . ImmutableSet . of ( "localhost" ) ) , false ) ) ; final org . apache . druid . indexing . overlord . setup . WorkerSelectStrategy strategy2 = objectMapper . readValue ( objectMapper . writeValueAsBytes ( strategy ) , org . apache . druid . indexing . overlord . setup . WorkerSelectStrategy . class ) ; "<AssertPlaceHolder>" ; } writeValueAsBytes ( java . lang . Object ) { return com . google . common . primitives . Ints . toByteArray ( ( ( org . apache . druid . java . util . emitter . core . IntEvent ) ( value ) ) . index ) ; }
|
org . junit . Assert . assertEquals ( strategy , strategy2 )
|
decisionNodeIncomingsOutgoingsMustBeControlFlows ( ) { org . eclipse . uml2 . uml . DecisionNode node = UMLFactory . eINSTANCE . createDecisionNode ( ) ; org . eclipse . uml2 . uml . ObjectFlow inFlow = UMLFactory . eINSTANCE . createObjectFlow ( ) ; node . getIncomings ( ) . add ( inFlow ) ; "<AssertPlaceHolder>" ; } isValidControlFlowStart ( org . eclipse . uml2 . uml . Element ) { if ( preSource instanceof org . eclipse . uml2 . uml . ActivityNode ) { for ( final org . eclipse . uml2 . uml . ActivityEdge incoming : ( ( org . eclipse . uml2 . uml . ActivityNode ) ( preSource ) ) . getIncomings ( ) ) { if ( incoming instanceof org . eclipse . uml2 . uml . ObjectFlow ) { return false ; } } } return isValidFlowStart ( preSource ) ; }
|
org . junit . Assert . assertFalse ( services . isValidControlFlowStart ( node ) )
|
does_not_notifies_at_end_of_failed_bootstrap ( ) { final org . eclipse . leshan . server . bootstrap . BootstrapHandlerTest . MockBootstrapSessionManager bsSessionManager = new org . eclipse . leshan . server . bootstrap . BootstrapHandlerTest . MockBootstrapSessionManager ( true ) ; final org . eclipse . leshan . server . bootstrap . LwM2mBootstrapRequestSender requestSender = new org . eclipse . leshan . server . bootstrap . BootstrapHandlerTest . MockRequestSender ( false ) ; final org . eclipse . leshan . server . bootstrap . BootstrapStore bsStore = new org . eclipse . leshan . server . bootstrap . BootstrapStore ( ) { @ org . eclipse . leshan . server . bootstrap . Override public org . eclipse . leshan . server . bootstrap . BootstrapConfig getBootstrap ( java . lang . String endpoint , org . eclipse . leshan . core . request . Identity deviceIdentity ) { return new org . eclipse . leshan . server . bootstrap . BootstrapConfig ( ) ; } } ; org . eclipse . leshan . server . bootstrap . BootstrapHandler bsHandler = new org . eclipse . leshan . server . bootstrap . DefaultBootstrapHandler ( bsStore , requestSender , bsSessionManager , new java . util . concurrent . Executor ( ) { @ org . eclipse . leshan . server . bootstrap . Override public void execute ( java . lang . Runnable command ) { command . run ( ) ; } } ) ; bsHandler . bootstrap ( org . eclipse . leshan . core . request . Identity . psk ( new java . net . InetSocketAddress ( 4242 ) , "pskdentity" ) , new org . eclipse . leshan . core . request . BootstrapRequest ( "enpoint" ) ) ; "<AssertPlaceHolder>" ; } endWasCalled ( ) { return ( this . endBsSession ) != null ; }
|
org . junit . Assert . assertFalse ( bsSessionManager . endWasCalled ( ) )
|
parseTST09A_BadLong ( ) { java . io . BufferedInputStream bufferedStream = new java . io . BufferedInputStream ( new java . io . ByteArrayInputStream ( javax . xml . bind . DatatypeConverter . parseHexBinary ( ( ( org . codice . imaging . nitf . core . tre . impl . TreTortureTest . TST09A_THREE ) + "f02367" ) ) ) ) ; org . codice . imaging . nitf . core . tre . Tre tst09a = parseTST_UINT ( bufferedStream , 3 ) ; org . codice . imaging . nitf . core . tre . TreEntry uint = tst09a . getEntries ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; exception . expect ( org . codice . imaging . nitf . core . common . NitfFormatException . class ) ; exception . expectMessage ( "Failed<sp>to<sp>look<sp>up<sp>NOSUCHFIELD<sp>as<sp>a<sp>numerical<sp>value" ) ; tst09a . getLongValue ( "NOSUCHFIELD" ) ; } getEntries ( ) { return entries ; }
|
org . junit . Assert . assertNotNull ( uint )
|
testUsesLowercaseIdGenerator ( ) { org . atlasapi . media . entity . Person person = new org . atlasapi . media . entity . Person ( ) ; person . setId ( 1234L ) ; org . atlasapi . media . entity . simple . Person simplePerson = personSimplifier . simplify ( person , org . atlasapi . output . Annotation . defaultAnnotations ( ) , org . mockito . Mockito . mock ( com . metabroadcast . applications . client . model . internal . Application . class ) ) ; java . lang . String lowercasedId = simplePerson . getId ( ) . toLowerCase ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( lowercasedId , simplePerson . getId ( ) )
|
testCreate ( ) { org . oscarehr . common . model . GroupMembers entity = new org . oscarehr . common . model . GroupMembers ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
|
org . junit . Assert . assertNotNull ( entity . getId ( ) )
|
set_if_exists_should_remove_component ( ) { @ com . artemis . annotations . Wire ( injectInherited = true ) class TestSystem extends net . mostlyoriginal . api . plugin . extendedcomponentmapper . ExtendedComponentMapperPluginTest . BasicSystem { @ net . mostlyoriginal . api . plugin . extendedcomponentmapper . Override protected void process ( net . mostlyoriginal . api . plugin . extendedcomponentmapper . Entity e ) { mPos . create ( e ) ; mPos . set ( e , false ) ; "<AssertPlaceHolder>" ; } } createAndProcessWorld ( new TestSystem ( ) ) ; } has ( int ) { return mapper . has ( entityId ) ; }
|
org . junit . Assert . assertFalse ( mPos . has ( e ) )
|
getUserDisplayName ( ) { java . lang . String user = "vmmtestuser@ibm.com" ; java . lang . String displayName = "1<sp>919<sp>555<sp>5555" ; com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_SUNLDAP_SSLTest . c , "getUserDisplayName" , "Checking<sp>with<sp>a<sp>valid<sp>user." ) ; "<AssertPlaceHolder>" ; } getUserDisplayName ( java . lang . String ) { return userRegistry . getUserDisplayName ( securityName ) ; }
|
org . junit . Assert . assertEquals ( displayName , com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_SUNLDAP_SSLTest . servlet . getUserDisplayName ( user ) )
|
testShouldBeAbleToTypeTheAtCharacter ( ) { driver . get ( pages . javascriptPage ) ; org . openqa . selenium . WebElement keyReporter = driver . findElement ( org . openqa . selenium . By . id ( "keyReporter" ) ) ; keyReporter . sendKeys ( "@" ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { return commandProcessor . getString ( "getAttribute" , new java . lang . String [ ] { attributeLocator } ) ; }
|
org . junit . Assert . assertThat ( keyReporter . getAttribute ( "value" ) , org . hamcrest . Matchers . is ( "@" ) )
|
testConcurrentRenameCommandIgnore ( ) { final org . kie . workbench . common . widgets . metadata . client . TestDocument document = createTestDocument ( ) ; final org . uberfire . backend . vfs . ObservablePath path = document . getLatestPath ( ) ; concurrentRenameCommand = editor . getConcurrentRenameOnIgnoreCommand ( ) ; editor . setupMenuBar ( ) ; registerDocument ( document ) ; final org . mockito . ArgumentCaptor < org . uberfire . mvp . ParameterizedCommand > renameCommandCaptor = org . mockito . ArgumentCaptor . forClass ( org . uberfire . mvp . ParameterizedCommand . class ) ; verify ( path , times ( 1 ) ) . onConcurrentRename ( renameCommandCaptor . capture ( ) ) ; final org . uberfire . mvp . ParameterizedCommand renameCommand = renameCommandCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; final org . uberfire . backend . vfs . ObservablePath . OnConcurrentRenameEvent info = mock ( ObservablePath . OnConcurrentRenameEvent . class ) ; renameCommand . execute ( info ) ; verify ( editor , times ( 1 ) ) . enableMenus ( eq ( false ) ) ; verify ( editor , times ( 4 ) ) . enableMenuItem ( eq ( false ) , any ( org . uberfire . ext . editor . commons . client . menu . MenuItems . class ) ) ; verify ( saveMenuItem , times ( 1 ) ) . setEnabled ( eq ( false ) ) ; verify ( versionManagerMenuItem , times ( 1 ) ) . setEnabled ( eq ( false ) ) ; } getValue ( ) { return rootPath ; }
|
org . junit . Assert . assertNotNull ( renameCommand )
|
shouldRejectTimeoutOverValue ( ) { lb . setTimeout ( 150 ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( lb , org . openstack . atlas . api . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } passedValidation ( ) { return expectationResultList . isEmpty ( ) ; }
|
org . junit . Assert . assertFalse ( result . passedValidation ( ) )
|
basicOpenSSLTest1 ( ) { try ( java . net . ServerSocket serverSocket = org . wildfly . openssl . SSLTestUtils . createServerSocket ( ) ) { final java . util . concurrent . atomic . AtomicReference < byte [ ] > sessionID = new java . util . concurrent . atomic . AtomicReference ( ) ; java . lang . Thread acceptThread = new java . lang . Thread ( new org . wildfly . openssl . EchoRunnable ( serverSocket , org . wildfly . openssl . SSLTestUtils . createDSASSLContext ( "TLSv1.2" ) , sessionID , ( engine ) -> { engine . setEnabledCipherSuites ( new java . lang . String [ ] { "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" } ) ; return engine ; } ) ) ; acceptThread . start ( ) ; final javax . net . ssl . SSLContext sslContext = org . wildfly . openssl . SSLTestUtils . createClientDSASSLContext ( "openssl.TLSv1.2" ) ; final javax . net . ssl . SSLSocket socket = ( ( javax . net . ssl . SSLSocket ) ( sslContext . getSocketFactory ( ) . createSocket ( ) ) ) ; socket . setEnabledCipherSuites ( new java . lang . String [ ] { "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" } ) ; socket . connect ( org . wildfly . openssl . SSLTestUtils . createSocketAddress ( ) ) ; socket . getOutputStream ( ) . write ( "hello<sp>world" . getBytes ( StandardCharsets . US_ASCII ) ) ; socket . getOutputStream ( ) . flush ( ) ; byte [ ] data = new byte [ 100 ] ; int read = socket . getInputStream ( ) . read ( data ) ; "<AssertPlaceHolder>" ; serverSocket . close ( ) ; acceptThread . join ( ) ; } } read ( java . io . File ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; byte [ ] buf = new byte [ 100 ] ; try ( java . io . FileInputStream in = new java . io . FileInputStream ( file ) ) { int r ; while ( ( r = in . read ( buf ) ) > 0 ) { out . write ( buf , 0 , r ) ; } } return new java . lang . String ( out . toByteArray ( ) ) ; }
|
org . junit . Assert . assertEquals ( "hello<sp>world" , new java . lang . String ( data , 0 , read ) )
|
testGetNativeDataTypeClass ( ) { for ( java . lang . String valueMetaName : org . pentaho . di . core . row . value . ValueMetaFactory . getValueMetaNames ( ) ) { int valueMetaID = org . pentaho . di . core . row . value . ValueMetaFactory . getIdForValueMeta ( valueMetaName ) ; org . pentaho . di . core . row . ValueMetaInterface valueMeta = org . pentaho . di . core . row . value . ValueMetaFactory . createValueMeta ( valueMetaID ) ; try { java . lang . Class < ? > clazz = valueMeta . getNativeDataTypeClass ( ) ; "<AssertPlaceHolder>" ; } catch ( org . pentaho . di . core . exception . KettleValueException kve ) { org . junit . Assert . fail ( ( valueMetaName + "<sp>should<sp>implement<sp>getNativeDataTypeClass()" ) ) ; } } } getNativeDataTypeClass ( ) { if ( ( nativeType ) == null ) { try { nativeType = org . pentaho . di . core . row . value . ValueMetaFactory . createValueMeta ( getType ( ) ) ; } catch ( org . pentaho . di . core . exception . KettlePluginException e ) { throw new org . pentaho . di . core . exception . KettleValueException ( e ) ; } } return nativeType . getNativeDataTypeClass ( ) ; }
|
org . junit . Assert . assertNotNull ( clazz )
|
testDescriptor2 ( ) { org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer mol1 = sp . parseSmiles ( "CO" ) ; double value = ( ( org . openscience . cdk . qsar . result . DoubleResult ) ( descriptor . calculate ( mol1 . getBond ( 0 ) , mol1 ) . getValue ( ) ) ) . doubleValue ( ) ; "<AssertPlaceHolder>" ; } doubleValue ( ) { return this . value ; }
|
org . junit . Assert . assertEquals ( 2 , value , 0.0 )
|
testSearchForExtensionTwoDeepReferenceWrongType ( ) { ca . uhn . fhir . jpa . dao . r4 . SearchParameter siblingSp = new ca . uhn . fhir . jpa . dao . r4 . SearchParameter ( ) ; siblingSp . addBase ( "Patient" ) ; siblingSp . setCode ( "foobar" ) ; siblingSp . setType ( org . hl7 . fhir . r4 . model . Enumerations . SearchParamType . REFERENCE ) ; siblingSp . setTitle ( "FooBar" ) ; siblingSp . setExpression ( "Patient.extension('http://acme.org/foo').extension('http://acme.org/bar')" ) ; siblingSp . setXpathUsage ( org . hl7 . fhir . r4 . model . SearchParameter . XPathUsageType . NORMAL ) ; siblingSp . setStatus ( org . hl7 . fhir . r4 . model . Enumerations . PublicationStatus . ACTIVE ) ; siblingSp . getTarget ( ) . add ( new ca . uhn . fhir . jpa . dao . r4 . CodeType ( "Observation" ) ) ; mySearchParameterDao . create ( siblingSp , mySrd ) ; mySearchParamRegistry . forceRefresh ( ) ; ca . uhn . fhir . jpa . dao . r4 . Appointment apt = new ca . uhn . fhir . jpa . dao . r4 . Appointment ( ) ; apt . setStatus ( AppointmentStatus . ARRIVED ) ; org . hl7 . fhir . instance . model . api . IIdType aptId = myAppointmentDao . create ( apt ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . dao . r4 . Patient patient = new ca . uhn . fhir . jpa . dao . r4 . Patient ( ) ; patient . addName ( ) . setFamily ( "P2" ) ; ca . uhn . fhir . jpa . dao . r4 . Extension extParent = patient . addExtension ( ) . setUrl ( "http://acme.org/foo" ) ; extParent . addExtension ( ) . setUrl ( "http://acme.org/bar" ) . setValue ( new ca . uhn . fhir . jpa . dao . r4 . Reference ( aptId . getValue ( ) ) ) ; org . hl7 . fhir . instance . model . api . IIdType p2id = myPatientDao . create ( patient ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . searchparam . SearchParameterMap map ; ca . uhn . fhir . rest . api . server . IBundleProvider results ; java . util . List < java . lang . String > foundResources ; map = new ca . uhn . fhir . jpa . searchparam . SearchParameterMap ( ) ; map . add ( "foobar" , new ca . uhn . fhir . jpa . dao . r4 . ReferenceParam ( aptId . getValue ( ) ) ) ; results = myPatientDao . search ( map ) ; foundResources = toUnqualifiedVersionlessIdValues ( results ) ; "<AssertPlaceHolder>" ; } empty ( ) { return ( canonical . isEmpty ( ) ) && ( definitions . isEmpty ( ) ) ; }
|
org . junit . Assert . assertThat ( foundResources , empty ( ) )
|
copyFileNoSourceFile ( ) { org . mewx . wenku8 . util . LightCache . copyFile ( org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_NAME , org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_FULL_NAME_PATH , false ) ; "<AssertPlaceHolder>" ; } testFileExist ( java . lang . String ) { java . io . File file = new java . io . File ( path ) ; if ( file . exists ( ) ) { if ( ( file . length ( ) ) == 0 ) org . mewx . wenku8 . util . LightCache . deleteFile ( path ) ; else return true ; } return false ; }
|
org . junit . Assert . assertFalse ( org . mewx . wenku8 . util . LightCache . testFileExist ( org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_FULL_NAME_PATH ) )
|
collectIfWithTarget ( ) { java . lang . Iterable < java . lang . Integer > iterable = new org . eclipse . collections . impl . utility . internal . IterableIterateTest . IterableAdapter ( org . eclipse . collections . impl . list . Interval . oneTo ( 31 ) ) ; java . util . Collection < java . lang . Class < ? > > result = org . eclipse . collections . impl . utility . Iterate . collectIf ( iterable , java . lang . Integer . valueOf ( 31 ) :: equals , Object :: getClass , org . eclipse . collections . impl . list . mutable . FastList . newList ( ) ) ; "<AssertPlaceHolder>" ; } iList ( T ) { return Lists . immutable . with ( one ) ; }
|
org . junit . Assert . assertEquals ( iList ( org . eclipse . collections . impl . utility . internal . Integer . class ) , result )
|
testSubject ( ) { java . lang . String bean = "bob" ; org . apache . taverna . workflowmodel . Edit < ? > edit = org . apache . taverna . workflowmodel . impl . ConfigureActivityEditTest . edits . getConfigureActivityEdit ( activity , bean ) ; "<AssertPlaceHolder>" ; } getSubject ( ) { return configurable ; }
|
org . junit . Assert . assertEquals ( activity , edit . getSubject ( ) )
|
testRegisterListeners ( ) { org . kaaproject . kaa . server . control . service . loadmgmt . DynamicLoadManager dm = new org . kaaproject . kaa . server . control . service . loadmgmt . DynamicLoadManager ( org . kaaproject . kaa . server . control . service . loadmgmt . DynamicLoadManagerTest . ldServiceMock ) ; "<AssertPlaceHolder>" ; dm . registerListeners ( ) ; verify ( org . kaaproject . kaa . server . control . service . loadmgmt . DynamicLoadManagerTest . pNodeMock , atLeast ( 1 ) ) . addListener ( ( ( org . kaaproject . kaa . server . common . zk . operations . OperationsNodeListener ) ( dm ) ) ) ; }
|
org . junit . Assert . assertNotNull ( dm )
|
verifyTypeIdentification ( ) { org . apache . fop . fonts . CustomFont sbFont = mock ( org . apache . fop . fonts . CustomFont . class ) ; when ( sbFont . getInputStream ( ) ) . thenReturn ( new java . io . FileInputStream ( new java . io . File ( org . apache . fop . render . pcl . fonts . PCLFontReaderFactoryTestCase . TEST_FONT_TTF ) ) ) ; when ( sbFont . getEmbedFileURI ( ) ) . thenReturn ( new java . net . URI ( org . apache . fop . render . pcl . fonts . PCLFontReaderFactoryTestCase . TEST_FONT_TTF ) ) ; org . apache . fop . render . java2d . CustomFontMetricsMapper customFont = new org . apache . fop . render . java2d . CustomFontMetricsMapper ( sbFont ) ; when ( customFont . getFontType ( ) ) . thenReturn ( FontType . TRUETYPE ) ; when ( ( ( org . apache . fop . fonts . CustomFont ) ( customFont . getRealFont ( ) ) ) . getInputStream ( ) ) . thenReturn ( new java . io . FileInputStream ( new java . io . File ( org . apache . fop . render . pcl . fonts . PCLFontReaderFactoryTestCase . TEST_FONT_TTF ) ) ) ; "<AssertPlaceHolder>" ; } createInstance ( org . apache . fop . fonts . Typeface ) { if ( ( ( font . getFontType ( ) ) == ( org . apache . fop . fonts . FontType . TRUETYPE ) ) || ( org . apache . fop . render . pcl . fonts . PCLFontReaderFactory . isCIDType2 ( font ) ) ) { return new org . apache . fop . render . pcl . fonts . truetype . PCLTTFFontReader ( font ) ; } return null ; }
|
org . junit . Assert . assertTrue ( ( ( org . apache . fop . render . pcl . fonts . PCLFontReaderFactory . createInstance ( customFont ) ) instanceof org . apache . fop . render . pcl . fonts . truetype . PCLTTFFontReader ) )
|
AccessStaticVariableIndirect_VarVarToString ( ) { java . lang . String fromClass = "domain.indirect.violatingfrom.AccessStaticVariableIndirect_VarVarToString" ; java . lang . String toClass = "domain.indirect.indirectto.ServiceOne" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Access" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , boolean ) { return areDependencyTypesDetected ( classFrom , classTo , dependencyTypes , "" , isIndirect ) ; }
|
org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , true ) )
|
test_getBuildDescription ( ) { org . jenkinsci . plugins . stashNotifier . AbstractBuild build = mock ( org . jenkinsci . plugins . stashNotifier . AbstractBuild . class ) ; when ( build . getDescription ( ) ) . thenReturn ( "some<sp>description" ) ; java . lang . String description = sn . getBuildDescription ( build , StashBuildState . FAILED ) ; "<AssertPlaceHolder>" ; } getBuildDescription ( org . jenkinsci . plugins . stashNotifier . Run , org . jenkinsci . plugins . stashNotifier . StashBuildState ) { if ( ( ( run . getDescription ( ) ) != null ) && ( ( run . getDescription ( ) . trim ( ) . length ( ) ) > 0 ) ) { return run . getDescription ( ) ; } else { switch ( state ) { case INPROGRESS : return "building<sp>on<sp>Jenkins<sp>@<sp>" + ( getRootUrl ( ) ) ; default : return "built<sp>by<sp>Jenkins<sp>@<sp>" + ( getRootUrl ( ) ) ; } } }
|
org . junit . Assert . assertThat ( description , org . hamcrest . CoreMatchers . is ( "some<sp>description" ) )
|
testWriteShort ( ) { com . liferay . petra . io . Serializer serializer = new com . liferay . petra . io . Serializer ( ) ; java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . allocate ( ( ( com . liferay . petra . io . SerializerTest . _COUNT ) * 2 ) ) ; byteBuffer . order ( ByteOrder . BIG_ENDIAN ) ; java . nio . ShortBuffer shortBuffer = byteBuffer . asShortBuffer ( ) ; short [ ] shorts = new short [ com . liferay . petra . io . SerializerTest . _COUNT ] ; for ( int i = 0 ; i < ( com . liferay . petra . io . SerializerTest . _COUNT ) ; i ++ ) { shorts [ i ] = ( ( short ) ( _random . nextInt ( ) ) ) ; serializer . writeShort ( shorts [ i ] ) ; shortBuffer . put ( shorts [ i ] ) ; } java . nio . ByteBuffer serializerByteBuffer = serializer . toByteBuffer ( ) ; "<AssertPlaceHolder>" ; } toByteBuffer ( ) { java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . wrap ( java . util . Arrays . copyOf ( _buffer , _index ) ) ; if ( ( _buffer . length ) <= ( com . liferay . petra . io . Serializer . _THREADLOCAL_BUFFER_SIZE_LIMIT ) ) { com . liferay . petra . io . Serializer . BufferQueue bufferQueue = _getBufferQueue ( ) ; bufferQueue . enqueue ( _buffer ) ; } _buffer = null ; return byteBuffer ; }
|
org . junit . Assert . assertArrayEquals ( byteBuffer . array ( ) , serializerByteBuffer . array ( ) )
|
testLongCollectList ( ) { io . cdap . cdap . api . data . schema . Schema schema = io . cdap . cdap . api . data . schema . Schema . recordOf ( "test" , Schema . Field . of ( "x" , io . cdap . cdap . api . data . schema . Schema . of ( Schema . Type . LONG ) ) ) ; io . cdap . plugin . batch . aggregator . function . CollectList collectList = new io . cdap . plugin . batch . aggregator . function . CollectList ( "x" , io . cdap . cdap . api . data . schema . Schema . of ( Schema . Type . LONG ) ) ; collectList . beginFunction ( ) ; collectList . operateOn ( io . cdap . cdap . api . data . format . StructuredRecord . builder ( schema ) . set ( "x" , 1L ) . build ( ) ) ; collectList . operateOn ( io . cdap . cdap . api . data . format . StructuredRecord . builder ( schema ) . set ( "x" , 2L ) . build ( ) ) ; java . util . List list = collectList . getAggregate ( ) ; "<AssertPlaceHolder>" ; } getAggregate ( ) { return first ; }
|
org . junit . Assert . assertArrayEquals ( new java . lang . Long [ ] { 1L , 2L } , list . toArray ( ) )
|
testSecurityMaskReadRowQuery ( ) { java . lang . String tableName = "testSecurity2" ; createTable ( tableName ) ; org . apache . blur . thrift . generated . Blur . Iface client = getClient ( ) ; { org . apache . blur . thrift . generated . ColumnDefinition columnDefinition = new org . apache . blur . thrift . generated . ColumnDefinition ( org . apache . blur . thrift . BlurClusterTestSecurity . TEST , "read_mask" , null , false , "read-mask" , null , false ) ; columnDefinition . setMultiValueField ( false ) ; client . addColumnDefinition ( tableName , columnDefinition ) ; } java . util . List < org . apache . blur . thrift . generated . RowMutation > batch = new java . util . ArrayList < org . apache . blur . thrift . generated . RowMutation > ( ) ; for ( int i = 0 ; i < 50 ; i ++ ) { java . util . List < org . apache . blur . thrift . generated . RecordMutation > recordMutations = getRecordMutations ( "a" ) ; org . apache . blur . thrift . generated . RowMutation mutation1 = new org . apache . blur . thrift . generated . RowMutation ( tableName , getRowId ( ) , org . apache . blur . thrift . generated . RowMutationType . REPLACE_ROW , recordMutations ) ; addReadMaskColumn ( mutation1 ) ; batch . add ( mutation1 ) ; } client . mutateBatch ( batch ) ; java . util . Map < java . lang . String , java . lang . String > attributes = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; attributes . put ( BlurConstants . ACL_READ , "a" ) ; org . apache . blur . user . User user = new org . apache . blur . user . User ( "testuser" , attributes ) ; org . apache . blur . user . UserContext . setUser ( user ) ; org . apache . blur . thrift . generated . BlurQuery blurQuery = new org . apache . blur . thrift . generated . BlurQuery ( ) ; blurQuery . setSelector ( new org . apache . blur . thrift . generated . Selector ( ) ) ; org . apache . blur . thrift . generated . Query query = new org . apache . blur . thrift . generated . Query ( ) ; query . setRowQuery ( true ) ; query . setQuery ( "*" ) ; blurQuery . setQuery ( query ) ; blurQuery . setFetch ( 100 ) ; org . apache . blur . thrift . generated . BlurResults results = client . query ( tableName , blurQuery ) ; for ( org . apache . blur . thrift . generated . BlurResult result : results . getResults ( ) ) { System . out . println ( result . getFetchResult ( ) . getRowResult ( ) . getRow ( ) ) ; } java . util . List < java . lang . String > terms = client . terms ( tableName , org . apache . blur . thrift . BlurClusterTestSecurity . TEST , "test2" , "" , ( ( short ) ( 1000 ) ) ) ; "<AssertPlaceHolder>" ; org . apache . blur . user . UserContext . reset ( ) ; } isEmpty ( ) { return auths . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( terms . isEmpty ( ) )
|
testPositionAfterAbsoluteWrite ( ) { byte [ ] contents = new byte [ 1024 ] ; new java . util . Random ( ) . nextBytes ( contents ) ; java . nio . file . Path testFile = root . resolve ( "test" ) ; try ( java . nio . channels . FileChannel channel = java . nio . channels . FileChannel . open ( testFile , StandardOpenOption . CREATE , StandardOpenOption . WRITE ) ) { java . nio . ByteBuffer buf = java . nio . ByteBuffer . wrap ( contents ) ; channel . write ( buf , 500 ) ; "<AssertPlaceHolder>" ; } } position ( ) { synchronized ( fc . lock ) { assertNotClosed ( ) ; return position ; } }
|
org . junit . Assert . assertEquals ( 0 , channel . position ( ) )
|
testVraagOpKandidaatVaderMetOverledenVaderNLBuitenPeriode ( ) { final nl . bzk . brp . model . hisvolledig . momentview . kern . PersoonView moeder = bouwMoeder ( 20101231 , 20110228 , NationaliteitcodeAttribuut . NL_NATIONALITEIT_CODE_STRING , null , null , null ) ; final java . util . List < nl . bzk . brp . model . hisvolledig . momentview . kern . PersoonView > kandidaten = brby0002 . bepaalKandidatenVader ( moeder , new nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumEvtDeelsOnbekendAttribuut ( 20120101 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , kandidaten . size ( ) )
|
testTooLargeSize ( ) { int size = ( 1 << 30 ) + 1 ; try { new com . somethingsimilar . opposite_of_a_bloom_filter . OoaBFilter ( size , 0 ) ; org . junit . Assert . fail ( "should<sp>have<sp>thrown<sp>an<sp>IllegalArgumentException" ) ; } catch ( java . lang . IllegalArgumentException e ) { java . lang . String msg = "array<sp>size<sp>may<sp>not<sp>be<sp>larger<sp>than<sp>2**31-1,<sp>but<sp>will<sp>be<sp>rounded<sp>to<sp>larger.<sp>was<sp>" + size ; "<AssertPlaceHolder>" ; } }
|
org . junit . Assert . assertEquals ( msg , e . getMessage ( ) )
|
testIsMutable ( ) { boolean actual = unit . isMutable ( ) ; "<AssertPlaceHolder>" ; } isMutable ( ) { return false ; }
|
org . junit . Assert . assertEquals ( false , actual )
|
newInputStreamOnFile_shouldBeNotNull ( ) { initRepository ( ) ; writeToCache ( "/file.txt" ) ; commitToMaster ( ) ; initGitFileSystem ( ) ; try ( java . io . InputStream stream = java . nio . file . Files . newInputStream ( gfs . getPath ( "/file.txt" ) ) ) { "<AssertPlaceHolder>" ; } } getPath ( java . net . URI ) { com . beijunyi . parallelgit . filesystem . GitFileSystem gfs = getFileSystem ( uri ) ; java . lang . String file = com . beijunyi . parallelgit . filesystem . utils . GfsUriUtils . getFile ( uri ) ; return gfs . getPath ( file ) . toRealPath ( ) ; }
|
org . junit . Assert . assertNotNull ( stream )
|
shouldResolveIndexViaClass ( ) { org . springframework . data . mongodb . core . mapping . MongoMappingContext mappingContext = new org . springframework . data . mongodb . core . mapping . MongoMappingContext ( ) ; org . springframework . data . mongodb . core . index . IndexResolver indexResolver = org . springframework . data . mongodb . core . index . IndexResolver . create ( mappingContext ) ; java . lang . Iterable < ? extends org . springframework . data . mongodb . core . index . IndexDefinition > definitions = indexResolver . resolveIndexFor ( org . springframework . data . mongodb . core . index . MongoPersistentEntityIndexResolverUnitTests . IndexResolutionTests . IndexOnLevelOne . class ) ; "<AssertPlaceHolder>" ; } iterator ( ) { return data . iterator ( ) ; }
|
org . junit . Assert . assertThat ( definitions . iterator ( ) . hasNext ( ) , is ( true ) )
|
generateCodeShouldSucceed ( ) { org . jooq . util . jaxb . Configuration configuration = io . github . jklingsporn . vertx . jooq . async . generate . TestTool . createGeneratorConfig ( io . github . jklingsporn . vertx . jooq . async . generate . classic . ClassicAsyncVertxGenerator . class . getName ( ) , "classic.async.vertx" , io . github . jklingsporn . vertx . jooq . async . generate . classic . ClassicAsyncGeneratorStrategy . class ) ; try { org . jooq . util . GenerationTool . generate ( configuration ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } createGeneratorConfig ( java . lang . String , java . lang . String , java . lang . Class ) { io . github . jklingsporn . vertx . jooq . async . generate . Jdbc jdbcConfig = new io . github . jklingsporn . vertx . jooq . async . generate . Jdbc ( ) ; jdbcConfig . setDriver ( "com.mysql.jdbc.Driver" ) ; jdbcConfig . setUrl ( "jdbc:mysql://127.0.0.1:3306/" ) ; jdbcConfig . setUser ( "vertx" ) ; jdbcConfig . setPassword ( "" ) ; jdbcConfig . setSchema ( "vertx" ) ; return io . github . jklingsporn . vertx . jooq . async . generate . TestTool . createGeneratorConfig ( generatorName , packageName , generatorStrategy , jdbcConfig , org . jooq . util . mysql . MySQLDatabase . class . getName ( ) ) ; }
|
org . junit . Assert . assertTrue ( true )
|
writeNonExistentFile_shouldCreateNewFile ( ) { initGitFileSystem ( ) ; com . beijunyi . parallelgit . filesystem . GitPath file = gfs . getPath ( "/file.txt" ) ; java . nio . file . Files . write ( file , someBytes ( ) ) ; "<AssertPlaceHolder>" ; } someBytes ( ) { return encodeASCII ( com . beijunyi . parallelgit . AbstractParallelGitTest . someText ( ) ) ; }
|
org . junit . Assert . assertTrue ( java . nio . file . Files . exists ( file ) )
|
testPrefixOnly ( ) { java . lang . String prefix = "foo" ; java . lang . String suffix = "bar" ; java . lang . String streamName = "testPrefixOnly" ; java . lang . String processingChainUnderTest = java . lang . String . format ( "%s<sp>--prefix=%s<sp>--prefixOnly=true" , com . acme . ExampleModuleIntegrationTest . moduleName , prefix ) ; chain = chain ( com . acme . ExampleModuleIntegrationTest . application , streamName , processingChainUnderTest ) ; chain . sendPayload ( "hello" ) ; java . lang . String result = ( ( java . lang . String ) ( chain . receivePayload ( com . acme . ExampleModuleIntegrationTest . RECEIVE_TIMEOUT ) ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( ( prefix + "hello" ) , result )
|
testExtFun1 ( ) { java . lang . String init = "prefix<sp>ex:<sp><http://example.org/><sp>" + ( ( "function<sp>xt:fun(?n)<sp>{<sp>" 0 + "ex:John<sp>rdf:value<sp>1,<sp>2<sp>" ) + "}" ) ; java . lang . String q = "prefix<sp>ex:<sp><http://example.org/><sp>" + ( ( ( ( ( ( ( "select<sp>*<sp>" + "where<sp>{" ) + "?x<sp>rdf:value<sp>?n<sp>" ) + "filter<sp>xt:fun(?n)<sp>" ) + "}" ) + "function<sp>xt:fun(?n)<sp>{<sp>" ) + "exists<sp>{<sp>?y<sp>?p<sp>?n<sp>}<sp>" ) + "}<sp>" ) ; fr . inria . corese . core . Graph g = createGraph ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; exec . query ( init ) ; fr . inria . corese . kgram . core . Mappings map = exec . query ( q ) ; "<AssertPlaceHolder>" ; } size ( ) { return tests . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , map . size ( ) )
|
testCreateConnectionAsUnknwonUser ( ) { org . apache . qpid . jms . JmsConnectionFactory factory = new org . apache . qpid . jms . JmsConnectionFactory ( getBrokerAmqpConnectionURI ( ) ) ; factory . setUsername ( "unknown" ) ; factory . setPassword ( "unknown" ) ; connection = factory . createTopicConnection ( ) ; "<AssertPlaceHolder>" ; connection . start ( ) ; } createTopicConnection ( ) { return createTopicConnection ( getUsername ( ) , getPassword ( ) ) ; }
|
org . junit . Assert . assertNotNull ( connection )
|
testLaunch ( ) { parseComment ( ) ; "<AssertPlaceHolder>" ; } parseComment ( ) { file = getAboveCommentAndSaveFile ( org . eclipse . linuxtools . internal . valgrind . core . ValgrindCoreParserTest . VALGRIND_OUT2 ) ; parse ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , messages . length )
|
testResolvePackageWithJavaFileInDefaultPackage ( ) { final javax . enterprise . inject . spi . Bean moduleServiceBean = ( ( javax . enterprise . inject . spi . Bean ) ( beanManager . getBeans ( org . kie . workbench . common . services . shared . project . KieModuleService . class ) . iterator ( ) . next ( ) ) ) ; final javax . enterprise . context . spi . CreationalContext cc = beanManager . createCreationalContext ( moduleServiceBean ) ; final org . kie . workbench . common . services . shared . project . KieModuleService moduleService = ( ( org . kie . workbench . common . services . shared . project . KieModuleService ) ( beanManager . getReference ( moduleServiceBean , org . kie . workbench . common . services . shared . project . KieModuleService . class , cc ) ) ) ; final java . net . URL testUrl = this . getClass ( ) . getResource ( "/ModuleBackendTestModuleStructureValid/src/main/java/Bean.java" ) ; final org . uberfire . java . nio . file . Path nioTestPath = fs . getPath ( testUrl . toURI ( ) ) ; final org . uberfire . backend . vfs . Path testPath = paths . convert ( nioTestPath ) ; final org . guvnor . common . services . project . model . Package result = moduleService . resolvePackage ( testPath ) ; "<AssertPlaceHolder>" ; } getPackageName ( ) { return ( getQualifiedName ( ) ) != null ? getQualifiedName ( ) . getName ( ) : null ; }
|
org . junit . Assert . assertEquals ( "" , result . getPackageName ( ) )
|
requestWithFactoryLink ( ) { com . vmware . xenon . common . test . VerificationHost sourceNode = this . sourceNodes . iterator ( ) . next ( ) ; com . vmware . xenon . common . test . VerificationHost destNode = this . destNodes . iterator ( ) . next ( ) ; com . vmware . xenon . common . test . TestRequestSender sender = sourceNode . getTestRequestSender ( ) ; int count = 30 ; java . util . List < com . vmware . xenon . common . Operation > posts = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < count ; i ++ ) { com . vmware . xenon . services . common . ExampleService . ExampleServiceState body = new com . vmware . xenon . services . common . ExampleService . ExampleServiceState ( ) ; body . name = "foo-" + i ; body . documentSelfLink = body . name ; com . vmware . xenon . common . Operation post = com . vmware . xenon . common . Operation . createPost ( sourceNode , ExampleService . FACTORY_LINK ) . setBody ( body ) ; posts . add ( post ) ; } sender . sendAndWait ( posts ) ; com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState body = new com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState ( ) ; body . sourceNodeReference = sourceNode . getUri ( ) ; body . destinationNodeReference = destNode . getUri ( ) ; com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState . MigrationRequest entry = new com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState . MigrationRequest ( ) ; entry . factoryLink = ExampleService . FACTORY_LINK ; java . util . List < com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState . MigrationRequest > batchEntry = new java . util . ArrayList ( ) ; batchEntry . add ( entry ) ; body . batches . add ( batchEntry ) ; com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState result = postNodeGroupMigrationTaskAndWaitFinish ( body ) ; "<AssertPlaceHolder>" ; } postNodeGroupMigrationTaskAndWaitFinish ( com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState ) { com . vmware . xenon . common . test . VerificationHost destNode = this . destNodes . iterator ( ) . next ( ) ; com . vmware . xenon . common . test . TestRequestSender sender = destNode . getTestRequestSender ( ) ; com . vmware . xenon . common . Operation post = com . vmware . xenon . common . Operation . createPost ( destNode , NodeGroupMigrationTaskService . FACTORY_LINK ) . setBody ( requestBody ) ; com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState response = sender . sendAndWait ( post , com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState . class ) ; java . lang . String taskPath = response . documentSelfLink ; java . util . Set < com . vmware . xenon . common . TaskState . TaskStage > finalStages = java . util . EnumSet . of ( TaskStage . CANCELLED , TaskStage . FAILED , TaskStage . FINISHED ) ; java . util . concurrent . atomic . AtomicReference < com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState > state = new java . util . concurrent . atomic . AtomicReference ( ) ; long waitSecond = ( TimeUnit . MICROSECONDS . toSeconds ( MigrationTaskService . DEFAULT_MAINTENANCE_INTERVAL_MILLIS ) ) * 2 ; com . vmware . xenon . common . test . TestContext . waitFor ( java . time . Duration . ofSeconds ( waitSecond ) , ( ) -> { com . vmware . xenon . common . Operation get = com . vmware . xenon . common . Operation . createGet ( destNode , taskPath ) ; com . vmware . xenon . services . common . NodeGroupMigrationTaskService . NodeGroupMigrationState result = sender . sendAndWait ( get , . class ) ; state . set ( result ) ; if ( result . taskInfo == null ) { return false ; } return finalStages . contains ( result . taskInfo . stage ) ; } , "waiting<sp>for<sp>MigrationService<sp>To<sp>Finish" ) ; return state . get ( ) ; }
|
org . junit . Assert . assertEquals ( TaskStage . FINISHED , result . taskInfo . stage )
|
testIterator ( ) { org . apache . hadoop . hdfs . util . ChunkedArrayList < java . lang . Integer > l = new org . apache . hadoop . hdfs . util . ChunkedArrayList < java . lang . Integer > ( ) ; for ( int i = 0 ; i < 30000 ; i ++ ) { l . add ( i ) ; } int i = 0 ; for ( int fromList : l ) { "<AssertPlaceHolder>" ; i ++ ; } } add ( org . apache . hadoop . yarn . server . resourcemanager . webapp . dao . StatisticsItemInfo ) { this . statItem . add ( statItem ) ; }
|
org . junit . Assert . assertEquals ( i , fromList )
|
itInjectsTheDefaultLocaleIfNoLanguagesAreGiven ( ) { final com . sun . jersey . api . core . HttpRequestContext request = mock ( com . sun . jersey . api . core . HttpRequestContext . class ) ; when ( request . getAcceptableLanguages ( ) ) . thenReturn ( com . google . common . collect . ImmutableList . < java . util . Locale > of ( ) ) ; final com . sun . jersey . api . core . HttpContext context = mock ( com . sun . jersey . api . core . HttpContext . class ) ; when ( context . getRequest ( ) ) . thenReturn ( request ) ; "<AssertPlaceHolder>" ; } getValue ( com . sun . jersey . api . core . HttpContext ) { java . util . List < java . util . Locale > locales ; try { locales = c . getRequest ( ) . getAcceptableLanguages ( ) ; } catch ( javax . ws . rs . WebApplicationException e ) { locales = com . google . common . collect . ImmutableList . of ( ) ; } if ( ! ( locales . isEmpty ( ) ) ) { final java . util . Locale locale = locales . get ( 0 ) ; if ( ! ( locale . equals ( com . wesabe . api . accounts . providers . LocaleInjectionProvider . WILDCARD_LOCALE ) ) ) { return locale ; } } return java . util . Locale . getDefault ( ) ; }
|
org . junit . Assert . assertThat ( provider . getValue ( context ) , org . hamcrest . CoreMatchers . is ( java . util . Locale . getDefault ( ) ) )
|
testListAll ( ) { com . shippo . model . TransactionCollection objectCollection = com . shippo . model . Transaction . all ( null ) ; "<AssertPlaceHolder>" ; } getData ( ) { return results ; }
|
org . junit . Assert . assertNotNull ( objectCollection . getData ( ) )
|
testManyNodes ( ) { tested = new codeine . command_peer . ExponentialProgressiveRateClaculator ( 1000 , 1 ) ; "<AssertPlaceHolder>" ; } getTimeToSleep ( long ) { return getTimeToSleep ( ratio ( ) , loopTime ) ; }
|
org . junit . Assert . assertEquals ( 0 , tested . getTimeToSleep ( 0 ) )
|
testDiff ( ) { java . util . List < org . gitlab4j . api . models . Diff > diffs = org . gitlab4j . api . JsonUtils . unmarshalResourceList ( org . gitlab4j . api . models . Diff . class , "diff.json" ) ; "<AssertPlaceHolder>" ; } compareJson ( T , java . lang . String ) { java . io . InputStreamReader reader = new java . io . InputStreamReader ( org . gitlab4j . api . TestGitLabApiBeans . class . getResourceAsStream ( filename ) ) ; return org . gitlab4j . api . JsonUtils . compareJson ( apiObject , reader ) ; }
|
org . junit . Assert . assertTrue ( org . gitlab4j . api . JsonUtils . compareJson ( diffs , "diff.json" ) )
|
testGetOperationLimitNullAndMostRecentIdEqualsLastId ( ) { java . lang . Long lastId = 1L ; when ( memcacheService . get ( MemcacheKey . DB_OPERATION_COUNTER . getName ( ) ) ) . thenReturn ( lastId ) ; java . util . List < com . arcbees . gaestudio . shared . dto . DbOperationRecordDto > results = operationService . getOperations ( lastId , null ) ; verify ( memcacheService ) . get ( MemcacheKey . DB_OPERATION_COUNTER . getName ( ) ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertNull ( results )
|
testValidationIsDisabled_01 ( ) { try { final org . eclipse . core . resources . IProject project = this . workspace . getRoot ( ) . getProject ( "simpleProject" ) ; project . create ( null ) ; project . open ( null ) ; final org . eclipse . core . resources . IFile file = project . getFile ( "Hello.xtext" ) ; final java . io . InputStream _function = new java . io . InputStream ( ) { @ org . eclipse . xtext . xbase . ui . tests . editor . Override public int read ( ) throws java . io . IOException { return - 1 ; } } ; file . create ( _function , true , null ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Throwable _e ) { throw org . eclipse . xtext . xbase . lib . Exceptions . sneakyThrow ( _e ) ; } } isValidationDisabled ( org . eclipse . core . resources . IStorage ) { return isValidationDisabled ( null , storage ) ; }
|
org . junit . Assert . assertTrue ( this . isValidationDisabled ( file ) )
|
version ( ) { java . util . Map < java . lang . String , java . lang . String > conf = new java . util . HashMap ( ) ; conf . put ( CoreProfile . KEY_VERSION , "TESTING" ) ; com . asakusafw . yaess . core . ServiceProfile < com . asakusafw . yaess . core . CoreProfile > profile = new com . asakusafw . yaess . core . ServiceProfile ( "testing" , com . asakusafw . yaess . basic . BasicCoreProfile . class , conf , com . asakusafw . yaess . core . ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; com . asakusafw . yaess . core . CoreProfile instance = profile . newInstance ( ) ; "<AssertPlaceHolder>" ; } getVersion ( ) { return com . asakusafw . info . BatchInfo . VERSION ; }
|
org . junit . Assert . assertThat ( instance . getVersion ( ) , is ( "TESTING" ) )
|
testOnlyRequiredArguments ( ) { final java . lang . String configDir = "/foo/bar" ; final java . lang . String [ ] args = new java . lang . String [ ] { "--configDir" , configDir } ; final org . apache . flink . runtime . entrypoint . ClusterConfiguration clusterConfiguration = org . apache . flink . runtime . entrypoint . ClusterConfigurationParserFactoryTest . commandLineParser . parse ( args ) ; "<AssertPlaceHolder>" ; } getConfigDir ( ) { return configDir ; }
|
org . junit . Assert . assertThat ( clusterConfiguration . getConfigDir ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( configDir ) ) )
|
testGetPortletName2 ( ) { com . liferay . portal . kernel . model . PortletInstance portletInstance = com . liferay . portal . kernel . model . PortletInstance . fromPortletInstanceKey ( getPortletInstanceKey ( PortletKeys . TEST , "1234" ) ) ; "<AssertPlaceHolder>" ; } getPortletName ( ) { return com . liferay . social . activity . web . internal . constants . SocialActivityPortletKeys . SOCIAL_ACTIVITY ; }
|
org . junit . Assert . assertEquals ( PortletKeys . TEST , portletInstance . getPortletName ( ) )
|
testZeroSizeCache ( ) { org . apache . jackrabbit . oak . cache . CacheLIRS < java . lang . Integer , java . lang . String > cache = org . apache . jackrabbit . oak . cache . CacheTest . createCache ( 0 , 100 ) ; cache . put ( 1 , "Hello" , 100 ) ; cache . put ( 2 , "World" , 100 ) ; cache . put ( 3 , "!" , 100 ) ; "<AssertPlaceHolder>" ; } containsKey ( java . lang . Object ) { return options . containsKey ( key ) ; }
|
org . junit . Assert . assertFalse ( cache . containsKey ( 1 ) )
|
testSelect5 ( ) { org . la4j . matrix . Matrix a = matrixA ( ) ; int [ ] rowInd = new int [ ] { 1 , 3 , 4 } ; int [ ] colInd = new int [ ] { 2 , 4 , 5 } ; org . la4j . matrix . Matrix d = m ( org . la4j . matrix . MatrixTest . a ( 2.51 , 4.63 , 6.12 ) , org . la4j . matrix . MatrixTest . a ( 1.16 , 3.66 , 4.93 ) , org . la4j . matrix . MatrixTest . a ( 8.11 , 9.04 , 6.72 ) ) ; "<AssertPlaceHolder>" ; } select ( int [ ] , int [ ] ) { int newRows = rowIndices . length ; int newCols = columnIndices . length ; if ( ( newRows == 0 ) || ( newCols == 0 ) ) { fail ( "No<sp>rows<sp>or<sp>columns<sp>selected." ) ; } int newCardinality = 0 ; for ( int i = 0 ; i < newRows ; i ++ ) { for ( int j = 0 ; j < newCols ; j ++ ) { if ( ( get ( rowIndices [ i ] , columnIndices [ j ] ) ) != 0.0 ) { newCardinality ++ ; } } } double [ ] newValues = new double [ newCardinality ] ; int [ ] newRowIndices = new int [ newCardinality ] ; int [ ] newColumnPointers = new int [ newCols + 1 ] ; newColumnPointers [ 0 ] = 0 ; int endPtr = 0 ; for ( int j = 0 ; j < newCols ; j ++ ) { newColumnPointers [ ( j + 1 ) ] = newColumnPointers [ j ] ; for ( int i = 0 ; i < newRows ; i ++ ) { double val = get ( rowIndices [ i ] , columnIndices [ j ] ) ; if ( val != 0.0 ) { newValues [ endPtr ] = val ; newRowIndices [ endPtr ] = i ; endPtr ++ ; ( newColumnPointers [ ( j + 1 ) ] ) ++ ; } } } return new org . la4j . matrix . sparse . CCSMatrix ( newRows , newCols , newCardinality , newValues , newRowIndices , newColumnPointers ) ; }
|
org . junit . Assert . assertEquals ( d , a . select ( rowInd , colInd ) )
|
testCreate ( ) { org . oscarehr . common . model . AppointmentStatus entity = new org . oscarehr . common . model . AppointmentStatus ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
|
org . junit . Assert . assertNotNull ( entity . getId ( ) )
|
testUpdateAccessLogNotRecentContentAccess ( ) { contentAccessLogger = new eu . smartenit . unada . ctm . cache . impl . ContentAccessLoggerImpl ( 987654 , "3.3.3.3" ) ; boolean access = contentAccessLogger . updateAccessLog ( ) ; "<AssertPlaceHolder>" ; } updateAccessLog ( ) { eu . smartenit . unada . ctm . cache . impl . ContentAccessLoggerImpl . logger . debug ( ( "Checking<sp>last<sp>accesses<sp>of<sp>content<sp>" + ( contentID ) ) ) ; eu . smartenit . unada . db . dto . ContentAccess contentAccess = eu . smartenit . unada . db . dao . util . DAOFactory . getContentAccessDAO ( ) . findLatestByContentID ( contentID ) ; if ( ( contentAccess == null ) || ( ( contentAccess . getTimeStamp ( ) . getTime ( ) ) < ( ( java . lang . System . currentTimeMillis ( ) ) - ( sameVideoRequestInterval ) ) ) ) { contentAccess = new eu . smartenit . unada . db . dto . ContentAccess ( ) ; contentAccess . setContentID ( contentID ) ; contentAccess . setTimeStamp ( new java . util . Date ( java . lang . System . currentTimeMillis ( ) ) ) ; try { eu . smartenit . unada . db . dao . util . DAOFactory . getContentAccessDAO ( ) . insert ( contentAccess ) ; eu . smartenit . unada . ctm . cache . impl . ContentAccessLoggerImpl . logger . info ( ( ( "Request<sp>for<sp>video<sp>" + ( contentAccess . getContentID ( ) ) ) + "<sp>is<sp>served<sp>from<sp>local<sp>cache." ) ) ; eu . smartenit . unada . ctm . cache . impl . ContentAccessLoggerImpl . logger . debug ( ( ( ( "Inserting<sp>content<sp>access<sp>" + contentAccess ) + "<sp>from<sp>IP<sp>" ) + ( ipAddress ) ) ) ; UnadaLogger . overall . info ( "{}:<sp>Video<sp>request<sp>({},<sp>{})" , new java . lang . Object [ ] { eu . smartenit . unada . commons . constants . UnadaConstants . UNADA_OWNER_MD5 , java . lang . System . currentTimeMillis ( ) , contentID } ) ; return true ; } catch ( java . lang . Exception e ) { eu . smartenit . unada . ctm . cache . impl . ContentAccessLoggerImpl . logger . error ( ( ( ( "Error<sp>inserting<sp>content<sp>access<sp>for<sp>" + ( contentID ) ) + ":<sp>" ) + ( e . getMessage ( ) ) ) ) ; return false ; } } return false ; }
|
org . junit . Assert . assertTrue ( access )
|
testChildren ( ) { java . lang . String expectedJavascript = "$('div').children('span');" ; java . lang . String generatedJavascript = new org . odlabs . wiquery . core . javascript . JsStatement ( ) . $ ( null , "div" ) . chain ( org . odlabs . wiquery . core . javascript . helper . TraversingHelper . children ( "span" ) ) . render ( ) . toString ( ) ; org . odlabs . wiquery . core . javascript . helper . TraversingHelperTestCase . log . info ( expectedJavascript ) ; org . odlabs . wiquery . core . javascript . helper . TraversingHelperTestCase . log . info ( generatedJavascript ) ; "<AssertPlaceHolder>" ; } toString ( ) { return super . toString ( ) . toLowerCase ( ) ; }
|
org . junit . Assert . assertEquals ( generatedJavascript , expectedJavascript )
|
size_freeform_returnsFour ( ) { com . vaadin . v7 . data . util . sqlcontainer . SQLContainer container = new com . vaadin . v7 . data . util . sqlcontainer . SQLContainer ( new com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQuery ( "SELECT<sp>*<sp>FROM<sp>people" , connectionPool , "ID" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { updateCount ( ) ; return ( ( size ) + ( sizeOfAddedItems ( ) ) ) - ( removedItems . size ( ) ) ; }
|
org . junit . Assert . assertEquals ( 4 , container . size ( ) )
|
testLimit ( ) { net . sourceforge . pmd . lang . symboltable . ApplierTest . MyFunction f = new net . sourceforge . pmd . lang . symboltable . ApplierTest . MyFunction ( 2 ) ; java . util . List < java . lang . Object > l = new java . util . ArrayList ( ) ; l . add ( new java . lang . Object ( ) ) ; l . add ( new java . lang . Object ( ) ) ; l . add ( new java . lang . Object ( ) ) ; net . sourceforge . pmd . lang . symboltable . Applier . apply ( f , l . iterator ( ) ) ; "<AssertPlaceHolder>" ; } getNumCallbacks ( ) { return this . numCallbacks ; }
|
org . junit . Assert . assertEquals ( 2 , f . getNumCallbacks ( ) )
|
findAll_returnsAllRetailCustomers ( ) { java . util . List < org . greenbuttonalliance . espi . common . domain . RetailCustomer > allRetailCustomers = new java . util . ArrayList < org . greenbuttonalliance . espi . common . domain . RetailCustomer > ( ) ; when ( repository . findAll ( ) ) . thenReturn ( allRetailCustomers ) ; "<AssertPlaceHolder>" ; } findAll ( ) { batchListService . findAll ( ) ; verify ( repository ) . findAll ( ) ; }
|
org . junit . Assert . assertEquals ( allRetailCustomers , service . findAll ( ) )
|
handlesEmtpyStreamDuringBufferdRead ( ) { org . jsoup . Connection . Response res = org . jsoup . Jsoup . connect ( InterruptedServlet . Url ) . timeout ( 200 ) . execute ( ) ; boolean threw = false ; try { res . bufferUp ( ) ; } catch ( org . jsoup . UncheckedIOException e ) { threw = true ; } "<AssertPlaceHolder>" ; } bufferUp ( ) { prepareByteData ( ) ; return this ; }
|
org . junit . Assert . assertTrue ( threw )
|
testPageRankWithJavaGraph ( ) { org . qcri . rheem . tests . List < org . qcri . rheem . basic . data . Tuple2 < java . lang . Long , java . lang . Long > > edges = org . qcri . rheem . tests . Arrays . asList ( new org . qcri . rheem . basic . data . Tuple2 ( 0L , 1L ) , new org . qcri . rheem . basic . data . Tuple2 ( 0L , 2L ) , new org . qcri . rheem . basic . data . Tuple2 ( 0L , 3L ) , new org . qcri . rheem . basic . data . Tuple2 ( 1L , 2L ) , new org . qcri . rheem . basic . data . Tuple2 ( 1L , 3L ) , new org . qcri . rheem . basic . data . Tuple2 ( 2L , 3L ) , new org . qcri . rheem . basic . data . Tuple2 ( 3L , 0L ) ) ; org . qcri . rheem . tests . List < org . qcri . rheem . basic . data . Tuple2 < java . lang . Long , java . lang . Float > > pageRanks = new org . qcri . rheem . tests . LinkedList ( ) ; org . qcri . rheem . core . plan . rheemplan . RheemPlan rheemPlan = org . qcri . rheem . tests . RheemPlans . pageRank ( edges , pageRanks ) ; org . qcri . rheem . core . api . RheemContext rheemContext = new org . qcri . rheem . core . api . RheemContext ( ) . with ( org . qcri . rheem . java . Java . basicPlugin ( ) ) . with ( org . qcri . rheem . java . Java . graphPlugin ( ) ) ; rheemContext . execute ( rheemPlan ) ; pageRanks . sort ( ( r1 , r2 ) -> java . lang . Float . compare ( r2 . getField1 ( ) , r1 . getField1 ( ) ) ) ; final org . qcri . rheem . tests . List < java . lang . Long > vertexOrder = pageRanks . stream ( ) . map ( Tuple2 :: getField0 ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } stream ( ) { org . apache . commons . io . IOUtils . closeQuietly ( this . writer ) ; this . writer = null ; final org . qcri . rheem . core . platform . PartialExecution . Serializer serializer = new org . qcri . rheem . core . platform . PartialExecution . Serializer ( this . configuration ) ; return java . nio . file . Files . lines ( java . nio . file . Paths . get ( this . repositoryPath ) , java . nio . charset . Charset . forName ( "UTF-8" ) ) . map ( ( line ) -> { try { return org . qcri . rheem . core . util . JsonSerializables . deserialize ( new org . json . JSONObject ( line ) , serializer , . class ) ; } catch ( e ) { throw new < org . qcri . rheem . core . profiling . e > org . qcri . rheem . core . api . exception . RheemException ( java . lang . String . format ( "Could<sp>not<sp>parse<sp>\"%s\"." , line ) ) ; } } ) ; }
|
org . junit . Assert . assertEquals ( org . qcri . rheem . tests . Arrays . asList ( 3L , 0L , 2L , 1L ) , vertexOrder )
|
test22getUserProfileByLoginId ( ) { setup ( ) ; org . apache . ranger . db . XXPortalUserDao xPortalUserDao = org . mockito . Mockito . mock ( org . apache . ranger . db . XXPortalUserDao . class ) ; org . mockito . Mockito . when ( daoManager . getXXPortalUser ( ) ) . thenReturn ( xPortalUserDao ) ; org . apache . ranger . view . VXPortalUser userProfile = userProfile ( ) ; org . apache . ranger . entity . XXPortalUser user = new org . apache . ranger . entity . XXPortalUser ( ) ; user . setEmailAddress ( userProfile . getEmailAddress ( ) ) ; user . setFirstName ( userProfile . getFirstName ( ) ) ; user . setLastName ( userProfile . getLastName ( ) ) ; user . setLoginId ( userProfile . getLoginId ( ) ) ; user . setPassword ( userProfile . getPassword ( ) ) ; user . setUserSource ( userProfile . getUserSource ( ) ) ; user . setPublicScreenName ( userProfile . getPublicScreenName ( ) ) ; user . setId ( userProfile . getId ( ) ) ; org . apache . ranger . view . VXPortalUser dbVXPortalUser = userMgr . getUserProfileByLoginId ( ) ; org . mockito . Mockito . when ( xPortalUserDao . findByLoginId ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( user ) ; org . apache . ranger . db . XXPortalUserRoleDao xPortalUserRoleDao = org . mockito . Mockito . mock ( org . apache . ranger . db . XXPortalUserRoleDao . class ) ; org . mockito . Mockito . when ( daoManager . getXXPortalUserRole ( ) ) . thenReturn ( xPortalUserRoleDao ) ; java . util . List < org . apache . ranger . entity . XXPortalUserRole > xPortalUserRoleList = new java . util . ArrayList < org . apache . ranger . entity . XXPortalUserRole > ( ) ; org . apache . ranger . entity . XXPortalUserRole XXPortalUserRole = new org . apache . ranger . entity . XXPortalUserRole ( ) ; XXPortalUserRole . setId ( org . apache . ranger . biz . TestUserMgr . userId ) ; XXPortalUserRole . setUserId ( org . apache . ranger . biz . TestUserMgr . userId ) ; XXPortalUserRole . setUserRole ( "ROLE_USER" ) ; xPortalUserRoleList . add ( XXPortalUserRole ) ; org . mockito . Mockito . when ( xPortalUserRoleDao . findByParentId ( org . mockito . Mockito . anyLong ( ) ) ) . thenReturn ( xPortalUserRoleList ) ; org . apache . ranger . db . XXUserPermissionDao xUserPermissionDao = org . mockito . Mockito . mock ( org . apache . ranger . db . XXUserPermissionDao . class ) ; org . apache . ranger . db . XXGroupPermissionDao xGroupPermissionDao = org . mockito . Mockito . mock ( org . apache . ranger . db . XXGroupPermissionDao . class ) ; org . mockito . Mockito . when ( daoManager . getXXUserPermission ( ) ) . thenReturn ( xUserPermissionDao ) ; java . util . List < org . apache . ranger . entity . XXUserPermission > xUserPermissionsList = new java . util . ArrayList < org . apache . ranger . entity . XXUserPermission > ( ) ; java . util . List < org . apache . ranger . entity . XXGroupPermission > xGroupPermissionList = new java . util . ArrayList < org . apache . ranger . entity . XXGroupPermission > ( ) ; org . mockito . Mockito . when ( xUserPermissionDao . findByUserPermissionIdAndIsAllowed ( userProfile . getId ( ) ) ) . thenReturn ( xUserPermissionsList ) ; org . mockito . Mockito . when ( daoManager . getXXGroupPermission ( ) ) . thenReturn ( xGroupPermissionDao ) ; org . mockito . Mockito . when ( xGroupPermissionDao . findbyVXPortalUserId ( userProfile . getId ( ) ) ) . thenReturn ( xGroupPermissionList ) ; dbVXPortalUser = userMgr . getUserProfileByLoginId ( user . getLoginId ( ) ) ; "<AssertPlaceHolder>" ; } getLoginId ( ) { return loginId ; }
|
org . junit . Assert . assertNotNull ( dbVXPortalUser )
|
testPropagateWhenAddingUserToRequiredGroups ( ) { com . liferay . portal . security . membership . policy . test . util . MembershipPolicyTestUtil . addUser ( null , null , addRequiredGroups ( ) , null ) ; "<AssertPlaceHolder>" ; } isPropagateMembership ( ) { return com . liferay . portal . security . membership . policy . BaseMembershipPolicyTestCase . _propagateMembership ; }
|
org . junit . Assert . assertTrue ( isPropagateMembership ( ) )
|
testApplicationWadl ( ) { com . sun . jersey . api . client . WebResource r = resource ( ) ; java . lang . String serviceWadl = r . path ( "application.wadl" ) . accept ( MediaTypes . WADL ) . get ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } length ( ) { return code . length ; }
|
org . junit . Assert . assertTrue ( ( ( serviceWadl . length ( ) ) > 0 ) )
|
all ( ) { com . intellij . psi . codeStyle . arrangement . std . StdArrangementSettings settings = new com . intellij . psi . codeStyle . arrangement . std . StdArrangementSettings ( ) ; settings . addGrouping ( new com . intellij . psi . codeStyle . arrangement . group . ArrangementGroupingRule ( OVERRIDDEN_METHODS , BY_NAME ) ) ; com . intellij . psi . codeStyle . arrangement . model . ArrangementAtomMatchCondition condition = new com . intellij . psi . codeStyle . arrangement . model . ArrangementAtomMatchCondition ( FIELD ) ; settings . addRule ( new com . intellij . psi . codeStyle . arrangement . match . StdArrangementMatchRule ( new com . intellij . psi . codeStyle . arrangement . match . StdArrangementEntryMatcher ( condition ) , BY_NAME ) ) ; org . jdom . Element holder = new org . jdom . Element ( "holder" ) ; com . intellij . psi . codeStyle . arrangement . ArrangementSettingsSerializer instance = new com . intellij . psi . codeStyle . arrangement . DefaultArrangementSettingsSerializer ( settings ) ; instance . serialize ( settings , holder ) ; com . intellij . psi . codeStyle . arrangement . ArrangementSettings restored = instance . deserialize ( holder ) ; "<AssertPlaceHolder>" ; } deserialize ( com . intellij . psi . stubs . StubInputStream ) { com . intellij . psi . util . QualifiedName qName ; int size = dataStream . readVarInt ( ) ; if ( size == 0 ) { qName = null ; } else { qName = new com . intellij . psi . util . QualifiedName ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { final com . intellij . util . io . StringRef name = dataStream . readName ( ) ; qName . myComponents . add ( ( name == null ? null : name . getString ( ) ) ) ; } } return qName ; }
|
org . junit . Assert . assertEquals ( settings , restored )
|
testSetPositionFloatArray ( ) { final double [ ] initial = new double [ ] { 5.3 , 2.6 , 3.1 , - 852.1 } ; final float [ ] fynal = new float [ ] { 98.2F , - 16.1F , 44.7F , 0.0F } ; final net . imglib2 . RealPoint p1 = new net . imglib2 . RealPoint ( initial ) ; p1 . setPosition ( fynal ) ; for ( int j = 0 ; j < 4 ; j ++ ) { "<AssertPlaceHolder>" ; } } getDoublePosition ( int ) { return position . getDoublePosition ( d ) ; }
|
org . junit . Assert . assertEquals ( p1 . getDoublePosition ( j ) , fynal [ j ] , 0 )
|
resetTagsForMarketplace ( ) { tagCloudBean = new org . oscm . ui . beans . marketplace . TagCloudBean ( ) ; tagCloudBean . tagsForMarketplace = new java . util . LinkedList < org . oscm . ui . model . ServiceTag > ( ) ; tagCloudBean . tagsForMarketplace . add ( new org . oscm . ui . model . ServiceTag ( "Tag1" , "en" , 5 ) ) ; tagCloudBean . resetTagsForMarketplace ( ) ; "<AssertPlaceHolder>" ; } resetTagsForMarketplace ( ) { tagsForMarketplace = null ; }
|
org . junit . Assert . assertNull ( tagCloudBean . tagsForMarketplace )
|
testGetFileCharset_UTF16_LE ( ) { java . io . File file = org . apache . commons . io . FileUtils . toFile ( CLASS . getResource ( "russian-utf16-le.srt" ) ) ; "<AssertPlaceHolder>" . isEqualTo ( net . pms . util . CHARSET_UTF_16LE ) ; } getFileCharsetName ( net . pms . util . File ) { if ( file == null ) { return null ; } com . ibm . icu . text . CharsetMatch match = net . pms . util . FileUtil . getFileCharsetMatch ( file ) ; try { if ( java . nio . charset . Charset . isSupported ( match . getName ( ) ) ) { net . pms . util . FileUtil . LOGGER . debug ( "Detected<sp>charset<sp>\"{}\"<sp>in<sp>file<sp>\"{}\"" , match . getName ( ) , file . getAbsolutePath ( ) ) ; return match . getName ( ) . toUpperCase ( Locale . ROOT ) ; } net . pms . util . FileUtil . LOGGER . debug ( "Detected<sp>charset<sp>\"{}\"<sp>in<sp>file<sp>\"{}\",<sp>but<sp>cannot<sp>use<sp>it<sp>because<sp>it\'s<sp>not<sp>supported<sp>by<sp>the<sp>Java<sp>Virual<sp>Machine" , match . getName ( ) , file . getAbsolutePath ( ) ) ; return null ; } catch ( java . nio . charset . IllegalCharsetNameException e ) { net . pms . util . FileUtil . LOGGER . debug ( "Illegal<sp>charset<sp>\"{}\"<sp>deteceted<sp>in<sp>file<sp>\"{}\"" , match . getName ( ) , file . getAbsolutePath ( ) ) ; } net . pms . util . FileUtil . LOGGER . debug ( "Found<sp>no<sp>matching<sp>charset<sp>for<sp>file<sp>\"{}\"" , file . getAbsolutePath ( ) ) ; return null ; }
|
org . junit . Assert . assertThat ( net . pms . util . FileUtil . getFileCharsetName ( file ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.