input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testConstant ( ) { org . hipparchus . filtering . kalman . extended . ExtendedKalmanFilterTest . ConstantProcess process = new org . hipparchus . filtering . kalman . extended . ExtendedKalmanFilterTest . ConstantProcess ( ) ; final org . hipparchus . filtering . kalman . ProcessEstimate initial = new org . hipparchus . filtering . kalman . ProcessEstimate ( 0 , org . hipparchus . linear . MatrixUtils . createRealVector ( new double [ ] { 10.0 } ) , process . q ) ; "<AssertPlaceHolder>" ; final java . util . List < org . hipparchus . filtering . kalman . Reference > referenceData = org . hipparchus . filtering . kalman . Reference . loadReferenceData ( 1 , 1 , "constant-value.txt" ) ; final java . util . stream . Stream < org . hipparchus . filtering . kalman . SimpleMeasurement > measurements = referenceData . stream ( ) . map ( ( r ) -> new org . hipparchus . filtering . kalman . SimpleMeasurement ( r . getTime ( ) , r . getZ ( ) , org . hipparchus . linear . MatrixUtils . createRealDiagonalMatrix ( new double [ ] { 0.1 } ) ) ) ; final org . hipparchus . filtering . kalman . extended . ExtendedKalmanFilter < org . hipparchus . filtering . kalman . SimpleMeasurement > filter = new org . hipparchus . filtering . kalman . extended . ExtendedKalmanFilter ( new org . hipparchus . linear . CholeskyDecomposer ( 1.0E-15 , 1.0E-15 ) , process , initial ) ; measurements . map ( ( measurement ) -> filter . estimationStep ( measurement ) ) . forEach ( ( estimate ) -> { for ( org . hipparchus . filtering . kalman . Reference r : referenceData ) { if ( r . sameTime ( estimate . getTime ( ) ) ) { r . checkState ( estimate . getState ( ) , 1.0E-15 ) ; r . checkCovariance ( estimate . getCovariance ( ) , 3.0E-19 ) ; return ; } } } ) ; } getInnovationCovariance ( ) { return innovationCovarianceMatrix ; }
|
org . junit . Assert . assertNull ( initial . getInnovationCovariance ( ) )
|
testPointTypeWithOneOtherProperty ( ) { org . neo4j . graphdb . spatial . Point point = org . neo4j . values . storable . Values . pointValue ( CoordinateReferenceSystem . Cartesian , 1 , 1 ) ; java . lang . String key = "location" ; node1 . setProperty ( "prop1" , 1 ) ; node1 . setProperty ( key , point ) ; newTransaction ( ) ; java . lang . Object property = node1 . getProperty ( key ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { if ( null == key ) { throw new java . lang . IllegalArgumentException ( "(null)<sp>property<sp>key<sp>is<sp>not<sp>allowed" ) ; } org . neo4j . kernel . api . KernelTransaction transaction = spi . kernelTransaction ( ) ; int propertyKey = transaction . tokenRead ( ) . propertyKey ( key ) ; if ( propertyKey == ( org . neo4j . internal . kernel . api . TokenRead . NO_TOKEN ) ) { throw new org . neo4j . graphdb . NotFoundException ( java . lang . String . format ( "No<sp>such<sp>property,<sp>'%s'." , key ) ) ; } org . neo4j . internal . kernel . api . RelationshipScanCursor relationships = transaction . ambientRelationshipCursor ( ) ; org . neo4j . internal . kernel . api . PropertyCursor properties = transaction . ambientPropertyCursor ( ) ; singleRelationship ( transaction , relationships ) ; relationships . properties ( properties ) ; while ( properties . next ( ) ) { if ( propertyKey == ( properties . propertyKey ( ) ) ) { org . neo4j . values . storable . Value value = properties . propertyValue ( ) ; if ( value == ( org . neo4j . values . storable . Values . NO_VALUE ) ) { throw new org . neo4j . graphdb . NotFoundException ( java . lang . String . format ( "No<sp>such<sp>property,<sp>'%s'." , key ) ) ; } return value . asObjectCopy ( ) ; } } throw new org . neo4j . graphdb . NotFoundException ( java . lang . String . format ( "No<sp>such<sp>property,<sp>'%s'." , key ) ) ; }
|
org . junit . Assert . assertEquals ( point , property )
|
testEncoding ( ) { org . w3c . dom . Document document = xmlHelpers . getXMLDocumentOfSAMLMessage ( message ) ; java . lang . String message = xmlHelpers . getStringOfDocument ( document , 0 , false ) ; "<AssertPlaceHolder>" ; } getStringOfDocument ( org . w3c . dom . Document , int , boolean ) { document . normalize ( ) ; removeEmptyTags ( document ) ; return getString ( document , linebreaks , indent ) ; }
|
org . junit . Assert . assertEquals ( true , message . contains ( "" ) )
|
isCheckingAccessInfoEmpty_nullSelectedTechnicalService ( ) { "<AssertPlaceHolder>" ; } isCheckingAccessInfoEmpty ( ) { boolean isValidationAccessInfo = false ; if ( ( selectedTechnicalService ) != null ) { java . lang . String locale = getUserLanguage ( ) ; org . oscm . internal . types . enumtypes . ServiceAccessType accessType = selectedTechnicalService . getVo ( ) . getAccessType ( ) ; if ( ( locale . equals ( "en" ) ) && ( ( accessType == ( org . oscm . internal . types . enumtypes . ServiceAccessType . DIRECT ) ) || ( accessType == ( org . oscm . internal . types . enumtypes . ServiceAccessType . USER ) ) ) ) { isValidationAccessInfo = true ; } } return isValidationAccessInfo ; }
|
org . junit . Assert . assertFalse ( bean . isCheckingAccessInfoEmpty ( ) )
|
staffServiceTest ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
statusTest ( ) { fr . gouv . vitam . logbook . operations . client . LogbookOperationsClientFactory . changeMode ( null ) ; final fr . gouv . vitam . logbook . operations . client . LogbookOperationsClient client = fr . gouv . vitam . logbook . operations . client . LogbookOperationsClientFactory . getInstance ( ) . getClient ( ) ; "<AssertPlaceHolder>" ; client . checkStatus ( ) ; } getClient ( ) { return new fr . gouv . vitam . client . IhmRecetteClient ( this ) ; }
|
org . junit . Assert . assertNotNull ( client )
|
testGetSyntaxErrors_DoubleQuotes_End ( ) { a . setProperty ( "prop" , "Expected<sp>value<sp>is<sp>''{0}''" ) ; final org . oscm . build . ant . PropertiesSyntaxChecker checker = new org . oscm . build . ant . PropertiesSyntaxChecker ( a ) ; "<AssertPlaceHolder>" ; } getSyntaxSingleQuotesErrorKeys ( ) { java . lang . String singleQuoted = "\'\\{[0-9]+\\}\'" ; java . lang . String notQuote = "[^']{1}" ; java . lang . String begin = ( ( "^(" + singleQuoted ) + notQuote ) + ")" ; java . lang . String end = ( ( "(" + notQuote ) + singleQuoted ) + ")$" ; java . lang . String middle = ( notQuote + singleQuoted ) + notQuote ; java . lang . String exact = ( "^(" + singleQuoted ) + ")$" ; java . lang . String pattern = ( ( ( ( ( ( ( "(" + begin ) + ")|(" ) + middle ) + ")|(" ) + end ) + ")|(" ) + exact ) + ")" ; final java . util . regex . Pattern VAR_PATTERN_SYNTAX = java . util . regex . Pattern . compile ( pattern ) ; java . util . Set < java . util . Map . Entry < java . lang . Object , java . lang . Object > > s = a . entrySet ( ) ; java . util . Iterator < java . util . Map . Entry < java . lang . Object , java . lang . Object > > it = s . iterator ( ) ; final java . util . Set < java . lang . String > result = new java . util . HashSet < java . lang . String > ( ) ; while ( it . hasNext ( ) ) { final java . util . Map . Entry < java . lang . Object , java . lang . Object > propEntry = it . next ( ) ; java . lang . String text = propEntry . getValue ( ) . toString ( ) ; final java . util . regex . Matcher m = VAR_PATTERN_SYNTAX . matcher ( text ) ; if ( m . find ( ) ) { result . add ( propEntry . getKey ( ) . toString ( ) ) ; } } return result ; }
|
org . junit . Assert . assertEquals ( 0 , checker . getSyntaxSingleQuotesErrorKeys ( ) . size ( ) )
|
testSearchWithNoResults ( ) { java . lang . String json = "{\"q0\":{\"query\":<sp>\"ncjecerence\",\"type_strict\":\"should\"}}" ; org . springframework . test . web . servlet . MvcResult mvcResult = mvc . perform ( get ( "/reconcile/viaf" ) . param ( "queries" , json ) ) . andReturn ( ) ; java . lang . String body = mvcResult . getResponse ( ) . getContentAsString ( ) ; com . fasterxml . jackson . databind . JsonNode root = new com . fasterxml . jackson . databind . ObjectMapper ( ) . readTree ( body ) ; com . fasterxml . jackson . databind . JsonNode results = root . get ( "q0" ) . get ( "result" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
|
testCompareViaParsing ( ) { javax . xml . datatype . DatatypeFactory dt = javax . xml . datatype . DatatypeFactory . newInstance ( ) ; javax . xml . datatype . XMLGregorianCalendar now = dt . newXMLGregorianCalendar ( "2009-06-03T17:42:09.322-04:00" ) ; javax . xml . datatype . XMLGregorianCalendar notBefore = dt . newXMLGregorianCalendar ( "2009-06-03T17:42:05.901-04:00" ) ; javax . xml . datatype . XMLGregorianCalendar notOnOrAfter = dt . newXMLGregorianCalendar ( "2009-06-03T17:47:05.901-04:00" ) ; "<AssertPlaceHolder>" ; } isValid ( javax . xml . datatype . XMLGregorianCalendar , javax . xml . datatype . XMLGregorianCalendar , javax . xml . datatype . XMLGregorianCalendar ) { if ( notbefore == null ) throw org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . logger . nullArgumentError ( "notbefore<sp>argument<sp>is<sp>null" ) ; if ( notOnOrAfter == null ) throw org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . logger . nullArgumentError ( "notOnOrAfter<sp>argument<sp>is<sp>null" ) ; int val = notbefore . compare ( now ) ; if ( ( val == ( javax . xml . datatype . DatatypeConstants . INDETERMINATE ) ) || ( val == ( javax . xml . datatype . DatatypeConstants . GREATER ) ) ) return false ; val = notOnOrAfter . compare ( now ) ; if ( val != ( javax . xml . datatype . DatatypeConstants . GREATER ) ) return false ; return true ; }
|
org . junit . Assert . assertTrue ( org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . isValid ( now , notBefore , notOnOrAfter ) )
|
createWithArray ( ) { com . greensopinion . finance . services . domain . Transaction t1 = com . greensopinion . finance . services . transaction . MockTransaction . create ( "2015-01-02" , "a" , 123 ) ; com . greensopinion . finance . services . domain . Transaction t2 = com . greensopinion . finance . services . transaction . MockTransaction . create ( "2015-01-02" , "a" , 123 ) ; com . greensopinion . finance . services . domain . Transactions transactions = new com . greensopinion . finance . services . domain . Transactions ( t1 , t2 ) ; "<AssertPlaceHolder>" ; } getTransactions ( ) { return transactions ; }
|
org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableList . of ( t1 , t2 ) , transactions . getTransactions ( ) )
|
writeBytes ( ) { final byte [ ] data = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ; final java . io . ByteArrayOutputStream stream = new java . io . ByteArrayOutputStream ( ) ; final com . flagstone . transform . coder . SWFEncoder encoder = new com . flagstone . transform . coder . SWFEncoder ( stream ) ; encoder . writeBytes ( data ) ; encoder . flush ( ) ; "<AssertPlaceHolder>" ; } flush ( ) { stream . write ( buffer , 0 , index ) ; stream . flush ( ) ; int diff ; if ( ( offset ) == 0 ) { diff = 0 ; } else { diff = 1 ; buffer [ 0 ] = buffer [ index ] ; } for ( int i = diff ; i < ( buffer . length ) ; i ++ ) { buffer [ i ] = 0 ; } pos += index ; index = 0 ; }
|
org . junit . Assert . assertArrayEquals ( data , stream . toByteArray ( ) )
|
setsComposerOnV2Tag ( ) { com . mpatric . mp3agic . ID3v1 id3v1Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v1TagForTesting ( ) ; com . mpatric . mp3agic . ID3v2 id3v2Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v2TagForTesting ( ) ; com . mpatric . mp3agic . ID3Wrapper wrapper = new com . mpatric . mp3agic . ID3Wrapper ( id3v1Tag , id3v2Tag ) ; wrapper . setComposer ( "a<sp>composer" ) ; "<AssertPlaceHolder>" ; } getComposer ( ) { if ( ( id3v2Tag ) != null ) { return id3v2Tag . getComposer ( ) ; } else { return null ; } }
|
org . junit . Assert . assertEquals ( "a<sp>composer" , id3v2Tag . getComposer ( ) )
|
getAllowedLocales_shouldNotReturnDuplicatesEvenIfTheGlobalPropertyHasThem ( ) { adminService . saveGlobalProperty ( new org . openmrs . GlobalProperty ( org . openmrs . util . OpenmrsConstants . GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST , "en_GB,fr,es,en_GB" ) ) ; "<AssertPlaceHolder>" ; } getAllowedLocales ( ) { return allowedLocales ; }
|
org . junit . Assert . assertEquals ( 3 , adminService . getAllowedLocales ( ) . size ( ) )
|
statement_fetch_direction_01 ( ) { org . apache . jena . jdbc . connections . JenaConnection conn = this . getConnection ( ) ; org . apache . jena . jdbc . statements . Statement stmt = conn . createStatement ( ) ; "<AssertPlaceHolder>" ; conn . close ( ) ; } getFetchDirection ( ) { return java . sql . ResultSet . FETCH_FORWARD ; }
|
org . junit . Assert . assertEquals ( ResultSet . FETCH_FORWARD , stmt . getFetchDirection ( ) )
|
testIsClassLoaderReusable ( ) { org . talend . components . jdbc . RuntimeSettingProvider anyProperties = org . talend . components . jdbc . JdbcRuntimeInfoTest . createPropsWithDriverName ( "org.talend.Driver1" ) ; org . talend . components . jdbc . JdbcRuntimeInfo jdbcRuntimeInfo = new org . talend . components . jdbc . JdbcRuntimeInfo ( anyProperties , "anyRuntimeClassName" ) ; "<AssertPlaceHolder>" ; } isClassLoaderReusable ( ) { return reusable ; }
|
org . junit . Assert . assertTrue ( jdbcRuntimeInfo . isClassLoaderReusable ( ) )
|
passingTestWithPendingCategoryShouldFail ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 1 , 1 )
|
testRepairedComment ( ) { net . roboconf . core . dsl . parsing . FileDefinition def = new net . roboconf . core . dsl . parsing . FileDefinition ( new java . io . File ( "whatever" ) ) ; net . roboconf . core . dsl . parsing . BlockComment block = new net . roboconf . core . dsl . parsing . BlockComment ( def , "invalid<sp>comment<sp>\n\t<sp>#<sp>followed<sp>by<sp>a<sp>valid<sp>\n#comment" ) ; net . roboconf . core . internal . dsl . parsing . FileDefinitionSerializer serializer = new net . roboconf . core . internal . dsl . parsing . FileDefinitionSerializer ( ) ; java . lang . String s = serializer . write ( block , true ) ; java . lang . String expected = "#<sp>invalid<sp>comment<sp>\n\t<sp>#<sp>followed<sp>by<sp>a<sp>valid<sp>\n#comment\n" . replace ( "\n" , java . lang . System . getProperty ( "line.separator" ) ) ; "<AssertPlaceHolder>" ; } write ( net . roboconf . core . dsl . parsing . BlockComment , boolean ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( writeComments ) { if ( net . roboconf . core . dsl . ParsingModelValidator . validate ( block ) . isEmpty ( ) ) { sb . append ( block . getContent ( ) ) ; } else { for ( java . lang . String s : block . getContent ( ) . split ( "\n" ) ) { if ( ! ( s . trim ( ) . startsWith ( ParsingConstants . COMMENT_DELIMITER ) ) ) sb . append ( "#<sp>" ) ; sb . append ( s ) ; sb . append ( this . lineSeparator ) ; } } } return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , s )
|
testInvokeWithSuperAABB ( ) { javax . el . MethodExpression me9 = factory . createMethodExpression ( context , "${beanC.sayHello(beanAA,beanBB)}" , null , null ) ; java . lang . Exception e = null ; try { me9 . invoke ( context , null ) ; } catch ( java . lang . Exception e1 ) { e = e1 ; } "<AssertPlaceHolder>" ; } invoke ( java . lang . Object , java . lang . String ) { java . lang . reflect . Method executeM = null ; java . lang . Class < ? > c = proxy . getClass ( ) ; executeM = c . getMethod ( method , org . apache . tomcat . test . watchdog . DynamicObject . NO_PARAMS ) ; if ( executeM == null ) { throw new java . lang . RuntimeException ( ( "No<sp>execute<sp>in<sp>" + ( proxy . getClass ( ) ) ) ) ; } return executeM . invoke ( proxy , ( ( java . lang . Object [ ] ) ( null ) ) ) ; }
|
org . junit . Assert . assertNotNull ( e )
|
invalidMetastoreTunnel ( ) { com . hotels . hcommon . hive . metastore . client . tunnelling . MetastoreTunnel metastoreTunnel = com . hotels . bdp . waggledance . api . model . AbstractMetaStoreTest . newMetastoreTunnel ( ) ; metastoreTunnel . setPort ( ( - 1 ) ) ; metaStore . setMetastoreTunnel ( metastoreTunnel ) ; java . util . Set < javax . validation . ConstraintViolation < T > > violations = validator . validate ( metaStore ) ; "<AssertPlaceHolder>" ; } size ( ) { return whiteList . size ( ) ; }
|
org . junit . Assert . assertThat ( violations . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
|
createFileWithPermission ( ) { java . util . List < java . lang . Integer > permissionValues = com . google . common . collect . Lists . newArrayList ( 73 , 146 , 219 , 292 , 365 , 438 , 511 , 493 , 475 , 420 , 347 , 329 ) ; for ( int value : permissionValues ) { org . apache . hadoop . fs . Path file = new org . apache . hadoop . fs . Path ( ( "/createfile" + value ) ) ; org . apache . hadoop . fs . permission . FsPermission permission = org . apache . hadoop . fs . permission . FsPermission . createImmutable ( ( ( short ) ( value ) ) ) ; org . apache . hadoop . fs . FSDataOutputStream o = alluxio . client . hadoop . FileSystemAclIntegrationTest . sTFS . create ( file , permission , false , 10 , ( ( short ) ( 1 ) ) , 512 , null ) ; o . writeBytes ( "Test<sp>Bytes" ) ; o . close ( ) ; org . apache . hadoop . fs . FileStatus fs = alluxio . client . hadoop . FileSystemAclIntegrationTest . sTFS . getFileStatus ( file ) ; "<AssertPlaceHolder>" ; } } getPermission ( ) { alluxio . security . authorization . AccessControlList acl = new alluxio . security . authorization . AccessControlList ( ) ; setPermissions ( acl ) ; assertMode ( Mode . Bits . ALL , acl , alluxio . security . authorization . AccessControlListTest . OWNING_USER , java . util . Collections . emptyList ( ) ) ; assertMode ( Mode . Bits . READ_EXECUTE , acl , alluxio . security . authorization . AccessControlListTest . NAMED_USER , java . util . Collections . emptyList ( ) ) ; assertMode ( Mode . Bits . READ_EXECUTE , acl , alluxio . security . authorization . AccessControlListTest . OTHER_USER , com . google . common . collect . Lists . newArrayList ( alluxio . security . authorization . AccessControlListTest . OWNING_GROUP ) ) ; assertMode ( Mode . Bits . READ , acl , alluxio . security . authorization . AccessControlListTest . OTHER_USER , com . google . common . collect . Lists . newArrayList ( alluxio . security . authorization . AccessControlListTest . NAMED_GROUP ) ) ; assertMode ( Mode . Bits . WRITE_EXECUTE , acl , alluxio . security . authorization . AccessControlListTest . OTHER_USER , com . google . common . collect . Lists . newArrayList ( alluxio . security . authorization . AccessControlListTest . NAMED_GROUP2 ) ) ; assertMode ( Mode . Bits . ALL , acl , alluxio . security . authorization . AccessControlListTest . OTHER_USER , com . google . common . collect . Lists . newArrayList ( alluxio . security . authorization . AccessControlListTest . NAMED_GROUP , alluxio . security . authorization . AccessControlListTest . NAMED_GROUP2 ) ) ; assertMode ( Mode . Bits . EXECUTE , acl , alluxio . security . authorization . AccessControlListTest . OTHER_USER , java . util . Collections . emptyList ( ) ) ; assertMode ( Mode . Bits . EXECUTE , acl , alluxio . security . authorization . AccessControlListTest . OTHER_USER , com . google . common . collect . Lists . newArrayList ( alluxio . security . authorization . AccessControlListTest . OTHER_GROUP ) ) ; }
|
org . junit . Assert . assertEquals ( permission , fs . getPermission ( ) )
|
hasPath_pathSlash ( ) { final java . net . URI input = java . net . URI . create ( "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/" ) ; final boolean actual = hudson . plugins . tfs . util . UriHelper . hasPath ( input ) ; "<AssertPlaceHolder>" ; } hasPath ( java . net . URI ) { final java . lang . String path = uri . getPath ( ) ; if ( path != null ) { if ( ( ( path . length ( ) ) > 0 ) && ( ! ( path . equals ( "/" ) ) ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertEquals ( true , actual )
|
testBalanceSplit ( ) { java . util . List < org . apache . hadoop . hbase . util . Pair < org . apache . hadoop . hbase . shaded . protobuf . generated . SnapshotProtos . SnapshotFileInfo , java . lang . Long > > files = new java . util . ArrayList ( 21 ) ; for ( long i = 0 ; i <= 20 ; i ++ ) { org . apache . hadoop . hbase . shaded . protobuf . generated . SnapshotProtos . SnapshotFileInfo fileInfo = org . apache . hadoop . hbase . shaded . protobuf . generated . SnapshotProtos . SnapshotFileInfo . newBuilder ( ) . setType ( SnapshotFileInfo . Type . HFILE ) . setHfile ( ( "file-8" 3 + i ) ) . build ( ) ; files . add ( new org . apache . hadoop . hbase . util . Pair ( fileInfo , i ) ) ; } java . util . List < java . util . List < org . apache . hadoop . hbase . util . Pair < org . apache . hadoop . hbase . shaded . protobuf . generated . SnapshotProtos . SnapshotFileInfo , java . lang . Long > > > splits = org . apache . hadoop . hbase . snapshot . ExportSnapshot . getBalancedSplits ( files , 5 ) ; "<AssertPlaceHolder>" ; java . lang . String [ ] split0 = new java . lang . String [ ] { "file-20" , "file-8" 2 , "file-20" 0 , "file-20" 1 , "file-0" } ; verifyBalanceSplit ( splits . get ( 0 ) , split0 , 42 ) ; java . lang . String [ ] split1 = new java . lang . String [ ] { "file-19" , "file-12" , "file-9" , "file-8" 7 } ; verifyBalanceSplit ( splits . get ( 1 ) , split1 , 42 ) ; java . lang . String [ ] split2 = new java . lang . String [ ] { "file-18" , "file-8" 4 , "file-8" , "file-8" 9 } ; verifyBalanceSplit ( splits . get ( 2 ) , split2 , 42 ) ; java . lang . String [ ] split3 = new java . lang . String [ ] { "file-8" 8 , "file-14" , "file-8" 5 , "file-8" 6 } ; verifyBalanceSplit ( splits . get ( 3 ) , split3 , 42 ) ; java . lang . String [ ] split4 = new java . lang . String [ ] { "file-16" , "file-15" , "file-8" 0 , "file-8" 1 } ; verifyBalanceSplit ( splits . get ( 4 ) , split4 , 42 ) ; } size ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 5 , splits . size ( ) )
|
testThatVerificationFailsIfProductHasNoGeoCoding ( ) { org . powermock . api . mockito . PowerMockito . when ( M_product . getGeoCoding ( ) ) . thenReturn ( null ) ; boolean result = _productValidator . isValid ( M_product ) ; "<AssertPlaceHolder>" ; verify ( S_logger , times ( 1 ) ) . info ( "Product<sp>skipped.<sp>The<sp>product<sp>'ProductMock'<sp>does<sp>not<sp>contain<sp>a<sp>geo<sp>coding." ) ; } isValid ( org . esa . beam . framework . datamodel . Product ) { return ( ( containsGeocoding ( product ) ) && ( canHandleBandConfigurations ( product ) ) ) && ( isInDateRange ( product ) ) ; }
|
org . junit . Assert . assertEquals ( false , result )
|
testCase40 ( ) { org . evosuite . testcase . DefaultTestCase tc = buildTestCase40 ( ) ; java . util . List < org . evosuite . symbolic . BranchCondition > branch_conditions = executeTest ( tc ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , branch_conditions . size ( ) )
|
testShouldGetResourceFromClasspath ( ) { org . openqa . jetty . util . Resource resource = getResourceFromClasspath ( "ClasspathResourceLocatorUnitTest.class" ) ; "<AssertPlaceHolder>" ; } getInputStream ( ) { return ( allInput ) != null ? new java . io . ByteArrayInputStream ( allInput . getBytes ( ) ) : null ; }
|
org . junit . Assert . assertNotNull ( resource . getInputStream ( ) )
|
deveObterInfoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNota nota = new com . fincatto . documentofiscal . nfe400 . classes . nota . NFNota ( ) ; final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfo notaInfo = com . fincatto . documentofiscal . nfe400 . FabricaDeObjetosFake . getNFNotaInfo ( ) ; nota . setInfo ( notaInfo ) ; "<AssertPlaceHolder>" ; } getInfo ( ) { return this . info ; }
|
org . junit . Assert . assertEquals ( notaInfo , nota . getInfo ( ) )
|
testSetIpAddress ( ) { reachability . setIpAddress ( ip4Address ) ; result = reachability . getIpAddress ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( ip4Address ) )
|
testProactiveFutures ( ) { final org . apache . reef . tang . Injector i = Tang . Factory . getTang ( ) . newInjector ( ) ; org . apache . reef . tang . IsFuture . instantiated = false ; i . getInstance ( org . apache . reef . tang . NeedsFuture . class ) ; "<AssertPlaceHolder>" ; } getInstance ( org . apache . reef . tang . implementation . java . Node ) { assertNotConcurrent ( ) ; @ org . apache . reef . tang . implementation . java . SuppressWarnings ( "unchecked" ) final org . apache . reef . tang . implementation . java . InjectionPlan < U > plan = ( ( org . apache . reef . tang . implementation . java . InjectionPlan < U > ) ( getInjectionPlan ( n ) ) ) ; final U u = ( ( U ) ( injectFromPlan ( plan ) ) ) ; while ( ! ( pendingFutures . isEmpty ( ) ) ) { final org . apache . reef . tang . implementation . java . Iterator < org . apache . reef . tang . implementation . java . InjectionFuture < ? > > i = pendingFutures . iterator ( ) ; final org . apache . reef . tang . implementation . java . InjectionFuture < ? > f = i . next ( ) ; pendingFutures . remove ( f ) ; f . get ( ) ; } return u ; }
|
org . junit . Assert . assertTrue ( org . apache . reef . tang . IsFuture . instantiated )
|
testUnitResultFailure ( ) { condition . setFile ( ( ( org . oscm . build . ant . XPathConditionTest . TESTDIR ) + "/TESTS-failure.xml" ) ) ; condition . setPath ( org . oscm . build . ant . XPathConditionTest . JUNIT_XPATH ) ; "<AssertPlaceHolder>" ; } eval ( ) { if ( nullOrEmpty ( fileName ) ) { throw new org . apache . tools . ant . BuildException ( "No<sp>file<sp>set" ) ; } java . io . File file = new java . io . File ( fileName ) ; if ( ( ! ( file . exists ( ) ) ) || ( file . isDirectory ( ) ) ) { throw new org . apache . tools . ant . BuildException ( "The<sp>specified<sp>file<sp>does<sp>not<sp>exist<sp>or<sp>is<sp>a<sp>directory" ) ; } if ( nullOrEmpty ( path ) ) { throw new org . apache . tools . ant . BuildException ( "No<sp>XPath<sp>expression<sp>set" ) ; } javax . xml . xpath . XPath xpath = javax . xml . xpath . XPathFactory . newInstance ( ) . newXPath ( ) ; org . xml . sax . InputSource inputSource = new org . xml . sax . InputSource ( fileName ) ; java . lang . Boolean result = Boolean . FALSE ; try { result = ( ( java . lang . Boolean ) ( xpath . evaluate ( path , inputSource , XPathConstants . BOOLEAN ) ) ) ; } catch ( javax . xml . xpath . XPathExpressionException e ) { throw new org . apache . tools . ant . BuildException ( "XPath<sp>expression<sp>fails" , e ) ; } return result . booleanValue ( ) ; }
|
org . junit . Assert . assertTrue ( condition . eval ( ) )
|
checkLoggerNames ( ) { final java . util . logging . LogManager logManager = org . jboss . logmanager . java . util . logging . LogManager . getLogManager ( ) ; "<AssertPlaceHolder>" ; final java . util . List < java . lang . String > expectedNames = java . util . Arrays . asList ( "" , "test1" , "org.jboss" , "org.jboss.logmanager" , "other" , "stdout" ) ; for ( java . lang . String name : expectedNames ) { org . jboss . logmanager . Logger . getLogger ( name ) ; } compare ( expectedNames , java . util . Collections . list ( logManager . getLoggerNames ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( org . jboss . logmanager . LogManager . class , logManager . getClass ( ) )
|
roundTrip ( ) { long [ ] point = new long [ 2 ] ; org . davidmoten . hilbert . WikipediaHilbertTest . d2xy ( 32 , 3 , point ) ; "<AssertPlaceHolder>" ; } xy2d ( long , long [ ] ) { long rx ; long ry ; long s ; long d = 0 ; for ( s = n / 2 ; s > 0 ; s /= 2 ) { rx = ( ( ( point [ 0 ] ) & s ) > 0 ) ? 1 : 0 ; ry = ( ( ( point [ 1 ] ) & s ) > 0 ) ? 1 : 0 ; d += ( s * s ) * ( ( 3 * rx ) ^ ry ) ; org . davidmoten . hilbert . WikipediaHilbertTest . rot ( s , point , rx , ry ) ; } return d ; }
|
org . junit . Assert . assertEquals ( 3 , org . davidmoten . hilbert . WikipediaHilbertTest . xy2d ( 32 , point ) )
|
toStringIsCorrect ( ) { final java . lang . String iotHubHostname = "test.iothub" ; final java . lang . String deviceId = "test-deviceid" ; final java . lang . String eTag = "test-etag" ; final java . lang . String uriStr = "test-uri-str" ; new mockit . NonStrictExpectations ( ) { { mockIotHubUri . toString ( ) ; result = uriStr ; } } ; com . microsoft . azure . sdk . iot . device . net . IotHubCompleteUri completeUri = new com . microsoft . azure . sdk . iot . device . net . IotHubCompleteUri ( iotHubHostname , deviceId , eTag , null ) ; java . lang . String testUriStr = completeUri . toString ( ) ; final java . lang . String expectedUriStr = uriStr ; "<AssertPlaceHolder>" ; } toString ( ) { com . google . gson . Gson gson = new com . google . gson . GsonBuilder ( ) . disableHtmlEscaping ( ) . setPrettyPrinting ( ) . create ( ) ; return gson . toJson ( this ) ; }
|
org . junit . Assert . assertThat ( testUriStr , org . hamcrest . CoreMatchers . is ( expectedUriStr ) )
|
testEqual ( ) { final org . drools . verifier . core . index . keys . Key a = new org . drools . verifier . core . index . keys . Key ( org . drools . verifier . core . maps . KeyDefinition . newKeyDefinition ( ) . withId ( "id" ) . build ( ) , 2 ) ; final org . drools . verifier . core . index . keys . Key b = new org . drools . verifier . core . index . keys . Key ( org . drools . verifier . core . maps . KeyDefinition . newKeyDefinition ( ) . withId ( "id" ) . build ( ) , 2 ) ; "<AssertPlaceHolder>" ; } compareTo ( org . drools . compiler . lang . descr . EnumLiteralDescr ) { return ( this . index ) - ( other . index ) ; }
|
org . junit . Assert . assertEquals ( 0 , a . compareTo ( b ) )
|
headerListSizeUnsignedInt ( ) { settings . maxHeaderListSize ( io . netty . handler . codec . http2 . Http2CodecUtil . MAX_UNSIGNED_INT ) ; "<AssertPlaceHolder>" ; } maxHeaderListSize ( ) { return hpackDecoder . getMaxHeaderListSize ( ) ; }
|
org . junit . Assert . assertEquals ( io . netty . handler . codec . http2 . Http2CodecUtil . MAX_UNSIGNED_INT , ( ( long ) ( settings . maxHeaderListSize ( ) ) ) )
|
testCatalog ( ) { try ( com . zaxxer . hikari . HikariDataSource ds = com . zaxxer . hikari . pool . TestElf . newHikariDataSource ( ) ) { ds . setCatalog ( "test" ) ; ds . setMinimumIdle ( 1 ) ; ds . setMaximumPoolSize ( 1 ) ; ds . setConnectionTestQuery ( "VALUES<sp>1" ) ; ds . setDataSourceClassName ( "com.zaxxer.hikari.mocks.StubDataSource" ) ; try ( java . sql . Connection connection = ds . getConnection ( ) ) { java . sql . Connection unwrap = connection . unwrap ( java . sql . Connection . class ) ; connection . setCatalog ( "other" ) ; connection . close ( ) ; "<AssertPlaceHolder>" ; } } } getCatalog ( ) { return catalog ; }
|
org . junit . Assert . assertEquals ( "test" , unwrap . getCatalog ( ) )
|
shouldNotBeValidWithEmptyLabels ( ) { io . gravitee . management . model . api . ApiEntity api = mock ( io . gravitee . management . model . api . ApiEntity . class ) ; when ( api . getLabels ( ) ) . thenReturn ( java . util . Collections . emptyList ( ) ) ; boolean valid = srv . isValid ( api ) ; "<AssertPlaceHolder>" ; } isValid ( io . gravitee . management . model . api . ApiEntity ) { return ( ( api . getViews ( ) ) != null ) && ( ! ( api . getViews ( ) . isEmpty ( ) ) ) ; }
|
org . junit . Assert . assertFalse ( valid )
|
getReferences_none_found ( ) { final net . ripe . db . whois . common . rpsl . RpslObject role = net . ripe . db . whois . common . rpsl . RpslObject . parse ( "role:<sp>Role\nnic-hdl:<sp>NIC-TEST\nabuse-mailbox:abuse@ripe.net" ) ; subject . createObject ( role ) ; final net . ripe . db . whois . common . rpsl . RpslObject org = net . ripe . db . whois . common . rpsl . RpslObject . parse ( "organisation:<sp>ORG-TEST" ) ; subject . createObject ( org ) ; final java . util . Set < net . ripe . db . whois . common . dao . RpslObjectInfo > roleReferences = subject . getReferences ( role ) ; "<AssertPlaceHolder>" ; } size ( ) { return count ; }
|
org . junit . Assert . assertThat ( roleReferences . size ( ) , org . hamcrest . Matchers . is ( 0 ) )
|
testGetPermissionsEmptyString ( ) { "<AssertPlaceHolder>" ; } getPermissions ( java . lang . String ) { if ( ( permissionNames == null ) || ( permissionNames . isEmpty ( ) ) ) { return org . apache . jackrabbit . oak . spi . security . authorization . permission . Permissions . NO_PERMISSION ; } else { return org . apache . jackrabbit . oak . spi . security . authorization . permission . Permissions . getPermissions ( com . google . common . collect . Sets . newHashSet ( java . util . Arrays . asList ( permissionNames . split ( "," ) ) ) ) ; } }
|
org . junit . Assert . assertEquals ( Permissions . NO_PERMISSION , org . apache . jackrabbit . oak . spi . security . authorization . permission . Permissions . getPermissions ( "" ) )
|
getTest ( ) { org . openscience . cdk . group . Permutation p = new org . openscience . cdk . group . Permutation ( 1 , 0 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { return getParameter ( paramType ) . getValue ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , p . get ( 0 ) )
|
countsFailures ( ) { org . junit . runner . Result result = org . junit . runner . JUnitCore . runClasses ( org . junit . tests . running . classes . ParameterizedTestTest . ThreeFailures . class ) ; "<AssertPlaceHolder>" ; } getFailureCount ( ) { return failures . size ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , result . getFailureCount ( ) )
|
test_GetRadioButton_By_AutomationId ( ) { when ( element . findFirst ( mmarquee . automation . BaseAutomationTest . isTreeScope ( TreeScope . Descendants ) , any ( ) ) ) . thenReturn ( targetElement ) ; mmarquee . automation . controls . AutomationRadioButton radio = spyWndw . getRadioButton ( mmarquee . automation . controls . Search . getBuilder ( ) . automationId ( "myID" ) . build ( ) ) ; "<AssertPlaceHolder>" ; verify ( spyWndw ) . createAutomationIdPropertyCondition ( "myID" ) ; verify ( spyWndw ) . createControlTypeCondition ( ControlType . RadioButton ) ; verify ( element , atLeastOnce ( ) ) . findFirst ( any ( ) , any ( ) ) ; } getElement ( ) { return this . element ; }
|
org . junit . Assert . assertEquals ( targetElement , radio . getElement ( ) )
|
testGetDistinctKeys_GreaterThanInclusiveAscending ( ) { com . googlecode . cqengine . index . sqlite . ConnectionManager connectionManager = temporaryInMemoryDatabase . getConnectionManager ( true ) ; com . googlecode . cqengine . index . sqlite . SQLiteIndex < java . lang . String , com . googlecode . cqengine . testutil . Car , java . lang . Integer > offHeapIndex = com . googlecode . cqengine . index . sqlite . SQLiteIndex . onAttribute ( Car . MODEL , Car . CAR_ID , new com . googlecode . cqengine . attribute . SimpleAttribute < java . lang . Integer , com . googlecode . cqengine . testutil . Car > ( ) { @ com . googlecode . cqengine . index . sqlite . Override public com . googlecode . cqengine . testutil . Car getValue ( java . lang . Integer carId , com . googlecode . cqengine . query . option . QueryOptions queryOptions ) { return com . googlecode . cqengine . testutil . CarFactory . createCar ( carId ) ; } } ) ; offHeapIndex . addAll ( com . googlecode . cqengine . index . sqlite . SQLiteIndexTest . createObjectSetOfCars ( 10 ) , com . googlecode . cqengine . index . sqlite . SQLiteIndexTest . createQueryOptions ( connectionManager ) ) ; com . googlecode . cqengine . index . sqlite . List < java . lang . String > expected ; com . googlecode . cqengine . index . sqlite . List < java . lang . String > actual ; expected = com . googlecode . cqengine . index . sqlite . Arrays . asList ( "Accord" , "Avensis" , "Civic" , "Focus" , "Fusion" , "Hilux" , "Insight" , "M6" , "Prius" , "Taurus" ) ; actual = com . googlecode . cqengine . index . sqlite . Lists . newArrayList ( offHeapIndex . getDistinctKeys ( "Accord" , true , null , true , com . googlecode . cqengine . index . sqlite . SQLiteIndexTest . createQueryOptions ( connectionManager ) ) ) ; "<AssertPlaceHolder>" ; } createQueryOptions ( com . googlecode . cqengine . index . sqlite . ConnectionManager ) { com . googlecode . cqengine . query . option . QueryOptions queryOptions = new com . googlecode . cqengine . query . option . QueryOptions ( ) ; queryOptions . put ( com . googlecode . cqengine . index . sqlite . ConnectionManager . class , connectionManager ) ; return queryOptions ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testBigImageIsNotCached ( ) { org . eclipse . swt . internal . graphics . ImageDataCache cache = new org . eclipse . swt . internal . graphics . ImageDataCache ( ) ; org . eclipse . swt . graphics . ImageData imageData = getImageData ( Fixture . IMAGE_100x50 ) ; org . eclipse . swt . internal . graphics . InternalImage internalImage = new org . eclipse . swt . internal . graphics . InternalImage ( "testpath" , imageData . width , imageData . height , false ) ; cache . putImageData ( internalImage , imageData ) ; "<AssertPlaceHolder>" ; } getImageData ( org . eclipse . swt . internal . graphics . InternalImage ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( internalImage , "internalImage" ) ; org . eclipse . swt . graphics . ImageData cached ; synchronized ( cacheLock ) { cached = cache . get ( internalImage ) ; } return cached != null ? ( ( org . eclipse . swt . graphics . ImageData ) ( cached . clone ( ) ) ) : null ; }
|
org . junit . Assert . assertNull ( cache . getImageData ( internalImage ) )
|
shouldRetrieveSubject ( ) { final com . calclab . emite . core . stanzas . Message message = new com . calclab . emite . core . stanzas . Message ( com . calclab . emite . base . xml . XMLBuilder . create ( "message" ) . childText ( "subject" , "the<sp>subject" ) . getXML ( ) ) ; "<AssertPlaceHolder>" ; } getSubject ( ) { return xml . getChildText ( "subject" ) ; }
|
org . junit . Assert . assertEquals ( "the<sp>subject" , message . getSubject ( ) )
|
testBasic ( ) { jee . setExpression ( "message.equals(\"Some<sp>message\")" ) ; jee . start ( ) ; ch . qos . logback . core . util . StatusPrinter . print ( loggerContext ) ; ch . qos . logback . classic . spi . ILoggingEvent event = makeLoggingEvent ( null ) ; "<AssertPlaceHolder>" ; } evaluate ( ch . qos . logback . access . spi . IAccessEvent ) { java . lang . String url = event . getRequestURL ( ) ; for ( java . lang . String expected : URLList ) { if ( url . contains ( expected ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( jee . evaluate ( event ) )
|
getUnknownResourceSubscribersWithInheritanceByAnAuthenticatedUser ( ) { com . sun . jersey . api . client . WebResource resource = resource ( ) ; com . silverpeas . web . mock . UserDetailWithProfiles user = new com . silverpeas . web . mock . UserDetailWithProfiles ( ) ; user . setFirstName ( "Bart" ) ; user . setLastName ( "Simpson" ) ; user . addProfile ( org . silverpeas . core . subscription . web . SubscriptionTestResources . COMPONENT_ID , SilverpeasRole . writer ) ; user . addProfile ( org . silverpeas . core . subscription . web . SubscriptionTestResources . COMPONENT_ID , SilverpeasRole . user ) ; user . setState ( UserState . VALID ) ; java . lang . String sessionKey = authenticate ( user ) ; try { resource . path ( ( ( org . silverpeas . core . subscription . web . SubscriptionTestResources . SUBSCRIPTION_RESOURCE_PATH ) + "/subscribers/wrong_type/inheritance/26" ) ) . queryParam ( "existenceIndicatorOnly" , "toto" ) . header ( org . silverpeas . core . subscription . web . HTTP_SESSIONKEY , sessionKey ) . accept ( MediaType . APPLICATION_JSON ) . get ( org . silverpeas . core . subscription . web . SubscriberEntity [ ] . class ) ; org . junit . Assert . fail ( "a<sp>NOT<sp>FOUND<sp>web<sp>error<sp>should<sp>be<sp>returned" ) ; } catch ( com . sun . jersey . api . client . UniformInterfaceException ex ) { int receivedStatus = ex . getResponse ( ) . getStatus ( ) ; int notFound = Status . NOT_FOUND . getStatusCode ( ) ; "<AssertPlaceHolder>" ; } } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
|
org . junit . Assert . assertThat ( receivedStatus , org . hamcrest . Matchers . is ( notFound ) )
|
givenMultiValuesMap_whenUsingContainsKeyMethod_thenReturningTrue ( ) { org . apache . commons . collections4 . MultiValuedMap < java . lang . String , java . lang . String > map = new org . apache . commons . collections4 . multimap . ArrayListValuedHashMap ( ) ; map . put ( "fruits" , "apple" ) ; map . put ( "fruits" , "orange" ) ; map . put ( "vehicles" , "car" ) ; map . put ( "vehicles" , "bike" ) ; "<AssertPlaceHolder>" ; } containsKey ( java . lang . String ) { try { readLock . lock ( ) ; return com . baeldung . concurrent . locks . SynchronizedHashMapWithRWLock . syncHashMap . containsKey ( key ) ; } finally { readLock . unlock ( ) ; } }
|
org . junit . Assert . assertTrue ( map . containsKey ( "fruits" ) )
|
nonSecureExecuted ( ) { final org . uberfire . java . nio . file . FileSystem fs = mock ( org . uberfire . java . nio . file . FileSystem . class ) ; final org . uberfire . java . nio . file . Path rootPath = mock ( org . uberfire . java . nio . file . Path . class ) ; when ( fs . getRootDirectories ( ) ) . thenReturn ( java . util . Arrays . asList ( rootPath ) ) ; when ( rootPath . getFileSystem ( ) ) . thenReturn ( fs ) ; when ( rootPath . toUri ( ) ) . thenReturn ( java . net . URI . create ( "/" ) ) ; final org . uberfire . ext . security . server . io . IOSecurityService service = new org . uberfire . ext . security . server . io . IOSecurityService ( new org . uberfire . ext . security . server . io . MockIOService ( ) , new org . uberfire . ext . security . server . io . MockAuthenticationService ( ) , new org . uberfire . ext . security . server . io . IOServiceSecuritySetupTest . DummyAuthorizationManager ( true ) ) ; "<AssertPlaceHolder>" ; try { service . startBatch ( fs ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( "error" ) ; } } getDisposables ( ) { return org . uberfire . commons . lifecycle . PriorityDisposableRegistry . disposables ; }
|
org . junit . Assert . assertTrue ( org . uberfire . commons . lifecycle . PriorityDisposableRegistry . getDisposables ( ) . contains ( service ) )
|
resolveVirtualAttributeValueChangeTestWithWrongMatch ( ) { System . out . println ( "urn_perun_user_facility_attribute_def_virt_defaultUnixGID.resolveVirtualAttributeValueChangeTestWithWrongMatch()" ) ; java . util . List < cz . metacentrum . perun . audit . events . AuditEvent > resolvedEvents ; when ( session . getPerunBl ( ) . getMembersManagerBl ( ) . getMemberById ( any ( cz . metacentrum . perun . core . impl . PerunSessionImpl . class ) , anyInt ( ) ) ) . thenReturn ( member ) ; when ( session . getPerunBl ( ) . getResourcesManagerBl ( ) . getResourceById ( any ( cz . metacentrum . perun . core . impl . PerunSessionImpl . class ) , anyInt ( ) ) ) . thenReturn ( resource ) ; when ( session . getPerunBl ( ) . getAttributesManagerBl ( ) . getAttribute ( any ( cz . metacentrum . perun . core . impl . PerunSessionImpl . class ) , any ( cz . metacentrum . perun . core . api . Member . class ) , any ( cz . metacentrum . perun . core . api . Resource . class ) , anyString ( ) ) ) . thenReturn ( isBanned ) ; resolvedEvents = cz . metacentrum . perun . core . impl . modules . attributes . urn_perun_member_resource_attribute_def_virt_isBannedTest . classInstance . resolveVirtualAttributeValueChange ( session , wrongEvent ) ; "<AssertPlaceHolder>" ; } resolveVirtualAttributeValueChange ( cz . metacentrum . perun . core . impl . PerunSessionImpl , cz . metacentrum . perun . audit . events . AuditEvent ) { java . util . List < cz . metacentrum . perun . audit . events . AuditEvent > messages = super . resolveVirtualAttributeValueChange ( sess , message ) ; if ( ( message instanceof cz . metacentrum . perun . audit . events . AttributesManagerEvents . AttributeSetForKey ) && ( ( ( cz . metacentrum . perun . audit . events . AttributesManagerEvents . AttributeSetForKey ) ( message ) ) . getAttribute ( ) . getFriendlyName ( ) . equals ( cz . metacentrum . perun . core . impl . modules . attributes . urn_perun_user_attribute_def_virt_institutionsCountries . DNS_STATE_MAPPING_ATTR . getFriendlyName ( ) ) ) ) { messages . addAll ( resolveEvent ( sess , ( ( cz . metacentrum . perun . audit . events . AttributesManagerEvents . AttributeSetForKey ) ( message ) ) . getKey ( ) ) ) ; } else if ( ( message instanceof cz . metacentrum . perun . audit . events . AttributesManagerEvents . AttributeRemovedForKey ) && ( ( ( cz . metacentrum . perun . audit . events . AttributesManagerEvents . AttributeRemovedForKey ) ( message ) ) . getAttribute ( ) . getFriendlyName ( ) . equals ( cz . metacentrum . perun . core . impl . modules . attributes . urn_perun_user_attribute_def_virt_institutionsCountries . DNS_STATE_MAPPING_ATTR . getFriendlyName ( ) ) ) ) { messages . addAll ( resolveEvent ( sess , ( ( cz . metacentrum . perun . audit . events . AttributesManagerEvents . AttributeRemovedForKey ) ( message ) ) . getKey ( ) ) ) ; } return messages ; }
|
org . junit . Assert . assertTrue ( resolvedEvents . isEmpty ( ) )
|
getTablesToRepairRemoveTwoTablesTest ( ) { io . cassandrareaper . jmx . JmxProxy proxy = io . cassandrareaper . jmx . JmxProxyTest . mockJmxProxyImpl ( ) ; when ( context . jmxConnectionFactory . connectAny ( cluster ) ) . thenReturn ( proxy ) ; when ( context . jmxConnectionFactory . connectAny ( org . mockito . Mockito . any ( java . util . Collection . class ) ) ) . thenReturn ( proxy ) ; when ( proxy . getTablesForKeyspace ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( com . google . common . collect . Sets . newHashSet ( io . cassandrareaper . core . Table . builder ( ) . withName ( "table1" ) . withCompactionStrategy ( io . cassandrareaper . service . RepairUnitServiceTest . STCS ) . build ( ) , io . cassandrareaper . core . Table . builder ( ) . withName ( "table2" ) . withCompactionStrategy ( io . cassandrareaper . service . RepairUnitServiceTest . STCS ) . build ( ) , io . cassandrareaper . core . Table . builder ( ) . withName ( "table3" ) . withCompactionStrategy ( io . cassandrareaper . service . RepairUnitServiceTest . STCS ) . build ( ) ) ) ; io . cassandrareaper . core . RepairUnit unit = io . cassandrareaper . core . RepairUnit . builder ( ) . clusterName ( cluster . getName ( ) ) . keyspaceName ( "test" ) . blacklistedTables ( com . google . common . collect . Sets . newHashSet ( "table1" , "table3" ) ) . incrementalRepair ( false ) . repairThreadCount ( 4 ) . build ( com . datastax . driver . core . utils . UUIDs . timeBased ( ) ) ; "<AssertPlaceHolder>" ; } getTablesToRepair ( io . cassandrareaper . jmx . JmxProxy , io . cassandrareaper . core . Cluster , io . cassandrareaper . core . RepairUnit ) { java . lang . String keyspace = repairUnit . getKeyspaceName ( ) ; java . util . Set < java . lang . String > tables ; if ( repairUnit . getColumnFamilies ( ) . isEmpty ( ) ) { java . util . Set < java . lang . String > twcsBlacklisted = findBlacklistedCompactionStrategyTables ( cluster , keyspace ) ; tables = proxy . getTablesForKeyspace ( keyspace ) . stream ( ) . map ( Table :: getName ) . filter ( ( tableName ) -> ! ( repairUnit . getBlacklistedTables ( ) . contains ( tableName ) ) ) . filter ( ( tableName ) -> ! ( twcsBlacklisted . contains ( tableName ) ) ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; } else { tables = repairUnit . getColumnFamilies ( ) . stream ( ) . filter ( ( tableName ) -> ! ( repairUnit . getBlacklistedTables ( ) . contains ( tableName ) ) ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; } com . google . common . base . Preconditions . checkState ( ( ( repairUnit . getBlacklistedTables ( ) . isEmpty ( ) ) || ( ! ( tables . isEmpty ( ) ) ) ) , "Invalid<sp>blacklist<sp>definition.<sp>It<sp>filtered<sp>out<sp>all<sp>tables<sp>in<sp>the<sp>keyspace." ) ; return tables ; }
|
org . junit . Assert . assertEquals ( com . google . common . collect . Sets . newHashSet ( "table2" ) , service . getTablesToRepair ( proxy , cluster , unit ) )
|
testCreateMetadataWithDuplicateUsernameAndInjectedUser ( ) { createUserAndInjectSecurityContext ( true ) ; java . util . Map < java . lang . Class < ? extends org . hisp . dhis . common . IdentifiableObject > , java . util . List < org . hisp . dhis . common . IdentifiableObject > > metadata = renderService . fromMetadata ( new org . springframework . core . io . ClassPathResource ( "dxf2/user_duplicate_username.json" ) . getInputStream ( ) , RenderFormat . JSON ) ; org . hisp . dhis . dxf2 . metadata . objectbundle . ObjectBundleParams params = new org . hisp . dhis . dxf2 . metadata . objectbundle . ObjectBundleParams ( ) ; params . setObjectBundleMode ( ObjectBundleMode . COMMIT ) ; params . setImportStrategy ( ImportStrategy . CREATE_AND_UPDATE ) ; params . setAtomicMode ( AtomicMode . NONE ) ; params . setObjects ( metadata ) ; org . hisp . dhis . dxf2 . metadata . objectbundle . ObjectBundle bundle = objectBundleService . create ( params ) ; objectBundleValidationService . validate ( bundle ) ; objectBundleService . commit ( bundle ) ; "<AssertPlaceHolder>" ; } getAll ( java . lang . Class ) { org . hisp . dhis . common . IdentifiableObjectStore < org . hisp . dhis . common . IdentifiableObject > store = getIdentifiableObjectStore ( clazz ) ; if ( store == null ) { return new java . util . ArrayList ( ) ; } return ( ( java . util . List < T > ) ( store . getAll ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( 2 , manager . getAll ( org . hisp . dhis . user . User . class ) . size ( ) )
|
testQuotingCornerCase ( ) { java . io . InputStream inStream = this . getClass ( ) . getResourceAsStream ( "/org/biojava/nbio/structure/io/difficult_mmcif_quoting.cif" ) ; org . biojava . nbio . structure . io . mmcif . MMcifParser parser = new org . biojava . nbio . structure . io . mmcif . SimpleMMcifParser ( ) ; org . biojava . nbio . structure . io . mmcif . SimpleMMcifConsumer consumer = new org . biojava . nbio . structure . io . mmcif . SimpleMMcifConsumer ( ) ; org . biojava . nbio . structure . io . FileParsingParameters fileParsingParams = new org . biojava . nbio . structure . io . FileParsingParameters ( ) ; fileParsingParams . setAlignSeqRes ( true ) ; consumer . setFileParsingParameters ( fileParsingParams ) ; parser . addMMcifConsumer ( consumer ) ; parser . parse ( new java . io . BufferedReader ( new java . io . InputStreamReader ( inStream ) ) ) ; org . biojava . nbio . structure . Structure s = consumer . getStructure ( ) ; "<AssertPlaceHolder>" ; } getStructure ( ) { return parent ; }
|
org . junit . Assert . assertNotNull ( s )
|
testExplicitProvider ( ) { java . security . SecureRandom secureRandom = java . security . SecureRandom . getInstance ( SSL . DEFAULT_SECURE_RANDOM_ALGORITHM ) ; factoryBean . setProvider ( secureRandom . getProvider ( ) . getName ( ) ) ; "<AssertPlaceHolder>" ; } createSecureRandom ( ) { try { return ( getProvider ( ) ) != null ? java . security . SecureRandom . getInstance ( getAlgorithm ( ) , getProvider ( ) ) : java . security . SecureRandom . getInstance ( getAlgorithm ( ) ) ; } catch ( java . security . NoSuchProviderException ex ) { throw new java . security . NoSuchProviderException ( ( "no<sp>such<sp>secure<sp>random<sp>provider:<sp>" + ( getProvider ( ) ) ) ) ; } catch ( java . security . NoSuchAlgorithmException ex ) { throw new java . security . NoSuchAlgorithmException ( ( "no<sp>such<sp>secure<sp>random<sp>algorithm:<sp>" + ( getAlgorithm ( ) ) ) ) ; } }
|
org . junit . Assert . assertNotNull ( factoryBean . createSecureRandom ( ) )
|
testGetSortIgnoreCase ( ) { "<AssertPlaceHolder>" ; } getSortIgnoreCase ( ) { return sortIgnoreCase ; }
|
org . junit . Assert . assertFalse ( builder . getSortIgnoreCase ( ) )
|
testHashCode ( ) { org . eclipse . aether . repository . Authentication auth1 = new org . eclipse . aether . util . repository . SecretAuthentication ( "key" , "value" ) ; org . eclipse . aether . repository . Authentication auth2 = new org . eclipse . aether . util . repository . SecretAuthentication ( "key" , "value" ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return getClass ( ) . hashCode ( ) ; }
|
org . junit . Assert . assertEquals ( auth1 . hashCode ( ) , auth2 . hashCode ( ) )
|
testRemove ( ) { com . liferay . portal . workflow . kaleo . model . KaleoTaskInstanceToken newKaleoTaskInstanceToken = addKaleoTaskInstanceToken ( ) ; _persistence . remove ( newKaleoTaskInstanceToken ) ; com . liferay . portal . workflow . kaleo . model . KaleoTaskInstanceToken existingKaleoTaskInstanceToken = _persistence . fetchByPrimaryKey ( newKaleoTaskInstanceToken . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertNull ( existingKaleoTaskInstanceToken )
|
testMillisSerialization ( ) { com . owlike . genson . Genson genson = createTimestampGenson ( java . time . ZonedDateTime . class , TimestampFormat . MILLIS ) ; java . lang . Long millis = 4534654564653L ; java . time . ZonedDateTime dt = java . time . ZonedDateTime . ofInstant ( java . time . Instant . ofEpochMilli ( millis ) , defaultZoneId ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . owlike . genson . ext . jsr353 . JSR353Bundle . toString ( this ) ; }
|
org . junit . Assert . assertEquals ( millis . toString ( ) , genson . serialize ( dt ) )
|
test02 ( ) { com . ebay . cloud . cms . metadata . model . MetaClass metadata = raptorMetaService . getMetaClass ( "ServiceInstance" ) ; com . ebay . cloud . cms . dal . search . SearchGroup group = new com . ebay . cloud . cms . dal . search . SearchGroup ( ) ; group . addGroupField ( createGroupField ( metadata , "healthStatus" ) ) ; group . addGroupField ( createGroupField ( metadata , "activeManifestDiff" ) ) ; com . ebay . cloud . cms . dal . search . impl . field . AggregationField max_ports = createAggregationField ( metadata , AggFuncEnum . MAX , "port" ) ; group . addAggregationField ( max_ports ) ; com . ebay . cloud . cms . dal . search . SearchProjection projection = new com . ebay . cloud . cms . dal . search . SearchProjection ( ) ; projection . addField ( max_ports ) ; com . ebay . cloud . cms . dal . search . ISearchQuery query = new com . ebay . cloud . cms . dal . search . impl . query . SearchQuery ( metadata , null , projection , group , null , strategy ) ; com . ebay . cloud . cms . dal . search . SearchOption option = new com . ebay . cloud . cms . dal . search . SearchOption ( ) ; option . setStrategy ( strategy ) ; java . util . List < java . lang . String > sortFields = new java . util . ArrayList < java . lang . String > ( ) ; sortFields . add ( "name" ) ; sortFields . add ( "port" ) ; java . util . List < java . lang . Integer > sortOrders = new java . util . ArrayList < java . lang . Integer > ( ) ; sortOrders . add ( SearchOption . DESC_ORDER ) ; sortOrders . add ( SearchOption . DESC_ORDER ) ; option . setSort ( sortFields , sortOrders , metadata ) ; option . setSkip ( 1 ) ; option . setLimit ( 2 ) ; com . ebay . cloud . cms . dal . search . SearchResult result = searchService . search ( query , option , raptorContext ) ; "<AssertPlaceHolder>" ; java . util . List < com . ebay . cloud . cms . dal . entity . IEntity > entities = result . getResultSet ( ) ; for ( com . ebay . cloud . cms . dal . entity . IEntity e : entities ) { System . out . println ( e ) ; } } getResultSize ( ) { return resultSet . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , result . getResultSize ( ) )
|
canInitializeFixtureClockMultipleTimesButAlwaysGetTheSameFixtureClock ( ) { final org . apache . isis . applib . fixtures . FixtureClock fixtureClock1 = org . apache . isis . applib . fixtures . FixtureClock . initialize ( ) ; final org . apache . isis . applib . fixtures . FixtureClock fixtureClock2 = org . apache . isis . applib . fixtures . FixtureClock . initialize ( ) ; "<AssertPlaceHolder>" ; } is ( org . apache . isis . core . metamodel . spec . feature . Contributed ) { return new com . google . common . base . Predicate < T > ( ) { @ org . apache . isis . core . metamodel . specloader . specimpl . Override public boolean apply ( org . apache . isis . core . metamodel . spec . feature . ObjectMember input ) { return contributed . isIncluded ( ) ; } } ; }
|
org . junit . Assert . assertThat ( fixtureClock1 , org . hamcrest . CoreMatchers . is ( fixtureClock2 ) )
|
with_prefix ( ) { java . io . File shell = putScript ( "arguments.sh" , "bin/script.sh" ) ; com . asakusafw . yaess . core . CommandScript script = new com . asakusafw . yaess . core . CommandScript ( "testing" , set ( ) , "profile" , "module" , java . util . Arrays . asList ( "Hello,<sp>world!" ) , map ( ) ) ; com . asakusafw . yaess . core . CommandScriptHandler handler = handler ( "command.0" , shell . getAbsolutePath ( ) ) ; execute ( script , handler ) ; java . util . List < java . lang . String > results = getOutput ( shell ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; }
|
org . junit . Assert . assertThat ( results , is ( java . util . Arrays . asList ( "Hello,<sp>world!" ) ) )
|
parsePersonTest ( ) { org . atlasapi . media . entity . simple . Person person = new org . atlasapi . media . entity . simple . Person ( ) ; person . setType ( "person" ) ; person . setUri ( "abc" ) ; org . atlasapi . output . JsonTranslator < org . atlasapi . media . entity . simple . Person > writer = new org . atlasapi . output . JsonTranslator ( ) ; javax . servlet . http . HttpServletRequest request = new com . metabroadcast . common . servlet . StubHttpServletRequest ( ) ; com . metabroadcast . common . servlet . StubHttpServletResponse response = new com . metabroadcast . common . servlet . StubHttpServletResponse ( ) ; writer . writeTo ( request , response , person , com . google . common . collect . ImmutableSet . copyOf ( org . atlasapi . output . Annotation . values ( ) ) , application ) ; java . lang . String respBody = response . getResponseAsString ( ) ; org . atlasapi . media . entity . simple . Person actual = reader . read ( new java . io . StringReader ( respBody ) , org . atlasapi . media . entity . simple . Person . class , strict ) ; "<AssertPlaceHolder>" ; } getUri ( ) { return uri ; }
|
org . junit . Assert . assertEquals ( person . getUri ( ) , actual . getUri ( ) )
|
hadoopShouldLoadFileSystemWhenConfigured ( ) { org . apache . hadoop . conf . Configuration conf = getConf ( ) ; java . net . URI uri = java . net . URI . create ( ( ( alluxio . Constants . HEADER ) + "localhost:19998/tmp/path.txt" ) ) ; java . util . Map < alluxio . conf . PropertyKey , java . lang . String > properties = new java . util . HashMap ( ) ; properties . put ( PropertyKey . MASTER_HOSTNAME , uri . getHost ( ) ) ; properties . put ( PropertyKey . MASTER_RPC_PORT , java . lang . Integer . toString ( uri . getPort ( ) ) ) ; properties . put ( PropertyKey . ZOOKEEPER_ENABLED , "false" ) ; properties . put ( PropertyKey . ZOOKEEPER_ADDRESS , null ) ; try ( java . io . Closeable c = new alluxio . ConfigurationRule ( properties , mConfiguration ) . toResource ( ) ) { final org . apache . hadoop . fs . FileSystem fs = alluxio . hadoop . org . apache . hadoop . fs . FileSystem . get ( uri , conf ) ; "<AssertPlaceHolder>" ; } } get ( alluxio . conf . PropertyKey , alluxio . conf . ConfigurationValueOptions ) { return conf ( key ) . get ( key , options ) ; }
|
org . junit . Assert . assertTrue ( ( fs instanceof alluxio . hadoop . FileSystem ) )
|
testBuildWithParametersWithDisabledDefaultConstraints ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String name = "fdsfds" ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; org . lnu . is . domain . timeperiod . TimePeriod timePeriod = new org . lnu . is . domain . timeperiod . TimePeriod ( ) ; org . lnu . is . domain . publicactivity . PublicActivityType publicActiveType = new org . lnu . is . domain . publicactivity . PublicActivityType ( ) ; org . lnu . is . domain . publicactivity . PublicActivity context = new org . lnu . is . domain . publicactivity . PublicActivity ( ) ; context . setName ( name ) ; context . setBegDate ( begDate ) ; context . setEndDate ( endDate ) ; context . setTimePeriod ( timePeriod ) ; context . setPublicActivityType ( publicActiveType ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>PublicActivity<sp>e<sp>WHERE<sp>(<sp>e.publicActivityType=:publicActivityType<sp>AND<sp>e.timePeriod=:timePeriod<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.begDate<sp><=<sp>:begDate<sp>AND<sp>e.endDate<sp>>=<sp>:endDate)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . publicactivity . PublicActivity > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testWrap ( ) { final java . util . List < com . spotify . folsom . ketama . AddressAndClient > clients = com . google . common . collect . ImmutableList . of ( com . spotify . folsom . ketama . ContinuumTest . AAC1 , com . spotify . folsom . ketama . ContinuumTest . AAC2 , com . spotify . folsom . ketama . ContinuumTest . AAC3 ) ; final com . spotify . folsom . ketama . Continuum c = new com . spotify . folsom . ketama . Continuum ( clients ) ; java . util . List < com . spotify . folsom . RawMemcacheClient > actual = java . util . Arrays . asList ( c . findClient ( com . spotify . folsom . ketama . ContinuumTest . bytes ( "key321" ) ) , c . findClient ( com . spotify . folsom . ketama . ContinuumTest . bytes ( "key477" ) ) ) ; java . util . List < com . spotify . folsom . RawMemcacheClient > expected = java . util . Arrays . asList ( com . spotify . folsom . ketama . ContinuumTest . CLIENT2 , com . spotify . folsom . ketama . ContinuumTest . CLIENT3 ) ; "<AssertPlaceHolder>" ; } bytes ( java . lang . String ) { return key . getBytes ( Charsets . US_ASCII ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testCheckPreFlightRequestTypeNoACRM ( ) { org . apache . catalina . filters . TesterHttpServletRequest request = new org . apache . catalina . filters . TesterHttpServletRequest ( ) ; request . setHeader ( CorsFilter . REQUEST_HEADER_ORIGIN , TesterFilterConfigs . HTTP_TOMCAT_APACHE_ORG ) ; request . setMethod ( "OPTIONS" ) ; org . apache . catalina . filters . CorsFilter corsFilter = new org . apache . catalina . filters . CorsFilter ( ) ; corsFilter . init ( org . apache . catalina . filters . TesterFilterConfigs . getDefaultFilterConfig ( ) ) ; org . apache . catalina . filters . CorsFilter . CORSRequestType requestType = corsFilter . checkRequestType ( request ) ; "<AssertPlaceHolder>" ; } checkRequestType ( javax . servlet . http . HttpServletRequest ) { org . apache . catalina . filters . CorsFilter . CORSRequestType requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . INVALID_CORS ; if ( request == null ) { throw new java . lang . IllegalArgumentException ( org . apache . catalina . filters . CorsFilter . sm . getString ( "corsFilter.nullRequest" ) ) ; } java . lang . String originHeader = request . getHeader ( org . apache . catalina . filters . CorsFilter . REQUEST_HEADER_ORIGIN ) ; if ( originHeader != null ) { if ( originHeader . isEmpty ( ) ) { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . INVALID_CORS ; } else if ( ! ( org . apache . catalina . filters . CorsFilter . isValidOrigin ( originHeader ) ) ) { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . INVALID_CORS ; } else if ( isLocalOrigin ( request , originHeader ) ) { return org . apache . catalina . filters . CorsFilter . CORSRequestType . NOT_CORS ; } else { java . lang . String method = request . getMethod ( ) ; if ( method != null ) { if ( "OPTIONS" . equals ( method ) ) { java . lang . String accessControlRequestMethodHeader = request . getHeader ( org . apache . catalina . filters . CorsFilter . REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD ) ; if ( ( accessControlRequestMethodHeader != null ) && ( ! ( accessControlRequestMethodHeader . isEmpty ( ) ) ) ) { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . PRE_FLIGHT ; } else if ( ( accessControlRequestMethodHeader != null ) && ( accessControlRequestMethodHeader . isEmpty ( ) ) ) { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . INVALID_CORS ; } else { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . ACTUAL ; } } else if ( ( "GET" . equals ( method ) ) || ( "HEAD" . equals ( method ) ) ) { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . SIMPLE ; } else if ( "POST" . equals ( method ) ) { java . lang . String mediaType = getMediaType ( request . getContentType ( ) ) ; if ( mediaType != null ) { if ( org . apache . catalina . filters . CorsFilter . SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES . contains ( mediaType ) ) { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . SIMPLE ; } else { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . ACTUAL ; } } } else { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . ACTUAL ; } } } } else { requestType = org . apache . catalina . filters . CorsFilter . CORSRequestType . NOT_CORS ; } return requestType ; }
|
org . junit . Assert . assertEquals ( CorsFilter . CORSRequestType . ACTUAL , requestType )
|
defaultModesOK ( ) { org . eclipse . xtext . linking . ILinkingDiagnosticMessageProvider . ILinkingDiagnosticContext diagnosticContext = createMock ( org . eclipse . xtext . linking . ILinkingDiagnosticMessageProvider . ILinkingDiagnosticContext . class ) ; com . github . jknack . antlr4ide . lang . LexerCommand command = createMock ( com . github . jknack . antlr4ide . lang . LexerCommand . class ) ; com . github . jknack . antlr4ide . lang . LexerCommands commands = createMock ( com . github . jknack . antlr4ide . lang . LexerCommands . class ) ; expect ( diagnosticContext . getLinkText ( ) ) . andReturn ( "HIDDEN" ) ; expect ( diagnosticContext . getContext ( ) ) . andReturn ( command ) ; expect ( command . eContainer ( ) ) . andReturn ( commands ) ; java . lang . Object [ ] mocks = new java . lang . Object [ ] { diagnosticContext , command , commands } ; replay ( mocks ) ; org . eclipse . xtext . diagnostics . DiagnosticMessage message = new com . github . jknack . antlr4ide . validation . Antlr4MissingReferenceMessageProvider ( ) . getUnresolvedProxyMessage ( diagnosticContext ) ; "<AssertPlaceHolder>" ; verify ( mocks ) ; }
|
org . junit . Assert . assertNull ( message )
|
test4 ( ) { int rows = new org . n3r . eql . Eql ( "mysql" ) . params ( of ( "id" , 3 , "data" , "Old11" , "ts" , new java . sql . Timestamp ( java . lang . System . currentTimeMillis ( ) ) ) ) . execute ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( rows , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( 1 ) ) )
|
getCurrentFileVersion ( ) { com . zsmartsystems . zigbee . zcl . clusters . ZclOtaUpgradeCluster cluster = org . mockito . Mockito . mock ( com . zsmartsystems . zigbee . zcl . clusters . ZclOtaUpgradeCluster . class ) ; org . mockito . Mockito . when ( cluster . getCurrentFileVersion ( org . mockito . ArgumentMatchers . anyLong ( ) ) ) . thenReturn ( 1234 ) ; com . zsmartsystems . zigbee . app . otaserver . ZclOtaUpgradeServer server = new com . zsmartsystems . zigbee . app . otaserver . ZclOtaUpgradeServer ( ) ; server . appStartup ( cluster ) ; "<AssertPlaceHolder>" ; } getCurrentFileVersion ( ) { return cluster . getCurrentFileVersion ( Long . MAX_VALUE ) ; }
|
org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 1234 ) , server . getCurrentFileVersion ( ) )
|
testStopRuntimeConfirmYesAndFailed ( ) { prepareRuntimeStop ( ) ; org . guvnor . ala . ui . model . RuntimeKey currentKey = runtime . getKey ( ) ; when ( translationService . getTranslation ( org . guvnor . ala . ui . client . provider . status . runtime . RuntimePresenter_RuntimeStoppingMessage ) ) . thenReturn ( org . guvnor . ala . ui . client . provider . status . runtime . RuntimePresenterActionsTest . BUSY_POPUP_MESSAGE ) ; doThrow ( new java . lang . RuntimeException ( org . guvnor . ala . ui . client . provider . status . runtime . RuntimePresenterActionsTest . ERROR_MESSAGE ) ) . when ( runtimeService ) . stopRuntime ( currentKey ) ; yesCommandCaptor . getValue ( ) . execute ( ) ; verify ( runtimeService , times ( 1 ) ) . stopRuntime ( currentKey ) ; verify ( defaultErrorCallback , times ( 1 ) ) . error ( any ( org . jboss . errai . bus . client . api . messaging . Message . class ) , exceptionCaptor . capture ( ) ) ; "<AssertPlaceHolder>" ; verify ( popupHelper , times ( 1 ) ) . showBusyIndicator ( org . guvnor . ala . ui . client . provider . status . runtime . RuntimePresenterActionsTest . BUSY_POPUP_MESSAGE ) ; verify ( popupHelper , times ( 1 ) ) . hideBusyIndicator ( ) ; } getValue ( ) { return rootPath ; }
|
org . junit . Assert . assertEquals ( org . guvnor . ala . ui . client . provider . status . runtime . RuntimePresenterActionsTest . ERROR_MESSAGE , exceptionCaptor . getValue ( ) . getMessage ( ) )
|
testAndIncomplete ( ) { buildRule . executeTarget ( "andincomplete" ) ; "<AssertPlaceHolder>" ; } getProject ( ) { return project ; }
|
org . junit . Assert . assertNull ( buildRule . getProject ( ) . getProperty ( "andincomplete" ) )
|
objectFieldOffset ( ) { long actual = io . trane . future . Unsafe . objectFieldOffset ( io . trane . future . UnsafeTest . TestClass . class , "field" ) ; long expected = Unsafe . instance . objectFieldOffset ( io . trane . future . UnsafeTest . TestClass . class . getDeclaredField ( "field" ) ) ; "<AssertPlaceHolder>" ; } objectFieldOffset ( java . lang . Class , java . lang . String ) { try { return io . trane . future . Unsafe . instance . objectFieldOffset ( cls . getDeclaredField ( name ) ) ; } catch ( final java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } }
|
org . junit . Assert . assertEquals ( actual , expected )
|
testGetAnalyzingDocument ( ) { org . w3c . dom . Document doc = wsattacker . library . xmlutilities . dom . DomUtilities . readDocument ( wsattacker . library . schemaanalyzer . SOAP11_PATH_TO_ENVELOPE_ELEMENT_XML ) ; org . w3c . dom . Element envelope = doc . getDocumentElement ( ) ; wsattacker . library . schemaanalyzer . SchemaAnalyzerImpl instance = new wsattacker . library . schemaanalyzer . SchemaAnalyzerImpl ( ) ; instance . findExpansionPoint ( envelope ) ; "<AssertPlaceHolder>" ; } getAnalyzingDocument ( ) { return analyzingDocument ; }
|
org . junit . Assert . assertEquals ( doc , instance . getAnalyzingDocument ( ) )
|
testFailure3 ( ) { boolean correct = false ; java . lang . String test = null ; org . openscience . cdk . tools . BremserOneSphereHOSECodePredictor bp = new org . openscience . cdk . tools . BremserOneSphereHOSECodePredictor ( ) ; try { bp . predict ( test ) ; } catch ( java . lang . Exception exc ) { if ( exc instanceof org . openscience . cdk . exception . CDKException ) { correct = true ; } } "<AssertPlaceHolder>" ; } predict ( org . openscience . cdk . interfaces . IAtomContainer ) { if ( ( mol == null ) || ( ( mol . getAtomCount ( ) ) == 0 ) ) throw new org . openscience . cdk . exception . CDKException ( "Molecule<sp>cannot<sp>be<sp>blank<sp>or<sp>null." ) ; org . openscience . cdk . fingerprint . CircularFingerprinter circ = new org . openscience . cdk . fingerprint . CircularFingerprinter ( classType ) ; circ . setPerceiveStereo ( optPerceiveStereo ) ; circ . calculate ( mol ) ; final int AND_BITS = ( folding ) - 1 ; java . util . Set < java . lang . Integer > hashset = new java . util . HashSet < java . lang . Integer > ( ) ; for ( int n = ( circ . getFPCount ( ) ) - 1 ; n >= 0 ; n -- ) { int code = circ . getFP ( n ) . hashCode ; if ( ( folding ) > 0 ) code &= AND_BITS ; hashset . add ( code ) ; } double val = 0 ; for ( int h : hashset ) { java . lang . Double c = contribs . get ( h ) ; if ( c != null ) val += c ; } return val ; }
|
org . junit . Assert . assertTrue ( correct )
|
shouldAcceptWhenMaxRequestPerSecondIsZero ( ) { rateLimit . setMaxRequestsPerSecond ( 0 ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( rateLimit , org . openstack . atlas . api . mgmt . validation . validators . PUT ) ; "<AssertPlaceHolder>" ; } passedValidation ( ) { return expectationResultList . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( result . passedValidation ( ) )
|
testGetInstance ( ) { com . cybersource . ws . client . HttpClientConnection con = null ; java . util . Properties merchantProperties = new java . util . Properties ( ) ; java . io . InputStream in = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( "test_cybs.properties" ) ; if ( in == null ) { throw new java . lang . RuntimeException ( "Unable<sp>to<sp>load<sp>test_cybs.properties<sp>file" ) ; } try { merchantProperties . load ( in ) ; } catch ( java . io . IOException e1 ) { e1 . printStackTrace ( ) ; } javax . xml . parsers . DocumentBuilder builder ; try { builder = com . cybersource . ws . client . Utility . newDocumentBuilder ( ) ; org . w3c . dom . Document request = com . cybersource . ws . client . Utility . readRequest ( merchantProperties , requestFilename ) ; com . cybersource . ws . client . MerchantConfig mc ; mc = new com . cybersource . ws . client . MerchantConfig ( merchantProperties , null ) ; java . lang . String merchantID = mc . getMerchantID ( ) ; java . lang . String nsURI = mc . getEffectiveNamespaceURI ( ) ; com . cybersource . ws . client . HttpClientConnectionIT . setMerchantID ( request , merchantID , nsURI ) ; com . cybersource . ws . client . LoggerWrapper logger = new com . cybersource . ws . client . LoggerWrapper ( null , true , true , mc ) ; con = new com . cybersource . ws . client . HttpClientConnection ( mc , builder , logger ) ; "<AssertPlaceHolder>" ; } catch ( javax . xml . parsers . ParserConfigurationException e ) { e . printStackTrace ( ) ; } catch ( com . cybersource . ws . client . ConfigException e ) { e . printStackTrace ( ) ; } } setMerchantID ( org . w3c . dom . Document , java . lang . String , java . lang . String ) { org . w3c . dom . Element merchantIDElem = com . cybersource . ws . client . Utility . createElement ( request , nsURI , "merchantID" , merchantID ) ; org . w3c . dom . Element requestMessage = com . cybersource . ws . client . Utility . getElement ( request , "requestMessage" , nsURI ) ; requestMessage . insertBefore ( merchantIDElem , requestMessage . getFirstChild ( ) ) ; }
|
org . junit . Assert . assertNotNull ( con )
|
testNonEmptyKieBaseWithWrongCSV ( ) { java . lang . String csv = "\"RuleSet\",\"org.jboss.qa.brms.bre.functional.expert.decisiontable\",,,\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( "\"Import\",\"org.jboss.qa.brms.domain.Message\",,,\n" + ",,,,\n" ) + "\"RuleTable<sp>TimerCalendarRule\",,,,\n" ) + "\"NAME\",\"TIMER\",\"CALENDARS\",\"ACTION\",\"Description\"\n" ) + ",,,,\n" ) + ",,,\"insert(new<sp>Message(\\\"$param\\\"));\",\n" ) + "\"Rule<sp>name\",\"Timer<sp>value\",\"Calendar<sp>value\",\"Inserted<sp>message<sp>text\",\"Note\"\n" ) + "\"Weekend<sp>rule\",,\"weekend\",\"Weekend<sp>rule\",\n" ) + "\"Every<sp>100<sp>ms<sp>weekday<sp>rule\",\"int:<sp>0<sp>100ms\",\"weekday\",\"Every<sp>100<sp>ms<sp>weekday<sp>rule\",\n" ) + "\"Delayed<sp>Tuesday<sp>rule\",\"int:<sp>1000<sp>0\",\"tuesday\",\"Delayed<sp>Tuesday<sp>rule\",\n" ) + "\"Delayed<sp>repetitive<sp>Friday<sp>rule\",\"int:<sp>500ms<sp>1s\",\"friday\",\"Delayed<sp>repetitive<sp>Friday<sp>rule\",\n" ) + "\"Delayed<sp>rule\",\"int:<sp>1s<sp>0ms\",,\"Delayed<sp>rule\",\n" ) + "\"Repetitive<sp>rule\",\"int:<sp>0ms<sp>100\",,\"Repetitive<sp>rule\",\n" ) + "\"Repetitive<sp>delayed<sp>rule\",\"int:<sp>1s<sp>100ms\",,\"Repetitive<sp>delayed<sp>rule\",\n" ) + "\"Cron<sp>rule\",\"cron:<sp>*/1<sp>*<sp>*<sp>*<sp>*<sp>?\",,\"Cron<sp>rule\",\n" ) ; org . kie . api . KieServices ks = KieServices . Factory . get ( ) ; org . kie . api . builder . KieFileSystem kfs = ks . newKieFileSystem ( ) . write ( "src/main/resources/r1.csv" , csv ) ; org . kie . api . builder . Results results = ks . newKieBuilder ( kfs ) . buildAll ( ) . getResults ( ) ; "<AssertPlaceHolder>" ; } getMessages ( ) { return messages ; }
|
org . junit . Assert . assertFalse ( results . getMessages ( ) . isEmpty ( ) )
|
testListAlleenLijstAnders ( ) { final java . lang . String xml1 = "<resultaat>" + ( ( ( ( ( ( ( ( ( "<persoon>" + "<attr1>1.1</attr1><attr2>1.2</attr2>" ) + "</persoon>" ) + "<persoon>" ) + "<attr1>2.1</attr1><attr2>2.2</attr2>" ) + "</persoon>" ) + "<persoon>" ) + "<attr1>3.1</attr1><attr2>3.2</attr2>" ) + "</persoon>" ) + "</resultaat>" ) ; final java . lang . String xml2 = "<resultaat>" + ( ( ( ( ( ( ( ( ( "<persoon>" + "<attr1>2.1</attr1><attr2>2.2</attr2>" ) + "</persoon>" ) + "<persoon>" ) + "<attr1>3.1</attr1><attr2>3.2</attr2>" ) + "</persoon>" ) + "<persoon>" ) + "<attr1>1.1</attr1><attr2>1.2</attr2>" ) + "</persoon>" ) + "</resultaat>" ) ; "<AssertPlaceHolder>" ; } sorteer ( java . lang . String ) { return new nl . bzk . migratiebrp . test . common . vergelijk . SorteerXml ( ) . sorteerXml ( input ) ; }
|
org . junit . Assert . assertEquals ( nl . bzk . migratiebrp . test . common . vergelijk . SorteerXml . sorteer ( xml1 ) , nl . bzk . migratiebrp . test . common . vergelijk . SorteerXml . sorteer ( xml2 ) )
|
enabledComponent_isEnabledReturnsTrue ( ) { com . vaadin . flow . component . HasEnabledTest . TestComponent component = new com . vaadin . flow . component . HasEnabledTest . TestComponent ( ) ; "<AssertPlaceHolder>" ; } isEnabled ( ) { return getElement ( ) . isEnabled ( ) ; }
|
org . junit . Assert . assertTrue ( component . isEnabled ( ) )
|
setDatacontainerValues_configuratorURL_PARTNER_TEMPLATE ( ) { org . oscm . domobjects . Product prod = createProduct ( 1 , 1 , ServiceType . PARTNER_TEMPLATE ) ; org . oscm . domobjects . Product template = createProduct ( 1 , 1 , ServiceType . TEMPLATE ) ; prod . setTemplate ( template ) ; org . oscm . domobjects . Product copy = new org . oscm . domobjects . Product ( ) ; prod . setDatacontainerValues ( copy , ServiceType . PARTNER_TEMPLATE ) ; "<AssertPlaceHolder>" ; } getConfiguratorUrl ( ) { return vo . getConfiguratorUrl ( ) ; }
|
org . junit . Assert . assertEquals ( null , copy . getConfiguratorUrl ( ) )
|
testGetEffectiveConnection ( ) { "<AssertPlaceHolder>" ; } getConnectionProperties ( ) { return connection . getEffectiveConnectionProperties ( ) ; }
|
org . junit . Assert . assertNotNull ( properties . getConnectionProperties ( ) . getEffectiveConnectionProperties ( ) )
|
shoulBeSetByList ( ) { final java . util . List < java . lang . Object > value = new java . util . ArrayList ( ) ; value . add ( new java . lang . Object ( ) ) ; "<AssertPlaceHolder>" ; } isSet ( java . lang . String ) { return ( value != null ) && ( ! ( value . isEmpty ( ) ) ) ; }
|
org . junit . Assert . assertThat ( isSet ( value ) , org . hamcrest . CoreMatchers . is ( true ) )
|
testGoalId ( ) { request . setGoalId ( 1 ) ; "<AssertPlaceHolder>" ; } getGoalId ( ) { return ( ( java . lang . Integer ) ( getParameter ( org . piwik . java . tracking . PiwikRequest . GOAL_ID ) ) ) ; }
|
org . junit . Assert . assertEquals ( new java . lang . Integer ( 1 ) , request . getGoalId ( ) )
|
stripTableAliasesFromFormula_with_spaces ( ) { java . lang . String formula = "count(<sp>a<sp>.id)" ; java . lang . String expected = "count(<sp>id)" ; java . lang . String result = new org . pentaho . pms . mql . dialect . HiveDialect ( ) . stripTableAliasesFromFormula ( formula ) ; "<AssertPlaceHolder>" ; } stripTableAliasesFromFormula ( java . lang . String ) { return TABLE_QUALIFIER_PATTERN . matcher ( formula ) . replaceAll ( new java . lang . String ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testGetWithMiss ( ) { final edu . illinois . library . cantaloupe . image . Identifier identifier = new edu . illinois . library . cantaloupe . image . Identifier ( "jpg" ) ; edu . illinois . library . cantaloupe . image . Info actualInfo = instance . get ( identifier ) ; "<AssertPlaceHolder>" ; } get ( java . util . UUID ) { return tasks . stream ( ) . filter ( ( t ) -> t . getUUID ( ) . equals ( uuid ) ) . findFirst ( ) . orElse ( null ) ; }
|
org . junit . Assert . assertNull ( actualInfo )
|
testRewriteCookieMatchingPathNoPort ( ) { javax . servlet . http . HttpServletRequest request = buildGoogleDotComServletRequest ( ) ; java . net . URL redirectUrl = buildRedirectUrlWithoutPort ( ) ; com . woonoz . proxy . servlet . UrlRewriter rewriter = new com . woonoz . proxy . servlet . UrlRewriterImpl ( request , redirectUrl ) ; java . lang . String cookie = "JSESSIONID=F39EC36E999C90604EAFF7A87F88DA58;<sp>Path=/services;" ; java . lang . String expected = "JSESSIONID=F39EC36E999C90604EAFF7A87F88DA58;<sp>path=/proxy;" ; "<AssertPlaceHolder>" ; org . easymock . EasyMock . verify ( request ) ; } rewriteCookie ( java . lang . String ) { org . apache . http . impl . cookie . BestMatchSpec parser = new org . apache . http . impl . cookie . BestMatchSpec ( ) ; java . util . List < org . apache . http . cookie . Cookie > cookies ; try { cookies = parser . parse ( new org . apache . http . message . BasicHeader ( "Set-Cookie" , headerValue ) , new org . apache . http . cookie . CookieOrigin ( targetServer . getHost ( ) , getPortOrDefault ( targetServer ) , targetServer . getPath ( ) , false ) ) ; } catch ( org . apache . http . cookie . MalformedCookieException e ) { throw new com . woonoz . proxy . servlet . InvalidCookieException ( e ) ; } if ( ( cookies . size ( ) ) != 1 ) { throw new com . woonoz . proxy . servlet . InvalidCookieException ( ) ; } org . apache . http . cookie . Cookie cookie = rewriteCookiePathIfNeeded ( cookies . get ( 0 ) ) ; com . woonoz . proxy . servlet . CookieFormatter cookieFormatter = com . woonoz . proxy . servlet . CookieFormatter . createFromApacheCookie ( cookie ) ; return cookieFormatter . asString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , rewriter . rewriteCookie ( cookie ) )
|
parallel_whenIsParallel_thenCorrect ( ) { com . baeldung . java8 . IntStream intStreamParallel = com . baeldung . java8 . IntStream . range ( 1 , 150 ) . parallel ( ) . map ( ( element ) -> element * 34 ) ; boolean isParallel = intStreamParallel . isParallel ( ) ; "<AssertPlaceHolder>" ; } map ( java . lang . String ) { com . baeldung . rate . impl . QuoteResponseWrapper qrw = javax . json . bind . JsonbBuilder . create ( ) . fromJson ( response , com . baeldung . rate . impl . QuoteResponseWrapper . class ) ; return qrw . getQuoteResponse ( ) . getResult ( ) ; }
|
org . junit . Assert . assertTrue ( isParallel )
|
testExtensionRead ( ) { org . onebusaway . gtfs . services . MockGtfs gtfs = org . onebusaway . gtfs . services . MockGtfs . create ( ) ; gtfs . putMinimal ( ) ; gtfs . putStops ( 2 , "label=a,b" ) ; org . onebusaway . csv_entities . schema . DefaultEntitySchemaFactory factory = org . onebusaway . gtfs . serialization . GtfsEntitySchemaFactory . createEntitySchemaFactory ( ) ; factory . addExtension ( org . onebusaway . gtfs . model . Stop . class , org . onebusaway . gtfs . ExtensionsTest . StopExtension . class ) ; org . onebusaway . gtfs . serialization . GtfsReader reader = new org . onebusaway . gtfs . serialization . GtfsReader ( ) ; reader . setEntitySchemaFactory ( factory ) ; org . onebusaway . gtfs . services . GtfsMutableRelationalDao dao = gtfs . read ( reader ) ; org . onebusaway . gtfs . model . Stop stop = dao . getStopForId ( new org . onebusaway . gtfs . model . AgencyAndId ( "a0" , "s0" ) ) ; org . onebusaway . gtfs . ExtensionsTest . StopExtension extension = stop . getExtension ( org . onebusaway . gtfs . ExtensionsTest . StopExtension . class ) ; "<AssertPlaceHolder>" ; } getLabel ( ) { return label ; }
|
org . junit . Assert . assertEquals ( "a" , extension . getLabel ( ) )
|
testIsCheckerDisabledWhenUnsettingRequiredRoleToUser ( ) { long requiredRoleId = addRequiredRoles ( ) [ 0 ] ; com . liferay . portal . kernel . model . Role role = com . liferay . portal . kernel . service . RoleLocalServiceUtil . getRole ( requiredRoleId ) ; com . liferay . portlet . sites . search . OrganizationRoleUserChecker organizationRoleUserChecker = new com . liferay . portlet . sites . search . OrganizationRoleUserChecker ( com . liferay . portal . security . membership . policy . organization . test . OrganizationMembershipPolicyRowCheckerTest . _renderResponse , organization , role ) ; com . liferay . portal . kernel . model . User user = com . liferay . portal . kernel . test . util . UserTestUtil . addUser ( ) ; com . liferay . portal . kernel . service . UserGroupRoleLocalServiceUtil . addUserGroupRoles ( user . getUserId ( ) , organization . getGroupId ( ) , new long [ ] { requiredRoleId } ) ; "<AssertPlaceHolder>" ; } isDisabled ( java . lang . Object ) { com . liferay . portal . kernel . model . UserNotificationEvent userNotificationEvent = ( ( com . liferay . portal . kernel . model . UserNotificationEvent ) ( obj ) ) ; if ( userNotificationEvent . isActionRequired ( ) ) { return true ; } return super . isDisabled ( obj ) ; }
|
org . junit . Assert . assertTrue ( organizationRoleUserChecker . isDisabled ( user ) )
|
hasNext ( ) { ru . szhernovoy . simplenumber . IteratorSimpleNumber it = new ru . szhernovoy . simplenumber . IteratorSimpleNumber ( new int [ ] { 1 , 2 , 3 , 4 , 5 , 11 , 67 } ) ; it . next ( ) ; it . next ( ) ; boolean result = it . hasNext ( ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return this . listLeaf . isEmpty ( ) ? false : this . inner . hasNext ( ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( true ) )
|
testIsJDK7OrHigher_1 ( ) { boolean result = org . audit4j . core . util . EnvUtil . isJDK7OrHigher ( ) ; "<AssertPlaceHolder>" ; } isJDK7OrHigher ( ) { return org . audit4j . core . util . EnvUtil . isJDK_N_OrHigher ( 7 ) ; }
|
org . junit . Assert . assertEquals ( true , result )
|
ensureThatWeCanAddTwoCardsThatAreIdenticalToThePile ( ) { com . clinkworks . solitaire . datatype . Pile pile = newEmptyPile ( ) ; pile . addCard ( newAceOfSpades ( ) ) . addCard ( newAceOfSpades ( ) ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return cards . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , pile . getSize ( ) )
|
testGetHeaders ( ) { org . apache . cxf . jaxrs . ext . multipart . Attachment a = createAttachment ( "p1" ) ; "<AssertPlaceHolder>" ; } getHeader ( java . lang . String ) { java . lang . String value = headers . get ( name ) ; return value == null ? headers . get ( name . toLowerCase ( ) ) : value ; }
|
org . junit . Assert . assertEquals ( "bar" , a . getHeader ( "foo" ) )
|
testGetUserByName ( ) { try { qa . qcri . aidr . dbmanager . dto . UsersDTO result = qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . userResourceFacadeImp . getUserByName ( qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . user . getName ( ) ) ; "<AssertPlaceHolder>" ; } catch ( qa . qcri . aidr . common . exception . PropertyNotSetException ex ) { qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . logger . error ( ( "PropertyNotSetException<sp>while<sp>fetching<sp>user<sp>by<sp>name<sp>" + ( ex . getMessage ( ) ) ) ) ; org . junit . Assert . fail ( "testGetUserByName<sp>failed" ) ; } } getUserID ( ) { return userID ; }
|
org . junit . Assert . assertEquals ( qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . user . getUserID ( ) , result . getUserID ( ) )
|
extractingConsulResponseShouldSucceedWhenRequestSucceed ( ) { java . lang . String expectedBody = "success" ; retrofit2 . Response < java . lang . String > response = retrofit2 . Response . success ( expectedBody ) ; retrofit2 . Call < java . lang . String > call = mock ( retrofit2 . Call . class ) ; doReturn ( response ) . when ( call ) . execute ( ) ; com . orbitz . consul . model . ConsulResponse < java . lang . String > consulResponse = http . extractConsulResponse ( call ) ; "<AssertPlaceHolder>" ; } getResponse ( ) { return response ; }
|
org . junit . Assert . assertEquals ( expectedBody , consulResponse . getResponse ( ) )
|
testHDFSConfigClusterUpdateQuorumJournalURL ( ) { final java . lang . String expectedHostNameOne = "HDFS<sp>HA<sp>shared<sp>edits<sp>directory<sp>property<sp>not<sp>properly<sp>updated<sp>for<sp>cluster<sp>create." 0 ; final java . lang . String expectedHostNameTwo = "c6402.apache.ambari.org" ; final java . lang . String expectedPortNum = "808080" ; final java . lang . String expectedHostGroupName = "host_group_1" ; final java . lang . String expectedHostGroupNameTwo = "host_group_2" ; java . util . Map < java . lang . String , java . util . Map < java . lang . String , java . lang . String > > properties = new java . util . HashMap ( ) ; java . util . Map < java . lang . String , java . lang . String > hdfsSiteProperties = new java . util . HashMap ( ) ; properties . put ( "HDFS<sp>HA<sp>shared<sp>edits<sp>directory<sp>property<sp>not<sp>properly<sp>updated<sp>for<sp>cluster<sp>create." 1 , hdfsSiteProperties ) ; hdfsSiteProperties . put ( "dfs.namenode.shared.edits.dir" , ( ( ( ( "qjournal://" + ( org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . createExportedAddress ( expectedPortNum , expectedHostGroupName ) ) ) + ";" ) + ( org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . createExportedAddress ( expectedPortNum , expectedHostGroupNameTwo ) ) ) + "/mycluster" ) ) ; org . apache . ambari . server . topology . Configuration clusterConfig = new org . apache . ambari . server . topology . Configuration ( properties , java . util . Collections . emptyMap ( ) ) ; java . util . Collection < java . lang . String > hgComponents1 = new java . util . HashSet ( ) ; hgComponents1 . add ( "NAMENODE" ) ; org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . TestHostGroup group1 = new org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . TestHostGroup ( expectedHostGroupName , hgComponents1 , java . util . Collections . singleton ( expectedHostNameOne ) ) ; java . util . Collection < java . lang . String > hgComponents2 = new java . util . HashSet ( ) ; hgComponents2 . add ( "NAMENODE" ) ; org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . TestHostGroup group2 = new org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . TestHostGroup ( expectedHostGroupNameTwo , hgComponents2 , java . util . Collections . singleton ( expectedHostNameTwo ) ) ; java . util . Collection < org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . TestHostGroup > hostGroups = new java . util . ArrayList ( ) ; hostGroups . add ( group1 ) ; hostGroups . add ( group2 ) ; org . apache . ambari . server . topology . ClusterTopology topology = createClusterTopology ( bp , clusterConfig , hostGroups ) ; org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessor updater = new org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessor ( topology ) ; updater . doUpdateForClusterCreate ( ) ; "<AssertPlaceHolder>" ; } createHostAddress ( java . lang . String , java . lang . String ) { return ( hostName + ":" ) + portNumber ; }
|
org . junit . Assert . assertEquals ( "HDFS<sp>HA<sp>shared<sp>edits<sp>directory<sp>property<sp>not<sp>properly<sp>updated<sp>for<sp>cluster<sp>create." , ( ( ( ( "qjournal://" + ( org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . createHostAddress ( expectedHostNameOne , expectedPortNum ) ) ) + ";" ) + ( org . apache . ambari . server . controller . internal . BlueprintConfigurationProcessorTest . createHostAddress ( expectedHostNameTwo , expectedPortNum ) ) ) + "/mycluster" ) , hdfsSiteProperties . get ( "dfs.namenode.shared.edits.dir" ) )
|
testCreateSection ( ) { org . bukkit . configuration . ConfigurationSection section = getConfigurationSection ( ) ; org . bukkit . configuration . ConfigurationSection subsection = section . createSection ( "subsection" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return getType ( ) . getName ( ) ; }
|
org . junit . Assert . assertEquals ( "subsection" , subsection . getName ( ) )
|
testTraitImplicitInsertionExceptionOnNonTraitable ( ) { final java . lang . String s1 = "\t\tdon(<sp>new<sp>Core(),<sp>Mask.class<sp>);\n" 0 + ( ( ( ( ( ( ( ( ( ( ( ( ( "import<sp>org.drools.core.factmodel.traits.*;<sp>\n" + "global<sp>java.util.List<sp>list;\n" ) + "" ) + "declare<sp>Core<sp>id<sp>:<sp>String<sp>end\n" ) + "" ) + "\t\tdon(<sp>new<sp>Core(),<sp>Mask.class<sp>);\n" 1 ) + "" ) + "rule<sp>\"Don<sp>ItemStyle\"\n" ) + "\twhen\n" ) + "\tthen\n" ) + "\t\tdon(<sp>new<sp>Core(),<sp>Mask.class<sp>);\n" ) + "\t\tdon(<sp>new<sp>Core(),<sp>Mask.class<sp>);\n" 3 ) + "" ) + "" ) ; org . kie . api . KieBase kbase = getKieBaseFromString ( s1 ) ; org . drools . core . factmodel . traits . TraitFactory . setMode ( mode , kbase ) ; java . util . ArrayList list = new java . util . ArrayList ( ) ; org . kie . api . runtime . KieSession knowledgeSession = kbase . newKieSession ( ) ; knowledgeSession . setGlobal ( "\t\tdon(<sp>new<sp>Core(),<sp>Mask.class<sp>);\n" 2 , list ) ; try { knowledgeSession . fireAllRules ( ) ; org . junit . Assert . fail ( "Core<sp>is<sp>not<sp>declared<sp>@Traitable,<sp>this<sp>test<sp>should<sp>have<sp>thrown<sp>an<sp>exception" ) ; } catch ( java . lang . Exception csq ) { "<AssertPlaceHolder>" ; } } getCause ( ) { return cause ; }
|
org . junit . Assert . assertTrue ( ( ( csq . getCause ( ) ) instanceof java . lang . IllegalStateException ) )
|
testLinearAddition ( ) { org . apache . druid . collections . bitmap . MutableBitmap mutableBitmap = factory . makeEmptyMutableBitmap ( ) ; for ( int i = 0 ; i < ( org . apache . druid . segment . data . BitmapCreationBenchmark . numBits ) ; ++ i ) { mutableBitmap . add ( i ) ; } "<AssertPlaceHolder>" ; } size ( ) { return immutableBitmap . size ( ) ; }
|
org . junit . Assert . assertEquals ( org . apache . druid . segment . data . BitmapCreationBenchmark . numBits , mutableBitmap . size ( ) )
|
testMinAggregation ( ) { com . liferay . portal . search . aggregation . metrics . MinAggregation minAggregation = com . liferay . portal . search . aggregations . test . AggregationsInstantiationTest . _aggregations . min ( "name" , "field" ) ; "<AssertPlaceHolder>" ; } min ( java . lang . String , java . lang . String ) { return new com . liferay . portal . search . internal . aggregation . metrics . MinAggregationImpl ( name , field ) ; }
|
org . junit . Assert . assertNotNull ( minAggregation )
|
testDecodeAttachedFileNamesEncoded ( ) { final java . lang . String fileNames = "???????<sp>?????????,???????" ; final java . lang . String message = getMailMessageSpy . decodeAttachedFileNames ( fileNames ) ; "<AssertPlaceHolder>" ; } decodeAttachedFileNames ( java . lang . String ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; java . lang . String delimiter = "" ; for ( java . lang . String fileName : attachedFileNames . split ( io . cloudslang . content . mail . services . GetMailMessage . STR_COMMA ) ) { sb . append ( delimiter ) . append ( javax . mail . internet . MimeUtility . decodeText ( fileName ) ) ; delimiter = io . cloudslang . content . mail . services . GetMailMessage . STR_COMMA ; } return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "???????<sp>?????????,???????" , message )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.