input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
whenValidationWithInvalidConstructorParameters_thenCorrectNumberOfVoilations ( ) { java . lang . reflect . Constructor < org . baeldung . javaxval . methodvalidation . model . Customer > constructor = org . baeldung . javaxval . methodvalidation . model . Customer . class . getConstructor ( java . lang . String . class , java . lang . String . class ) ; java . lang . Object [ ] parameterValues = new java . lang . Object [ ] { "John" , "Doe" } ; java . util . Set < javax . validation . ConstraintViolation < org . baeldung . javaxval . methodvalidation . model . Customer > > violations = executableValidator . validateConstructorParameters ( constructor , parameterValues ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , violations . size ( ) ) |
testProjectionMethodsAreCalledIfParametersAreAssignableToSuperclassOrInterface ( ) { final akka . testkit . TestActorRef < no . ks . eventstore2 . formProcessorProject . FormStatuses > ref = akka . testkit . TestActorRef . create ( no . ks . eventstore2 . projection . ProjectionCallTest . _system , akka . actor . Props . create ( no . ks . eventstore2 . formProcessorProject . FormStatuses . class , super . testActor ( ) ) , "lastFormStatus2" ) ; ref . tell ( new no . ks . eventstore2 . formProcessorProject . FormReceived ( "2" ) , super . testActor ( ) ) ; ref . tell ( new no . ks . eventstore2 . formProcessorProject . FormReceived ( "3" ) , super . testActor ( ) ) ; ref . tell ( new no . ks . eventstore2 . formProcessorProject . FormParsed ( "2" ) , super . testActor ( ) ) ; ref . tell ( new no . ks . eventstore2 . eventstore . CompleteSubscriptionRegistered ( "agg" ) , super . testActor ( ) ) ; java . util . List < java . lang . String > ids = new java . util . ArrayList < java . lang . String > ( ) ; ids . add ( "2" ) ; ids . add ( "3" ) ; scala . concurrent . Future < java . lang . Object > formStatus = akka . pattern . Patterns . ask ( ref , no . ks . eventstore2 . projection . CallProjection . call ( "getStatuses" , ids ) , 3000 ) ; java . util . Map < java . lang . String , no . ks . eventstore2 . formProcessorProject . FormStatus > result = ( ( java . util . Map < java . lang . String , no . ks . eventstore2 . formProcessorProject . FormStatus > ) ( scala . concurrent . Await . result ( formStatus , akka . testkit . JavaTestKit . duration ( "3<sp>seconds" ) ) ) ) ; "<AssertPlaceHolder>" ; } call ( java . lang . String , java . lang . Object [ ] ) { return new no . ks . eventstore2 . projection . Call ( method , args ) ; } | org . junit . Assert . assertEquals ( 2 , result . size ( ) ) |
testStaticImport ( ) { java . util . Set < net . sourceforge . pmd . lang . java . ast . ASTImportDeclaration > ops = net . sourceforge . pmd . lang . java . ParserTstUtil . getNodes ( net . sourceforge . pmd . lang . java . ast . ASTImportDeclaration . class , net . sourceforge . pmd . lang . java . ast . ASTImportDeclarationTest . TEST3 ) ; net . sourceforge . pmd . lang . java . ast . ASTImportDeclaration i = ops . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } isStatic ( ) { return isStatic ; } | org . junit . Assert . assertTrue ( i . isStatic ( ) ) |
testTrashVersionBaseModelIsNotVisible ( ) { org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsAssetableBaseModel ) ) ; org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsUpdatableBaseModel ) ) ; com . liferay . trash . test . util . WhenIsUpdatableBaseModel whenIsUpdatableBaseModel = ( ( com . liferay . trash . test . util . WhenIsUpdatableBaseModel ) ( this ) ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( group . getGroupId ( ) ) ; com . liferay . portal . kernel . model . BaseModel < ? > parentBaseModel = getParentBaseModel ( group , serviceContext ) ; baseModel = addBaseModel ( parentBaseModel , serviceContext ) ; baseModel = whenIsUpdatableBaseModel . updateBaseModel ( ( ( java . lang . Long ) ( baseModel . getPrimaryKeyObj ( ) ) ) , serviceContext ) ; com . liferay . trash . test . util . WhenIsAssetableBaseModel whenIsAssetableModel = ( ( com . liferay . trash . test . util . WhenIsAssetableBaseModel ) ( this ) ) ; moveBaseModelToTrash ( ( ( java . lang . Long ) ( baseModel . getPrimaryKeyObj ( ) ) ) ) ; "<AssertPlaceHolder>" ; } isAssetEntryVisible ( com . liferay . portal . kernel . model . ClassedModel , long ) { com . liferay . message . boards . model . MBMessage rootMessage = com . liferay . message . boards . service . MBMessageLocalServiceUtil . getMBMessage ( ( ( com . liferay . message . boards . model . MBThread ) ( classedModel ) ) . getRootMessageId ( ) ) ; return _whenIsAssetable . isAssetEntryVisible ( rootMessage , getAssetClassPK ( rootMessage ) ) ; } | org . junit . Assert . assertFalse ( whenIsAssetableModel . isAssetEntryVisible ( baseModel , getAssetClassPK ( baseModel ) ) ) |
defaultTest3 ( ) { com . zaxxer . hikari . HikariDataSource dataSource = new com . zaxxer . hikari . HikariDataSource ( ) ; dataSource . setDataSourceClassName ( com . navercorp . pinpoint . plugin . jdk7 . hikaricp . HikariCpIT . DATA_SOURCE_CLASS_NAME ) ; dataSource . addDataSourceProperty ( "url" , com . navercorp . pinpoint . plugin . jdk7 . hikaricp . HikariCpIT . JDBC_URL ) ; try { java . sql . Connection connection = dataSource . getConnection ( "" , "" ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( 500 ) ; connection . close ( ) ; java . lang . Thread . sleep ( 500 ) ; com . navercorp . pinpoint . bootstrap . plugin . test . PluginTestVerifier verifier = com . navercorp . pinpoint . bootstrap . plugin . test . PluginTestVerifierHolder . getInstance ( ) ; verifier . printCache ( ) ; verifier . verifyTrace ( event ( com . navercorp . pinpoint . plugin . jdk7 . hikaricp . HikariCpIT . serviceType , "com.zaxxer.hikari.HikariDataSource.HikariDataSource()" ) ) ; verifier . verifyTrace ( event ( com . navercorp . pinpoint . plugin . jdk7 . hikaricp . HikariCpIT . serviceType , com . navercorp . pinpoint . plugin . jdk7 . hikaricp . HikariCpIT . getConnectionMethod2 , annotation ( AnnotationKey . ARGS0 . getName ( ) , "" ) ) ) ; verifier . verifyTrace ( event ( com . navercorp . pinpoint . plugin . jdk7 . hikaricp . HikariCpIT . serviceType , com . navercorp . pinpoint . plugin . jdk7 . hikaricp . HikariCpIT . proxyConnectionMethod ) ) ; } finally { if ( dataSource != null ) { dataSource . close ( ) ; } } } getConnection ( java . lang . String , java . lang . String ) { return this . testBrokerMap . get ( brokerName ) . getConnection ( connectUri ) ; } | org . junit . Assert . assertNotNull ( connection ) |
testRecognize ( ) { java . lang . String value = "-------------------------------------------------------\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( "T<sp>E<sp>S<sp>T<sp>S\n" + "-------------------------------------------------------\n" ) + "Running<sp>hello.HelloWorldTest\n" ) + "-------------------------------------------------------\n" 0 ) + "Tests<sp>run:<sp>4,<sp>Failures:<sp>2,<sp>Errors:<sp>0,<sp>Skipped:<sp>1,<sp>Time<sp>elapsed:<sp>0.043<sp>sec<sp><<<<sp>FAILURE!\n" ) + "\n" ) + "Results<sp>:\n" ) + "\n" ) + "Failed<sp>tests:<sp>\n" ) + "<sp>testTwo(hello.HelloWorldTest)\n" ) + "-------------------------------------------------------\n" 2 ) + "\n" ) + "-------------------------------------------------------\n" 3 ) + "-------------------------------------------------------\n" 5 ) ; java . util . LinkedList < com . hp . alm . ali . idea . navigation . Candidate > list = new java . util . LinkedList < com . hp . alm . ali . idea . navigation . Candidate > ( ) ; recognizer . recognize ( value , list ) ; "<AssertPlaceHolder>" ; checkClassCandidate ( list . get ( 0 ) , "-------------------------------------------------------\n" 1 , "HelloWorldTest" , 0 , "-------------------------------------------------------\n" 4 , 278 , 309 , 280 , 287 ) ; checkClassCandidate ( list . get ( 1 ) , "-------------------------------------------------------\n" 1 , "HelloWorldTest" , 0 , "testThree" , 310 , 343 , 312 , 321 ) ; } recognize ( java . lang . String , java . util . List ) { } | org . junit . Assert . assertEquals ( 2 , list . size ( ) ) |
testCreate_attrMin_wrong ( ) { com . github . mygreen . supercsv . builder . FieldAccessor field = getFieldAccessor ( com . github . mygreen . supercsv . cellprocessor . constraint . NumberRangeFactoryTest . ErrorCsv . class , "col_min_wrong" , comparator ) ; com . github . mygreen . supercsv . builder . standard . IntegerProcessorBuilder builder = ( ( com . github . mygreen . supercsv . builder . standard . IntegerProcessorBuilder ) ( builderResolver . resolve ( com . github . mygreen . supercsv . cellprocessor . constraint . Integer . class ) ) ) ; com . github . mygreen . supercsv . cellprocessor . format . TextFormatter < java . lang . Integer > formatter = builder . getFormatter ( field , config ) ; com . github . mygreen . supercsv . annotation . constraint . CsvNumberRange anno = field . getAnnotationsByGroup ( com . github . mygreen . supercsv . annotation . constraint . CsvNumberRange . class , groupEmpty ) . get ( 0 ) ; try { factory . create ( anno , java . util . Optional . empty ( ) , field , formatter , config ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" . isInstanceOf ( com . github . mygreen . supercsv . exception . SuperCsvInvalidAnnotationException . class ) . hasMessage ( "'%s'<sp><sp>@CsvNumberRange<sp><sp>'min'<sp>aaaajava.lang.Integer<sp>(#,###)" , field . getNameWithClass ( ) ) ; } } create ( com . github . mygreen . supercsv . annotation . constraint . CsvNumberMax , java . util . Optional , com . github . mygreen . supercsv . builder . FieldAccessor , com . github . mygreen . supercsv . cellprocessor . format . TextFormatter , com . github . mygreen . supercsv . builder . Configuration ) { @ com . github . mygreen . supercsv . cellprocessor . constraint . SuppressWarnings ( "unchecked" ) final com . github . mygreen . supercsv . cellprocessor . format . TextFormatter < N > typeFormatter = ( ( com . github . mygreen . supercsv . cellprocessor . format . TextFormatter < N > ) ( formatter ) ) ; final N max ; try { max = typeFormatter . parse ( anno . value ( ) ) ; } catch ( com . github . mygreen . supercsv . cellprocessor . format . TextParseException e ) { throw new com . github . mygreen . supercsv . exception . SuperCsvInvalidAnnotationException ( anno , com . github . mygreen . supercsv . localization . MessageBuilder . create ( "anno.attr.invalidType" ) . var ( "property" , field . getNameWithClass ( ) ) . varWithAnno ( "anno" , anno . annotationType ( ) ) . var ( "attrName" , "value" ) . var ( "attrValue" , anno . value ( ) ) . varWithClass ( "type" , field . getType ( ) ) . var ( "pattern" , typeFormatter . getPattern ( ) . orElseGet ( null ) ) . format ( true ) , e ) ; } final com . github . mygreen . supercsv . cellprocessor . constraint . NumberMax < N > processor = next . map ( ( n ) -> new NumberMax < com . github . mygreen . supercsv . cellprocessor . constraint . N > ( max , anno . inclusive ( ) , typeFormatter , n ) ) . orElseGet ( ( ) -> new NumberMax < com . github . mygreen . supercsv . cellprocessor . constraint . N > ( max , anno . inclusive ( ) , typeFormatter ) ) ; processor . setValidationMessage ( anno . message ( ) ) ; return java . util . Optional . of ( processor ) ; } | org . junit . Assert . assertThat ( e ) |
createEmptyComplexListTest ( ) { com . betfair . cougar . tests . clienttests . CougarClientResponseTypeUtils utils = new com . betfair . cougar . tests . clienttests . CougarClientResponseTypeUtils ( ) ; java . util . List < com . betfair . baseline . v2 . to . ComplexObject > returnedList = utils . createEmptyComplexList ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return underlyingMap . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( returnedList . isEmpty ( ) ) |
shouldStartServerOnRandomPortWhenDefaultPortIsBusy ( ) { com . xebialabs . restito . server . StubServer server1 = new com . xebialabs . restito . server . StubServer ( ) . run ( ) ; com . xebialabs . restito . server . StubServer server2 = new com . xebialabs . restito . server . StubServer ( ) . run ( ) ; "<AssertPlaceHolder>" ; } getPort ( ) { return simpleServer . getListeners ( ) . iterator ( ) . next ( ) . getPort ( ) ; } | org . junit . Assert . assertTrue ( ( ( server2 . getPort ( ) ) != ( server1 . getPort ( ) ) ) ) |
host2 ( ) { org . jboss . hal . meta . AddressTemplate input = org . jboss . hal . meta . AddressTemplate . of ( "/host=master/subsystem=jmx" ) ; org . jboss . hal . meta . AddressTemplate expected = org . jboss . hal . meta . AddressTemplate . of ( "/host=*/subsystem=jmx" ) ; org . jboss . hal . meta . AddressTemplate result = processor . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( org . jboss . hal . meta . AddressTemplate ) { org . jboss . hal . meta . AddressTemplate modified = org . jboss . hal . meta . AddressTemplate . ROOT ; if ( ( template != null ) && ( ! ( AddressTemplate . ROOT . equals ( template ) ) ) ) { java . util . List < java . lang . String [ ] > segments = stream ( template . spliterator ( ) , false ) . map ( ( segment ) -> { if ( segment . contains ( "=" ) ) { return com . google . common . base . Splitter . on ( '=' ) . omitEmptyStrings ( ) . trimResults ( ) . limit ( 2 ) . splitToList ( segment ) . toArray ( new java . lang . String [ 2 ] ) ; } return new java . lang . String [ ] { segment , null } ; } ) . collect ( toList ( ) ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; org . jboss . hal . meta . description . SegmentProcessor . process ( segments , ( segment ) -> { builder . append ( "/" ) . append ( segment [ 0 ] ) ; if ( ( segment [ 1 ] ) != null ) { builder . append ( "=" ) . append ( segment [ 1 ] ) ; } } ) ; modified = org . jboss . hal . meta . AddressTemplate . of ( builder . toString ( ) ) ; } org . jboss . hal . meta . description . ResourceDescriptionTemplateProcessor . logger . debug ( "{}<sp>-><sp>{}" , template , modified ) ; return modified ; } | org . junit . Assert . assertEquals ( expected , result ) |
test45getUserRolesByName ( ) { destroySession ( ) ; setup ( ) ; org . apache . ranger . db . XXPortalUserRoleDao xPortalUserRoleDao = org . mockito . Mockito . mock ( org . apache . ranger . db . XXPortalUserRoleDao . class ) ; org . apache . ranger . view . VXPortalUser userProfile = userProfile ( ) ; java . util . Collection < java . lang . String > userRoleList = new java . util . ArrayList < java . lang . String > ( ) ; userRoleList . add ( "ROLE_USER" ) ; userProfile . setUserRoleList ( userRoleList ) ; java . util . List < org . apache . ranger . view . VXString > vStringRolesList = new java . util . ArrayList < org . apache . ranger . view . VXString > ( ) ; org . apache . ranger . view . VXString vXStringObj = new org . apache . ranger . view . VXString ( ) ; vXStringObj . setValue ( "ROLE_USER" ) ; vStringRolesList . add ( vXStringObj ) ; java . util . List < org . apache . ranger . entity . XXPortalUserRole > xPortalUserRoleList = new java . util . ArrayList < org . apache . ranger . entity . XXPortalUserRole > ( ) ; org . apache . ranger . entity . XXPortalUserRole XXPortalUserRole = new org . apache . ranger . entity . XXPortalUserRole ( ) ; XXPortalUserRole . setId ( org . apache . ranger . biz . TestXUserMgr . userId ) ; XXPortalUserRole . setUserId ( org . apache . ranger . biz . TestXUserMgr . userId ) ; XXPortalUserRole . setUserRole ( "ROLE_USER" ) ; xPortalUserRoleList . add ( XXPortalUserRole ) ; java . util . List < org . apache . ranger . entity . XXUserPermission > xUserPermissionsList = new java . util . ArrayList < org . apache . ranger . entity . XXUserPermission > ( ) ; org . apache . ranger . entity . XXUserPermission xUserPermissionObj = xxUserPermission ( ) ; xUserPermissionsList . add ( xUserPermissionObj ) ; java . util . List < org . apache . ranger . entity . XXGroupPermission > xGroupPermissionList = new java . util . ArrayList < org . apache . ranger . entity . XXGroupPermission > ( ) ; org . apache . ranger . entity . XXGroupPermission xGroupPermissionObj = xxGroupPermission ( ) ; xGroupPermissionList . add ( xGroupPermissionObj ) ; java . util . List < org . apache . ranger . view . VXGroupPermission > groupPermList = new java . util . ArrayList < org . apache . ranger . view . VXGroupPermission > ( ) ; org . apache . ranger . view . VXGroupPermission groupPermission = vxGroupPermission ( ) ; groupPermList . add ( groupPermission ) ; org . mockito . Mockito . when ( daoManager . getXXPortalUserRole ( ) ) . thenReturn ( xPortalUserRoleDao ) ; org . mockito . Mockito . when ( xPortalUserRoleDao . findByUserId ( org . apache . ranger . biz . TestXUserMgr . userId ) ) . thenReturn ( xPortalUserRoleList ) ; org . mockito . Mockito . when ( userMgr . getUserProfileByLoginId ( userProfile . getLoginId ( ) ) ) . thenReturn ( userProfile ) ; org . apache . ranger . view . VXStringList vXStringList = xUserMgr . getUserRolesByName ( userProfile . getLoginId ( ) ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . when ( restErrorUtil . createRESTException ( "Please<sp>provide<sp>a<sp>valid<sp>userName" , MessageEnums . INVALID_INPUT_DATA ) ) . thenThrow ( new javax . ws . rs . WebApplicationException ( ) ) ; thrown . expect ( javax . ws . rs . WebApplicationException . class ) ; xUserMgr . getUserRolesByName ( "" ) ; } getLoginId ( ) { return loginId ; } | org . junit . Assert . assertNotNull ( vXStringList ) |
testGetFirehoseNoDomainSet ( ) { store . setNodeConfValue ( org . buddycloud . channelserver . db . jdbc . TEST_SERVER1_NODE1_ID , Conf . ACCESS_MODEL , AccessModels . open . toString ( ) ) ; org . buddycloud . channelserver . Configuration . getInstance ( ) . remove ( Configuration . CONFIGURATION_SERVER_DOMAIN ) ; org . buddycloud . channelserver . Configuration . getInstance ( ) . remove ( Configuration . CONFIGURATION_SERVER_TOPICS_DOMAIN ) ; org . buddycloud . channelserver . db . CloseableIterator < org . buddycloud . channelserver . pubsub . model . NodeItem > firehose = store . getFirehose ( Integer . MAX_VALUE , null , false , org . buddycloud . channelserver . db . jdbc . TEST_SERVER1_HOSTNAME ) ; int itemCount = 0 ; while ( firehose . hasNext ( ) ) { firehose . next ( ) ; itemCount ++ ; } "<AssertPlaceHolder>" ; } next ( ) { return iterator . next ( ) ; } | org . junit . Assert . assertEquals ( 5 , itemCount ) |
testBuilder_user ( ) { com . google . cloud . tools . jib . configuration . ContainerConfiguration configuration = com . google . cloud . tools . jib . configuration . ContainerConfiguration . builder ( ) . setUser ( "john" ) . build ( ) ; "<AssertPlaceHolder>" ; } getUser ( ) { return user ; } | org . junit . Assert . assertEquals ( "john" , configuration . getUser ( ) ) |
testBatchWithFailedExecutionJobDeletionWithCascade ( ) { org . camunda . bpm . engine . repository . ProcessDefinition processDefinition = testRule . deployAndGetDefinition ( ProcessModels . TWO_TASKS_PROCESS ) ; org . camunda . bpm . engine . runtime . ProcessInstance processInstance1 = runtimeService . startProcessInstanceByKey ( "Process" ) ; org . camunda . bpm . engine . runtime . ProcessInstance processInstance2 = runtimeService . startProcessInstanceByKey ( "Process" ) ; runtimeService . deleteProcessInstance ( processInstance1 . getId ( ) , "test" ) ; runtimeService . deleteProcessInstance ( processInstance2 . getId ( ) , "test" ) ; org . camunda . bpm . engine . batch . Batch batch = runtimeService . restartProcessInstances ( processDefinition . getId ( ) ) . startTransition ( "flow1" ) . processInstanceIds ( processInstance1 . getId ( ) , processInstance2 . getId ( ) ) . executeAsync ( ) ; helper . executeSeedJob ( batch ) ; java . util . List < org . camunda . bpm . engine . runtime . Job > executionJobs = helper . getExecutionJobs ( batch ) ; for ( org . camunda . bpm . engine . runtime . Job executionJob : executionJobs ) { engineRule . getManagementService ( ) . setJobRetries ( executionJob . getId ( ) , 0 ) ; } engineRule . getManagementService ( ) . deleteBatch ( batch . getId ( ) , true ) ; long historicIncidents = engineRule . getHistoryService ( ) . createHistoricIncidentQuery ( ) . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { return count ( ALL_STATES ) ; } | org . junit . Assert . assertEquals ( 0 , historicIncidents ) |
embeddedCacheWithFlagsTest ( ) { org . apache . camel . component . infinispan . InfinispanConfiguration configuration = new org . apache . camel . component . infinispan . InfinispanConfiguration ( ) ; configuration . setHosts ( "localhost" ) ; configuration . setCacheContainer ( new org . infinispan . manager . DefaultCacheManager ( new org . infinispan . configuration . cache . ConfigurationBuilder ( ) . build ( ) , true ) ) ; org . apache . camel . component . infinispan . InfinispanManager manager = new org . apache . camel . component . infinispan . InfinispanManager ( configuration ) ; manager . start ( ) ; org . infinispan . commons . api . BasicCache < java . lang . Object , java . lang . Object > cache = manager . getCache ( "misc_cache" ) ; "<AssertPlaceHolder>" ; manager . getCacheContainer ( ) . stop ( ) ; manager . stop ( ) ; } getCache ( java . lang . String ) { org . infinispan . commons . api . BasicCache < K , V > cache ; if ( org . apache . camel . util . ObjectHelper . isEmpty ( cacheName ) ) { cache = cacheContainer . getCache ( ) ; cacheName = cache . getName ( ) ; } else { cache = cacheContainer . getCache ( cacheName ) ; } org . apache . camel . component . infinispan . InfinispanManager . LOGGER . trace ( "Cache[{}]" , cacheName ) ; if ( ( configuration . hasFlags ( ) ) && ( org . apache . camel . component . infinispan . InfinispanUtil . isEmbedded ( cache ) ) ) { cache = new org . infinispan . cache . impl . DecoratedCache ( org . apache . camel . component . infinispan . InfinispanUtil . asAdvanced ( cache ) , configuration . getFlags ( ) ) ; } return cache ; } | org . junit . Assert . assertNotNull ( cache ) |
shouldConstructAnAuthorizationHttpChannelWithGivenParams ( ) { org . codegist . crest . config . MethodType type = mock ( org . codegist . crest . config . MethodType . class ) ; org . codegist . crest . io . http . HttpChannel channel = mock ( org . codegist . crest . io . http . HttpChannel . class ) ; org . codegist . crest . io . http . AuthorizationHttpChannel expected = mock ( org . codegist . crest . io . http . AuthorizationHttpChannel . class ) ; when ( delegate . open ( type , "url" , org . codegist . crest . io . http . UTF8 ) ) . thenReturn ( channel ) ; whenNew ( org . codegist . crest . io . http . AuthorizationHttpChannel . class ) . withArguments ( channel , authorization , type , "url" , org . codegist . crest . io . http . UTF8 , httpEntityParamExtractors ) . thenReturn ( expected ) ; org . codegist . crest . io . http . HttpChannel actual = toTest . open ( type , "url" , org . codegist . crest . io . http . UTF8 ) ; "<AssertPlaceHolder>" ; } open ( org . codegist . crest . config . MethodType , java . lang . String , java . nio . charset . Charset ) { return new org . codegist . crest . io . http . AuthorizationHttpChannel ( delegate . open ( methodType , url , charset ) , authorization , methodType , url , charset , entityParamExtrators ) ; } | org . junit . Assert . assertSame ( expected , actual ) |
testRead ( ) { org . eclipse . rap . rwt . internal . resources . ClientFilesReader reader = org . eclipse . rap . rwt . internal . resources . ClientFilesReader_Test . createReader ( "foo\nbar" ) ; reader . read ( ) ; "<AssertPlaceHolder>" ; } getFiles ( ) { if ( ( files ) == null ) { files = new org . eclipse . ui . model . AdaptableList ( 0 ) ; } return files ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "foo" , "bar" ) , reader . getFiles ( ) ) |
strict_with_ambiguous_scenarios ( ) { createStrictRuntime ( ) ; bus . send ( testCaseFinishedWithStatus ( Result . Type . AMBIGUOUS ) ) ; "<AssertPlaceHolder>" ; } exitStatus ( ) { if ( results . isEmpty ( ) ) { return cucumber . runtime . ExitStatus . DEFAULT ; } if ( runtimeOptions . isWip ( ) ) { return min ( results , cucumber . runtime . SEVERITY ) . is ( Result . Type . PASSED ) ? cucumber . runtime . ExitStatus . ERRORS : cucumber . runtime . ExitStatus . DEFAULT ; } return max ( results , cucumber . runtime . SEVERITY ) . isOk ( runtimeOptions . isStrict ( ) ) ? cucumber . runtime . ExitStatus . DEFAULT : cucumber . runtime . ExitStatus . ERRORS ; } | org . junit . Assert . assertEquals ( 1 , exitStatus . exitStatus ( ) ) |
testGetFromPennTreebankString ( ) { java . lang . String origTreeStr = "" + ( ( ( ( "((VP<sp>(VB<sp>join)\n" + "(NP<sp>(DT<sp>the)<sp>(NN<sp>board)<sp>)\n" ) + "(PP-CLR<sp>(IN<sp>as)\n" ) + "(NP<sp>(DT<sp>a)<sp>(JJ<sp>nonexecutive)<sp>(NN<sp>director)<sp>))\n" ) + "(NP-TMP<sp>(NNP<sp>Nov.)<sp>(CD<sp>29)<sp>)))\n" ) ; java . io . StringReader reader = new java . io . StringReader ( origTreeStr ) ; edu . jhu . prim . bimap . IntObjectBimap < java . lang . String > alphabet = new edu . jhu . prim . bimap . IntObjectBimap < java . lang . String > ( ) ; edu . jhu . pacaya . parse . cky . intdata . IntNaryTree tree = edu . jhu . pacaya . parse . cky . intdata . IntNaryTree . readTreeInPtbFormat ( alphabet , alphabet , reader ) ; java . lang . String newTreeStr = tree . getAsPennTreebankString ( ) ; System . out . println ( alphabet ) ; System . out . println ( newTreeStr ) ; newTreeStr = edu . jhu . pacaya . parse . cky . intdata . IntNaryTreeTest . canonicalizeTreeString ( newTreeStr ) ; origTreeStr = edu . jhu . pacaya . parse . cky . intdata . IntNaryTreeTest . canonicalizeTreeString ( origTreeStr ) ; "<AssertPlaceHolder>" ; } canonicalizeTreeString ( java . lang . String ) { return newTreeStr . trim ( ) . replaceAll ( "\\s+\\)" , ")" ) . replaceAll ( "\\s+" , "<sp>" ) ; } | org . junit . Assert . assertEquals ( origTreeStr , newTreeStr ) |
testIdConstructor_Null ( ) { org . matsim . api . core . v01 . Id < org . matsim . api . core . v01 . IdTest . TLink > linkId1 = org . matsim . api . core . v01 . Id . create ( ( ( org . matsim . api . core . v01 . Id ) ( null ) ) , org . matsim . api . core . v01 . IdTest . TLink . class ) ; "<AssertPlaceHolder>" ; } create ( long , java . lang . Class ) { return org . matsim . api . core . v01 . Id . create ( java . lang . Long . toString ( key ) , type ) ; } | org . junit . Assert . assertNull ( linkId1 ) |
testCastCase_01 ( ) { org . eclipse . xtend . core . xtend . XtendClass xtendClazz = this . toValidXtendClass ( "public<sp>class<sp>TestCast<sp>{<sp>void<sp>doStuff()<sp>{<sp>Object<sp>o<sp>=<sp>(Object)this;}" ) ; "<AssertPlaceHolder>" ; } toValidXtendClass ( java . lang . CharSequence ) { org . eclipse . xtend . core . xtend . XtendTypeDeclaration _validTypeDeclaration = this . toValidTypeDeclaration ( "Clazz" , javaCode ) ; return ( ( org . eclipse . xtend . core . xtend . XtendClass ) ( _validTypeDeclaration ) ) ; } | org . junit . Assert . assertNotNull ( xtendClazz ) |
testProcess_zeroterminated ( ) { System . out . println ( "zeroterm" ) ; kg . apc . jmeter . modifiers . RawRequestSourcePreProcessor instance = new kg . apc . jmeter . modifiers . RawRequestSourcePreProcessor ( ) ; instance . testStarted ( ) ; instance . setFileName ( ( ( basedir ) + "/rawdata_zeroterm_looped.txt" ) ) ; int n = 1 ; try { for ( ; n < 20 ; n ++ ) { instance . process ( ) ; org . apache . jmeter . threads . JMeterContextService . getContext ( ) . getVariables ( ) . get ( instance . getVarName ( ) ) ; } org . junit . Assert . fail ( "EOF<sp>expected" ) ; } catch ( kg . apc . jmeter . RuntimeEOFException ex ) { "<AssertPlaceHolder>" ; } } getVarName ( ) { return getPropertyAsString ( kg . apc . jmeter . modifiers . FifoPopPreProcessor . variableName ) ; } | org . junit . Assert . assertEquals ( 6 , n ) |
testSetFieldSeparator ( ) { final org . apache . commons . lang3 . builder . ToStringStyle style = new org . apache . commons . lang3 . builder . ToStringStyleTest . ToStringStyleImpl ( ) ; style . setFieldSeparator ( null ) ; "<AssertPlaceHolder>" ; } getFieldSeparator ( ) { return fieldSeparator ; } | org . junit . Assert . assertEquals ( "" , style . getFieldSeparator ( ) ) |
testAuthUserReadAppendDelete ( ) { setupAuthUserReadAppend ( ) ; request . setRequestURI ( org . fcrepo . auth . webac . WebACFilterTest . testPath ) ; request . setMethod ( "DELETE" ) ; webacFilter . doFilter ( request , response , filterChain ) ; "<AssertPlaceHolder>" ; } doFilter ( javax . servlet . ServletRequest , javax . servlet . ServletResponse , javax . servlet . FilterChain ) { final org . apache . shiro . subject . Subject currentUser = org . apache . shiro . SecurityUtils . getSubject ( ) ; javax . servlet . http . HttpServletRequest httpRequest = ( ( javax . servlet . http . HttpServletRequest ) ( request ) ) ; if ( ( isSparqlUpdate ( httpRequest ) ) || ( isRdfRequest ( httpRequest ) ) ) { httpRequest = new org . fcrepo . auth . webac . CachedHttpRequest ( httpRequest ) ; } addURIToAuthorize ( httpRequest , java . net . URI . create ( httpRequest . getRequestURL ( ) . toString ( ) ) ) ; if ( currentUser . isAuthenticated ( ) ) { org . fcrepo . auth . webac . WebACFilter . log . debug ( "User<sp>is<sp>authenticated" ) ; if ( currentUser . hasRole ( org . fcrepo . auth . webac . FEDORA_ADMIN_ROLE ) ) { org . fcrepo . auth . webac . WebACFilter . log . debug ( "User<sp>has<sp>fedoraAdmin<sp>role" ) ; } else if ( currentUser . hasRole ( org . fcrepo . auth . webac . FEDORA_USER_ROLE ) ) { org . fcrepo . auth . webac . WebACFilter . log . debug ( "User<sp>has<sp>fedoraUser<sp>role" ) ; if ( ! ( isAuthorized ( currentUser , httpRequest ) ) ) { ( ( javax . servlet . http . HttpServletResponse ) ( response ) ) . sendError ( org . fcrepo . auth . webac . SC_FORBIDDEN ) ; return ; } } else { org . fcrepo . auth . webac . WebACFilter . log . debug ( "User<sp>has<sp>no<sp>recognized<sp>servlet<sp>container<sp>role" ) ; ( ( javax . servlet . http . HttpServletResponse ) ( response ) ) . sendError ( org . fcrepo . auth . webac . SC_FORBIDDEN ) ; return ; } } else { org . fcrepo . auth . webac . WebACFilter . log . debug ( "User<sp>is<sp>NOT<sp>authenticated" ) ; if ( ! ( isAuthorized ( getFoafAgentSubject ( ) , httpRequest ) ) ) { ( ( javax . servlet . http . HttpServletResponse ) ( response ) ) . sendError ( org . fcrepo . auth . webac . SC_FORBIDDEN ) ; return ; } } chain . doFilter ( httpRequest , response ) ; } | org . junit . Assert . assertEquals ( javax . servlet . http . HttpServletResponse . SC_FORBIDDEN , response . getStatus ( ) ) |
testImportToSqliteViaFromParameters ( ) { java . io . File dbFile = java . io . File . createTempFile ( "test" , "db" ) ; dbFile . deleteOnExit ( ) ; de . hpi . isg . mdms . rdbms . SQLiteInterface sqliteInterface = de . hpi . isg . mdms . rdbms . SQLiteInterface . createForFile ( dbFile ) ; de . hpi . isg . mdms . model . MetadataStore metadataStore = de . hpi . isg . mdms . domain . RDBMSMetadataStore . createNewInstance ( sqliteInterface ) ; java . io . File testFolder = de . hpi . isg . mdms . tools . apps . CreateSchemaForCsvFilesAppTest . getTestResource ( "test-schema" ) ; de . hpi . isg . mdms . tools . apps . CreateSchemaForCsvFilesApp . fromParameters ( metadataStore , java . util . Collections . singleton ( testFolder . getAbsolutePath ( ) ) , "test-schema" , ";" , "\"" , true ) ; de . hpi . isg . mdms . model . targets . Schema schema = metadataStore . getSchemaByName ( "test-schema" ) ; org . junit . Assert . assertNotNull ( "test-schema" ) ; org . junit . Assert . assertEquals ( 2 , schema . getTables ( ) . size ( ) ) ; de . hpi . isg . mdms . model . targets . Table table1 = metadataStore . getTableByName ( "test-schema.table1" ) ; org . junit . Assert . assertNotNull ( table1 ) ; org . junit . Assert . assertEquals ( 3 , table1 . getColumns ( ) . size ( ) ) ; de . hpi . isg . mdms . model . targets . Column table1Comments = metadataStore . getColumnByName ( "test-schema.table2.dat.Comments" ) ; "<AssertPlaceHolder>" ; } fromParameters ( de . hpi . isg . mdms . model . MetadataStore , java . lang . String , int , int , int ) { de . hpi . isg . mdms . tools . apps . CreateQGramSketchApp . Parameters parameters = new de . hpi . isg . mdms . tools . apps . CreateQGramSketchApp . Parameters ( ) ; parameters . schemaName = schemaName ; parameters . q = q ; parameters . numSketchDimensions = numSketchDimensions ; parameters . numQGramDimensions = numQGramDimensions ; parameters . metadataStoreParameters . isCloseMetadataStore = false ; de . hpi . isg . mdms . tools . apps . CreateQGramSketchApp app = new de . hpi . isg . mdms . tools . apps . CreateQGramSketchApp ( parameters ) ; app . metadataStore = mds ; app . run ( ) ; } | org . junit . Assert . assertNotNull ( table1Comments ) |
queriesDontReturnDeletedEntities ( ) { com . google . appengine . api . datastore . Entity entity = createTestEntity ( "KIND" ) ; com . google . appengine . api . datastore . Key key = entity . getKey ( ) ; service . put ( entity ) ; service . delete ( key ) ; java . util . List < com . google . appengine . api . datastore . Entity > entities = service . prepare ( new com . google . appengine . api . datastore . Query ( "KIND" ) ) . asList ( FetchOptions . Builder . withDefaults ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = delegate . size ( ) ; if ( size > 0 ) { get ( ( size - 1 ) ) ; } return size ; } | org . junit . Assert . assertEquals ( 0 , entities . size ( ) ) |
testListHourCost ( ) { int previous = hourCostDAO . list ( org . libreplan . business . costcategories . entities . HourCost . class ) . size ( ) ; org . libreplan . business . costcategories . entities . HourCost hourCost = createValidHourCost ( ) ; hourCostDAO . save ( hourCost ) ; java . util . List < org . libreplan . business . costcategories . entities . HourCost > list = hourCostDAO . list ( org . libreplan . business . costcategories . entities . HourCost . class ) ; "<AssertPlaceHolder>" ; } list ( java . lang . Class ) { return getSession ( ) . createCriteria ( klass ) . list ( ) ; } | org . junit . Assert . assertEquals ( ( previous + 1 ) , list . size ( ) ) |
testSquare ( ) { edu . ucla . sspace . graph . isomorphism . Graph < edu . ucla . sspace . graph . isomorphism . Edge > g1 = new edu . ucla . sspace . graph . isomorphism . SparseUndirectedGraph ( ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 2 ) ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 4 ) ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 3 , 2 ) ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 3 , 4 ) ) ; edu . ucla . sspace . graph . isomorphism . Graph < edu . ucla . sspace . graph . isomorphism . Edge > g2 = new edu . ucla . sspace . graph . isomorphism . SparseUndirectedGraph ( ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 3 ) ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 4 ) ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 2 , 3 ) ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 2 , 4 ) ) ; edu . ucla . sspace . graph . isomorphism . IsomorphismTester isoTest = new edu . ucla . sspace . graph . isomorphism . TypedVF2IsomorphismTester ( ) ; "<AssertPlaceHolder>" ; } areIsomorphic ( edu . ucla . sspace . graph . isomorphism . Graph , edu . ucla . sspace . graph . isomorphism . Graph ) { edu . ucla . sspace . graph . isomorphism . Graph < ? extends edu . ucla . sspace . graph . isomorphism . Edge > g1mapped = remap ( g1 , null ) ; edu . ucla . sspace . graph . isomorphism . Graph < ? extends edu . ucla . sspace . graph . isomorphism . Edge > g2mapped = remap ( g2 , null ) ; edu . ucla . sspace . graph . isomorphism . State state = makeInitialState ( g1mapped , g2mapped ) ; return match ( state ) ; } | org . junit . Assert . assertTrue ( isoTest . areIsomorphic ( g1 , g2 ) ) |
testRewritePomWithParentAndProperties ( ) { java . util . List < org . apache . maven . project . MavenProject > reactorProjects = createReactorProjects ( "pom-with-parent-and-properties" ) ; org . apache . maven . shared . release . config . ReleaseDescriptorBuilder builder = createDescriptorFromProjects ( reactorProjects , "pom-with-parent-and-properties" ) ; builder . addReleaseVersion ( "groupId:artifactId" , org . apache . maven . shared . release . phase . RewritePomsForReleasePhaseTest . NEXT_VERSION ) ; builder . addReleaseVersion ( "groupId:subproject1" , org . apache . maven . shared . release . phase . RewritePomsForReleasePhaseTest . ALTERNATIVE_NEXT_VERSION ) ; builder . addReleaseVersion ( "groupId:subproject2" , org . apache . maven . shared . release . phase . RewritePomsForReleasePhaseTest . ALTERNATIVE_NEXT_VERSION ) ; phase . execute ( org . apache . maven . shared . release . config . ReleaseUtils . buildReleaseDescriptor ( builder ) , new org . apache . maven . shared . release . env . DefaultReleaseEnvironment ( ) , reactorProjects ) ; "<AssertPlaceHolder>" ; } comparePomFiles ( java . util . List ) { return comparePomFiles ( reactorProjects , true ) ; } | org . junit . Assert . assertTrue ( comparePomFiles ( reactorProjects ) ) |
testAggregatorWithoutParameterForIterateDelta ( ) { final org . apache . flink . api . java . ExecutionEnvironment env = org . apache . flink . api . java . ExecutionEnvironment . getExecutionEnvironment ( ) ; env . setParallelism ( org . apache . flink . test . iterative . aggregators . AggregatorsITCase . parallelism ) ; org . apache . flink . api . java . DataSet < org . apache . flink . api . java . tuple . Tuple2 < java . lang . Integer , java . lang . Integer > > initialSolutionSet = org . apache . flink . test . operators . util . CollectionDataSets . getIntegerDataSet ( env ) . map ( new org . apache . flink . test . iterative . aggregators . AggregatorsITCase . TupleMakerMap ( ) ) ; org . apache . flink . api . java . operators . DeltaIteration < org . apache . flink . api . java . tuple . Tuple2 < java . lang . Integer , java . lang . Integer > , org . apache . flink . api . java . tuple . Tuple2 < java . lang . Integer , java . lang . Integer > > iteration = initialSolutionSet . iterateDelta ( initialSolutionSet , org . apache . flink . test . iterative . aggregators . AggregatorsITCase . MAX_ITERATIONS , 0 ) ; org . apache . flink . api . common . aggregators . LongSumAggregator aggr = new org . apache . flink . api . common . aggregators . LongSumAggregator ( ) ; iteration . registerAggregator ( org . apache . flink . test . iterative . aggregators . AggregatorsITCase . NEGATIVE_ELEMENTS_AGGR , aggr ) ; org . apache . flink . api . java . DataSet < org . apache . flink . api . java . tuple . Tuple2 < java . lang . Integer , java . lang . Integer > > updatedDs = iteration . getWorkset ( ) . map ( new org . apache . flink . test . iterative . aggregators . AggregatorsITCase . AggregateMapDelta ( ) ) ; org . apache . flink . api . java . DataSet < org . apache . flink . api . java . tuple . Tuple2 < java . lang . Integer , java . lang . Integer > > newElements = updatedDs . join ( iteration . getSolutionSet ( ) ) . where ( 0 ) . equalTo ( 0 ) . flatMap ( new org . apache . flink . test . iterative . aggregators . AggregatorsITCase . UpdateFilter ( ) ) ; org . apache . flink . api . java . DataSet < org . apache . flink . api . java . tuple . Tuple2 < java . lang . Integer , java . lang . Integer > > iterationRes = iteration . closeWith ( newElements , newElements ) ; java . util . List < java . lang . Integer > result = iterationRes . map ( new org . apache . flink . test . iterative . aggregators . AggregatorsITCase . ProjectSecondMapper ( ) ) . collect ( ) ; java . util . Collections . sort ( result ) ; java . util . List < java . lang . Integer > expected = java . util . Arrays . asList ( 1 , 2 , 2 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 ) ; "<AssertPlaceHolder>" ; } sort ( org . apache . flink . runtime . operators . sort . IndexedSortable ) { sort ( s , 0 , s . size ( ) ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
testGetSlackService ( ) { org . gitlab4j . api . services . SlackService slackService = org . gitlab4j . api . TestServicesApi . gitLabApi . getServicesApi ( ) . getSlackService ( org . gitlab4j . api . TestServicesApi . testProject ) ; "<AssertPlaceHolder>" ; } getSlackService ( java . lang . Object ) { javax . ws . rs . core . Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "slack" ) ; return response . readEntity ( org . gitlab4j . api . services . SlackService . class ) ; } | org . junit . Assert . assertNotNull ( slackService ) |
whenServiceRouteAndNewServiceFitsIn_itShouldReturnFulfilled ( ) { stateManager . informInsertionStarts ( java . util . Arrays . asList ( serviceRoute ) , java . util . Collections . < com . graphhopper . jsprit . core . problem . constraint . Job > emptyList ( ) ) ; com . graphhopper . jsprit . core . problem . constraint . Service s = mock ( com . graphhopper . jsprit . core . problem . constraint . Service . class ) ; when ( s . getSize ( ) ) . thenReturn ( Capacity . Builder . newInstance ( ) . addDimension ( 0 , 5 ) . build ( ) ) ; com . graphhopper . jsprit . core . problem . constraint . ServiceLoadRouteLevelConstraint loadconstraint = new com . graphhopper . jsprit . core . problem . constraint . ServiceLoadRouteLevelConstraint ( stateManager ) ; com . graphhopper . jsprit . core . problem . misc . JobInsertionContext context = new com . graphhopper . jsprit . core . problem . misc . JobInsertionContext ( serviceRoute , s , serviceRoute . getVehicle ( ) , null , 0.0 ) ; "<AssertPlaceHolder>" ; } fulfilled ( com . graphhopper . jsprit . core . problem . misc . JobInsertionContext ) { com . graphhopper . jsprit . core . problem . Capacity maxLoadAtRoute = stateManager . getRouteState ( insertionContext . getRoute ( ) , InternalStates . MAXLOAD , com . graphhopper . jsprit . core . problem . Capacity . class ) ; if ( maxLoadAtRoute == null ) maxLoadAtRoute = defaultValue ; com . graphhopper . jsprit . core . problem . Capacity capacityDimensions = insertionContext . getNewVehicle ( ) . getType ( ) . getCapacityDimensions ( ) ; if ( ! ( maxLoadAtRoute . isLessOrEqual ( capacityDimensions ) ) ) { return false ; } if ( ( insertionContext . getJob ( ) ) instanceof com . graphhopper . jsprit . core . problem . job . Delivery ) { com . graphhopper . jsprit . core . problem . Capacity loadAtDepot = stateManager . getRouteState ( insertionContext . getRoute ( ) , InternalStates . LOAD_AT_BEGINNING , com . graphhopper . jsprit . core . problem . Capacity . class ) ; if ( loadAtDepot == null ) loadAtDepot = defaultValue ; if ( ! ( com . graphhopper . jsprit . core . problem . Capacity . addup ( loadAtDepot , insertionContext . getJob ( ) . getSize ( ) ) . isLessOrEqual ( capacityDimensions ) ) ) { return false ; } } else if ( ( ( insertionContext . getJob ( ) ) instanceof com . graphhopper . jsprit . core . problem . job . Pickup ) || ( ( insertionContext . getJob ( ) ) instanceof com . graphhopper . jsprit . core . problem . job . Service ) ) { com . graphhopper . jsprit . core . problem . Capacity loadAtEnd = stateManager . getRouteState ( insertionContext . getRoute ( ) , InternalStates . LOAD_AT_END , com . graphhopper . jsprit . core . problem . Capacity . class ) ; if ( loadAtEnd == null ) loadAtEnd = defaultValue ; if ( ! ( com . graphhopper . jsprit . core . problem . Capacity . addup ( loadAtEnd , insertionContext . getJob ( ) . getSize ( ) ) . isLessOrEqual ( capacityDimensions ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertTrue ( loadconstraint . fulfilled ( context ) ) |
testTessBaseAPIAnalyseLayout ( ) { net . sourceforge . tess4j . TessAPITest . logger . info ( "TessBaseAPIAnalyseLayout" ) ; java . io . File image = new java . io . File ( testResourcesDataPath , "eurotext.png" ) ; int expResult = 12 ; net . sourceforge . lept4j . Leptonica leptInstance = net . sourceforge . lept4j . Leptonica . INSTANCE ; net . sourceforge . lept4j . Pix pix = leptInstance . pixRead ( image . getPath ( ) ) ; api . TessBaseAPIInit3 ( handle , datapath , language ) ; api . TessBaseAPISetImage2 ( handle , pix ) ; int pageIteratorLevel = TessPageIteratorLevel . RIL_TEXTLINE ; net . sourceforge . tess4j . TessAPITest . logger . info ( ( "PageIteratorLevel:<sp>" + ( net . sourceforge . tess4j . util . Utils . getConstantName ( pageIteratorLevel , net . sourceforge . tess4j . TessPageIteratorLevel . class ) ) ) ) ; int i = 0 ; net . sourceforge . tess4j . TessPageIterator pi = api . TessBaseAPIAnalyseLayout ( handle ) ; do { java . nio . IntBuffer leftB = java . nio . IntBuffer . allocate ( 1 ) ; java . nio . IntBuffer topB = java . nio . IntBuffer . allocate ( 1 ) ; java . nio . IntBuffer rightB = java . nio . IntBuffer . allocate ( 1 ) ; java . nio . IntBuffer bottomB = java . nio . IntBuffer . allocate ( 1 ) ; api . TessPageIteratorBoundingBox ( pi , pageIteratorLevel , leftB , topB , rightB , bottomB ) ; int left = leftB . get ( ) ; int top = topB . get ( ) ; int right = rightB . get ( ) ; int bottom = bottomB . get ( ) ; net . sourceforge . tess4j . TessAPITest . logger . info ( java . lang . String . format ( "Box[%d]:<sp>x=%d,<sp>y=%d,<sp>w=%d,<sp>h=%d" , ( i ++ ) , left , top , ( right - left ) , ( bottom - top ) ) ) ; } while ( ( api . TessPageIteratorNext ( pi , pageIteratorLevel ) ) == ( net . sourceforge . tess4j . ITessAPI . TRUE ) ) ; api . TessPageIteratorDelete ( pi ) ; com . sun . jna . ptr . PointerByReference pRef = new com . sun . jna . ptr . PointerByReference ( ) ; pRef . setValue ( pix . getPointer ( ) ) ; leptInstance . pixDestroy ( pRef ) ; "<AssertPlaceHolder>" ; } TessPageIteratorDelete ( net . sourceforge . tess4j . ITessAPI$TessPageIterator ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>supported<sp>yet." ) ; } | org . junit . Assert . assertEquals ( expResult , i ) |
testBadSyntax ( ) { boolean ok = rawGenerateAndBuildRecognizer ( "Expr.g4" , org . antlr . v4 . test . tool . TestXPath . grammar , "ExprParser" , "ExprLexer" , false ) ; "<AssertPlaceHolder>" ; java . lang . String path = "///" ; java . lang . String expected = "/<sp>at<sp>index<sp>2<sp>isn't<sp>a<sp>valid<sp>rule<sp>name" ; testError ( org . antlr . v4 . test . tool . TestXPath . SAMPLE_PROGRAM , path , expected , "prog" , "ExprParser" , "ExprLexer" ) ; } rawGenerateAndBuildRecognizer ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String [ ] ) { return rawGenerateAndBuildRecognizer ( grammarFileName , grammarStr , parserName , lexerName , false , extraOptions ) ; } | org . junit . Assert . assertTrue ( ok ) |
nullBoundsMeansImageBounds ( ) { image = createSequentialImage ( org . jaitools . imageutils . iterator . SimpleIteratorTest . WIDTH , org . jaitools . imageutils . iterator . SimpleIteratorTest . HEIGHT , org . jaitools . imageutils . iterator . SimpleIteratorTest . NUM_BANDS ) ; iter = new org . jaitools . imageutils . iterator . SimpleIterator ( image , null , null ) ; java . awt . Rectangle imageBounds = image . getBounds ( ) ; "<AssertPlaceHolder>" ; } getBounds ( ) { return new java . awt . Rectangle ( bounds ) ; } | org . junit . Assert . assertEquals ( imageBounds , iter . getBounds ( ) ) |
testBindIndex7 ( ) { fr . inria . corese . core . Graph g = fr . inria . corese . core . Graph . create ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; java . lang . String q = "select<sp>" + ( ( ( ( ( ( ( ( "(us:test(3,<sp>3)<sp>as<sp>?t)<sp>where<sp>{}" + "function<sp>us:test(?n,<sp>?n)<sp>{xt:display('here')<sp>;" ) + "let<sp>(?n<sp>=<sp>?n)<sp>{" ) + "for<sp>(?x<sp>in<sp>(xt:iota(?n)))<sp>{" ) + "if<sp>(?x<sp>><sp>1)<sp>{" ) + "return<sp>(?x)}" ) + "}<sp>" ) + "}" ) + "}" ) ; fr . inria . corese . kgram . core . Mappings map = exec . query ( q ) ; "<AssertPlaceHolder>" ; } size ( ) { return tests . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , map . size ( ) ) |
testEqualityWithNull ( ) { javax . measure . Quantity < javax . measure . quantity . Length > value = tec . units . ri . quantity . Quantities . getQuantity ( java . lang . Integer . valueOf ( 20 ) , Units . METRE ) ; javax . measure . Quantity < javax . measure . quantity . Length > anotherValue = tec . units . ri . quantity . Quantities . getQuantity ( null , Units . METRE ) ; "<AssertPlaceHolder>" ; } getQuantity ( java . lang . Number , javax . measure . Unit ) { if ( value == null ) throw new java . lang . NullPointerException ( ) ; if ( unit == null ) throw new java . lang . NullPointerException ( ) ; if ( tec . units . ri . quantity . Double . class . isInstance ( value ) ) { return new tec . units . ri . quantity . DoubleQuantity < Q > ( value . doubleValue ( ) , unit ) ; } else if ( tec . units . ri . quantity . Long . class . isInstance ( value ) ) { return new tec . units . ri . quantity . LongQuantity < Q > ( tec . units . ri . quantity . Long . class . cast ( value ) , unit ) ; } else if ( tec . units . ri . quantity . Short . class . isInstance ( value ) ) { return new tec . units . ri . quantity . ShortQuantity < Q > ( tec . units . ri . quantity . Short . class . cast ( value ) , unit ) ; } else if ( tec . units . ri . quantity . Integer . class . isInstance ( value ) ) { return new tec . units . ri . quantity . IntegerQuantity < Q > ( tec . units . ri . quantity . Integer . class . cast ( value ) , unit ) ; } else if ( tec . units . ri . quantity . Float . class . isInstance ( value ) ) { return new tec . units . ri . quantity . FloatQuantity < Q > ( tec . units . ri . quantity . Float . class . cast ( value ) , unit ) ; } return new tec . units . ri . quantity . NumberQuantity < Q > ( value , unit ) ; } | org . junit . Assert . assertEquals ( value , anotherValue ) |
testSetsChangeHandler ( ) { com . eclipsesource . tabris . internal . ui . PropertyChangeNotifier notifier = new com . eclipsesource . tabris . internal . ui . PropertyChangeNotifier ( ) ; com . eclipsesource . tabris . internal . ui . PropertyChangeHandler handler = mock ( com . eclipsesource . tabris . internal . ui . PropertyChangeHandler . class ) ; notifier . setPropertyChangeHandler ( handler ) ; com . eclipsesource . tabris . internal . ui . PropertyChangeHandler actualHandler = notifier . getPropertyChangeHandler ( ) ; "<AssertPlaceHolder>" ; } getPropertyChangeHandler ( ) { return handler ; } | org . junit . Assert . assertSame ( handler , actualHandler ) |
testForURLSafeToken ( ) { java . util . List < java . lang . String > aefMapIdsList = java . util . Collections . singletonList ( "290" ) ; org . kaaproject . kaa . common . dto . admin . SdkProfileDto sdkProfileDto = new org . kaaproject . kaa . common . dto . admin . SdkProfileDto ( "113" , 1 , 0 , 1 , 1 , aefMapIdsList , "someVerifierToken" , "15643220456970528206" , "devuser" , 100000L , "" ) ; org . kaaproject . kaa . server . common . dao . service . SdkTokenGenerator . generateSdkToken ( sdkProfileDto ) ; "<AssertPlaceHolder>" ; } getToken ( ) { return token ; } | org . junit . Assert . assertFalse ( sdkProfileDto . getToken ( ) . contains ( "/" ) ) |
relative ( ) { org . jboss . as . console . client . v3 . dmr . AddressTemplate at = org . jboss . as . console . client . v3 . dmr . AddressTemplate . of ( "a=b/c=d" ) ; "<AssertPlaceHolder>" ; } getTemplate ( ) { return template ; } | org . junit . Assert . assertEquals ( "a=b/c=d" , at . getTemplate ( ) ) |
testDeptRepoSave ( ) { java . lang . String name = "test123" ; com . tomniu . model . Department dept = new com . tomniu . model . Department ( ) ; dept . setDeptName ( name ) ; com . tomniu . model . Department dept1 = deptRepo . save ( dept ) ; "<AssertPlaceHolder>" ; } getDeptName ( ) { return deptName ; } | org . junit . Assert . assertEquals ( name , dept1 . getDeptName ( ) ) |
testPack3dInput ( ) { final double [ ] [ ] [ ] data = new double [ slices ] [ rows ] [ columns ] ; java . lang . String msg = ( java . lang . String . format ( org . jtransforms . fft . RealFFTUtils_3DTest . DEFAULT_MESSAGE , numThreads , slices , rows , columns ) ) + "[%d][%d][%d]" ; for ( int s = 0 ; s < ( slices ) ; s ++ ) { for ( int r = 0 ; r < ( rows ) ; r ++ ) { for ( int c = 0 ; c < ( 2 * ( columns ) ) ; c ++ ) { final double expected = random . nextDouble ( ) ; try { unpacker . pack ( expected , s , r , c , data ) ; final double actual = unpacker . unpack ( s , r , c , data ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . IllegalArgumentException e ) { } } } } } unpack ( int , int , int , float [ ] [ ] [ ] ) { final int i = getIndex ( s , r , c ) ; final int ii = abs ( i ) ; final int ss = ii / ( sliceStride ) ; final int remainder = ii % ( sliceStride ) ; final int rr = remainder / ( rowStride ) ; final int cc = remainder % ( rowStride ) ; if ( i >= 0 ) { return packed [ ss ] [ rr ] [ cc ] ; } else if ( i > ( Integer . MIN_VALUE ) ) { return - ( packed [ ss ] [ rr ] [ cc ] ) ; } else { return org . jtransforms . fft . RealFFTUtils_3D . ZERO ; } } | org . junit . Assert . assertEquals ( java . lang . String . format ( msg , s , r , c ) , expected , actual , 0.0 ) |
shouldWorkWithNull ( ) { "<AssertPlaceHolder>" ; } getLanguage ( java . lang . String ) { localeString = ( ( localeString == null ) || ( localeString . equals ( "default" ) ) ) ? "en" : localeString ; java . lang . String [ ] split = localeString . split ( "[_-]" ) ; if ( ( ( split . length ) > 0 ) && ( split [ 0 ] . matches ( cc . kune . common . shared . utils . I18nBasicUtils . LANG_PATTERN ) ) ) { return split [ 0 ] ; } else { return cc . kune . common . shared . utils . I18nBasicUtils . DEFAULT_LANG ; } } | org . junit . Assert . assertEquals ( "en" , cc . kune . common . shared . utils . I18nBasicUtils . getLanguage ( null ) ) |
testSignalNamedSlot ( ) { final java . util . concurrent . atomic . AtomicBoolean correct = new java . util . concurrent . atomic . AtomicBoolean ( ) ; java . lang . Object callback = new java . lang . Object ( ) { @ com . aldebaran . qi . QiSlot ( "abc" ) public void onResult ( int i , java . lang . String s ) { correct . set ( ( ( i == 42 ) && ( "hello" . equals ( s ) ) ) ) ; } @ com . aldebaran . qi . QiSlot ( "def" ) public void onResult ( ) { } } ; com . aldebaran . qi . QiSignalConnection connection = proxy . connect ( "fire" , callback , "abc" ) ; connection . waitForDone ( ) ; obj . post ( "fire" , 42 , "hello" ) ; java . lang . Thread . sleep ( 100 ) ; "<AssertPlaceHolder>" ; connection . disconnect ( ) ; } waitForDone ( ) { future . sync ( ) ; } | org . junit . Assert . assertTrue ( correct . get ( ) ) |
getGroupMembersEmptyAfterFilter ( ) { System . out . println ( "VootManager.getGroupMembersEmptyAfterFilter" ) ; voot = new cz . metacentrum . perun . voot . VOOT ( ) ; java . lang . String groupName = "vo1:group2" ; cz . metacentrum . perun . voot . Response response = ( ( cz . metacentrum . perun . voot . Response ) ( voot . process ( session , ( "people/@me/" + groupName ) , "sortOrder=descending,filterBy=displayName,filterOp=equals,filterValue=karol" ) ) ) ; "<AssertPlaceHolder>" ; } getEntry ( ) { return entry ; } | org . junit . Assert . assertEquals ( 0 , response . getEntry ( ) . length ) |
testUnlinkObject ( ) { System . out . println ( "unlinkObject" ) ; java . lang . String objectName = "" ; java . lang . Object [ ] ids = null ; com . odoojava . api . OdooCommand instance = null ; boolean expResult = false ; boolean result = instance . unlinkObject ( objectName , ids ) ; "<AssertPlaceHolder>" ; fail ( "The<sp>test<sp>case<sp>is<sp>a<sp>prototype." ) ; } unlinkObject ( java . lang . String , java . lang . Object [ ] ) { return ( ( java . lang . Boolean ) ( session . executeCommand ( objectName , "unlink" , new java . lang . Object [ ] { ids } ) ) ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
test_simple_sequencer_initialization ( ) { com . hazelcast . test . TestHazelcastInstanceFactory factory = new com . hazelcast . test . TestHazelcastInstanceFactory ( 1 ) ; com . hazelcast . core . HazelcastInstance hazelcastInstance = factory . newHazelcastInstance ( ) ; try { com . noctarius . snowcast . Snowcast snowcast = com . noctarius . snowcast . SnowcastSystem . snowcast ( hazelcastInstance ) ; com . noctarius . snowcast . SnowcastSequencer sequencer = buildSnowcastSequencer ( snowcast ) ; "<AssertPlaceHolder>" ; } finally { factory . shutdownAll ( ) ; } } buildSnowcastSequencer ( com . noctarius . snowcast . Snowcast ) { com . noctarius . snowcast . SnowcastEpoch epoch = buildEpoch ( ) ; return buildSnowcastSequencer ( snowcast , epoch ) ; } | org . junit . Assert . assertNotNull ( sequencer ) |
whenDeleteModelThenGetNull ( ) { nbc . add ( 1 , testModel ) ; nbc . delete ( 1 ) ; "<AssertPlaceHolder>" ; } get ( K ) { return this . cache . getOrDefault ( key , null ) ; } | org . junit . Assert . assertNull ( nbc . get ( 1 ) ) |
provides_the_scenario_line ( ) { java . util . List < gherkin . pickles . PickleLocation > scenarioLocation = asList ( new gherkin . pickles . PickleLocation ( line ( 3 ) , column ( 2 ) ) ) ; cucumber . runner . Scenario scenario = createScenarioWithScenarioLocations ( scenarioLocation ) ; "<AssertPlaceHolder>" ; } getLines ( ) { java . util . List < java . lang . Integer > lines = new java . util . ArrayList ( ) ; for ( gherkin . pickles . PickleLocation location : pickleEvent . pickle . getLocations ( ) ) { lines . add ( location . getLine ( ) ) ; } return lines ; } | org . junit . Assert . assertEquals ( asList ( 3 ) , scenario . getLines ( ) ) |
testCreatedCacheWithConfiguration ( ) { org . dayatang . cache . ehcache . EhCacheConfiguration configuration = org . dayatang . cache . ehcache . EhCacheConfiguration . builder ( ) . name ( "mycache" ) . maxElementsInMemory ( 100000 ) . overflowToDisk ( true ) . eternal ( true ) . timeToLiveSeconds ( 1200000 ) . timeToIdleSeconds ( 200000 ) . build ( ) ; org . dayatang . cache . Cache cache = new org . dayatang . cache . ehcache . EhCacheBasedCache ( configuration ) ; "<AssertPlaceHolder>" ; } build ( ) { if ( ( org . apache . commons . lang3 . StringUtils . isBlank ( sheetName ) ) && ( ( sheetIndex ) < 0 ) ) { throw new org . dayatang . excel . ExcelException ( "sheet<sp>name<sp>not<sp>defined,<sp>and<sp>sheet<sp>index<sp><<sp>0" ) ; } if ( ( rowIndex ) < 0 ) { throw new org . dayatang . excel . ExcelException ( "row<sp>index<sp>must<sp>>=<sp>0" ) ; } if ( ( columnIndex ) < 0 ) { throw new org . dayatang . excel . ExcelException ( "column<sp>index<sp>must<sp>>=<sp>0" ) ; } if ( org . apache . commons . lang3 . StringUtils . isBlank ( sheetName ) ) { return new org . dayatang . excel . ExcelCell ( sheetIndex , rowIndex , columnIndex ) ; } return new org . dayatang . excel . ExcelCell ( sheetName , rowIndex , columnIndex ) ; } | org . junit . Assert . assertTrue ( ( cache != null ) ) |
secondRuleDrl ( ) { org . drools . builder . KnowledgeBuilder kbuilder = org . drools . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; kbuilder . add ( new org . drools . io . impl . ClassPathResource ( "secondRule.drl" ) , ResourceType . DRL ) ; if ( kbuilder . hasErrors ( ) ) { throw new java . lang . IllegalStateException ( ( "Knowledge<sp>Resources<sp>cannot<sp>be<sp>parsed!<sp>" + ( kbuilder . getErrors ( ) . iterator ( ) . next ( ) . getMessage ( ) ) ) ) ; } org . drools . KnowledgeBase kbase = kbuilder . newKnowledgeBase ( ) ; kbase . addKnowledgePackages ( kbuilder . getKnowledgePackages ( ) ) ; org . drools . runtime . StatefulKnowledgeSession ksession = kbase . newStatefulKnowledgeSession ( ) ; org . drools . logger . KnowledgeRuntimeLoggerFactory . newConsoleLogger ( ksession ) ; com . wordpress . salaboy . model . Person person = new com . wordpress . salaboy . model . Person ( "Salaboy" , 28 ) ; ksession . insert ( person ) ; ksession . insert ( new com . wordpress . salaboy . model . Address ( "nowhere" , "" , 1425 , "BA" ) ) ; int fired = ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } fireAllRules ( ) { org . drools . runtime . StatefulKnowledgeSession ksession = this . getKnowledgeSession ( ) ; try { return ksession . fireAllRules ( ) ; } finally { ksession . dispose ( ) ; } } | org . junit . Assert . assertEquals ( 1 , fired ) |
testHibernateProfile ( ) { java . util . List < org . geosdi . geoplatform . persistence . demo . model . Car > cars = this . hibCarDAO . findAll ( ) ; "<AssertPlaceHolder>" ; logger . info ( "Persistence<sp>Hibernate<sp>Test<sp>-<sp>Car<sp>Found<sp>@@@@@@@@@@@@@@@@@@@@@@@@@<sp>{}\n" , cars ) ; logger . info ( "########################FIND_CAR_BY_ID<sp>:<sp>{}\n" , this . hibCarDAO . find ( car . getId ( ) ) ) ; this . hibCarDAO . removeAll ( ) ; } size ( ) { return list . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( cars . size ( ) ) == 1 ) ) |
testInvalidAlertDefinition ( ) { java . lang . String componentName = "DATANODE" ; org . apache . ambari . server . state . Alert alert = new org . apache . ambari . server . state . Alert ( "missing_alert_definition_name" , null , "HDFS" , componentName , org . apache . ambari . server . state . alerts . AlertReceivedListenerTest . HOST1 , org . apache . ambari . server . state . AlertState . OK ) ; alert . setLabel ( org . apache . ambari . server . state . alerts . AlertReceivedListenerTest . ALERT_LABEL ) ; alert . setText ( ( ( "HDFS<sp>" + componentName ) + "<sp>is<sp>OK" ) ) ; alert . setTimestamp ( 1L ) ; org . apache . ambari . server . events . listeners . alerts . AlertReceivedListener listener = m_injector . getInstance ( org . apache . ambari . server . events . listeners . alerts . AlertReceivedListener . class ) ; org . apache . ambari . server . events . AlertReceivedEvent event1 = new org . apache . ambari . server . events . AlertReceivedEvent ( m_cluster . getClusterId ( ) , alert ) ; listener . onAlertEvent ( event1 ) ; java . util . List < org . apache . ambari . server . orm . entities . AlertCurrentEntity > allCurrent = m_dao . findCurrent ( ) ; "<AssertPlaceHolder>" ; } size ( ) { java . util . Set < java . lang . String > nodes = new java . util . HashSet < java . lang . String > ( ) ; for ( org . apache . ambari . eventdb . model . WorkflowDag . WorkflowDagEntry entry : entries ) { nodes . add ( entry . getSource ( ) ) ; nodes . addAll ( entry . getTargets ( ) ) ; } return nodes . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , allCurrent . size ( ) ) |
testRemoveAttribute ( ) { com . amadeus . session . RepositoryBackedSession rbs = new com . amadeus . session . RepositoryBackedSession ( sessionData , manager , factory ) ; rbs . setAttribute ( "Test" , "value" ) ; rbs . removeAttribute ( "Test" ) ; verify ( notifier ) . attributeRemoved ( refEq ( rbs ) , eq ( "Test" ) , eq ( "value" ) ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { return null ; } | org . junit . Assert . assertNull ( rbs . getAttribute ( "Test" ) ) |
componentToDependency ( ) { io . cereebro . server . graph . sigma . Edge actual = io . cereebro . server . graph . sigma . Edge . to ( io . cereebro . core . Component . of ( "phoenix" , "superhero" ) , io . cereebro . core . Dependency . on ( io . cereebro . core . Component . of ( "xavier" , "superhero" ) ) ) ; io . cereebro . server . graph . sigma . Edge expected = io . cereebro . server . graph . sigma . Edge . create ( "superhero:phoenix-to-superhero:xavier" , "superhero:phoenix" , "superhero:xavier" ) ; "<AssertPlaceHolder>" ; } of ( java . lang . String , java . lang . String ) { return new io . cereebro . core . Component ( name , type ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
found_in_index ( ) { final net . ripe . db . whois . common . rpsl . RpslObject domain = net . ripe . db . whois . common . rpsl . RpslObject . parse ( "domain:142.37.in-addr.arpa\nnserver:ns.ripe.net" ) ; rpslObjectUpdateDao . createObject ( domain ) ; subject = net . ripe . db . whois . common . dao . jdbc . index . IndexStrategies . get ( AttributeType . NSERVER ) ; final java . util . List < net . ripe . db . whois . common . dao . RpslObjectInfo > results = subject . findInIndex ( whoisTemplate , "ns.ripe.net" ) ; "<AssertPlaceHolder>" ; } size ( ) { return count ; } | org . junit . Assert . assertThat ( results . size ( ) , org . hamcrest . core . Is . is ( 1 ) ) |
billingCodeNullTest ( ) { org . marc . everest . rmim . uv . cdar2 . pocd_mt000040uv . EntryRelationship entryRelationship = org . oscarehr . e2e . model . export . body . FamilyHistoryModelTest . nullFamilyHistoryModel . getBillingCode ( ) ; "<AssertPlaceHolder>" ; } getBillingCode ( ) { return billingCode ; } | org . junit . Assert . assertNotNull ( entryRelationship ) |
applyGlobMixedCase ( ) { setup ( "n*e" ) ; org . apache . hadoop . fs . shell . PathData item = new org . apache . hadoop . fs . shell . PathData ( "/directory/path/NaMe" , mockFs . getConf ( ) ) ; "<AssertPlaceHolder>" ; } apply ( org . apache . hadoop . fs . shell . PathData , int ) { java . lang . String name = getPath ( item ) . getName ( ) ; if ( ! ( caseSensitive ) ) { name = org . apache . hadoop . util . StringUtils . toLowerCase ( name ) ; } if ( globPattern . matches ( name ) ) { return Result . PASS ; } else { return Result . FAIL ; } } | org . junit . Assert . assertEquals ( Result . FAIL , name . apply ( item , ( - 1 ) ) ) |
shouldCompareReturnMinusOneIfSolutionBHasHigherDistance ( ) { @ org . uma . jmetal . util . comparator . SuppressWarnings ( "unchecked" ) org . uma . jmetal . util . solutionattribute . impl . CrowdingDistance < org . uma . jmetal . solution . Solution < ? > > distance = mock ( org . uma . jmetal . util . solutionattribute . impl . CrowdingDistance . class ) ; when ( distance . getAttribute ( any ( org . uma . jmetal . solution . BinarySolution . class ) ) ) . thenReturn ( 3.0 , 3.0 , 2.0 , 2.0 ) ; org . springframework . test . util . ReflectionTestUtils . setField ( comparator , "crowdingDistance" , distance ) ; org . uma . jmetal . solution . BinarySolution solution1 = mock ( org . uma . jmetal . solution . BinarySolution . class ) ; org . uma . jmetal . solution . BinarySolution solution2 = mock ( org . uma . jmetal . solution . BinarySolution . class ) ; "<AssertPlaceHolder>" ; verify ( distance , times ( 4 ) ) . getAttribute ( any ( org . uma . jmetal . solution . Solution . class ) ) ; } compare ( S extends org . uma . jmetal . solution . Solution , S extends org . uma . jmetal . solution . Solution ) { if ( ( overallConstraintViolation . getAttribute ( solution1 ) ) == null ) { return 0 ; } double overall1 ; double overall2 ; overall1 = ( numberOfViolatedConstraints . getAttribute ( solution1 ) ) * ( overallConstraintViolation . getAttribute ( solution1 ) ) ; overall2 = ( numberOfViolatedConstraints . getAttribute ( solution2 ) ) * ( overallConstraintViolation . getAttribute ( solution2 ) ) ; if ( ( overall1 < 0 ) && ( overall2 < 0 ) ) { if ( overall1 > overall2 ) { return - 1 ; } else if ( overall2 > overall1 ) { return 1 ; } else { return 0 ; } } else if ( ( overall1 == 0 ) && ( overall2 < 0 ) ) { return - 1 ; } else if ( ( overall1 < 0 ) && ( overall2 == 0 ) ) { return 1 ; } else { return 0 ; } } | org . junit . Assert . assertEquals ( ( - 1 ) , comparator . compare ( solution1 , solution2 ) ) |
testExceptionWhenOperationNotAllowed ( ) { final org . opensmartgridplatform . shared . exceptionhandling . FunctionalException fe = new org . opensmartgridplatform . shared . exceptionhandling . FunctionalException ( org . opensmartgridplatform . shared . exceptionhandling . FunctionalExceptionType . UNAUTHORIZED , org . opensmartgridplatform . shared . exceptionhandling . ComponentType . WS_SMART_METERING ) ; doThrow ( fe ) . when ( this . domainHelperService ) . isAllowed ( this . organisation , this . device , DeviceFunction . REQUEST_PERIODIC_METER_DATA ) ; try { this . bundleService . enqueueBundleRequest ( org . opensmartgridplatform . adapter . ws . smartmetering . application . services . BundleServiceTest . ORGANISATION_IDENTIFICATION , org . opensmartgridplatform . adapter . ws . smartmetering . application . services . BundleServiceTest . DEVICE_IDENTIFICATION , this . actionRequestMockList , org . opensmartgridplatform . adapter . ws . smartmetering . application . services . BundleServiceTest . MESSAGE_PRIORITY , org . opensmartgridplatform . adapter . ws . smartmetering . application . services . BundleServiceTest . BYPASS_RETRY ) ; org . junit . Assert . fail ( ) ; } catch ( final org . opensmartgridplatform . shared . exceptionhandling . FunctionalException e ) { "<AssertPlaceHolder>" ; } } enqueueBundleRequest ( java . lang . String , java . lang . String , java . util . List , int , boolean ) { final org . opensmartgridplatform . domain . core . entities . Organisation organisation = this . domainHelperService . findOrganisation ( organisationIdentification ) ; final org . opensmartgridplatform . domain . core . entities . Device device = this . domainHelperService . findActiveDevice ( deviceIdentification ) ; org . opensmartgridplatform . adapter . ws . smartmetering . application . services . BundleService . LOGGER . info ( "Bundle<sp>request<sp>called<sp>with<sp>organisation<sp>{}" , organisationIdentification ) ; this . checkIfBundleIsAllowed ( actionList , organisation , device ) ; final java . lang . String correlationUid = this . correlationIdProviderService . getCorrelationId ( organisationIdentification , deviceIdentification ) ; final org . opensmartgridplatform . shared . infra . jms . DeviceMessageMetadata deviceMessageMetadata = new org . opensmartgridplatform . shared . infra . jms . DeviceMessageMetadata ( deviceIdentification , organisationIdentification , correlationUid , MessageType . HANDLE_BUNDLED_ACTIONS . name ( ) , messagePriority ) ; deviceMessageMetadata . setBypassRetry ( bypassRetry ) ; final org . opensmartgridplatform . adapter . ws . smartmetering . infra . jms . SmartMeteringRequestMessage message = new org . opensmartgridplatform . adapter . ws . smartmetering . infra . jms . SmartMeteringRequestMessage . Builder ( ) . deviceMessageMetadata ( deviceMessageMetadata ) . request ( new org . opensmartgridplatform . domain . core . valueobjects . smartmetering . BundleMessageRequest ( actionList ) ) . build ( ) ; this . smartMeteringRequestMessageSender . send ( message ) ; return correlationUid ; } | org . junit . Assert . assertEquals ( fe , e ) |
testGrantPermission ( ) { com . picocontainer . classname . ClassPathElement element = new com . picocontainer . classname . ClassPathElement ( new java . net . URL ( "file:///usr/lib" ) ) ; element . grantPermission ( new java . io . FilePermission ( "/usr/lib" , "read" ) ) ; "<AssertPlaceHolder>" ; } getPermissionCollection ( ) { if ( ( permissionCollection ) == null ) { permissionCollection = new java . security . Permissions ( ) ; for ( java . security . Permission permission : permissions ) { permissionCollection . add ( permission ) ; } } return permissionCollection ; } | org . junit . Assert . assertNotNull ( element . getPermissionCollection ( ) ) |
testClientUntypedRequestWithoutHint ( ) { ca . uhn . fhir . rest . server . SearchReturningProfiledResourceDstu2Test . ourCtx = ca . uhn . fhir . context . FhirContext . forDstu2 ( ) ; ca . uhn . fhir . rest . client . api . IGenericClient client = ca . uhn . fhir . rest . server . SearchReturningProfiledResourceDstu2Test . ourCtx . newRestfulGenericClient ( ( ( "http://localhost:" + ( ca . uhn . fhir . rest . server . SearchReturningProfiledResourceDstu2Test . ourPort ) ) + "/" ) ) ; ca . uhn . fhir . model . dstu2 . resource . Bundle bundle = client . search ( ) . forResource ( ca . uhn . fhir . model . dstu2 . resource . Patient . class ) . returnBundle ( ca . uhn . fhir . model . dstu2 . resource . Bundle . class ) . execute ( ) ; "<AssertPlaceHolder>" ; } getEntry ( ) { if ( ( this . entry ) == null ) this . entry = new org . hl7 . fhir . dstu3 . model . ArrayList < org . hl7 . fhir . dstu3 . model . Bundle . BundleEntryComponent > ( ) ; return this . entry ; } | org . junit . Assert . assertEquals ( ca . uhn . fhir . model . dstu2 . resource . Patient . class , bundle . getEntry ( ) . get ( 0 ) . getResource ( ) . getClass ( ) ) |
testVer ( ) { log . debug ( "Debiera<sp>mostrar<sp>una<sp>Orden<sp>de<sp>Pago" ) ; mx . edu . um . mateo . contabilidad . web . Usuario usuario = this . obtieneUsuario ( ) ; this . authenticate ( usuario , usuario . getPassword ( ) , new java . util . ArrayList < org . springframework . security . core . GrantedAuthority > ( usuario . getRoles ( ) ) ) ; mx . edu . um . mateo . contabilidad . model . OrdenPago orden = new mx . edu . um . mateo . contabilidad . model . OrdenPago ( "TEST" , true , new java . util . Date ( ) , usuario . getEmpresa ( ) , mx . edu . um . mateo . general . utils . Constantes . STATUS_ACTIVO , usuario , new java . util . Date ( ) , mx . edu . um . mateo . general . utils . Constantes . STATUS_ACTIVO ) ; currentSession ( ) . save ( orden ) ; "<AssertPlaceHolder>" ; this . mockMvc . perform ( get ( ( ( ( mx . edu . um . mateo . general . utils . Constantes . ORDENPAGO_PATH_VER ) + "/" ) + ( orden . getId ( ) ) ) ) ) . andExpect ( forwardedUrl ( ( ( "/WEB-INF/jsp/" + ( mx . edu . um . mateo . general . utils . Constantes . ORDENPAGO_PATH_VER ) ) + ".jsp" ) ) ) . andExpect ( model ( ) . attributeExists ( Constantes . ORDENPAGO ) ) ; } getId ( ) { return id ; } | org . junit . Assert . assertNotNull ( orden . getId ( ) ) |
testGeboortemamaMetTitel ( ) { voegKindToeAanOuder ( broertje , papa , mama ) ; final nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . NaamParameters sPara = new nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . NaamParameters ( ) ; sPara . indicatieNamenreeks ( false ) ; final nl . bzk . brp . bijhouding . bericht . model . AdministratieveHandelingElement ah = createAdministratieveHandelingRegistratieGeborene ( 20100101 , sPara , "0001" , "Karel<sp>appel" , "Stam" , "10" , "2" , null , null , null , null , null , null , null ) ; final java . util . List < nl . bzk . brp . bijhouding . bericht . model . MeldingElement > meldingen = ah . valideerInhoud ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) ) |
test_size_4 ( ) { org . trie4j . Trie t = trieWithWords ( "hello" , "helicoptor" , "world" , "hel" ) ; "<AssertPlaceHolder>" ; } size ( ) { return orig . size ( ) ; } | org . junit . Assert . assertEquals ( 4 , t . size ( ) ) |
test ( ) { com . arjuna . ats . internal . jts . utils . TxStoreLog log = new com . arjuna . ats . internal . jts . utils . TxStoreLog ( ) ; com . arjuna . ats . arjuna . state . InputObjectState is = new com . arjuna . ats . arjuna . state . InputObjectState ( ) ; "<AssertPlaceHolder>" ; } getTransactions ( com . arjuna . ats . arjuna . state . InputObjectState ) { return com . arjuna . ats . internal . jts . utils . TxStoreLog . getTransactions ( os , StateStatus . OS_UNKNOWN ) ; } | org . junit . Assert . assertTrue ( com . arjuna . ats . internal . jts . utils . TxStoreLog . getTransactions ( is ) ) |
noErrorOnJSExecutionBeforeDetach ( ) { open ( ) ; findElement ( org . openqa . selenium . By . tagName ( "button" ) ) . click ( ) ; waitUntil ( ( driver ) -> ! ( isElementPresent ( org . openqa . selenium . By . className ( "v-system-error" ) ) ) ) ; "<AssertPlaceHolder>" ; } isElementPresent ( org . openqa . selenium . By ) { try { org . openqa . selenium . WebElement element = getDriver ( ) . findElement ( by ) ; return element != null ; } catch ( java . lang . Exception e ) { return false ; } } | org . junit . Assert . assertFalse ( isElementPresent ( org . openqa . selenium . By . className ( "v-system-error" ) ) ) |
testIndexForNodes ( ) { org . neo4j . rest . graphdb . index . RestIndexManager index = ( ( org . neo4j . rest . graphdb . index . RestIndexManager ) ( getRestGraphDb ( ) . index ( ) ) ) ; org . neo4j . graphdb . index . Index < org . neo4j . graphdb . Node > testIndex = index . forNodes ( "indexName" ) ; "<AssertPlaceHolder>" ; } existsForNodes ( java . lang . String ) { return indexInfo ( org . neo4j . rest . graphdb . index . RestIndexManager . NODE ) . exists ( indexName ) ; } | org . junit . Assert . assertTrue ( index . existsForNodes ( "indexName" ) ) |
testGetPayloadReturnsNullIfTheQueryResponseMessageDidNotContainAnyPayload ( ) { org . axonframework . queryhandling . QueryResponseMessage < org . axonframework . axonserver . connector . query . GrpcBackedResponseMessageTest . TestQueryResponse > testQueryResponseMessage = org . axonframework . queryhandling . GenericQueryResponseMessage . asResponseMessage ( org . axonframework . axonserver . connector . query . GrpcBackedResponseMessageTest . TestQueryResponse . class , new java . lang . IllegalArgumentException ( "some-exception" ) ) ; io . axoniq . axonserver . grpc . query . QueryResponse testQueryResponse = querySerializer . serializeResponse ( testQueryResponseMessage , org . axonframework . axonserver . connector . query . GrpcBackedResponseMessageTest . REQUEST_MESSAGE_ID ) ; org . axonframework . axonserver . connector . query . GrpcBackedResponseMessage < org . axonframework . axonserver . connector . query . GrpcBackedResponseMessageTest . TestQueryResponse > testSubject = new org . axonframework . axonserver . connector . query . GrpcBackedResponseMessage ( testQueryResponse , serializer ) ; "<AssertPlaceHolder>" ; } getPayload ( ) { return new org . axonframework . eventhandling . SimpleSerializedObject ( payload , ( ( java . lang . Class < T > ) ( payload . getClass ( ) ) ) , new org . axonframework . eventhandling . SimpleSerializedType ( payloadType , payloadRevision ) ) ; } | org . junit . Assert . assertNull ( testSubject . getPayload ( ) ) |
testIterator ( ) { java . util . Iterator < java . lang . String > it2 = ch . bfh . unicrypt . helper . array . DenseArrayTest . a2 . iterator ( ) ; java . util . Iterator < java . lang . String > it3 = ch . bfh . unicrypt . helper . array . DenseArrayTest . a3 . iterator ( ) ; while ( it2 . hasNext ( ) ) { "<AssertPlaceHolder>" ; } } next ( ) { if ( ! ( this . hasNext ( ) ) ) { throw new ch . bfh . unicrypt . UniCryptRuntimeException ( ch . bfh . unicrypt . ErrorCode . INVALID_METHOD_CALL , this ) ; } this . updateBefore ( ) ; V result = this . abstractNext ( ) ; this . updateAfter ( ) ; return result ; } | org . junit . Assert . assertEquals ( it2 . next ( ) , it3 . next ( ) ) |
testCreateAndWaitUntilReady ( ) { io . fabric8 . kubernetes . api . model . Pod pod1 = new io . fabric8 . kubernetes . api . model . PodBuilder ( ) . withNewMetadata ( ) . withName ( "pod1" ) . withResourceVersion ( "1" ) . withNamespace ( "test" ) . and ( ) . build ( ) ; io . fabric8 . kubernetes . api . model . Pod noReady = new io . fabric8 . kubernetes . api . model . PodBuilder ( pod1 ) . withNewStatus ( ) . addNewCondition ( ) . withType ( "Ready" ) . withStatus ( "False" ) . endCondition ( ) . endStatus ( ) . build ( ) ; io . fabric8 . kubernetes . api . model . Pod ready = new io . fabric8 . kubernetes . api . model . PodBuilder ( pod1 ) . withNewStatus ( ) . addNewCondition ( ) . withType ( "Ready" ) . withStatus ( "pod1" 1 ) . endCondition ( ) . endStatus ( ) . build ( ) ; server . expect ( ) . get ( ) . withPath ( "/api/v1/namespaces/test/pods/pod1" ) . andReturn ( 200 , noReady ) . times ( 2 ) ; server . expect ( ) . post ( ) . withPath ( "/api/v1/namespaces/test/pods" ) . andReturn ( 201 , noReady ) . once ( ) ; server . expect ( ) . get ( ) . withPath ( "/api/v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1&resourceVersion=1&watch=true" ) . andUpgradeToWebSocket ( ) . open ( ) . waitFor ( 100 ) . andEmit ( new io . fabric8 . kubernetes . api . model . WatchEvent ( ready , "MODIFIED" ) ) . done ( ) . always ( ) ; io . fabric8 . kubernetes . client . KubernetesClient client = server . getClient ( ) ; io . fabric8 . kubernetes . api . model . Pod p = client . resource ( noReady ) . createOrReplaceAnd ( ) . waitUntilReady ( 10 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } isPodReady ( io . fabric8 . kubernetes . api . model . Pod ) { io . fabric8 . kubernetes . client . utils . Utils . checkNotNull ( pod , "Pod<sp>can't<sp>be<sp>null." ) ; io . fabric8 . kubernetes . api . model . PodCondition condition = io . fabric8 . kubernetes . client . internal . readiness . Readiness . getPodReadyCondition ( pod ) ; if ( ( condition == null ) || ( ( condition . getStatus ( ) ) == null ) ) { return false ; } return condition . getStatus ( ) . equalsIgnoreCase ( io . fabric8 . kubernetes . client . internal . readiness . Readiness . TRUE ) ; } | org . junit . Assert . assertTrue ( io . fabric8 . kubernetes . client . internal . readiness . Readiness . isPodReady ( p ) ) |
testGenerateName_withZeroLength ( ) { final java . lang . String result = grammarGenerator . generateName ( 0 ) ; "<AssertPlaceHolder>" ; } generateName ( int ) { if ( length < 2 ) { length = 2 ; } final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; final java . util . concurrent . ThreadLocalRandom rand = java . util . concurrent . ThreadLocalRandom . current ( ) ; while ( ( sb . length ( ) ) < length ) { if ( ( length % 2 ) == 0 ) { sb . append ( vowels [ rand . nextInt ( vowels . length ) ] ) ; } else { sb . append ( consonants [ rand . nextInt ( consonants . length ) ] ) ; } } if ( ( sb . length ( ) ) > length ) { sb . deleteCharAt ( ( ( sb . length ( ) ) - ( ( sb . length ( ) ) - length ) ) ) ; } return capitalizeFirstCharacter ( sb . toString ( ) ) ; } | org . junit . Assert . assertEquals ( 2 , result . length ( ) ) |
testPatternMatches ( ) { final org . apache . logging . log4j . core . time . internal . format . DateParser parser = getInstance ( org . apache . logging . log4j . core . time . internal . format . FastDateParserTest . yMdHmsSZ ) ; "<AssertPlaceHolder>" ; } getPattern ( ) { return pattern ; } | org . junit . Assert . assertEquals ( org . apache . logging . log4j . core . time . internal . format . FastDateParserTest . yMdHmsSZ , parser . getPattern ( ) ) |
shouldReturnFalseIfOtherVersionIsNull ( ) { com . github . zafarkhaja . semver . Version v1 = com . github . zafarkhaja . semver . Version . valueOf ( "2.3.7" ) ; com . github . zafarkhaja . semver . Version v2 = null ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == other ) { return true ; } if ( ! ( other instanceof com . github . zafarkhaja . semver . Version ) ) { return false ; } return ( compareTo ( ( ( com . github . zafarkhaja . semver . Version ) ( other ) ) ) ) == 0 ; } | org . junit . Assert . assertFalse ( v1 . equals ( v2 ) ) |
assertGetURLForColumnIndex ( ) { for ( java . sql . ResultSet each : resultSets . values ( ) ) { try { each . getURL ( 1 ) ; 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 ( ) ) |
isExpandedReturnsTrueForTrueSetting ( ) { this . parameters . put ( "expanded_by_default" , "true" ) ; org . phenotips . configuration . RecordSection s = new org . phenotips . configuration . spi . UIXRecordSection ( this . uiExtension , this . uixManager , this . orderFilter ) ; "<AssertPlaceHolder>" ; } isExpandedByDefault ( ) { return this . expanded ; } | org . junit . Assert . assertTrue ( s . isExpandedByDefault ( ) ) |
testCallableElement ( ) { org . camunda . bpm . engine . impl . cmmn . model . CmmnActivity activity = handler . handleElement ( planItem , context ) ; org . camunda . bpm . engine . impl . cmmn . behavior . DecisionTaskActivityBehavior behavior = ( ( org . camunda . bpm . engine . impl . cmmn . behavior . DecisionTaskActivityBehavior ) ( activity . getActivityBehavior ( ) ) ) ; "<AssertPlaceHolder>" ; } getCallableElement ( ) { return ( ( org . camunda . bpm . engine . impl . core . model . CallableElement ) ( callableElement ) ) ; } | org . junit . Assert . assertNotNull ( behavior . getCallableElement ( ) ) |
shouldDisplayImageHistory ( ) { final javax . ws . rs . core . Response response = getAsycResponse ( target ( "images" ) . path ( "ubuntu:latest" ) . path ( "history" ) ) ; System . out . println ( response ) ; "<AssertPlaceHolder>" ; final javax . json . JsonArray responseContent = response . readEntity ( javax . json . JsonArray . class ) ; } getAsycResponse ( javax . ws . rs . client . WebTarget ) { return com . kodcu . rapid . util . Networking . getAsycResponse ( target ) ; } | org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) ) |
apply_FinishEarlyTest ( ) { final java . util . List < org . openscience . cdk . group . Permutation > all = new java . util . ArrayList < org . openscience . cdk . group . Permutation > ( ) ; final int max = 5 ; int size = 4 ; org . openscience . cdk . group . PermutationGroup group = org . openscience . cdk . group . PermutationGroup . makeSymN ( size ) ; group . apply ( new org . openscience . cdk . group . PermutationGroup . Backtracker ( ) { @ org . openscience . cdk . group . Override public boolean isFinished ( ) { return ( all . size ( ) ) >= max ; } @ org . openscience . cdk . group . Override public void applyTo ( org . openscience . cdk . group . Permutation p ) { all . add ( p ) ; } } ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; } | org . junit . Assert . assertEquals ( max , all . size ( ) ) |
CallInstanceMethodIndirect_StaticMethodInstanceMethod ( ) { java . lang . String fromClass = "domain.indirect.violatingfrom.CallInstanceMethodIndirect_StaticMethodInstanceMethod" ; java . lang . String toClass = "domain.indirect.indirectto.ServiceOne" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Call" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , boolean ) { return areDependencyTypesDetected ( classFrom , classTo , dependencyTypes , "" , isIndirect ) ; } | org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , true ) ) |
lessThanEqualIsNullInput ( ) { when ( corc . getWritable ( com . hotels . corc . sarg . LessThanEvaluatorTest . COL0 ) ) . thenReturn ( null ) ; evaluator = new com . hotels . corc . sarg . LessThanEvaluator ( com . hotels . corc . sarg . LessThanEvaluatorTest . COL0 , com . hotels . corc . sarg . LessThanEvaluatorTest . ONE , org . apache . hadoop . hive . ql . io . sarg . PredicateLeaf . Operator . LESS_THAN_EQUALS ) ; "<AssertPlaceHolder>" ; } evaluate ( T extends org . apache . hadoop . io . WritableComparable ) { if ( value == null ) { return org . apache . hadoop . hive . ql . io . sarg . SearchArgument . TruthValue . NULL ; } if ( ( literal . compareTo ( value ) ) > ( threshold ) ) { return org . apache . hadoop . hive . ql . io . sarg . SearchArgument . TruthValue . YES ; } return org . apache . hadoop . hive . ql . io . sarg . SearchArgument . TruthValue . NO ; } | org . junit . Assert . assertThat ( evaluator . evaluate ( corc ) , org . hamcrest . CoreMatchers . is ( TruthValue . NULL ) ) |
testSetManagedParentUnmanaged ( ) { destination = new flex . messaging . MessageDestination ( ) ; destination . setManaged ( false ) ; destination . setAdapter ( adapter ) ; adapter . setManaged ( true ) ; boolean managed = adapter . isManaged ( ) ; "<AssertPlaceHolder>" ; } isManaged ( ) { return false ; } | org . junit . Assert . assertFalse ( managed ) |
test14 ( ) { cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . bigint . BigInteger > a = cc . redberry . rings . poly . univar . UnivariatePolynomial . create ( ( - 1 ) , 0 , 4 ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . bigint . BigInteger > b = cc . redberry . rings . poly . univar . UnivariatePolynomial . create ( 1 , ( - 5 ) , 6 ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . bigint . BigInteger > gcd = ModularGCD ( a , b ) ; "<AssertPlaceHolder>" ; } create ( cc . redberry . rings . poly . univar . Ring , E [ ] ) { ring . setToValueOf ( data ) ; return new cc . redberry . rings . poly . univar . UnivariatePolynomial ( ring , data ) ; } | org . junit . Assert . assertEquals ( cc . redberry . rings . poly . univar . UnivariatePolynomial . create ( ( - 1 ) , 2 ) , gcd ) |
testSetOutputNull ( ) { javax . imageio . ImageWriter writer = createImageWriter ( ) ; "<AssertPlaceHolder>" ; writer . setOutput ( null ) ; } createImageWriter ( ) { return new com . twelvemonkeys . imageio . plugins . tiff . TIFFImageWriter ( com . twelvemonkeys . imageio . plugins . tiff . TIFFImageWriterTest . PROVIDER ) ; } | org . junit . Assert . assertNotNull ( writer ) |
testAggregateGroupingSetDuplicateIgnored ( ) { final org . apache . calcite . tools . RelBuilder builder = org . apache . calcite . tools . RelBuilder . create ( org . apache . calcite . test . RelBuilderTest . config ( ) . build ( ) ) ; org . apache . calcite . rel . RelNode root = builder . scan ( "EMP" ) . aggregate ( builder . groupKey ( org . apache . calcite . util . ImmutableBitSet . of ( 7 , 6 ) , com . google . common . collect . ImmutableList . of ( org . apache . calcite . util . ImmutableBitSet . of ( 7 ) , org . apache . calcite . util . ImmutableBitSet . of ( 6 ) , org . apache . calcite . util . ImmutableBitSet . of ( 7 ) ) ) ) . build ( ) ; final java . lang . String expected = "" + ( "LogicalAggregate(group=[{6,<sp>7}],<sp>groups=[[{6},<sp>{7}]])\n" + "<sp>LogicalTableScan(table=[[scott,<sp>EMP]])\n" ) ; "<AssertPlaceHolder>" ; } hasTree ( java . lang . String ) { return org . apache . calcite . test . Matchers . compose ( org . hamcrest . core . Is . is ( value ) , ( input ) -> { return org . apache . calcite . util . Util . toLinux ( org . apache . calcite . plan . RelOptUtil . toString ( input ) ) ; } ) ; } | org . junit . Assert . assertThat ( root , org . apache . calcite . test . Matchers . hasTree ( expected ) ) |
testNewMultimapWith ( ) { org . eclipse . collections . api . tuple . Pair < java . lang . Integer , java . lang . String > pair1 = org . eclipse . collections . impl . tuple . Tuples . pair ( 1 , "One" ) ; org . eclipse . collections . api . tuple . Pair < java . lang . Integer , java . lang . String > pair2 = org . eclipse . collections . impl . tuple . Tuples . pair ( 2 , "Two" ) ; org . eclipse . collections . api . tuple . Pair < java . lang . Integer , java . lang . String > pair3 = org . eclipse . collections . impl . tuple . Tuples . pair ( 3 , "Three" ) ; org . eclipse . collections . api . tuple . Pair < java . lang . Integer , java . lang . String > pair4 = org . eclipse . collections . impl . tuple . Tuples . pair ( 4 , "Four" ) ; org . eclipse . collections . api . list . ListIterable < org . eclipse . collections . api . tuple . Pair < java . lang . Integer , java . lang . String > > pairs = org . eclipse . collections . impl . list . mutable . FastList . newListWith ( pair1 , pair2 , pair3 , pair4 ) ; org . eclipse . collections . api . multimap . Multimap < java . lang . Integer , java . lang . String > expected = this . newMultimap ( pair1 , pair2 , pair3 , pair4 ) ; org . eclipse . collections . api . multimap . Multimap < java . lang . Integer , java . lang . String > actual = this . newMultimapFromPairs ( pairs ) ; "<AssertPlaceHolder>" ; } newMultimapFromPairs ( java . lang . Iterable ) { return org . eclipse . collections . impl . multimap . bag . strategy . HashBagMultimapWithHashingStrategy . newMultimap ( org . eclipse . collections . impl . block . factory . HashingStrategies . defaultStrategy ( ) , inputIterable ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
shouldBeRequiredIfHasNotNullMetaAnnotation ( ) { org . springframework . springfaces . template . ui . ComponentInfo info = getComponentInfoForBeanValue ( "notBlank" ) ; "<AssertPlaceHolder>" ; } isRequired ( ) { for ( javax . faces . component . UIComponent component : this . components ) { if ( isRequired ( component ) ) { return true ; } } return false ; } | org . junit . Assert . assertThat ( info . isRequired ( ) , org . hamcrest . Matchers . is ( true ) ) |
testClosePartitions_topicNotPublished ( ) { com . taobao . metamorphosis . server . utils . MetaConfig metaConfig = new com . taobao . metamorphosis . server . utils . MetaConfig ( ) ; metaConfig . closePartitions ( "topic1" , 1 , 2 ) ; "<AssertPlaceHolder>" ; } isClosedPartition ( java . lang . String , int ) { final java . util . Set < java . lang . Integer > closedPartitions = this . closedPartitionMap . get ( topic ) ; return closedPartitions == null ? false : closedPartitions . contains ( partition ) ; } | org . junit . Assert . assertFalse ( metaConfig . isClosedPartition ( "topic1" , 1 ) ) |
testBigDecimalComparison ( ) { java . lang . String str = "import<sp>org.drools.compiler.Person;\n" + ( ( ( ( ( "rule<sp>\"Big<sp>Decimal<sp>Comparison\"\n" + "<sp>dialect<sp>\"mvel\"\n" ) + "when\n" ) + "<sp>Person(<sp>bigDecimal<sp>==<sp>0.0B<sp>)\n" ) + "then\n" ) + "end" ) ; org . kie . api . KieBase kbase = loadKnowledgeBaseFromString ( str ) ; final org . kie . api . runtime . KieSession ksession = kbase . newKieSession ( ) ; org . drools . compiler . Person p = new org . drools . compiler . Person ( "Mario" , 38 ) ; p . setBigDecimal ( new java . math . BigDecimal ( "0" ) ) ; ksession . insert ( p ) ; "<AssertPlaceHolder>" ; ksession . dispose ( ) ; } fireAllRules ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 1 , ksession . fireAllRules ( ) ) |
testMdlLegacyImport ( ) { compile ( "modules/legacyimport/module.ceylon" , "modules/legacyimport/package.ceylon" , "modules/legacyimport/A.ceylon" ) ; java . io . File carFile = getModuleArchive ( "org.eclipse.ceylon.compiler.java.test.cmr.modules.legacyimport" , "6.6.6" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( carFile . exists ( ) ) |
writeJSONWithNonNamedSpecificityDoesNothing ( ) { when ( this . patient . getData ( "specificity" ) ) . thenReturn ( new org . phenotips . data . IndexedPatientData ( "specificity" , java . util . Collections . < java . lang . Object > singletonList ( 0.25 ) ) ) ; org . json . JSONObject json = new org . json . JSONObject ( ) ; this . mocker . getComponentUnderTest ( ) . writeJSON ( this . patient , json ) ; "<AssertPlaceHolder>" ; } writeJSON ( org . phenotips . data . Patient , org . json . JSONObject ) { final org . phenotips . data . PatientData < org . apache . commons . lang3 . tuple . Pair < java . lang . String , java . lang . String > > identifiers = patient . getData ( org . phenotips . data . internal . controller . LabeledExternalIdentifiersController . IDENTIFIERS_STRING ) ; final org . json . JSONArray eidsJSON = ( ( ( identifiers != null ) && ( identifiers . isIndexed ( ) ) ) && ( ( identifiers . size ( ) ) > 0 ) ) ? toJSON ( identifiers ) : null ; json . putOpt ( org . phenotips . data . internal . controller . LabeledExternalIdentifiersController . IDENTIFIERS_STRING , eidsJSON ) ; } | org . junit . Assert . assertEquals ( 0 , json . length ( ) ) |
testValueOfRoot ( ) { org . onosproject . net . resource . DiscreteResource resource = Resource . ROOT ; "<AssertPlaceHolder>" ; } valueAs ( java . lang . Class ) { checkNotNull ( type ) ; if ( ( ( type == ( java . lang . Object . class ) ) || ( type == ( double . class ) ) ) || ( type == ( org . onosproject . net . resource . Double . class ) ) ) { @ org . onosproject . net . resource . SuppressWarnings ( "unchecked" ) T value = ( ( T ) ( java . lang . Double . valueOf ( this . value ) ) ) ; return java . util . Optional . of ( value ) ; } return java . util . Optional . empty ( ) ; } | org . junit . Assert . assertThat ( resource . valueAs ( java . lang . Object . class ) , org . hamcrest . Matchers . is ( java . util . Optional . empty ( ) ) ) |
testTruncDecimalColumnNegativeGreaterThanPrecision ( ) { java . lang . String sqlText = java . lang . String . format ( "select<sp>trunc(n,<sp>-5),<sp>n<sp>from<sp>%s" , com . splicemachine . derby . impl . sql . execute . operations . TruncateFunctionIT . QUALIFIED_TABLE_NAME ) ; java . sql . ResultSet rs = com . splicemachine . derby . impl . sql . execute . operations . TruncateFunctionIT . spliceClassWatcher . executeQuery ( sqlText ) ; java . lang . String expected = "1<sp>|<sp>N<sp>|\n" + ( "---------------------\n" + "0E-7<sp>|12345.6789000<sp>|" ) ; "<AssertPlaceHolder>" ; rs . close ( ) ; } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; } | org . junit . Assert . assertEquals ( ( ( "\n" + sqlText ) + "\n" ) , expected , TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) ) |
shouldAddArgument ( ) { com . oracle . bedrock . runtime . options . Arguments arguments = com . oracle . bedrock . runtime . options . Arguments . empty ( ) . with ( com . oracle . bedrock . runtime . options . Argument . of ( "foo" ) ) ; "<AssertPlaceHolder>" ; } resolve ( com . oracle . bedrock . runtime . Platform , com . oracle . bedrock . OptionsByType ) { com . oracle . bedrock . lang . ExpressionEvaluator evaluator = new com . oracle . bedrock . lang . ExpressionEvaluator ( optionsByType ) ; java . util . Properties properties = new java . util . Properties ( ) ; for ( com . oracle . bedrock . runtime . java . options . SystemProperty property : this . properties . values ( ) ) { java . lang . String name = property . getName ( ) ; java . lang . Object value = property . getValue ( ) ; if ( value != null ) { if ( value instanceof com . oracle . bedrock . runtime . java . options . SystemProperty . ContextSensitiveValue ) { com . oracle . bedrock . runtime . java . options . SystemProperty . ContextSensitiveValue contextSensitiveValue = ( ( com . oracle . bedrock . runtime . java . options . SystemProperty . ContextSensitiveValue ) ( value ) ) ; value = contextSensitiveValue . resolve ( name , platform , optionsByType ) ; } if ( value instanceof java . util . Iterator < ? > ) { java . util . Iterator < ? > iterator = ( ( java . util . Iterator < ? > ) ( value ) ) ; if ( iterator . hasNext ( ) ) { value = iterator . next ( ) . toString ( ) ; } else { throw new java . lang . IndexOutOfBoundsException ( java . lang . String . format ( "No<sp>more<sp>values<sp>available<sp>for<sp>the<sp>property<sp>[%s]" , name ) ) ; } } if ( value != null ) { java . lang . String expression = value . toString ( ) . trim ( ) ; if ( ! ( expression . isEmpty ( ) ) ) { java . lang . Object result = evaluator . evaluate ( expression , java . lang . Object . class ) ; expression = ( result == null ) ? "" : result . toString ( ) ; } com . oracle . bedrock . OptionsByType propertyOptions = property . getOptions ( ) ; java . lang . Iterable < com . oracle . bedrock . runtime . java . options . SystemProperty . ResolveHandler > handlers = propertyOptions . getInstancesOf ( SystemProperty . ResolveHandler . class ) ; for ( com . oracle . bedrock . runtime . java . options . SystemProperty . ResolveHandler handler : handlers ) { try { handler . onResolve ( name , expression , optionsByType ) ; } catch ( java . lang . Throwable t ) { t . printStackTrace ( ) ; } } properties . put ( name , expression ) ; } } } return properties ; } | org . junit . Assert . assertThat ( arguments . resolve ( null , null ) , contains ( "foo" ) ) |
testJoinSingleElement ( ) { java . util . Set < java . lang . String > elements = new java . util . LinkedHashSet ( ) ; java . lang . String separator = "," ; elements . add ( "world" ) ; java . lang . String join = com . erudika . para . utils . filters . CORSFilter . join ( elements , separator ) ; "<AssertPlaceHolder>" ; } join ( java . util . Collection , java . lang . String ) { java . lang . String separator = "," ; if ( elements == null ) { return null ; } if ( joinSeparator != null ) { separator = joinSeparator ; } java . lang . StringBuilder buffer = new java . lang . StringBuilder ( ) ; boolean isFirst = true ; for ( java . lang . String element : elements ) { if ( ! isFirst ) { buffer . append ( separator ) ; } else { isFirst = false ; } if ( element != null ) { buffer . append ( element ) ; } } return buffer . toString ( ) ; } | org . junit . Assert . assertTrue ( "world" . equals ( join ) ) |
testIssue64 ( ) { java . lang . String pattern = "(?<message>client<sp>id):<sp>(?<clientid>.*)" ; java . lang . String input = "client<sp>id:<sp>\"name\"<sp>\"Mac<sp>OS<sp>X<sp>Mail\"<sp>\"version\"<sp>\"10.2<sp>(3259)\"<sp>\"os\"<sp>\"Mac<sp>OS<sp>X\"" + "\"os-version\"<sp>\"10.12.3<sp>(16D32)\"<sp>\"vendor\"<sp>\"Apple<sp>Inc.\"" ; java . util . regex . Pattern javaPattern = java . util . regex . Pattern . compile ( pattern ) ; java . util . regex . Matcher javaMatcher = javaPattern . matcher ( input ) ; if ( javaMatcher . matches ( ) ) { System . out . println ( javaMatcher . group ( "clientid" ) ) ; } io . krakens . grok . api . GrokCompiler grokCompiler = io . krakens . grok . api . GrokCompiler . newInstance ( ) ; grokCompiler . registerDefaultPatterns ( ) ; io . krakens . grok . api . io . krakens . grok . api . Grok grok = grokCompiler . compile ( pattern , true ) ; io . krakens . grok . api . Match gm = grok . match ( input ) ; java . util . Map < java . lang . String , java . lang . Object > captures = gm . capture ( ) ; "<AssertPlaceHolder>" ; } getMatch ( ) { return match ; } | org . junit . Assert . assertEquals ( captures . get ( "clientid" ) , gm . getMatch ( ) . group ( "clientid" ) ) |
testZeroRowResult ( ) { java . sql . Statement st = con . createStatement ( ResultSet . TYPE_SCROLL_INSENSITIVE , ResultSet . CONCUR_UPDATABLE ) ; java . sql . ResultSet rs = st . executeQuery ( "select<sp>*<sp>from<sp>updatable<sp>WHERE<sp>0<sp>><sp>1" ) ; "<AssertPlaceHolder>" ; rs . moveToInsertRow ( ) ; rs . moveToCurrentRow ( ) ; rs . close ( ) ; st . close ( ) ; } next ( ) { return relative ( 1 ) ; } | org . junit . Assert . assertTrue ( ( ! ( rs . next ( ) ) ) ) |
toBigDecimal_Null ( ) { software . amazon . awssdk . services . dynamodb . document . Item item = new software . amazon . awssdk . services . dynamodb . document . Item ( ) ; "<AssertPlaceHolder>" ; } getNumber ( java . lang . String ) { java . lang . Object val = attributes . get ( attrName ) ; return toBigDecimal ( val ) ; } | org . junit . Assert . assertNull ( item . getNumber ( "test" ) ) |
givenObservable_whenUsing_thenReturnCreatedResource ( ) { rx . Observable < java . lang . Character > values = rx . Observable . using ( ( ) -> "resource" , ( r ) -> rx . Observable . create ( ( o ) -> { for ( java . lang . Character c : r . toCharArray ( ) ) { o . onNext ( c ) ; } o . onCompleted ( ) ; } ) , ( r ) -> System . out . println ( ( "Disposed:<sp>" + r ) ) ) ; values . subscribe ( ( v ) -> result += v , ( e ) -> result += e ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof com . baeldung . jackson . entities . MyPair ) ) { return false ; } com . baeldung . jackson . entities . MyPair other = ( ( com . baeldung . jackson . entities . MyPair ) ( obj ) ) ; if ( ( first ) == null ) { if ( ( other . first ) != null ) { return false ; } } else if ( ! ( first . equals ( other . first ) ) ) { return false ; } if ( ( second ) == null ) { if ( ( other . second ) != null ) { return false ; } } else if ( ! ( second . equals ( other . second ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( result . equals ( "resource" ) ) |
testGetBuilder ( ) { "<AssertPlaceHolder>" ; objJPAEdmPropertyTest = new com . sap . core . odata . processor . core . jpa . model . JPAEdmPropertyTest ( ) ; objJPAEdmProperty = new com . sap . core . odata . processor . core . jpa . model . JPAEdmProperty ( objJPAEdmPropertyTest , objJPAEdmPropertyTest ) ; try { objJPAEdmProperty . getBuilder ( ) . build ( ) ; } catch ( com . sap . core . odata . processor . api . jpa . exception . ODataJPAModelException e ) { org . junit . Assert . fail ( ( ( ( com . sap . core . odata . processor . core . jpa . common . ODataJPATestConstants . EXCEPTION_MSG_PART_1 ) + ( e . getMessage ( ) ) ) + ( com . sap . core . odata . processor . core . jpa . common . ODataJPATestConstants . EXCEPTION_MSG_PART_2 ) ) ) ; } catch ( com . sap . core . odata . processor . api . jpa . exception . ODataJPARuntimeException e ) { org . junit . Assert . fail ( ( ( ( com . sap . core . odata . processor . core . jpa . common . ODataJPATestConstants . EXCEPTION_MSG_PART_1 ) + ( e . getMessage ( ) ) ) + ( com . sap . core . odata . processor . core . jpa . common . ODataJPATestConstants . EXCEPTION_MSG_PART_2 ) ) ) ; } } getBuilder ( ) { if ( ( builder ) == null ) { builder = new com . sap . core . odata . processor . core . jpa . model . JPAEdmReferentialConstraint . JPAEdmRefConstraintBuilder ( ) ; } return builder ; } | org . junit . Assert . assertNotNull ( objJPAEdmProperty . getBuilder ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.