input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
matchRequiredVersions_shouldAllowRangedNonNumericCharacterRequiredVersion ( ) { java . lang . String openmrsVersion = "1.4.3" ; java . lang . String requiredOpenmrsVersion = "1.4.1a<sp>-<sp>1.4.3a" ; "<AssertPlaceHolder>" ; } matchRequiredVersions ( java . lang . String , java . lang . String ) { if ( org . apache . commons . lang3 . StringUtils . isNotEmpty ( versionRange ) ) { java . lang . String [ ] ranges = versionRange . split ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" 1 ) ; for ( java . lang . String range : ranges ) { java . lang . String separator = "-" ; if ( ( ( range . indexOf ( "*" ) ) > 0 ) || ( ( ( range . indexOf ( separator ) ) > 0 ) && ( ! ( org . openmrs . module . ModuleUtil . isVersionWithQualifier ( range ) ) ) ) ) { java . lang . String lowerBound = range ; java . lang . String upperBound = range ; int indexOfSeparator = range . indexOf ( separator ) ; while ( indexOfSeparator > 0 ) { lowerBound = range . substring ( 0 , indexOfSeparator ) ; upperBound = range . substring ( ( indexOfSeparator + 1 ) ) ; if ( upperBound . matches ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" 0 ) ) { break ; } indexOfSeparator = range . indexOf ( separator , ( indexOfSeparator + 1 ) ) ; } lowerBound = org . apache . commons . lang3 . StringUtils . remove ( lowerBound , lowerBound . replaceAll ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" , "" ) ) ; upperBound = org . apache . commons . lang3 . StringUtils . remove ( upperBound , upperBound . replaceAll ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" , "" ) ) ; if ( ( lowerBound . indexOf ( "*" ) ) > 0 ) { lowerBound = lowerBound . replaceAll ( "\\*" , "0" ) ; } if ( ( upperBound . indexOf ( "*" ) ) > 0 ) { upperBound = upperBound . replaceAll ( "\\*" , java . lang . Integer . toString ( Integer . MAX_VALUE ) ) ; } int lowerReturn = org . openmrs . module . ModuleUtil . compareVersion ( version , lowerBound ) ; int upperReturn = org . openmrs . module . ModuleUtil . compareVersion ( version , upperBound ) ; if ( ( lowerReturn < 0 ) || ( upperReturn > 0 ) ) { org . openmrs . module . ModuleUtil . log . debug ( ( ( ( ( ( "Version<sp>" + version ) + "<sp>is<sp>not<sp>between<sp>" ) + lowerBound ) + "<sp>and<sp>" ) + upperBound ) ) ; } else { return true ; } } else { if ( ( org . openmrs . module . ModuleUtil . compareVersion ( version , range ) ) < 0 ) { org . openmrs . module . ModuleUtil . log . debug ( ( ( ( "Version<sp>" + version ) + "<sp>is<sp>below<sp>" ) + range ) ) ; } else { return true ; } } } } else { return true ; } return false ; } | org . junit . Assert . assertTrue ( org . openmrs . module . ModuleUtil . matchRequiredVersions ( openmrsVersion , requiredOpenmrsVersion ) ) |
testPollPartitioned ( ) { java . util . List < com . bazaarvoice . emodb . queue . api . Message > expected = com . google . common . collect . ImmutableList . of ( new com . bazaarvoice . emodb . queue . api . Message ( "id-1" , "payload-1" ) , new com . bazaarvoice . emodb . queue . api . Message ( "id-2" , "payload-2" ) ) ; when ( _server . poll ( "queue-name" , java . time . Duration . ofSeconds ( 15 ) , 123 ) ) . thenReturn ( expected ) ; java . util . List < com . bazaarvoice . emodb . queue . api . Message > actual = queueClient ( true ) . poll ( "queue-name" , java . time . Duration . ofSeconds ( 15 ) , 123 ) ; "<AssertPlaceHolder>" ; verify ( _server ) . poll ( "queue-name" , java . time . Duration . ofSeconds ( 15 ) , 123 ) ; verifyNoMoreInteractions ( _server ) ; } poll ( java . lang . String , java . time . Duration , int ) { return _authDatabus . poll ( _apiKey , subscription , claimTtl , limit ) ; } | org . junit . Assert . assertEquals ( actual , expected ) |
putsString ( ) { java . nio . CharBuffer buffer = java . nio . CharBuffer . allocate ( 100 ) ; buffer . put ( "TeaVM" ) ; "<AssertPlaceHolder>" ; } flip ( ) { limit = position ; position = 0 ; mark = - 1 ; return this ; } | org . junit . Assert . assertThat ( buffer . flip ( ) . toString ( ) , org . hamcrest . CoreMatchers . is ( "TeaVM" ) ) |
testCompareTo002 ( ) { javax . naming . ldap . LdapName ln = new javax . naming . ldap . LdapName ( "cn=common,t=test" ) ; javax . naming . ldap . LdapName ln2 = new javax . naming . ldap . LdapName ( "t=test" ) ; "<AssertPlaceHolder>" ; } compareTo ( com . ibm . ws . pmi . server . data . SpdData ) { if ( ( dataId ) < ( other . getId ( ) ) ) { return - 1 ; } else if ( ( dataId ) > ( other . getId ( ) ) ) { return 1 ; } else { return 0 ; } } | org . junit . Assert . assertFalse ( ( ( ln . compareTo ( ln2 ) ) <= 0 ) ) |
testRollingUpdateMigrate ( ) { final java . lang . String host = testHost ( ) ; startDefaultAgent ( host , "--labels" , com . spotify . helios . system . DeploymentGroupTest . TEST_LABEL ) ; final com . spotify . helios . client . HeliosClient client = defaultClient ( ) ; awaitHostStatus ( client , testHost ( ) , com . spotify . helios . system . UP , com . spotify . helios . system . LONG_WAIT_SECONDS , java . util . concurrent . TimeUnit . SECONDS ) ; final com . spotify . helios . common . descriptors . JobId jobId = createJob ( testJobName , testJobVersion , com . spotify . helios . system . BUSYBOX , com . spotify . helios . system . IDLE_COMMAND ) ; deployJob ( jobId , host ) ; awaitTaskState ( jobId , host , TaskStatus . State . RUNNING ) ; cli ( "create-deployment-group" , "--json" , com . spotify . helios . system . DeploymentGroupTest . TEST_GROUP , com . spotify . helios . system . DeploymentGroupTest . TEST_LABEL ) ; cli ( "rolling-update" , "--async" , "--migrate" , testJobNameAndVersion , com . spotify . helios . system . DeploymentGroupTest . TEST_GROUP ) ; final java . lang . String jobDeploymentGroup = com . spotify . helios . Polling . await ( com . spotify . helios . system . LONG_WAIT_SECONDS , java . util . concurrent . TimeUnit . SECONDS , new java . util . concurrent . Callable < java . lang . String > ( ) { @ com . spotify . helios . system . Override public java . lang . String call ( ) throws com . spotify . helios . system . Exception { final com . spotify . helios . common . descriptors . Deployment deployment = defaultClient ( ) . hostStatus ( host ) . get ( ) . getJobs ( ) . get ( jobId ) ; if ( ( deployment != null ) && ( ! ( isNullOrEmpty ( deployment . getDeploymentGroupName ( ) ) ) ) ) { return deployment . getDeploymentGroupName ( ) ; } else { return null ; } } } ) ; "<AssertPlaceHolder>" ; awaitDeploymentGroupStatus ( defaultClient ( ) , com . spotify . helios . system . DeploymentGroupTest . TEST_GROUP , DeploymentGroupStatus . State . DONE ) ; awaitTaskState ( jobId , host , TaskStatus . State . RUNNING ) ; } getDeploymentGroupName ( ) { return deploymentGroupName ; } | org . junit . Assert . assertEquals ( com . spotify . helios . system . DeploymentGroupTest . TEST_GROUP , jobDeploymentGroup ) |
getDiagnosisByUuid_shouldFindDiagnosisGivenValidUuid ( ) { java . lang . String uuid = "68802cce-6880-17e4-6880-a68804d22fb7" ; org . openmrs . Diagnosis diagnosis = diagnosisService . getDiagnosisByUuid ( uuid ) ; "<AssertPlaceHolder>" ; } getUuid ( ) { return uuid ; } | org . junit . Assert . assertEquals ( uuid , diagnosis . getUuid ( ) ) |
deveObterDescontoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemProdutoDeclaracaoImportacaoAdicao importacaoAdicao = new com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemProdutoDeclaracaoImportacaoAdicao ( ) ; importacaoAdicao . setDesconto ( new java . math . BigDecimal ( "999999999999.99" ) ) ; "<AssertPlaceHolder>" ; } getDesconto ( ) { return this . desconto ; } | org . junit . Assert . assertEquals ( "999999999999.99" , importacaoAdicao . getDesconto ( ) ) |
testToStringNoQuota ( ) { long length = 11111 ; long fileCount = 22222 ; long directoryCount = 33333 ; org . apache . hadoop . fs . ContentSummary contentSummary = new org . apache . hadoop . fs . ContentSummary . Builder ( ) . length ( length ) . fileCount ( fileCount ) . directoryCount ( directoryCount ) . build ( ) ; java . lang . String expected = "<sp>none<sp>inf<sp>none" + "<sp>inf<sp>33333<sp>22222<sp>11111<sp>" ; "<AssertPlaceHolder>" ; } toString ( java . util . List ) { return infos . stream ( ) . map ( org . apache . hadoop . ozone . container . common . helpers . TestBlockData :: toString ) . reduce ( ( left , right ) -> ( left + ",<sp>" ) + right ) . orElse ( "" ) ; } | org . junit . Assert . assertEquals ( expected , contentSummary . toString ( true ) ) |
testBytesSerializationTrustedPackage ( ) { org . pac4j . core . util . JavaSerializationHelper h = new org . pac4j . core . util . JavaSerializationHelper ( ) ; h . addTrustedPackage ( "org.apache" ) ; final org . apache . shiro . subject . SimplePrincipalCollection spc = new org . apache . shiro . subject . SimplePrincipalCollection ( ) ; final byte [ ] serialized = h . serializeToBytes ( spc ) ; "<AssertPlaceHolder>" ; } deserializeFromBytes ( byte [ ] ) { org . pac4j . core . util . Serializable o = null ; try ( final org . pac4j . core . util . ByteArrayInputStream bais = new org . pac4j . core . util . ByteArrayInputStream ( bytes ) ; final org . pac4j . core . util . ObjectInputStream ois = new org . pac4j . core . util . JavaSerializationHelper . RestrictedObjectInputStream ( bais , this . trustedPackages , this . trustedClasses ) ) { o = ( ( org . pac4j . core . util . Serializable ) ( ois . readObject ( ) ) ) ; } catch ( org . pac4j . core . util . IOException | java . lang . ClassNotFoundException e ) { org . pac4j . core . util . JavaSerializationHelper . logger . warn ( "cannot<sp>Java<sp>deserialize<sp>object" , e ) ; } return o ; } | org . junit . Assert . assertNotNull ( h . deserializeFromBytes ( serialized ) ) |
testOverwrite ( ) { ca . uwaterloo . ece . qhanam . practice . lru . LRUCache cache = new ca . uwaterloo . ece . qhanam . practice . lru . LRUCache ( 2 ) ; cache . set ( 1 , 1 ) ; cache . set ( 1 , 2 ) ; "<AssertPlaceHolder>" ; } get ( int ) { list . access ( n ) ; return n . value ; } | org . junit . Assert . assertEquals ( 2 , cache . get ( 1 ) ) |
testNeighbour1of5DirectHit ( ) { ch . ethz . globis . phtree . PhTree < long [ ] > idx = ch . ethz . globis . phtree . test . util . TestUtil . newTree ( 2 , 8 ) ; idx . put ( new long [ ] { 3 , 3 } , new long [ ] { 3 , 3 } ) ; idx . put ( new long [ ] { 2 , 2 } , new long [ ] { 2 , 2 } ) ; idx . put ( new long [ ] { 1 , 1 } , new long [ ] { 1 , 1 } ) ; idx . put ( new long [ ] { 1 , 3 } , new long [ ] { 1 , 3 } ) ; idx . put ( new long [ ] { 3 , 1 } , new long [ ] { 3 , 1 } ) ; java . util . List < long [ ] > result = toList ( idx . rangeQuery ( 1 , 3 , 3 ) ) ; check ( 8 , result . get ( 0 ) , 3 , 3 ) ; "<AssertPlaceHolder>" ; } size ( ) { return tree . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , result . size ( ) ) |
testOpenShiftConfigFromSystemPropsNegative ( ) { try { java . lang . System . setProperty ( "docker.useOpenShiftAuth" , "false" ) ; executeWithTempHomeDir ( new io . fabric8 . maven . docker . util . AuthConfigFactoryTest . HomeDirExecutor ( ) { @ io . fabric8 . maven . docker . util . Override public void exec ( java . io . File homeDir ) throws java . io . IOException , org . apache . maven . plugin . MojoExecutionException { createOpenShiftConfig ( homeDir , "openshift_simple_config.yaml" ) ; java . util . Map < java . lang . String , java . lang . String > authConfigMap = new java . util . HashMap ( ) ; authConfigMap . put ( "useOpenShiftAuth" , "true" ) ; io . fabric8 . maven . docker . access . AuthConfig config = factory . createAuthConfig ( isPush , false , authConfigMap , settings , "roland" , null ) ; "<AssertPlaceHolder>" ; } } ) ; } finally { java . lang . System . getProperties ( ) . remove ( "docker.useOpenShiftAuth" ) ; } } createAuthConfig ( boolean , boolean , java . util . Map , org . apache . maven . settings . Settings , java . lang . String , java . lang . String ) { io . fabric8 . maven . docker . access . AuthConfig ret = createStandardAuthConfig ( isPush , authConfig , settings , user , registry ) ; if ( ret != null ) { if ( ( registry == null ) || skipExtendedAuth ) { return ret ; } try { return extendedAuthentication ( ret , registry ) ; } catch ( java . io . IOException e ) { throw new org . apache . maven . plugin . MojoExecutionException ( e . getMessage ( ) , e ) ; } } ret = getAuthConfigFromDockerConfig ( registry ) ; if ( ret != null ) { log . debug ( "AuthConfig:<sp>credentials<sp>from<sp>~/.docker/config.json" ) ; return ret ; } log . debug ( "AuthConfig:<sp>no<sp>credentials<sp>found" ) ; return null ; } | org . junit . Assert . assertNull ( config ) |
testBuildTableNameNonRootServicePathDataModelByEntityNewEncoding ( ) { System . out . println ( ( ( ( ( getTestTraceHead ( "[NGSIPostgreSQLSink.buildTableName]" ) ) + "--------<sp>When<sp>a<sp>non<sp>root<sp>service-path<sp>is<sp>notified/defaulted<sp>and<sp>data_model<sp>is<sp>" ) + "'dm-by-service-path'<sp>the<sp>MySQL<sp>table<sp>name<sp>is<sp>the<sp>encoding<sp>of<sp>the<sp>concatenation<sp>of<sp><service-path>,<sp>" ) + "x002fsomex0050athxffffsomex0049dxffffsomex0054ype" 2 ) ) ; java . lang . String attrPersistence = null ; java . lang . String batchSize = null ; java . lang . String batchTime = null ; java . lang . String batchTTL = null ; java . lang . String dataModel = "dm-by-entity" ; java . lang . String enableEncoding = "true" ; java . lang . String enableGrouping = null ; java . lang . String enableLowercase = null ; java . lang . String host = null ; java . lang . String password = null ; java . lang . String port = null ; java . lang . String username = null ; java . lang . String cache = null ; com . telefonica . iot . cygnus . sinks . NGSIPostgreSQLSink sink = new com . telefonica . iot . cygnus . sinks . NGSIPostgreSQLSink ( ) ; sink . configure ( createContext ( attrPersistence , batchSize , batchTime , batchTTL , dataModel , enableEncoding , enableGrouping , enableLowercase , host , password , port , username , cache ) ) ; java . lang . String servicePath = "x002fsomex0050athxffffsomex0049dxffffsomex0054ype" 0 ; java . lang . String entity = "someId=someType" ; java . lang . String attribute = null ; try { java . lang . String builtTableName = sink . buildTableName ( servicePath , entity , attribute ) ; java . lang . String expecetedTableName = "x002fsomex0050athxffffsomex0049dxffffsomex0054ype" ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( ( ( ( getTestTraceHead ( "[NGSIPostgreSQLSink.buildTableName]" ) ) + "-<sp>OK<sp>-<sp>'" ) + builtTableName ) + "'<sp>is<sp>equals<sp>to<sp>the<sp>encoding<sp>of<sp><service-path>,<sp><entityId><sp>" ) + "x002fsomex0050athxffffsomex0049dxffffsomex0054ype" 3 ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( ( ( ( getTestTraceHead ( "[NGSIPostgreSQLSink.buildTableName]" ) ) + "-<sp>FAIL<sp>-<sp>'" ) + builtTableName ) + "x002fsomex0050athxffffsomex0049dxffffsomex0054ype" 1 ) + "x002fsomex0050athxffffsomex0049dxffffsomex0054ype" 2 ) ) ; throw e ; } } catch ( java . lang . Exception e ) { System . out . println ( ( ( getTestTraceHead ( "[NGSIPostgreSQLSink.buildTableName]" ) ) + "x002fsomex0050athxffffsomex0049dxffffsomex0054ype" 4 ) ) ; throw e ; } buildTableName ( java . lang . String , java . lang . String , java . lang . String ) { java . lang . String name ; switch ( dataModel ) { case DMBYSERVICEPATH : name = com . telefonica . iot . cygnus . utils . NGSICharsets . encodePostgreSQL ( servicePath ) ; break ; case DMBYENTITY : java . lang . String truncatedServicePath = com . telefonica . iot . cygnus . utils . NGSICharsets . encodePostgreSQL ( servicePath ) ; name = ( truncatedServicePath . isEmpty ( ) ? "" : truncatedServicePath + ( com . telefonica . iot . cygnus . utils . CommonConstants . CONCATENATOR ) ) + ( com . telefonica . iot . cygnus . utils . NGSICharsets . encodePostgreSQL ( entity ) ) ; break ; case DMBYATTRIBUTE : truncatedServicePath = com . telefonica . iot . cygnus . utils . NGSICharsets . encodePostgreSQL ( servicePath ) ; name = ( ( ( truncatedServicePath . isEmpty ( ) ? "" : truncatedServicePath + ( com . telefonica . iot . cygnus . utils . CommonConstants . CONCATENATOR ) ) + ( com . telefonica . iot . cygnus . utils . NGSICharsets . encodePostgreSQL ( entity ) ) ) + ( com . telefonica . iot . cygnus . utils . CommonConstants . CONCATENATOR ) ) + ( com . telefonica . iot . cygnus . utils . NGSICharsets . encodePostgreSQL ( attribute ) ) ; break ; default : throw new com . telefonica . iot . cygnus . errors . CygnusBadConfiguration ( ( ( "Unknown<sp>data<sp>model<sp>'" + ( dataModel . toString ( ) ) ) + "'.<sp>Please,<sp>use<sp>dm-by-service-path,<sp>dm-by-entity<sp>or<sp>dm-by-attribute" ) ) ; } if ( ( name . length ( ) ) > ( com . telefonica . iot . cygnus . utils . NGSIConstants . POSTGRESQL_MAX_NAME_LEN ) ) { throw new com . telefonica . iot . cygnus . errors . CygnusBadConfiguration ( ( ( ( "Building<sp>table<sp>name<sp>'" + name ) + "'<sp>and<sp>its<sp>length<sp>is<sp>greater<sp>than<sp>" ) + ( com . telefonica . iot . cygnus . utils . NGSIConstants . POSTGRESQL_MAX_NAME_LEN ) ) ) ; } return name ; } | org . junit . Assert . assertEquals ( expecetedTableName , builtTableName ) |
testGetFirstName_1 ( ) { org . jinstagram . entity . users . feed . UserFeedData fixture = new org . jinstagram . entity . users . feed . UserFeedData ( ) ; fixture . setBio ( "" ) ; fixture . setId ( "" ) ; fixture . setFirstName ( "" ) ; fixture . setLastName ( "" ) ; fixture . setUserName ( "" ) ; fixture . setProfilePictureUrl ( "" ) ; fixture . setFullName ( "" ) ; fixture . setWebsite ( "" ) ; java . lang . String result = fixture . getFirstName ( ) ; "<AssertPlaceHolder>" ; } getFirstName ( ) { return firstName ; } | org . junit . Assert . assertEquals ( "" , result ) |
assertHandleExceptionWithoutSet ( ) { "<AssertPlaceHolder>" ; org . apache . shardingsphere . core . execute . sql . execute . threadlocal . ExecutorExceptionHandler . handleException ( new java . sql . SQLException ( "" ) ) ; } isExceptionThrown ( ) { return org . apache . shardingsphere . core . execute . sql . execute . threadlocal . ExecutorExceptionHandler . IS_EXCEPTION_THROWN . get ( ) ; } | org . junit . Assert . assertTrue ( org . apache . shardingsphere . core . execute . sql . execute . threadlocal . ExecutorExceptionHandler . isExceptionThrown ( ) ) |
containsTest ( ) { java . util . List < com . github . anno4j . model . Annotation > list = queryService . addPrefix ( "ex" , "http://www.example.com/schema#" ) . addCriteria ( "oa:hasBody/ex:comparisonBodyStringValue" , "Test" , Comparison . CONTAINS ) . execute ( ) ; "<AssertPlaceHolder>" ; } size ( ) { try { if ( ( _size ) < 0 ) { synchronized ( this ) { if ( ( _size ) < 0 ) { int index = findSize ( ) ; _size = index ; } } } return _size ; } catch ( org . openrdf . repository . RepositoryException e ) { throw new org . openrdf . repository . object . exceptions . ObjectStoreException ( e ) ; } } | org . junit . Assert . assertEquals ( 3 , list . size ( ) ) |
testEmptyColumnNames ( ) { org . meridor . perspective . sql . impl . parser . DataSource dataSource = new org . meridor . perspective . sql . impl . parser . DataSource ( TABLE_ALIAS ) ; "<AssertPlaceHolder>" ; org . meridor . perspective . sql . impl . task . strategy . DataSourceStrategy strategy = getStrategy ( ) ; strategy . process ( dataSource , org . meridor . perspective . sql . impl . task . strategy . TABLE_ALIASES ) ; } getColumns ( ) { return columns ; } | org . junit . Assert . assertThat ( dataSource . getColumns ( ) , is ( empty ( ) ) ) |
shouldConvert ( ) { br . com . uol . pagseguro . api . utils . RequestMap expectedMap = new br . com . uol . pagseguro . api . utils . RequestMap ( ) ; expectedMap . putMap ( new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "permissions" , "CREATE_CHECKOUTS,DIRECT_PAYMENT" ) ; } } ) ; br . com . uol . pagseguro . api . utils . RequestMap map = mapConverter . convert ( permissions ) ; "<AssertPlaceHolder>" ; } convert ( br . com . uol . pagseguro . api . common . domain . AccountRegisterSuggestion ) { if ( account == null ) { return null ; } br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter convertedAccount = new br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter ( ) ; convertedAccount . setEmail ( account . getEmail ( ) ) ; convertedAccount . setType ( account . getType ( ) ) ; convertedAccount . setPerson ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . PERSON_V_2_XML_CONVERTER . convert ( account . getPerson ( ) ) ) ; convertedAccount . setCompany ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . COMPANY_V_2_XML_CONVERTER . convert ( account . getCompany ( ) ) ) ; return convertedAccount ; } | org . junit . Assert . assertEquals ( expectedMap , map ) |
testGivenMaxMinConstant ( ) { double tolerancePerc = 1 ; int nSamples = 500 ; int nFeatures = 3 ; org . nd4j . linalg . api . ndarray . INDArray featureSet = org . nd4j . linalg . factory . Nd4j . rand ( nSamples , nFeatures ) . mul ( 0.1 ) . add ( 10 ) ; org . nd4j . linalg . api . ndarray . INDArray labelSet = org . nd4j . linalg . factory . Nd4j . zeros ( nSamples , 1 ) ; org . nd4j . linalg . dataset . DataSet sampleDataSet = new org . nd4j . linalg . dataset . DataSet ( featureSet , labelSet ) ; double givenMin = - 1000 ; double givenMax = 1000 ; org . nd4j . linalg . dataset . api . preprocessor . DataNormalization myNormalizer = new org . nd4j . linalg . dataset . api . preprocessor . NormalizerMinMaxScaler ( givenMin , givenMax ) ; org . nd4j . linalg . dataset . DataSet transformed = sampleDataSet . copy ( ) ; myNormalizer . fit ( sampleDataSet ) ; myNormalizer . transform ( transformed ) ; org . nd4j . linalg . api . ndarray . INDArray expected = org . nd4j . linalg . factory . Nd4j . ones ( nSamples , nFeatures ) . mul ( givenMin ) ; org . nd4j . linalg . api . ndarray . INDArray delta = org . nd4j . linalg . ops . transforms . Transforms . abs ( transformed . getFeatures ( ) . sub ( expected ) ) . div ( expected ) ; double maxdeltaPerc = delta . max ( 0 , 1 ) . mul ( 100 ) . getDouble ( 0 ) ; "<AssertPlaceHolder>" ; } getDouble ( long ) { return cachedByteByteBuffer ( ) . getDouble ( ( ( ( int ) ( i ) ) * 8 ) ) ; } | org . junit . Assert . assertTrue ( ( maxdeltaPerc < tolerancePerc ) ) |
testNextSetBitAfterEnd ( ) { org . roaringbitmap . BitmapContainer container = new org . roaringbitmap . BitmapContainer ( org . roaringbitmap . TestBitmapContainer . evenBits ( ) , ( 1 << 15 ) ) ; container . bitmap [ 1023 ] = 0L ; container . cardinality -= 32 ; "<AssertPlaceHolder>" ; } nextSetBit ( int ) { int x = i > > 6 ; long w = bitmap . get ( x ) ; w >>>= i ; if ( w != 0 ) { return i + ( java . lang . Long . numberOfTrailingZeros ( w ) ) ; } for ( ++ x ; x < ( ( org . roaringbitmap . buffer . MappeableBitmapContainer . MAX_CAPACITY ) / 64 ) ; ++ x ) { long X = bitmap . get ( x ) ; if ( X != 0 ) { return ( x * 64 ) + ( java . lang . Long . numberOfTrailingZeros ( X ) ) ; } } return - 1 ; } | org . junit . Assert . assertEquals ( ( - 1 ) , container . nextSetBit ( ( ( 64 * 1023 ) + 5 ) ) ) |
testGetJavaHomeForNonDefault ( ) { final org . jboss . arquillian . container . tomcat . managed . TomcatManagedConfiguration commonTomcatManagedConfiguration = new org . jboss . arquillian . container . tomcat . managed . TomcatManagedConfiguration ( ) ; final java . lang . String expectedJavaHome = "EXPECTED_JAVA_HOME" ; commonTomcatManagedConfiguration . setJavaHome ( expectedJavaHome ) ; final java . lang . String actualJavaHome = commonTomcatManagedConfiguration . getJavaHome ( ) ; "<AssertPlaceHolder>" ; } getJavaHome ( ) { return javaHome ; } | org . junit . Assert . assertEquals ( expectedJavaHome , actualJavaHome ) |
testStoreAndQueryStartTimeExclude ( ) { org . hawkular . apm . api . model . trace . Trace trace1 = new org . hawkular . apm . api . model . trace . Trace ( ) ; trace1 . setTimestamp ( 1000000 ) ; trace1 . setTraceId ( "1" ) ; trace1 . setFragmentId ( "1" ) ; org . hawkular . apm . api . model . trace . Consumer c1 = new org . hawkular . apm . api . model . trace . Consumer ( ) ; trace1 . getNodes ( ) . add ( c1 ) ; org . hawkular . apm . tests . dist . TraceServiceITest . tracePublisher . publish ( null , java . util . Collections . singletonList ( trace1 ) ) ; org . hawkular . apm . api . services . Criteria criteria = new org . hawkular . apm . api . services . Criteria ( ) ; criteria . setStartTime ( 100 ) ; org . hawkular . apm . tests . common . Wait . until ( ( ) -> ( org . hawkular . apm . tests . dist . TraceServiceITest . traceService . searchFragments ( null , criteria ) . size ( ) ) == 1 ) ; criteria . setStartTime ( 1100 ) ; java . util . List < org . hawkular . apm . api . model . trace . Trace > result = org . hawkular . apm . tests . dist . TraceServiceITest . traceService . searchFragments ( null , criteria ) ; "<AssertPlaceHolder>" ; } searchFragments ( java . lang . String , org . hawkular . apm . api . services . Criteria ) { java . lang . String path = "traces/fragments/search?criteria=%s" ; return getResultsForUrl ( tenantId , org . hawkular . apm . trace . service . rest . client . TraceServiceRESTClient . TRACE_LIST , path , criteria ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testCreateMedicalEquipmentSectionBuilder ( ) { org . openhealthtools . mdht . uml . cda . builder . SectionBuilder < org . openhealthtools . mdht . uml . cda . hitsp . MedicalEquipmentSection > sectionBuilder = org . openhealthtools . mdht . uml . cda . hitsp . builder . HITSPBuilderFactory . createMedicalEquipmentSectionBuilder ( ) ; org . openhealthtools . mdht . uml . cda . hitsp . MedicalEquipmentSection section = sectionBuilder . buildSection ( ) ; "<AssertPlaceHolder>" ; Diagnostician . INSTANCE . validate ( section ) ; org . openhealthtools . mdht . uml . cda . util . CDAUtil . saveSnippet ( section , System . out ) ; } buildSection ( ) { org . openhealthtools . mdht . uml . cda . Section section = CDAFactory . eINSTANCE . createSection ( ) ; construct ( section ) ; return section ; } | org . junit . Assert . assertNotNull ( section ) |
input ( ) { com . asakusafw . runtime . io . text . tabular . TabularTextFormat format = com . asakusafw . runtime . io . text . tabular . TabularTextFormat . builder ( ) . build ( ) ; java . lang . String [ ] [ ] results = read ( format , new java . lang . String [ ] { "Hello,<sp>world!" } ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; } | org . junit . Assert . assertThat ( results , org . hamcrest . CoreMatchers . is ( new java . lang . String [ ] [ ] { new java . lang . String [ ] { "Hello,<sp>world!" } } ) ) |
should_list_roles ( ) { com . flow . platform . api . domain . user . Action action = new com . flow . platform . api . domain . user . Action ( ) ; action . setName ( "test" ) ; action . setTag ( ActionGroup . MANAGER ) ; actionService . create ( action ) ; "<AssertPlaceHolder>" ; } list ( ) { com . flow . platform . util . http . HttpResponse < java . lang . String > response = com . flow . platform . util . http . HttpClient . build ( platformURL . getAgentUrl ( ) ) . get ( ) . retry ( httpRetryTimes ) . bodyAsString ( ) ; if ( ! ( response . hasSuccess ( ) ) ) { throw new com . flow . platform . core . exception . HttpException ( "Unable<sp>to<sp>load<sp>agent<sp>list" ) ; } com . flow . platform . domain . Agent [ ] agents = Jsonable . GSON_CONFIG . fromJson ( response . getBody ( ) , com . flow . platform . domain . Agent [ ] . class ) ; return com . google . common . collect . Lists . newArrayList ( agents ) ; } | org . junit . Assert . assertEquals ( 1 , actionService . list ( ) . size ( ) ) |
getTableLocationPartitionedTableSnapshotsDisabledWithOverride ( ) { org . apache . hadoop . hive . metastore . api . StorageDescriptor sd = new org . apache . hadoop . hive . metastore . api . StorageDescriptor ( ) ; sd . setLocation ( ( ( com . hotels . bdp . circustrain . core . source . HdfsSnapshotLocationManagerTest . PARTITION_BASE_LOCATION ) + "/partition1" ) ) ; partition1 . setSd ( sd ) ; sd = new org . apache . hadoop . hive . metastore . api . StorageDescriptor ( ) ; sd . setLocation ( ( ( com . hotels . bdp . circustrain . core . source . HdfsSnapshotLocationManagerTest . PARTITION_BASE_LOCATION ) + "/partition2" ) ) ; partition2 . setSd ( sd ) ; com . hotels . bdp . circustrain . core . source . HdfsSnapshotLocationManager manager = new com . hotels . bdp . circustrain . core . source . HdfsSnapshotLocationManager ( hiveConf , com . hotels . bdp . circustrain . core . source . HdfsSnapshotLocationManagerTest . EVENT_ID , sourceTable , partitions , true , com . hotels . bdp . circustrain . core . source . HdfsSnapshotLocationManagerTest . PARTITION_BASE_LOCATION , sourceCatalogListener ) ; org . apache . hadoop . fs . Path tableLocation = manager . getTableLocation ( ) ; "<AssertPlaceHolder>" ; } getTableLocation ( ) { return tableLocation ; } | org . junit . Assert . assertThat ( tableLocation , org . hamcrest . CoreMatchers . is ( new org . apache . hadoop . fs . Path ( com . hotels . bdp . circustrain . core . source . HdfsSnapshotLocationManagerTest . PARTITION_BASE_LOCATION ) ) ) |
testEmptyTextFil ( ) { byte [ ] emptyContents = new byte [ ] { } ; java . lang . String output = readUsingTextCommand ( org . apache . hadoop . fs . shell . TestTextCommand . TEXT_FILENAME , emptyContents ) ; "<AssertPlaceHolder>" ; } readUsingTextCommand ( java . lang . String , byte [ ] ) { createFile ( fileName , fileContents ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; java . net . URI localPath = new java . net . URI ( fileName ) ; org . apache . hadoop . fs . shell . PathData pathData = new org . apache . hadoop . fs . shell . PathData ( localPath , conf ) ; org . apache . hadoop . fs . shell . Display . Text text = new org . apache . hadoop . fs . shell . Display . Text ( ) { @ org . apache . hadoop . fs . shell . Override public java . io . InputStream getInputStream ( org . apache . hadoop . fs . shell . PathData item ) throws java . io . IOException { return super . getInputStream ( item ) ; } } ; text . setConf ( conf ) ; java . io . InputStream stream = ( ( java . io . InputStream ) ( text . getInputStream ( pathData ) ) ) ; return inputStreamToString ( stream ) ; } | org . junit . Assert . assertTrue ( "" . equals ( output ) ) |
test_render ( ) { java . lang . String templateVariable = "Hello<sp>Freemarker!" ; java . util . Map < java . lang . String , java . lang . Object > model = new java . util . HashMap ( ) ; model . put ( "message" , templateVariable ) ; java . lang . String expected = java . lang . String . format ( "<h1>%s</h1>" , templateVariable ) ; java . lang . String actual = new spark . template . freemarker . FreeMarkerEngine ( ) . render ( new spark . ModelAndView ( model , "hello.ftl" ) ) ; "<AssertPlaceHolder>" ; } render ( spark . ModelAndView , java . util . Locale ) { java . lang . Object model = modelAndView . getModel ( ) ; if ( model instanceof java . util . Map ) { org . thymeleaf . context . Context context = new org . thymeleaf . context . Context ( locale ) ; context . setVariables ( ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( model ) ) ) ; return templateEngine . process ( modelAndView . getViewName ( ) , context ) ; } else { throw new java . lang . IllegalArgumentException ( "modelAndView.getModel()<sp>must<sp>return<sp>a<sp>java.util.Map" ) ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
convert ( ) { com . fasterxml . jackson . databind . ObjectMapper objectMapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; java . util . List < com . levelup . java . json . JsonArrayToObjectArray . NavItem > navigation = objectMapper . readValue ( jsonString , objectMapper . getTypeFactory ( ) . constructCollectionType ( java . util . List . class , com . levelup . java . json . JsonArrayToObjectArray . NavItem . class ) ) ; com . levelup . java . json . JsonArrayToObjectArray . logger . info ( navigation ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 4 , navigation . size ( ) ) |
testSearchRequestSubtreeLevelScopePerf ( ) { org . apache . directory . ldap . client . api . LdapConnection connection = new org . apache . directory . ldap . client . api . LdapNetworkConnection ( org . apache . directory . api . util . Network . LOOPBACK_HOSTNAME , getLdapServer ( ) . getPort ( ) ) ; try { connection . bind ( "uid=admin,ou=system" , "secret" ) ; org . apache . directory . api . ldap . model . cursor . EntryCursor cursor = connection . search ( "ou=system" , ",<sp>" 0 , SearchScope . SUBTREE , "*" ) ; int i = 0 ; while ( cursor . next ( ) ) { cursor . get ( ) ; ++ i ; } cursor . close ( ) ; "<AssertPlaceHolder>" ; for ( int j = 0 ; j < 10000 ; j ++ ) { cursor = connection . search ( "ou=system" , ",<sp>" 0 , SearchScope . SUBTREE , "*" ) ; while ( cursor . next ( ) ) { cursor . get ( ) ; } cursor . close ( ) ; } org . apache . directory . api . ldap . model . name . Dn dn = new org . apache . directory . api . ldap . model . name . Dn ( getService ( ) . getSchemaManager ( ) , "uid=admin,ou=system" ) ; org . apache . directory . api . ldap . model . message . SearchRequest searchRequest = new org . apache . directory . api . ldap . model . message . SearchRequestImpl ( ) ; searchRequest . setBase ( dn ) ; searchRequest . setFilter ( ",<sp>" 0 ) ; searchRequest . setScope ( SearchScope . SUBTREE ) ; searchRequest . addAttributes ( "*" ) ; searchRequest . setDerefAliases ( AliasDerefMode . DEREF_ALWAYS ) ; long t0 = java . lang . System . currentTimeMillis ( ) ; long t00 = 0L ; long tt0 = java . lang . System . currentTimeMillis ( ) ; int nbIterations = 200000 ; int count = 0 ; for ( int j = 0 ; j < nbIterations ; j ++ ) { if ( ( j % 10000 ) == 0 ) { long tt1 = java . lang . System . currentTimeMillis ( ) ; System . out . println ( ( ( j + ",<sp>" ) + ( tt1 - tt0 ) ) ) ; tt0 = tt1 ; } if ( j == 50000 ) { t00 = java . lang . System . currentTimeMillis ( ) ; } cursor = connection . search ( "ou=system" , ",<sp>" 0 , SearchScope . SUBTREE , "*" ) ; while ( cursor . next ( ) ) { count ++ ; cursor . get ( ) ; } cursor . close ( ) ; } long t1 = java . lang . System . currentTimeMillis ( ) ; java . lang . Long deltaWarmed = t1 - t00 ; System . out . println ( ( ( ( ( ( ( ( "SUB<sp>level<sp>-<sp>Delta<sp>:<sp>" + deltaWarmed ) + "(<sp>" ) + ( ( ( ( nbIterations - 50000 ) * 1000 ) / deltaWarmed ) * 10 ) ) + "<sp>per<sp>s<sp>)<sp>/" ) + ( t1 - t0 ) ) + ",<sp>count<sp>:<sp>" ) + count ) ) ; } catch ( org . apache . directory . api . ldap . model . exception . LdapException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( "Should<sp>not<sp>have<sp>caught<sp>exception." ) ; } finally { connection . unBind ( ) ; connection . close ( ) ; } } close ( ) { if ( org . apache . directory . server . xdbm . search . cursor . OrCursor . IS_DEBUG ) { org . apache . directory . server . xdbm . search . cursor . OrCursor . LOG_CURSOR . debug ( "Closing<sp>OrCursor<sp>{}" , this ) ; } super . close ( ) ; for ( org . apache . directory . api . ldap . model . cursor . Cursor < ? > cursor : cursors ) { cursor . close ( ) ; } } | org . junit . Assert . assertEquals ( 10 , i ) |
assertGetDefaultDataSourceNameWithMasterSlaveDataSourceName ( ) { org . apache . shardingsphere . api . config . sharding . ShardingRuleConfiguration shardingRuleConfig = new org . apache . shardingsphere . api . config . sharding . ShardingRuleConfiguration ( ) ; shardingRuleConfig . getMasterSlaveRuleConfigs ( ) . add ( new org . apache . shardingsphere . api . config . masterslave . MasterSlaveRuleConfiguration ( "ms_ds" , "master_ds" , java . util . Collections . singletonList ( "slave_ds" ) , new org . apache . shardingsphere . api . config . masterslave . LoadBalanceStrategyConfiguration ( "ROUND_ROBIN" ) ) ) ; java . lang . String actual = new org . apache . shardingsphere . core . rule . ShardingDataSourceNames ( shardingRuleConfig , java . util . Arrays . asList ( "master_ds" , "slave_ds" ) ) . getRawMasterDataSourceName ( "ms_ds" ) ; "<AssertPlaceHolder>" ; } getRawMasterDataSourceName ( java . lang . String ) { for ( org . apache . shardingsphere . api . config . masterslave . MasterSlaveRuleConfiguration each : shardingRuleConfig . getMasterSlaveRuleConfigs ( ) ) { if ( each . getName ( ) . equals ( dataSourceName ) ) { return each . getMasterDataSourceName ( ) ; } } return dataSourceName ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( "master_ds" ) ) |
testCompliesNotWithWidthSmallerThanMinWidth ( ) { com . eclipsesource . tabris . passepartout . internal . condition . MinWidthCondition condition = new com . eclipsesource . tabris . passepartout . internal . condition . MinWidthCondition ( new com . eclipsesource . tabris . passepartout . internal . unit . Pixel ( 100 ) ) ; com . eclipsesource . tabris . passepartout . Bounds bounds = new com . eclipsesource . tabris . passepartout . Bounds ( 10 , 10 , 90 , 0 ) ; boolean complies = condition . compliesWith ( createEnvironment ( bounds ) ) ; "<AssertPlaceHolder>" ; } createEnvironment ( org . eclipse . swt . widgets . Widget ) { com . eclipsesource . tabris . passepartout . internal . Clauses . whenNull ( widget ) . throwIllegalArgument ( "Widget<sp>must<sp>not<sp>be<sp>null" ) ; com . eclipsesource . tabris . passepartout . internal . Clauses . when ( widget . isDisposed ( ) ) . throwIllegalState ( "Widget<sp>already<sp>disposed" ) ; return new com . eclipsesource . tabris . passepartout . internal . UIEnvironmentImpl ( com . eclipsesource . tabris . passepartout . internal . UIEnvironmentFactory . getParentBounds ( widget ) , com . eclipsesource . tabris . passepartout . internal . UIEnvironmentFactory . getReferenceBounds ( widget ) , com . eclipsesource . tabris . passepartout . internal . UIEnvironmentFactory . getParentFontSize ( widget ) ) ; } | org . junit . Assert . assertFalse ( complies ) |
getModifiers ( ) { "<AssertPlaceHolder>" ; } getModifiers ( ) { return modifiers ; } | org . junit . Assert . assertEquals ( modifiers , method . getModifiers ( ) ) |
entIsNotCompliantWhenSocketsAreNotCovered ( ) { org . candlepin . model . Consumer c = mockConsumer ( PRODUCT_1 ) ; c . setFact ( "cpu.cpu_socket(s)" , "8" ) ; org . candlepin . model . Entitlement ent = mockEntitlement ( c , PRODUCT_1 ) ; ent . getPool ( ) . getProduct ( ) . setAttribute ( Product . Attributes . SOCKETS , "4" ) ; org . candlepin . model . CandlepinQuery cqmock = mock ( org . candlepin . model . CandlepinQuery . class ) ; when ( cqmock . list ( ) ) . thenReturn ( java . util . Arrays . asList ( ent ) ) ; when ( entCurator . listByConsumerAndDate ( eq ( c ) , any ( java . util . Date . class ) ) ) . thenReturn ( cqmock ) ; "<AssertPlaceHolder>" ; } isEntitlementCompliant ( org . candlepin . model . Consumer , org . candlepin . model . Entitlement , java . util . Date ) { java . util . List < org . candlepin . model . Entitlement > ents = entCurator . listByConsumerAndDate ( consumer , onDate ) . list ( ) ; java . util . stream . Stream < org . candlepin . dto . rules . v1 . EntitlementDTO > entStream = ( ents == null ) ? java . util . stream . Stream . empty ( ) : ents . stream ( ) . map ( this . translator . getStreamMapper ( org . candlepin . model . Entitlement . class , org . candlepin . dto . rules . v1 . EntitlementDTO . class ) ) ; java . util . stream . Stream < org . candlepin . dto . rules . v1 . GuestIdDTO > guestIdStream = ( ( consumer . getGuestIds ( ) ) == null ) ? java . util . stream . Stream . empty ( ) : consumer . getGuestIds ( ) . stream ( ) . map ( this . translator . getStreamMapper ( org . candlepin . model . GuestId . class , org . candlepin . dto . rules . v1 . GuestIdDTO . class ) ) ; org . candlepin . policy . js . JsonJsContext args = new org . candlepin . policy . js . JsonJsContext ( mapper ) ; args . put ( "consumer" , this . translator . translate ( consumer , org . candlepin . dto . rules . v1 . ConsumerDTO . class ) ) ; args . put ( "entitlement" , this . translator . translate ( ent , org . candlepin . dto . rules . v1 . EntitlementDTO . class ) ) ; args . put ( "entitlements" , entStream ) ; args . put ( "log" , org . candlepin . policy . js . compliance . ComplianceRules . log , false ) ; args . put ( "guestIds" , guestIdStream ) ; return jsRules . runJsFunction ( org . candlepin . policy . js . compliance . Boolean . class , "is_ent_compliant" , args ) ; } | org . junit . Assert . assertFalse ( compliance . isEntitlementCompliant ( c , ent , new java . util . Date ( ) ) ) |
setSourceUri ( ) { com . google . cloud . tools . eclipse . appengine . libraries . model . LibraryFile libraryFile = new com . google . cloud . tools . eclipse . appengine . libraries . model . LibraryFile ( mavenCoordinates ) ; libraryFile . setSourceUri ( new java . net . URI ( "http://example.com" ) ) ; "<AssertPlaceHolder>" ; } getSourceUri ( ) { return sourceUri ; } | org . junit . Assert . assertThat ( libraryFile . getSourceUri ( ) . toString ( ) , org . hamcrest . CoreMatchers . is ( "http://example.com" ) ) |
testGetId ( ) { int id = OnmsSeverity . CLEARED . getId ( ) ; org . opennms . netmgt . model . OnmsSeverity sev = OnmsSeverity . CLEARED ; "<AssertPlaceHolder>" ; } getId ( ) { return java . util . Optional . ofNullable ( m_id ) ; } | org . junit . Assert . assertEquals ( id , sev . getId ( ) ) |
contentTypeExtraction ( ) { org . apache . shindig . gadgets . http . HttpRequest request = new org . apache . shindig . gadgets . http . HttpRequest ( org . apache . shindig . gadgets . http . HttpRequestTest . DEFAULT_URI ) . addHeader ( "Content-Type" , org . apache . shindig . gadgets . http . HttpRequestTest . CONTENT_TYPE ) ; "<AssertPlaceHolder>" ; } getContentType ( ) { java . lang . String type = getHeader ( "Content-Type" ) ; if ( type == null ) { return org . apache . shindig . gadgets . http . HttpRequest . DEFAULT_CONTENT_TYPE ; } return type ; } | org . junit . Assert . assertEquals ( org . apache . shindig . gadgets . http . HttpRequestTest . CONTENT_TYPE , request . getContentType ( ) ) |
testNullReturn ( ) { com . eclipsesource . v8 . utils . V8Executor executor = new com . eclipsesource . v8 . utils . V8Executor ( "null;" ) ; executor . start ( ) ; executor . join ( ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; } | org . junit . Assert . assertNull ( executor . getResult ( ) ) |
testHostnameContainsWhenMatch ( ) { java . lang . String substring = halfOf ( message . hostname ) ; matcher . setHostnameContains ( new tech . aroma . application . service . reactions . matchers . MatcherHostnameContains ( substring ) ) ; tech . aroma . application . service . reactions . matchers . MessageMatcher result = instance . matcherFor ( matcher ) ; "<AssertPlaceHolder>" ; } matcherFor ( tech . aroma . thrift . reactions . AromaMatcher ) { if ( ( matcher == null ) || ( matcher . isSetAll ( ) ) ) { return tech . aroma . application . service . reactions . matchers . MessageMatchers . matchesAll ( ) ; } if ( matcher . isSetApplicationIs ( ) ) { java . lang . String appId = matcher . getApplicationIs ( ) . getAppId ( ) ; checkThat ( appId ) . is ( validApplicationId ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . applicationIs ( appId ) ; } if ( matcher . isSetApplicationIsNot ( ) ) { java . lang . String appId = matcher . getApplicationIsNot ( ) . getAppId ( ) ; checkThat ( appId ) . is ( validApplicationId ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . applicationIsNot ( appId ) ; } if ( matcher . isSetBodyContains ( ) ) { java . lang . String substring = matcher . getBodyContains ( ) . getSubstring ( ) ; checkThat ( substring ) . usingMessage ( "Matcher<sp>substring<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . bodyContains ( substring ) ; } if ( matcher . isSetBodyDoesNotContain ( ) ) { java . lang . String substring = matcher . getBodyDoesNotContain ( ) . getSubstring ( ) ; checkThat ( substring ) . usingMessage ( "Matcher<sp>substring<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . bodyDoesNotContain ( substring ) ; } if ( matcher . isSetBodyIs ( ) ) { java . lang . String expectedBody = matcher . getBodyIs ( ) . getExpectedBody ( ) ; checkThat ( expectedBody ) . usingMessage ( "Expected<sp>Body<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . bodyIs ( expectedBody ) ; } if ( matcher . isSetTitleContains ( ) ) { java . lang . String substring = matcher . getTitleContains ( ) . getSubstring ( ) ; checkThat ( substring ) . usingMessage ( "Matcher<sp>substring<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . titleContains ( substring ) ; } if ( matcher . isSetTitleDoesNotContain ( ) ) { java . lang . String substring = matcher . getTitleDoesNotContain ( ) . getSubstring ( ) ; checkThat ( substring ) . usingMessage ( "Matcher<sp>substring<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . not ( tech . aroma . application . service . reactions . matchers . MessageMatchers . titleContains ( substring ) ) ; } if ( matcher . isSetTitleIs ( ) ) { java . lang . String expectedTitle = matcher . getTitleIs ( ) . getExpectedTitle ( ) ; checkThat ( expectedTitle ) . usingMessage ( "Expected<sp>Message<sp>Title<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . titleIs ( expectedTitle ) ; } if ( matcher . isSetTitleIsNot ( ) ) { java . lang . String title = matcher . getTitleIsNot ( ) . getTitle ( ) ; checkThat ( title ) . usingMessage ( "Message<sp>Title<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . titleIsNot ( title ) ; } if ( matcher . isSetUrgencyEquals ( ) ) { java . util . Set < tech . aroma . thrift . Urgency > expectedUrgencies = sir . wellington . alchemy . collections . sets . Sets . nullToEmpty ( matcher . getUrgencyEquals ( ) . getPossibleUrgencies ( ) ) ; checkThat ( expectedUrgencies ) . usingMessage ( "Expected<sp>Urgency<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptySet ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . urgencyIsOneOf ( expectedUrgencies ) ; } if ( matcher . isSetHostnameIs ( ) ) { java . lang . String expectedHostname = matcher . getHostnameIs ( ) . getExpectedHostname ( ) ; checkThat ( expectedHostname ) . usingMessage ( "Expected<sp>Hostname<sp>cannote<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . hostnameIs ( expectedHostname ) ; } if ( matcher . isSetHostnameContains ( ) ) { java . lang . String substring = matcher . getHostnameContains ( ) . getSubstring ( ) ; checkThat ( substring ) . usingMessage ( "Hostname<sp>substring<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . hostnameContains ( substring ) ; } if ( matcher . isSetHostnameDoesNotContain ( ) ) { java . lang . String substring = matcher . getHostnameDoesNotContain ( ) . getSubstring ( ) ; checkThat ( substring ) . usingMessage ( "Hostname<sp>substring<sp>cannot<sp>be<sp>empty" ) . is ( nonEmptyString ( ) ) ; return tech . aroma . application . service . reactions . matchers . MessageMatchers . hostnameDoesNotContain ( substring ) ; } return tech . aroma . application . service . reactions . matchers . MessageMatchers . matchesNone ( ) ; } | org . junit . Assert . assertThat ( result . matches ( message ) , org . hamcrest . Matchers . is ( true ) ) |
remove_null_from_list_guava_fluentiterbale ( ) { java . util . List < java . lang . String > strings = com . google . common . collect . Lists . newArrayList ( null , "www" , null , "leveluplunch" , "com" , null ) ; java . util . List < java . lang . String > filterStrings = com . google . common . collect . FluentIterable . from ( strings ) . filter ( com . google . common . base . Predicates . notNull ( ) ) . toList ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 3 , filterStrings . size ( ) ) |
shouldQueryView ( ) { final com . couchbase . client . java . bucket . BucketManager bucketManager = bucket . bucketManager ( ) ; final com . couchbase . client . java . view . View view = com . couchbase . client . java . view . DefaultView . create ( "byFirstname" , org . apache . commons . io . IOUtils . toString ( getClass ( ) . getResourceAsStream ( "/byfirstname.js" ) ) ) ; final com . couchbase . client . java . view . DesignDocument document = com . couchbase . client . java . view . DesignDocument . create ( "person" , com . google . common . collect . ImmutableList . of ( view ) ) ; try { bucketManager . upsertDesignDocument ( document ) ; repository . save ( person ) ; final com . couchbase . client . java . view . ViewQuery query = com . couchbase . client . java . view . ViewQuery . from ( document . name ( ) , view . name ( ) ) ; query . stale ( Stale . FALSE ) ; query . debug ( ) ; query . key ( person . getFirstname ( ) ) ; final java . lang . Iterable < com . github . jloisel . reactive . repository . couchbase . it . Person > found = repository . queryView ( query ) ; "<AssertPlaceHolder>" ; } finally { bucketManager . removeDesignDocument ( document . name ( ) ) ; } } queryView ( com . couchbase . client . java . view . ViewQuery ) { return blocking ( async . queryView ( query ) . toList ( ) ) . single ( ) ; } | org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableList . of ( person ) , found ) |
test_valid_name_maxlength ( ) { org . restfulwhois . rdap . common . dto . IpDto ipDto = generateIpDto ( ) ; java . lang . String stringMaxLength = createStringWithLength ( UpdateValidateUtil . MAX_LENGTH_255 ) ; ipDto . setName ( stringMaxLength ) ; "<AssertPlaceHolder>" ; java . lang . String content = org . restfulwhois . rdap . JsonHelper . serialize ( ipDto ) ; mockMvc . perform ( post ( org . restfulwhois . rdap . controller . NetworkCreateControllerTest . URI_IP_U ) . contentType ( org . springframework . http . MediaType . parseMediaType ( rdapJson ) ) . content ( content ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( content ( ) . contentType ( rdapJson ) ) . andExpect ( jsonPath ( "$.handle" ) . value ( ipDto . getHandle ( ) ) ) ; } getName ( ) { return name ; } | org . junit . Assert . assertTrue ( ( ( ipDto . getName ( ) . length ( ) ) == ( org . restfulwhois . rdap . common . util . UpdateValidateUtil . MAX_LENGTH_255 ) ) ) |
testNederlandseNationaliteitGeenVoornaamWelVoornaamInBericht ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > overtreders = brby0153 . voerRegelUit ( bouwHuidigeSituatie ( null ) , bouwNieuweSituatie ( NationaliteitcodeAttribuut . NL_NATIONALITEIT_CODE , "Jan" ) , null , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , overtreders . size ( ) ) |
commutativeNewUpdatesSingleBuilder ( ) { org . apache . accumulo . server . replication . proto . Replication . Status newFile = org . apache . accumulo . server . replication . StatusUtil . fileCreated ( 100 ) ; org . apache . accumulo . server . replication . proto . Replication . Status firstSync = org . apache . accumulo . server . replication . StatusUtil . ingestedUntil ( builder , 100 ) ; org . apache . accumulo . server . replication . proto . Replication . Status secondSync = org . apache . accumulo . server . replication . StatusUtil . ingestedUntil ( builder , 200 ) ; org . apache . accumulo . server . replication . proto . Replication . Status order1 = combiner . typedReduce ( key , java . util . Arrays . asList ( newFile , firstSync , secondSync ) . iterator ( ) ) ; org . apache . accumulo . server . replication . proto . Replication . Status order2 = combiner . typedReduce ( key , java . util . Arrays . asList ( newFile , secondSync , firstSync ) . iterator ( ) ) ; "<AssertPlaceHolder>" ; } iterator ( ) { if ( ( iflag ) != null ) ( ( org . apache . accumulo . core . iterators . system . InterruptibleIterator ) ( iter ) ) . setInterruptFlag ( iflag ) ; return iter ; } | org . junit . Assert . assertEquals ( order1 , order2 ) |
into ( ) { int sum = new com . gs . collections . impl . lazy . LazyIterableAdapter ( com . gs . collections . impl . list . Interval . oneTo ( 5 ) ) . into ( com . gs . collections . impl . list . mutable . FastList . < java . lang . Integer > newList ( ) ) . injectInto ( 0 , AddFunction . INTEGER_TO_INT ) ; "<AssertPlaceHolder>" ; } injectInto ( IV , com . gs . collections . api . block . function . Function2 ) { synchronized ( this . lock ) { return this . iterable . injectInto ( injectedValue , function ) ; } } | org . junit . Assert . assertEquals ( 15 , sum ) |
getTestMethodSourceCode_A$TestMethodMeta_ArrangeActAssert_JUnit3 ( ) { org . junithelper . core . config . Configuration config = new org . junithelper . core . config . Configuration ( ) ; config . junitVersion = org . junithelper . core . config . JUnitVersion . version3 ; config . testingPatternExplicitComment = org . junithelper . core . config . TestingPatternExplicitComment . ArrangeActAssert ; org . junithelper . core . generator . TestMethodGeneratorImpl localGenerator = new org . junithelper . core . generator . TestMethodGeneratorImpl ( config , lineBreakProvider ) ; java . lang . String sourceCodeString = "package<sp>hoge.foo;<sp>import<sp>java.util.List;<sp>public<sp>class<sp>Sample<sp>{<sp>public<sp>Sample()<sp>{}\r\n<sp>public<sp>int<sp>doSomething(String<sp>str,<sp>long<sp>longValue)<sp>throws<sp>Throwable<sp>{<sp>System.out.println(\"aaaa\")<sp>}<sp>}" ; org . junithelper . core . meta . ClassMeta targetClassMeta = classMetaExtractor . extract ( sourceCodeString ) ; localGenerator . initialize ( targetClassMeta ) ; org . junithelper . core . meta . MethodMeta targetMethodMeta = targetClassMeta . methods . get ( 0 ) ; org . junithelper . core . meta . TestMethodMeta testMethodMeta = localGenerator . getTestMethodMeta ( targetMethodMeta ) ; java . lang . String actual = localGenerator . getTestMethodSourceCode ( testMethodMeta ) ; java . lang . String expected = "\tpublic<sp>void<sp>test_doSomething_A$String$long()<sp>throws<sp>Throwable<sp>{\r\n\t\t//<sp>TODO<sp>auto-generated<sp>by<sp>JUnit<sp>Helper.\r\n\t\t//<sp>Arrange\r\n\t\tSample<sp>target<sp>=<sp>new<sp>Sample();\r\n\t\tString<sp>str<sp>=<sp>null;\r\n\t\tlong<sp>longValue<sp>=<sp>0L;\r\n\t\t//<sp>Act\r\n\t\tint<sp>actual<sp>=<sp>target.doSomething(str,<sp>longValue);\r\n\t\t//<sp>Assert\r\n\t\tint<sp>expected<sp>=<sp>0;\r\n\t\tassertEquals(expected,<sp>actual);\r\n\t}\r\n" ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testSerialization ( ) { org . jfree . chart . annotations . CategoryPointerAnnotation a1 = new org . jfree . chart . annotations . CategoryPointerAnnotation ( "Label" , "A" , 20.0 , Math . PI ) ; org . jfree . chart . annotations . CategoryPointerAnnotation a2 = ( ( org . jfree . chart . annotations . CategoryPointerAnnotation ) ( org . jfree . chart . TestUtilities . serialised ( a1 ) ) ) ; "<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 ( a1 , a2 ) |
missedTypeParameter ( ) { final org . nohope . reflection . TypeReference < java . lang . String > reference = org . nohope . reflection . TypeReferenceTest . getReference ( ) ; "<AssertPlaceHolder>" ; } getTypeClass ( ) { return rawType ; } | org . junit . Assert . assertNull ( reference . getTypeClass ( ) ) |
startingSimulatorWorksWhenSimulatorNotRunning ( ) { ImmutableList . Builder < Map . Entry < com . facebook . buck . util . ProcessExecutorParams , com . facebook . buck . util . FakeProcess > > fakeProcessesBuilder = com . google . common . collect . ImmutableList . builder ( ) ; fakeProcessesBuilder . add ( new java . util . AbstractMap . SimpleImmutableEntry ( com . facebook . buck . apple . simulator . AppleSimulatorControllerTest . SIMCTL_LIST_PARAMS , new com . facebook . buck . util . FakeProcess ( 0 ) ) ) ; fakeProcessesBuilder . add ( new java . util . AbstractMap . SimpleImmutableEntry ( com . facebook . buck . util . ProcessExecutorParams . builder ( ) . setCommand ( com . google . common . collect . ImmutableList . of ( "open" , "-a" , com . facebook . buck . apple . simulator . AppleSimulatorControllerTest . IOS_SIMULATOR_PATH . toString ( ) , "--args" , "-CurrentDeviceUDID" , "70200ED8-EEF1-4BDB-BCCF-3595B137D67D" ) ) . build ( ) , new com . facebook . buck . util . FakeProcess ( 0 ) ) ) ; fakeProcessesBuilder . add ( new java . util . AbstractMap . SimpleImmutableEntry ( com . facebook . buck . apple . simulator . AppleSimulatorControllerTest . SIMCTL_LIST_PARAMS , new com . facebook . buck . util . FakeProcess ( 0 , ( "<sp>iPhone<sp>5<sp>(45BD7164-686C-474F-8C68-3730432BC5F2)<sp>(Shutdown)\n" + "<sp>iPhone<sp>5s<sp>(70200ED8-EEF1-4BDB-BCCF-3595B137D67D)<sp>(Booted)\n" ) , "" ) ) ) ; com . facebook . buck . util . FakeProcessExecutor fakeProcessExecutor = new com . facebook . buck . util . FakeProcessExecutor ( fakeProcessesBuilder . build ( ) ) ; com . facebook . buck . apple . simulator . AppleSimulatorController appleSimulatorController = new com . facebook . buck . apple . simulator . AppleSimulatorController ( fakeProcessExecutor , com . facebook . buck . apple . simulator . AppleSimulatorControllerTest . SIMCTL_PATH , com . facebook . buck . apple . simulator . AppleSimulatorControllerTest . IOS_SIMULATOR_PATH ) ; java . util . Optional < java . lang . Long > result = appleSimulatorController . startSimulator ( "70200ED8-EEF1-4BDB-BCCF-3595B137D67D" , 1000 ) ; "<AssertPlaceHolder>" ; } of ( com . facebook . buck . core . config . BuckConfig ) { return new com . facebook . buck . jvm . java . JavaBuckConfig ( delegate ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( java . util . Optional . of ( 0L ) ) ) |
compareIndexAndTraversal ( ) { org . neo4j . graphdb . index . IndexManager index = org . neo4j . rest . graphdb . MatrixDatabaseTest . graphDb . index ( ) ; org . neo4j . graphdb . index . Index < org . neo4j . graphdb . Node > goodGuys = index . forNodes ( "heroes" ) ; org . neo4j . graphdb . index . IndexHits < org . neo4j . graphdb . Node > hits = goodGuys . query ( "name" , "*" ) ; org . neo4j . graphdb . traversal . Traverser heroesTraverser = org . neo4j . rest . graphdb . MatrixDatabaseTest . getHeroes ( ) ; "<AssertPlaceHolder>" ; } nodes ( ) { return new org . neo4j . helpers . collection . IterableWrapper < org . neo4j . graphdb . Node , org . neo4j . graphdb . Path > ( paths ) { @ org . neo4j . rest . graphdb . traversal . Override protected org . neo4j . graphdb . Node underlyingObjectToObject ( org . neo4j . graphdb . Path path ) { return path . endNode ( ) ; } } ; } | org . junit . Assert . assertEquals ( heroesTraverser . nodes ( ) . iterator ( ) . next ( ) . getId ( ) , hits . iterator ( ) . next ( ) . getId ( ) ) |
testIp ( ) { byte [ ] bytes = org . bitcoinj . script . HEX . decode ( "41043e96222332ea7848323c08116dddafbfa917b8e37f0bdf63841628267148588a09a43540942d58d49717ad3fabfe14978cf4f0a8b84d2435dad16e9aa4d7f935ac" ) ; org . bitcoinj . script . Script s = new org . bitcoinj . script . Script ( bytes ) ; "<AssertPlaceHolder>" ; } isSentToRawPubKey ( ) { return ( ( ( ( chunks . size ( ) ) == 2 ) && ( chunks . get ( 1 ) . equalsOpCode ( org . bitcoinj . script . OP_CHECKSIG ) ) ) && ( ! ( chunks . get ( 0 ) . isOpCode ( ) ) ) ) && ( ( chunks . get ( 0 ) . data . length ) > 1 ) ; } | org . junit . Assert . assertTrue ( s . isSentToRawPubKey ( ) ) |
flipTest8 ( ) { org . krakenapps . pcap . util . Buffer buffer = new org . krakenapps . pcap . util . ChainBuffer ( ) ; byte [ ] testArray = new byte [ ] { 1 , 2 } ; byte [ ] testArray2 = new byte [ ] { 3 , 4 , 5 } ; byte [ ] testArray3 = new byte [ ] { 6 , 7 , 8 , 9 } ; byte [ ] testArray4 = new byte [ ] { 10 , 11 } ; byte [ ] testArray5 = new byte [ ] { 12 , 13 , 14 } ; buffer . addLast ( testArray ) ; buffer . addLast ( testArray2 ) ; buffer . addLast ( testArray3 ) ; buffer . addLast ( testArray4 ) ; buffer . addLast ( testArray5 ) ; org . krakenapps . pcap . util . Buffer buffer2 = new org . krakenapps . pcap . util . ChainBuffer ( ) ; byte [ ] testArray6 = new byte [ ] { 101 , 102 , 103 , 104 } ; byte [ ] testArray7 = new byte [ ] { 105 , 106 , 107 , 108 , 109 } ; byte [ ] testArray8 = new byte [ ] { 110 , 111 , 112 } ; buffer2 . addLast ( testArray6 ) ; buffer2 . addLast ( testArray7 ) ; buffer2 . addLast ( testArray8 ) ; buffer . addLast ( buffer2 ) ; byte [ ] b = new byte [ 26 ] ; buffer . gets ( b ) ; buffer . flip ( ) ; "<AssertPlaceHolder>" ; } readableBytes ( ) { if ( ( ( buffers . size ( ) ) <= 0 ) || ( isEOB ( ) ) ) return 0 ; byte [ ] buf = buffers . get ( bufIndex ) ; int remain = ( buf . length ) - ( bufOffset ) ; for ( int i = ( bufIndex ) + 1 ; i < ( buffers . size ( ) ) ; i ++ ) { buf = buffers . get ( i ) ; remain += buf . length ; } return remain ; } | org . junit . Assert . assertEquals ( 26 , buffer . readableBytes ( ) ) |
testInitializationUniqueSymbol ( ) { org . orbisgis . legend . thematic . constant . UniqueSymbolLine usl = getUniqueSymbolLine ( org . orbisgis . legend . analyzer . CONSTANT_LINE ) ; "<AssertPlaceHolder>" ; } getUniqueSymbolLine ( java . lang . String ) { org . orbisgis . coremap . renderer . se . Style st = getStyle ( s ) ; org . orbisgis . coremap . renderer . se . LineSymbolizer ls = ( ( org . orbisgis . coremap . renderer . se . LineSymbolizer ) ( st . getRules ( ) . get ( 0 ) . getCompositeSymbolizer ( ) . getSymbolizerList ( ) . get ( 0 ) ) ) ; return new org . orbisgis . legend . thematic . constant . UniqueSymbolLine ( ls ) ; } | org . junit . Assert . assertTrue ( true ) |
testAppendSchemaChange ( ) { org . sagebionetworks . repo . model . table . ColumnChange add = new org . sagebionetworks . repo . model . table . ColumnChange ( ) ; add . setOldColumnId ( null ) ; add . setNewColumnId ( "123" ) ; org . sagebionetworks . repo . model . table . ColumnChange delete = new org . sagebionetworks . repo . model . table . ColumnChange ( ) ; delete . setOldColumnId ( "456" ) ; delete . setNewColumnId ( null ) ; org . sagebionetworks . repo . model . table . ColumnChange update = new org . sagebionetworks . repo . model . table . ColumnChange ( ) ; update . setOldColumnId ( "777" ) ; update . setNewColumnId ( "888" ) ; java . util . List < org . sagebionetworks . repo . model . table . ColumnChange > changes = new java . util . LinkedList < org . sagebionetworks . repo . model . table . ColumnChange > ( ) ; changes . add ( add ) ; changes . add ( delete ) ; changes . add ( update ) ; java . util . List < java . lang . String > current = new java . util . LinkedList < java . lang . String > ( ) ; current . add ( "123" ) ; current . add ( "888" ) ; long versionNumber = appendSchemaChangeToTable ( creatorUserGroupId , tableId , current , changes ) ; java . util . List < org . sagebionetworks . repo . model . table . ColumnChange > back = tableRowTruthDao . getSchemaChangeForVersion ( tableId , versionNumber ) ; "<AssertPlaceHolder>" ; } getSchemaChangeForVersion ( java . lang . String , long ) { java . util . List < org . sagebionetworks . repo . model . table . ColumnChange > changes = tableRowTruthDao . getSchemaChangeForVersion ( tableId , versionNumber ) ; return columModelManager . getColumnChangeDetails ( changes ) ; } | org . junit . Assert . assertEquals ( changes , back ) |
testHostDifferentCase ( ) { java . lang . String host = "matthieu-test.woonoz.dev" ; java . lang . String expectedRewritedHost = "google.com" ; com . woonoz . proxy . servlet . UrlRewriter rewriter = org . easymock . EasyMock . createMock ( com . woonoz . proxy . servlet . UrlRewriter . class ) ; org . easymock . EasyMock . expect ( rewriter . rewriteHost ( host ) ) . andReturn ( expectedRewritedHost ) ; org . easymock . EasyMock . replay ( rewriter ) ; com . woonoz . proxy . servlet . AbstractHeadersHandler handler = new com . woonoz . proxy . servlet . ClientHeadersHandler ( rewriter ) ; java . lang . String actualValue = handler . handleHeader ( "HoST" , host ) ; "<AssertPlaceHolder>" ; org . easymock . EasyMock . verify ( rewriter ) ; } handleHeader ( java . lang . String , java . lang . String ) { com . woonoz . proxy . servlet . HeadersToSubstitute handler = headersToHandle . get ( toLower ( headerName ) ) ; if ( handler != null ) { return handler . handleValue ( headerValue , urlRewriter ) ; } else { return headerValue ; } } | org . junit . Assert . assertEquals ( expectedRewritedHost , actualValue ) |
maxTxnLow ( ) { java . util . BitSet bitSet = new java . util . BitSet ( 2 ) ; bitSet . set ( 0 , 2 ) ; org . apache . hadoop . hive . common . ValidWriteIdList writeIds = new org . apache . hadoop . hive . common . ValidCompactorWriteIdList ( tableName , new long [ ] { 13 , 14 } , bitSet , 12 ) ; org . apache . hadoop . hive . common . ValidWriteIdList . RangeResponse rsp = writeIds . isWriteIdRangeValid ( 7 , 9 ) ; "<AssertPlaceHolder>" ; } isWriteIdRangeValid ( long , long ) { if ( minWriteId > ( highWatermark ) ) { return RangeResponse . NONE ; } else if ( ( ( exceptions . length ) > 0 ) && ( ( exceptions [ 0 ] ) > maxWriteId ) ) { return RangeResponse . ALL ; } long count = java . lang . Math . max ( 0 , ( maxWriteId - ( highWatermark ) ) ) ; for ( long txn : exceptions ) { if ( ( minWriteId <= txn ) && ( txn <= maxWriteId ) ) { count += 1 ; } } if ( count == 0 ) { return RangeResponse . ALL ; } else if ( count == ( ( maxWriteId - minWriteId ) + 1 ) ) { return RangeResponse . NONE ; } else { return RangeResponse . SOME ; } } | org . junit . Assert . assertEquals ( ValidWriteIdList . RangeResponse . ALL , rsp ) |
shouldRecordSuccessTestExecutionWhenSaveAll ( ) { final java . lang . String oldValue = updateRecorderToDefaultOption ( ) ; try { TestRecorderRule . RECORDER_OPTION = TestRecorderRule . ALWAYS ; org . junit . runner . Description desc = description ( "shouldRecordSuccessTestExecutionWhenSaveAll" ) ; org . jenkinsci . test . acceptance . recorder . TestRecorderRule testRecorderRule = rule ( desc ) ; testRecorderRule . starting ( desc ) ; System . out . println ( "Hello<sp>World" ) ; testRecorderRule . succeeded ( desc ) ; testRecorderRule . finished ( desc ) ; java . io . File outputFile = outputFile ( desc ) ; "<AssertPlaceHolder>" ; TestRecorderRule . RECORDER_OPTION = TestRecorderRule . FAILURES ; outputFile . delete ( ) ; } finally { restoreRecorderOption ( oldValue ) ; } } existingFile ( ) { return new org . jenkinsci . test . acceptance . Matcher < java . io . File > ( "an<sp>existing<sp>file" ) { @ org . jenkinsci . test . acceptance . Override public boolean matchesSafely ( final java . io . File item ) { return ( item . exists ( ) ) && ( item . isFile ( ) ) ; } @ org . jenkinsci . test . acceptance . Override public void describeMismatchSafely ( final java . io . File item , final org . hamcrest . Description desc ) { desc . appendText ( ( "File<sp>does<sp>not<sp>exist<sp>" + ( item . getAbsolutePath ( ) ) ) ) ; } } ; } | org . junit . Assert . assertThat ( outputFile , org . hamcrest . core . Is . is ( org . jenkinsci . test . acceptance . Matchers . existingFile ( ) ) ) |
testGetOperationQualifiedName ( ) { org . mockito . Mockito . when ( operationMeta . getSchemaQualifiedName ( ) ) . thenReturn ( "value" ) ; java . lang . String qualifiedName = operationMeta . getSchemaQualifiedName ( ) ; "<AssertPlaceHolder>" ; } getSchemaQualifiedName ( ) { return schemaQualifiedName ; } | org . junit . Assert . assertEquals ( "value" , qualifiedName ) |
testIfResourceIsNotContained ( ) { org . onosproject . net . resource . DiscreteResource res1 = org . onosproject . net . resource . Resources . discrete ( org . onosproject . net . DeviceId . deviceId ( "a" ) , org . onosproject . net . PortNumber . portNumber ( 1 ) ) . resource ( ) ; org . onosproject . net . resource . DiscreteResource res2 = org . onosproject . net . resource . Resources . discrete ( org . onosproject . net . DeviceId . deviceId ( "a" ) , org . onosproject . net . PortNumber . portNumber ( 2 ) ) . resource ( ) ; org . onosproject . store . resource . impl . DiscreteResources sut = org . onosproject . store . resource . impl . EncodableDiscreteResources . of ( com . google . common . collect . ImmutableSet . of ( res1 ) ) ; "<AssertPlaceHolder>" ; } containsAny ( java . util . Set ) { return ! ( com . google . common . collect . Sets . intersection ( this . values ( ) , other ) . isEmpty ( ) ) ; } | org . junit . Assert . assertThat ( sut . containsAny ( com . google . common . collect . ImmutableSet . of ( res2 ) ) , org . hamcrest . Matchers . is ( false ) ) |
save_with_mentions ( ) { com . querydsl . example . sql . model . User other = new com . querydsl . example . sql . model . User ( ) ; other . setUsername ( "dexter" ) ; java . lang . Long otherId = userRepository . save ( other ) ; java . lang . String content = "I<sp>am<sp>alive!<sp>#YOLO" ; com . querydsl . example . sql . model . Tweet tweet = new com . querydsl . example . sql . model . Tweet ( ) ; tweet . setContent ( content ) ; tweet . setPosterId ( posterId ) ; java . lang . Long tweetId = repository . save ( tweet , otherId ) ; "<AssertPlaceHolder>" ; } findWithMentioned ( java . lang . Long ) { return selectFrom ( tweet ) . innerJoin ( tweetUser ) . on ( tweet . id . eq ( tweetUser . tweetId ) ) . where ( tweetUser . mentionsId . eq ( userId ) ) . fetch ( ) ; } | org . junit . Assert . assertEquals ( tweetId , repository . findWithMentioned ( otherId ) . get ( 0 ) . getId ( ) ) |
testSearchCompartements ( ) { ca . uhn . fhir . jaxrs . server . example . Bundle response = ca . uhn . fhir . jaxrs . server . example . JaxRsPatientProviderTest . client . search ( ) . forResource ( ca . uhn . fhir . jaxrs . server . example . Patient . class ) . withIdAndCompartment ( "1" , "Condition" ) . returnBundle ( ca . uhn . fhir . model . dstu2 . resource . Bundle . class ) . execute ( ) ; "<AssertPlaceHolder>" ; } getEntry ( ) { if ( ( this . entry ) == null ) this . entry = new org . hl7 . fhir . dstu3 . model . ArrayList < org . hl7 . fhir . dstu3 . model . Bundle . BundleEntryComponent > ( ) ; return this . entry ; } | org . junit . Assert . assertTrue ( ( ( response . getEntry ( ) . size ( ) ) > 0 ) ) |
testToBuilder ( ) { com . google . cloud . datastore . LatLngValue value = com . google . cloud . datastore . LatLngValue . of ( com . google . cloud . datastore . LatLngValueTest . CONTENT ) ; "<AssertPlaceHolder>" ; } toBuilder ( ) { return ( this ) == ( com . google . firestore . admin . v1 . DeleteIndexRequest . DEFAULT_INSTANCE ) ? new com . google . firestore . admin . v1 . DeleteIndexRequest . Builder ( ) : new com . google . firestore . admin . v1 . DeleteIndexRequest . Builder ( ) . mergeFrom ( this ) ; } | org . junit . Assert . assertEquals ( value , value . toBuilder ( ) . build ( ) ) |
testGetQueryLTEFilters ( ) { filters . add ( org . nohope . cassandra . mapservice . cfilter . CFilters . lte ( org . nohope . cassandra . mapservice . Value . bound ( org . nohope . cassandra . mapservice . CFilterBuilderTest . INT_COL , 4 ) ) ) ; final java . util . List < org . nohope . cassandra . mapservice . cfilter . CFilter < ? > > builderFilters = org . nohope . cassandra . mapservice . CFilterBuilder . getQueryFilters ( ) . lte ( org . nohope . cassandra . mapservice . CFilterBuilderTest . INT_COL , 4 ) . getFilters ( ) ; "<AssertPlaceHolder>" ; } getFilters ( ) { return java . util . Collections . unmodifiableCollection ( filters ) ; } | org . junit . Assert . assertEquals ( filters , builderFilters ) |
testBuildWithDisabledStatusConstraint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . education . type . EducationType context = new org . lnu . is . domain . education . type . EducationType ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>EducationType<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . education . type . EducationType > 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 ( expected , actualQuery ) |
beginAreaReferenceDoesNotHitDatabase ( ) { fm . last . musicbrainz . data . model . Artist artist = ( ( fm . last . musicbrainz . data . model . Artist ) ( session . load ( fm . last . musicbrainz . data . model . Artist . class , 1 ) ) ) ; fm . last . musicbrainz . data . model . Area beginArea = artist . getBeginArea ( ) ; "<AssertPlaceHolder>" ; } fetchCount ( ) { return ( statistics . getEntityFetchCount ( ) ) - ( fetches ) ; } | org . junit . Assert . assertThat ( fetchCount ( ) , org . hamcrest . CoreMatchers . is ( 1L ) ) |
setInvalidLastModificationTime ( ) { alluxio . master . file . meta . MutableInodeDirectory inodeDirectory = createInodeDirectory ( ) ; long lastModificationTimeMs = inodeDirectory . getLastModificationTimeMs ( ) ; long invalidModificationTimeMs = lastModificationTimeMs - ( alluxio . Constants . SECOND_MS ) ; inodeDirectory . setLastModificationTimeMs ( invalidModificationTimeMs ) ; "<AssertPlaceHolder>" ; } getLastModificationTimeMs ( ) { return mInfo . getLastModificationTimeMs ( ) ; } | org . junit . Assert . assertEquals ( lastModificationTimeMs , inodeDirectory . getLastModificationTimeMs ( ) ) |
readUnkeyedListDataAllTest ( ) { doReturn ( immediateFluentFuture ( java . util . Optional . of ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . unkeyedListNode1 ) ) ) . when ( read ) . read ( LogicalDatastoreType . OPERATIONAL , org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . path3 ) ; doReturn ( immediateFluentFuture ( java . util . Optional . of ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . unkeyedListNode2 ) ) ) . when ( read ) . read ( LogicalDatastoreType . CONFIGURATION , org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . path3 ) ; doReturn ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . path3 ) . when ( context ) . getInstanceIdentifier ( ) ; final org . opendaylight . yangtools . yang . data . api . schema . NormalizedNode < ? , ? > normalizedNode = org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtil . readData ( RestconfDataServiceConstant . ReadData . ALL , wrapper , schemaContext ) ; final org . opendaylight . yangtools . yang . data . api . schema . UnkeyedListNode expectedData = org . opendaylight . yangtools . yang . data . impl . schema . Builders . unkeyedListBuilder ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . listQname ) ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . Builders . unkeyedListEntryBuilder ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . listQname ) ) . withChild ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . unkeyedListEntryNode1 . getValue ( ) . iterator ( ) . next ( ) ) . withChild ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . unkeyedListEntryNode2 . getValue ( ) . iterator ( ) . next ( ) ) . build ( ) ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return configuration ; } | org . junit . Assert . assertEquals ( expectedData , normalizedNode ) |
testIsValidMoveNotAffordable ( ) { it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . players . Player player1 = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . players . Player ( ) ; player1 . setID ( ) ; it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . BoardStatus status = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . BoardStatus ( 1 ) ; status . addPlayerToBoardStatus ( player1 ) ; status . setCurrentPlayer ( player1 ) ; it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Road one = status . getRoadMap ( ) . getHashMapOfRoads ( ) . get ( 1 ) ; it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Road two = status . getRoadMap ( ) . getHashMapOfRoads ( ) . get ( 39 ) ; player1 . move ( one ) ; it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . move . Move incorrect = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . move . MovePlayer ( player1 , two ) ; "<AssertPlaceHolder>" ; } isValid ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . BoardStatus ) { return it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . move . RuleChecker . isValidBuyCard ( this , status ) ; } | org . junit . Assert . assertFalse ( incorrect . isValid ( status ) ) |
hasSubscriptionId_nullId ( ) { when ( fixture . getSubscriptionId ( ) ) . thenReturn ( null ) ; "<AssertPlaceHolder>" ; } hasSubscriptionId ( ) { return ( ( getSubscriptionId ( ) ) != null ) && ( ! ( getSubscriptionId ( ) . isEmpty ( ) ) ) ; } | org . junit . Assert . assertFalse ( fixture . hasSubscriptionId ( ) ) |
testLoadPatterns ( ) { final java . util . ArrayList < java . lang . String > lhsBoundFacts = new java . util . ArrayList < java . lang . String > ( ) { { add ( "boundFact1" ) ; add ( "" ) ; add ( "boundFact3" ) ; } } ; final java . util . ArrayList < java . lang . String > expectedPatterns = new java . util . ArrayList < java . lang . String > ( ) { { add ( "boundFact1" ) ; add ( "boundFact3" ) ; } } ; doReturn ( lhsBoundFacts ) . when ( page ) . getLHSBoundFacts ( ) ; final java . util . List < java . lang . String > patterns = page . loadPatterns ( ) ; "<AssertPlaceHolder>" ; } loadPatterns ( ) { return getLHSBoundFacts ( ) . stream ( ) . filter ( ( boundName ) -> ! ( nil ( boundName ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; } | org . junit . Assert . assertEquals ( expectedPatterns , patterns ) |
doRedirect ( ) { java . lang . String path = "http://www.google.com" ; org . slim3 . controller . Controller controller = tester . frontController . createController ( "/" ) ; tester . frontController . doRedirect ( tester . request , tester . response , controller , path ) ; "<AssertPlaceHolder>" ; } getRedirectPath ( ) { return redirectPath ; } | org . junit . Assert . assertThat ( tester . response . getRedirectPath ( ) , org . hamcrest . CoreMatchers . is ( path ) ) |
supports_not ( ) { com . asakusafw . testdriver . excel . ExcelRuleExtractor extractor = new com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor ( ) ; org . apache . poi . ss . usermodel . Sheet sheet = sheet ( "invalid_format.xls" ) ; "<AssertPlaceHolder>" ; } supports ( org . apache . poi . ss . usermodel . Sheet ) { if ( sheet == null ) { throw new java . lang . IllegalArgumentException ( "sheet<sp>must<sp>not<sp>be<sp>null" ) ; } com . asakusafw . testdriver . excel . RuleSheetFormat item = RuleSheetFormat . FORMAT ; java . lang . String title = com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor . getStringCell ( sheet , item . getRowIndex ( ) , item . getColumnIndex ( ) ) ; if ( ( title . equals ( item . getTitle ( ) ) ) == false ) { return false ; } java . lang . String format = com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor . getStringCell ( sheet , item . getRowIndex ( ) , ( ( item . getColumnIndex ( ) ) + 1 ) ) ; return com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor . SUPPORTED_FORMATS . contains ( format ) ; } | org . junit . Assert . assertThat ( extractor . supports ( sheet ) , is ( false ) ) |
testPackDoubleNaN ( ) { final double k = Double . NaN ; final char r = com . jogamp . opengl . math . Binary16 . packDouble ( k ) ; "<AssertPlaceHolder>" ; } isNaN ( char ) { final int e = com . jogamp . opengl . math . Binary16 . unpackGetExponentUnbiased ( k ) ; final int s = com . jogamp . opengl . math . Binary16 . unpackGetSignificand ( k ) ; return ( e == 16 ) && ( s > 0 ) ; } | org . junit . Assert . assertTrue ( com . jogamp . opengl . math . Binary16 . isNaN ( r ) ) |
testGetTopic ( ) { javax . jms . Topic topic = session . createTopic ( getTestName ( ) ) ; javax . jms . TopicPublisher publisher = session . createPublisher ( topic ) ; "<AssertPlaceHolder>" ; } getTopic ( ) { checkClosed ( ) ; return ( ( javax . jms . Topic ) ( this . producerInfo . getDestination ( ) ) ) ; } | org . junit . Assert . assertSame ( topic , publisher . getTopic ( ) ) |
testLinkOwner ( ) { org . apache . hadoop . fs . Path file = new org . apache . hadoop . fs . Path ( testBaseDir1 ( ) , "file" ) ; org . apache . hadoop . fs . Path link = new org . apache . hadoop . fs . Path ( testBaseDir1 ( ) , "symlinkToFile" ) ; createAndWriteFile ( file ) ; wrapper . createSymlink ( file , link , false ) ; org . apache . hadoop . fs . FileStatus statFile = wrapper . getFileStatus ( file ) ; org . apache . hadoop . fs . FileStatus statLink = wrapper . getFileStatus ( link ) ; "<AssertPlaceHolder>" ; } getOwner ( ) { return owner ; } | org . junit . Assert . assertEquals ( statLink . getOwner ( ) , statFile . getOwner ( ) ) |
testRemoveObsFromSingle ( ) { org . apache . commons . math . stat . regression . SimpleRegression regression = new org . apache . commons . math . stat . regression . SimpleRegression ( ) ; regression . addData ( removeX , removeY ) ; regression . removeData ( removeX , removeY ) ; "<AssertPlaceHolder>" ; } getN ( ) { return n ; } | org . junit . Assert . assertEquals ( regression . getN ( ) , 0 ) |
updateTopologyIsNonDestructive ( ) { _routingProcess . updateTopology ( nonEmptyOspfTopology ( ) ) ; org . batfish . datamodel . ospf . OspfNeighborConfigId n1 = new org . batfish . datamodel . ospf . OspfNeighborConfigId ( org . batfish . dataplane . ibdp . OspfRoutingProcessTest . HOSTNAME , org . batfish . dataplane . ibdp . OspfRoutingProcessTest . VRF_NAME , "1" , org . batfish . dataplane . ibdp . OspfRoutingProcessTest . ACTIVE_IFACE_NAME ) ; org . batfish . datamodel . ospf . OspfNeighborConfigId n2 = new org . batfish . datamodel . ospf . OspfNeighborConfigId ( "r2" , org . batfish . dataplane . ibdp . OspfRoutingProcessTest . VRF_NAME , "1" , "someIface" ) ; _routingProcess . enqueueMessagesIntra ( org . batfish . datamodel . ospf . OspfTopology . makeEdge ( n2 , n1 ) , com . google . common . collect . ImmutableSet . of ( new org . batfish . dataplane . rib . RouteAdvertisement ( org . batfish . datamodel . OspfIntraAreaRoute . builder ( ) . setArea ( 0 ) . setNetwork ( Prefix . ZERO ) . setNextHopIp ( org . batfish . datamodel . Ip . parse ( "8.8.8.8" ) ) . build ( ) ) ) ) ; _routingProcess . updateTopology ( nonEmptyOspfTopology ( ) ) ; "<AssertPlaceHolder>" ; } isDirty ( ) { return ( ( ( ( ( ( ! ( _changeset . build ( ) . isEmpty ( ) ) ) || ( ! ( _queuedForRedistribution . isEmpty ( ) ) ) ) || ( ! ( _activatedGeneratedRoutes . isEmpty ( ) ) ) ) || ( ! ( _interAreaIncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ) || ( ! ( _intraAreaIncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ) || ( ! ( _type1IncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ) || ( ! ( _type2IncomingRoutes . values ( ) . stream ( ) . allMatch ( Queue :: isEmpty ) ) ) ; } | org . junit . Assert . assertTrue ( _routingProcess . isDirty ( ) ) |
testStopEventHaltDoesntWork ( ) { org . easymock . EasyMock . expect ( processManager . getPidFromProcQuery ( ( "State.Name.sw=java,Args.*.eq=-Dcatalina.base=" + ( catalinaBase ) ) ) ) . andReturn ( 123L ) ; processManager . kill ( 123L ) ; org . easymock . EasyMock . expect ( processManager . waitForProcessDeath ( 60 , 123L ) ) . andReturn ( false ) ; processManager . forceKill ( 123L ) ; org . easymock . EasyMock . expect ( processManager . waitForProcessDeath ( 1 , 123L ) ) . andReturn ( false ) ; replay ( ) ; boolean stopped = tomcatEngineController . stop ( ) ; verify ( ) ; "<AssertPlaceHolder>" ; } verify ( ) { org . easymock . EasyMock . verify ( processManager ) ; org . easymock . classextension . EasyMock . verify ( osInfo ) ; } | org . junit . Assert . assertFalse ( stopped ) |
testReportingLevelNoneBySetter ( ) { org . hawkular . apm . client . collector . internal . DefaultTraceCollectorTest . TestTraceService traceService = new org . hawkular . apm . client . collector . internal . DefaultTraceCollectorTest . TestTraceService ( ) ; org . hawkular . apm . client . collector . internal . DefaultTraceCollector collector = new org . hawkular . apm . client . collector . internal . DefaultTraceCollector ( new org . hawkular . apm . client . api . recorder . BatchTraceRecorder . BatchTraceRecorderBuilder ( ) . withTracePublisher ( traceService ) . build ( ) ) ; org . hawkular . apm . client . collector . internal . DefaultTraceCollectorTest . TestConfigurationService tcs = new org . hawkular . apm . client . collector . internal . DefaultTraceCollectorTest . TestConfigurationService ( ) ; org . hawkular . apm . api . model . config . CollectorConfiguration cc = new org . hawkular . apm . api . model . config . CollectorConfiguration ( ) ; tcs . setCollectorConfiguration ( cc ) ; org . hawkular . apm . api . model . config . txn . TransactionConfig btc = new org . hawkular . apm . api . model . config . txn . TransactionConfig ( ) ; btc . setFilter ( new org . hawkular . apm . api . model . config . txn . Filter ( ) ) ; btc . getFilter ( ) . getInclusions ( ) . add ( "/test" ) ; cc . getTransactions ( ) . put ( "testapp" , btc ) ; collector . setConfigurationService ( tcs ) ; collector . activate ( "/test" , null ) ; collector . setLevel ( null , "None" ) ; collector . consumerStart ( null , "/test" , null , null , null ) ; collector . consumerEnd ( null , null , null , null ) ; java . util . List < org . hawkular . apm . api . model . trace . Trace > traces = traceService . getTraces ( ) ; "<AssertPlaceHolder>" ; } getTraces ( ) { return traces ; } | org . junit . Assert . assertEquals ( 0 , traces . size ( ) ) |
collectCacheRequestCacheFalse ( org . apache . servicecomb . common . rest . filter . HttpServerFilter ) { java . util . List < org . apache . servicecomb . common . rest . filter . HttpServerFilter > httpServerFilters = java . util . Arrays . asList ( f1 ) ; new mockit . Expectations ( ) { { f1 . needCacheRequest ( operationMeta ) ; result = false ; } } ; restInvocation . setHttpServerFilters ( httpServerFilters ) ; "<AssertPlaceHolder>" ; } collectCacheRequest ( org . apache . servicecomb . core . definition . OperationMeta ) { for ( org . apache . servicecomb . common . rest . filter . HttpServerFilter filter : httpServerFilters ) { if ( filter . needCacheRequest ( operationMeta ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( restInvocation . collectCacheRequest ( operationMeta ) ) |
testStringFunction1 ( ) { java . lang . String sql = "/*IF<sp>SF.isEmpty(val1)*/1=1<sp>/*ELIF<sp>SF.containsAny(val2,<sp>val3)*/2=2<sp>--ELSE<sp>3=3/*END*/" ; jp . co . future . uroborosql . parser . SqlParser parser = new jp . co . future . uroborosql . parser . SqlParserImpl ( sql ) ; jp . co . future . uroborosql . context . SqlContext ctx = sqlContextFactory . createSqlContext ( ) ; ctx . param ( "val1" , null ) ; ctx . param ( "val2" , "aaabbbccc" ) ; ctx . param ( "val3" , "ab" ) ; java . lang . String sql2 = "1=1<sp>" ; ctx . param ( StringFunction . SHORT_NAME , new jp . co . future . uroborosql . utils . StringFunction ( new jp . co . future . uroborosql . dialect . DefaultDialect ( ) ) ) ; jp . co . future . uroborosql . parser . ContextTransformer transformer = parser . parse ( ) ; transformer . transform ( ctx ) ; System . out . println ( ctx . getExecutableSql ( ) ) ; "<AssertPlaceHolder>" ; } getExecutableSql ( ) { if ( org . apache . commons . lang3 . StringUtils . isEmpty ( executableSqlCache ) ) { if ( ( executableSql . length ( ) ) > 0 ) { executableSqlCache = executableSql . toString ( ) ; if ( executableSqlCache . toUpperCase ( ) . contains ( "WHERE" ) ) { java . lang . StringBuffer buff = new java . lang . StringBuffer ( ) ; java . util . regex . Matcher matcher = jp . co . future . uroborosql . context . SqlContextImpl . WHERE_CLAUSE_PATTERN . matcher ( executableSqlCache ) ; while ( matcher . find ( ) ) { java . lang . String whereClause = matcher . group ( 1 ) ; matcher . appendReplacement ( buff , whereClause ) ; } matcher . appendTail ( buff ) ; executableSqlCache = buff . toString ( ) ; } java . lang . StringBuffer buff = new java . lang . StringBuffer ( ) ; java . util . regex . Matcher removeCommaMatcher = jp . co . future . uroborosql . context . SqlContextImpl . REMOVE_FIRST_COMMA_PATTERN . matcher ( executableSqlCache ) ; while ( removeCommaMatcher . find ( ) ) { java . lang . String clauseWords = removeCommaMatcher . group ( 1 ) ; removeCommaMatcher . appendReplacement ( buff , clauseWords ) ; } removeCommaMatcher . appendTail ( buff ) ; executableSqlCache = buff . toString ( ) ; executableSqlCache = jp . co . future . uroborosql . context . SqlContextImpl . CLEAR_BLANK_PATTERN . matcher ( executableSqlCache ) . replaceAll ( "" ) ; } } return executableSqlCache ; } | org . junit . Assert . assertEquals ( "1" , sql2 , ctx . getExecutableSql ( ) ) |
testSetCategoryKeys ( ) { org . jfree . data . category . DefaultIntervalCategoryDataset empty = new org . jfree . data . category . DefaultIntervalCategoryDataset ( new double [ 0 ] [ 0 ] , new double [ 0 ] [ 0 ] ) ; boolean pass = true ; try { empty . setCategoryKeys ( new java . lang . String [ 0 ] ) ; } catch ( java . lang . RuntimeException e ) { pass = false ; } "<AssertPlaceHolder>" ; } setCategoryKeys ( java . lang . Comparable [ ] ) { org . jfree . chart . util . Args . nullNotPermitted ( categoryKeys , "categoryKeys" ) ; if ( ( categoryKeys . length ) != ( getCategoryCount ( ) ) ) { throw new java . lang . IllegalArgumentException ( "The<sp>number<sp>of<sp>categories<sp>does<sp>not<sp>match<sp>the<sp>data." ) ; } for ( int i = 0 ; i < ( categoryKeys . length ) ; i ++ ) { if ( ( categoryKeys [ i ] ) == null ) { throw new java . lang . IllegalArgumentException ( ( "DefaultIntervalCategoryDataset.setCategoryKeys():<sp>" + "null<sp>category<sp>not<sp>permitted." ) ) ; } } this . categoryKeys = categoryKeys ; fireDatasetChanged ( ) ; } | org . junit . Assert . assertTrue ( pass ) |
testReadWriteRead ( ) { java . io . File f = folder . newFile ( ) ; de . rub . nds . tlsattacker . core . config . Config config = de . rub . nds . tlsattacker . core . config . Config . createConfig ( ) ; de . rub . nds . tlsattacker . core . config . ConfigIO . write ( config , f ) ; config = de . rub . nds . tlsattacker . core . config . ConfigIO . read ( f ) ; "<AssertPlaceHolder>" ; } read ( de . rub . nds . tlsattacker . core . config . File ) { de . rub . nds . tlsattacker . core . config . Config config = javax . xml . bind . JAXB . unmarshal ( f , de . rub . nds . tlsattacker . core . config . Config . class ) ; return config ; } | org . junit . Assert . assertNotNull ( config ) |
testFindSingleAfterFilteringToOneElementStream ( ) { com . annimon . stream . OptionalDouble result = com . annimon . stream . DoubleStream . of ( 1.0 , 10.12 , ( - 3.01 ) ) . filter ( com . annimon . stream . Functions . greaterThan ( Math . PI ) ) . findSingle ( ) ; "<AssertPlaceHolder>" ; } hasValue ( int ) { return com . annimon . stream . test . hamcrest . OptionalIntMatcher . hasValueThat ( org . hamcrest . CoreMatchers . is ( value ) ) ; } | org . junit . Assert . assertThat ( result , hasValue ( 10.12 ) ) |
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . workflow . kaleo . model . KaleoTaskInstanceToken > kaleoTaskInstanceTokens = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( kaleoTaskInstanceTokens . isEmpty ( ) ) |
decode ( ) { final java . io . ByteArrayInputStream stream = new java . io . ByteArrayInputStream ( encoded ) ; final com . flagstone . transform . coder . SWFDecoder decoder = new com . flagstone . transform . coder . SWFDecoder ( stream ) ; fixture = new com . flagstone . transform . button . ButtonSound ( decoder ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( fixture ) |
getExternalKeyShouldReturnExternalKeyFromGroup ( ) { java . lang . String externalKey = "externalKey" ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceGroupEntity group = new ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceGroupEntity ( ) ; group . setFcExternalKey ( externalKey ) ; resourceEntity = new ch . puzzle . itc . mobiliar . builders . ResourceEntityBuilder ( ) . forResourceGroup ( group ) . build ( ) ; java . lang . String delegatedExternalKey = resourceEntity . getExternalKey ( ) ; "<AssertPlaceHolder>" ; } getExternalKey ( ) { return fcExternalKey ; } | org . junit . Assert . assertEquals ( externalKey , delegatedExternalKey ) |
testBadDate ( ) { try { modelOf ( "timestamp<sp>=<sp>'2015-02-23T10:00:55.00z;30m'" ) ; org . junit . Assert . fail ( ) ; } catch ( com . questdb . griffin . SqlException e ) { "<AssertPlaceHolder>" ; } } getPosition ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 12 , e . getPosition ( ) ) |
testGetValueList ( ) { new mockit . Expectations ( ) { { request . getHeaders ( "h1" ) ; result = java . util . Collections . enumeration ( java . util . Arrays . asList ( "h1v" ) ) ; } } ; org . apache . servicecomb . common . rest . codec . param . HeaderProcessorCreator . HeaderProcessor processor = new org . apache . servicecomb . common . rest . codec . param . HeaderProcessorCreator . HeaderProcessor ( "h1" , com . fasterxml . jackson . databind . type . TypeFactory . defaultInstance ( ) . constructCollectionType ( java . util . List . class , java . lang . String . class ) , null , true ) ; java . lang . Object value = processor . getValue ( request ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return false ; } | org . junit . Assert . assertThat ( ( ( java . util . List < java . lang . String > ) ( value ) ) , org . hamcrest . Matchers . contains ( "h1v" ) ) |
testFormatMessageWithSquigglyFormatAndEmptyParameters ( ) { record . setMessage ( "{0}" ) ; record . setParameters ( new java . lang . Object [ 0 ] ) ; "<AssertPlaceHolder>" ; } formatMessage ( java . util . logging . LogRecord ) { java . lang . String message = super . formatMessage ( record ) ; try { final java . lang . Object [ ] parameters = record . getParameters ( ) ; if ( ( ( message == ( record . getMessage ( ) ) ) && ( parameters != null ) ) && ( ( parameters . length ) > 0 ) ) { message = java . lang . String . format ( message , parameters ) ; } } catch ( java . lang . Exception ex ) { } return message ; } | org . junit . Assert . assertEquals ( "{0}" , instance . formatMessage ( record ) ) |
testCanGetPageConfigurationForPage ( ) { com . eclipsesource . tabris . ui . UIConfiguration configuration = new com . eclipsesource . tabris . ui . UIConfiguration ( ) ; com . eclipsesource . tabris . ui . PageConfiguration pageConfiguration = new com . eclipsesource . tabris . ui . PageConfiguration ( "foo" , com . eclipsesource . tabris . internal . ui . TestPage . class ) . setTopLevel ( true ) ; com . eclipsesource . tabris . ui . PageConfiguration pageConfiguration2 = new com . eclipsesource . tabris . ui . PageConfiguration ( "foo2" , com . eclipsesource . tabris . internal . ui . TestPage . class ) ; configuration . addPageConfiguration ( pageConfiguration ) ; configuration . addPageConfiguration ( pageConfiguration2 ) ; com . eclipsesource . tabris . internal . ui . Controller controller = new com . eclipsesource . tabris . internal . ui . Controller ( new com . eclipsesource . tabris . internal . ui . RemoteUI ( shell ) , configuration . getAdapter ( com . eclipsesource . tabris . internal . ui . UIDescriptor . class ) ) ; com . eclipsesource . tabris . internal . ui . UIImpl ui = new com . eclipsesource . tabris . internal . ui . UIImpl ( shell . getDisplay ( ) , controller , configuration ) ; controller . setUI ( ui ) ; controller . createRootPages ( ui ) ; com . eclipsesource . tabris . internal . ui . rendering . PageRenderer page = controller . showPage ( ui , pageConfiguration2 . getAdapter ( com . eclipsesource . tabris . internal . ui . PageDescriptor . class ) , new com . eclipsesource . tabris . ui . PageData ( ) ) ; com . eclipsesource . tabris . ui . PageConfiguration actualConfiguration = controller . getPageConfiguration ( page . getPage ( ) ) ; "<AssertPlaceHolder>" ; } getPage ( ) { return page ; } | org . junit . Assert . assertSame ( pageConfiguration2 , actualConfiguration ) |
testGetValue ( ) { when ( iTable . getValue ( 0 , "category" ) ) . thenReturn ( "POPE:01" ) ; when ( manager . getEngineByName ( anyString ( ) ) ) . thenReturn ( null ) ; java . lang . Object value = scriptableTable . getValue ( 0 , "category" ) ; "<AssertPlaceHolder>" ; verify ( ScriptableTable . log ) . warning ( "Could<sp>not<sp>find<sp>script<sp>engine<sp>by<sp>name<sp>'POPE'" ) ; verify ( manager ) . getEngineByName ( "POPE" ) ; verify ( iTable ) . getValue ( 0 , "category" ) ; verifyNoMoreInteractions ( ScriptableTable . log , manager , iTable ) ; } getValue ( int , java . lang . String ) { java . lang . Object value = delegate . getValue ( row , column ) ; if ( ( value != null ) && ( com . github . database . rider . core . api . dataset . ScriptableTable . scriptEnginePattern . matcher ( value . toString ( ) ) . matches ( ) ) ) { javax . script . ScriptEngine engine = getScriptEngine ( value . toString ( ) . trim ( ) ) ; if ( engine != null ) { try { return getScriptResult ( value . toString ( ) , engine ) ; } catch ( java . lang . Exception e ) { com . github . database . rider . core . api . dataset . ScriptableTable . log . log ( Level . WARNING , java . lang . String . format ( "Could<sp>not<sp>evaluate<sp>script<sp>expression<sp>for<sp>table<sp>'%s',<sp>column<sp>'%s'.<sp>The<sp>original<sp>value<sp>will<sp>be<sp>used." , getTableMetaData ( ) . getTableName ( ) , column ) , e ) ; } } } return value ; } | org . junit . Assert . assertEquals ( "POPE:01" , value ) |
testUploadMetadataFilesToTempDir ( ) { java . io . InputStream metadataFile = mock ( java . io . InputStream . class ) ; fillServiceMock ( org . pentaho . platform . dataaccess . datasource . api . MetadataServiceTest . DOMAIN_ID , metadataFile ) ; doReturn ( new org . apache . tools . ant . filters . StringInputStream ( "" ) ) . when ( org . pentaho . platform . dataaccess . datasource . api . MetadataServiceTest . metadataService ) . createInputStreamFromFile ( any ( java . lang . String . class ) ) ; doReturn ( org . pentaho . platform . dataaccess . datasource . api . MetadataServiceTest . XMI_TEMP_FILE_NAME ) . when ( org . pentaho . platform . dataaccess . datasource . api . MetadataServiceTest . metadataService ) . uploadFile ( any ( java . io . InputStream . class ) ) ; org . pentaho . platform . dataaccess . datasource . api . resources . MetadataTempFilesListDto res = org . pentaho . platform . dataaccess . datasource . api . MetadataServiceTest . metadataService . uploadMetadataFilesToTempDir ( metadataFile , null , null ) ; "<AssertPlaceHolder>" ; } getXmiFileName ( ) { return xmiFileName ; } | org . junit . Assert . assertEquals ( res . getXmiFileName ( ) , org . pentaho . platform . dataaccess . datasource . api . MetadataServiceTest . XMI_TEMP_FILE_NAME ) |
testNoFrontendUrlWithSingleUrlIpport ( ) { java . util . Map < java . net . URI , java . net . URI > ipports = new java . util . HashMap ( ) ; ipports . put ( com . vsct . supervision . notification . model . AlarmMapperTest . DEFAULT_GRAPHITE_URL , com . vsct . supervision . notification . model . AlarmMapperTest . DEFAULT_GRAPHITE_IPPORT ) ; when ( graphiteSources . getIpportsByUrl ( ) ) . thenReturn ( ipports ) ; when ( this . graphiteSources . getSources ( ) ) . thenReturn ( java . util . stream . Stream . of ( new com . vsct . supervision . notification . model . GraphiteSources . GraphiteSource ( com . vsct . supervision . notification . model . AlarmMapperTest . DEFAULT_GRAPHITE_URL , com . vsct . supervision . notification . model . AlarmMapperTest . DEFAULT_GRAPHITE_IPPORT ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ; com . vsct . supervision . seyren . api . Alarm frontendAlarm = com . vsct . supervision . notification . TestUtils . getDefaultAlarm ( ) ; frontendAlarm . setGraphiteBaseUrl ( null ) ; com . vsct . supervision . seyren . api . Alarm backendAlarm = alarmMapper . mapNewAlarmFormToSeyren ( frontendAlarm ) ; "<AssertPlaceHolder>" ; } getGraphiteBaseUrl ( ) { return graphiteBaseUrl ; } | org . junit . Assert . assertEquals ( com . vsct . supervision . notification . model . AlarmMapperTest . DEFAULT_GRAPHITE_IPPORT , backendAlarm . getGraphiteBaseUrl ( ) ) |
testApplyVpnUsersException1 ( ) { vpcVirtualRouterElement . _vpcRouterMgr = _vpcRouterMgr ; final com . cloud . network . topology . AdvancedNetworkTopology advancedNetworkTopology = org . mockito . Mockito . mock ( com . cloud . network . topology . AdvancedNetworkTopology . class ) ; final com . cloud . network . topology . BasicNetworkTopology basicNetworkTopology = org . mockito . Mockito . mock ( com . cloud . network . topology . BasicNetworkTopology . class ) ; networkTopologyContext . setAdvancedNetworkTopology ( advancedNetworkTopology ) ; networkTopologyContext . setBasicNetworkTopology ( basicNetworkTopology ) ; networkTopologyContext . init ( ) ; final com . cloud . network . RemoteAccessVpn remoteAccessVpn = org . mockito . Mockito . mock ( com . cloud . network . RemoteAccessVpn . class ) ; final java . util . List < com . cloud . legacymodel . network . VpnUser > users = new java . util . ArrayList ( ) ; when ( remoteAccessVpn . getVpcId ( ) ) . thenReturn ( null ) ; try { final java . lang . String [ ] results = vpcVirtualRouterElement . applyVpnUsers ( remoteAccessVpn , users ) ; "<AssertPlaceHolder>" ; } catch ( final com . cloud . legacymodel . exceptions . ResourceUnavailableException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } verify ( remoteAccessVpn , times ( 1 ) ) . getVpcId ( ) ; } applyVpnUsers ( com . cloud . network . RemoteAccessVpn , java . util . List ) { if ( ( vpn . getNetworkId ( ) ) == null ) { return null ; } final com . cloud . legacymodel . network . Network network = this . _networksDao . findById ( vpn . getNetworkId ( ) ) ; if ( canHandle ( network , Service . Vpn ) ) { final java . util . List < com . cloud . vm . DomainRouterVO > routers = this . _routerDao . listByNetworkAndRole ( network . getId ( ) , Role . VIRTUAL_ROUTER ) ; if ( ( routers == null ) || ( routers . isEmpty ( ) ) ) { com . cloud . network . element . VirtualRouterElement . s_logger . debug ( ( ( "Virtual<sp>router<sp>elemnt<sp>doesn't<sp>need<sp>to<sp>apply<sp>vpn<sp>users<sp>on<sp>the<sp>backend;<sp>virtual<sp>router" + "<sp>doesn't<sp>exist<sp>in<sp>the<sp>network<sp>" ) + ( network . getId ( ) ) ) ) ; return null ; } final com . cloud . db . model . Zone zone = this . zoneRepository . findById ( network . getDataCenterId ( ) ) . orElse ( null ) ; final com . cloud . network . topology . NetworkTopology networkTopology = this . networkTopologyContext . retrieveNetworkTopology ( zone ) ; return networkTopology . applyVpnUsers ( network , users , routers ) ; } else { com . cloud . network . element . VirtualRouterElement . s_logger . debug ( ( ( "Element<sp>" + ( getName ( ) ) ) + "<sp>doesn't<sp>handle<sp>applyVpnUsers<sp>command" ) ) ; return null ; } } | org . junit . Assert . assertNull ( results ) |
shouldNotFilterFeature ( ) { final java . util . List < com . github . bmsantos . core . cola . formatter . FeatureDetails > features = test . utils . TestUtils . loadFeatures ( "com.github.bmsantos.core.cola.filters.FilterProcessorTest$SkipFeatureClass" ) ; when ( filter . filtrate ( any ( com . github . bmsantos . core . cola . formatter . TagStatementDetails . class ) ) ) . thenReturn ( false ) ; com . github . bmsantos . core . cola . filters . FilterProcessor . filtrate ( features ) . using ( asList ( filter ) ) ; "<AssertPlaceHolder>" ; } using ( java . util . List ) { final java . util . Iterator < com . github . bmsantos . core . cola . formatter . FeatureDetails > it = features . iterator ( ) ; while ( it . hasNext ( ) ) { final com . github . bmsantos . core . cola . formatter . FeatureDetails feature = it . next ( ) ; for ( final com . github . bmsantos . core . cola . filters . Filter filter : filters ) { if ( filter . filtrate ( feature ) ) { it . remove ( ) ; break ; } } } return features ; } | org . junit . Assert . assertThat ( features . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( false ) ) |
testTaskStartTimes ( ) { org . apache . hadoop . mapreduce . v2 . api . records . TaskId taskId = mock ( org . apache . hadoop . mapreduce . v2 . api . records . TaskId . class ) ; org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskInfo taskInfo = mock ( org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskInfo . class ) ; java . util . Map < org . apache . hadoop . mapreduce . TaskAttemptID , org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo > taskAttempts = new java . util . TreeMap < org . apache . hadoop . mapreduce . TaskAttemptID , org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo > ( ) ; org . apache . hadoop . mapreduce . TaskAttemptID id = new org . apache . hadoop . mapreduce . TaskAttemptID ( "0" , 0 , org . apache . hadoop . mapreduce . TaskType . MAP , 0 , 0 ) ; org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo info = mock ( org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo . class ) ; when ( info . getAttemptId ( ) ) . thenReturn ( id ) ; when ( info . getStartTime ( ) ) . thenReturn ( 10L ) ; taskAttempts . put ( id , info ) ; id = new org . apache . hadoop . mapreduce . TaskAttemptID ( "1" , 0 , org . apache . hadoop . mapreduce . TaskType . MAP , 1 , 1 ) ; info = mock ( org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo . class ) ; when ( info . getAttemptId ( ) ) . thenReturn ( id ) ; when ( info . getStartTime ( ) ) . thenReturn ( 20L ) ; taskAttempts . put ( id , info ) ; when ( taskInfo . getAllTaskAttempts ( ) ) . thenReturn ( taskAttempts ) ; org . apache . hadoop . mapreduce . v2 . hs . CompletedTask task = new org . apache . hadoop . mapreduce . v2 . hs . CompletedTask ( taskId , taskInfo ) ; org . apache . hadoop . mapreduce . v2 . api . records . TaskReport report = task . getReport ( ) ; "<AssertPlaceHolder>" ; } getStartTime ( ) { return this . startTime ; } | org . junit . Assert . assertTrue ( ( ( report . getStartTime ( ) ) == 10 ) ) |
testEqualsSelf ( ) { final ddf . catalog . validation . impl . validator . PatternValidator validator = new ddf . catalog . validation . impl . validator . PatternValidator ( "test" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) { return false ; } ddf . catalog . validation . impl . validator . ISO3CountryCodeValidator that = ( ( ddf . catalog . validation . impl . validator . ISO3CountryCodeValidator ) ( o ) ) ; return new org . apache . commons . lang . builder . EqualsBuilder ( ) . append ( countryCodes , that . countryCodes ) . append ( ignoreCase , that . ignoreCase ) . isEquals ( ) ; } | org . junit . Assert . assertThat ( validator . equals ( validator ) , org . hamcrest . Matchers . is ( true ) ) |
testFormat ( ) { java . lang . String tpl = "${bsType?string('','123')}" ; java . util . Map < java . lang . String , java . lang . Object > args = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; args . put ( "bsType" , true ) ; "<AssertPlaceHolder>" ; } format ( java . lang . String , java . util . Map ) { return cn . bc . core . util . FreeMarkerUtils . format ( tpl , ( ( java . lang . Object ) ( args ) ) ) ; } | org . junit . Assert . assertEquals ( "" , cn . bc . core . util . FreeMarkerUtils . format ( tpl , args ) ) |
testBuild ( ) { org . lnu . is . domain . subject . Subject context = new org . lnu . is . domain . subject . Subject ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>Subject<sp>e<sp>WHERE<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . subject . Subject > 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 ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.