input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testNonNormalizedURIs ( ) { org . eclipse . emf . ecore . resource . ResourceSet resourceSet = new org . eclipse . xtext . resource . XtextResourceSet ( ) ; parser . parse ( "B" , org . eclipse . emf . common . util . URI . createURI ( ( "a." + ( parser . fileExtension ) ) ) , resourceSet ) ; parser . parse ( "B" , org . eclipse . emf . common . util . URI . createURI ( ( "b." + ( parser . fileExtension ) ) ) , resourceSet ) ; org . eclipse . xtext . resource . IResourceDescriptions index = descriptionsProvider . getResourceDescriptions ( resourceSet ) ; org . eclipse . xtext . resource . IResourceDescription rd = index . getResourceDescription ( org . eclipse . emf . common . util . URI . createURI ( ( "a." + ( parser . fileExtension ) ) ) ) ; java . util . List < org . eclipse . xtext . resource . IContainer > containers = containerManager . getVisibleContainers ( rd , index ) ; java . util . List < org . eclipse . xtext . resource . IEObjectDescription > objects = com . google . common . collect . Lists . newArrayList ( ) ; org . eclipse . emf . ecore . EClass type = ( ( org . eclipse . emf . ecore . EClass ) ( grammarAccess . getGrammar ( ) . getRules ( ) . get ( 0 ) . getType ( ) . getClassifier ( ) ) ) ; for ( org . eclipse . xtext . resource . IContainer container : containers ) com . google . common . collect . Iterables . addAll ( objects , container . getExportedObjects ( type , org . eclipse . xtext . naming . QualifiedName . create ( "B" ) , false ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return modules . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , objects . size ( ) )
|
getValueMessage ( ) { org . openhab . binding . zwave . internal . protocol . commandclass . ZWavePowerLevelCommandClass cls = ( ( org . openhab . binding . zwave . internal . protocol . commandclass . ZWavePowerLevelCommandClass ) ( getCommandClass ( CommandClass . COMMAND_CLASS_POWERLEVEL ) ) ) ; org . openhab . binding . zwave . internal . protocol . transaction . ZWaveCommandClassTransactionPayload msg ; byte [ ] expectedResponseV1 = new byte [ ] { 115 , 2 } ; cls . setVersion ( 1 ) ; msg = cls . getValueMessage ( ) ; "<AssertPlaceHolder>" ; } getPayloadBuffer ( ) { return payload ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( msg . getPayloadBuffer ( ) , expectedResponseV1 ) )
|
isNewReceiptNotRequiredTestQuantity ( ) { final de . metas . inoutcandidate . model . I_M_ReceiptSchedule previousReceiptSchedule = createReceiptSchedule ( bpartner1 , warehouse1 , date , product1_wh1 , 10 ) ; final de . metas . inoutcandidate . model . I_M_ReceiptSchedule receiptSchedule = createReceiptSchedule ( bpartner1 , warehouse1 , date , product1_wh1 , 20 ) ; final boolean isNewRequired = inOutProducer . isNewReceiptRequired ( previousReceiptSchedule , receiptSchedule ) ; "<AssertPlaceHolder>" ; } isNewReceiptRequired ( de . metas . inoutcandidate . model . I_M_ReceiptSchedule , de . metas . inoutcandidate . model . I_M_ReceiptSchedule ) { de . metas . util . Check . assumeNotNull ( previousReceiptSchedule , "previousReceiptSchedule<sp>not<sp>null" ) ; de . metas . util . Check . assumeNotNull ( receiptSchedule , "receiptSchedule<sp>not<sp>null" ) ; if ( ! ( headerAggregationKeyBuilder . isSame ( previousReceiptSchedule , receiptSchedule ) ) ) { return true ; } if ( ( previousReceiptSchedule . getC_Order_ID ( ) ) != ( receiptSchedule . getC_Order_ID ( ) ) ) { return true ; } return false ; }
|
org . junit . Assert . assertFalse ( isNewRequired )
|
testLogout ( ) { org . openiot . security . client . AccessControlUtil accessControlUtil = org . openiot . security . client . AccessControlUtil . getRestInstance ( ) ; accessControlUtil . login ( "admin" , "secret" ) ; accessControlUtil . logout ( ) ; "<AssertPlaceHolder>" ; } logout ( ) { org . apache . shiro . subject . Subject subject = org . apache . shiro . SecurityUtils . getSubject ( ) ; if ( subject . isAuthenticated ( ) ) { subject . logout ( ) ; } reset ( ) ; }
|
org . junit . Assert . assertFalse ( org . apache . shiro . SecurityUtils . getSubject ( ) . isAuthenticated ( ) )
|
testToUda_Null ( ) { "<AssertPlaceHolder>" ; } toUda ( org . oscm . internal . vo . VOUda ) { if ( voUda == null ) { return null ; } org . oscm . domobjects . Uda uda = new org . oscm . domobjects . Uda ( ) ; org . oscm . accountservice . assembler . UdaAssembler . copyAttributes ( voUda , uda ) ; return uda ; }
|
org . junit . Assert . assertNull ( org . oscm . accountservice . assembler . UdaAssembler . toUda ( null ) )
|
loadProfilesFromClasspath ( ) { java . util . List < com . optimaize . langdetect . profiles . LanguageProfile > result = new com . optimaize . langdetect . profiles . LanguageProfileReader ( ) . read ( this . getClass ( ) . getClassLoader ( ) , "languages" , com . google . common . collect . ImmutableList . of ( "en" , "fr" , "nl" , "de" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { org . junit . Assert . assertEquals ( com . optimaize . langdetect . NgramFrequencyDataTest . allThreeGrams . getLanguageList ( ) . size ( ) , 71 ) ; }
|
org . junit . Assert . assertEquals ( result . size ( ) , 4 )
|
testContainObjectId ( ) { org . o3project . odenos . remoteobject . RemoteObject mockLocalObject = org . mockito . Mockito . mock ( org . o3project . odenos . remoteobject . RemoteObject . class ) ; org . mockito . Mockito . when ( mockLocalObject . getObjectId ( ) ) . thenReturn ( "object1" ) ; java . util . concurrent . ConcurrentHashMap < java . lang . String , org . o3project . odenos . remoteobject . RemoteObject > localObjectsMap = org . powermock . reflect . Whitebox . getInternalState ( target , "localObjectsMap" ) ; localObjectsMap . put ( "object1" , mockLocalObject ) ; "<AssertPlaceHolder>" ; } containObjectId ( java . lang . String ) { return localObjectsMap . containsKey ( objectId ) ; }
|
org . junit . Assert . assertTrue ( target . containObjectId ( "object1" ) )
|
testDecoratedElementsShouldBeUnwrapped ( ) { final org . openqa . selenium . remote . RemoteWebElement element = new org . openqa . selenium . remote . RemoteWebElement ( ) ; element . setId ( "foo" ) ; org . openqa . selenium . WebDriver driver = new org . openqa . selenium . StubDriver ( ) { @ org . openqa . selenium . v1 . support . Override public org . openqa . selenium . WebElement findElement ( org . openqa . selenium . By by ) { return element ; } } ; org . openqa . selenium . v1 . support . DecoratedWebElementTest . PublicPage page = new org . openqa . selenium . v1 . support . DecoratedWebElementTest . PublicPage ( ) ; org . openqa . selenium . support . PageFactory . initElements ( driver , page ) ; java . lang . Object seen = new org . openqa . selenium . remote . internal . WebElementToJsonConverter ( ) . apply ( page . element ) ; java . lang . Object expected = new org . openqa . selenium . remote . internal . WebElementToJsonConverter ( ) . apply ( element ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Object ) { return ! ( proxy . isDown ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , seen )
|
testRetrieve ( ) { accessor . add ( file , org . apache . commons . io . IOUtils . toInputStream ( ee . shy . storage . FileAccessorTest . TEST_STRING ) ) ; checkFile ( file ) ; "<AssertPlaceHolder>" ; } get ( java . nio . file . Path ) { try { return java . nio . file . Files . newInputStream ( path ) ; } catch ( java . nio . file . NoSuchFileException e ) { return null ; } }
|
org . junit . Assert . assertEquals ( ee . shy . storage . FileAccessorTest . TEST_STRING , org . apache . commons . io . IOUtils . toString ( accessor . get ( file ) ) )
|
canIterateThroughResults ( ) { java . util . List < java . lang . String > result = createStringListResult ( ) ; int i = 0 ; for ( java . lang . String s : result ) { "<AssertPlaceHolder>" ; ++ i ; } } createStringListResult ( ) { com . microsoft . windowsazure . services . media . models . ListResult < java . lang . String > result = new com . microsoft . windowsazure . services . media . models . ListResult < java . lang . String > ( java . util . Arrays . asList ( expectedStrings ) ) ; return result ; }
|
org . junit . Assert . assertEquals ( expectedStrings [ i ] , s )
|
testDoubleTroubleResolution ( ) { try { org . glassfish . hk2 . tests . locator . justintime . JustInTimeTest . locator . getService ( org . glassfish . hk2 . tests . locator . justintime . DoubleTroubleService . class ) ; org . junit . Assert . fail ( "DoubleTrouble<sp>depends<sp>on<sp>Service2<sp>which<sp>should<sp>not<sp>be<sp>available<sp>yet" ) ; } catch ( org . glassfish . hk2 . api . MultiException me ) { } org . glassfish . hk2 . utilities . ServiceLocatorUtilities . addOneDescriptor ( org . glassfish . hk2 . tests . locator . justintime . JustInTimeTest . locator , org . glassfish . hk2 . utilities . BuilderHelper . link ( org . glassfish . hk2 . tests . locator . justintime . SimpleService3 . class ) . build ( ) ) ; "<AssertPlaceHolder>" ; } getService ( org . glassfish . hk2 . api . ServiceHandle ) { if ( ( root ) instanceof org . jvnet . hk2 . internal . Closeable ) { org . jvnet . hk2 . internal . Closeable closeable = ( ( org . jvnet . hk2 . internal . Closeable ) ( root ) ) ; if ( closeable . isClosed ( ) ) { throw new java . lang . IllegalStateException ( ( "This<sp>service<sp>has<sp>been<sp>unbound:<sp>" + ( root ) ) ) ; } } synchronized ( lock ) { if ( serviceDestroyed ) throw new java . lang . IllegalStateException ( "Service<sp>has<sp>been<sp>disposed" ) ; if ( serviceSet ) return service ; org . glassfish . hk2 . api . Injectee injectee = getLastInjectee ( ) ; java . lang . Class < ? > requiredClass = ( injectee == null ) ? null : org . glassfish . hk2 . utilities . reflection . ReflectionHelper . getRawClass ( injectee . getRequiredType ( ) ) ; service = org . jvnet . hk2 . internal . Utilities . createService ( root , injectee , locator , handle , requiredClass ) ; serviceSet = true ; return service ; } }
|
org . junit . Assert . assertNotNull ( org . glassfish . hk2 . tests . locator . justintime . JustInTimeTest . locator . getService ( org . glassfish . hk2 . tests . locator . justintime . DoubleTroubleService . class ) )
|
testBasicQueryGroupBy ( ) { java . lang . String query = "select<sp>`timestamp`,<sp>sum(`aggregated<sp>value`)<sp>from<sp>openTSDB.`(metric=warp.speed.test,<sp>aggregator=sum,<sp>start=47y-ago)`<sp>group<sp>by<sp>`timestamp`" ; "<AssertPlaceHolder>" ; } testSql ( java . lang . String ) { return org . apache . drill . test . BaseTestQuery . testRunAndPrint ( QueryType . SQL , query ) ; }
|
org . junit . Assert . assertEquals ( 15 , testSql ( query ) )
|
shouldDenyUserDeletionIfCurrentUserIdIsTheSameAsIdInDeletingOne ( ) { java . lang . Long id = 1L ; stubCurrentUserId ( id ) ; stubUserEntityId ( id ) ; boolean canDelete = userModelHooks . preventSelfDeletion ( userDD , user ) ; "<AssertPlaceHolder>" ; } preventSelfDeletion ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { if ( org . apache . commons . lang3 . ObjectUtils . equals ( securityService . getCurrentUserId ( ) , user . getId ( ) ) ) { user . addGlobalError ( com . qcadoo . security . internal . hooks . UserModelHooks . SELF_DELETION_ERROR ) ; return false ; } return true ; }
|
org . junit . Assert . assertFalse ( canDelete )
|
testDeleteUsers_NullStatus ( ) { final java . lang . String instanceId = createService ( ProvisioningStatus . COMPLETED ) ; final java . util . List < org . oscm . provisioning . data . User > users = new java . util . ArrayList ( ) ; final org . oscm . provisioning . data . BaseResult result = new org . oscm . provisioning . data . BaseResult ( ) ; result . setRc ( 1 ) ; doReturn ( result ) . when ( provServiceMock ) . deleteUsers ( instanceId , users , null ) ; org . oscm . provisioning . data . BaseResult ur = runTX ( new java . util . concurrent . Callable < org . oscm . provisioning . data . BaseResult > ( ) { @ org . oscm . app . v2_0 . service . Override public org . oscm . provisioning . data . BaseResult call ( ) { return proxy . deleteUsers ( instanceId , users , null ) ; } } ) ; "<AssertPlaceHolder>" ; verifyZeroInteractions ( provServiceMock ) ; } getRc ( ) { return localRc ; }
|
org . junit . Assert . assertEquals ( 0 , ur . getRc ( ) )
|
should_update_user_create_a_new_icon ( ) { org . bonitasoft . engine . identity . User user = getIdentityAPI ( ) . createUser ( new org . bonitasoft . engine . identity . UserCreator ( "userWithIcon" , "thePassword" ) ) ; org . bonitasoft . engine . identity . User updatedUser = getIdentityAPI ( ) . updateUser ( user . getId ( ) , new org . bonitasoft . engine . identity . UserUpdater ( ) . setIcon ( "myFile.png" , "content" . getBytes ( ) ) ) ; org . bonitasoft . engine . identity . Icon icon = getIdentityAPI ( ) . getIcon ( updatedUser . getIconId ( ) ) ; "<AssertPlaceHolder>" . isEqualTo ( new org . bonitasoft . engine . identity . impl . IconImpl ( icon . getId ( ) , "image/png" , "content" . getBytes ( ) ) ) ; getIdentityAPI ( ) . deleteUser ( "userWithIcon" ) ; } getIconId ( ) { return iconId ; }
|
org . junit . Assert . assertThat ( icon )
|
testSetLineCapWithUnchangeValue ( ) { gc . setLineCap ( SWT . CAP_ROUND ) ; org . eclipse . swt . graphics . ControlGC_Test . getGCAdapter ( gc ) . clearGCOperations ( ) ; gc . setLineCap ( SWT . CAP_ROUND ) ; "<AssertPlaceHolder>" ; } getGCOperations ( org . eclipse . swt . graphics . GC ) { return org . eclipse . swt . graphics . ControlGC_Test . getGCAdapter ( gc ) . getGCOperations ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , org . eclipse . swt . graphics . ControlGC_Test . getGCOperations ( gc ) . length )
|
testValidFixed ( ) { org . apache . drill . exec . record . BatchSchema schema = new org . apache . drill . exec . record . metadata . SchemaBuilder ( ) . add ( "a" , MinorType . INT ) . addNullable ( "b" , MinorType . INT ) . build ( ) ; org . apache . drill . test . rowSet . RowSet . SingleRowSet batch = org . apache . drill . exec . physical . impl . validate . TestBatchValidator . fixture . rowSetBuilder ( schema ) . addRow ( 10 , 100 ) . addRow ( 20 , 120 ) . addRow ( 30 , null ) . addRow ( 40 , 140 ) . build ( ) ; org . apache . drill . exec . physical . impl . validate . BatchValidator validator = new org . apache . drill . exec . physical . impl . validate . BatchValidator ( batch . vectorAccessible ( ) , true ) ; validator . validate ( ) ; "<AssertPlaceHolder>" ; batch . clear ( ) ; } errors ( ) { return errorList ; }
|
org . junit . Assert . assertTrue ( validator . errors ( ) . isEmpty ( ) )
|
getByKey_not_normalized ( ) { final net . ripe . db . whois . common . rpsl . RpslObject rpslObject = net . ripe . db . whois . common . rpsl . RpslObject . parse ( ( "" + ( ( "inet6num:<sp>2001:0658:021A::/48\n" + "netname:<sp>NETNAME\n" ) + "source:<sp>RIPE\n" ) ) ) ; databaseHelper . addObject ( rpslObject ) ; final net . ripe . db . whois . common . rpsl . RpslObject byKey = subject . getByKey ( ObjectType . INET6NUM , "2001:658:21a::/48" ) ; "<AssertPlaceHolder>" ; } getByKey ( net . ripe . db . whois . common . rpsl . ObjectType , net . ripe . db . whois . common . domain . CIString ) { return getByKey ( type , key . toString ( ) ) ; }
|
org . junit . Assert . assertThat ( byKey , org . hamcrest . Matchers . is ( rpslObject ) )
|
shouldReturnCaseSensitiveWhenResultIsNotExtendedJcrQueryResult ( ) { for ( int i = 0 ; i != ( columnNames . length ) ; ++ i ) { "<AssertPlaceHolder>" ; } } isCaseSensitive ( int ) { return provider . getBooleanValue ( adjustColumn ( index ) , ResultsMetadataConstants . CASE_SENSITIVE ) ; }
|
org . junit . Assert . assertThat ( metadata . isCaseSensitive ( ( i + 1 ) ) , org . hamcrest . core . Is . is ( true ) )
|
should_return_true_if_both_Objects_are_null ( ) { "<AssertPlaceHolder>" ; } areEqual ( java . lang . Object , java . lang . Object ) { if ( o1 == null ) { return o2 == null ; } if ( o1 . equals ( o2 ) ) { return true ; } return org . fest . util . Objects . areEqualArrays ( o1 , o2 ) ; }
|
org . junit . Assert . assertTrue ( org . fest . util . Objects . areEqual ( null , null ) )
|
testSGGradientNegative1 ( ) { org . nd4j . linalg . api . ndarray . INDArray syn0 = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) . assign ( 0.01F ) ; org . nd4j . linalg . api . ndarray . INDArray syn1 = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) . assign ( 0.02F ) ; org . nd4j . linalg . api . ndarray . INDArray syn1Neg = org . nd4j . linalg . factory . Nd4j . ones ( 10 , 10 ) . assign ( 0.03F ) ; org . nd4j . linalg . api . ndarray . INDArray expTable = org . nd4j . linalg . factory . Nd4j . create ( 10000 ) . assign ( 0.5F ) ; org . nd4j . linalg . api . ndarray . INDArray table = org . nd4j . linalg . factory . Nd4j . create ( 100000 ) ; double lr = 0.001 ; org . nd4j . linalg . api . ndarray . INDArray expSyn0 = org . nd4j . linalg . factory . Nd4j . create ( 10 ) . assign ( 0.01F ) ; int idxSyn0 = 1 ; log . info ( "syn0row1<sp>after:<sp>{}" , java . util . Arrays . toString ( syn0 . getRow ( idxSyn0 ) . dup ( ) . data ( ) . asFloat ( ) ) ) ; org . nd4j . linalg . api . ops . aggregates . impl . AggregateSkipGram op = new org . nd4j . linalg . api . ops . aggregates . impl . AggregateSkipGram ( syn0 , syn1 , syn1Neg , expTable , table , idxSyn0 , new int [ ] { } , new int [ ] { } , 1 , 3 , 10 , lr , 2L , 10 ) ; lombok . val sg = new org . nd4j . linalg . api . ops . impl . nlp . SkipGramRound ( idxSyn0 , 3 , syn0 , syn1Neg , expTable , table , 1 , lr , 2L , org . nd4j . linalg . factory . Nd4j . empty ( syn0 . dataType ( ) ) ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( sg ) ; log . info ( "syn0row1<sp>after:<sp>{}" , java . util . Arrays . toString ( syn0 . getRow ( idxSyn0 ) . dup ( ) . data ( ) . asFloat ( ) ) ) ; "<AssertPlaceHolder>" ; } getRow ( long ) { if ( ( isRowVector ( ) ) && ( r == 0 ) ) return this ; else if ( ( isRowVector ( ) ) && ( r > 0 ) ) throw new java . lang . IllegalArgumentException ( ( ( ( "Illegal<sp>index<sp>for<sp>row:<sp>requested<sp>row<sp>" + r ) + "<sp>but<sp>this.size(0)=" ) + ( this . size ( 0 ) ) ) ) ; org . nd4j . base . Preconditions . checkArgument ( ( ( rank ( ) ) == 2 ) , "getRow()<sp>can<sp>be<sp>called<sp>on<sp>2D<sp>arrays<sp>only" ) ; org . nd4j . base . Preconditions . checkArgument ( ( r < ( rows ( ) ) ) , "Row<sp>index<sp>must<sp>be<sp>smaller<sp>than<sp>total<sp>number<sp>of<sp>rows" ) ; return tensorAlongDimension ( r , 1 ) ; }
|
org . junit . Assert . assertEquals ( expSyn0 , syn0 . getRow ( idxSyn0 ) )
|
isAllServicesSelected_All ( ) { bean . allServicesSelected = true ; boolean actual = bean . isAllServicesSelected ( ) ; "<AssertPlaceHolder>" ; } isAllServicesSelected ( ) { return allServicesSelected ; }
|
org . junit . Assert . assertEquals ( true , actual )
|
testParseCatalogXML4 ( ) { owltools . io . CatalogXmlIRIMapper m = new owltools . io . CatalogXmlIRIMapper ( "src/test/resources/catalog-v001.xml" ) ; owltools . io . ParserWrapper p = new owltools . io . ParserWrapper ( ) ; p . addIRIMapper ( m ) ; if ( owltools . io . CatalogXmlIRIMapperTest . verbose ) { p . manager . addOntologyLoaderListener ( new owltools . io . CatalogXmlIRIMapperTest . PrintingOntologLoaderListener ( ) ) ; } org . semanticweb . owlapi . model . OWLOntology owlOntology = p . parse ( getResourceIRIString ( "mutual-import-1.owl" ) ) ; "<AssertPlaceHolder>" ; } getResourceIRIString ( java . lang . String ) { return owltools . OWLToolsTestBasics . getResourceIRI ( name ) . toString ( ) ; }
|
org . junit . Assert . assertNotNull ( owlOntology )
|
scroll ( ) { session . save ( new com . querydsl . jpa . domain . Cat ( "Bob" , 10 ) ) ; session . save ( new com . querydsl . jpa . domain . Cat ( "Steve" , 11 ) ) ; com . querydsl . jpa . domain . QCat cat = com . querydsl . jpa . domain . QCat . cat ; com . querydsl . jpa . hibernate . HibernateQuery < ? > query = new com . querydsl . jpa . hibernate . HibernateQuery < java . lang . Void > ( session ) ; org . hibernate . ScrollableResults results = query . from ( cat ) . select ( cat ) . scroll ( ScrollMode . SCROLL_INSENSITIVE ) ; while ( results . next ( ) ) { "<AssertPlaceHolder>" ; } results . close ( ) ; } get ( com . querydsl . sql . RelationalPath ) { return ( ( T ) ( beans . get ( path ) ) ) ; }
|
org . junit . Assert . assertNotNull ( results . get ( 0 ) )
|
shouldMatchIfAllMatch ( ) { org . springframework . springfaces . mvc . navigation . annotation . NavigationMappingFilter f1 = mock ( org . springframework . springfaces . mvc . navigation . annotation . NavigationMappingFilter . class ) ; org . springframework . springfaces . mvc . navigation . annotation . NavigationMappingFilter f2 = mock ( org . springframework . springfaces . mvc . navigation . annotation . NavigationMappingFilter . class ) ; org . springframework . springfaces . mvc . navigation . annotation . NavigationMappingFilter f3 = mock ( org . springframework . springfaces . mvc . navigation . annotation . NavigationMappingFilter . class ) ; given ( f1 . matches ( this . context ) ) . willReturn ( true ) ; given ( f2 . matches ( this . context ) ) . willReturn ( true ) ; given ( f3 . matches ( this . context ) ) . willReturn ( true ) ; org . springframework . springfaces . mvc . navigation . annotation . CompositeNavigationMappingFilter composite = new org . springframework . springfaces . mvc . navigation . annotation . CompositeNavigationMappingFilter ( f1 , f2 , f3 ) ; "<AssertPlaceHolder>" ; } matches ( org . springframework . springfaces . mvc . navigation . NavigationContext ) { for ( org . springframework . springfaces . mvc . navigation . annotation . NavigationMappingFilter filter : this . filters ) { if ( ! ( filter . matches ( context ) ) ) { return false ; } } return true ; }
|
org . junit . Assert . assertThat ( composite . matches ( this . context ) , org . hamcrest . Matchers . is ( true ) )
|
testGetProjectById ( ) { com . onboard . domain . model . Project result = projectServiceImpl . getById ( com . onboard . service . collaboration . impl . test . ProjectServiceImplTest . id ) ; verify ( projectMapper ) . selectByPrimaryKey ( com . onboard . service . collaboration . impl . test . ProjectServiceImplTest . id ) ; "<AssertPlaceHolder>" ; } getById ( int ) { com . onboard . domain . model . Story story = storyMapper . selectByPrimaryKey ( storyId ) ; if ( story != null ) { checkCompletable ( story ) ; fillStorySteps ( story ) ; java . util . Map < java . lang . Integer , java . util . List < com . onboard . domain . model . Story > > parentStoryIdStoriesMap = getAllProjectStoriesMapByParentId ( story . getProjectId ( ) , null ) ; fillChildStory ( story , null , new java . util . HashSet < java . lang . Integer > ( ) , parentStoryIdStoriesMap ) ; return story ; } return null ; }
|
org . junit . Assert . assertEquals ( project , result )
|
testPropertyReactivityOfAKnownClass ( ) { final java . lang . String drl1 = ( ( ( ( ( ( ( ( ( ( "<sp>when\n" 0 + ( org . drools . compiler . integrationtests . incrementalcompilation . IncrementalCompilationTest . TypeA . class . getCanonicalName ( ) ) ) + "\n" ) + "<sp>when\n" 0 ) + ( org . drools . compiler . integrationtests . incrementalcompilation . IncrementalCompilationTest . TypeB . class . getCanonicalName ( ) ) ) + "\n" ) + "rule<sp>\"RULE_1\"\n" ) + "<sp>when\n" ) + "<sp>when\n" 1 ) + "<sp>when\n" 2 ) + "<sp>then\n" ) + "<sp>when\n" 3 ; final java . lang . String drl2 = ( ( ( ( ( ( ( "<sp>when\n" 0 + ( org . drools . compiler . integrationtests . incrementalcompilation . IncrementalCompilationTest . TypeB . class . getCanonicalName ( ) ) ) + "\n" ) + "rule<sp>\"RULE_2\"\n" ) + "<sp>when\n" ) + "<sp>$b<sp>:<sp>TypeB()<sp>@watch(!*)" ) + "<sp>then\n" ) + "<sp>modify($b)<sp>{<sp>setValue(0)<sp>}<sp>\n" ) + "<sp>when\n" 3 ; final org . kie . api . KieServices ks = KieServices . Factory . get ( ) ; final org . kie . api . builder . ReleaseId releaseId1 = ks . newReleaseId ( "org.kie" , "test-upgrade" , "1.0.0" ) ; org . drools . testcoverage . common . util . KieUtil . getKieModuleFromDrls ( releaseId1 , kieBaseTestConfiguration , drl1 ) ; final org . kie . api . runtime . KieContainer kc = ks . newKieContainer ( releaseId1 ) ; final org . kie . api . runtime . KieSession ksession = kc . newKieSession ( ) ; final org . kie . api . builder . ReleaseId releaseId2 = ks . newReleaseId ( "org.kie" , "test-upgrade" , "1.1.0" ) ; org . drools . testcoverage . common . util . KieUtil . getKieModuleFromDrls ( releaseId2 , kieBaseTestConfiguration , drl2 ) ; kc . updateToVersion ( releaseId2 ) ; ksession . insert ( new org . drools . compiler . integrationtests . incrementalcompilation . IncrementalCompilationTest . TypeB ( 1 ) ) ; final int fired = ksession . fireAllRules ( 10 ) ; "<AssertPlaceHolder>" ; } fireAllRules ( org . kie . api . runtime . rule . AgendaFilter ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 1 , fired )
|
testDatatypeValue3 ( ) { java . lang . String init = "'01'^^xsd:integer,<sp>'1'^^xsd:integer" 1 + ( ( ( ( ( ( ( ( "<Jack><sp>" + "rdf:value<sp>" ) + "<sp>1,<sp>1.0,<sp>'1'^^xsd:long,<sp>1e0,<sp>'1'^^xsd:double,<sp>'1'^^xsd:float,<sp>" ) + "'01'^^xsd:integer,<sp>'1'^^xsd:integer" 3 ) + "'1'^^xsd:boolean,<sp>'0'^^xsd:boolean<sp>." ) + "<sp><Jim><sp>rdf:value<sp>false,<sp>'01'^^xsd:double,<sp>'1.0'^^xsd:float," ) + "'01'^^xsd:integer,<sp>'1'^^xsd:integer" ) + ",<sp>'1'^^xsd:short,<sp>'1'^^xsd:byte<sp>,<sp>'1'^^xsd:int,<sp>'01'^^xsd:byte,<sp>'1'^^xsd:byte" ) + "'01'^^xsd:integer,<sp>'1'^^xsd:integer" 0 ) ; java . lang . String q = "'01'^^xsd:integer,<sp>'1'^^xsd:integer" 2 + ( ( "?x<sp>?p<sp>1" + "}" ) + "order<sp>by<sp>?x" ) ; fr . inria . corese . core . Graph g = createGraph ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; exec . query ( init ) ; fr . inria . corese . kgram . core . Mappings map = exec . query ( q ) ; "<AssertPlaceHolder>" ; } size ( ) { return tests . size ( ) ; }
|
org . junit . Assert . assertEquals ( 10 , map . size ( ) )
|
testCannotRetrieveUserWorkspaceWithoutDomains ( ) { java . util . List < org . nuxeo . ecm . core . api . DocumentRef > refs = session . getChildren ( session . getRootDocument ( ) . getRef ( ) ) . stream ( ) . map ( DocumentModel :: getRef ) . collect ( java . util . stream . Collectors . toList ( ) ) ; session . removeDocuments ( refs . toArray ( new org . nuxeo . ecm . core . api . DocumentRef [ refs . size ( ) ] ) ) ; session . save ( ) ; try ( org . nuxeo . ecm . core . api . CloseableCoreSession userSession = coreFeature . openCoreSession ( "toto" ) ) { org . nuxeo . ecm . core . api . DocumentModel uw = uwm . getCurrentUserPersonalWorkspace ( userSession ) ; "<AssertPlaceHolder>" ; } } getCurrentUserPersonalWorkspace ( org . nuxeo . ecm . core . api . CoreSession ) { return getCurrentUserPersonalWorkspace ( userCoreSession . getPrincipal ( ) , null , userCoreSession ) ; }
|
org . junit . Assert . assertNull ( uw )
|
testUpdateSecurityZoneWithMisMatchId ( ) { org . apache . ranger . plugin . model . RangerSecurityZone rangerSecurityZoneToUpdate = createRangerSecurityZone ( ) ; java . lang . Long securityZoneId = 1L ; rangerSecurityZoneToUpdate . setId ( securityZoneId ) ; when ( rangerBizUtil . isAdmin ( ) ) . thenReturn ( true ) ; when ( validatorFactory . getSecurityZoneValidator ( svcStore , securityZoneStore ) ) . thenReturn ( validator ) ; doNothing ( ) . when ( validator ) . validate ( rangerSecurityZoneToUpdate , RangerValidator . Action . UPDATE ) ; when ( securityZoneStore . updateSecurityZoneById ( rangerSecurityZoneToUpdate ) ) . thenReturn ( rangerSecurityZoneToUpdate ) ; when ( restErrorUtil . createRESTException ( org . mockito . Mockito . anyString ( ) ) ) . thenThrow ( new javax . ws . rs . WebApplicationException ( ) ) ; thrown . expect ( javax . ws . rs . WebApplicationException . class ) ; org . apache . ranger . plugin . model . RangerSecurityZone updatedRangerSecurityZone = securityZoneREST . updateSecurityZone ( 9L , rangerSecurityZoneToUpdate ) ; "<AssertPlaceHolder>" ; verify ( validator , times ( 1 ) ) . validate ( rangerSecurityZoneToUpdate , RangerValidator . Action . UPDATE ) ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( rangerSecurityZoneToUpdate . getId ( ) , updatedRangerSecurityZone . getId ( ) )
|
defaultSeparatorOutsideOfAVariable ( ) { ch . qos . logback . core . subst . Tokenizer tokenizer = new ch . qos . logback . core . subst . Tokenizer ( "{a:-b}" ) ; ch . qos . logback . core . subst . Parser parser = new ch . qos . logback . core . subst . Parser ( tokenizer . tokenize ( ) ) ; ch . qos . logback . core . subst . Node node = parser . parse ( ) ; dump ( node ) ; ch . qos . logback . core . subst . Node witness = new ch . qos . logback . core . subst . Node ( Node . Type . LITERAL , "{" ) ; ch . qos . logback . core . subst . Node t = witness . next = new ch . qos . logback . core . subst . Node ( Node . Type . LITERAL , "a" ) ; t . next = new ch . qos . logback . core . subst . Node ( Node . Type . LITERAL , ":-" ) ; t = t . next ; t . next = new ch . qos . logback . core . subst . Node ( Node . Type . LITERAL , "b" ) ; t = t . next ; t . next = new ch . qos . logback . core . subst . Node ( Node . Type . LITERAL , "}" ) ; "<AssertPlaceHolder>" ; } dump ( org . osgi . framework . BundleEvent ) { System . out . println ( ( ( ( ( ( ( "BundleEvent:" + ",<sp>source<sp>" ) + ( be . getSource ( ) ) ) + ",<sp>bundle=" ) + ( be . getBundle ( ) ) ) + ",<sp>type=" ) + ( be . getType ( ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( witness , node )
|
testValidPublish ( ) { com . streamsets . pipeline . stage . destination . redis . RedisTargetConfig conf = getDefaultConfig ( ) ; conf . mode = ModeType . PUBLISH ; conf . channel = com . google . common . collect . ImmutableList . of ( com . streamsets . pipeline . stage . destination . redis . RedisTargetIT . channel ) ; conf . dataFormat = com . streamsets . pipeline . config . DataFormat . JSON ; conf . dataFormatConfig . jsonMode = com . streamsets . pipeline . config . JsonMode . MULTIPLE_OBJECTS ; com . streamsets . pipeline . api . Target target = new com . streamsets . pipeline . stage . destination . redis . RedisTarget ( conf ) ; java . util . List < com . streamsets . pipeline . api . Record > records = getTestRecords ( ) ; com . streamsets . pipeline . sdk . TargetRunner runner = new com . streamsets . pipeline . sdk . TargetRunner . Builder ( com . streamsets . pipeline . stage . destination . redis . RedisDTarget . class , target ) . setOnRecordError ( OnRecordError . TO_ERROR ) . build ( ) ; runner . runInit ( ) ; runner . runWrite ( records ) ; "<AssertPlaceHolder>" ; } getErrorRecords ( ) { return errorRecords ; }
|
org . junit . Assert . assertTrue ( runner . getErrorRecords ( ) . isEmpty ( ) )
|
Should_locallyStoreEntries ( ) { info . smart_tools . smartactors . scheduler . actor . impl . EntryStorage storage = new info . smart_tools . smartactors . scheduler . actor . impl . EntryStorage ( remoteEntryStorage , null ) ; storage . notifyActive ( entries [ 0 ] ) ; storage . notifyActive ( entries [ 1 ] ) ; storage . notifyActive ( entries [ 2 ] ) ; "<AssertPlaceHolder>" ; } getEntry ( java . lang . String ) { try { info . smart_tools . smartactors . scheduler . interfaces . ISchedulerEntry localEntry = getLocalEntry ( id ) ; if ( null != localEntry ) { return localEntry ; } info . smart_tools . smartactors . iobject . iobject . IObject savedEntryState = remoteEntryStorage . querySingleEntry ( id ) ; return info . smart_tools . smartactors . ioc . ioc . IOC . resolve ( info . smart_tools . smartactors . ioc . named_keys_storage . Keys . getOrAdd ( "restore<sp>scheduler<sp>entry" ) , savedEntryState , this ) ; } catch ( info . smart_tools . smartactors . ioc . iioccontainer . exception . ResolutionException e ) { throw new info . smart_tools . smartactors . scheduler . actor . impl . EntryStorageAccessException ( "Error<sp>occurred<sp>restoring<sp>required<sp>entry<sp>from<sp>state<sp>saved<sp>in<sp>remote<sp>storage." ) ; } catch ( info . smart_tools . smartactors . scheduler . actor . impl . exceptions . CancelledLocalEntryRequestException e ) { throw new info . smart_tools . smartactors . scheduler . actor . impl . EntryNotFoundException ( "The<sp>entry<sp>was<sp>not<sp>found<sp>as<sp>it<sp>was<sp>cancelled<sp>recently." ) ; } }
|
org . junit . Assert . assertSame ( entries [ 1 ] , storage . getEntry ( "1" ) )
|
shouldParseIsoPrefixSimpleNumber ( ) { long value = org . dcache . util . ByteSizeParser . using ( isoPrefix ( ) ) . parse ( "1" ) ; "<AssertPlaceHolder>" ; } parse ( java . io . File ) { java . util . List < diskCacheV111 . util . PnfsId > list = new java . util . ArrayList ( ) ; try ( java . io . BufferedReader reader = new java . io . BufferedReader ( new java . io . FileReader ( file ) ) ) { java . lang . String line ; while ( ( line = reader . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( ( line . isEmpty ( ) ) || ( line . startsWith ( "#" ) ) ) { continue ; } list . add ( new diskCacheV111 . util . PnfsId ( line ) ) ; } } catch ( java . lang . IllegalArgumentException e ) { throw new java . io . IOException ( ( "Invalid<sp>file<sp>format:<sp>" + ( e . getMessage ( ) ) ) ) ; } return list ; }
|
org . junit . Assert . assertThat ( value , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( 1L ) ) )
|
testWritableOutputStreamWithAutoCreateOnNullBlob ( ) { java . lang . String location = "gs://test-spring/test" ; com . google . cloud . storage . Storage storage = mock ( com . google . cloud . storage . Storage . class ) ; com . google . cloud . storage . BlobId blobId = com . google . cloud . storage . BlobId . of ( "test-spring" , "test" ) ; when ( storage . get ( blobId ) ) . thenReturn ( null ) ; com . google . cloud . storage . BlobInfo blobInfo = com . google . cloud . storage . BlobInfo . newBuilder ( blobId ) . build ( ) ; com . google . cloud . WriteChannel writeChannel = mock ( com . google . cloud . WriteChannel . class ) ; com . google . cloud . storage . Blob blob = mock ( com . google . cloud . storage . Blob . class ) ; when ( blob . writer ( ) ) . thenReturn ( writeChannel ) ; when ( storage . create ( blobInfo ) ) . thenReturn ( blob ) ; org . springframework . cloud . gcp . storage . GoogleStorageResource resource = new org . springframework . cloud . gcp . storage . GoogleStorageResource ( storage , location ) ; org . springframework . cloud . gcp . storage . GoogleStorageResource spyResource = spy ( resource ) ; java . io . OutputStream os = spyResource . getOutputStream ( ) ; "<AssertPlaceHolder>" ; } getOutputStream ( ) { if ( isBucket ( ) ) { throw new java . lang . IllegalStateException ( ( ( "Cannot<sp>open<sp>an<sp>output<sp>stream<sp>to<sp>a<sp>bucket:<sp>'" + ( getURI ( ) ) ) + "'" ) ) ; } else { com . google . cloud . storage . Blob blob = getBlob ( ) ; if ( ( blob == null ) || ( ! ( blob . exists ( ) ) ) ) { if ( ! ( this . autoCreateFiles ) ) { throw new java . io . FileNotFoundException ( ( "The<sp>blob<sp>was<sp>not<sp>found:<sp>" + ( getURI ( ) ) ) ) ; } blob = createBlob ( ) ; } return java . nio . channels . Channels . newOutputStream ( blob . writer ( ) ) ; } }
|
org . junit . Assert . assertNotNull ( os )
|
etaLam ( ) { org . arend . core . expr . PiExpression type = Pi ( singleParam ( null , Nat ( ) ) , DataCall ( Prelude . PATH , Sort . SET0 , Lam ( singleParam ( "i" , Interval ( ) ) , Nat ( ) ) , Zero ( ) , Zero ( ) ) ) ; org . arend . typechecking . visitor . CheckTypeVisitor . Result result1 = typeCheckExpr ( "\\lam<sp>a<sp>x<sp>=><sp>path<sp>(\\lam<sp>i<sp>=><sp>a<sp>x<sp>@<sp>i)" , Pi ( singleParam ( null , type ) , type ) ) ; org . arend . typechecking . visitor . CheckTypeVisitor . Result result2 = typeCheckExpr ( "\\lam<sp>a<sp>=><sp>a" , Pi ( singleParam ( null , type ) , type ) ) ; "<AssertPlaceHolder>" ; } singleParam ( java . lang . String , org . arend . Expression ) { return org . arend . ExpressionFactory . singleParam ( true , name , type ) ; }
|
org . junit . Assert . assertEquals ( result2 . expression , result1 . expression )
|
testHasWarningsWhenBothWarningsAndErrorsAreRecorded ( ) { "<AssertPlaceHolder>" ; } hasWarnings ( ) { runCodes ( ) ; return ( numWarnings ) > 0 ; }
|
org . junit . Assert . assertThat ( report . hasWarnings ( ) , org . hamcrest . Matchers . equalTo ( true ) )
|
addWithEqualsInSuperclass ( ) { org . optaplanner . core . impl . testdata . domain . lookup . TestdataObjectEqualsSubclass object = new org . optaplanner . core . impl . testdata . domain . lookup . TestdataObjectEqualsSubclass ( 0 ) ; lookUpManager . addWorkingObject ( object ) ; "<AssertPlaceHolder>" ; } lookUpWorkingObject ( E ) { if ( externalObject == null ) { return null ; } org . optaplanner . core . impl . domain . lookup . LookUpStrategy lookUpStrategy = lookUpStrategyResolver . determineLookUpStrategy ( externalObject ) ; return lookUpStrategy . lookUpWorkingObject ( idToWorkingObjectMap , externalObject ) ; }
|
org . junit . Assert . assertSame ( object , lookUpManager . lookUpWorkingObject ( object ) )
|
testJmsConsumerIdFromJmsSessionId ( ) { org . apache . qpid . jms . meta . JmsConsumerId id1 = new org . apache . qpid . jms . meta . JmsConsumerId ( firstId , 1 ) ; org . apache . qpid . jms . meta . JmsConsumerId id2 = new org . apache . qpid . jms . meta . JmsConsumerId ( id1 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertSame ( id1 . getValue ( ) , id2 . getValue ( ) )
|
testRemoveExpiredMasterKeyInRMStateStore ( ) { org . apache . hadoop . yarn . server . resourcemanager . MockRM rm1 = new org . apache . hadoop . yarn . server . resourcemanager . security . TestRMDelegationTokens . MyMockRM ( conf ) ; rm1 . start ( ) ; org . apache . hadoop . yarn . server . resourcemanager . security . RMDelegationTokenSecretManager dtSecretManager = rm1 . getRMContext ( ) . getRMDelegationTokenSecretManager ( ) ; org . apache . hadoop . yarn . server . resourcemanager . recovery . RMStateStore . RMState rmState = rm1 . getRMContext ( ) . getStateStore ( ) . loadState ( ) ; java . util . Set < org . apache . hadoop . security . token . delegation . DelegationKey > rmDTMasterKeyState = rmState . getRMDTSecretManagerState ( ) . getMasterKeyState ( ) ; for ( org . apache . hadoop . security . token . delegation . DelegationKey expectedKey : dtSecretManager . getAllMasterKeys ( ) ) { boolean foundIt = false ; for ( org . apache . hadoop . security . token . delegation . DelegationKey gotKey : rmDTMasterKeyState ) { if ( ( ( expectedKey . getKeyId ( ) ) == ( gotKey . getKeyId ( ) ) ) && ( java . util . Arrays . equals ( expectedKey . getEncodedKey ( ) , gotKey . getEncodedKey ( ) ) ) ) { foundIt = true ; break ; } } "<AssertPlaceHolder>" ; } java . util . Set < org . apache . hadoop . security . token . delegation . DelegationKey > expiringKeys = new java . util . HashSet < org . apache . hadoop . security . token . delegation . DelegationKey > ( ) ; expiringKeys . addAll ( dtSecretManager . getAllMasterKeys ( ) ) ; while ( true ) { rm1 . getRMContext ( ) . getStateStore ( ) . loadState ( ) ; rmDTMasterKeyState = rmState . getRMDTSecretManagerState ( ) . getMasterKeyState ( ) ; boolean allExpired = true ; for ( org . apache . hadoop . security . token . delegation . DelegationKey key : expiringKeys ) { if ( rmDTMasterKeyState . contains ( key ) ) { allExpired = false ; } } if ( allExpired ) break ; java . lang . Thread . sleep ( 500 ) ; } rm1 . stop ( ) ; } getEncodedKey ( ) { return keyBytes ; }
|
org . junit . Assert . assertTrue ( foundIt )
|
testAfter ( ) { final org . apache . drill . exec . expr . holders . VarCharHolder left = org . apache . drill . exec . fn . impl . TestByteComparisonFunctions . hello ; final org . apache . drill . exec . expr . holders . VarCharHolder right = org . apache . drill . exec . fn . impl . TestByteComparisonFunctions . goodbye ; "<AssertPlaceHolder>" ; } compare ( io . netty . buffer . DrillBuf , int , int , io . netty . buffer . DrillBuf , int , int ) { rangeCheck ( left , lStart , lEnd , right , rStart , rEnd ) ; return org . apache . drill . exec . expr . fn . impl . ByteFunctionHelpers . memcmp ( left . memoryAddress ( ) , lStart , lEnd , right . memoryAddress ( ) , rStart , rEnd ) ; }
|
org . junit . Assert . assertTrue ( ( ( org . apache . drill . exec . expr . fn . impl . ByteFunctionHelpers . compare ( left . buffer , left . start , left . end , right . buffer , right . start , right . end ) ) == 1 ) )
|
testNestedExecution ( ) { final org . nd4j . autodiff . samediff . SameDiff outer = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > input = new org . nd4j . autodiff . samediff . HashMap ( ) ; input . put ( "x" , org . nd4j . linalg . factory . Nd4j . ones ( 2 ) ) ; outer . defineFunction ( "firstadd" , new org . nd4j . autodiff . samediff . SameDiff . SameDiffFunctionDefinition ( ) { @ org . nd4j . autodiff . samediff . Override public org . nd4j . autodiff . samediff . SDVariable [ ] define ( org . nd4j . autodiff . samediff . SameDiff sameDiff , org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > inputs , org . nd4j . autodiff . samediff . SDVariable [ ] variableInputs ) { org . nd4j . autodiff . samediff . SDVariable input = sameDiff . var ( "x" , inputs . get ( "x" ) ) ; org . nd4j . autodiff . samediff . SDVariable ret = input . add ( input ) ; return new org . nd4j . autodiff . samediff . SDVariable [ ] { ret } ; } } , input ) ; outer . defineFunction ( "secondadd" , new org . nd4j . autodiff . samediff . SameDiff . SameDiffFunctionDefinition ( ) { @ org . nd4j . autodiff . samediff . Override public org . nd4j . autodiff . samediff . SDVariable [ ] define ( org . nd4j . autodiff . samediff . SameDiff sameDiff , org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > inputs , org . nd4j . autodiff . samediff . SDVariable [ ] variableInputs ) { org . nd4j . autodiff . samediff . SDVariable result = outer . invokeFunctionOn ( "firstadd" , sameDiff ) ; return new org . nd4j . autodiff . samediff . SDVariable [ ] { result . add ( 1.0 ) } ; } } ) ; org . nd4j . autodiff . samediff . SameDiff secondAdd = outer . getFunction ( "secondadd" ) ; org . nd4j . linalg . api . ndarray . INDArray [ ] outputs = secondAdd . eval ( input ) ; org . nd4j . linalg . api . ndarray . INDArray outputsAssertion = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( 2 , 2.0 ) ; "<AssertPlaceHolder>" ; } valueArrayOf ( int [ ] , double ) { if ( ( shape . length ) == 0 ) return org . nd4j . linalg . factory . Nd4j . trueScalar ( value ) ; org . nd4j . linalg . factory . Nd4j . checkShapeValues ( shape ) ; org . nd4j . linalg . factory . INDArray ret = org . nd4j . linalg . factory . Nd4j . INSTANCE . valueArrayOf ( shape , value ) ; org . nd4j . linalg . factory . Nd4j . logCreationIfNecessary ( ret ) ; return ret ; }
|
org . junit . Assert . assertEquals ( outputsAssertion , outputs [ 0 ] )
|
printsOutLinesIndiscrimately ( ) { com . facebook . buck . tools . consistency . RuleKeyLogFilePrinter printer = new com . facebook . buck . tools . consistency . RuleKeyLogFilePrinter ( stream , reader , java . util . Optional . empty ( ) , java . util . Optional . empty ( ) , Integer . MAX_VALUE ) ; printer . printFile ( logPath ) ; java . lang . String [ ] lines = stream . getOutputLines ( ) ; "<AssertPlaceHolder>" ; validateLines ( ruleKeys . get ( 0 ) , lines [ 0 ] , lines [ 1 ] , lines [ 2 ] ) ; validateLines ( ruleKeys . get ( 1 ) , lines [ 3 ] , lines [ 4 ] , lines [ 5 ] ) ; validateLines ( ruleKeys . get ( 2 ) , lines [ 6 ] , lines [ 7 ] , lines [ 8 ] ) ; validateLines ( ruleKeys . get ( 3 ) , lines [ 9 ] , lines [ 10 ] , lines [ 11 ] ) ; } getOutputLines ( ) { this . flush ( ) ; return new java . lang . String ( outBytesStream . toByteArray ( ) , 0 , outBytesStream . toByteArray ( ) . length , java . nio . charset . StandardCharsets . UTF_8 ) . split ( java . lang . System . lineSeparator ( ) ) ; }
|
org . junit . Assert . assertEquals ( 12 , lines . length )
|
test ( ) { connect ( ) ; org . zkoss . zktest . zats . ztl . JQuery icon1 = jq ( ".z-icon-caret-right" ) ; click ( icon1 ) ; check ( jq ( ".z-checkbox" ) . find ( "input" ) ) ; waitResponse ( ) ; org . zkoss . zktest . zats . ztl . JQuery trs = jq ( ".z-treerow-selected" ) ; "<AssertPlaceHolder>" ; } length ( ) { return org . zkoss . zktest . zats . WebDriverTestCase . parseInt ( org . zkoss . zktest . zats . WebDriverTestCase . getEval ( ( ( _out . toString ( ) ) + ".length" ) ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( trs . length ( ) ) == 5 ) )
|
shouldParsePicklistsToObjects ( ) { final int properCountExceptions = 0 ; final org . apache . camel . maven . GenerateMojo mojo = new org . apache . camel . maven . GenerateMojo ( ) ; mojo . picklistToStrings = org . apache . camel . maven . GenerateMojoTest . createValidPicklistToStrings ( ) ; mojo . picklistToEnums = org . apache . camel . maven . GenerateMojoTest . createValidPicklistToEnums ( ) ; int resultCountExceptions = 0 ; try { mojo . parsePicklistToEnums ( ) ; } catch ( final java . lang . IllegalArgumentException e ) { resultCountExceptions ++ ; } try { mojo . parsePicklistToStrings ( ) ; } catch ( final java . lang . IllegalArgumentException e ) { resultCountExceptions ++ ; } "<AssertPlaceHolder>" ; } parsePicklistToStrings ( ) { org . apache . camel . maven . GenerateMojo . parsePicklistOverrideArgs ( picklistToStrings , picklistsStringToSObject ) ; }
|
org . junit . Assert . assertEquals ( properCountExceptions , resultCountExceptions )
|
testConvertToThreeBytes ( ) { result2 = org . onosproject . isis . io . util . IsisUtil . convertToThreeBytes ( 30 ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
|
org . junit . Assert . assertThat ( result2 . length , org . hamcrest . CoreMatchers . is ( 3 ) )
|
shouldHaveProjections ( ) { final int result = uut . size ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( examples . getRows ( ) . size ( ) ) - 1 ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . equalTo ( 1 ) )
|
testBadUsername ( ) { mockNonce ( "3rfcNHYJY1ZVvWVs7j" ) ; final org . wildfly . security . password . Password password = org . wildfly . security . sasl . scram . ScramServerCompatibilityTest . getPassword ( "pencil" , "QSXCR+Q6sek8bf92" ) ; final javax . security . sasl . SaslServer saslServer = new org . wildfly . security . sasl . test . SaslServerBuilder ( org . wildfly . security . sasl . scram . ScramSaslServerFactory . class , SaslMechanismInformation . Names . SCRAM_SHA_1 ) . setUserName ( "baduser" ) . setPassword ( password ) . build ( ) ; byte [ ] message = "n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL" . getBytes ( StandardCharsets . UTF_8 ) ; try { saslServer . evaluateResponse ( message ) ; org . junit . Assert . fail ( "SaslException<sp>not<sp>thrown" ) ; } catch ( javax . security . sasl . SaslException e ) { } "<AssertPlaceHolder>" ; } isComplete ( ) { return delegate . isComplete ( ) ; }
|
org . junit . Assert . assertFalse ( saslServer . isComplete ( ) )
|
classInfoClone ( ) { org . mapdb . elsa . ElsaSerializerPojo . ClassInfo c = p . makeClassInfo ( org . mapdb . elsa . IntBean . class , null ) ; org . mapdb . elsa . ByteArrayOutputStream bout = new org . mapdb . elsa . ByteArrayOutputStream ( ) ; org . mapdb . elsa . DataOutputStream out = new org . mapdb . elsa . DataOutputStream ( bout ) ; p . classInfoSerialize ( out , c ) ; org . mapdb . elsa . DataInput in = new org . mapdb . elsa . DataInputStream ( new org . mapdb . elsa . ByteArrayInputStream ( bout . toByteArray ( ) ) ) ; org . mapdb . elsa . ElsaSerializerPojo . ClassInfo c2 = p . classInfoDeserialize ( in ) ; "<AssertPlaceHolder>" ; } classInfoDeserialize ( org . mapdb . elsa . DataInput ) { java . lang . String className = in . readUTF ( ) ; java . lang . Class clazz = null ; boolean isEnum = in . readBoolean ( ) ; int flags = in . readUnsignedByte ( ) ; boolean externalizable = ( flags & 2 ) != 0 ; boolean useObjectStream = ( flags & 1 ) != 0 ; int fieldsNum = ( useObjectStream ) ? 0 : org . mapdb . elsa . ElsaUtil . unpackInt ( in ) ; org . mapdb . elsa . ElsaSerializerPojo . FieldInfo [ ] fields = new org . mapdb . elsa . ElsaSerializerPojo . FieldInfo [ fieldsNum ] ; for ( int j = 0 ; j < fieldsNum ; j ++ ) { java . lang . String fieldName = in . readUTF ( ) ; boolean primitive = in . readBoolean ( ) ; java . lang . String type = in . readUTF ( ) ; if ( clazz == null ) clazz = loadClassCachedUnchecked ( className ) ; fields [ j ] = new org . mapdb . elsa . ElsaSerializerPojo . FieldInfo ( fieldName , type , ( primitive ? null : loadClassCachedUnchecked ( type ) ) , clazz ) ; } return new org . mapdb . elsa . ElsaSerializerPojo . ClassInfo ( className , fields , isEnum , externalizable , useObjectStream ) ; }
|
org . junit . Assert . assertEquals ( c , c2 )
|
preHandleDomainPort ( ) { domain = "localhost" ; org . springframework . mock . web . MockHttpServletRequest request = new org . springframework . mock . web . MockHttpServletRequest ( ) ; org . springframework . mock . web . MockHttpServletResponse response = new org . springframework . mock . web . MockHttpServletResponse ( ) ; request . addHeader ( com . ctrip . xpipe . spring . DomainValidateFilter . HTTP_REQUEST_HEADER_HOST , ( ( domain ) + ":8080" ) ) ; filter . doFilter ( request , response , filterChain ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) )
|
testFuzzyLookup ( ) { java . lang . Class expected = com . laytonsmith . PureUtilities . Common . ReflectionUtils . class ; java . lang . Class actual = com . laytonsmith . PureUtilities . ClassLoading . ClassDiscovery . getDefaultInstance ( ) . forFuzzyName ( "com.laytonsmith.Pur.*" , "ReflectionUtils" ) . loadClass ( ) ; "<AssertPlaceHolder>" ; } loadClass ( ) { return loadClass ( com . laytonsmith . PureUtilities . ClassLoading . ClassDiscovery . getDefaultInstance ( ) . getDefaultClassLoader ( ) , true ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
countAuditLogs_byOperationName1 ( ) { givenAuditLogs ( ) ; operatorIds . add ( "opId1" ) ; long cnt = countAuditLogsInTx ( operatorIds , 0 , Long . MAX_VALUE ) ; "<AssertPlaceHolder>" ; } countAuditLogsInTx ( java . util . List , long , long ) { return runTX ( new java . util . concurrent . Callable < java . lang . Long > ( ) { @ org . oscm . auditlog . dao . Override public org . oscm . auditlog . dao . Long call ( ) { return dao . countAuditLogs ( operationName , startTime , endTime ) ; } } ) ; }
|
org . junit . Assert . assertEquals ( 3 , cnt )
|
shouldReturnFriends ( ) { try ( org . neo4j . harness . ServerControls server = newTestDb ( ) ) { populateDb ( server . graph ( ) ) ; org . neo4j . server . rest . RestRequest restRequest = new org . neo4j . server . rest . RestRequest ( server . httpURI ( ) . resolve ( com . neo4j . example . extension . MyServiceFunctionalTest . MOUNT_POINT ) , com . neo4j . example . extension . MyServiceFunctionalTest . CLIENT ) ; org . neo4j . server . rest . JaxRsResponse response = restRequest . get ( "service/friendsCypher/B" ) ; System . out . println ( response . getEntity ( ) ) ; java . util . List list = objectMapper . readValue ( response . getEntity ( ) , java . util . List . class ) ; "<AssertPlaceHolder>" ; } } populateDb ( com . neo4j . example . extension . GraphDatabaseService ) { try ( com . neo4j . example . extension . Transaction tx = db . beginTx ( ) ) { com . neo4j . example . extension . Node personA = createPerson ( db , "A" ) ; com . neo4j . example . extension . Node personB = createPerson ( db , "B" ) ; com . neo4j . example . extension . Node personC = createPerson ( db , "C" ) ; com . neo4j . example . extension . Node personD = createPerson ( db , "D" ) ; personA . createRelationshipTo ( personB , com . neo4j . example . extension . MyServiceFunctionalTest . KNOWS ) ; personB . createRelationshipTo ( personC , com . neo4j . example . extension . MyServiceFunctionalTest . KNOWS ) ; personC . createRelationshipTo ( personD , com . neo4j . example . extension . MyServiceFunctionalTest . KNOWS ) ; tx . success ( ) ; } }
|
org . junit . Assert . assertEquals ( new java . util . HashSet ( java . util . Arrays . asList ( "A" , "C" ) ) , new java . util . HashSet ( list ) )
|
testDestroyWeakSynapseOnWrongPrediction ( ) { org . numenta . nupic . algorithms . TemporalMemory tm = new org . numenta . nupic . algorithms . TemporalMemory ( ) ; org . numenta . nupic . model . Connections cn = new org . numenta . nupic . model . Connections ( ) ; org . numenta . nupic . Parameters p = getDefaultParameters ( null , KEY . INITIAL_PERMANENCE , 0.2 ) ; p = getDefaultParameters ( p , KEY . MAX_NEW_SYNAPSE_COUNT , 4 ) ; p = getDefaultParameters ( p , KEY . PREDICTED_SEGMENT_DECREMENT , 0.02 ) ; p . apply ( cn ) ; org . numenta . nupic . algorithms . TemporalMemory . init ( cn ) ; int [ ] previousActiveColumns = new int [ ] { 0 } ; org . numenta . nupic . model . Cell [ ] previousActiveCells = new org . numenta . nupic . model . Cell [ ] { cn . getCell ( 0 ) , cn . getCell ( 1 ) , cn . getCell ( 2 ) , cn . getCell ( 3 ) } ; int [ ] activeColumns = new int [ ] { 2 } ; org . numenta . nupic . model . Cell expectedActiveCell = cn . getCell ( 5 ) ; org . numenta . nupic . model . DistalDendrite activeSegment = cn . createSegment ( expectedActiveCell ) ; cn . createSynapse ( activeSegment , previousActiveCells [ 0 ] , 0.5 ) ; cn . createSynapse ( activeSegment , previousActiveCells [ 1 ] , 0.5 ) ; cn . createSynapse ( activeSegment , previousActiveCells [ 2 ] , 0.5 ) ; cn . createSynapse ( activeSegment , previousActiveCells [ 3 ] , 0.015 ) ; tm . compute ( cn , previousActiveColumns , true ) ; tm . compute ( cn , activeColumns , true ) ; "<AssertPlaceHolder>" ; } numSynapses ( org . numenta . nupic . model . DistalDendrite ) { if ( optionalSegmentArg != null ) { return getSynapses ( optionalSegmentArg ) . size ( ) ; } return numSynapses ; }
|
org . junit . Assert . assertEquals ( 3 , cn . numSynapses ( activeSegment ) )
|
testParsePathNodePortSizeErr ( ) { queriesString = org . apache . commons . lang . StringUtils . join ( new java . lang . String [ ] { "type=node" , "enabled=true" , "status=established" , "path=type=Network,node_id=node01,port_id=port01,port_id=port02" } , "&" ) ; target = new org . o3project . odenos . core . component . network . flow . query . OFPFlowQuery ( queriesString ) ; "<AssertPlaceHolder>" ; } parse ( ) { if ( ! ( super . parse ( ) ) ) { return false ; } if ( ! ( org . o3project . odenos . core . component . network . BasicQuery . checkMapExactly ( this . actions , new java . lang . String [ ] { } ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertThat ( target . parse ( ) , org . hamcrest . CoreMatchers . is ( false ) )
|
testGroupItemChangesBaseItem ( ) { org . eclipse . smarthome . model . item . internal . GenericItemProvider gip = new org . eclipse . smarthome . model . item . internal . GenericItemProvider ( ) ; org . eclipse . smarthome . core . items . GroupItem g1 = new org . eclipse . smarthome . core . items . GroupItem ( "testGroup" , new org . eclipse . smarthome . core . library . items . SwitchItem ( "test" ) , new org . eclipse . smarthome . core . library . types . ArithmeticGroupFunction . Or ( org . eclipse . smarthome . core . library . types . OnOffType . ON , org . eclipse . smarthome . core . library . types . OnOffType . OFF ) ) ; org . eclipse . smarthome . core . items . GroupItem g2 = new org . eclipse . smarthome . core . items . GroupItem ( "testGroup" , new org . eclipse . smarthome . core . library . items . NumberItem ( "test" ) , new org . eclipse . smarthome . core . library . types . ArithmeticGroupFunction . Or ( org . eclipse . smarthome . core . library . types . OnOffType . ON , org . eclipse . smarthome . core . library . types . OnOffType . OFF ) ) ; "<AssertPlaceHolder>" ; } hasItemChanged ( org . eclipse . smarthome . core . items . Item , org . eclipse . smarthome . core . items . Item ) { return ( ( ( ( ( ( ( ! ( java . util . Objects . equals ( item1 . getClass ( ) , item2 . getClass ( ) ) ) ) || ( ! ( java . util . Objects . equals ( item1 . getName ( ) , item2 . getName ( ) ) ) ) ) || ( ! ( java . util . Objects . equals ( item1 . getCategory ( ) , item2 . getCategory ( ) ) ) ) ) || ( ! ( java . util . Objects . equals ( item1 . getGroupNames ( ) , item2 . getGroupNames ( ) ) ) ) ) || ( ! ( java . util . Objects . equals ( item1 . getLabel ( ) , item2 . getLabel ( ) ) ) ) ) || ( ! ( java . util . Objects . equals ( item1 . getTags ( ) , item2 . getTags ( ) ) ) ) ) || ( ! ( java . util . Objects . equals ( item1 . getType ( ) , item2 . getType ( ) ) ) ) ) || ( hasGroupItemChanged ( item1 , item2 ) ) ; }
|
org . junit . Assert . assertTrue ( gip . hasItemChanged ( g1 , g2 ) )
|
testNeighborState ( ) { isisNeighbor . setNeighborState ( IsisInterfaceState . DOWN ) ; isisInterfaceState = isisNeighbor . neighborState ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
|
org . junit . Assert . assertThat ( isisInterfaceState , org . hamcrest . CoreMatchers . is ( IsisInterfaceState . DOWN ) )
|
fromNumericCodeWorksWithExistingValuesExceptForUicFranc ( ) { for ( fr . marcwrobel . jbanking . IsoCurrency currency : fr . marcwrobel . jbanking . IsoCurrency . values ( ) ) { if ( currency != ( IsoCurrency . UIC_FRANC ) ) { "<AssertPlaceHolder>" ; } } } fromNumericCode ( java . lang . Integer ) { if ( code == null ) { return fr . marcwrobel . jbanking . IsoCurrency . NO_UNIVERSAL_CURRENCY ; } if ( ( code < ( fr . marcwrobel . jbanking . IsoCurrency . MIN_NUMERIC_CODE ) ) || ( code > ( fr . marcwrobel . jbanking . IsoCurrency . MAX_NUMERIC_CODE ) ) ) { return null ; } for ( fr . marcwrobel . jbanking . IsoCurrency currency : fr . marcwrobel . jbanking . IsoCurrency . values ( ) ) { if ( code . equals ( currency . getNumericCode ( ) ) ) { return currency ; } } return null ; }
|
org . junit . Assert . assertEquals ( currency , fr . marcwrobel . jbanking . IsoCurrency . fromNumericCode ( currency . getNumericCode ( ) ) )
|
testGetMenuItem ( ) { "<AssertPlaceHolder>" ; } getMenuItem ( ) { return menuItem ; }
|
org . junit . Assert . assertEquals ( item , menuItem . getMenuItem ( ) )
|
testRegExPattern ( ) { java . lang . String str = null ; java . lang . String regex = null ; java . util . regex . Pattern p = null ; java . util . regex . Matcher m = null ; str = "191.254.169.46||IPc986b1a0b0d88d5fb2629f||URL-2-2-3-y-h-r-t-7-.v32c-to-5-8w-0yc-tzl8-h2a-7f-ezc-oxt1-7-8y-0elh-be-3k-d.info||DOMAIN" ; regex = "^.+\\|\\|.+\\|\\|.*" ; p = java . util . regex . Pattern . compile ( regex ) ; m = p . matcher ( str ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( m . matches ( ) )
|
test ( ) { org . reunionemu . jreunion . model . Quest quest = questDao . findById ( 1 ) ; "<AssertPlaceHolder>" ; } findById ( int ) { for ( org . reunionemu . jreunion . model . Quest quest : quests ) { if ( ( quest . getId ( ) ) == id ) { return quest ; } } throw new java . lang . IllegalStateException ( ( ( "Quest<sp>with<sp>id:<sp>" + id ) + "<sp>not<sp>found" ) ) ; }
|
org . junit . Assert . assertNotNull ( quest )
|
testOptions1 ( ) { ch . qos . logback . core . pattern . parser . Parser < java . lang . Object > p = new ch . qos . logback . core . pattern . parser . Parser ( "%45x{a,<sp>b}" ) ; ch . qos . logback . core . pattern . parser . Node t = p . parse ( ) ; ch . qos . logback . core . pattern . parser . SimpleKeywordNode witness = new ch . qos . logback . core . pattern . parser . SimpleKeywordNode ( "x" ) ; witness . setFormatInfo ( new ch . qos . logback . core . pattern . FormatInfo ( 45 , Integer . MAX_VALUE ) ) ; java . util . List < java . lang . String > ol = new java . util . ArrayList < java . lang . String > ( ) ; ol . add ( "a" ) ; ol . add ( "b" ) ; witness . setOptions ( ol ) ; "<AssertPlaceHolder>" ; } setOptions ( java . util . List ) { this . optionList = optionList ; }
|
org . junit . Assert . assertEquals ( witness , t )
|
testEncryptDecryptRSA15WrapA128CBCHS256 ( ) { final java . lang . String specPlainText = "Live<sp>long<sp>and<sp>prosper." ; java . security . interfaces . RSAPublicKey publicKey = org . apache . cxf . rt . security . crypto . CryptoUtils . getRSAPublicKey ( org . apache . cxf . rs . security . jose . jwe . JweCompactReaderWriterTest . RSA_MODULUS_ENCODED_A1 , org . apache . cxf . rs . security . jose . jwe . JweCompactReaderWriterTest . RSA_PUBLIC_EXPONENT_ENCODED_A1 ) ; org . apache . cxf . rs . security . jose . jwe . KeyEncryptionProvider keyEncryption = new org . apache . cxf . rs . security . jose . jwe . RSAKeyEncryptionAlgorithm ( publicKey , org . apache . cxf . rs . security . jose . jwa . KeyAlgorithm . RSA1_5 ) ; org . apache . cxf . rs . security . jose . jwe . JweEncryptionProvider encryption = new org . apache . cxf . rs . security . jose . jwe . AesCbcHmacJweEncryption ( org . apache . cxf . rs . security . jose . jwa . ContentAlgorithm . A128CBC_HS256 , org . apache . cxf . rs . security . jose . jwe . JweCompactReaderWriterTest . CONTENT_ENCRYPTION_KEY_A3 , org . apache . cxf . rs . security . jose . jwe . JweCompactReaderWriterTest . INIT_VECTOR_A3 , keyEncryption ) ; java . lang . String jweContent = encryption . encrypt ( specPlainText . getBytes ( StandardCharsets . UTF_8 ) , null ) ; java . security . interfaces . RSAPrivateKey privateKey = org . apache . cxf . rt . security . crypto . CryptoUtils . getRSAPrivateKey ( org . apache . cxf . rs . security . jose . jwe . JweCompactReaderWriterTest . RSA_MODULUS_ENCODED_A1 , org . apache . cxf . rs . security . jose . jwe . JweCompactReaderWriterTest . RSA_PRIVATE_EXPONENT_ENCODED_A1 ) ; org . apache . cxf . rs . security . jose . jwe . KeyDecryptionProvider keyDecryption = new org . apache . cxf . rs . security . jose . jwe . RSAKeyDecryptionAlgorithm ( privateKey , org . apache . cxf . rs . security . jose . jwa . KeyAlgorithm . RSA1_5 ) ; org . apache . cxf . rs . security . jose . jwe . JweDecryptionProvider decryption = new org . apache . cxf . rs . security . jose . jwe . AesCbcHmacJweDecryption ( keyDecryption ) ; java . lang . String decryptedText = decryption . decrypt ( jweContent ) . getContentText ( ) ; "<AssertPlaceHolder>" ; } getContentText ( ) { return new java . lang . String ( getContent ( ) , java . nio . charset . StandardCharsets . UTF_8 ) ; }
|
org . junit . Assert . assertEquals ( specPlainText , decryptedText )
|
testBuildWithDisabledStatusConstraint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . enrolment . status . EnrolmentStatus context = new org . lnu . is . domain . enrolment . status . EnrolmentStatus ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>EnrolmentStatus<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . enrolment . status . EnrolmentStatus > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testLogout ( ) { org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModule loginModule = org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . initLoginModule ( org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . TestCredentials . class , com . google . common . collect . ImmutableMap . of ( ) ) ; "<AssertPlaceHolder>" ; } logout ( ) { boolean success = false ; if ( ( ! ( subject . getPrincipals ( ) . isEmpty ( ) ) ) && ( ! ( subject . getPublicCredentials ( javax . jcr . Credentials . class ) . isEmpty ( ) ) ) ) { if ( ! ( subject . isReadOnly ( ) ) ) { subject . getPrincipals ( ) . clear ( ) ; subject . getPublicCredentials ( ) . clear ( ) ; } success = true ; } return success ; }
|
org . junit . Assert . assertFalse ( loginModule . logout ( ) )
|
testMultipleDefeats ( ) { org . kie . api . runtime . KieSession kSession = getSession ( "org/drools/compiler/beliefsystem/defeasible/multiDefeat.drl" ) ; kSession . fireAllRules ( ) ; org . drools . core . common . TruthMaintenanceSystem tms = ( ( org . drools . core . common . NamedEntryPoint ) ( kSession . getEntryPoint ( "DEFAULT" ) ) ) . getTruthMaintenanceSystem ( ) ; org . kie . api . definition . type . FactType Xtype = kSession . getKieBase ( ) . getFactType ( "org.drools.defeasible" , "X" ) ; org . drools . core . util . ObjectHashMap keys = tms . getEqualityKeyMap ( ) ; org . drools . core . util . Iterator iter = keys . iterator ( ) ; org . drools . core . util . ObjectHashMap . ObjectEntry entry ; while ( ( entry = ( ( org . drools . core . util . ObjectHashMap . ObjectEntry ) ( iter . next ( ) ) ) ) != null ) { org . drools . core . common . EqualityKey key = ( ( org . drools . core . common . EqualityKey ) ( entry . getValue ( ) ) ) ; java . lang . Class factClass = key . getFactHandle ( ) . getObject ( ) . getClass ( ) ; if ( factClass == ( Xtype . getFactClass ( ) ) ) { checkStatus ( key , 2 , DefeasibilityStatus . DEFEATEDLY ) ; } else { org . junit . Assert . fail ( ( "Unrecognized<sp>object<sp>has<sp>been<sp>logically<sp>justified<sp>:<sp>" + factClass ) ) ; } } for ( java . lang . Object o : kSession . getObjects ( ) ) { System . out . println ( o ) ; } "<AssertPlaceHolder>" ; kSession . fireAllRules ( ) ; } getObjects ( ) { return null ; }
|
org . junit . Assert . assertEquals ( 2 , kSession . getObjects ( ) . size ( ) )
|
testMonitoringTrue ( ) { com . sun . enterprise . universal . xml . MiniXmlParser instance = new com . sun . enterprise . universal . xml . MiniXmlParser ( com . sun . enterprise . universal . xml . MiniXmlParserTest . monitoringTrue , "server" ) ; "<AssertPlaceHolder>" ; } isMonitoringEnabled ( ) { org . glassfish . flashlight . FlashlightUtils . ok ( ) ; return org . glassfish . flashlight . FlashlightUtils . monitoringEnabled ; }
|
org . junit . Assert . assertTrue ( instance . isMonitoringEnabled ( ) )
|
testNN_AtmCorrCheckOutputNode ( ) { int numNodesInput = 18 ; int numNodesOutput = 10 ; int checkOutputNode = org . esa . s3tbx . fub . wew . util . NN_CHL . compute ( in , numNodesInput , out , numNodesOutput , width , mask , 0 , a ) ; "<AssertPlaceHolder>" ; } compute ( float [ ] [ ] , int , float [ ] [ ] , int , int , int [ ] , int , float [ ] ) { final int [ ] rcheck ; final int nodes_input = 18 ; final int nodes_output = 1 ; final int nodes_input_bias = 1 ; final int nodes_input_pca = 1 ; final int nodes_hidden = 100 ; final int nodes_hidden_bias = 1 ; final double nodes_hidden_temperature = 1.0 ; final double t_input = nodes_hidden_temperature / ( ( double ) ( nodes_input ) ) ; final double t_hidden = nodes_hidden_temperature / ( ( double ) ( nodes_hidden ) ) ; final double [ ] vt ; final double [ ] vt1 ; if ( getNumNodesInput <= 0 ) { return nodes_input ; } if ( getNumNodesOutput <= 0 ) { return nodes_output ; } if ( getNumNodesInput != nodes_input ) { return - 1 ; } if ( getNumNodesOutput != nodes_output ) { return - 2 ; } vt = new double [ nodes_input + nodes_input_bias ] ; vt1 = new double [ nodes_hidden + nodes_hidden_bias ] ; rcheck = new int [ width ] ; for ( int x = 0 ; x < width ; x ++ ) { rcheck [ x ] = 0 ; if ( ( a [ x ] ) < 0.0F ) { rcheck [ x ] = 1 ; } a [ x ] = 1.0F ; } for ( int x = 0 ; x < width ; x ++ ) { if ( ( mask [ x ] ) == 0 ) { if ( ( rcheck [ x ] ) != 0 ) { for ( int i = 0 ; ( i < nodes_input ) && ( ( a [ x ] ) > 0.0F ) ; i ++ ) { if ( ( ( in [ i ] [ x ] ) < ( ( float ) ( NN_General . NODES_INPUT_SCALE_LIMITS [ i ] [ 0 ] ) ) ) || ( ( in [ i ] [ x ] ) > ( ( float ) ( NN_General . NODES_INPUT_SCALE_LIMITS [ i ] [ 1 ] ) ) ) ) { a [ x ] -= 3.0F ; } } if ( ( a [ x ] ) < 0.0F ) { mask [ x ] |= errmask ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == ( - 1 ) ) { in [ i ] [ x ] = ( ( float ) ( java . lang . Math . log ( ( ( double ) ( in [ i ] [ x ] ) ) ) ) ) ; } if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == ( - 2 ) ) { in [ i ] [ x ] = ( ( float ) ( java . lang . Math . exp ( ( ( double ) ( in [ i ] [ x ] ) ) ) ) ) ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { in [ i ] [ x ] = ( ( float ) ( NN_General . NODES_INPUT_SCALE_OFF [ i ] ) ) + ( ( ( in [ i ] [ x ] ) - ( ( float ) ( org . esa . s3tbx . fub . wew . util . NN_CHL . nodes_input_scale_run46 [ i ] [ 0 ] ) ) ) / ( ( float ) ( org . esa . s3tbx . fub . wew . util . NN_CHL . nodes_input_scale_run46 [ i ] [ 1 ] ) ) ) ; } if ( nodes_input_pca != 0 ) { for ( int i = 0 ; i < nodes_input ; i ++ ) { vt [ i ] = ( ( double ) ( in [ i ] [ x ] ) ) ; if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == 1 ) { vt [ i ] = 0.0 ; for ( int j = 0 ; j < nodes_input ; j ++ ) { if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ j ] ) == 1 ) { vt [ i ] += ( ( double ) ( in [ j ] [ x ] ) ) * ( org . esa . s3tbx . fub . wew . util . NN_CHL . nodes_input_pca_evec_run46 [ j ] [ i ] ) ; } } } } for ( int i = 0 ; i < nodes_input ; i ++ ) { in [ i ] [ x ] = ( ( float ) ( vt [ i ] ) ) ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { vt [ i ] = ( ( double ) ( in [ i ] [ x ] ) ) ; } for ( int i = nodes_input ; i < ( nodes_input + nodes_input_bias ) ; i ++ ) { vt [ i ] = 1.0 ; } for ( int i = 0 ; i < nodes_hidden ; i ++ ) { vt1 [ i ] = 0.0 ; for ( int j = 0 ; j < ( nodes_input + nodes_input_bias ) ; j ++ ) { vt1 [ i ] += ( vt [ j ] ) * ( org . esa . s3tbx . fub . wew .
|
org . junit . Assert . assertEquals ( ( - 2 ) , checkOutputNode )
|
shipmentViolationAtStart_shouldWork ( ) { buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore ( ) ; com . graphhopper . jsprit . core . analysis . SolutionAnalyser analyser = new com . graphhopper . jsprit . core . analysis . SolutionAnalyser ( vrp , solution , vrp . getTransportCosts ( ) ) ; com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route = solution . getRoutes ( ) . iterator ( ) . next ( ) ; java . lang . Boolean violation = analyser . hasShipmentConstraintViolationAtActivity ( route . getStart ( ) , route ) ; "<AssertPlaceHolder>" ; } getStart ( ) { return start ; }
|
org . junit . Assert . assertFalse ( violation )
|
testRepeatedOr ( ) { org . opengis . filter . expression . PropertyName p = ff . property ( "prop" ) ; org . opengis . filter . Or orFilter = ff . or ( java . util . Arrays . asList ( ff . equal ( p , ff . literal ( "zero" ) , true ) , ff . equal ( p , ff . literal ( "one" ) , true ) , ff . equal ( p , ff . literal ( "two" ) , true ) ) ) ; org . geotools . jdbc . NullHandlingVisitor nh = new org . geotools . jdbc . NullHandlingVisitor ( ) ; org . opengis . filter . Filter nhResult = ( ( org . opengis . filter . Filter ) ( orFilter . accept ( nh , null ) ) ) ; org . opengis . filter . Filter expected = ff . and ( java . util . Arrays . asList ( orFilter , ff . not ( ff . isNull ( p ) ) ) ) ; "<AssertPlaceHolder>" ; } isNull ( org . opengis . filter . expression . Expression ) { return ( ( exp == null ) || ( exp instanceof org . opengis . filter . expression . NilExpression ) ) || ( ( exp instanceof org . geotools . filter . ConstantExpression ) && ( ( ( ( org . geotools . filter . ConstantExpression ) ( exp ) ) . getValue ( ) ) == null ) ) ; }
|
org . junit . Assert . assertEquals ( expected , nhResult )
|
testStore ( ) { for ( org . springframework . context . ApplicationContext context : AppContextSetup . contextList ) { org . apache . taverna . reference . ListDao dao = ( ( org . apache . taverna . reference . ListDao ) ( context . getBean ( "testListDao" ) ) ) ; org . apache . taverna . reference . impl . T2ReferenceImpl r = new org . apache . taverna . reference . impl . T2ReferenceImpl ( ) ; r . setNamespacePart ( "testNamespace0" ) ; r . setLocalPart ( "testLocal0" ) ; r . setReferenceType ( T2ReferenceType . IdentifiedList ) ; r . setDepth ( 0 ) ; r . setContainsErrors ( false ) ; org . apache . taverna . reference . impl . T2ReferenceListImpl newList = new org . apache . taverna . reference . impl . T2ReferenceListImpl ( ) ; newList . setTypedId ( r ) ; dao . store ( newList ) ; "<AssertPlaceHolder>" ; } } get ( int ) { return listDelegate . get ( index ) ; }
|
org . junit . Assert . assertNotNull ( dao . get ( r ) )
|
GetBestMatchWithNoDriver ( ) { org . osgi . service . device . Match match = m_matcherImpl . getBestMatch ( ) ; "<AssertPlaceHolder>" ; } getBestMatch ( ) { if ( m_map . isEmpty ( ) ) { return null ; } int matchValue = m_map . lastKey ( ) ; java . util . List < org . apache . felix . das . DriverAttributes > das = m_map . get ( matchValue ) ; if ( ( das . size ( ) ) == 1 ) { return new org . apache . felix . das . util . DriverMatcher . MatchImpl ( das . get ( 0 ) . getReference ( ) , matchValue ) ; } final java . util . SortedMap < org . osgi . framework . ServiceReference , org . osgi . service . device . Match > matches = new java . util . TreeMap < org . osgi . framework . ServiceReference , org . osgi . service . device . Match > ( new org . apache . felix . das . util . DriverMatcher . ServicePriority ( ) ) ; for ( org . apache . felix . das . DriverAttributes da : das ) { matches . put ( da . getReference ( ) , new org . apache . felix . das . util . DriverMatcher . MatchImpl ( da . getReference ( ) , matchValue ) ) ; } org . osgi . framework . ServiceReference last = matches . lastKey ( ) ; return matches . get ( last ) ; }
|
org . junit . Assert . assertNull ( match )
|
doNotDeleteNewSlaveIfInstanceRequired ( ) { jenkins . plugins . openstack . compute . JCloudsCloud cloud = j . configureSlaveLaunchingWithFloatingIP ( j . dummyCloud ( j . dummySlaveTemplate ( j . defaultSlaveOptions ( ) . getBuilder ( ) . retentionTime ( 0 ) . instancesMin ( 1 ) . build ( ) , "label" ) ) ) ; jenkins . plugins . openstack . compute . JCloudsSlave slave = j . provision ( cloud , "label" ) ; jenkins . plugins . openstack . compute . JCloudsComputer computer = slave . getComputer ( ) ; computer . waitUntilOnline ( ) ; computer . getRetentionStrategy ( ) . check ( computer ) ; "<AssertPlaceHolder>" ; } isPendingDelete ( ) { return ( offlineCause ) instanceof jenkins . plugins . openstack . compute . JCloudsComputer . PendingTermination ; }
|
org . junit . Assert . assertFalse ( computer . isPendingDelete ( ) )
|
shouldAllowEmptyNamespaceUriInConstructor ( ) { name = new org . modeshape . jcr . value . basic . BasicName ( "" , validLocalName ) ; "<AssertPlaceHolder>" ; } getNamespaceUri ( ) { return namespaceUri ; }
|
org . junit . Assert . assertThat ( name . getNamespaceUri ( ) , org . hamcrest . core . Is . is ( "" ) )
|
getWhenBlocks ( ) { com . alibaba . citrus . service . pipeline . Pipeline [ ] pipelines = new com . alibaba . citrus . service . pipeline . Pipeline [ ] { createPipeline ( ) , createPipeline ( ) } ; valve . setWhenBlocks ( pipelines ) ; "<AssertPlaceHolder>" ; } getWhenBlocks ( ) { com . alibaba . citrus . service . pipeline . Pipeline [ ] pipelines = new com . alibaba . citrus . service . pipeline . Pipeline [ ] { createPipeline ( ) , createPipeline ( ) } ; valve . setWhenBlocks ( pipelines ) ; org . junit . Assert . assertArrayEquals ( pipelines , valve . getWhenBlocks ( ) ) ; }
|
org . junit . Assert . assertArrayEquals ( pipelines , valve . getWhenBlocks ( ) )
|
deleteNotExistingId ( ) { com . ebay . cloud . cms . model . raptor_paas . ApplicationService deleteServ = new com . ebay . cloud . cms . model . raptor_paas . ApplicationService ( ) ; deleteServ . set_id ( "invalid-oid" ) ; com . ebay . cloud . cms . typsafe . service . CMSClientServiceTest . raptorService . delete ( deleteServ ) ; com . ebay . cloud . cms . typsafe . entity . GenericCMSEntity entity = com . ebay . cloud . cms . typsafe . service . CMSClientServiceTest . raptorService . get ( deleteServ . get_id ( ) , deleteServ . get_type ( ) , new com . ebay . cloud . cms . typsafe . service . CMSClientContext ( ) ) ; "<AssertPlaceHolder>" ; } get_type ( ) { return ( ( java . lang . String ) ( getFieldValue ( "_type" ) ) ) ; }
|
org . junit . Assert . assertNull ( entity )
|
getGroupMembersCount ( ) { System . out . println ( ( ( cz . metacentrum . perun . core . entry . GroupsManagerEntryIntegrationTest . CLASS_NAME ) + "getGroupMembersCount" ) ) ; vo = setUpVo ( ) ; setUpGroup ( vo ) ; cz . metacentrum . perun . core . api . Member member = setUpMember ( vo ) ; groupsManager . addMember ( sess , group , member ) ; int count = groupsManager . getGroupMembersCount ( sess , group ) ; "<AssertPlaceHolder>" ; } getGroupMembersCount ( cz . metacentrum . perun . core . api . PerunSession , cz . metacentrum . perun . core . api . Group ) { java . util . List < cz . metacentrum . perun . core . api . Member > members = this . getGroupMembers ( sess , group ) ; return members . size ( ) ; }
|
org . junit . Assert . assertTrue ( ( count == 1 ) )
|
testSadPath ( ) { ( ( com . krillsson . sysapi . core . metrics . rasbian . RaspbianLinuxInfoProviderTest . TestableRaspbianLinuxInfoProvider ) ( infoProvider ) ) . setCommandOutput ( "volt=NaNV" ) ; double voltage = infoProvider . cpuVoltage ( ) ; "<AssertPlaceHolder>" ; } cpuVoltage ( ) { java . lang . String vcgenCmdAnswer = executeCommand ( ) ; if ( ( vcgenCmdAnswer != null ) && ( ( vcgenCmdAnswer . length ( ) ) > 1 ) ) { java . lang . String trimmed = vcgenCmdAnswer . replace ( "volt=" , "" ) . replace ( "V" , "" ) ; try { java . lang . Double value = java . lang . Double . valueOf ( trimmed ) ; if ( ( value . isInfinite ( ) ) || ( value . isNaN ( ) ) ) { return 0.0 ; } else { return value ; } } catch ( java . lang . NumberFormatException e ) { com . krillsson . sysapi . core . metrics . rasbian . RaspbianCpuMetrics . LOGGER . error ( "Error<sp>while<sp>parsing<sp>vcgencmd<sp>command" , e ) ; return 0.0 ; } } return super . cpuVoltage ( ) ; }
|
org . junit . Assert . assertEquals ( 0.0 , voltage , 0.0 )
|
testCommitOnePhase ( ) { com . arjuna . ats . internal . jts . orbspecific . ControlImple cont = new com . arjuna . ats . internal . jts . orbspecific . ControlImple ( null , null ) ; org . omg . CosTransactions . Control theControl = cont . getControl ( ) ; com . arjuna . ats . internal . jts . orbspecific . coordinator . ArjunaTransactionImple tx = cont . getImplHandle ( ) ; com . arjuna . ats . internal . jts . orbspecific . interposition . ServerControl sc = new com . arjuna . ats . internal . jts . orbspecific . interposition . ServerControl ( tx . get_uid ( ) , theControl , tx , theControl . get_coordinator ( ) , theControl . get_terminator ( ) ) ; com . arjuna . ats . internal . jts . orbspecific . interposition . resources . osi . ServerOSITopLevelAction act = new com . arjuna . ats . internal . jts . orbspecific . interposition . resources . osi . ServerOSITopLevelAction ( sc , true ) ; act . commit_one_phase ( ) ; "<AssertPlaceHolder>" ; } type ( ) { return io . narayana . lra . coordinator . domain . model . Transaction . LRA_TYPE ; }
|
org . junit . Assert . assertTrue ( ( ( act . type ( ) ) != null ) )
|
testStopInstance_Null ( ) { org . easymock . EasyMock . expect ( computeRpcMock . stop ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getZone ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getInstance ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . EMPTY_RPC_OPTIONS ) ) . andReturn ( null ) ; org . easymock . EasyMock . replay ( computeRpcMock ) ; compute = options . getService ( ) ; "<AssertPlaceHolder>" ; } stop ( com . google . cloud . compute . deprecated . Compute . OperationOption [ ] ) { return compute . stop ( getInstanceId ( ) , options ) ; }
|
org . junit . Assert . assertNull ( compute . stop ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID ) )
|
newInstance_cmd ( ) { java . io . File cmd = putExec ( "bin/hadoop" ) ; create ( "conf/hadoop-env.sh" ) ; putConf ( "conf/core-site.xml" ) ; java . util . Map < java . lang . String , java . lang . String > envp = new java . util . HashMap ( ) ; envp . put ( "HADOOP_CMD" , cmd . getAbsolutePath ( ) ) ; org . apache . hadoop . conf . Configuration conf = new com . asakusafw . runtime . util . hadoop . ConfigurationProvider ( envp ) . newInstance ( ) ; "<AssertPlaceHolder>" ; } isLoaded ( org . apache . hadoop . conf . Configuration ) { return c . get ( "testing.conf" , "not<sp>added" ) . equals ( "added" ) ; }
|
org . junit . Assert . assertThat ( isLoaded ( conf ) , is ( true ) )
|
resetPropertyValueOnResourceRelationForContextShouldThrowExceptionWhenWhenResourceUpdatePermissionIsMissing ( ) { java . lang . String resourceGroupName = "resourceGroupName" ; java . lang . String releaseName = "releaseName" ; java . lang . String relatedResourceGroupName = "relatedResourceGroupName" ; java . lang . String relatedResourceReleaseName = "relatedResourceReleaseName" ; java . lang . String contextName = "contextName" ; java . lang . String propertyName = "propertyName" ; ch . puzzle . itc . mobiliar . business . property . boundary . PropertyDescriptorEntity propertyDescriptorMock = ch . puzzle . itc . mobiliar . business . property . boundary . Mockito . mock ( ch . puzzle . itc . mobiliar . business . property . boundary . PropertyDescriptorEntity . class ) ; ch . puzzle . itc . mobiliar . business . property . boundary . PropertyEntity property = new ch . puzzle . itc . mobiliar . business . property . boundary . PropertyEntity ( ) ; property . setDescriptor ( propertyDescriptorMock ) ; ch . puzzle . itc . mobiliar . business . property . boundary . Set < ch . puzzle . itc . mobiliar . business . property . boundary . PropertyEntity > properties = new ch . puzzle . itc . mobiliar . business . property . boundary . HashSet ( ) ; properties . add ( property ) ; ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ConsumedResourceRelationEntity relationWithMasterAndSlave = createWithMasterAndSlave ( resourceGroupName , relatedResourceGroupName ) ; ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity contextMock = mock ( ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity . class ) ; when ( resourceRelationLocatorMock . getResourceRelation ( resourceGroupName , releaseName , relatedResourceGroupName , relatedResourceReleaseName ) ) . thenReturn ( relationWithMasterAndSlave ) ; when ( contextLocatorMock . getContextByName ( contextName ) ) . thenReturn ( contextMock ) ; when ( entityManagerMock . find ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class , 1 ) ) . thenReturn ( mock ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class ) ) ; when ( entityManagerMock . find ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class , 2 ) ) . thenReturn ( mock ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class ) ) ; when ( resourceRelationContextRepositoryMock . getResourceRelationContext ( any ( ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ConsumedResourceRelationEntity . class ) , any ( ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity . class ) ) ) . thenReturn ( resourceRelationContextEntityMock ) ; when ( resourceRelationContextEntityMock . getProperties ( ) ) . thenReturn ( properties ) ; when ( propertyDescriptorMock . getPropertyName ( ) ) . thenReturn ( propertyName ) ; when ( permissionBoundaryMock . hasPermission ( Permission . RESOURCE , contextMock , Action . UPDATE , relationWithMasterAndSlave . getMasterResource ( ) , null ) ) . thenReturn ( false ) ; when ( permissionBoundaryMock . hasPermission ( Permission . RESOURCE_PROPERTY_DECRYPT , contextMock , Action . ALL , relationWithMasterAndSlave . getMasterResource ( ) , null ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; verify ( propertyValueServiceMock , never ( ) ) . decryptProperties ( anyList ( ) ) ; editor . resetPropertyValueOnResourceRelationForContext ( resourceGroupName , releaseName , relatedResourceGroupName , relatedResourceReleaseName , contextName , propertyName ) ; } isEmpty ( ) { if ( ( ( asProperties ) != null ) && ( ! ( asProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( nodeProperties ) != null ) && ( ! ( nodeProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( consumerUnit ) != null ) && ( ! ( consumerUnit . isEmpty ( ) ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertFalse ( properties . isEmpty ( ) )
|
testAddAll ( ) { inventory . clear ( ) ; inventory . addAll ( items ) ; "<AssertPlaceHolder>" ; } containsAll ( java . util . Collection ) { java . util . Iterator < ? > i = objects . iterator ( ) ; while ( i . hasNext ( ) ) { if ( ! ( contains ( i . next ( ) ) ) ) { return false ; } } return true ; }
|
org . junit . Assert . assertTrue ( inventory . containsAll ( items ) )
|
testWriteMBeanQuery ( ) { com . ibm . ws . jmx . connector . datatypes . MBeanQuery mBean = new com . ibm . ws . jmx . connector . datatypes . MBeanQuery ( ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; java . lang . StringBuilder str = new java . lang . StringBuilder ( ) ; try { mBean . className = com . ibm . ws . jmx . connector . converter . JSONConverterTest . TEST_MBEAN_QUERY_INSTANCE ; mBean . objectName = new javax . management . ObjectName ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . TEST_MBEAN_QUERY_OBJ_NAME , com . ibm . ws . jmx . connector . converter . JSONConverterTest . TEST_MBEAN_QUERY_OBJ_KEY , com . ibm . ws . jmx . connector . converter . JSONConverterTest . TEST_MBEAN_QUERY_OBJ_VALUE ) ; str . append ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . OPEN_JSON ) ; str . append ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . encloseString ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . N_OBJECTNAME , mBean . objectName . getCanonicalName ( ) ) ) ; str . append ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . COMMA ) ; str . append ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . encloseString ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . N_CLASSNAME , mBean . className ) ) ; str . append ( com . ibm . ws . jmx . connector . converter . JSONConverterTest . CLOSE_JSON ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Exception<sp>encountered<sp>while<sp>setting<sp>up<sp>test<sp>parameters" + e ) ) ; } try { converter . writeMBeanQuery ( out , mBean ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Exception<sp>encountered<sp>during<sp>testing<sp>" + e ) ) ; } } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( 128 ) ; sb . append ( getClass ( ) . getSimpleName ( ) ) ; sb . append ( '@' ) . append ( java . lang . Integer . toHexString ( hashCode ( ) ) ) ; sb . append ( "<sp>writing=" ) . append ( this . writing ) ; sb . append ( "<sp>closed=" ) . append ( this . closed ) ; sb . append ( "<sp>bufferedCount=" ) . append ( this . bufferedCount ) ; sb . append ( "<sp>bytesWritten=" ) . append ( this . bytesWritten ) ; sb . append ( "<sp>error=" ) . append ( this . error ) ; if ( null != ( this . output ) ) { sb . append ( "<sp>outindex=" ) . append ( this . outputIndex ) ; for ( int i = 0 ; i < ( this . output . length ) ; i ++ ) { sb . append ( "\r\n\t" ) . append ( this . output [ i ] ) ; } } return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( out . toString ( ) , str . toString ( ) )
|
testGetKey ( ) { "<AssertPlaceHolder>" ; } getApnsKey ( ) { return com . turo . pushy . apns . auth . ApnsVerificationKey . loadFromInputStream ( this . getClass ( ) . getResourceAsStream ( "/token-auth-public-key.p8" ) , "Team<sp>ID" , "Key<sp>ID" ) ; }
|
org . junit . Assert . assertNotNull ( this . getApnsKey ( ) . getKey ( ) )
|
testGetSignalKillCommand ( ) { java . lang . String anyPid = "9999" ; int anySignal = 9 ; java . lang . String [ ] checkProcessAliveCommand = getSignalKillCommand ( anySignal , anyPid ) ; java . lang . String [ ] expectedCommand ; if ( org . apache . hadoop . util . Shell . Shell . WINDOWS ) { expectedCommand = new java . lang . String [ ] { getWinUtilsPath ( ) , "task" , "kill" , anyPid } ; } else if ( org . apache . hadoop . util . Shell . Shell . isSetsidAvailable ) { expectedCommand = new java . lang . String [ ] { "bash" , "-c" , ( "kill<sp>-9<sp>--<sp>-'" + anyPid ) + "'" } ; } else { expectedCommand = new java . lang . String [ ] { "bash" , "-c" , ( "kill<sp>-9<sp>'" + anyPid ) + "'" } ; } "<AssertPlaceHolder>" ; } getWinUtilsPath ( ) { if ( ( org . apache . hadoop . util . Shell . WINUTILS_FAILURE ) == null ) { return org . apache . hadoop . util . Shell . WINUTILS_PATH ; } else { throw new java . lang . RuntimeException ( org . apache . hadoop . util . Shell . WINUTILS_FAILURE . toString ( ) , org . apache . hadoop . util . Shell . WINUTILS_FAILURE ) ; } }
|
org . junit . Assert . assertArrayEquals ( expectedCommand , checkProcessAliveCommand )
|
testMinAtRangeInclusive ( ) { parameter . setMinimumValue ( 0 , true ) ; parameter . configure ( org . apache . flink . api . java . utils . ParameterTool . fromArgs ( new java . lang . String [ ] { "--test" , "0" } ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertEquals ( new java . lang . Double ( 0 ) , parameter . getValue ( ) )
|
testAsymmetricEncryptionNoKeyValue ( ) { org . apache . camel . support . jsse . KeyStoreParameters tsParameters = new org . apache . camel . support . jsse . KeyStoreParameters ( ) ; tsParameters . setPassword ( "password" ) ; tsParameters . setResource ( "sender.ts" ) ; final org . apache . camel . dataformat . xmlsecurity . XMLSecurityDataFormat xmlEncDataFormat = new org . apache . camel . dataformat . xmlsecurity . XMLSecurityDataFormat ( ) ; xmlEncDataFormat . setKeyOrTrustStoreParameters ( tsParameters ) ; xmlEncDataFormat . setXmlCipherAlgorithm ( org . apache . camel . dataformat . xmlsecurity . XMLSecurityDataFormatTest . testCypherAlgorithm ) ; xmlEncDataFormat . setRecipientKeyAlias ( "recipient" ) ; xmlEncDataFormat . setAddKeyValueForEncryptedKey ( false ) ; context . addRoutes ( new org . apache . camel . builder . RouteBuilder ( ) { public void configure ( ) { from ( "direct:start" ) . marshal ( xmlEncDataFormat ) . to ( "mock:encrypted" ) ; } } ) ; org . w3c . dom . Document doc = xmlsecTestHelper . testEncryption ( TestHelper . XML_FRAGMENT , context ) ; org . w3c . dom . NodeList nodeList = doc . getElementsByTagNameNS ( "http://www.w3.org/2000/09/xmldsig#" , "RSAKeyValue" ) ; "<AssertPlaceHolder>" ; } getLength ( ) { return length ; }
|
org . junit . Assert . assertTrue ( ( ( nodeList . getLength ( ) ) == 0 ) )
|
shouldReturnFeatureEnabledGivenFeatureWithDayOfWeekEvaluatesToTrue ( ) { java . lang . reflect . Method method = org . flips . fixture . TestClientFlipAnnotationsWithAnnotationsOnMethod . class . getMethod ( "featureWithDayOfWeekConditionBasedAnnotation" ) ; boolean result = flipAnnotationsStore . isFeatureEnabled ( method ) ; "<AssertPlaceHolder>" ; } isFeatureEnabled ( java . lang . reflect . Method ) { return store . getOrDefault ( method , flipConditionEvaluatorFactory . getEmptyFlipConditionEvaluator ( ) ) . evaluate ( ) ; }
|
org . junit . Assert . assertEquals ( true , result )
|
testPartialRadixSortSortsKeysCorrectly ( ) { int key1 = 1 << 16 ; int key2 = 1 << 17 ; int [ ] data = new int [ ] { key2 | 25 , key1 | 1 , 0 , key2 | 10 , 25 , key1 | 10 , key1 , 10 } ; int [ ] expected = new int [ ] { 0 , 25 , 10 , key1 | 1 , key1 | 10 , key1 , key2 | 25 , key2 | 10 } ; int [ ] test = java . util . Arrays . copyOf ( data , data . length ) ; org . roaringbitmap . Util . partialRadixSort ( test ) ; "<AssertPlaceHolder>" ; } partialRadixSort ( int [ ] ) { final int radix = 8 ; int shift = 16 ; int mask = 16711680 ; int [ ] copy = new int [ data . length ] ; int [ ] histogram = new int [ ( 1 << radix ) + 1 ] ; while ( shift < 32 ) { for ( int i = 0 ; i < ( data . length ) ; ++ i ) { ++ ( histogram [ ( ( ( ( data [ i ] ) & mask ) > > > shift ) + 1 ) ] ) ; } for ( int i = 0 ; i < ( 1 << radix ) ; ++ i ) { histogram [ ( i + 1 ) ] += histogram [ i ] ; } for ( int i = 0 ; i < ( data . length ) ; ++ i ) { copy [ ( ( histogram [ ( ( ( data [ i ] ) & mask ) > > > shift ) ] ) ++ ) ] = data [ i ] ; } java . lang . System . arraycopy ( copy , 0 , data , 0 , data . length ) ; shift += radix ; mask <<= radix ; java . util . Arrays . fill ( histogram , 0 ) ; } }
|
org . junit . Assert . assertArrayEquals ( expected , test )
|
testGetUserDefinedTags ( ) { java . util . Map < java . lang . String , java . lang . String > instanceTemplateTags = com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . String > builder ( ) . put ( "t1" , "v1" ) . put ( "t2" , "v2" ) . build ( ) ; com . cloudera . director . spi . v2 . model . InstanceTemplate instanceTemplate = mock ( com . cloudera . director . spi . v2 . model . InstanceTemplate . class ) ; when ( instanceTemplate . getTags ( ) ) . thenReturn ( instanceTemplateTags ) ; com . cloudera . director . aws . CustomTagMappings customTagMappings = mock ( com . cloudera . director . aws . CustomTagMappings . class ) ; when ( customTagMappings . getCustomTagName ( "t1" ) ) . thenReturn ( "c1" ) ; when ( customTagMappings . getCustomTagName ( "t2" ) ) . thenReturn ( "c2" ) ; com . cloudera . director . aws . AbstractAWSTagHelperTest . TestAWSTagHelper tagHelper = new com . cloudera . director . aws . AbstractAWSTagHelperTest . TestAWSTagHelper ( customTagMappings ) ; java . util . Set < java . lang . String > userDefinedTags = new java . util . HashSet ( tagHelper . getUserDefinedTags ( instanceTemplate ) ) ; "<AssertPlaceHolder>" ; } createTestTag ( java . lang . String , java . lang . String ) { return ( tagKey + "." ) + tagValue ; }
|
org . junit . Assert . assertEquals ( new java . util . HashSet ( java . util . Arrays . asList ( com . cloudera . director . aws . AbstractAWSTagHelperTest . createTestTag ( "t1" , "v1" ) , com . cloudera . director . aws . AbstractAWSTagHelperTest . createTestTag ( "t2" , "v2" ) ) ) , userDefinedTags )
|
insert ( ) { io . confluent . connect . jdbc . util . TableId customers = tableId ( "customers" ) ; java . lang . String expected = "INSERT<sp>INTO<sp>`customers`(`age`,`firstName`,`lastName`)<sp>VALUES(?,?,?)" ; java . lang . String sql = dialect . buildInsertStatement ( customers , columns ( customers ) , columns ( customers , "age" , "firstName" , "lastName" ) ) ; "<AssertPlaceHolder>" ; } columns ( java . lang . String [ ] ) { return new java . util . HashSet ( java . util . Arrays . asList ( names ) ) ; }
|
org . junit . Assert . assertEquals ( expected , sql )
|
whenNotPresent ( ) { final org . apache . isis . applib . fixturescripts . FixtureScript . ExecutionContext executionContext = new org . apache . isis . applib . fixturescripts . FixtureScript . ExecutionContext ( ( ( java . lang . String ) ( null ) ) , null ) ; executionContext . setParameterIfNotPresent ( "foo" , "bar" ) ; "<AssertPlaceHolder>" ; } getParameter ( int ) { final java . util . List < org . apache . isis . core . metamodel . spec . feature . ObjectActionParameter > parameters = getParameters ( ) ; if ( position >= ( parameters . size ( ) ) ) { throw new java . lang . IllegalArgumentException ( ( ( ( "getParameter(int):<sp>only<sp>" + ( parameters . size ( ) ) ) + "<sp>parameters,<sp>position=" ) + position ) ) ; } return parameters . get ( position ) ; }
|
org . junit . Assert . assertThat ( executionContext . getParameter ( "foo" ) , org . hamcrest . CoreMatchers . is ( "bar" ) )
|
testTellInsertsSentence ( ) { kb . tell ( "(A<sp>&<sp>B)" ) ; "<AssertPlaceHolder>" ; } size ( ) { return sentences . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , kb . size ( ) )
|
createDynamicModule ( ) { de . devsurf . injection . guice . scanner . StartupModule startup = de . devsurf . injection . guice . scanner . StartupModule . create ( de . devsurf . injection . guice . scanner . asm . ASMClasspathScanner . class , de . devsurf . injection . guice . scanner . PackageFilter . create ( de . devsurf . injection . guice . test . configuration . url . override . DirectOverrideConfigTests . class ) ) ; startup . addFeature ( de . devsurf . injection . guice . configuration . features . ConfigurationFeature . class ) ; com . google . inject . Injector injector = com . google . inject . Guice . createInjector ( startup ) ; "<AssertPlaceHolder>" ; } addFeature ( de . devsurf . injection . guice . scanner . features . ScannerFeature ) { _collector . addScannerFeature ( listener ) ; }
|
org . junit . Assert . assertNotNull ( injector )
|
whenBuildingTypeJustByCallingNewInstance_capMustBeCorrect ( ) { com . graphhopper . jsprit . core . problem . vehicle . VehicleTypeImpl type = VehicleTypeImpl . Builder . newInstance ( "foo" ) . build ( ) ; "<AssertPlaceHolder>" ; } getCapacityDimensions ( ) { return capacityDimensions ; }
|
org . junit . Assert . assertEquals ( 0 , type . getCapacityDimensions ( ) . get ( 0 ) )
|
throwsIfRequestBodyForGet ( ) { boolean caught = false ; java . lang . String url = "https://jsoup.org" ; try { org . jsoup . nodes . Document doc = org . jsoup . Jsoup . connect ( url ) . requestBody ( "fail" ) . get ( ) ; } catch ( java . lang . IllegalArgumentException e ) { caught = true ; } "<AssertPlaceHolder>" ; } get ( ) { return e ; }
|
org . junit . Assert . assertTrue ( caught )
|
shouldConcatSomethingAndNoneToSomething ( ) { "<AssertPlaceHolder>" ; } of ( double , double [ ] ) { double limit = java . util . stream . DoubleStream . of ( limits ) . filter ( ( l ) -> l > 0.0 ) . min ( ) . orElse ( Double . POSITIVE_INFINITY ) ; return java . lang . Double . isFinite ( limit ) ? new org . dcache . pool . assumption . PerformanceCostAssumption ( ( limit + error ) ) : org . dcache . pool . assumption . Assumptions . none ( ) ; }
|
org . junit . Assert . assertThat ( org . dcache . pool . assumption . PerformanceCostAssumption . of ( 0 , 1 ) . and ( org . dcache . pool . assumption . Assumptions . none ( ) ) , org . hamcrest . CoreMatchers . is ( org . dcache . pool . assumption . PerformanceCostAssumption . of ( 0 , 1 ) ) )
|
test23PrefixPostfix_join_noresult3 ( ) { com . ebay . cloud . cms . query . service . QueryContext context = new com . ebay . cloud . cms . query . service . QueryContext ( raptorContext ) ; java . lang . String query = "Environment[@name<sp>in<sp>(\"EnvRaptor-invalid\")].applications[@archTier=\"app\"].services.runsOn[@name=\"compute-00010\"]<@name>" ; com . ebay . cloud . cms . query . service . IQueryResult result = queryService . query ( query , context ) ; "<AssertPlaceHolder>" ; } getEntities ( ) { return entities ; }
|
org . junit . Assert . assertEquals ( 0 , result . getEntities ( ) . size ( ) )
|
testBackForwardCache ( ) { clickEditCancelEdition ( ) ; clickEditPageInWysiwyg ( ) ; waitForEditorToLoad ( ) ; typeText ( "123" ) ; getSelenium ( ) . goBack ( ) ; waitPage ( ) ; getSelenium ( ) . runScript ( "window.history.forward()" ) ; waitPage ( ) ; waitForEditorToLoad ( ) ; "<AssertPlaceHolder>" ; } getRichTextArea ( ) { org . openqa . selenium . WebDriver driver = getDriver ( ) ; return new org . xwiki . test . wysiwyg . framework . RichTextAreaElement ( driver , driver . findElement ( org . openqa . selenium . By . className ( "gwt-RichTextArea" ) ) ) ; }
|
org . junit . Assert . assertEquals ( "123" , getRichTextArea ( ) . getText ( ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.