input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testClientHelloLacksServerNameExtensionForNonRegisteredPeer ( ) { givenAClientHandshaker ( new java . net . InetSocketAddress ( java . net . InetAddress . getByAddress ( new byte [ ] { 10 , 0 , 0 , 1 } ) , 10000 ) , false ) ; handshaker . startHandshake ( ) ; org . eclipse . californium . scandium . dtls . ClientHello clientHello = org . eclipse . californium . scandium . dtls . ClientHandshakerTest . getClientHello ( recordLayer . getSentFlight ( ) ) ; "<AssertPlaceHolder>" ; } getServerNameExtension ( ) { if ( ( extensions ) != null ) { return ( ( org . eclipse . californium . scandium . dtls . ServerNameExtension ) ( extensions . getExtension ( ExtensionType . SERVER_NAME ) ) ) ; } else { return null ; } }
org . junit . Assert . assertNull ( clientHello . getServerNameExtension ( ) )
testListObject2 ( ) { com . amazonaws . services . s3 . model . ObjectListing expected = new com . amazonaws . services . s3 . model . ObjectListing ( ) ; com . amazonaws . services . s3 . model . ListObjectsRequest request = new com . amazonaws . services . s3 . model . ListObjectsRequest ( ) . withBucketName ( org . sagebionetworks . SynapseS3ClientImplUnitTest . BUCKET_NAME ) ; when ( mockAmazonClient . listObjects ( request ) ) . thenReturn ( expected ) ; com . amazonaws . services . s3 . model . ObjectListing actual = client . listObjects ( request ) ; verify ( mockAmazonClient ) . listObjects ( request ) ; "<AssertPlaceHolder>" ; } listObjects ( com . amazonaws . services . s3 . model . ListObjectsRequest ) { return getS3ClientForBucket ( listObjectsRequest . getBucketName ( ) ) . listObjects ( listObjectsRequest ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetProcessDefinitionInvalidDeploymenId ( ) { "<AssertPlaceHolder>" ; org . jbpm . services . api . model . DeploymentUnit deploymentUnit = new org . jbpm . kie . services . impl . KModuleDeploymentUnit ( GROUP_ID , ARTIFACT_ID , VERSION ) ; deploymentService . deploy ( deploymentUnit ) ; units . add ( deploymentUnit ) ; bpmn2Service . getProcessDefinition ( "invalidid" , "org.jbpm.writedocument" ) ; }
org . junit . Assert . assertNotNull ( deploymentService )
generateSwaggerSDKForInvalidLanguage_shouldNotGenerateSwaggerSDK ( ) { java . lang . String urlWithoutScheme = "http" ; java . lang . String language = "non-exist" ; java . lang . String basePath = "/ws/fhir" ; javax . servlet . http . HttpServletRequest request = new org . springframework . mock . web . MockHttpServletRequest ( ) ; org . openmrs . module . fhir . swagger . SwaggerSpecificationCreator creator = new org . openmrs . module . fhir . swagger . SwaggerSpecificationCreator ( urlWithoutScheme , basePath , request ) ; java . lang . String swaggerSpecificationJSON = creator . buildJSON ( ) ; "<AssertPlaceHolder>" ; org . openmrs . module . fhir . swagger . codegen . SwaggerCodeGenerator swaggerCodeGenerator = new org . openmrs . module . fhir . swagger . codegen . SwaggerCodeGenerator ( ) ; java . lang . String path = swaggerCodeGenerator . generateSDK ( language , swaggerSpecificationJSON ) ; org . junit . Assert . fail ( "Attempt<sp>generate<sp>SDK<sp>for<sp>non<sp>exist<sp>language<sp>which<sp>should<sp>throw<sp>an<sp>exception" ) ; } buildJSON ( ) { synchronized ( this ) { createApiDefinition ( ) ; addPaths ( ) ; addParameters ( ) ; createObjectDefinitions ( ) ; } return createSwaggerSpecification ( ) ; }
org . junit . Assert . assertNotNull ( swaggerSpecificationJSON )
testGenerateOperatorBean02 ( ) { java . lang . String operatorId = "op00" ; java . util . List < java . lang . String > projectedFields = java . util . Arrays . asList ( "c" , "a" , "b" ) ; edu . uci . ics . texera . textql . statements . predicates . ProjectSomeFieldsPredicate projectSomeFieldsPredicate = new edu . uci . ics . texera . textql . statements . predicates . ProjectSomeFieldsPredicate ( projectedFields ) ; edu . uci . ics . texera . dataflow . common . PredicateBase computedProjectionBean = projectSomeFieldsPredicate . generateOperatorBean ( operatorId ) ; edu . uci . ics . texera . dataflow . common . PredicateBase expectedProjectionBean = new edu . uci . ics . texera . dataflow . projection . ProjectionPredicate ( java . util . Arrays . asList ( "c" , "a" , "b" ) ) ; expectedProjectionBean . setID ( operatorId ) ; "<AssertPlaceHolder>" ; } setID ( java . lang . String ) { this . id = id ; }
org . junit . Assert . assertEquals ( expectedProjectionBean , computedProjectionBean )
testExecuteInSequence ( ) { boolean b = aic . executeInSequence ( ) ; "<AssertPlaceHolder>" ; } executeInSequence ( ) { return true ; }
org . junit . Assert . assertTrue ( b )
testGlobalGapPenalties ( ) { for ( org . biojava . bio . alignment . AlignmentPair alignmentPair : align . global ( query , subject , gapPenalties ) ) { "<AssertPlaceHolder>" ; } } global ( org . biojava . bio . seq . Sequence , org . biojava . bio . seq . Sequence , org . nmdp . ngs . align . GapPenalties ) { return global ( com . google . common . collect . ImmutableList . of ( query ) , com . google . common . collect . ImmutableList . of ( subject ) , gapPenalties ) ; }
org . junit . Assert . assertNotNull ( alignmentPair )
testRegisterClientDriver ( ) { org . apache . bookkeeper . meta . MetadataClientDriver clientDriver = mock ( org . apache . bookkeeper . meta . MetadataClientDriver . class ) ; when ( clientDriver . getScheme ( ) ) . thenReturn ( "testdriver" ) ; try { org . apache . bookkeeper . meta . MetadataDrivers . getClientDriver ( clientDriver . getScheme ( ) ) ; org . junit . Assert . fail ( "Should<sp>fail<sp>to<sp>get<sp>client<sp>driver<sp>if<sp>it<sp>is<sp>not<sp>registered" ) ; } catch ( java . lang . IllegalArgumentException iae ) { } org . apache . bookkeeper . meta . MetadataDrivers . registerClientDriver ( clientDriver . getScheme ( ) , clientDriver . getClass ( ) ) ; org . apache . bookkeeper . meta . MetadataClientDriver driver = org . apache . bookkeeper . meta . MetadataDrivers . getClientDriver ( clientDriver . getScheme ( ) ) ; "<AssertPlaceHolder>" ; } getScheme ( ) { return org . apache . bookkeeper . metadata . etcd . EtcdMetadataDriverBase . SCHEME ; }
org . junit . Assert . assertEquals ( clientDriver . getClass ( ) , driver . getClass ( ) )
testComparatorList ( ) { org . evosuite . junit . naming . methods . GoalComparator comparator = new org . evosuite . junit . naming . methods . GoalComparator ( ) ; org . evosuite . coverage . method . MethodCoverageTestFitness goal1 = new org . evosuite . coverage . method . MethodCoverageTestFitness ( "FooClass" , "toString()" ) ; org . evosuite . coverage . exception . ExceptionCoverageTestFitness goal2 = new org . evosuite . coverage . exception . ExceptionCoverageTestFitness ( "FooClass" , "toString()" , org . evosuite . runtime . mock . java . lang . MockArithmeticException . class , ExceptionCoverageTestFitness . ExceptionType . EXPLICIT ) ; org . evosuite . coverage . io . output . OutputCoverageGoal outputGoal = new org . evosuite . coverage . io . output . OutputCoverageGoal ( "FooClass" , "toString" , org . objectweb . asm . Type . getType ( "Ljava.lang.String;" ) , org . evosuite . coverage . io . IOCoverageConstants . REF_NONNULL ) ; org . evosuite . coverage . io . output . OutputCoverageTestFitness goal3 = new org . evosuite . coverage . io . output . OutputCoverageTestFitness ( outputGoal ) ; java . util . List < org . evosuite . testcase . TestFitnessFunction > goals = new java . util . ArrayList ( ) ; goals . add ( goal1 ) ; goals . add ( goal2 ) ; goals . add ( goal3 ) ; java . util . Collections . sort ( goals , comparator ) ; "<AssertPlaceHolder>" ; } get ( int ) { return this . pathCondition . get ( index ) ; }
org . junit . Assert . assertEquals ( goal2 , goals . get ( 0 ) )
testApplication ( ) { info . batey . kafka . unit . KafkaUnit ku = kafkaUnitRule . getKafkaUnit ( ) ; java . lang . String topicName = "/META-INF/properties.xml" 2 ; ku . createTopic ( topicName , 1 ) ; java . lang . String [ ] words = "/META-INF/properties.xml" 5. split ( "\\s+" ) ; for ( java . lang . String word : words ) { ku . sendMessages ( new kafka . producer . KeyedMessage < java . lang . String , java . lang . String > ( topicName , word ) ) ; } org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( false ) ; conf . addResource ( this . getClass ( ) . getResourceAsStream ( "/META-INF/properties.xml" ) ) ; conf . set ( "apex.operator.kafkaInput.prop.topics" , topicName ) ; conf . set ( "apex.operator.kafkaInput.prop.clusters" , ( "localhost:" + ( brokerPort ) ) ) ; conf . set ( "apex.operator.kafkaInput.prop.maxTuplesPerWindow" , "1" ) ; conf . set ( "apex.operator.kafkaInput.prop.initialOffset" , "EARLIEST" ) ; conf . set ( "/META-INF/properties.xml" 3 , org . apache . apex . examples . exactlyonce . ExactlyOnceJdbcOutputTest . DB_DRIVER ) ; conf . set ( "apex.operator.store.prop.store.databaseUrl" , org . apache . apex . examples . exactlyonce . ExactlyOnceJdbcOutputTest . DB_URL ) ; org . apache . apex . api . EmbeddedAppLauncher < ? > launcher = org . apache . apex . api . Launcher . getLauncher ( LaunchMode . EMBEDDED ) ; com . datatorrent . api . Attribute . AttributeMap launchAttributes = new com . datatorrent . api . Attribute . AttributeMap . DefaultAttributeMap ( ) ; launchAttributes . put ( EmbeddedAppLauncher . RUN_ASYNC , true ) ; org . apache . apex . api . Launcher . AppHandle appHandle = launcher . launchApp ( new org . apache . apex . examples . exactlyonce . ExactlyOnceJdbcOutputApp ( ) , conf , launchAttributes ) ; java . util . HashSet < java . lang . String > wordsSet = com . google . common . collect . Sets . newHashSet ( words ) ; java . sql . Connection con = java . sql . DriverManager . getConnection ( org . apache . apex . examples . exactlyonce . ExactlyOnceJdbcOutputTest . DB_URL ) ; java . sql . Statement stmt = con . createStatement ( ) ; int rowCount = 0 ; long timeout = ( java . lang . System . currentTimeMillis ( ) ) + 30000 ; while ( ( rowCount < ( wordsSet . size ( ) ) ) && ( timeout > ( java . lang . System . currentTimeMillis ( ) ) ) ) { java . lang . Thread . sleep ( 500 ) ; java . lang . String countQuery = "/META-INF/properties.xml" 4 + ( org . apache . apex . examples . exactlyonce . ExactlyOnceJdbcOutputTest . TABLE_NAME ) ; java . sql . ResultSet resultSet = stmt . executeQuery ( countQuery ) ; resultSet . next ( ) ; rowCount = resultSet . getInt ( 1 ) ; resultSet . close ( ) ; org . apache . apex . examples . exactlyonce . ExactlyOnceJdbcOutputTest . LOG . info ( "/META-INF/properties.xml" 0 , org . apache . apex . examples . exactlyonce . ExactlyOnceJdbcOutputTest . TABLE_NAME , rowCount ) ; } "<AssertPlaceHolder>" ; appHandle . shutdown ( ShutdownMode . KILL ) ; } size ( ) { return key . length ; }
org . junit . Assert . assertEquals ( "/META-INF/properties.xml" 1 , wordsSet . size ( ) , rowCount )
matchWithNullValue ( ) { boolean check = org . jumbune . utils . PatternMatcher . match ( null , UtilitiesConstantsTestInterface . REGEX ) ; "<AssertPlaceHolder>" ; } match ( org . apache . hadoop . io . Writable , java . lang . String ) { if ( value == null ) { return false ; } java . lang . String valueStr = value . toString ( ) ; if ( ( valueStr == null ) || ( ( valueStr . length ( ) ) == 0 ) ) { return false ; } java . util . regex . Pattern p = java . util . regex . Pattern . compile ( regex ) ; java . util . regex . Matcher m = p . matcher ( valueStr ) ; return m . matches ( ) ; }
org . junit . Assert . assertFalse ( check )
findByName ( ) { final org . feuyeux . jaxrs2 . atup . core . domain . AtupTestCase testCase = dao . findByName ( CreateTestCase . CASE_NAME ) ; "<AssertPlaceHolder>" ; } getCaseName ( ) { return caseName ; }
org . junit . Assert . assertEquals ( CreateTestCase . CASE_NAME , testCase . getCaseName ( ) )
testRemoveKeyFromNewMap_shouldRemoveEntry ( ) { java . util . Map < java . lang . String , java . lang . String > original = com . google . common . collect . ImmutableMap . of ( "foo" , "bar" , "test" , "42" ) ; java . util . Map < java . lang . String , java . lang . String > oldMap = com . google . common . collect . ImmutableMap . copyOf ( original ) ; java . util . Map < java . lang . String , java . lang . String > newMap = com . google . common . collect . ImmutableMap . of ( "foo" , "bar" ) ; com . google . common . collect . MapDifference < java . lang . String , java . lang . String > difference = com . google . common . collect . Maps . difference ( oldMap , newMap ) ; java . util . Map < java . lang . String , java . lang . String > result = org . openengsb . core . util . ConfigUtils . updateMap ( original , difference ) ; "<AssertPlaceHolder>" ; } updateMap ( java . util . Map , com . google . common . collect . MapDifference ) { java . util . Map < K , V > result = new java . util . HashMap < K , V > ( original ) ; if ( diff . areEqual ( ) ) { return result ; } for ( java . util . Map . Entry < K , V > entry : diff . entriesOnlyOnLeft ( ) . entrySet ( ) ) { V originalValue = original . get ( entry . getKey ( ) ) ; if ( org . apache . commons . lang . ObjectUtils . equals ( originalValue , entry . getValue ( ) ) ) { result . remove ( entry . getKey ( ) ) ; } } for ( java . util . Map . Entry < K , V > entry : diff . entriesOnlyOnRight ( ) . entrySet ( ) ) { K key = entry . getKey ( ) ; if ( original . containsKey ( key ) ) { if ( org . apache . commons . lang . ObjectUtils . notEqual ( original . get ( key ) , entry . getValue ( ) ) ) { throw new org . openengsb . core . util . MergeException ( java . lang . String . format ( "tried<sp>to<sp>introduce<sp>a<sp>new<sp>value,<sp>but<sp>it<sp>was<sp>already<sp>there:<sp>%s<sp>(%s,%s)" , key , original . get ( key ) , entry . getValue ( ) ) ) ; } } result . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } for ( java . util . Map . Entry < K , com . google . common . collect . MapDifference . ValueDifference < V > > entry : diff . entriesDiffering ( ) . entrySet ( ) ) { K key = entry . getKey ( ) ; V originalValue = original . get ( entry . getKey ( ) ) ; if ( org . apache . commons . lang . ObjectUtils . equals ( originalValue , entry . getValue ( ) . leftValue ( ) ) ) { result . put ( key , entry . getValue ( ) . rightValue ( ) ) ; } else if ( org . apache . commons . lang . ObjectUtils . equals ( originalValue , entry . getValue ( ) . rightValue ( ) ) ) { result . put ( key , originalValue ) ; } else { java . lang . String errorMessage = java . lang . String . format ( ( "Changes<sp>could<sp>not<sp>be<sp>applied,<sp>because<sp>original<sp>value<sp>differes<sp>from<sp>left-side<sp>of<sp>the" + "MapDifference:<sp>%s<sp>(%s,%s)" ) , entry . getKey ( ) , original . get ( entry . getKey ( ) ) , entry . getValue ( ) ) ; throw new org . openengsb . core . util . MergeException ( errorMessage ) ; } } return result ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( newMap ) )
testValid06 ( ) { org . terasoluna . gfw . web . token . transaction . TransactionToken token = new org . terasoluna . gfw . web . token . transaction . TransactionToken ( "" , "123" , "456" ) ; boolean valid = token . valid ( ) ; "<AssertPlaceHolder>" ; } valid ( ) { return false ; }
org . junit . Assert . assertFalse ( valid )
unreachedTime ( ) { "<AssertPlaceHolder>" ; } create ( ) { return new com . conveyal . r5 . otp2 . rangeraptor . transit . ReverseSearchTransitCalculator ( com . conveyal . r5 . otp2 . rangeraptor . transit . ReverseSearchTransitCalculatorTest . TRIP_SEARCH_BINARY_SEARCH_THRESHOLD , boardSlackInSeconds , latestArrivelTime , searchWindowSizeInSeconds , earliestAcceptableDepartureTime , iterationStep ) ; }
org . junit . Assert . assertEquals ( Integer . MAX_VALUE , create ( ) . unreachedTime ( ) )
testInit ( ) { final org . kie . workbench . common . dmn . client . editors . types . listview . DataTypeListItem listItem = mock ( org . kie . workbench . common . dmn . client . editors . types . listview . DataTypeListItem . class ) ; final elemental2 . dom . HTMLElement htmlElement = mock ( elemental2 . dom . HTMLElement . class ) ; final org . kie . workbench . common . dmn . client . editors . types . listview . DataTypeList actualDataTypeList = shortcuts . getDataTypeList ( ) ; final org . kie . workbench . common . dmn . client . editors . types . listview . DataTypeList expectedDataTypeList = shortcuts . getDataTypeList ( ) ; when ( listItem . getElement ( ) ) . thenReturn ( htmlElement ) ; "<AssertPlaceHolder>" ; verify ( expectedDataTypeList ) . registerDataTypeListItemUpdateCallback ( onDataTypeListItemUpdateArgumentCaptor . capture ( ) ) ; onDataTypeListItemUpdateArgumentCaptor . getValue ( ) . accept ( listItem ) ; verify ( view ) . highlight ( htmlElement ) ; } getElement ( ) { return view . getElement ( ) ; }
org . junit . Assert . assertEquals ( expectedDataTypeList , actualDataTypeList )
testSupportsUserUpdate ( ) { org . nuxeo . ecm . core . blob . BlobProvider blobProvider = blobManager . getBlobProvider ( org . nuxeo . ecm . liveconnect . dropbox . TestDropboxBlobProvider . PREFIX ) ; "<AssertPlaceHolder>" ; } supportsUserUpdate ( ) { return ! ( java . lang . Boolean . parseBoolean ( properties . get ( org . nuxeo . ecm . core . storage . mongodb . PREVENT_USER_UPDATE ) ) ) ; }
org . junit . Assert . assertTrue ( blobProvider . supportsUserUpdate ( ) )
unlockExclusiveAndTakeWriteLockMustPreventExclusiveLocks ( ) { pageList . unlockExclusiveAndTakeWriteLock ( pageRef ) ; "<AssertPlaceHolder>" ; } tryExclusiveLock ( long ) { long s = org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . getState ( address ) ; boolean res = ( ( s & ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . UNL_MASK ) ) == 0 ) && ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . compareAndSetState ( address , s , ( s + ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . EXL_MASK ) ) ) ) ; org . neo4j . unsafe . impl . internal . dragons . UnsafeUtil . storeFence ( ) ; return res ; }
org . junit . Assert . assertFalse ( pageList . tryExclusiveLock ( pageRef ) )
testMaakInitieelBerichtResultaatGroepBericht ( ) { final nl . bzk . brp . model . bericht . ber . BerichtResultaatGroepBericht resultaatGroepBericht = antwoordBerichtFactory . maakInitieelBerichtResultaatGroepBericht ( null , null ) ; "<AssertPlaceHolder>" ; } maakInitieelBerichtResultaatGroepBericht ( nl . bzk . brp . model . logisch . ber . Bericht , nl . bzk . brp . webservice . business . stappen . BerichtVerwerkingsResultaat ) { return new nl . bzk . brp . model . bericht . ber . BerichtResultaatGroepBericht ( ) ; }
org . junit . Assert . assertNotNull ( resultaatGroepBericht )
testInsertDataToDefaultGraph ( ) { java . lang . String queryStr = "PREFIX<sp>dc:<sp><http://purl.org/dc/elements/1.1/><sp>INSERT<sp>DATA<sp>{<sp>\n" + "<http://example/book1><sp>dc:title<sp>\"A<sp>new<sp>book\"<sp>;<sp>dc:creator<sp>\"A.N.Other\"<sp>.<sp>}" ; org . apache . clerezza . rdf . core . sparql . SparqlPreParser parser ; parser = new org . apache . clerezza . rdf . core . sparql . SparqlPreParser ( org . apache . clerezza . rdf . core . access . TcManager . getInstance ( ) ) ; java . util . Set < org . apache . clerezza . commons . rdf . IRI > referredGraphs = parser . getReferredGraphs ( queryStr , org . apache . clerezza . rdf . core . sparql . SparqlPreParserTest . DEFAULT_GRAPH ) ; "<AssertPlaceHolder>" ; } toArray ( ) { java . lang . Object [ ] result = base . toArray ( ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { org . apache . clerezza . commons . rdf . Triple triple = ( ( org . apache . clerezza . commons . rdf . Triple ) ( result [ i ] ) ) ; result [ i ] = toTargetTriple ( triple ) ; } return result ; }
org . junit . Assert . assertTrue ( referredGraphs . toArray ( ) [ 0 ] . equals ( org . apache . clerezza . rdf . core . sparql . SparqlPreParserTest . DEFAULT_GRAPH ) )
testVer ( ) { log . debug ( "Debiera<sp>mostrar<sp>paquetes" ) ; mx . edu . um . mateo . general . model . Usuario usuario = obtieneUsuario ( ) ; mx . edu . um . mateo . inscripciones . model . Paquete paquete = new mx . edu . um . mateo . inscripciones . model . Paquete ( ) ; paquete . setAcfe ( "a" ) ; paquete . setDescripcion ( "test" ) ; paquete . setEmpresa ( usuario . getEmpresa ( ) ) ; paquete . setEnsenanza ( new java . math . BigDecimal ( "80" ) ) ; paquete . setInternado ( new java . math . BigDecimal ( "80" ) ) ; paquete . setMatricula ( new java . math . BigDecimal ( "80" ) ) ; paquete . setNombre ( "test" ) ; currentSession ( ) . save ( paquete ) ; "<AssertPlaceHolder>" ; this . mockMvc . perform ( get ( ( ( ( mx . edu . um . mateo . general . utils . Constantes . PATH_PAQUETE_VER ) + "/" ) + ( paquete . getId ( ) ) ) ) ) . andExpect ( forwardedUrl ( ( ( "/WEB-INF/jsp/" + ( mx . edu . um . mateo . general . utils . Constantes . PATH_PAQUETE_VER ) ) + ".jsp" ) ) ) . andExpect ( model ( ) . attributeExists ( Constantes . ADDATTRIBUTE_PAQUETE ) ) ; } currentSession ( ) { return sessionFactory . getCurrentSession ( ) ; }
org . junit . Assert . assertNotNull ( paquete )
testGetServiceFormarketplace_hasOneSubscription_login_False ( ) { container . login ( org . oscm . serviceprovisioningservice . bean . ServiceProvisioningServiceBeanGetServiceIT . customerUserKey2 , org . oscm . serviceprovisioningservice . bean . ROLE_ORGANIZATION_ADMIN ) ; org . oscm . internal . vo . VOServiceEntry se = org . oscm . serviceprovisioningservice . bean . ServiceProvisioningServiceBeanGetServiceIT . sps . getServiceForMarketplace ( java . lang . Long . valueOf ( org . oscm . serviceprovisioningservice . bean . ServiceProvisioningServiceBeanGetServiceIT . serviceListSet1 . get ( 18 ) . getKey ( ) ) , "FUJITSU" , null ) ; "<AssertPlaceHolder>" ; } isSubscriptionLimitReached ( ) { return subscriptionLimitReached ; }
org . junit . Assert . assertFalse ( se . isSubscriptionLimitReached ( ) )
testGetPropertyClass_shouldReturnStringClass ( ) { pb . addProperty ( "test" , "42" ) ; "<AssertPlaceHolder>" ; } getPropertyClass ( java . lang . String ) { return properties . get ( key ) . getClass ( ) ; }
org . junit . Assert . assertTrue ( ( ( pb . getPropertyClass ( "test" ) ) == ( java . lang . String . class ) ) )
testInvite ( ) { com . riversoft . weixin . qy . contact . user . Invitation invitation = com . riversoft . weixin . qy . contact . Users . defaultUsers ( ) . invite ( "smooth" ) ; "<AssertPlaceHolder>" ; } invite ( java . lang . String ) { java . lang . String url = com . riversoft . weixin . qy . base . WxEndpoint . get ( "url.user.invite" ) ; java . lang . String json = "{\"userid\":\"%s\"}" ; com . riversoft . weixin . qy . contact . Users . logger . debug ( "invite<sp>user:<sp>{}" , java . lang . String . format ( json , uid ) ) ; try { java . lang . String response = wxClient . post ( url , java . lang . String . format ( json , uid ) ) ; java . util . Map < java . lang . String , java . lang . Object > result = com . riversoft . weixin . common . util . JsonMapper . defaultMapper ( ) . json2Map ( response ) ; if ( result . containsKey ( "type" ) ) { return com . riversoft . weixin . qy . contact . Invitation . format ( java . lang . Integer . valueOf ( result . get ( "type" ) . toString ( ) ) ) ; } else { return Invitation . FAILED ; } } catch ( java . lang . Exception e ) { if ( e instanceof com . riversoft . weixin . common . exception . WxRuntimeException ) { com . riversoft . weixin . common . exception . WxRuntimeException wxRuntimeException = ( ( com . riversoft . weixin . common . exception . WxRuntimeException ) ( e ) ) ; if ( 60119 == ( wxRuntimeException . getCode ( ) ) ) { return Invitation . ALREADY_FOLLOWED ; } if ( 45025 == ( wxRuntimeException . getCode ( ) ) ) { return Invitation . ALREADY_INVITED ; } } return Invitation . FAILED ; } }
org . junit . Assert . assertNotNull ( invitation )
testCheckByName ( ) { java . lang . String name1 = "alpha" ; java . lang . String name2 = "bravo" ; java . lang . String name3 = "charlie" ; org . oscarehr . common . model . Property property1 = new org . oscarehr . common . model . Property ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( property1 ) ; property1 . setName ( name1 ) ; dao . persist ( property1 ) ; org . oscarehr . common . model . Property property2 = new org . oscarehr . common . model . Property ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( property2 ) ; property2 . setName ( name2 ) ; dao . persist ( property2 ) ; org . oscarehr . common . model . Property property3 = new org . oscarehr . common . model . Property ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( property3 ) ; property3 . setName ( name3 ) ; dao . persist ( property3 ) ; org . oscarehr . common . model . Property expectedResult = property2 ; org . oscarehr . common . model . Property result = dao . checkByName ( name2 ) ; "<AssertPlaceHolder>" ; } checkByName ( java . lang . String ) { java . lang . String sql = ( ( ( "<sp>select<sp>x<sp>from<sp>" + ( this . modelClass . getName ( ) ) ) + "<sp>x<sp>where<sp>x.name='" ) + name ) + "'" ; javax . persistence . Query query = entityManager . createQuery ( sql ) ; try { return ( ( org . oscarehr . common . model . Property ) ( query . getSingleResult ( ) ) ) ; } catch ( javax . persistence . NoResultException ex ) { return null ; } }
org . junit . Assert . assertEquals ( expectedResult , result )
testSendNotificationWithAppKeyWithSpecialCharacter2 ( ) { int erroCode = ErrorCodeEnum . NOERROR . value ( ) ; java . lang . String msgTitle = "jpush" ; java . lang . String msgContent = "jpush@" ; cn . jpush . api . MessageResult result = jpush . sendNotificationWithAppKey ( sendNo , msgTitle , msgContent ) ; "<AssertPlaceHolder>" ; } getErrcode ( ) { return errcode ; }
org . junit . Assert . assertEquals ( erroCode , result . getErrcode ( ) )
showCarbon_ErrorMarker ( ) { org . openscience . cdk . interfaces . IAtomContainer atomContainer = super . makeCCC ( ) ; org . openscience . cdk . interfaces . IAtom carbon = atomContainer . getAtom ( 1 ) ; org . openscience . cdk . validate . ProblemMarker . markWithError ( carbon ) ; "<AssertPlaceHolder>" ; } showCarbon ( org . openscience . cdk . interfaces . IAtom , org . openscience . cdk . interfaces . IAtomContainer , org . openscience . cdk . renderer . RendererModel ) { java . lang . Integer massNumber = atom . getMassNumber ( ) ; if ( massNumber != null ) { try { java . lang . Integer expectedMassNumber = org . openscience . cdk . config . Isotopes . getInstance ( ) . getMajorIsotope ( atom . getSymbol ( ) ) . getMassNumber ( ) ; if ( ! ( massNumber . equals ( expectedMassNumber ) ) ) return true ; } catch ( java . io . IOException e ) { logger . warn ( e ) ; } } return super . showCarbon ( atom , container , model ) ; }
org . junit . Assert . assertTrue ( generator . showCarbon ( carbon , atomContainer , model ) )
test_allInValidStringBuilderCode ( ) { org . terasoluna . gfw . common . codelist . Employee e = new org . terasoluna . gfw . common . codelist . Employee ( ) ; e . gender = new java . lang . StringBuilder ( "G" ) ; e . lang = new java . lang . StringBuilder ( "FR" ) ; java . util . Set < javax . validation . ConstraintViolation < org . terasoluna . gfw . common . codelist . Employee > > result = validator . validate ( e ) ; "<AssertPlaceHolder>" ; } size ( ) { return java . lang . reflect . Array . getLength ( arrayObject ) ; }
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 2 ) )
givenGeoPointData_whenExecutedGeoBoundingBoxQuery_thenResultNonEmpty ( ) { java . lang . String jsonObject = "{\"name\":\"Pyramids<sp>of<sp>Giza\",\"location\":[31.131302,29.976480]}" ; org . elasticsearch . action . index . IndexResponse response = client . prepareIndex ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS_OF_WORLD , com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS ) . setSource ( jsonObject , XContentType . JSON ) . get ( ) ; java . lang . String pyramidsOfGizaId = response . getId ( ) ; client . admin ( ) . indices ( ) . prepareRefresh ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS_OF_WORLD ) . get ( ) ; org . elasticsearch . index . query . QueryBuilder qb = org . elasticsearch . index . query . QueryBuilders . geoBoundingBoxQuery ( "location" ) . setCorners ( 31 , 30 , 28 , 32 ) ; org . elasticsearch . action . search . SearchResponse searchResponse = client . prepareSearch ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS_OF_WORLD ) . setTypes ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS ) . setQuery ( qb ) . execute ( ) . actionGet ( ) ; java . util . List < java . lang . String > ids = java . util . Arrays . stream ( searchResponse . getHits ( ) . getHits ( ) ) . map ( SearchHit :: getId ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { if ( o instanceof java . lang . String ) { return cookieMap . containsKey ( o ) ; } if ( o instanceof javax . servlet . http . Cookie ) { return cookieMap . containsValue ( o ) ; } return false ; }
org . junit . Assert . assertTrue ( ids . contains ( pyramidsOfGizaId ) )
testMatchConnectionSameConnectioRequestInfoNotBound ( ) { javax . security . auth . Subject subject = null ; java . util . Set < org . apache . cxf . jca . core . resourceadapter . AbstractManagedConnectionImpl > connectionSet = new java . util . HashSet ( ) ; javax . resource . spi . ConnectionRequestInfo cri = new org . apache . cxf . jca . core . resourceadapter . DummyConnectionRequestInfo ( ) ; org . apache . cxf . jca . core . resourceadapter . DummyManagedConnectionImpl con1 = new org . apache . cxf . jca . core . resourceadapter . DummyManagedConnectionImpl ( mcf , cri , subject ) ; connectionSet . add ( con1 ) ; javax . resource . spi . ManagedConnection mcon = mcf . matchManagedConnections ( connectionSet , subject , cri ) ; "<AssertPlaceHolder>" ; } matchManagedConnections ( java . util . Set , javax . security . auth . Subject , javax . resource . spi . ConnectionRequestInfo ) { if ( org . apache . cxf . jca . outbound . ManagedConnectionFactoryImpl . LOG . isLoggable ( Level . FINER ) ) { org . apache . cxf . jca . outbound . ManagedConnectionFactoryImpl . LOG . finer ( ( ( ( ( ( "match<sp>connections:<sp>set=" + mcs ) + ",<sp>subject=" ) + subject ) + "<sp>reqInfo=" ) + reqInfo ) ) ; } @ org . apache . cxf . jca . outbound . SuppressWarnings ( "rawtypes" ) java . util . Iterator iter = mcs . iterator ( ) ; while ( iter . hasNext ( ) ) { java . lang . Object obj = iter . next ( ) ; if ( ! ( obj instanceof org . apache . cxf . jca . outbound . ManagedConnectionImpl ) ) { continue ; } org . apache . cxf . jca . outbound . ManagedConnectionImpl mc = ( ( org . apache . cxf . jca . outbound . ManagedConnectionImpl ) ( obj ) ) ; if ( ! ( java . util . Objects . equals ( busConfigURL , mc . getManagedConnectionFactoryImpl ( ) . getBusConfigURL ( ) ) ) ) { continue ; } if ( ! ( java . util . Objects . equals ( reqInfo , mc . getRequestInfo ( ) ) ) ) { continue ; } if ( org . apache . cxf . jca . outbound . ManagedConnectionFactoryImpl . LOG . isLoggable ( Level . FINER ) ) { org . apache . cxf . jca . outbound . ManagedConnectionFactoryImpl . LOG . finer ( ( "found<sp>matched<sp>connection<sp>" + mc ) ) ; } return mc ; } return null ; }
org . junit . Assert . assertEquals ( con1 , mcon )
testAcceptWithMatchingExclusionPattern ( ) { com . codeaffine . osgi . testuite . internal . ClassnameFilter filter = new com . codeaffine . osgi . testuite . internal . ClassnameFilter ( "!.*Foo" ) ; boolean actual = filter . accept ( "com.codeaffine.Foo" ) ; "<AssertPlaceHolder>" ; } accept ( java . lang . String ) { boolean result = false ; if ( ( ! ( matchesNegationFilters ( className ) ) ) && ( matchesPositiveFilters ( className ) ) ) { result = true ; } return result ; }
org . junit . Assert . assertFalse ( actual )
shouldAllowMultipleOrderBeforeWithoutSave ( ) { int childCount = 2 ; javax . jcr . Node parent = session . getRootNode ( ) . addNode ( "parent" , "nt:unstructured" ) ; try { for ( int i = 0 ; i < childCount ; i ++ ) { parent . addNode ( ( "Child<sp>" + i ) , "nt:unstructured" ) ; } session . save ( ) ; long childIdx = 0 ; javax . jcr . NodeIterator nodeIterator = parent . getNodes ( ) ; while ( nodeIterator . hasNext ( ) ) { parent . orderBefore ( ( "Child<sp>" + childIdx ) , "Child<sp>0" ) ; childIdx ++ ; nodeIterator . nextNode ( ) ; } session . save ( ) ; nodeIterator = parent . getNodes ( ) ; childIdx = ( nodeIterator . getSize ( ) ) - 1 ; while ( nodeIterator . hasNext ( ) ) { javax . jcr . Node child = nodeIterator . nextNode ( ) ; "<AssertPlaceHolder>" ; childIdx -- ; } } finally { parent . remove ( ) ; session . save ( ) ; } } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( ( "Child<sp>" + childIdx ) , child . getName ( ) )
failTest ( ) { net . nikr . eve . jeveasset . io . local . SettingsTest . SettingsFactoryError factoryError = new net . nikr . eve . jeveasset . io . local . SettingsTest . SettingsFactoryError ( ) ; java . net . URL resource = net . nikr . eve . jeveasset . io . local . BackwardCompatibilitySettings . class . getResource ( "/data-fail/settings.xml" ) ; java . io . File file = new java . io . File ( resource . toURI ( ) ) ; net . nikr . eve . jeveasset . io . local . BackwardCompatibilitySettings settings = ( ( net . nikr . eve . jeveasset . io . local . BackwardCompatibilitySettings ) ( net . nikr . eve . jeveasset . io . local . SettingsReader . load ( factoryError , file . getAbsolutePath ( ) ) ) ) ; "<AssertPlaceHolder>" ; testFail ( settings , Function . GET_EXPORT_SETTINGS ) ; testFail ( settings , Function . GET_FLAGS ) ; testFail ( settings , Function . GET_OVERVIEW_GROUPS ) ; testFail ( settings , Function . GET_OWNERS ) ; testFail ( settings , Function . GET_PRICE_DATA_SETTINGS ) ; testFail ( settings , Function . GET_STOCKPILES ) ; testFail ( settings , Function . GET_TABLE_COLUMNS ) ; testFail ( settings , Function . GET_TABLE_COLUMNS_WIDTH ) ; testFail ( settings , Function . GET_TABLE_FILTERS ) ; testFail ( settings , Function . GET_TABLE_RESIZE ) ; testFail ( settings , Function . GET_TABLE_VIEWS ) ; testFail ( settings , Function . GET_TAGS ) ; testFail ( settings , Function . GET_TAGS_ID ) ; testFail ( settings , Function . GET_USER_ITEM_NAMES ) ; testFail ( settings , Function . GET_USER_PRICES ) ; testFail ( settings , Function . SET_MAXIMUM_PURCHASE_AGE ) ; testFail ( settings , Function . SET_PRICE_DATA_SETTINGS ) ; testFail ( settings , Function . SET_PROXY_DATA ) ; testFail ( settings , Function . SET_REPROCESS_SETTINGS ) ; testFail ( settings , Function . SET_WINDOW_ALWAYS_ON_TOP ) ; testFail ( settings , Function . SET_WINDOW_AUTO_SAVE ) ; testFail ( settings , Function . SET_WINDOW_LOCATION ) ; testFail ( settings , Function . SET_WINDOW_MAXIMIZED ) ; testFail ( settings , Function . SET_WINDOW_SIZE ) ; } isSettingsLoadError ( ) { return settingsLoadError ; }
org . junit . Assert . assertThat ( settings . isSettingsLoadError ( ) , org . hamcrest . Matchers . equalTo ( true ) )
testStoppedContainer ( ) { java . lang . String image = "image:ver" ; com . vmware . admiral . compute . container . ContainerDescriptionService . ContainerDescription containerDesc = new com . vmware . admiral . compute . container . ContainerDescriptionService . ContainerDescription ( ) ; containerDesc . image = image ; containerDesc = doPost ( containerDesc , ContainerDescriptionService . FACTORY_LINK ) ; com . vmware . admiral . compute . container . ContainerService . ContainerState cs = new com . vmware . admiral . compute . container . ContainerService . ContainerState ( ) ; cs . id = java . util . UUID . randomUUID ( ) . toString ( ) ; cs . names = new java . util . ArrayList ( java . util . Collections . singletonList ( ( "name_" + ( cs . id ) ) ) ) ; cs . parentLink = com . vmware . admiral . compute . container . HostContainerListDataCollectionTest . COMPUTE_HOST_LINK ; cs . powerState = com . vmware . admiral . compute . container . ContainerService . ContainerState . PowerState . RUNNING ; cs . image = image ; cs . adapterManagementReference = com . vmware . xenon . common . UriUtils . buildUri ( ManagementUriParts . ADAPTER_DOCKER ) ; cs . descriptionLink = containerDesc . documentSelfLink ; cs = doPost ( cs , ContainerFactoryService . SELF_LINK ) ; addContainerToMockAdapter ( com . vmware . admiral . compute . container . HostContainerListDataCollectionTest . COMPUTE_HOST_LINK , cs . id , cs . names . get ( 0 ) , image , PowerState . STOPPED , computeState . tenantLinks ) ; startAndWaitHostContainerListDataCollection ( ) ; cs = getDocument ( com . vmware . admiral . compute . container . ContainerService . ContainerState . class , cs . documentSelfLink ) ; "<AssertPlaceHolder>" ; } getDocument ( java . lang . String , java . lang . Class ) { java . lang . String body = com . vmware . admiral . BaseIntegrationSupportIT . sendRequest ( HttpMethod . GET , seflLink , null ) ; if ( ( body == null ) || ( body . isEmpty ( ) ) ) { return null ; } return com . vmware . xenon . common . Utils . fromJson ( body , type ) ; }
org . junit . Assert . assertEquals ( PowerState . STOPPED , cs . powerState )
testBboxFilterWithEmptyAttributeName ( ) { org . opengis . filter . spatial . BBOX emptyAttNameFilter = ff . bbox ( "" , ( - 10 ) , ( - 10 ) , 10 , 10 , "EPSG:4326" ) ; java . lang . String typeName = org . geotools . arcsde . data . ArcSDEFeatureSourceTest . testData . getTempTableName ( ) ; org . geotools . data . simple . SimpleFeatureSource source ; source = org . geotools . arcsde . data . ArcSDEFeatureSourceTest . store . getFeatureSource ( typeName ) ; org . geotools . data . simple . SimpleFeatureCollection features ; features = source . getFeatures ( emptyAttNameFilter ) ; org . geotools . data . simple . SimpleFeatureIterator iterator = features . features ( ) ; try { "<AssertPlaceHolder>" ; } finally { iterator . close ( ) ; } } hasNext ( ) { if ( ( reference ) != ( modificationCount ) ) { throw new java . util . ConcurrentModificationException ( "The<sp>map<sp>entry<sp>count<sp>has<sp>been<sp>modified<sp>during<sp>the<sp>iteration" ) ; } if ( ( current ) == null ) { while ( ( ( idx ) < ( table . length ) ) && ( ( table [ idx ] ) == null ) ) { ( idx ) ++ ; } if ( ( idx ) == ( table . length ) ) { return false ; } current = table [ idx ] ; ( idx ) ++ ; } return ( current ) != null ; }
org . junit . Assert . assertTrue ( iterator . hasNext ( ) )
readData_FailedToParse ( ) { org . mockito . Mockito . when ( filereader . fileExist ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( filereader . readAllLine ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( new java . lang . String [ ] { "14141z8436.923000<sp>screen<sp>press" , "1414108436.957000<sp>screen<sp>release<sp>invalid" , "1414108436.957000<sp>screen<sp>release" , "1414108463.785000<sp>key<sp>green<sp>press<sp>invalid" , "1414108464.059000<sp>key<sp>green<sp>release<sp>invalid" } ) ; java . util . List < com . att . aro . core . peripheral . pojo . UserEvent > listUserEvent = traceDataReader . readData ( traceFolder , 0 , 0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return sessionTable . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , listUserEvent . size ( ) , 0 )
test_parse_instantZones_LDT ( java . time . format . DateTimeFormatter , java . lang . String , java . time . ZonedDateTime ) { java . time . temporal . TemporalAccessor actual = formatter . parse ( text ) ; "<AssertPlaceHolder>" ; } from ( java . time . temporal . TemporalAccessor ) { if ( temporal instanceof java . time . LocalDateTime ) { return ( ( java . time . LocalDateTime ) ( temporal ) ) ; } else if ( temporal instanceof java . time . ZonedDateTime ) { return ( ( java . time . ZonedDateTime ) ( temporal ) ) . toLocalDateTime ( ) ; } else if ( temporal instanceof java . time . OffsetDateTime ) { return ( ( java . time . OffsetDateTime ) ( temporal ) ) . toLocalDateTime ( ) ; } try { java . time . LocalDate date = java . time . LocalDate . from ( temporal ) ; java . time . LocalTime time = java . time . LocalTime . from ( temporal ) ; return new java . time . LocalDateTime ( date , time ) ; } catch ( java . time . DateTimeException ex ) { throw new java . time . DateTimeException ( ( ( ( "Unable<sp>to<sp>obtain<sp>LocalDateTime<sp>from<sp>TemporalAccessor:<sp>" + temporal ) + "<sp>of<sp>type<sp>" ) + ( temporal . getClass ( ) . getName ( ) ) ) , ex ) ; } }
org . junit . Assert . assertEquals ( java . time . LocalDateTime . from ( actual ) , expected . toLocalDateTime ( ) )
buildingFromVariableLengthByteArrayIndexedListTestLongUnsafe ( ) { final java . util . List < com . yandex . yoctodb . util . UnsignedByteArray > elements = new java . util . ArrayList ( ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 0L ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 1L ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 2L ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 3L ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 4L ) ) ; final com . yandex . yoctodb . util . buf . Buffer bb = prepareDataFromVariableLengthByteArrayIndexedLength ( elements ) ; final com . yandex . yoctodb . util . immutable . ByteArrayIndexedList list = com . yandex . yoctodb . util . immutable . impl . VariableLengthByteArrayIndexedList . from ( bb ) ; for ( int i = 0 ; i < ( elements . size ( ) ) ; i ++ ) { final long puttedValue = ( elements . get ( i ) . toByteBuffer ( ) . getLong ( ) ) ^ ( Long . MIN_VALUE ) ; "<AssertPlaceHolder>" ; } } getLongUnsafe ( int ) { assert ( 0 <= docId ) && ( docId < ( elementCount ) ) ; final long offsetIndex = ( getOffsetIndex . apply ( docId ) ) * ( Long . BYTES ) ; final long start = offsets . getLong ( offsetIndex ) ; return ( elements . getLong ( start ) ) ^ ( Long . MIN_VALUE ) ; }
org . junit . Assert . assertEquals ( puttedValue , list . getLongUnsafe ( i ) )
offerAndPollSingleValue ( ) { org . mule . runtime . core . internal . util . queue . QueueStore queue = createQueue ( ) ; queue . offer ( org . mule . tck . core . util . queue . QueueStoreTestCase . VALUE , 0 , org . mule . tck . core . util . queue . QueueStoreTestCase . OFFER_TIMEOUT ) ; java . io . Serializable result = queue . poll ( org . mule . tck . core . util . queue . QueueStoreTestCase . OFFER_TIMEOUT ) ; "<AssertPlaceHolder>" ; } poll ( long ) { return queueStore . poll ( timeout ) ; }
org . junit . Assert . assertThat ( ( ( java . lang . String ) ( result ) ) , org . hamcrest . core . Is . is ( org . mule . tck . core . util . queue . QueueStoreTestCase . VALUE ) )
qlNameEqualAndAgeEqual ( ) { java . lang . String sqlite = "SELECT<sp>*<sp>FROM<sp>users<sp>WHERE<sp>name<sp>=<sp>'askagirl'<sp>and<sp>age<sp>=<sp>16<sp>LIMIT<sp>10" ; java . lang . String api = "select<sp>*<sp>where<sp>name<sp>=<sp>'askagirl'<sp>and<sp>age<sp>=<sp>16" ; org . apache . usergrid . query . validator . QueryRequest request = new org . apache . usergrid . query . validator . QueryRequest ( ) ; request . setDbQuery ( sqlite ) ; request . getApiQuery ( ) . setQuery ( api ) ; org . apache . usergrid . query . validator . QueryResponse response = validator . execute ( request , new org . apache . usergrid . query . validator . QueryResultsMatcher ( ) { @ org . apache . usergrid . query . validator . users . Override public boolean equals ( java . util . List < org . apache . usergrid . persistence . Entity > expectedEntities , java . util . List < org . apache . usergrid . persistence . Entity > actuallyEntities ) { boolean equals = ( expectedEntities . size ( ) ) == ( expectedEntities . size ( ) ) ; if ( ! equals ) return false ; for ( org . apache . usergrid . persistence . Entity entity : actuallyEntities ) { java . lang . String name = entity . getName ( ) ; int age = ( ( java . lang . Integer ) ( entity . getProperty ( "age" ) ) ) ; if ( ( ( org . apache . usergrid . utils . StringUtils . equals ( "askagirl" , name ) ) && ( age == 16 ) ) == false ) { return false ; } } return equals ; } } ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ( serviceName ) != null ) { sb . append ( "/" ) ; sb . append ( serviceName ) ; } for ( int i = 0 ; i < ( parameters . size ( ) ) ; i ++ ) { org . apache . usergrid . services . ServiceParameter p = parameters . get ( i ) ; if ( p instanceof org . apache . usergrid . services . ServiceParameter . QueryParameter ) { if ( i == ( ( parameters . size ( ) ) - 1 ) ) { sb . append ( '?' ) ; } else { sb . append ( ';' ) ; } boolean has_prev_param = false ; java . lang . String q = p . toString ( ) ; if ( isNotBlank ( q ) ) { try { sb . append ( "ql=" ) . append ( java . net . URLEncoder . encode ( q , "UTF-8" ) ) ; } catch ( java . io . UnsupportedEncodingException e ) { org . apache . usergrid . services . ServiceRequest . logger . error ( "Unable<sp>to<sp>encode<sp>url" , e ) ; } has_prev_param = true ; } int limit = p . getQuery ( ) . getLimit ( ) ; if ( limit != ( org . apache . usergrid . persistence . Query . DEFAULT_LIMIT ) ) { if ( has_prev_param ) { sb . append ( '&' ) ; } sb . append ( "limit=" ) . append ( limit ) ; has_prev_param = true ; } if ( ( p . getQuery ( ) . getStartResult ( ) ) != null ) { if ( has_prev_param ) { sb . append ( '&' ) ; } sb . append ( "start=" ) . append ( p . getQuery ( ) . getStartResult ( ) ) ; has_prev_param = true ; } } else { sb . append ( '/' ) ; sb . append ( p . toString ( ) ) ; } } return sb . toString ( ) ; }
org . junit . Assert . assertTrue ( response . toString ( ) , response . result ( ) )
stopSession_getStopTime ( ) { target . startSession ( ) ; com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . Session originalSession = target . getSession ( ) ; target . stopSession ( ) ; "<AssertPlaceHolder>" ; } getStopTime ( ) { return this . stopTime ; }
org . junit . Assert . assertTrue ( ( ( ( java . lang . System . currentTimeMillis ( ) ) - ( originalSession . getStopTime ( ) ) ) < 100 ) )
testClass ( ) { com . gigaspaces . document . SpaceDocument doc = new com . gigaspaces . document . SpaceDocument ( "classPropertyType" ) ; doc . setProperty ( "classProperty" , com . gigaspaces . persistency . qa . model . Priority . class ) ; doc = com . gigaspaces . persistency . metadata . MongoDocumentObjectConverter . instance ( ) . toSpaceDocument ( doc ) ; com . mongodb . DBObject bson = converter . toDBObject ( doc ) ; java . lang . Object e = bson . get ( "classProperty" ) ; java . lang . Object c = converter . fromDBObject ( e ) ; "<AssertPlaceHolder>" ; } fromDBObject ( java . lang . Object ) { if ( value == null ) return null ; switch ( bsonType ( value ) ) { case com . gigaspaces . persistency . metadata . DefaultSpaceDocumentMapper . TYPE_OBJECTID : return null ; case com . gigaspaces . persistency . metadata . DefaultSpaceDocumentMapper . TYPE_ARRAY : return toExactArray ( ( ( com . mongodb . BasicDBList ) ( value ) ) ) ; case com . gigaspaces . persistency . metadata . DefaultSpaceDocumentMapper . TYPE_OBJECT : return toExactObject ( value ) ; default : return value ; } }
org . junit . Assert . assertEquals ( com . gigaspaces . persistency . qa . model . Priority . class , c )
q_compare_nonexistant_field_returns_false ( ) { com . redhat . lightblue . query . QueryExpression q = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{<sp>'$and'<sp>:<sp>[{'field':'field1','regex':'Val.*','caseInsensitive':1},{'field':'field7.5.elemf1','op':'$eq','rvalue':'x'}]}" ) ; com . redhat . lightblue . eval . QueryEvaluator qe = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( q , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext ctx = qe . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
org . junit . Assert . assertFalse ( ctx . getResult ( ) )
shouldGenerateIsNotNullPredicate ( ) { java . lang . String lhs = uniqueString ( ) ; java . lang . String actual = annis . sqlgen . SqlConstraints . isNotNull ( lhs ) ; java . lang . String expected = lhs + "<sp>IS<sp>NOT<sp>NULL" ; "<AssertPlaceHolder>" ; } isNotNull ( java . lang . String ) { return lhs + "<sp>IS<sp>NOT<sp>NULL" ; }
org . junit . Assert . assertEquals ( expected , actual )
retainsStuffThatsNotComplexOptions ( ) { java . lang . String [ ] args = new java . lang . String [ ] { "--host" , "google.com" , "notta" , "--port=8080" , "option" , "--debug=true" } ; java . lang . String [ ] notoptions = new java . lang . String [ ] { "notta" , "option" } ; com . google . devtools . common . options . Options < com . google . devtools . common . options . OptionsTest . HttpOptions > options = com . google . devtools . common . options . Options . parse ( com . google . devtools . common . options . OptionsTest . HttpOptions . class , args ) ; java . lang . String [ ] remainingArgs = options . getRemainingArgs ( ) ; "<AssertPlaceHolder>" ; } getRemainingArgs ( ) { return remainingArgs ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( notoptions ) , java . util . Arrays . asList ( remainingArgs ) )
testUpdateLogicalSwitchPortException ( ) { resource . configure ( "NiciraNvpResource" , parameters ) ; doThrow ( new com . cloud . network . nicira . NiciraNvpApiException ( ) ) . when ( nvpApi ) . updateLogicalSwitchPortAttachment ( ( ( java . lang . String ) ( any ( ) ) ) , ( ( java . lang . String ) ( any ( ) ) ) , ( ( com . cloud . network . nicira . Attachment ) ( any ( ) ) ) ) ; final com . cloud . agent . api . UpdateLogicalSwitchPortAnswer dlspa = ( ( com . cloud . agent . api . UpdateLogicalSwitchPortAnswer ) ( resource . executeRequest ( new com . cloud . agent . api . UpdateLogicalSwitchPortCommand ( "aaaa" , "bbbb" , "cccc" , "owner" , "nicname" ) ) ) ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return this . result ; }
org . junit . Assert . assertFalse ( dlspa . getResult ( ) )
deleteArchivedProcessInstanceAlsoDeleteArchivedElements ( ) { final org . bonitasoft . engine . bpm . process . ProcessDefinition processDefinition = deployProcessWithSeveralOutGoingTransitions ( ) ; processDefinitions . add ( processDefinition ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance = startAndFinishProcess ( processDefinition ) ; getProcessAPI ( ) . deleteArchivedProcessInstances ( processDefinition . getId ( ) , 0 , 50 ) ; final java . util . List < org . bonitasoft . engine . bpm . flownode . ArchivedActivityInstance > taskInstances = getProcessAPI ( ) . getArchivedActivityInstances ( processInstance . getId ( ) , 0 , 100 , ActivityInstanceCriterion . DEFAULT ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( 0 , taskInstances . size ( ) )
graph_dft_1q ( ) { java . util . List < org . apache . jena . sparql . engine . binding . Binding > results = exec ( ( ( "(graph<sp><" + ( Quad . defaultGraphIRI . getURI ( ) ) ) + "><sp>(bgp<sp>(<s2><sp>?p<sp>?o)))" ) , org . apache . jena . sparql . core . TestSpecialGraphNames . Mode . QUADS ) ; "<AssertPlaceHolder>" ; } size ( ) { return rows . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
testActionPostRequestXmlScore ( ) { java . lang . String uri = "http://some.com/xyz.svc/Customers(2)/ODataDemo.ODataDemoAction" ; odataUri = uriParser . parseUri ( uri , entityDataModel ) ; int score = unmarshaller . score ( createODataRequestContext ( createODataRequest ( com . sdl . odata . unmarshaller . atom . POST , com . sdl . odata . unmarshaller . atom . AtomActionUnmarshallerTest . CONTENT_TYPE_JSON ) , odataUri , entityDataModel ) ) ; "<AssertPlaceHolder>" ; } createODataRequest ( com . sdl . odata . api . service . ODataRequest$Method , java . util . Map ) { if ( headers == null ) { headers = new java . util . HashMap ( ) ; } return new com . sdl . odata . api . service . ODataRequest . Builder ( ) . setBodyText ( "test" , "UTF-8" ) . setUri ( com . sdl . odata . test . util . TestUtils . SERVICE_ROOT ) . setHeaders ( headers ) . setMethod ( method ) . build ( ) ; }
org . junit . Assert . assertThat ( score , org . hamcrest . CoreMatchers . is ( 0 ) )
testFloatStaxUnmarshaller ( ) { java . lang . Float data = new java . lang . Float ( 1000.0 ) ; com . amazonaws . transform . SimpleTypeStaxUnmarshallers . FloatStaxUnmarshaller unmarshaller = SimpleTypeStaxUnmarshallers . FloatStaxUnmarshaller . getInstance ( ) ; java . lang . Float unmarshalled = unmarshaller . unmarshall ( getContext ( data . toString ( ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "{" ) ; if ( ( getDomainName ( ) ) != null ) sb . append ( ( "DomainName:<sp>" + ( getDomainName ( ) ) ) ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( unmarshalled , new java . lang . Float ( 1000.0 ) )
testDownloadFile ( ) { java . lang . String fileName = ( "item." + ( org . opencb . opencga . core . common . TimeUtils . getTimeMillis ( ) ) ) + ".vcf" ; int fileSize = 200 ; byte [ ] bytesOrig = org . opencb . commons . utils . StringUtils . randomString ( fileSize ) . getBytes ( ) ; org . opencb . commons . datastore . core . QueryResult < org . opencb . opencga . core . models . File > queryResult = catalogManager . getFileManager ( ) . create ( studyFqn , File . Type . FILE , File . Format . PLAIN , File . Bioformat . NONE , ( "data/" + fileName ) , null , "description" , new org . opencb . opencga . core . models . File . FileStatus ( File . FileStatus . STAGE ) , 0 , ( - 1 ) , null , ( - 1 ) , null , null , true , null , null , sessionIdUser ) ; new org . opencb . opencga . catalog . managers . FileUtils ( catalogManager ) . upload ( new org . opencb . opencga . catalog . managers . ByteArrayInputStream ( bytesOrig ) , queryResult . first ( ) , sessionIdUser , false , false , true ) ; org . opencb . opencga . core . models . File file = catalogManager . getFileManager ( ) . get ( studyFqn , queryResult . first ( ) . getPath ( ) , null , sessionIdUser ) . first ( ) ; org . opencb . opencga . catalog . managers . DataInputStream dis = catalogManager . getFileManager ( ) . download ( studyFqn , file . getPath ( ) , ( - 1 ) , ( - 1 ) , null , sessionIdUser ) ; byte [ ] bytes = new byte [ fileSize ] ; dis . read ( bytes , 0 , fileSize ) ; "<AssertPlaceHolder>" ; } equals ( float , float ) { return ( java . lang . Math . abs ( ( second - first ) ) ) < ( org . opencb . opencga . core . common . ArrayUtils . EPSILON ) ; }
org . junit . Assert . assertTrue ( org . opencb . opencga . catalog . managers . Arrays . equals ( bytesOrig , bytes ) )
testAlignRtRowAttrs ( ) { org . batfish . question . routes . RouteRowAttribute rra1 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node1" ) . build ( ) ; org . batfish . question . routes . RouteRowAttribute rra3 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node3" ) . build ( ) ; org . batfish . question . routes . RouteRowAttribute rra5 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node5" ) . build ( ) ; org . batfish . question . routes . RouteRowAttribute rra2 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node2" ) . build ( ) ; org . batfish . question . routes . RouteRowAttribute rra4 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node4" ) . build ( ) ; java . util . List < java . util . List < org . batfish . question . routes . RouteRowAttribute > > alignedRouteRowattrs = org . batfish . question . routes . RoutesAnswererUtil . alignRouteRowAttributes ( com . google . common . collect . ImmutableList . of ( rra1 , rra3 , rra5 ) , com . google . common . collect . ImmutableList . of ( rra2 , rra4 , rra5 ) ) ; java . util . List < java . util . List < org . batfish . question . routes . RouteRowAttribute > > expectedOutput = com . google . common . collect . ImmutableList . of ( com . google . common . collect . Lists . newArrayList ( rra1 , null ) , com . google . common . collect . Lists . newArrayList ( null , rra2 ) , com . google . common . collect . Lists . newArrayList ( rra3 , null ) , com . google . common . collect . Lists . newArrayList ( null , rra4 ) , com . google . common . collect . Lists . newArrayList ( rra5 , rra5 ) ) ; "<AssertPlaceHolder>" ; } build ( ) { checkState ( ( ( _networkId ) != null ) , "Missing<sp>networkId" ) ; checkState ( ( ( _snapshotId ) != null ) , "Missing<sp>snapshotId" ) ; checkState ( ( ( _workType ) != null ) , "Missing<sp>workType" ) ; return new org . batfish . coordinator . WorkDetails ( _networkId , _snapshotId , _isDifferential , _workType , _referenceSnapshotId , _analysisId , _questionId ) ; }
org . junit . Assert . assertThat ( alignedRouteRowattrs , org . hamcrest . Matchers . equalTo ( expectedOutput ) )
testPhraseSearchForStringField ( ) { java . lang . String query = "george<sp>lin<sp>lin" ; java . util . ArrayList < java . lang . String > attributeNames = new java . util . ArrayList ( ) ; attributeNames . add ( TestConstants . FIRST_NAME ) ; attributeNames . add ( TestConstants . LAST_NAME ) ; attributeNames . add ( TestConstants . DESCRIPTION ) ; java . util . List < edu . uci . ics . texera . api . span . Span > list = new java . util . ArrayList < edu . uci . ics . texera . api . span . Span > ( ) ; edu . uci . ics . texera . api . span . Span span1 = new edu . uci . ics . texera . api . span . Span ( "firstName" , 0 , 14 , "george<sp>lin<sp>lin" , "george<sp>lin<sp>lin" ) ; list . add ( span1 ) ; edu . uci . ics . texera . api . schema . Attribute [ ] schemaAttributes = new edu . uci . ics . texera . api . schema . Attribute [ ( TestConstants . ATTRIBUTES_PEOPLE . length ) + 1 ] ; for ( int count = 0 ; count < ( ( schemaAttributes . length ) - 1 ) ; count ++ ) { schemaAttributes [ count ] = edu . uci . ics . texera . api . constants . test . TestConstants . ATTRIBUTES_PEOPLE [ count ] ; } schemaAttributes [ ( ( schemaAttributes . length ) - 1 ) ] = new edu . uci . ics . texera . api . schema . Attribute ( edu . uci . ics . texera . dataflow . keywordmatcher . KeywordPhraseTest . RESULTS , edu . uci . ics . texera . api . schema . AttributeType . LIST ) ; edu . uci . ics . texera . api . field . IField [ ] fields1 = new edu . uci . ics . texera . api . field . IField [ ] { new edu . uci . ics . texera . api . field . StringField ( "george<sp>lin<sp>lin" ) , new edu . uci . ics . texera . api . field . StringField ( "lin<sp>clooney" ) , new edu . uci . ics . texera . api . field . IntegerField ( 43 ) , new edu . uci . ics . texera . api . field . DoubleField ( 6.06 ) , new edu . uci . ics . texera . api . field . DateField ( new java . text . SimpleDateFormat ( "MM-dd-yyyy" ) . parse ( "01-13-1973" ) ) , new edu . uci . ics . texera . api . field . TextField ( "Lin<sp>Clooney<sp>is<sp>Short<sp>and<sp>lin<sp>clooney<sp>is<sp>Angry" ) , new edu . uci . ics . texera . api . field . ListField ( list ) } ; edu . uci . ics . texera . api . tuple . Tuple tuple1 = new edu . uci . ics . texera . api . tuple . Tuple ( new edu . uci . ics . texera . api . schema . Schema ( schemaAttributes ) , fields1 ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > expectedResultList = new java . util . ArrayList ( ) ; expectedResultList . add ( tuple1 ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > resultList = edu . uci . ics . texera . dataflow . keywordmatcher . KeywordTestHelper . getQueryResults ( edu . uci . ics . texera . dataflow . keywordmatcher . KeywordPhraseTest . PEOPLE_TABLE , query , attributeNames , edu . uci . ics . texera . dataflow . keywordmatcher . KeywordPhraseTest . phrase ) ; boolean contains = edu . uci . ics . texera . api . utils . TestUtils . equals ( expectedResultList , resultList ) ; "<AssertPlaceHolder>" ; } equals ( java . util . List , java . util . List ) { expectedResults = Tuple . Builder . removeIfExists ( expectedResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; exactResults = Tuple . Builder . removeIfExists ( exactResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; if ( ( expectedResults . size ( ) ) != ( exactResults . size ( ) ) ) return false ; return ( expectedResults . containsAll ( exactResults ) ) && ( exactResults . containsAll ( expectedResults ) ) ; }
org . junit . Assert . assertTrue ( contains )
testFetchResponse ( ) { org . owasp . proxy . http . client . HttpClient client = new org . owasp . proxy . http . client . HttpClient ( ) ; client . connect ( "localhost" , 9999 , false ) ; java . lang . String request = "GET<sp>/blah/blah?abc=def<sp>HTTP/1.0\r\nHost:<sp>localhost\r\n\r\n" ; client . sendRequestHeader ( request . getBytes ( ) ) ; byte [ ] header = client . getResponseHeader ( ) ; org . owasp . proxy . http . client . HttpClientTest . logger . fine ( ( "Header<sp>length:<sp>" + ( header . length ) ) ) ; int got ; int read = 0 ; byte [ ] buff = new byte [ 1024 ] ; java . io . InputStream is = client . getResponseContent ( ) ; while ( ( got = is . read ( buff ) ) > 0 ) read = read + got ; "<AssertPlaceHolder>" ; } length ( ) { return length ; }
org . junit . Assert . assertEquals ( request . length ( ) , read )
testBoundsWithTranform ( ) { org . geotools . data . simple . SimpleFeatureSource transformed = transformWithExpressions ( ) ; "<AssertPlaceHolder>" ; } getBounds ( ) { return org . geotools . data . DataUtilities . bounds ( this ) ; }
org . junit . Assert . assertNull ( transformed . getBounds ( ) )
testAddGlobal_shouldAddGlobal ( ) { ruleManager . addGlobal ( "java.util.Random" , "bla" ) ; ruleManager . add ( new org . openengsb . core . workflow . api . model . RuleBaseElementId ( org . openengsb . core . workflow . api . model . RuleBaseElementType . Rule , "bla" ) , "when\n<sp>then<sp>example2.doSomethingWithMessage(\"\"<sp>+<sp>bla.nextInt());" ) ; createSession ( ) ; session . setGlobal ( "bla" , new java . util . Random ( ) ) ; sendEventToSession ( ) ; "<AssertPlaceHolder>" ; } haveRulesFired ( java . lang . String [ ] ) { return rulesFired . containsAll ( java . util . Arrays . asList ( names ) ) ; }
org . junit . Assert . assertTrue ( listener . haveRulesFired ( "bla" ) )
testGetNotificationToken ( ) { java . lang . String accessToken = oauthHelper . getClientCredentialsAccessToken ( client1ClientId , client1ClientSecret , ScopePathType . PREMIUM_NOTIFICATION ) ; "<AssertPlaceHolder>" ; } getClientCredentialsAccessToken ( java . lang . String , java . lang . String , org . orcid . jaxb . model . message . ScopePathType ) { return getClientCredentialsAccessToken ( clientId , clientSecret , scope , APIRequestType . MEMBER ) ; }
org . junit . Assert . assertNotNull ( accessToken )
testShowErrorAndRejectWithRejection ( ) { generalSettingsPresenter . showErrorAndReject ( "Test<sp>message" ) . then ( ( i ) -> { org . junit . Assert . fail ( "Promise<sp>should've<sp>not<sp>been<sp>resolved!" ) ; return promises . resolve ( ) ; } ) . catch_ ( ( e ) -> { verify ( view ) . showError ( eq ( "Test<sp>message" ) ) ; "<AssertPlaceHolder>" ; return promises . resolve ( ) ; } ) ; } showError ( java . lang . String ) { this . errorMessage . setTextContent ( errorMessage ) ; this . error . setHidden ( false ) ; }
org . junit . Assert . assertEquals ( e , generalSettingsPresenter )
setVisibility ( ) { org . phenotips . data . Patient p = mock ( org . phenotips . data . Patient . class ) ; org . phenotips . data . permissions . internal . EntityAccessHelper h = mock ( org . phenotips . data . permissions . internal . EntityAccessHelper . class ) ; org . phenotips . data . permissions . internal . EntityAccessManager am = mock ( org . phenotips . data . permissions . internal . EntityAccessManager . class ) ; org . phenotips . data . permissions . internal . EntityVisibilityManager vm = mock ( org . phenotips . data . permissions . internal . EntityVisibilityManager . class ) ; org . phenotips . data . permissions . PatientAccess pa = new org . phenotips . data . permissions . internal . DefaultPatientAccess ( p , h , am , vm ) ; org . phenotips . data . permissions . Visibility v = mock ( org . phenotips . data . permissions . Visibility . class ) ; when ( vm . setVisibility ( p , v ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } setVisibility ( org . phenotips . data . permissions . Visibility ) { return this . visibilityManager . setVisibility ( this . entity , newVisibility ) ; }
org . junit . Assert . assertTrue ( pa . setVisibility ( v ) )
testCustomColors2 ( ) { final java . lang . String restPath = ( ( ( ( org . geoserver . rest . RestBaseController . ROOT_PATH ) + "/sldservice/cite:ClassificationPoints/" ) + ( getServiceUrl ( ) ) ) + ".xml?" ) + "attribute=foo&intervals=2&ramp=custom&colors=#FF0000,#00FF00,#0000FF" ; org . springframework . mock . web . MockHttpServletResponse response = getAsServletResponse ( restPath ) ; "<AssertPlaceHolder>" ; org . w3c . dom . Document dom = getAsDOM ( restPath , 200 ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; print ( dom , baos ) ; java . lang . String resultXml = baos . toString ( ) . replace ( "\r" , "" ) . replace ( "\n" , "" ) ; org . geotools . styling . Rule [ ] rules = checkRules ( resultXml . replace ( "<Rules>" , org . geoserver . sldservice . rest . ClassifierTest . sldPrefix ) . replace ( "</Rules>" , org . geoserver . sldservice . rest . ClassifierTest . sldPostfix ) , 2 ) ; checkRule ( rules [ 0 ] , "#FF0000" , org . opengis . filter . And . class ) ; checkRule ( rules [ 1 ] , "#00FF00" , org . opengis . filter . And . class ) ; } getStatus ( ) { return status ; }
org . junit . Assert . assertTrue ( ( ( response . getStatus ( ) ) == 200 ) )
testFullResMetricVarianceForOneSample ( ) { variance . handleFullResMetric ( 3.14 ) ; "<AssertPlaceHolder>" ; } toDouble ( ) { return this . doubleValue ; }
org . junit . Assert . assertEquals ( 0.0 , variance . toDouble ( ) , 0 )
testCreateInstance ( ) { com . netsuite . webservices . test . lists . accounting . Account instance = org . talend . components . netsuite . client . model . TypeUtils . createInstance ( com . netsuite . webservices . test . lists . accounting . Account . class ) ; "<AssertPlaceHolder>" ; } createInstance ( java . lang . Class ) { try { T target = clazz . cast ( clazz . newInstance ( ) ) ; return target ; } catch ( java . lang . IllegalAccessException | java . lang . InstantiationException e ) { throw new org . talend . components . netsuite . client . NetSuiteException ( ( "Failed<sp>to<sp>instantiate<sp>object:<sp>" + clazz ) , e ) ; } }
org . junit . Assert . assertNotNull ( instance )
testParseCount ( ) { java . lang . String json = "{\"kind\":<sp>\"Listing\",<sp>\"data\":<sp>{\"modhash\":<sp>\"\",<sp>\"children\":<sp>[1,2,3],<sp>\"after\":<sp>null,<sp>\"before\":<sp>null}}" ; com . headissue . sharecount . provider . ShareCountProvider p = new com . headissue . sharecount . provider . Reddit ( ) ; int count = p . parseCount ( json ) ; "<AssertPlaceHolder>" ; } parseCount ( java . lang . String ) { java . util . regex . Pattern p = java . util . regex . Pattern . compile ( "\\{.*\\}" ) ; java . util . regex . Matcher m = p . matcher ( json ) ; if ( m . find ( ) ) { org . json . JSONObject o = new org . json . JSONObject ( m . group ( 0 ) ) ; return o . getInt ( "count" ) ; } return 0 ; }
org . junit . Assert . assertEquals ( 3 , count )
getLinkTypeSLL ( ) { "<AssertPlaceHolder>" ; } getLinkType ( long ) { switch ( ( ( int ) ( linkTypeVal ) ) ) { case 0 : return net . ripe . hadoop . pcap . PcapReader . LinkType . NULL ; case 1 : return net . ripe . hadoop . pcap . PcapReader . LinkType . EN10MB ; case 101 : return net . ripe . hadoop . pcap . PcapReader . LinkType . RAW ; case 108 : return net . ripe . hadoop . pcap . PcapReader . LinkType . LOOP ; case 113 : return net . ripe . hadoop . pcap . PcapReader . LinkType . LINUX_SLL ; } return null ; }
org . junit . Assert . assertEquals ( PcapReader . LinkType . LINUX_SLL , reader . getLinkType ( 113 ) )
getUser ( ) { java . util . List < com . behase . relumin . model . LoginUser > users = com . google . common . collect . Lists . newArrayList ( new com . behase . relumin . model . LoginUser ( "username1" , "displayName1" , "rawPassword" , Role . VIEWER . getAuthority ( ) ) , new com . behase . relumin . model . LoginUser ( "username2" , "displayName2" , "rawPassword" , Role . VIEWER . getAuthority ( ) ) , new com . behase . relumin . model . LoginUser ( "username3" , "displayName3" , "rawPassword" , Role . VIEWER . getAuthority ( ) ) ) ; doReturn ( users ) . when ( service ) . getUsers ( ) ; com . behase . relumin . model . LoginUser result = service . getUser ( "username2" ) ; log . info ( "result={}" , result ) ; "<AssertPlaceHolder>" ; } getUser ( java . lang . String ) { java . util . List < com . behase . relumin . model . LoginUser > users = getUsers ( ) ; if ( users == null ) { return null ; } return users . stream ( ) . filter ( ( v ) -> org . apache . commons . lang3 . StringUtils . equalsIgnoreCase ( username , v . getUsername ( ) ) ) . findFirst ( ) . orElse ( null ) ; }
org . junit . Assert . assertThat ( result . getUsername ( ) , org . hamcrest . core . Is . is ( "username2" ) )
testImpalaDistribution_MapR ( ) { org . talend . hadoop . distribution . model . DistributionBean distribution = HadoopDistributionsHelper . IMPALA . getDistribution ( IMapRDistribution . DISTRIBUTION_NAME , false ) ; "<AssertPlaceHolder>" ; java . lang . String [ ] versionsDisplay = distribution . getVersionsDisplay ( ) ; java . util . List < java . lang . String > versions = java . util . Arrays . asList ( versionsDisplay ) ; java . lang . String message = "Should<sp>contain<sp>the<sp>version" ; arrayContain ( versions , "MapR<sp>5.1.0(YARN<sp>mode)" , message ) ; } getDistribution ( java . lang . String , boolean ) { if ( name != null ) { for ( org . talend . hadoop . distribution . model . DistributionBean bean : getDistributions ( ) ) { if ( byDisplay ) { if ( name . equals ( bean . displayName ) ) { return bean ; } } else if ( name . equals ( bean . name ) ) { return bean ; } } } return null ; }
org . junit . Assert . assertNotNull ( distribution )
testNot1 ( ) { org . nd4j . linalg . api . ndarray . INDArray x = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0 , 0 , 1 , 0 , 0 } ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 1 , 0 , 1 , 1 } ) ; org . nd4j . linalg . api . ndarray . INDArray z = org . nd4j . linalg . ops . transforms . Transforms . not ( x ) ; "<AssertPlaceHolder>" ; } not ( org . nd4j . linalg . api . ndarray . INDArray ) { org . nd4j . linalg . api . ndarray . INDArray z = org . nd4j . linalg . factory . Nd4j . createUninitialized ( x . shape ( ) , x . ordering ( ) ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . ops . transforms . Not ( x , z , 0.0 ) ) ; return z ; }
org . junit . Assert . assertEquals ( exp , z )
testGetComplexProvider2 ( ) { org . apache . cxf . jaxrs . provider . ServerProviderFactory pf = org . apache . cxf . jaxrs . provider . ServerProviderFactory . getInstance ( ) ; pf . registerUserProvider ( new org . apache . cxf . jaxrs . provider . ProviderFactoryTest . ComplexMessageBodyReader ( ) ) ; javax . ws . rs . ext . MessageBodyReader < org . apache . cxf . jaxrs . resources . Book > reader = pf . createMessageBodyReader ( org . apache . cxf . jaxrs . resources . Book . class , org . apache . cxf . jaxrs . resources . Book . class , null , MediaType . APPLICATION_JSON_TYPE , new org . apache . cxf . message . MessageImpl ( ) ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { return org . apache . cxf . jaxrs . provider . ServerProviderFactory . createInstance ( null ) ; }
org . junit . Assert . assertTrue ( ( ( org . apache . cxf . jaxrs . provider . ProviderFactoryTest . ComplexMessageBodyReader . class ) == ( reader . getClass ( ) ) ) )
selectCellPointCoordinateOutsideGridBounds ( ) { cellSelectionManager . selectCell ( new com . ait . lienzo . client . core . types . Point2D ( ( - 10 ) , ( - 10 ) ) , false , false ) ; final java . util . List < org . uberfire . ext . wires . core . grids . client . model . GridData . SelectedCell > selectedCells = gridWidgetData . getSelectedCells ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return dependencies . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( selectedCells . isEmpty ( ) )
addAsContactPersonsToCampaign_NullDefaultAddressType_NonExistingBill_NotMandatoryLocation ( ) { final de . metas . interfaces . I_C_BPartner partner1 = createBPartner ( "Partner1" ) ; createBPartnerLocation ( partner1 ) ; final de . metas . bpartner . BPartnerId bpartnerId = de . metas . bpartner . BPartnerId . ofRepoId ( partner1 . getC_BPartner_ID ( ) ) ; final java . util . stream . Stream < org . adempiere . user . User > users = java . util . Collections . singletonList ( createUserForPartner ( "User1" , "testmail@testmail.testmail" , bpartnerId ) ) . stream ( ) ; final de . metas . marketing . base . model . I_MKTG_Platform platform = createPlatform ( ) ; platform . setIsRequiredLocation ( false ) ; save ( platform ) ; final de . metas . marketing . base . model . I_MKTG_Campaign campaignRecord = createCampaign ( platform ) ; final de . metas . marketing . base . model . CampaignId campaignId = de . metas . marketing . base . model . CampaignId . ofRepoId ( campaignRecord . getMKTG_Campaign_ID ( ) ) ; final de . metas . marketing . base . bpartner . DefaultAddressType defaultAddressType = null ; campaignService . addAsContactPersonsToCampaign ( users , campaignId , defaultAddressType ) ; final java . util . List < de . metas . marketing . base . model . I_MKTG_ContactPerson > existingContactPersons = retrieveExistingContactPersons ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return getMap ( ) . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( existingContactPersons . size ( ) ) == 1 ) )
test_whitelabel_ips__id__get ( ) { com . sendgrid . SendGrid sg = new com . sendgrid . SendGrid ( "SENDGRID_API_KEY" , true ) ; sg . setHost ( "localhost:4010" ) ; sg . addRequestHeader ( "X-Mock" , "200" ) ; com . sendgrid . Request request = new com . sendgrid . Request ( ) ; request . setMethod ( Method . GET ) ; request . setEndpoint ( "whitelabel/ips/{id}" ) ; com . sendgrid . Response response = sg . api ( request ) ; "<AssertPlaceHolder>" ; } api ( com . sendgrid . Request ) { com . sendgrid . Request req = new com . sendgrid . Request ( ) ; req . setMethod ( request . getMethod ( ) ) ; req . setBaseUri ( this . host ) ; req . setEndpoint ( ( ( ( "/" + ( version ) ) + "/" ) + ( request . getEndpoint ( ) ) ) ) ; req . setBody ( request . getBody ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > header : this . requestHeaders . entrySet ( ) ) { req . addHeader ( header . getKey ( ) , header . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . String > queryParam : request . getQueryParams ( ) . entrySet ( ) ) { req . addQueryParam ( queryParam . getKey ( ) , queryParam . getValue ( ) ) ; } return makeCall ( req ) ; }
org . junit . Assert . assertEquals ( 200 , response . getStatusCode ( ) )
createClaimId ( ) { java . lang . String claimId = gov . uspto . patent . ReferenceTagger . createClaimId ( "claim<sp>1" ) ; java . lang . String expect = "CLM-0001" ; "<AssertPlaceHolder>" ; } createClaimId ( java . lang . String ) { java . util . regex . Matcher clmMatcher = gov . uspto . patent . ReferenceTagger . CLAIM_REF . matcher ( text ) ; java . lang . StringBuilder stb = new java . lang . StringBuilder ( ) ; if ( clmMatcher . matches ( ) ) { stb . append ( "CLM-" ) ; stb . append ( com . google . common . base . Strings . padStart ( clmMatcher . group ( 2 ) , 4 , '0' ) ) ; } return stb . toString ( ) ; }
org . junit . Assert . assertEquals ( expect , claimId )
testShow ( ) { opennlp . tools . parser . Parse p1 = opennlp . tools . parser . Parse . parseParse ( opennlp . tools . parser . ParseTest . PARSE_STRING ) ; java . lang . StringBuffer parseString = new java . lang . StringBuffer ( ) ; p1 . show ( parseString ) ; opennlp . tools . parser . Parse p2 = opennlp . tools . parser . Parse . parseParse ( parseString . toString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sentence = new java . lang . StringBuilder ( ) ; int lastEndIndex = - 1 ; for ( opennlp . tools . util . Span token : tokenSpans ) { if ( lastEndIndex != ( - 1 ) ) { java . lang . String separator ; if ( lastEndIndex == ( token . getStart ( ) ) ) separator = opennlp . tools . tokenize . TokenSample . separatorChars ; else separator = "<sp>" ; sentence . append ( separator ) ; } sentence . append ( token . getCoveredText ( text ) ) ; lastEndIndex = token . getEnd ( ) ; } return sentence . toString ( ) ; }
org . junit . Assert . assertEquals ( p1 , p2 )
testNonExistentField ( ) { final java . lang . Object [ ] objArray = new java . lang . Object [ 1 ] ; final org . drools . core . util . asm . TestBean obj = new org . drools . core . util . asm . TestBean ( ) ; obj . setBlah ( false ) ; obj . setSomething ( "no" ) ; obj . setObjArray ( objArray ) ; org . drools . core . base . ClassFieldReader ext = store . getReader ( org . drools . core . util . asm . TestBean . class , "xyz" ) ; "<AssertPlaceHolder>" ; } getReader ( java . lang . String , java . lang . Class ) { return new java . io . InputStreamReader ( clazz . getResourceAsStream ( resourceFileName ) ) ; }
org . junit . Assert . assertNull ( ext )
testClaimsSubclass ( ) { com . vmware . xenon . common . jwt . TestEndToEnd . CustomClaims in = new com . vmware . xenon . common . jwt . TestEndToEnd . CustomClaims ( ) ; in . customProperty = "hello<sp>world" ; java . lang . String jwt = this . signer . sign ( in ) ; com . vmware . xenon . common . jwt . TestEndToEnd . CustomClaims out = this . verifier . verify ( jwt , com . vmware . xenon . common . jwt . TestEndToEnd . CustomClaims . class ) ; "<AssertPlaceHolder>" ; } verify ( java . lang . String , java . lang . Class ) { int headerIndex = jwt . indexOf ( Constants . JWT_SEPARATOR , 0 ) ; if ( ( headerIndex == ( - 1 ) ) || ( headerIndex == 0 ) ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( "Separator<sp>for<sp>header<sp>not<sp>found" ) ; } int payloadIndex = jwt . indexOf ( Constants . JWT_SEPARATOR , ( headerIndex + 1 ) ) ; if ( ( payloadIndex == ( - 1 ) ) || ( payloadIndex == ( headerIndex + 1 ) ) ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( "Separator<sp>for<sp>payload<sp>not<sp>found" ) ; } java . lang . String encodedHeader = jwt . substring ( 0 , headerIndex ) ; java . lang . String encodedPayload = jwt . substring ( ( headerIndex + 1 ) , payloadIndex ) ; java . lang . String encodedSignature = jwt . substring ( ( payloadIndex + 1 ) ) ; com . vmware . xenon . common . jwt . Header header ; try { header = decode ( encodedHeader , com . vmware . xenon . common . jwt . Header . class ) ; } catch ( com . google . gson . JsonSyntaxException ex ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( java . lang . String . format ( "Invalid<sp>header<sp>JSON:<sp>%s" , ex . getMessage ( ) ) ) ; } if ( header == null ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( "Invalid<sp>header:<sp>null" ) ; } if ( ( header . type ) == null ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( "Invalid<sp>header:<sp>no<sp>type" ) ; } if ( ! ( header . type . equals ( Constants . JWT_TYPE ) ) ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( java . lang . String . format ( "Header<sp>type:<sp>%s" , header . type ) ) ; } com . vmware . xenon . common . jwt . Algorithm algorithm ; try { algorithm = com . vmware . xenon . common . jwt . Algorithm . fromString ( header . algorithm ) ; } catch ( com . vmware . xenon . common . jwt . Algorithm ex ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( ex . getMessage ( ) ) ; } byte [ ] bytesToSign = jwt . substring ( 0 , payloadIndex ) . getBytes ( Constants . DEFAULT_CHARSET ) ; byte [ ] expectedSignature = algorithm . sign ( bytesToSign , this . secret ) ; byte [ ] actualSignature = decode ( encodedSignature ) ; if ( ! ( java . security . MessageDigest . isEqual ( expectedSignature , actualSignature ) ) ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidSignatureException ( "Signature<sp>does<sp>not<sp>match" ) ; } T payload ; try { payload = decode ( encodedPayload , klass ) ; } catch ( com . google . gson . JsonSyntaxException ex ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( java . lang . String . format ( "Invalid<sp>payload<sp>JSON:<sp>%s" , ex . getMessage ( ) ) ) ; } if ( payload == null ) { throw new com . vmware . xenon . common . jwt . Verifier . InvalidTokenException ( "Invalid<sp>payload:<sp>null" ) ; } return payload ; }
org . junit . Assert . assertEquals ( in . customProperty , out . customProperty )
getFirstChildElement_no_children ( ) { org . w3c . dom . Document document = ezvcard . util . XmlUtils . toDocument ( xml ) ; org . w3c . dom . Element root = ( ( org . w3c . dom . Element ) ( document . getFirstChild ( ) ) ) ; org . w3c . dom . Element child1 = ezvcard . util . XmlUtils . getFirstChildElement ( root ) ; "<AssertPlaceHolder>" ; } getFirstChildElement ( org . w3c . dom . Element ) { return ezvcard . util . XmlUtils . getFirstChildElement ( ( ( org . w3c . dom . Node ) ( parent ) ) ) ; }
org . junit . Assert . assertNull ( ezvcard . util . XmlUtils . getFirstChildElement ( child1 ) )
testMultipleErrors ( ) { java . util . Set < javax . validation . ConstraintViolation < com . cloudera . csd . descriptors . ServiceDescriptor > > violations = violations ( "service_multipleErrors.sdl" ) ; "<AssertPlaceHolder>" ; } violations ( java . lang . String ) { return validator . getViolations ( com . cloudera . parcel . validation . ParcelTestUtils . getParserJson ( path ) ) ; }
org . junit . Assert . assertEquals ( 2 , violations . size ( ) )
stopSession_sessionIsPaused_stateChangedToInactive ( ) { target . startSession ( ) ; target . pauseSession ( ) ; target . stopSession ( ) ; "<AssertPlaceHolder>" ; } getSessionState ( ) { if ( ( this . session ) != null ) { return this . session . isPaused ( ) ? com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . client . DefaultSessionClient . SessionState . PAUSED : com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . client . DefaultSessionClient . SessionState . ACTIVE ; } return com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . client . DefaultSessionClient . SessionState . INACTIVE ; }
org . junit . Assert . assertEquals ( target . getSessionState ( ) , DefaultSessionClient . SessionState . INACTIVE )
testGetIsArray ( ) { com . eclipsesource . v8 . V8Array array = v8 . executeArrayScript ( "foo<sp>=<sp>[[]]" ) ; java . lang . Object result = array . get ( 0 ) ; "<AssertPlaceHolder>" ; array . close ( ) ; ( ( com . eclipsesource . v8 . Releasable ) ( result ) ) . release ( ) ; } get ( byte [ ] ) { v8 . checkThread ( ) ; checkReleased ( ) ; byteBuffer . get ( dst ) ; return this ; }
org . junit . Assert . assertTrue ( ( result instanceof com . eclipsesource . v8 . V8Array ) )
shouldAddToCache ( ) { cache . put ( "key" , 1 ) ; "<AssertPlaceHolder>" ; } size ( ) { return cache . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , cache . size ( ) )
testFileEntryDeleteShouldIgnoreErorsIfFileDoesNotExist ( ) { com . liferay . portal . kernel . repository . model . FileEntry fileEntry = _addPortletFileEntry ( com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) ) ; com . liferay . portal . kernel . portletfilerepository . PortletFileRepositoryUtil . deletePortletFileEntry ( fileEntry . getFileEntryId ( ) ) ; com . liferay . portal . kernel . portletfilerepository . PortletFileRepositoryUtil . deletePortletFileEntry ( fileEntry . getFileEntryId ( ) ) ; int count = com . liferay . portal . kernel . portletfilerepository . PortletFileRepositoryUtil . getPortletFileEntriesCount ( _group . getGroupId ( ) , _folder . getFolderId ( ) ) ; "<AssertPlaceHolder>" ; } getFolderId ( ) { return model . getFolderId ( ) ; }
org . junit . Assert . assertEquals ( 0 , count )
testConstructor ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( field )
testSize ( ) { org . pb . x12 . Segment s = new org . pb . x12 . Segment ( new org . pb . x12 . Context ( '~' , '*' , ':' ) ) ; s . addElements ( "ISA" , "ISA01" , "ISA02" , "ISA03" , "ISA04" ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; size = this . segments . size ( ) ; for ( org . pb . x12 . Loop l : this . childList ( ) ) { size += l . size ( ) ; } return size ; }
org . junit . Assert . assertEquals ( new java . lang . Integer ( 5 ) , new java . lang . Integer ( s . size ( ) ) )
testValidKubernetesResources ( ) { java . net . URL fileUrl = io . fabric8 . maven . core . util . ResourceValidatorTest . class . getResource ( "/validations/kubernetes-deploy.yml" ) ; io . fabric8 . maven . core . util . validator . ResourceValidator resourceValidator = new io . fabric8 . maven . core . util . validator . ResourceValidator ( java . nio . file . Paths . get ( fileUrl . toURI ( ) ) . toFile ( ) , ResourceClassifier . KUBERNETES , logger ) ; int validResources = resourceValidator . validate ( ) ; "<AssertPlaceHolder>" ; } validate ( ) { for ( java . io . File resource : resources ) { if ( ( resource . isFile ( ) ) && ( resource . exists ( ) ) ) { try { log . info ( "validating<sp>%s<sp>resource" , resource . toString ( ) ) ; com . fasterxml . jackson . databind . JsonNode inputSpecNode = geFileContent ( resource ) ; java . lang . String kind = inputSpecNode . get ( "kind" ) . toString ( ) ; com . networknt . schema . JsonSchema schema = getJsonSchema ( prepareSchemaUrl ( io . fabric8 . maven . core . util . validator . ResourceValidator . SCHEMA_JSON ) , kind ) ; java . util . Set < com . networknt . schema . ValidationMessage > errors = schema . validate ( inputSpecNode ) ; processErrors ( errors , resource ) ; } catch ( java . net . URISyntaxException e ) { throw new java . io . IOException ( e ) ; } } } return resources . length ; }
org . junit . Assert . assertEquals ( 1 , validResources )
testGetRemotePartitionFilePaths ( ) { com . liveramp . hank . storage . curly . CurlyUpdatePlanner updatePlanner = new com . liveramp . hank . storage . curly . CurlyUpdatePlanner ( domain ) ; java . util . List < java . lang . String > paths = updatePlanner . getRemotePartitionFilePaths ( new com . liveramp . hank . storage . incremental . IncrementalUpdatePlan ( v1 , v2 ) , new com . liveramp . hank . storage . LocalPartitionRemoteFileOps ( remotePartitionRoot , 0 ) ) ; java . util . List < java . lang . String > expectedPaths = new java . util . ArrayList < java . lang . String > ( ) ; expectedPaths . add ( getRemoteFilePath ( "0/00001.base.cueball" ) ) ; expectedPaths . add ( getRemoteFilePath ( "0/00001.base.curly" ) ) ; expectedPaths . add ( getRemoteFilePath ( "0/00002.delta.cueball" ) ) ; expectedPaths . add ( getRemoteFilePath ( "0/00002.delta.curly" ) ) ; java . util . Collections . sort ( paths ) ; java . util . Collections . sort ( expectedPaths ) ; "<AssertPlaceHolder>" ; } getRemoteFilePath ( java . lang . String ) { return ( ( remotePartitionRoot ) + "/" ) + name ; }
org . junit . Assert . assertEquals ( expectedPaths , paths )
testHasNextBeforeOpenFails ( ) { org . apache . hyracks . storage . common . IIndexAccessor accessor = createAccessor ( ) ; org . apache . hyracks . storage . common . IIndexCursor cursor = createCursor ( accessor ) ; boolean expectedExceptionThrown = false ; try { cursor . hasNext ( ) ; } catch ( java . lang . Exception e ) { expectedExceptionThrown = true ; } cursor . destroy ( ) ; destroy ( accessor ) ; "<AssertPlaceHolder>" ; } destroy ( ) { java . io . File f = dir . toFile ( ) ; org . apache . commons . io . FileUtils . deleteDirectory ( f ) ; return true ; }
org . junit . Assert . assertTrue ( expectedExceptionThrown )
testDontWrapSerializedRelayAgain ( ) { com . jakewharton . rxrelay2 . PublishRelay < java . lang . Object > s = com . jakewharton . rxrelay2 . PublishRelay . create ( ) ; com . jakewharton . rxrelay2 . Relay < java . lang . Object > s1 = s . toSerialized ( ) ; com . jakewharton . rxrelay2 . Relay < java . lang . Object > s2 = s1 . toSerialized ( ) ; "<AssertPlaceHolder>" ; } create ( ) { return new com . jakewharton . rxrelay2 . PublishRelay < T > ( ) ; }
org . junit . Assert . assertSame ( s1 , s2 )
testDOMWS ( ) { itest . common . intf . ClientIntf client = itest . CrossContribTestCase . node . getService ( itest . common . intf . ClientIntf . class , "ClientWS" ) ; "<AssertPlaceHolder>" ; client . callDOM ( ) ; } getService ( java . lang . Class , java . lang . String ) { try { return ( ( B ) ( node . getClass ( ) . getMethod ( "getService" , java . lang . Class . class , java . lang . String . class ) . invoke ( node , businessInterface , serviceName ) ) ) ; } catch ( java . lang . Throwable e ) { org . apache . tuscany . sca . node . NodeFactory . NodeProxy . handleException ( e ) ; return null ; } }
org . junit . Assert . assertNotNull ( client )
shouldMarkUnusedSteps ( ) { final java . util . UUID stepMarker = java . util . UUID . randomUUID ( ) ; final org . talend . dataprep . maintenance . preparation . StepMarker marker = new org . talend . dataprep . maintenance . preparation . PreparationStepMarker ( ) ; final org . talend . dataprep . preparation . store . PreparationRepository repository = mock ( org . talend . dataprep . preparation . store . PreparationRepository . class ) ; final org . talend . dataprep . api . preparation . Preparation preparation = new org . talend . dataprep . api . preparation . Preparation ( ) ; final org . talend . dataprep . api . preparation . Step step = mock ( org . talend . dataprep . api . preparation . Step . class ) ; when ( step . id ( ) ) . thenReturn ( "1234" ) ; when ( step . getParent ( ) ) . thenReturn ( Step . ROOT_STEP . id ( ) ) ; when ( repository . get ( eq ( "1234" ) , eq ( org . talend . dataprep . api . preparation . Step . class ) ) ) . thenReturn ( step ) ; preparation . setSteps ( java . util . Arrays . asList ( Step . ROOT_STEP , step ) ) ; when ( repository . list ( eq ( org . talend . dataprep . api . preparation . Preparation . class ) ) ) . thenReturn ( java . util . stream . Stream . of ( preparation ) ) ; final org . talend . dataprep . maintenance . preparation . StepMarker . Result result = marker . mark ( repository , stepMarker ) ; "<AssertPlaceHolder>" ; verify ( repository , times ( 1 ) ) . add ( eq ( java . util . Collections . singletonList ( step ) ) ) ; verify ( step , times ( 1 ) ) . setMarker ( eq ( stepMarker . toString ( ) ) ) ; } mark ( org . talend . dataprep . preparation . store . PreparationRepository , java . util . UUID ) { if ( repository . exist ( org . talend . dataprep . api . preparation . Preparation . class , recentlyModified ( ) ) ) { org . talend . dataprep . maintenance . preparation . PreparationStepMarker . LOGGER . info ( "Not<sp>running<sp>clean<sp>up<sp>(at<sp>least<sp>a<sp>preparation<sp>modified<sp>within<sp>last<sp>hour)." ) ; logRecentlyModified ( repository ) ; return Result . INTERRUPTED ; } final java . util . concurrent . atomic . AtomicBoolean interrupted = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; repository . list ( org . talend . dataprep . api . preparation . Preparation . class ) . filter ( ( p ) -> ! ( interrupted . get ( ) ) ) . forEach ( ( p ) -> { if ( repository . exist ( . class , recentlyModified ( ) ) ) { org . talend . dataprep . maintenance . preparation . PreparationStepMarker . LOGGER . info ( "Interrupting<sp>clean<sp>up<sp>(preparation<sp>modified<sp>within<sp>last<sp>hour)." ) ; logRecentlyModified ( repository ) ; interrupted . set ( true ) ; return ; } final Collection < org . talend . dataprep . api . preparation . Identifiable > markedSteps = p . getSteps ( ) . stream ( ) . filter ( ( s ) -> ! ( java . util . Objects . equals ( s , Step . ROOT_STEP ) ) ) . peek ( ( s ) -> s . setMarker ( marker . toString ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; repository . add ( markedSteps ) ; } ) ; return interrupted . get ( ) ? Result . INTERRUPTED : Result . COMPLETED ; }
org . junit . Assert . assertEquals ( StepMarker . Result . COMPLETED , result )
shouldConvertStringToId ( ) { org . openkilda . model . PathId pathId = new org . openkilda . model . PathId ( "test_path_id" ) ; org . openkilda . model . PathId actualEntity = new org . openkilda . persistence . converters . PathIdConverter ( ) . toEntityAttribute ( pathId . getId ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( pathId , actualEntity )
testActionInstantiationWhichFailsDueToFailedDependencies ( ) { com . picocontainer . web . webwork . TestAction action = ( ( com . picocontainer . web . webwork . TestAction ) ( factory . getActionImpl ( com . picocontainer . web . webwork . TestAction . class . getName ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertNull ( action )
testNotImplementedExceptionResourcesStringStringArray ( ) { org . support . project . common . exception . NotImplementedException exception = new org . support . project . common . exception . NotImplementedException ( org . support . project . common . config . Resources . getInstance ( java . util . Locale . getDefault ( ) ) , "errors.integer" , "AAA" ) ; org . support . project . common . config . Resources resources = org . support . project . common . config . Resources . getInstance ( java . util . Locale . getDefault ( ) ) ; "<AssertPlaceHolder>" ; } getResource ( java . lang . String , java . lang . String [ ] ) { org . support . project . common . config . Resources resources = org . support . project . common . config . Resources . getInstance ( org . support . project . web . common . HttpUtil . getLocale ( getRequest ( ) ) ) ; return resources . getResource ( key , params ) ; }
org . junit . Assert . assertEquals ( resources . getResource ( "errors.integer" , "AAA" ) , exception . getMessage ( ) )
testEvictChangedLease ( ) { software . amazon . kinesis . leases . dynamodb . TestHarnessBuilder builder = new software . amazon . kinesis . leases . dynamodb . TestHarnessBuilder ( leaseRefresher ) ; software . amazon . kinesis . leases . Lease lease = builder . withLease ( "1" ) . build ( ) . get ( "1" ) ; lease . leaseOwner ( "otherOwner" ) ; "<AssertPlaceHolder>" ; } evictLease ( software . amazon . kinesis . leases . Lease ) { log . debug ( "Evicting<sp>lease<sp>with<sp>leaseKey<sp>{}<sp>owned<sp>by<sp>{}" , lease . leaseKey ( ) , lease . leaseOwner ( ) ) ; final software . amazon . kinesis . retrieval . AWSExceptionManager exceptionManager = createExceptionManager ( ) ; exceptionManager . add ( software . amazon . awssdk . services . dynamodb . model . ConditionalCheckFailedException . class , ( t ) -> t ) ; java . util . Map < java . lang . String , software . amazon . awssdk . services . dynamodb . model . AttributeValueUpdate > updates = serializer . getDynamoLeaseCounterUpdate ( lease ) ; updates . putAll ( serializer . getDynamoEvictLeaseUpdate ( lease ) ) ; software . amazon . awssdk . services . dynamodb . model . UpdateItemRequest request = software . amazon . awssdk . services . dynamodb . model . UpdateItemRequest . builder ( ) . tableName ( table ) . key ( serializer . getDynamoHashKey ( lease ) ) . expected ( serializer . getDynamoLeaseOwnerExpectation ( lease ) ) . attributeUpdates ( updates ) . build ( ) ; try { try { software . amazon . kinesis . common . FutureUtils . resolveOrCancelFuture ( dynamoDBClient . updateItem ( request ) , dynamoDbRequestTimeout ) ; } catch ( java . util . concurrent . ExecutionException e ) { throw exceptionManager . apply ( e . getCause ( ) ) ; } catch ( java . lang . InterruptedException e ) { throw new software . amazon . kinesis . leases . exceptions . DependencyException ( e ) ; } } catch ( software . amazon . awssdk . services . dynamodb . model . ConditionalCheckFailedException e ) { log . debug ( "Lease<sp>eviction<sp>failed<sp>for<sp>lease<sp>with<sp>key<sp>{}<sp>because<sp>the<sp>lease<sp>owner<sp>was<sp>not<sp>{}" , lease . leaseKey ( ) , lease . leaseOwner ( ) ) ; return false ; } catch ( software . amazon . awssdk . services . dynamodb . model . DynamoDbException | java . util . concurrent . TimeoutException e ) { throw convertAndRethrowExceptions ( "evict" , lease . leaseKey ( ) , e ) ; } lease . leaseOwner ( null ) ; lease . leaseCounter ( ( ( lease . leaseCounter ( ) ) + 1 ) ) ; return true ; }
org . junit . Assert . assertFalse ( leaseRefresher . evictLease ( lease ) )
testLoadExistingJsonFile ( ) { org . apache . hadoop . hdfs . protocol . DatanodeAdminProperties [ ] all = org . apache . hadoop . hdfs . util . CombinedHostsFileReader . readFile ( jsonFile . getAbsolutePath ( ) ) ; "<AssertPlaceHolder>" ; } getAbsolutePath ( ) { final java . lang . String path = getValue ( ) ; return path == null ? null : "/" + path ; }
org . junit . Assert . assertEquals ( 7 , all . length )
shouldReturnTrueIfClientHasMobile ( ) { client . addPhone ( com . practicalunittesting . chp05 . mockornot . NotMockingPhone2Test . MOBILE_PHONE ) ; client . addPhone ( com . practicalunittesting . chp05 . mockornot . NotMockingPhone2Test . STATIONARY_PHONE ) ; "<AssertPlaceHolder>" ; } hasMobile ( ) { for ( com . practicalunittesting . chp05 . mockornot . Phone2 phone : phones ) { if ( phone . isMobile ( ) ) { return true ; } } return false ; }
org . junit . Assert . assertTrue ( client . hasMobile ( ) )
testCompileValidEncoding ( ) { org . eclipse . ceylon . common . tool . ToolModel < org . eclipse . ceylon . compiler . CeylonCompileTool > model = pluginLoader . loadToolModel ( "compile" ) ; "<AssertPlaceHolder>" ; org . eclipse . ceylon . compiler . CeylonCompileTool tool = pluginFactory . bindArguments ( model , getMainTool ( ) , toolOptions ( "--src=test/src" , "--encoding=UTF-8" , "org.eclipse.ceylon.tools.test.ceylon" ) ) ; }
org . junit . Assert . assertNotNull ( model )
shouldDoGetLastElementWithWindowSize ( ) { int addedElementsNumber = 10 ; int windowSize = 3 ; com . orange . dgil . trail . core . common . TrailPoint [ ] points = new com . orange . dgil . trail . core . common . TrailPoint [ windowSize ] ; com . orange . dgil . trail . TestTools . setObj ( "addedElementsNumber" , com . orange . dgil . trail . core . vecto . SlidingWindow . class , slidingWindow , addedElementsNumber ) ; com . orange . dgil . trail . TestTools . setObj ( "points" , com . orange . dgil . trail . core . vecto . SlidingWindow . class , slidingWindow , points ) ; org . mockito . Mockito . doCallRealMethod ( ) . when ( slidingWindow ) . getLastElementIndex ( ) ; int ret = slidingWindow . getLastElementIndex ( ) ; "<AssertPlaceHolder>" ; } getLastElementIndex ( ) { return java . lang . Math . min ( ( ( addedElementsNumber ) - 1 ) , ( ( points . length ) - 1 ) ) ; }
org . junit . Assert . assertEquals ( 2 , ret )
rejectKeysMultiValues ( ) { org . eclipse . collections . api . multimap . Multimap < java . lang . String , java . lang . Integer > multimap = this . newMultimapWithKeysValues ( "One" , 1 , "One" , 12 , "Two" , 2 , "Two" , 3 ) ; org . eclipse . collections . api . multimap . Multimap < java . lang . String , java . lang . Integer > rejectedMultimap = multimap . rejectKeysMultiValues ( ( key , values ) -> ( "Two" . equals ( key ) ) && ( org . eclipse . collections . impl . utility . Iterate . contains ( values , 2 ) ) ) ; "<AssertPlaceHolder>" ; } newMultimapWithKeysValues ( K , V , K , V ) { org . eclipse . collections . api . multimap . bag . MutableBagMultimap < K , V > mutableMultimap = this . newMultimap ( ) ; mutableMultimap . put ( key1 , value1 ) ; mutableMultimap . put ( key2 , value2 ) ; return mutableMultimap ; }
org . junit . Assert . assertEquals ( this . newMultimapWithKeysValues ( "One" , 1 , "One" , 12 ) , rejectedMultimap )
testCopyFormatAttributesWithCpuAsString ( ) { org . sonatype . nexus . repository . npm . internal . NpmFormatAttributesExtractor underTest = new org . sonatype . nexus . repository . npm . internal . NpmFormatAttributesExtractor ( new ImmutableMap . Builder < java . lang . String , java . lang . Object > ( ) . put ( "cpu" , "x64" ) . build ( ) ) ; underTest . copyFormatAttributes ( asset ) ; "<AssertPlaceHolder>" ; } formatAttributes ( ) { return component . formatAttributes ( ) ; }
org . junit . Assert . assertThat ( asset . formatAttributes ( ) . get ( "cpu" ) , org . hamcrest . Matchers . is ( "x64" ) )
customerAccountIsCreatedWithCustomerSchedulesWhenAssociatedCustomerIsActive ( ) { applicableCalendarEvents = new org . mifos . domain . builders . CalendarEventBuilder ( ) . build ( ) ; customerMeeting = new org . mifos . domain . builders . MeetingBuilder ( ) . customerMeeting ( ) . weekly ( ) . every ( 1 ) . build ( ) ; accountFees = new java . util . ArrayList < org . mifos . accounts . business . AccountFeesEntity > ( ) ; customer = new org . mifos . domain . builders . CenterBuilder ( ) . active ( ) . build ( ) ; customerAccount = org . mifos . customers . business . CustomerAccountBO . createNew ( customer , accountFees , customerMeeting , applicableCalendarEvents ) ; "<AssertPlaceHolder>" ; } getAccountActionDates ( ) { return accountActionDates ; }
org . junit . Assert . assertThat ( customerAccount . getAccountActionDates ( ) . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( false ) )