input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
getValueStringByKeyGoodCaseTrim ( ) { java . util . HashMap < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "key2" , "<sp>value2<sp>" ) ; java . lang . String keyName = "key2" ; java . lang . String expResult = "value2" ; java . lang . String result = com . microsoft . azure . sdk . iot . deps . util . Tools . getValueStringByKey ( map , keyName ) ; "<AssertPlaceHolder>" ; } getValueStringByKey ( java . util . Map , java . lang . String ) { java . lang . String retVal ; if ( ( map == null ) || ( keyName == null ) ) { retVal = "" ; } else { java . lang . Object val = map . get ( keyName ) ; if ( val != null ) retVal = val . toString ( ) . trim ( ) ; else retVal = "" ; } return retVal ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testSingleElementMinusDisjointSet ( ) { org . antlr . v4 . runtime . misc . IntervalSet s = org . antlr . v4 . runtime . misc . IntervalSet . of ( 15 , 15 ) ; org . antlr . v4 . runtime . misc . IntervalSet s2 = org . antlr . v4 . runtime . misc . IntervalSet . of ( 1 , 5 ) ; s2 . add ( 10 , 20 ) ; java . lang . String expecting = "{}" ; java . lang . String result = s . subtract ( s2 ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( a ) + ".." ) + ( b ) ; }
|
org . junit . Assert . assertEquals ( expecting , result )
|
testToLowerCaseConverting ( ) { eu . stratosphere . types . StringValue testString = new eu . stratosphere . types . StringValue ( "TEST" ) ; eu . stratosphere . util . SimpleStringUtils . toLowerCase ( testString ) ; "<AssertPlaceHolder>" ; } toLowerCase ( eu . stratosphere . types . StringValue ) { final char [ ] chars = string . getCharArray ( ) ; final int len = string . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { chars [ i ] = java . lang . Character . toLowerCase ( chars [ i ] ) ; } }
|
org . junit . Assert . assertEquals ( new eu . stratosphere . types . StringValue ( "test" ) , testString )
|
strokeOpacitySetWithNoneStrokeRGB ( ) { com . itextpdf . svg . renderers . impl . AbstractSvgNodeRenderer renderer = new com . itextpdf . svg . renderers . impl . CircleSvgNodeRenderer ( ) ; renderer . setAttribute ( SvgConstants . Attributes . STROKE_OPACITY , "0.75" ) ; renderer . setAttribute ( SvgConstants . Attributes . STROKE , SvgConstants . Values . NONE ) ; renderer . draw ( sdc ) ; com . itextpdf . kernel . pdf . PdfResources resources = cv . getResources ( ) ; "<AssertPlaceHolder>" ; } getResourceNames ( ) { java . util . Set < com . itextpdf . kernel . pdf . PdfName > names = new java . util . TreeSet ( ) ; for ( com . itextpdf . kernel . pdf . PdfName resType : getPdfObject ( ) . keySet ( ) ) { names . addAll ( getResourceNames ( resType ) ) ; } return names ; }
|
org . junit . Assert . assertTrue ( resources . getResourceNames ( ) . isEmpty ( ) )
|
shouldNotBeDiagnosticMode ( ) { com . oracle . bedrock . runtime . console . NullApplicationConsole console = new com . oracle . bedrock . runtime . console . NullApplicationConsole ( ) ; "<AssertPlaceHolder>" ; } isDiagnosticsEnabled ( ) { return false ; }
|
org . junit . Assert . assertThat ( console . isDiagnosticsEnabled ( ) , org . hamcrest . CoreMatchers . is ( false ) )
|
testGetAvailability ( ) { java . lang . String xml = sendRequest ( org . opennms . web . rest . v1 . GET , "/availability" , new java . util . HashMap < java . lang . String , java . lang . String > ( ) , 200 ) ; "<AssertPlaceHolder>" ; } sendRequest ( java . lang . String , java . lang . String , java . util . Map , int , java . lang . String ) { final org . springframework . mock . web . MockHttpServletRequest request = org . opennms . core . test . rest . AbstractSpringJerseyRestTestCase . createRequest ( servletContext , requestType , url , org . opennms . core . test . rest . AbstractSpringJerseyRestTestCase . getUser ( ) , org . opennms . core . test . rest . AbstractSpringJerseyRestTestCase . getUserRoles ( ) ) ; request . setCharacterEncoding ( StandardCharsets . UTF_8 . name ( ) ) ; request . setContentType ( MediaType . APPLICATION_FORM_URLENCODED ) ; request . setParameters ( parameters ) ; request . setQueryString ( org . opennms . core . test . rest . AbstractSpringJerseyRestTestCase . getQueryString ( parameters ) ) ; request . setRemoteUser ( org . opennms . core . test . rest . AbstractSpringJerseyRestTestCase . getUser ( ) ) ; return sendRequest ( request , expectedStatus , expectedUrlSuffix ) ; }
|
org . junit . Assert . assertNotNull ( xml )
|
consistencyNotBoundedShouldEraseScanWaitAndVector ( ) { com . couchbase . client . java . query . N1qlParams p = com . couchbase . client . java . query . N1qlParams . build ( ) . scanWait ( 12 , TimeUnit . SECONDS ) . consistency ( ScanConsistency . NOT_BOUNDED ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "scan_consistency" , "not_bounded" ) ; com . couchbase . client . java . document . json . JsonObject actual = com . couchbase . client . java . document . json . JsonObject . empty ( ) ; p . injectParams ( actual ) ; "<AssertPlaceHolder>" ; } injectParams ( com . couchbase . client . java . document . json . JsonObject ) { input . put ( "regexp" , regexp ) ; if ( ( field ) != null ) { input . put ( "field" , field ) ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testVelocityMerge ( ) { org . oscarehr . PMmodule . model . Program program = new org . oscarehr . PMmodule . model . Program ( ) ; program . setName ( "MyProgramName" ) ; java . lang . String notes = "some<sp>of<sp>my<sp>notes" ; java . util . Calendar startCal = new java . util . GregorianCalendar ( 2012 , 3 , 4 ) ; java . util . Calendar endCal = new java . util . GregorianCalendar ( 2012 , 3 , 5 ) ; org . oscarehr . managers . WaitListManager . AdmissionDemographicPair a1 = new org . oscarehr . managers . WaitListManager . AdmissionDemographicPair ( ) ; org . oscarehr . common . model . Demographic d1 = new org . oscarehr . common . model . Demographic ( ) ; d1 . setLastName ( "lastName1" ) ; d1 . setFirstName ( "firstName1" ) ; d1 . setSex ( "sex1" ) ; a1 . setDemographic ( d1 ) ; org . oscarehr . managers . WaitListManager . AdmissionDemographicPair a2 = new org . oscarehr . managers . WaitListManager . AdmissionDemographicPair ( ) ; org . oscarehr . common . model . Demographic d2 = new org . oscarehr . common . model . Demographic ( ) ; d2 . setLastName ( "lastName2" ) ; d2 . setFirstName ( "firstName2" ) ; d2 . setSex ( "sex2" ) ; a2 . setDemographic ( d2 ) ; java . util . ArrayList < org . oscarehr . managers . WaitListManager . AdmissionDemographicPair > admissionDemographicPairs = new java . util . ArrayList < org . oscarehr . managers . WaitListManager . AdmissionDemographicPair > ( ) ; admissionDemographicPairs . add ( a1 ) ; admissionDemographicPairs . add ( a2 ) ; org . apache . velocity . VelocityContext velocityContext = org . oscarehr . managers . WaitListManager . getAdmissionVelocityContext ( program , notes , startCal . getTime ( ) , endCal . getTime ( ) , admissionDemographicPairs ) ; java . io . InputStream is = org . oscarehr . managers . WaitListManagerTest . class . getResourceAsStream ( "/wait_list_velocity_template.txt" ) ; java . lang . String template = org . apache . commons . io . IOUtils . toString ( is ) ; java . lang . String mergedtemplate = org . oscarehr . util . VelocityUtils . velocityEvaluate ( velocityContext , template ) ; is = org . oscarehr . managers . WaitListManagerTest . class . getResourceAsStream ( "/wait_list_velocity_template_results.txt" ) ; java . lang . String expectedResults = org . apache . commons . io . IOUtils . toString ( is ) ; "<AssertPlaceHolder>" ; } getTime ( ) { return time ; }
|
org . junit . Assert . assertEquals ( expectedResults , mergedtemplate )
|
testNegativeServiceFilter ( ) { org . opennms . web . alarm . filter . AlarmCriteria criteria = getCriteria ( new org . opennms . web . alarm . filter . NegativeServiceFilter ( 12 , null ) ) ; org . opennms . netmgt . model . OnmsAlarm [ ] alarms = m_daoAlarmRepo . getMatchingAlarms ( org . opennms . web . alarm . AlarmUtil . getOnmsCriteria ( criteria ) ) ; "<AssertPlaceHolder>" ; } getOnmsCriteria ( org . opennms . web . alarm . filter . AlarmCriteria ) { final org . opennms . netmgt . model . OnmsCriteria criteria = new org . opennms . netmgt . model . OnmsCriteria ( org . opennms . netmgt . model . OnmsAlarm . class ) ; criteria . createAlias ( "node" , "node" , OnmsCriteria . LEFT_JOIN ) ; criteria . createAlias ( "distPoller" , "distPoller" , OnmsCriteria . LEFT_JOIN ) ; criteria . createAlias ( "lastEvent" , "lastEvent" , OnmsCriteria . LEFT_JOIN ) ; criteria . createAlias ( "counter" 3 , "counter" 3 , OnmsCriteria . LEFT_JOIN ) ; alarmCriteria . visit ( new org . opennms . web . alarm . filter . AlarmCriteria . AlarmCriteriaVisitor < java . lang . RuntimeException > ( ) { @ org . opennms . web . alarm . Override public void visitAckType ( org . opennms . web . alarm . AcknowledgeType ackType ) throws org . opennms . web . alarm . RuntimeException { if ( ackType == ( AcknowledgeType . ACKNOWLEDGED ) ) { criteria . add ( org . hibernate . criterion . Restrictions . isNotNull ( "alarmAckUser" ) ) ; } else if ( ackType == ( AcknowledgeType . UNACKNOWLEDGED ) ) { criteria . add ( org . hibernate . criterion . Restrictions . isNull ( "alarmAckUser" ) ) ; } } @ org . opennms . web . alarm . Override public void visitFilter ( org . opennms . web . filter . Filter filter ) throws org . opennms . web . alarm . RuntimeException { criteria . add ( filter . getCriterion ( ) ) ; } @ org . opennms . web . alarm . Override public void visitLimit ( int limit , int offset ) throws org . opennms . web . alarm . RuntimeException { criteria . setMaxResults ( limit ) ; criteria . setFirstResult ( offset ) ; } @ org . opennms . web . alarm . Override public void visitSortStyle ( org . opennms . web . alarm . SortStyle sortStyle ) throws org . opennms . web . alarm . RuntimeException { switch ( sortStyle ) { case COUNT : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "counter" ) ) ; break ; case FIRSTEVENTTIME : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "firstEventTime" ) ) ; break ; case ID : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "counter" 1 ) ) ; break ; case INTERFACE : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "counter" 0 ) ) ; break ; case LASTEVENTTIME : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "lastEventTime" ) ) ; break ; case NODE : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "node.label" ) ) ; break ; case POLLER : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "distPoller" ) ) ; break ; case SERVICE : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "serviceType.name" ) ) ; break ; case SEVERITY : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "severity" ) ) ; break ; case ACKUSER : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "alarmAckUser" ) ) ; break ; case SITUATION : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "counter" 2 ) ) ; break ; case REVERSE_COUNT : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "counter" ) ) ; break ; case REVERSE_FIRSTEVENTTIME : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "firstEventTime" ) ) ; break ; case REVERSE_ID : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "counter" 1 ) ) ; break ; case REVERSE_INTERFACE : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "counter" 0 ) ) ; break ; case REVERSE_LASTEVENTTIME : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "lastEventTime" ) ) ; break ; case REVERSE_NODE : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "node.label" ) ) ; break ; case REVERSE_POLLER : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "distPoller" ) ) ; break ; case REVERSE_SERVICE : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "serviceType.name" ) ) ; break ; case REVERSE_SEVERITY : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "severity" ) ) ; break ; case REVERSE_ACKUSER : criteria . addOrder ( org . hibernate . criterion . Order . desc ( "alarmAckUser" ) ) ; break ; case REVERSE_SITUATION : criteria . addOrder ( org . hibernate . criterion . Order . asc ( "counter" 2 ) ) ; break ; default : break ; } } } ) ; return criteria ; }
|
org . junit . Assert . assertEquals ( 1 , alarms . length )
|
AnnotationDependency ( ) { java . lang . String fromClass = "domain.direct.violating.AnnotationDependency" ; java . lang . String toClass = "technology.direct.dao.SettingsAnnotation" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Annotation" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , java . lang . String , boolean ) { boolean dependencyTypesDetected = false ; java . util . TreeMap < java . lang . String , java . lang . Boolean > foundDependencyTypes = new java . util . TreeMap < java . lang . String , java . lang . Boolean > ( ) ; husaccttest . analyse . Java_AccuracyTestDependencyDetection . analyseService = husacct . ServiceProvider . getInstance ( ) . getAnalyseService ( ) ; husacct . common . dto . DependencyDTO [ ] foundDependencies = husaccttest . analyse . Java_AccuracyTestDependencyDetection . analyseService . getDependenciesFromClassToClass ( classFrom , classTo ) ; int numberOfDependencies = foundDependencies . length ; for ( java . lang . String dependencyType : dependencyTypes ) { boolean found = false ; for ( int i = 0 ; i < numberOfDependencies ; i ++ ) { if ( ( foundDependencies [ i ] . type . equals ( dependencyType ) ) && ( ( foundDependencies [ i ] . isIndirect ) == isIndirect ) ) { if ( ! ( subType . equals ( "" ) ) ) { if ( foundDependencies [ i ] . subType . equals ( subType ) ) { found = true ; } } else { found = true ; } } } foundDependencyTypes . put ( dependencyType , found ) ; } if ( ! ( foundDependencyTypes . containsValue ( false ) ) ) { dependencyTypesDetected = true ; } return dependencyTypesDetected ; }
|
org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , "" , false ) )
|
testTileBp ( ) { org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 12345 ) ; org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . create ( 1 , 2 , 3 ) ; int [ ] tile = new int [ ] { 2 , 3 , 4 } ; int [ ] outShape = new int [ ] { 1 * 2 , 2 * 3 , 3 * 4 } ; int length = org . nd4j . linalg . util . ArrayUtil . prod ( outShape ) ; org . nd4j . linalg . api . ndarray . INDArray gradAtOut = org . nd4j . linalg . factory . Nd4j . rand ( outShape ) ; org . nd4j . linalg . api . ndarray . INDArray gradAtInExp = org . nd4j . linalg . factory . Nd4j . create ( in . shape ( ) ) ; for ( int i = 0 ; i < ( tile [ 0 ] ) ; i ++ ) { for ( int j = 0 ; j < ( tile [ 1 ] ) ; j ++ ) { for ( int k = 0 ; k < ( tile [ 2 ] ) ; k ++ ) { org . nd4j . linalg . api . ndarray . INDArray subset = gradAtOut . get ( org . nd4j . linalg . indexing . NDArrayIndex . interval ( ( i * 1 ) , ( ( i + 1 ) * 1 ) ) , org . nd4j . linalg . indexing . NDArrayIndex . interval ( ( j * 2 ) , ( ( j + 1 ) * 2 ) ) , org . nd4j . linalg . indexing . NDArrayIndex . interval ( ( k * 3 ) , ( ( k + 1 ) * 3 ) ) ) ; gradAtInExp . addi ( subset ) ; } } } org . nd4j . linalg . api . ops . DynamicCustomOp op = org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "tile_bp" ) . addInputs ( in , gradAtOut ) . addOutputs ( gradAtInExp ) . addIntegerArguments ( tile ) . build ( ) ; org . nd4j . autodiff . validation . OpTestCase otc = new org . nd4j . autodiff . validation . OpTestCase ( op ) . expectedOutput ( 0 , gradAtInExp ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( otc ) ; "<AssertPlaceHolder>" ; } validate ( org . nd4j . autodiff . validation . TestCase ) { return org . nd4j . autodiff . validation . OpValidation . validate ( testCase , false ) ; }
|
org . junit . Assert . assertNull ( err )
|
testCondParens ( ) { java . lang . String template = "<if(!(x||y)&&!z)>works<endif>" ; org . stringtemplate . v4 . ST st = new org . stringtemplate . v4 . ST ( template ) ; java . lang . String expected = "works" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testPredicateDependentOnArg2 ( ) { java . lang . String grammar = "grammar<sp>T;\n" + ( ( ( ( ( ( ( "T.g4" 4 + "T.g4" 3 ) + "<sp>:<sp>{$i==1}?<sp>ID\n" ) + "<sp>|<sp>{$i==2}?<sp>ID\n" ) + "<sp>;\n" ) + "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" ) + "INT<sp>:<sp>\'0\'..\'9\'+;\n" ) + "T.g4" 1 ) ; java . lang . String found = execParser ( "T.g4" , grammar , "TParser" , "T.g4" 0 , "T.g4" 2 , "a<sp>b" , false ) ; java . lang . String expecting = "" ; "<AssertPlaceHolder>" ; } execParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { return execParser ( grammarFileName , grammarStr , parserName , lexerName , startRuleName , input , debug , false ) ; }
|
org . junit . Assert . assertEquals ( expecting , found )
|
testUnzipDownload ( ) { if ( com . bixly . pastevid . util . MediaUtil . osIsWindows ( ) ) { java . io . File file = new java . io . File ( com . bixly . pastevid . Settings . getUnzipExecutable ( ) ) ; if ( file . exists ( ) ) file . delete ( ) ; file = new java . io . File ( com . bixly . pastevid . Settings . BIN_DIR , "unzip.zip" ) ; if ( file . exists ( ) ) file . delete ( ) ; com . bixly . pastevid . download . DownloadUnzip instance = new com . bixly . pastevid . download . DownloadUnzip ( ) ; com . bixly . pastevid . download . DownloadManager downloadManager = com . bixly . pastevid . download . DownloadManager . getInstance ( ) ; downloadManager . registerDownload ( com . bixly . pastevid . Settings . getUnzipExecutable ( ) , instance ) ; downloadManager . start ( ) ; while ( ! ( instance . checkStatus ( DownloadStatus . FINISHED ) ) ) { System . out . println ( "Downloading<sp>instance" ) ; com . bixly . pastevid . util . TimeUtil . skipToMyLou ( 1 ) ; } "<AssertPlaceHolder>" ; } else { System . out . println ( "testUnzipDownload<sp>can<sp>only<sp>be<sp>completed<sp>on<sp>Windows<sp>since<sp>Mac<sp>and<sp>Linux<sp>already<sp>have<sp>the<sp>Unzip<sp>application" ) ; } } getFile ( ) { return this . videoRecorder . getOutputFileName ( ) ; }
|
org . junit . Assert . assertTrue ( instance . getFile ( ) . exists ( ) )
|
testLocalHostCall ( ) { domain = "xpipe.meta.ctripcorp.com" ; org . springframework . mock . web . MockHttpServletRequest request = new org . springframework . mock . web . MockHttpServletRequest ( ) ; org . springframework . mock . web . MockHttpServletResponse response = new org . springframework . mock . web . MockHttpServletResponse ( ) ; request . addHeader ( com . ctrip . xpipe . spring . DomainValidateFilter . HTTP_REQUEST_HEADER_HOST , "localhost:8080" ) ; filter . doFilter ( request , response , filterChain ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) )
|
testComponentStatusList ( ) { server . expect ( ) . withPath ( "/api/v1/componentstatuses" ) . andReturn ( 200 , status ) . once ( ) ; io . fabric8 . kubernetes . client . KubernetesClient client = server . getClient ( ) ; io . fabric8 . kubernetes . api . model . ComponentStatusList stats = client . componentstatuses ( ) . list ( ) ; "<AssertPlaceHolder>" ; } list ( ) { try { java . net . URL requestUrl = getNamespacedUrl ( ) ; okhttp3 . Request . Builder requestBuilder = new okhttp3 . Request . Builder ( ) . get ( ) . url ( requestUrl ) ; return handleResponse ( requestBuilder , io . fabric8 . kubernetes . api . model . Status . class ) ; } catch ( java . lang . InterruptedException | java . util . concurrent . ExecutionException | java . io . IOException e ) { throw io . fabric8 . kubernetes . client . KubernetesClientException . launderThrowable ( e ) ; } }
|
org . junit . Assert . assertNotNull ( stats )
|
testGetInPort ( ) { target = new org . o3project . odenos . core . component . network . flow . basic . BasicFlowMatch ( "node01" , "port01" ) ; "<AssertPlaceHolder>" ; } getInPort ( ) { return matchInPort ; }
|
org . junit . Assert . assertThat ( target . getInPort ( ) , org . hamcrest . CoreMatchers . is ( "port01" ) )
|
testSaveAndLoad ( ) { com . catify . processengine . core . data . model . entities . FlowNodeInstance flowNodeInstance = createFlowNodeInstance ( NodeInstaceStates . ACTIVE_STATE ) ; flowNodeInstanceRepository . save ( flowNodeInstance ) ; flowNodeInstance = flowNodeInstanceRepository . findOne ( flowNodeInstance . getGraphId ( ) ) ; "<AssertPlaceHolder>" ; } getGraphId ( ) { return graphId ; }
|
org . junit . Assert . assertNotNull ( flowNodeInstance )
|
testGetWord ( ) { model = createVoiceModel ( ) ; final java . util . List < com . ibm . watson . text_to_speech . v1 . model . Word > expected = instantiateWords ( ) ; com . ibm . watson . text_to_speech . v1 . model . AddWordsOptions addOptions = new com . ibm . watson . text_to_speech . v1 . model . AddWordsOptions . Builder ( ) . customizationId ( model . getCustomizationId ( ) ) . words ( expected ) . build ( ) ; service . addWords ( addOptions ) . execute ( ) . getResult ( ) ; com . ibm . watson . text_to_speech . v1 . model . GetWordOptions getOptions = new com . ibm . watson . text_to_speech . v1 . model . GetWordOptions . Builder ( ) . customizationId ( model . getCustomizationId ( ) ) . word ( expected . get ( 0 ) . getWord ( ) ) . build ( ) ; final com . ibm . watson . text_to_speech . v1 . model . Translation translation = service . getWord ( getOptions ) . execute ( ) . getResult ( ) ; "<AssertPlaceHolder>" ; } getTranslation ( ) { return translation ; }
|
org . junit . Assert . assertEquals ( expected . get ( 0 ) . getTranslation ( ) , translation . getTranslation ( ) )
|
loggerLevel ( ) { org . hongxi . whatsmars . common . logging . inner . Level level = org . hongxi . whatsmars . common . logging . inner . Logger . getRootLogger ( ) . getLevel ( ) ; "<AssertPlaceHolder>" ; } getLevel ( ) { return this . level ; }
|
org . junit . Assert . assertTrue ( ( level != null ) )
|
testGetMetaData ( ) { java . sql . DatabaseMetaData dbmd = con . getMetaData ( ) ; "<AssertPlaceHolder>" ; } getMetaData ( ) { checkClosed ( ) ; if ( ( rsMetaData ) == null ) { rsMetaData = createMetaData ( ) ; } return rsMetaData ; }
|
org . junit . Assert . assertNotNull ( dbmd )
|
shouldReturnTrueWhenSchemaHasValidatorEntityPropertyFilters ( ) { final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . store . schema . SchemaEntityDefinition . Builder ( ) . property ( TestPropertyNames . PROP_1 , "str" ) . build ( ) ) . type ( "str" , new uk . gov . gchq . gaffer . store . schema . TypeDefinition . Builder ( ) . validateFunctions ( new uk . gov . gchq . koryphe . impl . predicate . Exists ( ) ) . build ( ) ) . edge ( TestGroups . EDGE , new uk . gov . gchq . gaffer . store . schema . SchemaEdgeDefinition ( ) ) . build ( ) ; final boolean result = schema . hasValidation ( ) ; "<AssertPlaceHolder>" ; } hasValidation ( ) { for ( final uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition elementDef : new uk . gov . gchq . gaffer . commonutil . iterable . ChainedIterable < uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition > ( getEntities ( ) . values ( ) , getEdges ( ) . values ( ) ) ) { if ( null != elementDef ) { if ( elementDef . hasValidation ( ) ) { return true ; } } } return false ; }
|
org . junit . Assert . assertTrue ( result )
|
testAddOneLayer ( ) { renders = 0 ; java . util . List < org . locationtech . udig . catalog . IGeoResource > resources = new java . util . ArrayList < org . locationtech . udig . catalog . IGeoResource > ( ) ; org . opengis . feature . simple . SimpleFeature [ ] features = org . locationtech . udig . ui . tests . support . UDIGTestUtil . createDefaultTestFeatures ( "type2" , 4 ) ; resources . add ( org . locationtech . udig . project . tests . support . MapTests . createGeoResource ( features , true ) ) ; org . locationtech . udig . project . ui . ApplicationGIS . addLayersToMap ( map , resources , 0 ) ; org . locationtech . udig . ui . tests . support . UDIGTestUtil . inDisplayThreadWait ( 3000 , new org . locationtech . udig . ui . WaitCondition ( ) { public boolean isTrue ( ) { return 0 < ( renders ) ; } } , false ) ; "<AssertPlaceHolder>" ; } isTrue ( ) { return ( progressMonitor ) == null ; }
|
org . junit . Assert . assertEquals ( 1 , renders )
|
shouldNotHandleMapWithTypesUsingEmbedTypeSettingV2d0 ( ) { final org . apache . tinkerpop . shaded . jackson . databind . ObjectMapper mapper = org . apache . tinkerpop . gremlin . structure . io . graphson . GraphSONMapper . build ( ) . version ( GraphSONVersion . V2_0 ) . typeInfo ( TypeInfo . NO_TYPES ) . create ( ) . createMapper ( ) ; final java . util . Map < java . lang . String , java . lang . Object > m = new java . util . HashMap ( ) ; m . put ( "test" , 100L ) ; final java . lang . String json = mapper . writeValueAsString ( m ) ; final java . util . Map read = mapper . readValue ( json , java . util . HashMap . class ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { if ( ! ( this . memoryComputeKeys . containsKey ( key ) ) ) throw Memory . Exceptions . memoryDoesNotExist ( key ) ; if ( ( this . inExecute ) && ( ! ( this . memoryComputeKeys . get ( key ) . isBroadcast ( ) ) ) ) throw Memory . Exceptions . memoryDoesNotExist ( key ) ; final org . apache . tinkerpop . gremlin . hadoop . structure . io . ObjectWritable < R > r = ( ( org . apache . tinkerpop . gremlin . hadoop . structure . io . ObjectWritable < R > ) ( ( this . inExecute ) ? this . broadcast . value ( ) . get ( key ) : this . sparkMemory . get ( key ) . value ( ) ) ) ; if ( ( null == r ) || ( r . isEmpty ( ) ) ) throw Memory . Exceptions . memoryDoesNotExist ( key ) ; else return r . get ( ) ; }
|
org . junit . Assert . assertEquals ( 100 , read . get ( "test" ) )
|
selectSingle ( ) { com . fasterxml . jackson . databind . JsonNode expected = com . nebhale . jsonpath . internal . component . NODE . get ( "store" ) ; com . fasterxml . jackson . databind . JsonNode result = new com . nebhale . jsonpath . internal . component . ChildPathComponent ( null , "store" ) . select ( com . nebhale . jsonpath . internal . component . NODE ) ; "<AssertPlaceHolder>" ; } select ( com . fasterxml . jackson . databind . JsonNode ) { this . selectCalled = true ; return input ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
getLevelLabels ( ) { "<AssertPlaceHolder>" ; } getLevelLabels ( ) { org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "hard<sp>score" , "soft<sp>score" } , new org . optaplanner . core . impl . score . buildin . hardsoft . HardSoftScoreDefinition ( ) . getLevelLabels ( ) ) ; }
|
org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "hard<sp>score" , "soft<sp>score" } , new org . optaplanner . core . impl . score . buildin . hardsoft . HardSoftScoreDefinition ( ) . getLevelLabels ( ) )
|
testBigIntHandling ( ) { java . lang . String jsonBody = ( "[{\"collectionTime\":<sp>" + ( current ) ) + ",\"ttlInSeconds\":172800,\"metricValue\":18446744073709000000,\"metricName\":\"used\",\"unit\":\"unknown\"}]" ; com . rackspacecloud . blueflood . inputs . formats . JSONMetricsContainer container = getContainer ( "786659" , jsonBody ) ; java . util . List < com . rackspacecloud . blueflood . types . Metric > metrics = container . getValidMetrics ( ) ; "<AssertPlaceHolder>" ; } getValidationErrors ( ) { return validationErrors ; }
|
org . junit . Assert . assertTrue ( container . getValidationErrors ( ) . isEmpty ( ) )
|
testBadge_2 ( ) { cn . jpush . api . push . model . notification . IosNotification ios = cn . jpush . api . push . model . notification . IosNotification . newBuilder ( ) . setBadge ( 2 ) . build ( ) ; com . google . gson . JsonObject json = new com . google . gson . JsonObject ( ) ; json . add ( "badge" , new com . google . gson . JsonPrimitive ( "2" ) ) ; json . add ( "sound" , new com . google . gson . JsonPrimitive ( "" ) ) ; "<AssertPlaceHolder>" ; } toJSON ( ) { cn . jpush . api . report . model . JsonObject jsonObject = new cn . jpush . api . report . model . JsonObject ( ) ; if ( ( msgId ) != ( - 1L ) ) { jsonObject . addProperty ( cn . jpush . api . report . model . CheckMessagePayload . MSG_ID , msgId ) ; } if ( null != ( registrationIds ) ) { cn . jpush . api . report . model . JsonArray jsonArray = new cn . jpush . api . report . model . JsonArray ( ) ; for ( java . lang . String rid : registrationIds ) { jsonArray . add ( new cn . jpush . api . report . model . JsonPrimitive ( rid ) ) ; } jsonObject . add ( cn . jpush . api . report . model . CheckMessagePayload . REGISTRATION_IDS , jsonArray ) ; } if ( null != ( date ) ) { jsonObject . addProperty ( cn . jpush . api . report . model . CheckMessagePayload . DATE , date ) ; } return jsonObject ; }
|
org . junit . Assert . assertEquals ( "" , json , ios . toJSON ( ) )
|
testRecordTaskMultipleTimes ( ) { profileReport . recordTask ( ) ; profileReport . recordTask ( ) ; "<AssertPlaceHolder>" ; } hasRecordedTasks ( ) { return recordedTasks ; }
|
org . junit . Assert . assertThat ( profileReport . hasRecordedTasks ( ) , org . hamcrest . Matchers . equalTo ( true ) )
|
assertEqualsWithSameColumnLabel ( ) { org . apache . shardingsphere . core . parse . old . parser . context . orderby . OrderItem orderItem1 = new org . apache . shardingsphere . core . parse . old . parser . context . orderby . OrderItem ( "column_name" , org . apache . shardingsphere . core . constant . OrderDirection . ASC , org . apache . shardingsphere . core . constant . OrderDirection . ASC ) ; orderItem1 . setAlias ( "column_alias" ) ; org . apache . shardingsphere . core . parse . old . parser . context . orderby . OrderItem orderItem2 = new org . apache . shardingsphere . core . parse . old . parser . context . orderby . OrderItem ( "tbl" , "column_name" , org . apache . shardingsphere . core . constant . OrderDirection . ASC , org . apache . shardingsphere . core . constant . OrderDirection . ASC ) ; orderItem2 . setAlias ( "column_alias" ) ; "<AssertPlaceHolder>" ; } setAlias ( java . lang . String ) { this . alias = org . apache . shardingsphere . core . parse . util . SQLUtil . getExactlyValue ( alias ) ; }
|
org . junit . Assert . assertThat ( orderItem1 , org . hamcrest . CoreMatchers . is ( orderItem2 ) )
|
fromStringPlainPropertiesComplexToObject ( ) { java . lang . String sampleFileAsString = getSampleFileAsString ( "JoaoPlainProperties.jsonld" ) ; br . com . srs . gsonld . test . JoaoPlain joao = new br . com . srs . gsonld . GsonLD ( ) . fromJsonLD ( sampleFileAsString , br . com . srs . gsonld . test . JoaoPlain . class ) ; br . com . srs . gsonld . test . Endereco enderecoExpected = new br . com . srs . gsonld . test . Endereco ( "SC" , "Florianpolis" , "Rua<sp>Joo<sp>Pio<sp>Duarte<sp>Silva" , "78850-000" ) ; br . com . srs . gsonld . test . Residencia residenciaExpected = new br . com . srs . gsonld . test . Residencia ( "Trindade<sp>-<sp>Florianpolis<sp>-<sp>Santa<sp>Catarina<sp>-<sp>Brazil" , "55<sp>48<sp>1234<sp>5678" , enderecoExpected ) ; br . com . srs . gsonld . test . JoaoPlain joaoExpected = new br . com . srs . gsonld . test . JoaoPlain ( "da<sp>Silva" , "Joao" , "2015-03-04" , residenciaExpected , 12345 ) ; "<AssertPlaceHolder>" ; } fromJsonLD ( java . lang . String , java . lang . Class ) { if ( org . apache . commons . lang3 . StringUtils . equalsIgnoreCase ( br . com . srs . gsonld . GsonLD . NULL_OBJECT_JSON , jsonld ) ) { return null ; } try { java . util . Map < java . lang . String , java . lang . String > context = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; com . github . jsonldjava . core . JsonLdOptions options = new com . github . jsonldjava . core . JsonLdOptions ( ) ; java . lang . Object fromString = com . github . jsonldjava . utils . JsonUtils . fromString ( jsonld ) ; java . lang . Object compact = com . github . jsonldjava . core . JsonLdProcessor . compact ( fromString , context , options ) ; if ( compact instanceof java . util . Map ) { java . util . Map < ? , ? > jsonLDProperties = ( ( java . util . Map < ? , ? > ) ( compact ) ) ; return mapJsonLDtoObject ( jsonLDProperties , classOfT ) ; } } catch ( java . io . IOException | com . github . jsonldjava . core . JsonLdError | java . lang . InstantiationException | java . lang . IllegalAccessException e ) { throw new java . lang . RuntimeException ( e ) ; } return null ; }
|
org . junit . Assert . assertEquals ( joaoExpected , joao )
|
addDuplicates ( ) { final java . nio . file . Path blobDbx = temporaryFolder . getRoot ( ) . toPath ( ) . resolve ( "blob.dbx" ) ; final java . nio . file . Path blobDir = temporaryFolder . newFolder ( "blob" ) . toPath ( ) ; final com . evolvedbinary . j8fu . tuple . Tuple2 < byte [ ] , org . exist . util . crypto . digest . MessageDigest > testFile1 = generateTestFile ( ) ; final com . evolvedbinary . j8fu . tuple . Tuple2 < byte [ ] , org . exist . util . crypto . digest . MessageDigest > testFile2 = generateTestFile ( ) ; try ( final org . exist . storage . blob . BlobStore blobStore = org . exist . storage . blob . BlobStoreImplTest . newBlobStore ( blobDbx , blobDir ) ) { blobStore . open ( ) ; addAndVerify ( blobStore , testFile1 ) ; addAndVerify ( blobStore , testFile2 ) ; addAndVerify ( blobStore , testFile1 ) ; addAndVerify ( blobStore , testFile2 ) ; } final long expectedBlobDbxLen = calculateBlobStoreSize ( 2 ) ; final long actualBlobDbxLen = java . nio . file . Files . size ( blobDbx ) ; "<AssertPlaceHolder>" ; } size ( org . exist . xquery . functions . map . Sequence [ ] ) { final org . exist . xquery . functions . map . AbstractMapType map = ( ( org . exist . xquery . functions . map . AbstractMapType ) ( args [ 0 ] . itemAt ( 0 ) ) ) ; return new org . exist . xquery . functions . map . IntegerValue ( map . size ( ) , Type . INTEGER ) ; }
|
org . junit . Assert . assertEquals ( expectedBlobDbxLen , actualBlobDbxLen )
|
testServiceLoaderCanLoadExtensions ( ) { java . util . Map < java . lang . String , com . graphaware . nlp . extension . NLPExtension > loadedExtensions = com . graphaware . nlp . util . ServiceLoader . loadInstances ( com . graphaware . nlp . annotation . NLPModuleExtension . class ) ; "<AssertPlaceHolder>" ; } loadInstances ( java . lang . Class ) { java . util . Map < java . lang . String , java . lang . Class < T > > loadedClass = com . graphaware . nlp . util . ServiceLoader . loadClass ( annotationClass ) ; java . util . Map < java . lang . String , T > result = new java . util . HashMap ( ) ; if ( loadedClass == null ) { return result ; } loadedClass . entrySet ( ) . forEach ( ( entry ) -> { try { com . graphaware . nlp . util . ServiceLoader . LOG . info ( ( "Loading<sp>extension<sp>:<sp>" + ( entry . getValue ( ) . getName ( ) ) ) ) ; Class < com . graphaware . nlp . util . T > cls = entry . getValue ( ) ; Constructor < com . graphaware . nlp . util . T > constructor = cls . getConstructor ( ) ; com . graphaware . nlp . util . T newInstance = constructor . newInstance ( ) ; result . put ( entry . getKey ( ) , newInstance ) ; } catch ( java . lang . NoSuchMethodException | java . lang . InstantiationException | java . lang . IllegalAccessException | java . lang . IllegalArgumentException | java . lang . reflect . InvocationTargetException ex ) { com . graphaware . nlp . util . ServiceLoader . LOG . error ( ( ( "Error<sp>while<sp>initializing<sp>" + ( entry . getKey ( ) ) ) + ".<sp>Continuing" ) ) ; com . graphaware . nlp . util . ex . printStackTrace ( ) ; } } ) ; return result ; }
|
org . junit . Assert . assertFalse ( ( ( loadedExtensions . size ( ) ) == 0 ) )
|
addAndRemovePropertiesWithinOneTransaction ( ) { org . neo4j . graphdb . Node node = getGraphDb ( ) . createNode ( ) ; node . setProperty ( "name" , "oscar" ) ; node . setProperty ( "favourite_numbers" , new java . lang . Long [ ] { 1L , 2L , 3L } ) ; node . setProperty ( "favourite_colors" , new java . lang . String [ ] { "blue" , "red" } ) ; node . removeProperty ( "favourite_colors" ) ; newTransaction ( ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String , java . lang . Object ) { if ( null == key ) { throw new java . lang . IllegalArgumentException ( "(null)<sp>property<sp>key<sp>is<sp>not<sp>allowed" ) ; } org . neo4j . kernel . api . KernelTransaction transaction = spi . kernelTransaction ( ) ; org . neo4j . internal . kernel . api . RelationshipScanCursor relationships = transaction . ambientRelationshipCursor ( ) ; org . neo4j . internal . kernel . api . PropertyCursor properties = transaction . ambientPropertyCursor ( ) ; int propertyKey = transaction . tokenRead ( ) . propertyKey ( key ) ; if ( propertyKey == ( org . neo4j . internal . kernel . api . TokenRead . NO_TOKEN ) ) { return defaultValue ; } singleRelationship ( transaction , relationships ) ; relationships . properties ( properties ) ; while ( properties . next ( ) ) { if ( propertyKey == ( properties . propertyKey ( ) ) ) { org . neo4j . values . storable . Value value = properties . propertyValue ( ) ; return value == ( org . neo4j . values . storable . Values . NO_VALUE ) ? defaultValue : value . asObjectCopy ( ) ; } } return defaultValue ; }
|
org . junit . Assert . assertNotNull ( node . getProperty ( "favourite_numbers" , null ) )
|
nullValue ( ) { victim . addValue ( "module" , "key" , null ) ; "<AssertPlaceHolder>" ; } getDataForModule ( java . lang . String ) { java . util . Map < java . lang . String , java . lang . String > values = data . get ( module ) ; if ( values == null ) { java . util . Map < java . lang . String , java . lang . String > emptyValues = new java . util . HashMap ( ) ; values = data . putIfAbsent ( module , emptyValues ) ; if ( values == null ) { values = emptyValues ; } } return values ; }
|
org . junit . Assert . assertEquals ( "" , victim . getDataForModule ( "module" ) . get ( "key" ) )
|
testInsertComplete ( ) { initializeExpectedTable ( 1 ) ; expect ( bigquery . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( bigquery . insertAll ( com . google . cloud . bigquery . TableTest . INSERT_ALL_REQUEST_COMPLETE ) ) . andReturn ( com . google . cloud . bigquery . TableTest . EMPTY_INSERT_ALL_RESPONSE ) ; replay ( bigquery ) ; initializeTable ( ) ; com . google . cloud . bigquery . InsertAllResponse response = table . insert ( com . google . cloud . bigquery . TableTest . ROWS_TO_INSERT , true , true ) ; "<AssertPlaceHolder>" ; } insert ( java . lang . Iterable , boolean , boolean ) { com . google . cloud . bigquery . InsertAllRequest request = com . google . cloud . bigquery . InsertAllRequest . newBuilder ( getTableId ( ) , rows ) . setSkipInvalidRows ( skipInvalidRows ) . setIgnoreUnknownValues ( ignoreUnknownValues ) . build ( ) ; return bigquery . insertAll ( request ) ; }
|
org . junit . Assert . assertSame ( com . google . cloud . bigquery . TableTest . EMPTY_INSERT_ALL_RESPONSE , response )
|
testConstructor8 ( ) { marytts . datatypes . MaryData md = new marytts . datatypes . MaryData ( MaryDataType . AUDIO , null , true ) ; "<AssertPlaceHolder>" ; } getDocument ( ) { for ( marytts . unitselection . analysis . Phone phone : phones ) { org . w3c . dom . Element phoneElement = phone . getMaryXMLElement ( ) ; if ( phoneElement != null ) { return phoneElement . getOwnerDocument ( ) ; } } return null ; }
|
org . junit . Assert . assertTrue ( ( ( md . getDocument ( ) ) == null ) )
|
testJUMPI_4 ( ) { org . ethereum . vm . VM vm = new org . ethereum . vm . VM ( ) ; program = new org . ethereum . vm . Program ( org . spongycastle . util . encoders . Hex . decode ( "6001602259" ) , invoke ) ; try { vm . step ( program ) ; vm . step ( program ) ; vm . step ( program ) ; } finally { "<AssertPlaceHolder>" ; } } isStopped ( ) { return stopped ; }
|
org . junit . Assert . assertTrue ( program . isStopped ( ) )
|
test ( ) { "<AssertPlaceHolder>" ; for ( org . geosdi . geoplatform . gui . configuration . menubar . MenuBarCategory category : menuBarContainerTool . getCategories ( ) ) { logger . info ( "MENU<sp>********************<sp>{}" , category . toString ( ) ) ; } }
|
org . junit . Assert . assertNotNull ( menuBarContainerTool )
|
shouldNotBeReadSuspendedAfterThreadRealignment ( ) { org . kaazing . mina . core . session . DummySessionEx session = executor . submit ( new org . kaazing . mina . core . session . DummySessionExTest . DummySessionExFactory ( ) ) . get ( ) ; org . apache . mina . core . filterchain . IoFilterChain filterChain = session . getFilterChain ( ) ; filterChain . fireMessageReceived ( new java . lang . Object ( ) ) ; executor . shutdown ( ) ; executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } isReadSuspended ( ) { return channel . isReadable ( ) ; }
|
org . junit . Assert . assertFalse ( session . isReadSuspended ( ) )
|
testKieSession ( ) { org . kie . api . runtime . KieSession ksession = ( ( org . kie . api . runtime . KieSession ) ( org . kie . spring . tests . KieSpringBasics2Test . context . getBean ( "ksession2" ) ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( ksession )
|
startActivityInThisAppTestCase ( ) { io . appium . java_client . android . Activity activity = new io . appium . java_client . android . Activity ( "io.appium.android.apis" , ".accessibility.AccessibilityNodeProviderActivity" ) ; driver . startActivity ( activity ) ; "<AssertPlaceHolder>" ; } currentActivity ( ) { return io . appium . java_client . CommandExecutionHelper . execute ( this , io . appium . java_client . android . AndroidMobileCommandHelper . currentActivityCommand ( ) ) ; }
|
org . junit . Assert . assertEquals ( driver . currentActivity ( ) , ".accessibility.AccessibilityNodeProviderActivity" )
|
equals_trueForSameInstance ( ) { org . eclipse . rap . json . JsonNumber number = new org . eclipse . rap . json . JsonNumber ( "23" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; org . eclipse . rap . e4 . internal . RAPEventObjectSupplier . Subscriber other = ( ( org . eclipse . rap . e4 . internal . RAPEventObjectSupplier . Subscriber ) ( obj ) ) ; if ( ( requestor ) == null ) { if ( ( other . requestor ) != null ) return false ; } else if ( ! ( requestor . equals ( other . requestor ) ) ) return false ; if ( ( topic ) == null ) { if ( ( other . topic ) != null ) return false ; } else if ( ! ( topic . equals ( other . topic ) ) ) return false ; return true ; }
|
org . junit . Assert . assertTrue ( number . equals ( number ) )
|
testBatchTenantIdCase3 ( ) { org . camunda . bpm . engine . batch . Batch batch = batchHelper . migrateProcessInstanceAsync ( sharedDefinition , tenant1Definition ) ; "<AssertPlaceHolder>" ; } getTenantId ( ) { return tenantId ; }
|
org . junit . Assert . assertNull ( batch . getTenantId ( ) )
|
treeMenuRoot ( ) { java . util . List < ? extends org . geosdi . geoplatform . gui . configuration . GPMenuGenericTool > tools = gpTreeMenuStore . getTools ( new org . geosdi . geoplatform . gui . configuration . composite . menu . store . SingleSelectionCompositeKey ( org . geosdi . geoplatform . gui . configuration . composite . GPTreeCompositeType . ROOT ) ) ; "<AssertPlaceHolder>" ; logger . info ( "ROOT<sp>TREE<sp>MENU<sp>@@@@@@@@@@@@@@@@@@@@@@@@@@<sp>\n\n<sp>{}<sp>\n" , tools ) ; } size ( ) { return list . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , tools . size ( ) )
|
shouldAddRecords ( ) { int initialRecordCount = journal . allRecords ( false ) . size ( ) ; journal . addRecords ( new org . modeshape . jcr . journal . JournalRecord ( org . modeshape . jcr . journal . LocalJournalTest . TestChangeSet . create ( "j4" , 2 ) ) , new org . modeshape . jcr . journal . JournalRecord ( org . modeshape . jcr . journal . LocalJournalTest . TestChangeSet . create ( "j4" , 1 ) ) , new org . modeshape . jcr . journal . JournalRecord ( org . modeshape . jcr . journal . LocalJournalTest . TestChangeSet . create ( "j4" , 3 ) ) ) ; "<AssertPlaceHolder>" ; } allRecords ( boolean ) { return localJournal . allRecords ( descendingOrder ) ; }
|
org . junit . Assert . assertEquals ( ( initialRecordCount + 3 ) , journal . allRecords ( false ) . size ( ) )
|
isImportInProgress ( ) { com . gisgraphy . webapp . action . ImportAction action = new com . gisgraphy . webapp . action . ImportAction ( ) ; com . gisgraphy . importer . ImporterManager mockImporterManager = org . easymock . EasyMock . createMock ( com . gisgraphy . importer . ImporterManager . class ) ; boolean isInProgressState = true ; org . easymock . EasyMock . expect ( mockImporterManager . isInProgress ( ) ) . andReturn ( isInProgressState ) ; org . easymock . EasyMock . replay ( mockImporterManager ) ; action . setImporterManager ( mockImporterManager ) ; "<AssertPlaceHolder>" ; org . easymock . EasyMock . verify ( mockImporterManager ) ; } isImportInProgress ( ) { com . gisgraphy . webapp . action . ImportAction action = new com . gisgraphy . webapp . action . ImportAction ( ) ; com . gisgraphy . importer . ImporterManager mockImporterManager = org . easymock . EasyMock . createMock ( com . gisgraphy . importer . ImporterManager . class ) ; boolean isInProgressState = true ; org . easymock . EasyMock . expect ( mockImporterManager . isInProgress ( ) ) . andReturn ( isInProgressState ) ; org . easymock . EasyMock . replay ( mockImporterManager ) ; action . setImporterManager ( mockImporterManager ) ; org . junit . Assert . assertEquals ( isInProgressState , action . isImportInProgress ( ) ) ; org . easymock . EasyMock . verify ( mockImporterManager ) ; }
|
org . junit . Assert . assertEquals ( isInProgressState , action . isImportInProgress ( ) )
|
test3_testDeleteGlossary ( ) { com . google . cloud . translate . v3beta1 . DeleteGlossaryResponse response = com . google . cloud . examples . translate . snippets . TranslateSnippetsBeta . deleteGlossary ( com . google . cloud . examples . translate . snippets . ITTranslateSnippetsBeta . projectId , "us-central1" , "glossary-testing" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . firestore . admin . v1 . FieldName . PATH_TEMPLATE . instantiate ( "project" , project , "database" , database , "collection_id" , collectionId , "field_id" , fieldId ) ; }
|
org . junit . Assert . assertTrue ( response . toString ( ) , response . toString ( ) . contains ( "glossary-testing" ) )
|
testAuthorizerExtension ( ) { org . apache . twill . filesystem . Location externalAuthJar = createValidAuthExtensionJar ( ) ; io . cdap . cdap . common . conf . CConfiguration cConfCopy = io . cdap . cdap . common . conf . CConfiguration . copy ( io . cdap . cdap . security . authorization . CCONF ) ; cConfCopy . set ( Constants . Security . Authorization . EXTENSION_JAR_PATH , externalAuthJar . toString ( ) ) ; final java . io . File tempFile = io . cdap . cdap . security . authorization . AuthorizerInstantiatorTest . TEMP_FOLDER . newFile ( "conf-file.xml" ) ; cConfCopy . set ( Constants . Security . Authorization . EXTENSION_EXTRA_CLASSPATH , tempFile . getParent ( ) ) ; try ( io . cdap . cdap . security . authorization . AuthorizerInstantiator instantiator = new io . cdap . cdap . security . authorization . AuthorizerInstantiator ( cConfCopy , AUTH_CONTEXT_FACTORY ) ) { io . cdap . cdap . security . spi . authorization . Authorizer externalAuthorizer1 = instantiator . get ( ) ; java . lang . ClassLoader authorizerClassLoader = externalAuthorizer1 . getClass ( ) . getClassLoader ( ) ; authorizerClassLoader . loadClass ( io . cdap . cdap . security . authorization . AuthorizerInstantiatorTest . ValidExternalAuthorizer . class . getName ( ) ) ; "<AssertPlaceHolder>" ; } } getResource ( java . lang . String ) { java . net . URL resource = super . getResource ( name ) ; if ( resource == null ) { return null ; } java . lang . String baseClasspath = io . cdap . cdap . common . lang . ClassLoaders . getClassPathURL ( name , resource ) . getPath ( ) ; java . lang . String jarName = baseClasspath . substring ( ( ( baseClasspath . lastIndexOf ( '/' ) ) + 1 ) , baseClasspath . length ( ) ) ; return jarName . startsWith ( "org.scala-lang" ) ? null : resource ; }
|
org . junit . Assert . assertNotNull ( authorizerClassLoader . getResource ( "conf-file.xml" ) )
|
hashCode2 ( ) { com . querydsl . sql . domain . QSurvey survey = new com . querydsl . sql . domain . QSurvey ( "entity" ) ; com . querydsl . sql . domain . QEmployee employee = new com . querydsl . sql . domain . QEmployee ( "entity" ) ; com . querydsl . core . types . SubQueryExpression < java . lang . Integer > query1 = com . querydsl . sql . SQLExpressions . select ( survey . id ) . from ( survey ) ; com . querydsl . core . types . SubQueryExpression < java . lang . Integer > query2 = com . querydsl . sql . SQLExpressions . select ( employee . id ) . from ( employee ) ; java . util . Set < com . querydsl . core . types . SubQueryExpression < java . lang . Integer > > queries = com . google . common . collect . Sets . newHashSet ( ) ; queries . add ( query1 ) ; queries . add ( query2 ) ; "<AssertPlaceHolder>" ; } size ( ) { query ( store , store . products . size ( ) . gt ( 0 ) ) ; }
|
org . junit . Assert . assertEquals ( 1 , queries . size ( ) )
|
testHandleWithException ( ) { boolean validAssert ; com . netflix . hystrix . strategy . HystrixPlugins . reset ( ) ; try { validAssert = true ; bizkeeperHandler . handle ( invocation , asyncResp ) ; } catch ( java . lang . Exception e ) { validAssert = false ; } "<AssertPlaceHolder>" ; } handle ( java . lang . String , java . util . Map ) { if ( ( parseConfigs == null ) || ( parseConfigs . isEmpty ( ) ) ) { return ; } java . util . Map < java . lang . String , java . lang . Object > configuration = org . apache . servicecomb . config . ConfigMapping . getConvertedMap ( parseConfigs ) ; if ( "create" . equals ( action ) ) { valueCache . putAll ( configuration ) ; updateConfiguration ( createIncremental ( com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > copyOf ( configuration ) , null , null ) ) ; } else if ( "set" . equals ( action ) ) { valueCache . putAll ( configuration ) ; updateConfiguration ( createIncremental ( null , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > copyOf ( configuration ) , null ) ) ; } else if ( "delete" . equals ( action ) ) { for ( java . lang . String itemKey : configuration . keySet ( ) ) { valueCache . remove ( itemKey ) ; } updateConfiguration ( createIncremental ( null , null , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > copyOf ( configuration ) ) ) ; } else { org . apache . servicecomb . config . archaius . sources . ConfigCenterConfigurationSourceImpl . LOGGER . error ( "action:<sp>{}<sp>is<sp>invalid." , action ) ; return ; } org . apache . servicecomb . config . archaius . sources . ConfigCenterConfigurationSourceImpl . LOGGER . warn ( "Config<sp>value<sp>cache<sp>changed:<sp>action:{};<sp>item:{}" , action , configuration . keySet ( ) ) ; }
|
org . junit . Assert . assertFalse ( validAssert )
|
componentTest ( ) { com . ctrip . framework . cs . component . ComponentManager . add ( com . ctrip . framework . cs . AppInfo . class ) ; com . ctrip . framework . cs . component . ComponentManager . add ( com . ctrip . framework . cs . component . defaultComponents . HostInfo . class ) ; com . ctrip . framework . cs . component . Map < java . lang . String , java . lang . Class < ? > > components = com . ctrip . framework . cs . component . ComponentManager . getAllComponents ( ) ; com . ctrip . framework . cs . annotation . ComponentStatus compAnnotation = com . ctrip . framework . cs . AppInfo . class . getAnnotation ( com . ctrip . framework . cs . annotation . ComponentStatus . class ) ; "<AssertPlaceHolder>" ; } containsKey ( java . lang . String ) { return false ; }
|
org . junit . Assert . assertTrue ( components . containsKey ( compAnnotation . id ( ) ) )
|
testDeletePrimaryIndexKeyMultipleNodes ( ) { org . hivedb . meta . directory . DbDirectory d = getDirectory ( ) ; org . hivedb . Hive hive = getHive ( ) ; for ( java . lang . String key : getPrimaryIndexOrResourceKeys ( ) ) for ( org . hivedb . meta . Node node : hive . getNodes ( ) ) d . insertPrimaryIndexKey ( node , key ) ; for ( java . lang . String key : getPrimaryIndexOrResourceKeys ( ) ) { d . deletePrimaryIndexKey ( key ) ; "<AssertPlaceHolder>" ; } } getKeySemamphoresOfPrimaryIndexKey ( java . lang . Object ) { return doRead ( sql . selectKeySemaphoreOfPrimaryIndexKey ( partitionDimension ) , new java . lang . Object [ ] { primaryIndexKey } , new org . hivedb . meta . directory . KeySemaphoreRowMapper ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , d . getKeySemamphoresOfPrimaryIndexKey ( key ) . size ( ) )
|
testGetUserByUsernameLike ( ) { java . util . List < org . ikasan . security . model . User > users = this . xaUserDao . getUserByUsernameLike ( "user" ) ; "<AssertPlaceHolder>" ; } size ( ) { logger . debug ( "Size!<sp>" ) ; return 15000 ; }
|
org . junit . Assert . assertNotNull ( ( ( users . size ( ) ) == 1 ) )
|
test_matchSubUrls_ok_one_param_suffix ( ) { java . util . Map < java . lang . String , java . lang . String > params = urlMarcher . matchSubUrls ( "{id}-test" , "abc-test" ) ; java . util . Map < java . lang . String , java . lang . String > expectParams = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; expectParams . put ( "id" , "abc" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { boolean result = false ; if ( other instanceof com . webpagebytes . cms . template . FreeMarkerTemplateObject ) { com . webpagebytes . cms . template . FreeMarkerTemplateObject that = ( ( com . webpagebytes . cms . template . FreeMarkerTemplateObject ) ( other ) ) ; result = ( ( ( this . lastModified ) == ( that . lastModified ) ) && ( this . externalKey . equals ( that . externalKey ) ) ) && ( this . type . equals ( that . type ) ) ; } return result ; }
|
org . junit . Assert . assertTrue ( params . equals ( expectParams ) )
|
testValidateLimits0 ( ) { java . lang . String string = "<sp>" ; boolean result = org . oscm . validator . ADMValidator . containsOnlyValidIdChars ( string ) ; "<AssertPlaceHolder>" ; } containsOnlyValidIdChars ( java . lang . String ) { if ( value == null ) { return true ; } java . util . regex . Matcher matcher = org . oscm . validator . ADMValidator . INVALID_ID_CHARS . matcher ( value ) ; return ! ( matcher . find ( ) ) ; }
|
org . junit . Assert . assertTrue ( result )
|
testGetSummaryString1Element ( ) { com . box . l10n . mojito . service . branch . notification . slack . BranchNotificationMessageBuilderSlack branchNotificationMessageBuilderSlack = getBranchNotificationMessageBuilder ( ) ; java . lang . String summaryString = branchNotificationMessageBuilderSlack . getSummaryString ( java . util . Arrays . asList ( "string<sp>1" ) ) ; "<AssertPlaceHolder>" ; } getSummaryString ( java . util . List ) { return strings . stream ( ) . limit ( com . box . l10n . mojito . service . branch . notification . slack . BranchNotificationMessageBuilderSlack . STRING_IN_SUMMARY_COUNT ) . map ( ( s ) -> org . apache . commons . lang . StringUtils . abbreviate ( s , com . box . l10n . mojito . service . branch . notification . slack . BranchNotificationMessageBuilderSlack . STRING_IN_SUMMARY_ABRREVIATE_LENGHT ) ) . collect ( java . util . stream . Collectors . joining ( ",<sp>" ) ) ; }
|
org . junit . Assert . assertEquals ( "string<sp>1" , summaryString )
|
testBlanksSituation ( ) { nom . tam . fits . FitsFactory . setLongStringsEnabled ( true ) ; nom . tam . fits . FitsFactory . setUseHierarch ( true ) ; nom . tam . fits . FitsFactory . setHierarchFormater ( new nom . tam . fits . header . hierarch . BlanksDotHierarchKeyFormatter ( 2 ) ) ; nom . tam . fits . Fits fitsSrc = null ; java . io . FileInputStream stream = null ; try { stream = new java . io . FileInputStream ( nom . tam . fits . util . BlackBoxImages . getBlackBoxImage ( "16913-1.fits" ) ) ; nom . tam . fits . BasicHDU < ? > bhduMain = null ; fitsSrc = new nom . tam . fits . Fits ( stream ) ; bhduMain = fitsSrc . readHDU ( ) ; nom . tam . util . Cursor < java . lang . String , nom . tam . fits . HeaderCard > iterator = bhduMain . getHeader ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { nom . tam . fits . HeaderCard headerCard = ( ( nom . tam . fits . HeaderCard ) ( iterator . next ( ) ) ) ; java . lang . String start = headerCard . getKey ( ) ; if ( start . isEmpty ( ) ) { "" . toString ( ) ; } start = ( start + "<sp>" ) . substring ( 0 , 8 ) ; "<AssertPlaceHolder>" ; } } finally { nom . tam . util . SafeClose . close ( fitsSrc ) ; nom . tam . util . SafeClose . close ( stream ) ; } } toString ( ) { return toString ( nom . tam . fits . FitsFactory . current ( ) ) ; }
|
org . junit . Assert . assertTrue ( headerCard . toString ( ) . startsWith ( start ) )
|
testToStringOfCircularObject ( ) { just . niubi . json . Json . Json x = just . niubi . json . Json . Json . object ( "name" , "x" , "tuple" , just . niubi . json . Json . Json . array ( ) ) ; just . niubi . json . Json . Json y = just . niubi . json . Json . Json . object ( "backref" , x ) ; x . at ( "tuple" ) . add ( y ) ; java . lang . String asstring = x . toString ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( asstring . contains ( "tuple" ) )
|
testUpdateClusterAssignmentData ( ) { org . apache . bookkeeper . stream . proto . cluster . ClusterAssignmentData assignmentData = org . apache . bookkeeper . stream . proto . cluster . ClusterAssignmentData . newBuilder ( ) . putServers ( "server-0" , org . apache . bookkeeper . stream . proto . cluster . ServerAssignmentData . newBuilder ( ) . addContainers ( 1L ) . addContainers ( 2L ) . build ( ) ) . build ( ) ; store . updateClusterAssignmentData ( assignmentData ) ; "<AssertPlaceHolder>" ; } getClusterAssignmentData ( ) { return assignmentData ; }
|
org . junit . Assert . assertEquals ( assignmentData , store . getClusterAssignmentData ( ) )
|
testImportTechnicalService_OnBehalfActingNotSet ( ) { svcProv . importTechnicalServices ( org . oscm . serviceprovisioningservice . bean . TECHNICAL_SERVICES_XML . getBytes ( "UTF-8" ) ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . serviceprovisioningservice . bean . Override public org . oscm . serviceprovisioningservice . bean . Void call ( ) throws org . oscm . serviceprovisioningservice . bean . Exception { org . oscm . domobjects . Organization org = org . oscm . test . data . Organizations . findOrganization ( mgr , providerOrganizationId ) ; org . oscm . domobjects . TechnicalProduct techPrd = org . getTechnicalProducts ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; return null ; } } ) ; } isAllowingOnBehalfActing ( ) { return dataContainer . isAllowingOnBehalfActing ( ) ; }
|
org . junit . Assert . assertEquals ( false , techPrd . isAllowingOnBehalfActing ( ) )
|
t01_find ( ) { com . jajja . jorm . Transaction moria = psql . Moria . open ( ) ; try { moria . Goblin goblin = moria . select ( moria . Goblin . class , "SELECT<sp>*<sp>FROM<sp>#1#<sp>LIMIT<sp>1" , moria . Goblin . class ) ; "<AssertPlaceHolder>" ; } catch ( java . sql . SQLException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; moria . rollback ( ) ; } finally { moria . close ( ) ; } } select ( java . lang . Class , java . lang . String , java . lang . Object [ ] ) { return com . jajja . jorm . Record . transaction ( clazz ) . select ( clazz , sql , params ) ; }
|
org . junit . Assert . assertNotNull ( goblin )
|
shouldReturnNullWhenNullIsProvided ( ) { java . util . Properties props = new java . util . Properties ( ) ; org . aeonbits . owner . StrSubstitutor substitutor = new org . aeonbits . owner . StrSubstitutor ( props ) ; "<AssertPlaceHolder>" ; } replace ( java . lang . String ) { if ( source == null ) return null ; java . util . regex . Matcher m = org . aeonbits . owner . StrSubstitutor . PATTERN . matcher ( source ) ; java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; while ( m . find ( ) ) { java . lang . String var = m . group ( 1 ) ; java . lang . String value = values . getProperty ( var ) ; java . lang . String replacement = ( value != null ) ? replace ( value ) : "" ; m . appendReplacement ( sb , java . util . regex . Matcher . quoteReplacement ( replacement ) ) ; } m . appendTail ( sb ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertNull ( substitutor . replace ( null ) )
|
test_getDataSet ( ) { cn . cerc . core . DataSet ds = new cn . cerc . core . DataSet ( ) ; for ( int i = 1 ; i < 3 ; i ++ ) ds . append ( ) . setField ( "Code" , ( "C00" + i ) ) . setField ( "Name" , ( "N00" + i ) ) ; java . lang . String str = cn . cerc . mis . mail . HtmlGrid . getDataSet ( ds ) ; "<AssertPlaceHolder>" ; } getDataSet ( cn . cerc . core . DataSet ) { cn . cerc . mis . mail . HtmlRow row ; java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; cn . cerc . mis . mail . HtmlGrid head = new cn . cerc . mis . mail . HtmlGrid ( null ) ; row = head . addRow ( ) ; for ( java . lang . String field : ds . getHead ( ) . getFieldDefs ( ) . getFields ( ) ) row . addCol ( field ) ; row = head . addRow ( ) ; for ( java . lang . String field : ds . getHead ( ) . getFieldDefs ( ) . getFields ( ) ) row . addCol ( ds . getHead ( ) . getField ( field ) ) ; cn . cerc . mis . mail . HtmlGrid detail = new cn . cerc . mis . mail . HtmlGrid ( null ) ; ds . first ( ) ; row = detail . addRow ( ) ; for ( java . lang . String field : ds . getFieldDefs ( ) . getFields ( ) ) row . addCol ( field ) ; while ( ds . fetch ( ) ) { row = detail . addRow ( ) ; for ( java . lang . String field : ds . getFieldDefs ( ) . getFields ( ) ) row . addCol ( ds . getField ( field ) ) ; } sb . append ( "<!DOCTYPE<sp>html>" ) ; sb . append ( "<head>" ) ; sb . append ( "<meta<sp>http-equiv=\"Content-Type\"<sp>content=\"text/html;<sp>charset=utf-8\"<sp>/>" ) ; sb . append ( "</head>" ) ; sb . append ( "<body>" ) ; head . getHtml ( sb ) ; detail . getHtml ( sb ) ; sb . append ( "</body></html>" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertTrue ( ( ! ( "" . equals ( str ) ) ) )
|
deserializationSortedTest ( ) { org . springframework . core . io . Resource r = new org . springframework . core . io . ClassPathResource ( "sorted-feed.json" ) ; java . lang . String json = org . apache . commons . io . IOUtils . toString ( r . getInputStream ( ) , java . nio . charset . Charset . defaultCharset ( ) ) ; com . thinkbiganalytics . feedmgr . rest . model . FeedMetadata feed = com . thinkbiganalytics . json . ObjectMapperSerializer . deserialize ( json , com . thinkbiganalytics . feedmgr . rest . model . FeedMetadata . class ) ; "<AssertPlaceHolder>" ; } deserialize ( java . lang . String , java . lang . Class ) { try { return com . thinkbiganalytics . json . ObjectMapperSerializer . getMapper ( ) . readValue ( json , clazz ) ; } catch ( java . io . IOException e ) { com . thinkbiganalytics . json . ObjectMapperSerializer . log . error ( "Error<sp>de-serializing<sp>object<sp>for<sp>class<sp>{}<sp>" , clazz , e ) ; throw new java . lang . RuntimeException ( "error<sp>de-serializing<sp>object" , e ) ; } }
|
org . junit . Assert . assertNotNull ( feed )
|
getAccessLevelWithGuestUserAndGuestOwner ( ) { org . phenotips . data . Patient p = mock ( org . phenotips . data . Patient . class ) ; org . phenotips . data . permissions . internal . EntityAccessHelper helper = 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 , helper , am , vm ) ; when ( am . getOwner ( p ) ) . thenReturn ( org . phenotips . data . permissions . internal . DefaultPatientAccessTest . GUEST_OWNER_OBJECT ) ; when ( helper . getCurrentUser ( ) ) . thenReturn ( null ) ; org . phenotips . data . permissions . Visibility privateV = mock ( org . phenotips . data . permissions . Visibility . class ) ; when ( vm . getVisibility ( p ) ) . thenReturn ( privateV ) ; org . phenotips . data . permissions . AccessLevel none = new org . phenotips . data . permissions . internal . access . NoAccessLevel ( ) ; when ( privateV . getDefaultAccessLevel ( ) ) . thenReturn ( none ) ; org . phenotips . data . permissions . AccessLevel owner = new org . phenotips . data . permissions . internal . access . OwnerAccessLevel ( ) ; when ( am . resolveAccessLevel ( "owner" ) ) . thenReturn ( owner ) ; "<AssertPlaceHolder>" ; } getAccessLevel ( ) { return this . access ; }
|
org . junit . Assert . assertSame ( owner , pa . getAccessLevel ( ) )
|
testTimeFor_FiftyThousand ( ) { tests . models . Choir testChoir = new tests . models . Choir ( ) ; tests . models . Address choirAddress = new tests . models . Address ( ) ; choirAddress . setCity ( "Omaha" ) ; choirAddress . setState ( "NE" ) ; testChoir . setChoirName ( "Omaha<sp>Children's<sp>Choir" ) ; testChoir . setAddress ( choirAddress ) ; org . apache . commons . lang3 . time . StopWatch timer = new org . apache . commons . lang3 . time . StopWatch ( ) ; java . lang . String result = null ; timer . start ( ) ; for ( int i = 0 ; i < 50000 ; i ++ ) { result = utils . TestUtility . post ( ( ( timeTestBase ) + "names" ) , testChoir . toJson ( false ) ) ; } timer . stop ( ) ; "<AssertPlaceHolder>" ; tests . TimeTests . say ( ( "\n\nTime<sp>taken<sp>=<sp>" + ( timer . getTime ( ) ) ) ) ; tests . TimeTests . say ( ( "Time<sp>taken<sp>(nano)<sp>=<sp>" + ( timer . getNanoTime ( ) ) ) ) ; } toJson ( boolean ) { com . fasterxml . jackson . databind . ObjectMapper mapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; mapper . setVisibility ( mapper . getSerializationConfig ( ) . getDefaultVisibilityChecker ( ) . withFieldVisibility ( com . fasterxml . jackson . annotation . JsonAutoDetect . Visibility . ANY ) . withGetterVisibility ( com . fasterxml . jackson . annotation . JsonAutoDetect . Visibility . NONE ) . withSetterVisibility ( com . fasterxml . jackson . annotation . JsonAutoDetect . Visibility . NONE ) . withCreatorVisibility ( com . fasterxml . jackson . annotation . JsonAutoDetect . Visibility . NONE ) ) ; java . lang . String toret = "" ; if ( pretty ) { mapper . enable ( com . fasterxml . jackson . databind . SerializationFeature . INDENT_OUTPUT ) ; } try { toret = mapper . writeValueAsString ( this ) ; } catch ( com . fasterxml . jackson . core . JsonProcessingException e ) { e . printStackTrace ( ) ; } return toret ; }
|
org . junit . Assert . assertNotNull ( result )
|
testDictionaryToMap ( ) { java . util . Dictionary < java . lang . String , java . lang . Object > dict = new org . osgi . util . converter . TestDictionary ( ) ; dict . put ( "foo" , "hello" ) ; @ org . osgi . util . converter . SuppressWarnings ( "rawtypes" ) java . util . Map m = converter . convert ( dict ) . to ( java . util . Map . class ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { if ( ! ( key instanceof java . lang . String ) ) { throw new java . lang . IllegalArgumentException ( "Key<sp>must<sp>be<sp>of<sp>type<sp>String!" ) ; } return super . get ( key ) ; }
|
org . junit . Assert . assertEquals ( "hello" , m . get ( "foo" ) )
|
testBasicGetNextLogic ( ) { final org . apache . flink . runtime . io . network . partition . consumer . SingleInputGate inputGate = createInputGate ( ) ; final org . apache . flink . runtime . io . network . partition . consumer . TestInputChannel [ ] inputChannels = new org . apache . flink . runtime . io . network . partition . consumer . TestInputChannel [ ] { new org . apache . flink . runtime . io . network . partition . consumer . TestInputChannel ( inputGate , 0 ) , new org . apache . flink . runtime . io . network . partition . consumer . TestInputChannel ( inputGate , 1 ) } ; inputGate . setInputChannel ( new org . apache . flink . runtime . jobgraph . IntermediateResultPartitionID ( ) , inputChannels [ 0 ] ) ; inputGate . setInputChannel ( new org . apache . flink . runtime . jobgraph . IntermediateResultPartitionID ( ) , inputChannels [ 1 ] ) ; inputChannels [ 0 ] . readBuffer ( ) ; inputChannels [ 0 ] . readBuffer ( ) ; inputChannels [ 1 ] . readBuffer ( ) ; inputChannels [ 1 ] . readEndOfPartitionEvent ( ) ; inputChannels [ 0 ] . readEndOfPartitionEvent ( ) ; inputGate . notifyChannelNonEmpty ( inputChannels [ 0 ] ) ; inputGate . notifyChannelNonEmpty ( inputChannels [ 1 ] ) ; org . apache . flink . runtime . io . network . partition . consumer . SingleInputGateTest . verifyBufferOrEvent ( inputGate , true , 0 , true ) ; org . apache . flink . runtime . io . network . partition . consumer . SingleInputGateTest . verifyBufferOrEvent ( inputGate , true , 1 , true ) ; org . apache . flink . runtime . io . network . partition . consumer . SingleInputGateTest . verifyBufferOrEvent ( inputGate , true , 0 , true ) ; org . apache . flink . runtime . io . network . partition . consumer . SingleInputGateTest . verifyBufferOrEvent ( inputGate , false , 1 , true ) ; org . apache . flink . runtime . io . network . partition . consumer . SingleInputGateTest . verifyBufferOrEvent ( inputGate , false , 0 , false ) ; "<AssertPlaceHolder>" ; } isFinished ( ) { return positionMarker . isFinished ( ) ; }
|
org . junit . Assert . assertTrue ( inputGate . isFinished ( ) )
|
classifyByDataSourceUrlTest ( ) { final java . lang . String id = "test_app" ; long timestamp = new com . navercorp . pinpoint . web . service . stat . Date ( ) . getTime ( ) ; com . navercorp . pinpoint . web . service . stat . ApplicationDataSourceService applicationDataSourceService = new com . navercorp . pinpoint . web . service . stat . ApplicationDataSourceService ( ) ; com . navercorp . pinpoint . web . service . stat . Map < com . navercorp . pinpoint . common . server . bo . stat . join . JoinDataSourceListBo . DataSourceKey , com . navercorp . pinpoint . web . service . stat . List < com . navercorp . pinpoint . web . vo . stat . AggreJoinDataSourceBo > > dataSourceKeyListMap = applicationDataSourceService . classifyByDataSourceUrl ( createJoinDataSourceListBoList ( id , timestamp ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . queue . size ( ) ; }
|
org . junit . Assert . assertEquals ( dataSourceKeyListMap . size ( ) , 5 )
|
addClassifierEmptyAcl ( ) { org . opendaylight . sfc . scfofrenderer . processors . OpenflowClassifierProcessor classifierManager = new org . opendaylight . sfc . scfofrenderer . processors . OpenflowClassifierProcessor ( readWriteTransaction , classifierInterface , new org . opendaylight . sfc . scfofrenderer . flowgenerators . BareClassifier ( ) ) ; when ( accessListEntries . getAce ( ) ) . thenReturn ( new java . util . ArrayList ( ) ) ; java . util . List < org . opendaylight . sfc . util . openflow . writer . FlowDetails > theFlows = classifierManager . processClassifier ( sffClassifier , acl , true ) ; "<AssertPlaceHolder>" ; } processClassifier ( org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . scf . rev140701 . service . function . classifiers . service . function . classifier . SclServiceFunctionForwarder , org . opendaylight . yang . gen . v1 . urn . ietf . params . xml . ns . yang . ietf . access . control . list . rev160218 . access . lists . Acl , boolean ) { addClassifier = addClassifierScenario ; java . util . Optional < org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . sff . rev140701 . service . function . forwarders . ServiceFunctionForwarder > sff = java . util . Optional . of ( new org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . common . rev151017 . SffName ( theClassifier . getName ( ) ) ) . map ( SfcProviderServiceForwarderAPI :: readServiceFunctionForwarder ) ; java . util . Optional < java . lang . String > itfName = classifierHandler . getInterfaceNameFromClassifier ( theClassifier ) ; if ( ( ! ( sff . isPresent ( ) ) ) || ( ! ( itfName . isPresent ( ) ) ) ) { org . opendaylight . sfc . scfofrenderer . processors . OpenflowClassifierProcessor . LOG . error ( ( "createdServiceFunctionClassifier:<sp>" + "Cannot<sp>install<sp>ACL<sp>rules<sp>in<sp>classifier.<sp>SFF<sp>exists?<sp>{};<sp>Interface<sp>exists?<sp>{}" ) , sff . isPresent ( ) , itfName . isPresent ( ) ) ; return java . util . Collections . emptyList ( ) ; } if ( classifierHandler . usesLogicalInterfaces ( sff . get ( ) ) ) { if ( addClassifierScenario ) { org . opendaylight . sfc . scfofrenderer . logicalclassifier . ClassifierGeniusIntegration . performGeniusServiceBinding ( tx , itfName . get ( ) ) ; org . opendaylight . sfc . scfofrenderer . processors . OpenflowClassifierProcessor . LOG . info ( "processClassifier<sp>-<sp>Bound<sp>interface<sp>{}" , itfName . get ( ) ) ; } else { org . opendaylight . sfc . scfofrenderer . logicalclassifier . ClassifierGeniusIntegration . performGeniusServiceUnbinding ( tx , itfName . get ( ) ) ; org . opendaylight . sfc . scfofrenderer . processors . OpenflowClassifierProcessor . LOG . info ( "processClassifier<sp>-<sp>Unbound<sp>interface<sp>{}" , itfName . get ( ) ) ; } } return theAcl . getAccessListEntries ( ) . getAce ( ) . stream ( ) . map ( ( theAce ) -> processAce ( itfName , sff . get ( ) , theClassifier . getName ( ) , theAcl . getAclName ( ) , theAce ) ) . reduce ( new java . util . ArrayList ( ) , ( dstList , theList ) -> java . util . stream . Stream . concat ( dstList . stream ( ) , theList . stream ( ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( theFlows . isEmpty ( ) )
|
shouldReturnOkWhenRetrievingStats ( ) { doReturn ( true ) . when ( restApiConfiguration ) . hasKeys ( PublicApiServiceConfigurationKeys . stats ) ; doReturn ( "true" ) . when ( restApiConfiguration ) . getString ( PublicApiServiceConfigurationKeys . stats ) ; when ( loadBalancerService . get ( anyInt ( ) , anyInt ( ) ) ) . thenReturn ( null ) ; doReturn ( stats ) . when ( reverseProxyLoadBalancerService ) . getLoadBalancerStats ( org . mockito . Matchers . any ( org . openstack . atlas . service . domain . entities . LoadBalancer . class ) ) ; response = loadBalancerResource . retrieveLoadBalancerStats ( ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) )
|
validate_shouldPassWhenObsHasValidConceptIdAndValidConceptAnswerIds ( ) { java . lang . String xml = "<htmlform><obs<sp>conceptId=\"21\"<sp>answerConceptIds=\"7,8\">TEST</obs></htmlform>" ; org . openmrs . module . htmlformentry . handler . TagAnalysis analysis = validateObsTag ( xml ) ; "<AssertPlaceHolder>" ; } getWarnings ( ) { return warnings ; }
|
org . junit . Assert . assertEquals ( 0 , analysis . getWarnings ( ) . size ( ) )
|
testAddAdditionalProperties ( ) { com . streamsets . pipeline . stage . destination . elasticsearch . ElasticsearchTarget target = createTarget ( "${time:now()}" , "${record:value('/index')}" , "docId" , ElasticsearchOperationType . UPDATE , "" , "" ) ; java . lang . String expected = ",\"_retry_on_conflict\":1" ; "<AssertPlaceHolder>" ; } addAdditionalProperties ( ) { com . google . gson . JsonParser parser = new com . google . gson . JsonParser ( ) ; com . google . gson . JsonObject additionalPropertiesAsJson = parser . parse ( conf . rawAdditionalProperties ) . getAsJsonObject ( ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; additionalPropertiesAsJson . entrySet ( ) . forEach ( ( e ) -> sb . append ( java . lang . String . format ( ",\"%s\":%s" , e . getKey ( ) , e . getValue ( ) ) ) ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , target . addAdditionalProperties ( ) )
|
testKeep ( ) { com . performizeit . mjprof . parser . ThreadInfo js = new com . performizeit . mjprof . parser . ThreadInfo ( ( ( ( ( strt ) + ( stck ) ) + ( akkka ) ) + ( stck2 ) ) ) ; com . performizeit . mjprof . plugins . mappers . singlethread . StackFrameContains tb = new com . performizeit . mjprof . plugins . mappers . singlethread . StackFrameContains ( "com.akkka" ) ; com . performizeit . mjprof . parser . ThreadInfo js2 = tb . map ( js ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( stepName ) . append ( "/" ) ; for ( java . lang . String stepV : stepArgs ) { sb . append ( stepV ) . append ( "," ) ; } sb . append ( "/" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( ( ( strt ) + ( akkka ) ) , js2 . toString ( ) )
|
shouldCloseAllOperationInputsWhenExceptionIsThrownWhenJobExecuted ( ) { final java . lang . Exception exception = mock ( uk . gov . gchq . gaffer . graph . RuntimeException . class ) ; final uk . gov . gchq . gaffer . store . Store store = mock ( uk . gov . gchq . gaffer . store . Store . class ) ; given ( store . executeJob ( clonedOpChain , clonedContext ) ) . willThrow ( exception ) ; final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema ( ) ; given ( store . getSchema ( ) ) . willReturn ( schema ) ; given ( store . getProperties ( ) ) . willReturn ( new uk . gov . gchq . gaffer . store . StoreProperties ( ) ) ; final uk . gov . gchq . gaffer . graph . Graph graph = new uk . gov . gchq . gaffer . graph . Graph . Builder ( ) . config ( new uk . gov . gchq . gaffer . graph . GraphConfig . Builder ( ) . graphId ( uk . gov . gchq . gaffer . graph . GraphTest . GRAPH_ID ) . build ( ) ) . storeProperties ( uk . gov . gchq . gaffer . commonutil . StreamUtil . storeProps ( getClass ( ) ) ) . store ( store ) . addSchema ( new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . build ( ) ) . build ( ) ; try { graph . executeJob ( opChain , context ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( final java . lang . Exception e ) { "<AssertPlaceHolder>" ; verify ( clonedOpChain ) . close ( ) ; } } executeJob ( uk . gov . gchq . gaffer . operation . Operation , uk . gov . gchq . gaffer . user . User ) { return executeJob ( new uk . gov . gchq . gaffer . graph . GraphRequest ( operation , user ) ) . getResult ( ) ; }
|
org . junit . Assert . assertSame ( exception , e )
|
testContentTypeApplicationXml ( ) { org . r10r . doctester . testbrowser . Request request = org . r10r . doctester . testbrowser . Request . GET ( ) . contentTypeApplicationXml ( ) ; "<AssertPlaceHolder>" ; } contentTypeApplicationXml ( ) { addHeader ( HttpConstants . HEADER_CONTENT_TYPE , HttpConstants . APPLICATION_XML_WITH_CHARSET_UTF_8 ) ; return this ; }
|
org . junit . Assert . assertThat ( request . headers . get ( HttpConstants . HEADER_CONTENT_TYPE ) , org . hamcrest . CoreMatchers . equalTo ( HttpConstants . APPLICATION_XML_WITH_CHARSET_UTF_8 ) )
|
testGetSinaStockClassUrl ( ) { java . lang . String curl = cn . edu . zju . vlis . bigdata . common . UrlFactory . getSinaStockClassUrl ( "class" ) ; java . lang . String expUrl = "http://money.finance.sina.com.cn/q/view/newFLJK.php?param=class" ; "<AssertPlaceHolder>" ; } getSinaStockClassUrl ( java . lang . String ) { java . lang . String root = "http://money.finance.sina.com.cn/q/view/newFLJK.php?param=" ; return root + className ; }
|
org . junit . Assert . assertEquals ( expUrl , curl )
|
testEncode ( ) { System . out . println ( "encode" ) ; java . lang . CharSequence rawPassword = "test" ; java . lang . String expResult = "test" ; java . lang . String result = instance . encode ( rawPassword ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testAllLocationsHealthy ( ) { final java . util . List < org . apache . hadoop . hdfs . server . datanode . StorageLocation > locations = makeMockLocations ( org . apache . hadoop . hdfs . server . datanode . checker . HEALTHY , org . apache . hadoop . hdfs . server . datanode . checker . HEALTHY , org . apache . hadoop . hdfs . server . datanode . checker . HEALTHY ) ; final org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . hdfs . HdfsConfiguration ( ) ; conf . setInt ( org . apache . hadoop . hdfs . DFSConfigKeys . DFS_DATANODE_FAILED_VOLUMES_TOLERATED_KEY , 0 ) ; org . apache . hadoop . hdfs . server . datanode . checker . StorageLocationChecker checker = new org . apache . hadoop . hdfs . server . datanode . checker . StorageLocationChecker ( conf , new org . apache . hadoop . util . FakeTimer ( ) ) ; java . util . List < org . apache . hadoop . hdfs . server . datanode . StorageLocation > filteredLocations = checker . check ( conf , locations ) ; "<AssertPlaceHolder>" ; for ( org . apache . hadoop . hdfs . server . datanode . StorageLocation location : locations ) { verify ( location ) . check ( any ( StorageLocation . CheckContext . class ) ) ; } } size ( ) { return loggers . size ( ) ; }
|
org . junit . Assert . assertThat ( filteredLocations . size ( ) , org . hamcrest . CoreMatchers . is ( 3 ) )
|
shouldFindValuesWithinRange ( ) { final java . lang . String key = "a" ; bytesStore . put ( serializeKey ( new org . apache . kafka . streams . kstream . Windowed ( key , windows [ 0 ] ) ) , serializeValue ( 10 ) ) ; bytesStore . put ( serializeKey ( new org . apache . kafka . streams . kstream . Windowed ( key , windows [ 1 ] ) ) , serializeValue ( 50 ) ) ; bytesStore . put ( serializeKey ( new org . apache . kafka . streams . kstream . Windowed ( key , windows [ 2 ] ) ) , serializeValue ( 100 ) ) ; final org . apache . kafka . streams . state . KeyValueIterator < org . apache . kafka . common . utils . Bytes , byte [ ] > results = bytesStore . fetch ( org . apache . kafka . common . utils . Bytes . wrap ( key . getBytes ( ) ) , 1 , 999 ) ; final java . util . List < org . apache . kafka . streams . KeyValue < org . apache . kafka . streams . kstream . Windowed < java . lang . String > , java . lang . Long > > expected = java . util . Arrays . asList ( org . apache . kafka . streams . KeyValue . pair ( new org . apache . kafka . streams . kstream . Windowed ( key , windows [ 0 ] ) , 10L ) , org . apache . kafka . streams . KeyValue . pair ( new org . apache . kafka . streams . kstream . Windowed ( key , windows [ 1 ] ) , 50L ) ) ; "<AssertPlaceHolder>" ; } toList ( java . util . Iterator ) { java . util . List < T > res = new java . util . ArrayList ( ) ; while ( iterator . hasNext ( ) ) res . add ( iterator . next ( ) ) ; return res ; }
|
org . junit . Assert . assertEquals ( expected , toList ( results ) )
|
whenActivityStateIsSetWithGenericMethodAndInteger_itMustBeSetCorrectly ( ) { jsprit . core . problem . solution . route . activity . TourActivity activity = mock ( jsprit . core . problem . solution . route . activity . TourActivity . class ) ; when ( activity . getIndex ( ) ) . thenReturn ( 1 ) ; jsprit . core . algorithm . state . StateManager stateManager = new jsprit . core . algorithm . state . StateManager ( vrpMock ) ; jsprit . core . algorithm . state . StateId id = stateManager . createStateId ( "myState" ) ; int load = 3 ; stateManager . putActivityState ( activity , id , load ) ; int getLoad = stateManager . getActivityState ( activity , id , jsprit . core . algorithm . state . Integer . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 3 , getLoad )
|
printRyaStreamsDetails_configured ( ) { final org . apache . rya . api . client . RyaClient mockCommands = mock ( org . apache . rya . api . client . RyaClient . class ) ; final org . apache . rya . api . client . GetInstanceDetails getDetails = mock ( org . apache . rya . api . client . GetInstanceDetails . class ) ; when ( mockCommands . getGetInstanceDetails ( ) ) . thenReturn ( getDetails ) ; final org . apache . rya . api . instance . RyaDetails details = mock ( org . apache . rya . api . instance . RyaDetails . class ) ; when ( details . getRyaStreamsDetails ( ) ) . thenReturn ( com . google . common . base . Optional . of ( new org . apache . rya . api . instance . RyaDetails . RyaStreamsDetails ( "localhost" , 6 ) ) ) ; when ( getDetails . getDetails ( eq ( "unitTest" ) ) ) . thenReturn ( com . google . common . base . Optional . of ( details ) ) ; final org . apache . rya . shell . SharedShellState state = new org . apache . rya . shell . SharedShellState ( ) ; state . connectedToAccumulo ( mock ( org . apache . rya . api . client . accumulo . AccumuloConnectionDetails . class ) , mockCommands ) ; state . connectedToInstance ( "unitTest" ) ; final org . apache . rya . shell . RyaStreamsCommands commands = new org . apache . rya . shell . RyaStreamsCommands ( state , mock ( org . apache . rya . shell . util . SparqlPrompt . class ) , mock ( org . apache . rya . shell . util . ConsolePrinter . class ) ) ; final java . lang . String message = commands . printRyaStreamsDetails ( ) ; final java . lang . String expected = "Kafka<sp>Hostname:<sp>localhost,<sp>Kafka<sp>Port:<sp>6" ; "<AssertPlaceHolder>" ; } printRyaStreamsDetails ( ) { final java . lang . String ryaInstance = state . getShellState ( ) . getRyaInstanceName ( ) . get ( ) ; final org . apache . rya . api . client . RyaClient client = state . getShellState ( ) . getConnectedCommands ( ) . get ( ) ; try { final com . google . common . base . Optional < org . apache . rya . api . instance . RyaDetails > details = client . getGetInstanceDetails ( ) . getDetails ( ryaInstance ) ; if ( ! ( details . isPresent ( ) ) ) { return "This<sp>instance<sp>does<sp>not<sp>have<sp>any<sp>Rya<sp>Details,<sp>so<sp>it<sp>is<sp>unable<sp>to<sp>be<sp>connected<sp>to<sp>the<sp>Rya<sp>Streams<sp>subsystem." ; } final com . google . common . base . Optional < org . apache . rya . api . instance . RyaDetails . RyaStreamsDetails > streamsDetails = details . get ( ) . getRyaStreamsDetails ( ) ; if ( ! ( streamsDetails . isPresent ( ) ) ) { return "This<sp>instance<sp>of<sp>Rya<sp>has<sp>not<sp>been<sp>configured<sp>to<sp>use<sp>a<sp>Rya<sp>Streams<sp>subsystem." ; } return ( ( "Kafka<sp>Hostname:<sp>" + ( streamsDetails . get ( ) . getHostname ( ) ) ) + ",<sp>Kafka<sp>Port:<sp>" ) + ( streamsDetails . get ( ) . getPort ( ) ) ; } catch ( final org . apache . rya . api . client . RyaClientException e ) { throw new java . lang . RuntimeException ( "Could<sp>not<sp>fetch<sp>the<sp>Rya<sp>Details<sp>for<sp>this<sp>Rya<sp>instance." , e ) ; } }
|
org . junit . Assert . assertEquals ( expected , message )
|
test ( ) { java . util . List < edu . emory . clir . clearnlp . collection . pair . ObjectIntPair < java . lang . String > > items = edu . emory . clir . clearnlp . util . DSUtils . toArrayList ( new edu . emory . clir . clearnlp . collection . pair . ObjectIntPair < java . lang . String > ( "A" , 1 ) , new edu . emory . clir . clearnlp . collection . pair . ObjectIntPair < java . lang . String > ( "B" , 2 ) , new edu . emory . clir . clearnlp . collection . pair . ObjectIntPair < java . lang . String > ( "C" , 3 ) ) ; edu . emory . clir . clearnlp . collection . map . IntObjectHashMap < java . lang . String > map = new edu . emory . clir . clearnlp . collection . map . IntObjectHashMap ( ) ; for ( edu . emory . clir . clearnlp . collection . pair . ObjectIntPair < java . lang . String > item : items ) map . put ( item . i , item . o ) ; java . io . ByteArrayOutputStream bout = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream out = new java . io . ObjectOutputStream ( new java . io . BufferedOutputStream ( bout ) ) ; out . writeObject ( map ) ; out . close ( ) ; java . io . ObjectInputStream in = new java . io . ObjectInputStream ( new java . io . BufferedInputStream ( new java . io . ByteArrayInputStream ( bout . toByteArray ( ) ) ) ) ; map = ( ( edu . emory . clir . clearnlp . collection . map . IntObjectHashMap < java . lang . String > ) ( in . readObject ( ) ) ) ; in . close ( ) ; for ( edu . emory . clir . clearnlp . collection . pair . ObjectIntPair < java . lang . String > item : items ) "<AssertPlaceHolder>" ; } get ( int ) { return g_map . get ( key ) ; }
|
org . junit . Assert . assertEquals ( item . o , map . get ( item . i ) )
|
testHandleUrlAsPath ( ) { final java . lang . String hostPart = "swift://container.service1" ; final java . lang . String pathPart = "/home/user/files/file1" ; final java . lang . String uriString = hostPart + pathPart ; final org . apache . hadoop . fs . swift . util . SwiftObjectPath expected = new org . apache . hadoop . fs . swift . util . SwiftObjectPath ( uriString , pathPart ) ; final org . apache . hadoop . fs . swift . util . SwiftObjectPath actual = new org . apache . hadoop . fs . swift . util . SwiftObjectPath ( uriString , uriString ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
create_new_set_apache ( ) { @ com . levelup . java . collections . SuppressWarnings ( "unchecked" ) java . util . Set < java . lang . String > newSet = org . apache . commons . collections . SetUtils . EMPTY_SET ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( newSet )
|
testIn ( ) { java . util . List < java . lang . String > names = new java . util . ArrayList < java . lang . String > ( ) ; names . add ( "" ) ; names . add ( "" ) ; template . in ( "name" , names ) ; java . util . List < java . lang . Object > list = template . getResultList ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . size ; }
|
org . junit . Assert . assertTrue ( ( ( list . size ( ) ) == 2 ) )
|
testMapExists ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( map )
|
buildDownstream ( ) { com . vackosar . gitflowincrementalbuild . boundary . Configuration configuration = new com . vackosar . gitflowincrementalbuild . boundary . Configuration . Provider ( mavenSessionMock ) . get ( ) ; "<AssertPlaceHolder>" ; verify ( mavenExecutionRequestMock , times ( 1 ) ) . getMakeBehavior ( ) ; } get ( ) { if ( ( configuration ) == null ) { configuration = new com . vackosar . gitflowincrementalbuild . boundary . Configuration ( mavenSession ) ; } return configuration ; }
|
org . junit . Assert . assertTrue ( configuration . buildDownstream )
|
getNodeReturnsNodeIfExists ( ) { final com . b2international . snowowl . snomed . core . tree . TerminologyTree tree = new com . b2international . snowowl . snomed . core . tree . TerminologyTreeTest . TestTree ( ) . addNode ( com . b2international . snowowl . snomed . core . tree . TerminologyTreeTest . N1 ) . build ( ) ; "<AssertPlaceHolder>" ; } getNode ( java . lang . String ) { checkArgument ( items . containsKey ( nodeId ) , "Unknown<sp>node:<sp>'%s'" , nodeId ) ; return items . get ( nodeId ) ; }
|
org . junit . Assert . assertNotNull ( tree . getNode ( com . b2international . snowowl . snomed . core . tree . TerminologyTreeTest . N1 ) )
|
testGetByAccFail ( ) { uk . ac . ebi . bioinvindex . model . Study study = dao . getByAcc ( "not_existing_acc" ) ; "<AssertPlaceHolder>" ; } getByAcc ( java . lang . String ) { java . lang . Class < T > clazz = uk . ac . ebi . bioinvindex . dao . ejb3 . OntologyEntryEJB3DAO . getPersistentClass ( ) ; return ( ( T ) ( uk . ac . ebi . bioinvindex . dao . ejb3 . OntologyEntryEJB3DAO . getSession ( ) . createCriteria ( clazz ) . add ( org . hibernate . criterion . Restrictions . eq ( "acc" , acc ) ) . uniqueResult ( ) ) ) ; }
|
org . junit . Assert . assertNull ( study )
|
testSetForeground_acceptsNull ( ) { org . eclipse . rap . rwt . template . Cell cell = new org . eclipse . rap . rwt . template . TestCell ( template , "foo" ) ; cell . setForeground ( new org . eclipse . swt . graphics . Color ( display , 0 , 0 , 0 ) ) ; cell . setForeground ( null ) ; "<AssertPlaceHolder>" ; } getForeground ( ) { checkWidget ( ) ; handleVirtual ( ) ; org . eclipse . swt . graphics . Color defaultForeground = getItemData ( ) . defaultForeground ; return defaultForeground == null ? parent . getForeground ( ) : defaultForeground ; }
|
org . junit . Assert . assertNull ( cell . getForeground ( ) )
|
postUpdate ( ) { java . util . Properties props = new java . util . Properties ( ) ; props . setProperty ( ChangeTripleService . POST_BODY_CHANGETYPE , ChangeTripleService . CHANGETYPE_UPDATE ) ; props . setProperty ( ChangeTripleService . POST_BODY_AFFECTEDTRIPLE , "<http://example.org/myconcept><sp><http://www.w3.org/2004/02/skos/core#prefLabel><sp>\"somelabel\"@en<sp>." ) ; props . setProperty ( ChangeTripleService . POST_BODY_SECONDARYTRIPLE , "<http://example.org/myconcept><sp><http://www.w3.org/2004/02/skos/core#prefLabel><sp>\"updatedlabel\"@en<sp>." ) ; "<AssertPlaceHolder>" ; } postChangeset ( java . util . Properties ) { org . apache . http . client . methods . HttpPost httpPost = new org . apache . http . client . methods . HttpPost ( ( "http://localhost:" + ( PORT ) ) ) ; java . io . StringWriter sw = new java . io . StringWriter ( ) ; properties . store ( sw , null ) ; httpPost . setEntity ( new org . apache . http . entity . StringEntity ( sw . toString ( ) ) ) ; org . apache . http . HttpResponse response = new org . apache . http . impl . client . DefaultHttpClient ( ) . execute ( httpPost ) ; return response . getStatusLine ( ) . getStatusCode ( ) ; }
|
org . junit . Assert . assertEquals ( 200 , postChangeset ( props ) )
|
testDescription ( ) { final java . lang . String name = "description<sp>text" ; testMember . addFacet ( new org . apache . isis . core . metamodel . facets . all . describedas . DescribedAsFacetAbstract ( name , testMember ) { } ) ; "<AssertPlaceHolder>" ; } getDescription ( ) { return ( org . apache . isis . core . metamodel . services . container . query . QueryFindByPattern . getResultTypeName ( ) ) + "<sp>(matching<sp>pattern)" ; }
|
org . junit . Assert . assertEquals ( name , testMember . getDescription ( ) )
|
test_deployComponent_withIndexBean_nullFile ( ) { org . talend . updates . runtime . nexus . component . NexusShareComponentsManagerTest . NexusShareComponentsManagerTestClass shareManager = new org . talend . updates . runtime . nexus . component . NexusShareComponentsManagerTest . NexusShareComponentsManagerTestClass ( org . talend . updates . runtime . nexus . component . NexusShareComponentsManagerTest . serverBean ) ; boolean deployed = shareManager . deployComponent ( null , null , null ) ; "<AssertPlaceHolder>" ; } deployComponent ( org . eclipse . core . runtime . IProgressMonitor , java . io . File , org . talend . updates . runtime . nexus . component . ComponentIndexBean ) { if ( monitor == null ) { monitor = new org . eclipse . core . runtime . NullProgressMonitor ( ) ; } org . eclipse . core . runtime . SubMonitor subMonitor = org . eclipse . core . runtime . SubMonitor . convert ( monitor , 3 ) ; if ( subMonitor . isCanceled ( ) ) { throw new org . eclipse . core . runtime . OperationCanceledException ( ) ; } if ( ( ( ( componentZipFile == null ) || ( ! ( componentZipFile . exists ( ) ) ) ) || ( ! ( componentZipFile . isFile ( ) ) ) ) || ( ! ( org . talend . commons . utils . resource . UpdatesHelper . isComponentUpdateSite ( componentZipFile ) ) ) ) { return false ; } if ( compIndexBean == null ) { compIndexBean = getIndexManager ( ) . create ( componentZipFile ) ; if ( compIndexBean == null ) { return false ; } subMonitor . worked ( 1 ) ; } org . talend . core . runtime . maven . MavenArtifact mvnArtifact = org . talend . core . runtime . maven . MavenUrlHelper . parseMvnUrl ( compIndexBean . getMvnURI ( ) ) ; if ( mvnArtifact == null ) { return false ; } try { nexusTransport . doHttpUpload ( monitor , componentZipFile , mvnArtifact ) ; subMonitor . worked ( 1 ) ; } catch ( java . lang . Exception e ) { org . talend . commons . exception . ExceptionHandler . process ( e ) ; return false ; } if ( subMonitor . isCanceled ( ) ) { throw new org . eclipse . core . runtime . OperationCanceledException ( ) ; } final org . talend . core . runtime . maven . MavenArtifact indexArtifact = getIndexArtifact ( ) ; java . io . File indexFile = null ; if ( nexusTransport . isAvailable ( subMonitor , indexArtifact ) ) { indexFile = downloadIndexFile ( monitor ) ; if ( indexFile == null ) { return false ; } boolean updated = indexManager . updateIndexFile ( indexFile , compIndexBean ) ; if ( ! updated ) { return false ; } } else { indexFile = new java . io . File ( getWorkFolder ( ) , indexArtifact . getFileName ( false ) ) ; boolean created = indexManager . createIndexFile ( indexFile , compIndexBean ) ; if ( ! created ) { return false ; } } subMonitor . worked ( 1 ) ; if ( subMonitor . isCanceled ( ) ) { throw new org . eclipse . core . runtime . OperationCanceledException ( ) ; } if ( ! ( indexFile . exists ( ) ) ) { return false ; } try { nexusTransport . doHttpUpload ( monitor , indexFile , indexArtifact ) ; subMonitor . worked ( 1 ) ; } catch ( java . lang . Exception e ) { org . talend . commons . exception . ExceptionHandler . process ( e ) ; return false ; } return true ; }
|
org . junit . Assert . assertFalse ( deployed )
|
testSerialization ( ) { final org . apache . logging . log4j . util . SortedArrayStringMap original = new org . apache . logging . log4j . util . SortedArrayStringMap ( ) ; original . putValue ( "a" , "avalue" ) ; original . putValue ( "B" , "Bvalue" ) ; original . putValue ( "3" , "3value" ) ; final byte [ ] binary = serialize ( original ) ; final org . apache . logging . log4j . util . SortedArrayStringMap copy = deserialize ( binary ) ; "<AssertPlaceHolder>" ; } deserialize ( byte [ ] ) { final java . io . ByteArrayInputStream inArr = new java . io . ByteArrayInputStream ( binary ) ; try ( final java . io . ObjectInputStream in = new org . apache . logging . log4j . util . FilteredObjectInputStream ( inArr ) ) { final org . apache . logging . log4j . util . SortedArrayStringMap result = ( ( org . apache . logging . log4j . util . SortedArrayStringMap ) ( in . readObject ( ) ) ) ; return result ; } }
|
org . junit . Assert . assertEquals ( original , copy )
|
sourceFileToToolTests ( ) { io . dockstore . webservice . core . SourceFile sourceFile = new io . dockstore . webservice . core . SourceFile ( ) ; sourceFile . setType ( SourceFile . FileType . CWL_TEST_JSON ) ; sourceFile . setPath ( "/test.cwl.json" ) ; sourceFile . setAbsolutePath ( "/test.cwl.json" ) ; sourceFile . setContent ( io . swagger . api . impl . ToolsImplCommonTest . PLACEHOLDER_CONTENT ) ; sourceFile . setId ( 9001 ) ; io . swagger . model . FileWrapper actualToolTests = io . swagger . api . impl . ToolsImplCommon . sourceFileToToolTests ( "" , sourceFile ) ; io . swagger . model . ExtendedFileWrapper expectedToolTests = new io . swagger . model . ExtendedFileWrapper ( ) ; expectedToolTests . setContent ( io . swagger . api . impl . ToolsImplCommonTest . PLACEHOLDER_CONTENT ) ; expectedToolTests . setUrl ( "/test.cwl.json" ) ; "<AssertPlaceHolder>" ; } setUrl ( java . lang . String ) { this . url = url ; }
|
org . junit . Assert . assertEquals ( expectedToolTests , actualToolTests )
|
parseSignature_4 ( ) { final java . lang . String sig = "l3axl2sad" ; final org . erlide . util . erlang . Signature [ ] result = org . erlide . util . erlang . Signature . parse ( sig ) ; final java . lang . String expect = "[l(t(a,x,l(t(s,a)))),<sp>d]" ; "<AssertPlaceHolder>" ; } toString ( int ) { final java . lang . StringBuilder s = new java . lang . StringBuilder ( ) ; s . append ( "[" ) ; for ( int i = start ; i < ( arity ( ) ) ; i ++ ) { if ( i > start ) { s . append ( "," ) ; } s . append ( elems [ i ] . toString ( ) ) ; } if ( ( lastTail ) != null ) { s . append ( "|" ) . append ( lastTail . toString ( ) ) ; } s . append ( "]" ) ; return s . toString ( ) ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . toString ( result ) . equals ( expect ) )
|
testTestBKConfiguration ( ) { java . lang . Class . forName ( "org.apache.bookkeeper.conf.TestBKConfiguration" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testGetAsObjectOneSpace ( ) { java . lang . String in = "<sp>" ; java . lang . String out = ( ( java . lang . String ) ( converter . getAsObject ( context , component , in ) ) ) ; "<AssertPlaceHolder>" ; } getAsObject ( javax . faces . context . FacesContext , javax . faces . component . UIComponent , java . lang . String ) { org . oscm . internal . vo . VOPaymentInfo retVal = null ; for ( org . oscm . internal . vo . VOPaymentInfo vopsp : accountingService . getPaymentInfos ( ) ) { if ( java . lang . Long . valueOf ( vopsp . getKey ( ) ) . toString ( ) . equals ( value ) ) { retVal = vopsp ; } } return retVal ; }
|
org . junit . Assert . assertEquals ( null , out )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.