input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . portal . background . task . model . BackgroundTask > backgroundTasks = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( backgroundTasks . isEmpty ( ) )
|
testTaskErr ( ) { org . apache . hadoop . hbase . master . TestSplitLogManager . LOG . info ( "TestTaskErr<sp>-<sp>cleanup<sp>task<sp>node<sp>once<sp>in<sp>ERR<sp>state" ) ; conf . setInt ( "hbase.splitlog.max.resubmit" , 0 ) ; slm = new org . apache . hadoop . hbase . master . SplitLogManager ( zkw , conf , org . apache . hadoop . hbase . master . TestSplitLogManager . stopper , "dummy-master" , null ) ; slm . finishInitialization ( ) ; org . apache . hadoop . hbase . master . SplitLogManager . TaskBatch batch = new org . apache . hadoop . hbase . master . SplitLogManager . TaskBatch ( ) ; java . lang . String tasknode = submitTaskAndWait ( batch , "foo/1" ) ; org . apache . hadoop . hbase . zookeeper . ZKUtil . setData ( zkw , tasknode , TaskState . TASK_ERR . get ( "worker" ) ) ; synchronized ( batch ) { while ( ( batch . installed ) != ( batch . error ) ) { batch . wait ( ) ; } } waitForCounter ( tot_mgr_task_deleted , 0 , 1 , 1000 ) ; "<AssertPlaceHolder>" ; conf . setInt ( "hbase.splitlog.max.resubmit" , ZKSplitLog . DEFAULT_MAX_RESUBMIT ) ; } checkExists ( org . apache . hadoop . hbase . zookeeper . ZooKeeperWatcher , java . lang . String ) { try { org . apache . zookeeper . data . Stat s = zkw . getRecoverableZooKeeper ( ) . exists ( znode , null ) ; return s != null ? s . getVersion ( ) : - 1 ; } catch ( org . apache . zookeeper . KeeperException e ) { org . apache . hadoop . hbase . zookeeper . ZKUtil . LOG . warn ( zkw . prefix ( ( ( "Unable<sp>to<sp>set<sp>watcher<sp>on<sp>znode<sp>(" + znode ) + ")" ) ) , e ) ; zkw . keeperException ( e ) ; return - 1 ; } catch ( java . lang . InterruptedException e ) { org . apache . hadoop . hbase . zookeeper . ZKUtil . LOG . warn ( zkw . prefix ( ( ( "Unable<sp>to<sp>set<sp>watcher<sp>on<sp>znode<sp>(" + znode ) + ")" ) ) , e ) ; zkw . interruptedException ( e ) ; return - 1 ; } }
|
org . junit . Assert . assertTrue ( ( ( org . apache . hadoop . hbase . zookeeper . ZKUtil . checkExists ( zkw , tasknode ) ) == ( - 1 ) ) )
|
testAdjacentEdges ( ) { edu . ucla . sspace . graph . WeightedDirectedMultigraph < java . lang . String > g = new edu . ucla . sspace . graph . WeightedDirectedMultigraph < java . lang . String > ( ) ; edu . ucla . sspace . graph . Set < edu . ucla . sspace . graph . WeightedDirectedTypedEdge < java . lang . String > > control = new edu . ucla . sspace . graph . HashSet < edu . ucla . sspace . graph . WeightedDirectedTypedEdge < java . lang . String > > ( ) ; for ( int i = 1 ; i <= 100 ; ++ i ) { edu . ucla . sspace . graph . WeightedDirectedTypedEdge < java . lang . String > e = new edu . ucla . sspace . graph . SimpleWeightedDirectedTypedEdge < java . lang . String > ( "type-1" , 0 , i , 1.0 ) ; g . add ( e ) ; control . add ( e ) ; } edu . ucla . sspace . graph . Set < edu . ucla . sspace . graph . WeightedDirectedTypedEdge < java . lang . String > > test = g . getAdjacencyList ( 0 ) ; "<AssertPlaceHolder>" ; } getAdjacencyList ( int ) { return g . getAdjacencyList ( vertex ) ; }
|
org . junit . Assert . assertEquals ( control , test )
|
createResponse_Map ( ) { org . searchisko . api . rest . RestServiceBase tested = getTested ( ) ; org . elasticsearch . action . get . GetResponse rMock = org . mockito . Mockito . mock ( org . elasticsearch . action . get . GetResponse . class ) ; java . util . Map < java . lang . String , java . lang . Object > m = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; org . mockito . Mockito . when ( rMock . getSource ( ) ) . thenReturn ( m ) ; "<AssertPlaceHolder>" ; } createResponse ( org . elasticsearch . action . get . GetResponse ) { return response . getSource ( ) ; }
|
org . junit . Assert . assertEquals ( m , tested . createResponse ( rMock ) )
|
invalidEventLevelParsesToAbsent ( ) { com . facebook . buck . apple . XctoolOutputParsing . StatusEvent statusEvent = new com . facebook . buck . apple . XctoolOutputParsing . StatusEvent ( ) ; statusEvent . message = "Hello<sp>world" ; statusEvent . level = "BALEETED" ; statusEvent . timestamp = 123.456 ; java . util . Optional < com . facebook . buck . test . TestStatusMessage > testStatusMessage = com . facebook . buck . apple . XctoolOutputParsing . testStatusMessageForStatusEvent ( statusEvent ) ; "<AssertPlaceHolder>" ; } equalTo ( com . facebook . buck . query . QueryEnvironment$Argument ) { return ( ( ( type . equals ( other . type ) ) && ( ( integer ) == ( other . integer ) ) ) && ( java . util . Objects . equals ( expression , other . expression ) ) ) && ( java . util . Objects . equals ( word , other . word ) ) ; }
|
org . junit . Assert . assertThat ( testStatusMessage , org . hamcrest . Matchers . equalTo ( java . util . Optional . empty ( ) ) )
|
testTrashBaseModelAndDeleteWithParentIsNotRestorable ( ) { org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsRestorableBaseModel ) ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( group . getGroupId ( ) ) ; com . liferay . portal . kernel . model . BaseModel < ? > parentBaseModel = getParentBaseModel ( group , serviceContext ) ; com . liferay . portal . kernel . trash . TrashHandler trashHandler = com . liferay . portal . kernel . trash . TrashHandlerRegistryUtil . getTrashHandler ( getBaseModelClassName ( ) ) ; try { baseModel = addBaseModel ( parentBaseModel , serviceContext ) ; moveBaseModelToTrash ( ( ( java . lang . Long ) ( baseModel . getPrimaryKeyObj ( ) ) ) ) ; deleteParentBaseModel ( parentBaseModel , false ) ; boolean restorable = trashHandler . isRestorable ( getAssetClassPK ( baseModel ) ) ; "<AssertPlaceHolder>" ; } finally { trashHandler . deleteTrashEntry ( getTrashEntryClassPK ( baseModel ) ) ; } } getAssetClassPK ( com . liferay . portal . kernel . model . ClassedModel ) { if ( classedModel instanceof com . liferay . journal . model . JournalArticle ) { com . liferay . journal . model . JournalArticle article = ( ( com . liferay . journal . model . JournalArticle ) ( classedModel ) ) ; try { com . liferay . journal . model . JournalArticleResource journalArticleResource = com . liferay . journal . service . JournalArticleResourceLocalServiceUtil . getArticleResource ( article . getResourcePrimKey ( ) ) ; return journalArticleResource . getResourcePrimKey ( ) ; } catch ( java . lang . Exception e ) { return super . getAssetClassPK ( classedModel ) ; } } else { return super . getAssetClassPK ( classedModel ) ; } }
|
org . junit . Assert . assertFalse ( restorable )
|
testCollectHeads_disconnected ( ) { com . asakusafw . utils . graph . Graph < java . lang . Integer > graph = com . asakusafw . utils . graph . Graphs . newInstance ( ) ; com . asakusafw . utils . graph . GraphsTest . addPath ( graph , 1 ) ; com . asakusafw . utils . graph . GraphsTest . addPath ( graph , 2 ) ; com . asakusafw . utils . graph . GraphsTest . addPath ( graph , 3 ) ; com . asakusafw . utils . graph . GraphsTest . addPath ( graph , 4 ) ; "<AssertPlaceHolder>" ; } collectHeads ( com . asakusafw . utils . graph . Graph ) { if ( graph == null ) { throw new java . lang . IllegalArgumentException ( "graph<sp>must<sp>not<sp>be<sp>null" ) ; } java . util . Set < V > results = new java . util . HashSet ( graph . getNodeSet ( ) ) ; for ( com . asakusafw . utils . graph . Graph . Vertex < ? extends V > vertex : graph ) { results . removeAll ( vertex . getConnected ( ) ) ; } return results ; }
|
org . junit . Assert . assertThat ( com . asakusafw . utils . graph . Graphs . collectHeads ( graph ) , is ( set ( 1 , 2 , 3 , 4 ) ) )
|
testWhitelistedCapabilities_noWhitelist ( ) { final com . spotify . helios . common . descriptors . Job job = com . spotify . helios . common . descriptors . Job . newBuilder ( ) . setName ( "foo" ) . setVersion ( "1" ) . setImage ( "foobar" ) . setAddCapabilities ( com . google . common . collect . ImmutableSet . of ( "cap1" , "cap2" ) ) . build ( ) ; "<AssertPlaceHolder>" ; } validate ( com . spotify . helios . common . descriptors . Job ) { final java . util . Set < java . lang . String > errors = com . google . common . collect . Sets . newHashSet ( ) ; errors . addAll ( validateJobId ( job ) ) ; errors . addAll ( validateJobImage ( job . getImage ( ) ) ) ; errors . addAll ( validateJobHostName ( job . getHostname ( ) ) ) ; final java . util . Set < java . lang . Integer > externalPorts = com . google . common . collect . Sets . newHashSet ( ) ; for ( final com . spotify . helios . common . descriptors . PortMapping mapping : job . getPorts ( ) . values ( ) ) { final java . lang . Integer externalMappedPort = mapping . getExternalPort ( ) ; if ( ( externalPorts . contains ( externalMappedPort ) ) && ( externalMappedPort != null ) ) { errors . add ( java . lang . String . format ( "/a" 9 , externalMappedPort ) ) ; } externalPorts . add ( externalMappedPort ) ; } for ( final Map . Entry < java . lang . String , com . spotify . helios . common . descriptors . PortMapping > entry : job . getPorts ( ) . entrySet ( ) ) { final java . lang . String name = entry . getKey ( ) ; final com . spotify . helios . common . descriptors . PortMapping mapping = entry . getValue ( ) ; if ( ! ( com . spotify . helios . common . JobValidator . PORT_MAPPING_PROTO_PATTERN . matcher ( mapping . getProtocol ( ) ) . matches ( ) ) ) { errors . add ( java . lang . String . format ( "/a" 6 , mapping . getProtocol ( ) ) ) ; } if ( ! ( legalPort ( mapping . getInternalPort ( ) ) ) ) { errors . add ( java . lang . String . format ( "Invalid<sp>internal<sp>port:<sp>%d" , mapping . getInternalPort ( ) ) ) ; } if ( ( ( mapping . getExternalPort ( ) ) != null ) && ( ! ( legalPort ( mapping . getExternalPort ( ) ) ) ) ) { errors . add ( java . lang . String . format ( "Invalid<sp>external<sp>port:<sp>%d" , mapping . getExternalPort ( ) ) ) ; } if ( ! ( com . spotify . helios . common . JobValidator . PORT_MAPPING_NAME_PATTERN . matcher ( name ) . matches ( ) ) ) { errors . add ( java . lang . String . format ( "Invalid<sp>port<sp>mapping<sp>endpoint<sp>name:<sp>%s" , name ) ) ; } } for ( final com . spotify . helios . common . descriptors . ServiceEndpoint registration : job . getRegistration ( ) . keySet ( ) ) { final com . spotify . helios . common . descriptors . ServicePorts servicePorts = job . getRegistration ( ) . get ( registration ) ; if ( ( servicePorts == null ) || ( ( servicePorts . getPorts ( ) ) == null ) ) { errors . add ( java . lang . String . format ( "/a" 3 , registration . getName ( ) ) ) ; continue ; } for ( final java . lang . String portName : servicePorts . getPorts ( ) . keySet ( ) ) { if ( ! ( job . getPorts ( ) . containsKey ( portName ) ) ) { errors . add ( java . lang . String . format ( "/a" 4 , registration , portName ) ) ; } if ( ! ( com . spotify . helios . common . JobValidator . REGISTRATION_NAME_PATTERN . matcher ( registration . getName ( ) ) . matches ( ) ) ) { errors . add ( java . lang . String . format ( "Invalid<sp>service<sp>registration<sp>name:<sp>%s" , registration . getName ( ) ) ) ; } } } for ( final Map . Entry < java . lang . String , java . lang . String > entry : job . getVolumes ( ) . entrySet ( ) ) { final java . lang . String path = entry . getKey ( ) ; final java . lang . String source = entry . getValue ( ) ; if ( ! ( path . startsWith ( "/a" 8 ) ) ) { errors . add ( ( "Volume<sp>path<sp>is<sp>not<sp>absolute:<sp>" + path ) ) ; continue ; } if ( ( source . contains ( "/a" 8 ) ) && ( ! ( source . startsWith ( "/a" 8 ) ) ) ) { errors . add ( ( "/a" 1 + source ) ) ; continue ; } final java . lang . String [ ] parts = path . split ( "/a" 0 , 3 ) ; if ( ( ( ( path . isEmpty ( ) ) || ( path . equals ( "/a" 8 ) ) ) || ( ( parts . length ) > 2 ) ) || ( ( ( parts . length ) > 1 ) && ( parts [ 1 ] . isEmpty ( ) ) ) ) { errors . add ( java . lang . String . format ( "Invalid<sp>volume<sp>path:<sp>%s" , path ) ) ; } } final java . util . Date expiry = job . getExpires ( ) ; final java . util . Date
|
org . junit . Assert . assertEquals ( 1 , validator . validate ( job ) . size ( ) )
|
testInvalidCompressionCodec ( ) { com . streamsets . pipeline . stage . destination . hdfs . HdfsDTarget dTarget = new com . streamsets . pipeline . stage . destination . hdfs . BaseHdfsTargetIT . ForTestHdfsTarget ( ) ; configure ( dTarget ) ; dTarget . hdfsTargetConfigBean . compression = CompressionMode . OTHER ; dTarget . hdfsTargetConfigBean . otherCompression = java . lang . String . class . getName ( ) ; com . streamsets . pipeline . stage . destination . hdfs . HdfsTarget target = ( ( com . streamsets . pipeline . stage . destination . hdfs . HdfsTarget ) ( dTarget . createTarget ( ) ) ) ; com . streamsets . pipeline . api . Target . Context context = com . streamsets . pipeline . sdk . ContextInfoCreator . createTargetContext ( com . streamsets . pipeline . stage . destination . hdfs . HdfsDTarget . class , "n" , false , OnRecordError . TO_ERROR , null ) ; "<AssertPlaceHolder>" ; } init ( com . streamsets . pipeline . stage . origin . eventhubs . Info , com . streamsets . pipeline . stage . origin . eventhubs . Context ) { java . util . List < com . streamsets . pipeline . stage . origin . eventhubs . ConfigIssue > issues = new java . util . ArrayList ( ) ; this . context = context ; consumerConfigBean . dataFormatConfig . stringBuilderPoolSize = getNumberOfThreads ( ) ; consumerConfigBean . dataFormatConfig . init ( context , consumerConfigBean . dataFormat , Groups . DATA_FORMAT . name ( ) , "dataFormatConfig" , DataFormatConstants . MAX_OVERRUN_LIMIT , issues ) ; parserFactory = consumerConfigBean . dataFormatConfig . getParserFactory ( ) ; errorQueue = new java . util . concurrent . ArrayBlockingQueue ( 100 ) ; errorList = new java . util . ArrayList ( 100 ) ; if ( ( issues . size ( ) ) == 0 ) { try { com . microsoft . azure . eventhubs . EventHubClient ehClient = eventHubCommon . createEventHubClient ( "event-hub-consumer-pool-%d" ) ; com . microsoft . azure . eventhubs . EventHubRuntimeInformation ehInfo = ehClient . getRuntimeInformation ( ) . get ( ) ; ehClient . close ( ) . get ( ) ; } catch ( java . lang . Exception e ) { issues . add ( context . createConfigIssue ( Groups . EVENT_HUB . toString ( ) , EventHubCommon . CONF_NAME_SPACE , Errors . EVENT_HUB_02 , e . getMessage ( ) ) ) ; } } return issues ; }
|
org . junit . Assert . assertEquals ( 1 , target . init ( null , context ) . size ( ) )
|
testLijstControleGeenNok ( ) { setup ( java . util . Collections . < nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst > emptyList ( ) , true , false , true ) ; "<AssertPlaceHolder>" ; } setup ( java . util . List , boolean , boolean , boolean ) { org . mockito . Mockito . when ( plZoekerOpAnummerObvActueelAnummer . zoek ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) ) ) . thenReturn ( plZoekerOpAnummerObvActueelAnummerResult ) ; org . mockito . Mockito . when ( verzoekControleOudAnummerIsNietGevuld . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . bericht . model . sync . impl . SynchroniseerNaarBrpVerzoekBericht . class ) ) ) . thenReturn ( verzoekControleOudAnummerIsNietGevuldResult ) ; org . mockito . Mockito . when ( lijstControleGeen . controleer ( org . mockito . Matchers . anyListOf ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( lijstControleGeenResult ) ; org . mockito . Mockito . when ( plControleAnummerHistorischGelijk . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( plControleAnummerHistorischGelijkResult ) ; }
|
org . junit . Assert . assertFalse ( subject . controleer ( new nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext ( null , null , null , null ) ) )
|
shouldWriteWithComplexId ( ) { org . springframework . data . crate . core . convert . MappingCrateConverterTest . Country country = new org . springframework . data . crate . core . convert . MappingCrateConverterTest . Country ( "languages" 1 , java . util . Arrays . asList ( new org . springframework . data . crate . core . convert . MappingCrateConverterTest . Language ( "aLanguage" ) ) ) ; org . springframework . data . crate . core . convert . MappingCrateConverterTest . Address address = new org . springframework . data . crate . core . convert . MappingCrateConverterTest . Address ( ) ; address . country = country ; address . city = "languages" 3 ; address . street = "languages" 6 ; org . springframework . data . crate . core . convert . MappingCrateConverterTest . Person person = new org . springframework . data . crate . core . convert . MappingCrateConverterTest . Person ( ) ; person . name = "aName" ; person . address = address ; person . emails = new java . util . HashSet < org . springframework . data . crate . core . convert . MappingCrateConverterTest . Email > ( java . util . Arrays . asList ( new org . springframework . data . crate . core . convert . MappingCrateConverterTest . Email ( "languages" 2 ) ) ) ; org . springframework . data . crate . core . convert . MappingCrateConverterTest . ComplexId entity = new org . springframework . data . crate . core . convert . MappingCrateConverterTest . ComplexId ( ) ; entity . pk = person ; entity . string = "STRING" ; org . springframework . data . crate . core . mapping . CrateDocument languageDocument = new org . springframework . data . crate . core . mapping . CrateDocument ( "name" , "aLanguage" ) ; org . springframework . data . crate . core . mapping . CrateDocument emailDocument = new org . springframework . data . crate . core . mapping . CrateDocument ( "email" , "languages" 2 ) ; org . springframework . data . crate . core . mapping . CrateArray languagesArray = new org . springframework . data . crate . core . mapping . CrateArray ( languageDocument ) ; org . springframework . data . crate . core . mapping . CrateArray emailsArray = new org . springframework . data . crate . core . mapping . CrateArray ( emailDocument ) ; org . springframework . data . crate . core . mapping . CrateDocument countryDocument = new org . springframework . data . crate . core . mapping . CrateDocument ( ) ; countryDocument . put ( "name" , "languages" 1 ) ; countryDocument . put ( "languages" , languagesArray ) ; org . springframework . data . crate . core . mapping . CrateDocument addressDocument = new org . springframework . data . crate . core . mapping . CrateDocument ( ) ; addressDocument . put ( "country" , countryDocument ) ; addressDocument . put ( "city" , "languages" 3 ) ; addressDocument . put ( "street" , "languages" 6 ) ; org . springframework . data . crate . core . mapping . CrateDocument personDocument = new org . springframework . data . crate . core . mapping . CrateDocument ( ) ; personDocument . put ( "name" , "aName" ) ; personDocument . put ( "languages" 4 , addressDocument ) ; personDocument . put ( "emails" , emailsArray ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( org . springframework . data . crate . core . convert . CrateTypeMapper . DEFAULT_TYPE_KEY , org . springframework . data . crate . core . convert . MappingCrateConverterTest . ComplexId . class . getName ( ) ) ; expected . put ( "languages" 5 , "STRING" ) ; expected . put ( "languages" 0 , personDocument ) ; org . springframework . data . crate . core . mapping . CrateDocument document = new org . springframework . data . crate . core . mapping . CrateDocument ( ) ; converter . write ( entity , document ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( obj instanceof org . springframework . data . sample . entities . integration . EntityWithNesting ) ) { return false ; } if ( ( this ) == obj ) { return true ; } org . springframework . data . sample . entities . integration . EntityWithNesting that = ( ( org . springframework . data . sample . entities . integration . EntityWithNesting ) ( obj ) ) ; return new org . apache . commons . lang3 . builder . EqualsBuilder ( ) . append ( this . id , that . id ) . append ( this . name , that . name ) . append ( this . country , that . country ) . append ( this . map , that . map ) . append ( this . integers , that . integers ) . isEquals ( ) ; }
|
org . junit . Assert . assertThat ( expected . equals ( document ) , org . hamcrest . Matchers . is ( true ) )
|
testSelectMinKeyValue ( ) { logger . info ( "selectMaxKeyValue" ) ; com . datumbox . framework . common . dataobjects . AssociativeArray keyValueMap = new com . datumbox . framework . common . dataobjects . AssociativeArray ( ) ; keyValueMap . put ( "1" , 1 ) ; keyValueMap . put ( "2" , 2 ) ; keyValueMap . put ( "5" , 5 ) ; keyValueMap . put ( "3" , 3 ) ; keyValueMap . put ( "4" , 4 ) ; Map . Entry < java . lang . Object , java . lang . Object > expResult = new java . util . AbstractMap . SimpleEntry < > ( "1" , 1 ) ; Map . Entry < java . lang . Object , java . lang . Object > result = com . datumbox . framework . core . common . utilities . MapMethods . selectMinKeyValue ( keyValueMap ) ; "<AssertPlaceHolder>" ; } selectMinKeyValue ( com . datumbox . framework . common . dataobjects . AssociativeArray ) { java . lang . Double minValue = Double . POSITIVE_INFINITY ; java . lang . Object minValueKey = null ; for ( Map . Entry < java . lang . Object , java . lang . Object > entry : keyValueMap . entrySet ( ) ) { java . lang . Double value = com . datumbox . framework . common . dataobjects . TypeInference . toDouble ( entry . getValue ( ) ) ; if ( ( value != null ) && ( value < minValue ) ) { minValue = value ; minValueKey = entry . getKey ( ) ; } } return new com . datumbox . framework . core . common . utilities . AbstractMap . SimpleEntry < > ( minValueKey , keyValueMap . get ( minValueKey ) ) ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
test ( ) { io . protostuff . runtime . ProtobufCompatibleUtils . init ( ) ; java . util . Map < java . lang . String , java . lang . String > stringMap = new java . util . HashMap ( ) ; stringMap . put ( "k1" , "v1" ) ; stringMap . put ( "k2" , "v2" ) ; java . util . Map < java . lang . String , io . protostuff . runtime . model . User > userMap = new java . util . HashMap ( ) ; userMap . put ( "u1" , new io . protostuff . runtime . model . User ( "n1" ) ) ; userMap . put ( "u2" , new io . protostuff . runtime . model . User ( "n2" ) ) ; byte [ ] protostuffBytes = testProtostuff ( stringMap , userMap ) ; io . protostuff . runtime . model . ModelProtobuf . RequestHeader r = ModelProtobuf . RequestHeader . newBuilder ( ) . putAllCseContext ( stringMap ) . putUserMap ( "u1" , ModelProtobuf . User . newBuilder ( ) . setName ( "n1" ) . build ( ) ) . putUserMap ( "u2" , ModelProtobuf . User . newBuilder ( ) . setName ( "n2" ) . build ( ) ) . addList ( "l1" ) . addList ( "l2" ) . build ( ) ; byte [ ] protoBufBytes = r . toByteArray ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return this ; }
|
org . junit . Assert . assertArrayEquals ( protostuffBytes , protoBufBytes )
|
deserialize_multiple ( ) { java . lang . String json = "[" + ( ( ( ( ( ( ( ( ( ( ( ( "[\"vcard\"," + "[" ) + "[\"version\",<sp>{},<sp>\"text\",<sp>\"4.0\"]," ) + "[\"fn\",<sp>{},<sp>\"text\",<sp>\"John<sp>Doe\"]" ) + "]" ) + "]," ) + "[\"vcard\"," ) + "[" ) + "[\"version\",<sp>{},<sp>\"text\",<sp>\"4.0\"]," ) + "[\"fn\",<sp>{},<sp>\"text\",<sp>\"Jane<sp>Doe\"]" ) + "]" ) + "]" ) + "]" ) ; ezvcard . io . json . JCardModule module = new ezvcard . io . json . JCardModule ( ) ; mapper . registerModule ( module ) ; java . util . List < ezvcard . VCard > expected = new java . util . ArrayList < ezvcard . VCard > ( ) ; ezvcard . VCard vcard = new ezvcard . VCard ( ) ; vcard . setVersion ( VCardVersion . V4_0 ) ; vcard . setFormattedName ( "John<sp>Doe" ) ; expected . add ( vcard ) ; vcard = new ezvcard . VCard ( ) ; vcard . setVersion ( VCardVersion . V4_0 ) ; vcard . setFormattedName ( "Jane<sp>Doe" ) ; expected . add ( vcard ) ; java . util . List < ezvcard . VCard > actual = mapper . readValue ( json , new com . fasterxml . jackson . core . type . TypeReference < java . util . List < ezvcard . VCard > > ( ) { } ) ; "<AssertPlaceHolder>" ; } add ( ezvcard . VCard ) { vcards . add ( vcard ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testEmptyQualifiedName ( ) { org . eclipse . xtext . naming . QualifiedName empty = org . eclipse . xtext . naming . QualifiedName . EMPTY ; java . lang . String converted = factory . convertToString ( dataType , empty ) ; "<AssertPlaceHolder>" ; } convertToString ( org . eclipse . emf . ecore . EDataType , java . lang . Object ) { switch ( eDataType . getClassifierID ( ) ) { case org . eclipse . xtext . builder . builderState . BuilderStatePackage . EURI : return convertEURIToString ( eDataType , instanceValue ) ; case org . eclipse . xtext . builder . builderState . BuilderStatePackage . ESTRING_ARRAY : return convertEStringArrayToString ( eDataType , instanceValue ) ; case org . eclipse . xtext . builder . builderState . BuilderStatePackage . QUALIFIED_NAME : return convertQualifiedNameToString ( eDataType , instanceValue ) ; default : throw new java . lang . IllegalArgumentException ( ( ( "The<sp>datatype<sp>'" + ( eDataType . getName ( ) ) ) + "'<sp>is<sp>not<sp>a<sp>valid<sp>classifier" ) ) ; } }
|
org . junit . Assert . assertNotNull ( converted )
|
getMosaicsReturnsAllMosaicsWhenNonXemMosaicsArePresent ( ) { final org . nem . core . model . TransferTransaction transaction = this . createTransferWithMosaics ( org . nem . core . model . TransferTransactionTest . AbstractTransferTransactionTest . ONE_POINT_TWO_XEM , false ) ; final org . nem . core . model . Collection < org . nem . core . model . Mosaic > mosaics = transaction . getMosaics ( ) ; final org . nem . core . model . Collection < org . nem . core . model . Mosaic > expectedMosaics = org . nem . core . model . Arrays . asList ( org . nem . core . model . Utils . createMosaic ( 7 , 14 ) , org . nem . core . model . Utils . createMosaic ( 11 , 6 ) , org . nem . core . model . Utils . createMosaic ( 9 , 28 ) ) ; "<AssertPlaceHolder>" ; } equivalentTo ( T [ ] ) { return new org . nem . core . test . IsEquivalent ( array ) ; }
|
org . junit . Assert . assertThat ( mosaics , org . nem . core . model . IsEquivalent . equivalentTo ( expectedMosaics ) )
|
testRemoveNotSupported ( ) { org . openehealth . ipf . platform . camel . core . process . splitter . support . TextFileIterator iterator = new org . openehealth . ipf . platform . camel . core . process . splitter . support . TextFileIterator ( file . getAbsolutePath ( ) ) ; try { iterator . remove ( ) ; } finally { "<AssertPlaceHolder>" ; } } isClosed ( ) { return closed ; }
|
org . junit . Assert . assertTrue ( iterator . isClosed ( ) )
|
testCalculateTargetIops ( ) { long writeIops = writeIopsCalculator . calculateTargetIops ( ) ; long expectedWriteIops = ( ( long ) ( ( ( org . apache . hadoop . dynamodb . write . WriteIopsCalculatorTest . WRITE_CAPACITY_UNITS ) * ( org . apache . hadoop . dynamodb . write . WriteIopsCalculatorTest . THROUGHPUT_WRITE_PERCENT ) ) / ( java . lang . Math . min ( org . apache . hadoop . dynamodb . write . WriteIopsCalculatorTest . MAX_CONCURRENT_MAP_TASKS , org . apache . hadoop . dynamodb . write . WriteIopsCalculatorTest . TOTAL_MAP_TASKS ) ) ) ) ; "<AssertPlaceHolder>" ; } calculateTargetIops ( ) { double configuredThroughput = java . lang . Math . floor ( ( ( java . lang . Double . parseDouble ( jobConf . get ( DynamoDBConstants . READ_THROUGHPUT , java . lang . String . valueOf ( getThroughput ( ) ) ) ) ) * ( throughputPercent ) ) ) ; long throughputPerTask = java . lang . Math . max ( ( ( long ) ( ( configuredThroughput / ( totalSegments ) ) * ( localSegments ) ) ) , 1 ) ; org . apache . hadoop . dynamodb . read . ReadIopsCalculator . log . info ( ( ( ( "Throughput<sp>per<sp>task<sp>for<sp>table<sp>" + ( tableName ) ) + "<sp>:<sp>" ) + throughputPerTask ) ) ; return throughputPerTask ; }
|
org . junit . Assert . assertEquals ( expectedWriteIops , writeIops )
|
testWrapper ( ) { final nl . bzk . brp . domain . leveringmodel . MetaObject persoon = nl . bzk . brp . domain . leveringmodel . helper . TestBuilders . LEEG_PERSOON ; final nl . bzk . brp . service . maakbericht . algemeen . Berichtgegevens berichtgegevens = maakBerichtgegevens ( persoon , maakAutorisatieBundel ( ) , SoortSynchronisatie . VOLLEDIG_BERICHT ) ; new nl . bzk . brp . service . maakbericht . AutorisatieAlles ( berichtgegevens ) ; final nl . bzk . brp . service . maakbericht . builders . BerichtBuilder berichtBuilder = new nl . bzk . brp . service . maakbericht . builders . BerichtBuilder ( berichtgegevens , 1 ) ; final nl . bzk . brp . domain . berichtmodel . BerichtElement berichtElement = berichtBuilder . build ( persoon ) ; "<AssertPlaceHolder>" ; } build ( java . lang . String ) { return new nl . bzk . brp . testrunner . jbehave . BrpStoryReporter ( super . build ( storyPath ) ) ; }
|
org . junit . Assert . assertNotNull ( berichtElement )
|
testParseEnabledErr ( ) { queriesString = "type=node&enabled=aaa" ; target = new org . o3project . odenos . core . component . network . flow . query . BasicFlowQuery ( queriesString ) ; "<AssertPlaceHolder>" ; } parse ( ) { if ( ! ( super . parse ( ) ) ) { return false ; } if ( ! ( org . o3project . odenos . core . component . network . BasicQuery . checkMapExactly ( this . actions , new java . lang . String [ ] { } ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertThat ( target . parse ( ) , org . hamcrest . CoreMatchers . is ( false ) )
|
differentValueGivesDifferentHashcode ( ) { stormpot . Timeout a = new stormpot . Timeout ( 1 , java . util . concurrent . TimeUnit . SECONDS ) ; stormpot . Timeout b = new stormpot . Timeout ( 2 , java . util . concurrent . TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return 31 * ( 1 + ( ( int ) ( ( timeoutBase ) ^ ( ( timeoutBase ) > > > 32 ) ) ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( a . hashCode ( ) ) != ( b . hashCode ( ) ) ) )
|
nonIntegralNumberValueWriter ( ) { final java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; final javax . json . JsonWriter writer = javax . json . Json . createWriter ( out ) ; final javax . json . JsonValue value = javax . json . Json . createValue ( new java . math . BigDecimal ( "123.456" ) ) ; writer . write ( value ) ; writer . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { flush ( ) ; }
|
org . junit . Assert . assertEquals ( "123.456" , new java . lang . String ( out . toByteArray ( ) ) )
|
test_minute_shouldReturnNull ( ) { java . lang . Integer actual = org . openl . util . DateTool . minute ( null ) ; "<AssertPlaceHolder>" ; } minute ( java . util . Date ) { if ( d == null ) { return null ; } java . util . Calendar c = java . util . Calendar . getInstance ( ) ; c . setTime ( d ) ; return c . get ( Calendar . MINUTE ) ; }
|
org . junit . Assert . assertNull ( actual )
|
testName_Gets_Name_From_Element ( ) { mmarquee . automation . AutomationElement element = org . mockito . Mockito . mock ( mmarquee . automation . AutomationElement . class ) ; mmarquee . automation . pattern . ItemContainer pattern = org . mockito . Mockito . mock ( mmarquee . automation . pattern . ItemContainer . class ) ; when ( element . getName ( ) ) . thenReturn ( "NAME" ) ; mmarquee . automation . uiautomation . IUIAutomation mocked_automation = org . mockito . Mockito . mock ( mmarquee . automation . uiautomation . IUIAutomation . class ) ; mmarquee . automation . UIAutomation instance = new mmarquee . automation . UIAutomation ( mocked_automation ) ; mmarquee . automation . controls . AutomationStatusBar statusBar = new mmarquee . automation . controls . AutomationStatusBar ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( pattern ) . automation ( instance ) ) ; java . lang . String name = statusBar . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return this . name ; }
|
org . junit . Assert . assertTrue ( name . equals ( "NAME" ) )
|
testInteger ( ) { final int expected = 2 ; byte [ ] raw = org . apache . metron . common . utils . SerDeUtils . toBytes ( expected ) ; int actual = org . apache . metron . common . utils . SerDeUtils . fromBytes ( raw , org . apache . metron . common . utils . Integer . class ) ; "<AssertPlaceHolder>" ; } fromBytes ( byte [ ] , java . lang . Class ) { try { com . esotericsoftware . kryo . io . Input input = new com . esotericsoftware . kryo . io . Input ( new java . io . ByteArrayInputStream ( value ) ) ; return clazz . cast ( org . apache . metron . common . utils . SerDeUtils . kryo . get ( ) . readClassAndObject ( input ) ) ; } catch ( java . lang . Throwable t ) { org . apache . metron . common . utils . SerDeUtils . LOG . error ( "Unable<sp>to<sp>deserialize<sp>because<sp>{}" , t . getMessage ( ) , t ) ; throw t ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
verifyStapANaluLengths_TwoNal_ShouldPass ( ) { int [ ] naluSizes = new int [ ] { 10 , 10 } ; "<AssertPlaceHolder>" ; } buildAndVerifyStapA ( int [ ] , int ) { return buildAndVerifyStapA ( naluSizes , offset , packetLength ( naluSizes ) ) ; }
|
org . junit . Assert . assertTrue ( buildAndVerifyStapA ( naluSizes , 1 ) )
|
shouldReturnFalseWhenCurrencyGlobalIsSelected ( ) { given ( costCalculation . getStringField ( CostCalculationFields . SOURCE_OF_MATERIAL_COSTS ) ) . willReturn ( SourceOfMaterialCosts . CURRENT_GLOBAL_DEFINITIONS_IN_PRODUCT . getStringValue ( ) ) ; given ( costCalculation . getStringField ( CostCalculationFields . CALCULATE_MATERIAL_COSTS_MODE ) ) . willReturn ( CalculateMaterialCostsMode . COST_FOR_ORDER . getStringValue ( ) ) ; boolean result = costCalculationValidators . checkIfCurrentGlobalIsSelected ( costCalculationDD , costCalculation ) ; "<AssertPlaceHolder>" ; } checkIfCurrentGlobalIsSelected ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { java . lang . String sourceOfMaterialCosts = costCalculation . getStringField ( CostCalculationFields . SOURCE_OF_MATERIAL_COSTS ) ; java . lang . String calculateMaterialCostsMode = costCalculation . getStringField ( CostCalculationFields . CALCULATE_MATERIAL_COSTS_MODE ) ; if ( ( SourceOfMaterialCosts . CURRENT_GLOBAL_DEFINITIONS_IN_PRODUCT . getStringValue ( ) . equals ( sourceOfMaterialCosts ) ) && ( CalculateMaterialCostsMode . COST_FOR_ORDER . getStringValue ( ) . equals ( calculateMaterialCostsMode ) ) ) { costCalculation . addError ( costCalculationDD . getField ( CostCalculationFields . CALCULATE_MATERIAL_COSTS_MODE ) , "costCalculation.messages.optionUnavailable" ) ; return false ; } return true ; }
|
org . junit . Assert . assertFalse ( result )
|
shouldBeAbleToWriteValuesGreaterThanHalfTheBufferSize ( ) { final java . io . File firstFile = new java . io . File ( directory . directory ( ) , "file1" ) ; org . neo4j . io . fs . StoreChannel storeChannel = fileSystemRule . get ( ) . open ( firstFile , OpenMode . READ_WRITE ) ; org . neo4j . kernel . impl . transaction . log . PhysicalLogVersionedStoreChannel versionedStoreChannel = new org . neo4j . kernel . impl . transaction . log . PhysicalLogVersionedStoreChannel ( storeChannel , 1 , ( ( byte ) ( - 1 ) ) ) ; org . neo4j . kernel . impl . transaction . log . PhysicalFlushableChannel channel = new org . neo4j . kernel . impl . transaction . log . PhysicalFlushableChannel ( versionedStoreChannel ) ; int length = 262145 ; byte [ ] bytes = generateBytes ( length ) ; channel . put ( bytes , length ) ; channel . close ( ) ; byte [ ] writtenBytes = new byte [ length ] ; try ( java . io . InputStream in = new java . io . FileInputStream ( firstFile ) ) { in . read ( writtenBytes ) ; } "<AssertPlaceHolder>" ; } read ( java . nio . ByteBuffer ) { if ( ( readPosition ) == ( writePosition ) ) { return eof ? - 1 : 0 ; } buffer . position ( readPosition ) ; int originalPosition = readPosition ; int originalLimit = buffer . limit ( ) ; buffer . limit ( java . lang . Math . min ( ( ( buffer . position ( ) ) + ( ( dst . limit ( ) ) - ( dst . position ( ) ) ) ) , writePosition ) ) ; dst . put ( buffer ) ; readPosition = buffer . position ( ) ; buffer . limit ( originalLimit ) ; return ( readPosition ) - originalPosition ; }
|
org . junit . Assert . assertArrayEquals ( bytes , writtenBytes )
|
testSubstVarsRecursive ( ) { context . putProperty ( "v1" , "if" ) ; context . putProperty ( "v2" , "${v3}" ) ; context . putProperty ( "v3" , "works" ) ; java . lang . String result = ch . qos . logback . core . util . OptionHelper . substVars ( text , context ) ; "<AssertPlaceHolder>" ; } substVars ( java . lang . String , ch . qos . logback . core . spi . PropertyContainer ) { return ch . qos . logback . core . util . OptionHelper . substVars ( val , pc1 , null ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testMath226 ( ) { double [ ] mean = new double [ ] { 1 , 1 , 10 , 1 } ; double [ ] [ ] cov = new double [ ] [ ] { new double [ ] { 1 , 3 , 2 , 6 } , new double [ ] { 3 , 13 , 16 , 2 } , new double [ ] { 2 , 16 , 38 , - 1 } , new double [ ] { 6 , 2 , - 1 , 197 } } ; org . apache . commons . math3 . linear . RealMatrix covRM = org . apache . commons . math3 . linear . MatrixUtils . createRealMatrix ( cov ) ; org . apache . commons . math3 . random . JDKRandomGenerator jg = new org . apache . commons . math3 . random . JDKRandomGenerator ( ) ; jg . setSeed ( 5322145245211L ) ; org . apache . commons . math3 . random . NormalizedRandomGenerator rg = new org . apache . commons . math3 . random . GaussianRandomGenerator ( jg ) ; org . apache . commons . math3 . random . CorrelatedRandomVectorGenerator sg = new org . apache . commons . math3 . random . CorrelatedRandomVectorGenerator ( mean , covRM , 1.0E-5 , rg ) ; double [ ] min = new double [ mean . length ] ; java . util . Arrays . fill ( min , Double . POSITIVE_INFINITY ) ; double [ ] max = new double [ mean . length ] ; java . util . Arrays . fill ( max , Double . NEGATIVE_INFINITY ) ; for ( int i = 0 ; i < 10 ; i ++ ) { double [ ] generated = sg . nextVector ( ) ; for ( int j = 0 ; j < ( generated . length ) ; ++ j ) { min [ j ] = org . apache . commons . math3 . util . FastMath . min ( min [ j ] , generated [ j ] ) ; max [ j ] = org . apache . commons . math3 . util . FastMath . max ( max [ j ] , generated [ j ] ) ; } } for ( int j = 0 ; j < ( min . length ) ; ++ j ) { "<AssertPlaceHolder>" ; } } max ( java . lang . Comparable , java . lang . Comparable ) { if ( ( c1 != null ) && ( c2 != null ) ) { return ( c1 . compareTo ( c2 ) ) >= 0 ? c1 : c2 ; } else { return c1 != null ? c1 : c2 ; } }
|
org . junit . Assert . assertTrue ( ( ( ( max [ j ] ) - ( min [ j ] ) ) > 2.0 ) )
|
testLastHourNext ( ) { org . jfree . data . time . Hour last = new org . jfree . data . time . Hour ( 23 , new org . jfree . data . time . Day ( 31 , org . jfree . date . MonthConstants . DECEMBER , 9999 ) ) ; org . jfree . data . time . Hour next = ( ( org . jfree . data . time . Hour ) ( last . next ( ) ) ) ; "<AssertPlaceHolder>" ; } next ( ) { org . jfree . data . time . Month result ; if ( ( this . month ) != ( org . jfree . date . MonthConstants . DECEMBER ) ) { result = new org . jfree . data . time . Month ( ( ( this . month ) + 1 ) , this . year ) ; } else { if ( ( this . year ) < 9999 ) { result = new org . jfree . data . time . Month ( org . jfree . date . MonthConstants . JANUARY , ( ( this . year ) + 1 ) ) ; } else { result = null ; } } return result ; }
|
org . junit . Assert . assertNull ( next )
|
testExecuteScheduledAlerts_ForMoreThanOneTimeSeries ( ) { com . salesforce . dva . argus . service . UserService userService = system . getServiceFactory ( ) . getUserService ( ) ; final java . util . concurrent . atomic . AtomicInteger notificationCount = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; final java . util . concurrent . atomic . AtomicInteger clearCount = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; com . salesforce . dva . argus . entity . Metric metric1 = new com . salesforce . dva . argus . entity . Metric ( "30" 6 , "metric" ) ; java . util . Map < java . lang . Long , java . lang . String > dps1 = new java . util . HashMap < java . lang . Long , java . lang . String > ( ) ; dps1 . put ( 1000L , "30" 0 ) ; dps1 . put ( 2000L , "30" 1 ) ; dps1 . put ( 3000L , "3" ) ; metric1 . setDatapoints ( _convertDatapoints ( dps1 ) ) ; com . salesforce . dva . argus . entity . Metric metric2 = new com . salesforce . dva . argus . entity . Metric ( "scope2" , "metric" ) ; java . util . Map < java . lang . Long , java . lang . String > dps2 = new java . util . HashMap < java . lang . Long , java . lang . String > ( ) ; dps2 . put ( 4000L , "11" ) ; dps2 . put ( 5000L , "30" 4 ) ; dps2 . put ( 6000L , "30" ) ; metric2 . setDatapoints ( _convertDatapoints ( dps2 ) ) ; com . salesforce . dva . argus . entity . Alert alert = new com . salesforce . dva . argus . entity . Alert ( userService . findAdminUser ( ) , userService . findAdminUser ( ) , "testAlert" , "-1h:scope:metric:avg" , "*<sp>*<sp>*<sp>*<sp>*" ) ; _setAlertId ( alert , "30" 5 ) ; com . salesforce . dva . argus . entity . Trigger trigger = new com . salesforce . dva . argus . entity . Trigger ( alert , com . salesforce . dva . argus . entity . Trigger . TriggerType . GREATER_THAN_OR_EQ , "testTrigger" , 10 , 0 ) ; _setTriggerId ( trigger , "100002" ) ; com . salesforce . dva . argus . entity . Notification notification = new com . salesforce . dva . argus . entity . Notification ( "30" 2 , alert , com . salesforce . dva . argus . service . alert . notifier . AuditNotifier . class . getName ( ) , new java . util . ArrayList < java . lang . String > ( ) , 0 ) ; _setNotificationId ( notification , "30" 3 ) ; alert . setTriggers ( java . util . Arrays . asList ( new com . salesforce . dva . argus . entity . Trigger [ ] { trigger } ) ) ; alert . setNotifications ( java . util . Arrays . asList ( new com . salesforce . dva . argus . entity . Notification [ ] { notification } ) ) ; notification . setTriggers ( alert . getTriggers ( ) ) ; alert . setEnabled ( true ) ; com . salesforce . dva . argus . service . alert . DefaultAlertService spyAlertService = _initializeSpyAlertServiceWithStubs ( notificationCount , clearCount , java . util . Arrays . asList ( metric1 , metric2 ) , alert , notification ) ; spyAlertService . executeScheduledAlerts ( 10 , 1000 ) ; "<AssertPlaceHolder>" ; } executeScheduledAlerts ( int , int ) { requireNotDisposed ( ) ; requireArgument ( ( alertCount > 0 ) , "Alert<sp>count<sp>must<sp>be<sp>greater<sp>than<sp>zero." ) ; requireArgument ( ( timeout > 0 ) , "Timeout<sp>in<sp>milliseconds<sp>must<sp>be<sp>greater<sp>than<sp>zero." ) ; java . util . List < com . salesforce . dva . argus . entity . History > historyList = new java . util . ArrayList ( ) ; java . util . List < com . salesforce . dva . argus . service . alert . DefaultAlertService . AlertWithTimestamp > alertsWithTimestamp = _mqService . dequeue ( com . salesforce . dva . argus . service . alert . ALERT . getQueueName ( ) , com . salesforce . dva . argus . service . alert . DefaultAlertService . AlertWithTimestamp . class , timeout , alertCount ) ; java . util . List < com . salesforce . dva . argus . entity . Notification > allNotifications = new java . util . ArrayList ( ) ; java . util . Map < java . math . BigInteger , com . salesforce . dva . argus . entity . Alert > alertsByNotificationId = new java . util . HashMap ( ) ; java . util . Map < java . math . BigInteger , java . lang . Long > alertEnqueueTimestampsByAlertId = new java . util . HashMap ( ) ; for ( com . salesforce . dva . argus . service . alert . DefaultAlertService . AlertWithTimestamp alertWithTimestamp : alertsWithTimestamp ) { java . lang . String serializedAlert = alertWithTimestamp . getSerializedAlert ( ) ; com . salesforce . dva . argus . entity . Alert alert ; try { alert = _mapper . readValue ( serializedAlert , com . salesforce . dva . argus . entity . Alert . class ) ; } catch ( java . lang . Exception e ) { java . lang . String logMessage = java . text . MessageFormat . format ( "Failed<sp>to<sp>deserialize<sp>alert<sp>{0}.<sp>Full<sp>stack<sp>trace<sp>of<sp>exception<sp>{1}" , serializedAlert , org . apache . commons . lang . exception . ExceptionUtils . getFullStackTrace ( e ) ) ; _logger . warn ( logMessage ) ; logAlertStatsOnFailure ( com . salesforce . dva . argus . service . alert . DefaultAlertService . DEFAULTALERTID , com . salesforce
|
org . junit . Assert . assertEquals ( 1 , notificationCount . get ( ) )
|
testGetFiles ( ) { org . apromore . filestore . client . DavFile dir = new org . apromore . filestore . client . DavFile ( new org . apromore . filestore . client . DavFileSystemViewUnitTest . TestDavResource ( ) ) ; java . io . File [ ] files = fsView . getFiles ( dir , false ) ; "<AssertPlaceHolder>" ; for ( int i = 0 ; i < 39 ; i ++ ) { org . apromore . filestore . client . DavFileSystemViewUnitTest . LOGGER . info ( ( ( ( "File<sp>#" + i ) + "<sp>=" ) + ( files [ i ] ) ) ) ; } } getFiles ( java . io . File , boolean ) { org . apromore . filestore . client . DavFileSystemView . LOGGER . info ( ( "Get<sp>files<sp>in<sp>" + dir ) ) ; java . util . ArrayList < java . io . File > fileList = new java . util . ArrayList ( ) ; try { java . lang . String s = dir . toString ( ) ; java . net . URI uri ; if ( "/" . equals ( s ) ) { uri = service . getBaseURI ( ) ; } else { uri = service . getBaseURI ( ) . resolve ( dir . toString ( ) ) ; } org . apromore . filestore . client . DavFileSystemView . LOGGER . info ( ( "Get<sp>files<sp>at<sp>" + uri ) ) ; for ( com . github . sardine . DavResource resource : service . list ( uri . toString ( ) ) ) { org . apromore . filestore . client . DavFileSystemView . LOGGER . info ( ( ( ( "<sp>Got<sp>file<sp>\"" + resource ) + "\"<sp>name=\"" ) + ( resource . getName ( ) ) ) ) ; org . apromore . filestore . client . DavFile davFile = new org . apromore . filestore . client . DavFile ( resource ) ; if ( davFile . isHidden ( ) ) { org . apromore . filestore . client . DavFileSystemView . LOGGER . info ( ( ( "<sp>Skipping<sp>\"" + resource ) + "\"" ) ) ; continue ; } fileList . add ( davFile ) ; } } catch ( java . lang . Exception e ) { org . apromore . filestore . client . DavFileSystemView . LOGGER . log ( org . apromore . filestore . client . SEVERE , "Unable<sp>to<sp>iterate<sp>through<sp>DAV<sp>files" , e ) ; } final java . io . File [ ] dummy = new java . io . File [ ] { } ; return fileList . toArray ( dummy ) ; }
|
org . junit . Assert . assertEquals ( 39 , files . length )
|
create ( ) { com . foxinmy . weixin4j . qy . model . Party Party = new com . foxinmy . weixin4j . qy . model . Party ( 1 , "" , 1 ) ; int id = partyApi . createParty ( Party ) ; "<AssertPlaceHolder>" ; } createParty ( com . foxinmy . weixin4j . qy . model . Party ) { java . lang . String department_create_uri = getRequestUri ( "department_create_uri" ) ; com . alibaba . fastjson . JSONObject obj = ( ( com . alibaba . fastjson . JSONObject ) ( com . alibaba . fastjson . JSON . toJSON ( party ) ) ) ; if ( ( party . getParentId ( ) ) < 1 ) { obj . remove ( "parentid" ) ; } if ( ( party . getId ( ) ) < 1 ) { obj . remove ( "id" ) ; } com . foxinmy . weixin4j . model . Token token = tokenManager . getCache ( ) ; com . foxinmy . weixin4j . http . weixin . WeixinResponse response = weixinExecutor . post ( java . lang . String . format ( department_create_uri , token . getAccessToken ( ) ) , obj . toJSONString ( ) ) ; return response . getAsJson ( ) . getIntValue ( "id" ) ; }
|
org . junit . Assert . assertTrue ( ( id > 0 ) )
|
testStreamQueryExecutionChangelog ( ) { final java . net . URL url = getClass ( ) . getClassLoader ( ) . getResource ( "test-data.csv" ) ; java . util . Objects . requireNonNull ( url ) ; final java . util . Map < java . lang . String , java . lang . String > replaceVars = new java . util . HashMap ( ) ; replaceVars . put ( "$VAR_SOURCE_PATH1" , url . getPath ( ) ) ; replaceVars . put ( "(true,27,Hello<sp>World)" 3 , "streaming" ) ; replaceVars . put ( "$VAR_RESULT_MODE" , "(true,27,Hello<sp>World)" 1 ) ; replaceVars . put ( "$VAR_UPDATE_MODE" , "update-mode:<sp>append" ) ; replaceVars . put ( "(true,27,Hello<sp>World)" 0 , "100" ) ; final org . apache . flink . table . client . gateway . Executor executor = createModifiedExecutor ( org . apache . flink . table . client . gateway . local . LocalExecutorITCase . clusterClient , replaceVars ) ; final org . apache . flink . table . client . gateway . SessionContext session = new org . apache . flink . table . client . gateway . SessionContext ( "(true,27,Hello<sp>World)" 5 , new org . apache . flink . table . client . config . Environment ( ) ) ; try { final org . apache . flink . table . client . gateway . ResultDescriptor desc = executor . executeQuery ( session , "SELECT<sp>scalarUDF(IntegerField1),<sp>StringField1<sp>FROM<sp>TableNumber1" ) ; "<AssertPlaceHolder>" ; final java . util . List < java . lang . String > actualResults = retrieveChangelogResult ( executor , session , desc . getResultId ( ) ) ; final java . util . List < java . lang . String > expectedResults = new java . util . ArrayList ( ) ; expectedResults . add ( "(true,27,Hello<sp>World)" 4 ) ; expectedResults . add ( "(true,27,Hello<sp>World)" ) ; expectedResults . add ( "(true,37,Hello<sp>World)" ) ; expectedResults . add ( "(true,37,Hello<sp>World)" ) ; expectedResults . add ( "(true,27,Hello<sp>World)" 4 ) ; expectedResults . add ( "(true,27,Hello<sp>World)" 2 ) ; org . apache . flink . test . util . TestBaseUtils . compareResultCollections ( expectedResults , actualResults , java . util . Comparator . naturalOrder ( ) ) ; } finally { executor . stop ( session ) ; } } isMaterialized ( ) { return isMaterialized ; }
|
org . junit . Assert . assertFalse ( desc . isMaterialized ( ) )
|
testAddByCursor ( ) { final int addedTriples = eu . fbk . knowledgestore . triplestore . virtuoso . VirtuosoTripleStoreTest . CURSOR_STATEMENT_COUNT ; final java . lang . Iterable < org . openrdf . model . Statement > statements = createFakeStatements ( addedTriples ) ; final int triplesBefore = countStatementsInStore ( null ) ; final eu . fbk . knowledgestore . triplestore . TripleTransaction transaction = this . store . begin ( false ) ; transaction . add ( eu . fbk . knowledgestore . data . Stream . create ( statements ) ) ; transaction . end ( true ) ; final int triplesAfter = countStatementsInStore ( null ) ; "<AssertPlaceHolder>" ; } countStatementsInStore ( eu . fbk . knowledgestore . triplestore . TripleTransaction ) { final eu . fbk . knowledgestore . triplestore . TripleTransaction tx = ( transaction != null ) ? transaction : this . store . begin ( true ) ; try { final info . aduna . iteration . CloseableIteration < org . openrdf . query . BindingSet , org . openrdf . query . QueryEvaluationException > cursor = tx . query ( eu . fbk . knowledgestore . triplestore . SelectQuery . from ( "SELECT<sp>*<sp>WHERE<sp>{?s<sp>?p<sp>?o}" ) , null , null ) ; int statementsCount = 0 ; while ( cursor . hasNext ( ) ) { cursor . next ( ) ; statementsCount ++ ; } return statementsCount ; } catch ( final org . openrdf . query . QueryEvaluationException ex ) { throw new java . io . IOException ( ex ) ; } finally { if ( transaction == null ) { tx . end ( true ) ; } } }
|
org . junit . Assert . assertEquals ( addedTriples , ( triplesAfter - triplesBefore ) )
|
refinementAnyStringEquals ( ) { generateDrugHierarchy ( ) ; final com . b2international . index . query . Expression actual = eval ( java . lang . String . format ( "*:<sp>%s<sp>=<sp>'PANADOL'" , com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . HAS_TRADE_NAME ) ) ; final com . b2international . index . query . Expression expected = ids ( com . google . common . collect . ImmutableSet . of ( com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . PANADOL_TABLET ) ) ; "<AssertPlaceHolder>" ; } of ( com . b2international . commons . exceptions . ApiError ) { return new com . b2international . snowowl . snomed . api . rest . domain . RestApiError . Builder ( error ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testGetParametersWithDefaultEntityAndDisabledStatus ( ) { unit . setActive ( false ) ; org . lnu . is . domain . asset . type . AssetType entity = new org . lnu . is . domain . asset . type . AssetType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "userGroups" , groups ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testAvroToAvro ( ) { org . apache . flink . api . java . ExecutionEnvironment env = org . apache . flink . api . java . ExecutionEnvironment . getExecutionEnvironment ( ) ; org . apache . flink . table . api . java . BatchTableEnvironment tEnv = org . apache . flink . table . api . java . BatchTableEnvironment . create ( env , config ( ) ) ; org . apache . flink . table . api . Table t = tEnv . fromDataSet ( testData ( env ) ) ; org . apache . flink . table . api . Table result = t . select ( "*" ) ; java . util . List < org . apache . flink . formats . avro . generated . User > results = tEnv . toDataSet ( result , org . apache . flink . api . common . typeinfo . Types . POJO ( org . apache . flink . formats . avro . generated . User . class ) ) . collect ( ) ; java . util . List < org . apache . flink . formats . avro . generated . User > expected = java . util . Arrays . asList ( org . apache . flink . table . runtime . batch . AvroTypesITCase . USER_1 , org . apache . flink . table . runtime . batch . AvroTypesITCase . USER_2 , org . apache . flink . table . runtime . batch . AvroTypesITCase . USER_3 ) ; "<AssertPlaceHolder>" ; } collect ( ) { java . util . List < org . apache . flink . metrics . prometheus . MetricFamilySamples . Sample > samples = new java . util . LinkedList ( ) ; for ( Map . Entry < java . util . List < java . lang . String > , org . apache . flink . metrics . Histogram > labelValuesToHistogram : histogramsByLabelValues . entrySet ( ) ) { addSamples ( labelValuesToHistogram . getKey ( ) , labelValuesToHistogram . getValue ( ) , samples ) ; } return java . util . Collections . singletonList ( new org . apache . flink . metrics . prometheus . MetricFamilySamples ( metricName , Type . SUMMARY , helpString , samples ) ) ; }
|
org . junit . Assert . assertEquals ( expected , results )
|
testStaticFactoryInAction ( ) { com . picocontainer . ComponentAdapter < java . rmi . registry . Registry > componentAdapter = new com . picocontainer . gems . adapters . StaticFactoryAdapter < java . rmi . registry . Registry > ( java . rmi . registry . Registry . class , new com . picocontainer . gems . adapters . StaticFactory < java . rmi . registry . Registry > ( ) { public java . rmi . registry . Registry get ( ) { try { return java . rmi . registry . LocateRegistry . getRegistry ( ) ; } catch ( java . rmi . RemoteException e ) { return null ; } } } ) ; com . picocontainer . DefaultPicoContainer pico = new com . picocontainer . DefaultPicoContainer ( ) ; pico . addAdapter ( componentAdapter ) . getComponentAdapter ( componentAdapter . getComponentKey ( ) ) . verify ( pico ) ; java . rmi . registry . Registry registry = pico . getComponent ( java . rmi . registry . Registry . class ) ; "<AssertPlaceHolder>" ; } getComponent ( java . lang . Class ) { checkReadPermission ( ) ; return pico . getComponent ( componentType ) ; }
|
org . junit . Assert . assertNotNull ( registry )
|
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . portal . kernel . model . PortletPreferences missingPortletPreferences = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
|
org . junit . Assert . assertNull ( missingPortletPreferences )
|
getsEndpointFromDefaultAwsRegion ( ) { org . powermock . api . mockito . PowerMockito . mockStatic ( com . amazonaws . regions . RegionUtils . class ) ; when ( com . amazonaws . util . EC2MetadataUtils . getEC2InstanceRegion ( ) ) . thenThrow ( new com . amazonaws . AmazonClientException ( ( "Unable<sp>to<sp>" + "get<sp>region<sp>from<sp>EC2<sp>instance<sp>data" ) ) ) ; when ( com . amazonaws . regions . RegionUtils . getRegion ( DynamoDBConstants . DEFAULT_AWS_REGION ) ) . thenReturn ( region ) ; when ( region . getServiceEndpoint ( ServiceAbbreviations . Dynamodb ) ) . thenReturn ( TEST_ENDPOINT ) ; "<AssertPlaceHolder>" ; org . powermock . api . mockito . PowerMockito . verifyStatic ( ) ; com . amazonaws . regions . RegionUtils . getRegion ( DynamoDBConstants . DEFAULT_AWS_REGION ) ; } getDynamoDBEndpoint ( org . apache . hadoop . conf . Configuration , java . lang . String ) { java . lang . String endpoint = org . apache . hadoop . dynamodb . DynamoDBUtil . getValueFromConf ( conf , DynamoDBConstants . ENDPOINT ) ; if ( com . google . common . base . Strings . isNullOrEmpty ( endpoint ) ) { if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { region = org . apache . hadoop . dynamodb . DynamoDBUtil . getValueFromConf ( conf , DynamoDBConstants . REGION ) ; } if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { region = org . apache . hadoop . dynamodb . DynamoDBUtil . getValueFromConf ( conf , DynamoDBConstants . REGION_ID ) ; } if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { try { region = com . amazonaws . util . EC2MetadataUtils . getEC2InstanceRegion ( ) ; } catch ( java . lang . Exception e ) { org . apache . hadoop . dynamodb . DynamoDBUtil . log . warn ( java . lang . String . format ( ( "Exception<sp>when<sp>attempting<sp>to<sp>get<sp>AWS<sp>region<sp>information.<sp>Will<sp>" + ( "ignore<sp>and<sp>default<sp>" + "to<sp>%s" ) ) , DynamoDBConstants . DEFAULT_AWS_REGION ) , e ) ; } } if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { region = DynamoDBConstants . DEFAULT_AWS_REGION ; } endpoint = com . amazonaws . regions . RegionUtils . getRegion ( region ) . getServiceEndpoint ( ServiceAbbreviations . Dynamodb ) ; } org . apache . hadoop . dynamodb . DynamoDBUtil . log . info ( ( "Using<sp>endpoint<sp>for<sp>DynamoDB:<sp>" + endpoint ) ) ; return endpoint ; }
|
org . junit . Assert . assertEquals ( TEST_ENDPOINT , org . apache . hadoop . dynamodb . DynamoDBUtil . getDynamoDBEndpoint ( conf , null ) )
|
testBothFlushFail ( ) { insertRecords ( org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 , StorageTestUtils . TOTAL_NUM_OF_RECORDS , StorageTestUtils . RECORDS_PER_COMPONENT , true ) ; org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . primaryIndexes [ org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 ] . clearFlushCallbacks ( ) ; org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . secondaryIndexes [ org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 ] . clearFlushCallbacks ( ) ; java . util . concurrent . Semaphore primaryFlushSemaphore = new java . util . concurrent . Semaphore ( 0 ) ; java . util . concurrent . Semaphore secondaryFlushSemaphore = new java . util . concurrent . Semaphore ( 0 ) ; org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . primaryIndexes [ org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 ] . addFlushCallback ( new org . apache . hyracks . storage . am . lsm . btree . impl . ITestOpCallback < java . util . concurrent . Semaphore > ( ) { @ org . apache . asterix . test . dataflow . Override public void before ( java . util . concurrent . Semaphore t ) throws org . apache . hyracks . api . exceptions . HyracksDataException { primaryFlushSemaphore . release ( ) ; throw new org . apache . hyracks . api . exceptions . HyracksDataException ( "Kill<sp>the<sp>flush<sp>thread" ) ; } @ org . apache . asterix . test . dataflow . Override public void after ( java . util . concurrent . Semaphore t ) throws org . apache . hyracks . api . exceptions . HyracksDataException { } } ) ; org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . secondaryIndexes [ org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 ] . addFlushCallback ( new org . apache . hyracks . storage . am . lsm . btree . impl . ITestOpCallback < java . util . concurrent . Semaphore > ( ) { @ org . apache . asterix . test . dataflow . Override public void before ( java . util . concurrent . Semaphore t ) throws org . apache . hyracks . api . exceptions . HyracksDataException { secondaryFlushSemaphore . release ( ) ; throw new org . apache . hyracks . api . exceptions . HyracksDataException ( "Kill<sp>the<sp>fluhs<sp>thread" ) ; } @ org . apache . asterix . test . dataflow . Override public void after ( java . util . concurrent . Semaphore t ) throws org . apache . hyracks . api . exceptions . HyracksDataException { } } ) ; org . apache . asterix . test . dataflow . StorageTestUtils . flush ( org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . dsLifecycleMgr , org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . primaryIndexes [ org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 ] , true ) ; primaryFlushSemaphore . acquire ( ) ; secondaryFlushSemaphore . acquire ( ) ; java . util . List < org . apache . hyracks . storage . am . lsm . common . api . ILSMDiskComponent > primaryComponents = org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . primaryIndexes [ org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 ] . getDiskComponents ( ) ; java . util . List < org . apache . hyracks . storage . am . lsm . common . api . ILSMDiskComponent > secondaryComponents = org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . secondaryIndexes [ org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . PARTITION_0 ] . getDiskComponents ( ) ; "<AssertPlaceHolder>" ; org . apache . asterix . test . dataflow . LSMFlushRecoveryTest . nc . deInit ( false ) ; } size ( ) { return list . size ( ) ; }
|
org . junit . Assert . assertEquals ( secondaryComponents . size ( ) , primaryComponents . size ( ) )
|
testNoMatch1 ( ) { java . lang . String act = mig . migrate ( "<sp>x<sp>y<sp>z<sp>" , "a<sp>b<sp>c" , ws ) ; "<AssertPlaceHolder>" ; } migrate ( java . lang . String , java . lang . String , java . util . regex . Pattern ) { if ( ( org . eclipse . xtext . util . Strings . isEmpty ( toBeFormattedString ) ) || ( org . eclipse . xtext . util . Strings . isEmpty ( formattedString ) ) ) return toBeFormattedString ; org . eclipse . xtext . util . internal . FormattingMigrator . FormattedString formatted = createFormattedString ( formattedString , format ) ; org . eclipse . xtext . util . internal . FormattingMigrator . FormattedString toBeFormatted = createFormattedString ( toBeFormattedString , format ) ; if ( formatted . semantic . equals ( toBeFormatted . semantic ) ) return formattedString ; java . util . List < org . eclipse . xtext . util . internal . FormattingMigrator . Mapping > mappings = com . google . common . collect . Lists . newArrayList ( ) ; java . util . List < org . eclipse . xtext . util . internal . FormattingMigrator . Region > remainingRegions = com . google . common . collect . Lists . newArrayList ( ) ; findLinearMatches ( formatted , toBeFormatted , mappings , remainingRegions ) ; for ( org . eclipse . xtext . util . internal . FormattingMigrator . Mapping m : mappings ) toBeFormatted . migrateFrom ( formatted , m ) ; return toBeFormatted . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "a<sp>b<sp>c" , act )
|
grammaticalFeaturesCanBeNull ( ) { org . wikidata . wdtk . datamodel . implementation . FormDocument doc = new org . wikidata . wdtk . datamodel . implementation . FormDocumentImpl ( fid , repList , null , statementGroups , 1234 ) ; "<AssertPlaceHolder>" ; } getGrammaticalFeatures ( ) { return grammaticalFeatures ; }
|
org . junit . Assert . assertTrue ( doc . getGrammaticalFeatures ( ) . isEmpty ( ) )
|
testGetArgumentType_Integer ( ) { org . seasar . extension . jdbc . gen . internal . argtype . ArgumentType < java . lang . String > argumentType = org . seasar . extension . jdbc . gen . internal . argtype . ArgumentTypeRegistry . getArgumentType ( beanDesc . getPropertyDesc ( "integer" ) ) ; "<AssertPlaceHolder>" ; } getPropertyDesc ( int ) { return ( ( org . seasar . framework . beans . PropertyDesc ) ( propertyDescCache . get ( index ) ) ) ; }
|
org . junit . Assert . assertNotNull ( argumentType )
|
removeSubGraph ( ) { org . apache . clerezza . commons . rdf . Graph baseGraph = createBaseGraph ( ) ; org . apache . clerezza . commons . rdf . Graph subGraph = new org . apache . clerezza . commons . rdf . impl . utils . simple . SimpleGraph ( ) ; { org . apache . clerezza . commons . rdf . BlankNode bNode1 = new org . apache . clerezza . commons . rdf . BlankNode ( ) ; org . apache . clerezza . commons . rdf . BlankNode bNode2 = new org . apache . clerezza . commons . rdf . BlankNode ( ) ; subGraph . add ( new org . apache . clerezza . commons . rdf . impl . utils . TripleImpl ( u1 , u2 , bNode2 ) ) ; subGraph . add ( new org . apache . clerezza . commons . rdf . impl . utils . TripleImpl ( bNode2 , u2 , bNode2 ) ) ; subGraph . add ( new org . apache . clerezza . commons . rdf . impl . utils . TripleImpl ( bNode2 , u2 , bNode1 ) ) ; } org . apache . clerezza . rdf . utils . GraphUtils . removeSubGraph ( baseGraph , subGraph ) ; "<AssertPlaceHolder>" ; } size ( ) { expandTill ( Integer . MAX_VALUE ) ; return valueList . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , baseGraph . size ( ) )
|
testDeleteEntity_MayaLink ( ) { handler . addRequest ( false , "DELETE" , "/qcbin/rest/domains/domain/projects/project/defects/86/defect-links/2763" , 200 ) ; handler . async ( ) ; addEntityListener ( new com . hp . alm . ali . idea . services . EntityNotFound ( handler , "defect-link" , 2763 , true ) ) ; com . hp . alm . ali . idea . model . Entity link = new com . hp . alm . ali . idea . model . Entity ( "defect-link" , 2763 ) ; link . setProperty ( "first-endpoint-id" , "86" ) ; boolean deleted = entityService . deleteEntity ( link ) ; "<AssertPlaceHolder>" ; } deleteEntity ( com . hp . alm . ali . idea . model . Entity ) { if ( ( "defect-link" . equals ( entity . getType ( ) ) ) && ( restService . getServerStrategy ( ) . hasSecondLevelDefectLink ( ) ) ) { return deleteOldDefectLink ( entity ) ; } com . hp . alm . ali . idea . rest . MyResultInfo result = new com . hp . alm . ali . idea . rest . MyResultInfo ( ) ; if ( ( restService . delete ( result , "{0}s/{1}" , entity . getType ( ) , entity . getId ( ) ) ) != ( org . apache . commons . httpclient . HttpStatus . SC_OK ) ) { errorService . showException ( new com . hp . alm . ali . idea . rest . RestException ( result ) ) ; return false ; } else { fireEntityNotFound ( new com . hp . alm . ali . idea . entity . EntityRef ( entity ) , true ) ; return true ; } }
|
org . junit . Assert . assertTrue ( deleted )
|
syncInvokeNormalAndPostMethodAndContentIsNotEmptyTest ( ) { com . aliyuncs . http . clients . HttpClientConfig config = mock ( com . aliyuncs . http . clients . HttpClientConfig . class ) ; when ( config . isIgnoreSSLCerts ( ) ) . thenReturn ( true ) ; com . aliyuncs . http . clients . CompatibleUrlConnClient client0 = new com . aliyuncs . http . clients . CompatibleUrlConnClient ( config ) ; com . aliyuncs . http . clients . CompatibleUrlConnClient client = org . powermock . api . mockito . PowerMockito . spy ( client0 ) ; com . aliyuncs . http . clients . HttpRequest request = mock ( com . aliyuncs . http . clients . HttpRequest . class ) ; when ( request . getSysMethod ( ) ) . thenReturn ( MethodType . POST ) ; when ( request . getHttpContent ( ) ) . thenReturn ( "http<sp>content" . getBytes ( ) ) ; java . net . HttpURLConnection connection = mock ( java . net . HttpURLConnection . class ) ; doNothing ( ) . when ( connection ) . connect ( ) ; org . powermock . api . mockito . PowerMockito . doReturn ( connection ) . when ( client , "buildHttpConnection" , request ) ; java . net . URL url = org . powermock . api . mockito . PowerMockito . mock ( java . net . URL . class ) ; when ( url . toString ( ) ) . thenReturn ( "http://www.aliyun.com" ) ; when ( connection . getURL ( ) ) . thenReturn ( url ) ; java . io . OutputStream outputStream = mock ( java . io . OutputStream . class ) ; doNothing ( ) . when ( outputStream ) . write ( "http<sp>content" . getBytes ( ) ) ; when ( connection . getOutputStream ( ) ) . thenReturn ( outputStream ) ; when ( connection . getInputStream ( ) ) . thenReturn ( mock ( java . io . InputStream . class ) ) ; org . powermock . api . mockito . PowerMockito . doNothing ( ) . when ( client , "parseHttpConn" , any ( com . aliyuncs . http . clients . HttpResponse . class ) , any ( java . net . HttpURLConnection . class ) , any ( java . io . InputStream . class ) ) ; com . aliyuncs . http . clients . HttpResponse response = client . syncInvoke ( request ) ; verifyPrivate ( client , times ( 1 ) ) . invoke ( "parseHttpConn" , any ( com . aliyuncs . http . clients . HttpResponse . class ) , any ( java . net . HttpURLConnection . class ) , any ( java . io . InputStream . class ) ) ; "<AssertPlaceHolder>" ; verify ( outputStream , times ( 1 ) ) . write ( "http<sp>content" . getBytes ( ) ) ; } getSysUrl ( ) { return url ; }
|
org . junit . Assert . assertEquals ( "http://www.aliyun.com" , response . getSysUrl ( ) )
|
getModifiers ( ) { "<AssertPlaceHolder>" ; } getModifiers ( ) { return modifiers ; }
|
org . junit . Assert . assertEquals ( modifiers , field . getModifiers ( ) )
|
testIsInitialized_isFalseByDefault ( ) { boolean initialized = adapter . isInitialized ( ) ; "<AssertPlaceHolder>" ; } isInitialized ( ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertFalse ( initialized )
|
shouldThrowExceptionIfJobTrackerIsNotConfigured ( ) { final uk . gov . gchq . gaffer . store . operation . handler . job . GetJobDetailsHandler handler = new uk . gov . gchq . gaffer . store . operation . handler . job . GetJobDetailsHandler ( ) ; final uk . gov . gchq . gaffer . operation . impl . job . GetJobDetails operation = mock ( uk . gov . gchq . gaffer . operation . impl . job . GetJobDetails . class ) ; final uk . gov . gchq . gaffer . store . Store store = mock ( uk . gov . gchq . gaffer . store . Store . class ) ; final uk . gov . gchq . gaffer . user . User user = mock ( uk . gov . gchq . gaffer . user . User . class ) ; given ( store . getJobTracker ( ) ) . willReturn ( null ) ; try { handler . doOperation ( operation , new uk . gov . gchq . gaffer . store . Context ( user ) , store ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( final uk . gov . gchq . gaffer . operation . OperationException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( ( ( super . getMessage ( ) ) + "<sp>in<sp>string<sp>\'" ) + ( this . visibility ) ) + "\'<sp>at<sp>position<sp>" ) + ( super . getErrorOffset ( ) ) ; }
|
org . junit . Assert . assertNotNull ( e . getMessage ( ) )
|
testFloorDecimalInWhere ( ) { java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) ) ; java . sql . ResultSet rs = conn . createStatement ( ) . executeQuery ( ( ( "SELECT<sp>*<sp>FROM<sp>" + ( tableName ) ) + "<sp>WHERE<sp>FLOOR(\"DEC\",<sp>2)<sp>=<sp>1.26" ) ) ; "<AssertPlaceHolder>" ; } next ( ) { if ( ! ( org . apache . phoenix . util . CursorUtil . moreValues ( cursorName ) ) ) { return null ; } else if ( ( fetchSize ) == ( rowsRead ) ) { return null ; } org . apache . phoenix . schema . tuple . Tuple next = delegate . next ( ) ; org . apache . phoenix . util . CursorUtil . updateCursor ( cursorName , next , delegate . peek ( ) ) ; ( rowsRead ) ++ ; return next ; }
|
org . junit . Assert . assertTrue ( rs . next ( ) )
|
testIsLuExistsFails ( ) { final java . lang . String volumeName = appliance . getVolumeName ( "volume1" ) ; exception . expect ( com . cloud . utils . exception . CloudRuntimeException . class ) ; exception . expectMessage ( "any<sp>exception" ) ; when ( client . execute ( org . apache . cloudstack . storage . datastore . util . NexentaStorAppliance . IntegerNmsResponse . class , "scsidisk" , "lu_exists" , volumeName ) ) . thenThrow ( new com . cloud . utils . exception . CloudRuntimeException ( "any<sp>exception" ) ) ; "<AssertPlaceHolder>" ; } isLuExists ( java . lang . String ) { org . apache . cloudstack . storage . datastore . util . NexentaStorAppliance . IntegerNmsResponse response ; try { response = ( ( org . apache . cloudstack . storage . datastore . util . NexentaStorAppliance . IntegerNmsResponse ) ( client . execute ( org . apache . cloudstack . storage . datastore . util . NexentaStorAppliance . IntegerNmsResponse . class , "scsidisk" , "lu_exists" , luName ) ) ) ; } catch ( com . cloud . utils . exception . CloudRuntimeException ex ) { if ( ex . getMessage ( ) . contains ( "does<sp>not<sp>exist" ) ) { return false ; } throw ex ; } return ( response != null ) && ( ( response . getResult ( ) ) > 0 ) ; }
|
org . junit . Assert . assertTrue ( appliance . isLuExists ( volumeName ) )
|
testMean ( ) { int [ ] shape = new int [ ] { 1 , 2 , 2 , 2 , 2 , 2 } ; int len = org . nd4j . linalg . util . ArrayUtil . prod ( shape ) ; org . nd4j . linalg . api . ndarray . INDArray val = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , len , len ) . reshape ( 'c' , shape ) ; org . nd4j . linalg . api . ndarray . INDArray sum = val . sum ( 2 , 3 ) ; double [ ] assertionData = new double [ ] { 28.0 , 32.0 , 36.0 , 40.0 , 92.0 , 96.0 , 100.0 , 104.0 } ; org . nd4j . linalg . api . ndarray . INDArray avgExpected = org . nd4j . linalg . factory . Nd4j . create ( assertionData ) . reshape ( 1 , 2 , 2 , 2 ) ; "<AssertPlaceHolder>" ; } create ( float [ ] ) { return org . nd4j . linalg . factory . Nd4j . create ( data , org . nd4j . linalg . factory . Nd4j . order ( ) ) ; }
|
org . junit . Assert . assertEquals ( avgExpected , sum )
|
extraOptionsAreNotAppended_WhenConnTypePointsToAnotherDataBase ( ) { java . util . Map < java . lang . String , java . lang . String > extraOptions = generateExtraOptions ( org . pentaho . di . core . database . DatabaseMeta_AppendExtraParamsTest . STRING_DEFAULT , 2 ) ; doThrow ( new org . pentaho . di . core . exception . KettleDatabaseException ( ) ) . when ( meta ) . getDbInterface ( org . pentaho . di . core . database . DatabaseMeta_AppendExtraParamsTest . STRING_DEFAULT ) ; java . lang . String connUrlWithExtraOptions = meta . appendExtraOptions ( CONN_URL_NO_EXTRA_OPTIONS , extraOptions ) ; "<AssertPlaceHolder>" ; } appendExtraOptions ( java . lang . String , java . util . Map ) { if ( extraOptions . isEmpty ( ) ) { return url ; } java . lang . StringBuilder urlBuilder = new java . lang . StringBuilder ( url ) ; final java . lang . String optionIndicator = getExtraOptionIndicator ( ) ; final java . lang . String optionSeparator = getExtraOptionSeparator ( ) ; final java . lang . String valueSeparator = getExtraOptionValueSeparator ( ) ; java . util . Iterator < java . lang . String > iterator = extraOptions . keySet ( ) . iterator ( ) ; boolean first = true ; while ( iterator . hasNext ( ) ) { java . lang . String typedParameter = iterator . next ( ) ; int dotIndex = typedParameter . indexOf ( '.' ) ; if ( dotIndex == ( - 1 ) ) { continue ; } final java . lang . String value = extraOptions . get ( typedParameter ) ; if ( ( org . pentaho . di . core . util . Utils . isEmpty ( value ) ) || ( value . equals ( org . pentaho . di . core . database . DatabaseMeta . EMPTY_OPTIONS_STRING ) ) ) { continue ; } final java . lang . String typeCode = typedParameter . substring ( 0 , dotIndex ) ; final java . lang . String parameter = typedParameter . substring ( ( dotIndex + 1 ) ) ; boolean dbForBothDbInterfacesIsSame = false ; try { org . pentaho . di . core . database . DatabaseInterface primaryDb = getDbInterface ( typeCode ) ; dbForBothDbInterfacesIsSame = databaseForBothDbInterfacesIsTheSame ( primaryDb , getDatabaseInterface ( ) ) ; } catch ( org . pentaho . di . core . exception . KettleDatabaseException e ) { getGeneralLogger ( ) . logError ( ( ( ( ( "DatabaseInterface<sp>with<sp>" + typeCode ) + "<sp>database<sp>type<sp>is<sp>not<sp>found!<sp>Parameter<sp>" ) + parameter ) + "won't<sp>be<sp>appended<sp>to<sp>URL" ) ) ; } if ( dbForBothDbInterfacesIsSame ) { if ( first && ( ( url . indexOf ( valueSeparator ) ) == ( - 1 ) ) ) { urlBuilder . append ( optionIndicator ) ; } else { urlBuilder . append ( optionSeparator ) ; } urlBuilder . append ( environmentSubstitute ( parameter ) ) . append ( valueSeparator ) . append ( environmentSubstitute ( value ) ) ; first = false ; } } return urlBuilder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( CONN_URL_NO_EXTRA_OPTIONS , connUrlWithExtraOptions )
|
testEquals ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( empty . equals ( empty ) )
|
shouldReturnAnInstanceOfCollectionMergingCookieProcessor ( ) { org . codegist . crest . param . CollectionMergingCookieParamProcessor expected = mock ( org . codegist . crest . param . CollectionMergingCookieParamProcessor . class ) ; whenNew ( org . codegist . crest . param . CollectionMergingCookieParamProcessor . class ) . withArguments ( "-" ) . thenReturn ( expected ) ; org . codegist . crest . param . ParamProcessor actual = org . codegist . crest . param . ParamProcessors . newInstance ( ParamType . COOKIE , "-" ) ; "<AssertPlaceHolder>" ; } newInstance ( org . codegist . crest . config . ParamType , java . lang . String ) { switch ( type ) { case COOKIE : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingCookieParamProcessor ( listSeparator ) : DefaultCookieParamProcessor . INSTANCE ; default : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingParamProcessor ( listSeparator ) : DefaultParamProcessor . INSTANCE ; } }
|
org . junit . Assert . assertSame ( expected , actual )
|
numberOfColumns_max ( ) { model . addLandingpageData ( landingpageData ( newServiceList ( "s1" , "s2" , "s3" ) , newCategories ( "cat1" , "cat2" , "cat3" ) ) ) ; int size = model . getNumberOfColumns ( ) ; "<AssertPlaceHolder>" ; } getNumberOfColumns ( ) { return result . numberOfColumns ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , size )
|
when_focus_is_delayed_then_it_is_not_applied_on_initial_request ( ) { browser . get ( contextPath . toExternalForm ( ) ) ; "<AssertPlaceHolder>" ; } getFocusedElement ( ) { return org . richfaces . utils . focus . FocusRetriever . retrieveActiveElement ( ) ; }
|
org . junit . Assert . assertEquals ( null , getFocusedElement ( ) )
|
equals_null ( ) { final net . sf . qualitycheck . immutableobject . domain . Method a = new net . sf . qualitycheck . immutableobject . domain . MethodTest . Blueprint ( ) . build ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final net . sf . qualitycheck . ConditionalCheckTest . NotEqual other = ( ( net . sf . qualitycheck . ConditionalCheckTest . NotEqual ) ( obj ) ) ; if ( ( value ) != ( other . value ) ) { return false ; } return true ; }
|
org . junit . Assert . assertFalse ( a . equals ( null ) )
|
testHasValue2 ( ) { setLocale ( null ) ; com . vaadin . data . ValueContext fromComponent = new com . vaadin . data . ValueContext ( new com . vaadin . ui . CheckBox ( ) , textField ) ; "<AssertPlaceHolder>" ; } getHasValue ( ) { return java . util . Optional . ofNullable ( hasValue ) ; }
|
org . junit . Assert . assertEquals ( textField , fromComponent . getHasValue ( ) . get ( ) )
|
testListNonExistingDir ( ) { java . lang . String temp = temporaryFolder . getRoot ( ) . getAbsolutePath ( ) ; try ( com . questdb . std . str . Path path = new com . questdb . std . str . Path ( ) . of ( temp ) . concat ( "xyz" ) ) { long pFind = com . questdb . Files . findFirst ( path ) ; "<AssertPlaceHolder>" ; } } findFirst ( com . questdb . std . str . LPSZ ) { long ptr = com . questdb . std . Files . findFirst ( path ) ; if ( ptr == ( - 1 ) ) { throw com . questdb . cairo . CairoException . instance ( com . questdb . std . Os . errno ( ) ) . put ( "findFirst<sp>failed<sp>on<sp>" ) . put ( path ) ; } return ptr ; }
|
org . junit . Assert . assertEquals ( 0 , pFind )
|
testNotSet ( ) { org . antlr . misc . IntervalSet vocabulary = org . antlr . misc . IntervalSet . of ( 1 , 1000 ) ; org . antlr . misc . IntervalSet s = org . antlr . misc . IntervalSet . of ( 50 , 60 ) ; s . add ( 5 ) ; s . add ( 250 , 300 ) ; java . lang . String expecting = "{1..4,<sp>6..49,<sp>61..249,<sp>301..1000}" ; java . lang . String result = s . complement ( vocabulary ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return new java . lang . String ( data ) ; }
|
org . junit . Assert . assertEquals ( result , expecting )
|
testContainsKey ( ) { v8 . add ( "foo" , true ) ; boolean result = v8 . contains ( "foo" ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertTrue ( result )
|
testOneInputFile ( ) { java . lang . String query = new com . spotify . beetest . TestCase ( ) . getDDLSetupQuery ( "src/main/resources/test/table.ddl" , "test" ) ; java . lang . String expected = "DROP<sp>TABLE<sp>IF<sp>EXISTS<sp>words;" + ( ( "\nCREATE<sp>TABLE<sp>words(word<sp>STRING,<sp>length<sp>INT)" + "\nROW<sp>FORMAT<sp>DELIMITED<sp>FIELDS<sp>TERMINATED<sp>BY<sp>\'\\t\';" ) + "\nLOAD<sp>DATA<sp>LOCAL<sp>INPATH<sp>\'input1.txt\'<sp>INTO<sp>TABLE<sp>words;\n" ) ; "<AssertPlaceHolder>" ; } getDDLSetupQuery ( java . lang . String , java . lang . String ) { java . lang . StringBuilder query = new java . lang . StringBuilder ( ) ; java . util . List < java . lang . String > fileContent = com . spotify . beetest . Utils . fileToList ( ddlSetupFilename ) ; for ( java . lang . String line : fileContent ) { java . lang . String [ ] parts = line . split ( com . spotify . beetest . TestCase . TAB ) ; java . lang . String table = parts [ 0 ] ; java . lang . String tableName = table . substring ( 0 , table . indexOf ( "(" ) ) ; java . lang . String tableSchema = table . substring ( ( ( table . indexOf ( "(" ) ) + 1 ) , table . indexOf ( ")" ) ) ; java . lang . String createTable = org . apache . commons . lang3 . StringUtils . join ( "DROP<sp>TABLE<sp>IF<sp>EXISTS<sp>" , tableName , ";" , com . spotify . beetest . TestCase . NL , "CREATE<sp>TABLE<sp>" , tableName , "(" , tableSchema , ")" , com . spotify . beetest . TestCase . NL , "ROW<sp>FORMAT<sp>DELIMITED<sp>FIELDS<sp>TERMINATED<sp>BY<sp>\'\\t\';" , com . spotify . beetest . TestCase . NL ) ; query . append ( createTable ) ; if ( ( parts . length ) == 1 ) { java . lang . String file = ( ( testDirectory + "ROW<sp>FORMAT<sp>DELIMITED<sp>FIELDS<sp>TERMINATED<sp>BY<sp>\'\\t\';" 0 ) + tableName ) + ".txt" ; java . lang . String load = org . apache . commons . lang3 . StringUtils . join ( "LOAD<sp>DATA<sp>LOCAL<sp>INPATH<sp>'" , file , "'<sp>INTO<sp>TABLE<sp>" , tableName , ";" , com . spotify . beetest . TestCase . NL ) ; query . append ( load ) ; } else if ( ! ( ( ( parts . length ) == 2 ) && ( parts [ 1 ] . equals ( "<sp>" ) ) ) ) { for ( int i = 1 ; i < ( parts . length ) ; ++ i ) { java . lang . String load = org . apache . commons . lang3 . StringUtils . join ( "LOAD<sp>DATA<sp>LOCAL<sp>INPATH<sp>'" , parts [ i ] , "'<sp>INTO<sp>TABLE<sp>" , tableName , ";" , com . spotify . beetest . TestCase . NL ) ; query . append ( load ) ; } } } return query . toString ( ) ; }
|
org . junit . Assert . assertEquals ( query , expected )
|
testReadWriteBeginning ( ) { org . jscsi . initiator . devices . JSCSIDeviceTest . address = 0 ; org . jscsi . initiator . devices . JSCSIDeviceTest . device . write ( org . jscsi . initiator . devices . JSCSIDeviceTest . address , org . jscsi . initiator . devices . JSCSIDeviceTest . testData ) ; byte [ ] result = new byte [ ( org . jscsi . initiator . devices . JSCSIDeviceTest . TEST_DATA_SIZE ) * ( org . jscsi . initiator . devices . JSCSIDeviceTest . device . getBlockSize ( ) ) ] ; org . jscsi . initiator . devices . JSCSIDeviceTest . device . read ( org . jscsi . initiator . devices . JSCSIDeviceTest . address , result ) ; for ( int i = 0 ; i < ( ( org . jscsi . initiator . devices . JSCSIDeviceTest . TEST_DATA_SIZE ) * ( org . jscsi . initiator . devices . JSCSIDeviceTest . device . getBlockSize ( ) ) ) ; i ++ ) { "<AssertPlaceHolder>" ; } } getBlockSize ( ) { return device . getBlockSize ( ) ; }
|
org . junit . Assert . assertEquals ( result [ i ] , org . jscsi . initiator . devices . JSCSIDeviceTest . testData [ i ] )
|
parsesRules ( ) { java . lang . String sponsorsLine = "RULES<sp>COM" ; java . lang . String expectedSponsor = "RULES" ; gov . nysenate . openleg . processor . daybreak . DaybreakFragmentSponsorParser . parseSponsors ( senateBill , sponsorsLine ) ; "<AssertPlaceHolder>" ; } getSponsor ( ) { return sponsor ; }
|
org . junit . Assert . assertEquals ( expectedSponsor , senateBill . getSponsor ( ) )
|
testClone ( ) { com . streamsets . pipeline . api . impl . TypeSupport tt = new com . streamsets . pipeline . api . impl . TestTypeSupport . TTypeSupport ( ) ; java . lang . Object o = new java . lang . Object ( ) ; "<AssertPlaceHolder>" ; } clone ( java . lang . Object ) { return value ; }
|
org . junit . Assert . assertSame ( o , tt . clone ( o ) )
|
checkSingleAnnotation ( ) { org . apache . pdfbox . pdmodel . interactive . form . PDTextField field = ( ( org . apache . pdfbox . pdmodel . interactive . form . PDTextField ) ( acroForm . getField ( "SingleAnnotation" ) ) ) ; java . lang . String fieldFontSetting = getFontSettingFromDA ( field ) ; java . util . List < org . apache . pdfbox . pdmodel . interactive . annotation . PDAnnotationWidget > widgets = field . getWidgets ( ) ; for ( org . apache . pdfbox . pdmodel . interactive . annotation . PDAnnotationWidget widget : widgets ) { java . lang . String contentAsString = new java . lang . String ( widget . getNormalAppearanceStream ( ) . getContentStream ( ) . toByteArray ( ) ) ; "<AssertPlaceHolder>" ; } } indexOf ( org . apache . pdfbox . debugger . ui . PageEntry ) { return ( page . getPageNum ( ) ) - 1 ; }
|
org . junit . Assert . assertTrue ( ( ( contentAsString . indexOf ( fieldFontSetting ) ) > 0 ) )
|
shouldFindFirstCharacterAfterNumber ( ) { int position = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . indexOfWord ( "200x" , 1 ) ; "<AssertPlaceHolder>" ; } indexOfWord ( java . lang . String , int ) { checkNotNull ( entityName , "Input<sp>string<sp>must<sp>not<sp>be<sp>null" ) ; int length = entityName . length ( ) ; checkElementIndex ( startIndex , length ) ; for ( int index = startIndex ; index < length ; index ++ ) { if ( edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isWordStart ( entityName , index ) ) { return index ; } } return - 1 ; }
|
org . junit . Assert . assertEquals ( position , 3 )
|
resolveAbsolutePathFromRootTest ( ) { com . beijunyi . parallelgit . filesystem . GitPath path = root . resolve ( "/a.txt" ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( ( stringValue ) == null ) stringValue = decode ( com . beijunyi . parallelgit . filesystem . CHARSET , path ) ; return stringValue ; }
|
org . junit . Assert . assertEquals ( "/a.txt" , path . toString ( ) )
|
testGetProxy ( ) { final nl . bzk . brp . model . hisvolledig . impl . kern . PersoonHisVolledigImpl persoonProxy = persoonHisVolledigImplLuieLader . getProxy ( ) ; "<AssertPlaceHolder>" ; verifyZeroInteractions ( blobifierService ) ; } getProxy ( ) { final javassist . util . proxy . ProxyFactory factory = new javassist . util . proxy . ProxyFactory ( ) ; factory . setSuperclass ( nl . bzk . brp . model . hisvolledig . impl . kern . PersoonHisVolledigImpl . class ) ; factory . setFilter ( finalizeFilter ) ; final java . lang . Class clazz = factory . createClass ( ) ; try { final java . lang . Object instance = clazz . newInstance ( ) ; ( ( javassist . util . proxy . ProxyObject ) ( instance ) ) . setHandler ( this ) ; return ( ( nl . bzk . brp . model . hisvolledig . impl . kern . PersoonHisVolledigImpl ) ( instance ) ) ; } catch ( java . lang . InstantiationException | java . lang . IllegalAccessException | java . lang . ClassCastException e ) { nl . bzk . brp . blobifier . repository . alleenlezen . PersoonHisVolledigImplLuieLader . LOGGER . error ( "Het<sp>is<sp>niet<sp>gelukt<sp>om<sp>een<sp>instantie<sp>te<sp>maken<sp>voor<sp>de<sp>persoon<sp>his<sp>volledig<sp>proxy<sp>met<sp>persoonId<sp>{}" , persoonId ) ; throw new nl . bzk . brp . blobifier . exceptie . ProxyAanmakenMisluktExceptie ( "Proxy<sp>aanmaken<sp>mislukt." , e ) ; } }
|
org . junit . Assert . assertNotNull ( persoonProxy )
|
test ( ) { org . opennms . netmgt . jasper . measurement . MeasurementParameterFilter filter = new org . opennms . netmgt . jasper . measurement . MeasurementParameterFilter ( new org . opennms . netmgt . jasper . measurement . MeasurementParameterFilter . JvmDetector ( ) { @ org . opennms . netmgt . jasper . measurement . Override public boolean isRunInOpennmsJvm ( ) { return jvmMode ; } } ) ; boolean result = filter . apply ( parameter ) ; "<AssertPlaceHolder>" ; } apply ( T ) { return regExp . matcher ( value . toString ( ) ) . matches ( ) ; }
|
org . junit . Assert . assertEquals ( apply , result )
|
lockShouldReturnFalseIfAnotherRowIsLocked ( ) { java . sql . Connection connection = null ; try { lock = createLock ( props ) ; executeStatement ( ( ( ( ( "INSERT<sp>INTO<sp>" + ( tableName ) ) + "<sp>(MOMENT,<sp>NODE)<sp>VALUES<sp>(1,<sp>'" ) + ( clustername ) ) + "_2')" ) ) ; connection = lock ( tableName , ( ( clustername ) + "_2" ) ) ; "<AssertPlaceHolder>" ; } finally { close ( connection ) ; } } lock ( ) { return aquireLock ( ) ; }
|
org . junit . Assert . assertFalse ( lock . lock ( ) )
|
testValueSort ( ) { java . util . List < java . lang . String > list = java . util . Arrays . asList ( "vuur" , ")vis(" , "noot" , "(mies)" , "aap" , "aa(n)" , "aa(s)" ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( "aa(n)" , "aap" , "aa(s)" , "(mies)" , "noot" , ")vis(" , "vuur" ) ; java . text . Collator coll = nl . inl . blacklab . server . requesthandlers . RequestHandlerFieldInfo . getValueSortCollator ( ) ; java . util . Collections . sort ( list , coll ) ; "<AssertPlaceHolder>" ; } sort ( nl . inl . blacklab . perdocument . DocProperty , boolean ) { java . util . Comparator < nl . inl . blacklab . perdocument . DocResult > comparator = new nl . inl . blacklab . perdocument . ComparatorDocProperty ( prop ) ; if ( sortReverse ) { comparator = new nl . inl . util . ReverseComparator ( comparator ) ; } sort ( comparator ) ; }
|
org . junit . Assert . assertEquals ( expected , list )
|
getPcrManifestFromXen ( ) { java . security . cert . X509Certificate aikCertificate = test . agent . TestIntelHostAgent . agent . getAikCertificate ( ) ; com . intel . mtwilson . model . PcrManifest pcrManifest = test . agent . TestIntelHostAgent . agent . getPcrManifest ( ) ; "<AssertPlaceHolder>" ; if ( ( pcrManifest != null ) && ( pcrManifest . containsPcrEventLog ( PcrIndex . PCR19 ) ) ) { com . intel . mtwilson . model . PcrEventLog pcrEventLog = pcrManifest . getPcrEventLog ( 19 ) ; java . util . List < com . intel . mtwilson . model . Measurement > mList = pcrEventLog . getEventLog ( ) ; for ( com . intel . mtwilson . model . Measurement m : mList ) { test . agent . TestIntelHostAgent . log . debug ( ( ( ( ( ( ( "Host<sp>specific<sp>manifest<sp>for<sp>event<sp>'" + ( m . getInfo ( ) . get ( "EventName" ) ) ) + "'<sp>field<sp>'" ) + ( m . getLabel ( ) ) ) + "'<sp>component<sp>'" ) + ( m . getInfo ( ) . get ( "ComponentName" ) ) ) + "'" ) ) ; } } for ( int i = 0 ; i < 24 ; i ++ ) { com . intel . mtwilson . model . Pcr pcr = pcrManifest . getPcr ( i ) ; test . agent . TestIntelHostAgent . log . debug ( "Pcr<sp>{}<sp>=<sp>{}" , i , pcr . getValue ( ) . toString ( ) ) ; } } getPcrManifest ( ) { com . intel . mtwilson . model . PcrManifest pcrManifest = new com . intel . mtwilson . model . PcrManifest ( ) ; java . lang . String pcrList = "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24" ; java . util . HashMap < java . lang . String , com . intel . mtwilson . model . Pcr > pcrMap = client . getQuoteInformationForHost ( pcrList ) ; log . info ( "CitrixHostAgent:<sp>getQuoteInformationForHost<sp>done" ) ; java . util . Iterator it = pcrMap . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { java . util . Map . Entry pairs = ( ( java . util . Map . Entry ) ( it . next ( ) ) ) ; com . intel . mtwilson . model . Pcr pcr = ( ( com . intel . mtwilson . model . Pcr ) ( pairs . getValue ( ) ) ) ; pcrManifest . setPcr ( com . intel . mtwilson . model . PcrFactory . newInstance ( pcr . getPcrBank ( ) , pcr . getIndex ( ) , pcr . getValue ( ) . toByteArray ( ) ) ) ; } log . info ( "CitrixHostAgent:<sp>created<sp>PcrManifest" ) ; return pcrManifest ; }
|
org . junit . Assert . assertNotNull ( pcrManifest )
|
testGetAstSimpleTypeJavaTypeNull ( ) { java . util . Map < java . lang . String , java . lang . String > javaTypes = createJavaTypes ( ) ; when ( dataTypeUtils . getJavaTypes ( ) ) . thenReturn ( javaTypes ) ; java . lang . String typeName = "org.codecrowd.Test" ; org . eclipse . jdt . core . dom . SimpleType tp = jdtHelper . getAstSimpleType ( ast , typeName ) ; "<AssertPlaceHolder>" ; } getName ( ) { return ( ( ( ( name ) + "<sp>-<sp>" ) + ( elementStringCollection . iterator ( ) . next ( ) ) ) + "<sp>-<sp>" ) + ( elementIntegerCollection . iterator ( ) . next ( ) ) ; }
|
org . junit . Assert . assertEquals ( "org.codecrowd.Test" , tp . getName ( ) . toString ( ) )
|
should_isTrackable_returns_false_if_not_started ( ) { tracker = createTimeTracker ( true , null , 10 , 2 , org . bonitasoft . engine . tracking . TimeTrackerTest . REC ) ; "<AssertPlaceHolder>" ; } isTrackable ( org . bonitasoft . engine . tracking . TimeTrackerRecords ) { return ( isTracking ( ) ) && ( activatedRecords . contains ( recordName ) ) ; }
|
org . junit . Assert . assertFalse ( tracker . isTrackable ( org . bonitasoft . engine . tracking . TimeTrackerTest . REC ) )
|
testEditAssociatedProjectsForProject ( ) { java . lang . Long projectId = 1L ; org . springframework . ui . ExtendedModelMap model = new org . springframework . ui . ExtendedModelMap ( ) ; java . security . Principal principal = ( ) -> ca . corefacility . bioinformatics . irida . ria . unit . web . projects . ProjectSettingsAssociatedProjectsControllerTest . USER_NAME ; java . lang . String editAssociatedProjectsForProject = controller . editAssociatedProjectsForProject ( projectId , model , principal ) ; "<AssertPlaceHolder>" ; } editAssociatedProjectsForProject ( java . lang . Long , org . springframework . ui . Model , java . security . Principal ) { ca . corefacility . bioinformatics . irida . model . project . Project project = projectService . read ( projectId ) ; model . addAttribute ( "project" , project ) ; projectControllerUtils . getProjectTemplateDetails ( model , principal , project ) ; model . addAttribute ( ProjectsController . ACTIVE_NAV , ProjectSettingsController . ACTIVE_NAV_SETTINGS ) ; return "projects/settings/pages/associated_edit" ; }
|
org . junit . Assert . assertEquals ( "projects/settings/pages/associated_edit" , editAssociatedProjectsForProject )
|
testConsole ( ) { java . io . PrintStream out = System . out ; java . io . ByteArrayOutputStream byteArrayOutputStream = new java . io . ByteArrayOutputStream ( ) ; java . lang . System . setOut ( new java . io . PrintStream ( byteArrayOutputStream ) ) ; org . apache . rocketmq . logging . inner . Appender consoleAppender = org . apache . rocketmq . logging . inner . LoggingBuilder . newAppenderBuilder ( ) . withConsoleAppender ( LoggingBuilder . SYSTEM_OUT ) . withLayout ( org . apache . rocketmq . logging . inner . LoggingBuilder . newLayoutBuilder ( ) . withDefaultLayout ( ) . build ( ) ) . build ( ) ; consoleAppender . doAppend ( loggingEvent ) ; java . lang . String result = new java . lang . String ( byteArrayOutputStream . toByteArray ( ) ) ; java . lang . System . setOut ( out ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { if ( ( message ) != null ) { return message ; } else { return getRenderedMessage ( ) ; } }
|
org . junit . Assert . assertTrue ( result . contains ( loggingEvent . getMessage ( ) . toString ( ) ) )
|
testOnePortAvailable ( ) { int numAllocated = 2 ; java . net . ServerSocket [ ] sockets = new java . net . ServerSocket [ numAllocated ] ; for ( int i = 0 ; i < numAllocated ; i ++ ) { try { sockets [ i ] = new java . net . ServerSocket ( 0 ) ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ( "An<sp>exception<sp>was<sp>thrown<sp>while<sp>preparing<sp>the<sp>test<sp>" + ( e . getMessage ( ) ) ) ) ; } } int availablePort = org . apache . flink . util . NetUtils . getAvailablePort ( ) ; org . apache . flink . configuration . Configuration conf = new org . apache . flink . configuration . Configuration ( ) ; conf . setString ( BlobServerOptions . PORT , ( ( ( ( ( sockets [ 0 ] . getLocalPort ( ) ) + "," ) + ( sockets [ 1 ] . getLocalPort ( ) ) ) + "," ) + availablePort ) ) ; conf . setString ( BlobServerOptions . STORAGE_DIRECTORY , temporaryFolder . newFolder ( ) . getAbsolutePath ( ) ) ; try { org . apache . flink . runtime . blob . BlobServer server = new org . apache . flink . runtime . blob . BlobServer ( conf , new org . apache . flink . runtime . blob . VoidBlobStore ( ) ) ; server . start ( ) ; "<AssertPlaceHolder>" ; server . close ( ) ; } finally { for ( int i = 0 ; i < numAllocated ; ++ i ) { sockets [ i ] . close ( ) ; } } } getPort ( ) { final java . net . InetSocketAddress currentServerAddress = serverAddress ; if ( currentServerAddress != null ) { return currentServerAddress . getPort ( ) ; } else { return - 1 ; } }
|
org . junit . Assert . assertEquals ( availablePort , server . getPort ( ) )
|
testProjectNames ( ) { givenProjects ( "foo" , "bar" ) ; java . util . Set < io . fabric8 . elasticsearch . plugin . model . Project > projects = service . projectNames ( "someToken" ) ; java . util . Set < io . fabric8 . elasticsearch . plugin . model . Project > exp = new java . util . HashSet < io . fabric8 . elasticsearch . plugin . model . Project > ( ) ; exp . add ( new io . fabric8 . elasticsearch . plugin . model . Project ( "foo" , "foo" ) ) ; exp . add ( new io . fabric8 . elasticsearch . plugin . model . Project ( "bar" , "bar" ) ) ; "<AssertPlaceHolder>" ; } projectNames ( java . lang . String ) { try ( io . fabric8 . openshift . client . DefaultOpenShiftClient client = factory . buildClient ( token ) ) { okhttp3 . Request request = new okhttp3 . Request . Builder ( ) . url ( ( ( client . getMasterUrl ( ) ) + "apis/project.openshift.io/v1/projects" ) ) . header ( io . fabric8 . elasticsearch . plugin . OpenshiftAPIService . ACCEPT , io . fabric8 . elasticsearch . plugin . OpenshiftAPIService . APPLICATION_JSON ) . build ( ) ; okhttp3 . Response response = client . getHttpClient ( ) . newCall ( request ) . execute ( ) ; if ( ( response . code ( ) ) != ( RestStatus . OK . getStatus ( ) ) ) { throw new org . elasticsearch . ElasticsearchSecurityException ( "Unable<sp>to<sp>retrieve<sp>users's<sp>project<sp>list" , org . elasticsearch . rest . RestStatus . fromCode ( response . code ( ) ) ) ; } java . util . Set < io . fabric8 . elasticsearch . plugin . model . Project > projects = new java . util . HashSet ( ) ; java . util . List < java . util . Map < java . lang . String , java . lang . String > > raw = com . jayway . jsonpath . JsonPath . read ( response . body ( ) . byteStream ( ) , "$.items[*].metadata" ) ; for ( java . util . Map < java . lang . String , java . lang . String > map : raw ) { projects . add ( new io . fabric8 . elasticsearch . plugin . model . Project ( map . get ( "name" ) , map . get ( "uid" ) ) ) ; } return projects ; } catch ( io . fabric8 . kubernetes . client . KubernetesClientException e ) { io . fabric8 . elasticsearch . plugin . OpenshiftAPIService . LOGGER . error ( "Error<sp>retrieving<sp>project<sp>list" , e ) ; throw new org . elasticsearch . ElasticsearchSecurityException ( e . getMessage ( ) ) ; } catch ( java . io . IOException e ) { io . fabric8 . elasticsearch . plugin . OpenshiftAPIService . LOGGER . error ( "Error<sp>retrieving<sp>project<sp>list" , e ) ; throw new org . elasticsearch . ElasticsearchException ( e ) ; } }
|
org . junit . Assert . assertEquals ( exp , projects )
|
testTimeStampToChar ( ) { java . lang . String sqlText = ( "SELECT<sp>TIMESTAMP_TO_CHAR(col1,<sp>col2),<sp>col3<sp>from<sp>" + ( com . splicemachine . derby . utils . SpliceDateFunctionsIT . tableWatcherH ) ) + "<sp>order<sp>by<sp>col3" ; try ( com . splicemachine . derby . utils . ResultSet rs = methodWatcher . executeQuery ( sqlText ) ) { java . lang . String expected = "1<sp>|<sp>COL3<sp>|\n" + ( ( ( ( "------------------------\n" + "<sp>12<sp>|<sp>12<sp>|\n" ) + "<sp>2012<sp>|<sp>2012<sp>|\n" ) + "2012-12-31<sp>|2012-12-31<sp>|\n" ) + "<sp>31<sp>|<sp>31<sp>|" ) ; "<AssertPlaceHolder>" ; } } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; }
|
org . junit . Assert . assertEquals ( ( ( "\n" + sqlText ) + "\n" ) , expected , TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) )
|
renameFile ( ) { byte [ ] bytes = getBytes ( ) ; java . lang . String filepath1 = alluxio . util . io . PathUtils . concatPath ( mLocalUfsRoot , getUniqueFileName ( ) ) ; java . io . OutputStream os = mLocalUfs . create ( filepath1 ) ; os . write ( bytes ) ; os . close ( ) ; java . lang . String filepath2 = alluxio . util . io . PathUtils . concatPath ( mLocalUfsRoot , getUniqueFileName ( ) ) ; mLocalUfs . renameFile ( filepath1 , filepath2 ) ; java . io . InputStream is = mLocalUfs . open ( filepath2 ) ; byte [ ] bytes1 = new byte [ bytes . length ] ; is . read ( bytes1 ) ; is . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { mLockedInodes . clear ( ) ; mEntries . forEach ( ( entry ) -> entry . mLock . close ( ) ) ; mEntries . clear ( ) ; }
|
org . junit . Assert . assertArrayEquals ( bytes , bytes1 )
|
shouldNotInjectIfUuidIsPresentInConfigOnly ( ) { org . openqa . selenium . ImmutableCapabilities config = new org . openqa . selenium . ImmutableCapabilities ( "browserName" , "chrome" , "chrome_binary" , "binary" , org . openqa . grid . internal . utils . configuration . GridNodeConfiguration . CONFIG_UUID_CAPABILITY , "uuid" ) ; org . openqa . selenium . ImmutableCapabilities caps = new org . openqa . selenium . ImmutableCapabilities ( "browserName" , "chrome" , CAPABILITY , com . google . common . collect . ImmutableMap . of ( "binary" , "cheese" ) ) ; org . openqa . selenium . Capabilities seen = new org . openqa . grid . selenium . node . ChromeMutator ( config ) . apply ( caps ) ; java . util . Map < java . lang . String , java . lang . Object > options = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( seen . getCapability ( org . openqa . grid . selenium . node . CAPABILITY ) ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return options . get ( key ) ; }
|
org . junit . Assert . assertEquals ( options . get ( "binary" ) , "cheese" )
|
testSetPort ( ) { org . jacoco . core . runtime . AgentOptions options = new org . jacoco . core . runtime . AgentOptions ( ) ; options . setPort ( 1234 ) ; "<AssertPlaceHolder>" ; } getPort ( ) { throw new java . lang . AssertionError ( ) ; }
|
org . junit . Assert . assertEquals ( 1234 , options . getPort ( ) )
|
testGetApplicationContext_withDeactivatedApplicationContext ( ) { org . eclipse . rap . rwt . internal . service . ServiceContext context = new org . eclipse . rap . rwt . internal . service . ServiceContext ( mock ( javax . servlet . http . HttpServletRequest . class ) , mock ( javax . servlet . http . HttpServletResponse . class ) , applicationContext ) ; org . eclipse . rap . rwt . internal . application . ApplicationContextImpl found = context . getApplicationContext ( ) ; "<AssertPlaceHolder>" ; } getApplicationContext ( ) { org . eclipse . rap . rwt . RWT . checkContext ( ) ; return org . eclipse . rap . rwt . internal . service . ContextProvider . getApplicationContext ( ) ; }
|
org . junit . Assert . assertNull ( found )
|
shouldIterateThroughAllGroups ( ) { de . slackspace . openkeepass . domain . KeePassFile keePassFile = createTreeStructure ( ) ; de . slackspace . openkeepass . domain . zipper . GroupZipper zipper = new de . slackspace . openkeepass . domain . zipper . GroupZipper ( keePassFile ) ; java . util . Iterator < de . slackspace . openkeepass . domain . Group > iter = zipper . iterator ( ) ; java . util . List < de . slackspace . openkeepass . domain . Group > visitedGroups = new java . util . ArrayList < de . slackspace . openkeepass . domain . Group > ( ) ; while ( iter . hasNext ( ) ) { de . slackspace . openkeepass . domain . Group group = iter . next ( ) ; visitedGroups . add ( group ) ; } "<AssertPlaceHolder>" ; } next ( ) { if ( ! ( hasNext ( ) ) ) { throw new java . util . NoSuchElementException ( ) ; } if ( isFirst ) { isFirst = false ; return getNode ( ) ; } if ( canDown ( ) ) { return down ( ) . getNode ( ) ; } if ( canRight ( ) ) { return right ( ) . getNode ( ) ; } return getNextRightNode ( parent ) ; }
|
org . junit . Assert . assertEquals ( 6 , visitedGroups . size ( ) )
|
testBuscarPorCnpj ( ) { com . kazale . pontointeligente . api . entities . Empresa empresa = this . empresaRepository . findByCnpj ( com . kazale . pontointeligente . api . repositories . EmpresaRepositoryTest . CNPJ ) ; "<AssertPlaceHolder>" ; } getCnpj ( ) { return cnpj ; }
|
org . junit . Assert . assertEquals ( com . kazale . pontointeligente . api . repositories . EmpresaRepositoryTest . CNPJ , empresa . getCnpj ( ) )
|
testNullValueEqualityScan ( ) { java . lang . String pTSDBTableName = generateUniqueName ( ) ; ensureTableCreated ( getUrl ( ) , pTSDBTableName , org . apache . phoenix . end2end . PTSDB_NAME , null , null , null ) ; java . lang . String url = getUrl ( ) ; java . util . Properties props = org . apache . phoenix . util . PropertiesUtil . deepCopy ( org . apache . phoenix . end2end . TEST_PROPERTIES ) ; java . sql . Connection conn = java . sql . DriverManager . getConnection ( url , props ) ; conn . setAutoCommit ( true ) ; java . sql . PreparedStatement stmt = conn . prepareStatement ( ( ( "upsert<sp>into<sp>" + pTSDBTableName ) + "<sp>VALUES<sp>('',<sp>'',<sp>?,<sp>0.5)" ) ) ; stmt . setDate ( 1 , org . apache . phoenix . end2end . VariableLengthPKIT . D1 ) ; stmt . execute ( ) ; conn . close ( ) ; java . lang . String query = ( "SELECT<sp>HOST,\"DATE\"<sp>FROM<sp>" + pTSDBTableName ) + "<sp>WHERE<sp>HOST=''<sp>AND<sp>INST=''" ; url = getUrl ( ) ; conn = java . sql . DriverManager . getConnection ( url , props ) ; try { java . sql . PreparedStatement statement = conn . prepareStatement ( query ) ; java . sql . ResultSet rs = statement . executeQuery ( ) ; "<AssertPlaceHolder>" ; } finally { conn . close ( ) ; } } next ( ) { if ( ! ( org . apache . phoenix . util . CursorUtil . moreValues ( cursorName ) ) ) { return null ; } else if ( ( fetchSize ) == ( rowsRead ) ) { return null ; } org . apache . phoenix . schema . tuple . Tuple next = delegate . next ( ) ; org . apache . phoenix . util . CursorUtil . updateCursor ( cursorName , next , delegate . peek ( ) ) ; ( rowsRead ) ++ ; return next ; }
|
org . junit . Assert . assertFalse ( rs . next ( ) )
|
recordTransferLog ( ) { org . apache . usergrid . persistence . qakka . serialization . transferlog . TransferLogSerialization logSerialization = getInjector ( ) . getInstance ( org . apache . usergrid . persistence . qakka . serialization . transferlog . TransferLogSerialization . class ) ; org . apache . usergrid . persistence . qakka . core . CassandraClient cassandraClient = getInjector ( ) . getInstance ( org . apache . usergrid . persistence . qakka . core . CassandraClientImpl . class ) ; java . lang . String queueName = "tlst_queue_" + ( org . apache . commons . lang . RandomStringUtils . randomAlphanumeric ( 15 ) ) ; java . lang . String source = org . apache . commons . lang . RandomStringUtils . randomAlphanumeric ( 15 ) ; java . lang . String dest = org . apache . commons . lang . RandomStringUtils . randomAlphanumeric ( 15 ) ; int numLogs = 100 ; for ( int i = 0 ; i < numLogs ; i ++ ) { logSerialization . recordTransferLog ( queueName , source , dest , org . apache . cassandra . utils . UUIDGen . getTimeUUID ( ) ) ; } int count = 0 ; int fetchCount = 0 ; com . datastax . driver . core . PagingState pagingState = null ; while ( true ) { org . apache . usergrid . persistence . qakka . serialization . Result < org . apache . usergrid . persistence . qakka . serialization . transferlog . TransferLog > all = logSerialization . getAllTransferLogs ( pagingState , 10 ) ; java . util . List < org . apache . usergrid . persistence . qakka . serialization . transferlog . TransferLog > logs = all . getEntities ( ) . stream ( ) . filter ( ( log ) -> log . getQueueName ( ) . equals ( queueName ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; count += logs . size ( ) ; fetchCount ++ ; if ( ( all . getPagingState ( ) ) == null ) { break ; } pagingState = all . getPagingState ( ) ; } "<AssertPlaceHolder>" ; } getPagingState ( ) { return null ; }
|
org . junit . Assert . assertEquals ( numLogs , count )
|
test ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( false )
|
returns_false_if_inner_specification_returns_true ( ) { when ( this . mockInnerSpecification . isSatisfiedBy ( this . request ) ) . thenReturn ( true ) ; boolean isSatisfied = this . specification . isSatisfiedBy ( this . request ) ; "<AssertPlaceHolder>" ; } isSatisfiedBy ( java . lang . Object ) { if ( ! ( request instanceof com . flextrade . jfixture . utility . SpecimenType ) ) { return false ; } com . flextrade . jfixture . utility . SpecimenType < ? > requestClass = ( ( com . flextrade . jfixture . utility . SpecimenType < ? > ) ( request ) ) ; java . lang . String name = requestClass . getRawType ( ) . getName ( ) ; return ! ( name . startsWith ( "org.joda" ) ) ; }
|
org . junit . Assert . assertFalse ( isSatisfied )
|
shouldReturnFalseWhenNewFPMethodOfECIsNotOCP ( ) { boolean didRuleSucceed = rule . apply ( new org . ei . drishti . util . SafeMap ( mapOf ( "newMethod" , "condom" ) ) ) ; "<AssertPlaceHolder>" ; } mapOf ( Key , Value ) { java . util . HashMap < Key , Value > normalMap = new java . util . HashMap ( ) ; normalMap . put ( key , value ) ; return normalMap ; }
|
org . junit . Assert . assertFalse ( didRuleSucceed )
|
testGetExchangeRatewithTime ( ) { long now = java . lang . System . currentTimeMillis ( ) ; java . time . LocalDate [ ] times = new java . time . LocalDate [ ] { java . time . LocalDate . now ( ) , java . time . LocalDate . now ( ) . minus ( 1 , ChronoUnit . YEARS ) , java . time . LocalDate . now ( ) . minus ( 2 , ChronoUnit . YEARS ) , java . time . LocalDate . now ( ) . minus ( 3 , ChronoUnit . YEARS ) } ; javax . money . CurrencyUnit [ ] units = new javax . money . CurrencyUnit [ ] { javax . money . Monetary . getCurrency ( "CHF" ) , javax . money . Monetary . getCurrency ( "EUR" ) , javax . money . Monetary . getCurrency ( "USD" ) } ; for ( javax . money . CurrencyUnit u1 : units ) { for ( javax . money . CurrencyUnit u2 : units ) { if ( u1 . equals ( u2 ) ) { continue ; } for ( java . time . LocalDate time : times ) { boolean exception = false ; org . javamoney . adopjsr . ExchangeRate expected = null ; try { expected = org . javamoney . adopjsr . MonetaryConversions . getExchangeRateProvider ( "IMF" ) . getExchangeRate ( org . javamoney . adopjsr . ConversionQueryBuilder . of ( ) . set ( time ) . setBaseCurrency ( u1 ) . setTermCurrency ( u2 ) . build ( ) ) ; } catch ( java . lang . Exception e ) { exception = true ; } org . javamoney . adopjsr . ExchangeRate r = conv . getExchangeRateWithTime ( u1 , u2 , time ) ; try { "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { if ( ! exception ) { throw e ; } } } } } } getExchangeRateWithTime ( javax . money . CurrencyUnit , javax . money . CurrencyUnit , java . time . LocalDate ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertEquals ( expected , r )
|
testCanSetVendor ( ) { com . eclipsesource . tabris . tracking . TrackingInfo trackingInfo = new com . eclipsesource . tabris . tracking . TrackingInfo ( ) ; trackingInfo . setDeviceVendor ( "foo" ) ; java . lang . String deviceVendor = trackingInfo . getDeviceVendor ( ) ; "<AssertPlaceHolder>" ; } getDeviceVendor ( ) { return deviceVendor ; }
|
org . junit . Assert . assertEquals ( "foo" , deviceVendor )
|
testSSTest ( ) { org . openl . rules . testmethod . TestDoubleDelta . ITestDouble instance = org . openl . rules . TestUtils . create ( org . openl . rules . testmethod . TestDoubleDelta . FILE_NAME , org . openl . rules . testmethod . TestDoubleDelta . ITestDouble . class ) ; org . openl . rules . testmethod . TestUnitsResults result = instance . testSSTest ( ) ; "<AssertPlaceHolder>" ; } getNumberOfFailures ( ) { int cnt = 0 ; for ( int i = 0 ; i < ( getNumberOfTestUnits ( ) ) ; i ++ ) { if ( ( testUnits . get ( i ) . getResultStatus ( ) ) != ( TestStatus . TR_OK ) ) { ++ cnt ; } } return cnt ; }
|
org . junit . Assert . assertEquals ( 0 , result . getNumberOfFailures ( ) )
|
shouldNotRetrieveSimpleConfiguration ( ) { org . nuxeo . ecm . core . api . DocumentModel workspace = session . getDocument ( org . nuxeo . ecm . localconf . PARENT_WORKSPACE_REF ) ; org . nuxeo . ecm . localconf . SimpleConfiguration simpleConfiguration = localConfigurationService . getConfiguration ( org . nuxeo . ecm . localconf . SimpleConfiguration . class , org . nuxeo . ecm . localconf . SimpleConfiguration . SIMPLE_CONFIGURATION_FACET , workspace ) ; "<AssertPlaceHolder>" ; } getConfiguration ( java . lang . Class , java . lang . String , org . nuxeo . ecm . core . api . DocumentModel ) { if ( ( currentDoc == null ) || ( ( currentDoc . getRef ( ) ) == null ) ) { return null ; } org . nuxeo . ecm . core . api . CoreSession session = currentDoc . getCoreSession ( ) ; if ( session == null ) { return null ; } T localConfiguration = session . adaptFirstMatchingDocumentWithFacet ( currentDoc . getRef ( ) , configurationFacet , configurationClass ) ; if ( localConfiguration == null ) { return null ; } while ( localConfiguration . canMerge ( ) ) { org . nuxeo . ecm . core . api . DocumentRef parentRef = session . getParentDocumentRef ( localConfiguration . getDocumentRef ( ) ) ; if ( parentRef == null ) { org . nuxeo . ecm . core . api . DocumentModel parentDoc = session . getParentDocument ( localConfiguration . getDocumentRef ( ) ) ; if ( parentDoc == null ) { break ; } parentRef = parentDoc . getRef ( ) ; if ( parentRef == null ) { break ; } } T parentConfiguration = session . adaptFirstMatchingDocumentWithFacet ( parentRef , configurationFacet , configurationClass ) ; if ( parentConfiguration == null ) { break ; } localConfiguration . merge ( parentConfiguration ) ; } return localConfiguration ; }
|
org . junit . Assert . assertNull ( simpleConfiguration )
|
testGetFileExtensions ( ) { System . out . println ( "getFileExtensions" ) ; org . biojava . nbio . core . search . io . blast . BlastTabularParser instance = new org . biojava . nbio . core . search . io . blast . BlastTabularParser ( ) ; java . util . List < java . lang . String > expResult = new java . util . ArrayList < java . lang . String > ( ) ; expResult . add ( "blasttabular" ) ; expResult . add ( "blasttxt" ) ; java . util . List < java . lang . String > result = instance . getFileExtensions ( ) ; "<AssertPlaceHolder>" ; } getFileExtensions ( ) { java . util . List < java . lang . String > l = new java . util . ArrayList < java . lang . String > ( ) ; l . add ( "blasttabular" ) ; l . add ( "blasttxt" ) ; return l ; }
|
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.