input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testDecodeAdjacentSingletonFirst ( ) { java . util . List < java . lang . String > encoded = java . util . Arrays . asList ( opennlp . tools . namefind . BilouCodecTest . A_UNIT , opennlp . tools . namefind . BilouCodecTest . A_UNIT , opennlp . tools . namefind . BilouCodecTest . OTHER ) ; opennlp . tools . util . Span [ ] expected = new opennlp . tools . util . Span [ ] { new opennlp . tools . util . Span ( 0 , 1 , opennlp . tools . namefind . BilouCodecTest . A_TYPE ) , new opennlp . tools . util . Span ( 1 , 2 , opennlp . tools . namefind . BilouCodecTest . A_TYPE ) } ; opennlp . tools . util . Span [ ] actual = opennlp . tools . namefind . BilouCodecTest . codec . decode ( encoded ) ; "<AssertPlaceHolder>" ; } decode ( java . util . List ) { int start = - 1 ; int end = - 1 ; java . util . List < opennlp . tools . util . Span > spans = new java . util . ArrayList ( c . size ( ) ) ; for ( int li = 0 ; li < ( c . size ( ) ) ; li ++ ) { java . lang . String chunkTag = c . get ( li ) ; if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . START ) ) { if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( li - 1 ) ) ) ) ) ; } start = li ; end = li + 1 ; } else if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . CONTINUE ) ) { end = li + 1 ; } else if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . OTHER ) ) { if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( li - 1 ) ) ) ) ) ; start = - 1 ; end = - 1 ; } } } if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( ( c . size ( ) ) - 1 ) ) ) ) ) ; } return spans . toArray ( new opennlp . tools . util . Span [ spans . size ( ) ] ) ; } | org . junit . Assert . assertArrayEquals ( expected , actual ) |
voided ( ) { io . trane . future . Future < java . lang . Void > future = io . trane . future . Future . value ( 1 ) . voided ( ) ; "<AssertPlaceHolder>" ; } get ( io . trane . future . Future ) { return future . get ( Duration . ZERO ) ; } | org . junit . Assert . assertNull ( get ( future ) ) |
builds_an_unchangeable_rekord ( ) { com . noodlesandwich . rekord . validation . ValidRekord < com . noodlesandwich . rekord . validation . Sandvich > sandvich = com . noodlesandwich . rekord . validation . ValidatingRekordTest . validatingSandvich . with ( Bread . Brown , Sandvich . bread ) . with ( Sandvich . filling , Filling . Jam ) . with ( Sandvich . style , Style . Roll ) . fix ( ) ; "<AssertPlaceHolder>" ; } aRekordOf ( java . lang . Class ) { return com . noodlesandwich . rekord . validation . RekordMatchers . aRekordNamed ( type . getSimpleName ( ) ) ; } | org . junit . Assert . assertThat ( sandvich , org . hamcrest . Matchers . is ( com . noodlesandwich . rekord . validation . RekordMatchers . aRekordOf ( com . noodlesandwich . rekord . validation . Sandvich . class ) . with ( Sandvich . bread , Bread . Brown ) . with ( Sandvich . filling , Filling . Jam ) . with ( Sandvich . style , Style . Roll ) ) ) |
mergeTextDecorationEmpyInputsTest ( ) { java . lang . String firstValue = "" ; java . lang . String secondValue = "" ; java . lang . String expected = "none" ; java . lang . String actual = com . itextpdf . styledxmlparser . css . resolve . CssPropertyMerger . mergeTextDecoration ( firstValue , secondValue ) ; "<AssertPlaceHolder>" ; } mergeTextDecoration ( java . lang . String , java . lang . String ) { if ( firstValue == null ) { return secondValue ; } else if ( secondValue == null ) { return firstValue ; } java . util . Set < java . lang . String > merged = com . itextpdf . styledxmlparser . css . resolve . CssPropertyMerger . normalizeTextDecoration ( firstValue ) ; merged . addAll ( com . itextpdf . styledxmlparser . css . resolve . CssPropertyMerger . normalizeTextDecoration ( secondValue ) ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; for ( java . lang . String mergedProp : merged ) { if ( ( sb . length ( ) ) != 0 ) { sb . append ( "<sp>" ) ; } sb . append ( mergedProp ) ; } return ( sb . length ( ) ) != 0 ? sb . toString ( ) : com . itextpdf . styledxmlparser . css . CommonCssConstants . NONE ; } | org . junit . Assert . assertEquals ( expected , actual ) |
isAccessExcluded ( ) { final java . lang . String appName = "applicationName" ; final java . lang . String moduleName = "moduleName" ; final java . lang . String uriName = "/test/index.html" ; final java . lang . String method = "GET" ; try { com . ibm . ws . security . authorization . jacc . internal . JaccServiceImpl jaccService = new com . ibm . ws . security . authorization . jacc . internal . JaccServiceImpl ( ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Exception<sp>is<sp>caught<sp>:<sp>" + e ) ) ; } } isAccessExcluded ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . Object ) { return ! ( checkDataConstraints ( applicationName , moduleName , uriName , methodName , req , "CONFIDENTIAL" ) ) ; } | org . junit . Assert . assertTrue ( jaccService . isAccessExcluded ( appName , moduleName , uriName , method , new java . lang . Object ( ) ) ) |
testAsSystemSpecificPath ( ) { java . lang . String urlPath = "c:\\workdir\\server-local\\instance\\tmp\\vfs\\deployment\\deploymentf7b5abe7c4c1cb56\\rules-with-kjar-1.0.jar-57cc270a5729d6b2\\rules-with-kjar-1.0.jar" ; java . lang . String specificPath = org . drools . core . util . IoUtils . asSystemSpecificPath ( urlPath , 1 ) ; "<AssertPlaceHolder>" ; } asSystemSpecificPath ( java . lang . String , int ) { java . lang . String ic = urlPath . substring ( java . lang . Math . max ( 0 , ( colonIndex - 2 ) ) , ( colonIndex + 1 ) ) ; if ( ic . matches ( "\\/[a-zA-Z]:" ) ) { return urlPath . substring ( ( colonIndex - 2 ) ) ; } else if ( ic . matches ( "[a-zA-Z]:" ) ) { return urlPath . substring ( ( colonIndex - 1 ) ) ; } else { return urlPath . substring ( ( colonIndex + 1 ) ) ; } } | org . junit . Assert . assertEquals ( urlPath , specificPath ) |
shouldCorrectlyGeneralize ( ) { java . util . Set < com . graphaware . common . description . relationship . DetachedRelationshipDescription > toGeneralize = new java . util . HashSet ( ) ; toGeneralize . add ( literal ( "T1" , com . graphaware . module . relcount . compact . OUTGOING ) . with ( "k1" , equalTo ( "v1" ) ) ) ; toGeneralize . add ( literal ( "T1" , com . graphaware . module . relcount . compact . OUTGOING ) . with ( "k1" , equalTo ( "v2" ) ) ) ; toGeneralize . add ( literal ( "T2" , com . graphaware . module . relcount . compact . INCOMING ) . with ( "k1" , equalTo ( "v1" ) ) . with ( "k2" , equalTo ( "v2" ) ) ) ; java . util . List < com . graphaware . module . relcount . compact . PropertyChangeFrequency > propertyChangeFrequencies = new java . util . LinkedList ( ) ; propertyChangeFrequencies . add ( new com . graphaware . module . relcount . compact . PropertyChangeFrequency ( "T1" , "k1" , 0.9 ) ) ; propertyChangeFrequencies . add ( new com . graphaware . module . relcount . compact . PropertyChangeFrequency ( "T2" , "k1" , 0.5 ) ) ; propertyChangeFrequencies . add ( new com . graphaware . module . relcount . compact . PropertyChangeFrequency ( "T2" , "k2" , 0.5 ) ) ; com . graphaware . module . relcount . compact . GeneralizationGenerator generalizer = new com . graphaware . module . relcount . compact . GeneralizationGenerator ( toGeneralize , propertyChangeFrequencies ) ; "<AssertPlaceHolder>" ; } generate ( ) { if ( ! ( frequencies . hasNext ( ) ) ) { return null ; } com . graphaware . module . relcount . compact . PropertyChangeFrequency frequency = frequencies . next ( ) ; com . graphaware . common . description . relationship . DetachedRelationshipDescription attempt = generate ( frequency . getType ( ) , createNewPropertySets ( frequency ) ) ; if ( attempt == null ) { return generate ( ) ; } return attempt ; } | org . junit . Assert . assertEquals ( literal ( "T1" , com . graphaware . module . relcount . compact . OUTGOING ) . with ( "k1" , any ( ) ) , generalizer . generate ( ) ) |
testEquals_NullBar ( ) { com . sumzerotrading . data . BarData bar = new com . sumzerotrading . data . BarData ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final com . sumzerotrading . realtime . bar . RealtimeBarRequest other = ( ( com . sumzerotrading . realtime . bar . RealtimeBarRequest ) ( obj ) ) ; if ( ( this . requestId ) != ( other . requestId ) ) { return false ; } if ( ( this . timeInterval ) != ( other . timeInterval ) ) { return false ; } if ( ! ( java . util . Objects . equals ( this . ticker , other . ticker ) ) ) { return false ; } if ( ( this . timeUnit ) != ( other . timeUnit ) ) { return false ; } if ( ( this . showProperty ) != ( other . showProperty ) ) { return false ; } return true ; } | org . junit . Assert . assertFalse ( bar . equals ( null ) ) |
testAcceptInValidParameter2 ( ) { final org . openspotlight . graph . query . console . ConsoleState state = new org . openspotlight . graph . query . console . ConsoleState ( null ) ; state . setInput ( "add<sp>help" ) ; "<AssertPlaceHolder>" ; } accept ( org . openspotlight . graph . query . console . ConsoleState ) { org . openspotlight . common . util . Assertions . checkNotNull ( "state" , state ) ; if ( ( ( state . getActiveCommand ( ) ) == null ) && ( state . getInput ( ) . trim ( ) . equals ( "display<sp>properties" ) ) ) { return true ; } return false ; } | org . junit . Assert . assertThat ( command . accept ( state ) , org . hamcrest . core . Is . is ( false ) ) |
testContainerLogFile ( ) { java . io . File absLogDir = new java . io . File ( "target" , ( ( org . apache . hadoop . yarn . server . nodemanager . webapp . TestNMWebServer . class . getSimpleName ( ) ) + "LogDir" ) ) . getAbsoluteFile ( ) ; java . lang . String logdirwithFile = absLogDir . toURI ( ) . toString ( ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . set ( YarnConfiguration . NM_LOG_DIRS , logdirwithFile ) ; conf . setFloat ( YarnConfiguration . NM_MAX_PER_DISK_UTILIZATION_PERCENTAGE , 0.0F ) ; org . apache . hadoop . yarn . server . nodemanager . LocalDirsHandlerService dirsHandler = new org . apache . hadoop . yarn . server . nodemanager . LocalDirsHandlerService ( ) ; dirsHandler . init ( conf ) ; org . apache . hadoop . yarn . server . nodemanager . NodeManager . NMContext nmContext = new org . apache . hadoop . yarn . server . nodemanager . NodeManager . NMContext ( null , null , dirsHandler , new org . apache . hadoop . yarn . server . security . ApplicationACLsManager ( conf ) , new org . apache . hadoop . yarn . server . nodemanager . recovery . NMNullStateStoreService ( ) , false , conf ) ; java . lang . String user = "nobody" ; long clusterTimeStamp = 1234 ; org . apache . hadoop . yarn . api . records . ApplicationId appId = org . apache . hadoop . yarn . server . utils . BuilderUtils . newApplicationId ( clusterTimeStamp , 1 ) ; org . apache . hadoop . yarn . server . nodemanager . containermanager . application . Application app = mock ( org . apache . hadoop . yarn . server . nodemanager . containermanager . application . Application . class ) ; when ( app . getUser ( ) ) . thenReturn ( user ) ; when ( app . getAppId ( ) ) . thenReturn ( appId ) ; org . apache . hadoop . yarn . api . records . ApplicationAttemptId appAttemptId = org . apache . hadoop . yarn . server . utils . BuilderUtils . newApplicationAttemptId ( appId , 1 ) ; org . apache . hadoop . yarn . api . records . ContainerId containerId = org . apache . hadoop . yarn . server . utils . BuilderUtils . newContainerId ( appAttemptId , 1 ) ; nmContext . getApplications ( ) . put ( appId , app ) ; org . apache . hadoop . yarn . server . nodemanager . webapp . MockContainer container = new org . apache . hadoop . yarn . server . nodemanager . webapp . MockContainer ( appAttemptId , new org . apache . hadoop . yarn . event . AsyncDispatcher ( ) , conf , user , appId , 1 ) ; container . setState ( ContainerState . RUNNING ) ; nmContext . getContainers ( ) . put ( containerId , container ) ; java . io . File containerLogDir = new java . io . File ( absLogDir , org . apache . hadoop . yarn . server . nodemanager . containermanager . launcher . ContainerLaunch . getRelativeContainerLogDir ( appId . toString ( ) , containerId . toString ( ) ) ) ; containerLogDir . mkdirs ( ) ; java . lang . String fileName = "fileName" ; java . io . File containerLogFile = new java . io . File ( containerLogDir , fileName ) ; containerLogFile . createNewFile ( ) ; java . io . File file = org . apache . hadoop . yarn . server . nodemanager . webapp . ContainerLogsUtils . getContainerLogFile ( containerId , fileName , user , nmContext ) ; "<AssertPlaceHolder>" ; org . apache . hadoop . fs . FileUtil . fullyDelete ( absLogDir ) ; } toString ( ) { return getName ( ) ; } | org . junit . Assert . assertEquals ( containerLogFile . toURI ( ) . toString ( ) , file . toURI ( ) . toString ( ) ) |
testShortWithoutEqual ( ) { final java . lang . String [ ] args = new java . lang . String [ ] { "-fbar" } ; final org . apache . commons . cli . Options options = new org . apache . commons . cli . Options ( ) ; options . addOption ( org . apache . commons . cli . OptionBuilder . withLongOpt ( "foo" ) . hasArg ( ) . create ( 'f' ) ) ; final org . apache . commons . cli . CommandLine cl = parser . parse ( options , args ) ; "<AssertPlaceHolder>" ; } getOptionValue ( org . apache . commons . cli . Option ) { if ( option == null ) { return null ; } final java . lang . String [ ] values = getOptionValues ( option ) ; return values == null ? null : values [ 0 ] ; } | org . junit . Assert . assertEquals ( "bar" , cl . getOptionValue ( "foo" ) ) |
injectIntoInt ( ) { com . gs . collections . api . set . ImmutableSet < java . lang . Integer > objects = this . newSetWith ( 1 , 2 , 3 ) ; int result = objects . injectInto ( 1 , AddFunction . INTEGER_TO_INT ) ; "<AssertPlaceHolder>" ; } injectInto ( double , com . gs . collections . api . block . function . primitive . DoubleObjectToDoubleFunction ) { return 0 ; } | org . junit . Assert . assertEquals ( 7 , result ) |
shouldReturnTrueForEmptyStringSurroundedBySingleQuotes ( ) { boolean quoted = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isQuoted ( "''" ) ; "<AssertPlaceHolder>" ; } isQuoted ( java . lang . String ) { checkNotNull ( entityName ) ; return ( ( ( entityName . length ( ) ) >= 2 ) && ( ( entityName . charAt ( 0 ) ) == ( edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . SINGLE_QUOTE ) ) ) && ( ( entityName . charAt ( ( ( entityName . length ( ) ) - 1 ) ) ) == ( edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . SINGLE_QUOTE ) ) ; } | org . junit . Assert . assertEquals ( true , quoted ) |
setPhenotypeMappingWorks ( ) { org . xwiki . model . reference . DocumentReference mapping = new org . xwiki . model . reference . DocumentReference ( "xwiki" , "PhenoTips" , "Default<sp>phenotype<sp>mapping" ) ; this . component . setPhenotypeMapping ( mapping ) ; "<AssertPlaceHolder>" ; } getPhenotypeMapping ( ) { return this . phenotypeMapping ; } | org . junit . Assert . assertSame ( mapping , this . component . getPhenotypeMapping ( ) ) |
testApplicationDefinedHasPrecedence ( ) { final org . apache . flink . runtime . state . StateBackend appBackend = org . mockito . Mockito . mock ( org . apache . flink . runtime . state . StateBackend . class ) ; final org . apache . flink . configuration . Configuration config = new org . apache . flink . configuration . Configuration ( ) ; config . setString ( backendKey , "jobmanager" ) ; org . apache . flink . runtime . state . StateBackend backend = org . apache . flink . runtime . state . StateBackendLoader . fromApplicationOrConfigOrDefault ( appBackend , config , cl , null ) ; "<AssertPlaceHolder>" ; } fromApplicationOrConfigOrDefault ( org . apache . flink . runtime . state . StateBackend , org . apache . flink . configuration . Configuration , java . lang . ClassLoader , org . slf4j . Logger ) { checkNotNull ( config , "config" ) ; checkNotNull ( classLoader , "classLoader" ) ; final org . apache . flink . runtime . state . StateBackend backend ; if ( fromApplication != null ) { if ( logger != null ) { logger . info ( "Using<sp>application-defined<sp>state<sp>backend:<sp>{}" , fromApplication ) ; } if ( fromApplication instanceof org . apache . flink . runtime . state . ConfigurableStateBackend ) { if ( logger != null ) { logger . info ( "Configuring<sp>application-defined<sp>state<sp>backend<sp>with<sp>job/cluster<sp>config" ) ; } backend = ( ( org . apache . flink . runtime . state . ConfigurableStateBackend ) ( fromApplication ) ) . configure ( config , classLoader ) ; } else { backend = fromApplication ; } } else { final org . apache . flink . runtime . state . StateBackend fromConfig = org . apache . flink . runtime . state . StateBackendLoader . loadStateBackendFromConfig ( config , classLoader , logger ) ; if ( fromConfig != null ) { backend = fromConfig ; } else { backend = new org . apache . flink . runtime . state . memory . MemoryStateBackendFactory ( ) . createFromConfig ( config , classLoader ) ; if ( logger != null ) { logger . info ( "No<sp>state<sp>backend<sp>has<sp>been<sp>configured,<sp>using<sp>default<sp>(Memory<sp>/<sp>JobManager)<sp>{}" , backend ) ; } } } if ( backend instanceof org . apache . flink . runtime . state . memory . MemoryStateBackend ) { final org . apache . flink . runtime . state . memory . MemoryStateBackend memBackend = ( ( org . apache . flink . runtime . state . memory . MemoryStateBackend ) ( backend ) ) ; if ( ( ( memBackend . getCheckpointPath ( ) ) == null ) && ( org . apache . flink . runtime . jobmanager . HighAvailabilityMode . isHighAvailabilityModeActivated ( config ) ) ) { final java . lang . String haStoragePath = config . getString ( HighAvailabilityOptions . HA_STORAGE_PATH ) ; if ( haStoragePath != null ) { try { org . apache . flink . core . fs . Path checkpointDirPath = new org . apache . flink . core . fs . Path ( haStoragePath , java . util . UUID . randomUUID ( ) . toString ( ) ) ; if ( ( checkpointDirPath . toUri ( ) . getScheme ( ) ) == null ) { checkpointDirPath = checkpointDirPath . makeQualified ( checkpointDirPath . getFileSystem ( ) ) ; } org . apache . flink . configuration . Configuration tempConfig = new org . apache . flink . configuration . Configuration ( config ) ; tempConfig . setString ( CheckpointingOptions . CHECKPOINTS_DIRECTORY , checkpointDirPath . toString ( ) ) ; return memBackend . configure ( tempConfig , classLoader ) ; } catch ( java . lang . Exception ignored ) { } } } } return backend ; } | org . junit . Assert . assertEquals ( appBackend , backend ) |
testNonLatinTableCreateFilter ( ) { java . lang . String [ ] sql = new java . lang . String [ ] { "create<sp>table<sp><sp>(<sp><sp>int,<sp><sp>text<sp>)" } ; java . util . List < com . zendesk . maxwell . row . RowMap > rows = getRowsForDDLTransaction ( sql , excludeTable ( "" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return columns . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , rows . size ( ) ) |
errorMessageDefaultsToProvidedIfRequestIsSucceeeded ( ) { java . lang . String expectedMessage = java . util . UUID . randomUUID ( ) . toString ( ) ; org . appenders . log4j2 . elasticsearch . jest . BufferedBulkResult result = createTestBufferedBulkResult ( false , null ) ; java . lang . String actualMessage = result . getErrorMessage ( expectedMessage ) ; "<AssertPlaceHolder>" ; } getErrorMessage ( java . lang . String ) { if ( isSucceeded ( ) ) { return defaultMessage ; } java . lang . StringBuilder sb = new java . lang . StringBuilder ( 256 ) ; if ( errors ) { sb . append ( org . appenders . log4j2 . elasticsearch . jest . BufferedBulkResult . ONE_OR_MORE_ITEMS_FAILED_MESSAGE ) ; appendFailedItemErrorMessageIfAvailable ( sb . append ( org . appenders . log4j2 . elasticsearch . jest . BufferedBulkResult . SEPARATOR ) ) ; } else { sb . append ( org . appenders . log4j2 . elasticsearch . jest . BufferedBulkResult . BULK_REQUEST_FAILED_MESAGE ) ; } if ( ( getStatus ( ) ) > 0 ) { sb . append ( org . appenders . log4j2 . elasticsearch . jest . BufferedBulkResult . SEPARATOR ) . append ( "status:<sp>" ) . append ( getStatus ( ) ) ; } if ( ( getError ( ) ) != null ) { sb . append ( org . appenders . log4j2 . elasticsearch . jest . BufferedBulkResult . SEPARATOR ) . append ( org . appenders . log4j2 . elasticsearch . jest . BufferedBulkResult . ROOT_ERROR_ITEM_PREFIX ) ; getError ( ) . appendErrorMessage ( sb ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedMessage , actualMessage ) |
testExceptionRetry ( ) { javax . naming . InitialContext ctx = new javax . naming . InitialContext ( ) ; org . jboss . as . test . integration . ejb . timerservice . tx . retry . ExceptionRetryBean bean = ( ( org . jboss . as . test . integration . ejb . timerservice . tx . retry . ExceptionRetryBean ) ( ctx . lookup ( ( "java:module/" + ( org . jboss . as . test . integration . ejb . timerservice . tx . retry . ExceptionRetryBean . class . getSimpleName ( ) ) ) ) ) ) ; bean . createTimer ( ) ; "<AssertPlaceHolder>" ; } awaitTimerCall ( ) { try { org . jboss . as . test . integration . ejb . timerservice . tx . retry . ExceptionRetryBean . latch . await ( org . jboss . as . test . integration . ejb . timerservice . tx . retry . ExceptionRetryBean . TIMER_CALL_WAITING_S , TimeUnit . SECONDS ) ; } catch ( java . lang . InterruptedException e ) { throw new java . lang . RuntimeException ( e ) ; } return ( org . jboss . as . test . integration . ejb . timerservice . tx . retry . ExceptionRetryBean . count ) > 1 ; } | org . junit . Assert . assertTrue ( org . jboss . as . test . integration . ejb . timerservice . tx . retry . ExceptionRetryBean . awaitTimerCall ( ) ) |
checkRegisteredNodeMouseDoubleClickHandlerNotOverHeader ( ) { final org . mockito . ArgumentCaptor < com . ait . lienzo . client . core . event . NodeMouseDoubleClickHandler > nodeMouseDoubleClickHandlerArgumentCaptor = org . mockito . ArgumentCaptor . forClass ( com . ait . lienzo . client . core . event . NodeMouseDoubleClickHandler . class ) ; verify ( view , times ( 1 ) ) . registerNodeMouseDoubleClickHandler ( nodeMouseDoubleClickHandlerArgumentCaptor . capture ( ) ) ; final com . ait . lienzo . client . core . event . NodeMouseDoubleClickHandler nodeMouseDoubleClickHandler = nodeMouseDoubleClickHandlerArgumentCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; final com . ait . lienzo . client . core . event . NodeMouseDoubleClickEvent event = mock ( com . ait . lienzo . client . core . event . NodeMouseDoubleClickEvent . class ) ; when ( view . isNodeMouseEventOverCaption ( eq ( event ) ) ) . thenReturn ( false ) ; nodeMouseDoubleClickHandler . onNodeMouseDoubleClick ( event ) ; verify ( dtPresenter , never ( ) ) . enterPinnedMode ( any ( org . uberfire . ext . wires . core . grids . client . widget . grid . GridWidget . class ) , any ( com . google . gwt . user . client . Command . class ) ) ; verify ( dtPresenter , never ( ) ) . enterPinnedMode ( any ( org . uberfire . ext . wires . core . grids . client . widget . grid . GridWidget . class ) , any ( com . google . gwt . user . client . Command . class ) ) ; } getValue ( ) { return this . value ; } | org . junit . Assert . assertNotNull ( nodeMouseDoubleClickHandler ) |
shouldReturnLastIndexBeforeOpenBrace ( ) { int position = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . indexOfWordEnd ( "aa{a" , 0 ) ; "<AssertPlaceHolder>" ; } indexOfWordEnd ( java . lang . String , int ) { checkNotNull ( entityName ) ; checkElementIndex ( startIndex , entityName . length ( ) ) ; final int firstWordChar = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . indexOfWordChar ( entityName , startIndex ) ; if ( firstWordChar == ( - 1 ) ) { return - 1 ; } int lastIndex = firstWordChar + 1 ; for ( int i = lastIndex ; i < ( entityName . length ( ) ) ; i ++ ) { if ( ( edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isWordStart ( entityName , i ) ) || ( ! ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , i ) . isWordLetter ( ) ) ) ) { break ; } lastIndex ++ ; } return lastIndex ; } | org . junit . Assert . assertEquals ( 2 , position ) |
findReturnsNullWhenChildWithoutVersionAndParentWithoutVersion ( ) { when ( mavenProject . hasParent ( ) ) . thenReturn ( true ) ; when ( mavenProject . getParent ( ) ) . thenReturn ( parentMavenProject ) ; "<AssertPlaceHolder>" ; } find ( ) { org . apache . maven . artifact . versioning . ArtifactVersion childMavenVersion = getHighestArtifactVersion ( getPrerequisitesMavenVersion ( ) , getEnforcerMavenVersion ( ) ) ; if ( ! ( mavenProject . hasParent ( ) ) ) { return childMavenVersion ; } org . apache . maven . artifact . versioning . ArtifactVersion parentMavenVersion = new org . codehaus . mojo . versions . RequiredMavenVersionFinder ( mavenProject . getParent ( ) ) . find ( ) ; return getHighestArtifactVersion ( childMavenVersion , parentMavenVersion ) ; } | org . junit . Assert . assertNull ( new org . codehaus . mojo . versions . RequiredMavenVersionFinder ( mavenProject ) . find ( ) ) |
testAll ( ) { final io . vlingo . cluster . model . attribute . AttributeSet set1 = attributeSetFixture ( "set1" ) ; final io . vlingo . cluster . model . attribute . AttributeSet set2 = attributeSetFixture ( "set2" ) ; final io . vlingo . cluster . model . attribute . AttributeSet set3 = attributeSetFixture ( "set3" ) ; repository . add ( set1 ) ; repository . add ( set2 ) ; repository . add ( set3 ) ; "<AssertPlaceHolder>" ; } all ( ) { return attributes . values ( ) ; } | org . junit . Assert . assertEquals ( 3 , repository . all ( ) . size ( ) ) |
testKnotParserIteration ( ) { org . petitparser . parser . combinators . SettableParser parser1 = undefined ( ) ; parser1 . set ( parser1 ) ; org . petitparser . utils . Mirror mirror = org . petitparser . utils . Mirror . of ( parser1 ) ; java . util . List < org . petitparser . parser . Parser > parsers = mirror . stream ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } stream ( ) { return java . util . stream . StreamSupport . stream ( java . util . Spliterators . spliteratorUnknownSize ( iterator ( ) , ( ( java . util . Spliterator . DISTINCT ) | ( java . util . Spliterator . NONNULL ) ) ) , false ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( parser1 ) , parsers ) |
justPath ( ) { org . apache . shindig . common . uri . UriBuilder builder = new org . apache . shindig . common . uri . UriBuilder ( ) . setPath ( "/shindig" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return jsonString ; } | org . junit . Assert . assertEquals ( "/shindig" , builder . toString ( ) ) |
rejectRunnableTest ( ) { org . threadly . test . concurrent . TestableScheduler testableScheduler = new org . threadly . test . concurrent . TestableScheduler ( ) ; org . threadly . concurrent . wrapper . limiter . PrioritySchedulerServiceQueueLimitRejector queueRejector = new org . threadly . concurrent . wrapper . limiter . PrioritySchedulerServiceQueueLimitRejector ( testableScheduler , TEST_QTY ) ; for ( int i = 0 ; i < ( TEST_QTY ) ; i ++ ) { queueRejector . execute ( org . threadly . concurrent . DoNothingRunnable . instance ( ) ) ; } try { queueRejector . execute ( org . threadly . concurrent . DoNothingRunnable . instance ( ) ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>thrown" ) ; } catch ( java . util . concurrent . RejectedExecutionException e ) { } "<AssertPlaceHolder>" ; for ( int i = 0 ; i < ( TEST_QTY ) ; i ++ ) { queueRejector . execute ( org . threadly . concurrent . DoNothingRunnable . instance ( ) ) ; } } tick ( ) { return tick ( null ) ; } | org . junit . Assert . assertEquals ( org . threadly . concurrent . wrapper . limiter . TEST_QTY , testableScheduler . tick ( ) ) |
should_return_remote_unanchored ( ) { au . edu . wehi . idsv . SAMRecord r = withSequence ( "ACN" , Read ( 0 , 1 , "1M1D1M1S" ) ) [ 0 ] ; r . setAttribute ( "SA" , "polyA,10,+,2S1X,39,1" ) ; au . edu . wehi . idsv . SplitReadEvidence e = au . edu . wehi . idsv . SplitReadEvidence . create ( SES ( ) , r ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { assert ( kmer . length ( ) ) == ( getGraph ( ) . getK ( ) ) ; long state = au . edu . wehi . idsv . debruijn . KmerEncodingHelper . picardBaseToEncoded ( getGraph ( ) . getK ( ) , au . edu . wehi . idsv . TestHelper . B ( kmer . substring ( 0 , getGraph ( ) . getK ( ) ) ) ) ; for ( au . edu . wehi . idsv . debruijn . DeBruijnPathNode < au . edu . wehi . idsv . debruijn . DeBruijnNodeBase > pn : getPaths ( ) ) { for ( au . edu . wehi . idsv . debruijn . DeBruijnNodeBase n : au . edu . wehi . idsv . Iterables . concat ( pn . getPathAllNodes ( ) ) ) { if ( state == ( n . kmer ( ) ) ) { return pn ; } } } return null ; } | org . junit . Assert . assertNotNull ( e ) |
visitDocuments ( ) { org . xwiki . model . reference . DocumentReference alice = new org . xwiki . model . reference . DocumentReference ( "foo" , "Alice" , "WebHome" ) ; org . xwiki . model . reference . DocumentReference alicePrefs = new org . xwiki . model . reference . DocumentReference ( "WebPreferences" , alice . getLastSpaceReference ( ) ) ; org . xwiki . model . reference . DocumentReference aliceBio = new org . xwiki . model . reference . DocumentReference ( "Bio" , alice . getLastSpaceReference ( ) ) ; org . xwiki . model . reference . DocumentReference bob = new org . xwiki . model . reference . DocumentReference ( "foo" , java . util . Arrays . asList ( "Alice" , "Bob" ) , "WebHome" ) ; org . xwiki . model . reference . DocumentReference bobPrefs = new org . xwiki . model . reference . DocumentReference ( "WebPreferences" , bob . getLastSpaceReference ( ) ) ; org . xwiki . model . reference . DocumentReference bobBio = new org . xwiki . model . reference . DocumentReference ( "Bio" , bob . getLastSpaceReference ( ) ) ; org . xwiki . model . reference . DocumentReference carolBio = new org . xwiki . model . reference . DocumentReference ( "bar" , java . util . Arrays . asList ( "Users" , "Carol" ) , "Bio" ) ; org . xwiki . model . reference . SpaceReference spaceReference = mock ( org . xwiki . model . reference . SpaceReference . class ) ; when ( this . modelBridge . getDocumentReferences ( spaceReference ) ) . thenReturn ( java . util . Arrays . asList ( alice , alicePrefs , aliceBio , bob , bobPrefs , bobBio , carolBio ) ) ; org . xwiki . refactoring . internal . job . EntityJobTest . NoopEntityJob job = new org . xwiki . refactoring . internal . job . EntityJobTest . NoopEntityJob ( ) ; initialize ( job , new org . xwiki . refactoring . job . EntityRequest ( ) ) ; final java . util . List < org . xwiki . model . reference . DocumentReference > documentReferences = new java . util . ArrayList ( ) ; job . visitDocuments ( spaceReference , new org . xwiki . refactoring . internal . job . AbstractEntityJob . Visitor < org . xwiki . model . reference . DocumentReference > ( ) { @ org . xwiki . refactoring . internal . job . Override public void visit ( org . xwiki . model . reference . DocumentReference documentReference ) { documentReferences . add ( documentReference ) ; } } ) ; "<AssertPlaceHolder>" ; } add ( org . xwiki . rest . model . jaxb . Object ) { add ( obj , true ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( carolBio , aliceBio , bobBio , bob , bobPrefs , alice , alicePrefs ) , documentReferences ) |
testSchedulerNoOp ( ) { java . lang . Runnable runnable = mock ( net . bytebuddy . agent . builder . Runnable . class ) ; AgentBuilder . RedefinitionStrategy . ResubmissionScheduler . NoOp . INSTANCE . schedule ( runnable ) ; verifyZeroInteractions ( runnable ) ; "<AssertPlaceHolder>" ; } isAlive ( ) { return net . bytebuddy . dynamic . NexusAccessor . DISPATCHER . isAlive ( ) ; } | org . junit . Assert . assertThat ( AgentBuilder . RedefinitionStrategy . ResubmissionScheduler . NoOp . INSTANCE . isAlive ( ) , org . hamcrest . CoreMatchers . is ( false ) ) |
ignoring_A$ClassArray ( ) { com . m3 . scalaflavor4j . ExceptionControl . Catch < java . lang . String > ignore = ignoring ( com . m3 . scalaflavor4j . Exception . class ) ; java . lang . String result = ignore . apply ( new com . m3 . scalaflavor4j . F0 < java . lang . String > ( ) { public java . lang . String apply ( ) throws com . m3 . scalaflavor4j . Exception { throw new java . lang . RuntimeException ( ) ; } } ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . String ) { System . out . println ( ( v1 + v1 ) ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( null ) ) ) |
reportsDeathDateBeforeEndOfTreatment ( ) { final java . util . List < com . hartwig . hmftools . common . ecrf . datamodel . ValidationFinding > findings = com . hartwig . hmftools . patientdb . validators . PatientValidator . validateDeathDate ( com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . PATIENT_IDENTIFIER , baselineBuilder ( ) . deathDate ( com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . MAR ) . build ( ) , com . google . common . collect . Lists . newArrayList ( com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . TREATMENT_JAN_ONGOING , com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . TREATMENT_JAN_FEB ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( maxheap . size ( ) ) + ( minheap . size ( ) ) ; } | org . junit . Assert . assertEquals ( 1 , findings . size ( ) ) |
providesEmptyArray ( ) { "<AssertPlaceHolder>" ; } getBytes ( ) { return toByteArray ( this . inputStream ) ; } | org . junit . Assert . assertThat ( entity . getBytes ( ) . length , org . hamcrest . Matchers . is ( 0 ) ) |
testFrame0001 ( ) { final java . lang . Object frame = com . github . jsonldjava . utils . JsonUtils . fromInputStream ( getClass ( ) . getResourceAsStream ( "/custom/frame-0001-frame.jsonld" ) ) ; final java . lang . Object in = com . github . jsonldjava . utils . JsonUtils . fromInputStream ( getClass ( ) . getResourceAsStream ( "/custom/frame-0001-in.jsonld" ) ) ; final java . util . Map < java . lang . String , java . lang . Object > frame2 = com . github . jsonldjava . core . JsonLdProcessor . frame ( in , frame , new com . github . jsonldjava . core . JsonLdOptions ( ) ) ; "<AssertPlaceHolder>" ; } frame ( java . lang . Object , java . lang . Object , com . github . jsonldjava . core . JsonLdOptions ) { if ( frame instanceof java . util . Map ) { frame = com . github . jsonldjava . core . JsonLdUtils . clone ( frame ) ; } final java . lang . Object expandedInput = com . github . jsonldjava . core . JsonLdProcessor . expand ( input , opts ) ; final java . lang . Object savedExpandedContext = opts . getExpandContext ( ) ; opts . setExpandContext ( null ) ; opts . setFrameExpansion ( true ) ; final java . util . List < java . lang . Object > expandedFrame = com . github . jsonldjava . core . JsonLdProcessor . expand ( frame , opts ) ; opts . setExpandContext ( savedExpandedContext ) ; final com . github . jsonldjava . core . JsonLdApi api = new com . github . jsonldjava . core . JsonLdApi ( expandedInput , opts ) ; final com . github . jsonldjava . core . Context activeCtx = api . context . parse ( ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( frame ) ) . get ( JsonLdConsts . CONTEXT ) ) ; final java . util . List < java . lang . Object > framed = api . frame ( expandedInput , expandedFrame ) ; if ( opts . getPruneBlankNodeIdentifiers ( ) ) { com . github . jsonldjava . core . JsonLdUtils . pruneBlankNodes ( framed ) ; } java . lang . Object compacted = api . compact ( activeCtx , null , framed , opts . getCompactArrays ( ) ) ; final java . util . Map < java . lang . String , java . lang . Object > rval = activeCtx . serialize ( ) ; final boolean addGraph = ( ! ( compacted instanceof java . util . List ) ) && ( ! ( opts . getOmitGraph ( ) ) ) ; if ( addGraph && ( ! ( compacted instanceof java . util . List ) ) ) { final java . util . List < java . lang . Object > tmp = new java . util . ArrayList < java . lang . Object > ( ) ; tmp . add ( compacted ) ; compacted = tmp ; } if ( addGraph || ( compacted instanceof java . util . List ) ) { final java . lang . String alias = activeCtx . compactIri ( JsonLdConsts . GRAPH ) ; rval . put ( alias , compacted ) ; } else if ( ( ! addGraph ) && ( compacted instanceof java . util . Map ) ) { rval . putAll ( ( ( java . util . Map ) ( compacted ) ) ) ; } com . github . jsonldjava . core . JsonLdUtils . removePreserve ( activeCtx , rval , opts ) ; return rval ; } | org . junit . Assert . assertEquals ( 2 , frame2 . size ( ) ) |
testExpandedNodeIdTwoByte ( ) { org . opcfoundation . ua . builtintypes . ExpandedNodeId data = new org . opcfoundation . ua . builtintypes . ExpandedNodeId ( null , 0 , 128 ) ; org . opcfoundation . ua . encoding . EncoderContext ctx = org . opcfoundation . ua . encoding . EncoderContext . getDefaultInstance ( ) ; java . io . ByteArrayOutputStream buf = new java . io . ByteArrayOutputStream ( ) ; org . opcfoundation . ua . encoding . binary . BinaryEncoder enc = new org . opcfoundation . ua . encoding . binary . BinaryEncoder ( buf ) ; enc . setEncoderContext ( ctx ) ; enc . putExpandedNodeId ( null , data ) ; org . opcfoundation . ua . encoding . binary . BinaryDecoder sut = new org . opcfoundation . ua . encoding . binary . BinaryDecoder ( buf . toByteArray ( ) ) ; sut . setEncoderContext ( ctx ) ; org . opcfoundation . ua . builtintypes . ExpandedNodeId actual = sut . getExpandedNodeId ( null ) ; "<AssertPlaceHolder>" ; } getExpandedNodeId ( java . lang . String ) { org . opcfoundation . ua . builtintypes . ExpandedNodeId value = org . opcfoundation . ua . builtintypes . ExpandedNodeId . NULL ; if ( beginFieldSafe ( fieldName , true ) ) { value = org . opcfoundation . ua . builtintypes . ExpandedNodeId . parseExpandedNodeId ( getString ( "Identifier" ) ) ; endField ( fieldName ) ; } int namespaceIndex = value . getNamespaceIndex ( ) ; int serverIndex = value . getServerIndex ( ) . intValue ( ) ; boolean indexChanged = false ; if ( ( ( namespaceMappings ) != null ) && ( ( namespaceMappings . length ) > ( value . getNamespaceIndex ( ) ) ) ) { namespaceIndex = namespaceMappings [ value . getNamespaceIndex ( ) ] . intValue ( ) ; indexChanged = true ; } if ( ( ( serverMappings ) != null ) && ( ( serverMappings . length ) > ( value . getServerIndex ( ) . intValue ( ) ) ) ) { serverIndex = serverMappings [ value . getServerIndex ( ) . intValue ( ) ] . intValue ( ) ; indexChanged = true ; } if ( indexChanged ) value = new org . opcfoundation . ua . builtintypes . ExpandedNodeId ( org . opcfoundation . ua . builtintypes . UnsignedInteger . valueOf ( serverIndex ) , namespaceIndex , value . getValue ( ) ) ; return value ; } | org . junit . Assert . assertEquals ( data , actual ) |
containsRange_equals ( ) { org . eclipse . lsp4j . Range range = org . eclipse . lsp4j . test . util . RangesTest . newRange ( 0 , 0 , 1 , 3 ) ; "<AssertPlaceHolder>" ; } containsRange ( org . eclipse . lsp4j . Range , org . eclipse . lsp4j . Range ) { com . google . common . base . Preconditions . checkNotNull ( bigger , "bigger" ) ; com . google . common . base . Preconditions . checkNotNull ( smaller , "smaller" ) ; return ( org . eclipse . lsp4j . util . Ranges . containsPosition ( bigger , smaller . getStart ( ) ) ) && ( org . eclipse . lsp4j . util . Ranges . containsPosition ( bigger , smaller . getEnd ( ) ) ) ; } | org . junit . Assert . assertTrue ( org . eclipse . lsp4j . util . Ranges . containsRange ( range , range ) ) |
testHashCodeDeterministic ( ) { hw4 . hash . SimpleOomage so = hw4 . hash . SimpleOomage . randomSimpleOomage ( ) ; int hashCode = so . hashCode ( ) ; for ( int i = 0 ; i < 100 ; i += 1 ) { "<AssertPlaceHolder>" ; } } hashCode ( ) { int hashCode = 1 ; for ( int i = 0 ; i < ( length ( ) ) ; i += 1 ) { hashCode *= 31 ; } return hashCode ; } | org . junit . Assert . assertEquals ( hashCode , so . hashCode ( ) ) |
getCommentReturnsV1TagsCommentIfV2TagDoesNotExist ( ) { com . mpatric . mp3agic . ID3v1 id3v1Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v1TagForTesting ( ) ; id3v1Tag . setComment ( "V1<sp>Comment" ) ; com . mpatric . mp3agic . ID3Wrapper wrapper = new com . mpatric . mp3agic . ID3Wrapper ( id3v1Tag , null ) ; "<AssertPlaceHolder>" ; } getComment ( ) { return comment ; } | org . junit . Assert . assertEquals ( "V1<sp>Comment" , wrapper . getComment ( ) ) |
addNamedRenderer ( ) { com . itextpdf . svg . renderers . ISvgNodeRenderer expected = new com . itextpdf . svg . dummy . renderers . impl . DummySvgNodeRenderer ( ) ; java . lang . String dummyName = "dummy" ; this . context . addNamedObject ( dummyName , expected ) ; java . lang . Object actual = this . context . getNamedObject ( dummyName ) ; "<AssertPlaceHolder>" ; } getNamedObject ( java . lang . String ) { return this . namedObjects . get ( name ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
putItemWithHashKeyAndRangeKeyWithoutItem ( ) { com . amazonaws . services . dynamodb . model . KeySchema schema = new com . amazonaws . services . dynamodb . model . KeySchema ( new com . amazonaws . services . dynamodb . model . KeySchemaElement ( ) . withAttributeName ( "id" ) . withAttributeType ( ScalarAttributeType . S ) ) ; schema . setRangeKeyElement ( new com . amazonaws . services . dynamodb . model . KeySchemaElement ( ) . withAttributeName ( "range" ) . withAttributeType ( ScalarAttributeType . S ) ) ; createTable ( tableName , schema ) ; com . amazonaws . services . dynamodb . model . PutItemRequest request = new com . amazonaws . services . dynamodb . model . PutItemRequest ( ) . withTableName ( tableName ) ; try { getClient ( ) . putItem ( request ) ; "<AssertPlaceHolder>" ; } catch ( com . amazonaws . AmazonServiceException ase ) { } } putItem ( com . amazonaws . services . dynamodb . model . PutItemRequest ) { com . amazonaws . http . ExecutionContext executionContext = createExecutionContext ( putItemRequest ) ; com . amazonaws . util . AWSRequestMetrics awsRequestMetrics = executionContext . getAwsRequestMetrics ( ) ; com . amazonaws . Request < com . amazonaws . services . dynamodb . model . PutItemRequest > request = marshall ( putItemRequest , new com . amazonaws . services . dynamodb . model . transform . PutItemRequestMarshaller ( ) , executionContext . getAwsRequestMetrics ( ) ) ; request . setAWSRequestMetrics ( awsRequestMetrics ) ; com . amazonaws . transform . Unmarshaller < com . amazonaws . services . dynamodb . model . PutItemResult , com . amazonaws . transform . JsonUnmarshallerContext > unmarshaller = new com . amazonaws . services . dynamodb . model . transform . PutItemResultJsonUnmarshaller ( ) ; com . amazonaws . http . JsonResponseHandler < com . amazonaws . services . dynamodb . model . PutItemResult > responseHandler = new com . amazonaws . http . JsonResponseHandler < com . amazonaws . services . dynamodb . model . PutItemResult > ( unmarshaller ) ; return invoke ( request , responseHandler , executionContext ) ; } | org . junit . Assert . assertTrue ( false ) |
is_list_of_strings_sorted_case_insensitive_in_java_with_guava ( ) { java . util . List < java . lang . String > secConferenceEast = com . google . common . collect . Lists . newArrayList ( "alabama" , "Alabama" , "ALABAMA" ) ; boolean isSorted = com . google . common . collect . Ordering . from ( String . CASE_INSENSITIVE_ORDER ) . isOrdered ( secConferenceEast ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( isSorted ) |
testExonicFivePrimeOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t58946502\t.\tN\t<INS:ME>\t.\t.\tSVTYPE=INS;END=58946502" ) ; final java . lang . String expected = "1\t58946502\t.\tN\t<INS:ME>\t.\t.\tEND=58946502;" + ( "SVANN=insertion&3_prime_UTR_exon_variant&mobile_element_insertion&structural_variant&" + "coding_transcript_variant|HIGH|OMA1|115209|transcript|NM_145243.3|Coding|;SVTYPE=INS" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testArmClusterAnalysis ( ) { com . hartwig . hmftools . svanalysis . analyser . SvTestHelper tester = new com . hartwig . hmftools . svanalysis . analyser . SvTestHelper ( ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 1000 , 1100 , 1 , ( - 1 ) , com . hartwig . hmftools . svanalysis . analyser . DEL , 2 , 2 , 1 , 1 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 1200 , 13020 , ( - 1 ) , ( - 1 ) , com . hartwig . hmftools . svanalysis . analyser . INV , 3 , 3 , 1 , 1 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 1400 , 9000 , ( - 1 ) , 1 , com . hartwig . hmftools . svanalysis . analyser . DUP , 4 , 3 , 1 , 1 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 5400 , ( - 1 ) , 1 , ( - 1 ) , com . hartwig . hmftools . svanalysis . analyser . SGL , 4 , 0 , 1 , 0 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 5600 , ( - 1 ) , ( - 1 ) , ( - 1 ) , com . hartwig . hmftools . svanalysis . analyser . SGL , 4 , 0 , 1 , 0 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 8600 , ( - 1 ) , 1 , ( - 1 ) , com . hartwig . hmftools . svanalysis . analyser . SGL , 4 , 0 , 1 , 0 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 16200 , ( - 1 ) , 1 , ( - 1 ) , com . hartwig . hmftools . svanalysis . analyser . SGL , 4 , 0 , 1 , 0 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 14200 , 18200 , ( - 1 ) , 1 , com . hartwig . hmftools . svanalysis . analyser . DUP , 4 , 3 , 1 , 1 , 1 , "" ) ) ; tester . AllVariants . add ( com . hartwig . hmftools . svanalysis . analyser . SvTestHelper . createTestSv ( tester . nextVarId ( ) , "1" , "1" , 18400 , 19000 , 1 , ( - 1 ) , com . hartwig . hmftools . svanalysis . analyser . DEL , 2 , 2 , 1 , 1 , 1 , "" ) ) ; tester . preClusteringInit ( ) ; tester . mergeOnProximity ( ) ; "<AssertPlaceHolder>" ; tester . Analyser . clusterAndAnalyse ( ) ; } getClusters ( ) { return mAnalyser . getClusters ( ) ; } | org . junit . Assert . assertEquals ( tester . getClusters ( ) . size ( ) , 1 ) |
shouldGetTopActivityClassName ( ) { createRunningTaskInfo ( ) . topActivity = new android . content . ComponentName ( com . navercorp . utilset . ui . ActivityUtilsTest . INSTALLED_PACKAGE , com . navercorp . utilset . ui . ActivityUtilsTest . TEST_ACTIVITY ) ; java . lang . String className = com . navercorp . utilset . ui . ActivityUtils . getTopActivityClassName ( context ) ; "<AssertPlaceHolder>" ; } getTopActivityClassName ( android . content . Context ) { android . content . ComponentName activity = com . navercorp . utilset . ui . ActivityUtils . getTopActivity ( context ) ; if ( activity == null ) { return null ; } return activity . getClassName ( ) ; } | org . junit . Assert . assertThat ( className , org . hamcrest . CoreMatchers . is ( com . navercorp . utilset . ui . ActivityUtilsTest . TEST_ACTIVITY ) ) |
testDateNotBetween ( ) { java . util . Set < java . lang . String > datesBetween = jsonExtractor . getDatesBetween ( "2019-01-01" , "2017-01-13" ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertEquals ( datesBetween . size ( ) , 0 ) |
testSearchCount ( ) { addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; long [ ] groupIds = new long [ ] { group . getGroupId ( ) , _group . getGroupId ( ) } ; int count = com . liferay . dynamic . data . mapping . service . DDMStructureServiceUtil . searchCount ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , groupIds , com . liferay . dynamic . data . mapping . service . test . DDMStructureServiceTest . _classNameId , StringPool . BLANK , WorkflowConstants . STATUS_ANY ) ; "<AssertPlaceHolder>" ; } getCompanyId ( ) { if ( ( com . liferay . portal . kernel . test . util . TestPropsValues . _companyId ) > 0 ) { return com . liferay . portal . kernel . test . util . TestPropsValues . _companyId ; } com . liferay . portal . kernel . model . Company company = com . liferay . portal . kernel . service . CompanyLocalServiceUtil . getCompanyByWebId ( com . liferay . portal . kernel . test . util . TestPropsValues . COMPANY_WEB_ID ) ; com . liferay . portal . kernel . test . util . TestPropsValues . _companyId = company . getCompanyId ( ) ; return com . liferay . portal . kernel . test . util . TestPropsValues . _companyId ; } | org . junit . Assert . assertEquals ( 3 , count ) |
testParseNoTag ( ) { java . util . Map < java . lang . String , java . lang . Long > data = sut2 . parse ( "888" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . lang . String [ ] stringArray = toParse . split ( org . eurekastreams . server . domain . CollectionFormat . DELIMITER ) ; java . util . ArrayList < java . lang . String > strings = new java . util . ArrayList < java . lang . String > ( ) ; for ( java . lang . String stringName : stringArray ) { java . lang . String name = stringName . trim ( ) ; if ( ( name . length ( ) ) > 0 ) { strings . add ( name ) ; } } return strings ; } | org . junit . Assert . assertNull ( data ) |
testTrashGrandparentBaseModelIsNotVisible ( ) { org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenHasGrandParent ) ) ; org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsAssetableBaseModel ) ) ; com . liferay . trash . test . util . WhenHasParent whenHasParent = ( ( com . liferay . trash . test . util . WhenHasParent ) ( this ) ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( group . getGroupId ( ) ) ; com . liferay . portal . kernel . model . BaseModel < ? > grandparentBaseModel = getParentBaseModel ( group , serviceContext ) ; com . liferay . portal . kernel . model . BaseModel < ? > parentBaseModel = getParentBaseModel ( group , ( ( java . lang . Long ) ( grandparentBaseModel . getPrimaryKeyObj ( ) ) ) , serviceContext ) ; baseModel = addBaseModel ( parentBaseModel , serviceContext ) ; whenHasParent . moveParentBaseModelToTrash ( ( ( java . lang . Long ) ( grandparentBaseModel . getPrimaryKeyObj ( ) ) ) ) ; com . liferay . trash . test . util . WhenIsAssetableBaseModel whenIsAssetableModel = ( ( com . liferay . trash . test . util . WhenIsAssetableBaseModel ) ( this ) ) ; "<AssertPlaceHolder>" ; } isAssetEntryVisible ( com . liferay . portal . kernel . model . ClassedModel , long ) { com . liferay . message . boards . model . MBMessage rootMessage = com . liferay . message . boards . service . MBMessageLocalServiceUtil . getMBMessage ( ( ( com . liferay . message . boards . model . MBThread ) ( classedModel ) ) . getRootMessageId ( ) ) ; return _whenIsAssetable . isAssetEntryVisible ( rootMessage , getAssetClassPK ( rootMessage ) ) ; } | org . junit . Assert . assertFalse ( whenIsAssetableModel . isAssetEntryVisible ( baseModel , getAssetClassPK ( baseModel ) ) ) |
isAvailableType_A$String$Configuration_false ( ) { org . junithelper . core . meta . ClassMeta classMeta = new org . junithelper . core . meta . ClassMeta ( ) ; org . junithelper . core . extractor . AvailableTypeDetector target = new org . junithelper . core . extractor . AvailableTypeDetector ( classMeta ) ; java . lang . String typeName = "org.juithelper.core.Version" ; org . junithelper . core . config . Configuration config = new org . junithelper . core . config . Configuration ( ) ; boolean actual = target . isAvailableType ( typeName , config ) ; boolean expected = false ; "<AssertPlaceHolder>" ; } isAvailableType ( java . lang . String , org . junithelper . core . config . Configuration ) { if ( typeName == null ) { return false ; } boolean isTypeAvailable = false ; java . lang . String [ ] packageArr = typeName . split ( "\\." ) ; java . lang . String packageName = null ; if ( ( packageArr . length ) > 1 ) { packageName = typeName . replaceFirst ( "\\.[^\\.]+$" , StringValue . Empty ) ; } for ( java . lang . String imported : classMeta . importedList ) { if ( ( packageName != null ) && ( imported . equals ( typeName ) ) ) { return true ; } else if ( imported . matches ( ( ( ".+\\." + typeName ) + "$" ) ) ) { return true ; } } try { java . lang . Class . forName ( ( "java.lang." + typeName ) ) ; isTypeAvailable = true ; } catch ( java . lang . Exception ignore ) { if ( ( config != null ) && ( packageName != null ) ) { java . lang . String searchPath = ( ( config . directoryPathOfProductSourceCode ) + "/" ) + ( packageName . replaceAll ( "\\." , "/" ) ) ; try { java . util . List < java . io . File > files = org . junithelper . core . file . FileSearcherFactory . create ( ) . searchFilesRecursivelyByName ( searchPath , ( typeName + ( RegExp . FileExtension . JavaFile ) ) ) ; if ( ( files != null ) && ( ( files . size ( ) ) > 0 ) ) { isTypeAvailable = true ; } } catch ( java . lang . Exception e ) { org . junithelper . core . util . Stderr . p ( ( ( ( e . getLocalizedMessage ( ) ) + "<sp>-<sp>" ) + searchPath ) ) ; } } } return isTypeAvailable ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testRemoveTagFromLiveDataObjectByDomain ( ) { java . lang . String testFileName = "testRemoveTagFromLiveDataObjectByDomain.txt" ; java . lang . String expectedTagName = "testRemoveTagFromLiveDataObjectByDomain" ; java . lang . String targetIrodsCollection = org . irods . jargon . usertagging . IRODSTaggingServiceTest . testingPropertiesHelper . buildIRODSCollectionAbsolutePathFromTestProperties ( org . irods . jargon . usertagging . IRODSTaggingServiceTest . testingProperties , org . irods . jargon . usertagging . IRODSTaggingServiceTest . IRODS_TEST_SUBDIR_PATH ) ; java . lang . String targetIrodsDataObject = ( targetIrodsCollection + "/" ) + testFileName ; java . lang . String absPath = org . irods . jargon . usertagging . IRODSTaggingServiceTest . scratchFileUtils . createAndReturnAbsoluteScratchPath ( org . irods . jargon . usertagging . IRODSTaggingServiceTest . IRODS_TEST_SUBDIR_PATH ) ; java . lang . String fileNameOrig = org . irods . jargon . testutils . filemanip . FileGenerator . generateFileOfFixedLengthGivenName ( absPath , testFileName , 2 ) ; org . irods . jargon . core . connection . IRODSAccount irodsAccount = org . irods . jargon . usertagging . IRODSTaggingServiceTest . testingPropertiesHelper . buildIRODSAccountFromTestProperties ( org . irods . jargon . usertagging . IRODSTaggingServiceTest . testingProperties ) ; org . irods . jargon . usertagging . domain . IRODSTagValue irodsTagValue = new org . irods . jargon . usertagging . domain . IRODSTagValue ( expectedTagName , irodsAccount . getUserName ( ) ) ; org . irods . jargon . core . pub . io . IRODSFile targetIrodsFile = org . irods . jargon . usertagging . IRODSTaggingServiceTest . irodsFileSystem . getIRODSFileFactory ( irodsAccount ) . instanceIRODSFile ( targetIrodsCollection ) ; org . irods . jargon . core . pub . DataTransferOperations dataTransferOperationsAO = org . irods . jargon . usertagging . IRODSTaggingServiceTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) . getDataTransferOperations ( irodsAccount ) ; dataTransferOperationsAO . putOperation ( new java . io . File ( fileNameOrig ) , targetIrodsFile , null , null ) ; org . irods . jargon . usertagging . tags . IRODSTaggingService irodsTaggingService = org . irods . jargon . usertagging . tags . IRODSTaggingServiceImpl . instance ( org . irods . jargon . usertagging . IRODSTaggingServiceTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) , irodsAccount ) ; irodsTaggingService . addTagToDataObject ( targetIrodsDataObject , irodsTagValue ) ; irodsTaggingService . removeTagFromGivenDomain ( irodsTagValue , MetadataDomain . DATA , targetIrodsDataObject ) ; "<AssertPlaceHolder>" ; } getTagsOnDataObject ( java . lang . String ) { if ( ( dataObjectAbsolutePath == null ) || ( dataObjectAbsolutePath . isEmpty ( ) ) ) { throw new org . irods . jargon . core . exception . JargonException ( "null<sp>or<sp>empty<sp>dataObjectAbsolutepath" ) ; } org . irods . jargon . usertagging . tags . IRODSTaggingServiceImpl . log . info ( "getTagsOnDataObject:{}" , dataObjectAbsolutePath ) ; java . util . List < org . irods . jargon . core . query . AVUQueryElement > avuQueryElements = new java . util . ArrayList ( ) ; try { avuQueryElements . add ( org . irods . jargon . core . query . AVUQueryElement . instanceForValueQuery ( AVUQueryPart . UNITS , QueryConditionOperators . EQUAL , UserTaggingConstants . TAG_AVU_UNIT ) ) ; avuQueryElements . add ( org . irods . jargon . core . query . AVUQueryElement . instanceForValueQuery ( AVUQueryPart . VALUE , QueryConditionOperators . EQUAL , getIrodsAccount ( ) . getUserName ( ) ) ) ; } catch ( org . irods . jargon . core . query . JargonQueryException e ) { org . irods . jargon . usertagging . tags . IRODSTaggingServiceImpl . log . error ( "error<sp>on<sp>metadata<sp>query,<sp>rethrow<sp>as<sp>JargonException" , e ) ; throw new org . irods . jargon . core . exception . JargonException ( e ) ; } org . irods . jargon . core . pub . DataObjectAO dataObjectAO = irodsAccessObjectFactory . getDataObjectAO ( irodsAccount ) ; org . irods . jargon . core . pub . io . IRODSFile dataFile = irodsAccessObjectFactory . getIRODSFileFactory ( irodsAccount ) . instanceIRODSFile ( dataObjectAbsolutePath ) ; java . util . List < org . irods . jargon . core . query . MetaDataAndDomainData > queryResults ; try { queryResults = dataObjectAO . findMetadataValuesForDataObjectUsingAVUQuery ( avuQueryElements , dataFile . getParent ( ) , dataFile . getName ( ) ) ; } catch ( org . irods . jargon . core . exception . FileNotFoundException fnf ) { throw new org . irods . jargon . core . exception . DataNotFoundException ( "file<sp>not<sp>found<sp>querying<sp>for<sp>data" , fnf ) ; } catch ( org . irods . jargon . core . query . JargonQueryException e ) { org . irods . jargon . usertagging . tags . IRODSTaggingServiceImpl . log . error ( "error<sp>on<sp>metadata<sp>query,<sp>rethrow<sp>as<sp>JargonException" , e ) ; throw new org . irods . jargon . core . exception . JargonException ( e ) ; } org . irods . jargon . usertagging . tags . IRODSTaggingServiceImpl . log . debug ( "got<sp>results<sp>from<sp>query:{},<sp>process<sp>as<sp>tag<sp>objects" , queryResults ) ; java . util . List < org . irods . jargon . usertagging . domain . IRODSTagValue > resultValues = new java . util . ArrayList ( ) ; for ( org . irods . jargon . core . query . MetaDataAndDomainData metadataAndDomainData : queryResults ) { resultValues . add ( new org . irods . jargon . usertagging . domain . IRODSTagValue ( metadataAndDomainData ) ) ; } return resultValues ; } | org . junit . Assert . assertEquals ( 0 , irodsTaggingService . getTagsOnDataObject ( targetIrodsDataObject ) . size ( ) ) |
decodeExtended ( ) { final java . io . ByteArrayInputStream stream = new java . io . ByteArrayInputStream ( extended ) ; final com . flagstone . transform . coder . SWFDecoder decoder = new com . flagstone . transform . coder . SWFDecoder ( stream ) ; fixture = new com . flagstone . transform . image . DefineJPEGImage ( decoder ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( fixture ) |
cacheTest ( ) { com . ebay . cloud . cms . utils . ExpirableCache < java . lang . String > cache = new com . ebay . cloud . cms . utils . ExpirableCache < java . lang . String > ( 100 , 60 ) ; for ( java . lang . String i : c ) { cache . putObject ( i , i ) ; } for ( java . lang . String i : c ) { java . lang . String o = cache . getObject ( i ) ; "<AssertPlaceHolder>" ; } } getObject ( java . lang . String ) { checkNotNull ( name ) ; com . ebay . cloud . cms . utils . CacheEntry < T > entry = cache . get ( name ) ; if ( entry == null ) { return null ; } long now = java . lang . System . currentTimeMillis ( ) ; if ( ( now - ( entry . getLastModified ( ) ) ) > ( timeToLive ) ) { return null ; } return entry . getValue ( ) ; } | org . junit . Assert . assertTrue ( ( o == ( c [ java . lang . Integer . valueOf ( o ) ] ) ) ) |
PropertyTypeEdmDateTime ( ) { final java . lang . String time = ( "/Date(" + ( com . fujitsu . dc . core . utils . ODataUtils . DATETIME_MIN ) ) + ")/" ; org . json . simple . JSONObject body = new org . json . simple . JSONObject ( ) ; body . put ( "__id" , com . fujitsu . dc . test . jersey . box . odatacol . UserDataPropertyDateTimeTest . USERDATA_ID ) ; body . put ( com . fujitsu . dc . test . jersey . box . odatacol . UserDataPropertyDateTimeTest . PROP_NAME , time ) ; try { createEntities ( ) ; createProperty ( EdmSimpleType . DATETIME . getFullyQualifiedTypeName ( ) ) ; com . fujitsu . dc . test . utils . TResponse response = createUserData ( body , HttpStatus . SC_CREATED , cellName , boxName , com . fujitsu . dc . test . jersey . box . odatacol . UserDataPropertyDateTimeTest . COL_NAME , com . fujitsu . dc . test . jersey . box . odatacol . UserDataPropertyDateTimeTest . ENTITY_TYPE_NAME ) ; org . json . simple . JSONObject getJson = response . bodyAsJson ( ) ; org . json . simple . JSONObject getResults = ( ( org . json . simple . JSONObject ) ( ( ( org . json . simple . JSONObject ) ( getJson . get ( "d" ) ) ) . get ( "results" ) ) ) ; java . lang . String getValue = ( ( java . lang . String ) ( getResults . get ( com . fujitsu . dc . test . jersey . box . odatacol . UserDataPropertyDateTimeTest . PROP_NAME ) ) ) ; "<AssertPlaceHolder>" ; } finally { deleteUserData ( com . fujitsu . dc . test . jersey . box . odatacol . UserDataPropertyDateTimeTest . USERDATA_ID ) ; deleteProperty ( ) ; deleteEntities ( ) ; } } validateDateTime ( java . lang . String ) { try { if ( Common . SYSUTCDATETIME . equals ( value ) ) { return true ; } java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( "^/Date\\((.+)\\)/$" ) ; java . util . regex . Matcher match = pattern . matcher ( value ) ; if ( match . matches ( ) ) { java . lang . String date = match . replaceAll ( "$1" ) ; long longDate = java . lang . Long . parseLong ( date ) ; if ( ( longDate < ( com . fujitsu . dc . core . utils . ODataUtils . DATETIME_MIN ) ) || ( longDate > ( com . fujitsu . dc . core . utils . ODataUtils . DATETIME_MAX ) ) ) { return false ; } return true ; } return false ; } catch ( java . lang . NumberFormatException e ) { return false ; } } | org . junit . Assert . assertTrue ( com . fujitsu . dc . core . utils . ODataUtils . validateDateTime ( getValue ) ) |
getHadoopShim ( ) { org . pentaho . hadoop . shim . spi . HadoopShim hadoopShim = new org . pentaho . hadoop . shim . spi . MockHadoopShim ( ) ; org . pentaho . hadoop . shim . HadoopConfiguration c = new org . pentaho . hadoop . shim . HadoopConfiguration ( org . apache . commons . vfs2 . VFS . getManager ( ) . resolveFile ( "ram:///" ) , "id" , "name" , hadoopShim ) ; "<AssertPlaceHolder>" ; } getHadoopVersion ( ) { return null ; } | org . junit . Assert . assertEquals ( hadoopShim . getHadoopVersion ( ) , c . getHadoopShim ( ) . getHadoopVersion ( ) ) |
testCreateYieldsEqualsInstances_02 ( ) { org . eclipse . emf . common . util . URI doesNotExist = myProjectURI . trimSegments ( 1 ) . appendSegment ( "doesNotExist" ) ; org . eclipse . n4js . projectModel . IN4JSProject first = getN4JSCore ( ) . create ( doesNotExist ) ; org . eclipse . n4js . projectModel . IN4JSProject second = getN4JSCore ( ) . create ( doesNotExist ) ; "<AssertPlaceHolder>" ; } create ( org . eclipse . emf . ecore . EClass ) { switch ( eClass . getClassifierID ( ) ) { case ImPackage . SCRIPT_IM : return createScript_IM ( ) ; case ImPackage . SYMBOL_TABLE : return createSymbolTable ( ) ; case ImPackage . SYMBOL_TABLE_ENTRY_ORIGINAL : return createSymbolTableEntryOriginal ( ) ; case ImPackage . SYMBOL_TABLE_ENTRY_IM_ONLY : return createSymbolTableEntryIMOnly ( ) ; case ImPackage . SYMBOL_TABLE_ENTRY_INTERNAL : return createSymbolTableEntryInternal ( ) ; case ImPackage . IDENTIFIER_REF_IM : return createIdentifierRef_IM ( ) ; case ImPackage . PARAMETERIZED_PROPERTY_ACCESS_EXPRESSION_IM : return createParameterizedPropertyAccessExpression_IM ( ) ; case ImPackage . PARAMETERIZED_TYPE_REF_IM : return createParameterizedTypeRef_IM ( ) ; case ImPackage . PARAMETERIZED_TYPE_REF_STRUCTURAL_IM : return createParameterizedTypeRefStructural_IM ( ) ; case ImPackage . SNIPPET : return createSnippet ( ) ; case ImPackage . DELEGATING_GETTER_DECLARATION : return createDelegatingGetterDeclaration ( ) ; case ImPackage . DELEGATING_SETTER_DECLARATION : return createDelegatingSetterDeclaration ( ) ; case ImPackage . DELEGATING_METHOD_DECLARATION : return createDelegatingMethodDeclaration ( ) ; case ImPackage . STRING_LITERAL_FOR_STE : return createStringLiteralForSTE ( ) ; case ImPackage . VERSIONED_PARAMETERIZED_TYPE_REF_IM : return createVersionedParameterizedTypeRef_IM ( ) ; case ImPackage . VERSIONED_PARAMETERIZED_TYPE_REF_STRUCTURAL_IM : return createVersionedParameterizedTypeRefStructural_IM ( ) ; case ImPackage . VERSIONED_IDENTIFIER_REF_IM : return createVersionedIdentifierRef_IM ( ) ; case ImPackage . VERSIONED_NAMED_IMPORT_SPECIFIER_IM : return createVersionedNamedImportSpecifier_IM ( ) ; default : throw new java . lang . IllegalArgumentException ( ( ( "The<sp>class<sp>'" + ( eClass . getName ( ) ) ) + "'<sp>is<sp>not<sp>a<sp>valid<sp>classifier" ) ) ; } } | org . junit . Assert . assertEquals ( first , second ) |
getEditorByTitleRegexTest ( ) { org . eclipse . reddeer . eclipse . jdt . ui . packageview . PackageExplorerPart packageExplorer = new org . eclipse . reddeer . eclipse . jdt . ui . packageview . PackageExplorerPart ( ) ; packageExplorer . open ( ) ; packageExplorer . getProject ( org . eclipse . reddeer . workbench . test . editor . EditorTest . PROJECT_NAME ) . getProjectItem ( "editorTest+.min" ) . open ( ) ; org . eclipse . reddeer . workbench . impl . editor . DefaultEditor editor = new org . eclipse . reddeer . workbench . impl . editor . DefaultEditor ( "editorTest+.min" ) ; "<AssertPlaceHolder>" ; } open ( ) { if ( ( getOpenAction ( ) ) == null ) { throw new org . eclipse . reddeer . jface . exception . JFaceLayerException ( "Unable<sp>to<sp>open<sp>window<sp>because<sp>open<sp>action<sp>is<sp>not<sp>defined" ) ; } if ( ! ( isOpen ( ) ) ) { getOpenAction ( ) . run ( ) ; setShell ( new org . eclipse . reddeer . swt . impl . shell . DefaultShell ( getOpenAction ( ) . getShellMatchers ( ) ) ) ; } } | org . junit . Assert . assertNotNull ( editor ) |
getPatternName ( ) { pattern = new com . alibaba . citrus . turbine . auth . impl . AuthActionPattern ( "test" ) ; "<AssertPlaceHolder>" ; } getPatternName ( ) { return patternName ; } | org . junit . Assert . assertEquals ( "test" , pattern . getPatternName ( ) ) |
generateTitle ( ) { "<AssertPlaceHolder>" ; } generateTitle ( ) { org . junit . Assert . assertEquals ( "[][XPipe<sp>]" , decorator . generateTitle ( ) ) ; } | org . junit . Assert . assertEquals ( "[][XPipe<sp>]" , decorator . generateTitle ( ) ) |
testRestrictedEndpointWhenRelativePathEndsWithContainerId ( ) { final io . undertow . server . HttpServerExchange exchange = makeHttpServerExchange ( "/scanner" , "POST" ) ; final java . lang . String containerId = "containerId" ; final boolean isRestricted = restrictionPolicy . restrictedEndpoint ( exchange , containerId ) ; "<AssertPlaceHolder>" ; } restrictedEndpoint ( io . undertow . server . HttpServerExchange , java . lang . String ) { final java . lang . String relativePath = exchange . getRelativePath ( ) ; final boolean isReadOnlyRequest = isGet ( exchange . getRequestMethod ( ) ) ; final boolean isContainerResource = relativePath . endsWith ( ( "/containers/" + containerId ) ) ; final boolean isScannerResource = relativePath . endsWith ( "/scanner" ) ; final boolean isReleaseIdResource = relativePath . endsWith ( "/release-id" ) ; if ( ( ! isReadOnlyRequest ) && ( ( isContainerResource || isScannerResource ) || isReleaseIdResource ) ) { return true ; } return false ; } | org . junit . Assert . assertTrue ( isRestricted ) |
testGetAvgCharWidthUsesEstimationForUnknownStrings ( ) { float determined = org . eclipse . rap . rwt . internal . textsize . TextSizeUtil . getAvgCharWidth ( getFont ( ) ) ; float estimated = org . eclipse . rap . rwt . internal . textsize . TextSizeEstimation . getAvgCharWidth ( getFont ( ) ) ; "<AssertPlaceHolder>" ; } getFont ( ) { return new org . eclipse . swt . graphics . Font ( display , org . eclipse . rap . rwt . internal . textsize . TextSizeUtil_Test . FONT_DATA ) ; } | org . junit . Assert . assertEquals ( estimated , determined , 0 ) |
testDebugobject ( ) { redis1 . set ( key , value ) ; java . lang . String r = redis1 . debugobject ( key ) ; "<AssertPlaceHolder>" ; System . out . println ( java . lang . String . format ( "[CRAFT-ATOM-REDIS]<sp>(^_^)<sp><%s><sp>Case<sp>-><sp>test<sp>debugobject.<sp>" , io . craft . atom . test . CaseCounter . incr ( 1 ) ) ) ; } debugobject ( java . lang . String ) { return master ( ) . debugobject ( key ) ; } | org . junit . Assert . assertNotNull ( r ) |
annotationsShouldNotBeShownInXWiki10Syntax ( ) { getUtil ( ) . loginAsAdmin ( ) ; getUtil ( ) . deletePage ( getTestClassName ( ) , getTestMethodName ( ) ) ; org . xwiki . annotation . test . po . AnnotatableViewPage annotatableViewPage = new org . xwiki . annotation . test . po . AnnotatableViewPage ( getUtil ( ) . createPage ( getTestClassName ( ) , getTestMethodName ( ) , "#set<sp>($showannotations<sp>=<sp>false)\nSome<sp>content" , "AnnotationsTest<sp>in<sp>XWiki<sp>1.0<sp>Syntax" , "xwiki/1.0" ) ) ; annotatableViewPage . showAnnotationsPane ( ) ; "<AssertPlaceHolder>" ; annotatableViewPage . simulateCTRL_M ( ) ; annotatableViewPage . waitforAnnotationWarningNotification ( ) ; } checkIfAnnotationsAreDisabled ( ) { if ( ( getDriver ( ) . findElementsWithoutWaiting ( org . openqa . selenium . By . id ( "annotationsdisplay" ) ) . size ( ) ) > 0 ) { return false ; } else { return true ; } } | org . junit . Assert . assertTrue ( annotatableViewPage . checkIfAnnotationsAreDisabled ( ) ) |
testCompareToDiffSigns1 ( ) { byte [ ] aBytes = new byte [ ] { 12 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 3 , - 15 , 35 , 26 , 3 , 91 } ; byte [ ] bBytes = new byte [ ] { 10 , 20 , 30 , 40 , 50 , 60 , 70 , 10 , 20 , 30 } ; int aSign = 1 ; int bSign = - 1 ; java . math . BigInteger aNumber = new java . math . BigInteger ( aSign , aBytes ) ; java . math . BigInteger bNumber = new java . math . BigInteger ( bSign , bBytes ) ; "<AssertPlaceHolder>" ; } compareTo ( org . teavm . classlib . java . lang . TBoolean ) { return org . teavm . classlib . java . lang . TBoolean . compare ( value , other . value ) ; } | org . junit . Assert . assertEquals ( 1 , aNumber . compareTo ( bNumber ) ) |
versionComparatorTest2 ( ) { int compare = VersionComparator . INSTANCE . compare ( "1.12.1" , "1.12.1c" ) ; "<AssertPlaceHolder>" ; } compare ( java . lang . String , java . lang . String ) { if ( version1 == version2 ) { return 0 ; } if ( ( version1 == null ) && ( version2 == null ) ) { return 0 ; } else if ( version1 == null ) { return - 1 ; } else if ( version2 == null ) { return 1 ; } final java . util . List < java . lang . String > v1s = cn . hutool . core . util . StrUtil . split ( version1 , CharUtil . DOT ) ; final java . util . List < java . lang . String > v2s = cn . hutool . core . util . StrUtil . split ( version2 , CharUtil . DOT ) ; int diff = 0 ; int minLength = java . lang . Math . min ( v1s . size ( ) , v2s . size ( ) ) ; java . lang . String v1 ; java . lang . String v2 ; for ( int i = 0 ; i < minLength ; i ++ ) { v1 = v1s . get ( i ) ; v2 = v2s . get ( i ) ; diff = ( v1 . length ( ) ) - ( v2 . length ( ) ) ; if ( 0 == diff ) { diff = v1 . compareTo ( v2 ) ; } if ( diff != 0 ) { break ; } } return diff != 0 ? diff : ( v1s . size ( ) ) - ( v2s . size ( ) ) ; } | org . junit . Assert . assertTrue ( ( compare < 0 ) ) |
cannotGet6App1 ( ) { final org . openqa . grid . internal . GridRegistry registry = org . openqa . grid . internal . DefaultGridRegistry . newInstance ( new org . openqa . grid . web . Hub ( new org . openqa . grid . internal . utils . configuration . GridHubConfiguration ( ) ) ) ; org . openqa . grid . internal . RemoteProxy p1 = new org . openqa . grid . internal . BaseRemoteProxy ( req , registry ) ; try { registry . add ( p1 ) ; final java . util . concurrent . atomic . AtomicInteger count = new java . util . concurrent . atomic . AtomicInteger ( ) ; org . openqa . grid . internal . TestThreadCounter testThreadCounter = new org . openqa . grid . internal . TestThreadCounter ( ) ; for ( int i = 0 ; i < 6 ; i ++ ) { testThreadCounter . start ( ( ) -> { org . openqa . grid . web . servlet . handler . RequestHandler newSessionRequest = org . openqa . grid . internal . mock . GridHelper . createNewSessionHandler ( registry , app1 ) ; newSessionRequest . process ( ) ; count . incrementAndGet ( ) ; } ) ; } testThreadCounter . waitUntilDone ( 5 ) ; "<AssertPlaceHolder>" ; } finally { registry . stop ( ) ; } } get ( ) { throw new java . lang . UnsupportedOperationException ( "Cowardly<sp>refusing<sp>to<sp>create<sp>a<sp>new<sp>WebDriver" ) ; } | org . junit . Assert . assertEquals ( 5 , count . get ( ) ) |
geenDatumIngang ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangBijhoudingsautorisatie toegang = new nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangBijhoudingsautorisatie ( new nl . bzk . algemeenbrp . dal . domein . brp . entity . PartijRol ( new nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij ( "partij1" , "000001" ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Rol . AFNEMER ) , new nl . bzk . algemeenbrp . dal . domein . brp . entity . Bijhoudingsautorisatie ( false ) ) ; "<AssertPlaceHolder>" ; } errorCount ( nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie ) { final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "toegang" ) ; subject . validate ( toegang , errors ) ; return errors . getErrorCount ( ) ; } | org . junit . Assert . assertEquals ( 1 , errorCount ( toegang ) ) |
clusterNewScalingRuleLimitTest ( ) { initData ( ) ; when ( mockScalingRuleService . getRule ( 1 ) ) . thenReturn ( rule ) ; when ( mockClusterService . getCluster ( 1 ) ) . thenReturn ( cluster ) ; when ( mockHealthMonitoringService . getClusterLoad ( machine , PeriodicAutoscalerItemProcessor . METRIC_NAMES , PeriodicAutoscalerItemProcessor . METRIC_TYPE_LOAD , PeriodicAutoscalerItemProcessor . METRIC_PERIOD ) ) . thenReturn ( ( ( float ) ( 1 ) ) ) ; when ( mockScalingRuleService . applyScalingRule ( 1 , 1 , rule ) ) . thenReturn ( ScalingStatus . ERROR_SCALING_RULE_LIMIT ) ; org . openinfinity . cloud . autoscaler . periodicautoscaler . ClusterProcessingState clusterProcessingState = new org . openinfinity . cloud . autoscaler . periodicautoscaler . ClusterProcessingState ( 0 , false , false , false , false , false ) ; itemProcessor . getProcessingStatusMap ( ) . put ( 1 , clusterProcessingState ) ; org . openinfinity . cloud . autoscaler . util . ScalingData sd = new org . openinfinity . cloud . autoscaler . util . ScalingData ( 1 , cluster , rule ) ; org . openinfinity . cloud . autoscaler . test . Job job = itemProcessor . process ( machine ) ; "<AssertPlaceHolder>" ; verify ( notifier , times ( 1 ) ) . notify ( sd , Notifier . NotificationType . SCALING_RULE_LIMIT ) ; } | org . junit . Assert . assertNull ( job ) |
testSetOutboundPassthruMode ( ) { gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry registry = gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . getInstance ( ) ; gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum serviceName = gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum . AdminDistribution ; gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum direction = gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum . Outbound ; boolean status = true ; gov . hhs . fha . nhinc . admindistribution . configuration . jmx . AdminDistribution20WebServices adminDist20 = mock ( gov . hhs . fha . nhinc . admindistribution . configuration . jmx . AdminDistribution20WebServices . class ) ; when ( adminDist20 . getServiceName ( ) ) . thenReturn ( serviceEnum . AdminDistribution ) ; when ( adminDist20 . isOutboundPassthru ( ) ) . thenReturn ( status ) ; registry . registerWebServiceMXBean ( adminDist20 ) ; boolean passthru = registry . isPassthru ( serviceName , direction ) ; "<AssertPlaceHolder>" ; } isPassthru ( gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum , gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum ) { boolean passthruMode = false ; for ( gov . hhs . fha . nhinc . configuration . jmx . WebServicesMXBean b : registeredBeans ) { if ( ( ( gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . isInbound ( direction ) ) && ( b . getServiceName ( ) . equals ( serviceName ) ) ) && ( b . isInboundPassthru ( ) ) ) { passthruMode = true ; } if ( ( ( gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . isOutbound ( direction ) ) && ( b . getServiceName ( ) . equals ( serviceName ) ) ) && ( b . isOutboundPassthru ( ) ) ) { passthruMode = true ; } } return passthruMode ; } | org . junit . Assert . assertEquals ( true , passthru ) |
testGetTokenParameterTransformer ( ) { "<AssertPlaceHolder>" ; } getTokenParameterTransformer ( ) { return new org . togglz . spring . activation . TokenTransformer ( ) { @ org . togglz . spring . activation . Override public java . lang . String transform ( java . lang . String value ) { return value . toLowerCase ( ) ; } } ; } | org . junit . Assert . assertNull ( strategy . getTokenParameterTransformer ( ) ) |
testGetVarName ( ) { System . out . println ( "getVarName" ) ; kg . apc . jmeter . modifiers . RawRequestSourcePreProcessor instance = new kg . apc . jmeter . modifiers . RawRequestSourcePreProcessor ( ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getVarName ( ) ; "<AssertPlaceHolder>" ; } getVarName ( ) { return getPropertyAsString ( kg . apc . jmeter . modifiers . FifoPopPreProcessor . variableName ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testDecimalArrayModification ( ) { org . apache . ignite . internal . binary . mutabletest . GridBinaryTestClasses . TestObjectAllTypes obj = new org . apache . ignite . internal . binary . mutabletest . GridBinaryTestClasses . TestObjectAllTypes ( ) ; obj . bdArr = new java . math . BigDecimal [ ] { new java . math . BigDecimal ( 1000 ) , new java . math . BigDecimal ( 1000 ) , new java . math . BigDecimal ( 1000 ) } ; org . apache . ignite . internal . binary . builder . BinaryObjectBuilderImpl mutObj = wrap ( obj ) ; java . math . BigDecimal [ ] arr = mutObj . getField ( "bdArr" ) ; arr [ 0 ] = new java . math . BigDecimal ( 2000 ) ; org . apache . ignite . internal . binary . mutabletest . GridBinaryTestClasses . TestObjectAllTypes res = mutObj . build ( ) . deserialize ( ) ; "<AssertPlaceHolder>" ; } deserialize ( ) { return ( ( T ) ( deserializeValue ( ) ) ) ; } | org . junit . Assert . assertArrayEquals ( new java . math . BigDecimal [ ] { new java . math . BigDecimal ( 1000 ) , new java . math . BigDecimal ( 1000 ) , new java . math . BigDecimal ( 1000 ) } , res . bdArr ) |
testStoreWithFilterReturnsTrue ( ) { final java . nio . file . PathMatcher filter = org . mockito . Mockito . mock ( java . nio . file . PathMatcher . class ) ; org . mockito . Mockito . when ( entry . store ( org . mockito . Mockito . eq ( true ) , org . mockito . Mockito . same ( filter ) ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( entry ) . store ( org . mockito . Mockito . eq ( true ) , org . mockito . Mockito . same ( filter ) ) ; } store ( org . codice . ddf . util . function . BiThrowingConsumer ) { org . apache . commons . lang . Validate . notNull ( consumer , "invalid<sp>null<sp>consumer" ) ; if ( ( stored ) == null ) { this . stored = false ; try ( final java . io . OutputStream os = getOutputStream ( ) ) { this . stored = getReport ( ) . wasIOSuccessful ( ( ) -> consumer . accept ( getReport ( ) , os ) ) ; } catch ( org . codice . ddf . configuration . migration . ExportIOException e ) { throw newError ( org . codice . ddf . configuration . migration . ExportMigrationEntryImpl . FAILED_TO_BE_EXPORTED , e . getCause ( ) ) ; } catch ( java . io . IOException e ) { getReport ( ) . record ( newError ( org . codice . ddf . configuration . migration . ExportMigrationEntryImpl . FAILED_TO_BE_EXPORTED , e ) ) ; } catch ( org . codice . ddf . migration . MigrationException e ) { throw e ; } } return stored ; } | org . junit . Assert . assertThat ( entry . store ( filter ) , org . hamcrest . Matchers . equalTo ( true ) ) |
shouldMapCreatLB ( ) { org . openstack . atlas . service . domain . usage . entities . LoadBalancerHostUsage mappedUsage ; java . util . Calendar now = java . util . Calendar . getInstance ( ) ; org . openstack . atlas . service . domain . entities . LoadBalancerJoinVip jv = new org . openstack . atlas . service . domain . entities . LoadBalancerJoinVip ( ) ; java . util . Set < org . openstack . atlas . service . domain . entities . LoadBalancerJoinVip > jvs = new java . util . HashSet < org . openstack . atlas . service . domain . entities . LoadBalancerJoinVip > ( ) ; jvs . add ( jv ) ; lb . setLoadBalancerJoinVipSet ( jvs ) ; usageEventMapper = new org . openstack . atlas . usagerefactor . processor . mapper . UsageEventMapper ( lb , false , snmpUsage , org . openstack . atlas . service . domain . events . UsageEvent . CREATE_LOADBALANCER , now ) ; mappedUsage = usageEventMapper . mapSnmpUsageToUsageEvent ( ) ; "<AssertPlaceHolder>" ; } getTagsBitmask ( ) { return tagsBitmask ; } | org . junit . Assert . assertEquals ( 0 , mappedUsage . getTagsBitmask ( ) ) |
readFullFile ( ) { long length = ( ( alluxio . client . block . stream . GrpcDataReaderTest . CHUNK_SIZE ) * 1024 ) + ( ( alluxio . client . block . stream . GrpcDataReaderTest . CHUNK_SIZE ) / 3 ) ; try ( alluxio . client . block . stream . DataReader reader = create ( 0 , length ) ) { long checksum = setReadResponses ( mClient , length , 0 , ( length - 1 ) ) ; long checksumActual = checkChunks ( reader , 0 , length ) ; "<AssertPlaceHolder>" ; } validateReadRequestSent ( mClient , 0 , length , true , alluxio . client . block . stream . GrpcDataReaderTest . CHUNK_SIZE ) ; } checkChunks ( alluxio . client . block . stream . DataReader , long , long ) { long pos = 0 ; long checksum = 0 ; while ( true ) { alluxio . network . protocol . databuffer . DataBuffer chunk = reader . readChunk ( ) ; if ( chunk == null ) { break ; } try { org . junit . Assert . assertTrue ( ( chunk instanceof alluxio . network . protocol . databuffer . NioDataBuffer ) ) ; io . netty . buffer . ByteBuf buf = ( ( io . netty . buffer . ByteBuf ) ( chunk . getNettyOutput ( ) ) ) ; byte [ ] bytes = new byte [ buf . readableBytes ( ) ] ; buf . readBytes ( bytes ) ; for ( int i = 0 ; i < ( bytes . length ) ; i ++ ) { if ( pos >= checksumStart ) { checksum += alluxio . util . io . BufferUtils . byteToInt ( bytes [ i ] ) ; } pos ++ ; if ( pos >= bytesToRead ) { return checksum ; } } } finally { chunk . release ( ) ; } } return checksum ; } | org . junit . Assert . assertEquals ( checksum , checksumActual ) |
getPlotOptions_getAfterChartCreation_EmptyCollectionReturned ( ) { com . vaadin . addon . charts . Chart chart = new com . vaadin . addon . charts . Chart ( ) ; java . util . Collection < com . vaadin . addon . charts . model . AbstractPlotOptions > result = chart . getConfiguration ( ) . getPlotOptions ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return data . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testUpdateOrder ( ) { org . joice . common . dao . domain . BizPayOrder queryCon = new org . joice . common . dao . domain . BizPayOrder ( ) ; queryCon . setId ( 4L ) ; org . joice . common . dao . domain . BizPayOrder ret = payOrderService . getById ( queryCon ) ; ret . setGoodsDetail ( "mate10<sp>pro<sp>128g" ) ; payOrderService . updateOrder ( ret ) ; queryCon . setId ( ( - 1L ) ) ; boolean updateRet = payOrderService . updateOrder ( queryCon ) ; "<AssertPlaceHolder>" ; } updateOrder ( org . joice . common . dao . domain . BizPayOrder ) { return ( bizPayOrderMapper . updateByPrimaryKey ( order ) ) == 1 ; } | org . junit . Assert . assertFalse ( updateRet ) |
verifyServiceBinding ( ) { org . nuxeo . runtime . management . counters . CounterManager cm = org . nuxeo . runtime . api . Framework . getLocalService ( org . nuxeo . runtime . management . counters . CounterManager . class ) ; "<AssertPlaceHolder>" ; } getLocalService ( java . lang . Class ) { return org . nuxeo . runtime . api . Framework . getService ( serviceClass ) ; } | org . junit . Assert . assertNotNull ( cm ) |
testBlob ( ) { org . lilyproject . client . LilyClient client = org . lilyproject . process . test . LilyClientTest . lilyProxy . getLilyServerProxy ( ) . getClient ( ) ; org . lilyproject . repository . api . Repository repository = client . getRepository ( ) ; java . lang . String NS = "org.lilyproject.client.test" ; org . lilyproject . repository . api . TypeManager typeManager = repository . getTypeManager ( ) ; org . lilyproject . repository . api . ValueType blobType = typeManager . getValueType ( "BLOB" ) ; org . lilyproject . repository . api . FieldType blobFieldType = typeManager . newFieldType ( blobType , new org . lilyproject . repository . api . QName ( NS , "data" ) , Scope . VERSIONED ) ; blobFieldType = typeManager . createFieldType ( blobFieldType ) ; org . lilyproject . repository . api . RecordType recordType = typeManager . newRecordType ( new org . lilyproject . repository . api . QName ( NS , "file" ) ) ; recordType . addFieldTypeEntry ( blobFieldType . getId ( ) , true ) ; recordType = typeManager . createRecordType ( recordType ) ; byte [ ] data = makeBlobData ( 10000 ) ; org . lilyproject . repository . api . Blob blob = new org . lilyproject . repository . api . Blob ( "application/octet-stream" , ( ( long ) ( data . length ) ) , null ) ; java . io . OutputStream blobStream = repository . getOutputStream ( blob ) ; org . apache . commons . io . IOUtils . copy ( new java . io . ByteArrayInputStream ( data ) , blobStream ) ; blobStream . close ( ) ; "<AssertPlaceHolder>" ; org . lilyproject . repository . api . Record record = repository . newRecord ( ) ; record . setRecordType ( new org . lilyproject . repository . api . QName ( NS , "file" ) ) ; record . setField ( new org . lilyproject . repository . api . QName ( NS , "data" ) , blob ) ; record = repository . create ( record ) ; } getValue ( ) { return value ; } | org . junit . Assert . assertTrue ( ( ( blob . getValue ( ) ) != null ) ) |
testSimpleBindBadPrincipalAPassword ( ) { java . util . Hashtable < java . lang . String , java . lang . Object > env = new java . util . Hashtable < java . lang . String , java . lang . Object > ( ) ; env . put ( DirectoryService . JNDI_KEY , getService ( ) ) ; env . put ( Context . INITIAL_CONTEXT_FACTORY , org . apache . directory . server . core . jndi . CoreContextFactory . class . getName ( ) ) ; env . put ( Context . PROVIDER_URL , "ou=system" ) ; env . put ( Context . SECURITY_AUTHENTICATION , "simple" ) ; env . put ( Context . SECURITY_PRINCIPAL , "admin" ) ; env . put ( Context . SECURITY_CREDENTIALS , "secret" ) ; try { new javax . naming . directory . InitialDirContext ( env ) ; org . junit . Assert . fail ( ) ; } catch ( javax . naming . InvalidNameException ine ) { "<AssertPlaceHolder>" ; } catch ( javax . naming . NamingException ne ) { org . junit . Assert . fail ( ) ; } } put ( java . lang . Object , java . lang . Object ) { return dictionary . put ( arg0 , arg1 ) ; } | org . junit . Assert . assertTrue ( true ) |
testEquals ( ) { org . calrissian . mango . criteria . domain . criteria . Criteria eq = new org . calrissian . mango . criteria . domain . criteria . NotEqualsCriteria ( "key1" , "val1" , naturalOrder ( ) , null ) ; org . calrissian . mango . domain . entity . EntityBuilder entity = org . calrissian . mango . domain . entity . EntityBuilder . create ( "type" , "id" ) . attr ( "key1" , "val1" ) ; "<AssertPlaceHolder>" ; } test ( org . calrissian . mango . domain . AttributeStore ) { for ( org . calrissian . mango . domain . Attribute attribute : obj . getAttributes ( org . calrissian . mango . criteria . domain . criteria . LessThanCriteria . getTerm ( ) ) ) { if ( ( org . calrissian . mango . criteria . domain . criteria . LessThanCriteria . getComparator ( ) . compare ( ( ( T ) ( attribute . getValue ( ) ) ) , org . calrissian . mango . criteria . domain . criteria . LessThanCriteria . getValue ( ) ) ) < 0 ) return true ; } return false ; } | org . junit . Assert . assertFalse ( eq . test ( entity . build ( ) ) ) |
testDecodeAttachedFileNameWithSpaces ( ) { final java . lang . String fileName = "file<sp>Name" ; final java . lang . String message = getMailMessageSpy . decodeAttachedFileNames ( fileName ) ; "<AssertPlaceHolder>" ; } decodeAttachedFileNames ( java . lang . String ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; java . lang . String delimiter = "" ; for ( java . lang . String fileName : attachedFileNames . split ( io . cloudslang . content . mail . services . GetMailMessage . STR_COMMA ) ) { sb . append ( delimiter ) . append ( javax . mail . internet . MimeUtility . decodeText ( fileName ) ) ; delimiter = io . cloudslang . content . mail . services . GetMailMessage . STR_COMMA ; } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( "file<sp>Name" , message ) |
testCustomRecordDelimiters ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . set ( "textinputformat.record.delimiter" , "\t\n" ) ; conf . setInt ( "mapreduce.job.maps" , 1 ) ; org . apache . hadoop . fs . FileSystem localFs = org . apache . hadoop . fs . FileSystem . getLocal ( conf ) ; localFs . delete ( org . apache . hadoop . mapred . TestLineRecordReaderJobs . workDir , true ) ; createInputFile ( conf ) ; createAndRunJob ( conf ) ; java . lang . String expected = "0\tabc\ndef\n9\tghi\njkl\n" ; "<AssertPlaceHolder>" ; } readOutputFile ( org . apache . hadoop . conf . Configuration ) { org . apache . hadoop . fs . FileSystem localFs = org . apache . hadoop . fs . FileSystem . getLocal ( conf ) ; org . apache . hadoop . fs . Path file = new org . apache . hadoop . fs . Path ( org . apache . hadoop . mapred . TestLineRecordReaderJobs . outputDir , "part-00000" ) ; return org . apache . hadoop . mapred . UtilsForTests . slurpHadoop ( file , localFs ) ; } | org . junit . Assert . assertEquals ( expected , readOutputFile ( conf ) ) |
persisteRecuperaTipo ( ) { br . ufg . inf . es . saep . sandbox . persistencia . ram . Atributo a = new br . ufg . inf . es . saep . sandbox . persistencia . ram . Atributo ( "a" , "atributo" , Atributo . REAL ) ; br . ufg . inf . es . saep . sandbox . persistencia . ram . Set < br . ufg . inf . es . saep . sandbox . persistencia . ram . Atributo > atributos = new br . ufg . inf . es . saep . sandbox . persistencia . ram . HashSet ( 1 ) ; atributos . add ( a ) ; br . ufg . inf . es . saep . sandbox . persistencia . ram . Tipo tipo = new br . ufg . inf . es . saep . sandbox . persistencia . ram . Tipo ( "id" , "t" , "tipo" , atributos ) ; repo . persisteTipo ( tipo ) ; br . ufg . inf . es . saep . sandbox . persistencia . ram . Tipo recuperado = repo . tipoPeloCodigo ( "id" ) ; "<AssertPlaceHolder>" ; } tipoPeloCodigo ( java . lang . String ) { try { br . ufg . inf . es . saep . sandbox . persistencia . gds . Entity dsr = gds . get ( getKeyTipo ( s ) ) ; if ( dsr == null ) { return null ; } java . lang . String objeto = dsr . getString ( PAYLOAD ) ; java . lang . reflect . Type tipo = new com . google . gson . reflect . TypeToken < br . ufg . inf . es . saep . sandbox . dominio . Tipo > ( ) { } . getType ( ) ; return ( ( br . ufg . inf . es . saep . sandbox . dominio . Tipo ) ( new com . google . gson . Gson ( ) . fromJson ( objeto , tipo ) ) ) ; } catch ( java . lang . Exception e ) { return null ; } } | org . junit . Assert . assertEquals ( tipo , recuperado ) |
testGetRowCount ( ) { org . jfree . data . gantt . TaskSeriesCollection c = createCollection1 ( ) ; "<AssertPlaceHolder>" ; } getRowCount ( ) { return this . rows ; } | org . junit . Assert . assertEquals ( 2 , c . getRowCount ( ) ) |
test_successful_authorize_with_app_keys ( ) { final java . lang . String body = "<status>" + ( ( "<authorized>true</authorized>" + "<plan>Ultimate</plan>" ) + "</status>" ) ; context . checking ( new threescale . v3 . api . ServiceApiDriverTest . UrlWithParamsExpectations ( ) { { oneOf ( htmlServer ) . get ( withUrl ( ( ( "http://" + ( host ) ) + "/transactions/authorize.xml?provider_key=1234abcd&app_key=toosecret&app_id=foo" ) ) ) ; will ( returnValue ( new threescale . v3 . api . HttpResponse ( 200 , body ) ) ) ; } } ) ; threescale . v3 . api . ParameterMap params = new threescale . v3 . api . ParameterMap ( ) ; params . add ( "app_id" , "foo" ) ; params . add ( "app_key" , "toosecret" ) ; threescale . v3 . api . AuthorizeResponse response = serviceApi . authorize ( params ) ; "<AssertPlaceHolder>" ; } success ( ) { return status ; } | org . junit . Assert . assertTrue ( response . success ( ) ) |
testMissingBeforeSecond ( ) { System . out . println ( "binarySearch" ) ; int [ ] index = new int [ ] { 10 , 13 , 15 , 17 , 19 } ; int key = 11 ; int begin = 0 ; int end = 5 ; int expResult = - 2 ; int result = org . genemania . engine . matricks . Utils . myBinarySearch ( index , key , begin , end ) ; "<AssertPlaceHolder>" ; } myBinarySearch ( int [ ] , int , int , int ) { if ( ( ( indices . length ) == 0 ) || ( begin == end ) ) { return - 1 ; } end -- ; int mid = begin ; while ( begin <= end ) { mid = ( end + begin ) > > 1 ; if ( ( indices [ mid ] ) < key ) { begin = mid + 1 ; } else if ( ( indices [ mid ] ) > key ) { end = mid - 1 ; } else { return mid ; } } if ( ( indices [ mid ] ) < key ) { return ( - mid ) - 2 ; } else { return ( - mid ) - 1 ; } } | org . junit . Assert . assertEquals ( expResult , result ) |
testisSelectionSameType_3 ( ) { org . talend . repository . model . RepositoryNode anaNode = createAnalysisNode ( "ana" , null , false ) ; org . talend . repository . model . RepositoryNode anaNode_deleted = createAnalysisNode ( "ana2" , null , true ) ; setParentNode ( anaNode , ERepositoryObjectType . TDQ_ANALYSIS_ELEMENT ) ; setParentNode ( anaNode , ERepositoryObjectType . TDQ_ANALYSIS_ELEMENT ) ; java . lang . Object [ ] objs = new java . lang . Object [ 2 ] ; objs [ 0 ] = anaNode ; objs [ 1 ] = anaNode_deleted ; when ( treeSel . toArray ( ) ) . thenReturn ( objs ) ; boolean flag = absCommonActionProvider . isSelectionSameType ( ) ; "<AssertPlaceHolder>" ; } isSelectionSameType ( ) { org . eclipse . jface . viewers . TreeSelection currentSelections = ( ( org . eclipse . jface . viewers . TreeSelection ) ( getContext ( ) . getSelection ( ) ) ) ; java . lang . Object [ ] selectionArrays = currentSelections . toArray ( ) ; if ( ( selectionArrays . length ) > 1 ) { org . talend . repository . model . RepositoryNode firstNode = null ; org . talend . core . model . repository . ERepositoryObjectType firstContentType = null ; for ( java . lang . Object obj : selectionArrays ) { if ( obj instanceof org . talend . repository . model . RepositoryNode ) { if ( firstNode == null ) { firstNode = ( ( org . talend . repository . model . RepositoryNode ) ( obj ) ) ; firstContentType = firstNode . getContentType ( ) ; continue ; } org . talend . repository . model . RepositoryNode node = ( ( org . talend . repository . model . RepositoryNode ) ( obj ) ) ; org . talend . core . model . repository . ERepositoryObjectType contentType = node . getContentType ( ) ; if ( ( ( ( firstContentType != null ) && ( contentType != null ) ) && ( ! ( contentType . getType ( ) . equals ( firstContentType . getType ( ) ) ) ) ) || ( ( org . talend . dq . helper . RepositoryNodeHelper . isStateDeleted ( node ) ) != ( org . talend . dq . helper . RepositoryNodeHelper . isStateDeleted ( firstNode ) ) ) ) { return false ; } } } } return true ; } | org . junit . Assert . assertFalse ( flag ) |
testSerializeVOSubscriptionDetails ( ) { org . oscm . internal . vo . VOSubscriptionDetails voIn = new org . oscm . internal . vo . VOSubscriptionDetails ( ) ; voIn . setActivationDate ( org . oscm . domobjects . L_TIMESTAMP ) ; voIn . setCreationDate ( org . oscm . domobjects . L_TIMESTAMP ) ; voIn . setServiceAccessInfo ( "serviceAccessInfo" ) ; voIn . setServiceAccessType ( ServiceAccessType . LOGIN ) ; voIn . setServiceBaseURL ( "http://" ) ; voIn . setServiceId ( "serviceId" ) ; voIn . setServiceKey ( 1234 ) ; voIn . setServiceInstanceId ( "serviceInstanceId" ) ; voIn . setServiceLoginPath ( "serviceLoginPath" ) ; voIn . setPurchaseOrderNumber ( "purchaseOrderNumber" ) ; voIn . setStatus ( SubscriptionStatus . ACTIVE ) ; voIn . setSubscriptionId ( "subscriptionId" ) ; voIn . setTimeoutMailSent ( true ) ; createTriggerProcessWithParam ( voIn ) ; org . oscm . internal . vo . VOSubscriptionDetails voOut = getTriggerProcessParameterValue ( org . oscm . internal . vo . VOSubscriptionDetails . class ) ; java . lang . String result = doCompare ( voIn , voOut ) ; "<AssertPlaceHolder>" ; } doCompare ( java . lang . Object , java . lang . Object ) { return doCompare ( new java . util . ArrayList ( ) , first , second ) ; } | org . junit . Assert . assertTrue ( result , ( ( result . length ( ) ) == 0 ) ) |
canEstimateRegressionParametersVariance ( ) { double [ ] [ ] variance = regression . estimateRegressionParametersVariance ( ) ; "<AssertPlaceHolder>" ; } getNumberOfRegressors ( ) { return ( x [ 0 ] . length ) + 1 ; } | org . junit . Assert . assertEquals ( getNumberOfRegressors ( ) , variance . length ) |
testFlushStackPush ( ) { com . impetus . kundera . persistence . context . PersistenceCache pc = new com . impetus . kundera . persistence . context . PersistenceCache ( ) ; fs . push ( new com . impetus . kundera . graph . Node ( "A" , new java . lang . Object ( ) . getClass ( ) , null , pc , "A" , null ) ) ; fs . push ( new com . impetus . kundera . graph . Node ( "B" , new java . lang . Object ( ) . getClass ( ) , null , pc , "B" , null ) ) ; fs . push ( new com . impetus . kundera . graph . Node ( "C" , new java . lang . Object ( ) . getClass ( ) , null , pc , "C" , null ) ) ; fs . push ( new com . impetus . kundera . graph . Node ( "D" , new java . lang . Object ( ) . getClass ( ) , null , pc , "D" , null ) ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( isAlive ( ) ) { return ehcache . getSize ( ) ; } return 0 ; } | org . junit . Assert . assertEquals ( 4 , fs . size ( ) ) |
testCharFetch ( ) { createSingleArtistDataSet ( ) ; org . apache . cayenne . query . SelectQuery query = new org . apache . cayenne . query . SelectQuery ( org . apache . cayenne . testdo . testmap . Artist . class ) ; org . apache . cayenne . testdo . testmap . Artist a = ( ( org . apache . cayenne . testdo . testmap . Artist ) ( context . performQuery ( query ) . get ( 0 ) ) ) ; "<AssertPlaceHolder>" ; } getArtistName ( ) { beforePropertyRead ( "artistName" ) ; return this . artistName ; } | org . junit . Assert . assertEquals ( a . getArtistName ( ) . trim ( ) , a . getArtistName ( ) ) |
testSearchByType ( ) { int startIndex = 0 ; int pageSize = 10 ; org . codice . ddf . spatial . ogc . wfs . v2_0_0 . catalog . source . WfsSource source = getWfsSource ( org . codice . ddf . spatial . ogc . wfs . v2_0_0 . catalog . source . TestWfsSource . ONE_TEXT_PROPERTY_SCHEMA , org . codice . ddf . spatial . ogc . wfs . v2_0_0 . catalog . source . MockWfsServer . getFilterCapabilities ( ) , Wfs20Constants . EPSG_4326_URN , 10 , false ) ; org . opengis . filter . Filter filter = builder . attribute ( Metacard . CONTENT_TYPE ) . is ( ) . equalTo ( ) . text ( ( ( org . codice . ddf . spatial . ogc . wfs . v2_0_0 . catalog . source . TestWfsSource . SAMPLE_FEATURE_NAME ) + "0" ) ) ; ddf . catalog . operation . impl . QueryImpl query = new ddf . catalog . operation . impl . QueryImpl ( filter ) ; query . setPageSize ( pageSize ) ; net . opengis . wfs . v_2_0_0 . GetFeatureType featureType = source . buildGetFeatureRequest ( query ) ; net . opengis . wfs . v_2_0_0 . QueryType queryType = ( ( net . opengis . wfs . v_2_0_0 . QueryType ) ( featureType . getAbstractQueryExpression ( ) . get ( 0 ) . getValue ( ) ) ) ; "<AssertPlaceHolder>" ; } getTypeNames ( ) { return typeNames ; } | org . junit . Assert . assertEquals ( ( ( org . codice . ddf . spatial . ogc . wfs . v2_0_0 . catalog . source . TestWfsSource . SAMPLE_FEATURE_NAME ) + "0" ) , queryType . getTypeNames ( ) . get ( 0 ) ) |
testGetLabelResource ( ) { System . out . println ( "getLabelResource" ) ; kg . apc . jmeter . vizualizers . ResponseTimesPercentilesGui instance = new kg . apc . jmeter . vizualizers . ResponseTimesPercentilesGui ( ) ; java . lang . String expResult = "ResponseTimesPercentilesGui" ; java . lang . String result = instance . getLabelResource ( ) ; "<AssertPlaceHolder>" ; } getLabelResource ( ) { return this . getClass ( ) . getSimpleName ( ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testRoundTrip ( ) { org . apache . flume . sink . elasticsearch . ElasticSearchDynamicSerializer fixture = new org . apache . flume . sink . elasticsearch . ElasticSearchDynamicSerializer ( ) ; org . apache . flume . Context context = new org . apache . flume . Context ( ) ; fixture . configure ( context ) ; java . lang . String message = "test<sp>body" ; java . util . Map < java . lang . String , java . lang . String > headers = org . elasticsearch . common . collect . Maps . newHashMap ( ) ; headers . put ( "headerNameOne" , "headerValueOne" ) ; headers . put ( "headerNameTwo" , "headerValueTwo" ) ; headers . put ( "headerNameThree" , "headerValueThree" ) ; org . apache . flume . Event event = org . apache . flume . event . EventBuilder . withBody ( message . getBytes ( org . apache . flume . sink . elasticsearch . ElasticSearchEventSerializer . charset ) ) ; event . setHeaders ( headers ) ; org . elasticsearch . common . xcontent . XContentBuilder expected = jsonBuilder ( ) . startObject ( ) ; expected . field ( "body" , new java . lang . String ( message . getBytes ( ) , org . apache . flume . sink . elasticsearch . ElasticSearchEventSerializer . charset ) ) ; for ( java . lang . String headerName : headers . keySet ( ) ) { expected . field ( headerName , new java . lang . String ( headers . get ( headerName ) . getBytes ( ) , org . apache . flume . sink . elasticsearch . ElasticSearchEventSerializer . charset ) ) ; } expected . endObject ( ) ; org . elasticsearch . common . xcontent . XContentBuilder actual = fixture . getContentBuilder ( event ) ; "<AssertPlaceHolder>" ; } getContentBuilder ( org . apache . flume . Event ) { org . elasticsearch . common . xcontent . XContentBuilder builder = jsonBuilder ( ) . startObject ( ) ; appendBody ( builder , event ) ; appendHeaders ( builder , event ) ; return builder ; } | org . junit . Assert . assertEquals ( new java . lang . String ( expected . bytes ( ) . array ( ) ) , new java . lang . String ( actual . bytes ( ) . array ( ) ) ) |
testHandlePlan_DifferentThanLastMode ( ) { org . matsim . core . population . algorithms . ChooseRandomSingleLegMode algo = new org . matsim . core . population . algorithms . ChooseRandomSingleLegMode ( new java . lang . String [ ] { org . matsim . api . core . v01 . TransportMode . car , org . matsim . api . core . v01 . TransportMode . pt , org . matsim . api . core . v01 . TransportMode . walk } , org . matsim . core . gbl . MatsimRandom . getRandom ( ) , false ) ; org . matsim . api . core . v01 . population . Plan plan = org . matsim . core . population . PopulationUtils . createPlan ( org . matsim . core . population . PopulationUtils . getFactory ( ) . createPerson ( org . matsim . api . core . v01 . Id . create ( 1 , org . matsim . api . core . v01 . population . Person . class ) ) ) ; org . matsim . core . population . PopulationUtils . createAndAddActivityFromCoord ( plan , "home" , new org . matsim . api . core . v01 . Coord ( ( ( double ) ( 0 ) ) , ( ( double ) ( 0 ) ) ) ) ; org . matsim . api . core . v01 . population . Leg leg = org . matsim . core . population . PopulationUtils . createAndAddLeg ( plan , TransportMode . car ) ; org . matsim . core . population . PopulationUtils . createAndAddActivityFromCoord ( plan , "work" , new org . matsim . api . core . v01 . Coord ( ( ( double ) ( 0 ) ) , ( ( double ) ( 0 ) ) ) ) ; java . lang . String oldMode = leg . getMode ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { algo . run ( plan ) ; java . lang . String mode = leg . getMode ( ) ; "<AssertPlaceHolder>" ; oldMode = mode ; } } equals ( java . lang . Object ) { if ( ! ( obj instanceof org . matsim . vis . otfvis . data . OTFConnectionManager . Entry ) ) { return false ; } org . matsim . vis . otfvis . data . OTFConnectionManager . Entry other = ( ( org . matsim . vis . otfvis . data . OTFConnectionManager . Entry ) ( obj ) ) ; return ( from . equals ( other . from ) ) && ( to . equals ( other . to ) ) ; } | org . junit . Assert . assertTrue ( ( ! ( oldMode . equals ( mode ) ) ) ) |
test_OK ( ) { final java . lang . String cfcSrc = "<cfcomponent<sp>output=\"false\">\r\n" + ( ( ( ( "<cffunction<sp>name=\"test\"<sp>output=\"false\">\r\n" + "\t<cfargument<sp>name=\"xyz\"<sp>default=\"\">\r\n" ) + "\t<cfset<sp>var<sp>xyz=123/>\r\n" ) + "</cffunction>\r\n" ) + "</cfcomponent>" ) ; com . cflint . api . CFLintResult lintresult = cfBugs . scan ( cfcSrc , "test" ) ; "<AssertPlaceHolder>" ; } getIssues ( ) { return cflint . getBugs ( ) . getBugList ( ) ; } | org . junit . Assert . assertEquals ( 0 , lintresult . getIssues ( ) . size ( ) ) |
shouldNotPollBelowFloor ( ) { com . couchbase . client . core . ClusterFacade cluster = mock ( com . couchbase . client . core . ClusterFacade . class ) ; com . couchbase . client . core . config . refresher . CarrierRefresher refresher = new com . couchbase . client . core . config . refresher . CarrierRefresher ( com . couchbase . client . core . config . refresher . CarrierRefresherTest . ENVIRONMENT , cluster ) ; refresher . registerBucket ( "bucket" , "" ) ; com . couchbase . client . core . config . ConfigurationProvider provider = mock ( com . couchbase . client . core . config . ConfigurationProvider . class ) ; refresher . provider ( provider ) ; com . couchbase . client . core . config . ClusterConfig clusterConfig = mock ( com . couchbase . client . core . config . ClusterConfig . class ) ; com . couchbase . client . core . config . BucketConfig bucketConfig = mock ( com . couchbase . client . core . config . BucketConfig . class ) ; when ( bucketConfig . name ( ) ) . thenReturn ( "bucket" ) ; java . util . List < com . couchbase . client . core . config . NodeInfo > nodeInfos = new java . util . ArrayList < com . couchbase . client . core . config . NodeInfo > ( ) ; java . util . Map < java . lang . String , java . lang . Integer > ports = new java . util . HashMap < java . lang . String , java . lang . Integer > ( ) ; ports . put ( "direct" , 11210 ) ; nodeInfos . add ( new com . couchbase . client . core . config . DefaultNodeInfo ( null , "localhost:8091" , ports , null ) ) ; when ( bucketConfig . nodes ( ) ) . thenReturn ( nodeInfos ) ; java . util . Map < java . lang . String , com . couchbase . client . core . config . BucketConfig > bucketConfigs = new java . util . HashMap < java . lang . String , com . couchbase . client . core . config . BucketConfig > ( ) ; bucketConfigs . put ( "bucket" , bucketConfig ) ; when ( clusterConfig . bucketConfigs ( ) ) . thenReturn ( bucketConfigs ) ; final java . util . List < java . lang . Long > invocationTimings = java . util . Collections . synchronizedList ( new java . util . ArrayList < java . lang . Long > ( ) ) ; when ( cluster . send ( any ( com . couchbase . client . core . message . kv . GetBucketConfigRequest . class ) ) ) . thenAnswer ( new org . mockito . stubbing . Answer < rx . Observable < com . couchbase . client . core . message . CouchbaseResponse > > ( ) { @ com . couchbase . client . core . config . refresher . Override public rx . Observable < com . couchbase . client . core . message . CouchbaseResponse > answer ( org . mockito . invocation . InvocationOnMock invocation ) throws java . lang . Throwable { invocationTimings . add ( java . lang . System . nanoTime ( ) ) ; return rx . Observable . just ( ( ( com . couchbase . client . core . message . CouchbaseResponse ) ( new com . couchbase . client . core . message . kv . GetBucketConfigResponse ( com . couchbase . client . core . message . ResponseStatus . SUCCESS , KeyValueStatus . SUCCESS . code ( ) , "bucket" , io . netty . buffer . Unpooled . copiedBuffer ( "{\"config\":<sp>true}" , CharsetUtil . UTF_8 ) , com . couchbase . client . core . utils . NetworkAddress . localhost ( ) ) ) ) ) ; } } ) ; int attempts = 400 ; for ( int i = 0 ; i < attempts ; i ++ ) { refresher . refresh ( clusterConfig ) ; java . lang . Thread . sleep ( 2 ) ; } java . lang . Thread . sleep ( 200 ) ; long lastCall = invocationTimings . get ( 0 ) ; int good = 0 ; int bad = 0 ; for ( int i = 1 ; i < ( invocationTimings . size ( ) ) ; i ++ ) { if ( ( ( invocationTimings . get ( i ) ) - lastCall ) >= ( com . couchbase . client . core . env . DefaultCoreEnvironment . CONFIG_POLL_FLOOR_INTERVAL ) ) { good ++ ; } else { bad ++ ; } lastCall = invocationTimings . get ( i ) ; } "<AssertPlaceHolder>" ; } refresh ( com . couchbase . client . core . config . ClusterConfig ) { rx . Observable . from ( config . bucketConfigs ( ) . values ( ) ) . observeOn ( environment . scheduler ( ) ) . filter ( new rx . functions . Func1 < com . couchbase . client . core . config . BucketConfig , java . lang . Boolean > ( ) { @ com . couchbase . client . core . config . refresher . Override public com . couchbase . client . core . config . refresher . Boolean call ( com . couchbase . client . core . config . BucketConfig config ) { return registrations ( ) . containsKey ( config . name ( ) ) ; } } ) . filter ( new rx . functions . Func1 < com . couchbase . client . core . config . BucketConfig , java . lang . Boolean > ( ) { @ com . couchbase . client . core . config . refresher . Override public com . | org . junit . Assert . assertTrue ( ( good > bad ) ) |
shouldUpdateRelationshipWithLabelCountsWhenRemovingLabelAndDeletingRelationship ( ) { org . neo4j . graphdb . Node foo ; try ( org . neo4j . graphdb . Transaction tx = db . beginTx ( ) ) { foo = db . createNode ( label ( "Foo" ) ) ; org . neo4j . graphdb . Node bar = db . createNode ( label ( "Bar" ) ) ; foo . createRelationshipTo ( bar , withName ( "BAZ" ) ) ; tx . success ( ) ; } long before = numberOfRelationshipsMatching ( label ( "Foo" ) , withName ( "BAZ" ) , null ) ; try ( org . neo4j . graphdb . Transaction tx = db . beginTx ( ) ) { for ( org . neo4j . graphdb . Relationship relationship : foo . getRelationships ( ) ) { relationship . delete ( ) ; } foo . removeLabel ( label ( "Foo" ) ) ; tx . success ( ) ; } long after = numberOfRelationshipsMatching ( label ( "Foo" ) , withName ( "BAZ" ) , null ) ; "<AssertPlaceHolder>" ; } withName ( java . lang . String ) { return new org . neo4j . graphdb . DynamicRelationshipType ( name ) ; } | org . junit . Assert . assertEquals ( ( before - 1 ) , after ) |
testFill3 ( ) { java . lang . String [ ] testArray = new java . lang . String [ 64 ] ; java . util . Arrays . fill ( testArray , "a" ) ; java . lang . String [ ] a1 = testArray . clone ( ) ; java . lang . String [ ] a2 = testArray . clone ( ) ; java . util . Arrays . fill ( a1 , 50 , 51 , null ) ; org . spf4j . base . Arrays . fill ( a2 , 50 , 51 , null ) ; "<AssertPlaceHolder>" ; } fill ( byte [ ] , int , int , byte ) { int len = endIdx - startIdx ; if ( len > 0 ) { if ( ( endIdx > ( array . length ) ) || ( startIdx < 0 ) ) { throw new java . lang . IllegalArgumentException ( ( ( ( "Illegal<sp>range<sp>from<sp>" + startIdx ) + "<sp>to<sp>" ) + endIdx ) ) ; } if ( len <= ( org . spf4j . base . Arrays . ARR_CPY_THR ) ) { for ( int i = startIdx ; i < endIdx ; i ++ ) { array [ i ] = value ; } } else { int fillEnd = startIdx + ( org . spf4j . base . Arrays . ARR_CPY_THR ) ; for ( int i = startIdx ; i < fillEnd ; i ++ ) { array [ i ] = value ; } array [ startIdx ] = value ; for ( int i = org . spf4j . base . Arrays . ARR_CPY_THR ; i < len ; i += i ) { int lmi = len - i ; int from = startIdx + i ; if ( lmi < i ) { if ( lmi < ( org . spf4j . base . Arrays . ARR_CPY_THR ) ) { int xe = from + lmi ; for ( int j = from ; j < xe ; j ++ ) { array [ j ] = value ; } } else { java . lang . System . arraycopy ( array , startIdx , array , from , lmi ) ; } } else { java . lang . System . arraycopy ( array , startIdx , array , from , i ) ; } } } } else if ( len < 0 ) { throw new java . lang . IllegalArgumentException ( ( ( ( "Illegal<sp>range<sp>from<sp>" + startIdx ) + "<sp>to<sp>" ) + endIdx ) ) ; } } | org . junit . Assert . assertArrayEquals ( a1 , a2 ) |
testGetFileCharset_GB2312 ( ) { java . io . File file = org . apache . commons . io . FileUtils . toFile ( CLASS . getResource ( "chinese-big5.srt" ) ) ; "<AssertPlaceHolder>" . isEqualTo ( net . pms . util . CHARSET_BIG5 ) ; } getFileCharsetName ( net . pms . util . File ) { if ( file == null ) { return null ; } com . ibm . icu . text . CharsetMatch match = net . pms . util . FileUtil . getFileCharsetMatch ( file ) ; try { if ( java . nio . charset . Charset . isSupported ( match . getName ( ) ) ) { net . pms . util . FileUtil . LOGGER . debug ( "Detected<sp>charset<sp>\"{}\"<sp>in<sp>file<sp>\"{}\"" , match . getName ( ) , file . getAbsolutePath ( ) ) ; return match . getName ( ) . toUpperCase ( Locale . ROOT ) ; } net . pms . util . FileUtil . LOGGER . debug ( "Detected<sp>charset<sp>\"{}\"<sp>in<sp>file<sp>\"{}\",<sp>but<sp>cannot<sp>use<sp>it<sp>because<sp>it\'s<sp>not<sp>supported<sp>by<sp>the<sp>Java<sp>Virual<sp>Machine" , match . getName ( ) , file . getAbsolutePath ( ) ) ; return null ; } catch ( java . nio . charset . IllegalCharsetNameException e ) { net . pms . util . FileUtil . LOGGER . debug ( "Illegal<sp>charset<sp>\"{}\"<sp>deteceted<sp>in<sp>file<sp>\"{}\"" , match . getName ( ) , file . getAbsolutePath ( ) ) ; } net . pms . util . FileUtil . LOGGER . debug ( "Found<sp>no<sp>matching<sp>charset<sp>for<sp>file<sp>\"{}\"" , file . getAbsolutePath ( ) ) ; return null ; } | org . junit . Assert . assertThat ( net . pms . util . FileUtil . getFileCharsetName ( file ) ) |
renderConfluencePage_asciiDocWithCautionContentAndTitle_returnsConfluencePageContentWithNoteMacroWithContentAndTitle ( ) { java . lang . String adocContent = "[CAUTION]\n" + ( ( ( ".Caution<sp>Title\n" + "====\n" ) + "Some<sp>caution.\n" ) + "<ac:rich-text-body><p>Some<sp>caution.</p></ac:rich-text-body>" 0 ) ; org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage asciidocConfluencePage = org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage . newAsciidocConfluencePage ( asciidocPage ( org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . prependTitle ( adocContent ) ) , org . sahli . asciidoc . confluence . publisher . converter . UTF_8 , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . TEMPLATES_FOLDER , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . dummyAssetsTargetPath ( ) ) ; java . lang . String expectedContent = "<ac:structured-macro<sp>ac:name=\"note\">" + ( ( "<ac:parameter<sp>ac:name=\"title\">Caution<sp>Title</ac:parameter>" + "<ac:rich-text-body><p>Some<sp>caution.</p></ac:rich-text-body>" ) + "</ac:structured-macro>" ) ; "<AssertPlaceHolder>" ; } content ( ) { return this . htmlContent ; } | org . junit . Assert . assertThat ( asciidocConfluencePage . content ( ) , org . hamcrest . Matchers . is ( expectedContent ) ) |
testGetPort ( ) { System . out . println ( "getPort" ) ; kg . apc . jmeter . samplers . AbstractIPSampler instance = new kg . apc . jmeter . samplers . AbstractIPSamplerTest . AbstractIPSamplerImpl ( ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getPort ( ) ; "<AssertPlaceHolder>" ; } getPort ( ) { return port ; } | org . junit . Assert . assertEquals ( expResult , result ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.