input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testUpdateAndThenResetTheDistributionIs0 ( ) { statistics . update ( org . openehealth . ipf . commons . test . performance . PerformanceMeasurementTestUtils . createMeasurementHistory ( ) ) ; statistics . reset ( ) ; java . util . List < org . openehealth . ipf . commons . test . performance . throughput . Throughput > throughputs = statistics . getThroughputDistribution ( ) . getThroughput ( ) ; for ( org . openehealth . ipf . commons . test . performance . throughput . Throughput t : throughputs ) { "<AssertPlaceHolder>" ; } } getCount ( ) { return count ; } | org . junit . Assert . assertEquals ( 0 , t . getCount ( ) ) |
cannotGet2App2 ( ) { final org . openqa . grid . internal . GridRegistry registry = org . openqa . grid . internal . DefaultGridRegistry . newInstance ( new org . openqa . grid . web . Hub ( new org . openqa . grid . internal . utils . configuration . GridHubConfiguration ( ) ) ) ; org . openqa . grid . internal . RemoteProxy p1 = new org . openqa . grid . internal . BaseRemoteProxy ( req , registry ) ; try { registry . add ( p1 ) ; org . openqa . grid . internal . mock . MockedRequestHandler newSessionRequest = org . openqa . grid . internal . mock . GridHelper . createNewSessionHandler ( registry , app2 ) ; newSessionRequest . process ( ) ; org . openqa . grid . internal . TestThreadCounter testThreadCounter = new org . openqa . grid . internal . TestThreadCounter ( ) ; testThreadCounter . start ( ( ) -> { org . openqa . grid . internal . mock . MockedRequestHandler newSessionRequest1 = org . openqa . grid . internal . mock . GridHelper . createNewSessionHandler ( registry , app2 ) ; newSessionRequest1 . process ( ) ; processed = true ; } ) ; testThreadCounter . waitUntilStarted ( 1 ) ; "<AssertPlaceHolder>" ; } finally { registry . stop ( ) ; } } waitUntilStarted ( int ) { int i = 0 ; while ( ( num != ( started . get ( ) ) ) && ( ( i ++ ) < 20 ) ) { if ( i > 20 ) throw new java . lang . RuntimeException ( "Time<sp>out<sp>waiting<sp>for<sp>completion" ) ; try { java . lang . Thread . sleep ( 50 ) ; } catch ( java . lang . InterruptedException e ) { throw new java . lang . RuntimeException ( e ) ; } } } | org . junit . Assert . assertFalse ( processed ) |
testSerialization ( ) { org . jfree . chart . title . ShortTextTitle t1 = new org . jfree . chart . title . ShortTextTitle ( "ABC" ) ; org . jfree . chart . title . ShortTextTitle t2 = ( ( org . jfree . chart . title . ShortTextTitle ) ( org . jfree . chart . TestUtilities . serialised ( t1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( t1 , t2 ) |
convert_Boolean_to_primitive ( ) { java . util . List < java . lang . Boolean > booleans = com . google . common . collect . Lists . newArrayList ( Boolean . TRUE , Boolean . FALSE , Boolean . TRUE , Boolean . FALSE ) ; boolean [ ] primitiveArray = com . google . common . primitives . Booleans . toArray ( booleans ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 4 , primitiveArray . length ) |
testWebHdfsAppend ( ) { org . apache . hadoop . hdfs . MiniDFSCluster cluster = null ; final org . apache . hadoop . conf . Configuration conf = org . apache . hadoop . hdfs . web . WebHdfsTestUtil . createConf ( ) ; final int dnNumber = 3 ; try { cluster = new org . apache . hadoop . hdfs . MiniDFSCluster . Builder ( conf ) . numDataNodes ( dnNumber ) . build ( ) ; final org . apache . hadoop . hdfs . web . WebHdfsFileSystem webFS = org . apache . hadoop . hdfs . web . WebHdfsTestUtil . getWebHdfsFileSystem ( conf , WebHdfsConstants . WEBHDFS_SCHEME ) ; final org . apache . hadoop . hdfs . DistributedFileSystem fs = cluster . getFileSystem ( ) ; final org . apache . hadoop . fs . Path appendFile = new org . apache . hadoop . fs . Path ( "/testAppend.txt" ) ; final java . lang . String content = "hello<sp>world" ; org . apache . hadoop . hdfs . DFSTestUtil . writeFile ( fs , appendFile , content ) ; for ( int index = 0 ; index < ( dnNumber - 1 ) ; index ++ ) { cluster . shutdownDataNode ( index ) ; } cluster . restartNameNodes ( ) ; cluster . waitActive ( ) ; try { org . apache . hadoop . hdfs . DFSTestUtil . appendFile ( webFS , appendFile , content ) ; org . junit . Assert . fail ( ( "Should<sp>fail<sp>to<sp>append<sp>file<sp>since<sp>" + "datanode<sp>number<sp>is<sp>1<sp>and<sp>replication<sp>is<sp>3" ) ) ; } catch ( java . io . IOException ignored ) { java . lang . String resultContent = org . apache . hadoop . hdfs . DFSTestUtil . readFile ( fs , appendFile ) ; "<AssertPlaceHolder>" ; } } finally { if ( cluster != null ) { cluster . shutdown ( true ) ; } } } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org . apache . hadoop . ozone . client . rest . response . BucketInfo ) ) { return false ; } org . apache . hadoop . ozone . client . rest . response . BucketInfo that = ( ( org . apache . hadoop . ozone . client . rest . response . BucketInfo ) ( o ) ) ; com . google . common . base . Preconditions . checkState ( that . getVolumeName ( ) . equals ( this . getVolumeName ( ) ) ) ; return bucketName . equals ( that . bucketName ) ; } | org . junit . Assert . assertTrue ( resultContent . equals ( content ) ) |
one_$parent_elem_match_returns_false_when_no_values_in_array_match ( ) { com . redhat . lightblue . query . QueryExpression expr = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'array':'field6.$parent.field7','elemMatch':{'field':'elemf3','op':'>','rvalue':10}}" ) ; com . redhat . lightblue . eval . QueryEvaluator eval = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( expr , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext context = eval . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; } | org . junit . Assert . assertFalse ( context . getResult ( ) ) |
testGetValueReturnsInvalidIfReadFails ( ) { new mockit . NonStrictExpectations ( ) { { spiDevice . write ( anyShort , anyShort , anyShort ) ; result = new java . io . IOException ( "Some<sp>fake<sp>error" ) ; } } ; double result ; try { result = mcpP3008Provider . getImmediateValue ( inputPin ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "No<sp>exception<sp>expected<sp>here,<sp>but<sp>got<sp>" + e ) ) ; e . printStackTrace ( ) ; return ; } "<AssertPlaceHolder>" ; } getImmediateValue ( com . pi4j . gpio . extension . base . GpioPinAnalogInput ) { return getImmediateValue ( pin . getPin ( ) ) ; } | org . junit . Assert . assertTrue ( ( result < 0 ) ) |
testGetDiffAsStringOfEqualFiles ( ) { java . lang . String result = testGetDiffAsString ( "file1.txt" , "file1.txt" ) ; "<AssertPlaceHolder>" ; } testGetDiffAsString ( java . lang . String , java . lang . String ) { java . io . File file1 = new java . io . File ( hudson . plugins . jobConfigHistory . JobConfigHistoryBaseActionTest . class . getResource ( file1txt ) . getPath ( ) ) ; java . io . File file2 = new java . io . File ( hudson . plugins . jobConfigHistory . JobConfigHistoryBaseActionTest . class . getResource ( file2txt ) . getPath ( ) ) ; java . lang . String [ ] file1Lines = hudson . plugins . jobConfigHistory . TUtils . readResourceLines ( file1txt ) . toArray ( new java . lang . String [ ] { } ) ; java . lang . String [ ] file2Lines = hudson . plugins . jobConfigHistory . TUtils . readResourceLines ( file2txt ) . toArray ( new java . lang . String [ ] { } ) ; hudson . plugins . jobConfigHistory . JobConfigHistoryBaseAction sut = new hudson . plugins . jobConfigHistory . JobConfigHistoryBaseActionTest . JobConfigHistoryBaseActionImpl ( ) ; java . lang . String result = sut . getDiffAsString ( file1 , file2 , file1Lines , file2Lines ) ; return result ; } | org . junit . Assert . assertEquals ( "\n" , result ) |
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . kernel . model . Group > groups = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( groups . isEmpty ( ) ) |
traceMdcMarkerThrowableMessageArgs ( ) { uk . org . lidalia . slf4jtest . LoggingEvent event = uk . org . lidalia . slf4jtest . LoggingEvent . trace ( mdc , marker , throwable , message , arg1 , arg2 ) ; uk . org . lidalia . slf4jtest . LoggingEvent expected = new uk . org . lidalia . slf4jtest . LoggingEvent ( TRACE , mdc , marker , throwable , message , arg1 , arg2 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( event , org . hamcrest . core . Is . is ( expected ) ) |
testDownloadBadEncoding ( ) { java . lang . String blobValue = "Hello<sp>World<sp>Café" ; java . lang . String encoding = "no-such-charset" ; org . nuxeo . ecm . core . api . Blob blob = org . nuxeo . ecm . core . api . Blobs . createBlob ( blobValue . getBytes ( ) , "text/plain" , encoding ) ; blob . setFilename ( "myFile.txt" ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; javax . servlet . http . HttpServletRequest request = mock ( javax . servlet . http . HttpServletRequest . class ) ; when ( request . getMethod ( ) ) . thenReturn ( "GET" ) ; javax . servlet . http . HttpServletResponse response = mock ( javax . servlet . http . HttpServletResponse . class ) ; javax . servlet . ServletOutputStream sos = new org . nuxeo . ecm . core . io . download . TestDownloadService . DummyServletOutputStream ( ) { @ org . nuxeo . ecm . core . io . download . Override public void write ( int b ) { out . write ( b ) ; } } ; java . io . PrintWriter printWriter = new java . io . PrintWriter ( sos ) ; when ( response . getOutputStream ( ) ) . thenReturn ( sos ) ; when ( response . getWriter ( ) ) . thenReturn ( printWriter ) ; doThrow ( new java . lang . IllegalArgumentException ( ) ) . when ( response ) . setCharacterEncoding ( encoding ) ; downloadService . downloadBlob ( request , response , null , null , blob , null , null ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "\nquery<sp>:<sp>" ) . append ( auditQuery ) . append ( "\nparams<sp>:<sp>" ) ; java . util . List < java . lang . String > pNames = new java . util . ArrayList ( auditQueryParams . keySet ( ) ) ; java . util . Collections . sort ( pNames ) ; for ( java . lang . String name : pNames ) { sb . append ( "\n<sp>" ) ; sb . append ( name ) ; sb . append ( "<sp>:<sp>" ) ; sb . append ( auditQueryParams . get ( name ) . toString ( ) ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( blobValue , out . toString ( ) ) |
testLeeg ( ) { final nl . bzk . brp . util . hisvolledig . kern . PersoonHisVolledigImplBuilder builder = new nl . bzk . brp . util . hisvolledig . kern . PersoonHisVolledigImplBuilder ( nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortPersoon . INGESCHREVENE ) ; final nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView persoonHisVolledig = new nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView ( builder . build ( ) , null ) ; final nl . bzk . migratiebrp . conversie . model . brp . BrpStapel < nl . bzk . migratiebrp . conversie . model . brp . groep . BrpPersoonskaartInhoud > brpInhoud = mapper . map ( persoonHisVolledig , new nl . bzk . brp . levering . lo3 . mapper . OnderzoekMapper ( persoonHisVolledig ) , new nl . bzk . brp . levering . lo3 . mapper . TestActieHisVolledigLocator ( ) ) ; "<AssertPlaceHolder>" ; } map ( B , nl . bzk . brp . levering . lo3 . mapper . OnderzoekMapper , nl . bzk . brp . levering . lo3 . mapper . ActieHisVolledigLocator ) { final java . util . List < nl . bzk . migratiebrp . conversie . model . brp . BrpGroep < G > > groepen = new java . util . ArrayList ( ) ; final java . lang . Iterable < H > histories = getHistorieIterable ( volledig ) ; if ( histories != null ) { for ( final H historie : histories ) { if ( historie != null ) { if ( ! ( behoortTotStatischePersoonlijst ( historie ) ) ) { continue ; } final nl . bzk . migratiebrp . conversie . model . brp . BrpGroep < G > groep = mapGroep ( historie , onderzoekMapper , actieHisVolledigLocator ) ; if ( groep != null ) { groepen . add ( groep ) ; } } } } if ( groepen . isEmpty ( ) ) { return null ; } else { return new nl . bzk . migratiebrp . conversie . model . brp . BrpStapel < G > ( groepen ) ; } } | org . junit . Assert . assertNull ( brpInhoud ) |
testToCropWithFull ( ) { instance = new edu . illinois . library . cantaloupe . resource . iiif . v1 . Region ( ) ; instance . setFull ( true ) ; edu . illinois . library . cantaloupe . operation . Crop actual = instance . toCrop ( ) ; edu . illinois . library . cantaloupe . operation . Crop expected = new edu . illinois . library . cantaloupe . operation . CropByPercent ( 0 , 0 , 1 , 1 ) ; "<AssertPlaceHolder>" ; } toCrop ( ) { if ( edu . illinois . library . cantaloupe . resource . iiif . v2 . Region . Type . FULL . equals ( getType ( ) ) ) { return new edu . illinois . library . cantaloupe . operation . CropByPercent ( ) ; } else if ( edu . illinois . library . cantaloupe . resource . iiif . v2 . Region . Type . SQUARE . equals ( getType ( ) ) ) { return new edu . illinois . library . cantaloupe . operation . CropToSquare ( ) ; } else if ( edu . illinois . library . cantaloupe . resource . iiif . v2 . Region . Type . PERCENT . equals ( getType ( ) ) ) { return new edu . illinois . library . cantaloupe . operation . CropByPercent ( ( ( getX ( ) ) / 100.0 ) , ( ( getY ( ) ) / 100.0 ) , ( ( getWidth ( ) ) / 100.0 ) , ( ( getHeight ( ) ) / 100.0 ) ) ; } else { return new edu . illinois . library . cantaloupe . operation . CropByPixels ( java . lang . Math . round ( getX ( ) ) , java . lang . Math . round ( getY ( ) ) , java . lang . Math . round ( getWidth ( ) ) , java . lang . Math . round ( getHeight ( ) ) ) ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
testLinearCombination2 ( ) { org . apache . commons . math3 . random . Well1024a random = new org . apache . commons . math3 . random . Well1024a ( 553267312521321234L ) ; for ( int i = 0 ; i < 10000 ; ++ i ) { final double ux = 1.0E17 * ( random . nextDouble ( ) ) ; final double uy = 1.0E17 * ( random . nextDouble ( ) ) ; final double uz = 1.0E17 * ( random . nextDouble ( ) ) ; final double vx = 1.0E17 * ( random . nextDouble ( ) ) ; final double vy = 1.0E17 * ( random . nextDouble ( ) ) ; final double vz = 1.0E17 * ( random . nextDouble ( ) ) ; final double sInline = org . apache . commons . math3 . util . MathArrays . linearCombination ( ux , vx , uy , vy , uz , vz ) ; final double sArray = org . apache . commons . math3 . util . MathArrays . linearCombination ( new double [ ] { ux , uy , uz } , new double [ ] { vx , vy , vz } ) ; "<AssertPlaceHolder>" ; } } nextDouble ( ) { return fr . inria . astor . core . setup . RandomManager . randomNumberGenerator . nextDouble ( ) ; } | org . junit . Assert . assertEquals ( sInline , sArray , 0 ) |
testSetValidationMessage_illegalGroupId ( ) { enableUi ( ) ; getArtifactIdField ( ) . setText ( "some-artifact-id" ) ; getGroupIdField ( ) . setText ( "<:#=<sp>Illegal<sp>ID<sp>=#:>" ) ; "<AssertPlaceHolder>" ; verify ( dialogPage ) . setErrorMessage ( "Illegal<sp>Maven<sp>Group<sp>ID:<sp><:#=<sp>Illegal<sp>ID<sp>=#:>" ) ; } setValidationMessage ( org . eclipse . jface . dialogs . DialogPage ) { org . eclipse . core . runtime . IStatus status = validateMavenSettings ( ) ; if ( status . isOK ( ) ) { return true ; } if ( ( org . eclipse . core . runtime . IStatus . ERROR ) == ( status . getSeverity ( ) ) ) { page . setErrorMessage ( status . getMessage ( ) ) ; } else if ( ( org . eclipse . core . runtime . IStatus . WARNING ) == ( status . getSeverity ( ) ) ) { page . setMessage ( status . getMessage ( ) , IMessageProvider . WARNING ) ; } else if ( ( org . eclipse . core . runtime . IStatus . INFO ) == ( status . getSeverity ( ) ) ) { page . setMessage ( status . getMessage ( ) , IMessageProvider . INFORMATION ) ; } return false ; } | org . junit . Assert . assertFalse ( ui . setValidationMessage ( dialogPage ) ) |
divideTest ( ) { tec . uom . se . quantity . ShortQuantity < javax . measure . quantity . ElectricResistance > quantity1 = new tec . uom . se . quantity . ShortQuantity ( java . lang . Short . valueOf ( "3" ) . shortValue ( ) , tec . uom . se . unit . Units . OHM ) ; tec . uom . se . quantity . ShortQuantity < javax . measure . quantity . ElectricResistance > quantity2 = new tec . uom . se . quantity . ShortQuantity ( java . lang . Short . valueOf ( "2" ) . shortValue ( ) , tec . uom . se . unit . Units . OHM ) ; javax . measure . Quantity < ? > result = quantity1 . divide ( quantity2 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( "1" ) , result . getValue ( ) ) |
serializeMinLong ( ) { com . orientechnologies . orient . core . serialization . serializer . record . binary . BytesContainer bytes = new com . orientechnologies . orient . core . serialization . serializer . record . binary . BytesContainer ( ) ; bytes . offset = com . orientechnologies . orient . core . serialization . serializer . record . binary . OVarIntSerializer . write ( bytes , Long . MIN_VALUE ) ; "<AssertPlaceHolder>" ; } readAsLong ( com . orientechnologies . orient . core . serialization . serializer . record . binary . BytesContainer ) { return com . orientechnologies . orient . core . serialization . serializer . record . binary . OVarIntSerializer . readSignedVarLong ( bytes ) ; } | org . junit . Assert . assertEquals ( com . orientechnologies . orient . core . serialization . serializer . record . binary . OVarIntSerializer . readAsLong ( bytes ) , Long . MIN_VALUE ) |
testGetTemplateParameterSubstitutionNotPrimitiveTypeButJavaType ( ) { org . eclipse . uml2 . uml . Classifier clazzifier = prepareMocks ( ) ; when ( dataTypeUtils . isPrimitiveType ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( false ) ; when ( dataTypeUtils . isJavaType ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( true ) ; when ( clazzifier . getName ( ) ) . thenReturn ( "Data::datatype::String" ) ; when ( clazzifier . getQualifiedName ( ) ) . thenReturn ( "Data::datatype::de::test::String" ) ; java . util . List < java . lang . String > results = umlHelper . getTemplateParameterSubstitution ( type ) ; "<AssertPlaceHolder>" ; } getTemplateParameterSubstitution ( de . crowdcode . kissmda . core . uml . Type ) { de . crowdcode . kissmda . core . uml . List < java . lang . String > results = new de . crowdcode . kissmda . core . uml . ArrayList < java . lang . String > ( ) ; de . crowdcode . kissmda . core . uml . UmlHelper . logger . log ( Level . FINE , ( ( ( "getTemplateParameterSubstitution:<sp>" + ( type . getQualifiedName ( ) ) ) + "<sp>-<sp>" ) + ( type . getTemplateParameter ( ) ) ) ) ; org . eclipse . emf . common . util . EList < de . crowdcode . kissmda . core . uml . Element > elements = type . allOwnedElements ( ) ; for ( de . crowdcode . kissmda . core . uml . Element element : elements ) { if ( element instanceof de . crowdcode . kissmda . core . uml . TemplateBinding ) { de . crowdcode . kissmda . core . uml . TemplateBinding templateBinding = ( ( de . crowdcode . kissmda . core . uml . TemplateBinding ) ( element ) ) ; org . eclipse . emf . common . util . EList < de . crowdcode . kissmda . core . uml . TemplateParameterSubstitution > subs = templateBinding . getParameterSubstitutions ( ) ; for ( de . crowdcode . kissmda . core . uml . TemplateParameterSubstitution templateParameterSubstitution : subs ) { de . crowdcode . kissmda . core . uml . ParameterableElement paramElement = templateParameterSubstitution . getActual ( ) ; if ( paramElement instanceof de . crowdcode . kissmda . core . uml . Classifier ) { de . crowdcode . kissmda . core . uml . Classifier clazzifier = ( ( de . crowdcode . kissmda . core . uml . Classifier ) ( paramElement ) ) ; if ( ( ! ( dataTypeUtils . isPrimitiveType ( clazzifier . getName ( ) ) ) ) && ( ! ( dataTypeUtils . isJavaType ( clazzifier . getName ( ) ) ) ) ) { results . add ( clazzifier . getQualifiedName ( ) ) ; } else { results . add ( clazzifier . getName ( ) ) ; } } } } } return results ; } | org . junit . Assert . assertEquals ( "Data::datatype::String" , results . get ( 0 ) ) |
read ( ) { org . syncope . client . to . VirtualSchemaTO VirtualSchemaTO = restTemplate . getForObject ( ( ( BASE_URL ) + "virtualSchema/membership/read/mvirtualdata.json" ) , org . syncope . client . to . VirtualSchemaTO . class ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( VirtualSchemaTO ) |
build_response_with_confirm_slot_directive ( ) { com . amazon . ask . model . Slot slot1 = com . amazon . ask . model . Slot . builder ( ) . withConfirmationStatus ( SlotConfirmationStatus . NONE ) . withName ( "slot1" ) . withValue ( "value1" ) . build ( ) ; com . amazon . ask . model . Intent updatedIntent = com . amazon . ask . model . Intent . builder ( ) . withConfirmationStatus ( IntentConfirmationStatus . NONE ) . withName ( "intentName" ) . withSlots ( java . util . Collections . singletonMap ( "slot1" , slot1 ) ) . build ( ) ; java . util . Optional < com . amazon . ask . model . Response > responseWithBuilder = builder . addConfirmSlotDirective ( "slotName" , updatedIntent ) . build ( ) ; com . amazon . ask . model . dialog . ConfirmSlotDirective confirmSlotDirective = com . amazon . ask . model . dialog . ConfirmSlotDirective . builder ( ) . withSlotToConfirm ( "slotName" ) . withUpdatedIntent ( updatedIntent ) . build ( ) ; com . amazon . ask . model . Response response = com . amazon . ask . model . Response . builder ( ) . withDirectives ( java . util . Collections . singletonList ( confirmSlotDirective ) ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { com . amazon . ask . attributes . persistence . impl . DynamoDbPersistenceAdapter persistenceAdapter = null ; if ( ( tableName ) != null ) { com . amazon . ask . attributes . persistence . impl . DynamoDbPersistenceAdapter . Builder persistenceAdapterBuilder = com . amazon . ask . attributes . persistence . impl . DynamoDbPersistenceAdapter . builder ( ) . withTableName ( tableName ) ; if ( ( autoCreateTable ) != null ) { persistenceAdapterBuilder . withAutoCreateTable ( autoCreateTable ) ; } if ( ( partitionKeyGenerator ) != null ) { persistenceAdapterBuilder . withPartitionKeyGenerator ( partitionKeyGenerator ) ; } if ( ( customDynamoDBClient ) != null ) { persistenceAdapterBuilder . withDynamoDbClient ( customDynamoDBClient ) ; } persistenceAdapter = persistenceAdapterBuilder . build ( ) ; } com . amazon . ask . services . ApacheHttpApiClient apiClient = com . amazon . ask . services . ApacheHttpApiClient . custom ( ) . withHttpClient ( ( ( customHttpClient ) != null ? customHttpClient : org . apache . http . impl . client . HttpClients . createDefault ( ) ) ) . build ( ) ; return new com . amazon . ask . module . StandardSdkModule ( apiClient , persistenceAdapter ) ; } | org . junit . Assert . assertEquals ( responseWithBuilder . get ( ) , response ) |
test_intersection_same ( ) { org . threeten . extra . Interval test = org . threeten . extra . Interval . of ( org . threeten . extra . TestInterval . NOW2 , org . threeten . extra . TestInterval . NOW4 ) ; "<AssertPlaceHolder>" ; } intersection ( org . threeten . extra . LocalDateRange ) { java . util . Objects . requireNonNull ( other , "other" ) ; if ( ( isConnected ( other ) ) == false ) { throw new java . time . DateTimeException ( ( ( ( "Ranges<sp>do<sp>not<sp>connect:<sp>" + ( this ) ) + "<sp>and<sp>" ) + other ) ) ; } int cmpStart = start . compareTo ( other . start ) ; int cmpEnd = end . compareTo ( other . end ) ; if ( ( cmpStart >= 0 ) && ( cmpEnd <= 0 ) ) { return this ; } else if ( ( cmpStart <= 0 ) && ( cmpEnd >= 0 ) ) { return other ; } else { java . time . LocalDate newStart = ( cmpStart >= 0 ) ? start : other . start ; java . time . LocalDate newEnd = ( cmpEnd <= 0 ) ? end : other . end ; return org . threeten . extra . LocalDateRange . of ( newStart , newEnd ) ; } } | org . junit . Assert . assertEquals ( test , test . intersection ( test ) ) |
shouldDeleteGivenCriteriaQuery ( ) { java . lang . String documentId = randomNumeric ( 5 ) ; org . springframework . data . elasticsearch . entities . SampleEntity sampleEntity = org . springframework . data . elasticsearch . entities . SampleEntity . builder ( ) . id ( documentId ) . message ( "test<sp>message" ) . version ( java . lang . System . currentTimeMillis ( ) ) . build ( ) ; org . springframework . data . elasticsearch . core . IndexQuery indexQuery = getIndexQuery ( sampleEntity ) ; elasticsearchTemplate . index ( indexQuery ) ; elasticsearchTemplate . refresh ( org . springframework . data . elasticsearch . entities . SampleEntity . class ) ; org . springframework . data . elasticsearch . core . CriteriaQuery criteriaQuery = new org . springframework . data . elasticsearch . core . CriteriaQuery ( new org . springframework . data . elasticsearch . core . Criteria ( "message" ) . contains ( "test" ) ) ; elasticsearchTemplate . delete ( criteriaQuery , org . springframework . data . elasticsearch . entities . SampleEntity . class ) ; elasticsearchTemplate . refresh ( org . springframework . data . elasticsearch . entities . SampleEntity . class ) ; org . springframework . data . elasticsearch . core . StringQuery stringQuery = new org . springframework . data . elasticsearch . core . StringQuery ( matchAllQuery ( ) . toString ( ) ) ; java . util . List < org . springframework . data . elasticsearch . entities . SampleEntity > sampleEntities = elasticsearchTemplate . queryForList ( stringQuery , org . springframework . data . elasticsearch . entities . SampleEntity . class ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Object ) { queryCriteria . add ( new org . springframework . data . elasticsearch . core . query . Criteria . CriteriaEntry ( org . springframework . data . elasticsearch . core . query . Criteria . OperationKey . EQUALS , o ) ) ; return this ; } | org . junit . Assert . assertThat ( sampleEntities . size ( ) , is ( 0 ) ) |
buildEmojiFromJSON_without_unicode_returns_null ( ) { org . json . JSONObject json = new org . json . JSONObject ( ( "{" + ( ( "\"aliases\":<sp>[\"smile\"]," + "\"tags\":<sp>[\"happy\",<sp>\"joy\",<sp>\"pleased\"]" ) + "}" ) ) ) ; com . vdurmont . emoji . Emoji emoji = com . vdurmont . emoji . EmojiLoader . buildEmojiFromJSON ( json ) ; "<AssertPlaceHolder>" ; } buildEmojiFromJSON ( org . json . JSONObject ) { if ( ! ( json . has ( "emoji" ) ) ) { return null ; } byte [ ] bytes = json . getString ( "emoji" ) . getBytes ( "UTF-8" ) ; java . lang . String description = null ; if ( json . has ( "description" ) ) { description = json . getString ( "description" ) ; } boolean supportsFitzpatrick = false ; if ( json . has ( "supports_fitzpatrick" ) ) { supportsFitzpatrick = json . getBoolean ( "supports_fitzpatrick" ) ; } java . util . List < java . lang . String > aliases = com . vdurmont . emoji . EmojiLoader . jsonArrayToStringList ( json . getJSONArray ( "aliases" ) ) ; java . util . List < java . lang . String > tags = com . vdurmont . emoji . EmojiLoader . jsonArrayToStringList ( json . getJSONArray ( "tags" ) ) ; return new com . vdurmont . emoji . Emoji ( description , supportsFitzpatrick , aliases , tags , bytes ) ; } | org . junit . Assert . assertNull ( emoji ) |
testNoSegments ( ) { org . apache . commons . math3 . geometry . euclidean . twod . SubLine empty = new org . apache . commons . math3 . geometry . euclidean . twod . SubLine ( new org . apache . commons . math3 . geometry . euclidean . twod . Line ( new org . apache . commons . math3 . geometry . euclidean . twod . Vector2D ( ( - 1 ) , ( - 7 ) ) , new org . apache . commons . math3 . geometry . euclidean . twod . Vector2D ( 7 , ( - 1 ) ) , 1.0E-10 ) , new org . apache . commons . math3 . geometry . partitioning . RegionFactory < org . apache . commons . math3 . geometry . euclidean . oned . Euclidean1D > ( ) . getComplement ( new org . apache . commons . math3 . geometry . euclidean . oned . IntervalsSet ( 1.0E-10 ) ) ) ; java . util . List < org . apache . commons . math3 . geometry . euclidean . twod . Segment > segments = empty . getSegments ( ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( operations ) == 0 ) return ingredients ; if ( ( ingredients ) == 0 ) return operations ; return ( operations ) * ( ingredients ) ; } | org . junit . Assert . assertEquals ( 0 , segments . size ( ) ) |
testRetrievingDeadlineScope ( ) { org . quartz . JobDataMap testJobDataMap = toJobData ( serializer , testDeadlineMessage , testDeadlineScope ) ; org . axonframework . messaging . ScopeDescriptor result = deadlineScope ( serializer , testJobDataMap ) ; "<AssertPlaceHolder>" ; verify ( serializer ) . deserialize ( ( ( org . axonframework . serialization . SimpleSerializedObject < ? > ) ( argThat ( this :: assertDeadlineScopeSerializedObject ) ) ) ) ; } deadlineScope ( org . axonframework . serialization . Serializer , org . quartz . JobDataMap ) { org . axonframework . serialization . SimpleSerializedObject < byte [ ] > serializedDeadlineScope = new org . axonframework . serialization . SimpleSerializedObject ( ( ( byte [ ] ) ( jobDataMap . get ( org . axonframework . deadline . quartz . DeadlineJob . DeadlineJobDataBinder . SERIALIZED_DEADLINE_SCOPE ) ) ) , byte [ ] . class , ( ( java . lang . String ) ( jobDataMap . get ( org . axonframework . deadline . quartz . DeadlineJob . DeadlineJobDataBinder . SERIALIZED_DEADLINE_SCOPE_CLASS_NAME ) ) ) , null ) ; return serializer . deserialize ( serializedDeadlineScope ) ; } | org . junit . Assert . assertEquals ( testDeadlineScope , result ) |
testExecuteInvalidPerms ( ) { boolean result = sut . execute ( org . eurekastreams . server . persistence . mappers . db . GetTabPermissionByPersonAndTabTest . TEST_PERSON_ACCOUNTID2 , org . eurekastreams . server . persistence . mappers . db . GetTabPermissionByPersonAndTabTest . TEST_TAB_ID2 ) ; "<AssertPlaceHolder>" ; } execute ( javax . mail . Message , java . util . List ) { java . lang . String token = getToken ( message ) ; if ( token == null ) { return false ; } java . lang . String fromAddress = getFromAddress ( message ) ; org . springframework . transaction . support . DefaultTransactionDefinition transDef = new org . springframework . transaction . support . DefaultTransactionDefinition ( ) ; transDef . setName ( "TokenAddressMessageAuthenticator" ) ; transDef . setReadOnly ( false ) ; org . springframework . transaction . TransactionStatus transStatus = transactionMgr . getTransaction ( transDef ) ; byte [ ] key ; java . lang . Long personId ; org . eurekastreams . server . search . modelview . PersonModelView person ; try { personId = personIdByEmailDao . execute ( fromAddress ) ; key = userKeyByIdDao . execute ( personId ) ; person = personDao . execute ( personId ) ; } finally { transactionMgr . commit ( transStatus ) ; } java . util . Map < java . lang . String , java . lang . Long > tokenData = getTokenData ( token , key ) ; java . lang . String content = messageContentExtractor . extract ( message ) ; org . eurekastreams . commons . server . UserActionRequest actionSelection = actionSelector . select ( tokenData , content , person ) ; executeAction ( message , actionSelection , person , inResponseMessages ) ; return true ; } | org . junit . Assert . assertFalse ( result ) |
testGetSchemas2 ( ) { java . sql . DatabaseMetaData dbmd = sharedConnection . getMetaData ( ) ; java . sql . ResultSet rs = dbmd . getCatalogs ( ) ; boolean foundTestUnitsJdbc = false ; while ( rs . next ( ) ) { if ( rs . getString ( 1 ) . equals ( "testj" ) ) { foundTestUnitsJdbc = true ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == object ) { return true ; } if ( ( object == null ) || ( ( getClass ( ) ) != ( object . getClass ( ) ) ) ) { return false ; } org . mariadb . jdbc . internal . util . dao . CallableStatementCacheKey that = ( ( org . mariadb . jdbc . internal . util . dao . CallableStatementCacheKey ) ( object ) ) ; return ( database . equals ( that . database ) ) && ( query . equals ( that . query ) ) ; } | org . junit . Assert . assertEquals ( true , foundTestUnitsJdbc ) |
testSortLimit0 ( ) { final org . apache . calcite . tools . RelBuilder builder = org . apache . calcite . tools . RelBuilder . create ( org . apache . calcite . test . RelBuilderTest . config ( ) . build ( ) ) ; final org . apache . calcite . rel . RelNode root = builder . scan ( "EMP" ) . sortLimit ( ( - 1 ) , 0 , builder . desc ( builder . field ( "DEPTNO" ) ) ) . build ( ) ; final java . lang . String expected = "LogicalValues(tuples=[[]])\n" ; "<AssertPlaceHolder>" ; } hasTree ( java . lang . String ) { return org . apache . calcite . test . Matchers . compose ( org . hamcrest . core . Is . is ( value ) , ( input ) -> { return org . apache . calcite . util . Util . toLinux ( org . apache . calcite . plan . RelOptUtil . toString ( input ) ) ; } ) ; } | org . junit . Assert . assertThat ( root , org . apache . calcite . test . Matchers . hasTree ( expected ) ) |
editTrueToFalse ( ) { when ( access . isEditable ( ) ) . thenReturn ( true ) ; final org . uberfire . ext . wires . core . grids . client . model . GridCell < java . lang . Boolean > cell = new org . uberfire . ext . wires . core . grids . client . model . impl . BaseGridCell ( new org . uberfire . ext . wires . core . grids . client . model . impl . BaseGridCellValue ( true ) ) ; column . edit ( cell , context , callback ) ; verify ( callback , times ( 1 ) ) . accept ( callbackArgumentCaptor . capture ( ) ) ; final org . uberfire . ext . wires . core . grids . client . model . impl . BaseGridCellValue < java . lang . Boolean > callbackArgument = callbackArgumentCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return this . value ; } | org . junit . Assert . assertFalse ( callbackArgument . getValue ( ) ) |
test ( ) { connect ( ) ; org . zkoss . zktest . zats . ztl . JQuery logScrollTop = jq ( ".z-button:contains(logScrollTop)" ) ; click ( jq ( ".z-button:contains(scroll)" ) ) ; waitResponse ( ) ; click ( logScrollTop ) ; waitResponse ( ) ; java . lang . String scrollTop = getZKLog ( ) ; closeZKLog ( ) ; waitResponse ( ) ; click ( jq ( ".z-listheader" ) ) ; waitResponse ( ) ; click ( logScrollTop ) ; waitResponse ( ) ; "<AssertPlaceHolder>" ; } getZKLog ( ) { return getWebDriver ( ) . findElement ( org . openqa . selenium . By . id ( "zk_log" ) ) . getAttribute ( "value" ) . trim ( ) ; } | org . junit . Assert . assertEquals ( scrollTop , getZKLog ( ) ) |
testImportWithoutTestContainerLoaded ( ) { org . powermock . api . mockito . PowerMockito . mockStatic ( org . talend . core . GlobalServiceRegister . class ) ; org . talend . core . GlobalServiceRegister globalServiceRegister = org . powermock . api . mockito . PowerMockito . mock ( org . talend . core . GlobalServiceRegister . class ) ; org . powermock . api . mockito . PowerMockito . when ( org . talend . core . GlobalServiceRegister . getDefault ( ) ) . thenReturn ( globalServiceRegister ) ; org . powermock . api . mockito . PowerMockito . when ( globalServiceRegister . isServiceRegistered ( org . talend . core . ui . ITestContainerProviderService . class ) ) . thenReturn ( false ) ; org . powermock . api . mockito . PowerMockito . when ( globalServiceRegister . getService ( org . talend . core . ui . ITestContainerProviderService . class ) ) . thenReturn ( null ) ; org . talend . repository . items . importexport . wizard . models . ImportNodesBuilder importNodesBuilder = new org . talend . repository . items . importexport . wizard . models . ImportNodesBuilder ( ) ; org . talend . core . model . properties . ProcessItem processItem = PropertiesFactory . eINSTANCE . createProcessItem ( ) ; org . talend . core . model . properties . Property property = PropertiesFactory . eINSTANCE . createProperty ( ) ; property . setLabel ( "testJob" ) ; processItem . setProperty ( property ) ; org . talend . repository . items . importexport . handlers . model . ImportItem importItem = new org . talend . repository . items . importexport . handlers . model . ImportItem ( new org . eclipse . core . runtime . Path ( "dummy" ) ) ; importItem . setProperty ( processItem . getProperty ( ) ) ; java . util . List < org . talend . repository . items . importexport . handlers . model . ImportItem > importItems = new java . util . ArrayList < org . talend . repository . items . importexport . handlers . model . ImportItem > ( ) ; importItems . add ( importItem ) ; importNodesBuilder . addItems ( importItems ) ; java . util . List < org . talend . repository . items . importexport . handlers . model . ImportItem > importItemRecords = java . util . Arrays . asList ( importNodesBuilder . getAllImportItemRecords ( ) ) ; "<AssertPlaceHolder>" ; } contains ( java . io . File ) { for ( org . talend . metadata . managment . ui . editor . MetadataTalendTypeEditor . FileInfo info : tmpFiles ) { if ( info . file . equals ( file ) ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( importItemRecords . contains ( importItem ) ) |
test48IsServiceAdminUserTrue ( ) { java . lang . String configName = "service.admin.users" ; boolean result = false ; org . apache . ranger . plugin . model . RangerService rService = rangerService ( ) ; org . apache . ranger . biz . XXServiceConfigMapDao xxServiceConfigMapDao = org . mockito . Mockito . mock ( org . apache . ranger . biz . XXServiceConfigMapDao . class ) ; org . apache . ranger . biz . XXServiceConfigMap xxServiceConfigMap = new org . apache . ranger . biz . XXServiceConfigMap ( ) ; xxServiceConfigMap . setConfigkey ( configName ) ; xxServiceConfigMap . setConfigvalue ( rService . getConfigs ( ) . get ( configName ) ) ; org . mockito . Mockito . when ( daoManager . getXXServiceConfigMap ( ) ) . thenReturn ( xxServiceConfigMapDao ) ; org . mockito . Mockito . when ( xxServiceConfigMapDao . findByServiceNameAndConfigKey ( rService . getName ( ) , configName ) ) . thenReturn ( xxServiceConfigMap ) ; result = serviceDBStore . isServiceAdminUser ( rService . getName ( ) , "testServiceAdminUser2" ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( daoManager ) . getXXServiceConfigMap ( ) ; org . mockito . Mockito . verify ( xxServiceConfigMapDao ) . findByServiceNameAndConfigKey ( rService . getName ( ) , configName ) ; } getName ( ) { return name ; } | org . junit . Assert . assertTrue ( result ) |
invalidateTokenShouldTryToGetAlternativeToken ( ) { com . soundcloud . api . CloudAPI . TokenListener listener = mock ( CloudAPI . TokenListener . class ) ; final com . soundcloud . api . Token cachedToken = new com . soundcloud . api . Token ( "new" , "fresh" ) ; api . setTokenListener ( listener ) ; when ( listener . onTokenInvalid ( api . getToken ( ) ) ) . thenReturn ( cachedToken ) ; "<AssertPlaceHolder>" ; } invalidateToken ( ) { if ( ( mToken ) != null ) { com . soundcloud . api . Token alternative = ( ( listener ) == null ) ? null : listener . onTokenInvalid ( mToken ) ; mToken . invalidate ( ) ; if ( alternative != null ) { mToken = alternative ; return mToken ; } else { return null ; } } else { return null ; } } | org . junit . Assert . assertThat ( api . invalidateToken ( ) , org . hamcrest . CoreMatchers . equalTo ( cachedToken ) ) |
testGetXML ( ) { when ( field . getPentahoFieldName ( ) ) . thenReturn ( "SampleName" ) ; meta . setInputFields ( java . util . Arrays . asList ( field ) ) ; "<AssertPlaceHolder>" ; verify ( meta ) . getDataLocation ( ) ; verify ( meta ) . getSchemaLocation ( ) ; verify ( field ) . getAvroFieldName ( ) ; verify ( field , times ( 3 ) ) . getPentahoFieldName ( ) ; verify ( field ) . getTypeDesc ( ) ; } getXML ( ) { if ( org . pentaho . di . core . Const . isEmpty ( getKeyName ( ) ) ) { return "" ; } java . lang . String retString = "" ; retString += org . pentaho . di . core . xml . XMLHandler . openTag ( "mapping" ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "mapping_name" , getMappingName ( ) ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "mapping_name" 1 , getTableName ( ) ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "key" , getKeyName ( ) ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "key_type" , getKeyType ( ) . toString ( ) ) ; if ( ( mappedColumns . size ( ) ) > 0 ) { retString += org . pentaho . di . core . xml . XMLHandler . openTag ( "mapped_columns" ) ; for ( java . lang . String alias : mappedColumns . keySet ( ) ) { org . pentaho . bigdata . api . hbase . meta . HBaseValueMetaInterface vm = mappedColumns . get ( alias ) ; retString += org . pentaho . di . core . xml . XMLHandler . openTag ( "mapped_column" ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "alias" , alias ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "mapping_name" 0 , vm . getColumnFamily ( ) ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "column_name" , vm . getColumnName ( ) ) ; retString += org . pentaho . di . core . xml . XMLHandler . addTagValue ( "type" , vm . getHBaseTypeDesc ( ) ) ; retString += org . pentaho . di . core . xml . XMLHandler . closeTag ( "mapped_column" ) ; } retString += org . pentaho . di . core . xml . XMLHandler . closeTag ( "mapped_columns" ) ; } retString += org . pentaho . di . core . xml . XMLHandler . closeTag ( "mapping" ) ; return retString ; } | org . junit . Assert . assertNotNull ( meta . getXML ( ) ) |
verify_local_repo_detection ( ) { java . io . File path = org . gridkit . nanocloud . test . maven . MavenClasspathManager . getLocalMavenRepoPath ( ) ; System . out . println ( ( "verify_local_repo_detection:<sp>" + path ) ) ; "<AssertPlaceHolder>" ; } getLocalMavenRepoPath ( ) { org . gridkit . nanocloud . test . maven . MavenClasspathManager . initClasspath ( ) ; org . gridkit . nanocloud . test . maven . MavenClasspathManager . findLocalMavenRepo ( ) ; return org . gridkit . nanocloud . test . maven . MavenClasspathManager . LOCAL_MAVEN_REPOPATH ; } | org . junit . Assert . assertTrue ( ( path != null ) ) |
should_update_information_status_and_last_touched_by ( ) { org . mamute . model . User artur = user ( "" , "" ) ; org . mamute . model . User leo = user ( "" , "" ) ; artur . setId ( 1L ) ; leo . setId ( 2L ) ; org . mamute . model . Question comoFaz = question . withTitle ( "titulo" ) . withDescription ( "descricao" ) . withAuthor ( artur ) . build ( ) ; org . mamute . model . QuestionInformation comoFazEditedInformation = new org . mamute . model . QuestionInformationBuilder ( ) . with ( leo ) . build ( ) ; comoFaz . updateWith ( comoFazEditedInformation , updater ) ; comoFaz . approve ( comoFazEditedInformation ) ; "<AssertPlaceHolder>" ; } getLastTouchedBy ( ) { return lastTouchedBy ; } | org . junit . Assert . assertEquals ( comoFaz . getLastTouchedBy ( ) . getId ( ) , leo . getId ( ) ) |
testCoherenceToCsvLoader ( ) { com . seovic . loader . CoherenceLoaderTest . prepareCache ( ) ; com . seovic . loader . Source source = new com . seovic . loader . source . CoherenceCacheSource ( com . seovic . loader . CoherenceLoaderTest . countries ) ; java . io . Writer writer = new java . io . StringWriter ( ) ; com . seovic . loader . Target target = new com . seovic . loader . target . CsvTarget ( writer , "code,formalName,capital,currencySymbol,currencyName,telephonePrefix,domain" ) ; com . seovic . loader . Loader loader = new com . seovic . loader . DefaultLoader ( source , target ) ; loader . load ( ) ; java . io . BufferedReader reader = new java . io . BufferedReader ( new java . io . StringReader ( writer . toString ( ) ) ) ; int count = 0 ; while ( ( reader . readLine ( ) ) != null ) { count ++ ; } "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "Animal.v3{" + "species='" ) + ( species ) ) + '\'' ) + '}' ; } | org . junit . Assert . assertEquals ( 4 , count ) |
consulResponseShouldHaveResponseAndDefaultValuesIfNoHeader ( ) { java . lang . String responseMessage = "success" ; com . orbitz . consul . model . ConsulResponse < java . lang . String > expectedConsulResponse = new com . orbitz . consul . model . ConsulResponse ( responseMessage , 0 , false , java . math . BigInteger . ZERO ) ; retrofit2 . Response < java . lang . String > response = retrofit2 . Response . success ( responseMessage ) ; com . orbitz . consul . model . ConsulResponse < java . lang . String > consulResponse = com . orbitz . consul . util . Http . consulResponse ( response ) ; "<AssertPlaceHolder>" ; } consulResponse ( retrofit2 . Response ) { okhttp3 . Headers headers = response . headers ( ) ; java . lang . String indexHeaderValue = headers . get ( "X-Consul-Index" ) ; java . lang . String lastContactHeaderValue = headers . get ( "X-Consul-Lastcontact" ) ; java . lang . String knownLeaderHeaderValue = headers . get ( "X-Consul-Knownleader" ) ; java . math . BigInteger index = ( indexHeaderValue == null ) ? java . math . BigInteger . ZERO : new java . math . BigInteger ( indexHeaderValue ) ; long lastContact = ( lastContactHeaderValue == null ) ? 0 : org . apache . commons . lang3 . math . NumberUtils . toLong ( lastContactHeaderValue ) ; boolean knownLeader = ( knownLeaderHeaderValue == null ) ? false : java . lang . Boolean . valueOf ( knownLeaderHeaderValue ) ; return new com . orbitz . consul . model . ConsulResponse ( response . body ( ) , lastContact , knownLeader , index ) ; } | org . junit . Assert . assertEquals ( expectedConsulResponse , consulResponse ) |
service19PutWithHeaderApplicationOctetStreamContentTypeAndStringBodyWithEmptyBody ( ) { final com . azure . common . entities . HttpBinJSON result = createService ( com . azure . common . implementation . RestProxyTests . Service19 . class ) . putWithHeaderApplicationOctetStreamContentTypeAndStringBody ( "" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( "" , result . data ) |
testTTLMetadata ( ) { com . thinkaurelius . titan . diskstorage . keycolumnvalue . WriteBuffer wb = new com . thinkaurelius . titan . diskstorage . util . WriteByteBuffer ( 128 ) ; wb . putInt ( 1 ) . putInt ( 2 ) . putInt ( 3 ) . putInt ( 4 ) ; int valuePos = wb . getPosition ( ) ; wb . putInt ( 5 ) . putInt ( 6 ) ; com . thinkaurelius . titan . diskstorage . util . StaticArrayEntry entry = new com . thinkaurelius . titan . diskstorage . util . StaticArrayEntry ( wb . getStaticBuffer ( ) , valuePos ) ; entry . setMetaData ( EntryMetaData . TTL , 42 ) ; "<AssertPlaceHolder>" ; } getMetaData ( ) { return metadata ; } | org . junit . Assert . assertEquals ( 42 , entry . getMetaData ( ) . get ( EntryMetaData . TTL ) ) |
checkCreation ( ) { info . smart_tools . smartactors . scope . iscope . IScope scope = new info . smart_tools . smartactors . scope . recursive_scope . Scope ( null ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( scope ) |
doubleAddNotNullConstraint ( ) { org . apache . hadoop . hive . metastore . api . Table table = testTables [ 0 ] ; org . apache . hadoop . hive . metastore . api . NotNullConstraintsRequest rqst = new org . apache . hadoop . hive . metastore . api . NotNullConstraintsRequest ( table . getCatName ( ) , table . getDbName ( ) , table . getTableName ( ) ) ; java . util . List < org . apache . hadoop . hive . metastore . api . SQLNotNullConstraint > fetched = client . getNotNullConstraints ( rqst ) ; "<AssertPlaceHolder>" ; java . util . List < org . apache . hadoop . hive . metastore . api . SQLNotNullConstraint > nn = new org . apache . hadoop . hive . metastore . client . builder . SQLNotNullConstraintBuilder ( ) . onTable ( table ) . addColumn ( "col1" ) . build ( metaStore . getConf ( ) ) ; client . addNotNullConstraint ( nn ) ; try { nn = new org . apache . hadoop . hive . metastore . client . builder . SQLNotNullConstraintBuilder ( ) . onTable ( table ) . addColumn ( "col2" ) . build ( metaStore . getConf ( ) ) ; client . addNotNullConstraint ( nn ) ; org . junit . Assert . fail ( ) ; } catch ( org . apache . hadoop . hive . metastore . api . InvalidObjectException | org . apache . thrift . TApplicationException e ) { } } isEmpty ( ) { com . google . common . base . Preconditions . checkNotNull ( getPath ( ) ) ; try { org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( getPath ( ) . toUri ( ) , org . apache . hadoop . hive . ql . session . SessionState . getSessionConf ( ) ) ; return ( ! ( fs . exists ( getPath ( ) ) ) ) || ( ( fs . listStatus ( getPath ( ) , FileUtils . HIDDEN_FILES_PATH_FILTER ) . length ) == 0 ) ; } catch ( java . io . IOException e ) { throw new org . apache . hadoop . hive . ql . metadata . HiveException ( e ) ; } } | org . junit . Assert . assertTrue ( fetched . isEmpty ( ) ) |
getOrEmptyWithNullProperty ( ) { org . spincast . core . json . JsonObject jsonObj = getJsonManager ( ) . create ( ) ; jsonObj . set ( "key1" , null ) ; java . lang . String result = jsonObj . getJsonObjectOrEmpty ( "key1" ) . getJsonArrayOrEmpty ( "nope" ) . getJsonArrayOrEmpty ( 0 ) . getJsonObjectOrEmpty ( 5 ) . getString ( "nope" ) ; "<AssertPlaceHolder>" ; } getString ( int ) { return getStringNoKeyParsing ( java . lang . String . valueOf ( index ) ) ; } | org . junit . Assert . assertNull ( result ) |
testDifference ( ) { org . openscience . cdk . interfaces . IAtom carbon = mock ( org . openscience . cdk . interfaces . IAtom . class ) ; org . openscience . cdk . interfaces . IAtom oxygen = mock ( org . openscience . cdk . interfaces . IAtom . class ) ; when ( carbon . getSymbol ( ) ) . thenReturn ( "C" ) ; when ( oxygen . getSymbol ( ) ) . thenReturn ( "O" ) ; org . openscience . cdk . interfaces . IBond b1 = mock ( org . openscience . cdk . interfaces . IBond . class ) ; org . openscience . cdk . interfaces . IBond b2 = mock ( org . openscience . cdk . interfaces . IBond . class ) ; when ( b1 . getOrder ( ) ) . thenReturn ( IBond . Order . SINGLE ) ; when ( b2 . getOrder ( ) ) . thenReturn ( IBond . Order . DOUBLE ) ; when ( b1 . getAtomCount ( ) ) . thenReturn ( 2 ) ; when ( b2 . getAtomCount ( ) ) . thenReturn ( 2 ) ; when ( b1 . getBegin ( ) ) . thenReturn ( carbon ) ; when ( b1 . getEnd ( ) ) . thenReturn ( carbon ) ; when ( b2 . getBegin ( ) ) . thenReturn ( carbon ) ; when ( b2 . getEnd ( ) ) . thenReturn ( oxygen ) ; org . openscience . cdk . interfaces . IAtomContainer container1 = mock ( org . openscience . cdk . interfaces . IAtomContainer . class ) ; org . openscience . cdk . interfaces . IAtomContainer container2 = mock ( org . openscience . cdk . interfaces . IAtomContainer . class ) ; when ( container1 . getElectronContainerCount ( ) ) . thenReturn ( 1 ) ; when ( container2 . getElectronContainerCount ( ) ) . thenReturn ( 1 ) ; when ( container1 . getElectronContainer ( 0 ) ) . thenReturn ( b1 ) ; when ( container2 . getElectronContainer ( 0 ) ) . thenReturn ( b2 ) ; java . lang . String result = org . openscience . cdk . tools . diff . AtomContainerDiff . diff ( container1 , container2 ) ; "<AssertPlaceHolder>" ; } diff ( org . openscience . cdk . interfaces . IChemObject , org . openscience . cdk . interfaces . IChemObject ) { org . openscience . cdk . tools . diff . tree . IDifference diff = org . openscience . cdk . tools . diff . AtomContainerDiff . difference ( first , second ) ; if ( diff == null ) { return "" ; } else { return diff . toString ( ) ; } } | org . junit . Assert . assertNotNull ( result ) |
testEq ( ) { java . lang . String expectedJavascript = "$('div').eq(1);" ; java . lang . String generatedJavascript = new org . odlabs . wiquery . core . javascript . JsStatement ( ) . $ ( null , "div" ) . chain ( org . odlabs . wiquery . core . javascript . helper . TraversingHelper . eq ( 1 ) ) . render ( ) . toString ( ) ; org . odlabs . wiquery . core . javascript . helper . TraversingHelperTestCase . log . info ( expectedJavascript ) ; org . odlabs . wiquery . core . javascript . helper . TraversingHelperTestCase . log . info ( generatedJavascript ) ; "<AssertPlaceHolder>" ; } toString ( ) { return super . toString ( ) . toLowerCase ( ) ; } | org . junit . Assert . assertEquals ( generatedJavascript , expectedJavascript ) |
getAccessUrl_DIRECT ( ) { org . oscm . internal . landingpage . POLandingpageEntry entry = newEntry ( "s1" ) ; entry . setServiceAccessType ( ServiceAccessType . DIRECT ) ; java . lang . String accessUrl = ctrl . getAccessUrl ( entry ) ; "<AssertPlaceHolder>" ; } getAccessUrl ( org . oscm . internal . landingpage . POLandingpageEntry ) { if ( ( ( entry . getServiceAccessType ( ) ) == ( org . oscm . internal . types . enumtypes . ServiceAccessType . USER ) ) || ( ( entry . getServiceAccessType ( ) ) == ( org . oscm . internal . types . enumtypes . ServiceAccessType . DIRECT ) ) ) { return entry . getServiceAccessURL ( ) ; } else { java . lang . String serviceBaseUrl = entry . getServiceAccessURL ( ) ; java . lang . String serverBaseUrl ; if ( org . oscm . validator . ADMValidator . isHttpsScheme ( serviceBaseUrl ) ) { serverBaseUrl = getApplicationBean ( ) . getServerBaseUrlHttps ( ) ; } else { serverBaseUrl = getApplicationBean ( ) . getServerBaseUrl ( ) ; } return ( ( ( ( org . oscm . ui . common . ADMStringUtils . removeEndingSlash ( serverBaseUrl ) ) + ( org . oscm . ui . common . Constants . SERVICE_BASE_URI ) ) + "/" ) + ( java . lang . Long . toHexString ( entry . getSubscriptionKey ( ) ) ) ) + "/" ; } } | org . junit . Assert . assertNull ( accessUrl ) |
shouldValidateAndReturnTrueWhenAggregationIsDisabled ( ) { final uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition elementDef = mock ( uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition . class ) ; final uk . gov . gchq . gaffer . store . schema . SchemaElementDefinitionValidator validator = new uk . gov . gchq . gaffer . store . schema . SchemaElementDefinitionValidator ( ) ; final java . util . Map < java . lang . String , java . lang . String > properties = new java . util . HashMap ( ) ; properties . put ( TestPropertyNames . PROP_1 , "int" ) ; properties . put ( TestPropertyNames . PROP_2 , "string" ) ; final java . util . function . BinaryOperator < java . lang . Integer > function1 = mock ( java . util . function . BinaryOperator . class ) ; final uk . gov . gchq . gaffer . data . element . function . ElementAggregator aggregator = new uk . gov . gchq . gaffer . data . element . function . ElementAggregator . Builder ( ) . select ( TestPropertyNames . PROP_1 ) . execute ( function1 ) . build ( ) ; given ( elementDef . getIdentifiers ( ) ) . willReturn ( new java . util . HashSet ( ) ) ; given ( elementDef . getProperties ( ) ) . willReturn ( properties . keySet ( ) ) ; given ( elementDef . getPropertyMap ( ) ) . willReturn ( properties ) ; given ( elementDef . getValidator ( ) ) . willReturn ( mock ( uk . gov . gchq . gaffer . data . element . function . ElementFilter . class ) ) ; given ( elementDef . getFullAggregator ( ) ) . willReturn ( aggregator ) ; given ( elementDef . getPropertyClass ( TestPropertyNames . PROP_1 ) ) . willReturn ( ( ( java . lang . Class ) ( uk . gov . gchq . gaffer . store . schema . Integer . class ) ) ) ; given ( elementDef . getPropertyClass ( TestPropertyNames . PROP_2 ) ) . willReturn ( ( ( java . lang . Class ) ( java . lang . String . class ) ) ) ; given ( elementDef . isAggregate ( ) ) . willReturn ( false ) ; final uk . gov . gchq . koryphe . ValidationResult result = validator . validate ( elementDef ) ; "<AssertPlaceHolder>" ; } validate ( boolean ) { _getOp ( ) . setValidate ( validate ) ; return _self ( ) ; } | org . junit . Assert . assertTrue ( result . isValid ( ) ) |
testBuild ( ) { org . jinstagram . auth . InstagramAuthService fixture = new org . jinstagram . auth . InstagramAuthService ( ) ; fixture . apiSecret ( "" ) ; fixture . callback ( "" ) ; fixture . scope ( "" ) ; fixture . proxy ( new java . net . Proxy ( java . net . Proxy . Type . DIRECT , new java . net . InetSocketAddress ( 1 ) ) ) ; fixture . apiKey ( "" ) ; fixture . display ( "" ) ; org . jinstagram . auth . oauth . InstagramService result = fixture . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { org . jinstagram . auth . InstagramApi api = new org . jinstagram . auth . InstagramApi ( ) ; org . jinstagram . auth . model . OAuthConfig config ; org . jinstagram . utils . Preconditions . checkEmptyString ( apiKey , "You<sp>must<sp>provide<sp>an<sp>api<sp>key" ) ; org . jinstagram . utils . Preconditions . checkEmptyString ( apiSecret , "You<sp>must<sp>provide<sp>an<sp>api<sp>secret" ) ; config = new org . jinstagram . auth . model . OAuthConfig ( apiKey , apiSecret , callback , scope , display ) ; if ( ( this . requestProxy ) != null ) { config . setRequestProxy ( this . requestProxy ) ; } return api . createService ( config ) ; } | org . junit . Assert . assertNotNull ( result ) |
testOnlyCode ( ) { com . ieven . ext . response . DefaultResponse response = new com . ieven . ext . response . DefaultResponse ( 0 ) ; System . out . println ( response ) ; "<AssertPlaceHolder>" ; } getMsg ( ) { return msg ; } | org . junit . Assert . assertEquals ( "" , response . getMsg ( ) ) |
testAutoMapOfSqlDateToUtilDate ( ) { "<AssertPlaceHolder>" ; } autoMap ( java . sql . ResultSet , java . lang . Class ) { try { if ( cls . isInterface ( ) ) { return com . github . davidmoten . rx . jdbc . Util . autoMapInterface ( rs , cls ) ; } else { int n = rs . getMetaData ( ) . getColumnCount ( ) ; for ( java . lang . reflect . Constructor < ? > c : cls . getDeclaredConstructors ( ) ) { if ( n == ( c . getParameterTypes ( ) . length ) ) { return com . github . davidmoten . rx . jdbc . Util . autoMap ( rs , ( ( java . lang . reflect . Constructor < T > ) ( c ) ) ) ; } } throw new java . lang . RuntimeException ( ( ( ( "constructor<sp>with<sp>number<sp>of<sp>parameters=" + n ) + "<sp>not<sp>found<sp>in<sp>" ) + cls ) ) ; } } catch ( java . sql . SQLException e ) { throw new com . github . davidmoten . rx . jdbc . exceptions . SQLRuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( new java . util . Date ( 1 ) , com . github . davidmoten . rx . jdbc . Util . autoMap ( new java . sql . Date ( 1 ) , java . util . Date . class ) ) |
testForeignCollectionEager ( ) { co . touchlab . squeaky . dao . Dao < co . touchlab . squeaky . field . ForeignCollectionTest . ParentEager > parentDao = helper . getDao ( co . touchlab . squeaky . field . ForeignCollectionTest . ParentEager . class ) ; co . touchlab . squeaky . field . ForeignCollectionTest . ParentEager parent = new co . touchlab . squeaky . field . ForeignCollectionTest . ParentEager ( ) ; parent . name = "test" ; parentDao . create ( parent ) ; co . touchlab . squeaky . dao . Dao < co . touchlab . squeaky . field . ForeignCollectionTest . ChildEager > childDao = helper . getDao ( co . touchlab . squeaky . field . ForeignCollectionTest . ChildEager . class ) ; co . touchlab . squeaky . field . Random random = new co . touchlab . squeaky . field . Random ( ) ; co . touchlab . squeaky . field . List < co . touchlab . squeaky . field . ForeignCollectionTest . ChildEager > children = new co . touchlab . squeaky . field . ArrayList < co . touchlab . squeaky . field . ForeignCollectionTest . ChildEager > ( ) ; for ( int i = 0 ; i < 20 ; i ++ ) { co . touchlab . squeaky . field . ForeignCollectionTest . ChildEager child = new co . touchlab . squeaky . field . ForeignCollectionTest . ChildEager ( ) ; child . asdf = "Hello<sp>" + ( random . nextInt ( 10000 ) ) ; child . parent = parent ; childDao . create ( child ) ; children . add ( child ) ; } co . touchlab . squeaky . field . ForeignCollectionTest . ParentEager parentDb = parentDao . queryForAll ( ) . list ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; co . touchlab . squeaky . old . A a1 = ( ( co . touchlab . squeaky . old . A ) ( o ) ) ; if ( ( a ) != ( a1 . a ) ) return false ; if ( ( b ) != ( a1 . b ) ) return false ; if ( ( java . lang . Float . compare ( a1 . c , c ) ) != 0 ) return false ; if ( ( java . lang . Double . compare ( a1 . d , d ) ) != 0 ) return false ; if ( ( id ) != null ? ! ( id . equals ( a1 . id ) ) : ( a1 . id ) != null ) return false ; return ! ( ( name ) != null ? ! ( name . equals ( a1 . name ) ) : ( a1 . name ) != null ) ; } | org . junit . Assert . assertTrue ( parentDb . children . equals ( children ) ) |
shouldReturnFalseWhenDistinctCalledWithCollectionOfNonUniqueValues ( ) { final java . util . Collection collection = com . google . common . collect . Lists . newArrayList ( 1 , 2 , 3 , 1 , 2 ) ; final boolean result = uk . gov . gchq . gaffer . commonutil . CollectionUtil . distinct ( collection ) ; "<AssertPlaceHolder>" ; } distinct ( java . util . Collection ) { final java . util . Set < T > set = new java . util . HashSet ( ) ; for ( final T t : collection ) { if ( ! ( set . add ( t ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertFalse ( result ) |
cnTest ( ) { pl . setPattern ( "%cn" ) ; lc . setName ( "aValue" ) ; pl . start ( ) ; java . lang . String val = pl . doLayout ( getEventObject ( ) ) ; "<AssertPlaceHolder>" ; } getEventObject ( ) { return makeLoggingEvent ( "Some<sp>message" , null ) ; } | org . junit . Assert . assertEquals ( "aValue" , val ) |
apvidvrdi ( ) { lv . semti . morphology . Testi . Word w = lv . semti . morphology . Testi . MorphologyTest . loctjs . analyze ( "stis" ) ; "<AssertPlaceHolder>" ; } isRecognized ( ) { return ! ( wordforms . isEmpty ( ) ) ; } | org . junit . Assert . assertFalse ( w . isRecognized ( ) ) |
testGetPropertyNoTargetType ( ) { org . finra . herd . model . dto . ConfigurationValue configurationValue = org . finra . herd . model . dto . ConfigurationValue . HERD_ENVIRONMENT ; org . springframework . mock . env . MockEnvironment environment = new org . springframework . mock . env . MockEnvironment ( ) ; java . lang . String value = org . finra . herd . core . helper . ConfigurationHelper . getProperty ( configurationValue , environment ) ; "<AssertPlaceHolder>" ; } getDefaultValue ( ) { return defaultValue ; } | org . junit . Assert . assertEquals ( "value" , configurationValue . getDefaultValue ( ) , value ) |
kapuaNotifyPayloadConstructor ( ) { org . eclipse . kapua . service . device . management . message . notification . KapuaNotifyPayload kapuaNotifyPayload = new org . eclipse . kapua . service . device . management . commons . message . notification . KapuaNotifyPayloadImpl ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( kapuaNotifyPayload ) |
testDeleteForum ( ) { com . stratelia . webactiv . forums . models . ForumPK forumPK = new com . stratelia . webactiv . forums . models . ForumPK ( "forums130" , "8" ) ; com . stratelia . webactiv . forums . service . ForumsDAO . deleteForum ( con , forumPK ) ; com . stratelia . webactiv . forums . models . Forum forum = com . stratelia . webactiv . forums . service . ForumsDAO . getForum ( con , forumPK ) ; "<AssertPlaceHolder>" ; } getForum ( java . sql . Connection , org . silverpeas . components . forums . model . ForumPK ) { int forumId = java . lang . Integer . parseInt ( forumPK . getId ( ) ) ; java . lang . String instanceId = forumPK . getComponentName ( ) ; java . sql . PreparedStatement selectStmt = null ; java . sql . ResultSet rs = null ; try { selectStmt = con . prepareStatement ( org . silverpeas . components . forums . service . ForumsDAO . QUERY_GET_FORUM ) ; selectStmt . setInt ( 1 , forumId ) ; selectStmt . setString ( 2 , instanceId ) ; rs = selectStmt . executeQuery ( ) ; if ( rs . next ( ) ) { org . silverpeas . components . forums . model . Forum forum = org . silverpeas . components . forums . service . ForumsDAO . resultSet2Forum ( rs ) ; forum . setPk ( forumPK ) ; return forum ; } } finally { org . silverpeas . core . persistence . jdbc . DBUtil . close ( rs , selectStmt ) ; } return null ; } | org . junit . Assert . assertNull ( forum ) |
testGetParametersWithDisabledDefaults ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String name = "Extract<sp>Me<sp>All" ; java . lang . String abbrName = "EML" ; org . lnu . is . domain . street . type . StreetType entity = new org . lnu . is . domain . street . type . StreetType ( ) ; entity . setName ( name ) ; entity . setAbbrName ( abbrName ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "name" , name ) ; expected . put ( "abbrName" , abbrName ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testValidatorForGetList ( ) { java . util . Set < com . validator . enumuse . ValidationStrategy > strategies = new java . util . LinkedHashSet < com . validator . enumuse . ValidationStrategy > ( ) ; strategies . add ( UserValidationStrategy . DATE_OF_BIRTH ) ; strategies . add ( UserValidationStrategy . CITY ) ; strategies . add ( UserValidationStrategy . ZIP ) ; strategies . add ( UserValidationStrategy . COUNTRY ) ; strategies . add ( UserValidationStrategy . SSN ) ; strategies . add ( UserValidationStrategy . CREDIT_CARD_NUMBER ) ; strategies . add ( UserValidationStrategy . BANK_ROUTING_NUMBER ) ; strategies . add ( UserValidationStrategy . BANK_ACCOUNT_NUMBER ) ; strategies . add ( UserValidationStrategy . BANK_NAME ) ; strategies . add ( UserValidationStrategy . BANK_CITY ) ; strategies . add ( UserValidationStrategy . BANK_ZIP ) ; strategies . add ( UserValidationStrategy . BANK_COUNTRY ) ; com . validator . enumuse . UserInput input = new com . validator . enumuse . UserInput ( ) ; input . setUserValid ( true ) ; input . setDateOfBirth ( "01/01/1990" ) ; input . setCity ( "SanJose" ) ; input . setZip ( "" ) ; input . setCountry ( "USA" ) ; input . setSsn ( "" ) ; input . setBankAdded ( true ) ; input . setCreditCardAdded ( true ) ; input . setCreditCardNumber ( "" ) ; input . setBankRoutingNumber ( "" ) ; input . setBankAccountNumber ( "" ) ; input . setBankName ( "" ) ; input . setBankCity ( "" ) ; input . setBankZip ( "" ) ; input . setBankCountry ( "" ) ; com . validator . enumuse . UserValidationContext ctxUser = new com . validator . enumuse . UserValidationContext ( strategies ) ; java . lang . Object [ ] arrResultActual = ctxUser . executeAndGetList ( input ) . toArray ( ) ; java . lang . Object [ ] arrResultExpected = new java . lang . Object [ ] { constants . ValidationType . ZIP , constants . ValidationType . SSN , constants . ValidationType . CREDIT_CARD_NUMBER , constants . ValidationType . BANK_ROUTING_NUMBER , constants . ValidationType . BANK_ACCOUNT_NUMBER , constants . ValidationType . BANK_NAME , constants . ValidationType . BANK_CITY , constants . ValidationType . BANK_ZIP , constants . ValidationType . BANK_COUNTRY } ; "<AssertPlaceHolder>" ; } executeAndGetList ( com . validation . enumuse . UserInput ) { com . validation . enumuse . ValidationStrategy userValidation = UserValidationStrategy . UNSUPPORTED ; java . util . List < constants . ValidationType > validatedTypes = new java . util . ArrayList < constants . ValidationType > ( ) ; for ( java . util . Iterator < com . validation . enumuse . ValidationStrategy > iterator = userValidationStrategies . iterator ( ) ; iterator . hasNext ( ) ; ) { userValidation = iterator . next ( ) ; if ( userValidation . validate ( userInput ) ) { validatedTypes . add ( userValidation . getValidationType ( ) ) ; } } return validatedTypes ; } | org . junit . Assert . assertArrayEquals ( arrResultExpected , arrResultActual ) |
testRecipientDisabledFor2ResourcesMessage ( ) { java . lang . String recipient = "recipient-1@localhost" ; tigase . xmpp . JID recp1 = tigase . xmpp . JID . jidInstanceNS ( ( recipient + "/res1" ) ) ; tigase . xmpp . JID recp2 = tigase . xmpp . JID . jidInstanceNS ( ( recipient + "/res2" ) ) ; tigase . xmpp . JID connId1 = tigase . xmpp . JID . jidInstanceNS ( "c2s@localhost/recipient1-res1" ) ; tigase . xmpp . JID connId2 = tigase . xmpp . JID . jidInstanceNS ( "c2s@localhost/recipient1-res2" ) ; tigase . xmpp . XMPPResourceConnection session1 = getSession ( connId1 , recp1 ) ; getSession ( connId2 , recp2 ) ; tigase . server . Packet p = tigase . server . Packet . packetInstance ( "message" , "sender-1@localhost/res1" , recp1 . toString ( ) , StanzaType . chat ) ; p . setPacketTo ( connId1 ) ; java . util . ArrayDeque < tigase . server . Packet > results = new java . util . ArrayDeque < tigase . server . Packet > ( ) ; results . offer ( p ) ; tigase . server . Packet [ ] expected = results . toArray ( new tigase . server . Packet [ 0 ] ) ; mobileV3 . filter ( p , session1 , null , results ) ; tigase . server . Packet [ ] processed = results . toArray ( new tigase . server . Packet [ 0 ] ) ; "<AssertPlaceHolder>" ; } filter ( tigase . server . Packet , tigase . xmpp . impl . XMPPResourceConnection , tigase . db . NonAuthUserRepository , java . util . Queue ) { if ( ( ( ( sessionFromSM == null ) || ( ! ( sessionFromSM . isAuthorized ( ) ) ) ) || ( results == null ) ) || ( ( results . size ( ) ) == 0 ) ) { return ; } for ( java . util . Iterator < tigase . server . Packet > it = results . iterator ( ) ; it . hasNext ( ) ; ) { tigase . server . Packet res = it . next ( ) ; if ( ( res == null ) || ( ( res . getPacketTo ( ) ) == null ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . finest ( "packet<sp>without<sp>destination" ) ; } continue ; } tigase . xmpp . impl . XMPPSession parentSession = sessionFromSM . getParentSession ( ) ; if ( parentSession == null ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . log ( Level . FINEST , "no<sp>session<sp>for<sp>destination<sp>{0}<sp>for<sp>packet<sp>{1}<sp>-<sp>missing<sp>parent<sp>session" , new java . lang . Object [ ] { res . getPacketTo ( ) . toString ( ) , res . toString ( ) } ) ; } continue ; } tigase . xmpp . impl . XMPPResourceConnection session = parentSession . getResourceForConnectionId ( res . getPacketTo ( ) ) ; if ( session == null ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . log ( Level . FINEST , "no<sp>session<sp>for<sp>destination<sp>{0}<sp>for<sp>packet<sp>{1}" , new java . lang . Object [ ] { res . getPacketTo ( ) . toString ( ) , res . toString ( ) } ) ; } continue ; } if ( ! ( isQueueEnabled ( session ) ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . finest ( "queue<sp>is<sp>no<sp>enabled" ) ; } flushQueue ( session , results ) ; continue ; } java . util . Queue < tigase . server . Packet > queue = ( ( java . util . Queue < tigase . server . Packet > ) ( session . getSessionData ( tigase . xmpp . impl . MobileV1 . QUEUE_KEY ) ) ) ; if ( filter ( session , res , queue ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . log ( Level . FINEST , "queuing<sp>packet<sp>=<sp>{0}" , res . toString ( ) ) ; } it . remove ( ) ; if ( ( queue . size ( ) ) > ( maxQueueSize ) ) { if ( tigase . xmpp . impl . MobileV1 . log . isLoggable ( Level . FINEST ) ) { tigase . xmpp . impl . MobileV1 . log . finest ( "sending<sp>packets<sp>from<sp>queue<sp>(OVERFLOW)" ) ; } tigase . server . Packet p ; while ( ( p = queue . poll ( ) ) != null ) { try { p . setPacketTo ( session . getConnectionId ( ) ) ; results . offer ( p ) ; } catch ( tigase . xmpp . impl . NoConnectionIdException ex ) { tigase . xmpp . impl . MobileV1 . log . log ( Level . FINEST , "should<sp>not<sp>happen,<sp>as<sp>connection<sp>is<sp>ready" , ex ) ; } } } } } } | org . junit . Assert . assertArrayEquals ( expected , processed ) |
test9999Next ( ) { org . jfree . data . time . Year current = new org . jfree . data . time . Year ( 9999 ) ; org . jfree . data . time . Year next = ( ( org . jfree . data . time . Year ) ( current . next ( ) ) ) ; "<AssertPlaceHolder>" ; } next ( ) { org . jfree . data . time . Month result ; if ( ( this . month ) != ( org . jfree . date . MonthConstants . DECEMBER ) ) { result = new org . jfree . data . time . Month ( ( ( this . month ) + 1 ) , this . year ) ; } else { if ( ( this . year ) < 9999 ) { result = new org . jfree . data . time . Month ( org . jfree . date . MonthConstants . JANUARY , ( ( this . year ) + 1 ) ) ; } else { result = null ; } } return result ; } | org . junit . Assert . assertNull ( next ) |
testVStackDifferentOrders ( ) { org . nd4j . linalg . api . ndarray . INDArray expected = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 9 , 9 ) . reshape ( 'c' , 3 , 3 ) ; for ( char order : new char [ ] { 'c' , 'f' } ) { System . out . println ( order ) ; org . nd4j . linalg . factory . Nd4j . factory ( ) . setOrder ( order ) ; org . nd4j . linalg . api . ndarray . INDArray arr1 = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 6 , 6 ) . reshape ( 'c' , 2 , 3 ) ; org . nd4j . linalg . api . ndarray . INDArray arr2 = org . nd4j . linalg . factory . Nd4j . linspace ( 7 , 9 , 3 ) . reshape ( 'c' , 1 , 3 ) ; org . nd4j . linalg . api . ndarray . INDArray merged = org . nd4j . linalg . factory . Nd4j . vstack ( arr1 , arr2 ) ; System . out . println ( merged ) ; System . out . println ( expected ) ; "<AssertPlaceHolder>" ; } } reshape ( char , int , int ) { return ( ( org . nd4j . linalg . api . complex . IComplexNDArray ) ( super . reshape ( order , rows , columns ) ) ) ; } | org . junit . Assert . assertEquals ( expected , merged ) |
two_$this_nary_nin_string_array_returns_false_when_field_value_does_not_match_expression ( ) { com . redhat . lightblue . query . QueryExpression q = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'field':'field6.$this.$this.nf1','op':'$in','values':['blah','yada','nothere']}" ) ; com . redhat . lightblue . eval . QueryEvaluator qe = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( q , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext ctx = qe . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; } | org . junit . Assert . assertFalse ( ctx . getResult ( ) ) |
testGetOtherSeparator ( ) { com . amazonaws . secretsmanager . caching . SecretCache secretCache = org . mockito . Mockito . mock ( com . amazonaws . secretsmanager . caching . SecretCache . class ) ; com . streamsets . datacollector . credential . aws . secrets . manager . AWSSecretsManagerCredentialStore secretManager = setupNominalAWSSecretsManagerCredentialStore ( secretCache ) ; java . lang . String credName = "credName" ; java . lang . String credKey = "credKey" ; java . lang . String credValue = "credValue" ; org . mockito . Mockito . when ( secretCache . getSecretString ( credName ) ) . thenReturn ( createJSONString ( credKey , credValue ) ) ; com . streamsets . pipeline . api . credential . CredentialValue credentialValue = secretManager . get ( "" , ( ( credName + "|" ) + credKey ) , ( ( AWSSecretsManagerCredentialStore . SEPARATOR_OPTION ) + "=|" ) ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( secretCache , org . mockito . Mockito . times ( 0 ) ) . refreshNow ( credName ) ; } get ( ) { return this . root ; } | org . junit . Assert . assertEquals ( credValue , credentialValue . get ( ) ) |
name ( ) { colorTheme . setName ( "name" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertThat ( colorTheme . getName ( ) , org . hamcrest . CoreMatchers . is ( "name" ) ) |
testSourceCounterReadFail ( ) { init ( "true" ) ; org . apache . flume . channel . ChannelProcessor cp = org . mockito . Mockito . mock ( org . apache . flume . channel . ChannelProcessor . class ) ; doThrow ( new java . lang . RuntimeException ( "dummy" ) ) . when ( cp ) . processEvent ( any ( org . apache . flume . Event . class ) ) ; source . setChannelProcessor ( cp ) ; doCounterCommon ( ) ; for ( int i = 0 ; ( i < 10 ) && ( ( source . getSourceCounter ( ) . getEventReadFail ( ) ) == 0 ) ; i ++ ) { java . lang . Thread . sleep ( 100 ) ; } "<AssertPlaceHolder>" ; } getSourceCounter ( ) { return sourceCounter ; } | org . junit . Assert . assertEquals ( 1 , source . getSourceCounter ( ) . getEventReadFail ( ) ) |
testSerialization ( ) { org . jfree . chart . renderer . xy . StandardXYItemRenderer r1 = new org . jfree . chart . renderer . xy . StandardXYItemRenderer ( ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( r1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . renderer . xy . StandardXYItemRenderer r2 = ( ( org . jfree . chart . renderer . xy . StandardXYItemRenderer ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } } | org . junit . Assert . assertEquals ( r1 , r2 ) |
manuallyStartCaseExecutionDisabledTenantCheck ( ) { identityService . setAuthentication ( "user" , null , null ) ; processEngineConfiguration . setTenantCheckEnabled ( false ) ; caseService . manuallyStartCaseExecution ( caseExecutionId ) ; identityService . clearAuthentication ( ) ; org . camunda . bpm . engine . runtime . CaseExecution caseExecution = getCaseExecution ( ) ; "<AssertPlaceHolder>" ; } isActive ( ) { return ( state ) == ( org . camunda . bpm . engine . impl . history . event . ACTIVE . getStateCode ( ) ) ; } | org . junit . Assert . assertThat ( caseExecution . isActive ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testQueryDateFilter ( ) { insertRandom ( 10 , "employee" ) ; final java . util . Calendar today = java . util . Calendar . getInstance ( ) ; today . set ( Calendar . HOUR_OF_DAY , 0 ) ; today . set ( Calendar . MINUTE , 0 ) ; today . set ( Calendar . SECOND , 0 ) ; today . set ( Calendar . MILLISECOND , 0 ) ; final com . spotify . asyncdatastoreclient . Query get = com . spotify . asyncdatastoreclient . QueryBuilder . query ( ) . kindOf ( "employee" ) . filterBy ( com . spotify . asyncdatastoreclient . QueryBuilder . gte ( "started" , today . getTime ( ) ) ) ; final java . util . List < com . spotify . asyncdatastoreclient . Entity > entities = datastore . execute ( get ) . getAll ( ) ; "<AssertPlaceHolder>" ; } getAll ( ) { return entities ; } | org . junit . Assert . assertEquals ( 10 , entities . size ( ) ) |
testFireNavigationEvent ( ) { org . eclipse . rap . rwt . client . service . BrowserNavigationListener listener = mock ( org . eclipse . rap . rwt . client . service . BrowserNavigationListener . class ) ; navigation . addBrowserNavigationListener ( listener ) ; org . eclipse . rap . json . JsonObject parameters = new org . eclipse . rap . json . JsonObject ( ) . add ( "state" , "foo" ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . fakeNotifyOperation ( org . eclipse . rap . rwt . internal . client . BrowserNavigationImpl_Test . TYPE , "Navigation" , parameters ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . executeLifeCycleFromServerThread ( ) ; org . mockito . ArgumentCaptor < org . eclipse . rap . rwt . client . service . BrowserNavigationEvent > captor = org . mockito . ArgumentCaptor . forClass ( org . eclipse . rap . rwt . client . service . BrowserNavigationEvent . class ) ; verify ( listener , times ( 1 ) ) . navigated ( captor . capture ( ) ) ; org . eclipse . rap . rwt . client . service . BrowserNavigationEvent event = captor . getValue ( ) ; "<AssertPlaceHolder>" ; } getState ( ) { return data . equals ( Boolean . TRUE ) ? true : false ; } | org . junit . Assert . assertEquals ( "foo" , event . getState ( ) ) |
getSplitsWithBoundsIntersectFirstSplit ( ) { org . mrgeo . utils . tms . Bounds bounds = new org . mrgeo . utils . tms . Bounds ( ( - 180 ) , ( - 90 ) , 180 , 0 ) ; org . apache . hadoop . mapreduce . TaskAttemptContext mockContext = createDefaultTaskAttemptContext ( bounds ) ; java . util . List < org . apache . hadoop . mapreduce . InputSplit > result = subject . getSplits ( mockContext ) ; "<AssertPlaceHolder>" ; verifySplitsAreEqual ( 0 , 0 , result ) ; } size ( ) { return shpFile . getCount ( ) ; } | org . junit . Assert . assertEquals ( 1 , result . size ( ) ) |
testInvalidGroupOutOfRange ( ) { try { com . google . re2j . ApiTestUtils . testInvalidGroup ( "abc" , "abc" , 1 ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . IndexOutOfBoundsException e ) { "<AssertPlaceHolder>" ; } } fail ( ) { return new com . google . re2j . Compiler . Frag ( ) ; } | org . junit . Assert . assertTrue ( true ) |
testParseZeroX ( ) { java . lang . String source = ( ( ( "{0" + ( getDecimalCharacter ( ) ) ) + "0;<sp>-1" ) + ( getDecimalCharacter ( ) ) ) + "4343}" ; org . hipparchus . geometry . euclidean . twod . Vector2D expected = new org . hipparchus . geometry . euclidean . twod . Vector2D ( 0.0 , ( - 1.4343 ) ) ; org . hipparchus . geometry . euclidean . twod . Vector2D actual = vector2DFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . hipparchus . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . hipparchus . exception . MathIllegalStateException ( org . hipparchus . exception . LocalizedCoreFormats . CANNOT_PARSE_AS_TYPE , source , parsePosition . getErrorIndex ( ) , org . hipparchus . geometry . euclidean . twod . Vector2D . class ) ; } return result ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testSetExpressionValue ( ) { final java . lang . String expectedValue = "expression" ; view . setExpressionValue ( expectedValue ) ; final java . lang . String actualValue = expression . value ; "<AssertPlaceHolder>" ; } setExpressionValue ( java . lang . String ) { expression . value = value ; } | org . junit . Assert . assertEquals ( expectedValue , actualValue ) |
manageModificationVDiskDeletion_VSDISK_DETACHING_VDisksNotDetached ( ) { org . oscm . app . iaas . data . FlowState flowState = org . oscm . app . iaas . data . FlowState . VSDISK_DETACHING ; org . oscm . app . iaas . data . FlowState newState = null ; doReturn ( Boolean . FALSE ) . when ( vServerProcessor . vdiskInfo ) . areVDisksDetached ( paramHandler ) ; newState = vServerProcessor . manageModificationVDiskDeletion ( "controllerId" , "instanceId" , paramHandler , flowState , newState ) ; "<AssertPlaceHolder>" ; } manageModificationVDiskDeletion ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , org . oscm . app . iaas . data . FlowState ) { org . oscm . app . iaas . data . FlowState newState = newStateParam ; boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; switch ( flowState ) { case VSERVER_MODIFICATION_REQUESTED : if ( ( paramHandler . getControllerWaitTime ( ) ) != 0 ) { paramHandler . suspendProcessInstanceFor ( paramHandler . getControllerWaitTime ( ) ) ; newState = org . oscm . app . iaas . data . FlowState . WAITING_BEFORE_STOP ; break ; } case WAITING_BEFORE_STOP : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STOPPED_FOR_MODIFICATION , paramHandler ) ) { java . lang . String status = vserverComm . getVServerStatus ( paramHandler ) ; if ( VServerStatus . RUNNING . equals ( status ) ) { vserverComm . stopVServer ( paramHandler ) ; } else if ( VServerStatus . STOPPED . equals ( status ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STOPPED_FOR_MODIFICATION ; } } break ; case VSERVER_STOPPED_FOR_MODIFICATION : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATING , paramHandler ) ) ) { vserverComm . modifyVServerAttributes ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATING ; if ( vdiskInfo . isAttachedVDisksFound ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_DELETION_REQUESTED ; } } break ; case VSDISK_DELETION_REQUESTED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_DETACHING , paramHandler ) ) ) { vdiskInfo . detachVDisks ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_DETACHING ; } break ; case VSDISK_DETACHING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_DETACHED , paramHandler ) ) { if ( vdiskInfo . areVDisksDetached ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_DETACHED ; } } break ; case VSDISK_DETACHED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_DELETING , paramHandler ) ) ) { vdiskInfo . destroyVDisks ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_DELETING ; } break ; case VSDISK_DELETING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_DESTROYED , paramHandler ) ) { if ( vdiskInfo . areVDisksDestroyed ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATING ; } } break ; case VSERVER_UPDATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATED , paramHandler ) ) { if ( VServerStatus . STOPPED . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATED ; } } break ; case VSERVER_UPDATED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) { if ( vserverComm . startVServer ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } } break ; case VSERVER_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTED : if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { if ( ( paramHandler . getMailForCompletion ( ) ) != null ) { if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_RETRIEVEGUEST , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_RETRIEVEGUEST ; } } else { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } } break ; case VSERVER_RETRIEVEGUEST : java . lang . String mail = paramHandler . getMailForCompletion ( ) ; if ( mail != null ) { newState = dispatchVServerManualOperation ( controllerId , instanceId , paramHandler , mail ) ; } else { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; default : } return newState ; } | org . junit . Assert . assertNull ( newState ) |
testGenerationFromOtherItemDocument ( ) { org . wikidata . wdtk . datamodel . helpers . ItemDocument item = org . wikidata . wdtk . datamodel . helpers . Datamodel . makeItemDocument ( org . wikidata . wdtk . datamodel . helpers . Datamodel . makeWikidataItemIdValue ( "Q42" ) , java . util . Collections . singletonList ( org . wikidata . wdtk . datamodel . helpers . Datamodel . makeMonolingualTextValue ( "en" , "label" ) ) , java . util . Collections . singletonList ( org . wikidata . wdtk . datamodel . helpers . Datamodel . makeMonolingualTextValue ( "en" , "desc" ) ) , java . util . Collections . singletonList ( org . wikidata . wdtk . datamodel . helpers . Datamodel . makeMonolingualTextValue ( "en" , "alias" ) ) , java . util . Collections . emptyList ( ) , java . util . Collections . singletonMap ( "enwiki" , org . wikidata . wdtk . datamodel . helpers . Datamodel . makeSiteLink ( "foo" , "enwiki" , java . util . Collections . emptyList ( ) ) ) ) ; org . wikidata . wdtk . datamodel . helpers . DatamodelConverter converter = new org . wikidata . wdtk . datamodel . helpers . DatamodelConverter ( new org . wikidata . wdtk . datamodel . helpers . DataObjectFactoryImpl ( ) ) ; "<AssertPlaceHolder>" ; } copy ( java . util . List ) { java . util . List < org . wikidata . wdtk . datamodel . helpers . SnakGroup > result = new java . util . ArrayList ( snakGroups . size ( ) ) ; for ( org . wikidata . wdtk . datamodel . helpers . SnakGroup snakGroup : snakGroups ) { result . add ( copy ( snakGroup ) ) ; } return result ; } | org . junit . Assert . assertEquals ( item , converter . copy ( item ) ) |
testType ( ) { wd . open ( org . finra . jtaf . ewd . widget . element . InteractiveElementTest . url ) ; org . finra . jtaf . ewd . widget . IInteractiveElement field = new org . finra . jtaf . ewd . widget . element . InteractiveElement ( "//input[@id='inputFieldTest']" ) ; field . waitForElementPresent ( ) ; field . type ( "hello" ) ; org . finra . jtaf . ewd . widget . IElement element = new org . finra . jtaf . ewd . widget . element . Element ( getDiv ( "textcontent" ) ) ; "<AssertPlaceHolder>" ; } getText ( ) { try { org . openqa . selenium . WebElement webElement = findElement ( ) ; highlight ( org . finra . jtaf . ewd . widget . element . Element . HIGHLIGHT_MODES . GET ) ; return webElement . getText ( ) ; } catch ( java . lang . Exception e ) { throw new org . finra . jtaf . ewd . widget . WidgetException ( "Error<sp>while<sp>fetching<sp>text" , locator , e ) ; } } | org . junit . Assert . assertEquals ( "hello" , element . getText ( ) ) |
testAddMappedColum ( ) { org . pentaho . hbase . shim . api . Mapping aMapping = new org . pentaho . hbase . shim . api . Mapping ( "TestTable" , "TestMapping" , "MyKey" , Mapping . KeyType . INTEGER ) ; org . pentaho . hbase . shim . api . HBaseValueMeta vm = new org . pentaho . hbase . shim . api . HBaseValueMeta ( ( ( ( ( "Family1" + ( org . pentaho . hbase . shim . api . HBaseValueMeta . SEPARATOR ) ) + "Col1" ) + ( org . pentaho . hbase . shim . api . HBaseValueMeta . SEPARATOR ) ) + "Col1" ) , org . pentaho . di . core . row . ValueMetaInterface . TYPE_STRING , ( - 1 ) , ( - 1 ) ) ; aMapping . addMappedColumn ( vm , false ) ; "<AssertPlaceHolder>" ; } getMappedColumns ( ) { return java . util . Collections . unmodifiableMap ( com . google . common . collect . Maps . transformEntries ( delegate . getMappedColumns ( ) , new Maps . EntryTransformer < java . lang . String , org . pentaho . hbase . shim . api . HBaseValueMeta , org . pentaho . bigdata . api . hbase . meta . HBaseValueMetaInterface > ( ) { @ java . lang . Override public org . pentaho . bigdata . api . hbase . meta . HBaseValueMetaInterface transformEntry ( java . lang . String key , org . pentaho . hbase . shim . api . HBaseValueMeta value ) { if ( value instanceof org . pentaho . bigdata . api . hbase . meta . HBaseValueMetaInterface ) { return ( ( org . pentaho . bigdata . api . hbase . meta . HBaseValueMetaInterface ) ( value ) ) ; } return hBaseValueMetaInterfaceFactory . copy ( value ) ; } } ) ) ; } | org . junit . Assert . assertTrue ( aMapping . getMappedColumns ( ) . containsKey ( "Col1" ) ) |
testToString ( ) { final com . allanbank . mongodb . client . metrics . basic . BasicOperationMetricsListener metrics = new com . allanbank . mongodb . client . metrics . basic . BasicOperationMetricsListener ( ) ; "<AssertPlaceHolder>" ; metrics . close ( ) ; } toString ( ) { return "Metrics<sp>not<sp>being<sp>collected." ; } | org . junit . Assert . assertThat ( metrics . toString ( ) , org . hamcrest . Matchers . is ( "" ) ) |
testGetClientSideScriptNotExists ( ) { expect ( ( ( java . lang . Class ) ( descriptor . getImplementationClass ( ) ) ) ) . andReturn ( javax . faces . validator . RegexValidator . class ) ; expect ( scriptService . getScript ( environment . getFacesContext ( ) , javax . faces . validator . RegexValidator . class ) ) . andThrow ( new org . richfaces . javascript . ScriptNotFoundException ( ) ) ; controller . replay ( ) ; java . util . Collection < ? extends org . richfaces . renderkit . html . LibraryScriptFunction > clientSideValidatorScript = renderer . getClientSideValidatorScript ( environment . getFacesContext ( ) , descriptors ) ; "<AssertPlaceHolder>" ; controller . verify ( ) ; } isEmpty ( ) { return ( size ( ) ) == 0 ; } | org . junit . Assert . assertTrue ( clientSideValidatorScript . isEmpty ( ) ) |
testSplitIntoBundles ( ) { "<AssertPlaceHolder>" ; } splitIntoBundles ( long , org . talend . components . api . container . RuntimeContainer ) { return java . util . Arrays . asList ( this ) ; } | org . junit . Assert . assertEquals ( java . util . Collections . singletonList ( source ) , source . splitIntoBundles ( 0 , null ) ) |
testDeregister ( ) { tested . init ( canvasHandler ) ; tested . register ( element ) ; tested . deregister ( element ) ; verify ( selectionControl , times ( 1 ) ) . deregister ( eq ( element ) ) ; verify ( shapeViewHandlers , times ( 1 ) ) . removeHandler ( any ( org . kie . workbench . common . stunner . core . client . shape . view . event . ViewHandler . class ) ) ; "<AssertPlaceHolder>" ; } getHandlers ( ) { return handlers ; } | org . junit . Assert . assertTrue ( tested . getHandlers ( ) . isEmpty ( ) ) |
testAddDefaultTag ( ) { org . apache . servicecomb . swagger . generator . core . SwaggerGenerator swaggerGenerator = new org . apache . servicecomb . swagger . generator . core . SwaggerGenerator ( new org . apache . servicecomb . swagger . generator . pojo . PojoSwaggerGeneratorContext ( ) , null ) ; swaggerGenerator . addDefaultTag ( "test1" ) ; swaggerGenerator . addDefaultTag ( "" ) ; swaggerGenerator . addDefaultTag ( null ) ; swaggerGenerator . addDefaultTag ( "test2" ) ; "<AssertPlaceHolder>" ; } getDefaultTags ( ) { return defaultTags ; } | org . junit . Assert . assertThat ( swaggerGenerator . getDefaultTags ( ) , org . hamcrest . Matchers . contains ( "test1" , "test2" ) ) |
shouldGetRequestParameterWithSpecifiedName ( ) { java . lang . String expectedParameterName = "foo" ; java . lang . String expectedParameterValue = "bar" ; when ( mockHttpRequest . getParameterNames ( ) ) . thenReturn ( makeParameterNamesEnumeration ( expectedParameterName ) ) ; when ( mockHttpRequest . getParameterValues ( anyString ( ) ) ) . thenReturn ( new java . lang . String [ ] { expectedParameterValue } ) ; ro . pippo . pac4j . PippoWebContext context = makePippoWebContext ( ) ; "<AssertPlaceHolder>" ; verify ( mockHttpRequest , times ( 1 ) ) . getParameterNames ( ) ; verify ( mockHttpRequest , times ( 1 ) ) . getParameterValues ( expectedParameterName ) ; } getRequestParameter ( java . lang . String ) { ro . pippo . core . ParameterValue parameter = getRequest ( ) . getParameter ( name ) ; return parameter . isNull ( ) ? null : parameter . toString ( ) ; } | org . junit . Assert . assertThat ( context . getRequestParameter ( expectedParameterName ) , org . hamcrest . core . Is . is ( expectedParameterValue ) ) |
isOrStringLikeWithLowerCase ( ) { if ( isBatoo ( ) ) { return ; } final java . lang . String query = "select<sp>r<sp>from<sp>RegularEntityTwo<sp>r<sp>" + "<sp>where<sp>r.id<sp>in<sp>(select<sp>sub.id<sp>from<sp>RegularEntityOne<sp>sub<sp>where<sp>((lower(sub.stringAttribute)<sp>like<sp>'%string<sp>02%')<sp>or<sp>(lower(sub.stringAttribute)<sp>like<sp>'%string<sp>01%')))" ; final java . util . List < com . uaihebert . model . test . RegularEntityTwo > resultFromJPQL = jpqlHelper . getListFromJPQL ( query , com . uaihebert . model . test . RegularEntityTwo . class ) ; "<AssertPlaceHolder>" ; final com . uaihebert . uaicriteria . UaiCriteria < com . uaihebert . model . test . RegularEntityTwo > uaiCriteria = createCriteria ( com . uaihebert . model . test . RegularEntityTwo . class ) ; final com . uaihebert . uaicriteria . UaiCriteria < com . uaihebert . model . test . RegularEntityOne > subQuery = uaiCriteria . subQuery ( "id" , com . uaihebert . model . test . RegularEntityOne . class ) ; subQuery . orStringLike ( true , "stringAttribute" , "%String<sp>02%" , "%String<sp>01%" ) ; uaiCriteria . andAttributeIn ( "id" , subQuery ) ; validateTestLists ( resultFromJPQL , uaiCriteria . getResultList ( ) ) ; } getListFromJPQL ( java . lang . String , java . lang . Class ) { return getListFromJPQL ( query , classToUse , null ) ; } | org . junit . Assert . assertTrue ( ( ( resultFromJPQL . size ( ) ) > 0 ) ) |
stringSpansSegments ( ) { okio . Buffer buffer = new okio . Buffer ( ) ; java . lang . String a = okio . TestUtil . repeat ( 'a' , ( ( Segment . SIZE ) - 1 ) ) ; java . lang . String b = "bb" ; java . lang . String c = okio . TestUtil . repeat ( 'c' , ( ( Segment . SIZE ) - 1 ) ) ; buffer . writeUtf8 ( a ) ; buffer . writeUtf8 ( b ) ; buffer . writeUtf8 ( c ) ; "<AssertPlaceHolder>" ; } readUtf8 ( ) { buffer . writeAll ( source ) ; return buffer . readUtf8 ( ) ; } | org . junit . Assert . assertEquals ( ( ( a + b ) + c ) , buffer . readUtf8 ( ) ) |
testThatWhenExpiredQualityIsDecreasedNormally ( ) { int initialQuality = 10 ; int initialSellIn = - 1 ; Item dexerity = new Item ( "+5<sp>Dexterity<sp>Vest" , initialSellIn , initialQuality ) ; GildedRose sut = new GildedRose ( dexerity ) ; sut . updateQuality ( ) ; "<AssertPlaceHolder>" ; } getQuality ( ) { return quality ; } | org . junit . Assert . assertThat ( dexerity . getQuality ( ) , org . hamcrest . core . Is . is ( ( initialQuality - 1 ) ) ) |
listUserAccountFail ( ) { wireMockRule . stubFor ( get ( urlPathMatching ( "/user?.*" ) ) . willReturn ( aResponse ( ) . withHeader ( "Content-Type" , "application/json" ) . withBody ( "" ) ) ) ; final org . apache . cloudstack . cloudian . client . CloudianUser user = client . listUser ( "abc" , "xyz" ) ; "<AssertPlaceHolder>" ; } listUser ( java . lang . String , java . lang . String ) { if ( ( com . google . common . base . Strings . isNullOrEmpty ( userId ) ) || ( com . google . common . base . Strings . isNullOrEmpty ( groupId ) ) ) { return null ; } org . apache . cloudstack . cloudian . client . CloudianClient . LOG . debug ( ( ( ( "Trying<sp>to<sp>find<sp>Cloudian<sp>user<sp>with<sp>id=" + userId ) + "<sp>and<sp>group<sp>id=" ) + groupId ) ) ; try { final org . apache . http . HttpResponse response = get ( java . lang . String . format ( "/user?userId=%s&groupId=%s" , userId , groupId ) ) ; checkResponseOK ( response ) ; if ( checkEmptyResponse ( response ) ) { return null ; } final com . fasterxml . jackson . databind . ObjectMapper mapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; return mapper . readValue ( response . getEntity ( ) . getContent ( ) , org . apache . cloudstack . cloudian . client . CloudianUser . class ) ; } catch ( final java . io . IOException e ) { org . apache . cloudstack . cloudian . client . CloudianClient . LOG . error ( "Failed<sp>to<sp>list<sp>Cloudian<sp>user<sp>due<sp>to:" , e ) ; checkResponseTimeOut ( e ) ; } return null ; } | org . junit . Assert . assertNull ( user ) |
testStringsToString ( ) { final org . eclipse . birt . report . engine . api . IScalarParameterDefn def = org . mockito . Mockito . mock ( org . eclipse . birt . report . engine . api . IScalarParameterDefn . class ) ; org . mockito . Mockito . when ( def . getDataType ( ) ) . thenReturn ( IParameterDefn . TYPE_STRING ) ; final java . lang . Object input = new java . lang . String [ ] { "Blablabla" } ; final java . lang . Object result = nl . bzk . migratiebrp . isc . console . webapp . report . birt . BirtReportParameters . convertTo ( def , input ) ; "<AssertPlaceHolder>" ; } convertTo ( org . eclipse . birt . report . engine . api . IScalarParameterDefn , java . lang . Object ) { final java . lang . Object result ; if ( parameterValue instanceof java . lang . String ) { result = nl . moderniseringgba . isc . console . report . birt . BirtReportParameters . convertStringTo ( definition , ( ( java . lang . String ) ( parameterValue ) ) ) ; } else if ( parameterValue instanceof java . lang . String [ ] ) { final java . lang . String [ ] parameterValues = ( ( java . lang . String [ ] ) ( parameterValue ) ) ; result = ( ( parameterValues . length ) == 0 ) ? null : nl . moderniseringgba . isc . console . report . birt . BirtReportParameters . convertStringTo ( definition , parameterValues [ 0 ] ) ; } else { result = parameterValue ; } return result ; } | org . junit . Assert . assertEquals ( "Blablabla" , result ) |
testSerialization ( ) { org . jfree . chart . axis . PeriodAxisLabelInfo info1 = new org . jfree . chart . axis . PeriodAxisLabelInfo ( org . jfree . data . time . Day . class , new java . text . SimpleDateFormat ( "d" ) ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( info1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . axis . PeriodAxisLabelInfo info2 = ( ( org . jfree . chart . axis . PeriodAxisLabelInfo ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } } | org . junit . Assert . assertEquals ( info1 , info2 ) |
subInput1PositiveZeroOutput0 ( ) { final java . util . List < java . lang . Integer > list = new java . util . ArrayList ( ) ; list . add ( null ) ; final int start = 1 ; final int end = 0 ; final java . util . List < java . lang . Integer > retval = cn . hutool . core . collection . CollUtil . sub ( list , start , end ) ; final java . util . List < java . lang . Integer > arrayList = new java . util . ArrayList ( ) ; "<AssertPlaceHolder>" ; } sub ( java . util . List , int , int ) { return cn . hutool . core . collection . CollUtil . sub ( list , start , end , 1 ) ; } | org . junit . Assert . assertEquals ( arrayList , retval ) |
testGetIsotopes_IMolecularFormula_IElement ( ) { org . openscience . cdk . interfaces . IMolecularFormula formula = new org . openscience . cdk . formula . MolecularFormula ( ) ; org . openscience . cdk . interfaces . IIsotope carb = org . openscience . cdk . tools . manipulator . MolecularFormulaManipulatorTest . builder . newInstance ( org . openscience . cdk . interfaces . IIsotope . class , "C" ) ; org . openscience . cdk . interfaces . IIsotope flu = org . openscience . cdk . tools . manipulator . MolecularFormulaManipulatorTest . builder . newInstance ( org . openscience . cdk . interfaces . IIsotope . class , "F" ) ; org . openscience . cdk . interfaces . IIsotope h1 = org . openscience . cdk . tools . manipulator . MolecularFormulaManipulatorTest . builder . newInstance ( org . openscience . cdk . interfaces . IIsotope . class , "H" ) ; org . openscience . cdk . interfaces . IIsotope h2 = org . openscience . cdk . tools . manipulator . MolecularFormulaManipulatorTest . builder . newInstance ( org . openscience . cdk . interfaces . IIsotope . class , "H" ) ; h2 . setExactMass ( 2.014101778 ) ; formula . addIsotope ( carb , 1 ) ; formula . addIsotope ( flu ) ; formula . addIsotope ( h1 , 1 ) ; formula . addIsotope ( h2 , 2 ) ; java . util . List < org . openscience . cdk . interfaces . IIsotope > isotopes = org . openscience . cdk . tools . manipulator . MolecularFormulaManipulator . getIsotopes ( formula , org . openscience . cdk . tools . manipulator . MolecularFormulaManipulatorTest . builder . newInstance ( org . openscience . cdk . interfaces . IElement . class , "H" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , isotopes . size ( ) ) |
testCartesianCollection_Tables ( ) { org . apache . crunch . PTable < java . lang . String , java . lang . Integer > leftTable = org . apache . crunch . impl . mem . MemPipeline . typedTableOf ( org . apache . crunch . types . writable . Writables . tableOf ( org . apache . crunch . types . writable . Writables . strings ( ) , org . apache . crunch . types . writable . Writables . ints ( ) ) , "a" , 1 , "b" , 2 ) ; org . apache . crunch . PTable < java . lang . String , java . lang . Float > rightTable = org . apache . crunch . impl . mem . MemPipeline . typedTableOf ( org . apache . crunch . types . writable . Writables . tableOf ( org . apache . crunch . types . writable . Writables . strings ( ) , org . apache . crunch . types . writable . Writables . floats ( ) ) , "A" , 1.0F , "B" , 2.0F ) ; org . apache . crunch . PTable < org . apache . crunch . Pair < java . lang . String , java . lang . String > , org . apache . crunch . Pair < java . lang . Integer , java . lang . Float > > cartesianProduct = org . apache . crunch . lib . Cartesian . cross ( leftTable , rightTable ) ; java . util . List < org . apache . crunch . Pair < org . apache . crunch . Pair < java . lang . String , java . lang . String > , org . apache . crunch . Pair < java . lang . Integer , java . lang . Float > > > expectedResults = com . google . common . collect . Lists . newArrayList ( ) ; expectedResults . add ( org . apache . crunch . Pair . of ( org . apache . crunch . Pair . of ( "a" , "A" ) , org . apache . crunch . Pair . of ( 1 , 1.0F ) ) ) ; expectedResults . add ( org . apache . crunch . Pair . of ( org . apache . crunch . Pair . of ( "a" , "B" ) , org . apache . crunch . Pair . of ( 1 , 2.0F ) ) ) ; expectedResults . add ( org . apache . crunch . Pair . of ( org . apache . crunch . Pair . of ( "b" , "A" ) , org . apache . crunch . Pair . of ( 2 , 1.0F ) ) ) ; expectedResults . add ( org . apache . crunch . Pair . of ( org . apache . crunch . Pair . of ( "b" , "B" ) , org . apache . crunch . Pair . of ( 2 , 2.0F ) ) ) ; java . util . List < org . apache . crunch . Pair < org . apache . crunch . Pair < java . lang . String , java . lang . String > , org . apache . crunch . Pair < java . lang . Integer , java . lang . Float > > > actualResults = com . google . common . collect . Lists . newArrayList ( cartesianProduct . materialize ( ) ) ; java . util . Collections . sort ( actualResults ) ; "<AssertPlaceHolder>" ; } sort ( org . apache . crunch . PTable ) { return org . apache . crunch . lib . Sort . sort ( table , org . apache . crunch . lib . Sort . Order . ASCENDING ) ; } | org . junit . Assert . assertEquals ( expectedResults , actualResults ) |
testEqualsSelf ( ) { org . jfree . data . time . SimpleTimePeriod p = new org . jfree . data . time . SimpleTimePeriod ( new java . util . Date ( 1000L ) , new java . util . Date ( 1001L ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == ( this ) ) { return true ; } if ( ! ( obj instanceof org . jfree . ui . LengthAdjustmentType ) ) { return false ; } final org . jfree . ui . LengthAdjustmentType that = ( ( org . jfree . ui . LengthAdjustmentType ) ( obj ) ) ; if ( ! ( this . name . equals ( that . name ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( p . equals ( p ) ) |
testParse_NothingRegex ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) ) |
testAvgMemoryHigherThan75 ( ) { count . set ( 0 ) ; com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . LOGGER . debug ( "[AVG]<sp>Raising<sp>alarm<sp>if<sp>AVG(MEMORY)<sp>><sp>75%<sp>" ) ; com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . LOGGER . debug ( "--><sp>Creating<sp>Sandbox<sp>Queries<sp>and<sp>Loading<sp>dataset" ) ; com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . SENSORS_QUERY1_ID = sm . addQuery ( SandboxQueries . QUERY_250_AVG ) ; com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . SENSORS_QUERY2_ID = sm . addQuery ( SandboxQueries . QUERY_AVG_CPU_HIGHER_80 ) ; com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . SENSORS_QUERY3_ID = sm . addQuery ( SandboxQueries . QUERY_AVG_MEMORY_HIGHER_75 ) ; sm . addCallback ( SandboxQueries . STREAM_SENSORS_GRID_ALARMS , new org . wso2 . siddhi . core . stream . output . StreamCallback ( ) { @ com . stratio . decision . unit . siddhi . query . Override public void receive ( org . wso2 . siddhi . core . event . Event [ ] events ) { for ( org . wso2 . siddhi . core . event . Event event : events ) { if ( ( event instanceof org . wso2 . siddhi . core . event . in . InEvent ) && ( event . getData ( 2 ) . toString ( ) . equals ( "Alarm_intensive_MEMORY_load" ) ) ) { count . getAndIncrement ( ) ; com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . LOGGER . debug ( ( "Found<sp>event:<sp>" + ( event . toString ( ) ) ) ) ; } } } } ) ; com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . loadSensorsData ( com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . DATASET_SENSORS1 ) ; java . lang . Thread . sleep ( 2000 ) ; "<AssertPlaceHolder>" ; sm . removeQuery ( com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . SENSORS_QUERY1_ID ) ; sm . removeQuery ( com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . SENSORS_QUERY2_ID ) ; sm . removeQuery ( com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . SENSORS_QUERY3_ID ) ; } loadSensorsData ( java . lang . String ) { com . stratio . decision . unit . siddhi . query . SandboxQueriesValidationTest . LOGGER . debug ( ( "Loading<sp>sensors<sp>data<sp>from<sp>file:<sp>" + dataSetPath ) ) ; java . util . List < java . lang . String [ ] > sensors = com . stratio . decision . unit . siddhi . query . ResourcesLoader . loadData ( dataSetPath , ',' , ' | org . junit . Assert . assertEquals ( 1 , count . get ( ) ) |
testResolvedItems_withoutPreloadedItemsSet ( ) { table = new org . eclipse . swt . widgets . Table ( shell , org . eclipse . swt . SWT . VIRTUAL ) ; table . setSize ( 100 , 100 ) ; table . setItemCount ( 200 ) ; table . setTopIndex ( 100 ) ; org . eclipse . swt . widgets . Table_Test . redrawTable ( table ) ; "<AssertPlaceHolder>" ; } countResolvedItems ( org . eclipse . swt . widgets . Table ) { org . eclipse . swt . internal . widgets . ITableAdapter tableAdapter = org . eclipse . swt . widgets . Table_Test . getTableAdapter ( table ) ; int result = 0 ; org . eclipse . swt . widgets . TableItem [ ] createdItems = tableAdapter . getCreatedItems ( ) ; for ( int i = 0 ; i < ( createdItems . length ) ; i ++ ) { int index = table . indexOf ( createdItems [ i ] ) ; if ( ! ( tableAdapter . isItemVirtual ( index ) ) ) { result ++ ; } } return result ; } | org . junit . Assert . assertEquals ( 4 , org . eclipse . swt . widgets . Table_Test . countResolvedItems ( table ) ) |
canFindElement ( ) { page . setWebPage ( pages . clicksPage ) ; page . clickGet ( ) ; java . lang . String wdcByTagName = page . findElement ( "tagName" , "h1" ) ; java . lang . String wdcByXPath = page . findElement ( "xpath" , "//h1" ) ; "<AssertPlaceHolder>" ; } findElement ( org . openqa . selenium . WebDriver , java . lang . String ) { org . openqa . selenium . WebElement toReturn = null ; java . lang . String strategy = searchAdditionalStrategies ( locator ) ; if ( strategy != null ) { java . lang . String actualLocator = locator . substring ( ( ( locator . indexOf ( '=' ) ) + 1 ) ) ; try { toReturn = ( ( org . openqa . selenium . WebElement ) ( ( ( org . openqa . selenium . JavascriptExecutor ) ( driver ) ) . executeScript ( strategy , actualLocator ) ) ) ; if ( toReturn == null ) { throw new com . thoughtworks . selenium . SeleniumException ( ( ( "Element<sp>" + locator ) + "<sp>not<sp>found" ) ) ; } return toReturn ; } catch ( org . openqa . selenium . WebDriverException e ) { throw new com . thoughtworks . selenium . SeleniumException ( ( ( "Element<sp>" + locator ) + "<sp>not<sp>found" ) ) ; } } try { toReturn = findElementDirectlyIfNecessary ( driver , locator ) ; if ( toReturn != null ) { return toReturn ; } return ( ( org . openqa . selenium . WebElement ) ( ( ( org . openqa . selenium . JavascriptExecutor ) ( driver ) ) . executeScript ( findElement , locator ) ) ) ; } catch ( org . openqa . selenium . WebDriverException e ) { throw new com . thoughtworks . selenium . SeleniumException ( ( ( "Element<sp>" + locator ) + "<sp>not<sp>found" ) , e ) ; } } | org . junit . Assert . assertEquals ( wdcByTagName , wdcByXPath ) |
testGetBusinessObjectFormats ( ) { org . finra . herd . model . api . xml . BusinessObjectDefinitionKey businessObjectDefinitionKey = new org . finra . herd . model . api . xml . BusinessObjectDefinitionKey ( NAMESPACE , BDEF_NAME ) ; org . finra . herd . model . api . xml . BusinessObjectFormatKeys businessObjectFormatKeys = new org . finra . herd . model . api . xml . BusinessObjectFormatKeys ( java . util . Arrays . asList ( new org . finra . herd . model . api . xml . BusinessObjectFormatKey ( NAMESPACE , BDEF_NAME , DATA_PROVIDER_NAME , BDEF_DESCRIPTION , INITIAL_FORMAT_VERSION ) , new org . finra . herd . model . api . xml . BusinessObjectFormatKey ( NAMESPACE , BDEF_NAME , DATA_PROVIDER_NAME_2 , BDEF_DESCRIPTION , INITIAL_FORMAT_VERSION ) ) ) ; when ( businessObjectFormatService . getBusinessObjectFormats ( businessObjectDefinitionKey , false ) ) . thenReturn ( businessObjectFormatKeys ) ; org . finra . herd . model . api . xml . BusinessObjectFormatKeys resultKeys = businessObjectFormatRestController . getBusinessObjectFormats ( org . finra . herd . rest . NAMESPACE , org . finra . herd . rest . BDEF_NAME , false ) ; verify ( businessObjectFormatService ) . getBusinessObjectFormats ( businessObjectDefinitionKey , false ) ; verifyNoMoreInteractions ( businessObjectFormatService ) ; "<AssertPlaceHolder>" ; } getBusinessObjectFormats ( org . finra . herd . model . api . xml . BusinessObjectDefinitionKey , boolean ) { return getBusinessObjectFormatsWithFilters ( businessObjectDefinitionKey , null , latestBusinessObjectFormatVersion ) ; } | org . junit . Assert . assertEquals ( businessObjectFormatKeys , resultKeys ) |
testIsNull1 ( ) { org . infinispan . query . dsl . QueryFactory qf = org . infinispan . all . embeddedquery . QueryDslConditionsTest . getQueryFactory ( ) ; org . infinispan . query . dsl . Query q = qf . from ( org . infinispan . all . embeddedquery . QueryDslConditionsTest . getModelFactory ( ) . getUserImplClass ( ) ) . having ( "surname" ) . isNull ( ) . build ( ) ; java . util . List < org . infinispan . all . embeddedquery . testdomain . User > list = q . list ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return cache . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , list . size ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.