input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testDiscoverServicesEmpty ( ) { org . eclipse . kura . internal . driver . ble . sensortag . TiSensorTagBuilder builder = new org . eclipse . kura . internal . driver . ble . sensortag . TiSensorTagBuilder ( true , true ) . addService ( TiSensorTagGatt . UUID_DEVINFO_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) . addService ( TiSensorTagGatt . UUID_TEMP_SENSOR_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) . addService ( TiSensorTagGatt . UUID_HUM_SENSOR_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) . addService ( TiSensorTagGatt . UUID_PRE_SENSOR_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) . addService ( TiSensorTagGatt . UUID_KEYS_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) . addService ( TiSensorTagGatt . UUID_MOV_SENSOR_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) . addService ( TiSensorTagGatt . UUID_IO_SENSOR_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) . addService ( TiSensorTagGatt . UUID_OPTO_SENSOR_SERVICE , mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ) ; org . eclipse . kura . internal . driver . ble . sensortag . TiSensorTag tag = builder . build ( true ) ; java . util . List < org . eclipse . kura . bluetooth . le . BluetoothLeGattCharacteristic > characteristics = tag . getCharacteristics ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return data . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , characteristics . size ( ) )
testInlineCastForAField ( ) { java . lang . String str = ( ( ( ( ( ( ( ( ( "import<sp>" + ( org . drools . modelcompiler . domain . Person . class . getCanonicalName ( ) ) ) + ";" ) + "import<sp>" ) + ( org . drools . modelcompiler . domain . InternationalAddress . class . getCanonicalName ( ) ) ) + ";" ) + ";" 0 ) + "<sp>$p<sp>:<sp>Person(<sp>address#InternationalAddress.state.length<sp>==<sp>5<sp>)\n" ) + "then\n" ) + "<sp>insert(\"matched\");\n" ) + "end" ; org . kie . api . runtime . KieSession ksession = getKieSession ( str ) ; org . drools . modelcompiler . domain . Person john = new org . drools . modelcompiler . domain . Person ( "John" , 47 ) ; org . drools . modelcompiler . domain . InternationalAddress a = new org . drools . modelcompiler . domain . InternationalAddress ( "address" , "Italy" ) ; john . setAddress ( a ) ; ksession . insert ( john ) ; ksession . fireAllRules ( ) ; java . util . Collection < java . lang . String > results = getObjectsIntoList ( ksession , java . lang . String . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , results . size ( ) )
shouldDeflateGzipAndParseJsonTermsFromRedisOnGetCommand ( ) { when ( localParamsMock . get ( "command" ) ) . thenReturn ( "get" ) ; when ( localParamsMock . get ( "key" ) ) . thenReturn ( "simpleKey" ) ; when ( localParamsMock . get ( "compression" ) ) . thenReturn ( "gzip" ) ; when ( localParamsMock . get ( "serialization" ) ) . thenReturn ( "json" ) ; when ( localParamsMock . get ( QueryParsing . V ) ) . thenReturn ( "string_field" ) ; when ( jedisMock . get ( any ( byte [ ] . class ) ) ) . thenReturn ( com . sematext . solr . redis . Compressor . compressGzip ( "[100,200,300]" . getBytes ( ) ) ) ; when ( requestMock . getSchema ( ) ) . thenReturn ( schema ) ; when ( schema . getQueryAnalyzer ( ) ) . thenReturn ( new org . apache . lucene . analysis . standard . StandardAnalyzer ( ) ) ; redisQParser = new com . sematext . solr . redis . RedisQParser ( "string_field" , localParamsMock , paramsMock , requestMock , commandHandler ) ; final org . apache . lucene . search . Query query = redisQParser . parse ( ) ; verify ( jedisMock ) . get ( "simpleKey" . getBytes ( ) ) ; org . apache . lucene . search . IndexSearcher searcher = new org . apache . lucene . search . IndexSearcher ( new org . apache . lucene . index . MultiReader ( ) ) ; final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = com . sematext . solr . redis . TestRedisQParser . extractTerms ( searcher , query ) ; "<AssertPlaceHolder>" ; } extractTerms ( org . apache . lucene . search . IndexSearcher , org . apache . lucene . search . Query ) { final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = new com . sematext . solr . redis . HashSet ( ) ; org . apache . lucene . search . Query rewrittenQuery = searcher . rewrite ( query ) ; if ( rewrittenQuery instanceof org . apache . lucene . search . ConstantScoreQuery ) { org . apache . lucene . search . ConstantScoreQuery constantScoreQuery = ( ( org . apache . lucene . search . ConstantScoreQuery ) ( rewrittenQuery ) ) ; rewrittenQuery = constantScoreQuery . getQuery ( ) ; } searcher . createNormalizedWeight ( rewrittenQuery , true ) . extractTerms ( terms ) ; return terms ; }
org . junit . Assert . assertEquals ( 3 , terms . size ( ) )
testSection4273LinkTypeInvalidMime ( ) { org . apache . abdera . i18n . iri . IRI uri = org . apache . abdera . test . parser . stax . FeedValidatorTest . baseURI . resolve ( "4.2.7.3/link-type-invalid-mime.xml" ) ; org . apache . abdera . model . Document < org . apache . abdera . model . Feed > doc = parse ( uri ) ; org . apache . abdera . model . Feed feed = doc . getRoot ( ) ; java . util . List < org . apache . abdera . model . Entry > entries = feed . getEntries ( ) ; for ( org . apache . abdera . model . Entry entry : entries ) { java . util . List < org . apache . abdera . model . Link > links = entry . getLinks ( ) ; for ( org . apache . abdera . model . Link link : links ) { try { link . getMimeType ( ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } } } getMimeType ( ) { try { java . lang . String type = getAttributeValue ( "type" ) ; return type != null ? new javax . activation . MimeType ( type ) : null ; } catch ( org . apache . abdera . ext . thread . javax e ) { throw new org . apache . abdera . util . MimeTypeParseException ( e ) ; } }
org . junit . Assert . assertTrue ( ( e instanceof org . apache . abdera . util . MimeTypeParseException ) )
testShutdownTimeoutBadConfiguration ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; long shutdownTimeout = 50 ; conf . setTimeDuration ( org . apache . hadoop . util . SERVICE_SHUTDOWN_TIMEOUT , shutdownTimeout , TimeUnit . NANOSECONDS ) ; "<AssertPlaceHolder>" ; } getShutdownTimeout ( org . apache . hadoop . conf . Configuration ) { long duration = conf . getTimeDuration ( org . apache . hadoop . util . SERVICE_SHUTDOWN_TIMEOUT , org . apache . hadoop . util . SERVICE_SHUTDOWN_TIMEOUT_DEFAULT , org . apache . hadoop . util . ShutdownHookManager . TIME_UNIT_DEFAULT ) ; if ( duration < ( org . apache . hadoop . util . ShutdownHookManager . TIMEOUT_MINIMUM ) ) { duration = org . apache . hadoop . util . ShutdownHookManager . TIMEOUT_MINIMUM ; } return duration ; }
org . junit . Assert . assertEquals ( org . apache . hadoop . util . SERVICE_SHUTDOWN_TIMEOUT , ShutdownHookManager . TIMEOUT_MINIMUM , org . apache . hadoop . util . ShutdownHookManager . getShutdownTimeout ( conf ) )
testLastBlock ( ) { try { System . out . println ( io . nem . apps . api . ChainApi . getChainLastBlock ( ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . InterruptedException | java . util . concurrent . ExecutionException e ) { assert false ; } } getChainLastBlock ( ) { org . nem . core . serialization . Deserializer des ; des = NemAppsLibGlobals . CONNECTOR . getAsync ( io . nem . apps . service . NemAppsLibGlobals . getNodeEndpoint ( ) , NisApiId . NIS_REST_CHAIN_LAST_BLOCK , "" ) . exceptionally ( ( fn ) -> { fn . printStackTrace ( ) ; return null ; } ) . get ( ) ; return new org . nem . core . model . primitive . BlockHeight ( des ) ; }
org . junit . Assert . assertNotNull ( io . nem . apps . api . ChainApi . getChainLastBlock ( ) )
testGetContentDigest ( ) { final java . lang . String checksum = checksumString ( org . fcrepo . kernel . modeshape . LocalFileBinaryTest . EXPECTED_CONTENT ) ; mockChecksumProperty ( checksum ) ; final java . net . URI digestUri = testObj . getContentDigest ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder b = new java . lang . StringBuilder ( ) ; b . append ( value ) ; if ( hasDatatypeUri ( ) ) { b . append ( org . fcrepo . kernel . modeshape . FedoraJcrConstants . FIELD_DELIMITER ) ; b . append ( datatypeUri ) ; } else if ( hasLang ( ) ) { b . append ( org . fcrepo . kernel . modeshape . FedoraJcrConstants . FIELD_DELIMITER ) ; } if ( hasLang ( ) ) { b . append ( org . fcrepo . kernel . modeshape . FedoraJcrConstants . FIELD_DELIMITER ) ; b . append ( lang ) ; } return b . toString ( ) ; }
org . junit . Assert . assertEquals ( checksum , digestUri . toString ( ) )
retrieveExplicitlyAssociatedProfileCase4 ( ) { org . restcomm . connect . core . service . profile . ProfileServiceTest . MockingService mocks = new org . restcomm . connect . core . service . profile . ProfileServiceTest . MockingService ( ) ; org . restcomm . connect . dao . entities . Organization organization = returnValidOrganization ( mocks ) ; org . restcomm . connect . dao . entities . Profile resultantProfile = mocks . profileService . retrieveExplicitlyAssociatedProfile ( organization . getSid ( ) ) ; "<AssertPlaceHolder>" ; } getSid ( ) { return sid ; }
org . junit . Assert . assertNull ( resultantProfile )
testNoMaxWatermarkOnImmediateStop ( ) { final java . util . List < org . apache . flink . streaming . runtime . streamrecord . StreamElement > output = new java . util . ArrayList ( ) ; final org . apache . flink . streaming . api . operators . StoppableStreamSource < java . lang . String , org . apache . flink . streaming . runtime . operators . StreamSourceOperatorWatermarksTest . InfiniteSource < java . lang . String > > operator = new org . apache . flink . streaming . api . operators . StoppableStreamSource ( new org . apache . flink . streaming . runtime . operators . StreamSourceOperatorWatermarksTest . InfiniteSource < java . lang . String > ( ) ) ; org . apache . flink . streaming . runtime . operators . StreamSourceOperatorWatermarksTest . setupSourceOperator ( operator , TimeCharacteristic . EventTime , 0 ) ; operator . stop ( ) ; operator . run ( new java . lang . Object ( ) , mock ( org . apache . flink . streaming . runtime . streamstatus . StreamStatusMaintainer . class ) , new org . apache . flink . streaming . util . CollectorOutput < java . lang . String > ( output ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return tasks . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( output . isEmpty ( ) )
testHead ( ) { io . reactivex . Single < java . lang . String > single = org . jboss . resteasy . test . rx . rxjava2 . Rx2SingleProxyTest . proxy . head ( ) ; single . subscribe ( ( java . lang . String s ) -> { org . jboss . resteasy . test . rx . rxjava2 . Rx2SingleProxyTest . value . set ( s ) ; org . jboss . resteasy . test . rx . rxjava2 . Rx2SingleProxyTest . latch . countDown ( ) ; } , ( java . lang . Throwable t ) -> throwableContains ( t , "Input<sp>stream<sp>was<sp>empty" ) ) ; "<AssertPlaceHolder>" ; } get ( ) { return org . jboss . resteasy . test . rx . rxjava2 . resource . Rx2ObservableResourceNoStreamImpl . buildObservableString ( "x" , 3 ) ; }
org . junit . Assert . assertNull ( org . jboss . resteasy . test . rx . rxjava2 . Rx2SingleProxyTest . value . get ( ) )
ANDtest ( ) { final org . roaringbitmap . RoaringBitmap rr = new org . roaringbitmap . RoaringBitmap ( ) ; for ( int k = 4000 ; k < 4256 ; ++ k ) { rr . add ( k ) ; } for ( int k = 65536 ; k < ( 65536 + 4000 ) ; ++ k ) { rr . add ( k ) ; } for ( int k = 3 * 65536 ; k < ( ( 3 * 65536 ) + 9000 ) ; ++ k ) { rr . add ( k ) ; } for ( int k = 4 * 65535 ; k < ( ( 4 * 65535 ) + 7000 ) ; ++ k ) { rr . add ( k ) ; } for ( int k = 6 * 65535 ; k < ( ( 6 * 65535 ) + 10000 ) ; ++ k ) { rr . add ( k ) ; } for ( int k = 8 * 65535 ; k < ( ( 8 * 65535 ) + 1000 ) ; ++ k ) { rr . add ( k ) ; } for ( int k = 9 * 65535 ; k < ( ( 9 * 65535 ) + 30000 ) ; ++ k ) { rr . add ( k ) ; } final org . roaringbitmap . RoaringBitmap rr2 = new org . roaringbitmap . RoaringBitmap ( ) ; for ( int k = 4000 ; k < 4256 ; ++ k ) { rr2 . add ( k ) ; } for ( int k = 65536 ; k < ( 65536 + 4000 ) ; ++ k ) { rr2 . add ( k ) ; } for ( int k = ( 3 * 65536 ) + 2000 ; k < ( ( 3 * 65536 ) + 6000 ) ; ++ k ) { rr2 . add ( k ) ; } for ( int k = 6 * 65535 ; k < ( ( 6 * 65535 ) + 1000 ) ; ++ k ) { rr2 . add ( k ) ; } for ( int k = 7 * 65535 ; k < ( ( 7 * 65535 ) + 1000 ) ; ++ k ) { rr2 . add ( k ) ; } for ( int k = 10 * 65535 ; k < ( ( 10 * 65535 ) + 5000 ) ; ++ k ) { rr2 . add ( k ) ; } final org . roaringbitmap . RoaringBitmap correct = org . roaringbitmap . RoaringBitmap . and ( rr , rr2 ) ; rr . and ( rr2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( o instanceof org . roaringbitmap . buffer . ImmutableRoaringBitmap ) { if ( ( this . highLowContainer . size ( ) ) != ( ( ( org . roaringbitmap . buffer . ImmutableRoaringBitmap ) ( o ) ) . highLowContainer . size ( ) ) ) { return false ; } org . roaringbitmap . buffer . MappeableContainerPointer mp1 = this . highLowContainer . getContainerPointer ( ) ; org . roaringbitmap . buffer . MappeableContainerPointer mp2 = ( ( org . roaringbitmap . buffer . ImmutableRoaringBitmap ) ( o ) ) . highLowContainer . getContainerPointer ( ) ; while ( mp1 . hasContainer ( ) ) { if ( ( mp1 . key ( ) ) != ( mp2 . key ( ) ) ) { return false ; } if ( ( mp1 . getCardinality ( ) ) != ( mp2 . getCardinality ( ) ) ) { return false ; } if ( ! ( mp1 . getContainer ( ) . equals ( mp2 . getContainer ( ) ) ) ) { return false ; } mp1 . advance ( ) ; mp2 . advance ( ) ; } return true ; } return false ; }
org . junit . Assert . assertTrue ( correct . equals ( rr ) )
build_shouldSetId ( ) { com . testwithspring . starter . assertions . task . Task task = com . testwithspring . starter . assertions . task . Task . getBuilder ( ) . withId ( com . testwithspring . starter . assertions . task . TaskTest . ID ) . withAssignee ( com . testwithspring . starter . assertions . task . TaskTest . ASSIGNEE_ID ) . withCreator ( com . testwithspring . starter . assertions . task . TaskTest . CREATOR_ID ) . withTitle ( com . testwithspring . starter . assertions . task . TaskTest . TITLE ) . withDescription ( com . testwithspring . starter . assertions . task . TaskTest . DESCRIPTION ) . build ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( com . testwithspring . starter . assertions . task . TaskTest . ID , task . getId ( ) )
getMetadataKeyIdObjectValue ( ) { final java . lang . String person = "person" ; source = new org . mule . runtime . module . extension . internal . runtime . source . ExtensionMessageSourceTestCase . DummySource ( person ) ; sourceAdapter = createSourceAdapter ( ) ; when ( sourceAdapterFactory . createAdapter ( any ( ) , any ( ) , any ( ) , any ( ) , any ( ) ) ) . thenReturn ( sourceAdapter ) ; messageSource = getNewExtensionMessageSourceInstance ( ) ; messageSource . initialise ( ) ; messageSource . start ( ) ; final java . lang . Object metadataKeyValue = messageSource . getParameterValueResolver ( ) . getParameterValue ( org . mule . runtime . module . extension . internal . runtime . source . METADATA_KEY ) ; "<AssertPlaceHolder>" ; } getParameterValue ( java . lang . String ) { try { return getParameterGroup ( parameterName ) . map ( ( group ) -> new org . mule . runtime . module . extension . internal . runtime . operation . ParameterGroupArgumentResolver < > ( group , reflectionCache , expressionManager ) . resolve ( executionContext ) . get ( ) ) . orElseGet ( ( ) -> { java . lang . String showInDslGroupName = showInDslParameters . get ( parameterName ) ; if ( showInDslGroupName != null ) { if ( resolverSet . getResolvers ( ) . get ( showInDslGroupName ) . isDynamic ( ) ) { try { return new org . mule . runtime . module . extension . internal . runtime . config . ResolverSetBasedParameterResolver ( resolverSet , operationModel , reflectionCache , expressionManager ) . getParameterValue ( parameterName ) ; } catch ( e ) { return null ; } } else { return getShowInDslParameterValue ( parameterName , showInDslGroupName ) ; } } if ( executionContext . hasParameter ( parameterName ) ) { return executionContext . getParameter ( parameterName ) ; } return null ; } ) ; } catch ( java . lang . Exception e ) { throw new org . mule . runtime . module . extension . internal . runtime . ValueResolvingException ( ( "Unable<sp>to<sp>resolve<sp>value<sp>for<sp>the<sp>parameter:<sp>" + parameterName ) , e ) ; } }
org . junit . Assert . assertThat ( metadataKeyValue , org . hamcrest . CoreMatchers . is ( person ) )
setMeasurand_powerOffered_measurandIsSet ( ) { java . lang . String measurand = "Power.Offered" ; sampledValue . setMeasurand ( measurand ) ; "<AssertPlaceHolder>" ; } getMeasurand ( ) { return measurand ; }
org . junit . Assert . assertThat ( sampledValue . getMeasurand ( ) , org . hamcrest . CoreMatchers . equalTo ( measurand ) )
testRemove1 ( ) { final com . syncleus . ferma . traversals . VertexTraversal < ? , ? , ? > traversal = graph . v ( ) . has ( "lang" , "java" ) ; traversal . next ( ) ; traversal . remove ( ) ; "<AssertPlaceHolder>" ; } v ( ) { return getGraph ( ) . v ( ) ; }
org . junit . Assert . assertEquals ( 5 , graph . v ( ) . count ( ) )
saveFileNoUpdate ( ) { org . mewx . wenku8 . util . LightCache . saveFile ( org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_FULL_NAME_PATH , new byte [ ] { 'a' , 'b' , 'c' } , false ) ; org . mewx . wenku8 . util . LightCache . saveFile ( org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_FULL_NAME_PATH , new byte [ ] { 'd' , 'e' , 'f' } , false ) ; "<AssertPlaceHolder>" ; } loadFile ( java . lang . String ) { java . io . File file = new java . io . File ( path ) ; if ( ( file . exists ( ) ) && ( file . isFile ( ) ) ) { int fileSize = ( ( int ) ( file . length ( ) ) ) ; try { java . io . FileInputStream in = new java . io . FileInputStream ( file ) ; java . io . DataInputStream dis = new java . io . DataInputStream ( in ) ; byte [ ] bs = new byte [ fileSize ] ; if ( ( dis . read ( bs , 0 , fileSize ) ) == ( - 1 ) ) return null ; dis . close ( ) ; in . close ( ) ; return bs ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } } return null ; }
org . junit . Assert . assertArrayEquals ( new byte [ ] { 'a' , 'b' , 'c' } , org . mewx . wenku8 . util . LightCache . loadFile ( org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_FULL_NAME_PATH ) )
testStandardNormalise ( ) { double [ ] a = new double [ ] { 851620 , 746981 , 637136 , 581571 , 521126 , 485352 } ; uk . ac . tgac . rampart . stage . analyse . asm . stats . Scaling . standardScale ( a , true ) ; "<AssertPlaceHolder>" ; } standardScale ( double [ ] , boolean ) { double min = uk . ac . tgac . rampart . stage . analyse . asm . stats . Scaling . min ( a ) ; double max = uk . ac . tgac . rampart . stage . analyse . asm . stats . Scaling . max ( a ) ; for ( int i = 0 ; i < ( a . length ) ; i ++ ) { double delta = ( a [ i ] ) - min ; double diff = max - min ; double norm = delta / diff ; double newVal = ( diff == 0.0 ) ? 0.5 : norm ; a [ i ] = ( invert ) ? 1.0 - newVal : newVal ; } }
org . junit . Assert . assertTrue ( ( ( a [ 0 ] ) == 0.0 ) )
apply_A$ObjectArray ( ) { com . m3 . scalaflavor4j . IndexedSeq < java . lang . Integer > actual = com . m3 . scalaflavor4j . IndexedSeq . apply ( 1 , 2 , 3 ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
org . junit . Assert . assertThat ( actual . size ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( 3 ) ) )
testCountByExample ( ) { int result = topicServiceImpl . countByExample ( topic ) ; "<AssertPlaceHolder>" ; } countByExample ( com . onboard . domain . model . Tag ) { com . onboard . domain . mapper . model . TagExample example = new com . onboard . domain . mapper . model . TagExample ( item ) ; return tagMapper . countByExample ( example ) ; }
org . junit . Assert . assertEquals ( result , size )
testSimpleDefineFunction ( ) { org . nd4j . autodiff . samediff . SameDiff sameDiffOuter = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > inputs = variablesForInput ( ) ; inputs . remove ( "y" ) ; java . lang . String logisticForward = "logisticPredictions" ; sameDiffOuter . defineFunction ( logisticForward , new org . nd4j . autodiff . samediff . SameDiffFunctionDefinition ( ) { @ org . nd4j . autodiff . samediff . Override public org . nd4j . autodiff . samediff . SDVariable [ ] define ( org . nd4j . autodiff . samediff . SameDiff sameDiff , org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > inputs , org . nd4j . autodiff . samediff . SDVariable [ ] variableInputs ) { org . nd4j . autodiff . samediff . SDVariable input = sameDiff . var ( "x" , inputs . get ( "x" ) ) ; org . nd4j . autodiff . samediff . SDVariable w = sameDiff . var ( "w" , inputs . get ( "w" ) ) ; org . nd4j . autodiff . samediff . SDVariable preOutput = sameDiff . mmul ( input , w ) ; org . nd4j . autodiff . samediff . SDVariable sigmoid = sameDiff . nn ( ) . sigmoid ( preOutput ) ; return new org . nd4j . autodiff . samediff . SDVariable [ ] { sigmoid } ; } } , inputs ) ; "<AssertPlaceHolder>" ; } definedFunctionNames ( ) { return this . sameDiffFunctionInstances . keySet ( ) ; }
org . junit . Assert . assertEquals ( 1 , sameDiffOuter . definedFunctionNames ( ) . size ( ) )
shouldPersist ( ) { net . rrm . ehour . domain . Customer customer = net . rrm . ehour . domain . CustomerObjectMother . createCustomer ( ) ; customer . setName ( "aa" ) ; customer . setCode ( "bb" ) ; customer . setCustomerId ( null ) ; customerDao . persist ( customer ) ; "<AssertPlaceHolder>" ; } getCustomerId ( ) { return this . customerId ; }
org . junit . Assert . assertNotNull ( customer . getCustomerId ( ) )
updateActiveStateShouldFailIfNotFound ( ) { com . spotify . styx . storage . DatastoreStorageTransaction tx = new com . spotify . styx . storage . DatastoreStorageTransaction ( com . spotify . styx . storage . DatastoreStorageTransactionTest . datastore . newTransaction ( ) ) ; tx . updateActiveState ( com . spotify . styx . storage . DatastoreStorageTest . WORKFLOW_INSTANCE1 , com . spotify . styx . storage . DatastoreStorageTest . RUN_STATE ) ; try { tx . commit ( ) ; org . junit . Assert . fail ( "Expected<sp>exception!" ) ; } catch ( com . spotify . styx . storage . TransactionException e ) { "<AssertPlaceHolder>" ; } } isNotFound ( ) { if ( ( ( getCause ( ) ) != null ) && ( ( getCause ( ) ) instanceof com . google . cloud . datastore . DatastoreException ) ) { com . google . cloud . datastore . DatastoreException datastoreException = ( ( com . google . cloud . datastore . DatastoreException ) ( getCause ( ) ) ) ; return ( "NOT_FOUND" . equals ( datastoreException . getReason ( ) ) ) || ( messageStartsWith ( "no<sp>entity<sp>to<sp>update" ) ) ; } else { return false ; } }
org . junit . Assert . assertThat ( e . isNotFound ( ) , org . hamcrest . Matchers . is ( true ) )
getPatientIdentifierTypes_shouldReturnNonRetiredPatientIdentifierTypes_OrderedByRequiredFirst ( ) { org . openmrs . PatientIdentifierType nonRetiredNonRequiredType1 = dao . getPatientIdentifierType ( 1 ) ; org . openmrs . PatientIdentifierType nonRetiredNonRequiredType2 = dao . getPatientIdentifierType ( 5 ) ; org . openmrs . PatientIdentifierType nonRetiredRequiredType = dao . getPatientIdentifierType ( 2 ) ; nonRetiredRequiredType . setRequired ( true ) ; dao . savePatientIdentifierType ( nonRetiredRequiredType ) ; java . util . List < org . openmrs . PatientIdentifierType > patientIdentifierTypes = dao . getPatientIdentifierTypes ( null , null , null , null ) ; "<AssertPlaceHolder>" ; } toArray ( ) { return allergies . toArray ( ) ; }
org . junit . Assert . assertArrayEquals ( new java . lang . Object [ ] { nonRetiredRequiredType , nonRetiredNonRequiredType1 , nonRetiredNonRequiredType2 } , patientIdentifierTypes . toArray ( ) )
should_get_gatalog_whith_prefixed_service_offering ( ) { com . orange . cloud . servicebroker . filter . core . service . mapper . SuffixedCatalogMapper mapper = new com . orange . cloud . servicebroker . filter . core . service . mapper . SuffixedCatalogMapper ( "-suffix" ) ; org . springframework . cloud . servicebroker . model . Catalog input = org . springframework . cloud . servicebroker . model . fixture . CatalogFixture . getCatalog ( ) ; final org . springframework . cloud . servicebroker . model . Catalog prefixedCatalog = mapper . toCatalog ( input ) ; "<AssertPlaceHolder>" ; } expectedCatalog ( ) { java . util . ArrayList plans = new java . util . ArrayList ( ) ; java . util . HashMap metadata = new java . util . HashMap ( ) ; metadata . put ( "key1" , "Service<sp>One-suffix" 1 ) ; metadata . put ( "key2" , "value2" ) ; plans . add ( new org . springframework . cloud . servicebroker . model . Plan ( "plan-one-id-suffix" , "Plan<sp>One-suffix" , "Description<sp>for<sp>Plan<sp>One" ) ) ; plans . add ( new org . springframework . cloud . servicebroker . model . Plan ( "plan-two-id-suffix" , "Plan<sp>Two-suffix" , "Description<sp>for<sp>Plan<sp>Two" , metadata ) ) ; java . util . List services = java . util . Collections . singletonList ( new org . springframework . cloud . servicebroker . model . ServiceDefinition ( "Service<sp>One-suffix" 0 , "Service<sp>One-suffix" , "Service<sp>One-suffix" 2 , true , plans ) ) ; return new org . springframework . cloud . servicebroker . model . Catalog ( services ) ; }
org . junit . Assert . assertEquals ( expectedCatalog ( ) , prefixedCatalog )
testSanitizePathWithoutSensitiveInfoIsUnchanged ( ) { java . lang . String path = "myhost:8080/mypath" ; "<AssertPlaceHolder>" ; } sanitizePath ( java . lang . String ) { java . lang . String sanitized = path ; if ( path != null ) { sanitized = org . apache . camel . util . URISupport . PATH_USERINFO_PASSWORD . matcher ( sanitized ) . replaceFirst ( "$1xxxxxx$3" ) ; } return sanitized ; }
org . junit . Assert . assertEquals ( path , org . apache . camel . util . URISupport . sanitizePath ( path ) )
testMemAlloc ( ) { for ( int i = 0 ; i < 10000 ; i ++ ) { java . nio . ByteBuffer byteBuffer = getBuffer ( 8194 ) ; byteBuffer . put ( "helll<sp>world" . getBytes ( ) ) ; byteBuffer . flip ( ) ; byte [ ] src = new byte [ byteBuffer . remaining ( ) ] ; byteBuffer . get ( src ) ; "<AssertPlaceHolder>" ; free ( byteBuffer ) ; } } get ( int ) { return rangeCounters . get ( index ) ; }
org . junit . Assert . assertEquals ( "helll<sp>world" , new java . lang . String ( src ) )
insertBeforeHgroup ( ) { html = org . mixer2 . xhtml . insert . InsertById_html5Test . m2e . loadHtmlTemplate ( new java . io . File ( templateFilePath ) ) ; org . mixer2 . jaxb . xhtml . P p = org . mixer2 . xhtml . TagCreator . pWithId ( "p1" ) ; p . getContent ( ) . add ( "paragraph" ) ; html . insertBeforeId ( "hgroup1" , p ) ; java . util . List < java . lang . Object > objList = html . getById ( "header1" , org . mixer2 . jaxb . xhtml . Header . class ) . getContent ( ) ; for ( int i = 0 ; i < ( objList . size ( ) ) ; i ++ ) { if ( ( objList . get ( i ) ) instanceof org . mixer2 . jaxb . xhtml . Hgroup ) { "<AssertPlaceHolder>" ; break ; } } } getId ( ) { return null ; }
org . junit . Assert . assertEquals ( "p1" , ( ( org . mixer2 . jaxb . xhtml . P ) ( objList . get ( ( i - 1 ) ) ) ) . getId ( ) )
testAnonymous ( ) { com . amazonaws . auth . AWSCredentials credentials = new com . amazonaws . auth . AnonymousAWSCredentials ( ) ; com . amazonaws . Request < ? > request = new com . amazonaws . DefaultRequest < java . lang . Void > ( "Foo" ) ; request . setContent ( new java . io . ByteArrayInputStream ( "{\"TableName\":<sp>\"foo\"}" . getBytes ( StringUtils . UTF8 ) ) ) ; request . setResourcePath ( "/" ) ; request . addHeader ( "X-Amz-Target" , "com.amazon.bigbird.sharedtypes.BigBirdRequestRouterService.DescribeTable" ) ; request . setEndpoint ( java . net . URI . create ( "http://sdb-func7-3001.sea3:8080" ) ) ; signer . overrideDate ( "Tue,<sp>15<sp>Mar<sp>2011<sp>20:35:24<sp>GMT" ) ; signer . sign ( request , credentials ) ; java . lang . String authorization = request . getHeaders ( ) . get ( "X-Amzn-Authorization" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return local . getValue ( getIdentityId ( ) , datasetName , com . amazonaws . mobileconnectors . cognito . internal . util . DatasetUtils . validateRecordKey ( key ) ) ; }
org . junit . Assert . assertNull ( authorization )
testCountWithTimestampInMessageAndCustomFormat ( ) { this . sink . input ( ) . send ( new org . springframework . messaging . support . GenericMessage < java . lang . Object > ( java . util . Collections . singletonMap ( "ts" , "14/10/1978" ) ) ) ; org . joda . time . DateTime endDate = new org . joda . time . DateTime ( 1980 , 1 , 1 , 0 , 0 ) ; org . springframework . analytics . metrics . AggregateCounter counts = this . aggregateCounterRepository . getCounts ( org . springframework . cloud . stream . app . aggregate . counter . sink . AggregateCounterTests . AGGREGATE_COUNTER_NAME , 5 , endDate , AggregateCounterResolution . year ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertThat ( counts . getCounts ( ) , org . hamcrest . Matchers . equalTo ( new long [ ] { 0 , 0 , 1 , 0 , 0 } ) )
testTestWhenFalse ( ) { org . apache . commons . functor . NullaryFunction < java . lang . Boolean > f = new org . apache . commons . functor . adapter . NullaryPredicateNullaryFunction ( org . apache . commons . functor . core . Constant . FALSE ) ; "<AssertPlaceHolder>" ; } evaluate ( ) { return java . lang . Integer . valueOf ( ( ( count ) ++ ) ) ; }
org . junit . Assert . assertEquals ( Boolean . FALSE , f . evaluate ( ) )
ListEqualTest ( ) { java . util . List < model . Team > teams = teamServices . listEqual ( 10 ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( com . github . drinkjava2 . jdialects . springsrc . utils . ConcurrentReferenceHashMap < K , V > . Segment segment : this . segments ) { size += segment . getCount ( ) ; } return size ; }
org . junit . Assert . assertEquals ( 1 , teams . size ( ) )
testIgnoresNullValues ( ) { try ( final org . apache . druid . server . lookup . namespace . cache . CacheScheduler . Entry entry = ensureEntry ( ) ) { insertValues ( handleRef , "fooz" , null , null , "2900-01-01<sp>00:00:00" ) ; waitForUpdates ( 1000L , 2L ) ; java . lang . Thread . sleep ( 100 ) ; java . util . Set set = entry . getCache ( ) . keySet ( ) ; "<AssertPlaceHolder>" ; } } contains ( int ) { if ( isEmpty ( ) ) { return false ; } final org . apache . druid . extendedset . intset . IntSet . IntIterator intIterator = iterator ( ) ; intIterator . skipAllBefore ( integer ) ; return ( intIterator . hasNext ( ) ) && ( ( intIterator . next ( ) ) == integer ) ; }
org . junit . Assert . assertFalse ( set . contains ( "fooz" ) )
testHandle ( ) { org . springframework . validation . BindException e = new org . springframework . validation . BindException ( bindingResult ) ; java . lang . String field = "name" ; java . lang . String defaultMessage = "not<sp>valid" ; org . springframework . validation . FieldError fieldError1 = new org . springframework . validation . FieldError ( "fdsfsd" , field , defaultMessage ) ; java . util . List < org . springframework . validation . FieldError > errors = java . util . Arrays . asList ( fieldError1 ) ; org . lnu . is . resource . message . Pair < java . lang . String , java . lang . String > pair = new org . lnu . is . resource . message . Pair < java . lang . String , java . lang . String > ( ) ; pair . setName ( field ) ; pair . setValue ( defaultMessage ) ; java . util . List < org . lnu . is . resource . message . Pair < java . lang . String , java . lang . String > > errorResource = java . util . Arrays . asList ( pair ) ; org . lnu . is . resource . message . MessageResource expected = new org . lnu . is . resource . message . validation . ValidationMessageResource ( org . lnu . is . resource . message . MessageType . ERROR , "Validation<sp>failed,<sp>please<sp>see<sp>following<sp>errors" , errorResource ) ; when ( bindingResult . getFieldErrors ( ) ) . thenReturn ( errors ) ; org . lnu . is . resource . message . MessageResource actual = unit . handle ( e ) ; "<AssertPlaceHolder>" ; } handle ( java . lang . Exception ) { org . lnu . is . web . rest . handler . DefaultExceptionHandler . LOGGER . error ( "Handling<sp>general<sp>exception<sp>exception" , e ) ; org . lnu . is . resource . message . MessageResource message = new org . lnu . is . resource . message . MessageResource ( ) ; message . setMessageType ( MessageType . ERROR ) ; message . setMessage ( e . getMessage ( ) ) ; return message ; }
org . junit . Assert . assertEquals ( expected , actual )
getHoldsForFilePlan ( ) { doReturn ( holds ) . when ( mockedHoldService ) . getHolds ( filePlan ) ; java . util . Map < java . lang . String , java . lang . String > parameters = buildParameters ( "store_type" , filePlan . getStoreRef ( ) . getProtocol ( ) , "store_id" , filePlan . getStoreRef ( ) . getIdentifier ( ) , "id" , filePlan . getId ( ) ) ; org . json . JSONObject json = executeJSONWebScript ( parameters ) ; "<AssertPlaceHolder>" ; testForBothHolds ( json ) ; } getId ( ) { return id ; }
org . junit . Assert . assertNotNull ( json )
testValueOf ( ) { for ( org . jscep . transaction . MessageType msgType : org . jscep . transaction . MessageType . values ( ) ) { "<AssertPlaceHolder>" ; } } valueOf ( int ) { for ( org . jscep . transaction . MessageType msgType : org . jscep . transaction . MessageType . values ( ) ) { if ( ( msgType . getValue ( ) ) == value ) { return msgType ; } } throw new java . lang . IllegalArgumentException ( ) ; }
org . junit . Assert . assertSame ( msgType , org . jscep . transaction . MessageType . valueOf ( msgType . getValue ( ) ) )
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . portal . workflow . kaleo . model . KaleoTimerInstanceToken missingKaleoTimerInstanceToken = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
org . junit . Assert . assertNull ( missingKaleoTimerInstanceToken )
testGetGyroscopeRaw ( ) { org . eclipse . kura . raspberrypi . sensehat . sensors . LSM9DS1 lsm9ds1 = org . eclipse . kura . raspberrypi . sensehat . sensors . LSM9DS1 . getIMUSensor ( 1 , 3 , 4 , 1 , 1 ) ; float [ ] gyroRaw = lsm9ds1 . getGyroscopeRaw ( ) ; float [ ] expected = new float [ ] { - 0.024642F , - 0.020255F , 0.011905F } ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object , java . lang . Object ) { if ( obj1 == obj2 ) return true ; if ( ( ( obj1 == null ) || ( obj2 == null ) ) || ( ( obj1 . getClass ( ) ) != ( obj2 . getClass ( ) ) ) ) return false ; java . security . Permission p1 = ( ( java . security . Permission ) ( obj1 ) ) ; java . security . Permission p2 = ( ( java . security . Permission ) ( obj2 ) ) ; return ( p1 . getName ( ) . equals ( p2 . getName ( ) ) ) && ( p1 . getActions ( ) . equals ( p2 . getActions ( ) ) ) ; }
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( expected , gyroRaw ) )
testPriority ( ) { org . kefirsf . bb . conf . Code code = new org . kefirsf . bb . conf . Code ( ) ; code . setPriority ( 3 ) ; "<AssertPlaceHolder>" ; } getPriority ( ) { return priority ; }
org . junit . Assert . assertEquals ( 3 , code . getPriority ( ) )
testOntbekendeSpatieRondOperator ( ) { final java . lang . String voorwaardeRegel = "08.11.60<sp>GA1<sp>\"2261*\"<sp>OFVGL<sp>\"2262*\"OFVGL<sp>\"2263*\"<sp>OFVGL\"2264*\"<sp>OFVGL<sp>\"2265*\"<sp>" ; final java . lang . String expressieVerwacht = "Persoon.Adres.Postcode<sp>EIN%<sp>{\"2261*\",<sp>\"2262*\",<sp>\"2263*\",<sp>\"2264*\",<sp>\"2265*\"}" ; final java . lang . String expressie = converteerNaarExpressieService . converteerVoorwaardeRegel ( voorwaardeRegel ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expressieVerwacht , expressie )
testOverrideSerializableAttributeWithNonSerializable ( ) { java . lang . String attributeName = "name" ; java . io . Serializable serializableAttribute = new java . lang . String ( ) ; uiSession . setAttribute ( attributeName , serializableAttribute ) ; java . lang . Object overridingAtribute = new java . lang . Object ( ) ; uiSession . setAttribute ( attributeName , overridingAtribute ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( name , "name" ) ; return props . getProperty ( name ) ; }
org . junit . Assert . assertSame ( overridingAtribute , uiSession . getAttribute ( attributeName ) )
testSerialize ( ) { com . akkafun . common . test . domain . NotifyFirstTestEvent testEventFirst = new com . akkafun . common . test . domain . NotifyFirstTestEvent ( "" , java . time . LocalDateTime . now ( ) ) ; java . lang . String json = com . akkafun . common . event . EventUtils . serializeEvent ( testEventFirst ) ; com . akkafun . common . test . domain . NotifyFirstTestEvent testEventFirstFromJson = com . akkafun . common . event . EventUtils . deserializeEvent ( json , com . akkafun . common . test . domain . NotifyFirstTestEvent . class ) ; "<AssertPlaceHolder>" ; } deserializeEvent ( java . lang . String , java . lang . Class ) { return com . akkafun . common . utils . JsonUtils . json2Object ( data , clazz ) ; }
org . junit . Assert . assertThat ( testEventFirstFromJson , org . hamcrest . Matchers . is ( testEventFirst ) )
testResourcePathsDiffer ( ) { org . eclipse . rap . rwt . internal . theme . CssImage image1 = org . eclipse . rap . rwt . internal . theme . CssImage . valueOf ( Fixture . IMAGE_50x100 , org . eclipse . rap . rwt . internal . theme . ThemeTestUtil . RESOURCE_LOADER ) ; org . eclipse . rap . rwt . internal . theme . CssImage image2 = org . eclipse . rap . rwt . internal . theme . CssImage . valueOf ( Fixture . IMAGE_100x50 , org . eclipse . rap . rwt . internal . theme . ThemeTestUtil . RESOURCE_LOADER ) ; java . lang . String path1 = image1 . getResourcePath ( applicationContext ) ; java . lang . String path2 = image2 . getResourcePath ( applicationContext ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; org . eclipse . rap . e4 . internal . RAPEventObjectSupplier . Subscriber other = ( ( org . eclipse . rap . e4 . internal . RAPEventObjectSupplier . Subscriber ) ( obj ) ) ; if ( ( requestor ) == null ) { if ( ( other . requestor ) != null ) return false ; } else if ( ! ( requestor . equals ( other . requestor ) ) ) return false ; if ( ( topic ) == null ) { if ( ( other . topic ) != null ) return false ; } else if ( ! ( topic . equals ( other . topic ) ) ) return false ; return true ; }
org . junit . Assert . assertFalse ( path1 . equals ( path2 ) )
one_$this_array_query_projection_with_no_match_projection ( ) { com . redhat . lightblue . query . Projection p = com . redhat . lightblue . eval . EvalTestContext . projectionFromJson ( "{'field':'field7.$this','match':{'field':'elemf3','op':'>','rvalue':25},'projection':{'field':'*'}}" ) ; com . redhat . lightblue . eval . Projector projector = com . redhat . lightblue . eval . Projector . getInstance ( p , md ) ; com . fasterxml . jackson . databind . JsonNode expectedNode = com . redhat . lightblue . util . JsonUtils . json ( "{}" . replace ( '\'' , '\"' ) ) ; com . redhat . lightblue . util . JsonDoc pdoc = projector . project ( jsonDoc , com . redhat . lightblue . eval . JSON_NODE_FACTORY ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ops [ 0 ] ; }
org . junit . Assert . assertEquals ( expectedNode . toString ( ) , pdoc . toString ( ) )
testIsTablePatternAvailable ( ) { mmarquee . automation . pattern . Table pattern = org . mockito . Mockito . mock ( mmarquee . automation . pattern . Table . class ) ; when ( pattern . isAvailable ( ) ) . thenReturn ( true ) ; mmarquee . automation . controls . AutomationWindow window = new mmarquee . automation . controls . AutomationWindow ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( pattern ) ) ; boolean value = window . isTablePatternAvailable ( ) ; "<AssertPlaceHolder>" ; } isTablePatternAvailable ( ) { return isPatternAvailable ( PropertyID . IsTablePatternAvailable ) ; }
org . junit . Assert . assertTrue ( value )
testGetOutputFormat ( ) { java . util . List < org . geoserver . wms . GetMapOutputFormat > producers = org . geoserver . wms . WMSExtensions . findMapProducers ( applicationContext ) ; for ( org . geoserver . wms . GetMapOutputFormat producer : producers ) { "<AssertPlaceHolder>" ; } } getMimeType ( ) { switch ( this ) { case JSON : return org . geoserver . wfs . json . JSONType . json ; case JSONP : return org . geoserver . wfs . json . JSONType . jsonp ; default : return null ; } }
org . junit . Assert . assertNotNull ( producer . getMimeType ( ) )
testHoleAssignment ( ) { java . awt . Dimension ps = new java . awt . Dimension ( 500 , 500 ) ; org . locationtech . jts . geom . PrecisionModel precision = new org . locationtech . jts . geom . PrecisionModel ( ) ; java . util . ArrayList shells = new java . util . ArrayList ( ) ; java . util . ArrayList holes = new java . util . ArrayList ( ) ; int x = 10 ; int y = 10 ; shells . add ( org . geotools . data . shapefile . shp . PolygonHandlerTest . copyTo ( x , y , ( ( ps . width ) - ( 2 * x ) ) , ( ( ps . height ) - ( 2 * y ) ) , org . geotools . data . shapefile . shp . PolygonHandlerTest . rectangle ( precision , 0 ) ) ) ; int w = 11 ; int h = 11 ; int s = 10 ; int nx = ( ( ps . width ) - ( 2 * x ) ) / ( w + s ) ; int ny = ( ( ps . height ) - ( 2 * y ) ) / ( h + s ) ; for ( int i = 0 ; i < nx ; i ++ ) { for ( int j = 0 ; j < ny ; j ++ ) { holes . add ( org . geotools . data . shapefile . shp . PolygonHandlerTest . copyTo ( ( ( x + s ) + ( i * ( w + s ) ) ) , ( ( y + s ) + ( j * ( h + s ) ) ) , w , h , org . geotools . data . shapefile . shp . PolygonHandlerTest . rectangle ( precision , 0 ) ) ) ; } } org . geotools . data . shapefile . shp . PolygonHandler ph = new org . geotools . data . shapefile . shp . PolygonHandler ( new org . locationtech . jts . geom . GeometryFactory ( ) ) ; java . util . ArrayList assigned = ph . assignHolesToShells ( shells , holes ) ; "<AssertPlaceHolder>" ; } get ( int ) { switch ( value ) { case net . opengis . wcs10 . InterpolationMethodType . NEAREST_NEIGHBOR : return net . opengis . wcs10 . InterpolationMethodType . NEAREST_NEIGHBOR_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BILINEAR : return net . opengis . wcs10 . InterpolationMethodType . BILINEAR_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BICUBIC : return net . opengis . wcs10 . InterpolationMethodType . BICUBIC_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . LOST_AREA : return net . opengis . wcs10 . InterpolationMethodType . LOST_AREA_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BARYCENTRIC : return net . opengis . wcs10 . InterpolationMethodType . BARYCENTRIC_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . NONE : return net . opengis . wcs10 . InterpolationMethodType . NONE_LITERAL ; } return null ; }
org . junit . Assert . assertEquals ( ( ( java . util . ArrayList ) ( assigned . get ( 0 ) ) ) . size ( ) , holes . size ( ) )
testAddToReceivedInt ( long , int , long ) { com . github . mucaho . jnetrobust . util . ShiftableBitSet actualBitSet = new com . github . mucaho . jnetrobust . util . ShiftableBitSet ( preBits ) ; com . github . mucaho . jnetrobust . util . ShiftableBitSet expectedBitSet = new com . github . mucaho . jnetrobust . util . ShiftableBitSet ( postBits ) ; com . github . mucaho . jnetrobust . control . ReceivedBitsControl handler = new com . github . mucaho . jnetrobust . control . ReceivedBitsControl ( null ) ; mockit . Deencapsulation . setField ( handler , "receivedRemoteBits" , actualBitSet ) ; java . lang . String debug = "" ; debug += actualBitSet ; handler . addToReceived ( inDiff ) ; debug += ( ".addToReceived(" + inDiff ) + ")" ; debug += "<sp>=<sp>" + actualBitSet ; debug += "<sp>!=<sp>" + expectedBitSet ; "<AssertPlaceHolder>" ; } get ( ) { return this . bits ; }
org . junit . Assert . assertEquals ( debug , expectedBitSet . get ( ) , actualBitSet . get ( ) )
testGrantPermissionWebApplicationException ( ) { org . apache . ranger . plugin . model . RangerPolicy policy = rangerPolicy ( org . apache . ranger . rest . TestAssetREST . Id ) ; org . apache . ranger . plugin . model . RangerService service = rangerService ( org . apache . ranger . rest . TestAssetREST . Id ) ; org . apache . ranger . view . VXPolicy vXPolicy = vXPolicy ( policy , service ) ; org . apache . ranger . plugin . util . GrantRevokeRequest grantRequestObj = new org . apache . ranger . plugin . util . GrantRevokeRequest ( ) ; grantRequestObj . setAccessTypes ( null ) ; grantRequestObj . setDelegateAdmin ( true ) ; grantRequestObj . setEnableAudit ( true ) ; grantRequestObj . setGrantor ( "read" ) ; grantRequestObj . setIsRecursive ( true ) ; javax . ws . rs . WebApplicationException webApplicationException = new javax . ws . rs . WebApplicationException ( ) ; org . mockito . Mockito . when ( serviceUtil . toGrantRevokeRequest ( vXPolicy ) ) . thenReturn ( grantRequestObj ) ; try { org . mockito . Mockito . when ( serviceREST . grantAccess ( vXPolicy . getRepositoryName ( ) , grantRequestObj , request ) ) . thenThrow ( webApplicationException ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "test<sp>failed<sp>due<sp>to:<sp>" + ( e . getMessage ( ) ) ) ) ; } try { assetREST . grantPermission ( request , vXPolicy ) ; org . junit . Assert . fail ( "Exception<sp>not<sp>thrown" ) ; } catch ( javax . ws . rs . WebApplicationException e ) { "<AssertPlaceHolder>" ; } org . mockito . Mockito . verify ( serviceUtil ) . toGrantRevokeRequest ( vXPolicy ) ; try { org . mockito . Mockito . verify ( serviceREST ) . grantAccess ( vXPolicy . getRepositoryName ( ) , grantRequestObj , request ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "test<sp>failed<sp>due<sp>to:<sp>" + ( e . getMessage ( ) ) ) ) ; } } grantPermission ( javax . servlet . http . HttpServletRequest , org . apache . ranger . rest . VXPolicy ) { org . apache . ranger . admin . client . datatype . RESTResponse ret = null ; if ( org . apache . ranger . rest . AssetREST . logger . isDebugEnabled ( ) ) { org . apache . ranger . rest . AssetREST . logger . debug ( ( ( "==><sp>AssetREST.grantPermission(" + vXPolicy ) + ")" ) ) ; } if ( vXPolicy != null ) { java . lang . String serviceName = vXPolicy . getRepositoryName ( ) ; org . apache . ranger . plugin . util . GrantRevokeRequest grantRevokeRequest = serviceUtil . toGrantRevokeRequest ( vXPolicy ) ; try { ret = serviceREST . grantAccess ( serviceName , grantRevokeRequest , request ) ; } catch ( javax . ws . rs . WebApplicationException excp ) { throw excp ; } catch ( java . lang . Throwable e ) { org . apache . ranger . rest . AssetREST . logger . error ( ( ( ( javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ) + "Grant<sp>Access<sp>Failed<sp>for<sp>the<sp>request<sp>" ) + vXPolicy ) , e ) ; throw restErrorUtil . createRESTException ( ( ( ( "Grant<sp>Access<sp>Failed<sp>for<sp>the<sp>request:<sp>" + vXPolicy ) + ".<sp>" ) + ( e . getMessage ( ) ) ) ) ; } } else { org . apache . ranger . rest . AssetREST . logger . error ( ( ( javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ) + "Bad<sp>Request<sp>parameter" ) ) ; throw restErrorUtil . createRESTException ( "Bad<sp>Request<sp>parameter" ) ; } if ( org . apache . ranger . rest . AssetREST . logger . isDebugEnabled ( ) ) { org . apache . ranger . rest . AssetREST . logger . debug ( ( ( "<==<sp>AssetREST.grantPermission(" + ret ) + ")" ) ) ; } return vXPolicy ; }
org . junit . Assert . assertTrue ( true )
testLargeDoubleQueue ( ) { java . util . Random random = new java . util . Random ( ) ; com . charlesbihis . sandbox . queuefromstacks . Queue < java . lang . Double > queue = new com . charlesbihis . sandbox . queuefromstacks . QueueFromStacks < java . lang . Double > ( ) ; java . util . Queue < java . lang . Double > list = new java . util . LinkedList < java . lang . Double > ( ) ; for ( int i = 0 ; i < 500 ; i ++ ) { java . lang . Double num = random . nextDouble ( ) ; queue . enqueue ( num ) ; list . add ( num ) ; } while ( ( queue . size ( ) ) > 0 ) { "<AssertPlaceHolder>" ; } } dequeue ( ) { if ( ( dequeueStack . size ( ) ) == 0 ) { while ( ( enqueueStack . size ( ) ) > 0 ) { dequeueStack . push ( enqueueStack . pop ( ) ) ; } } return dequeueStack . pop ( ) ; }
org . junit . Assert . assertEquals ( list . remove ( ) , queue . dequeue ( ) )
testGetProperty ( ) { org . aeonbits . owner . ConfigFactory . setProperty ( "mypath" , org . aeonbits . owner . RESOURCES_DIR ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return org . aeonbits . owner . ConfigFactory . INSTANCE . getProperty ( key ) ; }
org . junit . Assert . assertEquals ( org . aeonbits . owner . RESOURCES_DIR , org . aeonbits . owner . ConfigFactory . getProperty ( "mypath" ) )
setNxShouldNotSetValueWhenAlreadyExistsInDBCorrectly ( ) { nativeConnection . set ( org . springframework . data . redis . connection . lettuce . KEY_1 , org . springframework . data . redis . connection . lettuce . VALUE_1 ) ; clusterConnection . setNX ( org . springframework . data . redis . connection . lettuce . LettuceClusterConnectionTests . KEY_1_BYTES , org . springframework . data . redis . connection . lettuce . LettuceClusterConnectionTests . VALUE_2_BYTES ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { return delegate . get ( key ) ; }
org . junit . Assert . assertThat ( nativeConnection . get ( org . springframework . data . redis . connection . lettuce . KEY_1 ) , is ( org . springframework . data . redis . connection . lettuce . VALUE_1 ) )
testStripManifest ( ) { final java . io . File out = java . io . File . createTempFile ( "manifest" , null ) ; out . deleteOnExit ( ) ; new io . github . zlika . reproducible . ManifestStripper ( ) . strip ( new java . io . File ( this . getClass ( ) . getResource ( "MANIFEST.MF" ) . getFile ( ) ) , out ) ; final byte [ ] expected = java . nio . file . Files . readAllBytes ( new java . io . File ( this . getClass ( ) . getResource ( "MANIFEST-stripped.MF" ) . getFile ( ) ) . toPath ( ) ) ; final byte [ ] actual = java . nio . file . Files . readAllBytes ( out . toPath ( ) ) ; "<AssertPlaceHolder>" ; out . delete ( ) ; } strip ( java . io . File , java . io . File ) { final io . github . zlika . reproducible . Stripper stripper = io . github . zlika . reproducible . SmartTarStripper . findImplementation ( file ) ; stripper . strip ( file , stripped ) ; if ( this . overwrite ) { java . nio . file . Files . move ( stripped . toPath ( ) , file . toPath ( ) , StandardCopyOption . REPLACE_EXISTING ) ; } }
org . junit . Assert . assertArrayEquals ( expected , actual )
attemptReconnectsAfterAFailedReconnect ( ) { final java . util . concurrent . BlockingQueue < java . lang . Object > values = new java . util . concurrent . LinkedBlockingQueue < java . lang . Object > ( ) ; com . github . nkzawa . socketio . client . IO . Options opts = createOptions ( ) ; opts . reconnection = true ; opts . timeout = 0 ; opts . reconnectionAttempts = 2 ; opts . reconnectionDelay = 10 ; final com . github . nkzawa . socketio . client . Manager manager = new com . github . nkzawa . socketio . client . Manager ( new java . net . URI ( uri ( ) ) , opts ) ; socket = manager . socket ( "/timeout" ) ; socket . once ( Socket . EVENT_RECONNECT_FAILED , new com . github . nkzawa . emitter . Emitter . Listener ( ) { @ com . github . nkzawa . socketio . client . Override public void call ( java . lang . Object ... args ) { final int [ ] reconnects = new int [ ] { 0 } ; com . github . nkzawa . emitter . Emitter . Listener reconnectCb = new com . github . nkzawa . emitter . Emitter . Listener ( ) { @ com . github . nkzawa . socketio . client . Override public void call ( java . lang . Object ... args ) { ( reconnects [ 0 ] ) ++ ; } } ; manager . on ( Manager . EVENT_RECONNECT_ATTEMPT , reconnectCb ) ; manager . on ( Manager . EVENT_RECONNECT_FAILED , new com . github . nkzawa . emitter . Emitter . Listener ( ) { @ com . github . nkzawa . socketio . client . Override public void call ( java . lang . Object ... args ) { values . offer ( reconnects [ 0 ] ) ; } } ) ; socket . connect ( ) ; } } ) ; socket . connect ( ) ; "<AssertPlaceHolder>" ; socket . close ( ) ; manager . close ( ) ; } connect ( ) { final java . util . concurrent . BlockingQueue < java . lang . Object > values = new java . util . concurrent . LinkedBlockingQueue < java . lang . Object > ( ) ; com . github . nkzawa . socketio . client . IO . Options opts = createOptions ( ) ; opts . sslContext = createSSLContext ( ) ; opts . hostnameVerifier = com . github . nkzawa . socketio . client . SSLConnectionTest . hostnameVerifier ; socket = client ( opts ) ; socket . on ( Socket . EVENT_CONNECT , new com . github . nkzawa . emitter . Emitter . Listener ( ) { @ com . github . nkzawa . socketio . client . Override public void call ( java . lang . Object ... objects ) { socket . emit ( "echo" ) ; socket . on ( "echoBack" , new com . github . nkzawa . emitter . Emitter . Listener ( ) { @ com . github . nkzawa . socketio . client . Override public void call ( java . lang . Object ... args ) { values . offer ( "done" ) ; } } ) ; } } ) ; socket . connect ( ) ; values . take ( ) ; socket . close ( ) ; }
org . junit . Assert . assertThat ( ( ( java . lang . Integer ) ( values . take ( ) ) ) , org . hamcrest . CoreMatchers . is ( 2 ) )
testReplaceWhereScalar ( ) { for ( org . nd4j . linalg . indexing . conditions . Condition c : new org . nd4j . linalg . indexing . conditions . Condition [ ] { org . nd4j . linalg . indexing . conditions . Conditions . lessThan ( 0.5 ) , org . nd4j . linalg . indexing . conditions . Conditions . greaterThan ( 0.5 ) , org . nd4j . linalg . indexing . conditions . Conditions . equals ( 0.5 ) } ) { log . info ( ( "Testing<sp>condition:<sp>" + ( c . getClass ( ) . getSimpleName ( ) ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray inArr = org . nd4j . linalg . factory . Nd4j . rand ( DataType . DOUBLE , 3 , 4 ) ; org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . SDVariable in = sd . var ( "in" , inArr ) ; org . nd4j . autodiff . samediff . SDVariable where = sd . replaceWhere ( in , 10 , c ) ; org . nd4j . linalg . api . ndarray . INDArray exp = inArr . dup ( ) ; org . nd4j . linalg . indexing . BooleanIndexing . replaceWhere ( exp , 10 , c ) ; org . nd4j . autodiff . samediff . SDVariable loss = where . std ( true ) ; org . nd4j . autodiff . validation . TestCase tc = new org . nd4j . autodiff . validation . TestCase ( sd ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( tc ) ; "<AssertPlaceHolder>" ; } } validate ( org . nd4j . autodiff . validation . TestCase ) { return org . nd4j . autodiff . validation . OpValidation . validate ( testCase , false ) ; }
org . junit . Assert . assertNull ( err )
testSingleTokenDeletionDuringLoop2 ( ) { java . lang . String grammar = "grammar<sp>T;\n" + "a<sp>:<sp>'a'<sp>('b'|'z'{;})*<sp>'c'<sp>;" ; java . lang . String found = execParser ( "T.g4" , grammar , "TParser" , "TLexer" , "a" , "ababbc" , false ) ; java . lang . String expecting = "line<sp>1:2<sp>extraneous<sp>input<sp>\'a\'<sp>expecting<sp>{\'b\',<sp>\'z\',<sp>\'c\'}\n" ; java . lang . String result = stderrDuringParse ; "<AssertPlaceHolder>" ; } execParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { return execParser ( grammarFileName , grammarStr , parserName , lexerName , startRuleName , input , debug , false ) ; }
org . junit . Assert . assertEquals ( expecting , result )
testContainsWithMultipleValues ( ) { com . thinkaurelius . titan . core . PropertyKey name = makeKey ( "name" , java . lang . String . class ) ; mgmt . buildIndex ( "store1" , org . apache . tinkerpop . gremlin . structure . Vertex . class ) . addKey ( name ) . buildMixedIndex ( com . thinkaurelius . titan . graphdb . TitanIndexTest . INDEX ) ; mgmt . commit ( ) ; com . thinkaurelius . titan . core . TitanVertex v1 = tx . addVertex ( ) ; v1 . property ( "name" , "hercules<sp>was<sp>here" ) ; tx . commit ( ) ; java . lang . Thread . sleep ( 2000 ) ; com . thinkaurelius . titan . core . TitanVertex r = com . google . common . collect . Iterables . < com . thinkaurelius . titan . core . TitanVertex > get ( graph . query ( ) . has ( "name" , Text . CONTAINS , "hercules<sp>here" ) . vertices ( ) , 0 ) ; "<AssertPlaceHolder>" ; } value ( ) { return value ; }
org . junit . Assert . assertEquals ( r . property ( "name" ) . value ( ) , "hercules<sp>was<sp>here" )
shouldDefaultToPortSpecifiedInProfileWhenDeterminingNextFreePort ( ) { org . junit . Assume . assumeFalse ( org . openqa . selenium . testing . drivers . SauceDriver . shouldUseSauce ( ) ) ; int expectedPort = 2400 ; org . openqa . selenium . firefox . FirefoxProfile profile = new org . openqa . selenium . firefox . FirefoxProfile ( ) ; profile . setPreference ( FirefoxProfile . PORT_PREFERENCE , expectedPort ) ; connection = new org . openqa . selenium . firefox . internal . NewProfileExtensionConnection ( makeLock ( ) , new org . openqa . selenium . firefox . FirefoxBinary ( ) , profile , "my-host" ) ; try { connection . start ( ) ; org . junit . Assert . fail ( ( ( "there<sp>was<sp>an<sp>unexpected<sp>server<sp>listening<sp>on<sp>" + expectedPort ) + ";<sp>expected<sp>connection<sp>to<sp>fail" ) ) ; } catch ( org . openqa . selenium . WebDriverException e ) { int PORT_PREFERENCE_NOT_PROPAGATED = - 1 ; "<AssertPlaceHolder>" ; } } getIntegerPreference ( java . lang . String , int ) { java . lang . Object preference = additionalPrefs . getPreference ( key ) ; if ( ( preference != null ) && ( preference instanceof java . lang . Integer ) ) { return ( ( java . lang . Integer ) ( preference ) ) ; } return defaultValue ; }
org . junit . Assert . assertEquals ( expectedPort , profile . getIntegerPreference ( FirefoxProfile . PORT_PREFERENCE , PORT_PREFERENCE_NOT_PROPAGATED ) )
testWaiverAmount ( ) { org . mifos . accounts . loan . business . LoanBO loanBO = new org . mifos . accounts . loan . business . LoanBO ( ) { @ org . mifos . accounts . loan . business . Override public org . mifos . accounts . business . AccountActionDateEntity getDetailsOfNextInstallment ( ) { return loanScheduleEntity ; } } ; org . mockito . Mockito . when ( loanScheduleEntity . getInterestDue ( ) ) . thenReturn ( new org . mifos . framework . util . helpers . Money ( rupee , "42" ) ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( loanScheduleEntity , org . mockito . Mockito . times ( 1 ) ) . getInterestDue ( ) ; } waiverAmount ( ) { org . mifos . accounts . loan . business . LoanScheduleEntity nextInstallment = ( ( org . mifos . accounts . loan . business . LoanScheduleEntity ) ( getDetailsOfNextInstallment ( ) ) ) ; if ( ( nextInstallment == null ) || ( nextInstallment . isPaid ( ) ) ) { return org . mifos . framework . util . helpers . Money . zero ( getCurrency ( ) ) ; } return nextInstallment . getInterestDue ( ) ; }
org . junit . Assert . assertEquals ( loanBO . waiverAmount ( ) , new org . mifos . framework . util . helpers . Money ( rupee , "42" ) )
sortNameDesc ( ) { java . lang . String sqlite = "SELECT<sp>*<sp>FROM<sp>users<sp>ORDER<sp>BY<sp>name<sp>desc<sp>LIMIT<sp>10" ; java . lang . String api = "select<sp>*<sp>order<sp>by<sp>name<sp>desc" ; org . apache . usergrid . query . validator . QueryRequest request = new org . apache . usergrid . query . validator . QueryRequest ( ) ; request . setDbQuery ( sqlite ) ; request . getApiQuery ( ) . setQuery ( api ) ; org . apache . usergrid . query . validator . QueryResponse response = validator . execute ( request ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ( serviceName ) != null ) { sb . append ( "/" ) ; sb . append ( serviceName ) ; } for ( int i = 0 ; i < ( parameters . size ( ) ) ; i ++ ) { org . apache . usergrid . services . ServiceParameter p = parameters . get ( i ) ; if ( p instanceof org . apache . usergrid . services . ServiceParameter . QueryParameter ) { if ( i == ( ( parameters . size ( ) ) - 1 ) ) { sb . append ( '?' ) ; } else { sb . append ( ';' ) ; } boolean has_prev_param = false ; java . lang . String q = p . toString ( ) ; if ( isNotBlank ( q ) ) { try { sb . append ( "ql=" ) . append ( java . net . URLEncoder . encode ( q , "UTF-8" ) ) ; } catch ( java . io . UnsupportedEncodingException e ) { org . apache . usergrid . services . ServiceRequest . logger . error ( "Unable<sp>to<sp>encode<sp>url" , e ) ; } has_prev_param = true ; } int limit = p . getQuery ( ) . getLimit ( ) ; if ( limit != ( org . apache . usergrid . persistence . Query . DEFAULT_LIMIT ) ) { if ( has_prev_param ) { sb . append ( '&' ) ; } sb . append ( "limit=" ) . append ( limit ) ; has_prev_param = true ; } if ( ( p . getQuery ( ) . getStartResult ( ) ) != null ) { if ( has_prev_param ) { sb . append ( '&' ) ; } sb . append ( "start=" ) . append ( p . getQuery ( ) . getStartResult ( ) ) ; has_prev_param = true ; } } else { sb . append ( '/' ) ; sb . append ( p . toString ( ) ) ; } } return sb . toString ( ) ; }
org . junit . Assert . assertTrue ( response . toString ( ) , response . result ( ) )
count_upper_case_letters_guava ( ) { java . lang . String danielTigerLyrics = "Its<sp>a<sp>beautiful<sp>day<sp>in<sp>the<sp>neighborhood,<sp>a<sp>beautiful<sp>day<sp>for<sp>a<sp>neighbor." + "Would<sp>you<sp>be<sp>Mine,<sp>could<sp>you<sp>be<sp>mine,<sp>would<sp>you<sp>be<sp>my<sp>neighbor." ; long count = CharMatcher . JAVA_UPPER_CASE . retainFrom ( danielTigerLyrics ) . length ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 3 , count )
character_with_3_bytes ( ) { org . mockito . Mockito . when ( request . getHeader ( "cookie" ) ) . thenReturn ( "c=%E4%BA%AC" ) ; java . lang . String actual = cookies . get ( "c" ) ; java . lang . String expected = "" ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { if ( ( name == null ) || ( ( name . length ( ) ) == 0 ) ) { throw new java . lang . IllegalArgumentException ( com . github . jscookie . javacookie . Cookies . lStrings . getString ( "err.cookie_name_blank" ) ) ; } java . lang . String cookieHeader = request . getHeader ( "cookie" ) ; if ( cookieHeader == null ) { return null ; } java . util . Map < java . lang . String , java . lang . String > cookies = getCookies ( cookieHeader ) ; for ( java . lang . String decodedName : cookies . keySet ( ) ) { if ( ! ( name . equals ( decodedName ) ) ) { continue ; } return cookies . get ( decodedName ) ; } return null ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetInt ( ) { headers . delegate ( ) . addInt ( "header" , 1 ) ; "<AssertPlaceHolder>" ; } getInt ( java . lang . CharSequence ) { java . lang . CharSequence value = get ( name ) ; return value != null ? valueConverter . convertToInt ( value ) : null ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Integer ) ( 1 ) ) , headers . getInt ( "header" ) )
copyByteArrayValidOutputStreamNegBufSz ( ) { java . io . ByteArrayOutputStream outputStream = new org . apache . maven . shared . utils . io . IOUtilTest . DontCloseByteArrayOutputStream ( ) ; byte [ ] input = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 } ; org . apache . maven . shared . utils . io . IOUtil . copy ( input , outputStream ) ; "<AssertPlaceHolder>" ; } copy ( java . io . InputStream , java . io . OutputStream ) { org . apache . maven . shared . utils . io . IOUtil . copy ( input , output , org . apache . maven . shared . utils . io . IOUtil . DEFAULT_BUFFER_SIZE ) ; }
org . junit . Assert . assertThat ( outputStream . toByteArray ( ) , org . hamcrest . CoreMatchers . is ( input ) )
restoreRecordsWarningWhenDirectoryIsNotNormal ( ) { java . nio . file . Path symlink = ddfHome . resolve ( createSoftLink ( "symlink" , path ) ) ; when ( mockPathUtils . resolveAgainstDDFHome ( any ( java . nio . file . Path . class ) ) ) . thenReturn ( symlink ) ; entry = new org . codice . ddf . configuration . migration . ImportMigrationExternalEntryImpl ( mockContext , org . codice . ddf . configuration . migration . ImportMigrationExternalEntryImplTest . METADATA_DIR_MAP ) ; "<AssertPlaceHolder>" ; verify ( mockPathUtils ) . getChecksumFor ( any ( java . nio . file . Path . class ) ) ; verifyReportHasMatchingWarning ( report , "is<sp>not<sp>a<sp>regular<sp>directory" ) ; } restore ( org . codice . ddf . util . function . BiThrowingConsumer ) { org . apache . commons . lang . Validate . notNull ( consumer , "invalid<sp>null<sp>consumer" ) ; if ( ( restored ) == null ) { this . restored = false ; java . util . Optional < java . io . InputStream > is = java . util . Optional . empty ( ) ; try { is = getInputStream ( true ) ; final java . util . Optional < java . io . InputStream > fis = is ; this . restored = getReport ( ) . wasIOSuccessful ( ( ) -> consumer . accept ( getReport ( ) , fis ) ) ; } catch ( java . io . IOException e ) { getReport ( ) . record ( new org . codice . ddf . migration . MigrationException ( Messages . IMPORT_PATH_COPY_ERROR , path , context . getPathUtils ( ) . getDDFHome ( ) , e ) ) ; } finally { is . ifPresent ( org . apache . commons . io . IOUtils :: closeQuietly ) ; } } return restored ; }
org . junit . Assert . assertThat ( entry . restore ( true ) , org . hamcrest . CoreMatchers . equalTo ( true ) )
getCertificateCheck ( ) { org . ops4j . util . property . PropertyResolver propertyResolver = createMock ( org . ops4j . util . property . PropertyResolver . class ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.localRepository" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.settings" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.useFallbackRepositories" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.certificateCheck" ) ) . andReturn ( "true" ) ; replay ( propertyResolver ) ; org . ops4j . pax . url . mvn . internal . config . MavenConfiguration config = new org . ops4j . pax . url . mvn . internal . config . MavenConfigurationImpl ( propertyResolver , org . ops4j . pax . url . mvn . internal . config . ConfigurationImplTest . PID ) ; "<AssertPlaceHolder>" ; verify ( propertyResolver ) ; } getCertificateCheck ( ) { org . ops4j . util . property . PropertyResolver propertyResolver = createMock ( org . ops4j . util . property . PropertyResolver . class ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.localRepository" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.settings" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.useFallbackRepositories" ) ) . andReturn ( null ) ; expect ( propertyResolver . get ( "org.ops4j.pax.url.mvn.certificateCheck" ) ) . andReturn ( "true" ) ; replay ( propertyResolver ) ; org . ops4j . pax . url . mvn . internal . config . MavenConfiguration config = new org . ops4j . pax . url . mvn . internal . config . MavenConfigurationImpl ( propertyResolver , org . ops4j . pax . url . mvn . internal . config . ConfigurationImplTest . PID ) ; org . junit . Assert . assertEquals ( "Certificate<sp>check" , true , config . getCertificateCheck ( ) ) ; verify ( propertyResolver ) ; }
org . junit . Assert . assertEquals ( "Certificate<sp>check" , true , config . getCertificateCheck ( ) )
getLastOnEmpty ( ) { com . gs . collections . impl . lazy . CollectIterable < java . lang . Integer , java . lang . String > collect = new com . gs . collections . impl . lazy . CollectIterable ( com . gs . collections . impl . list . mutable . FastList . newList ( ) , String :: valueOf ) ; "<AssertPlaceHolder>" ; } getLast ( ) { org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( ( - 10 ) ) , com . gs . collections . impl . list . Interval . fromTo ( 10 , ( - 10 ) ) . by ( ( - 5 ) ) . getLast ( ) ) ; org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( ( - 10 ) ) , com . gs . collections . impl . list . Interval . fromTo ( 10 , ( - 12 ) ) . by ( ( - 5 ) ) . getLast ( ) ) ; org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 10 ) , com . gs . collections . impl . list . Interval . fromTo ( ( - 10 ) , 10 ) . by ( 5 ) . getLast ( ) ) ; org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 10 ) , com . gs . collections . impl . list . Interval . fromTo ( ( - 10 ) , 12 ) . by ( 5 ) . getLast ( ) ) ; org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 0 ) , com . gs . collections . impl . list . Interval . zero ( ) . getLast ( ) ) ; }
org . junit . Assert . assertNull ( collect . getLast ( ) )
shouldImportMovieWithTwoDirectors ( ) { importService . importMovie ( "603" ) ; org . neo4j . cineasts . domain . Movie movie = findMovieByProperty ( "id" , "603" ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } getDirectors ( ) { return directors ; }
org . junit . Assert . assertEquals ( 2 , movie . getDirectors ( ) . size ( ) )
shouldAggregateAMixOfEdgesAndEntities ( ) { final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . edge ( TestGroups . EDGE , new uk . gov . gchq . gaffer . store . schema . SchemaEdgeDefinition . Builder ( ) . aggregator ( new uk . gov . gchq . gaffer . data . element . function . ElementAggregator . Builder ( ) . select ( "turns" ) . execute ( new uk . gov . gchq . koryphe . impl . binaryoperator . Max ( ) ) . build ( ) ) . build ( ) ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . store . schema . SchemaEntityDefinition . Builder ( ) . aggregator ( new uk . gov . gchq . gaffer . data . element . function . ElementAggregator . Builder ( ) . select ( "count" ) . execute ( new uk . gov . gchq . koryphe . impl . binaryoperator . Sum ( ) ) . build ( ) ) . build ( ) ) . build ( ) ; given ( store . getSchema ( ) ) . willReturn ( schema ) ; input . add ( edge ) ; input . add ( edge1 ) ; input . add ( edge2 ) ; input . add ( entity ) ; input . add ( entity1 ) ; input . add ( entity2 ) ; input . add ( entity3 ) ; final uk . gov . gchq . gaffer . operation . util . AggregatePair edgePair = new uk . gov . gchq . gaffer . operation . util . AggregatePair ( new java . lang . String [ ] { "timestamp" } ) ; final uk . gov . gchq . gaffer . operation . util . AggregatePair entityPair = new uk . gov . gchq . gaffer . operation . util . AggregatePair ( new java . lang . String [ ] { "timestamp" } ) ; edges . put ( TestGroups . EDGE , edgePair ) ; entities . put ( TestGroups . ENTITY , entityPair ) ; final uk . gov . gchq . gaffer . data . element . Edge expectedEdge = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE ) . property ( "timestamp" , 2L ) . property ( "turns" , 6 ) . property ( "count" , 2L ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Edge expectedEdge1 = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE ) . property ( "timestamp" , 1L ) . property ( "turns" , 9 ) . property ( "count" , 5L ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Entity expectedEntity = new uk . gov . gchq . gaffer . data . element . Entity . Builder ( ) . group ( TestGroups . ENTITY ) . property ( "timestamp" , 2L ) . property ( "count" , 6 ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Entity expectedEntity1 = new uk . gov . gchq . gaffer . data . element . Entity . Builder ( ) . group ( TestGroups . ENTITY ) . property ( "timestamp" , 3L ) . property ( "count" , 5 ) . build ( ) ; expected . add ( expectedEdge ) ; expected . add ( expectedEdge1 ) ; expected . add ( expectedEntity ) ; expected . add ( expectedEntity1 ) ; final uk . gov . gchq . gaffer . operation . impl . function . Aggregate aggregate = new uk . gov . gchq . gaffer . operation . impl . function . Aggregate . Builder ( ) . input ( input ) . edges ( edges ) . entities ( entities ) . build ( ) ; final java . lang . Iterable < ? extends uk . gov . gchq . gaffer . data . element . Element > results = handler . doOperation ( aggregate , context , store ) ; final java . util . Set < uk . gov . gchq . gaffer . data . element . Element > resultsSet = com . google . common . collect . Sets . newHashSet ( results ) ; "<AssertPlaceHolder>" ; } doOperation ( uk . gov . gchq . gaffer . operation . impl . ForEach , uk . gov . gchq . gaffer . store . Context , uk . gov . gchq . gaffer . store . Store ) { if ( null == ( forEach . getOperation ( ) ) ) { throw new uk . gov . gchq . gaffer . operation . OperationException ( "Operation<sp>cannot<sp>be<sp>null" ) ; } if ( null == ( forEach . getInput ( ) ) ) { throw new uk . gov . gchq . gaffer . operation . OperationException ( "Inputs<sp>cannot<sp>be<sp>null" ) ; } final java . util . List < O > results = new java . util . ArrayList ( ) ; for ( final I input : forEach . getInput ( ) ) { final uk . gov . gchq . gaffer . operation . Operation clonedOperation = forEach . getOperation ( ) . shallowClone ( ) ; uk . gov . gchq . gaffer . store . operation . handler . util . OperationHandlerUtil . updateOperationInput ( clonedOperation , input ) ; results . add ( executeOperation ( clonedOperation , context , store ) ) ; } return
org . junit . Assert . assertEquals ( expected , resultsSet )
testConversionJul ( ) { org . joda . time . format . DateTimeFormatter fmt = org . joda . time . format . DateTimeFormat . forPattern ( org . pm4j . core . pm . joda . impl . LocalDateConverterTest . ddMMMyyyy ) . withLocale ( Locale . ENGLISH ) ; org . joda . time . LocalDate localDate = fmt . parseLocalDate ( "20-Jul-2013" ) ; "<AssertPlaceHolder>" ; } toString ( org . json . JSONArray , org . json . JSONArray ) { if ( ( names == null ) || ( ( names . length ( ) ) == 0 ) ) { return null ; } java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; for ( int i = 0 ; i < ( ja . length ( ) ) ; i += 1 ) { org . json . JSONObject jo = ja . optJSONObject ( i ) ; if ( jo != null ) { sb . append ( org . json . CDL . rowToString ( jo . toJSONArray ( names ) ) ) ; } } return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( localDate . toString ( org . pm4j . core . pm . joda . impl . LocalDateConverterTest . ddMMMyyyy , Locale . ENGLISH ) , "20-Jul-2013" )
getAtomContainerTest ( ) { org . openscience . cdk . signature . MoleculeFromSignatureBuilder builder = new org . openscience . cdk . signature . MoleculeFromSignatureBuilder ( org . openscience . cdk . silent . SilentChemObjectBuilder . getInstance ( ) ) ; builder . makeGraph ( ) ; "<AssertPlaceHolder>" ; } getAtomContainer ( ) { return container ; }
org . junit . Assert . assertNotNull ( builder . getAtomContainer ( ) )
testSetProxyURL ( ) { getContentNodeMock ( mockContent , mockDescNode , org . fcrepo . kernel . modeshape . UrlBinaryTest . EXPECTED_CONTENT ) ; when ( mockDescNode . getNode ( org . fcrepo . kernel . modeshape . JCR_CONTENT ) ) . thenReturn ( mockContent ) ; mockProxyProperty ( ) ; testObj . setProxyURL ( fileUrl ) ; verify ( mockContent ) . setProperty ( org . fcrepo . kernel . modeshape . PROXY_FOR , fileUrl ) ; "<AssertPlaceHolder>" ; } getProxyURL ( ) { try { if ( hasProperty ( org . fcrepo . kernel . modeshape . PROXY_FOR ) ) { return getProperty ( org . fcrepo . kernel . modeshape . PROXY_FOR ) . getString ( ) ; } return null ; } catch ( final javax . jcr . RepositoryException e ) { throw new org . fcrepo . kernel . api . exception . RepositoryRuntimeException ( e ) ; } }
org . junit . Assert . assertEquals ( fileUrl , testObj . getProxyURL ( ) )
insertNullBlobAndReadAsByteArray ( ) { com . github . davidmoten . rx . jdbc . Database db = db ( ) ; com . github . davidmoten . rx . jdbc . DatabaseTestBase . insertBlob ( db , null ) ; byte [ ] bytes = db . select ( "select<sp>document<sp>from<sp>person_blob" ) . getAs ( byte [ ] . class ) . first ( ) . toBlocking ( ) . single ( ) ; "<AssertPlaceHolder>" ; } getAs ( java . lang . Class ) { return get ( com . github . davidmoten . rx . jdbc . tuple . Tuples . single ( cls ) ) ; }
org . junit . Assert . assertNull ( bytes )
equalIfMimeTypeIsNullOnBoth ( ) { com . mpatric . mp3agic . ID3v2PictureFrameData frameData1 = new com . mpatric . mp3agic . ID3v2PictureFrameData ( false , null , ( ( byte ) ( 3 ) ) , new com . mpatric . mp3agic . EncodedText ( ( ( byte ) ( 0 ) ) , com . mpatric . mp3agic . ID3v2PictureFrameDataTest . TEST_DESCRIPTION ) , com . mpatric . mp3agic . ID3v2PictureFrameDataTest . DUMMY_IMAGE_DATA ) ; com . mpatric . mp3agic . ID3v2PictureFrameData frameData2 = new com . mpatric . mp3agic . ID3v2PictureFrameData ( false , null , ( ( byte ) ( 3 ) ) , new com . mpatric . mp3agic . EncodedText ( ( ( byte ) ( 0 ) ) , com . mpatric . mp3agic . ID3v2PictureFrameDataTest . TEST_DESCRIPTION ) , com . mpatric . mp3agic . ID3v2PictureFrameDataTest . DUMMY_IMAGE_DATA ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( frameData1 , frameData2 )
testGetCurrent ( ) { "<AssertPlaceHolder>" ; } getCurrent ( ) { ( result . totalCount ) ++ ; try { cs = conn . prepareCall ( source . getSPStatement ( setting ) ) ; org . apache . avro . Schema componentSchema = org . talend . components . jdbc . CommonUtils . getMainSchemaFromInputConnector ( ( ( org . talend . components . api . properties . ComponentProperties ) ( source . properties ) ) ) ; org . apache . avro . Schema outputSchema = org . talend . components . jdbc . CommonUtils . getOutputSchema ( ( ( org . talend . components . api . properties . ComponentProperties ) ( source . properties ) ) ) ; source . fillParameters ( cs , componentSchema , null , null , setting ) ; cs . execute ( ) ; if ( ( indexedRecordCreator ) == null ) { indexedRecordCreator = new org . talend . components . jdbc . avro . JDBCSPIndexedRecordCreator ( ) ; indexedRecordCreator . init ( componentSchema , outputSchema , setting ) ; } org . apache . avro . generic . IndexedRecord outputRecord = indexedRecordCreator . createOutputIndexedRecord ( cs , null ) ; return outputRecord ; } catch ( java . sql . SQLException e ) { throw org . talend . components . jdbc . CommonUtils . newComponentException ( e ) ; } }
org . junit . Assert . assertNull ( reader . getCurrent ( ) )
shouldOverrideStreamsDefaultProducerConfigs ( ) { props . put ( org . apache . kafka . streams . StreamsConfig . producerPrefix ( ProducerConfig . LINGER_MS_CONFIG ) , "10000" ) ; final org . apache . kafka . streams . StreamsConfig streamsConfig = new org . apache . kafka . streams . StreamsConfig ( props ) ; final java . util . Map < java . lang . String , java . lang . Object > producerConfigs = streamsConfig . getProducerConfigs ( "clientId" ) ; "<AssertPlaceHolder>" ; } get ( org . apache . kafka . connect . data . Field ) { java . lang . Object val = values [ field . index ( ) ] ; if ( ( val == null ) && ( ( field . schema ( ) . defaultValue ( ) ) != null ) ) { val = field . schema ( ) . defaultValue ( ) ; } return val ; }
org . junit . Assert . assertEquals ( "10000" , producerConfigs . get ( ProducerConfig . LINGER_MS_CONFIG ) )
assertGetDateColumnLabelWithCalendar ( ) { for ( java . sql . ResultSet each : resultSets . values ( ) ) { try { each . getDate ( columnName , java . util . Calendar . getInstance ( ) ) ; org . junit . Assert . fail ( "Expected<sp>an<sp>SQLException<sp>to<sp>be<sp>thrown" ) ; } catch ( final java . lang . Exception ex ) { "<AssertPlaceHolder>" ; } } } isEmpty ( ) { return tables . isEmpty ( ) ; }
org . junit . Assert . assertFalse ( ex . getMessage ( ) . isEmpty ( ) )
shouldRetrieveAllOfficesAsOfficeDtos ( ) { java . util . List < org . mifos . dto . domain . OfficeDto > allOffices = officeDao . findAllOffices ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return fieldErrors . size ( ) ; }
org . junit . Assert . assertThat ( allOffices . size ( ) , org . hamcrest . CoreMatchers . is ( 9 ) )
testRemoveSchemaSelect ( ) { java . lang . String sql = "select<sp>id<sp>as<sp>'aa'<sp>from<sp>test<sp>where<sp>name='abcdtestx.aa'<sp>and<sp>id=1<sp>and<sp>testx=123" ; java . lang . String afterAql = io . mycat . route . util . RouterUtil . removeSchema ( sql , "testx" ) ; "<AssertPlaceHolder>" ; } removeSchema ( java . lang . String , java . lang . String ) { final java . lang . String upStmt = stmt . toUpperCase ( ) ; final java . lang . String upSchema = ( schema . toUpperCase ( ) ) + "." ; int strtPos = 0 ; int indx = 0 ; boolean flag = false ; indx = upStmt . indexOf ( upSchema , strtPos ) ; if ( indx < 0 ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( "`" ) . append ( schema . toUpperCase ( ) ) . append ( "`." ) ; indx = upStmt . indexOf ( sb . toString ( ) , strtPos ) ; flag = true ; if ( indx < 0 ) { return stmt ; } } int firstE = upStmt . indexOf ( "'" ) ; int endE = upStmt . lastIndexOf ( "'" ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; while ( indx > 0 ) { sb . append ( stmt . substring ( strtPos , indx ) ) ; strtPos = indx + ( upSchema . length ( ) ) ; if ( flag ) { strtPos += 2 ; } if ( ( ( indx > firstE ) && ( indx < endE ) ) && ( ( ( io . mycat . route . util . RouterUtil . countChar ( stmt , indx ) ) % 2 ) == 1 ) ) { sb . append ( stmt . substring ( indx , ( ( indx + ( schema . length ( ) ) ) + 1 ) ) ) ; } indx = upStmt . indexOf ( upSchema , strtPos ) ; } sb . append ( stmt . substring ( strtPos ) ) ; return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( sql , afterAql )
testHasLoop_simpleLoop ( ) { org . pentaho . di . job . JobMeta jobMetaSpy = spy ( jobMeta ) ; org . pentaho . di . job . entry . JobEntryCopy jobEntryCopyMain = createJobEntryCopy ( "mainStep" ) ; org . pentaho . di . job . entry . JobEntryCopy jobEntryCopy2 = createJobEntryCopy ( "step2" ) ; org . pentaho . di . job . entry . JobEntryCopy jobEntryCopy3 = createJobEntryCopy ( "step3" ) ; when ( jobMetaSpy . findNrPrevJobEntries ( jobEntryCopyMain ) ) . thenReturn ( 1 ) ; when ( jobMetaSpy . findPrevJobEntry ( jobEntryCopyMain , 0 ) ) . thenReturn ( jobEntryCopy2 ) ; when ( jobMetaSpy . findNrPrevJobEntries ( jobEntryCopy2 ) ) . thenReturn ( 1 ) ; when ( jobMetaSpy . findPrevJobEntry ( jobEntryCopy2 , 0 ) ) . thenReturn ( jobEntryCopy3 ) ; when ( jobMetaSpy . findNrPrevJobEntries ( jobEntryCopy3 ) ) . thenReturn ( 1 ) ; when ( jobMetaSpy . findPrevJobEntry ( jobEntryCopy3 , 0 ) ) . thenReturn ( jobEntryCopyMain ) ; "<AssertPlaceHolder>" ; } hasLoop ( org . pentaho . di . trans . step . StepMeta ) { clearLoopCache ( ) ; return hasLoop ( stepMeta , null ) ; }
org . junit . Assert . assertTrue ( jobMetaSpy . hasLoop ( jobEntryCopyMain ) )
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 ( "extraAmount" , "100.00" ) ; put ( "receiverEmail" , "teste@teste.com.br" ) ; put ( "currency" , "BRL" ) ; } } ) ; br . com . uol . pagseguro . api . utils . RequestMap map = mapConverter . convert ( directPaymentRegistration ) ; "<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 )
findTest ( ) { ru . itpark . models . Human expected = ru . itpark . models . Human . builder ( ) . id ( 2 ) . age ( 19 ) . name ( "" ) . citizen ( "" ) . build ( ) ; ru . itpark . models . Human actual = testedHumansDao . find ( 2 ) ; "<AssertPlaceHolder>" ; } find ( int ) { return null ; }
org . junit . Assert . assertEquals ( expected , actual )
testValidate_getter ( ) { java . lang . Class < ? > [ ] groups = new java . lang . Class [ ] { com . github . mygreen . supercsv . validation . beanvalidation . CsvBeanValidatorTest . Group3 . class } ; com . github . mygreen . supercsv . validation . CsvBindingErrors bindingErrors = new com . github . mygreen . supercsv . validation . CsvBindingErrors ( com . github . mygreen . supercsv . validation . beanvalidation . CsvBeanValidatorTest . TestCsv . class ) ; com . github . mygreen . supercsv . builder . BeanMapping < com . github . mygreen . supercsv . validation . beanvalidation . CsvBeanValidatorTest . TestCsv > beanMapping = beanMappingFactory . create ( com . github . mygreen . supercsv . validation . beanvalidation . CsvBeanValidatorTest . TestCsv . class , groupEmpty ) ; com . github . mygreen . supercsv . validation . ValidationContext < com . github . mygreen . supercsv . validation . beanvalidation . CsvBeanValidatorTest . TestCsv > validationContext = new com . github . mygreen . supercsv . validation . ValidationContext ( ANONYMOUS_CSVCONTEXT , beanMapping ) ; com . github . mygreen . supercsv . validation . beanvalidation . CsvBeanValidatorTest . TestCsv record = new com . github . mygreen . supercsv . validation . beanvalidation . CsvBeanValidatorTest . TestCsv ( ) ; record . id = "a01" ; record . name = "test" ; record . age = 40 ; csvValidator . validate ( record , bindingErrors , ( ( com . github . mygreen . supercsv . validation . ValidationContext ) ( validationContext ) ) , groups ) ; java . util . List < java . lang . String > messages = bindingErrors . getAllErrors ( ) . stream ( ) . map ( ( error ) -> error . format ( testMessageResolver , messageInterpolator ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" . hasSize ( 1 ) . contains ( "20" ) ; } format ( com . github . mygreen . supercsv . localization . MessageResolver , com . github . mygreen . supercsv . localization . MessageInterpolator ) { for ( java . lang . String code : getCodes ( ) ) { java . util . Optional < java . lang . String > message = messageResolver . getMessage ( code ) ; if ( message . isPresent ( ) ) { return messageInterpolator . interpolate ( message . get ( ) , getVariables ( ) , true , messageResolver ) ; } } return messageInterpolator . interpolate ( getDefaultMessage ( ) , getVariables ( ) , true , messageResolver ) ; }
org . junit . Assert . assertThat ( messages )
testFullBuildBigProjectWithLinkingErrors ( ) { org . eclipse . jdt . core . IJavaProject project = workspace . createJavaProject ( "foo" ) ; workspace . addNature ( project . getProject ( ) , XtextProjectHelper . NATURE_ID ) ; org . eclipse . core . resources . IFolder folder = project . getProject ( ) . getFolder ( "src" ) ; int NUM_FILES = 200 ; org . eclipse . core . resources . IFile [ ] files = new org . eclipse . core . resources . IFile [ NUM_FILES ] ; org . eclipse . xtext . util . StopWatch timer = new org . eclipse . xtext . util . StopWatch ( ) ; for ( int i = 0 ; i < NUM_FILES ; i ++ ) { org . eclipse . core . resources . IFile file = folder . getFile ( ( ( ( "Test_" + i ) + "_" ) + ( org . eclipse . xtext . builder . impl . ProfilerAbstractBuilderTest . F_EXT ) ) ) ; files [ i ] = file ; java . lang . String contents = ( ( "object<sp>Foo" + i ) + "<sp>references<sp>Foo" ) + ( i * 1000 ) ; if ( i == NUM_FILES ) contents = "object<sp>Foo" + i ; file . create ( new org . eclipse . xtext . util . StringInputStream ( contents ) , true , workspace . monitor ( ) ) ; } logAndReset ( "Creating<sp>files" , timer ) ; workspace . build ( ) ; logAndReset ( "Auto<sp>build" , timer ) ; org . eclipse . core . resources . IMarker [ ] iMarkers = folder . findMarkers ( EValidator . MARKER , true , org . eclipse . core . resources . IResource . DEPTH_INFINITE ) ; "<AssertPlaceHolder>" ; } logAndReset ( java . lang . String , org . eclipse . xtext . util . StopWatch ) { timer . resetAndLog ( string ) ; }
org . junit . Assert . assertEquals ( ( NUM_FILES - 1 ) , iMarkers . length )
runTestReflection5 ( ) { soot . jimple . infoflow . results . InfoflowResults res = analyzeAPKFile ( "Reflection/Reflection5.apk" , null , enableReflectionCallback ) ; "<AssertPlaceHolder>" ; } size ( ) { return set . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , res . size ( ) )
testIPv4AddressMatchesIPv4Address ( ) { com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidator allowedIPAddressesValidator = com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidatorFactory . create ( com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidatorTest . _ADDRESS_IP_V4 ) ; "<AssertPlaceHolder>" ; } isAllowedIPAddress ( java . lang . String ) { java . net . InetAddress inetAddress = null ; try { inetAddress = com . liferay . portal . kernel . util . InetAddressUtil . getInetAddressByName ( ipAddress ) ; } catch ( java . net . UnknownHostException uhe ) { return false ; } byte [ ] inetAddressBytes = inetAddress . getAddress ( ) ; if ( ! ( isSameProtocol ( inetAddressBytes ) ) ) { return false ; } if ( ( _netmask ) == null ) { return _allowedIpAddress . equals ( inetAddress ) ; } for ( int i = 0 ; i < ( _netmask . length ) ; i ++ ) { if ( ( ( inetAddressBytes [ i ] ) & ( _netmask [ i ] ) ) != ( ( _allowedIpAddressBytes [ i ] ) & ( _netmask [ i ] ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertTrue ( allowedIPAddressesValidator . isAllowedIPAddress ( com . liferay . portal . kernel . internal . security . access . control . AllowedIPAddressesValidatorTest . _ADDRESS_IP_V4 ) )
testNumKSubsetUpTo62 ( ) { for ( int i = 1 ; i < 62 ; i ++ ) { final tlc2 . value . impl . SubsetValue subset = new tlc2 . value . impl . SubsetValue ( new tlc2 . value . impl . IntervalValue ( 1 , i ) ) ; long sum = 0L ; for ( int j = 0 ; j <= i ; j ++ ) { sum += subset . numberOfKElements ( j ) ; } "<AssertPlaceHolder>" ; } } numberOfKElements ( int ) { final int size = this . set . size ( ) ; if ( ( ( k < 0 ) || ( size < k ) ) || ( size > 62 ) ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "k=%s<sp>and<sp>n=%s" , k , size ) ) ; } if ( ( k == 0 ) || ( k == size ) ) { return 1 ; } return tlc2 . util . Combinatorics . choose ( size , k ) ; }
org . junit . Assert . assertEquals ( ( 1L << i ) , sum )
testIfDifferenceCalculationWorks_shouldReturnTheCorrectAmountOfChanges ( ) { org . openengsb . core . ekb . persistence . persist . edb . models . EngineeringObjectModel old = new org . openengsb . core . ekb . persistence . persist . edb . models . EngineeringObjectModel ( ) ; old . setInternalModelName ( "testModel" ) ; old . setNameA ( "nameA-old" ) ; old . setNameB ( "nameB-old" ) ; old . setModelAId ( "testreference1" ) ; old . setModelBId ( "testreference2" ) ; old . setTest ( "this<sp>is<sp>a<sp>teststring" ) ; org . openengsb . core . ekb . persistence . persist . edb . models . EngineeringObjectModel updated = new org . openengsb . core . ekb . persistence . persist . edb . models . EngineeringObjectModel ( ) ; updated . setInternalModelName ( "testModel" ) ; updated . setNameA ( "nameA-new" ) ; updated . setNameB ( "nameB-new" ) ; updated . setModelAId ( "testreference1_1" ) ; updated . setModelBId ( "testreference2_1" ) ; org . openengsb . core . ekb . persistence . persist . edb . internal . ModelDiff diff = org . openengsb . core . ekb . persistence . persist . edb . internal . ModelDiff . createModelDiff ( ( ( org . openengsb . core . api . model . OpenEngSBModel ) ( old ) ) , ( ( org . openengsb . core . api . model . OpenEngSBModel ) ( updated ) ) ) ; "<AssertPlaceHolder>" ; } getDifferences ( ) { return differences ; }
org . junit . Assert . assertThat ( diff . getDifferences ( ) . size ( ) , org . hamcrest . CoreMatchers . is ( 5 ) )
testRemoveJobException ( ) { org . pentaho . platform . api . scheduler2 . Job job = mock ( org . pentaho . platform . api . scheduler2 . Job . class ) ; doReturn ( job ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService ) . getJob ( anyString ( ) ) ; doReturn ( true ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService ) . isScheduleAllowed ( ) ; doThrow ( new org . pentaho . platform . api . scheduler2 . SchedulerException ( "pause-exception" ) ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService . scheduler ) . removeJob ( anyString ( ) ) ; try { org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService . removeJob ( "job-id" ) ; } catch ( org . pentaho . platform . api . scheduler2 . SchedulerException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( "pause-exception" , e . getMessage ( ) )
testCase27 ( ) { org . evosuite . testcase . DefaultTestCase tc = buildTestCase27 ( ) ; java . util . List < org . evosuite . symbolic . BranchCondition > branch_conditions = executeTest ( tc ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; }
org . junit . Assert . assertEquals ( 8 , branch_conditions . size ( ) )
testSortAlreadySortedPreferred ( ) { java . util . List < java . net . InetSocketAddress > expected = java . util . Arrays . asList ( io . netty . resolver . dns . NameServerComparatorTest . IPV4ADDRESS1 , io . netty . resolver . dns . NameServerComparatorTest . IPV4ADDRESS2 , io . netty . resolver . dns . NameServerComparatorTest . IPV4ADDRESS3 ) ; java . util . List < java . net . InetSocketAddress > addresses = new java . util . ArrayList < java . net . InetSocketAddress > ( expected ) ; io . netty . resolver . dns . NameServerComparator comparator = new io . netty . resolver . dns . NameServerComparator ( java . net . Inet4Address . class ) ; java . util . Collections . sort ( addresses , comparator ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expected , addresses )
testIsListNotEmpty ( ) { java . util . List < java . lang . String > list = new java . util . ArrayList < java . lang . String > ( ) ; list . add ( "a" ) ; list . add ( "b" ) ; boolean listValue = stringUtil . isEmpty ( list ) ; "<AssertPlaceHolder>" ; } isEmpty ( java . util . Collection ) { return ( set == null ) || ( set . isEmpty ( ) ) ; }
org . junit . Assert . assertFalse ( listValue )
testDistributeWithTwoProfiles ( ) { long timestamp = 100 ; java . lang . String entity = ( ( java . lang . String ) ( messageOne . get ( "ip_src_addr" ) ) ) ; org . apache . metron . profiler . MessageRoute routeOne = new org . apache . metron . profiler . MessageRoute ( createDefinition ( profileOne ) , entity , messageOne , timestamp ) ; distributor . distribute ( routeOne , context ) ; org . apache . metron . profiler . MessageRoute routeTwo = new org . apache . metron . profiler . MessageRoute ( createDefinition ( profileTwo ) , entity , messageOne , timestamp ) ; distributor . distribute ( routeTwo , context ) ; java . util . List < org . apache . metron . profiler . ProfileMeasurement > measurements = distributor . flush ( ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( java . util . Map m : variableMappings ) { size += m . size ( ) ; } return size ; }
org . junit . Assert . assertEquals ( 2 , measurements . size ( ) )
testIsDebugEnabled ( ) { when ( mockLogger . isDebugEnabled ( ) ) . thenReturn ( true ) ; io . netty . util . internal . logging . InternalLogger logger = io . netty . util . internal . logging . InternalLoggerFactory . getInstance ( "mock" ) ; "<AssertPlaceHolder>" ; verify ( mockLogger ) . isDebugEnabled ( ) ; } isDebugEnabled ( ) { return logger . isDebugEnabled ( ) ; }
org . junit . Assert . assertTrue ( logger . isDebugEnabled ( ) )
testGetAccessTokenString ( ) { org . uberfire . ext . security . management . keycloak . client . auth . credentials . AccessTokenResponse response = mock ( org . uberfire . ext . security . management . keycloak . client . auth . credentials . AccessTokenResponse . class ) ; when ( response . getToken ( ) ) . thenReturn ( "token2" ) ; this . tokenManager . accessTokenResponse = response ; this . tokenManager . expirationTime = Long . MAX_VALUE ; this . tokenManager . minTokenValidity = 0 ; java . lang . String s = this . tokenManager . getAccessTokenString ( ) ; "<AssertPlaceHolder>" ; } getAccessTokenString ( ) { if ( null == ( this . accessTokenResponse ) ) { grantToken ( ) ; } else if ( tokenExpired ( ) ) { refreshToken ( ) ; } return ( accessTokenResponse ) != null ? accessTokenResponse . getToken ( ) : null ; }
org . junit . Assert . assertEquals ( "token2" , s )
testAnalyzeSelectStatement_OK_ColumnReferenceAndTableAlias ( ) { final java . lang . String sql = "SELECT<sp>`ID`,<sp>`NAME`<sp>FROM<sp>STUDENT<sp>STU" ; final org . codefamily . crabs . jdbc . lang . Statement actual = org . codefamily . crabs . jdbc . compiler . GrammarAnalyzer . analyze ( sql ) ; final org . codefamily . crabs . jdbc . lang . Statement expected = new org . codefamily . crabs . jdbc . lang . extension . statement . SelectStatement ( new org . codefamily . crabs . jdbc . compiler . SelectClause ( false , null , new org . codefamily . crabs . jdbc . compiler . SelectClause . ResultColumnDeclare ( ( ( java . lang . String ) ( null ) ) , new org . codefamily . crabs . jdbc . lang . expression . Reference ( null , "ID" ) ) , new org . codefamily . crabs . jdbc . compiler . SelectClause . ResultColumnDeclare ( ( ( java . lang . String ) ( null ) ) , new org . codefamily . crabs . jdbc . lang . expression . Reference ( null , "NAME" ) ) ) , new org . codefamily . crabs . jdbc . compiler . FromClause ( new org . codefamily . crabs . jdbc . compiler . FromClause . SimpleTableDeclare ( "STU" , "STUDENT" ) ) , null , null , null , null , null ) ; "<AssertPlaceHolder>" ; } analyze ( java . lang . String ) { if ( sql == null ) { throw new java . lang . IllegalArgumentException ( "Argument[sql]<sp>is<sp>null." ) ; } final org . codefamily . crabs . jdbc . compiler . GrammarAnalyzer . GrammarAnalyzeContext context = new org . codefamily . crabs . jdbc . compiler . GrammarAnalyzer . GrammarAnalyzeContext ( sql ) ; context . toNextToken ( ) ; final org . codefamily . crabs . jdbc . lang . Statement statement = org . codefamily . crabs . jdbc . compiler . GrammarAnalyzer . StatementGrammarAnalyzer . analyze ( context ) ; context . toNextToken ( ) ; if ( ( ( context . currentTokenType ( ) ) == ( org . codefamily . crabs . jdbc . compiler . GrammarAnalyzer . TokenType . SYMBOL ) ) && ( ( context . currentTokenToSymbol ( ) ) == ';' ) ) { context . toNextToken ( ) ; } if ( ( context . currentTokenType ( ) ) == ( org . codefamily . crabs . jdbc . compiler . GrammarAnalyzer . TokenType . EOF ) ) { return statement ; } throw org . codefamily . crabs . jdbc . compiler . GrammarAnalyzer . newSQLException ( context , "Unexpected<sp>sql<sp>end." , context . currentTokenStartPosition ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testAlreadyExistingEndPointsDoNotFireEvents ( ) { addNode ( "path" , com . bazaarvoice . ostrich . discovery . zookeeper . ZooKeeperHostDiscoveryTest . FOO ) ; com . bazaarvoice . ostrich . discovery . zookeeper . ZooKeeperHostDiscoveryTest . CountingListener endPointListener = new com . bazaarvoice . ostrich . discovery . zookeeper . ZooKeeperHostDiscoveryTest . CountingListener ( ) ; _discovery . addListener ( endPointListener ) ; "<AssertPlaceHolder>" ; } getNumEvents ( ) { return ( _numAdds ) + ( _numRemoves ) ; }
org . junit . Assert . assertEquals ( 0 , endPointListener . getNumEvents ( ) )
testInsert_ListFields ( ) { com . jmethods . catatumbo . entities . ListFields entity = com . jmethods . catatumbo . entities . ListFields . getSampleEntity1 ( ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; com . jmethods . catatumbo . entities . ListFields entity2 = com . jmethods . catatumbo . EntityManagerTest . em . load ( com . jmethods . catatumbo . entities . ListFields . class , entity . getId ( ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ! ( obj instanceof com . jmethods . catatumbo . GeoLocation ) ) { return false ; } com . jmethods . catatumbo . GeoLocation that = ( ( com . jmethods . catatumbo . GeoLocation ) ( obj ) ) ; return ( ( this . latitude ) == ( that . latitude ) ) && ( ( this . longitude ) == ( that . longitude ) ) ; }
org . junit . Assert . assertTrue ( entity . equals ( entity2 ) )
testIsRegionUsingDiskStoreWhenOverflowing ( ) { final java . lang . String diskStoreName = "testDiskStore" ; final com . gemstone . gemfire . cache . Region mockRegion = mockContext . mock ( com . gemstone . gemfire . cache . Region . class , "Region" ) ; final com . gemstone . gemfire . cache . RegionAttributes mockRegionAttributes = mockContext . mock ( com . gemstone . gemfire . cache . RegionAttributes . class , "RegionAttributes" ) ; final com . gemstone . gemfire . cache . EvictionAttributes mockEvictionAttributes = mockContext . mock ( com . gemstone . gemfire . cache . EvictionAttributes . class , "EvictionAttributes" ) ; final com . gemstone . gemfire . cache . DiskStore mockDiskStore = mockContext . mock ( com . gemstone . gemfire . cache . DiskStore . class , "DiskStore" ) ; mockContext . checking ( new org . jmock . Expectations ( ) { { exactly ( 4 ) . of ( mockRegion ) . getAttributes ( ) ; will ( returnValue ( mockRegionAttributes ) ) ; oneOf ( mockRegionAttributes ) . getDataPolicy ( ) ; will ( returnValue ( DataPolicy . PARTITION ) ) ; oneOf ( mockRegionAttributes ) . getDiskStoreName ( ) ; will ( returnValue ( diskStoreName ) ) ; exactly ( 2 ) . of ( mockRegionAttributes ) . getEvictionAttributes ( ) ; will ( returnValue ( mockEvictionAttributes ) ) ; oneOf ( mockEvictionAttributes ) . getAction ( ) ; will ( returnValue ( EvictionAction . OVERFLOW_TO_DISK ) ) ; oneOf ( mockDiskStore ) . getName ( ) ; will ( returnValue ( diskStoreName ) ) ; } } ) ; final com . gemstone . gemfire . management . internal . cli . functions . DescribeDiskStoreFunction function = createDescribeDiskStoreFunction ( null ) ; "<AssertPlaceHolder>" ; } isUsingDiskStore ( com . gemstone . gemfire . cache . Region , com . gemstone . gemfire . cache . DiskStore ) { return ( ( isPersistent ( region ) ) || ( isOverflowToDisk ( region ) ) ) && ( com . gemstone . gemfire . internal . lang . ObjectUtils . equals ( getDiskStoreName ( region ) , diskStore . getName ( ) ) ) ; }
org . junit . Assert . assertTrue ( function . isUsingDiskStore ( mockRegion , mockDiskStore ) )
testGetBandDataType_mixed_integerTypes ( ) { product . addBand ( "one" , ProductData . TYPE_UINT8 ) ; product . addBand ( "two" , ProductData . TYPE_INT32 ) ; product . addBand ( "double" , ProductData . TYPE_INT16 ) ; product . addBand ( "three" , ProductData . TYPE_INT16 ) ; product . addBand ( "four" , ProductData . TYPE_UINT16 ) ; final org . esa . beam . dataio . bigtiff . internal . TiffIFD tiffIFD = new org . esa . beam . dataio . bigtiff . internal . TiffIFD ( product ) ; "<AssertPlaceHolder>" ; } getBandDataType ( ) { return maxElemSizeBandDataType ; }
org . junit . Assert . assertEquals ( ProductData . TYPE_INT32 , tiffIFD . getBandDataType ( ) )
testVeryObese ( ) { java . lang . String string0 = com . examples . with . different . packagename . BMICalculator . calculateBMICategory ( ( - 1.0 ) , 2138.41 ) ; "<AssertPlaceHolder>" ; } calculateBMICategory ( double , double ) { double bmi = weight / ( height * height ) ; if ( bmi < 18.5 ) { return "underweight" ; } else if ( bmi < 25 ) { return "healthy" ; } else if ( bmi < 30 ) { return "overweight" ; } else if ( bmi < 40 ) { return "obese" ; } else { return "very<sp>obese" ; } }
org . junit . Assert . assertEquals ( "very<sp>obese" , string0 )