input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testSplitSegmentDoesNothingIfTheEventProcessorIsNotOfTypeTracking ( ) { boolean result = testSubject . splitSegment ( org . axonframework . axonserver . connector . processor . EventProcessorControllerTest . SUBSCRIBING_PROCESSOR_NAME , org . axonframework . axonserver . connector . processor . EventProcessorControllerTest . SEGMENT_ID ) ; verifyZeroInteractions ( testSubscribingProcessor ) ; "<AssertPlaceHolder>" ; } splitSegment ( java . lang . String , int ) { org . axonframework . eventhandling . EventProcessor eventProcessor = getEventProcessor ( processorName ) ; if ( ! ( eventProcessor instanceof org . axonframework . eventhandling . TrackingEventProcessor ) ) { org . axonframework . axonserver . connector . processor . EventProcessorController . logger . info ( "Split<sp>segment<sp>requested<sp>for<sp>processor<sp>[{}]<sp>which<sp>is<sp>not<sp>a<sp>Tracking<sp>Event<sp>Processor" ) ; return false ; } return ( ( org . axonframework . eventhandling . TrackingEventProcessor ) ( eventProcessor ) ) . splitSegment ( segmentId ) . thenApply ( ( result ) -> { if ( result ) { org . axonframework . axonserver . connector . processor . EventProcessorController . logger . info ( "Successfully<sp>split<sp>segment<sp>[{}]<sp>of<sp>processor<sp>[{}]" , segmentId , processorName ) ; } else { org . axonframework . axonserver . connector . processor . EventProcessorController . logger . warn ( "Was<sp>not<sp>able<sp>to<sp>split<sp>segment<sp>[{}]<sp>for<sp>processor<sp>[{}]" , segmentId , processorName ) ; } return result ; } ) . join ( ) ; }
org . junit . Assert . assertFalse ( result )
testGetColumn_withIndexExceedingGridWidth ( ) { int index = ( StaticGrid . TILE_GRID . getWidth ( ) ) + 1 ; final com . valkryst . VTerminal . Tile [ ] row = StaticGrid . TILE_GRID . getColumn ( index ) ; "<AssertPlaceHolder>" ; } getColumn ( int ) { if ( ( columnIndex >= ( tiles [ 0 ] . length ) ) || ( columnIndex < 0 ) ) { return com . valkryst . VTerminal . TileGrid . EMPTY_ARRAY ; } final com . valkryst . VTerminal . Tile [ ] columnTiles = new com . valkryst . VTerminal . Tile [ tiles . length ] ; for ( int rowIndex = 0 ; rowIndex < ( tiles . length ) ; rowIndex ++ ) { columnTiles [ rowIndex ] = tiles [ rowIndex ] [ columnIndex ] ; } return columnTiles ; }
org . junit . Assert . assertEquals ( row . length , 0 )
getPreviousCheckedTimeMillis_A$ ( ) { long actual = crond . getPreviousCheckedTimeMillis ( ) ; long expected = 0L ; "<AssertPlaceHolder>" ; } getPreviousCheckedTimeMillis ( ) { return previousCheckedTimeMillis ; }
org . junit . Assert . assertEquals ( expected , actual )
shouldRejectWhenMissingAttributes ( ) { org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( new org . openstack . atlas . docs . loadbalancers . api . v1 . Node ( ) , org . openstack . atlas . api . validation . validators . PUT ) ; "<AssertPlaceHolder>" ; } passedValidation ( ) { return expectationResultList . isEmpty ( ) ; }
org . junit . Assert . assertFalse ( result . passedValidation ( ) )
testGetContentCleanerJob ( ) { org . pentaho . platform . api . scheduler2 . Job mockJob = mock ( org . pentaho . platform . api . scheduler2 . Job . class ) ; doReturn ( mockJob ) . when ( schedulerResource . schedulerService ) . getContentCleanerJob ( ) ; org . pentaho . platform . api . scheduler2 . Job testJob = schedulerResource . getContentCleanerJob ( ) ; "<AssertPlaceHolder>" ; verify ( schedulerResource . schedulerService , times ( 1 ) ) . getContentCleanerJob ( ) ; } getContentCleanerJob ( ) { org . pentaho . platform . api . engine . IPentahoSession session = getSession ( ) ; final java . lang . String principalName = session . getName ( ) ; final java . lang . Boolean canAdminister = getPolicy ( ) . isAllowed ( AdministerSecurityAction . NAME ) ; java . util . List < org . pentaho . platform . api . scheduler2 . Job > jobs = getScheduler ( ) . getJobs ( getJobFilter ( canAdminister , principalName ) ) ; if ( ( jobs . size ( ) ) > 0 ) { return jobs . get ( 0 ) ; } return null ; }
org . junit . Assert . assertEquals ( mockJob , testJob )
compositeHadoopTap ( ) { java . lang . Class < ? > tapType = com . hotels . plunger . TapTypeUtil . getTapConfigClass ( new cascading . tap . MultiSourceTap ( new cascading . tap . hadoop . Hfs ( new cascading . scheme . hadoop . TextDelimited ( ) , "" ) ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( org . apache . hadoop . conf . Configuration . class , tapType )
shouldReturnTrueForPlannedQuantityValidation ( ) { stubBelongsToField ( order , OrderFields . PRODUCT , product ) ; stubDecimalField ( order , OrderFields . PLANNED_QUANTITY , BigDecimal . ONE ) ; boolean result = orderHooks . checkOrderPlannedQuantity ( orderDD , order ) ; "<AssertPlaceHolder>" ; } checkOrderPlannedQuantity ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { com . qcadoo . model . api . Entity product = order . getBelongsToField ( OrderFields . PRODUCT ) ; if ( product == null ) { return true ; } java . math . BigDecimal plannedQuantity = order . getDecimalField ( OrderFields . PLANNED_QUANTITY ) ; if ( plannedQuantity == null ) { order . addError ( orderDD . getField ( OrderFields . PLANNED_QUANTITY ) , "orders.validate.global.error.plannedQuantityError" ) ; return false ; } else { return true ; } }
org . junit . Assert . assertTrue ( result )
loadStoredSettingsShouldSetWakeLockToFalseIfSetToFalse ( ) { net . usikkert . kouchat . android . util . RobolectricTestUtils . setWakeLockInTheAndroidSettingsTo ( false ) ; settingsLoader . loadStoredSettings ( context , settings ) ; "<AssertPlaceHolder>" ; } isWakeLockEnabled ( ) { return wakeLockEnabled ; }
org . junit . Assert . assertFalse ( settings . isWakeLockEnabled ( ) )
getRedenVerliesNlTestOK ( ) { final java . lang . String rvnCode = "034" ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . RedenVerliesNLNationaliteit expectedRvn = new nl . bzk . algemeenbrp . dal . domein . brp . entity . RedenVerliesNLNationaliteit ( rvnCode , "034" ) ; final java . lang . String expected = java . lang . String . format ( nl . bzk . migratiebrp . ggo . viewer . service . impl . BrpStamtabelServiceTest . STRING_FORMAT , expectedRvn . getCode ( ) , expectedRvn . getOmschrijving ( ) ) ; org . mockito . Mockito . doReturn ( expectedRvn ) . when ( dynamischeStamtabelRepository ) . getRedenVerliesNLNationaliteitByCode ( rvnCode ) ; final java . lang . String resultRvn = brpStamtabelService . getRedenVerliesNederlandschap ( java . lang . String . valueOf ( rvnCode ) ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { final nl . bzk . brp . domain . expressie . Datumdeel datumdeel = new nl . bzk . brp . domain . expressie . Datumdeel ( ) ; datumdeel . waarde = waarde ; datumdeel . type = nl . bzk . brp . domain . expressie . Datumdeel . Type . WAARDE ; return datumdeel ; }
org . junit . Assert . assertEquals ( expected , resultRvn )
testParsePatternCount1 ( ) { model . datafield . DataField result = ( ( model . datafield . DataField ) ( p . parse ( "COMPARE<sp>PATTERN<sp>LABEL(Y)" , data ) ) ) ; "<AssertPlaceHolder>" ; } getIntegerValue ( ) { throw new model . UnsupportedFormatException ( "Double<sp>cannot<sp>be<sp>converted<sp>to<sp>an<sp>integer" ) ; }
org . junit . Assert . assertEquals ( 1 , result . getIntegerValue ( ) )
size_anthracene ( ) { int [ ] [ ] anthracene = org . openscience . cdk . graph . InitialCyclesTest . anthracene ( ) ; org . openscience . cdk . graph . VertexShortCycles vsc = new org . openscience . cdk . graph . VertexShortCycles ( anthracene ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; }
org . junit . Assert . assertThat ( vsc . size ( ) , org . hamcrest . CoreMatchers . is ( 3 ) )
testGetCDSLengthReverseDesc ( ) { java . util . List < java . lang . Integer > exonStarts = new java . util . ArrayList ( java . util . Arrays . asList ( 70 , 50 , 10 ) ) ; java . util . List < java . lang . Integer > exonEnds = new java . util . ArrayList ( java . util . Arrays . asList ( 80 , 60 , 20 ) ) ; int cdsStart = 75 ; int cdsEnd = 50 ; int cdsDesired = 17 - 3 ; org . biojava . nbio . genome . util . ChromosomeMappingTools . setCoordinateSystem ( 0 ) ; int cdsTest = org . biojava . nbio . genome . util . ChromosomeMappingTools . getCDSLengthReverse ( exonStarts , exonEnds , cdsStart , cdsEnd ) ; "<AssertPlaceHolder>" ; } getCDSLengthReverse ( java . util . List , java . util . List , int , int ) { int codingLength = 0 ; if ( cdsEnd < cdsStart ) { int tmp = cdsEnd ; cdsEnd = cdsStart ; cdsStart = tmp ; } cdsStart = cdsStart + ( org . biojava . nbio . genome . util . ChromosomeMappingTools . base ) ; for ( int i = ( exonStarts . size ( ) ) - 1 ; i >= 0 ; i -- ) { int end = exonStarts . get ( i ) ; int start = exonEnds . get ( i ) ; if ( end < start ) { int tmp = end ; end = start ; start = tmp ; } start = start + ( org . biojava . nbio . genome . util . ChromosomeMappingTools . base ) ; if ( ( ( start < cdsStart ) && ( end < cdsStart ) ) || ( ( start > cdsEnd ) && ( end > cdsEnd ) ) ) continue ; if ( start < cdsStart ) start = cdsStart ; if ( end > cdsEnd ) end = cdsEnd ; codingLength += ( end - start ) + 1 ; } return codingLength - 3 ; }
org . junit . Assert . assertEquals ( cdsDesired , cdsTest )
testGet ( ) { int value = com . annimon . stream . Exceptional . of ( com . annimon . stream . ExceptionalTest . tenSupplier ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return new java . lang . StringBuilder ( ) ; }
org . junit . Assert . assertEquals ( 10 , value )
serialization ( ) { org . apache . commons . math3 . ode . TestProblem1 pb = new org . apache . commons . math3 . ode . TestProblem1 ( ) ; double step = ( ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ) * 0.001 ; org . apache . commons . math3 . ode . nonstiff . EulerIntegrator integ = new org . apache . commons . math3 . ode . nonstiff . EulerIntegrator ( step ) ; integ . addStepHandler ( new org . apache . commons . math3 . ode . ContinuousOutputModel ( ) ) ; integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream oos = new java . io . ObjectOutputStream ( bos ) ; for ( org . apache . commons . math3 . ode . sampling . StepHandler handler : integ . getStepHandlers ( ) ) { oos . writeObject ( handler ) ; } java . io . ByteArrayInputStream bis = new java . io . ByteArrayInputStream ( bos . toByteArray ( ) ) ; java . io . ObjectInputStream ois = new java . io . ObjectInputStream ( bis ) ; org . apache . commons . math3 . ode . ContinuousOutputModel cm = ( ( org . apache . commons . math3 . ode . ContinuousOutputModel ) ( ois . readObject ( ) ) ) ; java . util . Random random = new java . util . Random ( 347588535632L ) ; double maxError = 0.0 ; for ( int i = 0 ; i < 1000 ; ++ i ) { double r = random . nextDouble ( ) ; double time = ( r * ( pb . getInitialTime ( ) ) ) + ( ( 1.0 - r ) * ( pb . getFinalTime ( ) ) ) ; cm . setInterpolatedTime ( time ) ; double [ ] interpolatedY = cm . getInterpolatedState ( ) ; double [ ] theoreticalY = pb . computeTheoreticalState ( time ) ; double dx = ( interpolatedY [ 0 ] ) - ( theoreticalY [ 0 ] ) ; double dy = ( interpolatedY [ 1 ] ) - ( theoreticalY [ 1 ] ) ; double error = ( dx * dx ) + ( dy * dy ) ; if ( error > maxError ) { maxError = error ; } } "<AssertPlaceHolder>" ; } nextDouble ( ) { return fr . inria . astor . core . setup . RandomManager . randomNumberGenerator . nextDouble ( ) ; }
org . junit . Assert . assertTrue ( ( maxError < 0.001 ) )
addRevokeUser_SubscriptionManagerPermissions ( ) { createdSubscription = createSubscription ( ) ; createdSubscription = org . oscm . ws . SubscriptionServiceWSTest . subscrServiceForSubManager . subscribeToService ( createdSubscription , org . oscm . ws . SubscriptionServiceWSTest . freeService , org . oscm . ws . SubscriptionServiceWSTest . usageLicences , null , null , new java . util . ArrayList < org . oscm . vo . VOUda > ( ) ) ; java . lang . String subId = createdSubscription . getSubscriptionId ( ) ; org . oscm . ws . SubscriptionServiceWSTest . factory . createUsageLicenceVO ( org . oscm . ws . SubscriptionServiceWSTest . customerUser ) ; org . oscm . ws . SubscriptionServiceWSTest . subscrServiceForSubManager . addRevokeUser ( subId , new java . util . ArrayList < org . oscm . vo . VOUsageLicense > ( ) , java . util . Arrays . asList ( ( ( org . oscm . vo . VOUser ) ( org . oscm . ws . SubscriptionServiceWSTest . customerUser ) ) ) ) ; java . util . List < org . oscm . vo . VOUserSubscription > subList = org . oscm . ws . SubscriptionServiceWSTest . subscrServiceForCustomer . getSubscriptionsForUser ( org . oscm . ws . SubscriptionServiceWSTest . customerUser ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , subList . size ( ) )
testCheckSettingsOk ( ) { com . onelogin . saml2 . settings . Saml2Settings settings = new com . onelogin . saml2 . settings . SettingsBuilder ( ) . fromFile ( "config/config.all.properties" ) . build ( ) ; java . util . List < java . lang . String > settingsErrors = settings . checkSettings ( ) ; "<AssertPlaceHolder>" ; } checkSettings ( ) { java . util . List < java . lang . String > errors = new java . util . ArrayList ( this . checkSPSettings ( ) ) ; if ( ! ( spValidationOnly ) ) { errors . addAll ( this . checkIdPSettings ( ) ) ; } return errors ; }
org . junit . Assert . assertTrue ( settingsErrors . isEmpty ( ) )
testGetColumnKeys ( ) { org . jfree . data . category . DefaultIntervalCategoryDataset empty = new org . jfree . data . category . DefaultIntervalCategoryDataset ( new double [ 0 ] [ 0 ] , new double [ 0 ] [ 0 ] ) ; java . util . List keys = empty . getColumnKeys ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return queue . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , keys . size ( ) )
test_Version ( ) { de . vandermeer . svg2vector . applications . fh . Svg2Vector_FH app = new de . vandermeer . svg2vector . applications . fh . Svg2Vector_FH ( ) ; java . lang . String [ ] args = new java . lang . String [ ] { "--version" } ; "<AssertPlaceHolder>" ; } executeApplication ( java . lang . String [ ] ) { int ret = super . executeApplication ( args ) ; if ( ret != 0 ) { return ret ; } de . vandermeer . svg2vector . applications . base . SvgTargets target = this . getProps ( ) . getTarget ( ) ; java . lang . String fn = this . optionInkscapeExec . getValue ( ) ; if ( ( ret = this . checkIsExecutable ( fn ) ) < 0 ) { return ret ; } this . printDetailMessage ( ( "Inkscape<sp>exec:<sp>" + fn ) ) ; this . setWarnings ( target ) ; de . vandermeer . svg2vector . applications . is . IsCmd isCmd = new de . vandermeer . svg2vector . applications . is . IsCmd ( fn , target , this . getProps ( ) ) ; isCmd . appendTargetSettings ( target , this . optionExpDpi , this . optionExpPdfver , this . optionExpPslevel ) ; de . vandermeer . svg2vector . applications . is . IsCmd isTmpCmd = new de . vandermeer . svg2vector . applications . is . IsCmd ( fn , de . vandermeer . svg2vector . applications . base . SvgTargets . svg , this . getProps ( ) ) ; if ( this . optionSvgFirst . inCli ( ) ) { this . printProgressMessage ( "converting<sp>to<sp>temporary<sp>SVG<sp>first" ) ; this . printDetailMessage ( ( "Inkscape<sp>cmd<sp>tmp:<sp>" + isTmpCmd ) ) ; } else { this . printProgressMessage ( "converting<sp>directly<sp>to<sp>target" ) ; this . printDetailMessage ( ( "Inkscape<sp>cmd:<sp>" + isCmd ) ) ; } ret = this . createTempArtifacts ( isTmpCmd ) ; if ( ret < 0 ) { return ret ; } ret = this . convertInput ( isCmd , target ) ; if ( ret < 0 ) { return ret ; } this . removeTempArtifacts ( ) ; this . printProgressMessage ( "finished<sp>successfully" ) ; return 0 ; }
org . junit . Assert . assertEquals ( 1 , app . executeApplication ( args ) )
testBug3093644 ( ) { java . lang . String smiles1 = "[H]C5(CCC(N)=O)(C=1N=C(C=C4N=C(C(C)=C3[N-]C(C)(C2N=C(C=1(C))C(C)" + ( ( "(CCC(=O)NCC(C)O)C2([H])(CC(N)=O))C(C)(CC(N)=O)C3([H])(CCC(N)=O))" + "C(C)(CC(N)=O)C4([H])(CCC(N)=O))C5(C)(C)).[H][C-]([H])C3([H])(OC([H])" ) + "(N2C=NC=1C(N)=NC=NC=12)C([H])(O)C3([H])(O)).[Co+3]" ) ; org . openscience . cdk . interfaces . IAtomContainer mol1 = org . openscience . cdk . atomtype . CDKAtomTypeMatcherSMILESTest . smilesParser . parseSmiles ( smiles1 ) ; org . openscience . cdk . interfaces . IAtomType [ ] types1 = org . openscience . cdk . atomtype . CDKAtomTypeMatcherSMILESTest . atomTypeMatcher . findMatchingAtomTypes ( mol1 ) ; for ( org . openscience . cdk . interfaces . IAtomType type : types1 ) { "<AssertPlaceHolder>" ; } } getAtomTypeName ( ) { return this . identifier ; }
org . junit . Assert . assertNotNull ( type . getAtomTypeName ( ) )
testByteOr ( ) { byte theValue = 1 ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 3 , ( theValue | 2 ) , 0 )
testGetPDFURLWithNoBundle ( ) { org . dspace . app . util . GoogleMetadata gm = new org . dspace . app . util . GoogleMetadata ( this . context , it ) ; "<AssertPlaceHolder>" ; } getPDFURL ( ) { return metadataMappings . get ( PDF ) ; }
org . junit . Assert . assertEquals ( 0 , gm . getPDFURL ( ) . size ( ) )
testSuccess ( ) { final java . lang . Object success = new java . lang . Object ( ) ; jobFuture . await ( 1000 , TimeUnit . MILLISECONDS ) ; new java . lang . Thread ( new java . lang . Runnable ( ) { @ com . ctrip . xpipe . command . Override public void run ( ) { jobFuture . setSuccess ( success ) ; } } ) . start ( ) ; "<AssertPlaceHolder>" ; } get ( ) { await ( ) ; java . lang . Throwable cause = cause ( ) ; if ( cause == null ) { return getNow ( ) ; } if ( cause instanceof com . ctrip . xpipe . command . CancellationException ) { throw ( ( com . ctrip . xpipe . command . CancellationException ) ( cause ) ) ; } throw new com . ctrip . xpipe . command . ExecutionException ( cause ) ; }
org . junit . Assert . assertEquals ( success , jobFuture . get ( ) )
testDictRef ( ) { java . lang . String cmlString = "<sp>elementType=\"3alanine\"<sp>elementType=\"2pdb:aminoAcid\"<sp>elementType=\"4pdb:residueName\"<sp>elementType=\"1pdb:oneLetterCode\"<sp>elementType=\"0pdb:id\">3</scalar><atomArray><atom<sp>id=\"a1\"<sp>elementType=\"C\"<sp>x2=\"265.0\"<sp>y2=\"989.0\"/><atom<sp>id=\"a2\"<sp>elementType=\"N\"<sp>x2=\"234.0\"<sp>y2=\"972.0\"<sp>elementType=\"2pdb:nTerminus\"/><atom<sp>id=\"a3\"<sp>elementType=\"C\"<sp>x2=\"265.0\"<sp>y2=\"1025.0\"/><atom<sp>id=\"a4\"<sp>elementType=\"C\"<sp>x2=\"296.0\"<sp>y2=\"971.0\"<sp>elementType=\"2pdb:cTerminus\"/><atom<sp>id=\"a5\"<sp>elementType=\"O\"<sp>x2=\"296.0\"<sp>y2=\"935.0\"/><atom<sp>id=\"a6\"<sp>elementType=\"O\"<sp>x2=\"327.0\"<sp>y2=\"988.0\"/></atomArray><bondArray><bond<sp>id=\"b1\"<sp>atomRefs2=\"a2<sp>a1\"<sp>order=\"S\"/><bond<sp>id=\"b2\"<sp>atomRefs2=\"a1<sp>a3\"<sp>order=\"S\"/><bond<sp>id=\"b3\"<sp>atomRefs2=\"a1<sp>a4\"<sp>order=\"S\"/><bond<sp>id=\"b4\"<sp>atomRefs2=\"a4<sp>a5\"<sp>order=\"D\"/><bond<sp>id=\"b5\"<sp>atomRefs2=\"a4<sp>a6\"<sp>order=\"S\"/></bondArray></molecule>" ; org . openscience . cdk . interfaces . IChemFile chemFile = parseCMLString ( cmlString ) ; org . openscience . cdk . interfaces . IAtomContainer mol = checkForSingleMoleculeFile ( chemFile ) ; java . util . Iterator < java . lang . Object > props = mol . getProperties ( ) . keySet ( ) . iterator ( ) ; boolean foundDictRefs = false ; while ( props . hasNext ( ) ) { java . lang . Object next = props . next ( ) ; if ( next instanceof org . openscience . cdk . dict . DictRef ) foundDictRefs = true ; } "<AssertPlaceHolder>" ; } next ( ) { if ( ( pos ) < ( str . length ( ) ) ) return str . charAt ( ( ( pos ) ++ ) ) ; ( pos ) ++ ; return '
org . junit . Assert . assertTrue ( foundDictRefs )
testForceSyncDefaultEnabled ( ) { java . io . File file = new java . io . File ( "foo.10027c6de" ) ; org . apache . zookeeper . server . persistence . FileTxnLog log = new org . apache . zookeeper . server . persistence . FileTxnLog ( file ) ; "<AssertPlaceHolder>" ; } isForceSync ( ) { return forceSync ; }
org . junit . Assert . assertTrue ( log . isForceSync ( ) )
testGetS3StorageUnitsToRestore ( ) { org . finra . herd . model . jpa . StorageUnitEntity storageUnitEntity = new org . finra . herd . model . jpa . StorageUnitEntity ( ) ; java . util . List < org . finra . herd . model . jpa . StorageUnitEntity > storageUnitEntities = java . util . Arrays . asList ( storageUnitEntity ) ; org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitKey storageUnitKey = new org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitKey ( BDEF_NAMESPACE , BDEF_NAME , FORMAT_USAGE_CODE , FORMAT_FILE_TYPE_CODE , FORMAT_VERSION , PARTITION_VALUE , SUBPARTITION_VALUES , DATA_VERSION , STORAGE_NAME ) ; when ( storageUnitDao . getS3StorageUnitsToRestore ( org . finra . herd . service . impl . MAX_RESULT ) ) . thenReturn ( storageUnitEntities ) ; when ( storageUnitHelper . createStorageUnitKeyFromEntity ( storageUnitEntity ) ) . thenReturn ( storageUnitKey ) ; java . util . List < org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitKey > result = businessObjectDataFinalizeRestoreServiceImpl . getS3StorageUnitsToRestore ( org . finra . herd . service . impl . MAX_RESULT ) ; verify ( storageUnitDao ) . getS3StorageUnitsToRestore ( org . finra . herd . service . impl . MAX_RESULT ) ; verify ( storageUnitHelper ) . createStorageUnitKeyFromEntity ( storageUnitEntity ) ; verifyNoMoreInteractionsHelper ( ) ; "<AssertPlaceHolder>" ; } verifyNoMoreInteractionsHelper ( ) { verifyNoMoreInteractions ( awsHelper , javaPropertiesHelper , retryPolicyFactory , s3Operations ) ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( storageUnitKey ) , result )
validStringDefaultShouldNotCreateViolations ( ) { java . util . Set < javax . validation . ConstraintViolation < org . alien4cloud . tosca . model . definitions . PropertyDefinition > > violations = validator . validate ( createDefinitions ( ToscaTypes . STRING . toString ( ) , "string<sp>value" ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "name:<sp>[" + ( name ) ) + "],<sp>value:<sp>[" ) + ( value ) ) + "]" ; }
org . junit . Assert . assertEquals ( 0 , violations . size ( ) )
isNewValue_newValLongValue ( ) { boolean result = parameterParserSpy . isNewValue ( strMaxValue , maxValue ) ; "<AssertPlaceHolder>" ; } isNewValue ( java . lang . Object , java . lang . String ) { return ( ( oldVal == null ) && ( ! ( isBlank ( newVal ) ) ) ) || ( ( oldVal != null ) && ( ! ( oldVal . equals ( newVal ) ) ) ) ; }
org . junit . Assert . assertTrue ( result )
testSetDeny ( ) { try { me . haosdent . cgroup . subsystem . Devices . Record record = new me . haosdent . cgroup . subsystem . Devices . Record ( Devices . TYPE_ALL , 8 , 0 , 2 ) ; me . haosdent . cgroup . subsystem . DevicesTest . one . getDevices ( ) . setDeny ( record . type , record . major , record . minor , record . accesses ) ; } catch ( java . io . IOException e ) { me . haosdent . cgroup . subsystem . DevicesTest . LOG . error ( "Set<sp>deny<sp>failed." , e ) ; "<AssertPlaceHolder>" ; } } setDeny ( char , int , int , int ) { setPermission ( me . haosdent . cgroup . subsystem . Devices . PROP_DEVICES_DENY , type , major , minor , accesses ) ; }
org . junit . Assert . assertTrue ( false )
testGetTransactionOfAccount ( ) { jstellarapi . core . StellarTransactionHistory txHistory = jstellarapi . connection . StellarDaemonWebsocketConnectionTest . conn . getTransactionsForAccount ( StellarAddress . STELLAR_ADDRESS_PMARCHES . toString ( ) , StellarDaemonConnection . GENESIS_LEDGER_NUMBER ) ; "<AssertPlaceHolder>" ; } size ( ) { return txHistory . size ( ) ; }
org . junit . Assert . assertEquals ( 16 , txHistory . size ( ) )
getSecond_A$ ( ) { com . m3 . scalaflavor4j . Tuple2 < java . lang . Integer , java . lang . Long > tuple = com . m3 . scalaflavor4j . Tuple2 . apply ( 1 , 2L ) ; java . lang . Long actual = tuple . getSecond ( ) ; java . lang . Long expected = 2L ; "<AssertPlaceHolder>" ; } getSecond ( ) { return _2 ( ) ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
shouldResourceBeIncluded_shouldReturnTrueIfFileMatchesAndOpenmrsVersionMatches ( ) { org . openmrs . module . ModuleConditionalResource resource = new org . openmrs . module . ModuleConditionalResource ( ) ; resource . setPath ( "lib/mockmodule-api-1.10.jar" ) ; resource . setOpenmrsPlatformVersion ( "1.7-1.8,1.10-1.11" ) ; mockModule . getConditionalResources ( ) . add ( resource ) ; boolean result = org . openmrs . module . ModuleClassLoader . shouldResourceBeIncluded ( mockModule , java . net . URI . create ( "file://module/mockmodule/lib/mockmodule-api-1.10.jar" ) . toURL ( ) , "1.10.0-SNAPSHOT" , mockModules ) ; "<AssertPlaceHolder>" ; } shouldResourceBeIncluded ( java . lang . Module , java . net . URL , java . lang . String , java . util . Map ) { boolean include = true ; for ( org . openmrs . module . ModuleConditionalResource conditionalResource : module . getConditionalResources ( ) ) { if ( fileUrl . getPath ( ) . matches ( ( ( ".*" + ( conditionalResource . getPath ( ) ) ) + "$" ) ) ) { include = false ; if ( org . apache . commons . lang3 . StringUtils . isNotBlank ( conditionalResource . getOpenmrsPlatformVersion ( ) ) ) { include = org . openmrs . module . ModuleUtil . matchRequiredVersions ( openmrsVersion , conditionalResource . getOpenmrsPlatformVersion ( ) ) ; if ( ! include ) { return false ; } } if ( ( conditionalResource . getModules ( ) ) != null ) { for ( org . openmrs . module . ModuleConditionalResource . ModuleAndVersion conditionalModuleResource : conditionalResource . getModules ( ) ) { if ( "!" . equals ( conditionalModuleResource . getVersion ( ) ) ) { include = ! ( org . openmrs . module . ModuleFactory . isModuleStarted ( conditionalModuleResource . getModuleId ( ) ) ) ; if ( ! include ) { return false ; } } else { java . lang . String moduleVersion = startedRelatedModules . get ( conditionalModuleResource . getModuleId ( ) ) ; if ( moduleVersion != null ) { include = org . openmrs . module . ModuleUtil . matchRequiredVersions ( moduleVersion , conditionalModuleResource . getVersion ( ) ) ; if ( ! include ) { return false ; } } } } } } } return include ; }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( true ) )
testValidityChecks ( ) { java . lang . String interfaceName = "eth0" ; boolean enabled = true ; int defaultLeaseTime = 1200 ; int maximumLeaseTime = 1200 ; boolean passDns = true ; org . eclipse . kura . net . dhcp . DhcpServerCfg dhcpServerCfg = new org . eclipse . kura . net . dhcp . DhcpServerCfg ( interfaceName , enabled , defaultLeaseTime , maximumLeaseTime , passDns ) ; org . eclipse . kura . net . IP4Address subnet = ( ( org . eclipse . kura . net . IP4Address ) ( org . eclipse . kura . net . IP4Address . parseHostAddress ( "172.16.4.0" ) ) ) ; org . eclipse . kura . net . IP4Address subnetMask = ( ( org . eclipse . kura . net . IP4Address ) ( org . eclipse . kura . net . IP4Address . parseHostAddress ( "255.255.255.0" ) ) ) ; short prefix = 24 ; org . eclipse . kura . net . IP4Address routerAddress = ( ( org . eclipse . kura . net . IP4Address ) ( org . eclipse . kura . net . IP4Address . parseHostAddress ( "172.16.4.1" ) ) ) ; org . eclipse . kura . net . IP4Address rangeStart = ( ( org . eclipse . kura . net . IP4Address ) ( org . eclipse . kura . net . IP4Address . parseHostAddress ( "172.16.4.100" ) ) ) ; org . eclipse . kura . net . IP4Address rangeEnd = ( ( org . eclipse . kura . net . IP4Address ) ( org . eclipse . kura . net . IP4Address . parseHostAddress ( "172.16.4.110" ) ) ) ; java . util . List < org . eclipse . kura . net . IP4Address > dnsServers = new java . util . ArrayList ( ) ; org . eclipse . kura . net . dhcp . DhcpServerCfgIP4 dhcpServerCfgIP4 = new org . eclipse . kura . net . dhcp . DhcpServerCfgIP4 ( subnet , subnetMask , prefix , routerAddress , rangeStart , rangeEnd , dnsServers ) ; org . eclipse . kura . net . dhcp . DhcpServerConfigIP4 configIP4 = new org . eclipse . kura . net . dhcp . DhcpServerConfigIP4 ( dhcpServerCfg , dhcpServerCfgIP4 ) ; "<AssertPlaceHolder>" ; } isValid ( ) { java . util . Iterator < java . lang . String > it = this . netInterfaceConfigs . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { org . eclipse . kura . net . NetInterfaceConfig < ? extends org . eclipse . kura . net . NetInterfaceAddressConfig > netInterfaceConfig = this . netInterfaceConfigs . get ( it . next ( ) ) ; if ( ( netInterfaceConfig . getMTU ( ) ) < 0 ) { org . eclipse . kura . core . net . NetworkConfiguration . logger . error ( "MTU<sp>must<sp>be<sp>greater<sp>than<sp>0" ) ; return false ; } org . eclipse . kura . net . NetInterfaceType type = netInterfaceConfig . getType ( ) ; if ( ( ( ( type != ( org . eclipse . kura . net . NetInterfaceType . ETHERNET ) ) && ( type != ( org . eclipse . kura . net . NetInterfaceType . WIFI ) ) ) && ( type != ( org . eclipse . kura . net . NetInterfaceType . MODEM ) ) ) && ( type != ( org . eclipse . kura . net . NetInterfaceType . LOOPBACK ) ) ) { org . eclipse . kura . core . net . NetworkConfiguration . logger . error ( "Type<sp>must<sp>be<sp>ETHERNET,<sp>WIFI,<sp>MODEM,<sp>or<sp>LOOPBACK<sp>-<sp>type<sp>is<sp>{}" , type ) ; return false ; } java . util . List < ? extends org . eclipse . kura . net . NetInterfaceAddressConfig > netInterfaceAddressConfigs = netInterfaceConfig . getNetInterfaceAddresses ( ) ; for ( org . eclipse . kura . net . NetInterfaceAddressConfig netInterfaceAddressConfig : netInterfaceAddressConfigs ) { java . util . List < org . eclipse . kura . net . NetConfig > netConfigs = netInterfaceAddressConfig . getConfigs ( ) ; if ( netConfigs != null ) { for ( org . eclipse . kura . net . NetConfig netConfig : netConfigs ) { if ( ! ( netConfig . isValid ( ) ) ) { org . eclipse . kura . core . net . NetworkConfiguration . logger . error ( "Invalid<sp>config<sp>{}" , netConfig . toString ( ) ) ; return false ; } } } } } return true ; }
org . junit . Assert . assertTrue ( configIP4 . isValid ( ) )
testGetMedicationIdForBarcodeNotExist ( ) { final java . lang . Long medicationId = medicationsDao . getMedicationIdForBarcode ( "222" ) ; "<AssertPlaceHolder>" ; } getMedicationIdForBarcode ( java . lang . String ) { final java . lang . Long medicationId = service . getMedicationIdForBarcode ( barcode ) ; return buildJsonResponse ( com . marand . maf . core . JsonUtil . toJson ( medicationId ) ) ; }
org . junit . Assert . assertNull ( medicationId )
testIsPlainTextForNull ( ) { "<AssertPlaceHolder>" ; } isPlainTextPassword ( java . lang . String ) { return ( org . apache . jackrabbit . oak . spi . security . user . util . PasswordUtil . extractAlgorithm ( password ) ) == null ; }
org . junit . Assert . assertTrue ( org . apache . jackrabbit . oak . spi . security . user . util . PasswordUtil . isPlainTextPassword ( null ) )
testToTerm_1 ( ) { final org . erlide . core . builder . CompilerOption . BooleanOption option = org . erlide . core . builder . CompilerOptions . WARN_EXPORT_ALL ; final com . ericsson . otp . erlang . OtpErlangObject actual = option . toTerm ( true ) ; final java . lang . String expected = "warn_export_all" ; "<AssertPlaceHolder>" ; } toString ( ) { return label ; }
org . junit . Assert . assertEquals ( expected , actual . toString ( ) )
testRecycleChildQuark ( ) { org . eclipse . tracecompass . tmf . core . statesystem . TmfAttributePool pool = new org . eclipse . tracecompass . tmf . core . statesystem . TmfAttributePool ( fStateSystem , org . eclipse . tracecompass . statesystem . core . ITmfStateSystem . ROOT_ATTRIBUTE ) ; "<AssertPlaceHolder>" ; try { java . lang . Integer child1 = fStateSystem . getQuarkRelativeAndAdd ( available , "child1" ) ; pool . recycle ( child1 , ( ( org . eclipse . tracecompass . tmf . core . tests . statesystem . AttributePoolTest . START_TIME ) + 10 ) ) ; } catch ( org . eclipse . tracecompass . statesystem . core . exceptions . StateValueTypeException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } }
org . junit . Assert . assertNotNull ( pool )
runTest ( ) { boolean result = checkNoError ( "Social_Activities_Update_Activity_Node" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
testDontTouchLoggingCanBeSet ( ) { configuration . setDontTouchLogging ( true ) ; "<AssertPlaceHolder>" ; } dontTouchLogging ( ) { return dontTouchLogging ; }
org . junit . Assert . assertTrue ( configuration . dontTouchLogging ( ) )
getNumberPassThru ( ) { org . eclipse . collections . api . block . function . Function < java . lang . Number , java . lang . Number > function = org . eclipse . collections . impl . block . factory . Functions . getNumberPassThru ( ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . Integer ) { return org . eclipse . collections . impl . list . Interval . fromTo ( ( - 1 ) , ( - object ) ) ; }
org . junit . Assert . assertEquals ( 1 , function . valueOf ( 1 ) )
testEdgeJoinOnBoundaryColumns ( ) { org . gradoop . common . model . impl . id . GradoopId v0 = org . gradoop . common . model . impl . id . GradoopId . get ( ) ; org . gradoop . common . model . impl . id . GradoopId v1 = org . gradoop . common . model . impl . id . GradoopId . get ( ) ; org . gradoop . common . model . impl . id . GradoopId e0 = org . gradoop . common . model . impl . id . GradoopId . get ( ) ; org . gradoop . common . model . impl . id . GradoopId e1 = org . gradoop . common . model . impl . id . GradoopId . get ( ) ; org . gradoop . flink . model . impl . operators . matching . single . cypher . pojos . Embedding left = createEmbedding ( v0 , e0 , v1 ) ; org . gradoop . flink . model . impl . operators . matching . single . cypher . pojos . Embedding right = createEmbedding ( v0 , e1 , v1 ) ; org . gradoop . flink . model . impl . operators . matching . single . cypher . operators . join . functions . MergeEmbeddings udf = new org . gradoop . flink . model . impl . operators . matching . single . cypher . operators . join . functions . MergeEmbeddings ( 3 , com . google . common . collect . Lists . newArrayList ( 0 , 2 ) , com . google . common . collect . Lists . newArrayList ( ) , com . google . common . collect . Lists . newArrayList ( ) , com . google . common . collect . Lists . newArrayList ( ) , com . google . common . collect . Lists . newArrayList ( ) ) ; java . util . List < org . gradoop . flink . model . impl . operators . matching . single . cypher . pojos . Embedding > result = new java . util . ArrayList ( ) ; udf . join ( left , right , new org . apache . flink . api . common . functions . util . ListCollector ( result ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { java . util . Objects . requireNonNull ( key ) ; return properties . get ( key ) ; }
org . junit . Assert . assertEquals ( createEmbedding ( v0 , e0 , v1 , e1 ) , result . get ( 0 ) )
testExplicitProduct ( ) { projectSeeds . add ( org . eclipse . tycho . plugins . p2 . director . ProductConfigTest . productSeed ( "product.id.1" ) ) ; projectSeeds . add ( org . eclipse . tycho . plugins . p2 . director . ProductConfigTest . productSeed ( "product.id.2" ) ) ; java . util . List < org . eclipse . tycho . plugins . p2 . director . Product > userConfig = java . util . Collections . singletonList ( new org . eclipse . tycho . plugins . p2 . director . Product ( "product.id.1" ) ) ; subject = new org . eclipse . tycho . plugins . p2 . director . ProductConfig ( userConfig , projectSeeds ) ; java . util . List < org . eclipse . tycho . plugins . p2 . director . Product > expected = java . util . Arrays . asList ( new org . eclipse . tycho . plugins . p2 . director . Product ( "product.id.1" ) ) ; "<AssertPlaceHolder>" ; } getProducts ( ) { return products ; }
org . junit . Assert . assertEquals ( expected , subject . getProducts ( ) )
testUeberCertIsRegeneratedOnNextInvocation ( ) { org . candlepin . dto . api . v1 . UeberCertificateDTO firstCert = or . createUeberCertificate ( principal , owner . getKey ( ) ) ; org . candlepin . dto . api . v1 . UeberCertificateDTO secondCert = or . createUeberCertificate ( principal , owner . getKey ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertTrue ( ( ( firstCert . getId ( ) ) != ( secondCert . getId ( ) ) ) )
updateOfAResourceByANonAuthenticatedUser ( ) { try { put ( aResource ( ) , org . silverpeas . web . ResourceUpdateTest . at ( aResourceURI ( ) ) , org . silverpeas . web . ResourceUpdateTest . withAsApiToken ( null ) ) ; org . junit . Assert . fail ( "A<sp>non<sp>authenticated<sp>user<sp>shouldn't<sp>update<sp>the<sp>resource" ) ; } catch ( javax . ws . rs . WebApplicationException ex ) { int receivedStatus = ex . getResponse ( ) . getStatus ( ) ; int unauthorized = Status . UNAUTHORIZED . getStatusCode ( ) ; "<AssertPlaceHolder>" ; } } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
org . junit . Assert . assertThat ( receivedStatus , org . hamcrest . Matchers . is ( unauthorized ) )
testItemIndex_ofSubItem ( ) { org . eclipse . nebula . widgets . grid . GridTestUtil . createGridItems ( grid , 3 , 3 ) ; org . eclipse . nebula . widgets . grid . GridItem item = new org . eclipse . nebula . widgets . grid . GridItem ( grid . getItem ( 0 ) , org . eclipse . swt . SWT . NONE , 1 ) ; "<AssertPlaceHolder>" ; } getItem ( int ) { checkWidget ( ) ; if ( ( index < 0 ) || ( index >= ( items . size ( ) ) ) ) { org . eclipse . swt . SWT . error ( SWT . ERROR_INVALID_RANGE ) ; } return items . get ( index ) ; }
org . junit . Assert . assertEquals ( 1 , item . index )
testSetTechnicalProductDistinguishedName ( ) { container . login ( "1" , org . oscm . operatorservice . bean . ROLE_PLATFORM_OPERATOR ) ; callerRolles . add ( OrganizationRoleType . PLATFORM_OPERATOR ) ; dataManager_getReferenceByBusinessKey_return . push ( organization ) ; operatorService . setDistinguishedName ( "1" , "2" ) ; "<AssertPlaceHolder>" ; } getDistinguishedName ( ) { return distinguishedName ; }
org . junit . Assert . assertEquals ( "2" , organization . getDistinguishedName ( ) )
testLatestBlogs ( ) { for ( int i = 0 ; i < 100 ; i ++ ) { com . openshift . blog . domain . Blog blog = new com . openshift . blog . domain . Blog ( "Getting<sp>Started<sp>with<sp>OpenShift" , "Getting<sp>Started<sp>with<sp>OpenShift" ) ; java . lang . String blogId = blogRepository . save ( blog ) ; } java . util . List < com . openshift . blog . domain . Blog > latestBlogs = blogRepository . latestBlogs ( ) ; "<AssertPlaceHolder>" ; } latestBlogs ( ) { java . util . List < java . lang . Object > objs = redisTemplate . opsForList ( ) . range ( "latestBlogs" , 0 , ( - 1 ) ) ; java . util . List < com . openshift . blog . domain . Blog > blogs = new java . util . ArrayList ( ) ; for ( java . lang . Object blog : objs ) { blogs . add ( ( ( com . openshift . blog . domain . Blog ) ( blog ) ) ) ; } return blogs ; }
org . junit . Assert . assertEquals ( 10 , latestBlogs . size ( ) )
cloneAsVersionTest ( ) { final org . opendaylight . controller . cluster . access . commands . ReadTransactionSuccess clone = org . opendaylight . controller . cluster . access . commands . ReadTransactionSuccessNoDataTest . OBJECT . cloneAsVersion ( ABIVersion . BORON ) ; "<AssertPlaceHolder>" ; } cloneAsVersion ( org . opendaylight . controller . cluster . access . ABIVersion ) { return ( ( T ) ( this ) ) ; }
org . junit . Assert . assertEquals ( org . opendaylight . controller . cluster . access . commands . ReadTransactionSuccessNoDataTest . OBJECT , clone )
insertTest ( ) { int i = user1Mapper . insert ( me . zhyd . springboot . multi . User1DatasourceTests . getUser ( 2 ) ) ; int ii = 1 / 0 ; "<AssertPlaceHolder>" ; } getUser ( int ) { java . lang . String username = "username" ; int len = new java . util . Random ( ) . nextInt ( max ) ; for ( int i = 0 ; i < len ; i ++ ) { username += username ; } return new me . zhyd . springboot . multi . entity . Users ( username , "password" , "" ) ; }
org . junit . Assert . assertEquals ( i , 1 )
test_param_string_copy_1 ( ) { java . lang . String cmdText = "SELECT<sp>*<sp>WHERE<sp>{<sp>?s<sp>?p<sp>?o<sp>}" ; org . apache . jena . query . ParameterizedSparqlString query = new org . apache . jena . query . ParameterizedSparqlString ( cmdText ) ; org . apache . jena . query . ParameterizedSparqlString copy = query . copy ( ) ; "<AssertPlaceHolder>" ; } getCommandText ( ) { return this . cmd . toString ( ) ; }
org . junit . Assert . assertEquals ( cmdText , copy . getCommandText ( ) )
testFactoryExceptionIsPropagated ( ) { java . lang . NullPointerException exception = mock ( com . bazaarvoice . ostrich . pool . NullPointerException . class ) ; when ( _factory . create ( any ( com . bazaarvoice . ostrich . ServiceEndPoint . class ) ) ) . thenThrow ( exception ) ; try { newCache ( ) . checkOut ( _endPoint ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception caught ) { "<AssertPlaceHolder>" ; } } checkOut ( com . bazaarvoice . ostrich . ServiceEndPoint ) { checkNotNull ( endPoint ) ; com . bazaarvoice . ostrich . pool . MultiThreadedClientServiceCache . checkState ( ( ! ( _isClosed ) ) , "cache<sp>is<sp>closed" ) ; com . bazaarvoice . ostrich . pool . ServiceHandle < S > serviceHandle = _instancesPerEndpoint . get ( endPoint ) ; if ( serviceHandle == null ) { return doRegister ( endPoint ) ; } return serviceHandle ; }
org . junit . Assert . assertSame ( exception , caught )
getByQueryStringTest ( ) { for ( int i = 0 ; i < 3 ; i ++ ) { com . datastax . driver . mapping . EntityWithIndexes obj = new com . datastax . driver . mapping . EntityWithIndexes ( ) ; obj . setCount ( 100 ) ; obj . setEmail ( "email@test" ) ; obj . setName ( ( "test" + i ) ) ; obj . setTimeStamp ( new com . datastax . driver . mapping . Date ( ) ) ; obj . setUuid ( com . datastax . driver . mapping . UUID . randomUUID ( ) ) ; target . save ( obj ) ; } java . lang . String query = "SELECT<sp>*<sp>FROM<sp>test_entity_index<sp>WHERE<sp>email='email@test'" ; com . datastax . driver . mapping . List < com . datastax . driver . mapping . EntityWithIndexes > items = target . getByQuery ( com . datastax . driver . mapping . EntityWithIndexes . class , query ) ; "<AssertPlaceHolder>" ; } getByQuery ( java . lang . Class , java . lang . String ) { maybeSync ( clazz ) ; return getFromResultSet ( clazz , session . execute ( query ) ) ; }
org . junit . Assert . assertEquals ( 3 , items . size ( ) )
testCodes ( ) { for ( org . bukkit . Material material : org . bukkit . Material . values ( ) ) { if ( material . isLegacy ( ) ) { continue ; } java . lang . String shortenedName = com . Acrobot . Breeze . Utils . MaterialUtil . getShortenedName ( material . toString ( ) , MaterialUtil . MAXIMUM_SIGN_WIDTH ) ; "<AssertPlaceHolder>" ; } } getMaterial ( java . lang . String ) { java . lang . String formatted = name . replaceAll ( "([a-z])([A-Z1-9])" , "$1_$2" ) . replace ( '<sp>' , '_' ) . toUpperCase ( ) ; org . bukkit . Material material = com . Acrobot . Breeze . Utils . MaterialUtil . MATERIAL_CACHE . get ( formatted ) ; if ( material != null ) { return material ; } material = org . bukkit . Material . matchMaterial ( name ) ; if ( material != null ) { com . Acrobot . Breeze . Utils . MaterialUtil . MATERIAL_CACHE . put ( formatted , material ) ; return material ; } material = new com . Acrobot . Breeze . Utils . MaterialUtil . EnumParser < org . bukkit . Material > ( ) . parse ( name , org . bukkit . Material . values ( ) ) ; if ( material != null ) { com . Acrobot . Breeze . Utils . MaterialUtil . MATERIAL_CACHE . put ( formatted , material ) ; } return material ; }
org . junit . Assert . assertSame ( material , com . Acrobot . Breeze . Utils . MaterialUtil . getMaterial ( shortenedName ) )
applyDefaultRespectsExtensionForBuildInWhenPresent ( ) { com . github . timm . cucumber . generate . Plugin plugin = new com . github . timm . cucumber . generate . Plugin ( ) ; plugin . setName ( "json" ) ; plugin . setExtension ( "somethingelse" ) ; plugin . applyDefaults ( new java . io . File ( "path/to/output" ) ) ; "<AssertPlaceHolder>" ; } getExtension ( ) { return extension ; }
org . junit . Assert . assertThat ( plugin . getExtension ( ) , org . hamcrest . CoreMatchers . equalTo ( "somethingelse" ) )
unmodifiableArray_reflectsChanges ( ) { com . restfb . json . JsonArray unmodifiableArray = com . restfb . json . JsonArray . unmodifiableArray ( array ) ; array . add ( 23 ) ; "<AssertPlaceHolder>" ; } values ( ) { return java . util . Collections . unmodifiableList ( values ) ; }
org . junit . Assert . assertEquals ( array . values ( ) , unmodifiableArray . values ( ) )
getProviders_shouldReturnEmptyListIfPassedEmptyList ( ) { java . util . List < org . openmrs . Provider > providers = org . openmrs . module . htmlformentry . HtmlFormEntryUtil . getProviders ( new java . util . ArrayList < org . openmrs . module . providermanagement . ProviderRole > ( ) ) ; "<AssertPlaceHolder>" ; } getProviders ( java . util . List ) { if ( ( providerRoles == null ) || ( ( providerRoles . size ( ) ) == 0 ) ) { return new java . util . ArrayList < org . openmrs . Provider > ( ) ; } org . openmrs . module . providermanagement . api . ProviderManagementService providerManagementService = org . openmrs . api . context . Context . getService ( org . openmrs . module . providermanagement . api . ProviderManagementService . class ) ; return new java . util . ArrayList < org . openmrs . Provider > ( providerManagementService . getProvidersByRoles ( providerRoles ) ) ; }
org . junit . Assert . assertThat ( providers . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
determinesFacingLeftDown ( ) { com . fundynamic . d2tm . math . Vector2D coordinatesToFaceTo = unitAbsoluteMapCoordinates . add ( create ( ( - 1 ) , 1 ) ) ; "<AssertPlaceHolder>" ; } determine ( com . fundynamic . d2tm . math . Vector2D , com . fundynamic . d2tm . math . Vector2D ) { boolean left = ( to . getXAsInt ( ) ) < ( from . getXAsInt ( ) ) ; boolean right = ( to . getXAsInt ( ) ) > ( from . getXAsInt ( ) ) ; boolean up = ( to . getYAsInt ( ) ) < ( from . getYAsInt ( ) ) ; boolean down = ( to . getYAsInt ( ) ) > ( from . getYAsInt ( ) ) ; if ( up && left ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . LEFT_UP ; if ( up && right ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT_UP ; if ( down && left ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . LEFT_DOWN ; if ( down && right ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT_DOWN ; if ( up ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . UP ; if ( down ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . DOWN ; if ( left ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . LEFT ; if ( right ) return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT ; return com . fundynamic . d2tm . game . entities . units . UnitFacings . RIGHT ; }
org . junit . Assert . assertEquals ( com . fundynamic . d2tm . game . entities . units . LEFT_DOWN , determine ( unitAbsoluteMapCoordinates , coordinatesToFaceTo ) )
testGetRegion ( ) { final java . lang . String name = this . name . getMethodName ( ) ; org . apache . hadoop . hbase . TestMetaTableAccessor . LOG . info ( ( "Started<sp>" + name ) ) ; org . apache . hadoop . hbase . util . Pair < org . apache . hadoop . hbase . client . RegionInfo , org . apache . hadoop . hbase . ServerName > pair = org . apache . hadoop . hbase . MetaTableAccessor . getRegion ( org . apache . hadoop . hbase . TestMetaTableAccessor . connection , org . apache . hadoop . hbase . util . Bytes . toBytes ( "nonexistent-region" ) ) ; "<AssertPlaceHolder>" ; org . apache . hadoop . hbase . TestMetaTableAccessor . LOG . info ( ( "Finished<sp>" + name ) ) ; } toBytes ( java . nio . ByteBuffer ) { java . nio . ByteBuffer dup = buf . duplicate ( ) ; dup . position ( 0 ) ; return org . apache . hadoop . hbase . util . Bytes . readBytes ( dup ) ; }
org . junit . Assert . assertNull ( pair )
testDestroy ( ) { tested . destroy ( ) ; "<AssertPlaceHolder>" ; } getParent ( ) { return parent ; }
org . junit . Assert . assertNull ( tested . getParent ( ) )
shouldOutputNoneWhenNoKillingTestFound ( ) { final org . pitest . mutationtest . MutationResult mr = createSurvivingMutant ( ) ; this . testee . handleMutationResult ( org . pitest . mutationtest . report . MutationTestResultMother . createClassResults ( mr ) ) ; final java . lang . String expected = "<mutation<sp>detected=\'false\'<sp>status=\'SURVIVED\'<sp>numberOfTestsRun=\'1\'><sourceFile>file</sourceFile><mutatedClass>clazz</mutatedClass><mutatedMethod>method</mutatedMethod><methodDescription>()I</methodDescription><lineNumber>42</lineNumber><mutator>mutator</mutator><index>1</index><block>0</block><killingTest/><description>desc</description></mutation>\n" ; "<AssertPlaceHolder>" ; } toString ( ) { return "SystemUnderTest" ; }
org . junit . Assert . assertEquals ( expected , this . out . toString ( ) )
testWaitOnCompletionMapReduceExceptionSet ( ) { org . pentaho . bigdata . api . mapreduce . MapReduceExecutionException mapReduceExecutionException = new org . pentaho . bigdata . api . mapreduce . MapReduceExecutionException ( "" ) ; exceptionAtomicReference . set ( mapReduceExecutionException ) ; try { futureMapReduceJobSimple . waitOnCompletion ( timeout , unit , stoppable ) ; } catch ( org . pentaho . bigdata . api . mapreduce . MapReduceExecutionException e ) { "<AssertPlaceHolder>" ; throw e ; } } waitOnCompletion ( long , java . util . concurrent . TimeUnit , org . pentaho . bigdata . api . mapreduce . MapReduceService$Stoppable ) { try { future . get ( timeout , timeUnit ) ; org . pentaho . bigdata . api . mapreduce . MapReduceExecutionException mapReduceExecutionException = exceptionAtomicReference . get ( ) ; if ( mapReduceExecutionException != null ) { throw mapReduceExecutionException ; } return true ; } catch ( java . lang . InterruptedException e ) { killJob ( ) ; return true ; } catch ( java . util . concurrent . ExecutionException e ) { java . lang . Throwable cause = e . getCause ( ) ; if ( cause instanceof org . pentaho . bigdata . api . mapreduce . MapReduceExecutionException ) { throw ( ( org . pentaho . bigdata . api . mapreduce . MapReduceExecutionException ) ( cause ) ) ; } else { throw new org . pentaho . bigdata . api . mapreduce . MapReduceExecutionException ( cause ) ; } } catch ( java . util . concurrent . TimeoutException e ) { return false ; } }
org . junit . Assert . assertEquals ( mapReduceExecutionException , e )
createOrganizationDisplayName_OrganizationNameNotExisting ( ) { org . oscm . reportingservice . business . SupplierRevenueShareBuilder builder = new org . oscm . reportingservice . business . SupplierRevenueShareBuilder ( null , null , null , null , null ) ; java . lang . String displayName = builder . createOrganizationDisplayName ( "id" ) ; "<AssertPlaceHolder>" ; } createOrganizationDisplayName ( java . lang . String ) { java . lang . String orgName = organizationNameMap . get ( orgId ) ; return org . oscm . reportingservice . business . Formatting . nameAndId ( orgName , orgId ) ; }
org . junit . Assert . assertEquals ( "id" , displayName )
getStatusCodeShouldNotThrowExceptionWhenCodeIsNull ( ) { com . twilio . exception . ApiException error = new com . twilio . exception . ApiException ( anyMessage ) ; "<AssertPlaceHolder>" ; } getStatusCode ( ) { return status ; }
org . junit . Assert . assertEquals ( null , error . getStatusCode ( ) )
testBadDateInGreater ( ) { try { modelOf ( "'2014-0x-01T12:30:00.000Z'<sp>><sp>timestamp" ) ; org . junit . Assert . fail ( ) ; } catch ( com . questdb . griffin . SqlException e ) { "<AssertPlaceHolder>" ; } } getPosition ( ) { return 0 ; }
org . junit . Assert . assertEquals ( 0 , e . getPosition ( ) )
testFindByPrimaryKeyExisting ( ) { com . liferay . journal . model . JournalArticleLocalization newJournalArticleLocalization = addJournalArticleLocalization ( ) ; com . liferay . journal . model . JournalArticleLocalization existingJournalArticleLocalization = _persistence . findByPrimaryKey ( newJournalArticleLocalization . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingJournalArticleLocalization , newJournalArticleLocalization )
testIsInhoudelijkGelijkAanNull ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonSamengesteldeNaamHistorie voorkomen1 = maakTemplateVoorkomen ( ) ; "<AssertPlaceHolder>" ; } isInhoudelijkGelijkAan ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . LandOfGebied ) { if ( ( this ) == anderLandOfGebied ) { return true ; } if ( anderLandOfGebied == null ) { return false ; } return ( getCode ( ) ) == ( anderLandOfGebied . getCode ( ) ) ; }
org . junit . Assert . assertFalse ( voorkomen1 . isInhoudelijkGelijkAan ( null ) )
testPile4 ( ) { lombok . val arrayW = org . nd4j . linalg . factory . Nd4j . create ( 1 , 5 ) ; lombok . val arrayX = org . nd4j . linalg . factory . Nd4j . create ( 1 , 5 ) ; lombok . val arrayY = org . nd4j . linalg . factory . Nd4j . create ( 1 , 5 ) ; lombok . val arrayZ = org . nd4j . linalg . factory . Nd4j . pile ( arrayW , arrayX , arrayY ) ; "<AssertPlaceHolder>" ; } shape ( ) { return sameDiff . shape ( this ) ; }
org . junit . Assert . assertArrayEquals ( new long [ ] { 3 , 1 , 5 } , arrayZ . shape ( ) )
testPreproStrat ( ) { for ( dk . alexandra . fresco . suite . spdz . configuration . PreprocessingStrategy pps : dk . alexandra . fresco . suite . spdz . configuration . PreprocessingStrategy . values ( ) ) { dk . alexandra . fresco . suite . spdz . configuration . PreprocessingStrategy strat = dk . alexandra . fresco . suite . spdz . configuration . PreprocessingStrategy . valueOf ( pps . name ( ) ) ; "<AssertPlaceHolder>" ; } }
org . junit . Assert . assertEquals ( pps , strat )
runTest ( ) { boolean result = checkNoError ( "Social_Activities_Get_All_Todos" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
testGet_LazyListInput ( ) { java . lang . Object input = com . firefly . utils . collection . LazyList . add ( null , "a" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object , int ) { if ( list == null ) throw new java . lang . IndexOutOfBoundsException ( ) ; if ( list instanceof com . firefly . utils . collection . List ) return ( ( E ) ( ( ( com . firefly . utils . collection . List < ? > ) ( list ) ) . get ( i ) ) ) ; if ( i == 0 ) return ( ( E ) ( list ) ) ; throw new java . lang . IndexOutOfBoundsException ( ) ; }
org . junit . Assert . assertEquals ( "a" , com . firefly . utils . collection . LazyList . get ( input , 0 ) )
startsOutWithAnEmptyMap ( ) { "<AssertPlaceHolder>" ; } empty ( ) { return instantiate ( findConstructor ( com . pholser . junit . quickcheck . generator . java . util . MapGenerator . types ( ) . get ( 0 ) ) ) ; }
org . junit . Assert . assertTrue ( generator . empty ( ) . isEmpty ( ) )
testUserAgent ( ) { com . blade . mvc . Map < java . lang . String , java . lang . String > headers = com . blade . mvc . Collections . singletonMap ( "User-Agent" , firefoxUA ) ; com . blade . mvc . http . Request mockRequest = mockHttpRequest ( "GET" ) ; when ( mockRequest . headers ( ) ) . thenReturn ( headers ) ; com . blade . mvc . http . Request request = new com . blade . mvc . http . HttpRequest ( mockRequest ) ; "<AssertPlaceHolder>" ; } userAgent ( ) { return this . request . userAgent ( ) ; }
org . junit . Assert . assertEquals ( firefoxUA , request . userAgent ( ) )
testGetDateTimeStr ( ) { java . lang . String receive ; Calendar calendar = Calendar . getInstance ( ) ; java . util . Date currentDate = calendar . getTime ( ) ; java . sql . Date dateReturn = new java . sql . Date ( currentDate . getTime ( ) ) ; java . text . SimpleDateFormat formater = new java . text . SimpleDateFormat ( "yyyyMMddHHmmss" ) ; java . lang . String waiting = formater . format ( dateReturn ) ; receive = org . bonita . lib . projet . LibJava . getDateTimeStr ( ) ; "<AssertPlaceHolder>" ; } getDateTimeStr ( ) { try { java . util . Calendar calendar = java . util . Calendar . getInstance ( ) ; java . util . Date currentDate = calendar . getTime ( ) ; java . sql . Date dateReturn = new java . sql . Date ( currentDate . getTime ( ) ) ; java . text . SimpleDateFormat formater = new java . text . SimpleDateFormat ( "yyyyMMddHHmmss" ) ; return formater . format ( dateReturn ) ; } catch ( java . lang . Exception e ) { org . bonita . lib . projet . LibJava . traceExeption ( e ) ; return null ; } }
org . junit . Assert . assertEquals ( receive , waiting )
testUntagResources ( ) { java . util . List < com . myjeeva . digitalocean . pojo . Resource > resources = new java . util . ArrayList < com . myjeeva . digitalocean . pojo . Resource > ( ) ; resources . add ( new com . myjeeva . digitalocean . pojo . Resource ( "3794738" , com . myjeeva . digitalocean . common . ResourceType . DROPLET ) ) ; com . myjeeva . digitalocean . pojo . Response result = apiClient . untagResources ( "lab" , resources ) ; "<AssertPlaceHolder>" ; log . info ( ( "Response<sp>of<sp>Tag<sp>resources:<sp>" + result ) ) ; } untagResources ( java . lang . String , java . util . List ) { checkBlankAndThrowError ( name , "Missing<sp>required<sp>parameter<sp>-<sp>tag<sp>name" ) ; if ( ( null == resources ) || ( resources . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "Missing<sp>required<sp>parameter<sp>-<sp>list<sp>of<sp>resources<sp>for<sp>untag" ) ; } java . lang . Object [ ] params = new java . lang . Object [ ] { name } ; return ( ( com . myjeeva . digitalocean . pojo . Response ) ( perform ( new com . myjeeva . digitalocean . impl . ApiRequest ( com . myjeeva . digitalocean . common . ApiAction . UNTAG_RESOURCE , new com . myjeeva . digitalocean . pojo . Resources ( resources ) , params ) ) . getData ( ) ) ) ; }
org . junit . Assert . assertNotNull ( result )
testEndLessThanStart ( ) { final long time = 123987564019283L ; final org . locationtech . geowave . core . geotime . index . dimension . TemporalBinningStrategy binStrategy = new org . locationtech . geowave . core . geotime . index . dimension . TemporalBinningStrategy ( org . locationtech . geowave . core . geotime . index . dimension . TemporalBinningStrategy . Unit . YEAR ) ; final org . locationtech . geowave . core . index . dimension . bin . BinRange [ ] ranges = binStrategy . getNormalizedRanges ( new org . locationtech . geowave . core . index . sfc . data . NumericRange ( time , ( time - 1 ) ) ) ; "<AssertPlaceHolder>" ; } getNormalizedRanges ( double , double ) { return new org . locationtech . geowave . core . geotime . index . dimension . LongitudeDefinition ( ) . getNormalizedRanges ( new org . locationtech . geowave . core . index . sfc . data . NumericRange ( minRange , maxRange ) ) ; }
org . junit . Assert . assertEquals ( 0 , ranges . length )
testCheckNullRequestMethod ( ) { com . erudika . para . utils . filters . MockHttpServletRequest request = new com . erudika . para . utils . filters . MockHttpServletRequest ( ) ; request . setHeader ( CORSFilter . REQUEST_HEADER_ORIGIN , "http://tomcat.apache.org" ) ; request . setMethod ( null ) ; com . erudika . para . utils . filters . CORSFilter corsFilter = new com . erudika . para . utils . filters . CORSFilter ( ) ; corsFilter . init ( com . erudika . para . utils . filters . TestConfigs . getSpecificOriginFilterConfig ( ) ) ; com . erudika . para . utils . filters . CORSFilter . CORSRequestType requestType = corsFilter . checkRequestType ( request ) ; "<AssertPlaceHolder>" ; } checkRequestType ( javax . servlet . http . HttpServletRequest ) { com . erudika . para . utils . filters . CORSFilter . CORSRequestType requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; if ( request == null ) { throw new java . lang . IllegalArgumentException ( "HttpServletRequest<sp>object<sp>is<sp>null" ) ; } java . lang . String originHeader = request . getHeader ( com . erudika . para . utils . filters . CORSFilter . REQUEST_HEADER_ORIGIN ) ; if ( originHeader != null ) { if ( originHeader . isEmpty ( ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else if ( ! ( com . erudika . para . utils . filters . CORSFilter . isValidOrigin ( originHeader ) ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else { java . lang . String method = org . apache . commons . lang3 . StringUtils . trimToEmpty ( request . getMethod ( ) ) ; if ( com . erudika . para . utils . filters . CORSFilter . HTTP_METHODS . contains ( method ) ) { if ( "OPTIONS" . equals ( method ) ) { java . lang . String accessControlRequestMethodHeader = request . getHeader ( com . erudika . para . utils . filters . CORSFilter . REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD ) ; if ( org . apache . commons . lang3 . StringUtils . isNotBlank ( accessControlRequestMethodHeader ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . PRE_FLIGHT ; } else if ( org . apache . commons . lang3 . StringUtils . isWhitespace ( accessControlRequestMethodHeader ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . INVALID_CORS ; } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } else if ( ( "GET" . equals ( method ) ) || ( "HEAD" . equals ( method ) ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . SIMPLE ; } else if ( "POST" . equals ( method ) ) { java . lang . String contentType = request . getContentType ( ) ; if ( contentType != null ) { contentType = contentType . toLowerCase ( ) . trim ( ) ; if ( com . erudika . para . utils . filters . CORSFilter . SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES . contains ( contentType ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . SIMPLE ; } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } } else if ( com . erudika . para . utils . filters . CORSFilter . COMPLEX_HTTP_METHODS . contains ( method ) ) { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . ACTUAL ; } } } } else { requestType = com . erudika . para . utils . filters . CORSFilter . CORSRequestType . NOT_CORS ; } return requestType ; }
org . junit . Assert . assertEquals ( CORSFilter . CORSRequestType . INVALID_CORS , requestType )
testNullEntityStatusResponse ( ) { "<AssertPlaceHolder>" ; } createStatus ( org . apache . http . HttpResponse ) { if ( ( response == null ) || ( ( response . getEntity ( ) ) == null ) ) { throw new java . io . IOException ( "unreadable<sp>response!" ) ; } final java . lang . String body = org . apache . http . util . EntityUtils . toString ( response . getEntity ( ) ) ; net . pushover . client . PushoverResponseFactory . ResponseModel m ; try { m = net . pushover . client . PushoverResponseFactory . GSON . fromJson ( body , net . pushover . client . PushoverResponseFactory . ResponseModel . class ) ; } catch ( com . google . gson . JsonSyntaxException e ) { throw new java . io . IOException ( e . getCause ( ) ) ; } final net . pushover . client . Status toReturn = new net . pushover . client . Status ( m . status ) ; final org . apache . http . Header responseId = response . getFirstHeader ( net . pushover . client . PushoverResponseFactory . REQUEST_ID_HEADER ) ; if ( responseId != null ) { toReturn . setRequestId ( responseId . getValue ( ) ) ; } return toReturn ; }
org . junit . Assert . assertNull ( net . pushover . client . PushoverResponseFactory . createStatus ( response ) )
testNoMinimumTimeBeforeFirstSubmission ( ) { "<AssertPlaceHolder>" ; } tick ( long ) { final long nextUpload = getNextSubmission ( ) ; if ( nextUpload >= ( localTime + ( 3 * ( getMinimumTimeBetweenUploads ( ) ) ) ) ) { org . mozilla . gecko . background . common . log . Logger . warn ( org . mozilla . gecko . background . healthreport . upload . SubmissionPolicy . LOG_TAG , ( ( ( "Next<sp>upload<sp>scheduled<sp>far<sp>in<sp>the<sp>future;<sp>system<sp>clock<sp>reset?<sp>" + nextUpload ) + "<sp>><sp>" ) + localTime ) ) ; editor ( ) . setNextSubmission ( ( localTime + ( getMinimumTimeBetweenUploads ( ) ) ) ) . commit ( ) ; return false ; } if ( localTime < nextUpload ) { org . mozilla . gecko . background . common . log . Logger . debug ( org . mozilla . gecko . background . healthreport . upload . SubmissionPolicy . LOG_TAG , ( ( ( "We<sp>uploaded<sp>less<sp>than<sp>an<sp>interval<sp>ago;<sp>skipping.<sp>" + nextUpload ) + "<sp>><sp>" ) + localTime ) ) ; return false ; } if ( ! ( uploadEnabled ) ) { final java . lang . String obsoleteId = tracker . getNextObsoleteId ( ) ; if ( obsoleteId == null ) { return false ; } org . mozilla . gecko . background . healthreport . upload . SubmissionPolicy . Editor editor = editor ( ) ; editor . setLastDeleteRequested ( localTime ) ; client . delete ( localTime , obsoleteId , new org . mozilla . gecko . background . healthreport . upload . SubmissionPolicy . DeleteDelegate ( editor ) ) ; return true ; } long firstRun = getFirstRunLocalTime ( ) ; if ( firstRun < 0 ) { firstRun = localTime ; editor ( ) . setFirstRunLocalTime ( firstRun ) . setNextSubmission ( ( localTime + ( getMinimumTimeBeforeFirstSubmission ( ) ) ) ) . setCurrentDayFailureCount ( 0 ) . commit ( ) ; } if ( localTime < ( firstRun + ( getMinimumTimeBeforeFirstSubmission ( ) ) ) ) { org . mozilla . gecko . background . common . log . Logger . info ( org . mozilla . gecko . background . healthreport . upload . SubmissionPolicy . LOG_TAG , ( ( "Need<sp>to<sp>wait<sp>" + ( getMinimumTimeBeforeFirstSubmission ( ) ) ) + "<sp>before<sp>first<sp>upload." ) ) ; return false ; } if ( localTime >= ( getCurrentDayResetTime ( ) ) ) { editor ( ) . setCurrentDayResetTime ( ( localTime + ( getMinimumTimeBetweenUploads ( ) ) ) ) . setCurrentDayFailureCount ( 0 ) . commit ( ) ; } java . lang . String id = org . mozilla . gecko . background . healthreport . HealthReportUtils . generateDocumentId ( ) ; java . util . Collection < java . lang . String > oldIds = tracker . getBatchOfObsoleteIds ( ) ; tracker . addObsoleteId ( id ) ; org . mozilla . gecko . background . healthreport . upload . SubmissionPolicy . Editor editor = editor ( ) ; editor . setLastUploadRequested ( localTime ) ; client . upload ( localTime , id , oldIds , new org . mozilla . gecko . background . healthreport . upload . SubmissionPolicy . UploadDelegate ( editor , oldIds ) ) ; return true ; }
org . junit . Assert . assertTrue ( policy . tick ( 0 ) )
shouldNotChangeCellWhenEditingAndArrowUpKeyIsPressed ( ) { final com . vaadin . addon . spreadsheet . elements . SheetCellElement b2 = spreadSheet . getCellAt ( "B2" ) ; b2 . setValue ( "123" ) ; sheetController . selectCell ( "B2" ) ; new org . openqa . selenium . interactions . Actions ( getDriver ( ) ) . sendKeys ( Keys . F2 ) . build ( ) . perform ( ) ; new org . openqa . selenium . interactions . Actions ( getDriver ( ) ) . sendKeys ( Keys . ARROW_UP ) . build ( ) . perform ( ) ; java . lang . String selectedCell = sheetController . getSelectedCell ( ) ; "<AssertPlaceHolder>" ; } getSelectedCell ( ) { java . lang . String elemClass = driver . findElement ( org . openqa . selenium . By . cssSelector ( ".sheet-selection" ) ) . getAttribute ( "class" ) ; int rowStart = elemClass . indexOf ( "row" ) ; if ( rowStart == ( - 1 ) ) { return "A1" ; } int k = rowStart + ( "row" . length ( ) ) ; java . lang . String rowNumber = "" ; while ( k < ( elemClass . length ( ) ) ) { char digit = elemClass . charAt ( k ) ; if ( digit == '<sp>' ) { break ; } rowNumber += elemClass . charAt ( k ) ; k ++ ; } int colStart = elemClass . indexOf ( "col" ) ; k = colStart + ( "col" . length ( ) ) ; java . lang . String colNumberStr = "" ; while ( k < ( elemClass . length ( ) ) ) { char digit = elemClass . charAt ( k ) ; if ( digit == '<sp>' ) { break ; } colNumberStr += elemClass . charAt ( k ) ; k ++ ; } int colNumber = java . lang . Integer . parseInt ( colNumberStr ) ; int dividend = colNumber ; java . lang . String columnName = "" ; int modulo ; while ( dividend > 0 ) { modulo = ( dividend - 1 ) % 26 ; columnName = ( ( char ) ( 65 + modulo ) ) + columnName ; dividend = ( dividend - modulo ) / 26 ; } return columnName + rowNumber ; }
org . junit . Assert . assertThat ( selectedCell , org . hamcrest . CoreMatchers . is ( "B2" ) )
testConvertALlWithEmptyFields ( ) { java . util . List < org . lnu . is . resource . asset . address . AssetAddressResource > expecteds = java . util . Collections . emptyList ( ) ; java . util . List < org . lnu . is . domain . asset . address . AssetAddress > sources = java . util . Collections . emptyList ( ) ; java . util . List < org . lnu . is . resource . asset . address . AssetAddressResource > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
org . junit . Assert . assertEquals ( expecteds , actuals )
testGetNorm ( ) { final double x = getPreferredEntryValue ( ) ; final double [ ] data = new double [ ] { x , x , 1.0 , x , 2.0 , x , x , 3.0 , x } ; final org . hipparchus . linear . RealVector v = create ( data ) ; final double actual = v . getNorm ( ) ; double expected = 0.0 ; for ( int i = 0 ; i < ( data . length ) ; i ++ ) { expected += ( data [ i ] ) * ( data [ i ] ) ; } expected = org . hipparchus . util . FastMath . sqrt ( expected ) ; "<AssertPlaceHolder>" ; } sqrt ( double ) { return java . lang . Math . sqrt ( a ) ; }
org . junit . Assert . assertEquals ( "" , expected , actual , 0.0 )
converteerLg01NaarLo3PersoonslijstOk ( ) { final java . lang . String filename = "Omzetting.txt" ; final java . io . InputStream inputStream = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; final java . util . List < nl . bzk . migratiebrp . conversie . model . lo3 . syntax . Lo3CategorieWaarde > result = lg01Converter . converteerLg01NaarLo3CategorieWaarde ( org . apache . commons . io . IOUtils . toString ( inputStream , "UTF-8" ) , foutMelder ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( result . size ( ) ) > 1 ) )
concurrent_test ( ) { final java . util . concurrent . atomic . AtomicInteger exceptions = new java . util . concurrent . atomic . AtomicInteger ( ) ; final java . util . concurrent . ExecutorService executorService = java . util . concurrent . Executors . newFixedThreadPool ( net . ripe . db . whois . api . rest . client . StreamingRestClientTest . NUM_THREADS ) ; for ( int thread = 0 ; thread < ( net . ripe . db . whois . api . rest . client . StreamingRestClientTest . NUM_THREADS ) ; thread ++ ) { executorService . submit ( new java . lang . Runnable ( ) { @ net . ripe . db . whois . api . rest . client . Override public void run ( ) { final net . ripe . db . whois . api . rest . client . StreamingRestClient streamingRestClient = new net . ripe . db . whois . api . rest . client . StreamingRestClient ( new java . io . ByteArrayInputStream ( ( "<sp></attributes>\n" 1 + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<sp><objects>\n" + "<sp><object<sp>type=\"person\">\n" ) + "<sp><source<sp>id=\"RIPE\"<sp></attributes>\n" 2 ) + "<sp><attributes>\n" ) + "<sp><attribute<sp>name=\"person\"<sp>value=\"Pauleth<sp>Palthen\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"address\"<sp>value=\"Singel<sp>258\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"phone\"<sp>value=\"+31-1234567890\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"e-mail\"<sp>value=\"noreply@ripe.net\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"mnt-by\"<sp>value=\"OWNER-MNT\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"nic-hdl\"<sp>value=\"PP1-TEST\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"changed\"<sp>value=\"ppalse@ripe.net<sp>20101228\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"source\"<sp>value=\"TEST\"<sp></attributes>\n" 2 ) + "<sp><attribute<sp>name=\"password\"<sp>value=\"test\"<sp></attributes>\n" 2 ) + "<sp></attributes>\n" ) + "<sp></object>\n" ) + "<sp></attributes>\n" 0 ) + "</whois-resources>" ) ) . getBytes ( ) ) ) ; while ( streamingRestClient . hasNext ( ) ) { try { streamingRestClient . next ( ) ; } catch ( java . lang . Exception e ) { exceptions . incrementAndGet ( ) ; } } } } ) ; } executorService . shutdown ( ) ; executorService . awaitTermination ( 10 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } get ( ) { return ( original ) == null ? new net . ripe . db . whois . common . rpsl . RpslObject ( attributes ) : new net . ripe . db . whois . common . rpsl . RpslObject ( original , attributes ) ; }
org . junit . Assert . assertThat ( exceptions . get ( ) , org . hamcrest . Matchers . is ( 0 ) )
test0 ( ) { com . navercorp . pinpoint . profiler . interceptor . factory . AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory ( ) ; final com . navercorp . pinpoint . profiler . instrument . ScopeInfo scopeInfo = newEmptyScopeInfo ( ) ; com . navercorp . pinpoint . bootstrap . interceptor . Interceptor interceptor = factory . newInterceptor ( com . navercorp . pinpoint . profiler . plugin . TestInterceptors . TestInterceptor0 . class , null , scopeInfo , instrumentClass , instrumentMethod ) ; "<AssertPlaceHolder>" ; } newInterceptor ( java . lang . Class , java . lang . Object [ ] , com . navercorp . pinpoint . profiler . instrument . ScopeInfo , com . navercorp . pinpoint . bootstrap . instrument . InstrumentClass , com . navercorp . pinpoint . bootstrap . instrument . InstrumentMethod ) { com . navercorp . pinpoint . common . util . Assert . requireNonNull ( interceptorClass , "interceptorClass<sp>must<sp>not<sp>be<sp>null" ) ; com . navercorp . pinpoint . common . util . Assert . requireNonNull ( scopeInfo , "scopeInfo<sp>must<sp>not<sp>be<sp>null" ) ; final com . navercorp . pinpoint . bootstrap . interceptor . scope . InterceptorScope interceptorScope = scopeInfo . getInterceptorScope ( ) ; com . navercorp . pinpoint . profiler . objectfactory . InterceptorArgumentProvider interceptorArgumentProvider = new com . navercorp . pinpoint . profiler . objectfactory . InterceptorArgumentProvider ( dataSourceMonitorRegistry , apiMetaDataService , requestRecorderFactory , interceptorScope , target , targetMethod ) ; com . navercorp . pinpoint . profiler . objectfactory . AutoBindingObjectFactory factory = new com . navercorp . pinpoint . profiler . objectfactory . AutoBindingObjectFactory ( profilerConfig , traceContext , pluginContext , interceptorClass . getClassLoader ( ) ) ; com . navercorp . pinpoint . bootstrap . interceptor . Interceptor interceptor = ( ( com . navercorp . pinpoint . bootstrap . interceptor . Interceptor ) ( factory . createInstance ( interceptorClass , providedArguments , interceptorArgumentProvider ) ) ) ; return wrap ( interceptor , scopeInfo , interceptorScope ) ; }
org . junit . Assert . assertEquals ( com . navercorp . pinpoint . profiler . plugin . TestInterceptors . TestInterceptor0 . class , interceptor . getClass ( ) )
testSerialization ( ) { org . jfree . chart . plot . CombinedDomainXYPlot plot1 = createPlot ( ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( plot1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . plot . CombinedDomainXYPlot plot2 = ( ( org . jfree . chart . plot . CombinedDomainXYPlot ) ( 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 ( plot1 , plot2 )
testMultipleArgsAdd ( ) { int result = stub . add ( 3 , 5 , 2 ) ; "<AssertPlaceHolder>" ; } add ( int , int , int ) { return ( arg1 + arg2 ) + arg3 ; }
org . junit . Assert . assertEquals ( 10 , result )
testCommandLineOverride ( ) { int testTopics = 50 ; java . lang . String [ ] args = new java . lang . String [ ] { "--topics=" + testTopics , "--run_cfg=src/main/resources/configuration/UnitTestConfig.cfg" } ; cc . mallet . configuration . LDACommandLineParser cp = new cc . mallet . configuration . LDACommandLineParser ( args ) ; cc . mallet . configuration . Configuration config = new cc . mallet . configuration . ParsedLDAConfiguration ( cp ) ; config . activateSubconfig ( "demo" ) ; java . lang . Integer gottenTopics = config . getInteger ( "topics" , 120 ) ; "<AssertPlaceHolder>" ; } getInteger ( java . lang . String , java . lang . Integer ) { if ( ( ( ( commandlineParser ) != null ) && ( commandlineParser . hasOption ( key ) ) ) && ( ( commandlineParser . getOption ( key ) ) != null ) ) { return java . lang . Integer . parseInt ( commandlineParser . getOption ( key . trim ( ) ) ) ; } else { return super . getInteger ( translateKey ( key ) , defaultValue ) ; } }
org . junit . Assert . assertTrue ( ( testTopics == gottenTopics ) )
testConvertTweetString ( ) { java . util . List < org . apache . streams . pojo . json . Activity > activityList = activityConverterUtil . convert ( tweetJson ) ; "<AssertPlaceHolder>" ; org . apache . streams . pojo . json . Activity activity = activityList . get ( 0 ) ; if ( ! ( org . apache . streams . data . util . ActivityUtil . isValid ( activity ) ) ) { org . junit . Assert . fail ( ) ; } } size ( ) { return queue . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( activityList . size ( ) ) == 1 ) )
testBuildWithDisabledStatusConstraint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . order . Order context = new org . lnu . is . domain . order . Order ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>Order<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . order . Order > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
org . junit . Assert . assertEquals ( expected , actualQuery )
testGetKeyspaceFromRhombusStorage ( ) { com . pardot . rhombus . helpers . ConnectionManagerTester cm = getConnectionManager ( ) ; cm . dropKeyspace ( cm . getRhombusKeyspaceName ( ) ) ; com . pardot . rhombus . functional . CKeyspaceDefinition definition = com . pardot . rhombus . util . JsonUtil . objectFromJsonResource ( com . pardot . rhombus . functional . CKeyspaceDefinition . class , this . getClass ( ) . getClassLoader ( ) , "CKeyspaceTestData.js" ) ; cm . dropKeyspace ( definition . getName ( ) ) ; cm . buildKeyspace ( definition , false ) ; cm . teardown ( ) ; cm = getConnectionManager ( ) ; com . pardot . rhombus . ObjectMapper om = cm . getObjectMapper ( definition . getName ( ) ) ; com . pardot . rhombus . functional . CKeyspaceDefinition rhombusStorageKeyspaceDefinition = om . getKeyspaceDefinition_ONLY_FOR_TESTING ( ) ; "<AssertPlaceHolder>" ; cm . teardown ( ) ; } getKeyspaceDefinition_ONLY_FOR_TESTING ( ) { return keyspaceDefinition ; }
org . junit . Assert . assertEquals ( definition , rhombusStorageKeyspaceDefinition )
testIgnoreBetweenSpecialComments ( ) { net . sourceforge . pmd . cpd . SourceCode sourceCode = new net . sourceforge . pmd . cpd . SourceCode ( new net . sourceforge . pmd . cpd . SourceCode . StringCodeLoader ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "%<sp>CPD-OFF" + ( net . sourceforge . pmd . PMD . EOL ) ) + "function<sp>g<sp>=<sp>vec(op,<sp>y)" ) + ( net . sourceforge . pmd . PMD . EOL ) ) + "<sp>opy<sp>=<sp>op(y);" ) + ( net . sourceforge . pmd . PMD . EOL ) ) + "<sp>if<sp>(<sp>any(size(opy)<sp>><sp>1)<sp>)" ) + ( net . sourceforge . pmd . PMD . EOL ) ) + "<sp>g<sp>=<sp>@loopWrapperArray;" ) + ( net . sourceforge . pmd . PMD . EOL ) ) + "<sp>end" ) + ( net . sourceforge . pmd . PMD . EOL ) ) + "<sp>%<sp>CPD-ON" ) + ( net . sourceforge . pmd . PMD . EOL ) ) + "end" ) ) ) ; net . sourceforge . pmd . cpd . Tokens tokens = new net . sourceforge . pmd . cpd . Tokens ( ) ; tokenizer . tokenize ( sourceCode , tokens ) ; net . sourceforge . pmd . cpd . TokenEntry . getEOF ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return rules . size ( ) ; }
org . junit . Assert . assertEquals ( 2 , tokens . size ( ) )
newAccessTokenNoRequestToken ( ) { when ( tokenDao . getByToken ( anyString ( ) ) ) . thenReturn ( null ) ; com . sun . jersey . oauth . server . spi . OAuthToken t = provider . newAccessToken ( token , "" ) ; "<AssertPlaceHolder>" ; } newAccessToken ( com . sun . jersey . oauth . server . spi . OAuthToken , java . lang . String ) { com . fiveamsolutions . plc . data . oauth . OAuthToken token = tokenDao . getByToken ( requestToken . getToken ( ) ) ; if ( token == null ) { return null ; } token . setToken ( org . apache . commons . lang3 . RandomStringUtils . randomAlphanumeric ( com . fiveamsolutions . plc . service . provider . oauth . PLCOAuthProvider . TOKEN_SECRET_LENGTH ) ) ; token . setSecret ( org . apache . commons . lang3 . RandomStringUtils . randomAlphanumeric ( com . fiveamsolutions . plc . service . provider . oauth . PLCOAuthProvider . TOKEN_SECRET_LENGTH ) ) ; token . setAttributes ( new com . sun . jersey . core . util . MultivaluedMapImpl ( ) ) ; tokenDao . save ( token ) ; return token ; }
org . junit . Assert . assertNull ( t )
testIsEqual ( ) { com . eclipsesource . tabris . tracking . Order order = new com . eclipsesource . tabris . tracking . Order ( "foo" , java . math . BigDecimal . ONE ) ; com . eclipsesource . tabris . tracking . Order order2 = new com . eclipsesource . tabris . tracking . Order ( "foo" , java . math . BigDecimal . ONE ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( order , order2 )
should_put_element_with_media_type_in_cache ( ) { fr . norad . visuwall . providers . common . ResourceCache cache = new fr . norad . visuwall . providers . common . ResourceCache ( ) ; java . lang . Class < java . lang . Object > clazz = java . lang . Object . class ; java . lang . Object object = new java . lang . Object ( ) ; java . lang . String url = "url" ; javax . ws . rs . core . MediaType mediaType = javax . ws . rs . core . MediaType . APPLICATION_ATOM_XML_TYPE ; cache . put ( object , url , clazz , mediaType ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String , java . lang . Class , javax . ws . rs . core . MediaType ) { java . io . Serializable cacheKey = key ( url , clazz , mediaType ) ; if ( cache . isKeyInCache ( cacheKey ) ) { net . sf . ehcache . Element element = cache . get ( cacheKey ) ; if ( element != null ) { java . lang . Object objectValue = element . getObjectValue ( ) ; return ( ( T ) ( objectValue ) ) ; } } return null ; }
org . junit . Assert . assertEquals ( object , cache . get ( url , clazz , mediaType ) )
testGetString ( ) { org . teiid . core . types . SQLXMLImpl xml = new org . teiid . core . types . SQLXMLImpl ( testStr ) ; "<AssertPlaceHolder>" ; } getString ( ) { return this . reference . getString ( ) ; }
org . junit . Assert . assertEquals ( testStr , xml . getString ( ) )
testTrueCondWithElse ( ) { java . lang . String template = "<if(name)>works<else>fail<endif>" ; org . stringtemplate . v4 . ST st = new org . stringtemplate . v4 . ST ( template ) ; st . add ( "name" , "Ter" ) ; java . lang . String expected = "works" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
testExtensionsValidatorNull ( ) { com . ibm . ws . microprofile . openapi . impl . validation . ExtensionValidator validator = com . ibm . ws . microprofile . openapi . impl . validation . ExtensionValidator . getInstance ( ) ; com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper vh = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper ( ) ; java . lang . String extension = null ; validator . validate ( vh , context , extension , null ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , vh . getEventsSize ( ) )
testSnapshotSingleServer ( ) { final int nTxns = 20 ; com . github . zk1931 . jzab . QuorumTestCallback cb1 = new com . github . zk1931 . jzab . QuorumTestCallback ( ) ; com . github . zk1931 . jzab . SnapshotStateMachine st1 = new com . github . zk1931 . jzab . SnapshotStateMachine ( nTxns ) ; java . lang . String server = getUniqueHostPort ( ) ; com . github . zk1931 . jzab . ZabConfig config = new com . github . zk1931 . jzab . ZabConfig ( ) ; config . setLogDir ( getDirectory ( ) . getPath ( ) ) ; com . github . zk1931 . jzab . Zab zab = new com . github . zk1931 . jzab . Zab ( st1 , config , server , server ) ; st1 . waitMemberChanged ( ) ; for ( int i = 0 ; i < nTxns ; ++ i ) { zab . send ( java . nio . ByteBuffer . wrap ( ( "txns" + i ) . getBytes ( ) ) , null ) ; } st1 . txnsCount . await ( ) ; zab . takeSnapshot ( null ) ; st1 . waitSnapshot ( ) ; java . lang . Thread . sleep ( 1000 ) ; zab . shutdown ( ) ; com . github . zk1931 . jzab . SnapshotStateMachine stNew = new com . github . zk1931 . jzab . SnapshotStateMachine ( nTxns ) ; zab = new com . github . zk1931 . jzab . Zab ( stNew , config ) ; stNew . waitMemberChanged ( ) ; "<AssertPlaceHolder>" ; zab . shutdown ( ) ; } waitMemberChanged ( ) { semMembership . acquire ( ) ; }
org . junit . Assert . assertEquals ( st1 . state , stNew . state )
shouldInjectFlushAfterWriteConfigBeforeFirstReadConfig ( ) { org . kaazing . k3po . lang . internal . ast . AstScriptNode expectedScriptNode = new org . kaazing . k3po . lang . internal . ast . builder . AstScriptNodeBuilder ( ) . addConnectStream ( ) . addConnectedEvent ( ) . done ( ) . addWriteConfigCommand ( ) . done ( ) . addFlushCommand ( ) . done ( ) . addReadConfigEvent ( ) . done ( ) . addReadConfigEvent ( ) . done ( ) . done ( ) . done ( ) ; org . kaazing . k3po . lang . internal . ast . AstScriptNode inputScriptNode = new org . kaazing . k3po . lang . internal . ast . builder . AstScriptNodeBuilder ( ) . addConnectStream ( ) . addConnectedEvent ( ) . done ( ) . addWriteConfigCommand ( ) . done ( ) . addReadConfigEvent ( ) . done ( ) . addReadConfigEvent ( ) . done ( ) . done ( ) . done ( ) ; org . kaazing . k3po . driver . internal . behavior . visitor . InjectFlushVisitor injectFlush = new org . kaazing . k3po . driver . internal . behavior . visitor . InjectFlushVisitor ( ) ; org . kaazing . k3po . lang . internal . ast . AstScriptNode actualScriptNode = inputScriptNode . accept ( injectFlush , new org . kaazing . k3po . driver . internal . behavior . visitor . InjectFlushVisitor . State ( ) ) ; "<AssertPlaceHolder>" ; } accept ( org . kaazing . k3po . lang . internal . ast . Visitor , P ) { return visitor . visit ( this , parameter ) ; }
org . junit . Assert . assertEquals ( expectedScriptNode , actualScriptNode )
getPartitionLocations ( ) { java . util . List < org . apache . hadoop . fs . Path > paths = com . google . common . collect . Lists . newArrayList ( path , missingPath ) ; when ( sourceLocationManager . getPartitionLocations ( ) ) . thenReturn ( paths ) ; java . util . List < org . apache . hadoop . fs . Path > filteredPaths = filterMissingPartitionsLocationManager . getPartitionLocations ( ) ; java . util . List < org . apache . hadoop . fs . Path > expected = com . google . common . collect . Lists . newArrayList ( path ) ; "<AssertPlaceHolder>" ; } getPartitionLocations ( ) { java . util . List < org . apache . hadoop . fs . Path > result = new java . util . ArrayList ( ) ; java . util . List < org . apache . hadoop . fs . Path > paths = sourceLocationManager . getPartitionLocations ( ) ; org . apache . hadoop . fs . FileSystem fileSystem = null ; for ( org . apache . hadoop . fs . Path path : paths ) { try { if ( fileSystem == null ) { fileSystem = path . getFileSystem ( hiveConf ) ; } if ( fileSystem . exists ( path ) ) { result . add ( path ) ; } else { com . hotels . bdp . circustrain . core . source . FilterMissingPartitionsLocationManager . LOG . warn ( ( "Source<sp>path<sp>'{}'<sp>does<sp>not<sp>exist<sp>skipping<sp>it<sp>for<sp>replication." + ( "<sp>WARNING:<sp>this<sp>means<sp>there<sp>is<sp>a<sp>partition<sp>in<sp>Hive<sp>that<sp>does<sp>not<sp>have<sp>a<sp>corresponding<sp>folder<sp>in" + "<sp>source<sp>file<sp>store,<sp>check<sp>your<sp>table<sp>and<sp>data." ) ) , path ) ; } } catch ( java . io . IOException e ) { com . hotels . bdp . circustrain . core . source . FilterMissingPartitionsLocationManager . LOG . warn ( "Exception<sp>while<sp>checking<sp>path,<sp>skipping<sp>path<sp>'{}',<sp>error<sp>{}" , path , e ) ; } } return result ; }
org . junit . Assert . assertThat ( filteredPaths , org . hamcrest . CoreMatchers . is ( expected ) )
loadTurtleFile ( ) { final org . apache . rya . api . client . Install . InstallConfiguration installConfig = org . apache . rya . api . client . Install . InstallConfiguration . builder ( ) . setEnableTableHashPrefix ( false ) . setEnableEntityCentricIndex ( false ) . setEnableFreeTextIndex ( false ) . setEnableTemporalIndex ( false ) . setEnablePcjIndex ( false ) . setEnableGeoIndex ( false ) . build ( ) ; final org . apache . rya . api . client . mongo . MongoConnectionDetails connectionDetails = getConnectionDetails ( ) ; final org . apache . rya . api . client . RyaClient ryaClient = org . apache . rya . api . client . mongo . MongoRyaClientFactory . build ( connectionDetails , getMongoClient ( ) ) ; final org . apache . rya . api . client . Install install = ryaClient . getInstall ( ) ; install . install ( conf . getRyaInstanceName ( ) , installConfig ) ; ryaClient . getLoadStatementsFile ( ) . loadStatements ( conf . getRyaInstanceName ( ) , java . nio . file . Paths . get ( "src/test/resources/example.ttl" ) , RDFFormat . TURTLE ) ; final org . eclipse . rdf4j . model . ValueFactory vf = org . eclipse . rdf4j . model . impl . SimpleValueFactory . getInstance ( ) ; final java . util . Set < org . eclipse . rdf4j . model . Statement > expected = new java . util . HashSet ( ) ; expected . add ( vf . createStatement ( vf . createIRI ( "http://example#alice" ) , vf . createIRI ( "http://example#talksTo" ) , vf . createIRI ( "http://example#bob" ) ) ) ; expected . add ( vf . createStatement ( vf . createIRI ( "http://example#bob" ) , vf . createIRI ( "http://example#talksTo" ) , vf . createIRI ( "http://example#charlie" ) ) ) ; expected . add ( vf . createStatement ( vf . createIRI ( "http://example#charlie" ) , vf . createIRI ( "http://example#likes" ) , vf . createIRI ( "http://example#icecream" ) ) ) ; final java . util . Set < org . eclipse . rdf4j . model . Statement > statements = new java . util . HashSet ( ) ; final com . mongodb . client . MongoCursor < org . bson . Document > triplesIterator = getMongoClient ( ) . getDatabase ( conf . getRyaInstanceName ( ) ) . getCollection ( conf . getTriplesCollectionName ( ) ) . find ( ) . iterator ( ) ; while ( triplesIterator . hasNext ( ) ) { final org . bson . Document triple = triplesIterator . next ( ) ; statements . add ( vf . createStatement ( vf . createIRI ( triple . getString ( "subject" ) ) , vf . createIRI ( triple . getString ( "predicate" ) ) , vf . createIRI ( triple . getString ( "object" ) ) ) ) ; } "<AssertPlaceHolder>" ; } add ( java . lang . String , boolean , boolean ) { requireNonNull ( query ) ; lock . lock ( ) ; try { checkState ( ) ; final java . util . UUID queryId = java . util . UUID . randomUUID ( ) ; final org . apache . rya . streams . api . queries . QueryChange change = org . apache . rya . streams . api . queries . QueryChange . create ( queryId , query , isActive , isInsert ) ; changeLog . write ( change ) ; updateCache ( ) ; return queriesCache . get ( queryId ) ; } catch ( final org . apache . rya . streams . api . queries . QueryChangeLog . QueryChangeLogException e ) { throw new org . apache . rya . streams . api . queries . QueryRepositoryException ( ( "Could<sp>not<sp>create<sp>a<sp>Rya<sp>Streams<sp>query<sp>for<sp>the<sp>SPARQL<sp>string:<sp>" + query ) , e ) ; } finally { lock . unlock ( ) ; } }
org . junit . Assert . assertEquals ( expected , statements )