input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
hasAnyBranchPermission ( ) { when ( permissionEvaluator . hasAnyBranchPermission ( authentication , "project" , Permission . EDIT_PAGE ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } hasAnyBranchPermission ( java . lang . String , de . blizzy . documentr . access . Permission ) { return permissionEvaluator . hasAnyBranchPermission ( authentication , projectName , permission ) ; }
|
org . junit . Assert . assertTrue ( root . hasAnyBranchPermission ( "project" , Permission . EDIT_PAGE ) )
|
testApiMisuse4_3 ( ) { "<AssertPlaceHolder>" ; } format ( org . ocpsoft . prettytime . Duration ) { return ( duration . getQuantityRounded ( 50 ) ) + "<sp>minut" ; }
|
org . junit . Assert . assertEquals ( t . format ( new java . util . Date ( ) ) , t . format ( ( ( java . util . List < org . ocpsoft . prettytime . Duration > ) ( null ) ) ) )
|
testColumnManagementGroupTitleWorkItemSetFieldEmpty ( ) { final org . drools . workbench . models . guided . dtable . shared . model . ActionWorkItemSetFieldCol52 column = mock ( org . drools . workbench . models . guided . dtable . shared . model . ActionWorkItemSetFieldCol52 . class ) ; doReturn ( org . drools . workbench . screens . guided . dtable . client . wizard . column . pages . common . DecisionTableColumnViewUtilsTest . COLUMN_HEADER ) . when ( column ) . getHeader ( ) ; "<AssertPlaceHolder>" ; } getColumnManagementGroupTitle ( org . drools . workbench . models . guided . dtable . shared . model . BaseColumn ) { java . lang . String managementSectionHeader = null ; if ( column instanceof org . drools . workbench . models . guided . dtable . shared . model . ActionInsertFactCol52 ) { managementSectionHeader = org . drools . workbench . screens . guided . dtable . client . wizard . column . pages . common . DecisionTableColumnViewUtils . concatenateFactTypeAndBoundName ( ( ( org . drools . workbench . models . guided . dtable . shared . model . ActionInsertFactCol52 ) ( column ) ) . getFactType ( ) , ( ( org . drools . workbench . models . guided . dtable . shared . model . ActionInsertFactCol52 ) ( column ) ) . getBoundName ( ) ) ; } else if ( column instanceof org . drools . workbench . models . guided . dtable . shared . model . ActionSetFieldCol52 ) { managementSectionHeader = org . drools . workbench . screens . guided . dtable . client . wizard . column . pages . common . DecisionTableColumnViewUtils . concatenateFactTypeAndBoundName ( null , ( ( org . drools . workbench . models . guided . dtable . shared . model . ActionSetFieldCol52 ) ( column ) ) . getBoundName ( ) ) ; } else if ( column instanceof org . drools . workbench . models . guided . dtable . shared . model . Pattern52 ) { managementSectionHeader = org . drools . workbench . screens . guided . dtable . client . wizard . column . pages . common . DecisionTableColumnViewUtils . concatenateFactTypeAndBoundName ( ( ( org . drools . workbench . models . guided . dtable . shared . model . Pattern52 ) ( column ) ) . getFactType ( ) , ( ( org . drools . workbench . models . guided . dtable . shared . model . Pattern52 ) ( column ) ) . getBoundName ( ) ) ; if ( ( ( org . drools . workbench . models . guided . dtable . shared . model . Pattern52 ) ( column ) ) . isNegated ( ) ) { managementSectionHeader = ( ( GuidedDecisionTableConstants . INSTANCE . negatedPattern ( ) ) + "<sp>" ) + managementSectionHeader ; } } else if ( column instanceof org . drools . workbench . models . guided . dtable . shared . model . ActionRetractFactCol52 ) { managementSectionHeader = GuidedDecisionTableConstants . INSTANCE . RetractActions ( ) ; } else if ( column instanceof org . drools . workbench . models . guided . dtable . shared . model . ActionWorkItemCol52 ) { managementSectionHeader = GuidedDecisionTableConstants . INSTANCE . ExecuteWorkItemActions ( ) ; } else if ( column instanceof org . drools . workbench . models . guided . dtable . shared . model . BRLActionColumn ) { managementSectionHeader = GuidedDecisionTableConstants . INSTANCE . BrlActions ( ) ; } else if ( column instanceof org . drools . workbench . models . guided . dtable . shared . model . BRLConditionColumn ) { managementSectionHeader = GuidedDecisionTableConstants . INSTANCE . BrlConditions ( ) ; } if ( ( managementSectionHeader == null ) || ( managementSectionHeader . isEmpty ( ) ) ) { return column . getHeader ( ) ; } else { return managementSectionHeader ; } }
|
org . junit . Assert . assertEquals ( org . drools . workbench . screens . guided . dtable . client . wizard . column . pages . common . DecisionTableColumnViewUtilsTest . COLUMN_HEADER , org . drools . workbench . screens . guided . dtable . client . wizard . column . pages . common . DecisionTableColumnViewUtils . getColumnManagementGroupTitle ( column ) )
|
testFormatLogMessage_code_and_message_is_notnull ( ) { java . lang . String code = "code" ; java . lang . String message = "message" ; java . lang . String actualLogMessage = testTarget . formatLogMessage ( code , message ) ; java . lang . String expectedLogMessage = ( ( "[" + code ) + "]<sp>" ) + message ; "<AssertPlaceHolder>" ; } formatLogMessage ( java . lang . String , java . lang . String ) { java . lang . String bindingExceptionCode = exceptionCode ; java . lang . String bindingExceptionMessage = exceptionMessage ; if ( org . springframework . util . StringUtils . isEmpty ( bindingExceptionCode ) ) { bindingExceptionCode = defaultCode ; } if ( org . springframework . util . StringUtils . isEmpty ( bindingExceptionMessage ) ) { bindingExceptionMessage = defaultMessage ; } java . lang . String message = java . text . MessageFormat . format ( logMessageFormat , bindingExceptionCode , bindingExceptionMessage ) ; if ( trimLogMessage ) { message = message . trim ( ) ; } return message ; }
|
org . junit . Assert . assertThat ( actualLogMessage , org . hamcrest . CoreMatchers . is ( expectedLogMessage ) )
|
getRealm ( ) { com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADWildCardTest . c , "getRealm" , "Checking<sp>expected<sp>realm" ) ; "<AssertPlaceHolder>" ; } getRealm ( ) { com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADWildCardTest . c , "getRealm" , "Checking<sp>expected<sp>realm" ) ; org . junit . Assert . assertEquals ( "SampleLdapADRealm" , com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADWildCardTest . servlet . getRealm ( ) ) ; }
|
org . junit . Assert . assertEquals ( "SampleLdapADRealm" , com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADWildCardTest . servlet . getRealm ( ) )
|
testWithTimeAllowed ( ) { org . springframework . data . solr . core . SimpleQuery query = new org . springframework . data . solr . core . SimpleQuery ( new org . springframework . data . solr . core . SimpleStringCriteria ( "field_1:value_1" ) ) ; query . setTimeAllowed ( 100 ) ; org . apache . solr . client . solrj . SolrQuery solrQuery = queryParser . constructSolrQuery ( query , null ) ; "<AssertPlaceHolder>" ; } getTimeAllowed ( ) { return this . timeAllowed ; }
|
org . junit . Assert . assertEquals ( new java . lang . Integer ( 100 ) , solrQuery . getTimeAllowed ( ) )
|
testReplaceIpForVNCInDesc ( ) { final java . lang . String xmlDesc = "transformation<sp>does<sp>not<sp>live<sp>up<sp>to<sp>expectation:\n" 0 + ( ( ( ( ( "<sp><devices>" + "<sp><graphics<sp>type='vnc'<sp>port='5900'<sp>autoport='yes'<sp>listen='10.10.10.1'>" ) + "<sp><listen<sp>type='address'<sp>address='10.10.10.1'/>" ) + "<sp></graphics>" ) + "<sp></devices>" ) + "</domain>" ) ; final java . lang . String expectedXmlDesc = "transformation<sp>does<sp>not<sp>live<sp>up<sp>to<sp>expectation:\n" 0 + ( ( ( ( ( "<sp><devices>" + "<sp><graphics<sp>type='vnc'<sp>port='5900'<sp>autoport='yes'<sp>listen='10.10.10.10'>" ) + "<sp><listen<sp>type='address'<sp>address='10.10.10.10'/>" ) + "<sp></graphics>" ) + "<sp></devices>" ) + "</domain>" ) ; final java . lang . String targetIp = "10.10.10.10" ; final java . lang . String result = libvirtMigrateCmdWrapper . replaceIpForVNCInDescFile ( xmlDesc , targetIp ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; rdpclient . clip . ClipboardDataFormat other = ( ( rdpclient . clip . ClipboardDataFormat ) ( obj ) ) ; if ( ( id ) != ( other . id ) ) return false ; if ( ( name ) == null ) { if ( ( other . name ) != null ) return false ; } else if ( ! ( name . equals ( other . name ) ) ) return false ; return true ; }
|
org . junit . Assert . assertTrue ( ( "transformation<sp>does<sp>not<sp>live<sp>up<sp>to<sp>expectation:\n" + result ) , expectedXmlDesc . equals ( result ) )
|
collectPromises ( ) { io . trane . future . Promise < java . lang . Integer > p1 = io . trane . future . Promise . apply ( ) ; io . trane . future . Promise < java . lang . Integer > p2 = io . trane . future . Promise . apply ( ) ; io . trane . future . Promise < java . lang . Integer > p3 = io . trane . future . Promise . apply ( ) ; io . trane . future . Future < java . util . List < java . lang . Integer > > future = io . trane . future . Future . collect ( java . util . Arrays . asList ( p1 , p2 , p3 ) ) ; p1 . setValue ( 1 ) ; p2 . setValue ( 2 ) ; p3 . setValue ( 3 ) ; java . lang . Integer [ ] expected = new java . lang . Integer [ ] { 1 , 2 , 3 } ; java . lang . Object [ ] result = get ( future ) . toArray ( ) ; "<AssertPlaceHolder>" ; } get ( io . trane . future . Future ) { return future . get ( Duration . ZERO ) ; }
|
org . junit . Assert . assertArrayEquals ( expected , result )
|
testAddPhaseListener_twice ( ) { org . eclipse . rap . rwt . internal . lifecycle . PhaseListener phaseListener = new org . eclipse . rap . rwt . internal . lifecycle . PhaseListenerManager_Test . EmptyPhaseListener ( ) ; phaseListenerManager . addPhaseListener ( phaseListener ) ; phaseListenerManager . addPhaseListener ( phaseListener ) ; "<AssertPlaceHolder>" ; } getPhaseListeners ( ) { return asList ( phaseListenerManager . getPhaseListeners ( ) ) ; }
|
org . junit . Assert . assertEquals ( asList ( phaseListener ) , getPhaseListeners ( ) )
|
testSerialization ( ) { org . jfree . chart . renderer . xy . XYAreaRenderer r1 = new org . jfree . chart . renderer . xy . XYAreaRenderer ( ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( r1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . renderer . xy . XYAreaRenderer r2 = ( ( org . jfree . chart . renderer . xy . XYAreaRenderer ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } }
|
org . junit . Assert . assertEquals ( r1 , r2 )
|
testResolveModuleWithRootPath ( ) { final javax . enterprise . inject . spi . Bean moduleServiceBean = ( ( javax . enterprise . inject . spi . Bean ) ( beanManager . getBeans ( org . kie . workbench . common . services . shared . project . KieModuleService . class ) . iterator ( ) . next ( ) ) ) ; final javax . enterprise . context . spi . CreationalContext cc = beanManager . createCreationalContext ( moduleServiceBean ) ; final org . kie . workbench . common . services . shared . project . KieModuleService moduleService = ( ( org . kie . workbench . common . services . shared . project . KieModuleService ) ( beanManager . getReference ( moduleServiceBean , org . kie . workbench . common . services . shared . project . KieModuleService . class , cc ) ) ) ; final java . net . URL rootUrl = this . getClass ( ) . getResource ( "/ModuleBackendTestModuleStructureInvalidNoKModule" ) ; final org . uberfire . java . nio . file . Path nioRootPath = fs . getPath ( rootUrl . toURI ( ) ) ; final org . uberfire . backend . vfs . Path rootPath = paths . convert ( nioRootPath ) ; final org . guvnor . common . services . project . model . Module result = moduleService . resolveModule ( rootPath ) ; "<AssertPlaceHolder>" ; } resolveModule ( org . uberfire . backend . vfs . Path ) { return ( ( org . kie . workbench . common . services . shared . project . KieModule ) ( resourceResolver . resolveModule ( resource ) ) ) ; }
|
org . junit . Assert . assertNull ( result )
|
equalsAndHashCodeTest ( ) { org . apache . apex . malhar . lib . dimensions . DimensionsDescriptor ddA = new org . apache . apex . malhar . lib . dimensions . DimensionsDescriptor ( new org . apache . apex . malhar . lib . appdata . schemas . CustomTimeBucket ( org . apache . apex . malhar . lib . appdata . schemas . TimeBucket . MINUTE , 5L ) , new org . apache . apex . malhar . lib . appdata . schemas . Fields ( com . google . common . collect . Sets . newHashSet ( "a" , "b" ) ) ) ; org . apache . apex . malhar . lib . dimensions . DimensionsDescriptor ddB = new org . apache . apex . malhar . lib . dimensions . DimensionsDescriptor ( new org . apache . apex . malhar . lib . appdata . schemas . CustomTimeBucket ( org . apache . apex . malhar . lib . appdata . schemas . TimeBucket . MINUTE , 5L ) , new org . apache . apex . malhar . lib . appdata . schemas . Fields ( com . google . common . collect . Sets . newHashSet ( "a" , "b" ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org . apache . apex . malhar . kudu . scanner . KuduPartitionScanAssignmentMeta ) ) { return false ; } org . apache . apex . malhar . kudu . scanner . KuduPartitionScanAssignmentMeta that = ( ( org . apache . apex . malhar . kudu . scanner . KuduPartitionScanAssignmentMeta ) ( o ) ) ; if ( ( getOrdinal ( ) ) != ( that . getOrdinal ( ) ) ) { return false ; } if ( ( getTotalSize ( ) ) != ( that . getTotalSize ( ) ) ) { return false ; } return getCurrentQuery ( ) . equals ( that . getCurrentQuery ( ) ) ; }
|
org . junit . Assert . assertTrue ( ddB . equals ( ddA ) )
|
testNoMatch ( ) { org . jacoco . core . internal . analysis . ClassCoverageImpl node = new org . jacoco . core . internal . analysis . ClassCoverageImpl ( "Sample" , 12345 , true ) ; "<AssertPlaceHolder>" ; } isNoMatch ( ) { return noMatch ; }
|
org . junit . Assert . assertTrue ( node . isNoMatch ( ) )
|
testClusterFromKafka ( ) { io . strimzi . operator . user . model . acl . SimpleAclRuleResource strimzi = new io . strimzi . operator . user . model . acl . SimpleAclRuleResource ( "kafka-cluster" , SimpleAclRuleResourceType . CLUSTER , io . strimzi . api . kafka . model . AclResourcePatternType . LITERAL ) ; kafka . security . auth . Resource kafka = new kafka . security . auth . Resource ( kafka . security . auth . Cluster$ . MODULE$ , "kafka-cluster" , org . apache . kafka . common . resource . PatternType . LITERAL ) ; "<AssertPlaceHolder>" ; } fromKafkaResource ( kafka . security . auth . Resource ) { java . lang . String resourceName ; io . strimzi . operator . user . model . acl . SimpleAclRuleResourceType resourceType ; io . strimzi . api . kafka . model . AclResourcePatternType resourcePattern = null ; switch ( kafkaResource . resourceType ( ) . toJava ( ) ) { case TOPIC : resourceName = kafkaResource . name ( ) ; resourceType = SimpleAclRuleResourceType . TOPIC ; switch ( kafkaResource . patternType ( ) ) { case LITERAL : resourcePattern = io . strimzi . api . kafka . model . AclResourcePatternType . LITERAL ; break ; case PREFIXED : resourcePattern = io . strimzi . api . kafka . model . AclResourcePatternType . PREFIX ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>Resource<sp>type:<sp>" + ( kafkaResource . resourceType ( ) ) ) ) ; } break ; case GROUP : resourceType = SimpleAclRuleResourceType . GROUP ; resourceName = kafkaResource . name ( ) ; switch ( kafkaResource . patternType ( ) ) { case LITERAL : resourcePattern = io . strimzi . api . kafka . model . AclResourcePatternType . LITERAL ; break ; case PREFIXED : resourcePattern = io . strimzi . api . kafka . model . AclResourcePatternType . PREFIX ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>Resource<sp>type:<sp>" + ( kafkaResource . resourceType ( ) ) ) ) ; } break ; case CLUSTER : resourceType = SimpleAclRuleResourceType . CLUSTER ; resourceName = "kafka-cluster" ; resourcePattern = io . strimzi . api . kafka . model . AclResourcePatternType . LITERAL ; break ; case TRANSACTIONAL_ID : resourceType = SimpleAclRuleResourceType . TRANSACTIONAL_ID ; resourceName = kafkaResource . name ( ) ; switch ( kafkaResource . patternType ( ) ) { case LITERAL : resourcePattern = io . strimzi . api . kafka . model . AclResourcePatternType . LITERAL ; break ; case PREFIXED : resourcePattern = io . strimzi . api . kafka . model . AclResourcePatternType . PREFIX ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>Resource<sp>type:<sp>" + ( kafkaResource . resourceType ( ) ) ) ) ; } break ; default : throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>Resource<sp>type:<sp>" + ( kafkaResource . resourceType ( ) ) ) ) ; } return new io . strimzi . operator . user . model . acl . SimpleAclRuleResource ( resourceName , resourceType , resourcePattern ) ; }
|
org . junit . Assert . assertEquals ( strimzi , io . strimzi . operator . user . model . acl . SimpleAclRuleResource . fromKafkaResource ( kafka ) )
|
testDefaultFormatVector3D ( ) { java . util . Locale defaultLocal = java . util . Locale . getDefault ( ) ; java . util . Locale . setDefault ( getLocale ( ) ) ; org . apache . commons . math3 . geometry . euclidean . threed . Vector3D c = new org . apache . commons . math3 . geometry . euclidean . threed . Vector3D ( 232.22222222222 , ( - 342.3333333333 ) , 432.44444444444 ) ; java . lang . String expected = ( ( ( ( ( "{232" + ( getDecimalCharacter ( ) ) ) + "2222222222;<sp>-342" ) + ( getDecimalCharacter ( ) ) ) + "3333333333;<sp>432" ) + ( getDecimalCharacter ( ) ) ) + "4444444444}" ; java . lang . String actual = new org . apache . commons . math3 . geometry . euclidean . threed . Vector3DFormat ( ) . format ( c ) ; "<AssertPlaceHolder>" ; java . util . Locale . setDefault ( defaultLocal ) ; } format ( org . apache . commons . math . geometry . Vector3D ) { return format ( v , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testIsSatisfied ( ) { org . apache . commons . math4 . genetics . FixedGenerationCount fgc = new org . apache . commons . math4 . genetics . FixedGenerationCount ( 20 ) ; int cnt = 0 ; org . apache . commons . math4 . genetics . Population pop = new org . apache . commons . math4 . genetics . Population ( ) { @ org . apache . commons . math4 . genetics . Override public void addChromosome ( org . apache . commons . math4 . genetics . Chromosome chromosome ) { } @ org . apache . commons . math4 . genetics . Override public org . apache . commons . math4 . genetics . Chromosome getFittestChromosome ( ) { return null ; } @ org . apache . commons . math4 . genetics . Override public int getPopulationLimit ( ) { return 0 ; } @ org . apache . commons . math4 . genetics . Override public int getPopulationSize ( ) { return 0 ; } @ org . apache . commons . math4 . genetics . Override public org . apache . commons . math4 . genetics . Population nextGeneration ( ) { return null ; } @ org . apache . commons . math4 . genetics . Override public java . util . Iterator < org . apache . commons . math4 . genetics . Chromosome > iterator ( ) { return null ; } } ; while ( ! ( fgc . isSatisfied ( pop ) ) ) { cnt ++ ; } "<AssertPlaceHolder>" ; } isSatisfied ( org . apache . commons . math4 . genetics . Population ) { if ( ( endTime ) < 0 ) { endTime = ( java . lang . System . nanoTime ( ) ) + ( maxTimePeriod ) ; } return ( java . lang . System . nanoTime ( ) ) >= ( endTime ) ; }
|
org . junit . Assert . assertEquals ( 20 , cnt )
|
testBlasGemm5 ( ) { if ( org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . getClass ( ) . getSimpleName ( ) . toLowerCase ( ) . contains ( "cuda" ) ) return ; lombok . val A = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 12 , 12 ) . reshape ( 'c' , 4 , 3 ) . dup ( 'f' ) ; lombok . val B = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 12 , 12 ) . reshape ( 'c' , 3 , 4 ) ; lombok . val exp = A . mmul ( B ) ; lombok . val res = org . nd4j . linalg . factory . Nd4j . create ( new int [ ] { 4 , 4 } , 'c' ) ; lombok . val matmul = org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "matmul" ) . addInputs ( A , B ) . addOutputs ( res ) . build ( ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( matmul ) ; "<AssertPlaceHolder>" ; } exec ( org . nd4j . linalg . cpu . nativecpu . ops . Op ) { checkForCompression ( op ) ; if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp ) { org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp s = ( ( org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp ) ( op ) ) ; exec ( s ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . GradientOp ) { op . exec ( ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . TransformOp ) { org . nd4j . linalg . cpu . nativecpu . ops . TransformOp t = ( ( org . nd4j . linalg . cpu . nativecpu . ops . TransformOp ) ( op ) ) ; exec ( t ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ) { org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ac = ( ( org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ) ( op ) ) ; exec ( ac ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation ) { org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation iac = ( ( org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation ) ( op ) ) ; exec ( iac ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp ) { org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp broadcastOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp ) ( op ) ) ; exec ( broadcastOp , broadcastOp . getDimension ( ) ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp ) { org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp shapeOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp ) ( op ) ) ; exec ( shapeOp ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . RandomOp ) { org . nd4j . linalg . cpu . nativecpu . ops . RandomOp rngOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . RandomOp ) ( op ) ) ; exec ( rngOp , org . nd4j . linalg . factory . Nd4j . getRandom ( ) ) ; } return op ; }
|
org . junit . Assert . assertEquals ( exp , res )
|
testFindExact ( ) { for ( net . ripe . db . whois . common . ip . Ipv4Resource n : all ) { "<AssertPlaceHolder>" ; } } findExact ( net . ripe . db . whois . common . ip . IpInterval ) { if ( ipInterval instanceof net . ripe . db . whois . common . ip . Ipv4Resource ) { return ipv4Tree . findExact ( ( ( net . ripe . db . whois . common . ip . Ipv4Resource ) ( ipInterval ) ) ) ; } else if ( ipInterval instanceof net . ripe . db . whois . common . ip . Ipv6Resource ) { return ipv6Tree . findExact ( ( ( net . ripe . db . whois . common . ip . Ipv6Resource ) ( ipInterval ) ) ) ; } throw new java . lang . IllegalArgumentException ( ( "Unexpected<sp>ip<sp>object:<sp>" + ipInterval ) ) ; }
|
org . junit . Assert . assertThat ( subject . findExact ( n ) , contains ( n ) )
|
testLetExp01 ( ) { testpackage . Class1 class1 ; class1 = new testpackage . Class1 ( ) ; "<AssertPlaceHolder>" ; } testLetExp01 ( ) { testpackage . Class1 class1 ; class1 = new testpackage . Class1 ( ) ; org . junit . Assert . assertEquals ( new java . lang . Integer ( 42 ) , class1 . testLetExp01 ( ) ) ; }
|
org . junit . Assert . assertEquals ( new java . lang . Integer ( 42 ) , class1 . testLetExp01 ( ) )
|
testValue ( ) { mmarquee . automation . AutomationElement element = org . mockito . Mockito . mock ( mmarquee . automation . AutomationElement . class ) ; mmarquee . automation . pattern . Value value = org . mockito . Mockito . mock ( mmarquee . automation . pattern . Value . class ) ; when ( value . isAvailable ( ) ) . thenReturn ( true ) ; when ( value . value ( ) ) . thenReturn ( "VALUE" ) ; mmarquee . automation . uiautomation . IUIAutomation mocked_automation = org . mockito . Mockito . mock ( mmarquee . automation . uiautomation . IUIAutomation . class ) ; mmarquee . automation . UIAutomation instance = new mmarquee . automation . UIAutomation ( mocked_automation ) ; mmarquee . automation . controls . AutomationDataGridCell cell = new mmarquee . automation . controls . AutomationDataGridCell ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( value ) . automation ( instance ) ) ; java . lang . String val = cell . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return this . value ; }
|
org . junit . Assert . assertTrue ( val . equals ( "VALUE" ) )
|
heterogeneousTest ( ) { org . organicdesign . fp . collections . RrbTree < java . lang . Object > rrb = org . organicdesign . fp . StaticImports . < java . lang . Object > rrb ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 1 , 2 ) . concat ( org . organicdesign . fp . StaticImports . < java . lang . Object > rrb ( "a" ) ) ; java . util . List < java . lang . Object > list = java . util . Arrays . asList ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 1 , 2 , "a" ) ; int i = 0 ; for ( java . lang . Object elem : rrb ) { "<AssertPlaceHolder>" ; i ++ ; } } get ( int ) { if ( ( idx >= 0 ) && ( idx < ( size ) ) ) { return ( start ) + idx ; } throw new java . lang . IndexOutOfBoundsException ( ( ( ( ( ( "Index<sp>" + idx ) + "<sp>was<sp>outside<sp>the<sp>size<sp>of<sp>this<sp>range:<sp>" ) + ( start ) ) + "<sp>to<sp>" ) + ( end ) ) ) ; }
|
org . junit . Assert . assertEquals ( list . get ( i ) , elem )
|
addWordHorizontalSuccesTest ( ) { this . crossword . addWord ( new de . unima . dws . semanta . crossword . model . HAWord ( new de . unima . dws . semanta . model . HAEntity ( null , "germany" , null , null , null ) ) , 0 , 0 , 6 , 0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return words . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , this . crossword . size ( ) )
|
testAddDropBasicColumnFamilyDefinition ( ) { me . prettyprint . cassandra . model . BasicColumnFamilyDefinition cfDef = new me . prettyprint . cassandra . model . BasicColumnFamilyDefinition ( ) ; cfDef . setName ( "DynCf" ) ; cfDef . setKeyspaceName ( "Keyspace1" ) ; cassandraCluster . addColumnFamily ( cfDef ) ; java . lang . String cfid2 = cassandraCluster . dropColumnFamily ( "Keyspace1" , "DynCf" ) ; "<AssertPlaceHolder>" ; } dropColumnFamily ( java . lang . String , java . lang . String ) { return dropColumnFamily ( keyspaceName , columnFamily , false ) ; }
|
org . junit . Assert . assertNotNull ( cfid2 )
|
testSQLDateMath ( ) { com . googlecode . cqengine . query . parser . sql . support . DateMathParser dateMathParser = new com . googlecode . cqengine . query . parser . sql . support . DateMathParser ( ) ; java . util . Date parsedDate = dateMathParser . validatedParse ( java . util . Date . class , "'+0DAY'" ) ; "<AssertPlaceHolder>" ; } validatedParse ( java . lang . Class , java . lang . String ) { try { return parse ( valueType , stringValue ) ; } catch ( java . lang . Exception e ) { throw new com . googlecode . cqengine . query . parser . common . InvalidQueryException ( ( ( ( "Failed<sp>to<sp>parse<sp>as<sp>type<sp>" + ( valueType . getSimpleName ( ) ) ) + ":<sp>" ) + stringValue ) , e ) ; } }
|
org . junit . Assert . assertNotNull ( parsedDate )
|
incrementExistingSuffixWithTemporary ( ) { final java . util . Properties props = new java . util . Properties ( ) ; props . setProperty ( VersioningState . INCREMENT_SERIAL_SUFFIX_SYSPROP . getCurrent ( ) , "temporary-redhat" ) ; props . setProperty ( VersioningState . INCREMENT_SERIAL_SUFFIX_PADDING_SYSPROP . getCurrent ( ) , "5" ) ; props . setProperty ( VersioningState . VERSION_SUFFIX_ALT , "redhat" ) ; setupSession ( props , "1.2.0.redhat-00002" , "1.2.0.temporary-redhat-00001" , "1.2.0.temporary-redhat-00002" ) ; java . lang . String oldValue = "1.2.0.redhat-00001" ; final java . lang . String v = "1.2.0.temporary-redhat-00003" ; final java . lang . String result = calculate ( oldValue ) ; "<AssertPlaceHolder>" ; } calculate ( java . lang . String ) { return modder . calculate ( org . commonjava . maven . ext . core . impl . VersioningCalculatorTest . GROUP_ID , org . commonjava . maven . ext . core . impl . VersioningCalculatorTest . ARTIFACT_ID , version , session ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . equalTo ( v ) )
|
testKeyBuildingFromRowFamilyVisibilityBytes ( ) { org . apache . accumulo . core . data . Key keyBuilt = org . apache . accumulo . core . data . Key . builder ( ) . row ( rowBytes ) . family ( familyBytes ) . visibility ( visibilityBytes ) . build ( ) ; org . apache . accumulo . core . data . Key keyExpected = new org . apache . accumulo . core . data . Key ( rowBytes , familyBytes , org . apache . accumulo . core . data . KeyBuilderTest . EMPTY_BYTES , visibilityBytes , Long . MAX_VALUE ) ; "<AssertPlaceHolder>" ; } build ( ) { return builderFunction . apply ( this ) ; }
|
org . junit . Assert . assertEquals ( keyExpected , keyBuilt )
|
testShaUpdateWithByteArray ( ) { final java . lang . String d1 = "C'est<sp>un<sp>homme<sp>qui<sp>rentre<sp>dans<sp>un<sp>caf,<sp>et<sp>plouf" ; final java . lang . String d2 = "C'est<sp>un<sp>homme,<sp>c'est<sp>qu'une<sp>tte,<sp>on<sp>lui<sp>offre<sp>un<sp>cadeau:<sp>'oh...<sp>encore<sp>un<sp>chapeau!'" ; java . security . MessageDigest messageDigest = org . apache . commons . codec . digest . DigestUtils . getShaDigest ( ) ; messageDigest . update ( d1 . getBytes ( ) ) ; messageDigest . update ( d2 . getBytes ( ) ) ; final java . lang . String expectedResult = org . apache . commons . codec . binary . Hex . encodeHexString ( messageDigest . digest ( ) ) ; messageDigest = org . apache . commons . codec . digest . DigestUtils . getShaDigest ( ) ; org . apache . commons . codec . digest . DigestUtils . updateDigest ( messageDigest , d1 . getBytes ( ) ) ; org . apache . commons . codec . digest . DigestUtils . updateDigest ( messageDigest , d2 . getBytes ( ) ) ; final java . lang . String actualResult = org . apache . commons . codec . binary . Hex . encodeHexString ( messageDigest . digest ( ) ) ; "<AssertPlaceHolder>" ; } encodeHexString ( byte [ ] ) { return new java . lang . String ( org . apache . commons . codec . binary . Hex . encodeHex ( data ) ) ; }
|
org . junit . Assert . assertEquals ( expectedResult , actualResult )
|
getOperatorRevenueShare_MandatoryForTemplates ( ) { org . oscm . domobjects . Product product = givenProduct ( 101L ) ; doReturn ( product ) . when ( partnerBean . dm ) . getReference ( eq ( org . oscm . domobjects . Product . class ) , eq ( 101L ) ) ; doNothing ( ) . when ( partnerBean ) . verifyOwningPermission ( eq ( product ) ) ; doThrow ( new org . oscm . internal . types . exception . SaaSSystemException ( "Template<sp>without<sp>operator<sp>revenue<sp>share" ) ) . when ( partnerBean ) . validateOperatorRevenueShare ( eq ( product ) ) ; try { partnerBean . getOperatorRevenueShare ( 101L ) ; org . junit . Assert . fail ( ) ; } catch ( org . oscm . internal . types . exception . SaaSSystemException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( "EXCEPTIONID<sp>" + ( id ) ) + ":<sp>" ) + ( super . getMessage ( ) ) ; }
|
org . junit . Assert . assertTrue ( e . getMessage ( ) . contains ( "Template<sp>without<sp>operator<sp>revenue<sp>share" ) )
|
testFluentInterfaceWithPassword ( ) { System . out . println ( "testFluentInterfaceWithPassword" ) ; team . bus . model . bean . DataBaseInfo instance = new team . bus . model . bean . DataBaseInfo ( ) ; java . lang . String expResult = "123456" ; instance . withPassword ( expResult ) ; java . lang . String result = instance . getPassword ( ) ; "<AssertPlaceHolder>" ; } getPassword ( ) { return this . password ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testCalendar_CreateDate20121215_NotNull ( ) { int year = 2012 ; int month = 12 ; int day = 15 ; java . util . Date actual = info . michaelkohler . helpertools . date . CalendarHelper . date ( year , month , day ) ; "<AssertPlaceHolder>" ; } date ( int , int , int ) { info . michaelkohler . helpertools . tools . DateTimeValidator . validateDateArguments ( year , month , day ) ; return new java . util . GregorianCalendar ( year , ( month - 1 ) , day ) . getTime ( ) ; }
|
org . junit . Assert . assertNotNull ( actual )
|
testBasic2 ( ) { com . laytonsmith . core . constructs . CByteArray ba = new com . laytonsmith . core . constructs . CByteArray ( Target . UNKNOWN , 0 ) ; ba . putByte ( ( ( byte ) ( 1 ) ) , null ) ; ba . putByte ( ( ( byte ) ( 1 ) ) , null ) ; ba . putByte ( ( ( byte ) ( 1 ) ) , null ) ; "<AssertPlaceHolder>" ; } asByteArrayCopy ( ) { byte [ ] src = data . array ( ) ; byte [ ] dest = new byte [ maxValue ] ; java . lang . System . arraycopy ( src , 0 , dest , 0 , maxValue ) ; return dest ; }
|
org . junit . Assert . assertEquals ( 3 , ba . asByteArrayCopy ( ) . length )
|
Duplicate_Scalar_Values_Allowed ( ) { org . javersion . object . MapTest . Mab mab = new org . javersion . object . MapTest . Mab ( ) ; java . lang . Integer integer = 123 ; mab . primitives . put ( "eka" , integer ) ; mab . primitives . put ( "toka" , integer ) ; java . util . Map < org . javersion . path . PropertyPath , java . lang . Object > properties = serializer . toPropertyMap ( mab ) ; mab = serializer . fromPropertyMap ( properties ) ; "<AssertPlaceHolder>" ; } map ( K , V , K , V ) { java . util . Map < K , V > map = com . google . common . collect . Maps . newLinkedHashMap ( ) ; map . put ( k1 , v1 ) ; map . put ( k2 , v2 ) ; return map ; }
|
org . junit . Assert . assertThat ( mab . primitives , org . hamcrest . Matchers . equalTo ( org . javersion . object . MapTest . map ( "eka" , integer , "toka" , integer ) ) )
|
testTimerStop ( ) { try { com . igumnov . common . Benchmark . timerStop ( ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } timerStop ( ) { return com . igumnov . common . Benchmark . timerStop ( com . igumnov . common . Benchmark . timerDefaultName ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testNone ( ) { barrysw19 . calculon . engine . CompoundIterator < java . lang . String > iter = new barrysw19 . calculon . engine . CompoundIterator ( ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( ( iterators . length ) > 0 ) && ( ( iterators [ index ] . hasNext ( ) ) || ( ( ( ++ ( index ) ) < ( iterators . length ) ) && ( hasNext ( ) ) ) ) ; }
|
org . junit . Assert . assertFalse ( iter . hasNext ( ) )
|
testMaxFunctionQuantityTypeIncompatibleUnits ( ) { items . add ( createNumberItem ( "TestItem1" , javax . measure . quantity . Temperature . class , new org . eclipse . smarthome . core . library . types . QuantityType < javax . measure . quantity . Temperature > ( "23.54<sp>C" ) ) ) ; items . add ( createNumberItem ( "TestItem2" , javax . measure . quantity . Temperature . class , UnDefType . NULL ) ) ; items . add ( createNumberItem ( "TestItem3" , javax . measure . quantity . Pressure . class , new org . eclipse . smarthome . core . library . types . QuantityType < javax . measure . quantity . Pressure > ( "192.2<sp>hPa" ) ) ) ; function = new org . eclipse . smarthome . core . library . types . QuantityTypeArithmeticGroupFunction . Max ( javax . measure . quantity . Temperature . class ) ; org . eclipse . smarthome . core . types . State state = function . calculate ( items ) ; "<AssertPlaceHolder>" ; } createNumberItem ( java . lang . String , java . lang . Class , org . eclipse . smarthome . core . types . State ) { org . eclipse . smarthome . core . library . items . NumberItem item = new org . eclipse . smarthome . core . library . items . NumberItem ( ( ( ( org . eclipse . smarthome . core . library . CoreItemFactory . NUMBER ) + ":" ) + ( dimension . getSimpleName ( ) ) ) , name ) ; item . setUnitProvider ( unitProvider ) ; item . setState ( state ) ; return item ; }
|
org . junit . Assert . assertEquals ( new org . eclipse . smarthome . core . library . types . QuantityType < javax . measure . quantity . Temperature > ( "23.54<sp>C" ) , state )
|
random_id ( ) { service = ( ( com . alibaba . citrus . service . requestcontext . impl . RequestContextChainingServiceImpl ) ( factory . getBean ( "rc2" ) ) ) ; com . alibaba . citrus . service . requestcontext . session . impl . SessionRequestContextFactoryImpl f = getFactory ( service , com . alibaba . citrus . service . requestcontext . session . impl . SessionRequestContextFactoryImpl . class ) ; com . alibaba . citrus . service . requestcontext . session . SessionConfig config = f . getConfig ( ) ; com . alibaba . citrus . service . requestcontext . session . idgen . random . impl . RandomIDGenerator rid = ( ( com . alibaba . citrus . service . requestcontext . session . idgen . random . impl . RandomIDGenerator ) ( config . getId ( ) . getGenerator ( ) ) ) ; "<AssertPlaceHolder>" ; } getLength ( ) { return length ; }
|
org . junit . Assert . assertEquals ( 16 , rid . getLength ( ) )
|
instantiation ( ) { com . github . seratch . taskun . scheduler . crond . Crontab crontab = new com . github . seratch . taskun . scheduler . crond . Crontab ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( crontab )
|
testSimpleWithDecimalsTrunc ( ) { org . apache . commons . math . complex . Complex c = new org . apache . commons . math . complex . Complex ( 1.2323 , 1.4343 ) ; java . lang . String expected = ( ( ( "1" + ( getDecimalCharacter ( ) ) ) + "23<sp>+<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "43i" ; java . lang . String actual = complexFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( java . lang . Object [ ] ) { return format . format ( arguments ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testDocumentToIndexCollectionValueEmptyOne ( ) { final com . orientechnologies . orient . core . record . impl . ODocument document = new com . orientechnologies . orient . core . record . impl . ODocument ( ) ; document . field ( "fOne" , 12 ) ; document . field ( "fTwo" , com . orientechnologies . orient . core . index . Collections . emptyList ( ) ) ; final com . orientechnologies . orient . core . index . OCompositeIndexDefinition compositeIndexDefinition = new com . orientechnologies . orient . core . index . OCompositeIndexDefinition ( "testCollectionClass" ) ; compositeIndexDefinition . addIndex ( new com . orientechnologies . orient . core . index . OPropertyIndexDefinition ( "testCollectionClass" , "fOne" , com . orientechnologies . orient . core . metadata . schema . OType . INTEGER ) ) ; compositeIndexDefinition . addIndex ( new com . orientechnologies . orient . core . index . OPropertyListIndexDefinition ( "testCollectionClass" , "fTwo" , com . orientechnologies . orient . core . metadata . schema . OType . INTEGER ) ) ; final java . lang . Object result = compositeIndexDefinition . getDocumentValueToIndex ( document ) ; "<AssertPlaceHolder>" ; } getDocumentValueToIndex ( com . orientechnologies . orient . core . record . impl . ODocument ) { return createValue ( iDocument . < java . lang . Object > field ( field ) ) ; }
|
org . junit . Assert . assertNull ( result )
|
testObserverIsAlwaysCheapForNullValues ( ) { org . apache . beam . sdk . coders . NullableCoder < java . util . List < java . lang . String > > coder = org . apache . beam . sdk . coders . NullableCoder . of ( org . apache . beam . sdk . coders . ListCoder . of ( org . apache . beam . sdk . coders . StringUtf8Coder . of ( ) ) ) ; "<AssertPlaceHolder>" ; } isRegisterByteSizeObserverCheap ( org . apache . beam . sdk . coders . CoderRegistryTest$MyValue ) { return true ; }
|
org . junit . Assert . assertTrue ( coder . isRegisterByteSizeObserverCheap ( null ) )
|
testNoFailure ( ) { "<AssertPlaceHolder>" ; } failed ( ) { return ( ruleFailedException ) != null ; }
|
org . junit . Assert . assertFalse ( result . failed ( ) )
|
testStandalone ( ) { org . apache . camel . impl . JndiRegistry jndi = new org . apache . camel . impl . JndiRegistry ( true ) ; jndi . bind ( "bar" , "Hello<sp>bar" ) ; "<AssertPlaceHolder>" ; } lookupByName ( java . lang . String ) { try { return unwrap ( getContext ( ) . lookup ( name ) ) ; } catch ( javax . naming . NameNotFoundException e ) { return null ; } catch ( javax . naming . NamingException e ) { return null ; } }
|
org . junit . Assert . assertEquals ( "Hello<sp>bar" , jndi . lookupByName ( "bar" ) )
|
testDeclareExtendsMissingJavaParent ( ) { java . lang . String drl = "package<sp>org.drools.test;<sp>\n" + ( ( "import<sp>org.drools.compiler.integrationtests.ExtendsTest.Y;<sp>\n" + "declare<sp>Student<sp>extends<sp>Y<sp>end<sp>\n" ) + "" ) ; org . kie . internal . builder . KnowledgeBuilder kBuilder = org . kie . internal . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; kBuilder . add ( new org . drools . core . io . impl . ByteArrayResource ( drl . getBytes ( ) ) , ResourceType . DRL ) ; if ( kBuilder . hasErrors ( ) ) { System . err . println ( kBuilder . getErrors ( ) ) ; } "<AssertPlaceHolder>" ; } hasErrors ( ) { return messages . stream ( ) . anyMatch ( ( m ) -> DMNMessage . Severity . ERROR . equals ( m . getSeverity ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( kBuilder . hasErrors ( ) )
|
cloneAsVersionTest ( ) { final org . opendaylight . controller . cluster . access . commands . TransactionAbortRequest clone = org . opendaylight . controller . cluster . access . commands . TransactionAbortRequestTest . OBJECT . cloneAsVersion ( ABIVersion . BORON ) ; "<AssertPlaceHolder>" ; } cloneAsVersion ( org . opendaylight . controller . cluster . access . ABIVersion ) { return ( ( T ) ( this ) ) ; }
|
org . junit . Assert . assertEquals ( org . opendaylight . controller . cluster . access . commands . TransactionAbortRequestTest . OBJECT , clone )
|
testBuildWithDisabledStatusConstraintWithOrderBy ( ) { unit . setActive ( false ) ; org . lnu . is . domain . education . type . EducationType context = new org . lnu . is . domain . education . type . EducationType ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "abbrName" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "name" , org . lnu . is . pagination . OrderByType . DESC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>EducationType<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>ORDER<sp>BY<sp>e.abbrName<sp>ASC,<sp>e.name<sp>DESC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . education . type . EducationType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
shouldCallNewMethodWhenDatabaseInterfaceIsOfANewType ( ) { org . pentaho . di . core . database . DatabaseInterfaceExtended databaseInterfaceNew = mock ( org . pentaho . di . core . database . DatabaseInterfaceExtended . class ) ; databaseMeta . setDatabaseInterface ( databaseInterfaceNew ) ; when ( databaseInterfaceNew . getDropTableIfExistsStatement ( org . pentaho . di . core . database . DatabaseMetaTest . TABLE_NAME ) ) . thenReturn ( org . pentaho . di . core . database . DatabaseMetaTest . DROP_STATEMENT ) ; java . lang . String statement = databaseMeta . getDropTableIfExistsStatement ( org . pentaho . di . core . database . DatabaseMetaTest . TABLE_NAME ) ; "<AssertPlaceHolder>" ; } getDropTableIfExistsStatement ( java . lang . String ) { if ( ( databaseInterface ) instanceof org . pentaho . di . core . database . DatabaseInterfaceExtended ) { return ( ( org . pentaho . di . core . database . DatabaseInterfaceExtended ) ( databaseInterface ) ) . getDropTableIfExistsStatement ( tableName ) ; } return ( org . pentaho . di . core . database . DatabaseMeta . DROP_TABLE_STATEMENT ) + tableName ; }
|
org . junit . Assert . assertEquals ( org . pentaho . di . core . database . DatabaseMetaTest . DROP_STATEMENT , statement )
|
testFindNoType ( ) { java . util . Collection < org . eclipse . emf . ecore . EObject > others = org . eclipse . emf . edit . provider . ItemPropertyDescriptor . getReachableObjectsOfType ( otherItemObject , poClass ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( primarySelection ) instanceof org . eclipse . jface . viewers . IStructuredSelection ? ( ( org . eclipse . jface . viewers . IStructuredSelection ) ( primarySelection ) ) . size ( ) : 0 ; }
|
org . junit . Assert . assertEquals ( others . size ( ) , 0 )
|
testGetParameters ( ) { org . lnu . is . multysearch . person . PersonList entity = new org . lnu . is . multysearch . person . PersonList ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testReadWithoutSource ( ) { "<AssertPlaceHolder>" ; } readHDU ( ) { if ( ( ( this . dataStr ) == null ) || ( this . atEOF ) ) { if ( ( this . dataStr ) == null ) { nom . tam . fits . Fits . LOG . warning ( "trying<sp>to<sp>read<sp>a<sp>hdu,<sp>without<sp>an<sp>input<sp>source!" ) ; } return null ; } if ( ( ( this . dataStr ) instanceof nom . tam . util . RandomAccess ) && ( ( this . lastFileOffset ) > 0 ) ) { nom . tam . fits . FitsUtil . reposition ( this . dataStr , this . lastFileOffset ) ; } nom . tam . fits . Header hdr = nom . tam . fits . Header . readHeader ( this . dataStr ) ; if ( hdr == null ) { this . atEOF = true ; return null ; } nom . tam . fits . Data data = hdr . makeData ( ) ; try { data . read ( this . dataStr ) ; } catch ( nom . tam . fits . PaddingException e ) { e . updateHeader ( hdr ) ; if ( ! ( nom . tam . fits . FitsFactory . getAllowTerminalJunk ( ) ) ) { throw e ; } } this . lastFileOffset = nom . tam . fits . FitsUtil . findOffset ( this . dataStr ) ; nom . tam . fits . BasicHDU < nom . tam . fits . Data > nextHDU = nom . tam . fits . FitsFactory . hduFactory ( hdr , data ) ; this . hduList . add ( nextHDU ) ; return nextHDU ; }
|
org . junit . Assert . assertNull ( new nom . tam . fits . Fits ( ) . readHDU ( ) )
|
testPutActual ( ) { java . lang . Object o = new java . lang . Object ( ) ; sut . put ( org . eurekastreams . server . domain . PropertyHashMapTest . KEY , o ) ; org . eurekastreams . server . domain . Property < java . lang . Object > result = sut . get ( org . eurekastreams . server . domain . PropertyHashMapTest . KEY ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertEquals ( o , result . getValue ( ) )
|
testGetLeadsChangesPagination ( ) { iprops . afterInputOperation ( ) ; iprops . batchSize . setValue ( 300 ) ; iprops . sinceDateTime . setValue ( org . talend . components . marketo . runtime . client . DATE_OLDEST_CREATE ) ; iprops . fieldList . setValue ( "id,email,firstName,lastName,company" ) ; org . talend . components . marketo . runtime . MarketoSource source = new org . talend . components . marketo . runtime . MarketoSource ( ) ; source . initialize ( null , iprops ) ; org . talend . components . marketo . runtime . client . MarketoClientService client = source . getClientService ( null ) ; org . talend . components . marketo . runtime . client . type . MarketoRecordResult result = client . getLeadChanges ( iprops , null ) ; org . talend . components . marketo . runtime . client . MarketoRESTClientTestIT . LOG . debug ( "{}" , result ) ; java . util . List < org . apache . avro . generic . IndexedRecord > changes = null ; int counted = 0 ; result = client . getLeadChanges ( iprops , null ) ; counted = result . getRecordCount ( ) ; while ( ( result . getRemainCount ( ) ) > 0 ) { result = client . getLeadChanges ( iprops , result . getStreamPosition ( ) ) ; counted += result . getRecordCount ( ) ; changes = result . getRecords ( ) ; } "<AssertPlaceHolder>" ; } getValue ( ) { return this . value ; }
|
org . junit . Assert . assertTrue ( ( ( iprops . batchSize . getValue ( ) ) < counted ) )
|
testDeleteJobWithDisabledTenantCheck ( ) { java . lang . String timerJobId = managementService . createJobQuery ( ) . processInstanceId ( processInstance . getId ( ) ) . singleResult ( ) . getId ( ) ; identityService . setAuthentication ( "aUserId" , null ) ; engineRule . getProcessEngineConfiguration ( ) . setTenantCheckEnabled ( false ) ; managementService . deleteJob ( timerJobId ) ; "<AssertPlaceHolder>" ; } createJobQuery ( ) { return new org . camunda . bpm . engine . impl . JobQueryImpl ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , managementService . createJobQuery ( ) . processInstanceId ( processInstance . getId ( ) ) . count ( ) )
|
test_Short ( ) { com . alibaba . dubbo . common . serialize . ObjectOutput objectOutput = serialization . serialize ( url , byteArrayOutputStream ) ; objectOutput . writeShort ( ( ( short ) ( 123 ) ) ) ; objectOutput . flushBuffer ( ) ; java . io . ByteArrayInputStream byteArrayInputStream = new java . io . ByteArrayInputStream ( byteArrayOutputStream . toByteArray ( ) ) ; com . alibaba . dubbo . common . serialize . ObjectInput deserialize = serialization . deserialize ( url , byteArrayInputStream ) ; "<AssertPlaceHolder>" ; try { deserialize . readShort ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . io . IOException expected ) { } } readShort ( ) { return ( ( short ) ( readVarint32 ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( ( ( short ) ( 123 ) ) , deserialize . readShort ( ) )
|
theLargest2 ( ) { int [ ] input = new int [ ] { 4 , 2 , 3 } ; chapter3 . selectionsort . JaegyuSelectionSort selection = new chapter3 . selectionsort . JaegyuSelectionSort ( ) ; "<AssertPlaceHolder>" ; } returnMaxIndex ( int [ ] , int ) { int maxIndex = 0 ; for ( int i = 1 ; i <= last ; i ++ ) { if ( ( input [ i ] ) > ( input [ maxIndex ] ) ) maxIndex = i ; } return maxIndex ; }
|
org . junit . Assert . assertEquals ( 0 , selection . returnMaxIndex ( input , 2 ) )
|
getLastCommittedTransactionShouldFailWhenStoreIsClosed ( ) { org . neo4j . kernel . impl . store . MetaDataStore metaDataStore = newMetaDataStore ( ) ; metaDataStore . close ( ) ; try { metaDataStore . getLastCommittedTransaction ( ) ; org . junit . Assert . fail ( "Expected<sp>exception<sp>reading<sp>from<sp>MetaDataStore<sp>after<sp>being<sp>closed." ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } instanceOf ( java . lang . Class ) { return clazz :: isInstance ; }
|
org . junit . Assert . assertThat ( e , org . hamcrest . Matchers . instanceOf ( org . neo4j . kernel . impl . store . IllegalStateException . class ) )
|
testExecutionTimeUrnsBuildMonitoringInfos ( ) { java . lang . String testPTransformId = "pTransformId" ; java . util . HashMap < java . lang . String , java . lang . String > labelsMetadata = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; labelsMetadata . put ( MonitoringInfoConstants . Labels . PTRANSFORM , testPTransformId ) ; org . apache . beam . runners . core . metrics . SimpleExecutionState startState = new org . apache . beam . runners . core . metrics . SimpleExecutionState ( ExecutionStateTracker . START_STATE_NAME , MonitoringInfoConstants . Urns . START_BUNDLE_MSECS , labelsMetadata ) ; org . apache . beam . runners . core . metrics . SimpleExecutionState processState = new org . apache . beam . runners . core . metrics . SimpleExecutionState ( ExecutionStateTracker . PROCESS_STATE_NAME , MonitoringInfoConstants . Urns . PROCESS_BUNDLE_MSECS , labelsMetadata ) ; org . apache . beam . runners . core . metrics . SimpleExecutionState finishState = new org . apache . beam . runners . core . metrics . SimpleExecutionState ( ExecutionStateTracker . FINISH_STATE_NAME , MonitoringInfoConstants . Urns . FINISH_BUNDLE_MSECS , labelsMetadata ) ; org . apache . beam . runners . core . metrics . SimpleStateRegistry testObject = new org . apache . beam . runners . core . metrics . SimpleStateRegistry ( ) ; testObject . register ( startState ) ; testObject . register ( processState ) ; testObject . register ( finishState ) ; java . util . List < org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo > testOutput = testObject . getExecutionTimeMonitoringInfos ( ) ; java . util . List < org . hamcrest . Matcher < org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo > > matchers = new java . util . ArrayList < org . hamcrest . Matcher < org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo > > ( ) ; org . apache . beam . runners . core . metrics . SimpleMonitoringInfoBuilder builder = new org . apache . beam . runners . core . metrics . SimpleMonitoringInfoBuilder ( ) ; builder . setUrn ( MonitoringInfoConstants . Urns . START_BUNDLE_MSECS ) ; builder . setInt64Value ( 0 ) ; builder . setPTransformLabel ( testPTransformId ) ; matchers . add ( org . apache . beam . runners . core . metrics . MonitoringInfoMatchers . matchSetFields ( builder . build ( ) ) ) ; builder = new org . apache . beam . runners . core . metrics . SimpleMonitoringInfoBuilder ( ) ; builder . setUrn ( MonitoringInfoConstants . Urns . PROCESS_BUNDLE_MSECS ) ; builder . setInt64Value ( 0 ) ; builder . setPTransformLabel ( testPTransformId ) ; matchers . add ( org . apache . beam . runners . core . metrics . MonitoringInfoMatchers . matchSetFields ( builder . build ( ) ) ) ; builder = new org . apache . beam . runners . core . metrics . SimpleMonitoringInfoBuilder ( ) ; builder . setUrn ( MonitoringInfoConstants . Urns . FINISH_BUNDLE_MSECS ) ; builder . setInt64Value ( 0 ) ; builder . setPTransformLabel ( testPTransformId ) ; matchers . add ( org . apache . beam . runners . core . metrics . MonitoringInfoMatchers . matchSetFields ( builder . build ( ) ) ) ; for ( org . hamcrest . Matcher < org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo > matcher : matchers ) { "<AssertPlaceHolder>" ; } } hasItem ( org . apache . beam . sdk . testing . SerializableMatcher ) { return org . apache . beam . sdk . testing . SerializableMatchers . fromSupplier ( ( ) -> org . hamcrest . Matchers . hasItem ( matcher ) ) ; }
|
org . junit . Assert . assertThat ( testOutput , org . hamcrest . Matchers . hasItem ( matcher ) )
|
testGetStructures ( ) { addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; long [ ] groupIds = new long [ ] { group . getGroupId ( ) , _group . getGroupId ( ) } ; java . util . List < com . liferay . dynamic . data . mapping . model . DDMStructure > structures = com . liferay . dynamic . data . mapping . service . DDMStructureServiceUtil . getStructures ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , groupIds , com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , WorkflowConstants . STATUS_ANY ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( structures . toString ( ) , 3 , structures . size ( ) )
|
testBasicWithMap ( ) { com . cloudera . science . avro . common . JsonConverter jc = new com . cloudera . science . avro . common . JsonConverter ( com . cloudera . science . avro . common . JsonConverterTest . sr ( f1 , f2 , f3Map ) ) ; java . lang . String json = "{\"field1\":<sp>1729,<sp>\"field2\":<sp>[true,<sp>true,<sp>false],<sp>\"field3\":<sp>{\"key\":<sp>\"value\"}}" ; org . apache . avro . generic . GenericRecord r = jc . convert ( json ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . Objects . toStringHelper ( this ) . add ( "voterName" , voterName ) . add ( "calculatedStrength" , java . lang . String . format ( ( ( "%1." + ( eu . dnetlib . iis . wf . affmatching . match . voter . AffOrgMatchVoterStrengthEstimatorAndTest . VOTER_MATCH_STRENGTH_SCALE ) ) + "f" ) , calculatedStrength ) ) . add ( "setStrength" , java . lang . String . format ( ( ( "%1." + ( eu . dnetlib . iis . wf . affmatching . match . voter . AffOrgMatchVoterStrengthEstimatorAndTest . VOTER_MATCH_STRENGTH_SCALE ) ) + "f" ) , setStrength ) ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( json , r . toString ( ) )
|
testEnsureValidMask ( ) { final org . esa . beam . framework . datamodel . Product product = new org . esa . beam . framework . datamodel . Product ( "n" , "t" , 18 , 2 ) ; final org . esa . beam . framework . datamodel . Band flagsBand = product . addBand ( "flags" , ProductData . TYPE_INT8 ) ; final org . esa . beam . framework . datamodel . FlagCoding flagCoding = new org . esa . beam . framework . datamodel . FlagCoding ( "fc" ) ; final int f1Mask = 1 ; flagCoding . addFlag ( "f1" , f1Mask , "" ) ; flagsBand . setSampleCoding ( flagCoding ) ; product . getFlagCodingGroup ( ) . add ( flagCoding ) ; final byte [ ] elems = new byte [ ] { 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 } ; flagsBand . setDataElems ( elems ) ; product . setModified ( false ) ; final com . bc . jexp . Term term = product . parseExpression ( "flags.f1" ) ; final org . esa . beam . util . BitRaster validMask = product . createValidMask ( term , ProgressMonitor . NULL ) ; for ( int i = 0 ; i < ( elems . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } isSet ( int ) { return ( value & ( mask ) ) != 0 ; }
|
org . junit . Assert . assertEquals ( ( ( elems [ i ] ) == 1 ) , validMask . isSet ( i ) )
|
validate_shouldPassValidationIfFieldLengthsAreCorrect ( ) { org . openmrs . LocationAttributeType type = new org . openmrs . LocationAttributeType ( ) ; type . setName ( "name" ) ; type . setDatatypeClassname ( "org.openmrs.customdatatype.datatype.FreeTextDatatype" ) ; type . setDescription ( "description" ) ; type . setRetireReason ( "retireReason" ) ; org . springframework . validation . Errors errors = new org . springframework . validation . BindException ( type , "type" ) ; new org . openmrs . validator . LocationAttributeTypeValidator ( ) . validate ( type , errors ) ; "<AssertPlaceHolder>" ; } hasErrors ( ) { return erroneous ; }
|
org . junit . Assert . assertFalse ( errors . hasErrors ( ) )
|
normalizesAbsolutePathWithJustDotsTest ( ) { com . beijunyi . parallelgit . filesystem . GitPath path = gfs . getPath ( "/./." ) ; com . beijunyi . parallelgit . filesystem . GitPath result = path . normalize ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( ( stringValue ) == null ) stringValue = decode ( com . beijunyi . parallelgit . filesystem . CHARSET , path ) ; return stringValue ; }
|
org . junit . Assert . assertEquals ( "/" , result . toString ( ) )
|
testSoftmax ( ) { org . nd4j . linalg . api . ndarray . INDArray vec = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 6 , 6 , DataType . DOUBLE ) ; org . nd4j . linalg . api . ndarray . INDArray matrix = vec . dup ( ) . reshape ( 'f' , 2 , 3 ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . api . ops . impl . transforms . strict . OldSoftMax ( matrix ) ) ; org . nd4j . linalg . api . ndarray . INDArray matrixAssertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0.015876241 , 0.015876241 , 0.11731043 , 0.11731043 , 0.86681336 , 0.86681336 } , new int [ ] { 2 , 3 } , 'f' ) ; "<AssertPlaceHolder>" ; } exec ( java . lang . String ) { code = org . datavec . python . PythonExecutioner . getFunctionalCode ( ( "__f_" + ( java . lang . Thread . currentThread ( ) . getId ( ) ) ) , code ) ; org . datavec . python . PythonExecutioner . acquireGIL ( ) ; log . info ( "CPython:<sp>PyRun_SimpleStringFlag()" ) ; log . info ( code ) ; int result = PyRun_SimpleStringFlags ( code , null ) ; if ( result != 0 ) { PyErr_Print ( ) ; throw new java . lang . RuntimeException ( "exec<sp>failed" ) ; } log . info ( "Exec<sp>done" ) ; org . datavec . python . PythonExecutioner . releaseGIL ( ) ; }
|
org . junit . Assert . assertEquals ( matrixAssertion , matrix )
|
testConstants1 ( ) { java . lang . Object o = checkConstantExpression ( "null" ) ; "<AssertPlaceHolder>" ; } checkConstantExpression ( java . lang . String ) { org . eclipse . birt . data . engine . expression . CompiledExpression expr = m_compiler . compile ( exprStr , m_registry , context ) ; org . junit . Assert . assertTrue ( ( expr instanceof org . eclipse . birt . data . engine . expression . ConstantExpression ) ) ; return ( ( org . eclipse . birt . data . engine . expression . ConstantExpression ) ( expr ) ) . getValue ( ) ; }
|
org . junit . Assert . assertNull ( o )
|
testAddFileEntryTypeWithEmptyDDMForm ( ) { int fileEntryTypesCount = com . liferay . document . library . kernel . service . DLFileEntryTypeServiceUtil . getFileEntryTypesCount ( new long [ ] { _group . getGroupId ( ) } ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group , com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) ) ; serviceContext . setAttribute ( "ddmForm" , com . liferay . dynamic . data . mapping . util . DDMBeanTranslatorUtil . translate ( new com . liferay . dynamic . data . mapping . model . DDMForm ( ) ) ) ; com . liferay . dynamic . data . mapping . model . DDMStructure ddmStructure = com . liferay . dynamic . data . mapping . test . util . DDMStructureTestUtil . addStructure ( _group . getGroupId ( ) , com . liferay . document . library . kernel . model . DLFileEntryMetadata . class . getName ( ) ) ; com . liferay . document . library . kernel . service . DLFileEntryTypeServiceUtil . addFileEntryType ( _group . getGroupId ( ) , com . liferay . portal . kernel . util . StringUtil . randomString ( ) , com . liferay . portal . kernel . util . StringUtil . randomString ( ) , new long [ ] { ddmStructure . getStructureId ( ) } , serviceContext ) ; "<AssertPlaceHolder>" ; } getFileEntryTypesCount ( long [ ] ) { return com . liferay . document . library . kernel . service . DLFileEntryTypeServiceUtil . getService ( ) . getFileEntryTypesCount ( groupIds ) ; }
|
org . junit . Assert . assertEquals ( ( fileEntryTypesCount + 1 ) , com . liferay . document . library . kernel . service . DLFileEntryTypeServiceUtil . getFileEntryTypesCount ( new long [ ] { _group . getGroupId ( ) } ) )
|
testIsRunByJunit ( ) { boolean isRunByJunit = cn . xiaowenjie . myrestutil . StackTraceHelper . isRunByJunit ( cn . xiaowenjie . myrestutil . StackTraceHelper . getMainThreadStackTraceElements ( ) ) ; "<AssertPlaceHolder>" ; } getMainThreadStackTraceElements ( ) { java . util . Map < java . lang . Thread , java . lang . StackTraceElement [ ] > stacks = java . lang . Thread . getAllStackTraces ( ) ; java . util . Set < java . lang . Thread > keySet = stacks . keySet ( ) ; java . lang . Thread mainThread = null ; for ( java . lang . Thread thread : keySet ) { if ( thread . getName ( ) . equals ( "main" ) ) { mainThread = thread ; break ; } } return stacks . get ( mainThread ) ; }
|
org . junit . Assert . assertEquals ( true , isRunByJunit )
|
testFetchByPrimaryKeyExisting ( ) { com . liferay . segments . model . SegmentsEntryRel newSegmentsEntryRel = addSegmentsEntryRel ( ) ; com . liferay . segments . model . SegmentsEntryRel existingSegmentsEntryRel = _persistence . fetchByPrimaryKey ( newSegmentsEntryRel . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertEquals ( existingSegmentsEntryRel , newSegmentsEntryRel )
|
testPhysicalIgnoresPastConsumed ( ) { pool . getProduct ( ) . setAttribute ( Pool . Attributes . MULTI_ENTITLEMENT , "yes" ) ; pool . getProduct ( ) . setAttribute ( Product . Attributes . STACKING_ID , "1" ) ; pool . getProduct ( ) . setAttribute ( org . candlepin . policy . js . quantity . QuantityRulesTest . SOCKET_ATTRIBUTE , "1" ) ; consumer . setFact ( org . candlepin . policy . js . quantity . QuantityRulesTest . SOCKET_FACT , "4" ) ; org . candlepin . model . Entitlement e = createValidEntitlement ( pool ) ; e . setQuantity ( 4 ) ; java . util . Set < org . candlepin . model . Entitlement > ents = new java . util . HashSet ( ) ; ents . add ( e ) ; consumer . setEntitlements ( ents ) ; java . util . Calendar c = java . util . Calendar . getInstance ( ) ; c . setTime ( pool . getEndDate ( ) ) ; java . util . Date futureDate = org . candlepin . test . TestUtil . createDate ( ( ( c . get ( Calendar . YEAR ) ) + 1 ) , 1 , 1 ) ; org . candlepin . dto . rules . v1 . SuggestedQuantityDTO suggested = quantityRules . getSuggestedQuantity ( pool , consumer , futureDate ) ; "<AssertPlaceHolder>" ; } getSuggested ( ) { return suggested ; }
|
org . junit . Assert . assertEquals ( new java . lang . Long ( 4 ) , suggested . getSuggested ( ) )
|
testRequestWithInvalidAuthorization ( ) { javax . servlet . http . HttpServletRequest request = org . mockito . Mockito . mock ( javax . servlet . http . HttpServletRequest . class ) ; javax . servlet . http . HttpServletResponse response = org . mockito . Mockito . mock ( javax . servlet . http . HttpServletResponse . class ) ; final org . apache . commons . codec . binary . Base64 base64 = new org . apache . commons . codec . binary . Base64 ( 0 ) ; java . lang . String credentials = "bjones:invalidpassword" ; org . mockito . Mockito . when ( request . getHeader ( org . apache . hadoop . security . authentication . server . AUTHORIZATION_HEADER ) ) . thenReturn ( base64 . encodeToString ( credentials . getBytes ( ) ) ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( response ) . addHeader ( org . apache . hadoop . security . authentication . server . WWW_AUTHENTICATE_HEADER , org . apache . hadoop . security . authentication . server . BASIC ) ; org . mockito . Mockito . verify ( response ) . addHeader ( org . apache . hadoop . security . authentication . server . WWW_AUTHENTICATE_HEADER , org . apache . hadoop . security . authentication . server . NEGOTIATE ) ; org . mockito . Mockito . verify ( response ) . setStatus ( HttpServletResponse . SC_UNAUTHORIZED ) ; } authenticate ( java . net . URL , org . apache . hadoop . security . authentication . client . AuthenticatedURL$Token ) { if ( ! ( hasDelegationToken ( url ) ) ) { super . authenticate ( url , token ) ; } }
|
org . junit . Assert . assertNull ( handler . authenticate ( request , response ) )
|
getAccessInfo_USER_fromSubscription ( ) { technicalProduct . setAccessType ( ServiceAccessType . USER ) ; subscription . setAccessInfo ( "<p><p>URL</p></p>" ) ; java . lang . String info = bean . getAccessInfo ( subscription , user ) ; "<AssertPlaceHolder>" ; verify ( bean , times ( 0 ) ) . getSubscriptionUrl ( eq ( subscription ) ) ; } getAccessInfo ( org . oscm . domobjects . Subscription , org . oscm . domobjects . PlatformUser ) { java . lang . String accessInfo ; if ( useAccessInfo ( subscription ) ) { accessInfo = subscription . getAccessInfo ( ) ; if ( accessInfo == null ) { accessInfo = localizer . getLocalizedTextFromDatabase ( user . getLocale ( ) , subscription . getProduct ( ) . getTechnicalProduct ( ) . getKey ( ) , LocalizedObjectTypes . TEC_PRODUCT_LOGIN_ACCESS_DESC ) ; if ( accessInfo != null ) { accessInfo = accessInfo . replaceAll ( "<p>" , "\n" ) ; accessInfo = accessInfo . replaceAll ( "</p>" , "\n" ) ; } } } else { accessInfo = getSubscriptionUrl ( subscription ) ; } if ( accessInfo == null ) { accessInfo = "" ; } return accessInfo ; }
|
org . junit . Assert . assertEquals ( "<p><p>URL</p></p>" , info )
|
whenExtractMultipleParametersThenTheParsedParametersAreReturned ( ) { when ( parameterParser . parse ( com . thoughtworks . gauge . execution . parameters . ANY_TYPE , com . thoughtworks . gauge . execution . ParameterTestHelpers . aParameter ( ) ) ) . thenReturn ( com . thoughtworks . gauge . execution . parameters . SPECIFIC_VALUE , com . thoughtworks . gauge . execution . parameters . ParametersExtractorTest . ANOTHER_SPECIFIC_VALUE ) ; java . lang . Object [ ] extract = parametersExtractor . extract ( asList ( com . thoughtworks . gauge . execution . ParameterTestHelpers . aParameter ( ) , com . thoughtworks . gauge . execution . ParameterTestHelpers . aParameter ( ) ) , array ( com . thoughtworks . gauge . execution . parameters . ANY_TYPE , com . thoughtworks . gauge . execution . parameters . ANY_TYPE ) ) ; "<AssertPlaceHolder>" ; } valueOf ( com . google . protobuf . Descriptors . EnumValueDescriptor ) { if ( ( desc . getType ( ) ) != ( gauge . messages . Spec . ExecutionStatus . getDescriptor ( ) ) ) { throw new java . lang . IllegalArgumentException ( "EnumValueDescriptor<sp>is<sp>not<sp>for<sp>this<sp>type." ) ; } if ( ( desc . getIndex ( ) ) == ( - 1 ) ) { return gauge . messages . Spec . ExecutionStatus . UNRECOGNIZED ; } return gauge . messages . Spec . ExecutionStatus . VALUES [ desc . getIndex ( ) ] ; }
|
org . junit . Assert . assertThat ( stream ( extract ) . filter ( ( v ) -> ( v == com . thoughtworks . gauge . execution . parameters . SPECIFIC_VALUE ) || ( v == ( com . thoughtworks . gauge . execution . parameters . ParametersExtractorTest . ANOTHER_SPECIFIC_VALUE ) ) ) . count ( ) , org . hamcrest . CoreMatchers . is ( java . lang . Long . valueOf ( extract . length ) ) )
|
constructorSuccess ( ) { java . lang . String body = "This<sp>is<sp>a<sp>valid<sp>body" ; com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage iotHubTransportMessage = new com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage ( body ) ; "<AssertPlaceHolder>" ; } getBytes ( ) { return this . body ; }
|
org . junit . Assert . assertEquals ( body , new java . lang . String ( iotHubTransportMessage . getBytes ( ) ) )
|
testByteStringConstructorValueCopy ( ) { byte [ ] changing = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; byte [ ] original = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; org . opcfoundation . ua . builtintypes . ByteString bs1 = org . opcfoundation . ua . builtintypes . ByteString . valueOf ( changing ) ; org . opcfoundation . ua . builtintypes . ByteString bs2 = org . opcfoundation . ua . builtintypes . ByteString . valueOf ( original ) ; changing [ 0 ] = 10 ; "<AssertPlaceHolder>" ; } valueOf ( byte [ ] ) { if ( byteArray == null ) { return null ; } if ( ( byteArray . length ) == 0 ) { return org . opcfoundation . ua . builtintypes . ByteString . EMPTY ; } return new org . opcfoundation . ua . builtintypes . ByteString ( byteArray ) ; }
|
org . junit . Assert . assertEquals ( bs1 , bs2 )
|
testConverterFile ( ) { org . spf4j . jmx . JMXBeanMapping m = conv . get ( java . io . File . class ) ; java . io . File expected = new java . io . File ( "bla" ) ; java . lang . Object toOpenValue = m . toOpenValue ( expected ) ; java . lang . Object f = m . fromOpenValue ( toOpenValue ) ; "<AssertPlaceHolder>" ; } fromOpenValue ( java . lang . Object ) { if ( ! ( openValue instanceof javax . management . openmbean . CompositeData ) ) { throw new java . io . InvalidObjectException ( ( "Not<sp>a<sp>CompositeData<sp>" + openValue ) ) ; } javax . management . openmbean . CompositeData cd = ( ( javax . management . openmbean . CompositeData ) ( openValue ) ) ; javax . management . openmbean . CompositeType compositeType = cd . getCompositeType ( ) ; java . lang . String typeName = compositeType . getTypeName ( ) ; org . apache . avro . specific . SpecificRecordBase rec ; try { rec = ( ( org . apache . avro . specific . SpecificRecordBase ) ( java . lang . Class . forName ( typeName ) . newInstance ( ) ) ) ; } catch ( java . lang . ClassNotFoundException | java . lang . InstantiationException | java . lang . IllegalAccessException ex ) { java . io . InvalidObjectException oex = new java . io . InvalidObjectException ( ( "Invalid<sp>object<sp>" + openValue ) ) ; oex . addSuppressed ( ex ) ; throw oex ; } for ( org . apache . avro . Schema . Field field : rec . getSchema ( ) . getFields ( ) ) { java . lang . Object obj = cd . get ( field . name ( ) ) ; try { rec . put ( field . pos ( ) , typeMapper . get ( org . spf4j . jmx . mappers . SpecificRecordOpenTypeMapping . getGenericType ( field . schema ( ) ) ) . fromOpenValue ( obj ) ) ; } catch ( java . io . NotSerializableException ex ) { java . io . InvalidObjectException tex = new java . io . InvalidObjectException ( ( ( ( "Ivalid<sp>Object<sp>" + obj ) + "<sp>id<sp>" ) + cd ) ) ; tex . addSuppressed ( ex ) ; throw tex ; } } return rec ; }
|
org . junit . Assert . assertEquals ( expected , f )
|
matchXPathAttributeStartsWith ( ) { java . lang . String xmlString = "<xml><doc<sp>id='US123456789'></doc></xml>" ; gov . uspto . bulkdata . find . PatternXPath pattern = new gov . uspto . bulkdata . find . PatternXPath ( "//doc/@id[starts-with(.,'US1234')]" ) ; gov . uspto . bulkdata . find . PatternMatcher matcher = new gov . uspto . bulkdata . find . PatternMatcher ( ) ; matcher . add ( pattern ) ; "<AssertPlaceHolder>" ; } match ( java . lang . String ) { if ( xmlDocStr == null ) { return false ; } javax . xml . parsers . DocumentBuilderFactory dbfact = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) ; dbfact . setAttribute ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ; try { javax . xml . parsers . DocumentBuilder builder = dbfact . newDocumentBuilder ( ) ; org . xml . sax . InputSource inputSource = new org . xml . sax . InputSource ( new java . io . StringReader ( xmlDocStr ) ) ; org . w3c . dom . Document document = builder . parse ( inputSource ) ; javax . xml . xpath . XPathFactory fact = javax . xml . xpath . XPathFactory . newInstance ( ) ; javax . xml . xpath . XPath xpath = fact . newXPath ( ) ; java . lang . String value = ( ( java . lang . String ) ( xpath . evaluate ( xPathExpression , document , XPathConstants . STRING ) ) ) ; java . util . regex . Matcher matcher = regexPattern . matcher ( value ) ; if ( matcher . matches ( ) ) { return true ; } } catch ( javax . xml . xpath . XPathExpressionException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>XPathExpressionException<sp>on<sp>doc:{}" , xmlDocStr , e ) ; return false ; } catch ( javax . xml . parsers . ParserConfigurationException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>ParserConfigurationException" , e ) ; return false ; } catch ( org . xml . sax . SAXException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>SAXException<sp>on<sp>doc:{}" , xmlDocStr , e ) ; return false ; } catch ( java . io . IOException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "IOException" , e ) ; return false ; } return false ; }
|
org . junit . Assert . assertTrue ( matcher . match ( xmlString ) )
|
compareToNull ( ) { final int actual = this . dbObjectComparator . compare ( null , null ) ; "<AssertPlaceHolder>" ; } compare ( com . mongodb . DBObject , com . mongodb . DBObject ) { final int obj1Count = getCount ( obj1 ) ; final int obj2Count = getCount ( obj2 ) ; return obj2Count - obj1Count ; }
|
org . junit . Assert . assertEquals ( 0 , actual )
|
testBuildTimerRollOverValue ( ) { final org . opendaylight . protocol . bgp . rib . spi . state . BGPTimersState timerState = mock ( org . opendaylight . protocol . bgp . rib . spi . state . BGPTimersState . class ) ; doReturn ( 90L ) . when ( timerState ) . getNegotiatedHoldTime ( ) ; doReturn ( 42949673015L ) . when ( timerState ) . getUpTime ( ) ; final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation timerStateAug = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentationBuilder ( ) . setNegotiatedHoldTime ( java . math . BigDecimal . valueOf ( 90L ) ) . setUptime ( new org . opendaylight . yang . gen . v1 . urn . ietf . params . xml . ns . yang . ietf . yang . types . rev130715 . Timeticks ( 5L ) ) . build ( ) ; final org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . Timers expectedTimers = new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . TimersBuilder ( ) . setState ( new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . timers . StateBuilder ( ) . addAugmentation ( org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation . class , timerStateAug ) . build ( ) ) . build ( ) ; "<AssertPlaceHolder>" ; } buildTimer ( org . opendaylight . protocol . bgp . rib . spi . state . BGPTimersState ) { if ( neighbor == null ) { return null ; } final long uptimeTicks = ( ( neighbor . getUpTime ( ) ) / 10 ) % ( org . opendaylight . protocol . bgp . state . NeighborUtil . TIMETICK_ROLLOVER_VALUE ) ; final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation timerState = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentationBuilder ( ) . setNegotiatedHoldTime ( java . math . BigDecimal . valueOf ( neighbor . getNegotiatedHoldTime ( ) ) ) . setUptime ( new org . opendaylight . yang . gen . v1 . urn . ietf . params . xml . ns . yang . ietf . yang . types . rev130715 . Timeticks ( uptimeTicks ) ) . build ( ) ; return new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . TimersBuilder ( ) . setState ( new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . timers . StateBuilder ( ) . addAugmentation ( org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation . class , timerState ) . build ( ) ) . build ( ) ; }
|
org . junit . Assert . assertEquals ( expectedTimers , org . opendaylight . protocol . bgp . state . NeighborUtil . buildTimer ( timerState ) )
|
testGetAllChunks ( ) { org . apache . jackrabbit . core . data . DataIdentifier d10 = new org . apache . jackrabbit . core . data . DataIdentifier ( "d-10" ) ; org . apache . jackrabbit . core . data . DataIdentifier d20 = new org . apache . jackrabbit . core . data . DataIdentifier ( "d-20" ) ; org . apache . jackrabbit . core . data . DataIdentifier d30 = new org . apache . jackrabbit . core . data . DataIdentifier ( "d-30" ) ; java . util . List < org . apache . jackrabbit . core . data . DataIdentifier > dis = com . google . common . collect . ImmutableList . of ( d10 , d20 , d30 ) ; java . util . List < org . apache . jackrabbit . core . data . DataRecord > recs = com . google . common . collect . Lists . newArrayList ( com . google . common . collect . Iterables . transform ( dis , new com . google . common . base . Function < org . apache . jackrabbit . core . data . DataIdentifier , org . apache . jackrabbit . core . data . DataRecord > ( ) { @ org . jetbrains . annotations . Nullable @ org . apache . jackrabbit . oak . plugins . blob . datastore . Override public org . apache . jackrabbit . core . data . DataRecord apply ( @ org . jetbrains . annotations . Nullable org . apache . jackrabbit . core . data . DataIdentifier input ) { return new org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreBlobStoreTest . TimeDataRecord ( input ) ; } } ) ) ; org . apache . jackrabbit . oak . plugins . blob . datastore . OakFileDataStore mockedDS = mock ( org . apache . jackrabbit . oak . plugins . blob . datastore . OakFileDataStore . class ) ; when ( mockedDS . getAllRecords ( ) ) . thenReturn ( recs . iterator ( ) ) ; when ( mockedDS . getRecord ( new org . apache . jackrabbit . core . data . DataIdentifier ( "d-10" ) ) ) . thenReturn ( new org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreBlobStoreTest . TimeDataRecord ( d10 ) ) ; when ( mockedDS . getRecord ( new org . apache . jackrabbit . core . data . DataIdentifier ( "d-20" ) ) ) . thenReturn ( new org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreBlobStoreTest . TimeDataRecord ( d20 ) ) ; when ( mockedDS . getRecord ( new org . apache . jackrabbit . core . data . DataIdentifier ( "d-30" ) ) ) . thenReturn ( new org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreBlobStoreTest . TimeDataRecord ( d30 ) ) ; org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreBlobStore ds = new org . apache . jackrabbit . oak . plugins . blob . datastore . DataStoreBlobStore ( mockedDS ) ; java . util . Iterator < java . lang . String > chunks = ds . getAllChunkIds ( 25 ) ; java . util . Set < java . lang . String > expected = com . google . common . collect . Sets . newHashSet ( "d-10" , "d-20" ) ; "<AssertPlaceHolder>" ; } getAllChunkIds ( long ) { org . bson . conversions . Bson fields = new com . mongodb . BasicDBObject ( MongoBlob . KEY_ID , 1 ) ; org . bson . conversions . Bson query = new org . bson . Document ( ) ; if ( ( maxLastModifiedTime != 0 ) && ( maxLastModifiedTime != ( - 1 ) ) ) { query = com . mongodb . client . model . Filters . lte ( MongoBlob . KEY_LAST_MOD , maxLastModifiedTime ) ; } final com . mongodb . client . MongoCursor < org . apache . jackrabbit . oak . plugins . document . mongo . MongoBlob > cur = getBlobCollection ( ) . find ( query ) . projection ( fields ) . hint ( fields ) . iterator ( ) ; return new com . google . common . collect . AbstractIterator < java . lang . String > ( ) { @ org . apache . jackrabbit . oak . plugins . document . mongo . Override protected java . lang . String computeNext ( ) { if ( cur . hasNext ( ) ) { org . apache . jackrabbit . oak . plugins . document . mongo . MongoBlob blob = cur . next ( ) ; if ( blob != null ) { return blob . getId ( ) ; } } return endOfData ( ) ; } } ; }
|
org . junit . Assert . assertEquals ( expected , com . google . common . collect . Sets . newHashSet ( chunks ) )
|
testTreePermissionIsGrantedOR ( ) { org . apache . jackrabbit . oak . spi . security . authorization . permission . TreePermission parentPermission = org . apache . jackrabbit . oak . spi . security . authorization . permission . TreePermission . EMPTY ; for ( java . lang . String path : TP_PATHS ) { org . apache . jackrabbit . oak . spi . security . authorization . permission . TreePermission tp = cppO . getTreePermission ( root . getTree ( path ) , parentPermission ) ; java . lang . Long toTest = ( defPermissions . containsKey ( path ) ) ? defPermissions . get ( path ) : defPermissions . get ( org . apache . jackrabbit . oak . commons . PathUtils . getAncestorPath ( path , 1 ) ) ; if ( toTest != null ) { "<AssertPlaceHolder>" ; } parentPermission = tp ; } } isGranted ( long ) { return false ; }
|
org . junit . Assert . assertTrue ( tp . isGranted ( toTest ) )
|
testCompareArtists ( ) { org . bff . javampd . album . MPDAlbum album1 = new org . bff . javampd . album . MPDAlbum ( "Album1" , "Artist1" ) ; org . bff . javampd . album . MPDAlbum album2 = new org . bff . javampd . album . MPDAlbum ( "Album2" , "Artist1" ) ; "<AssertPlaceHolder>" ; } getArtistName ( ) { return artistName ; }
|
org . junit . Assert . assertEquals ( album1 . getArtistName ( ) , album2 . getArtistName ( ) )
|
testExists_False ( ) { initializeExpectedJob ( 1 ) ; com . google . cloud . bigquery . BigQuery [ ] expectedOptions = new BigQuery . JobOption [ ] { BigQuery . JobOption . fields ( ) } ; expect ( bigquery . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( bigquery . getJob ( com . google . cloud . bigquery . JobTest . JOB_INFO . getJobId ( ) , expectedOptions ) ) . andReturn ( null ) ; replay ( bigquery ) ; initializeJob ( ) ; "<AssertPlaceHolder>" ; } exists ( ) { boolean exists = bucket . exists ( ) ; if ( exists ) { } else { } return exists ; }
|
org . junit . Assert . assertFalse ( job . exists ( ) )
|
testGetXWhenShapeIsNull ( ) { when ( canvas . getShape ( uuid ) ) . thenReturn ( null ) ; "<AssertPlaceHolder>" ; } getX ( ) { return x ; }
|
org . junit . Assert . assertEquals ( 0 , event . getX ( ) )
|
testConstructorWithBasicAwsCredentialsAndClientConfiguration ( ) { creds = new com . amazonaws . auth . BasicAWSCredentials ( "accessKey" , "secretKey" ) ; s3 = new com . amazonaws . services . s3 . AmazonS3Client ( creds , new com . amazonaws . ClientConfiguration ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( s3 )
|
testGetElementType ( ) { final javax . xml . namespace . QName qName = pluginForMongo . getElementType ( "test" , false ) ; "<AssertPlaceHolder>" ; } getLocalPart ( ) { return name . getLocalPart ( ) ; }
|
org . junit . Assert . assertEquals ( "test" , qName . getLocalPart ( ) )
|
testThatDoesntNormalizeIfStartsWithHttps ( ) { java . lang . String url = new net . vidageek . crawler . component . DefaultLinkNormalizer ( "http://test.com/foo" ) . normalize ( "https://other.com/bar" ) ; "<AssertPlaceHolder>" ; } normalize ( java . lang . String ) { java . lang . String normalizedUrl = delegate . normalize ( url ) . toLowerCase ( ) ; if ( normalizedUrl . contains ( "#" ) ) return normalizedUrl . substring ( 0 , normalizedUrl . indexOf ( "#" ) ) ; return normalizedUrl ; }
|
org . junit . Assert . assertEquals ( "https://other.com/bar" , url )
|
testPendingMemberShouldLeaveGroup ( ) { final java . lang . String consumerId = "consumer-id" ; subscriptions . subscribe ( singleton ( topic1 ) , rebalanceListener ) ; client . prepareResponse ( groupCoordinatorResponse ( node , Errors . NONE ) ) ; coordinator . ensureCoordinatorReady ( time . timer ( Long . MAX_VALUE ) ) ; client . prepareResponse ( joinGroupFollowerResponse ( ( - 1 ) , consumerId , "leader-id" , Errors . MEMBER_ID_REQUIRED ) ) ; coordinator . joinGroupIfNeeded ( time . timer ( 0 ) ) ; final java . util . concurrent . atomic . AtomicBoolean received = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; client . prepareResponse ( new org . apache . kafka . clients . MockClient . RequestMatcher ( ) { @ org . apache . kafka . clients . consumer . internals . Override public boolean matches ( org . apache . kafka . common . requests . AbstractRequest body ) { received . set ( true ) ; org . apache . kafka . common . requests . LeaveGroupRequest leaveRequest = ( ( org . apache . kafka . common . requests . LeaveGroupRequest ) ( body ) ) ; return leaveRequest . data ( ) . memberId ( ) . equals ( consumerId ) ; } } , new org . apache . kafka . common . requests . LeaveGroupResponse ( new org . apache . kafka . common . message . LeaveGroupResponseData ( ) . setErrorCode ( Errors . NONE . code ( ) ) ) ) ; coordinator . maybeLeaveGroup ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return value ; }
|
org . junit . Assert . assertTrue ( received . get ( ) )
|
testGetWhenDoesNotExist ( ) { final byte [ ] flow1v1 = fileSystemFlowProvider . getFlowContent ( "bucket1" , "flow1" , 1 ) ; "<AssertPlaceHolder>" ; } getFlowContent ( java . lang . String , java . lang . String , int ) { final org . apache . nifi . registry . provider . flow . git . Bucket bucket = getBucketOrFail ( bucketId ) ; final org . apache . nifi . registry . provider . flow . git . Flow flow = getFlowOrFail ( bucket , flowId ) ; if ( ! ( flow . hasVersion ( version ) ) ) { throw new org . apache . nifi . registry . flow . FlowPersistenceException ( java . lang . String . format ( "Flow<sp>ID<sp>%s<sp>version<sp>%d<sp>was<sp>not<sp>found<sp>in<sp>bucket<sp>%s:%s." , flowId , version , bucket . getBucketDirName ( ) , bucketId ) ) ; } final org . apache . nifi . registry . provider . flow . git . Flow . FlowPointer flowPointer = flow . getFlowVersion ( version ) ; try { return flowMetaData . getContent ( flowPointer . getObjectId ( ) ) ; } catch ( java . io . IOException e ) { throw new org . apache . nifi . registry . flow . FlowPersistenceException ( java . lang . String . format ( "Failed<sp>to<sp>get<sp>content<sp>of<sp>Flow<sp>ID<sp>%s<sp>version<sp>%d<sp>in<sp>bucket<sp>%s:%s<sp>due<sp>to<sp>%s." , flowId , version , bucket . getBucketDirName ( ) , bucketId , e ) , e ) ; } }
|
org . junit . Assert . assertNull ( flow1v1 )
|
GetArrayOffset ( ) { java . lang . String st = "HTTP/1.1<sp>101<sp>Switching<sp>Protocols\r\nAccept:<sp>*/*\r\nSec-WebSocket-Accept:<sp>W5bRv0dwYtd1GPxLJnXACYizcbU=\r\nUser-Agent:<sp>litesockets\r\n\r\n" ; org . threadly . litesockets . buffers . MergedByteBuffers mbb = new org . threadly . litesockets . buffers . ReuseableMergedByteBuffers ( ) ; mbb . add ( st . getBytes ( ) ) ; byte [ ] ba = new byte [ mbb . remaining ( ) ] ; System . out . println ( mbb . remaining ( ) ) ; for ( int i = 0 ; i < ( ba . length ) ; i ++ ) { mbb . get ( ba , i , 1 ) ; } System . out . println ( new java . lang . String ( ba ) . length ( ) ) ; System . out . println ( mbb . remaining ( ) ) ; "<AssertPlaceHolder>" ; } remaining ( ) { int left = 0 ; for ( int i = currentBuffer ; i < ( bba . length ) ; i ++ ) { left += bba [ i ] . remaining ( ) ; } return left ; }
|
org . junit . Assert . assertEquals ( st , new java . lang . String ( ba ) )
|
testCreateSchemaCharSet ( ) { java . util . List < com . zendesk . maxwell . schema . ddl . SchemaChange > changes = parse ( "CREATE<sp>SCHEMA<sp>IF<sp>NOT<sp>EXISTS<sp>`tblname`<sp>CHARACTER<sp>SET<sp>=<sp>default" ) ; "<AssertPlaceHolder>" ; } size ( ) { return columns . size ( ) ; }
|
org . junit . Assert . assertThat ( changes . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
|
assignedOrgChanged_negative ( ) { org . oscm . ui . model . Marketplace m = new org . oscm . ui . model . Marketplace ( ) ; m . setOwningOrganizationId ( "owningOrganizationId" ) ; m . setOriginalOrgId ( m . getOwningOrganizationId ( ) ) ; "<AssertPlaceHolder>" ; } assignedOrgChanged ( ) { org . oscm . ui . model . Marketplace m = new org . oscm . ui . model . Marketplace ( ) ; m . setOwningOrganizationId ( "owningOrganizationId" ) ; m . setOriginalOrgId ( "originalOrgId" ) ; org . junit . Assert . assertTrue ( m . assignedOrgChanged ( ) ) ; }
|
org . junit . Assert . assertFalse ( m . assignedOrgChanged ( ) )
|
noClassCastExceptionInGetAction ( ) { org . sejda . sambox . pdmodel . interactive . documentnavigation . outline . PDOutlineItem victim = new org . sejda . sambox . pdmodel . interactive . documentnavigation . outline . PDOutlineItem ( ) ; victim . getCOSObject ( ) . setItem ( COSName . A , new org . sejda . sambox . cos . COSArray ( org . sejda . sambox . cos . COSInteger . ONE ) ) ; "<AssertPlaceHolder>" ; } getAction ( ) { return org . sejda . sambox . pdmodel . interactive . action . PDActionFactory . createAction ( getCOSObject ( ) . getDictionaryObject ( COSName . A , org . sejda . sambox . cos . COSDictionary . class ) ) ; }
|
org . junit . Assert . assertNull ( victim . getAction ( ) )
|
testList ( ) { final ch . cyberduck . core . AttributedList < ch . cyberduck . core . Path > list = new ch . cyberduck . core . b2 . B2BucketListService ( session ) . list ( new ch . cyberduck . core . Path ( java . lang . String . valueOf ( Path . DELIMITER ) , java . util . EnumSet . of ( Path . Type . volume , Path . Type . directory ) ) , new ch . cyberduck . core . DisabledListProgressListener ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ( ) ) == 0 ; }
|
org . junit . Assert . assertFalse ( list . isEmpty ( ) )
|
testMismatchedFunctionUnequivalent ( ) { final org . openbel . framework . common . model . Namespace hgnc = new org . openbel . framework . common . model . Namespace ( "HGNC" , "http://resource.belframework.org/belframework/1.0/namespace/hgnc-approved-symbols.belns" ) ; org . openbel . framework . core . equivalence . EquivalentParameter param1 = new org . openbel . framework . core . equivalence . EquivalentParameter ( hgnc , "AKT1" , org . openbel . framework . common . protonetwork . model . SkinnyUUID . fromString ( "a32fd1cb-7d97-44ee-a0d0-db16c2a93b3f" ) ) ; org . openbel . framework . core . equivalence . EquivalentTerm term1 = new org . openbel . framework . core . equivalence . EquivalentTerm ( PROTEIN_ABUNDANCE , java . util . Arrays . asList ( ( ( org . openbel . framework . common . model . BELObject ) ( param1 ) ) ) ) ; org . openbel . framework . core . equivalence . EquivalentParameter param2 = new org . openbel . framework . core . equivalence . EquivalentParameter ( hgnc , "AKT1" , org . openbel . framework . common . protonetwork . model . SkinnyUUID . fromString ( "a32fd1cb-7d97-44ee-a0d0-db16c2a93b3f" ) ) ; org . openbel . framework . core . equivalence . EquivalentTerm term2 = new org . openbel . framework . core . equivalence . EquivalentTerm ( GENE_ABUNDANCE , java . util . Arrays . asList ( ( ( org . openbel . framework . common . model . BELObject ) ( param2 ) ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } else if ( obj == null ) { return false ; } else if ( ! ( obj instanceof org . openbel . framework . api . CitationFilterCriteria ) ) { return false ; } else { org . openbel . framework . api . CitationFilterCriteria other = ( ( org . openbel . framework . api . CitationFilterCriteria ) ( obj ) ) ; return ( ( isInclude ( ) ) == ( other . isInclude ( ) ) ) && ( valueSet . equals ( other . valueSet ) ) ; } }
|
org . junit . Assert . assertThat ( term1 . equals ( term2 ) , org . hamcrest . CoreMatchers . is ( false ) )
|
testSetLiteralWithOneEntryBlock ( ) { org . apache . commons . jexl3 . JexlScript e = org . apache . commons . jexl3 . JEXL . createScript ( "{<sp>{<sp>'foo'<sp>};<sp>}" ) ; org . apache . commons . jexl3 . JexlContext jc = new org . apache . commons . jexl3 . MapContext ( ) ; java . lang . Object o = e . execute ( jc ) ; java . util . Set < ? > check = org . apache . commons . jexl3 . SetLiteralTest . createSet ( "foo" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final org . apache . commons . jexl3 . internal . Script other = ( ( org . apache . commons . jexl3 . internal . Script ) ( obj ) ) ; if ( ( this . jexl ) != ( other . jexl ) ) { return false ; } if ( ( this . source ) == null ? ( other . source ) != null : ! ( this . source . equals ( other . source ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertTrue ( check . equals ( o ) )
|
testSingleFault ( ) { if ( ! ( runningInDistributedMode ( ) ) ) { System . out . println ( "testSingleFault:<sp>Ignore<sp>this<sp>test<sp>in<sp>local<sp>mode." ) ; return ; } org . apache . hadoop . fs . Path outputPath = getTempPath ( getCallingMethodName ( ) ) ; org . apache . giraph . conf . GiraphConfiguration conf = new org . apache . giraph . conf . GiraphConfiguration ( ) ; conf . setComputationClass ( SimpleCheckpoint . SimpleCheckpointComputation . class ) ; conf . setWorkerContextClass ( SimpleCheckpoint . SimpleCheckpointVertexWorkerContext . class ) ; conf . setMasterComputeClass ( SimpleCheckpoint . SimpleCheckpointVertexMasterCompute . class ) ; conf . setVertexInputFormatClass ( org . apache . giraph . examples . SimpleSuperstepComputation . SimpleSuperstepVertexInputFormat . class ) ; conf . setVertexOutputFormatClass ( org . apache . giraph . examples . SimpleSuperstepComputation . SimpleSuperstepVertexOutputFormat . class ) ; conf . setBoolean ( SimpleCheckpoint . ENABLE_FAULT , true ) ; conf . setInt ( "mapred.map.max.attempts" , 4 ) ; conf . setInt ( "mapred.task.timeout" , 10000 ) ; conf . setMaxMasterSuperstepWaitMsecs ( 10000 ) ; conf . setEventWaitMsecs ( 1000 ) ; conf . setCheckpointFrequency ( 2 ) ; GiraphConstants . CHECKPOINT_DIRECTORY . set ( conf , getTempPath ( "_singleFaultCheckpoints" ) . toString ( ) ) ; GiraphConstants . CLEANUP_CHECKPOINTS_AFTER_SUCCESS . set ( conf , false ) ; GiraphConstants . ZOOKEEPER_SESSION_TIMEOUT . set ( conf , 10000 ) ; GiraphConstants . ZOOKEEPER_MIN_SESSION_TIMEOUT . set ( conf , 10000 ) ; org . apache . giraph . job . GiraphJob job = prepareJob ( getCallingMethodName ( ) , conf , outputPath ) ; "<AssertPlaceHolder>" ; } run ( boolean ) { setIntConfIfDefault ( "mapreduce.job.counters.limit" , 512 ) ; setIntConfIfDefault ( "mapred.job.map.memory.mb" , 1024 ) ; setIntConfIfDefault ( "mapred.job.reduce.memory.mb" , 0 ) ; giraphConfiguration . setBoolean ( "mapred.map.tasks.speculative.execution" , false ) ; org . apache . hadoop . ipc . Client . setPingInterval ( giraphConfiguration , ( 60000 * 5 ) ) ; giraphConfiguration . setBoolean ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 5 , true ) ; giraphConfiguration . setBoolean ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 1 , true ) ; if ( ( giraphConfiguration . getCheckpointFrequency ( ) ) == 0 ) { int oldMaxTaskAttempts = giraphConfiguration . getMaxTaskAttempts ( ) ; giraphConfiguration . setMaxTaskAttempts ( 1 ) ; if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( ( ( ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 0 + "do<sp>not<sp>allow<sp>any<sp>task<sp>retries<sp>(setting<sp>" ) + ( GiraphConstants . MAX_TASK_ATTEMPTS . getKey ( ) ) ) + "<sp>=<sp>1,<sp>" ) + "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 2 ) + oldMaxTaskAttempts ) + ")" ) ) ; } } org . apache . giraph . conf . ImmutableClassesGiraphConfiguration conf = new org . apache . giraph . conf . ImmutableClassesGiraphConfiguration ( giraphConfiguration ) ; org . apache . giraph . job . GiraphJob . checkLocalJobRunnerConfiguration ( conf ) ; int tryCount = 0 ; org . apache . giraph . job . GiraphJobRetryChecker retryChecker = conf . getJobRetryChecker ( ) ; while ( true ) { org . apache . giraph . job . GiraphJobObserver jobObserver = conf . getJobObserver ( ) ; org . apache . giraph . job . JobProgressTrackerService jobProgressTrackerService = org . apache . giraph . job . DefaultJobProgressTrackerService . createJobProgressTrackerService ( conf , jobObserver ) ; org . apache . giraph . job . ClientThriftServer clientThriftServer = null ; if ( jobProgressTrackerService != null ) { clientThriftServer = new org . apache . giraph . job . ClientThriftServer ( conf , com . google . common . collect . ImmutableList . of ( jobProgressTrackerService ) ) ; } tryCount ++ ; org . apache . hadoop . mapreduce . Job submittedJob = new org . apache . hadoop . mapreduce . Job ( conf , jobName ) ; if ( ( submittedJob . getJar ( ) ) == null ) { submittedJob . setJarByClass ( getClass ( ) ) ; } submittedJob . setNumReduceTasks ( 0 ) ; submittedJob . setMapperClass ( org . apache . giraph . graph . GraphMapper . class ) ; submittedJob . setInputFormatClass ( org . apache . giraph . bsp . BspInputFormat . class ) ; submittedJob . setOutputFormatClass ( GiraphConstants . HADOOP_OUTPUT_FORMAT_CLASS . get ( conf ) ) ; if ( jobProgressTrackerService != null ) { jobProgressTrackerService . setJob ( submittedJob ) ; } jobObserver . launchingJob ( submittedJob ) ; submittedJob . submit ( ) ; if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( "Tracking<sp>URL:<sp>" + ( submittedJob . getTrackingURL ( ) ) ) ) ; org . apache . giraph . job . GiraphJob . LOG . info ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" + ( ( conf . getMinWorkers ( ) ) + 1 ) ) + "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 3 ) ) ; } jobObserver . jobRunning ( submittedJob ) ; org . apache . giraph . job . HaltApplicationUtils . printHaltInfo ( submittedJob , conf ) ; boolean passed = submittedJob . waitForCompletion ( verbose ) ; if ( jobProgressTrackerService != null ) { jobProgressTrackerService . stop ( passed ) ; } if ( clientThriftServer != null ) { clientThriftServer . stopThriftServer ( ) ; } jobObserver . jobFinished ( submittedJob , passed ) ; if ( ! passed ) { java . lang . String restartFrom = retryChecker . shouldRestartCheckpoint ( submittedJob ) ; if ( restartFrom != null ) { GiraphConstants . RESTART_JOB_ID . set ( conf , restartFrom ) ; continue ; } } if ( passed || ( ! ( retryChecker . shouldRetry ( submittedJob , tryCount ) ) ) ) { return passed ; } if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 4 +
|
org . junit . Assert . assertTrue ( job . run ( true ) )
|
mustNotIdentifyAsParentOrEqual ( ) { com . offbynull . actors . address . Address other = com . offbynull . actors . address . Address . of ( "one" , "two" , "three" ) ; com . offbynull . actors . address . Address fixture = com . offbynull . actors . address . Address . of ( "one" , "xxx" , "three" ) ; "<AssertPlaceHolder>" ; } isPrefixOf ( com . offbynull . actors . address . Address ) { org . apache . commons . lang3 . Validate . notNull ( other ) ; if ( ( other . addressElements . size ( ) ) < ( addressElements . size ( ) ) ) { return false ; } return other . addressElements . subList ( 0 , addressElements . size ( ) ) . equals ( addressElements ) ; }
|
org . junit . Assert . assertFalse ( other . isPrefixOf ( fixture ) )
|
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . message . boards . model . MBMailingList . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "mailingListId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "mailingListId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testSendAnalytics ( ) { java . lang . String name = com . liferay . portal . kernel . security . auth . PrincipalThreadLocal . getName ( ) ; try { com . liferay . portal . kernel . security . auth . PrincipalThreadLocal . setName ( com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) ) ; com . liferay . analytics . model . AnalyticsEventsMessage . Builder analyticsEventsMessageBuilder = com . liferay . analytics . model . AnalyticsEventsMessage . builder ( "ApplicationKey" ) ; analyticsEventsMessageBuilder . contextProperty ( "languageId" , "en_US" ) ; analyticsEventsMessageBuilder . contextProperty ( "url" , "http://www.liferay.com" ) ; com . liferay . analytics . model . AnalyticsEventsMessage . Event . Builder eventBuilder = AnalyticsEventsMessage . Event . builder ( "ApplicationId" , "View" ) ; eventBuilder . property ( "elementId" , "banner1" ) ; analyticsEventsMessageBuilder . event ( eventBuilder . build ( ) ) ; analyticsEventsMessageBuilder . protocolVersion ( "1.0" ) ; java . lang . Object response = com . liferay . analytics . client . osgi . test . AnalyticsClientTest . _analyticsClient . sendAnalytics ( analyticsEventsMessageBuilder . build ( ) ) ; "<AssertPlaceHolder>" ; } finally { com . liferay . portal . kernel . security . auth . PrincipalThreadLocal . setName ( name ) ; } } build ( ) { return _identityMessage ; }
|
org . junit . Assert . assertNull ( response )
|
updateShouldChangeUsername ( ) { final net . jforum . entities . User current = new net . jforum . entities . User ( ) ; current . setUsername ( "old" ) ; when ( repository . get ( 1 ) ) . thenReturn ( current ) ; net . jforum . entities . User newUser = new net . jforum . entities . User ( ) ; newUser . setId ( 1 ) ; newUser . setUsername ( "new<sp>username" ) ; service . update ( newUser , true ) ; "<AssertPlaceHolder>" ; } getUsername ( ) { return this . username ; }
|
org . junit . Assert . assertEquals ( newUser . getUsername ( ) , current . getUsername ( ) )
|
applyTest ( ) { java . lang . String [ ] [ ] tests = new java . lang . String [ ] [ ] { new java . lang . String [ ] { "{{<sp>8<sp>|<sp>modulo:<sp>2<sp>}}" , "0" } , new java . lang . String [ ] { "{{<sp>8<sp>|<sp>modulo:<sp>3<sp>}}" , "2" } , new java . lang . String [ ] { "{{<sp>\"8\"<sp>|<sp>modulo:<sp>3.<sp>}}" , "2.0" } , new java . lang . String [ ] { "{{<sp>8<sp>|<sp>modulo:<sp>3.0<sp>}}" , "2.0" } , new java . lang . String [ ] { "{{<sp>8<sp>|<sp>modulo:<sp>'2.0'<sp>}}" , "0.0" } } ; for ( java . lang . String [ ] test : tests ) { liqp . Template template = liqp . Template . parse ( test [ 0 ] ) ; java . lang . String rendered = java . lang . String . valueOf ( template . render ( ) ) ; "<AssertPlaceHolder>" ; } } render ( ) { return render ( new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; }
|
org . junit . Assert . assertThat ( rendered , org . hamcrest . CoreMatchers . is ( test [ 1 ] ) )
|
shouldAllowBypassForPresentPermission ( ) { org . bukkit . command . CommandSender sender = mock ( org . bukkit . command . CommandSender . class ) ; java . lang . String email = "mail-address@example.com" ; given ( permissionsManager . hasPermission ( sender , PlayerStatePermission . ALLOW_MULTIPLE_ACCOUNTS ) ) . willReturn ( true ) ; given ( dataSource . countAuthsByEmail ( email ) ) . willReturn ( 7 ) ; boolean result = validationService . isEmailFreeForRegistration ( email , sender ) ; "<AssertPlaceHolder>" ; } isEmailFreeForRegistration ( java . lang . String , org . bukkit . command . CommandSender ) { return ( permissionsManager . hasPermission ( sender , PlayerStatePermission . ALLOW_MULTIPLE_ACCOUNTS ) ) || ( ( dataSource . countAuthsByEmail ( email ) ) < ( settings . getProperty ( EmailSettings . MAX_REG_PER_EMAIL ) ) ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( true ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.