input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testGetZeroPortsFromResource ( ) { java . lang . String [ ] rangesOverlappingRequestPorts = new java . lang . String [ ] { "23:28" } ; int numPorts = 0 ; java . util . List < java . lang . Long > requestedPorts = java . util . Arrays . asList ( 25L , 27L ) ; org . apache . mesos . v1 . Protos . Resource resource = com . hubspot . singularity . helpers . MesosUtils . getPortsResource ( numPorts , buildOffer ( rangesOverlappingRequestPorts ) . getResourcesList ( ) , requestedPorts ) ; "<AssertPlaceHolder>" ; } getPorts ( org . apache . mesos . v1 . Protos . Resource , int ) { long [ ] ports = new long [ numPorts ] ; if ( numPorts == 0 ) { return ports ; } int idx = 0 ; for ( org . apache . mesos . v1 . Protos . Value . Range r : portsResource . getRanges ( ) . getRangeList ( ) ) { for ( long port = r . getBegin ( ) ; port <= ( r . getEnd ( ) ) ; port ++ ) { ports [ ( idx ++ ) ] = port ; if ( idx >= numPorts ) { return ports ; } } } return ports ; }
|
org . junit . Assert . assertEquals ( 0 , com . hubspot . singularity . helpers . MesosUtils . getPorts ( resource , numPorts ) . length )
|
isProtected_A$String_false ( ) { java . lang . String methodSignature = "private<sp>String<sp>hogehge(String<sp>hoge)<sp>throws<sp>Exception<sp>{" ; boolean actual = org . junithelper . core . util . AccessModifierDetector . isProtected ( methodSignature ) ; boolean expected = false ; "<AssertPlaceHolder>" ; } isProtected ( java . lang . String ) { return ( methodSignature != null ) && ( methodSignature . matches ( ( ( ( org . junithelper . core . util . AccessModifierDetector . RegExp . Prefix ) + "protected" ) + ( org . junithelper . core . util . AccessModifierDetector . RegExp . Suffix ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
dateTimeOffsetConversion ( ) { com . dslplatform . json . OffsetDateTime now = com . dslplatform . json . OffsetDateTime . now ( ) ; com . dslplatform . json . JsonWriter jw = new com . dslplatform . json . JsonWriter ( null ) ; com . dslplatform . json . JavaTimeConverter . serialize ( now , jw ) ; com . dslplatform . json . JsonReader jr = new com . dslplatform . json . JsonReader ( jw . toString ( ) . getBytes ( "UTF-8" ) , null ) ; jr . read ( ) ; com . dslplatform . json . OffsetDateTime value = com . dslplatform . json . JavaTimeConverter . deserializeDateTime ( jr ) ; "<AssertPlaceHolder>" ; } deserializeDateTime ( com . dslplatform . json . JsonReader ) { final char [ ] tmp = reader . readSimpleQuote ( ) ; final int len = ( ( reader . getCurrentIndex ( ) ) - ( reader . getTokenStart ( ) ) ) - 1 ; if ( ( ( ( ( ( ( ( ( len > 19 ) && ( len < 31 ) ) && ( ( tmp [ ( len - 1 ) ] ) == 'Z' ) ) && ( ( tmp [ 4 ] ) == '-' ) ) && ( ( tmp [ 7 ] ) == '-' ) ) && ( ( ( ( tmp [ 10 ] ) == 'T' ) || ( ( tmp [ 10 ] ) == 't' ) ) || ( ( tmp [ 10 ] ) == '<sp>' ) ) ) && ( ( tmp [ 13 ] ) == ':' ) ) && ( ( tmp [ 16 ] ) == ':' ) ) && ( com . dslplatform . json . JavaTimeConverter . allDigits ( tmp , 20 , ( len - 1 ) ) ) ) { final int year = com . dslplatform . json . NumberConverter . read4 ( tmp , 0 ) ; final int month = com . dslplatform . json . NumberConverter . read2 ( tmp , 5 ) ; final int day = com . dslplatform . json . NumberConverter . read2 ( tmp , 8 ) ; final int hour = com . dslplatform . json . NumberConverter . read2 ( tmp , 11 ) ; final int min = com . dslplatform . json . NumberConverter . read2 ( tmp , 14 ) ; final int sec = com . dslplatform . json . NumberConverter . read2 ( tmp , 17 ) ; if ( ( tmp [ 19 ] ) == '.' ) { final int nanos = com . dslplatform . json . JavaTimeConverter . readNanos ( tmp , ( len - 1 ) ) ; return com . dslplatform . json . OffsetDateTime . of ( year , month , day , hour , min , sec , nanos , ZoneOffset . UTC ) ; } return com . dslplatform . json . OffsetDateTime . of ( year , month , day , hour , min , sec , 0 , ZoneOffset . UTC ) ; } else if ( ( ( ( ( ( ( ( ( ( ( len > 22 ) && ( len < 36 ) ) && ( ( tmp [ ( len - 3 ) ] ) == ':' ) ) && ( ( ( tmp [ ( len - 6 ) ] ) == '+' ) || ( ( tmp [ ( len - 6 ) ] ) == '-' ) ) ) && ( ( tmp [ 4 ] ) == '-' ) ) && ( ( tmp [ 7 ] ) == '-' ) ) && ( ( ( ( tmp [ 10 ] ) == 'T' ) || ( ( tmp [ 10 ] ) == 't' ) ) || ( ( tmp [ 10 ] ) == '<sp>' ) ) ) && ( ( tmp [ 13 ] ) == ':' ) ) && ( ( tmp [ 16 ] ) == ':' ) ) && ( com . dslplatform . json . JavaTimeConverter . allDigits ( tmp , ( len - 2 ) , len ) ) ) && ( com . dslplatform . json . JavaTimeConverter . allDigits ( tmp , ( len - 5 ) , ( len - 3 ) ) ) ) { final int year = com . dslplatform . json . NumberConverter . read4 ( tmp , 0 ) ; final int month = com . dslplatform . json . NumberConverter . read2 ( tmp , 5 ) ; final int day = com . dslplatform . json . NumberConverter . read2 ( tmp , 8 ) ; final int hour = com . dslplatform . json . NumberConverter . read2 ( tmp , 11 ) ; final int min = com . dslplatform . json . NumberConverter . read2 ( tmp , 14 ) ; final int sec = com . dslplatform . json . NumberConverter . read2 ( tmp , 17 ) ; final int offHour = com . dslplatform . json . NumberConverter . read2 ( tmp , ( len - 5 ) ) ; final int offMin = com . dslplatform . json . NumberConverter . read2 ( tmp , ( len - 2 ) ) ; final com . dslplatform . json . ZoneOffset offset = com . dslplatform . json . ZoneOffset . ofHoursMinutes ( ( ( tmp [ ( len - 6 ) ] ) == '+' ? offHour : - offHour ) , offMin ) ; if ( ( tmp [ 19 ] ) == '.' ) { final int nanos = com . dslplatform . json . JavaTimeConverter . readNanos ( tmp , ( len - 6 ) ) ; return com . dslplatform . json . OffsetDateTime . of ( year , month , day , hour , min
|
org . junit . Assert . assertEquals ( now , value )
|
testNoArgumentInConstr ( ) { fr . inria . main . evolution . PlugInLoader loader = new fr . inria . main . evolution . PlugInLoader ( ) ; fr . inria . astor . core . faultlocalization . FaultLocalizationStrategy fls = ( ( fr . inria . astor . core . faultlocalization . FaultLocalizationStrategy ) ( loader . loadPlugin ( fr . inria . astor . core . faultlocalization . gzoltar . GZoltarFaultLocalization . class . getCanonicalName ( ) , fr . inria . astor . core . faultlocalization . FaultLocalizationStrategy . class ) ) ) ; "<AssertPlaceHolder>" ; } loadPlugin ( java . lang . String , java . lang . Class ) { java . lang . Object object = null ; try { java . lang . Class classDefinition = java . lang . Class . forName ( className ) ; object = classDefinition . newInstance ( ) ; } catch ( java . lang . Exception e ) { fr . inria . main . evolution . PlugInLoader . log . error ( ( ( ( "Loading<sp>" + className ) + "<sp>--" ) + e ) ) ; throw new java . lang . Exception ( ( "Error<sp>Loading<sp>Engine:<sp>" + e ) ) ; } if ( type . isInstance ( object ) ) return ( ( fr . inria . astor . core . solutionsearch . extension . AstorExtensionPoint ) ( object ) ) ; else throw new java . lang . Exception ( ( ( ( "The<sp>strategy<sp>" + className ) + "<sp>does<sp>not<sp>extend<sp>from<sp>" ) + ( type . getCanonicalName ( ) ) ) ) ; }
|
org . junit . Assert . assertNotNull ( fls )
|
testDeleteNull ( ) { initializeExpectedInstance ( 1 ) ; expect ( compute . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( compute . deleteInstance ( com . google . cloud . compute . deprecated . InstanceTest . INSTANCE_ID ) ) . andReturn ( null ) ; replay ( compute ) ; initializeInstance ( ) ; "<AssertPlaceHolder>" ; } delete ( ) { boolean deleted = sink . delete ( ) ; if ( deleted ) { } else { } return deleted ; }
|
org . junit . Assert . assertNull ( instance . delete ( ) )
|
testGetWidth_1 ( ) { org . jinstagram . entity . oembed . OembedInformation fixture = new org . jinstagram . entity . oembed . OembedInformation ( ) ; fixture . setVersion ( "" ) ; fixture . setTitle ( "" ) ; fixture . setProviderUrl ( "" ) ; fixture . setUrl ( "" ) ; fixture . setAuthorName ( "" ) ; fixture . setHeight ( "" ) ; fixture . setMediaId ( "" ) ; fixture . setProviderName ( "" ) ; fixture . setType ( "" ) ; fixture . setWidth ( "" ) ; fixture . setAuthorUrl ( "" ) ; java . lang . String result = fixture . getWidth ( ) ; "<AssertPlaceHolder>" ; } getWidth ( ) { return width ; }
|
org . junit . Assert . assertEquals ( "" , result )
|
startsWith_A$Seq$int ( ) { com . m3 . scalaflavor4j . Nil < java . lang . String > nil = com . m3 . scalaflavor4j . Nil . < java . lang . String > apply ( ) ; com . m3 . scalaflavor4j . Seq < java . lang . String > that = com . m3 . scalaflavor4j . Seq . apply ( "a" , "b" , "c" ) ; int offset = 0 ; boolean actual = nil . startsWith ( that , offset ) ; boolean expected = false ; "<AssertPlaceHolder>" ; } startsWith ( com . m3 . scalaflavor4j . Seq , int ) { return false ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
getOutputVlanId ( ) { "<AssertPlaceHolder>" ; } getOutputVlanId ( ) { org . junit . Assert . assertEquals ( org . openkilda . messaging . command . Constants . outputVlanId , flow . getOutputVlanId ( ) . intValue ( ) ) ; }
|
org . junit . Assert . assertEquals ( org . openkilda . messaging . command . Constants . outputVlanId , flow . getOutputVlanId ( ) . intValue ( ) )
|
shouldConvertMapToJSONString ( ) { java . lang . String data = "{\"/test.js\":{\"lineData\":[null,0,1]}}" ; jscover . report . SortedMap < java . lang . String , jscover . report . FileData > map = jsonMerger . jsonToMap ( data ) ; java . lang . String jsonString = jsonMerger . toJSON ( map ) ; "<AssertPlaceHolder>" ; } toJSON ( jscover . report . SortedMap ) { java . lang . StringBuilder json = new java . lang . StringBuilder ( "{" ) ; int scriptCount = 0 ; for ( java . lang . String scriptURI : map . keySet ( ) ) { java . lang . StringBuilder coverage = new java . lang . StringBuilder ( ) ; java . lang . StringBuilder branchData = new java . lang . StringBuilder ( ) ; jscover . report . FileData coverageData = map . get ( scriptURI ) ; for ( int i = 0 ; i < ( coverageData . getLines ( ) . size ( ) ) ; i ++ ) { if ( i > 0 ) coverage . append ( "," ) ; coverage . append ( coverageData . getLines ( ) . get ( i ) ) ; } java . lang . StringBuilder functions = new java . lang . StringBuilder ( ) ; for ( int i = 0 ; i < ( coverageData . getFunctions ( ) . size ( ) ) ; i ++ ) { if ( i > 0 ) functions . append ( "," ) ; functions . append ( coverageData . getFunctions ( ) . get ( i ) ) ; } addBranchData ( branchData , coverageData ) ; if ( ( scriptCount ++ ) > 0 ) { json . append ( "," ) ; } java . lang . StringBuilder scriptJSON = new java . lang . StringBuilder ( java . lang . String . format ( "\"%s\":{" , scriptURI ) ) ; scriptJSON . append ( java . lang . String . format ( "\"lineData\":[%s]" , coverage ) ) ; if ( ( functions . length ( ) ) > 0 ) scriptJSON . append ( java . lang . String . format ( ",\"functionData\":[%s]" , functions ) ) ; if ( ( branchData . length ( ) ) > 0 ) scriptJSON . append ( java . lang . String . format ( ",\"branchData\":{%s}" , branchData ) ) ; scriptJSON . append ( "}" ) ; json . append ( scriptJSON ) ; } json . append ( "}" ) ; return json . toString ( ) ; }
|
org . junit . Assert . assertThat ( jsonString , org . hamcrest . CoreMatchers . equalTo ( data ) )
|
testServicesAnnotatedNoneSetButImplementsMultiple ( ) { @ com . liferay . portal . kernel . spring . osgi . OSGiBeanProperties class C implements java . io . Serializable , java . util . EventListener { } java . util . Set < java . lang . String > interfaceNames = OSGiBeanProperties . Service . interfaceNames ( new C ( ) , C . class . getAnnotation ( com . liferay . portal . kernel . spring . osgi . OSGiBeanProperties . class ) , StringPool . EMPTY_ARRAY ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( interfaceNames . toString ( ) , 3 , interfaceNames . size ( ) )
|
findIsNullTest ( ) { java . util . List < cn . hutool . db . Entity > results = cn . hutool . db . CRUDTest . db . findAll ( cn . hutool . db . Entity . create ( "user" ) . set ( "age" , "is<sp>null" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . size ; }
|
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
|
getPeople_shouldGetNoOneByNull ( ) { java . util . List < org . openmrs . Person > people = hibernatePersonDAO . getPeople ( null , false ) ; logPeople ( people ) ; "<AssertPlaceHolder>" ; } size ( ) { return getMemberships ( ) . stream ( ) . filter ( ( m ) -> ! ( m . getVoided ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , people . size ( ) )
|
testHibernateConfiguration ( ) { javax . persistence . EntityManagerFactory factory = org . evosuite . runtime . mock . javax . persistence . MockPersistence . createEntityManagerFactory ( "foo" ) ; javax . persistence . EntityManager em = factory . createEntityManager ( ) ; factory . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { for ( java . util . jar . JarFile jar : openedJars . values ( ) ) { try { jar . close ( ) ; } catch ( java . io . IOException e ) { org . evosuite . classpath . ResourceList . logger . error ( ( ( ( "Cannot<sp>close<sp>jar<sp>file<sp>" + ( jar . getName ( ) ) ) + ".<sp>" ) + ( e . toString ( ) ) ) ) ; } } }
|
org . junit . Assert . assertNotNull ( em )
|
testGetSecurityRoleFunctions ( ) { org . finra . herd . model . api . xml . SecurityRoleFunctionKeys securityRoleFunctionKeys = new org . finra . herd . model . api . xml . SecurityRoleFunctionKeys ( java . util . Collections . singletonList ( new org . finra . herd . model . api . xml . SecurityRoleFunctionKey ( SECURITY_ROLE , SECURITY_FUNCTION ) ) ) ; when ( securityRoleFunctionService . getSecurityRoleFunctions ( ) ) . thenReturn ( securityRoleFunctionKeys ) ; org . finra . herd . model . api . xml . SecurityRoleFunctionKeys result = securityRoleFunctionRestController . getSecurityRoleFunctions ( ) ; "<AssertPlaceHolder>" ; verify ( securityRoleFunctionService ) . getSecurityRoleFunctions ( ) ; verifyNoMoreInteractions ( securityRoleFunctionService ) ; } getSecurityRoleFunctions ( ) { return securityRoleFunctionService . getSecurityRoleFunctions ( ) ; }
|
org . junit . Assert . assertEquals ( securityRoleFunctionKeys , result )
|
testBuildWithParameters ( ) { org . lnu . is . domain . department . Department department = new org . lnu . is . domain . department . Department ( ) ; org . lnu . is . domain . language . Language language = new org . lnu . is . domain . language . Language ( ) ; java . lang . String name = "fdfds" ; java . lang . String abbrName = "asfasf" ; org . lnu . is . domain . department . name . DepartmentName context = new org . lnu . is . domain . department . name . DepartmentName ( ) ; context . setDepartment ( department ) ; context . setLanguage ( language ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>DepartmentName<sp>e<sp>WHERE<sp>(<sp>e.department<sp>=<sp>:department<sp>AND<sp>e.language<sp>=<sp>:language<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . department . name . DepartmentName > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testFormURLEncode_2 ( ) { java . lang . String string = "" ; java . lang . String result = org . jinstagram . http . URLUtils . formURLEncode ( string ) ; "<AssertPlaceHolder>" ; } formURLEncode ( java . lang . String ) { org . jinstagram . utils . Preconditions . checkNotNull ( string , "Cannot<sp>encode<sp>null<sp>string" ) ; try { return java . net . URLEncoder . encode ( string , org . jinstagram . http . URLUtils . UTF_8 ) ; } catch ( java . io . UnsupportedEncodingException uee ) { throw new java . lang . IllegalStateException ( org . jinstagram . http . URLUtils . ERROR_MSG , uee ) ; } }
|
org . junit . Assert . assertEquals ( "" , result )
|
testValidDirectory ( ) { org . sejda . model . output . FileOrDirectoryTaskOutput instance = new org . sejda . model . output . FileOrDirectoryTaskOutput ( directory ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( instance )
|
testConvertBlocksWithLocations ( ) { boolean [ ] testSuite = new boolean [ ] { false , true } ; for ( int i = 0 ; i < ( testSuite . length ) ; i ++ ) { org . apache . hadoop . hdfs . server . protocol . BlocksWithLocations . BlockWithLocations [ ] list = new org . apache . hadoop . hdfs . server . protocol . BlocksWithLocations . BlockWithLocations [ ] { org . apache . hadoop . hdfs . protocolPB . TestPBHelper . getBlockWithLocations ( 1 , testSuite [ i ] ) , org . apache . hadoop . hdfs . protocolPB . TestPBHelper . getBlockWithLocations ( 2 , testSuite [ i ] ) } ; org . apache . hadoop . hdfs . server . protocol . BlocksWithLocations locs = new org . apache . hadoop . hdfs . server . protocol . BlocksWithLocations ( list ) ; org . apache . hadoop . hdfs . protocol . proto . HdfsServerProtos . BlocksWithLocationsProto locsProto = org . apache . hadoop . hdfs . protocolPB . PBHelper . convert ( locs ) ; org . apache . hadoop . hdfs . server . protocol . BlocksWithLocations locs2 = org . apache . hadoop . hdfs . protocolPB . PBHelper . convert ( locsProto ) ; org . apache . hadoop . hdfs . server . protocol . BlocksWithLocations . BlockWithLocations [ ] blocks = locs . getBlocks ( ) ; org . apache . hadoop . hdfs . server . protocol . BlocksWithLocations . BlockWithLocations [ ] blocks2 = locs2 . getBlocks ( ) ; "<AssertPlaceHolder>" ; for ( int j = 0 ; j < ( blocks . length ) ; j ++ ) { compare ( blocks [ j ] , blocks2 [ j ] ) ; } } } getBlocks ( ) { return blocks ; }
|
org . junit . Assert . assertEquals ( blocks . length , blocks2 . length )
|
testList ( ) { if ( ! ( org . apache . commons . lang3 . SystemUtils . IS_JAVA_1_6 ) ) { return ; } org . cyclopsgroup . jmxterm . jdk6 . Jdk6JavaProcessManager m = new org . cyclopsgroup . jmxterm . jdk6 . Jdk6JavaProcessManager ( org . cyclopsgroup . jmxterm . pm . JConsoleClassLoaderFactory . getClassLoader ( ) ) ; java . util . List < org . cyclopsgroup . jmxterm . JavaProcess > ps = m . list ( ) ; "<AssertPlaceHolder>" ; } list ( ) { throw new java . lang . UnsupportedOperationException ( message , cause ) ; }
|
org . junit . Assert . assertFalse ( ps . isEmpty ( ) )
|
whenUpdateZeroElementThenResultTwo ( ) { this . arr . update ( 0 , 2 ) ; "<AssertPlaceHolder>" ; } get ( K ) { return this . cache . getOrDefault ( key , null ) ; }
|
org . junit . Assert . assertThat ( this . arr . get ( 0 ) , org . hamcrest . core . Is . is ( 2 ) )
|
newKeyIfPresent ( ) { java . util . Map < java . lang . String , java . lang . Object > map = org . neo4j . helpers . collection . MapUtil . map ( "partitionProperty" , "old" , "writeProperty" , "new" ) ; org . neo4j . graphalgo . core . ProcedureConfiguration procedureConfiguration = org . neo4j . graphalgo . core . ProcedureConfiguration . create ( map ) ; java . lang . String value = procedureConfiguration . get ( "writeProperty" , "partitionProperty" , "defaultValue" ) ; "<AssertPlaceHolder>" ; } get ( int , long , double ) { org . neo4j . graphalgo . core . utils . container . TrackingLongDoubleHashMap map = data [ localIndex ] ; return map != null ? map . getOrDefault ( target , defaultValue ) : defaultValue ; }
|
org . junit . Assert . assertEquals ( "new" , value )
|
testServedCacheAbsentByDefault ( ) { com . facebook . buck . artifact_cache . config . ArtifactCacheBuckConfig config = com . facebook . buck . artifact_cache . ArtifactCacheBuckConfigTest . createFromText ( "[cache]" , "dir<sp>=<sp>~/cache_dir" ) ; "<AssertPlaceHolder>" ; } getServedLocalCache ( ) { if ( ! ( getServingLocalCacheEnabled ( ) ) ) { return java . util . Optional . empty ( ) ; } return java . util . Optional . of ( obtainDirEntryForName ( java . util . Optional . empty ( ) ) . withCacheReadMode ( getServedLocalCacheReadMode ( ) ) ) ; }
|
org . junit . Assert . assertThat ( config . getServedLocalCache ( ) , org . hamcrest . Matchers . equalTo ( java . util . Optional . empty ( ) ) )
|
testUpdateNotificationRegistrationStatusAssertSuccess ( ) { org . finra . herd . model . api . xml . NotificationRegistrationKey notificationRegistrationKey = new org . finra . herd . model . api . xml . NotificationRegistrationKey ( NAMESPACE , NOTIFICATION_NAME ) ; org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateRequest request = new org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateRequest ( org . finra . herd . model . jpa . NotificationRegistrationStatusEntity . DISABLED ) ; org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateResponse response = new org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateResponse ( notificationRegistrationKey , org . finra . herd . model . jpa . NotificationRegistrationStatusEntity . DISABLED ) ; when ( notificationRegistrationStatusService . updateNotificationRegistrationStatus ( org . finra . herd . rest . NAMESPACE , org . finra . herd . rest . NOTIFICATION_NAME , request ) ) . thenReturn ( response ) ; org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateResponse resultResponse = notificationRegistrationStatusRestController . updateNotificationRegistrationStatus ( org . finra . herd . rest . NAMESPACE , org . finra . herd . rest . NOTIFICATION_NAME , request ) ; verify ( notificationRegistrationStatusService ) . updateNotificationRegistrationStatus ( org . finra . herd . rest . NAMESPACE , org . finra . herd . rest . NOTIFICATION_NAME , request ) ; verifyNoMoreInteractions ( notificationRegistrationStatusService ) ; "<AssertPlaceHolder>" ; } updateNotificationRegistrationStatus ( java . lang . String , java . lang . String , org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateRequest ) { org . springframework . util . Assert . hasText ( namespace , "The<sp>namespace<sp>must<sp>be<sp>specified" ) ; org . springframework . util . Assert . hasText ( notificationName , "The<sp>notification<sp>name<sp>must<sp>be<sp>specified" ) ; java . lang . String notificationRegistrationStatus = notificationRegistrationStatusUpdateRequest . getNotificationRegistrationStatus ( ) ; org . springframework . util . Assert . hasText ( notificationRegistrationStatus , "The<sp>notification<sp>registration<sp>status<sp>must<sp>be<sp>specified" ) ; org . finra . herd . model . jpa . NotificationRegistrationEntity notificationRegistration = notificationRegistrationDaoHelper . getNotificationRegistration ( namespace . trim ( ) , notificationName . trim ( ) ) ; org . finra . herd . model . jpa . NotificationRegistrationStatusEntity notificationRegistrationStatusEntity = notificationRegistrationStatusDaoHelper . getNotificationRegistrationStatusEntity ( notificationRegistrationStatus . trim ( ) ) ; notificationRegistration . setNotificationRegistrationStatus ( notificationRegistrationStatusEntity ) ; org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateResponse notificationRegistrationStatusUpdateResponse = new org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateResponse ( ) ; notificationRegistrationStatusUpdateResponse . setNotificationRegistrationKey ( new org . finra . herd . model . api . xml . NotificationRegistrationKey ( notificationRegistration . getNamespace ( ) . getCode ( ) , notificationRegistration . getName ( ) ) ) ; notificationRegistrationStatusUpdateResponse . setNotificationRegistrationStatus ( notificationRegistrationStatusEntity . getCode ( ) ) ; return notificationRegistrationStatusUpdateResponse ; }
|
org . junit . Assert . assertEquals ( response , resultResponse )
|
testCompletenessOfSpecifiedDataLinks ( ) { org . apache . taverna . scufl2 . validation . correctness . DummyWorkflow dw = new org . apache . taverna . scufl2 . validation . correctness . DummyWorkflow ( ) ; dw . setDataLinks ( new java . util . TreeSet < org . apache . taverna . scufl2 . api . core . DataLink > ( ) ) ; org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator cv = new org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator ( ) ; org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener rcvl = new org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener ( ) ; cv . checkCorrectness ( dw , true , rcvl ) ; java . util . Set < org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem > nullFieldProblems = rcvl . getNullFieldProblems ( ) ; boolean problem = false ; for ( org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem nlp : nullFieldProblems ) { if ( ( nlp . getBean ( ) . equals ( dw ) ) && ( nlp . getFieldName ( ) . equals ( "dataLinks" ) ) ) { problem = true ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( getClass ( ) ) == ( obj . getClass ( ) ) ; }
|
org . junit . Assert . assertFalse ( problem )
|
testSetAbstractMethod ( ) { final org . opendaylight . mdsal . binding . model . util . generated . type . builder . MethodSignatureBuilderImpl signatureBuilderImpl = new org . opendaylight . mdsal . binding . model . util . generated . type . builder . MethodSignatureBuilderImpl ( "testMethod" ) ; signatureBuilderImpl . setAbstract ( true ) ; final org . opendaylight . mdsal . binding . model . api . MethodSignature methodSignature = signatureBuilderImpl . toInstance ( null ) ; "<AssertPlaceHolder>" ; } isAbstract ( ) { return this . isAbstract ; }
|
org . junit . Assert . assertTrue ( methodSignature . isAbstract ( ) )
|
testGetSuffixSegments_empty ( ) { org . apache . sling . api . resource . ResourceResolver resourceResolver = context . resourceResolver ( ) ; org . apache . sling . testing . mock . sling . servlet . MockSlingHttpServletRequest request = context . request ( ) ; request . setResource ( resourceResolver . getResource ( "/apple/macbookair" ) ) ; org . apache . sling . testing . mock . sling . servlet . MockRequestPathInfo requestPathInfo = ( ( org . apache . sling . testing . mock . sling . servlet . MockRequestPathInfo ) ( request . getRequestPathInfo ( ) ) ) ; requestPathInfo . setSelectorString ( "show.test" ) ; requestPathInfo . setExtension ( "html" ) ; request . setQueryString ( "cpu=i7&ghz=2.4" ) ; java . lang . String [ ] expResult = new java . lang . String [ ] { } ; java . lang . String [ ] result = com . adobe . acs . commons . util . PathInfoUtil . getSuffixSegments ( request ) ; "<AssertPlaceHolder>" ; } getSuffixSegments ( org . apache . sling . api . SlingHttpServletRequest ) { org . apache . sling . api . request . RequestPathInfo pathInfo = request . getRequestPathInfo ( ) ; if ( ( pathInfo == null ) || ( ( pathInfo . getSuffix ( ) ) == null ) ) { return new java . lang . String [ ] { } ; } return org . apache . commons . lang . StringUtils . split ( pathInfo . getSuffix ( ) , '/' ) ; }
|
org . junit . Assert . assertArrayEquals ( expResult , result )
|
testBrokenV3CertificatePath ( ) { java . util . Collection < org . bouncycastle . cert . X509CertificateHolder > certs = new java . util . ArrayList < org . bouncycastle . cert . X509CertificateHolder > ( ) ; certs . add ( org . xwiki . crypto . pkix . internal . BcUtils . getX509CertificateHolder ( v3CaCert ) ) ; org . bouncycastle . util . CollectionStore store = new org . bouncycastle . util . CollectionStore ( certs ) ; org . xwiki . crypto . pkix . CertificateProvider provider = mocker . getInstance ( org . xwiki . crypto . pkix . CertificateProvider . class , "BCStoreX509" ) ; ( ( org . xwiki . crypto . pkix . internal . BcStoreX509CertificateProvider ) ( provider ) ) . setStore ( store ) ; java . util . Collection < org . xwiki . crypto . pkix . params . CertifiedPublicKey > chain = builder . build ( v3Cert , provider ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { if ( this . name . equals ( name ) ) { return true ; } if ( ( this . references ) != null ) { for ( org . slf4j . Marker marker : this . references ) { if ( marker . contains ( name ) ) { return true ; } } } return false ; }
|
org . junit . Assert . assertThat ( chain , org . hamcrest . Matchers . contains ( v3Cert ) )
|
testEquality ( ) { int i = 0 ; final kieker . tools . opad . record . ExtendedStorableDetectionResult oneRecord = new kieker . tools . opad . record . ExtendedStorableDetectionResult ( kieker . tools . opad . record . junit . STRING_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . STRING_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . LONG_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . LONG_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) ) ; i = 0 ; final kieker . tools . opad . record . ExtendedStorableDetectionResult copiedRecord = new kieker . tools . opad . record . ExtendedStorableDetectionResult ( kieker . tools . opad . record . junit . STRING_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . STRING_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . LONG_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . LONG_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) , kieker . tools . opad . record . junit . DOUBLE_VALUES . get ( ( i % ( kieker . tools . opad . record . junit . DOUBLE_VALUES . size ( ) ) ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . points . getSize ( ) ; }
|
org . junit . Assert . assertEquals ( oneRecord , copiedRecord )
|
testAllOpenSSLCiphersMapped ( ) { java . util . Set < java . lang . String > openSSLCipherSuites = org . apache . tomcat . util . net . jsse . openssl . TesterOpenSSL . getOpenSSLCiphersAsSet ( "ALL:eNULL" ) ; java . lang . StringBuilder errors = new java . lang . StringBuilder ( ) ; for ( java . lang . String openSSLCipherSuite : openSSLCipherSuites ) { java . util . List < java . lang . String > jsseCipherSuites = org . apache . tomcat . util . net . jsse . openssl . OpenSSLCipherConfigurationParser . parseExpression ( openSSLCipherSuite ) ; for ( org . apache . tomcat . util . net . jsse . openssl . TestCipher . JsseImpl jsseImpl : org . apache . tomcat . util . net . jsse . openssl . TestCipher . JSSE_IMPLS ) { boolean found = false ; for ( java . lang . String jsseCipherSuite : jsseCipherSuites ) { if ( jsseImpl . getStandardNames ( ) . contains ( jsseCipherSuite ) ) { found = true ; if ( jsseImpl . getOpenSslUnmapped ( ) . contains ( openSSLCipherSuite ) ) { errors . append ( ( ( ( ( "Mapping<sp>found<sp>in<sp>" + ( jsseImpl . getVendor ( ) ) ) + "'s<sp>JSSE<sp>implementation<sp>for<sp>" ) + openSSLCipherSuite ) + "<sp>when<sp>none<sp>was<sp>expected\n" ) ) ; } break ; } } if ( ( ! found ) && ( ! ( jsseImpl . getOpenSslUnmapped ( ) . contains ( openSSLCipherSuite ) ) ) ) { errors . append ( ( ( ( ( "No<sp>mapping<sp>found<sp>in<sp>" + ( jsseImpl . getVendor ( ) ) ) + "'s<sp>JSSE<sp>implementation<sp>for<sp>" ) + openSSLCipherSuite ) + "<sp>when<sp>one<sp>was<sp>expected\n" ) ) ; } } } "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuffer buf = new java . lang . StringBuffer ( org . apache . tomcat . jdbc . pool . interceptor . StatementDecoratorInterceptor . StatementProxy . class . getName ( ) ) ; buf . append ( "[Proxy=" ) ; buf . append ( java . lang . System . identityHashCode ( this ) ) ; buf . append ( ";<sp>Sql=" ) ; buf . append ( getSql ( ) ) ; buf . append ( ";<sp>Delegate=" ) ; buf . append ( getDelegate ( ) ) ; buf . append ( ";<sp>Connection=" ) ; buf . append ( getConnection ( ) ) ; buf . append ( "]" ) ; return buf . toString ( ) ; }
|
org . junit . Assert . assertTrue ( errors . toString ( ) , ( ( errors . length ( ) ) == 0 ) )
|
remoteNonBlockingTimeout ( ) { org . ebayopensource . turmeric . runtime . sif . service . Service service = org . ebayopensource . turmeric . runtime . sif . service . ServiceFactory . create ( "test1" , "remote" , serverUri . toURL ( ) ) ; service . createDispatch ( "echoString" ) . invokeAsync ( ( ( ECHO_STRING ) + "service1" ) ) ; java . util . List < javax . xml . ws . Response < ? > > responseList = service . poll ( false , false , 0 ) ; "<AssertPlaceHolder>" ; } poll ( boolean , boolean , long ) { if ( ( m_poller ) == null ) throw new java . lang . UnsupportedOperationException ( "Transport<sp>doesn't<sp>support<sp>polling" ) ; if ( partial == false ) return getAll ( timeout ) ; return poll ( block , timeout ) ; }
|
org . junit . Assert . assertTrue ( ( ( responseList . size ( ) ) < 1 ) )
|
applyTest ( ) { java . lang . String [ ] [ ] tests = new java . lang . String [ ] [ ] { new java . lang . String [ ] { "{{<sp>''<sp>|<sp>downcase<sp>}}" , "" } , new java . lang . String [ ] { "{{<sp>nil<sp>|<sp>downcase<sp>}}" , "" } , new java . lang . String [ ] { "{{<sp>'Abc'<sp>|<sp>downcase<sp>}}" , "abc" } , new java . lang . String [ ] { "{{<sp>'abc'<sp>|<sp>downcase<sp>}}" , "abc" } } ; for ( java . lang . String [ ] test : tests ) { liqp . Template template = liqp . Template . parse ( test [ 0 ] ) ; java . lang . String rendered = java . lang . String . valueOf ( template . render ( ) ) ; "<AssertPlaceHolder>" ; } } render ( ) { return render ( new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; }
|
org . junit . Assert . assertThat ( rendered , org . hamcrest . CoreMatchers . is ( test [ 1 ] ) )
|
testDoubleOpenFails ( ) { org . apache . hyracks . storage . common . IIndexAccessor accessor = createAccessor ( ) ; org . apache . hyracks . storage . common . IIndexCursor cursor = createCursor ( accessor ) ; java . util . List < org . apache . hyracks . storage . common . ISearchPredicate > predicates = createSearchPredicates ( ) ; open ( accessor , cursor , predicates . get ( 0 ) ) ; boolean expectedExceptionThrown = false ; try { open ( accessor , cursor , predicates . get ( 0 ) ) ; } catch ( java . lang . Exception e ) { expectedExceptionThrown = true ; } cursor . close ( ) ; cursor . destroy ( ) ; destroy ( accessor ) ; "<AssertPlaceHolder>" ; } destroy ( ) { java . io . File f = dir . toFile ( ) ; org . apache . commons . io . FileUtils . deleteDirectory ( f ) ; return true ; }
|
org . junit . Assert . assertTrue ( expectedExceptionThrown )
|
testSearch ( ) { com . liferay . portlet . dynamicdatamapping . model . DDMTemplate template = addDisplayTemplate ( _classNameId , 0 , "Test<sp>Template<sp>1" ) ; addDisplayTemplate ( _classNameId , 0 , "Test<sp>Template<sp>2" ) ; java . util . List < com . liferay . portlet . dynamicdatamapping . model . DDMTemplate > templates = com . liferay . portlet . dynamicdatamapping . service . DDMTemplateLocalServiceUtil . search ( template . getCompanyId ( ) , template . getGroupId ( ) , template . getClassNameId ( ) , template . getClassPK ( ) , template . getName ( ) , template . getDescription ( ) , template . getType ( ) , template . getMode ( ) , template . getLanguage ( ) , false , 0 , 1 , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return getWidget ( ) . rowCount ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , templates . size ( ) )
|
test_Statement ( ) { com . taobao . tddl . group . jdbc . TGroupDataSource tgds = new com . taobao . tddl . group . jdbc . TGroupDataSource ( ) ; tgds . setDbGroupKey ( "dbKey0" ) ; java . util . List < com . taobao . tddl . group . jdbc . DataSourceWrapper > dataSourceWrappers = new java . util . ArrayList < com . taobao . tddl . group . jdbc . DataSourceWrapper > ( ) ; com . taobao . tddl . common . mock . MockDataSource db1 = new com . taobao . tddl . common . mock . MockDataSource ( "db" , "db1" ) ; com . taobao . tddl . common . mock . MockDataSource db2 = new com . taobao . tddl . common . mock . MockDataSource ( "db" , "db2" ) ; com . taobao . tddl . group . jdbc . DataSourceWrapper dsw1 = new com . taobao . tddl . group . jdbc . DataSourceWrapper ( "db1" , "rw" , db1 , com . taobao . tddl . common . model . DBType . MYSQL ) ; com . taobao . tddl . group . jdbc . DataSourceWrapper dsw2 = new com . taobao . tddl . group . jdbc . DataSourceWrapper ( "db2" , "r" , db2 , com . taobao . tddl . common . model . DBType . MYSQL ) ; dataSourceWrappers . add ( dsw1 ) ; dataSourceWrappers . add ( dsw2 ) ; tgds . init ( dataSourceWrappers ) ; com . taobao . tddl . group . jdbc . TGroupConnection conn = null ; java . sql . Statement stat = null ; try { db1 . setClosed ( true ) ; db2 . setClosed ( false ) ; conn = tgds . getConnection ( ) ; stat = conn . createStatement ( ) ; stat . executeQuery ( "select<sp>1<sp>from<sp>test" ) ; com . taobao . tddl . common . mock . MockDataSource . showTrace ( ) ; "<AssertPlaceHolder>" ; db1 . setClosed ( false ) ; db2 . setClosed ( true ) ; stat = conn . createStatement ( ) ; stat . executeQuery ( "select<sp>2<sp>from<sp>test" ) ; org . junit . Assert . fail ( "" ) ; } catch ( java . sql . SQLException e ) { System . out . println ( e . getMessage ( ) ) ; } finally { if ( conn != null ) { try { conn . close ( ) ; } catch ( java . sql . SQLException e ) { } if ( stat != null ) { try { stat . close ( ) ; } catch ( java . sql . SQLException e ) { } } } } } hasTrace ( java . lang . String , java . lang . String , java . lang . String ) { java . util . List < com . taobao . tddl . common . mock . MockDataSource . ExecuteInfo > trace = com . taobao . tddl . common . mock . MockDataSource . TRACE . get ( ) ; if ( trace != null ) { for ( com . taobao . tddl . common . mock . MockDataSource . ExecuteInfo info : trace ) { if ( ( ( ( ( ( info . sql ) != null ) && ( dbIndex . equals ( info . ds . dbIndex ) ) ) && ( info . ds . name . equals ( dsName ) ) ) && ( ( sqlHead . length ( ) ) <= ( info . sql . length ( ) ) ) ) && ( sqlHead . equalsIgnoreCase ( info . sql . substring ( 0 , sqlHead . length ( ) ) ) ) ) { return true ; } } } return false ; }
|
org . junit . Assert . assertTrue ( com . taobao . tddl . common . mock . MockDataSource . hasTrace ( "db" , "db2" , "select<sp>1<sp>from<sp>test" ) )
|
shouldAllowForZeroNumbersToBeGenerated ( ) { org . neo4j . neode . probabilities . ProbabilityDistribution probabilityDistribution = new org . neo4j . neode . probabilities . BaseUniqueProbabilityDistributionTest . DummyProbabilityDistribution ( ) ; java . util . List < java . lang . Integer > results = probabilityDistribution . generateList ( org . neo4j . neode . Range . minMax ( 0 , 0 ) , org . neo4j . neode . Range . minMax ( 0 , 1 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
|
testCat2Attributes ( ) { org . stringtemplate . v4 . ST e = new org . stringtemplate . v4 . ST ( "<[names,phones];<sp>separator=\",<sp>\">" ) ; e . add ( "names" , "Ter" ) ; e . add ( "names" , "Tom" ) ; e . add ( "phones" , "1" ) ; e . add ( "phones" , "2" ) ; java . lang . String expecting = "Ter,<sp>Tom,<sp>1,<sp>2" ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expecting , e . render ( ) )
|
testApplyTransforms_ra_e_hosshu ( ) { java . util . List < java . lang . Integer > glyphsAfterGsub = java . util . Arrays . asList ( 352 , 108 , 87 , 101 ) ; java . util . List < java . lang . Integer > result = gsubWorkerForBengali . applyTransforms ( getGlyphIds ( "" ) ) ; "<AssertPlaceHolder>" ; } getGlyphIds ( java . lang . String ) { java . util . List < java . lang . Integer > originalGlyphIds = new java . util . ArrayList ( ) ; for ( char unicodeChar : word . toCharArray ( ) ) { int glyphId = cmapLookup . getGlyphId ( unicodeChar ) ; org . junit . Assert . assertTrue ( ( glyphId > 0 ) ) ; originalGlyphIds . add ( glyphId ) ; } return originalGlyphIds ; }
|
org . junit . Assert . assertEquals ( glyphsAfterGsub , result )
|
testValueSetBeforeRead ( ) { org . apache . beam . runners . core . StateTag < org . apache . beam . sdk . state . ValueState < java . lang . String > > addr = org . apache . beam . runners . core . StateTags . value ( "value" , org . apache . beam . sdk . coders . StringUtf8Coder . of ( ) ) ; org . apache . beam . sdk . state . ValueState < java . lang . String > value = underTest . state ( org . apache . beam . runners . dataflow . worker . WindmillStateInternalsTest . NAMESPACE , addr ) ; value . write ( "Hello" ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verifyNoMoreInteractions ( mockReader ) ; } read ( ) { return read ( ( ( byte [ ] ) ( null ) ) , ( ( byte [ ] ) ( null ) ) ) ; }
|
org . junit . Assert . assertEquals ( "Hello" , value . read ( ) )
|
testCreateDatabaseConnectionConnectionPoolingProperties ( ) { "<AssertPlaceHolder>" ; } createDatabaseConnectionConnectionPoolingProperties ( ) { return new org . pentaho . platform . plugin . services . importexport . exportManifest . bindings . DatabaseConnection . ConnectionPoolingProperties ( ) ; }
|
org . junit . Assert . assertNotNull ( factory . createDatabaseConnectionConnectionPoolingProperties ( ) )
|
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . kernel . model . UserIdMapper > userIdMappers = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( userIdMappers . isEmpty ( ) )
|
testAddGetBlackSheep ( ) { it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . BoardStatus bs = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . BoardStatus ( 0 ) ; it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . BlackSheep black = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . BlackSheep ( null ) ; black . setID ( ) ; bs . addBlackSheepToBoardStatus ( black ) ; "<AssertPlaceHolder>" ; } getBlackSheep ( ) { return blackSheep ; }
|
org . junit . Assert . assertEquals ( black , bs . getBlackSheep ( ) )
|
testCreateMaxDimensionNoOriontation ( ) { com . mortennobel . imagescaling . DimensionConstrain . DimensionConstrain constains = createMaxDimensionNoOrientation ( 200 , 100 ) ; com . mortennobel . imagescaling . Dimension res = constains . getDimension ( new com . mortennobel . imagescaling . Dimension ( 400 , 400 ) ) ; "<AssertPlaceHolder>" ; } createMaxDimensionNoOrientation ( int , int ) { return com . mortennobel . imagescaling . DimensionConstrain . createMaxDimensionNoOrientation ( length1 , length2 , false ) ; }
|
org . junit . Assert . assertEquals ( new com . mortennobel . imagescaling . Dimension ( 100 , 100 ) , res )
|
testQuoteSyntaxIsEscaped ( ) { typeText ( "><sp>1" ) ; switchToSource ( ) ; switchToWysiwyg ( ) ; "<AssertPlaceHolder>" ; } getRichTextArea ( ) { org . openqa . selenium . WebDriver driver = getDriver ( ) ; return new org . xwiki . test . wysiwyg . framework . RichTextAreaElement ( driver , driver . findElement ( org . openqa . selenium . By . className ( "gwt-RichTextArea" ) ) ) ; }
|
org . junit . Assert . assertEquals ( "><sp>1" , getRichTextArea ( ) . getText ( ) )
|
shouldInjectService ( ) { final roboguice . inject . ExtrasListenerTest . MyRoboService s1 = new roboguice . inject . ExtrasListenerTest . MyRoboService ( ) ; try { s1 . onCreate ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } fail ( ) { throw new java . lang . ClassCastException ( ( "whoops,<sp>failure<sp>#" + ( ++ ( failures ) ) ) ) ; }
|
org . junit . Assert . assertTrue ( true )
|
sendReturnsBody ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsConnection , java . net . URL ) { final com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod httpsMethod = com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod . GET ; final byte [ ] requestBody = new byte [ 0 ] ; final byte [ ] responseBody = new byte [ ] { 1 , 2 , 3 , 0 , 4 } ; new tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . NonStrictExpectations ( ) { { mockUrl . getProtocol ( ) ; result = "https" ; mockConn . readInput ( ) ; result = responseBody ; mockConn . getResponseStatus ( ) ; result = 200 ; } } ; com . microsoft . azure . sdk . iot . device . transport . https . HttpsRequest request = new com . microsoft . azure . sdk . iot . device . transport . https . HttpsRequest ( mockUrl , httpsMethod , requestBody , "" ) ; com . microsoft . azure . sdk . iot . device . transport . https . HttpsResponse response = request . send ( ) ; byte [ ] testBody = response . getBody ( ) ; final byte [ ] expectedBody = responseBody ; "<AssertPlaceHolder>" ; } getBody ( ) { return java . util . Arrays . copyOf ( this . body , this . body . length ) ; }
|
org . junit . Assert . assertThat ( testBody , org . hamcrest . CoreMatchers . is ( expectedBody ) )
|
testParser ( ) { "<AssertPlaceHolder>" ; org . antlr . runtime . ANTLRInputStream input = new org . antlr . runtime . ANTLRInputStream ( eu . sqooss . parsers . python . PythonParserTest . in ) ; eu . sqooss . parsers . python . PythonLexer lexer = new eu . sqooss . parsers . python . PythonLexer ( input ) ; org . antlr . runtime . CommonTokenStream tokens = new org . antlr . runtime . CommonTokenStream ( lexer ) ; eu . sqooss . parsers . python . PythonParser parser = new eu . sqooss . parsers . python . PythonParser ( tokens ) ; parser . file_input ( ) ; System . out . println ( ( ( ( ( ( ( ( lexer . getLine ( ) ) + ":" ) + ( lexer . commentLines . size ( ) ) ) + ":" ) + ( lexer . mixedCodeCommentLines . size ( ) ) ) + ":" ) + ( lexer . wsLines . size ( ) ) ) ) ; }
|
org . junit . Assert . assertNotNull ( eu . sqooss . parsers . python . PythonParserTest . in )
|
testSerialization2 ( ) { org . jfree . chart . plot . MeterPlot p1 = new org . jfree . chart . plot . MeterPlot ( new org . jfree . data . general . DefaultValueDataset ( 1.23 ) ) ; org . jfree . chart . plot . MeterPlot p2 = ( ( org . jfree . chart . plot . MeterPlot ) ( org . jfree . chart . TestUtilities . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( p1 , p2 )
|
testBuildWithDisabledSecurityConstraint ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . person . type . PersonType context = new org . lnu . is . domain . person . type . PersonType ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>PersonType<sp>e<sp>WHERE<sp>e.status=:status<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . person . type . PersonType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testGetMatchPositions ( ) { for ( edu . illinois . cs . cogcomp . core . datastructures . trees . Tree < java . lang . String > p : foundPatterns ) { edu . illinois . cs . cogcomp . core . algorithms . TreeGrep < java . lang . String > matcher = new edu . illinois . cs . cogcomp . core . algorithms . TreeGrep ( p ) ; boolean result = matcher . matches ( tree ) ; "<AssertPlaceHolder>" ; } } matches ( edu . illinois . cs . cogcomp . core . datastructures . trees . Tree ) { boolean found = false ; matchesList = new java . util . ArrayList ( ) ; for ( edu . illinois . cs . cogcomp . core . datastructures . trees . Tree < T > node : edu . illinois . cs . cogcomp . core . datastructures . trees . TreeTraversal . breadthFirstTraversal ( tree ) ) { if ( verbose ) { edu . illinois . cs . cogcomp . core . algorithms . TreeGrep . logger . info ( "Comparing<sp>node:<sp>" ) ; edu . illinois . cs . cogcomp . core . algorithms . TreeGrep . logger . info ( node . toString ( ) ) ; } nodeTreeMatches = new java . util . ArrayList ( ) ; nodeTreeMatches = doesNodeMatchPattern ( node , getPattern ( ) , nodeTreeMatches ) ; if ( ( nodeTreeMatches . size ( ) ) > 0 ) { if ( verbose ) { edu . illinois . cs . cogcomp . core . algorithms . TreeGrep . logger . info ( "Found..." ) ; } matchesList . addAll ( nodeTreeMatches ) ; found = true ; } } return found ; }
|
org . junit . Assert . assertEquals ( true , result )
|
presetSocketKeepAlive ( ) { boolean keepAlive = ! ( DocumentNodeStoreService . DEFAULT_SO_KEEP_ALIVE ) ; addConfigurationEntry ( preset , "socketKeepAlive" , keepAlive ) ; org . apache . jackrabbit . oak . plugins . document . Configuration config = createConfiguration ( ) ; "<AssertPlaceHolder>" ; } socketKeepAlive ( ) { org . junit . Assume . assumeTrue ( org . apache . jackrabbit . oak . plugins . document . MongoUtils . isAvailable ( ) ) ; com . mongodb . MongoClientOptions . Builder options = org . apache . jackrabbit . oak . plugins . document . util . MongoConnection . getDefaultBuilder ( ) ; options . socketKeepAlive ( false ) ; org . apache . jackrabbit . oak . plugins . document . util . MongoConnection c = new org . apache . jackrabbit . oak . plugins . document . util . MongoConnection ( org . apache . jackrabbit . oak . plugins . document . MongoUtils . URL , options ) ; try { org . junit . Assert . assertFalse ( c . getMongoClient ( ) . getMongoClientOptions ( ) . isSocketKeepAlive ( ) ) ; } finally { c . close ( ) ; } c = new org . apache . jackrabbit . oak . plugins . document . util . MongoConnection ( org . apache . jackrabbit . oak . plugins . document . MongoUtils . URL ) ; try { org . junit . Assert . assertTrue ( c . getMongoClient ( ) . getMongoClientOptions ( ) . isSocketKeepAlive ( ) ) ; } finally { c . close ( ) ; } }
|
org . junit . Assert . assertEquals ( keepAlive , config . socketKeepAlive ( ) )
|
defaultResetToNice ( ) { org . easymock . tests . IMethods mock = createMock ( org . easymock . tests . IMethods . class ) ; expect ( mock . oneArg ( true ) ) . andReturn ( "foo" ) ; replay ( mock ) ; resetToNice ( mock ) ; replay ( mock ) ; "<AssertPlaceHolder>" ; verify ( mock ) ; } replay ( java . lang . Object [ ] ) { for ( int i = 0 ; i < ( mocks . length ) ; i ++ ) { try { org . easymock . EasyMock . getControl ( mocks [ i ] ) . replay ( ) ; } catch ( java . lang . RuntimeException e ) { throw org . easymock . EasyMock . getRuntimeException ( mocks . length , i , e ) ; } catch ( java . lang . AssertionError e ) { throw org . easymock . EasyMock . getAssertionError ( mocks . length , i , e ) ; } } }
|
org . junit . Assert . assertNull ( mock . oneArg ( true ) )
|
testShouldNotConsiderNonPublicConstructors ( ) { com . picocontainer . DefaultPicoContainer pico = new com . picocontainer . DefaultPicoContainer ( new com . picocontainer . injectors . ConstructorInjection ( ) ) ; pico . addComponent ( com . picocontainer . injectors . ConstructorInjectorTestCase . Component201 . class ) ; pico . addComponent ( new java . lang . Integer ( 2 ) ) ; pico . addComponent ( Boolean . TRUE ) ; pico . addComponent ( "Hello" ) ; "<AssertPlaceHolder>" ; } getComponent ( java . lang . Class ) { checkReadPermission ( ) ; return pico . getComponent ( componentType ) ; }
|
org . junit . Assert . assertNotNull ( pico . getComponent ( com . picocontainer . injectors . ConstructorInjectorTestCase . Component201 . class ) )
|
testHashCode ( ) { org . jfree . data . function . PolynomialFunction2D f1 = new org . jfree . data . function . PolynomialFunction2D ( new double [ ] { 1.0 , 2.0 } ) ; org . jfree . data . function . PolynomialFunction2D f2 = new org . jfree . data . function . PolynomialFunction2D ( new double [ ] { 1.0 , 2.0 } ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return getUuid ( ) . hashCode ( ) ; }
|
org . junit . Assert . assertEquals ( f1 . hashCode ( ) , f2 . hashCode ( ) )
|
testRelatedItemIndexingMessage ( ) { java . lang . System . setProperty ( org . greencheek . related . api . indexing . PROPNAME_MAX_NO_OF_RELATED_ITEMS_PER_INDEX_REQUEST , "2" ) ; org . greencheek . related . util . config . Configuration config = new org . greencheek . related . util . config . SystemPropertiesConfiguration ( ) ; org . greencheek . related . api . indexing . RelatedItemIndexingMessageFactory factory = new org . greencheek . related . api . indexing . RelatedItemIndexingMessageFactory ( config ) ; org . greencheek . related . api . indexing . RelatedItemIndexingMessage message = factory . newInstance ( ) ; "<AssertPlaceHolder>" ; } getMaxNumberOfRelatedItemsAllowed ( ) { return this . relatedItems . getMaxNumberOfRelatedItems ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , message . getMaxNumberOfRelatedItemsAllowed ( ) )
|
testProcessSong ( ) { java . lang . String testDate = "1990" ; org . bff . javampd . processor . DateTagProcessor dateTagProcessor = new org . bff . javampd . processor . DateTagProcessor ( ) ; org . bff . javampd . song . MPDSong song = new org . bff . javampd . song . MPDSong ( "testFile" , "testName" ) ; java . lang . String line = "Date:" + testDate ; dateTagProcessor . processTag ( song , line ) ; "<AssertPlaceHolder>" ; } getYear ( ) { return year ; }
|
org . junit . Assert . assertEquals ( testDate , song . getYear ( ) )
|
testApplyType ( ) { when ( rs . getString ( 1 ) ) . thenReturn ( "tester" ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Class , java . lang . Object ) { return null ; }
|
org . junit . Assert . assertEquals ( java . lang . String . class , handler . apply ( rs , 1 ) . getClass ( ) )
|
testUpload ( ) { com . ning . http . client . AsyncHttpClientConfig . Builder configBuilder = new com . ning . http . client . AsyncHttpClientConfig . Builder ( ) ; final com . ning . http . client . AsyncHttpClient asyncHttpClient = new com . ning . http . client . AsyncHttpClient ( new com . ning . http . client . providers . netty . NettyAsyncHttpProvider ( configBuilder . build ( ) ) , configBuilder . build ( ) ) ; byte [ ] requestBody = generatePostData ( ) ; final com . ning . http . client . Request request = new com . ning . http . client . RequestBuilder ( "POST" ) . setUrl ( resolveURI ( "/v1/upload" ) ) . setContentLength ( requestBody . length ) . setBody ( new io . cdap . cdap . gateway . router . NettyRouterTestBase . ByteEntityWriter ( requestBody ) ) . build ( ) ; final java . io . ByteArrayOutputStream byteArrayOutputStream = new java . io . ByteArrayOutputStream ( ) ; java . util . concurrent . Future < java . lang . Void > future = asyncHttpClient . executeRequest ( request , new com . ning . http . client . AsyncCompletionHandler < java . lang . Void > ( ) { @ io . cdap . cdap . gateway . router . Override public io . cdap . cdap . gateway . router . Void onCompleted ( com . ning . http . client . Response response ) { return null ; } @ io . cdap . cdap . gateway . router . Override public io . cdap . cdap . gateway . router . STATE onBodyPartReceived ( com . ning . http . client . HttpResponseBodyPart content ) throws io . cdap . cdap . gateway . router . Exception { content . writeTo ( byteArrayOutputStream ) ; return super . onBodyPartReceived ( content ) ; } } ) ; future . get ( ) ; "<AssertPlaceHolder>" ; } toByteArray ( ) { return java . util . Arrays . copyOf ( hash , hash . length ) ; }
|
org . junit . Assert . assertArrayEquals ( requestBody , byteArrayOutputStream . toByteArray ( ) )
|
addResolver_single ( ) { com . redhat . lightblue . util . DefaultRegistry < K , V > registery = createRegistery ( ) ; final K key = createKey ( ) ; final V value = createValue ( ) ; com . redhat . lightblue . util . Resolver < K , V > resolver = new com . redhat . lightblue . util . Resolver < K , V > ( ) { @ com . redhat . lightblue . util . Override public V find ( K name ) { if ( key . equals ( name ) ) { return value ; } return null ; } } ; registery . add ( resolver ) ; V found = registery . find ( key ) ; "<AssertPlaceHolder>" ; } find ( com . redhat . lightblue . crud . FindRequest ) { com . redhat . lightblue . mediator . Mediator . LOGGER . debug ( "find<sp>{}" , req . getEntityVersion ( ) ) ; com . redhat . lightblue . util . Error . push ( ( ( "find(" + ( req . getEntityVersion ( ) . toString ( ) ) ) + ")" ) ) ; com . redhat . lightblue . mediator . OperationContext ctx = null ; com . redhat . lightblue . Response response = new com . redhat . lightblue . Response ( factory . getNodeFactory ( ) , com . redhat . lightblue . OperationStatus . ERROR ) ; try { ctx = newCtx ( req , CRUDOperation . FIND ) ; ctx . measure . begin ( "find" ) ; com . redhat . lightblue . mediator . StreamingResponse r = _findAndStream ( req , ctx ) ; response = new com . redhat . lightblue . Response ( r ) ; if ( ( ( response . getErrors ( ) ) == null ) || ( response . getErrors ( ) . isEmpty ( ) ) ) { com . redhat . lightblue . crud . DocumentStream < com . redhat . lightblue . crud . DocCtx > docStream = r . documentStream ; java . util . List < com . redhat . lightblue . ResultMetadata > rmd = new java . util . ArrayList ( ) ; response . setEntityData ( factory . getNodeFactory ( ) . arrayNode ( ) ) ; response . setResultSizeThresholds ( factory . getMaxResultSetSizeForReadsB ( ) , factory . getWarnResultSetSizeB ( ) , req ) ; for ( ; docStream . hasNext ( ) ; ) { com . redhat . lightblue . crud . DocCtx doc = docStream . next ( ) ; if ( ! ( doc . hasErrors ( ) ) ) { response . addEntityData ( doc . getOutputDocument ( ) . getRoot ( ) ) ; rmd . add ( doc . getResultMetadata ( ) ) ; } else { com . redhat . lightblue . DataError error = doc . getDataError ( ) ; if ( error != null ) response . getDataErrors ( ) . add ( error ) ; } } docStream . close ( ) ; response . setResultMetadata ( rmd ) ; response . setMatchCount ( ( ( r . matchCount ) == null ? 0 : r . matchCount ) ) ; com . redhat . lightblue . mediator . Mediator . LOGGER . debug ( "responseMemoryUsed={}<sp>request={}" , response . getResponseDataSizeB ( ) , req ) ; } } catch ( com . redhat . lightblue . util . Error e ) { com . redhat . lightblue . mediator . Mediator . LOGGER . debug ( "Error<sp>during<sp>find:{}" , e ) ; response . getErrors ( ) . add ( e ) ; } catch ( java . lang . Exception e ) { com . redhat . lightblue . mediator . Mediator . LOGGER . debug ( "Exception<sp>during<sp>find:{}" , e ) ; response . getErrors ( ) . add ( com . redhat . lightblue . util . Error . get ( CrudConstants . ERR_CRUD , e ) ) ; } finally { if ( ctx != null ) { ctx . measure . end ( "find" ) ; com . redhat . lightblue . mediator . Mediator . METRICS . debug ( "find:<sp>{}" , ctx . measure ) ; } com . redhat . lightblue . util . Error . pop ( ) ; } return response ; }
|
org . junit . Assert . assertEquals ( value , found )
|
testPutKnowledgeBaseArticleMyRating ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testStappenVerwerking ( ) { final nl . bzk . brp . levering . mutatielevering . stappen . context . AdministratieveHandelingVerwerkingResultaat administratieveHandelingVerwerkingResultaat = administratieveHandelingStappenVerwerker . verwerk ( administratieveHandelingMutatie , administratieveHandelingVerwerkingContext ) ; "<AssertPlaceHolder>" ; } isSuccesvol ( ) { return succesvol ; }
|
org . junit . Assert . assertEquals ( administratieveHandelingVerwerkingResultaat . isSuccesvol ( ) , true )
|
testSetSubject ( ) { doReturn ( ExchangeVersion . Exchange2010_SP2 ) . when ( exchangeService ) . getRequestedServerVersion ( ) ; microsoft . exchange . webservices . data . core . service . item . Appointment appointment = new microsoft . exchange . webservices . data . core . service . item . Appointment ( exchangeService ) ; final java . lang . String subject = "Lorem<sp>Ipsum" ; appointment . setSubject ( subject ) ; "<AssertPlaceHolder>" ; } getSubject ( ) { return subject ; }
|
org . junit . Assert . assertThat ( appointment . getSubject ( ) , org . hamcrest . core . Is . is ( org . hamcrest . Matchers . equalTo ( subject ) ) )
|
toAmazonS3URISchemeIsS3nUppercase ( ) { com . amazonaws . services . s3 . AmazonS3URI result = com . hotels . bdp . circustrain . s3s3copier . aws . AmazonS3URIs . toAmazonS3URI ( new java . net . URI ( "S3N://a/b" ) ) ; com . amazonaws . services . s3 . AmazonS3URI expected = new com . amazonaws . services . s3 . AmazonS3URI ( "s3://a/b" ) ; "<AssertPlaceHolder>" ; } toAmazonS3URI ( java . net . URI ) { if ( com . hotels . bdp . circustrain . s3s3copier . aws . FS_PROTOCOL_S3 . equalsIgnoreCase ( uri . getScheme ( ) ) ) { return new com . amazonaws . services . s3 . AmazonS3URI ( uri ) ; } else if ( com . hotels . bdp . circustrain . aws . S3Schemes . isS3Scheme ( uri . getScheme ( ) ) ) { try { return new com . amazonaws . services . s3 . AmazonS3URI ( new java . net . URI ( FS_PROTOCOL_S3 , uri . getUserInfo ( ) , uri . getHost ( ) , uri . getPort ( ) , uri . getPath ( ) , uri . getQuery ( ) , uri . getFragment ( ) ) ) ; } catch ( java . net . URISyntaxException e ) { } } return new com . amazonaws . services . s3 . AmazonS3URI ( uri ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( expected ) )
|
testToMap ( ) { instance . add ( "name1" , "value1" ) ; instance . add ( "name1" , "value2" ) ; instance . add ( "name2" , "value1" ) ; java . util . Map < java . lang . String , java . lang . String > map = instance . toMap ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return pairs . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , map . size ( ) )
|
testReadBlockGroupNormalMultiBlocks ( ) { byte [ ] content = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 } ; com . geekhua . filequeue . datastore . BlockGroup blockGroup = com . geekhua . filequeue . datastore . BlockGroup . allocate ( content . length , 10 ) ; blockGroup . setContent ( content ) ; java . io . RandomAccessFile file = getFile ( ) ; file . write ( blockGroup . array ( ) ) ; file . seek ( 0 ) ; com . geekhua . filequeue . datastore . BlockGroup readBlockGroup = com . geekhua . filequeue . datastore . BlockGroup . read ( file , 10 ) ; "<AssertPlaceHolder>" ; file . close ( ) ; } getContent ( ) { return content ; }
|
org . junit . Assert . assertArrayEquals ( content , readBlockGroup . getContent ( ) )
|
testGetId ( ) { es . usc . citius . composit . core . model . impl . ResourceComponent testResource = new es . usc . citius . composit . core . model . impl . ResourceComponent ( "test" ) ; "<AssertPlaceHolder>" ; } getID ( ) { return id ; }
|
org . junit . Assert . assertEquals ( "test" , testResource . getID ( ) )
|
correctNodeIdShouldBeReturned ( ) { when ( mockDegreeCachingStrategy . readDegrees ( mockNode , com . graphaware . module . relcount . cache . DegreeCachingNodeTest . TEST_PREFIX ) ) . thenReturn ( com . graphaware . module . relcount . cache . Collections . < com . graphaware . common . description . relationship . DetachedRelationshipDescription , java . lang . Integer > emptyMap ( ) ) ; when ( mockNode . getId ( ) ) . thenReturn ( 123L ) ; com . graphaware . module . relcount . cache . DegreeCachingNode cachingNode = new com . graphaware . module . relcount . cache . DegreeCachingNode ( mockNode , com . graphaware . module . relcount . cache . DegreeCachingNodeTest . TEST_PREFIX , mockStrategies ) ; "<AssertPlaceHolder>" ; verify ( mockDegreeCachingStrategy ) . readDegrees ( mockNode , com . graphaware . module . relcount . cache . DegreeCachingNodeTest . TEST_PREFIX ) ; verify ( mockStrategies ) . getDegreeCachingStrategy ( ) ; verify ( mockNode ) . getId ( ) ; verifyNoMoreInteractions ( mockDegreeCachingStrategy , mockCompactionStrategy , mockNode , mockStrategies ) ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( 123L , cachingNode . getId ( ) )
|
initialize_list_java ( ) { java . util . List < java . lang . String > cheeses = new java . util . ArrayList < java . lang . String > ( ) ; cheeses . add ( "Munster" ) ; cheeses . add ( "Swiss" ) ; cheeses . add ( "Sharp<sp>cheddar" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 3 , cheeses . size ( ) )
|
testSTOP_1 ( ) { org . ethereum . vm . VM vm = new org . ethereum . vm . VM ( ) ; program = new org . ethereum . vm . Program ( org . spongycastle . util . encoders . Hex . decode ( "60206030601060306011602300" ) , invoke ) ; int expectedSteps = 7 ; int i = 0 ; while ( ! ( program . isStopped ( ) ) ) { vm . step ( program ) ; ++ i ; } "<AssertPlaceHolder>" ; } step ( org . ethereum . vm . Program ) { program . fullTrace ( ) ; if ( org . ethereum . vm . CONFIG . vmTrace ( ) ) program . saveOpTrace ( ) ; try { org . ethereum . vm . OpCode op = org . ethereum . vm . OpCode . code ( program . getCurrentOp ( ) ) ; if ( op == null ) throw program . new org . ethereum . vm . IllegalOperationException ( ) ; program . setLastOp ( op . val ( ) ) ; long oldMemSize = program . getMemSize ( ) ; java . math . BigInteger newMemSize = java . math . BigInteger . ZERO ; java . util . Stack < org . ethereum . vm . DataWord > stack = program . getStack ( ) ; java . lang . String hint = "code:<sp>" 6 ; long callGas = 0 ; long memWords = 0 ; long gasCost = GasCost . STEP ; long gasBefore = program . getGas ( ) . longValue ( ) ; int stepBefore = program . getPC ( ) ; program . stackRequire ( op . require ( ) ) ; switch ( op ) { case STOP : case SUICIDE : gasCost = GasCost . STOP ; break ; case SSTORE : org . ethereum . vm . DataWord newValue = stack . get ( ( ( stack . size ( ) ) - 2 ) ) ; org . ethereum . vm . DataWord oldValue = program . storageLoad ( stack . peek ( ) ) ; if ( ( oldValue == null ) && ( ! ( newValue . isZero ( ) ) ) ) gasCost = ( GasCost . SSTORE ) * 2 ; else if ( ( oldValue != null ) && ( newValue . isZero ( ) ) ) gasCost = ( GasCost . SSTORE ) * 0 ; else gasCost = GasCost . SSTORE ; break ; case SLOAD : gasCost = GasCost . SLOAD ; break ; case BALANCE : gasCost = GasCost . BALANCE ; break ; case MSTORE : newMemSize = memNeeded ( stack . peek ( ) , new org . ethereum . vm . DataWord ( 32 ) ) ; break ; case MSTORE8 : newMemSize = memNeeded ( stack . peek ( ) , new org . ethereum . vm . DataWord ( 1 ) ) ; break ; case MLOAD : newMemSize = memNeeded ( stack . peek ( ) , new org . ethereum . vm . DataWord ( 32 ) ) ; break ; case RETURN : newMemSize = memNeeded ( stack . peek ( ) , stack . get ( ( ( stack . size ( ) ) - 2 ) ) ) ; break ; case SHA3 : gasCost = GasCost . SHA3 ; newMemSize = memNeeded ( stack . peek ( ) , stack . get ( ( ( stack . size ( ) ) - 2 ) ) ) ; break ; case CALLDATACOPY : newMemSize = memNeeded ( stack . peek ( ) , stack . get ( ( ( stack . size ( ) ) - 3 ) ) ) ; break ; case CODECOPY : newMemSize = memNeeded ( stack . peek ( ) , stack . get ( ( ( stack . size ( ) ) - 3 ) ) ) ; break ; case EXTCODECOPY : newMemSize = memNeeded ( stack . get ( ( ( stack . size ( ) ) - 2 ) ) , stack . get ( ( ( stack . size ( ) ) - 4 ) ) ) ; break ; case org . ethereum . vm . OpCode . CALL : case CALLCODE : gasCost = GasCost . CALL ; org . ethereum . vm . DataWord callGasWord = stack . get ( ( ( stack . size ( ) ) - 1 ) ) ; if ( ( callGasWord . compareTo ( program . getGas ( ) ) ) == 1 ) { throw program . new org . ethereum . vm . Program . OutOfGasException ( ) ; } callGas = callGasWord . longValue ( ) ; java . math . BigInteger in = memNeeded ( stack . get ( ( ( stack . size ( ) ) - 4 ) ) , stack . get ( ( ( stack . size ( ) ) - 5 ) ) ) ; java . math . BigInteger out = memNeeded ( stack . get ( ( ( stack . size ( ) ) - 6 ) ) , stack . get ( ( ( stack . size ( ) ) - 7 ) ) ) ; newMemSize = in . max ( out ) ; break ; case org . ethereum . vm . OpCode . CREATE : gasCost = GasCost . CREATE ; newMemSize = memNeeded ( stack . get ( ( ( stack . size ( ) ) - 2 ) ) , stack . get ( ( ( stack . size ( ) ) - 3 ) ) ) ; break ; default : break ; } program . spendGas ( gasCost , op . name ( ) ) ; if ( ( newMemSize . compareTo ( org . ethereum . vm . VM . MAX_GAS ) ) == 1 ) { throw program
|
org . junit . Assert . assertEquals ( expectedSteps , i )
|
testSearch ( ) { doReturn ( com . google . common . collect . ImmutableSet . of ( com . olacabs . fabric . manager . service . ComponentServiceTest . component ) ) . when ( com . olacabs . fabric . manager . service . ComponentServiceTest . componentDAO ) . search ( anyString ( ) , anyString ( ) , anyString ( ) ) ; final java . util . Set < com . olacabs . fabric . manager . domain . ComponentDomain > result = com . olacabs . fabric . manager . service . ComponentServiceTest . componentService . search ( "test" , "test" , "test" ) ; "<AssertPlaceHolder>" ; doReturn ( com . google . common . collect . ImmutableSet . of ( ) ) . when ( com . olacabs . fabric . manager . service . ComponentServiceTest . componentDAO ) . search ( anyString ( ) , anyString ( ) , anyString ( ) ) ; } search ( java . lang . String , java . lang . String , java . lang . String ) { return componentDAO . search ( namespace , name , version ) ; }
|
org . junit . Assert . assertTrue ( ( ( result . size ( ) ) == 1 ) )
|
longToString ( ) { random . init ( ) ; java . lang . String [ ] results = new java . lang . String [ ] { "2c" 7 , "2a" 6 , "1g" 8 , "y" 0 , "1g" 0 , "12" 2 , "2c" 2 , "21" 9 , "12" 3 , "1l" 1 , "12" 8 , "1g" 3 , "1t" 7 , "21" 0 , "16" 2 , "16" 6 , "1t" 0 , "2a" 4 , "1t" 1 , "12" 4 , "21" 8 , "y" 1 , "16" 7 , "2a" 1 , "12" 0 , "1g" 6 , "1g" 4 , "12" 1 , "1t" 5 , "2c" 6 , "12" 7 , "2c" 3 , "16" 0 , "1t" 4 , "y" , "1l" 2 , "y" 3 , "12" 6 , "12" , "1t" 8 , "y" 7 , "y" 9 , "16" , "16" 3 , "2a" 5 , "1g" 5 , "2a" 2 , "1l" 3 , "21" 7 , "16" 9 , "1l" 0 , "2c" 8 , "1g" , "1t" 6 , "y" 6 , "21" 1 , "21" 2 , "1l" , "21" 6 , "16" 8 , "2c" 4 , "2a" 8 , "1l" 7 , "1t" 3 , "1l" 8 , "1t" , "12" 9 , "16" 5 , "1g" 1 , "1g" 9 , "1t" 2 , "16" 1 , "2a" 9 , "21" , "y" 5 , "16" 4 , "2c" 1 , "1g" 7 , "y" 8 , "1l" 9 , "21" 4 , "1t" 9 , "2a" , "21" 3 , "2c" , "y" 4 , "1l" 6 , "21" 5 , "2a" 3 , "2a" 7 , "1l" 5 , "1g" 2 , "2c" 9 , "y" 2 , "1l" 4 , "2c" 5 , "12" 5 , "2c" 0 , "2q" , "2a" 0 } ; for ( int i = 0 ; i < ( results . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } longToString ( long ) { if ( longValue == 0 ) { return java . lang . String . valueOf ( chars [ 0 ] ) ; } if ( longValue < 0 ) { longValue = - longValue ; } java . lang . StringBuilder strValue = new java . lang . StringBuilder ( ) ; while ( longValue != 0 ) { int digit = ( ( int ) ( longValue % ( radix ) ) ) ; longValue = longValue / ( radix ) ; strValue . append ( chars [ digit ] ) ; } return strValue . reverse ( ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( results [ i ] , random . longToString ( i ) )
|
testFindUnsubmittedOcanForms ( ) { int facilityId1 = 100 ; int facilityId2 = 200 ; java . lang . String assessmentStatus1 = "Completed" ; java . lang . String assessmentStatus2 = "NotCompleted" ; int submissionId1 = 0 ; int submissionId2 = 1 ; int clientId1 = 111 ; int clientId2 = 222 ; int assessmentId1 = 101 ; int assessmentId2 = 202 ; int assessmentId3 = 303 ; int assessmentId4 = 404 ; java . util . Date created1 = new java . util . Date ( dfm . parse ( "20100110" ) . getTime ( ) ) ; java . util . Date created2 = new java . util . Date ( dfm . parse ( "20121110" ) . getTime ( ) ) ; java . util . Date created3 = new java . util . Date ( dfm . parse ( "20130410" ) . getTime ( ) ) ; java . util . Date created4 = new java . util . Date ( dfm . parse ( "20111020" ) . getTime ( ) ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm1 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm1 ) ; ocanStaffForm1 . setFacilityId ( facilityId1 ) ; ocanStaffForm1 . setAssessmentStatus ( assessmentStatus1 ) ; ocanStaffForm1 . setSubmissionId ( submissionId1 ) ; ocanStaffForm1 . setClientId ( clientId1 ) ; ocanStaffForm1 . setAssessmentId ( assessmentId1 ) ; ocanStaffForm1 . setCreated ( created1 ) ; dao . persist ( ocanStaffForm1 ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm2 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm2 ) ; ocanStaffForm2 . setFacilityId ( facilityId2 ) ; ocanStaffForm2 . setAssessmentStatus ( assessmentStatus2 ) ; ocanStaffForm2 . setSubmissionId ( submissionId2 ) ; ocanStaffForm2 . setClientId ( clientId2 ) ; ocanStaffForm2 . setAssessmentId ( assessmentId2 ) ; ocanStaffForm2 . setCreated ( created2 ) ; dao . persist ( ocanStaffForm2 ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm3 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm3 ) ; ocanStaffForm3 . setFacilityId ( facilityId1 ) ; ocanStaffForm3 . setAssessmentStatus ( assessmentStatus1 ) ; ocanStaffForm3 . setSubmissionId ( submissionId1 ) ; ocanStaffForm3 . setClientId ( clientId1 ) ; ocanStaffForm3 . setAssessmentId ( assessmentId3 ) ; ocanStaffForm3 . setCreated ( created3 ) ; dao . persist ( ocanStaffForm3 ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm4 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm4 ) ; ocanStaffForm4 . setFacilityId ( facilityId2 ) ; ocanStaffForm4 . setAssessmentStatus ( assessmentStatus1 ) ; ocanStaffForm4 . setSubmissionId ( submissionId2 ) ; ocanStaffForm4 . setClientId ( clientId1 ) ; ocanStaffForm4 . setAssessmentId ( assessmentId4 ) ; ocanStaffForm4 . setCreated ( created4 ) ; dao . persist ( ocanStaffForm4 ) ; java . util . List < org . oscarehr . common . model . OcanStaffForm > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . OcanStaffForm > ( java . util . Arrays . asList ( ocanStaffForm3 , ocanStaffForm1 ) ) ; java . util . List < org . oscarehr . common . model . OcanStaffForm > result = dao . findUnsubmittedOcanForms ( facilityId1 ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( ( "Array<sp>sizes<sp>do<sp>not<sp>match.<sp>Result:<sp>" + ( result . size ( ) ) ) ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
|
org . junit . Assert . assertTrue ( true )
|
testQueryByMessageIdAndCheckPrecedence ( ) { messageId = "urn:uuid%" ; outcome = 0 ; responseList = gov . hhs . fha . nhinc . auditrepository . hibernate . AuditRepositoryDAOTest . auditLogDao . queryAuditRecords ( messageId , relatesTo ) ; "<AssertPlaceHolder>" ; } queryAuditRecords ( java . lang . String , java . lang . String ) { org . hibernate . Session session = null ; java . util . List < gov . hhs . fha . nhinc . auditrepository . hibernate . AuditRepositoryRecord > queryList = null ; try { session = getSession ( ) ; gov . hhs . fha . nhinc . auditrepository . hibernate . AuditRepositoryDAO . LOG . info ( "Getting<sp>Record<sp>for<sp>Audit<sp>Viewer<sp>" ) ; if ( session != null ) { final org . hibernate . Criteria queryCriteria = session . createCriteria ( gov . hhs . fha . nhinc . auditrepository . hibernate . AuditRepositoryRecord . class ) ; boolean idHasPrefix = ( gov . hhs . fha . nhinc . nhinclib . NullChecker . isNotNullish ( messageId ) ) && ( messageId . startsWith ( NhincConstants . WS_SOAP_HEADER_MESSAGE_ID_PREFIX ) ) ; if ( idHasPrefix ) { queryCriteria . add ( org . hibernate . criterion . Restrictions . eq ( "messageId" , messageId ) ) ; } else if ( gov . hhs . fha . nhinc . nhinclib . NullChecker . isNotNullish ( messageId ) ) { queryCriteria . add ( org . hibernate . criterion . Restrictions . eq ( "messageId" , ( ( gov . hhs . fha . nhinc . nhinclib . NhincConstants . WS_SOAP_HEADER_MESSAGE_ID_PREFIX ) + messageId ) ) ) ; } if ( gov . hhs . fha . nhinc . nhinclib . NullChecker . isNotNullish ( relatesTo ) ) { queryCriteria . add ( org . hibernate . criterion . Restrictions . eq ( "relatesTo" , relatesTo ) ) ; } queryList = queryCriteria . list ( ) ; } } catch ( final org . hibernate . HibernateException e ) { gov . hhs . fha . nhinc . auditrepository . hibernate . AuditRepositoryDAO . LOG . error ( "Exception<sp>in<sp>AuditLog.get()<sp>occurred<sp>due<sp>to<sp>:<sp>{}" , e . getLocalizedMessage ( ) , e ) ; } finally { closeSession ( session ) ; } return queryList ; }
|
org . junit . Assert . assertNotNull ( responseList )
|
testSerialization ( ) { org . jfree . chart . plot . PieLabelRecord p1 = new org . jfree . chart . plot . PieLabelRecord ( "A" , 1.0 , 2.0 , new org . jfree . chart . text . TextBox ( "B" ) , 3.0 , 4.0 , 5.0 ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( p1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . plot . PieLabelRecord p2 = ( ( org . jfree . chart . plot . PieLabelRecord ) ( in . readObject ( ) ) ) ; in . close ( ) ; boolean b = p1 . equals ( p2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == ( this ) ) { return true ; } if ( ! ( obj instanceof org . jfree . data . xy . YWithXInterval ) ) { return false ; } org . jfree . data . xy . YWithXInterval that = ( ( org . jfree . data . xy . YWithXInterval ) ( obj ) ) ; if ( ( this . y ) != ( that . y ) ) { return false ; } if ( ( this . xLow ) != ( that . xLow ) ) { return false ; } if ( ( this . xHigh ) != ( that . xHigh ) ) { return false ; } return true ; }
|
org . junit . Assert . assertTrue ( b )
|
test09DeleteResources ( ) { java . lang . String public_id = "api_,test3" + ( SUFFIX ) ; cloudinary . uploader ( ) . upload ( com . cloudinary . test . SRC_TEST_IMAGE , com . cloudinary . utils . ObjectUtils . asMap ( "public_id" , public_id , "tags" , com . cloudinary . test . AbstractApiTest . UPLOAD_TAGS ) ) ; com . cloudinary . test . Map resource = api . resource ( public_id , com . cloudinary . utils . ObjectUtils . emptyMap ( ) ) ; "<AssertPlaceHolder>" ; api . deleteResources ( com . cloudinary . test . Arrays . asList ( public_id ) , com . cloudinary . utils . ObjectUtils . emptyMap ( ) ) ; api . resource ( public_id , com . cloudinary . utils . ObjectUtils . emptyMap ( ) ) ; } emptyMap ( ) { return Collections . EMPTY_MAP ; }
|
org . junit . Assert . assertNotNull ( resource )
|
appliesToQuery_empty ( ) { "<AssertPlaceHolder>" ; } appliesToQuery ( net . ripe . db . whois . query . query . Query ) { return query . isReturningReferencedObjects ( ) ; }
|
org . junit . Assert . assertThat ( subject . appliesToQuery ( net . ripe . db . whois . query . query . Query . parse ( "foo" ) ) , is ( false ) )
|
testBuildRequestSignatureRsaSha384 ( ) { java . lang . String deflatedEncodedAuthNRequest = com . onelogin . saml2 . util . Util . getFileAsString ( "data/requests/authn_request.xml.deflated.base64" ) ; java . lang . String relayState = "http://example.com" ; java . lang . String signAlgorithm = com . onelogin . saml2 . util . Constants . RSA_SHA384 ; com . onelogin . saml2 . Auth auth = new com . onelogin . saml2 . Auth ( "config/config.certstring.properties" ) ; java . lang . String signature = auth . buildRequestSignature ( deflatedEncodedAuthNRequest , relayState , signAlgorithm ) ; java . lang . String expectedSignature = "rO7eswxuPsk/QPDLaZRHziTx8ndVXMDMfEsJI6ZSQDqVo0ZaHgOJJ8GC8UWcJrGg2qFrsl2mTozMh1Iqi5oBb2GSWTEC/WRAb/qnNi/02yLrLtoop1YfXb7yl0StpXoM0MwWeoPBroEyqdK+qcu2eWSOwrogffepVfcgghtUwo0=" ; "<AssertPlaceHolder>" ; } buildRequestSignature ( java . lang . String , java . lang . String , java . lang . String ) { return buildSignature ( samlRequest , relayState , signAlgorithm , "SAMLRequest" ) ; }
|
org . junit . Assert . assertEquals ( expectedSignature , signature )
|
testExplicitCloseReportsClose ( ) { java . util . concurrent . atomic . AtomicBoolean flag = new java . util . concurrent . atomic . AtomicBoolean ( ) ; try ( com . impossibl . postgres . api . jdbc . PGConnection connection = com . impossibl . postgres . jdbc . TestUtil . openDB ( ) . unwrap ( com . impossibl . postgres . api . jdbc . PGConnection . class ) ) { connection . addNotificationListener ( new com . impossibl . postgres . api . jdbc . PGNotificationListener ( ) { @ com . impossibl . postgres . jdbc . Override public void closed ( ) { flag . set ( true ) ; } } ) ; } "<AssertPlaceHolder>" ; } get ( ) { return this ; }
|
org . junit . Assert . assertTrue ( flag . get ( ) )
|
testSetLocalPhoneAutocomplete ( ) { com . github . bordertech . wcomponents . WSingleSelect field = new com . github . bordertech . wcomponents . WSingleSelect ( ) ; java . lang . String expected = Telephone . LOCAL . getValue ( ) ; field . setLocalPhoneAutocomplete ( ) ; "<AssertPlaceHolder>" ; } getAutocomplete ( ) { return getComponentModel ( ) . autocomplete ; }
|
org . junit . Assert . assertEquals ( expected , field . getAutocomplete ( ) )
|
testHasOthersFalseNull ( ) { com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . data . TriggerContext context = new com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . data . TriggerContext ( ) ; "<AssertPlaceHolder>" ; } hasOthers ( ) { return ( ( others ) != null ) && ( ! ( others . isEmpty ( ) ) ) ; }
|
org . junit . Assert . assertFalse ( context . hasOthers ( ) )
|
test_inverted ( ) { for ( int k = 0 ; k < 1000000 ; k ++ ) { java . math . BigInteger value = java . math . BigInteger . valueOf ( k ) ; "<AssertPlaceHolder>" ; } try { converter . reconvert ( java . math . BigInteger . valueOf ( ( - 1 ) ) ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { } } convert ( long ) { return this . convert ( java . math . BigInteger . valueOf ( value ) ) ; }
|
org . junit . Assert . assertEquals ( value , converter . convert ( converter . reconvert ( value ) ) )
|
testTimeRangeException2DDiscrete ( ) { org . eclipse . tracecompass . statesystem . core . ITmfStateSystem ss = fStateSystem ; "<AssertPlaceHolder>" ; ss . query2D ( java . util . Collections . singleton ( 0 ) , java . util . Collections . singleton ( Long . MIN_VALUE ) ) ; }
|
org . junit . Assert . assertNotNull ( ss )
|
whenAysncRequestShouldReturnOk ( ) { java . util . concurrent . Future < com . mashape . unirest . http . HttpResponse < com . mashape . unirest . http . JsonNode > > future = com . mashape . unirest . http . Unirest . post ( "http://www.mocky.io/v2/5a9ce37b3100004f00ab5154?mocky-delay=10000ms" ) . header ( "accept" , "application/json" ) . asJsonAsync ( new com . mashape . unirest . http . async . Callback < com . mashape . unirest . http . JsonNode > ( ) { public void failed ( com . mashape . unirest . http . exceptions . UnirestException e ) { } public void completed ( com . mashape . unirest . http . HttpResponse < com . mashape . unirest . http . JsonNode > response ) { } public void cancelled ( ) { } } ) ; "<AssertPlaceHolder>" ; } get ( ) { java . lang . StringBuilder stringBuilder = new java . lang . StringBuilder ( ) ; stringBuilder . append ( "Host:<sp>" ) . append ( java . net . InetAddress . getLocalHost ( ) . getHostName ( ) ) . append ( "<br/>" ) ; stringBuilder . append ( "IP:<sp>" ) . append ( java . net . InetAddress . getLocalHost ( ) . getHostAddress ( ) ) . append ( "<br/>" ) ; stringBuilder . append ( "Type:<sp>" ) . append ( "Travel<sp>Agency" ) . append ( "<br/>" ) ; return stringBuilder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( 200 , future . get ( ) . getStatus ( ) )
|
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . change . tracking . model . CTEntryAggregate . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "ctEntryAggregateId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "ctEntryAggregateId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testGetName ( ) { net . holmes . core . backend . response . ConfigurationFolder folder = new net . holmes . core . backend . response . ConfigurationFolder ( "id" , "name" , "path" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertEquals ( folder . getName ( ) , "name" )
|
testProblematicSubscriptSyntax2 ( ) { com . mitchellbosecke . pebble . PebbleEngine pebble = new com . mitchellbosecke . pebble . PebbleEngine . Builder ( ) . loader ( new com . mitchellbosecke . pebble . loader . StringLoader ( ) ) . strictVariables ( false ) . build ( ) ; java . lang . String source = "{{<sp>person<sp>['first-name'][0]<sp>}}" ; com . mitchellbosecke . pebble . template . PebbleTemplate template = pebble . getTemplate ( source ) ; java . util . Map < java . lang . String , java . lang . Object > context = new java . util . HashMap ( ) ; context . put ( "person" , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { this . put ( "first-name" , new java . lang . String [ ] { "Bob" } ) ; } } ) ; java . io . Writer writer = new java . io . StringWriter ( ) ; template . evaluate ( writer , context ) ; "<AssertPlaceHolder>" ; } toString ( ) { return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "Bob" , writer . toString ( ) )
|
listAllVisibilityOptionsWithLookupExceptions ( ) { when ( this . componentManager . < org . phenotips . data . permissions . Visibility > getInstanceList ( org . phenotips . data . permissions . Visibility . class ) ) . thenThrow ( new org . xwiki . component . manager . ComponentLookupException ( "None" ) ) ; java . util . Collection < org . phenotips . data . permissions . Visibility > returnedVisibilities = this . component . listAllVisibilityOptions ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return this . properties . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( returnedVisibilities . isEmpty ( ) )
|
deveObterSignedInfoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFSignature assinatura = new com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFSignature ( ) ; final com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFSignedInfo signedInfo = new com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFSignedInfo ( ) ; assinatura . setSignedInfo ( signedInfo ) ; "<AssertPlaceHolder>" ; } getSignedInfo ( ) { return this . signedInfo ; }
|
org . junit . Assert . assertEquals ( signedInfo , assinatura . getSignedInfo ( ) )
|
testMethodsNullSorterSelf ( ) { java . util . List < java . lang . String > expected = java . util . Arrays . asList ( org . junit . internal . MethodSorterTest . EPSILON , org . junit . internal . MethodSorterTest . BETA , org . junit . internal . MethodSorterTest . ALPHA , org . junit . internal . MethodSorterTest . DELTA , org . junit . internal . MethodSorterTest . GAMMA_VOID , org . junit . internal . MethodSorterTest . GAMMA_BOOLEAN ) ; java . util . List < java . lang . String > actual = getDeclaredMethodNames ( org . junit . internal . MethodSorterTest . DummySortWithoutAnnotation . class ) ; "<AssertPlaceHolder>" ; } getDeclaredMethodNames ( java . lang . Class ) { java . lang . reflect . Method [ ] actualMethods = org . junit . internal . MethodSorter . getDeclaredMethods ( clazz ) ; java . util . List < java . lang . String > names = new java . util . ArrayList < java . lang . String > ( ) ; for ( java . lang . reflect . Method m : actualMethods ) { if ( ! ( m . isSynthetic ( ) ) ) { names . add ( m . toString ( ) . replace ( ( ( clazz . getName ( ) ) + '.' ) , "" ) ) ; } } return names ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testSwapElements_4 ( ) { org . la4j . Vector a = v ( 0.0 , 1.0 , 0.0 , 0.0 ) ; org . la4j . Vector b = v ( 0.0 , 0.0 , 1.0 , 0.0 ) ; a . swapElements ( 1 , 2 ) ; "<AssertPlaceHolder>" ; } swapElements ( int , int ) { if ( i != j ) { double d = self [ i ] ; self [ i ] = self [ j ] ; self [ j ] = d ; } }
|
org . junit . Assert . assertEquals ( b , a )
|
testNodeTypeInNoURIFilter ( ) { org . hawkular . apm . api . model . config . CollectorConfiguration cc = new org . hawkular . apm . api . model . config . CollectorConfiguration ( ) ; org . hawkular . apm . api . model . config . txn . TransactionConfig btc = new org . hawkular . apm . api . model . config . txn . TransactionConfig ( ) ; cc . getTransactions ( ) . put ( "testapp" , btc ) ; org . hawkular . apm . api . model . config . txn . Processor p1 = new org . hawkular . apm . api . model . config . txn . Processor ( ) ; btc . getProcessors ( ) . add ( p1 ) ; p1 . setNodeType ( NodeType . Component ) ; p1 . setDirection ( Direction . In ) ; org . hawkular . apm . api . model . config . txn . SetPropertyAction pa1 = new org . hawkular . apm . api . model . config . txn . SetPropertyAction ( ) ; pa1 . setName ( "test" ) ; org . hawkular . apm . api . model . config . txn . TextExpression expr = new org . hawkular . apm . api . model . config . txn . TextExpression ( ) ; expr . setSource ( DataSource . Content ) ; expr . setKey ( "1" ) ; pa1 . setExpression ( expr ) ; p1 . getActions ( ) . add ( pa1 ) ; org . hawkular . apm . client . collector . internal . ProcessorManager pm = new org . hawkular . apm . client . collector . internal . ProcessorManager ( cc ) ; org . hawkular . apm . api . model . trace . Trace trace = new org . hawkular . apm . api . model . trace . Trace ( ) ; org . hawkular . apm . api . model . trace . Component service = new org . hawkular . apm . api . model . trace . Component ( ) ; trace . getNodes ( ) . add ( service ) ; trace . setTransaction ( "testapp" ) ; pm . process ( trace , service , Direction . In , null , "first" , "second" ) ; "<AssertPlaceHolder>" ; } getProperties ( java . lang . String ) { java . util . Set < org . hawkular . apm . api . model . Property > ret = new java . util . HashSet < org . hawkular . apm . api . model . Property > ( ) ; for ( org . hawkular . apm . api . model . Property property : this . properties ) { if ( property . getName ( ) . equals ( name ) ) { ret . add ( property ) ; } } return ret ; }
|
org . junit . Assert . assertEquals ( "second" , service . getProperties ( "test" ) . iterator ( ) . next ( ) . getValue ( ) )
|
testExportWithoutBoundedBy ( ) { java . net . URL docURL = org . deegree . gml . feature . GMLFeatureReaderTest . class . getResource ( "../cite/feature/dataset-sf0.xml" ) ; org . deegree . gml . GMLStreamReader gmlReader = org . deegree . gml . GMLInputFactory . createGMLStreamReader ( org . deegree . gml . GMLVersion . GML_31 , docURL ) ; org . deegree . feature . FeatureCollection fc = ( ( org . deegree . feature . FeatureCollection ) ( gmlReader . readFeature ( ) ) ) ; gmlReader . getIdContext ( ) . resolveLocalRefs ( ) ; for ( org . deegree . feature . Feature f : fc ) { f . setEnvelope ( null ) ; } javax . xml . stream . XMLOutputFactory outfac = javax . xml . stream . XMLOutputFactory . newInstance ( ) ; java . io . ByteArrayOutputStream os = new java . io . ByteArrayOutputStream ( ) ; javax . xml . stream . XMLStreamWriter writer = outfac . createXMLStreamWriter ( os ) ; org . deegree . gml . GMLStreamWriter gmlwriter = org . deegree . gml . GMLOutputFactory . createGMLStreamWriter ( org . deegree . gml . GMLVersion . GML_31 , writer ) ; gmlwriter . setNamespaceBindings ( gmlReader . getAppSchema ( ) . getNamespaceBindings ( ) ) ; gmlwriter . write ( fc ) ; gmlwriter . close ( ) ; org . deegree . commons . xml . XMLAdapter writtenDoc = new org . deegree . commons . xml . XMLAdapter ( new java . io . ByteArrayInputStream ( os . toByteArray ( ) ) , null ) ; org . deegree . commons . xml . NamespaceBindings nsContext = new org . deegree . commons . xml . NamespaceBindings ( ) ; nsContext . addNamespace ( "gml" , org . deegree . gml . GMLVersion . GML_31 . getNamespace ( ) ) ; org . deegree . commons . xml . XPath xpath = new org . deegree . commons . xml . XPath ( "gml:featureMember/*/gml:boundedBy" , nsContext ) ; java . util . List < org . apache . axiom . om . OMElement > boundedBys = writtenDoc . getElements ( writtenDoc . getRootElement ( ) , xpath ) ; "<AssertPlaceHolder>" ; } size ( ) { return fragment . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , boundedBys . size ( ) )
|
getterForRootCertificateSucceed ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . X509Certificates ) { tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . X509Attestation x509Attestation = tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . X509Attestation . createFromRootCertificates ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . X509AttestationTest . PUBLIC_CERTIFICATE_STRING , tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . X509AttestationTest . PUBLIC_CERTIFICATE_STRING ) ; "<AssertPlaceHolder>" ; } getRootCertificatesFinal ( ) { if ( ( this . rootCertificates ) == null ) { return null ; } return new com . microsoft . azure . sdk . iot . provisioning . service . configs . X509Certificates ( this . rootCertificates ) ; }
|
org . junit . Assert . assertNotNull ( x509Attestation . getRootCertificatesFinal ( ) )
|
nullNetaddressStrategyTest ( ) { boolean isMatch = RemoteAddressStrategyFactory . NULL_NET_ADDRESS_STRATEGY . match ( new org . apache . rocketmq . acl . plain . PlainAccessResource ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( isMatch )
|
testValues ( ) { org . sonar . plugins . scmstats . utils . SupportedScm [ ] result = org . sonar . plugins . scmstats . utils . SupportedScm . values ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( result . length , org . hamcrest . Matchers . equalTo ( 6 ) )
|
testNullMpReachNlri ( ) { final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . multiprotocol . rev180329 . update . attributes . MpReachNlriBuilder mpb = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . multiprotocol . rev180329 . update . attributes . MpReachNlriBuilder ( ) ; this . parser . parseNlri ( io . netty . buffer . Unpooled . buffer ( ) , mpb , null ) ; "<AssertPlaceHolder>" ; } parseNlri ( io . netty . buffer . ByteBuf , org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . multiprotocol . rev180329 . update . attributes . MpUnreachNlriBuilder , org . opendaylight . protocol . bgp . parser . spi . PeerSpecificParserConstraint ) { if ( ! ( nlri . isReadable ( ) ) ) { return ; } final boolean mPathSupported = org . opendaylight . protocol . bgp . parser . spi . MultiPathSupportUtil . isTableTypeSupported ( constraint , new org . opendaylight . protocol . bgp . parser . BgpTableTypeImpl ( builder . getAfi ( ) , builder . getSafi ( ) ) ) ; builder . setWithdrawnRoutes ( new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . multiprotocol . rev180329 . update . attributes . mp . unreach . nlri . WithdrawnRoutesBuilder ( ) . setDestinationType ( org . opendaylight . protocol . bgp . mvpn . impl . nlri . Ipv4NlriHandler . parseIpv4UnreachNlri ( nlri , mPathSupported ) ) . build ( ) ) ; }
|
org . junit . Assert . assertEquals ( new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . multiprotocol . rev180329 . update . attributes . MpReachNlriBuilder ( ) . build ( ) , mpb . build ( ) )
|
testSVM1v1 ( ) { setKSession ( getModelSession ( org . kie . pmml . pmml_4_2 . predictive . models . SVMTest . source3 , org . kie . pmml . pmml_4_2 . predictive . models . SVMTest . VERBOSE ) ) ; setKbase ( getKSession ( ) . getKieBase ( ) ) ; org . kie . api . runtime . KieSession kSession = getKSession ( ) ; kSession . fireAllRules ( ) ; org . kie . api . definition . type . FactType ztype = kSession . getKieBase ( ) . getFactType ( org . kie . pmml . pmml_4_2 . predictive . models . SVMTest . packageName , "Z" ) ; "<AssertPlaceHolder>" ; kSession . getEntryPoint ( "in_X" ) . insert ( 0.63 ) ; kSession . getEntryPoint ( "in_Y" ) . insert ( 0.0 ) ; kSession . fireAllRules ( ) ; checkFirstDataFieldOfTypeStatus ( ztype , true , false , "SVMXORMODEL" , "yes" ) ; checkFirstDataFieldOfTypeStatus ( kSession . getKieBase ( ) . getFactType ( org . kie . pmml . pmml_4_2 . predictive . models . SVMTest . packageName , "OutZ" ) , true , false , "SVMXORMODEL" , "yes" ) ; checkFirstDataFieldOfTypeStatus ( kSession . getKieBase ( ) . getFactType ( org . kie . pmml . pmml_4_2 . predictive . models . SVMTest . packageName , "ProbZYes" ) , true , false , "SVMXORMODEL" , 0.872057 ) ; checkGeneratedRules ( ) ; } getKieBase ( ) { return null ; }
|
org . junit . Assert . assertNotNull ( ztype )
|
testWindowSizeBiggerThanAvailableProducesEmptyList ( ) { java . util . List < java . lang . Integer > list = io . reactivex . Flowable . just ( 4 , 3 , 2 , 1 ) . compose ( com . github . davidmoten . rx2 . flowable . Transformers . < java . lang . Integer > windowMin ( 10 ) ) . toList ( ) . blockingGet ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( start ) == ( finish ) ; }
|
org . junit . Assert . assertTrue ( list . isEmpty ( ) )
|
saveEncounter_shouldNotCascadeToExistingOrder ( ) { org . openmrs . api . EncounterService es = org . openmrs . api . context . Context . getEncounterService ( ) ; org . openmrs . TestOrder order = ( ( org . openmrs . TestOrder ) ( org . openmrs . api . context . Context . getOrderService ( ) . getOrder ( 7 ) ) ) ; order . setVoided ( true ) ; org . openmrs . Encounter encounter = es . getEncounter ( 6 ) ; es . saveEncounter ( encounter ) ; java . lang . String sql = "SELECT<sp>voided<sp>FROM<sp>orders<sp>WHERE<sp>order_id=7" ; java . lang . Boolean voided = ( ( java . lang . Boolean ) ( org . openmrs . api . context . Context . getAdministrationService ( ) . executeSQL ( sql , true ) . get ( 0 ) . get ( 0 ) ) ) ; "<AssertPlaceHolder>" ; } get ( int ) { return allergies . get ( index ) ; }
|
org . junit . Assert . assertFalse ( voided )
|
methods ( ) { com . github . underscore . List < java . lang . String > result = com . github . underscore . U . methods ( com . github . underscore . U . class ) ; "<AssertPlaceHolder>" ; } first ( com . github . underscore . List , int ) { return list . subList ( 0 , java . lang . Math . min ( ( n < 0 ? 0 : n ) , list . size ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( 5 , com . github . underscore . U . first ( result , 5 ) . size ( ) )
|
testDataAfterPackFooterSplitObjectRead ( ) { final byte [ ] data = org . eclipse . jgit . lib . Constants . encode ( "0123456789" ) ; int objects = 900 ; org . eclipse . jgit . util . TemporaryBuffer . Heap pack = new org . eclipse . jgit . util . TemporaryBuffer . Heap ( ( 32 * 1024 ) ) ; org . eclipse . jgit . transport . PackParserTest . packHeader ( pack , objects ) ; for ( int i = 0 ; i < objects ; i ++ ) { pack . write ( ( ( ( org . eclipse . jgit . lib . Constants . OBJ_BLOB ) << 4 ) | 10 ) ) ; org . eclipse . jgit . transport . PackParserTest . deflate ( pack , data ) ; } org . eclipse . jgit . transport . PackParserTest . digest ( pack ) ; byte [ ] packData = pack . toByteArray ( ) ; byte [ ] streamData = new byte [ ( packData . length ) + 1 ] ; java . lang . System . arraycopy ( packData , 0 , streamData , 0 , packData . length ) ; streamData [ packData . length ] = 126 ; java . io . InputStream in = new java . io . ByteArrayInputStream ( streamData ) ; org . eclipse . jgit . transport . PackParser p = index ( in ) ; p . setAllowThin ( true ) ; p . setCheckEofAfterPackFooter ( false ) ; p . setExpectDataAfterPackFooter ( true ) ; p . parse ( NullProgressMonitor . INSTANCE ) ; "<AssertPlaceHolder>" ; } read ( ) { byte [ ] buf = new byte [ 1 ] ; int n = read ( buf , 0 , 1 ) ; return n == 1 ? ( buf [ 0 ] ) & 255 : - 1 ; }
|
org . junit . Assert . assertEquals ( 126 , in . read ( ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.