input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
selectMapperOneMethod ( ) { customMapper . setParameter ( org . apache . camel . component . dozer . MapperWithOneMethod . class . getName ( ) ) ; "<AssertPlaceHolder>" ; } selectMethod ( java . lang . Class , java . lang . Class ) { java . lang . reflect . Method method = null ; for ( java . lang . reflect . Method m : customClass . getDeclaredMethods ( ) ) { if ( ( ( ( m . getReturnType ( ) ) != null ) && ( ( m . getParameterTypes ( ) . length ) == 1 ) ) && ( m . getParameterTypes ( ) [ 0 ] . isAssignableFrom ( sourceClass ) ) ) { method = m ; break ; } } return method ; } | org . junit . Assert . assertNotNull ( customMapper . selectMethod ( org . apache . camel . component . dozer . MapperWithOneMethod . class , java . lang . String . class ) ) |
testReordering2 ( ) { mikera . matrixx . Matrix m = mikera . matrixx . Matrix . create ( new double [ ] [ ] { new double [ ] { 1 , 2 } , new double [ ] { 3 , 4 } } ) ; mikera . matrixx . AMatrix m2 = m . reorder ( 1 , new int [ ] { 0 , 1 } ) ; "<AssertPlaceHolder>" ; } create ( double , double , double , double ) { return new mikera . matrixx . Matrix22 ( a , b , c , d ) ; } | org . junit . Assert . assertEquals ( m , m2 ) |
test_WHEN_AdditionalLabels_THEN_ShouldReturnCorrectSample ( ) { final java . util . Map < java . lang . String , java . lang . String > labels = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; labels . put ( "service" , "${0}" ) ; labels . put ( "status" , "s_${1}" ) ; final io . prometheus . client . dropwizard . samplebuilder . MapperConfig mapperConfig = new io . prometheus . client . dropwizard . samplebuilder . MapperConfig ( "${0}" 1 , "${0}" 2 , labels ) ; final java . util . List < io . prometheus . client . dropwizard . samplebuilder . MapperConfig > mapperConfigs = java . util . Arrays . asList ( new io . prometheus . client . dropwizard . samplebuilder . MapperConfig ( "${0}" 4 ) , mapperConfig , new io . prometheus . client . dropwizard . samplebuilder . MapperConfig ( "app.okhttpclient.client.HttpClient.*.total" ) ) ; final io . prometheus . client . dropwizard . samplebuilder . CustomMappingSampleBuilder converter = new io . prometheus . client . dropwizard . samplebuilder . CustomMappingSampleBuilder ( mapperConfigs ) ; final io . prometheus . client . Collector . MetricFamilySamples . Sample expectedResult = new io . prometheus . client . Collector . MetricFamilySamples . Sample ( "app_okhttpclient_client_HttpClient_greatService_suffix" , java . util . Arrays . asList ( "service" , "status" , "another" ) , java . util . Arrays . asList ( "greatService" , "${0}" 0 , "label" ) , 1.0 ) ; final io . prometheus . client . Collector . MetricFamilySamples . Sample result = converter . createSample ( "${0}" 3 , "_suffix" , java . util . Collections . singletonList ( "another" ) , java . util . Collections . singletonList ( "label" ) , 1.0 ) ; "<AssertPlaceHolder>" ; } createSample ( java . lang . String , java . lang . String , java . util . List , java . util . List , double ) { final java . lang . String suffix = ( nameSuffix == null ) ? "" : nameSuffix ; final java . util . List < java . lang . String > labelNames = ( additionalLabelNames == null ) ? java . util . Collections . < java . lang . String > emptyList ( ) : additionalLabelNames ; final java . util . List < java . lang . String > labelValues = ( additionalLabelValues == null ) ? java . util . Collections . < java . lang . String > emptyList ( ) : additionalLabelValues ; return new io . prometheus . client . Collector . MetricFamilySamples . Sample ( io . prometheus . client . Collector . sanitizeMetricName ( ( dropwizardName + suffix ) ) , new java . util . ArrayList < java . lang . String > ( labelNames ) , new java . util . ArrayList < java . lang . String > ( labelValues ) , value ) ; } | org . junit . Assert . assertEquals ( expectedResult , result ) |
testDeregisterElement ( ) { tested . init ( canvasHandler ) ; tested . register ( element ) ; tested . deregister ( element ) ; verify ( shapeEventHandler , times ( 1 ) ) . removeHandler ( any ( org . kie . workbench . common . stunner . core . client . shape . view . event . ViewHandler . class ) ) ; "<AssertPlaceHolder>" ; } isRegistered ( java . lang . String ) { return handlers . containsKey ( uuid ) ; } | org . junit . Assert . assertFalse ( tested . isRegistered ( element ) ) |
testAddAll ( ) { tester . getSearch ( ) . setRemoveOlderThanDays ( 1 ) ; java . util . concurrent . BlockingQueue < de . jetwick . data . JTweet > queue = tweetConsumer . register ( "addAll" , Integer . MAX_VALUE , 1 ) ; de . jetwick . data . JTweet tw = createTweet ( 1L , "@daniel<sp>fancy!" , "timetabling" ) ; tw . setCreatedAt ( new java . util . Date ( ) ) ; queue . add ( tw . setFeedSource ( "addAll" ) ) ; tweetConsumer . executeOneBatch ( ) ; "<AssertPlaceHolder>" ; } getInputQueue ( ) { return resolverQueue ; } | org . junit . Assert . assertEquals ( 1 , resolver . getInputQueue ( ) . size ( ) ) |
test1 ( ) { System . out . println ( "**<sp>Test<sp>1<sp>***" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( true ) |
testMatches ( ) { java . lang . String header = "<?xml<sp>version=\"\"?><PC-Substance/>" ; "<AssertPlaceHolder>" ; } matches ( org . openscience . cdk . interfaces . IAtom ) { return ! ( symbols . contains ( atom . getSymbol ( ) ) ) ; } | org . junit . Assert . assertTrue ( matches ( header ) ) |
testProcessWithoutConditionalEvent ( ) { org . camunda . bpm . model . bpmn . BpmnModelInstance modelInstance = org . camunda . bpm . model . bpmn . Bpmn . createExecutableProcess ( org . camunda . bpm . engine . test . bpmn . event . conditional . CONDITIONAL_EVENT_PROCESS_KEY ) . startEvent ( ) . serviceTask ( ) . camundaClass ( org . camunda . bpm . engine . test . bpmn . event . conditional . OnlyDispatchVariableEventOnExistingConditionsTest . CheckNoDelayedVariablesDelegate . class . getName ( ) ) . userTask ( ) . endEvent ( ) . done ( ) ; rule . manageDeployment ( rule . getRepositoryService ( ) . createDeployment ( ) . addModelInstance ( org . camunda . bpm . engine . test . bpmn . event . conditional . CONDITIONAL_MODEL , modelInstance ) . deploy ( ) ) ; org . camunda . bpm . engine . impl . persistence . entity . ProcessInstanceWithVariablesImpl processInstance = ( ( org . camunda . bpm . engine . impl . persistence . entity . ProcessInstanceWithVariablesImpl ) ( rule . getRuntimeService ( ) . startProcessInstanceByKey ( org . camunda . bpm . engine . test . bpmn . event . conditional . CONDITIONAL_EVENT_PROCESS_KEY ) ) ) ; java . lang . Object property = processInstance . getExecutionEntity ( ) . getProcessDefinition ( ) . getProperty ( BpmnParse . PROPERTYNAME_HAS_CONDITIONAL_EVENTS ) ; "<AssertPlaceHolder>" ; } getProperty ( org . camunda . bpm . engine . runtime . Job ) { return obj . getPriority ( ) ; } | org . junit . Assert . assertNull ( property ) |
testMultiMatchQuery2 ( ) { java . lang . Object value = null ; com . liferay . portal . search . query . MultiMatchQuery multiMatchQuery = com . liferay . portal . search . query . test . QueriesInstantiationTest . _queries . multiMatch ( value , "fields" ) ; "<AssertPlaceHolder>" ; } multiMatch ( java . lang . Object , java . lang . String [ ] ) { return new com . liferay . portal . search . internal . query . MultiMatchQueryImpl ( value , fields ) ; } | org . junit . Assert . assertNotNull ( multiMatchQuery ) |
testDeleteSiteNavigationMenuItemsByGroupId ( ) { com . liferay . portal . kernel . model . Group group = com . liferay . portal . kernel . test . util . GroupTestUtil . addGroup ( ) ; com . liferay . site . navigation . model . SiteNavigationMenu siteNavigationMenu = com . liferay . site . navigation . util . SiteNavigationMenuTestUtil . addSiteNavigationMenu ( group ) ; try { com . liferay . site . navigation . util . SiteNavigationMenuTestUtil . addSiteNavigationMenuItem ( siteNavigationMenu ) ; com . liferay . site . navigation . util . SiteNavigationMenuTestUtil . addSiteNavigationMenuItem ( siteNavigationMenu ) ; int originalSiteNavigationMenuItemsCount = com . liferay . site . navigation . service . SiteNavigationMenuItemLocalServiceUtil . getSiteNavigationMenuItemsCount ( siteNavigationMenu . getSiteNavigationMenuId ( ) ) ; com . liferay . site . navigation . service . SiteNavigationMenuItemLocalServiceUtil . deleteSiteNavigationMenuItemsByGroupId ( group . getGroupId ( ) ) ; int actualSiteNavigationMenuItemsCount = com . liferay . site . navigation . service . SiteNavigationMenuItemLocalServiceUtil . getSiteNavigationMenuItemsCount ( siteNavigationMenu . getSiteNavigationMenuId ( ) ) ; "<AssertPlaceHolder>" ; } finally { com . liferay . portal . kernel . service . GroupLocalServiceUtil . deleteGroup ( group ) ; } } getSiteNavigationMenuId ( ) { return _siteNavigationMenuId ; } | org . junit . Assert . assertEquals ( ( originalSiteNavigationMenuItemsCount - 2 ) , actualSiteNavigationMenuItemsCount ) |
sameNodeHasNoCommonNeighbors ( ) { try ( org . neo4j . graphdb . Transaction tx = api . beginTx ( ) ) { org . neo4j . graphdb . Node node1 = api . createNode ( ) ; org . neo4j . graphdb . Node node2 = api . createNode ( ) ; node1 . createRelationshipTo ( node2 , org . neo4j . graphalgo . algo . linkprediction . NeighborsFinderTest . FRIEND ) ; tx . success ( ) ; } org . neo4j . graphalgo . linkprediction . NeighborsFinder neighborsFinder = new org . neo4j . graphalgo . linkprediction . NeighborsFinder ( api ) ; try ( org . neo4j . graphdb . Transaction tx = api . beginTx ( ) ) { org . neo4j . graphdb . Node node1 = api . getNodeById ( 0 ) ; java . util . Set < org . neo4j . graphdb . Node > neighbors = neighborsFinder . findCommonNeighbors ( node1 , node1 , null , Direction . BOTH ) ; "<AssertPlaceHolder>" ; } } size ( ) { return size ; } | org . junit . Assert . assertEquals ( 0 , neighbors . size ( ) ) |
conversionToDataType ( ) { final org . drools . workbench . models . guided . dtable . shared . model . DTCellValue52 dcv = new org . drools . workbench . models . guided . dtable . shared . model . DTCellValue52 ( value ) ; dcv . setOtherwise ( isOtherwise ) ; cellUtilities . convertDTCellValueType ( DataType . DataTypes . NUMERIC_BYTE , dcv ) ; "<AssertPlaceHolder>" ; } getNumericValue ( ) { try { if ( ( realCellValue . getNumericValue ( ) ) != null ) { return new org . drools . verifier . core . index . keys . Values ( ( ( java . lang . Comparable ) ( realCellValue . getNumericValue ( ) ) ) ) ; } else { return new org . drools . verifier . core . index . keys . Values ( ) ; } } catch ( final java . lang . Exception e ) { throw new org . drools . workbench . services . verifier . plugin . client . builders . ValueResolveException ( "Failed<sp>to<sp>resolve<sp>Numeric<sp>Value" ) ; } } | org . junit . Assert . assertEquals ( expected , dcv . getNumericValue ( ) ) |
when_allEdgesIdle_then_idleForwarded ( ) { com . hazelcast . jet . impl . execution . MockInboundStream instream1 = new com . hazelcast . jet . impl . execution . MockInboundStream ( 0 , singletonList ( com . hazelcast . jet . impl . execution . WatermarkCoalescer . IDLE_MESSAGE ) , 1000 ) ; com . hazelcast . jet . impl . execution . MockInboundStream instream2 = new com . hazelcast . jet . impl . execution . MockInboundStream ( 0 , singletonList ( com . hazelcast . jet . impl . execution . WatermarkCoalescer . IDLE_MESSAGE ) , 1000 ) ; com . hazelcast . jet . impl . execution . MockOutboundStream outstream1 = new com . hazelcast . jet . impl . execution . MockOutboundStream ( 0 , 128 ) ; instreams . add ( instream1 ) ; instreams . add ( instream2 ) ; outstreams . add ( outstream1 ) ; com . hazelcast . jet . impl . execution . ProcessorTasklet tasklet = createTasklet ( ) ; com . hazelcast . jet . impl . execution . ProcessorTaskletTest_Watermarks . callUntil ( tasklet ) ; "<AssertPlaceHolder>" ; } getBuffer ( ) { return buffer ; } | org . junit . Assert . assertEquals ( singletonList ( com . hazelcast . jet . impl . execution . WatermarkCoalescer . IDLE_MESSAGE ) , outstream1 . getBuffer ( ) ) |
testCreate ( ) { org . oscarehr . common . model . ReportFilter entity = new org . oscarehr . common . model . ReportFilter ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; } | org . junit . Assert . assertNotNull ( entity . getId ( ) ) |
testOnDiskButNotMemory ( ) { fakeSeenByScan ( org . apache . hadoop . hdfs . server . datanode . TestBlockReportGeneration . FAKE_BLK ) ; fakeBlockOnDisk ( org . apache . hadoop . hdfs . server . datanode . TestBlockReportGeneration . FAKE_BLK ) ; org . apache . hadoop . hdfs . server . datanode . FSDataset . reconcileRoughBlockScan ( seenOnDisk , volumeMap , ongoingCreates ) ; "<AssertPlaceHolder>" ; } containsKey ( java . lang . Object ) { return instance . containsKey ( key ) ; } | org . junit . Assert . assertTrue ( seenOnDisk . containsKey ( org . apache . hadoop . hdfs . server . datanode . TestBlockReportGeneration . FAKE_BLK ) ) |
testLastStatus ( ) { final java . lang . String name = "plugin1" ; final java . lang . String status = "some<sp>status" ; final java . util . Set < org . apache . usergrid . persistence . core . migration . data . MigrationPlugin > plugins = new java . util . LinkedHashSet ( ) ; org . apache . usergrid . persistence . core . migration . data . MigrationPlugin plugin1 = mock ( org . apache . usergrid . persistence . core . migration . data . MigrationPlugin . class ) ; when ( plugin1 . getPhase ( ) ) . thenReturn ( PluginPhase . MIGRATE ) ; when ( plugin1 . getName ( ) ) . thenReturn ( name ) ; plugins . add ( plugin1 ) ; final org . apache . usergrid . persistence . core . migration . data . MigrationInfoSerialization migrationInfoSerialization = mock ( org . apache . usergrid . persistence . core . migration . data . MigrationInfoSerialization . class ) ; when ( migrationInfoSerialization . getStatusMessage ( name ) ) . thenReturn ( status ) ; final org . apache . usergrid . persistence . core . migration . data . MigrationInfoCache migrationInfoCache = mock ( org . apache . usergrid . persistence . core . migration . data . MigrationInfoCache . class ) ; org . apache . usergrid . persistence . core . migration . data . DataMigrationManagerImpl migrationManager = new org . apache . usergrid . persistence . core . migration . data . DataMigrationManagerImpl ( plugins , migrationInfoSerialization , migrationInfoCache ) ; final java . lang . String returnedStatus = migrationManager . getLastStatus ( name ) ; "<AssertPlaceHolder>" ; } getLastStatus ( java . lang . String ) { com . google . common . base . Preconditions . checkNotNull ( pluginName , "pluginName<sp>cannot<sp>be<sp>null" ) ; return migrationInfoSerialization . getStatusMessage ( pluginName ) ; } | org . junit . Assert . assertEquals ( status , returnedStatus ) |
testPathWithMethodDisplayMethod ( ) { org . jsondoc . core . pojo . ApiDoc apiDoc = jsondocScanner . getApiDocs ( com . google . common . collect . Sets . < java . lang . Class < ? > > newHashSet ( org . jsondoc . springmvc . scanner . SpringPathBuilderTest . SpringController5 . class ) , MethodDisplay . METHOD ) . iterator ( ) . next ( ) ; boolean allRight = com . google . common . collect . FluentIterable . from ( apiDoc . getMethods ( ) ) . anyMatch ( new com . google . common . base . Predicate < org . jsondoc . core . pojo . ApiMethodDoc > ( ) { @ org . jsondoc . springmvc . scanner . Override public boolean apply ( org . jsondoc . core . pojo . ApiMethodDoc input ) { boolean allRight = ( ( input . getPath ( ) . contains ( "/path" ) ) && ( input . getPath ( ) . contains ( "/path2" ) ) ) && ( input . getDisplayedMethodString ( ) . contains ( "none" ) ) ; return allRight ; } } ) ; "<AssertPlaceHolder>" ; } getDisplayedMethodString ( ) { switch ( displayMethodAs ) { case URI : return path ; case SUMMARY : return com . google . common . collect . Sets . newHashSet ( summary ) ; case METHOD : return com . google . common . collect . Sets . newHashSet ( method ) ; default : return path ; } } | org . junit . Assert . assertTrue ( allRight ) |
testDeserialization ( ) { java . util . Map < java . time . LocalDate , java . lang . String > value = om . readValue ( map ( Jsr310NullKeySerializer . NULL_KEY , "test" ) , com . fasterxml . jackson . datatype . jsr310 . TestNullKeySerialization . TYPE_REF ) ; map . put ( null , "test" ) ; "<AssertPlaceHolder>" ; } map ( java . lang . String , java . lang . String ) { return java . lang . String . format ( "{\"%s\":\"%s\"}" , key , value ) ; } | org . junit . Assert . assertEquals ( map , value ) |
weAddTimeShouldGetLast ( ) { java . util . Properties properties = new java . util . Properties ( ) ; try ( java . io . FileInputStream fileInputStream = new java . io . FileInputStream ( this . getClass ( ) . getClassLoader ( ) . getResource ( "vacancy.properties" ) . getPath ( ) ) ) { properties . load ( fileInputStream ) ; } catch ( java . io . FileNotFoundException e ) { } catch ( java . io . IOException e ) { } ru . szhernovoy . jobvacancy . controller . DBManager dbManager = new ru . szhernovoy . jobvacancy . controller . DBManager ( properties ) ; dbManager . setTimeLoad ( java . lang . System . currentTimeMillis ( ) ) ; dbManager . setTimeLoad ( java . lang . System . currentTimeMillis ( ) ) ; long result = java . lang . System . currentTimeMillis ( ) ; dbManager . setTimeLoad ( result ) ; "<AssertPlaceHolder>" ; dbManager . close ( ) ; } getLastLoad ( ) { ru . szhernovoy . jobvacancy . controller . PreparedStatement st = null ; ru . szhernovoy . jobvacancy . controller . ResultSet rs = null ; long result = 0 ; try { st = conn . prepareStatement ( "SELECT<sp>d.lastDate<sp>FROM<sp>work<sp>as<sp>d" ) ; rs = st . executeQuery ( ) ; if ( rs . next ( ) ) { result = rs . getTimestamp ( "lastdate" ) . getTime ( ) ; ru . szhernovoy . jobvacancy . controller . DBManager . log . info ( "get<sp>time<sp>last<sp>load" ) ; } } catch ( java . lang . Exception e ) { ru . szhernovoy . jobvacancy . controller . DBManager . log . error ( e . getMessage ( ) , e ) ; } finally { try { st . close ( ) ; rs . close ( ) ; } catch ( java . lang . Exception e ) { ru . szhernovoy . jobvacancy . controller . DBManager . log . error ( e . getMessage ( ) , e ) ; } } return result ; } | org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( dbManager . getLastLoad ( ) ) ) |
testGetTitle ( ) { final org . drools . workbench . screens . guided . dtable . client . editor . page . accordion . GuidedDecisionTableAccordionItem . Type type = GuidedDecisionTableAccordionItem . Type . CONDITION ; final java . lang . String title = "title" ; when ( translationService . format ( type . getTitleKey ( ) ) ) . thenReturn ( title ) ; when ( item . getType ( ) ) . thenReturn ( type ) ; final java . lang . String itemTitle = item . getTitle ( ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return super . getTitle ( ) ; } | org . junit . Assert . assertEquals ( title , itemTitle ) |
asMulti_object ( ) { java . util . Map < java . lang . String , ezvcard . io . json . JsonValue > object = new java . util . HashMap < java . lang . String , ezvcard . io . json . JsonValue > ( ) ; object . put ( "a" , new ezvcard . io . json . JsonValue ( "one" ) ) ; ezvcard . io . json . JCardValue value = new ezvcard . io . json . JCardValue ( new ezvcard . io . json . JsonValue ( object ) ) ; "<AssertPlaceHolder>" ; } asMulti ( ) { if ( values . isEmpty ( ) ) { return java . util . Collections . emptyList ( ) ; } java . util . List < java . lang . String > multi = new java . util . ArrayList < java . lang . String > ( values . size ( ) ) ; for ( ezvcard . io . json . JsonValue value : values ) { if ( value . isNull ( ) ) { multi . add ( "" ) ; continue ; } java . lang . Object obj = value . getValue ( ) ; if ( obj != null ) { multi . add ( obj . toString ( ) ) ; continue ; } } return multi ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( ) , value . asMulti ( ) ) |
testSome02 ( ) { final org . stjs . javascript . Array < java . lang . Integer > arr = org . stjs . javascript . JSCollections . $array ( 1 , 2 , 3 , 4 , 5 ) ; org . stjs . javascript . ArraySomeTest . SomeCB < java . lang . Integer > callbackfn = new org . stjs . javascript . ArraySomeTest . SomeCB < java . lang . Integer > ( ) { @ org . stjs . javascript . Override public org . stjs . javascript . Boolean $invoke ( java . lang . Integer value , java . lang . Long index , org . stjs . javascript . Array < java . lang . Integer > arr ) { arr . $set ( 4 , 6 ) ; return value < 6 ; } } ; "<AssertPlaceHolder>" ; } some ( org . stjs . javascript . functions . Function1 ) { org . stjs . javascript . functions . Function3 f3 = org . stjs . javascript . functions . Functions . f3 ( callbackfn ) ; return some ( f3 ) ; } | org . junit . Assert . assertTrue ( arr . some ( callbackfn ) ) |
toOutputStreamImageFormatMatchesOutputFormatForJpeg ( ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; net . coobird . thumbnailator . Thumbnails . of ( "src/test/resources/Thumbnailator/grid.jpg" ) . size ( 100 , 100 ) . outputFormat ( "JPEG" ) . toOutputStream ( baos ) ; "<AssertPlaceHolder>" ; } getFormatName ( java . io . InputStream ) { return javax . imageio . ImageIO . getImageReaders ( javax . imageio . ImageIO . createImageInputStream ( is ) ) . next ( ) . getFormatName ( ) ; } | org . junit . Assert . assertEquals ( "JPEG" , net . coobird . thumbnailator . TestUtils . getFormatName ( new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ) ) |
testSendFaulted ( ) { final java . lang . String messageId = "testSendFaulted" ; final com . arjuna . webservices11 . wsarj . InstanceIdentifier instanceIdentifier = new com . arjuna . webservices11 . wsarj . InstanceIdentifier ( "4" ) ; javax . xml . ws . wsaddressing . W3CEndpointReference endpoint = com . arjuna . wst . tests . TestUtil . getParticipantCompletionParticipantEndpoint ( instanceIdentifier . getInstanceIdentifier ( ) ) ; final org . jboss . ws . api . addressing . MAP map = com . arjuna . webservices11 . wsaddr . AddressingHelper . createRequestContext ( TestUtil . participantCompletionParticipantServiceURI , messageId ) ; com . arjuna . webservices11 . wsba . client . ParticipantCompletionParticipantClient . getClient ( ) . sendFailed ( endpoint , map , new com . arjuna . webservices11 . wsarj . InstanceIdentifier ( "sender" ) ) ; final com . arjuna . wst . tests . arq . TestParticipantCompletionParticipantProcessor . ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor . getParticipantCompletionParticipantDetails ( messageId , 10000 ) ; "<AssertPlaceHolder>" ; checkDetails ( details , false , true , messageId , instanceIdentifier ) ; } hasFaulted ( ) { return faulted ; } | org . junit . Assert . assertTrue ( details . hasFaulted ( ) ) |
testCountQuery ( ) { int count = db ( ) . select ( "select<sp>name<sp>from<sp>person<sp>where<sp>name<sp>>?" ) . parameter ( "ALEX" ) . count ( ) . first ( ) . toBlocking ( ) . single ( ) ; "<AssertPlaceHolder>" ; } count ( ) { return rx . Observable . create ( new rx . Observable . OnSubscribe < java . lang . Long > ( ) { @ com . github . davidmoten . rx . Override public void call ( rx . Subscriber < ? super java . lang . Long > subscriber ) { subscriber . onNext ( count . get ( ) ) ; subscriber . onCompleted ( ) ; } } ) ; } | org . junit . Assert . assertEquals ( 3 , count ) |
testUpdateUserNamespaceAuthorizationTrimParameters ( ) { org . springframework . security . core . Authentication originalAuthentication = overrideSecurityContext ( ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey key = new org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey ( USER_ID , NAMESPACE ) ; org . finra . herd . model . jpa . UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = userNamespaceAuthorizationDaoTestHelper . createUserNamespaceAuthorizationEntity ( key , java . util . Arrays . asList ( NamespacePermissionEnum . READ , NamespacePermissionEnum . WRITE ) ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorization resultUserNamespaceAuthorization = userNamespaceAuthorizationService . updateUserNamespaceAuthorization ( new org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey ( addWhitespace ( key . getUserId ( ) ) , addWhitespace ( key . getNamespace ( ) ) ) , new org . finra . herd . model . api . xml . UserNamespaceAuthorizationUpdateRequest ( SUPPORTED_NAMESPACE_PERMISSIONS ) ) ; "<AssertPlaceHolder>" ; restoreSecurityContext ( originalAuthentication ) ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . UserNamespaceAuthorization ( userNamespaceAuthorizationEntity . getId ( ) , key , SUPPORTED_NAMESPACE_PERMISSIONS ) , resultUserNamespaceAuthorization ) |
work_day_query_lambda ( ) { java . util . List < java . time . LocalDate > randomDays = com . google . common . collect . Lists . newArrayList ( java . time . LocalDate . of ( 2014 , Month . FEBRUARY , 16 ) , java . time . LocalDate . of ( 2014 , Month . APRIL , 19 ) , java . time . LocalDate . of ( 2014 , Month . MAY , 30 ) , java . time . LocalDate . of ( 2014 , Month . DECEMBER , 12 ) , java . time . LocalDate . of ( 2014 , Month . DECEMBER , 17 ) ) ; java . util . List < java . time . LocalDate > workDays = randomDays . stream ( ) . filter ( ( p ) -> p . query ( new com . levelup . java . date . query . WorkDayQuery ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 3 , workDays . size ( ) ) |
testGetDefaults ( ) { org . bukkit . configuration . Configuration config = getConfig ( ) ; org . bukkit . configuration . Configuration defaults = getConfig ( ) ; config . setDefaults ( defaults ) ; "<AssertPlaceHolder>" ; } getDefaults ( ) { return defaults ; } | org . junit . Assert . assertEquals ( defaults , config . getDefaults ( ) ) |
test ( ) { org . tests . model . basic . ResetBasicData . reset ( ) ; java . lang . String sql = "select<sp>order_id,<sp>count(*)<sp>as<sp>totalItems,<sp>sum(order_qty*unit_price)<sp>as<sp>totalAmount<sp>\n" + ( "from<sp>o_order_detail<sp>\n" + "group<sp>by<sp>order_id" ) ; io . ebean . RawSql rawSql = io . ebean . RawSqlBuilder . parse ( sql ) . columnMapping ( "order_id" , "order.id" ) . create ( ) ; java . util . List < org . tests . model . basic . OrderAggregate > l0 = io . ebean . Ebean . find ( org . tests . model . basic . OrderAggregate . class ) . setRawSql ( rawSql ) . findList ( ) ; for ( org . tests . model . basic . OrderAggregate r0 : l0 ) { r0 . toString ( ) ; } java . util . List < org . tests . model . basic . OrderAggregate > l2 = io . ebean . Ebean . createQuery ( org . tests . model . basic . OrderAggregate . class ) . setRawSql ( rawSql ) . where ( ) . gt ( "order.id" , 0 ) . having ( ) . lt ( "totalItems" , 3 ) . gt ( "totalAmount" , 50 ) . findList ( ) ; for ( org . tests . model . basic . OrderAggregate r2 : l2 ) { "<AssertPlaceHolder>" ; } } getTotalItems ( ) { return totalItems ; } | org . junit . Assert . assertTrue ( ( ( r2 . getTotalItems ( ) ) < 3 ) ) |
testCountVars ( ) { java . lang . String csv = "1\n1,1,1\n1,1" ; "<AssertPlaceHolder>" ; } countRows ( java . lang . String , boolean ) { java . util . Iterator < org . apache . jena . sparql . engine . binding . Binding > table = org . deri . tarql . CSVParserTest . readCSV ( csv , varsFromHeader ) ; long count = 0 ; while ( table . hasNext ( ) ) { table . next ( ) ; count += 1 ; } return count ; } | org . junit . Assert . assertEquals ( 3 , org . deri . tarql . CSVParserTest . countRows ( csv , false ) ) |
incompleteSegmentsNotEmitted ( ) { okio . Buffer sink = new okio . Buffer ( ) ; okio . BufferedSink bufferedSink = new okio . RealBufferedSink ( sink ) ; bufferedSink . writeUtf8 ( okio . TestUtil . repeat ( 'a' , ( ( ( Segment . SIZE ) * 3 ) - 1 ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return pos ; } | org . junit . Assert . assertEquals ( ( ( Segment . SIZE ) * 2 ) , sink . size ( ) ) |
testThrowCheckedException ( ) { java . io . IOException expected = new java . io . IOException ( "EXPECTED<sp>ERROR" ) ; java . io . IOException actual = null ; try { org . slieb . throwables . ObjLongConsumerWithThrowable . aObjLongConsumerThatUnsafelyThrowsUnchecked ( ( v1 , v2 ) -> { throw expected ; } ) . accept ( null , 0 ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( java . io . IOException e ) { actual = e ; } "<AssertPlaceHolder>" ; } accept ( T , long ) { try { acceptWithThrowable ( v1 , v2 ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
testNewAtomType_IElement ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IAtomType type = builder . newInstance ( org . openscience . cdk . interfaces . IAtomType . class , builder . newInstance ( org . openscience . cdk . interfaces . IElement . class , "C" ) ) ; "<AssertPlaceHolder>" ; } newInstance ( java . lang . Class , java . lang . Object [ ] ) { return factory . ofClass ( clazz , params ) ; } | org . junit . Assert . assertNotNull ( type ) |
testCase19 ( ) { org . evosuite . testcase . DefaultTestCase tc = buildTestCase19 ( ) ; java . util . List < org . evosuite . symbolic . BranchCondition > branch_conditions = executeTest ( tc ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , branch_conditions . size ( ) ) |
runTestLoop1 ( ) { soot . jimple . infoflow . results . InfoflowResults res = analyzeAPKFile ( "GeneralJava/Loop1.apk" ) ; "<AssertPlaceHolder>" ; } size ( ) { return set . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , res . size ( ) ) |
testSerialSignatures ( ) { java . lang . Class < ? > serializerOne = com . google . auto . value . gwt . AutoValue_SerialSignatureTest_One_CustomFieldSerializer . class ; java . lang . Class < ? > serializerTwo = com . google . auto . value . gwt . AutoValue_SerialSignatureTest_Two_CustomFieldSerializer . class ; java . lang . String fieldNameOne = com . google . auto . value . gwt . SerialSignatureTest . dummySignatureFieldName ( serializerOne ) ; java . lang . String fieldNameTwo = com . google . auto . value . gwt . SerialSignatureTest . dummySignatureFieldName ( serializerTwo ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( o instanceof com . google . auto . common . MoreTypes . ComparedElements ) { com . google . auto . common . MoreTypes . ComparedElements that = ( ( com . google . auto . common . MoreTypes . ComparedElements ) ( o ) ) ; int nArguments = aArguments . size ( ) ; if ( ( ( ! ( this . a . equals ( that . a ) ) ) || ( ! ( this . b . equals ( that . b ) ) ) ) || ( nArguments != ( bArguments . size ( ) ) ) ) { return false ; } for ( int i = 0 ; i < nArguments ; i ++ ) { if ( ( aArguments . get ( i ) ) != ( bArguments . get ( i ) ) ) { return false ; } } return true ; } else { return false ; } } | org . junit . Assert . assertFalse ( fieldNameOne . equals ( fieldNameTwo ) ) |
testUpdateJob ( ) { final java . lang . String description = "test-" + ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; hudson . model . FreeStyleProject freeStyleProject = jenkinsRule . getInstance ( ) . createProject ( hudson . model . FreeStyleProject . class , com . offbytwo . jenkins . integration . JenkinsServerIT . JENKINS_TEST_JOB ) ; freeStyleProject . setDescription ( description ) ; java . lang . String sourceXml = server . getJobXml ( com . offbytwo . jenkins . integration . JenkinsServerIT . JENKINS_TEST_JOB ) ; java . lang . String newXml = sourceXml . replaceAll ( "<description>.*</description>" , ( ( "<description>" + description ) + "</description>" ) ) ; server . updateJob ( com . offbytwo . jenkins . integration . JenkinsServerIT . JENKINS_TEST_JOB , newXml ) ; java . lang . String confirmXml = server . getJobXml ( com . offbytwo . jenkins . integration . JenkinsServerIT . JENKINS_TEST_JOB ) ; "<AssertPlaceHolder>" ; } contains ( hudson . model . TopLevelItem ) { return false ; } | org . junit . Assert . assertTrue ( confirmXml . contains ( description ) ) |
testQueryForAnExistingTableAndNonExistingField ( ) { boolean thrown = false ; try { org . apache . metamodel . cassandra . CassandraDataContextTest . dc . query ( ) . from ( org . apache . metamodel . cassandra . CassandraDataContextTest . testTableName ) . select ( "nonExistingField" ) . execute ( ) ; } catch ( org . apache . metamodel . query . parser . QueryParserException ex ) { thrown = true ; } "<AssertPlaceHolder>" ; } execute ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertTrue ( thrown ) |
constructor ( ) { final org . apache . rya . api . instance . RyaDetails originalDetails = . setGeoIndexDetails ( new GeoIndexDetails ( true ) ) org . apache . rya . api . instance . RyaDetails . builder ( ) . setRyaInstanceName ( "test_instance" ) . setRyaVersion ( "1.2.3.4" ) . setEntityCentricIndexDetails ( new org . apache . rya . api . instance . RyaDetails . EntityCentricIndexDetails ( true ) ) . setTemporalIndexDetails ( new org . apache . rya . api . instance . RyaDetails . TemporalIndexDetails ( true ) ) . setFreeTextDetails ( new org . apache . rya . api . instance . RyaDetails . FreeTextIndexDetails ( true ) ) . setPCJIndexDetails ( org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . builder ( ) . setEnabled ( true ) . setFluoDetails ( new org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . FluoDetails ( "test_instance_rya_pcj_updater" ) ) . addPCJDetails ( org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . PCJDetails . builder ( ) . setId ( "pcj<sp>1" ) . setUpdateStrategy ( PCJUpdateStrategy . BATCH ) . setLastUpdateTime ( new java . util . Date ( ) ) ) . addPCJDetails ( org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . PCJDetails . builder ( ) . setId ( "pcj<sp>2" ) . setUpdateStrategy ( PCJUpdateStrategy . INCREMENTAL ) ) ) . setProspectorDetails ( new org . apache . rya . api . instance . RyaDetails . ProspectorDetails ( com . google . common . base . Optional . of ( new java . util . Date ( ) ) ) ) . setJoinSelectivityDetails ( new org . apache . rya . api . instance . RyaDetails . JoinSelectivityDetails ( com . google . common . base . Optional . of ( new java . util . Date ( ) ) ) ) . setRyaStreamsDetails ( new org . apache . rya . api . instance . RyaDetails . RyaStreamsDetails ( "localhost" , 5 ) ) . build ( ) ; final org . apache . rya . api . instance . RyaDetails . Builder builder = new org . apache . rya . api . instance . RyaDetails . Builder ( originalDetails ) ; "<AssertPlaceHolder>" ; } build ( ) { return new org . apache . rya . prospector . domain . IntermediateProspect ( index , data , dataType , tripleValueType , visibility ) ; } | org . junit . Assert . assertEquals ( originalDetails , builder . build ( ) ) |
testDecodeConnect ( ) { org . jboss . netty . buffer . ChannelBuffer bytes = read ( "valid-connect.msg" , true ) ; this . decoder . offer ( bytes ) ; org . projectodd . stilts . stomp . protocol . StompFrame frame = this . decoder . poll ( ) ; "<AssertPlaceHolder>" ; } poll ( ) { return productQueue . poll ( ) ; } | org . junit . Assert . assertNotNull ( frame ) |
onQuarters ( ) { net . time4j . range . CalendarPeriod < net . time4j . range . CalendarQuarter > expected = net . time4j . range . CalendarPeriod . between ( net . time4j . range . CalendarQuarter . of ( 2017 , Quarter . Q3 ) , net . time4j . range . CalendarQuarter . of ( 2020 , Quarter . Q2 ) ) ; net . time4j . format . expert . ChronoFormatter < net . time4j . range . CalendarQuarter > f = net . time4j . format . expert . ChronoFormatter . ofPattern ( "QQQ/uuuu" , PatternType . CLDR , Locale . ENGLISH , net . time4j . range . CalendarQuarter . chronology ( ) ) ; "<AssertPlaceHolder>" ; } onQuarters ( ) { net . time4j . range . CalendarPeriod < net . time4j . range . CalendarQuarter > expected = net . time4j . range . CalendarPeriod . between ( net . time4j . range . CalendarQuarter . of ( 2017 , Quarter . Q3 ) , net . time4j . range . CalendarQuarter . of ( 2020 , Quarter . Q2 ) ) ; net . time4j . format . expert . ChronoFormatter < net . time4j . range . CalendarQuarter > f = net . time4j . format . expert . ChronoFormatter . ofPattern ( "QQQ/uuuu" , PatternType . CLDR , Locale . ENGLISH , net . time4j . range . CalendarQuarter . chronology ( ) ) ; org . junit . Assert . assertThat ( net . time4j . range . CalendarPeriod . onQuarters ( ) . parse ( "Q3/2017<sp><sp>Q2/2020" , f ) , org . hamcrest . CoreMatchers . is ( expected ) ) ; } | org . junit . Assert . assertThat ( net . time4j . range . CalendarPeriod . onQuarters ( ) . parse ( "Q3/2017<sp><sp>Q2/2020" , f ) , org . hamcrest . CoreMatchers . is ( expected ) ) |
testMath85_ParticularIngredientStrategy ( ) { fr . inria . main . evolution . AstorMain main1 = new fr . inria . main . evolution . AstorMain ( ) ; java . lang . String dep = new java . io . File ( "7" 8 ) . getAbsolutePath ( ) ; java . lang . String [ ] args = new java . lang . String [ ] { "/target/classes" 5 , dep , "/target/classes" 6 , "7" 2 , "-failing" , "7" 3 , "/target/classes" 4 , new java . io . File ( "AstorMain-math_85/" 0 ) . getAbsolutePath ( ) , "-package" , "/target/classes" 7 , "7" 7 , "/src/java/" , "/target/classes" 2 , "/src/test/" , "-binjavafolder" , "/target/classes" , "7" 5 , "AstorMain-math_85/" 1 , "/target/classes" 3 , "7" , "/target/classes" 8 , "7" 1 , "-stopfirst" , "7" 0 , "/target/classes" 1 , "/target/classes" 9 , "/target/classes" 0 , "package" , "7" 9 , "7" 4 , "7" 6 , fr . inria . astor . core . solutionsearch . spaces . ingredients . ingredientSearch . RandomSelectionTransformedIngredientStrategy . class . getCanonicalName ( ) } ; System . out . println ( java . util . Arrays . toString ( args ) ) ; main1 . execute ( args ) ; validatePatchExistence ( ( ( ( out ) + ( java . io . File . separator ) ) + "AstorMain-math_85/" ) ) ; java . util . List < fr . inria . astor . core . entities . ProgramVariant > solutions = main1 . getEngine ( ) . getSolutions ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . operators . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( solutions . size ( ) ) > 0 ) ) |
testPackageNameInvalid ( ) { try ( org . jboss . forge . addon . ui . controller . CommandController controller = uiTestHarness . createCommandController ( org . jboss . forge . addon . parser . java . ui . mock . PackageRootCommand . class ) ) { controller . initialize ( ) ; controller . setValueFor ( "packageName" , "~.model" ) ; "<AssertPlaceHolder>" ; } } isValid ( ) { return getCurrentController ( ) . isValid ( ) ; } | org . junit . Assert . assertFalse ( controller . isValid ( ) ) |
testPublicConstructorBerichtModel ( ) { final nl . bzk . brp . model . operationeel . ber . BerichtModel berichtModel = new nl . bzk . brp . model . operationeel . ber . BerichtModel ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( berichtModel ) |
checkTest1 ( ) { com . navercorp . pinpoint . web . vo . Application application = new com . navercorp . pinpoint . web . vo . Application ( com . navercorp . pinpoint . web . alarm . checker . SlowCountCheckerTest . SERVICE_NAME , com . navercorp . pinpoint . common . trace . ServiceType . STAND_ALONE ) ; com . navercorp . pinpoint . web . alarm . collector . ResponseTimeDataCollector collector = new com . navercorp . pinpoint . web . alarm . collector . ResponseTimeDataCollector ( com . navercorp . pinpoint . web . alarm . DataCollectorFactory . DataCollectorCategory . RESPONSE_TIME , application , com . navercorp . pinpoint . web . alarm . checker . SlowCountCheckerTest . mockMapResponseDAO , java . lang . System . currentTimeMillis ( ) , 300000 ) ; com . navercorp . pinpoint . web . alarm . vo . Rule rule = new com . navercorp . pinpoint . web . alarm . vo . Rule ( com . navercorp . pinpoint . web . alarm . checker . SlowCountCheckerTest . SERVICE_NAME , com . navercorp . pinpoint . web . alarm . checker . SlowCountCheckerTest . SERVICE_TYPE , CheckerCategory . SLOW_COUNT . getName ( ) , 74 , "testGroup" , false , false , "" ) ; com . navercorp . pinpoint . web . alarm . checker . SlowCountChecker checker = new com . navercorp . pinpoint . web . alarm . checker . SlowCountChecker ( collector , rule ) ; checker . check ( ) ; "<AssertPlaceHolder>" ; } isDetected ( ) { return detected ; } | org . junit . Assert . assertTrue ( checker . isDetected ( ) ) |
serializationRestorationTest ( ) { org . apache . apex . malhar . lib . appdata . datastructs . DimensionalTable < java . lang . Integer > table = createTestTable ( ) ; int size = table . size ( ) ; table = org . apache . apex . malhar . lib . util . KryoCloneUtils . cloneObject ( table ) ; "<AssertPlaceHolder>" ; } size ( ) { return key . length ; } | org . junit . Assert . assertEquals ( size , table . size ( ) ) |
testClassnameConfigConstructor ( ) { final com . inspiresoftware . lib . dto . geda . assembler . MethodSynthesizerProxy proxy = new com . inspiresoftware . lib . dto . geda . assembler . MethodSynthesizerProxy ( this . getClass ( ) . getClassLoader ( ) , com . inspiresoftware . lib . dto . geda . assembler . extension . impl . JavassistMethodSynthesizer . class . getCanonicalName ( ) ) ; final com . inspiresoftware . lib . dto . geda . assembler . extension . MethodSynthesizer syn = proxy . getSynthesizer ( ) ; "<AssertPlaceHolder>" ; } getSynthesizer ( ) { return synthesizer ; } | org . junit . Assert . assertTrue ( ( syn instanceof com . inspiresoftware . lib . dto . geda . assembler . extension . impl . JavassistMethodSynthesizer ) ) |
getIndicatiePKVolledigGeconverteerdCodeNOkTest ( ) { final java . lang . String code = "X" ; final java . lang . String resultNat = lo3StamtabelService . getIndicatiePKVolledigGeconverteerdCode ( code ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( code , resultNat ) |
ifNotHashSet_thenSuccess ( ) { java . util . Set < java . lang . String > list = java . util . Set . of ( "foo" , "bar" ) ; "<AssertPlaceHolder>" ; } of ( java . lang . String , java . lang . Integer ) { return new com . baeldung . kafka . Tuple ( key , value ) ; } | org . junit . Assert . assertFalse ( ( list instanceof java . util . HashSet ) ) |
testGetArgString ( ) { com . lynden . gmapsfx . javascript . object . LatLong arg = new com . lynden . gmapsfx . javascript . object . LatLong ( 15 , 15 ) ; arg . variableName = "myVariable" ; com . lynden . gmapsfx . javascript . JavascriptRuntime rt = ( ( com . lynden . gmapsfx . javascript . JavascriptRuntime ) ( com . lynden . gmapsfx . javascript . JavascriptRuntime . getInstance ( ) ) ) ; "<AssertPlaceHolder>" ; } getArgString ( java . lang . Object ) { if ( arg instanceof com . lynden . gmapsfx . javascript . JavascriptObject ) { return ( ( com . lynden . gmapsfx . javascript . JavascriptObject ) ( arg ) ) . getVariableName ( ) ; } else if ( arg instanceof com . lynden . gmapsfx . javascript . JavascriptEnum ) { return ( ( com . lynden . gmapsfx . javascript . JavascriptEnum ) ( arg ) ) . getEnumValue ( ) . toString ( ) ; } else { return arg . toString ( ) ; } } | org . junit . Assert . assertEquals ( "myVariable" , rt . getArgString ( arg ) ) |
testTarPreservesContent ( ) { java . lang . String payload = "The<sp>quick<sp>brown<sp>fox<sp>jumps<sp>over<sp>the<sp>lazy<sp>dog!" ; writeTrashFile ( "xyzzy" , payload ) ; git . add ( ) . addFilepattern ( "xyzzy" ) . call ( ) ; git . commit ( ) . setMessage ( "add<sp>file<sp>with<sp>content" ) . call ( ) ; byte [ ] result = org . eclipse . jgit . pgm . CLIGitCommand . executeRaw ( "git<sp>archive<sp>--format=tar<sp>HEAD" , db ) . outBytes ( ) ; "<AssertPlaceHolder>" ; } tarEntryContent ( byte [ ] , java . lang . String ) { java . util . List < java . lang . String > l = new java . util . ArrayList ( ) ; java . lang . Process proc = spawnAssumingCommandPresent ( "tar" , "Oxf" , "-" , path ) ; try ( java . io . BufferedReader reader = readFromProcess ( proc ) ) { java . io . OutputStream out = proc . getOutputStream ( ) ; java . util . concurrent . Future < ? > writing = org . eclipse . jgit . pgm . ArchiveTest . writeAsync ( out , tarData ) ; try { java . lang . String line ; while ( ( line = reader . readLine ( ) ) != null ) l . add ( line ) ; return l . toArray ( new java . lang . String [ 0 ] ) ; } finally { writing . get ( ) ; proc . destroy ( ) ; } } } | org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { payload } , tarEntryContent ( result , "xyzzy" ) ) |
testAssetNameHappy ( ) { org . sonatype . nexus . selector . Selector selector = buildSelector ( "asset.name<sp>=~<sp>'^jun.+'" ) ; "<AssertPlaceHolder>" ; } evaluate ( org . sonatype . nexus . selector . VariableSource ) { return java . lang . Boolean . TRUE . equals ( expression . evaluate ( org . sonatype . nexus . selector . JexlSelector . asJexlContext ( source ) ) ) ; } | org . junit . Assert . assertTrue ( selector . evaluate ( source ) ) |
testSumOp ( ) { org . nd4j . autodiff . samediff . SameDiff sameDiff = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . linalg . api . ndarray . INDArray sumInput = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 4 , 4 ) . reshape ( 2 , 2 ) ; org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > inputs = new org . nd4j . autodiff . samediff . HashMap ( ) ; inputs . put ( "x" , sumInput ) ; sameDiff . defineFunction ( "sum" , new org . nd4j . autodiff . samediff . SameDiff . SameDiffFunctionDefinition ( ) { @ org . nd4j . autodiff . samediff . Override public org . nd4j . autodiff . samediff . SDVariable [ ] define ( org . nd4j . autodiff . samediff . SameDiff sameDiff , org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > inputs , org . nd4j . autodiff . samediff . SDVariable [ ] variableInputs ) { org . nd4j . autodiff . samediff . SDVariable input = sameDiff . var ( "x" , inputs . get ( "x" ) ) ; org . nd4j . autodiff . samediff . SDVariable sum = sameDiff . sum ( input , 1 ) ; return new org . nd4j . autodiff . samediff . SDVariable [ ] { sum } ; } } , inputs ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = sumInput . sum ( 1 ) ; org . nd4j . linalg . api . ndarray . INDArray executions = sameDiff . execAndEndResult ( "sum" ) ; "<AssertPlaceHolder>" ; } execAndEndResult ( org . nd4j . autodiff . samediff . List ) { org . nd4j . autodiff . samediff . List < org . nd4j . autodiff . functions . DifferentialFunction > exec = exec ( ops ) ; org . nd4j . autodiff . samediff . Op op = ( ( org . nd4j . autodiff . samediff . Op ) ( exec . get ( ( ( exec . size ( ) ) - 1 ) ) ) ) ; return op . z ( ) ; } | org . junit . Assert . assertEquals ( assertion , executions ) |
testWatchEnd ( ) { io . kubernetes . client . JSON json = new io . kubernetes . client . JSON ( ) ; io . kubernetes . client . util . Watch < io . kubernetes . client . models . V1ConfigMap > watch = new io . kubernetes . client . util . Watch < io . kubernetes . client . models . V1ConfigMap > ( json , null , new com . google . gson . reflect . TypeToken < io . kubernetes . client . util . Watch . Response < io . kubernetes . client . models . V1ConfigMap > > ( ) { } . getType ( ) , null ) ; com . google . gson . JsonObject metadata = new com . google . gson . JsonObject ( ) ; metadata . addProperty ( "kind" 2 , "foo" ) ; metadata . addProperty ( "namespace" , "bar" ) ; com . google . gson . JsonObject status = new com . google . gson . JsonObject ( ) ; status . add ( "kind" 7 , metadata ) ; status . addProperty ( "kind" , "kind" 0 ) ; status . addProperty ( "apiVersion" , "kind" 8 ) ; status . addProperty ( "kind" 1 , "kind" 4 ) ; status . addProperty ( "message" , "too<sp>old<sp>resource<sp>version" ) ; status . addProperty ( "kind" 6 , "kind" 3 ) ; status . addProperty ( "kind" 5 , 410 ) ; com . google . gson . JsonObject obj = new com . google . gson . JsonObject ( ) ; obj . addProperty ( "type" , "ERROR" ) ; obj . add ( "object" , status ) ; java . lang . String data = json . getGson ( ) . toJson ( obj ) ; io . kubernetes . client . util . Watch . Response < io . kubernetes . client . models . V1ConfigMap > response = watch . parseLine ( data ) ; "<AssertPlaceHolder>" ; } parseLine ( java . lang . String ) { if ( ! ( isStatus ( line ) ) ) { return json . deserialize ( line , watchType ) ; } java . lang . reflect . Type statusType = new com . google . gson . reflect . TypeToken < io . kubernetes . client . util . Watch . Response < io . kubernetes . client . models . V1Status > > ( ) { } . getType ( ) ; io . kubernetes . client . util . Watch . Response < io . kubernetes . client . models . V1Status > status = json . deserialize ( line , statusType ) ; return new io . kubernetes . client . util . Watch . Response < T > ( status . type , status . object ) ; } | org . junit . Assert . assertEquals ( null , response . object ) |
testMatchingConfigurationAttributeQuery ( ) { com . liferay . portal . kernel . repository . model . FileVersion fileVersion = org . mockito . Mockito . mock ( com . liferay . portal . kernel . repository . model . FileVersion . class ) ; _amImageQueryBuilderImpl . forFileVersion ( fileVersion ) . forConfiguration ( "small" ) ; com . liferay . adaptive . media . image . configuration . AMImageConfigurationEntry amImageConfigurationEntry = new com . liferay . adaptive . media . image . internal . configuration . AMImageConfigurationEntryImpl ( com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , "small" , java . util . Collections . emptyMap ( ) , true ) ; java . util . function . Predicate < com . liferay . adaptive . media . image . configuration . AMImageConfigurationEntry > filter = _amImageQueryBuilderImpl . getConfigurationEntryFilter ( ) ; "<AssertPlaceHolder>" ; } test ( com . liferay . portal . workflow . web . internal . search . WorkflowDefinitionLinkSearchEntry ) { if ( com . liferay . portal . kernel . util . Validator . isNull ( _keywords ) ) { return true ; } java . lang . String delimiter = com . liferay . petra . string . StringPool . SPACE ; if ( ! ( com . liferay . portal . kernel . util . StringUtil . contains ( _keywords , StringPool . SPACE ) ) ) { delimiter = com . liferay . petra . string . StringPool . BLANK ; } return com . liferay . portal . kernel . util . StringUtil . containsIgnoreCase ( workflowDefinitionLinkSearchEntry . getWorkflowDefinitionLabel ( ) , _keywords , delimiter ) ; } | org . junit . Assert . assertTrue ( filter . test ( amImageConfigurationEntry ) ) |
testInvokeVarargs19 ( ) { javax . el . BeanELResolver resolver = new javax . el . BeanELResolver ( ) ; javax . el . ELContext context = new javax . el . StandardELContext ( javax . el . ELManager . getExpressionFactory ( ) ) ; java . lang . Object result = resolver . invoke ( context , new javax . el . TesterBean ( javax . el . TestBeanELResolver . BEAN_NAME ) , "getNameVarargs" , new java . lang . Class < ? > [ ] { javax . el . Boolean . class , javax . el . Integer . class , javax . el . Integer . class , javax . el . Integer . class } , new java . lang . Object [ ] { Boolean . TRUE , java . lang . Integer . valueOf ( 10 ) , java . lang . Integer . valueOf ( 11 ) , java . lang . Integer . valueOf ( 12 ) } ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { return org . apache . tomcat . util . net . jsse . openssl . Cipher . idMap . get ( java . lang . Integer . valueOf ( cipherId ) ) ; } | org . junit . Assert . assertEquals ( javax . el . TestBeanELResolver . BEAN_NAME , result ) |
testIsDirWriteableWhenNot ( ) { org . irods . jargon . core . connection . IRODSAccount irodsAccount = org . irods . jargon . core . pub . io . IRODSFileSystemAOImplTest . testingPropertiesHelper . buildIRODSAccountFromSecondaryTestProperties ( org . irods . jargon . core . pub . io . IRODSFileSystemAOImplTest . testingProperties ) ; org . irods . jargon . core . pub . IRODSAccessObjectFactory accessObjectFactory = org . irods . jargon . core . pub . io . IRODSFileSystemAOImplTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) ; org . irods . jargon . core . pub . io . IRODSFileFactory irodsFileFactory = accessObjectFactory . getIRODSFileFactory ( irodsAccount ) ; java . lang . String targetIrodsCollection = org . irods . jargon . core . pub . io . IRODSFileSystemAOImplTest . testingPropertiesHelper . buildIRODSCollectionAbsolutePathFromTestProperties ( org . irods . jargon . core . pub . io . IRODSFileSystemAOImplTest . testingProperties , org . irods . jargon . core . pub . io . IRODSFileSystemAOImplTest . IRODS_TEST_SUBDIR_PATH ) ; org . irods . jargon . core . pub . io . IRODSFile irodsFile = irodsFileFactory . instanceIRODSFile ( targetIrodsCollection ) ; org . irods . jargon . core . pub . IRODSFileSystemAO fileSystemAO = accessObjectFactory . getIRODSFileSystemAO ( irodsAccount ) ; boolean writeable = fileSystemAO . isFileWriteable ( irodsFile ) ; "<AssertPlaceHolder>" ; } isFileWriteable ( org . irods . jargon . core . pub . io . IRODSFile ) { org . irods . jargon . core . pub . IRODSFileSystemAOImpl . log . info ( "isFileWriteable()" ) ; boolean writeable = false ; if ( irodsFile == null ) { throw new java . lang . IllegalArgumentException ( "irods<sp>file<sp>is<sp>null" ) ; } if ( org . irods . jargon . core . pub . IRODSFileSystemAOImpl . log . isInfoEnabled ( ) ) { org . irods . jargon . core . pub . IRODSFileSystemAOImpl . log . info ( ( "checking<sp>write<sp>permissions<sp>on:" + irodsFile ) ) ; } int filePermissions = 0 ; if ( irodsFile . isFile ( ) ) { org . irods . jargon . core . pub . IRODSFileSystemAOImpl . log . debug ( "getting<sp>file<sp>permissions" ) ; filePermissions = getFilePermissions ( irodsFile ) ; } else if ( irodsFile . isDirectory ( ) ) { org . irods . jargon . core . pub . IRODSFileSystemAOImpl . log . debug ( "getting<sp>directory<sp>permissions" ) ; filePermissions = getDirectoryPermissions ( irodsFile ) ; } if ( filePermissions >= ( org . irods . jargon . core . pub . io . IRODSFile . WRITE_PERMISSIONS ) ) { writeable = true ; } return writeable ; } | org . junit . Assert . assertFalse ( writeable ) |
testNullPlayer ( ) { world . bentobox . bentobox . api . user . User user = world . bentobox . bentobox . api . user . User . getInstance ( ( ( org . bukkit . entity . Player ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } getInstance ( org . bukkit . command . CommandSender ) { if ( sender instanceof org . bukkit . entity . Player ) { return world . bentobox . bentobox . api . user . User . getInstance ( ( ( org . bukkit . entity . Player ) ( sender ) ) ) ; } return new world . bentobox . bentobox . api . user . User ( sender ) ; } | org . junit . Assert . assertNull ( user ) |
testEventCategory ( ) { request . setEventCategory ( "category" ) ; "<AssertPlaceHolder>" ; } getEventCategory ( ) { return getNonEmptyStringParameter ( org . piwik . java . tracking . PiwikRequest . EVENT_CATEGORY ) ; } | org . junit . Assert . assertEquals ( "category" , request . getEventCategory ( ) ) |
testOptions ( ) { org . apache . http . client . HttpClient http = createHttpClient ( ) ; org . apache . http . HttpHost hostConfig = createHostConfiguration ( ) ; for ( java . lang . String s : new java . lang . String [ ] { com . github . caldav4j . methods . OptionsTest . INBOX , com . github . caldav4j . methods . OptionsTest . OUTBOX } ) { org . apache . jackrabbit . webdav . client . methods . HttpOptions options = new org . apache . jackrabbit . webdav . client . methods . HttpOptions ( ( ( caldavCredential . home ) + s ) ) ; try { org . apache . http . HttpResponse response = http . execute ( hostConfig , options ) ; if ( ( response . getStatusLine ( ) . getStatusCode ( ) ) == ( com . github . caldav4j . util . CalDAVStatus . SC_OK ) ) { log . info ( response . getFirstHeader ( "Allow" ) . toString ( ) ) ; for ( org . apache . http . Header h : response . getHeaders ( "DAV" ) ) { if ( h != null ) { if ( h . getValue ( ) . contains ( "calendar-access" ) ) { log . info ( h . toString ( ) ) ; } else if ( ( h . getValue ( ) . contains ( "calendar-schedule" ) ) || ( h . getValue ( ) . contains ( "calendar-auto-schedule" ) ) ) { log . info ( h . toString ( ) ) ; } else { "<AssertPlaceHolder>" ; } } } } } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } } createHostConfiguration ( ) { return com . github . caldav4j . BaseTestCase . createHostConfiguration ( this . caldavCredential ) ; } | org . junit . Assert . assertTrue ( false ) |
testNoOverwritesYieldsOriginal ( ) { discord4j . core . object . util . PermissionSet base = discord4j . core . object . util . PermissionSet . of ( discord4j . core . util . SEND_MESSAGES ) ; java . util . List < discord4j . core . object . PermissionOverwrite > roleOverwrites = java . util . Collections . emptyList ( ) ; discord4j . core . object . PermissionOverwrite memberOverwrite = null ; discord4j . core . object . util . PermissionSet actual = discord4j . core . util . PermissionUtil . computePermissions ( base , null , roleOverwrites , memberOverwrite ) ; discord4j . core . object . util . PermissionSet expected = discord4j . core . object . util . PermissionSet . of ( discord4j . core . util . SEND_MESSAGES ) ; "<AssertPlaceHolder>" ; } of ( long ) { return new discord4j . core . object . util . PermissionSet ( rawValue ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetIconClassesWithIconPositionundefined ( ) { java . lang . String icon = "fa-some-icon" ; com . github . bordertech . wcomponents . util . HtmlIconUtil . IconPosition position = HtmlIconUtil . IconPosition . UNDEFINED ; java . lang . String expResult = "wc-icon<sp>fa-some-icon" ; java . lang . String result = com . github . bordertech . wcomponents . util . HtmlIconUtil . getIconClasses ( icon , position ) ; "<AssertPlaceHolder>" ; } getIconClasses ( java . lang . String , com . github . bordertech . wcomponents . util . HtmlIconUtil$IconPosition ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; if ( position == null ) { builder . append ( com . github . bordertech . wcomponents . util . HtmlIconUtil . CLASS_ICON ) ; } else { switch ( position ) { case BEFORE : builder . append ( com . github . bordertech . wcomponents . util . HtmlIconUtil . CLASS_ICON_BEFORE_CONTENT ) ; break ; case AFTER : builder . append ( com . github . bordertech . wcomponents . util . HtmlIconUtil . CLASS_ICON_AFTER_CONTENT ) ; break ; default : builder . append ( com . github . bordertech . wcomponents . util . HtmlIconUtil . CLASS_ICON ) ; break ; } } if ( ! ( ( icon == null ) || ( com . github . bordertech . wcomponents . util . Util . empty ( icon ) ) ) ) { builder . append ( "<sp>" ) ; builder . append ( icon ) ; } return builder . toString ( ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
Test_GlobPatternMatcher_RelativePath_InRoot ( ) { java . nio . file . PathMatcher testMatcher = java . nio . file . FileSystems . getDefault ( ) . getPathMatcher ( "glob:**/*.sql" ) ; java . nio . file . Path root = java . nio . file . Paths . get ( "c:\\temp" ) ; java . nio . file . Path examplePath = java . nio . file . Paths . get ( "c:\\temp\\test\\blabla.sql" ) ; java . nio . file . Path relativePath = root . relativize ( examplePath ) ; "<AssertPlaceHolder>" ; } getPathMatcher ( java . lang . String ) { return java . nio . file . FileSystems . getDefault ( ) . getPathMatcher ( java . lang . String . format ( "glob:%1$s" , pattern ) ) ; } | org . junit . Assert . assertTrue ( testMatcher . matches ( relativePath ) ) |
testNotEscapeChars ( ) { final org . drools . template . model . Condition cond = new org . drools . template . model . Condition ( ) ; cond . setSnippet ( "a<sp><<sp>b" ) ; final org . drools . template . model . DRLOutput out = new org . drools . template . model . DRLOutput ( ) ; cond . renderDRL ( out ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( "SynchronizationImpl{" + "service=" ) + ( service . sessionInfo ) ) + "<sp>cmd=" ) + ( service . toString ( ) ) ) + '}' ; } | org . junit . Assert . assertTrue ( ( ( out . toString ( ) . indexOf ( "a<sp><<sp>b" ) ) != ( - 1 ) ) ) |
testGetArticleCountIsMock ( ) { com . ewcms . publication . service . ArticlePublishServiceable mock = mock ( com . ewcms . publication . service . ArticlePublishServiceable . class ) ; com . ewcms . publication . preview . service . ArticlePublishServiceWrapper service = new com . ewcms . publication . preview . service . ArticlePublishServiceWrapper ( mock , true ) ; "<AssertPlaceHolder>" ; } getArticleReleaseCount ( java . lang . Integer ) { if ( mock ) { return 1000 ; } return service . getArticleReleaseCount ( channelId ) ; } | org . junit . Assert . assertEquals ( 1000 , service . getArticleReleaseCount ( Integer . MAX_VALUE ) ) |
test5 ( ) { java . util . List < io . djigger . aggregation . Thread > threads = threads ( new java . lang . Object [ ] [ ] { new java . lang . Object [ ] { "m1" , "m2" } , new java . lang . Object [ ] { "m1" , "m2" , "m3" , "m4" } , new java . lang . Object [ ] { "m1" , "m2" } , new java . lang . Object [ ] { "m1" , "m2" , "m3" } } ) ; final java . util . List < io . djigger . monitoring . java . instrumentation . InstrumentationEvent > events = new java . util . ArrayList ( ) ; io . djigger . samplig . PseudoInstrumentationEventsGenerator a = new io . djigger . samplig . PseudoInstrumentationEventsGenerator ( new io . djigger . samplig . PseudoInstrumentationEventsGenerator . Listener ( ) { @ io . djigger . sampling . Override public void onPseudoInstrumentationEvent ( io . djigger . ui . model . PseudoInstrumentationEvent event ) { events . add ( event ) ; System . out . println ( event ) ; } } ) ; a . generateApproximatedEvents ( threads ) ; "<AssertPlaceHolder>" ; } generateApproximatedEvents ( io . djigger . samplig . List ) { for ( io . djigger . aggregation . Thread thread : threads ) { io . djigger . samplig . List < io . djigger . ui . model . NodeID > previousPath = null ; io . djigger . monitoring . java . model . ThreadInfo previousThreadInfo = null ; for ( io . djigger . aggregation . Thread . RealNodePathWrapper realNodePath : thread . getRealNodePathSequence ( ) ) { io . djigger . samplig . List < io . djigger . ui . model . NodeID > currentPath = realNodePath . getPath ( ) . getFullPath ( ) ; io . djigger . monitoring . java . model . ThreadInfo threadInfo = realNodePath . getThreadInfo ( ) ; for ( int level = 0 ; level < ( java . lang . Math . max ( currentPath . size ( ) , ( previousPath != null ? previousPath . size ( ) : 0 ) ) ) ; level ++ ) { io . djigger . ui . model . NodeID currentNodeID = ( ( currentPath . size ( ) ) > level ) ? currentPath . get ( level ) : null ; io . djigger . ui . model . NodeID previousNodeID = ( ( previousPath != null ) && ( ( previousPath . size ( ) ) > level ) ) ? previousPath . get ( level ) : null ; if ( currentNodeID != null ) { if ( ! ( currentNodeID . equals ( previousNodeID ) ) ) { if ( previousPath != null ) { leaveBranch ( previousThreadInfo , previousPath , level ) ; } enterBranch ( threadInfo , currentPath , level ) ; break ; } } else { if ( previousPath != null ) { leaveBranch ( previousThreadInfo , previousPath , level ) ; break ; } } } previousPath = currentPath ; previousThreadInfo = threadInfo ; } leaveBranch ( previousThreadInfo ) ; } } | org . junit . Assert . assertEquals ( 5 , events . size ( ) ) |
testInvalidApis ( ) { org . alfresco . rest . framework . core . ResourceWithMetadata entityResource = null ; try { entityResource = locator . locateEntityResource ( org . alfresco . rest . framework . Api . valueOf ( "alfrescomock" , "public" , "1" ) , "sheep" , HttpMethod . GET ) ; org . junit . Assert . fail ( "Should<sp>throw<sp>an<sp>InvalidArgumentException" ) ; } catch ( org . alfresco . rest . framework . core . exceptions . InvalidArgumentException error ) { } try { entityResource = locator . locateEntityResource ( org . alfresco . rest . framework . Api . valueOf ( "alfrescomock" , "public" , "999" ) , "sheep" , HttpMethod . GET ) ; org . junit . Assert . fail ( "Should<sp>throw<sp>an<sp>InvalidArgumentException" ) ; } catch ( org . alfresco . rest . framework . core . exceptions . InvalidArgumentException error ) { } entityResource = locator . locateEntityResource ( org . alfresco . rest . framework . Api . valueOf ( "alfrescomock" , "private" , "1" ) , "sheep" , HttpMethod . GET ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String , java . lang . String , java . lang . String ) { org . alfresco . rest . framework . Api . SCOPE scope = null ; int version = 1 ; try { if ( ! ( org . apache . commons . lang . StringUtils . isAllLowerCase ( apiName ) ) ) throw new org . alfresco . rest . framework . core . exceptions . InvalidArgumentException ( "Api<sp>name<sp>must<sp>be<sp>lowercase" ) ; scope = org . alfresco . rest . framework . Api . SCOPE . valueOf ( apiScope . toUpperCase ( ) ) ; version = java . lang . Integer . parseInt ( apiVersion ) ; if ( version < 1 ) throw new org . alfresco . rest . framework . core . exceptions . InvalidArgumentException ( "Version<sp>must<sp>be<sp>a<sp>positive<sp>integer." ) ; } catch ( java . lang . Exception error ) { if ( error instanceof org . alfresco . rest . framework . core . exceptions . InvalidArgumentException ) throw ( ( org . alfresco . rest . framework . core . exceptions . InvalidArgumentException ) ( error ) ) ; org . alfresco . rest . framework . Api . logger . debug ( ( ( ( ( ( "Invalid<sp>API<sp>definition:<sp>" + apiName ) + "<sp>" ) + apiScope ) + "<sp>" ) + apiVersion ) ) ; throw new org . alfresco . rest . framework . core . exceptions . InvalidArgumentException ( ( "Invalid<sp>API<sp>definition:" + ( error . getMessage ( ) ) ) ) ; } org . alfresco . rest . framework . Api anApi = new org . alfresco . rest . framework . Api ( apiName , scope , version ) ; return org . alfresco . rest . framework . Api . ALFRESCO_PUBLIC . equals ( anApi ) ? org . alfresco . rest . framework . Api . ALFRESCO_PUBLIC : anApi ; } | org . junit . Assert . assertNotNull ( entityResource ) |
readsContentOfEntityStreamAsUtf8String ( ) { javax . ws . rs . core . MediaType mediaType = new javax . ws . rs . core . MediaType ( "text" , "plain" ) ; byte [ ] data = org . everrest . core . impl . provider . StringEntityProviderTest . TEST_CONTENT . getBytes ( "UTF-8" ) ; java . lang . String result = stringEntityProvider . readFrom ( java . lang . String . class , java . lang . String . class , null , mediaType , null , new java . io . ByteArrayInputStream ( data ) ) ; "<AssertPlaceHolder>" ; } readFrom ( java . lang . Class , java . lang . reflect . Type , java . lang . annotation . Annotation [ ] , javax . ws . rs . core . MediaType , javax . ws . rs . core . MultivaluedMap , java . io . InputStream ) { return null ; } | org . junit . Assert . assertEquals ( org . everrest . core . impl . provider . StringEntityProviderTest . TEST_CONTENT , result ) |
addsListWithValues ( ) { int result = com . insightfullogic . java8 . answers . chapter3 . com . insightfullogic . java8 . answers . chapter3 . Question1 . addUp ( java . util . stream . Stream . of ( 1 , 3 , ( - 2 ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 2 , result ) |
patchWithReferenceToRelatedEntityIsResolvedCorrectly ( ) { org . springframework . data . rest . webmvc . mapping . Associations associations = mock ( org . springframework . data . rest . webmvc . mapping . Associations . class ) ; org . springframework . data . mapping . PersistentProperty < ? > any = org . mockito . ArgumentMatchers . any ( org . springframework . data . mapping . PersistentProperty . class ) ; when ( associations . isLinkableAssociation ( any ) ) . thenReturn ( true ) ; org . springframework . data . rest . webmvc . json . DomainObjectReader reader = new org . springframework . data . rest . webmvc . json . DomainObjectReader ( entities , associations ) ; org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Tag first = new org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Tag ( ) ; org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Tag second = new org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Tag ( ) ; org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Note note = new org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Note ( ) ; note . tags . add ( first ) ; note . tags . add ( second ) ; com . fasterxml . jackson . databind . module . SimpleModule module = new com . fasterxml . jackson . databind . module . SimpleModule ( ) ; module . addDeserializer ( org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Tag . class , new org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . SelectValueByIdSerializer < org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Tag > ( java . util . Collections . singletonMap ( second . id , second ) ) ) ; com . fasterxml . jackson . databind . ObjectMapper mapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; mapper . registerModule ( module ) ; com . fasterxml . jackson . databind . node . ObjectNode readTree = ( ( com . fasterxml . jackson . databind . node . ObjectNode ) ( mapper . readTree ( java . lang . String . format ( "{<sp>\"tags\"<sp>:<sp>[<sp>\"%s\"]}" , second . id ) ) ) ) ; org . springframework . data . rest . webmvc . json . DomainObjectReaderUnitTests . Note result = reader . doMerge ( readTree , note , mapper ) ; "<AssertPlaceHolder>" . contains ( second ) ; } doMerge ( com . fasterxml . jackson . databind . node . ObjectNode , T , com . fasterxml . jackson . databind . ObjectMapper ) { org . springframework . util . Assert . notNull ( root , "Root<sp>ObjectNode<sp>must<sp>not<sp>be<sp>null!" ) ; org . springframework . util . Assert . notNull ( target , "Target<sp>object<sp>instance<sp>must<sp>not<sp>be<sp>null!" ) ; org . springframework . util . Assert . notNull ( mapper , "ObjectMapper<sp>must<sp>not<sp>be<sp>null!" ) ; java . util . Optional < org . springframework . data . mapping . PersistentEntity < ? , ? extends org . springframework . data . mapping . PersistentProperty < ? > > > candidate = entities . getPersistentEntity ( target . getClass ( ) ) ; if ( ! ( candidate . isPresent ( ) ) ) { return mapper . readerForUpdating ( target ) . readValue ( root ) ; } org . springframework . data . mapping . PersistentEntity < ? , ? > entity = candidate . get ( ) ; org . springframework . data . rest . webmvc . json . MappedProperties mappedProperties = org . springframework . data . rest . webmvc . json . MappedProperties . forDeserialization ( entity , mapper ) ; for ( java . util . Iterator < java . util . Map . Entry < java . lang . String , com . fasterxml . jackson . databind . JsonNode > > i = root . fields ( ) ; i . hasNext ( ) ; ) { java . util . Map . Entry < java . lang . String , com . fasterxml . jackson . databind . JsonNode > entry = i . next ( ) ; com . fasterxml . jackson . databind . JsonNode child = entry . getValue ( ) ; java . lang . String fieldName = entry . getKey ( ) ; if ( ! ( mappedProperties . hasPersistentPropertyForField ( fieldName ) ) ) { continue ; } org . springframework . data . mapping . PersistentProperty < ? > property = mappedProperties . getPersistentProperty ( fieldName ) ; org . springframework . data . mapping . PersistentPropertyAccessor < ? > accessor = entity . getPropertyAccessor ( target ) ; java . util . Optional < java . lang . Object > rawValue = java . util . Optional . ofNullable ( accessor . getProperty ( property ) ) ; if ( ( ! ( rawValue . isPresent ( ) ) ) || ( associationLinks . isLinkableAssociation ( property ) ) ) { continue ; } rawValue . ifPresent ( ( it ) -> { if ( child . isArray ( ) ) { if ( handleArray ( child , it , mapper , property . getTypeInformation ( ) ) ) { i . remove ( ) ; } return ; } if ( child . isObject ( ) ) { com . fasterxml . jackson . databind . node . ObjectNode objectNode = ( ( com . fasterxml . jackson . databind . node . ObjectNode ) ( child ) ) ; if ( property . isMap ( ) ) { if ( ! ( objectNode . fieldNames ( ) | org . junit . Assert . assertThat ( result . tags ) |
shouldConstructResponseAndReturnNullIfNullContent ( ) { when ( mockResponse . statusCode ( ) ) . thenReturn ( 200 ) ; when ( mockResponse . as ( io . magentys . rest . model . RestAssuredResponseTest . Dummy . class ) ) . thenReturn ( null ) ; io . magentys . rest . model . RestResponse < io . magentys . rest . model . RestAssuredResponseTest . Dummy > response = io . magentys . rest . model . RestAssuredResponse . constructFrom ( mockResponse , ( ) -> mockResponse . as ( . class ) ) ; "<AssertPlaceHolder>" ; } data ( ) { return data ; } | org . junit . Assert . assertThat ( response . data ( ) , org . hamcrest . CoreMatchers . equalTo ( null ) ) |
testGetExpireMillisForKeyDoesNotExist ( ) { java . lang . Long expire = redisTemplate . getExpire ( keyFactory . instance ( ) , TimeUnit . MILLISECONDS ) ; "<AssertPlaceHolder>" ; } instance ( ) { return prefix . concat ( delegate . instance ( ) ) ; } | org . junit . Assert . assertTrue ( ( expire < 0L ) ) |
getValueStringByKey_good_case_trim ( ) { java . util . HashMap < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "key2" , "<sp>value2<sp>" ) ; java . lang . String keyName = "key2" ; java . lang . String expResult = "value2" ; java . lang . String result = com . microsoft . azure . sdk . iot . provisioning . service . Tools . getValueStringByKey ( map , keyName ) ; "<AssertPlaceHolder>" ; } getValueStringByKey ( java . util . Map , java . lang . String ) { java . lang . String retVal ; if ( ( map == null ) || ( keyName == null ) ) { retVal = "" ; } else { java . lang . Object val = map . get ( keyName ) ; if ( val != null ) retVal = val . toString ( ) . trim ( ) ; else retVal = "" ; } return retVal ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testGetBeanWrongType ( ) { try { final java . lang . String testBean = "testbean" ; final org . springframework . context . ApplicationContext appContext = new org . springframework . context . support . FileSystemXmlApplicationContext ( ) { @ gov . hhs . fha . nhinc . proxy . Override public java . lang . Object getBean ( java . lang . String beanName ) { return testBean ; } } ; gov . hhs . fha . nhinc . proxy . ComponentProxyObjectFactory sut = new gov . hhs . fha . nhinc . proxy . ComponentProxyObjectFactory ( ) { @ gov . hhs . fha . nhinc . proxy . Override protected org . springframework . context . ApplicationContext getContext ( ) { return appContext ; } @ gov . hhs . fha . nhinc . proxy . Override protected java . lang . String getConfigFileName ( ) { return "" ; } } ; sut . getBean ( "" , gov . hhs . fha . nhinc . proxy . Integer . class ) ; org . junit . Assert . fail ( "Should<sp>have<sp>had<sp>exception." ) ; } catch ( java . lang . ClassCastException cce ) { "<AssertPlaceHolder>" ; } catch ( java . lang . Throwable t ) { System . out . println ( ( "Error<sp>running<sp>testGetBeanWrongType<sp>test:<sp>" + ( t . getMessage ( ) ) ) ) ; t . printStackTrace ( ) ; org . junit . Assert . fail ( ( "Error<sp>running<sp>testGetBeanWrongType<sp>test:<sp>" + ( t . getMessage ( ) ) ) ) ; } } getBean ( java . lang . String , java . lang . Class ) { return type . cast ( mockProxy ) ; } | org . junit . Assert . assertTrue ( true ) |
testFromEpochToZuluDate_withUTC ( ) { java . lang . String epochTest = "1377174053" ; java . lang . String expected = "2013-08-22T12:20:53Z" ; setupStage ( ) ; com . findwise . hydra . local . LocalDocument ld = new com . findwise . hydra . local . LocalDocument ( ) ; ld . putContentField ( "date" , epochTest ) ; subject . process ( ld ) ; "<AssertPlaceHolder>" ; } getContentField ( java . lang . String ) { return getContentMap ( ) . get ( fieldName ) ; } | org . junit . Assert . assertEquals ( expected , ld . getContentField ( "date" ) ) |
testGetOtherUserId ( ) { java . lang . Long id = 2L ; usersPage . getOtherUser ( id ) ; java . lang . String otherUserId = usersPage . getUserId ( ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String ) { return new ca . corefacility . bioinformatics . irida . model . ClientRole ( value ) ; } | org . junit . Assert . assertEquals ( java . lang . String . valueOf ( id ) , otherUserId ) |
getPriceTest ( ) { final ua . com . alexcoffee . model . product . Product product = new ua . com . alexcoffee . model . product . Product ( ) ; product . setPrice ( 100 ) ; ua . com . alexcoffee . model . position . SalePosition position = new ua . com . alexcoffee . model . position . SalePosition ( ) ; position . setProduct ( product ) ; position . setNumber ( 10 ) ; "<AssertPlaceHolder>" ; } getPrice ( ) { return ( this . number ) * ( this . product . getPrice ( ) ) ; } | org . junit . Assert . assertTrue ( ( ( position . getPrice ( ) ) == ( ( product . getPrice ( ) ) * 10 ) ) ) |
testTwoIdenticalRegisterRequest ( ) { org . apache . hadoop . yarn . api . protocolrecords . RegisterApplicationMasterRequest registerReq = org . apache . hadoop . yarn . util . Records . newRecord ( org . apache . hadoop . yarn . api . protocolrecords . RegisterApplicationMasterRequest . class ) ; registerReq . setHost ( java . lang . Integer . toString ( testAppId ) ) ; registerReq . setRpcPort ( 0 ) ; registerReq . setTrackingUrl ( "" ) ; for ( int i = 0 ; i < 2 ; i ++ ) { org . apache . hadoop . yarn . api . protocolrecords . RegisterApplicationMasterResponse registerResponse = interceptor . registerApplicationMaster ( registerReq ) ; "<AssertPlaceHolder>" ; lastResponseId = 0 ; } } registerApplicationMaster ( org . apache . hadoop . yarn . api . protocolrecords . RegisterApplicationMasterRequest ) { return null ; } | org . junit . Assert . assertNotNull ( registerResponse ) |
testGetHistoricActivityInstance ( ) { java . util . List < org . camunda . bpm . engine . history . HistoricActivityInstance > instances = historyService . createHistoricActivityInstanceQuery ( ) . list ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return deletedCache . isEmpty ( ) ; } | org . junit . Assert . assertFalse ( instances . isEmpty ( ) ) |
testRotatedText ( ) { byte [ ] bytes = com . itextpdf . text . pdf . parser . TextExtractionTest . createPdfWithRotatedText ( TEXT1 , TEXT2 , ( - 90 ) , true , ( - 20 ) ) ; com . itextpdf . text . pdf . parser . PdfTextExtractor ex = new com . itextpdf . text . pdf . parser . PdfTextExtractor ( new com . itextpdf . text . pdf . PdfReader ( bytes ) ) ; "<AssertPlaceHolder>" ; } getTextFromPage ( int ) { com . lowagie . text . pdf . PdfDictionary pageDic = reader . getPageN ( page ) ; com . lowagie . text . pdf . PdfDictionary resourcesDic = pageDic . getAsDict ( PdfName . RESOURCES ) ; renderListener . reset ( ) ; com . lowagie . text . pdf . parser . PdfContentStreamProcessor processor = new com . lowagie . text . pdf . parser . PdfContentStreamProcessor ( renderListener ) ; processor . processContent ( getContentBytesForPage ( page ) , resourcesDic ) ; return renderListener . getResultantText ( ) ; } | org . junit . Assert . assertEquals ( ( ( ( TEXT1 ) + "\n" ) + ( TEXT2 ) ) , ex . getTextFromPage ( 1 ) ) |
getObject ( ) { when ( testAttributes . getValue ( anyString ( ) , eq ( "datarow-name" ) ) ) . thenReturn ( "TEST_FORMULA" ) ; argumentReadHandler . startParsing ( testAttributes ) ; java . lang . Object actualObject = argumentReadHandler . getObject ( ) ; "<AssertPlaceHolder>" ; } create ( java . lang . String ) { return new org . pentaho . reporting . engine . classic . extensions . datasources . kettle . FormulaArgument ( ( '=' + ( org . pentaho . reporting . libraries . formula . util . FormulaUtil . quoteReference ( reportField ) ) ) ) ; } | org . junit . Assert . assertEquals ( org . pentaho . reporting . engine . classic . extensions . datasources . kettle . FormulaArgument . create ( "TEST_FORMULA" ) , actualObject ) |
testShouldResolveWithSocksProxyHost ( ) { java . lang . System . setProperty ( "socksProxyHost" , "fake-socks-proxy" ) ; org . postgresql . util . HostSpec hostSpec = new org . postgresql . util . HostSpec ( "example.com" , 5432 ) ; "<AssertPlaceHolder>" ; } shouldResolve ( ) { java . lang . String socksProxy = java . lang . System . getProperty ( "socksProxyHost" ) ; if ( ( socksProxy == null ) || ( socksProxy . trim ( ) . isEmpty ( ) ) ) { return true ; } return matchesNonProxyHosts ( ) ; } | org . junit . Assert . assertFalse ( hostSpec . shouldResolve ( ) ) |
testBuildInfo ( ) { org . robolectric . Robolectric . getFakeHttpLayer ( ) . interceptHttpRequests ( false ) ; final java . lang . String owner = "sahan" ; final java . lang . String repo = "IckleBot" ; final long buildId = 8432801 ; java . util . concurrent . Future < com . lonepulse . travisjr . model . BuildInfo > future = executorService . submit ( new java . util . concurrent . Callable < com . lonepulse . travisjr . model . BuildInfo > ( ) { public com . lonepulse . travisjr . model . BuildInfo call ( ) throws com . lonepulse . travisjr . test . Exception { return buildService . getBuildInfo ( owner , repo , buildId ) ; } } ) ; com . lonepulse . travisjr . model . BuildInfo buildInfo = future . get ( ) ; "<AssertPlaceHolder>" ; } getBuildInfo ( java . lang . String , java . lang . String , long ) { try { return travisCIEndpoint . getBuildInfo ( owner , repository , java . lang . String . valueOf ( buildId ) ) ; } catch ( java . lang . Exception e ) { throw new com . lonepulse . travisjr . service . BuildInfoUnavailableException ( owner , repository , buildId , e ) ; } } | org . junit . Assert . assertNotNull ( buildInfo ) |
testGetEntitySlash ( ) { org . sakaiproject . lessonbuildertool . service . LessonEntity entity = mnemeEntity . getEntity ( "/" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNull ( entity ) |
shouldExtractKeyBytesFromBinary ( ) { final byte [ ] serialized = org . apache . kafka . streams . state . internals . SessionKeySchema . toBinary ( windowedKey , serde . serializer ( ) , "dummy" ) ; "<AssertPlaceHolder>" ; } extractKeyBytes ( byte [ ] ) { final byte [ ] bytes = new byte [ ( binaryKey . length ) - ( 2 * ( org . apache . kafka . streams . state . internals . SessionKeySchema . TIMESTAMP_SIZE ) ) ] ; java . lang . System . arraycopy ( binaryKey , 0 , bytes , 0 , bytes . length ) ; return bytes ; } | org . junit . Assert . assertArrayEquals ( key . getBytes ( ) , org . apache . kafka . streams . state . internals . SessionKeySchema . extractKeyBytes ( serialized ) ) |
testArraysJoinSimple1 ( ) { java . lang . String [ ] a1 = new java . lang . String [ ] { "a" , "b" , "c" } ; java . lang . String [ ] a2 = new java . lang . String [ ] { "a" , "b" , "d" } ; java . lang . String [ ] result = org . nuxeo . common . utils . ArrayUtils . intersect ( a1 , a2 ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "a" , "b" } ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object , java . lang . Object ) { if ( ( item1 == null ) && ( item2 == null ) ) { return true ; } else if ( item1 == null ) { return false ; } else { return item1 . equals ( item2 ) ; } } | org . junit . Assert . assertTrue ( java . util . Arrays . equals ( expected , result ) ) |
testNoUpdateWithNoFile ( ) { com . google . cloud . tools . eclipse . appengine . localserver . server . DatastoreIndexUpdateData update = com . google . cloud . tools . eclipse . appengine . localserver . server . DatastoreIndexUpdateData . detect ( launchConfiguration , server , defaultService ) ; "<AssertPlaceHolder>" ; } detect ( org . eclipse . debug . core . ILaunchConfiguration , org . eclipse . wst . server . core . IServer , org . eclipse . wst . server . core . IModule ) { com . google . cloud . tools . eclipse . appengine . localserver . server . LocalAppEngineServerBehaviour serverBehaviour = ( ( com . google . cloud . tools . eclipse . appengine . localserver . server . LocalAppEngineServerBehaviour ) ( server . loadAdapter ( com . google . cloud . tools . eclipse . appengine . localserver . server . LocalAppEngineServerBehaviour . class , null ) ) ) ; org . eclipse . core . runtime . IPath deployPath = serverBehaviour . getModuleDeployDirectory ( defaultService ) ; org . eclipse . core . runtime . IPath datastoreIndexesAutoXml = deployPath . append ( "WEB-INF/appengine-generated/datastore-indexes-auto.xml" ) ; if ( ! ( com . google . cloud . tools . eclipse . appengine . localserver . server . DatastoreIndexUpdateData . indexGenerated ( datastoreIndexesAutoXml ) ) ) { return null ; } org . eclipse . core . resources . IFile datastoreIndexesXml = com . google . cloud . tools . eclipse . appengine . facets . AppEngineConfigurationUtil . findConfigurationFile ( defaultService . getProject ( ) , new org . eclipse . core . runtime . Path ( "datastore-indexes.xml" ) ) ; if ( ( datastoreIndexesXml != null ) && ( datastoreIndexesXml . exists ( ) ) ) { long sourceTimestamp = datastoreIndexesXml . getLocalTimeStamp ( ) ; long generatedTimestamp = datastoreIndexesAutoXml . toFile ( ) . lastModified ( ) ; if ( sourceTimestamp > generatedTimestamp ) { com . google . cloud . tools . eclipse . appengine . localserver . server . DatastoreIndexUpdateData . logger . log ( Level . FINE , "no<sp>change<sp>based<sp>on<sp>datastore-indexes<sp>timestamps" ) ; return null ; } } return new com . google . cloud . tools . eclipse . appengine . localserver . server . DatastoreIndexUpdateData ( server , configuration , defaultService , datastoreIndexesXml , datastoreIndexesAutoXml ) ; } | org . junit . Assert . assertNull ( update ) |
testGetEmptyClusterNodeLabels ( ) { org . apache . hadoop . yarn . client . api . YarnClient client = mock ( org . apache . hadoop . yarn . client . api . YarnClient . class ) ; when ( client . getClusterNodeLabels ( ) ) . thenReturn ( new java . util . ArrayList < org . apache . hadoop . yarn . api . records . NodeLabel > ( ) ) ; org . apache . hadoop . yarn . client . cli . ClusterCLI cli = new org . apache . hadoop . yarn . client . cli . ClusterCLI ( ) ; cli . setClient ( client ) ; cli . setSysOutPrintStream ( sysOut ) ; cli . setSysErrPrintStream ( sysErr ) ; int rc = cli . run ( new java . lang . String [ ] { ClusterCLI . CMD , "-" + ( ClusterCLI . LIST_LABELS_CMD ) } ) ; "<AssertPlaceHolder>" ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintWriter pw = new java . io . PrintWriter ( baos ) ; pw . print ( "Node<sp>Labels:<sp>" ) ; pw . close ( ) ; verify ( sysOut ) . println ( baos . toString ( "UTF-8" ) ) ; } run ( org . apache . hadoop . hdfs . server . mover . Map , org . apache . hadoop . conf . Configuration ) { final long sleeptime = ( ( conf . getLong ( DFSConfigKeys . DFS_HEARTBEAT_INTERVAL_KEY , DFSConfigKeys . DFS_HEARTBEAT_INTERVAL_DEFAULT ) ) * 2000 ) + ( ( conf . getLong ( DFSConfigKeys . DFS_NAMENODE_REPLICATION_INTERVAL_KEY , DFSConfigKeys . DFS_NAMENODE_REPLICATION_INTERVAL_DEFAULT ) ) * 1000 ) ; org . apache . hadoop . hdfs . server . mover . Mover . LOG . info ( ( "namenodes<sp>=<sp>" + namenodes ) ) ; org . apache . hadoop . hdfs . server . mover . List < org . apache . hadoop . hdfs . server . balancer . NameNodeConnector > connectors = org . apache . hadoop . hdfs . server . mover . Collections . emptyList ( ) ; try { connectors = org . apache . hadoop . hdfs . server . balancer . NameNodeConnector . newNameNodeConnectors ( namenodes , org . apache . hadoop . hdfs . server . mover . Mover . class . getSimpleName ( ) , org . apache . hadoop . hdfs . server . mover . Mover . MOVER_ID_PATH , conf , NameNodeConnector . DEFAULT_MAX_IDLE_ITERATIONS ) ; while ( ( connectors . size ( ) ) > 0 ) { org . apache . hadoop . hdfs . server . mover . Collections . shuffle ( connectors ) ; org . apache . hadoop . hdfs . server . mover . Iterator < org . apache . hadoop . hdfs . server . balancer . NameNodeConnector > iter = connectors . iterator ( ) ; while ( iter . hasNext ( ) ) { org . apache . hadoop . hdfs . server . balancer . NameNodeConnector nnc = iter . next ( ) ; final org . apache . hadoop . hdfs . server . mover . Mover m = new org . apache . hadoop . hdfs . server . mover . Mover ( nnc , conf ) ; final org . apache . hadoop . hdfs . server . balancer . ExitStatus r = m . run ( ) ; if ( r == ( org . apache . hadoop . hdfs . server . balancer . ExitStatus . SUCCESS ) ) { org . apache . hadoop . io . IOUtils . cleanup ( org . apache . hadoop . hdfs . server . mover . Mover . LOG , nnc ) ; iter . remove ( ) ; } else if ( r != ( org . apache . hadoop . hdfs . server . balancer . ExitStatus . IN_PROGRESS ) ) { return r . getExitCode ( ) ; } } java . lang . Thread . sleep ( sleeptime ) ; } return ExitStatus . SUCCESS . getExitCode ( ) ; } finally { for ( org . apache . hadoop . hdfs . server . balancer . NameNodeConnector nnc : connectors ) { org . apache . hadoop . io . IOUtils . cleanup ( org . apache . hadoop . hdfs . server . mover . Mover . LOG , nnc ) ; } } } | org . junit . Assert . assertEquals ( 0 , rc ) |
shouldAccessAssignedLabels ( ) { org . neo4j . graphdb . GraphDatabaseService db = dbRule . getGraphDatabaseAPI ( ) ; org . neo4j . kernel . impl . event . TestTransactionEvents . ChangedLabels labels = ( ( org . neo4j . kernel . impl . event . TestTransactionEvents . ChangedLabels ) ( db . registerTransactionEventHandler ( new org . neo4j . kernel . impl . event . TestTransactionEvents . ChangedLabels ( ) ) ) ) ; try { try ( org . neo4j . graphdb . Transaction tx = db . beginTx ( ) ) { org . neo4j . graphdb . Node node1 = db . createNode ( ) ; org . neo4j . graphdb . Node node2 = db . createNode ( ) ; org . neo4j . graphdb . Node node3 = db . createNode ( ) ; labels . add ( node1 , "Foo" ) ; labels . add ( node2 , "Bar" ) ; labels . add ( node3 , "Baz" ) ; labels . add ( node3 , "Bar" ) ; labels . activate ( ) ; tx . success ( ) ; } "<AssertPlaceHolder>" ; } finally { db . unregisterTransactionEventHandler ( labels ) ; } } isEmpty ( ) { try ( org . neo4j . cursor . RawCursor < org . neo4j . index . internal . gbptree . Hit < org . neo4j . kernel . impl . index . labelscan . LabelScanKey , org . neo4j . kernel . impl . index . labelscan . LabelScanValue > , java . io . IOException > cursor = index . seek ( new org . neo4j . kernel . impl . index . labelscan . LabelScanKey ( 0 , 0 ) , new org . neo4j . kernel . impl . index . labelscan . LabelScanKey ( Integer . MAX_VALUE , Long . MAX_VALUE ) ) ) { return ! ( cursor . next ( ) ) ; } } | org . junit . Assert . assertTrue ( labels . isEmpty ( ) ) |
getFalse ( ) { "<AssertPlaceHolder>" ; } getFalse ( ) { return org . eclipse . collections . impl . block . factory . Functions0 . FALSE_FUNCTION ; } | org . junit . Assert . assertFalse ( org . eclipse . collections . impl . block . factory . Functions0 . getFalse ( ) . value ( ) ) |
testNull ( ) { java . lang . Exception caughtEx = null ; try { uk . ac . rdg . resc . edal . util . CollectionUtils . listFromFloatArray ( null ) ; } catch ( java . lang . NullPointerException e ) { caughtEx = e ; } "<AssertPlaceHolder>" ; uk . ac . rdg . resc . edal . util . CollectionUtils . listFromDoubleArray ( null ) ; } listFromFloatArray ( float [ ] ) { if ( arr == null ) throw new java . lang . NullPointerException ( "array<sp>cannot<sp>be<sp>null" ) ; return new java . util . AbstractList < java . lang . Float > ( ) { @ uk . ac . rdg . resc . edal . util . Override public uk . ac . rdg . resc . edal . util . Float get ( int index ) { return arr [ index ] ; } @ uk . ac . rdg . resc . edal . util . Override public int size ( ) { return arr . length ; } } ; } | org . junit . Assert . assertNotNull ( caughtEx ) |
testGetFieldValue ( ) { final org . drools . core . spi . InternalReadAccessor extractor = store . getReader ( org . drools . core . test . model . Cheese . class , "type" ) ; final org . drools . core . rule . Pattern pattern = new org . drools . core . rule . Pattern ( 5 , new org . drools . core . base . ClassObjectType ( org . drools . core . test . model . Cheese . class ) ) ; final org . drools . core . rule . Declaration declaration = new org . drools . core . rule . Declaration ( "typeOfCheese" , extractor , pattern ) ; final org . drools . core . test . model . Cheese cheddar = new org . drools . core . test . model . Cheese ( "cheddar" , 5 ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . Object , java . lang . String ) { return org . kie . dmn . feel . util . EvalHelper . getDefinedValue ( current , property ) . getValueResult ( ) . getOrElse ( null ) ; } | org . junit . Assert . assertEquals ( "cheddar" , declaration . getValue ( null , cheddar ) ) |
shouldCreateHashUriSubjectsWithExistingHashUri ( ) { final org . apache . jena . rdf . model . Model m = org . apache . jena . rdf . model . ModelFactory . createDefaultModel ( ) ; final org . apache . jena . rdf . model . Statement x = m . createStatement ( testSubjects . toDomain ( "/some/#/abc" ) , org . apache . jena . rdf . model . ResourceFactory . createProperty ( "info:x" ) , testSubjects . toDomain ( "/" ) ) ; testObj . jcrTools = mock ( org . modeshape . jcr . api . JcrTools . class ) ; when ( mockNode . getParent ( ) ) . thenReturn ( mockHashNode ) ; when ( mockHashNode . getParent ( ) ) . thenReturn ( mockChildNode ) ; when ( mockSession . nodeExists ( "/some" ) ) . thenReturn ( true ) ; when ( mockSession . getNode ( "/some" ) ) . thenReturn ( mockChildNode ) ; when ( mockChildNode . isNew ( ) ) . thenReturn ( false ) ; when ( mockChildNode . hasNode ( "#" ) ) . thenReturn ( true ) ; when ( mockChildNode . getNode ( "#" ) ) . thenReturn ( mockHashNode ) ; when ( mockHashNode . isNew ( ) ) . thenReturn ( false ) ; when ( testObj . jcrTools . findOrCreateNode ( mockSession , "/some/#/abc" , org . fcrepo . kernel . modeshape . rdf . NT_FOLDER ) ) . thenReturn ( mockNode ) ; final org . apache . jena . rdf . model . Statement statement = testObj . skolemize ( testSubjects , x , "/some/#/abc" ) ; "<AssertPlaceHolder>" ; verify ( testObj . jcrTools ) . findOrCreateNode ( mockSession , "/some/#/abc" , org . fcrepo . kernel . modeshape . rdf . NT_FOLDER ) ; verify ( mockNode ) . addMixin ( org . fcrepo . kernel . modeshape . rdf . FEDORA_RESOURCE ) ; } skolemize ( org . fcrepo . kernel . api . identifiers . IdentifierConverter , org . apache . jena . rdf . model . Statement , java . lang . String ) { org . apache . jena . rdf . model . Statement skolemized = t ; if ( t . getSubject ( ) . isAnon ( ) ) { skolemized = org . fcrepo . kernel . modeshape . rdf . JcrRdfTools . m . createStatement ( getSkolemizedResource ( idTranslator , skolemized . getSubject ( ) , topic ) , skolemized . getPredicate ( ) , skolemized . getObject ( ) ) ; } else if ( ( idTranslator . inDomain ( t . getSubject ( ) ) ) && ( t . getSubject ( ) . getURI ( ) . contains ( "#" ) ) ) { findOrCreateHashUri ( idTranslator , t . getSubject ( ) ) ; } if ( t . getObject ( ) . isAnon ( ) ) { skolemized = org . fcrepo . kernel . modeshape . rdf . JcrRdfTools . m . createStatement ( skolemized . getSubject ( ) , skolemized . getPredicate ( ) , getSkolemizedResource ( idTranslator , skolemized . getObject ( ) , topic ) ) ; } else if ( ( ( t . getObject ( ) . isResource ( ) ) && ( idTranslator . inDomain ( t . getObject ( ) . asResource ( ) ) ) ) && ( t . getObject ( ) . asResource ( ) . getURI ( ) . contains ( "#" ) ) ) { findOrCreateHashUri ( idTranslator , t . getObject ( ) . asResource ( ) ) ; } return skolemized ; } | org . junit . Assert . assertEquals ( x , statement ) |
testGetJavaType ( ) { final java . lang . String metadataId = ( ( ( ( "MID:" + ( org . springframework . roo . classpath . PhysicalTypeIdentifier . class . getName ( ) ) ) + "#" ) + ( org . springframework . roo . project . Path . SRC_MAIN_JAVA ) ) + "?" ) + ( org . springframework . roo . classpath . PhysicalTypeIdentifierTest . USER_PROJECT_TYPE ) ; final org . springframework . roo . model . JavaType javaType = org . springframework . roo . classpath . PhysicalTypeIdentifier . getJavaType ( metadataId ) ; "<AssertPlaceHolder>" ; } getFullyQualifiedTypeName ( ) { return fullyQualifiedTypeName ; } | org . junit . Assert . assertEquals ( org . springframework . roo . classpath . PhysicalTypeIdentifierTest . USER_PROJECT_TYPE , javaType . getFullyQualifiedTypeName ( ) ) |
testBuildWithIterableFields ( ) { java . lang . String expectedAwql = "SELECT<sp>Id,<sp>Name<sp>LIMIT<sp>0,100" ; com . google . api . ads . adwords . jaxws . utils . v201809 . ServiceQuery serviceQuery = new com . google . api . ads . adwords . jaxws . utils . v201809 . ServiceQuery . Builder ( ) . fields ( com . google . common . collect . Sets . newHashSet ( "Id" , "Name" ) ) . limit ( 0 , 100 ) . build ( ) ; "<AssertPlaceHolder>" ; checkUtilitiesState ( ) ; } toString ( ) { return com . google . common . base . MoreObjects . toStringHelper ( this . getClass ( ) ) . omitNullValues ( ) . add ( "currencyCode" , getCurrencyCode ( ) ) . add ( "id" , getId ( ) ) . add ( "name" , getName ( ) ) . add ( "primaryBillingId" , getPrimaryBillingId ( ) ) . add ( "secondaryBillingId" , getSecondaryBillingId ( ) ) . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedAwql , serviceQuery . toString ( ) ) |
testEvaluate ( ) { eu . atos . sla . evaluation . guarantee . GuaranteeTermEvaluator . GuaranteeTermEvaluationResult result = evaluator . evaluate ( contract , term , allMetrics , now ) ; "<AssertPlaceHolder>" ; } getViolations ( ) { return violations ; } | org . junit . Assert . assertEquals ( 3 , result . getViolations ( ) . size ( ) ) |
testEndOfTime ( ) { org . joda . time . Instant endOfGlobalWindow = GlobalWindow . INSTANCE . maxTimestamp ( ) ; org . apache . beam . sdk . transforms . windowing . FixedWindows windowFn = org . apache . beam . sdk . transforms . windowing . FixedWindows . of ( org . joda . time . Duration . standardHours ( 1 ) ) ; org . apache . beam . sdk . transforms . windowing . IntervalWindow truncatedWindow = windowFn . assignWindow ( endOfGlobalWindow . minus ( 1 ) ) ; "<AssertPlaceHolder>" ; } maxTimestamp ( ) { return ts ; } | org . junit . Assert . assertThat ( truncatedWindow . maxTimestamp ( ) , org . hamcrest . Matchers . equalTo ( endOfGlobalWindow ) ) |
testValidateNumberNegative ( ) { net . objecthunter . exp4j . Expression exp = new net . objecthunter . exp4j . ExpressionBuilder ( "-1" ) . build ( ) ; net . objecthunter . exp4j . ValidationResult result = exp . validate ( false ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return valid ; } | org . junit . Assert . assertTrue ( result . isValid ( ) ) |
test_findNotExistingMethod ( ) { try { java . lang . String methodName = "rotateLeft" ; java . lang . reflect . Method method = org . apache . tuscany . sca . binding . corba . provider . util . MethodFinder . findMethod ( org . apache . tuscany . sca . binding . corba . testing . Integer . class , methodName , new java . lang . Class < ? > [ ] { } ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; } } findMethod ( java . lang . Class , java . lang . String , org . apache . tuscany . sca . binding . corba . provider . util . Class [ ] ) { java . lang . reflect . Method [ ] methods = forClass . getMethods ( ) ; for ( int i = 0 ; i < ( methods . length ) ; i ++ ) { if ( methods [ i ] . getName ( ) . equals ( methodName ) ) { java . lang . Class < ? > [ ] methodPTypes = methods [ i ] . getParameterTypes ( ) ; if ( ( methodPTypes . length ) == ( parameterTypes . length ) ) { boolean parameterMatch = true ; for ( int j = 0 ; j < ( methodPTypes . length ) ; j ++ ) { java . lang . Class < ? > nMethodPType = org . apache . tuscany . sca . binding . corba . provider . util . MethodFinder . normalizePrimitive ( methodPTypes [ j ] ) ; java . lang . Class < ? > nParameterType = org . apache . tuscany . sca . binding . corba . provider . util . MethodFinder . normalizePrimitive ( parameterTypes [ j ] ) ; if ( ! ( nMethodPType . equals ( nParameterType ) ) ) { parameterMatch = false ; break ; } } if ( parameterMatch ) { return methods [ i ] ; } } } } return null ; } | org . junit . Assert . assertEquals ( null , method ) |
testSchema ( ) { final org . apache . flink . api . common . typeinfo . TypeInformation < org . apache . flink . types . Row > rowSchema = org . apache . flink . formats . json . JsonRowSchemaConverter . convert ( ( "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 2 + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 3 + "<sp>properties:<sp>{" ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," ) + "<sp>idNumber:<sp>{<sp>type:<sp>'number'<sp>}," ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 6 ) + "1990-10-14" 0 ) + "1990-10-14" 3 ) + "<sp>time:<sp>{<sp>type:<sp>'string',<sp>format:<sp>'time'<sp>}," ) + "1990-10-14" 6 ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 8 ) + "1990-10-14" 2 ) + "1990-10-14" 9 ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 7 ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 1 ) + "<sp>properties:<sp>{<sp>" ) + "1990-10-14" 7 ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 0 ) + "1990-10-14" 5 ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 4 ) + "<sp>}" ) + "<sp>id:<sp>{<sp>type:<sp>'integer'<sp>}," 5 ) ) ) ; final org . apache . flink . types . Row row = new org . apache . flink . types . Row ( 11 ) ; row . setField ( 0 , java . math . BigDecimal . valueOf ( ( - 333 ) ) ) ; row . setField ( 1 , java . math . BigDecimal . valueOf ( 12.2222 ) ) ; row . setField ( 2 , null ) ; row . setField ( 3 , "1990-10-14" 1 ) ; row . setField ( 4 , java . sql . Date . valueOf ( "1990-10-14" ) ) ; row . setField ( 5 , java . sql . Time . valueOf ( "1990-10-14" 8 ) ) ; row . setField ( 6 , java . sql . Timestamp . valueOf ( "1990-10-14" 4 ) ) ; final byte [ ] bytes = new byte [ 1024 ] ; java . util . concurrent . ThreadLocalRandom . current ( ) . nextBytes ( bytes ) ; row . setField ( 7 , bytes ) ; final java . math . BigDecimal [ ] numbers = new java . math . BigDecimal [ ] { java . math . BigDecimal . valueOf ( 1 ) , java . math . BigDecimal . valueOf ( 2 ) , java . math . BigDecimal . valueOf ( 3 ) } ; row . setField ( 8 , numbers ) ; final java . lang . String [ ] strings = new java . lang . String [ ] { "one" , "two" , "three" } ; row . setField ( 9 , strings ) ; final org . apache . flink . types . Row nestedRow = new org . apache . flink . types . Row ( 2 ) ; nestedRow . setField ( 0 , true ) ; nestedRow . setField ( 1 , java . math . BigDecimal . valueOf ( 12 ) ) ; row . setField ( 10 , nestedRow ) ; final org . apache . flink . types . Row resultRow = serializeAndDeserialize ( rowSchema , row ) ; "<AssertPlaceHolder>" ; } serializeAndDeserialize ( X extends org . apache . flink . streaming . runtime . streamrecord . StreamElement , org . apache . flink . streaming . runtime . streamrecord . StreamElementSerializer ) { org . apache . flink . core . memory . DataOutputSerializer output = new org . apache . flink . core . memory . DataOutputSerializer ( 32 ) ; serializer . serialize ( record , output ) ; org . apache . flink . core . memory . DataInputDeserializer copyInput = new org . apache . flink . core . memory . DataInputDeserializer ( output . getByteArray ( ) , 0 , output . length ( ) ) ; org . apache . flink . core . memory . DataOutputSerializer copyOutput = new org . apache . flink . core . memory . DataOutputSerializer ( 32 ) ; serializer . copy ( copyInput , copyOutput ) ; org . apache . flink . core . memory . DataInputDeserializer input = new org . apache . flink . core . memory . DataInputDeserializer ( copyOutput . getByteArray ( ) , 0 , copyOutput . length ( ) ) ; return ( ( X ) ( serializer . deserialize ( input ) ) ) ; } | org . junit . Assert . assertEquals ( row , resultRow ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.