input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testCallBatchTasksAutoCommitTrue ( ) { com . j256 . ormlite . table . TableInfo < com . j256 . ormlite . stmt . Foo , java . lang . String > tableInfo = new com . j256 . ormlite . table . TableInfo < com . j256 . ormlite . stmt . Foo , java . lang . String > ( databaseType , com . j256 . ormlite . stmt . Foo . class ) ; com . j256 . ormlite . support . ConnectionSource connectionSource = createMock ( com . j256 . ormlite . support . ConnectionSource . class ) ; com . j256 . ormlite . support . DatabaseConnection connection = createMock ( com . j256 . ormlite . support . DatabaseConnection . class ) ; expect ( connectionSource . isSingleConnection ( "foo" ) ) . andReturn ( false ) ; expect ( connectionSource . getReadWriteConnection ( "foo" ) ) . andReturn ( connection ) ; expect ( connectionSource . saveSpecialConnection ( connection ) ) . andReturn ( false ) ; connectionSource . clearSpecialConnection ( connection ) ; connectionSource . releaseConnection ( connection ) ; expect ( connection . isAutoCommitSupported ( ) ) . andReturn ( true ) ; expect ( connection . isAutoCommit ( ) ) . andReturn ( true ) ; connection . setAutoCommit ( false ) ; connection . setAutoCommit ( true ) ; com . j256 . ormlite . stmt . StatementExecutor < com . j256 . ormlite . stmt . Foo , java . lang . String > statementExec = new com . j256 . ormlite . stmt . StatementExecutor < com . j256 . ormlite . stmt . Foo , java . lang . String > ( databaseType , tableInfo , null ) ; replay ( connectionSource , connection ) ; final java . util . concurrent . atomic . AtomicBoolean called = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; statementExec . callBatchTasks ( connectionSource , new java . util . concurrent . Callable < java . lang . Void > ( ) { @ com . j256 . ormlite . stmt . Override public com . j256 . ormlite . stmt . Void call ( ) { called . set ( true ) ; return null ; } } ) ; "<AssertPlaceHolder>" ; verify ( connectionSource , connection ) ; } call ( ) { return someVal ; }
org . junit . Assert . assertTrue ( called . get ( ) )
hasAssociatedControls ( ) { java . lang . String html = "<form<sp>id=1><button<sp>id=1><fieldset<sp>id=2<sp>/><input<sp>id=3><keygen<sp>id=4><object<sp>id=5><output<sp>id=6>" + "<select<sp>id=7><option></select><textarea<sp>id=8><p<sp>id=9>" ; leap . lang . jsoup . nodes . Document doc = leap . lang . jsoup . Jsoup . parse ( html ) ; leap . lang . jsoup . nodes . FormElement form = ( ( leap . lang . jsoup . nodes . FormElement ) ( doc . select ( "form" ) . first ( ) ) ) ; "<AssertPlaceHolder>" ; } elements ( ) { return elements ; }
org . junit . Assert . assertEquals ( 8 , form . elements ( ) . size ( ) )
get_last_element_in_iterable ( ) { java . util . List < java . lang . String > strings = com . google . common . collect . Lists . newArrayList ( "one" , "two" , "three" ) ; java . lang . String firstElement = com . google . common . collect . Iterables . getLast ( strings , null ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( "three" , firstElement )
setKeyboardShortcut ( ) { java . lang . Object acceleratorKey = redoAction . getValue ( Action . ACCELERATOR_KEY ) ; pipe . actions . edit . KeyStroke stroke = pipe . actions . edit . KeyStroke . getKeyStroke ( KeyEvent . VK_Y , java . awt . Toolkit . getDefaultToolkit ( ) . getMenuShortcutKeyMask ( ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( stroke , acceleratorKey )
test_getBuildKey ( ) { java . lang . String key = "someKey" ; java . io . PrintStream logger = mock ( java . io . PrintStream . class ) ; when ( buildListener . getLogger ( ) ) . thenReturn ( logger ) ; org . powermock . api . mockito . PowerMockito . mockStatic ( org . jenkinsci . plugins . tokenmacro . TokenMacro . class ) ; org . powermock . api . mockito . PowerMockito . when ( org . jenkinsci . plugins . tokenmacro . TokenMacro . expandAll ( build , buildListener , key ) ) . thenReturn ( key ) ; sn = new org . jenkinsci . plugins . stashNotifier . StashNotifier ( "" , "scot" , true , null , true , key , true , false , false , new jenkins . model . JenkinsLocationConfiguration ( ) ) ; java . lang . String buildKey = sn . getBuildKey ( build , buildListener ) ; "<AssertPlaceHolder>" ; } getBuildKey ( org . jenkinsci . plugins . stashNotifier . Run , org . jenkinsci . plugins . stashNotifier . TaskListener ) { java . lang . StringBuilder key = new java . lang . StringBuilder ( ) ; if ( ( prependParentProjectKey ) || ( getDescriptor ( ) . isPrependParentProjectKey ( ) ) ) { if ( null != ( run . getParent ( ) . getParent ( ) ) ) { key . append ( run . getParent ( ) . getParent ( ) . getFullName ( ) ) . append ( '-' ) ; } } if ( ( ( projectKey ) != null ) && ( ( projectKey . trim ( ) . length ( ) ) > 0 ) ) { java . io . PrintStream logger = listener . getLogger ( ) ; try { if ( ! ( run instanceof org . jenkinsci . plugins . stashNotifier . AbstractBuild < ? , ? > ) ) { key . append ( org . jenkinsci . plugins . tokenmacro . TokenMacro . expandAll ( run , new org . jenkinsci . plugins . stashNotifier . FilePath ( run . getRootDir ( ) ) , listener , projectKey ) ) ; } else { key . append ( org . jenkinsci . plugins . tokenmacro . TokenMacro . expandAll ( ( ( org . jenkinsci . plugins . stashNotifier . AbstractBuild < ? , ? > ) ( run ) ) , listener , projectKey ) ) ; } } catch ( java . io . IOException | java . lang . InterruptedException | org . jenkinsci . plugins . tokenmacro . MacroEvaluationException ioe ) { logger . println ( "Cannot<sp>expand<sp>build<sp>key<sp>from<sp>parameter.<sp>Processing<sp>with<sp>default<sp>build<sp>key" ) ; ioe . printStackTrace ( logger ) ; key . append ( getDefaultBuildKey ( run ) ) ; } } else { key . append ( getDefaultBuildKey ( run ) ) ; } return org . apache . commons . lang . StringEscapeUtils . escapeJavaScript ( key . toString ( ) ) ; }
org . junit . Assert . assertThat ( buildKey , org . hamcrest . CoreMatchers . is ( key ) )
testMessageCount ( ) { java . lang . String topicName = "myTopic" ; java . lang . String groupId = "groupId" ; io . github . tcdl . msb . adapters . amqp . AmqpConsumerAdapter adapter = createAdapterWithNonDurableConf ( topicName , groupId , false ) ; when ( mockChannel . messageCount ( anyString ( ) ) ) . thenReturn ( 42L ) ; adapter . subscribe ( ( jsonMessage , ackHandler ) -> { } ) ; verify ( mockChannel ) . exchangeDeclare ( topicName , "fanout" , false , true , null ) ; java . util . Optional < java . lang . Long > answer = java . util . Optional . of ( 42L ) ; java . util . Optional < java . lang . Long > result = adapter . messageCount ( ) ; verify ( mockChannel , times ( 1 ) ) . messageCount ( anyString ( ) ) ; "<AssertPlaceHolder>" ; } messageCount ( ) { throw new java . lang . UnsupportedOperationException ( "Message<sp>count<sp>metric<sp>is<sp>not<sp>supported" ) ; }
org . junit . Assert . assertEquals ( answer , result )
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 . dynamic . data . mapping . model . DDMFormInstanceRecord > ddmFormInstanceRecords = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( ddmFormInstanceRecords . isEmpty ( ) )
testEncodeWithFunc2 ( ) { java . lang . String toEncode = "ò" + "123" ; "2" "3" check digit 56 java . lang . String expected = ( ( ( ( ( ( ( ( com . google . zxing . oned . Code128WriterTestCase . QUIET_SPACE ) + ( com . google . zxing . oned . Code128WriterTestCase . START_CODE_B ) ) + ( com . google . zxing . oned . Code128WriterTestCase . FNC2 ) ) + "10011100110" ) + "11001110010" ) + "11001011100" ) + "11100010110" ) + ( com . google . zxing . oned . Code128WriterTestCase . STOP ) ) + ( com . google . zxing . oned . Code128WriterTestCase . QUIET_SPACE ) ; com . google . zxing . common . BitMatrix result = writer . encode ( toEncode , BarcodeFormat . CODE_128 , 0 , 0 ) ; java . lang . String actual = com . google . zxing . common . BitMatrixTestCase . matrixToString ( result ) ; "<AssertPlaceHolder>" ; } matrixToString ( com . google . zxing . common . BitMatrix ) { org . junit . Assert . assertEquals ( 1 , result . getHeight ( ) ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( result . getWidth ( ) ) ; for ( int i = 0 ; i < ( result . getWidth ( ) ) ; i ++ ) { builder . append ( ( result . get ( i , 0 ) ? '1' : '0' ) ) ; } return builder . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testExcludeTableIncludeColumns ( ) { java . util . List < com . zendesk . maxwell . row . RowMap > list ; com . zendesk . maxwell . filtering . Filter filter = new com . zendesk . maxwell . filtering . Filter ( ) ; filter . addRule ( "exclude:<sp>foo.bars,<sp>include:<sp>foo.bars.something=accept" ) ; list = getRowsForSQL ( filter , com . zendesk . maxwell . MaxwellIntegrationTest . insertColumnSQL , com . zendesk . maxwell . MaxwellIntegrationTest . createDBs ) ; "<AssertPlaceHolder>" ; } size ( ) { return columns . size ( ) ; }
org . junit . Assert . assertThat ( list . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
whenGettingConceptById_ReturnTheConcept ( ) { grakn . core . concept . type . EntityType entityType = tx . putEntityType ( "test-name" ) ; "<AssertPlaceHolder>" ; } getConcept ( grakn . core . concept . ConceptId ) { return operateOnOpenGraph ( ( ) -> { if ( transactionCache . isConceptCached ( id ) ) { return transactionCache . getCachedConcept ( id ) ; } else { if ( id . getValue ( ) . startsWith ( Schema . PREFIX_EDGE ) ) { Optional < grakn . core . server . session . T > concept = getConceptEdge ( id ) ; if ( concept . isPresent ( ) ) return concept . get ( ) ; } grakn . core . server . session . T concept = getConcept ( getTinkerTraversal ( ) . V ( grakn . core . server . kb . Schema . elementId ( id ) ) ) ; return concept == null ? this . getConcept ( Schema . VertexProperty . EDGE_RELATION_ID , id . getValue ( ) ) : concept ; } } ) ; }
org . junit . Assert . assertEquals ( entityType , tx . getConcept ( entityType . id ( ) ) )
testGetAttribute_Override ( ) { java . lang . String actual = eTable . getHEAD ( ) ; java . lang . String expected = "exthd" ; "<AssertPlaceHolder>" ; } getHEAD ( ) { return "hd" ; }
org . junit . Assert . assertEquals ( expected , actual )
testDeleteAccessConfig ( ) { initializeExpectedInstance ( 2 ) ; expect ( compute . getOptions ( ) ) . andReturn ( mockOptions ) ; com . google . cloud . compute . deprecated . Operation operation = new com . google . cloud . compute . deprecated . Operation . Builder ( serviceMockReturnsOptions ) . setOperationId ( com . google . cloud . compute . deprecated . ZoneOperationId . of ( "project" , "op" ) ) . build ( ) ; expect ( compute . deleteAccessConfig ( com . google . cloud . compute . deprecated . InstanceTest . INSTANCE_ID , "nic0" , "NAT" ) ) . andReturn ( operation ) ; replay ( compute ) ; initializeInstance ( ) ; "<AssertPlaceHolder>" ; } initializeInstance ( ) { instance = new com . google . cloud . compute . deprecated . Instance . Builder ( compute , com . google . cloud . compute . deprecated . InstanceTest . INSTANCE_ID , com . google . cloud . compute . deprecated . InstanceTest . MACHINE_TYPE , com . google . cloud . compute . deprecated . InstanceTest . ATTACHED_DISK , com . google . cloud . compute . deprecated . InstanceTest . NETWORK_INTERFACE ) . setGeneratedId ( com . google . cloud . compute . deprecated . InstanceTest . GENERATED_ID ) . setCreationTimestamp ( com . google . cloud . compute . deprecated . InstanceTest . CREATION_TIMESTAMP ) . setDescription ( com . google . cloud . compute . deprecated . InstanceTest . DESCRIPTION ) . setStatus ( com . google . cloud . compute . deprecated . InstanceTest . STATUS ) . setStatusMessage ( com . google . cloud . compute . deprecated . InstanceTest . STATUS_MESSAGE ) . setTags ( com . google . cloud . compute . deprecated . InstanceTest . TAGS ) . setCanIpForward ( com . google . cloud . compute . deprecated . InstanceTest . CAN_IP_FORWARD ) . setMetadata ( com . google . cloud . compute . deprecated . InstanceTest . METADATA ) . setServiceAccounts ( com . google . cloud . compute . deprecated . InstanceTest . SERVICE_ACCOUNTS ) . setSchedulingOptions ( com . google . cloud . compute . deprecated . InstanceTest . SCHEDULING_OPTIONS ) . setCpuPlatform ( com . google . cloud . compute . deprecated . InstanceTest . CPU_PLATFORM ) . build ( ) ; }
org . junit . Assert . assertSame ( operation , instance . deleteAccessConfig ( "nic0" , "NAT" ) )
testJoinNoMatch ( ) { com . huawei . streaming . common . Pair < com . huawei . streaming . event . IEvent [ ] [ ] , com . huawei . streaming . event . IEvent [ ] [ ] > prepare1 = com . huawei . streaming . process . join . SupportDataPrepare . dataPrepare ( SupportConst . I_TWO , SupportConst . I_THREE ) ; com . huawei . streaming . common . Pair < com . huawei . streaming . event . IEvent [ ] [ ] , com . huawei . streaming . event . IEvent [ ] [ ] > prepare2 = com . huawei . streaming . process . join . SupportDataPrepare . dataPrepare ( SupportConst . I_THREE , SupportConst . I_FIVE ) ; sideJoin . maintainData ( prepare1 . getFirst ( ) , prepare1 . getSecond ( ) ) ; sideJoin . maintainData ( prepare2 . getFirst ( ) , prepare2 . getSecond ( ) ) ; newDataPerStream [ 1 ] [ 0 ] = com . huawei . streaming . process . join . SupportDataPrepare . genItemEvent ( SupportConst . I_SIX ) ; result = sideJoin . join ( newDataPerStream , null ) ; java . util . Set < com . huawei . streaming . common . MultiKey > expSet = new java . util . LinkedHashSet < com . huawei . streaming . common . MultiKey > ( ) ; java . lang . Object [ ] obj = new java . lang . Object [ com . huawei . streaming . support . SupportConst . I_TWO ] ; obj [ 0 ] = newDataPerStream [ 0 ] [ 0 ] ; obj [ 1 ] = prepare2 . getFirst ( ) [ 1 ] [ 0 ] ; expSet . add ( new com . huawei . streaming . common . MultiKey ( obj ) ) ; "<AssertPlaceHolder>" ; } getFirst ( ) { return first ; }
org . junit . Assert . assertEquals ( 0L , ( ( long ) ( result . getFirst ( ) . size ( ) ) ) )
givenAFieldWithoutGetter_whenCreatingAGetter_thenCorrectlyInvoked ( ) { java . lang . invoke . MethodHandles . Lookup lookup = java . lang . invoke . MethodHandles . lookup ( ) ; java . lang . invoke . MethodHandle getTitleMH = lookup . findGetter ( com . baeldung . java9 . methodhandles . Book . class , "title" , java . lang . String . class ) ; com . baeldung . java9 . methodhandles . Book book = new com . baeldung . java9 . methodhandles . Book ( "ISBN-1234" , "Effective<sp>Java" ) ; "<AssertPlaceHolder>" ; } invoke ( java . lang . Double ) { return c >= 0 ; }
org . junit . Assert . assertEquals ( "Effective<sp>Java" , getTitleMH . invoke ( book ) )
userNameValidDollarSign ( ) { org . apache . hadoop . hdfs . web . resources . UserParam userParam = new org . apache . hadoop . hdfs . web . resources . UserParam ( "a$" ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertNotNull ( userParam . getValue ( ) )
hasColumnDefinitionsWithAttributeColumn ( ) { final org . drools . workbench . models . guided . dtable . shared . model . AttributeCol52 attribute = new org . drools . workbench . models . guided . dtable . shared . model . AttributeCol52 ( ) ; attribute . setAttribute ( "attribute" ) ; dtPresenter . getModel ( ) . getAttributeCols ( ) . add ( attribute ) ; "<AssertPlaceHolder>" ; } hasColumnDefinitions ( ) { final boolean hasAttributeCols = ( model . getAttributeCols ( ) . size ( ) ) > 0 ; final boolean hasMetadataCols = ( model . getMetadataCols ( ) . size ( ) ) > 0 ; final boolean hasConditionCols = ( model . getConditionsCount ( ) ) > 0 ; final boolean hasActionCols = ( model . getActionCols ( ) . size ( ) ) > 0 ; return ( ( hasAttributeCols || hasConditionCols ) || hasActionCols ) || hasMetadataCols ; }
org . junit . Assert . assertTrue ( dtPresenter . hasColumnDefinitions ( ) )
testConverteerBijhoudingVerhuizingNaOpschorting ( ) { final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Stapel < nl . bzk . migratiebrp . conversie . model . lo3 . categorie . Lo3InschrijvingInhoud > lo3InschrijvingStapel = buildInschrijving ( Lo3RedenOpschortingBijhoudingCodeEnum . FOUT , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20091231 ) ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Stapel < nl . bzk . migratiebrp . conversie . model . lo3 . categorie . Lo3VerblijfplaatsInhoud > lo3VerblijfplaatsStapel = buildVerblijfplaats ( ) ; final nl . bzk . migratiebrp . conversie . model . tussen . TussenPersoonslijstBuilder builder = new nl . bzk . migratiebrp . conversie . model . tussen . TussenPersoonslijstBuilder ( ) ; inschrijvingConverteerder . converteer ( lo3VerblijfplaatsStapel , lo3InschrijvingStapel , false , builder ) ; final nl . bzk . migratiebrp . conversie . model . tussen . TussenPersoonslijst tussenPersoonslijst = builder . build ( ) ; final nl . bzk . migratiebrp . conversie . model . tussen . TussenStapel < nl . bzk . migratiebrp . conversie . model . brp . groep . BrpBijhoudingInhoud > migratieBijhoudingStapel = tussenPersoonslijst . getBijhoudingStapel ( ) ; "<AssertPlaceHolder>" ; checkInhoud ( migratieBijhoudingStapel , 0 , BrpBijhoudingsaardCode . INGEZETENE , BrpNadereBijhoudingsaardCode . FOUT , new nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpPartijCode ( 51801 ) , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20100101 ) , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20100101 ) ) ; checkInhoud ( migratieBijhoudingStapel , 1 , BrpBijhoudingsaardCode . ONBEKEND , BrpNadereBijhoudingsaardCode . ONBEKEND , new nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpPartijCode ( 59901 ) , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20050101 ) , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20050101 ) ) ; checkInhoud ( migratieBijhoudingStapel , 2 , BrpBijhoudingsaardCode . ONBEKEND , BrpNadereBijhoudingsaardCode . ONBEKEND , new nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpPartijCode ( 59901 ) , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20000101 ) , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20000101 ) ) ; checkInhoud ( migratieBijhoudingStapel , 3 , BrpBijhoudingsaardCode . INGEZETENE , BrpNadereBijhoudingsaardCode . FOUT , new nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpPartijCode ( 59901 ) , new nl . bzk . migratiebrp . conversie . model . lo3 . element . Lo3Datum ( 20091231 ) , nl . bzk . migratiebrp . conversie . regels . proces . lo3naarbrp . attributen . InschrijvingConverteerderTest . LO3_DATUMTIJDSTEMPEL_AS_DATUM ) ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 4 , migratieBijhoudingStapel . size ( ) )
shouldNotReceiveDuplicateMessages ( ) { final java . io . File location = net . openhft . chronicle . queue . impl . single . DirectoryUtils . tempDir ( net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . class . getSimpleName ( ) ) ; final net . openhft . chronicle . queue . impl . single . ChronicleQueue chronicleQueue = net . openhft . chronicle . queue . impl . single . SingleChronicleQueueBuilder . binary ( location ) . rollCycle ( net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . QUEUE_CYCLE ) . build ( ) ; final net . openhft . chronicle . queue . impl . single . ExcerptAppender appender = chronicleQueue . acquireAppender ( ) ; appender . pretouch ( ) ; final java . util . List < net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . Data > expected = new java . util . ArrayList ( ) ; for ( int i = 50 ; i < 60 ; i ++ ) { expected . add ( new net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . Data ( i ) ) ; } final net . openhft . chronicle . queue . impl . single . ExcerptTailer tailer = chronicleQueue . createTailer ( ) ; tailer . toEnd ( ) ; for ( final net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . Data data : expected ) { net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . write ( appender , data ) ; } final java . util . List < net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . Data > actual = new java . util . ArrayList ( ) ; net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . Data data ; while ( ( data = net . openhft . chronicle . queue . impl . single . DuplicateMessageReadTest . read ( tailer ) ) != null ) { actual . add ( data ) ; } "<AssertPlaceHolder>" ; } add ( java . io . File ) { toDeleteList . add ( path ) ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( expected ) )
eatPealed ( ) { org . mule . tck . testmodels . fruit . Banana banana = ( ( org . mule . tck . testmodels . fruit . Banana ) ( flowRunner ( "eatPealedBanana" ) . run ( ) . getMessage ( ) . getPayload ( ) . getValue ( ) ) ) ; "<AssertPlaceHolder>" ; } isBitten ( ) { return bitten ; }
org . junit . Assert . assertThat ( banana . isBitten ( ) , org . hamcrest . CoreMatchers . is ( true ) )
testGetXResourceFile ( ) { java . io . File file = new java . io . File ( "testGetXResource" ) ; javax . ws . rs . core . Response expectedResponse = javax . ws . rs . core . Response . ok ( file , MediaType . APPLICATION_OCTET_STREAM ) . header ( "Content-Disposition" , ( "attachment;filename=" + ( file . getName ( ) ) ) ) . build ( ) ; org . apache . ranger . view . VXResource vxResource = vxResource ( org . apache . ranger . rest . TestAssetREST . Id ) ; org . mockito . Mockito . when ( searchUtil . extractString ( ( ( javax . servlet . http . HttpServletRequest ) ( org . mockito . Mockito . any ( ) ) ) , ( ( org . apache . ranger . common . SearchCriteria ) ( org . mockito . Mockito . any ( ) ) ) , ( ( java . lang . String ) ( org . mockito . Mockito . any ( ) ) ) , ( ( java . lang . String ) ( org . mockito . Mockito . any ( ) ) ) , ( ( java . lang . String ) ( org . mockito . Mockito . any ( ) ) ) ) ) . thenReturn ( "json" ) ; org . mockito . Mockito . when ( assetREST . getXResource ( org . apache . ranger . rest . TestAssetREST . Id ) ) . thenReturn ( vxResource ) ; org . mockito . Mockito . when ( assetMgr . getXResourceFile ( vxResource , "json" ) ) . thenReturn ( file ) ; javax . ws . rs . core . Response reponse = assetREST . getXResourceFile ( request , org . apache . ranger . rest . TestAssetREST . Id ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( assetMgr ) . getXResourceFile ( vxResource , "json" ) ; org . mockito . Mockito . verify ( searchUtil ) . extractString ( ( ( javax . servlet . http . HttpServletRequest ) ( org . mockito . Mockito . any ( ) ) ) , ( ( org . apache . ranger . common . SearchCriteria ) ( org . mockito . Mockito . any ( ) ) ) , ( ( java . lang . String ) ( org . mockito . Mockito . any ( ) ) ) , ( ( java . lang . String ) ( org . mockito . Mockito . any ( ) ) ) , ( ( java . lang . String ) ( org . mockito . Mockito . any ( ) ) ) ) ; } getStatus ( ) { return status ; }
org . junit . Assert . assertEquals ( expectedResponse . getStatus ( ) , reponse . getStatus ( ) )
testFacetOrigin ( ) { test . org . jboss . forge . addon . facets . factory . MockFaceted faceted = new test . org . jboss . forge . addon . facets . factory . MockFaceted ( ) ; test . org . jboss . forge . addon . facets . factory . MockFacet facet = facetFactory . create ( faceted , test . org . jboss . forge . addon . facets . factory . MockFacet . class ) ; "<AssertPlaceHolder>" ; } getFaceted ( ) { return this . origin ; }
org . junit . Assert . assertEquals ( faceted , facet . getFaceted ( ) )
testGetID ( ) { com . aliyun . odps . Table a = odps . tables ( ) . get ( com . aliyun . odps . TableTest . TABLE_NAME ) ; "<AssertPlaceHolder>" ; } getTableID ( ) { if ( ( model . ID ) == null ) { lazyLoad ( ) ; } return model . ID ; }
org . junit . Assert . assertNotNull ( a . getTableID ( ) )
testReadChunked ( ) { com . predic8 . membrane . core . http . RequestTest . reqChunked . read ( inChunked , true ) ; "<AssertPlaceHolder>" ; } getBodyAsStream ( ) { try { return body . getContentAsStream ( ) ; } catch ( java . io . IOException e ) { com . predic8 . membrane . core . http . Message . log . error ( "Could<sp>not<sp>get<sp>body<sp>as<sp>stream" , e ) ; throw new java . lang . RuntimeException ( "Could<sp>not<sp>get<sp>body<sp>as<sp>stream" , e ) ; } }
org . junit . Assert . assertNotNull ( com . predic8 . membrane . core . http . RequestTest . reqChunked . getBodyAsStream ( ) )
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . document . library . kernel . model . DLFileEntry . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "fileEntryId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . document . library . kernel . model . DLFileEntry > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
instanciateShouldDelegateToComponentFactory ( ) { mockStatic ( org . codegist . crest . util . ComponentFactory . class ) ; when ( org . codegist . crest . util . ComponentFactory . instantiate ( java . lang . String . class , mockCRestConfig ) ) . thenReturn ( "a" ) ; java . lang . String actual = toTest . instantiate ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } instantiate ( java . lang . Class ) { if ( clazz == null ) { return null ; } else { try { return org . codegist . crest . util . ComponentFactory . instantiate ( clazz , crestConfig ) ; } catch ( java . lang . Exception e ) { throw org . codegist . crest . CRestException . handle ( e ) ; } } }
org . junit . Assert . assertEquals ( "a" , actual )
testAgentStatus ( ) { agentControllerServerDaemon . shutdown ( ) ; agentControllerServerDaemon = new net . grinder . AgentControllerServerDaemon ( agentControllerServerDaemon . getPort ( ) ) ; agentControllerServerDaemon . start ( ) ; sleep ( 3000 ) ; allAvailableAgents = agentControllerServerDaemon . getAllAvailableAgents ( ) ; "<AssertPlaceHolder>" ; } getAllAvailableAgents ( ) { return agentControllerServer . getComponent ( net . grinder . AgentProcessControlImplementation . class ) . getAllAgents ( ) ; }
org . junit . Assert . assertThat ( allAvailableAgents . size ( ) , org . hamcrest . Matchers . is ( 2 ) )
testId ( ) { com . bazaarvoice . ostrich . ServiceEndPoint endPoint = new com . bazaarvoice . ostrich . ServiceEndPointBuilder ( ) . withServiceName ( "service" ) . withId ( "id" ) . build ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( "id" , endPoint . getId ( ) )
testGetNodeAsSource ( ) { java . io . InputStream is = new java . io . ByteArrayInputStream ( "<foo><bar/></foo>" . getBytes ( ) ) ; org . apache . cxf . jaxrs . ext . xml . XMLSource xp = new org . apache . cxf . jaxrs . ext . xml . XMLSource ( is ) ; xp . setBuffering ( ) ; javax . xml . transform . Source element = xp . getNode ( "/foo/bar" , javax . xml . transform . Source . class ) ; "<AssertPlaceHolder>" ; } getNode ( java . lang . String , java . lang . Class ) { return getNode ( expression , org . apache . cxf . helpers . CastUtils . cast ( java . util . Collections . emptyMap ( ) , java . lang . String . class , java . lang . String . class ) , cls ) ; }
org . junit . Assert . assertNotNull ( element )
getPersonAddress_shouldGetVoidedPersonAddressIfPersonIsVoidedAndNotvoidedAddressDoesNotExist ( ) { org . openmrs . PersonAddress voidedAddress1 = org . openmrs . PersonTest . PersonAddressBuilder . newBuilder ( ) . withVoided ( true ) . build ( ) ; org . openmrs . PersonAddress voidedAddress2 = org . openmrs . PersonTest . PersonAddressBuilder . newBuilder ( ) . withVoided ( true ) . build ( ) ; java . util . Set < org . openmrs . PersonAddress > personAddresses = new java . util . HashSet ( java . util . Arrays . asList ( voidedAddress1 , voidedAddress2 ) ) ; org . openmrs . Person person = new org . openmrs . Person ( ) ; person . setVoided ( true ) ; person . setAddresses ( personAddresses ) ; org . openmrs . PersonAddress actualPersonAddress = person . getPersonAddress ( ) ; "<AssertPlaceHolder>" ; } getVoided ( ) { return voided ; }
org . junit . Assert . assertTrue ( actualPersonAddress . getVoided ( ) )
testAddPortPresent ( ) { java . lang . String normalized = org . apache . ambari . view . utils . hdfs . ConfigurationBuilder . addPortIfMissing ( "webhdfs://namenode.example.com:50070" ) ; "<AssertPlaceHolder>" ; } addPortIfMissing ( java . lang . String ) { if ( ! ( org . apache . ambari . view . utils . hdfs . ConfigurationBuilder . hasPort ( defaultFs ) ) ) { defaultFs = defaultFs + ":50070" ; } return defaultFs ; }
org . junit . Assert . assertEquals ( normalized , "webhdfs://namenode.example.com:50070" )
createsProducerForTypeThatHasStringValueOfMethod ( ) { org . everrest . core . method . TypeProducer typeProducer = typeProducerFactory . createTypeProducer ( org . everrest . core . impl . method . TypeProducerFactoryTest . ValueOfStringClass . class , null ) ; "<AssertPlaceHolder>" ; } createTypeProducer ( java . lang . Class , java . lang . reflect . Type ) { if ( ( ( aClass == ( java . util . List . class ) ) || ( aClass == ( java . util . Set . class ) ) ) || ( aClass == ( java . util . SortedSet . class ) ) ) { java . lang . Class < ? > actualTypeArgument = null ; if ( genericType != null ) { actualTypeArgument = getActualTypeArgument ( genericType ) ; } java . lang . reflect . Method methodValueOf ; java . lang . reflect . Constructor < ? > constructor ; if ( ( actualTypeArgument == ( org . everrest . core . impl . method . String . class ) ) || ( actualTypeArgument == null ) ) { return new org . everrest . core . impl . method . CollectionStringProducer ( aClass ) ; } else if ( ( methodValueOf = getStringValueOfMethod ( actualTypeArgument ) ) != null ) { return new org . everrest . core . impl . method . CollectionStringValueOfProducer ( aClass , methodValueOf ) ; } else if ( ( constructor = getStringConstructor ( actualTypeArgument ) ) != null ) { return new org . everrest . core . impl . method . CollectionStringConstructorProducer ( aClass , constructor ) ; } } else { java . lang . reflect . Method methodValueOf ; java . lang . reflect . Constructor < ? > constructor ; if ( aClass . isPrimitive ( ) ) { return new org . everrest . core . impl . method . PrimitiveTypeProducer ( aClass ) ; } else if ( aClass == ( org . everrest . core . impl . method . String . class ) ) { return new org . everrest . core . impl . method . StringProducer ( ) ; } else if ( ( methodValueOf = getStringValueOfMethod ( aClass ) ) != null ) { return new org . everrest . core . impl . method . StringValueOfProducer ( methodValueOf ) ; } else if ( ( constructor = getStringConstructor ( aClass ) ) != null ) { return new org . everrest . core . impl . method . StringConstructorProducer ( constructor ) ; } } throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "Unsupported<sp>type<sp>%s" , aClass ) ) ; }
org . junit . Assert . assertEquals ( org . everrest . core . impl . method . StringValueOfProducer . class , typeProducer . getClass ( ) )
testGetRowNumber ( ) { wd . open ( org . finra . jtaf . ewd . widget . element . html . TableTest . url ) ; org . finra . jtaf . ewd . widget . ITable table = new org . finra . jtaf . ewd . widget . element . html . Table ( tableLocator ) ; java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "Header<sp>1" , "Row<sp>1:<sp>Cell<sp>1" ) ; int rowNumber = table . getRowNumber ( map ) ; "<AssertPlaceHolder>" ; } getRowNumber ( java . util . Map ) { try { java . util . List < java . util . Map < java . lang . String , java . lang . String > > tableData = getTableDataInMap ( ) ; int index = 1 ; for ( java . util . Map < java . lang . String , java . lang . String > rowData : tableData ) { boolean found = true ; for ( Map . Entry < java . lang . String , java . lang . String > expectedEntry : item . entrySet ( ) ) { java . lang . String actual = rowData . get ( expectedEntry . getKey ( ) ) ; if ( ! ( actual . equals ( expectedEntry . getValue ( ) ) ) ) { found = false ; } } if ( found ) { return index ; } index ++ ; } return - 1 ; } catch ( java . lang . Exception e ) { throw new org . finra . jtaf . ewd . widget . WidgetException ( ( ( "Error<sp>while<sp>determining<sp>row<sp>number<sp>matching<sp>item<sp>" + item ) + "<sp>in<sp>table" ) , generateXPathLocator ( ) , e ) ; } }
org . junit . Assert . assertEquals ( rowNumber , 1 )
testDetectTypeFromTextWithIrodsSpacey ( ) { org . irods . jargon . core . rule . RuleTypeEvaluator detector = new org . irods . jargon . core . rule . RuleTypeEvaluator ( ) ; java . lang . String ruleText = "#<sp>@RuleEngine=\"<sp>IRODS<sp>\"<sp>" ; org . irods . jargon . core . rule . IrodsRuleInvocationTypeEnum actual = detector . detectTypeFromRuleTextAnnotation ( ruleText ) ; "<AssertPlaceHolder>" ; } detectTypeFromRuleTextAnnotation ( java . lang . String ) { org . irods . jargon . core . rule . RuleTypeEvaluator . log . info ( "detectTypeFromRuleTextAnnotation()" ) ; if ( ( ruleText == null ) || ( ruleText . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "null<sp>or<sp>empty<sp>ruleText" ) ; } org . irods . jargon . core . rule . RuleTypeEvaluator . log . info ( "ruleText:{}" , ruleText ) ; org . irods . jargon . core . rule . IrodsRuleInvocationTypeEnum enumVal ; int reAnnotationIndex = ruleText . indexOf ( org . irods . jargon . core . rule . RuleTypeEvaluator . RULE_ENGINE_ANNOTATION ) ; if ( reAnnotationIndex > ( - 1 ) ) { org . irods . jargon . core . rule . RuleTypeEvaluator . log . debug ( "found<sp>an<sp>annotation!" ) ; int endOfAnnotation = reAnnotationIndex + ( org . irods . jargon . core . rule . RuleTypeEvaluator . RULE_ENGINE_ANNOTATION . length ( ) ) ; int nextSpace = ruleText . indexOf ( "\"" , endOfAnnotation ) ; if ( nextSpace == ( - 1 ) ) { org . irods . jargon . core . rule . RuleTypeEvaluator . log . warn ( "couldn't<sp>find<sp>end<sp>of<sp>annotation,<sp>just<sp>bail" ) ; return null ; } java . lang . String annotationType = ruleText . substring ( endOfAnnotation , nextSpace ) . trim ( ) ; org . irods . jargon . core . rule . RuleTypeEvaluator . log . debug ( "annotationType:{}" , annotationType ) ; if ( annotationType . equals ( IrodsRuleInvocationTypeEnum . IRODS . toString ( ) ) ) { enumVal = IrodsRuleInvocationTypeEnum . IRODS ; } else if ( annotationType . equals ( IrodsRuleInvocationTypeEnum . PYTHON . toString ( ) ) ) { enumVal = IrodsRuleInvocationTypeEnum . PYTHON ; } else { enumVal = null ; } } else { enumVal = null ; } return enumVal ; }
org . junit . Assert . assertEquals ( IrodsRuleInvocationTypeEnum . IRODS , actual )
noArgs ( ) { org . springframework . retry . annotation . RecoverAnnotationRecoveryHandlerTests . NoArgs target = new org . springframework . retry . annotation . RecoverAnnotationRecoveryHandlerTests . NoArgs ( ) ; org . springframework . retry . annotation . RecoverAnnotationRecoveryHandler < ? > handler = new org . springframework . retry . annotation . RecoverAnnotationRecoveryHandler < java . lang . Integer > ( target , org . springframework . util . ReflectionUtils . findMethod ( org . springframework . retry . annotation . RecoverAnnotationRecoveryHandlerTests . NoArgs . class , "foo" ) ) ; handler . recover ( new java . lang . Object [ 0 ] , new java . lang . RuntimeException ( "Planned" ) ) ; "<AssertPlaceHolder>" ; } getCause ( ) { return cause ; }
org . junit . Assert . assertEquals ( "Planned" , target . getCause ( ) . getMessage ( ) )
testDecodeMultiClass ( ) { java . util . List < java . lang . String > encoded = java . util . Arrays . asList ( opennlp . tools . namefind . BilouCodecTest . OTHER , opennlp . tools . namefind . BilouCodecTest . A_START , opennlp . tools . namefind . BilouCodecTest . A_CONTINUE , opennlp . tools . namefind . BilouCodecTest . A_LAST , opennlp . tools . namefind . BilouCodecTest . OTHER , opennlp . tools . namefind . BilouCodecTest . B_START , opennlp . tools . namefind . BilouCodecTest . B_LAST , opennlp . tools . namefind . BilouCodecTest . OTHER , opennlp . tools . namefind . BilouCodecTest . C_UNIT , opennlp . tools . namefind . BilouCodecTest . OTHER ) ; opennlp . tools . util . Span [ ] expected = new opennlp . tools . util . Span [ ] { new opennlp . tools . util . Span ( 1 , 4 , opennlp . tools . namefind . BilouCodecTest . A_TYPE ) , new opennlp . tools . util . Span ( 5 , 7 , opennlp . tools . namefind . BilouCodecTest . B_TYPE ) , new opennlp . tools . util . Span ( 8 , 9 , opennlp . tools . namefind . BilouCodecTest . C_TYPE ) } ; opennlp . tools . util . Span [ ] actual = opennlp . tools . namefind . BilouCodecTest . codec . decode ( encoded ) ; "<AssertPlaceHolder>" ; } decode ( java . util . List ) { int start = - 1 ; int end = - 1 ; java . util . List < opennlp . tools . util . Span > spans = new java . util . ArrayList ( c . size ( ) ) ; for ( int li = 0 ; li < ( c . size ( ) ) ; li ++ ) { java . lang . String chunkTag = c . get ( li ) ; if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . START ) ) { if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( li - 1 ) ) ) ) ) ; } start = li ; end = li + 1 ; } else if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . CONTINUE ) ) { end = li + 1 ; } else if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . OTHER ) ) { if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( li - 1 ) ) ) ) ) ; start = - 1 ; end = - 1 ; } } } if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( ( c . size ( ) ) - 1 ) ) ) ) ) ; } return spans . toArray ( new opennlp . tools . util . Span [ spans . size ( ) ] ) ; }
org . junit . Assert . assertArrayEquals ( expected , actual )
equalsTestRight2 ( ) { de . vksi . c4j . acceptancetest . point . ColoredPoint x = classUnderTest ; de . vksi . c4j . acceptancetest . point . Point y = new de . vksi . c4j . acceptancetest . point . Point ( x . getX ( ) , x . getY ( ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return set . equals ( obj ) ; }
org . junit . Assert . assertFalse ( x . equals ( y ) )
testAggOverInlineView ( ) { java . lang . String sql = "SELECT<sp>SUM(x)<sp>FROM<sp>(SELECT<sp>(e2<sp>+<sp>1)<sp>AS<sp>x<sp>FROM<sp>pm1.g1)<sp>AS<sp>g" ; org . teiid . query . sql . lang . Command c = helpResolve ( sql ) ; "<AssertPlaceHolder>" ; verifyProjectedTypes ( c , new java . lang . Class [ ] { org . teiid . query . resolver . Long . class } ) ; } toString ( ) { if ( eIsProxy ( ) ) return super . toString ( ) ; java . lang . StringBuffer result = new java . lang . StringBuffer ( super . toString ( ) ) ; result . append ( "<sp>(description:<sp>" ) ; result . append ( description ) ; result . append ( ",<sp>keywords:<sp>" ) ; result . append ( keywords ) ; result . append ( ')' ) ; return result . toString ( ) ; }
org . junit . Assert . assertEquals ( sql , c . toString ( ) )
checkScrolledPropertiesBlock ( ) { org . eclipse . ice . datastructures . form . MasterDetailsComponent masterDetailsComponent = new org . eclipse . ice . datastructures . form . MasterDetailsComponent ( ) ; org . eclipse . ice . client . widgets . ICEDetailsPageProvider pageProvider = new org . eclipse . ice . client . widgets . ICEDetailsPageProvider ( masterDetailsComponent , null ) ; org . eclipse . ice . client . widgets . ICEDetailsPageProvider otherPageProvider = new org . eclipse . ice . client . widgets . ICEDetailsPageProvider ( masterDetailsComponent , null ) ; org . eclipse . ice . client . widgets . ICEScrolledPropertiesBlock ICEScrolledPropertiesBlock = new org . eclipse . ice . client . widgets . ICEScrolledPropertiesBlock ( null , null , pageProvider ) ; otherPageProvider = ( ( org . eclipse . ice . client . widgets . ICEDetailsPageProvider ) ( ICEScrolledPropertiesBlock . getDetailsPageProvider ( ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { boolean equal = false ; if ( ( other != null ) && ( other instanceof org . eclipse . ice . reflectivity . MaterialSelection ) ) { if ( ( this ) == other ) { equal = true ; } else { org . eclipse . ice . reflectivity . MaterialSelection selection = ( ( org . eclipse . ice . reflectivity . MaterialSelection ) ( other ) ) ; equal = ( this . material . equals ( selection . material ) ) && ( this . selectedProperty . equals ( selection . selectedProperty ) ) ; } } return equal ; }
org . junit . Assert . assertTrue ( pageProvider . equals ( otherPageProvider ) )
notEarlierThan3 ( ) { org . apache . jackrabbit . oak . plugins . document . util . TimeInterval t = ti . notEarlierThan ( ( ( start ) - 1 ) ) ; "<AssertPlaceHolder>" ; } notEarlierThan ( long ) { if ( ( fromMs ) < timestampMs ) { return new org . apache . jackrabbit . oak . plugins . document . util . TimeInterval ( timestampMs , ( timestampMs > ( toMs ) ? timestampMs : toMs ) ) ; } else { return this ; } }
org . junit . Assert . assertEquals ( t , ti )
testAliasNoValue ( ) { org . teiid . adminapi . impl . ModelMetaData mmd = new org . teiid . adminapi . impl . ModelMetaData ( ) ; mmd . setName ( "vw" ) ; mmd . addSourceMetadata ( "ddl" , ( "create<sp>view<sp>x<sp>(a<sp>string<sp>primary<sp>key,<sp>b<sp>integer)<sp>" + "as<sp>select<sp>'xyz',<sp>123<sp>union<sp>all<sp>select<sp>'abc',<sp>456;" ) ) ; mmd . setModelType ( Model . Type . VIRTUAL ) ; org . teiid . olingo . TestODataIntegration . teiid . deployVDB ( "northwind" , mmd ) ; org . eclipse . jetty . client . api . ContentResponse response = org . teiid . olingo . TestODataIntegration . http . GET ( ( ( ( org . teiid . olingo . TestODataIntegration . baseURL ) + "/northwind/vw/x?$filter=" ) + ( org . apache . olingo . commons . core . Encoder . encode ( "a<sp>eq<sp>@a" ) ) ) ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; }
org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) )
getPreparedOrderTest ( ) { final org . nohope . cassandra . mapservice . CMapSync map = mapService . getMap ( org . nohope . cassandra . mapservice . PreparedStatementsIT . RING_OF_POWER_TABLE ) ; final java . lang . String quote = org . nohope . cassandra . mapservice . QuoteTestGenerator . newQuote ( ) ; final org . nohope . cassandra . mapservice . ValueTuple valueToPut = org . nohope . cassandra . mapservice . ValueTuple . of ( org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_QUOTES , quote ) . with ( org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_TIMESTAMP , org . joda . time . DateTime . now ( DateTimeZone . UTC ) ) ; map . put ( new org . nohope . cassandra . mapservice . CPutQuery ( valueToPut ) ) ; final org . nohope . cassandra . mapservice . CQuery query = org . nohope . cassandra . mapservice . CQueryBuilder . createPreparedQuery ( ) . of ( org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_QUOTES , org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_TIMESTAMP ) . addFilters ( ) . eq ( org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_QUOTES ) . lte ( org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_TIMESTAMP ) . noMoreFilters ( ) . noFiltering ( ) ; final org . nohope . cassandra . mapservice . CPreparedGet preparedQuery = mapService . prepareGet ( org . nohope . cassandra . mapservice . PreparedStatementsIT . RING_OF_POWER_TABLE , query ) ; final org . nohope . cassandra . mapservice . ValueTuple value = preparedQuery . bind ( ) . bindTo ( org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_TIMESTAMP , org . joda . time . DateTime . now ( DateTimeZone . UTC ) ) . bindTo ( org . nohope . cassandra . mapservice . PreparedStatementsIT . COL_QUOTES , quote ) . stopBinding ( ) . one ( ) ; "<AssertPlaceHolder>" ; } one ( ) { final com . datastax . driver . core . ResultSet result = factory . getSession ( ) . execute ( bound ) ; final com . datastax . driver . core . Row row = result . one ( ) ; if ( row == null ) { throw new org . nohope . cassandra . util . RowNotFoundException ( cQuery . getExpectedColumnsCollection ( ) . toString ( ) ) ; } return converter . apply ( row ) ; }
org . junit . Assert . assertEquals ( valueToPut , value )
shouldUseProvidedSalt ( ) { edu . stanford . bmir . protege . web . shared . auth . ChapSession session = factory . create ( salt ) ; "<AssertPlaceHolder>" ; } getSalt ( ) { return salt ; }
org . junit . Assert . assertThat ( session . getSalt ( ) , org . hamcrest . core . Is . is ( salt ) )
testGetServletContextName ( ) { expect ( servletContext . getServletContextName ( ) ) . andReturn ( "value" ) ; replay ( servletContext , config ) ; org . apache . tiles . web . util . ServletContextAdapter adapter = new org . apache . tiles . web . util . ServletContextAdapter ( config ) ; "<AssertPlaceHolder>" ; } getServletContextName ( ) { return rootContext . getServletContextName ( ) ; }
org . junit . Assert . assertEquals ( "value" , adapter . getServletContextName ( ) )
testKeyGeneratorAndRawKey ( ) { this . interceptor . setKeyGenerator ( new org . springframework . retry . interceptor . MethodArgumentsKeyGenerator ( ) { @ org . springframework . retry . interceptor . Override public java . lang . Object getKey ( java . lang . Object [ ] item ) { return "bar" ; } } ) ; this . interceptor . setLabel ( "foo" ) ; this . interceptor . setUseRawKey ( true ) ; org . springframework . retry . RetryOperations template = mock ( org . springframework . retry . RetryOperations . class ) ; this . interceptor . setRetryOperations ( template ) ; org . aopalliance . intercept . MethodInvocation invocation = mock ( org . aopalliance . intercept . MethodInvocation . class ) ; when ( invocation . getArguments ( ) ) . thenReturn ( new java . lang . Object [ ] { new java . lang . Object ( ) } ) ; this . interceptor . invoke ( invocation ) ; org . mockito . ArgumentCaptor < org . springframework . retry . support . DefaultRetryState > captor = org . mockito . ArgumentCaptor . forClass ( org . springframework . retry . support . DefaultRetryState . class ) ; verify ( template ) . execute ( any ( org . springframework . retry . RetryCallback . class ) , any ( org . springframework . retry . RecoveryCallback . class ) , captor . capture ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { long time = java . lang . System . currentTimeMillis ( ) ; return ( value ) * ( java . lang . Math . exp ( ( ( - ( alpha ) ) * ( time - ( lastTime ) ) ) ) ) ; }
org . junit . Assert . assertEquals ( "bar" , captor . getValue ( ) . getKey ( ) )
deletePropertyDescriptorByOwnerIncludingPropertyValuesWhenDeletingOwnerIsOwnerOfDescriptorDefinedOnResourceTypeWithPropertiesOnResourceRelationShouldSucceed ( ) { ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner deletingOwner = ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner . AMW ; ch . puzzle . itc . mobiliar . business . environment . entity . AbstractContext abstractContextMock = mock ( ch . puzzle . itc . mobiliar . business . environment . entity . AbstractContext . class ) ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity resourceTypeEntityMock = mock ( ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity . class ) ; ch . puzzle . itc . mobiliar . business . property . entity . PropertyEntity property = new ch . puzzle . itc . mobiliar . business . property . entity . PropertyEntity ( ) ; ch . puzzle . itc . mobiliar . business . property . control . Set < ch . puzzle . itc . mobiliar . business . property . entity . PropertyEntity > properties = new ch . puzzle . itc . mobiliar . business . property . control . HashSet ( ) ; properties . add ( property ) ; ch . puzzle . itc . mobiliar . business . property . entity . PropertyDescriptorEntity descriptor = new ch . puzzle . itc . mobiliar . builders . PropertyDescriptorEntityBuilder ( ) . withOwner ( deletingOwner ) . withId ( 1 ) . withProperties ( properties ) . build ( ) ; "<AssertPlaceHolder>" ; ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ResourceRelationTypeEntity resourceRelationTypeEntityMock = mock ( ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ResourceRelationTypeEntity . class ) ; ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ConsumedResourceRelationEntity consumedResourceRelationEntityMock = mock ( ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ConsumedResourceRelationEntity . class ) ; ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ResourceRelationContextEntity resourceRelationContextEntityMock = mock ( ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ResourceRelationContextEntity . class ) ; javax . persistence . TypedQuery < ch . puzzle . itc . mobiliar . business . property . entity . PropertyDescriptorEntity > queryMock = mock ( javax . persistence . TypedQuery . class ) ; when ( entityManagerMock . createQuery ( "from<sp>PropertyDescriptorEntity<sp>d<sp>left<sp>join<sp>fetch<sp>d.propertyTags<sp>where<sp>d.id<sp>=<sp>:propertyDescriptorId<sp>" , ch . puzzle . itc . mobiliar . business . property . entity . PropertyDescriptorEntity . class ) ) . thenReturn ( queryMock ) ; when ( queryMock . getSingleResult ( ) ) . thenReturn ( descriptor ) ; when ( resourceTypeEntityMock . getResourceRelationTypesB ( ) ) . thenReturn ( ch . puzzle . itc . mobiliar . business . property . control . Collections . singleton ( resourceRelationTypeEntityMock ) ) ; when ( resourceRelationTypeEntityMock . getConsumedResourceRelations ( ) ) . thenReturn ( ch . puzzle . itc . mobiliar . business . property . control . Collections . singleton ( consumedResourceRelationEntityMock ) ) ; when ( consumedResourceRelationEntityMock . getContexts ( ) ) . thenReturn ( ch . puzzle . itc . mobiliar . business . property . control . Collections . singleton ( resourceRelationContextEntityMock ) ) ; when ( resourceRelationContextEntityMock . getProperties ( ) ) . thenReturn ( properties ) ; service . deletePropertyDescriptorByOwnerIncludingPropertyValues ( descriptor , abstractContextMock , resourceTypeEntityMock ) ; verify ( resourceRelationContextEntityMock ) . removeProperty ( property ) ; verify ( entityManagerMock ) . remove ( descriptor ) ; } getOwner ( ) { return owner ; }
org . junit . Assert . assertEquals ( deletingOwner , descriptor . getOwner ( ) )
computeFactor_TwoMonthsOfLeapYear ( ) { long startTimeUsage = org . oscm . test . DateTimeHandling . calculateMillis ( "2012-02-01<sp>00:00:00" ) ; long endTimeUsage = org . oscm . test . DateTimeHandling . calculateMillis ( "2012-03-01<sp>23:59:59" ) ; org . oscm . billingservice . service . model . BillingInput billingInput = org . oscm . billingservice . business . calculation . revenue . BillingInputFactory . newBillingInput ( "2012-02-01<sp>00:00:00" , "2012-03-02<sp>00:00:00" ) ; double factor = calculator . computeFactor ( PricingPeriod . MONTH , billingInput , startTimeUsage , endTimeUsage , true , true ) ; "<AssertPlaceHolder>" ; } computeFactor ( org . oscm . internal . types . enumtypes . PricingPeriod , org . oscm . billingservice . service . model . BillingInput , long , long , boolean , boolean ) { if ( usagePeriodEnd < usagePeriodStart ) { throw new org . oscm . internal . types . exception . IllegalArgumentException ( ( ( ( ( "Usage<sp>period<sp>end<sp>(" + ( new java . util . Date ( usagePeriodEnd ) ) ) + ")<sp>before<sp>usage<sp>period<sp>start<sp>(" ) + ( new java . util . Date ( usagePeriodStart ) ) ) + ")" ) ) ; } java . util . Calendar adjustedBillingPeriodStart = org . oscm . billingservice . business . calculation . revenue . PricingPeriodDateConverter . getStartTime ( billingInput . getCutOffDate ( ) , pricingPeriod ) ; java . util . Calendar adjustedBillingPeriodEnd = org . oscm . billingservice . business . calculation . revenue . PricingPeriodDateConverter . getStartTime ( billingInput . getBillingPeriodEnd ( ) , pricingPeriod ) ; if ( usagePeriodOutsideOfAdjustedBillingPeriod ( usagePeriodStart , usagePeriodEnd , adjustedBillingPeriodStart . getTimeInMillis ( ) , adjustedBillingPeriodEnd . getTimeInMillis ( ) ) ) { return 0.0 ; } else { java . util . Calendar startTimeForFactorCalculation = determineStartTimeForFactorCalculation ( pricingPeriod , adjustedBillingPeriodStart , usagePeriodStart , adjustsPeriodStart ) ; java . util . Calendar endTimeForFactorCalculation = determineEndTimeForFactorCalculation ( pricingPeriod , adjustedBillingPeriodEnd , usagePeriodEnd , adjustsPeriodEnd ) ; return computeFractionalFactor ( startTimeForFactorCalculation . getTimeInMillis ( ) , endTimeForFactorCalculation . getTimeInMillis ( ) , pricingPeriod ) ; } }
org . junit . Assert . assertEquals ( 1 , factor , 0 )
shouldReturnTrueGivenDocumentWithIdExists ( ) { java . lang . Integer documentId = org . apache . commons . lang . math . RandomUtils . nextInt ( ) ; org . springframework . data . elasticsearch . IntegerIDEntity sampleEntity = new org . springframework . data . elasticsearch . IntegerIDEntity ( ) ; sampleEntity . setId ( documentId ) ; sampleEntity . setMessage ( "hello<sp>world." ) ; sampleEntity . setVersion ( java . lang . System . currentTimeMillis ( ) ) ; repository . save ( sampleEntity ) ; boolean exist = repository . exists ( documentId ) ; "<AssertPlaceHolder>" ; } exists ( ID extends java . io . Serializable ) { return ( findOne ( id ) ) != null ; }
org . junit . Assert . assertEquals ( exist , true )
testCryptoAuth ( ) { byte [ ] challenge = new byte [ ] { - 69 , 107 , - 66 , 1 , 28 , - 57 , 84 , - 68 , - 26 , 25 , - 51 , 76 , - 62 , 107 , 117 , - 114 , - 60 , 15 , - 112 , 39 , - 97 , 2 , 54 , 111 , 15 , - 64 , 67 , - 41 , - 43 , 44 , - 44 , 107 } ; byte [ ] data = new byte [ 257 ] ; eu . abc4trust . smartcard . RSASignature sig = eu . abc4trust . smartcard . SmartcardCrypto . generateSignature ( data , challenge , eu . abc4trust . abce . smartcard . HardwareSmartcardTest . rootKey , eu . abc4trust . abce . smartcard . HardwareSmartcardTest . rand ) ; eu . abc4trust . smartcard . RSAVerificationKey verKey = new eu . abc4trust . smartcard . RSAVerificationKey ( ) ; verKey . n = eu . abc4trust . abce . smartcard . HardwareSmartcardTest . rootKey . getN ( ) ; byte [ ] extracted = eu . abc4trust . smartcard . SmartcardCrypto . extraction ( verKey , sig , challenge ) ; "<AssertPlaceHolder>" ; } extraction ( eu . abc4trust . smartcard . RSAVerificationKey , eu . abc4trust . smartcard . RSASignature , byte [ ] ) { java . security . MessageDigest sha256 ; try { sha256 = java . security . MessageDigest . getInstance ( "SHA-256" ) ; } catch ( java . security . NoSuchAlgorithmException e ) { sha256 = null ; e . printStackTrace ( ) ; } int l ; byte [ ] nBytes = eu . abc4trust . smartcard . SmartcardCrypto . removeSignBit ( vk . n . toByteArray ( ) ) ; l = nBytes . length ; int S ; byte [ ] sigBytes = sig . sig ; S = sigBytes . length ; if ( S == l ) { java . math . BigInteger signature = new java . math . BigInteger ( 1 , sig . sig ) ; java . math . BigInteger data = signature . modPow ( java . math . BigInteger . valueOf ( 3 ) , vk . n ) ; byte [ ] data_bytes = data . toByteArray ( ) ; byte [ ] plainBytesWithZeros = new byte [ l ] ; java . lang . System . arraycopy ( data_bytes , 0 , plainBytesWithZeros , ( ( plainBytesWithZeros . length ) - ( data_bytes . length ) ) , data_bytes . length ) ; byte [ ] h = new byte [ 32 ] ; byte [ ] pad = new byte [ l - 32 ] ; java . lang . System . arraycopy ( plainBytesWithZeros , 0 , pad , 0 , ( l - 32 ) ) ; java . lang . System . arraycopy ( plainBytesWithZeros , pad . length , h , 0 , 32 ) ; sha256 . update ( challenge ) ; byte [ ] h_prime = sha256 . digest ( pad ) ; if ( ! ( java . util . Arrays . equals ( h , h_prime ) ) ) { throw new java . lang . RuntimeException ( "h's<sp>failed<sp>to<sp>be<sp>equal" ) ; } if ( ( pad [ 0 ] ) != 0 ) { throw new java . lang . RuntimeException ( "pad[0]<sp>!=<sp>0" ) ; } byte [ ] L_bytes = new byte [ 2 ] ; java . lang . System . arraycopy ( pad , 1 , L_bytes , 0 , 2 ) ; int L = java . nio . ByteBuffer . wrap ( L_bytes ) . getShort ( ) ; if ( L > ( l - 35 ) ) { throw new java . lang . RuntimeException ( ( "L<sp>larger<sp>than<sp>l-35:<sp>" + L ) ) ; } byte [ ] output = new byte [ L ] ; java . lang . System . arraycopy ( pad , 3 , output , 0 , L ) ; return output ; } else if ( S > l ) { byte [ ] sigma = new byte [ l ] ; byte [ ] m2 = new byte [ S - l ] ; byte [ ] sig_bytes = sig . sig ; java . lang . System . arraycopy ( sig_bytes , 0 , sigma , 0 , l ) ; java . lang . System . arraycopy ( sig_bytes , l , m2 , 0 , m2 . length ) ; java . math . BigInteger signature = new java . math . BigInteger ( 1 , sigma ) ; java . math . BigInteger data = signature . modPow ( java . math . BigInteger . valueOf ( 3 ) , vk . n ) ; byte [ ] data_bytes = data . toByteArray ( ) ; byte [ ] plainBytesWithZeros = new byte [ l ] ; java . lang . System . arraycopy ( data_bytes , 0 , plainBytesWithZeros , ( ( plainBytesWithZeros . length ) - ( data_bytes . length ) ) , data_bytes . length ) ; byte [ ] h = new byte [ 32 ] ; byte [ ] pad = new byte [ l - 32 ] ; java . lang . System . arraycopy ( plainBytesWithZeros , 0 , pad , 0 , ( l - 32 ) ) ; java . lang . System . arraycopy ( plainBytesWithZeros , pad . length , h , 0 , 32 ) ; sha256 . update ( challenge ) ; sha256 . update ( pad ) ; byte [ ] h_prime = sha256 . digest ( m2 ) ; if ( ! ( java . util . Arrays . equals ( h , h_prime ) ) ) { throw new java . lang . RuntimeException (
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( data , extracted ) )
testValidationForDefaultValue ( ) { java . util . List < com . streamsets . pipeline . lib . jdbc . JdbcFieldColumnMapping > columnMappings = com . google . common . collect . ImmutableList . of ( new com . streamsets . pipeline . lib . jdbc . JdbcFieldColumnMapping ( "P_ID" , "[2]" , "100" , com . streamsets . pipeline . lib . jdbc . DataType . USE_COLUMN_TYPE ) ) ; com . streamsets . pipeline . stage . processor . jdbclookup . JdbcLookupDProcessor processor = createProcessor ( ) ; com . streamsets . pipeline . sdk . ProcessorRunner processorRunner = new com . streamsets . pipeline . sdk . ProcessorRunner . Builder ( com . streamsets . pipeline . stage . processor . jdbclookup . JdbcLookupDProcessor . class , processor ) . addConfiguration ( "query" , listQuery ) . addConfiguration ( "columnMappings" , columnMappings ) . addConfiguration ( "multipleValuesBehavior" , MultipleValuesBehavior . FIRST_ONLY ) . addConfiguration ( "missingValuesBehavior" , MissingValuesBehavior . SEND_TO_ERROR ) . addConfiguration ( "maxClobSize" , 1000 ) . addConfiguration ( "maxBlobSize" , 1000 ) . addOutputLane ( "lane" ) . build ( ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = processorRunner . runValidateConfigs ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return delegate . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , issues . size ( ) )
testGetPrefix ( ) { final org . apache . commons . configuration2 . Configuration conf = new org . apache . commons . configuration2 . BaseConfiguration ( ) ; final org . apache . commons . configuration2 . SubsetConfiguration subset = new org . apache . commons . configuration2 . SubsetConfiguration ( conf , "prefix" , "." ) ; "<AssertPlaceHolder>" ; } getPrefix ( ) { return prefix ; }
org . junit . Assert . assertEquals ( "prefix" , "prefix" , subset . getPrefix ( ) )
test_classify_nullClassifier3 ( ) { org . springframework . retry . RetryContext context = org . mockito . Mockito . mock ( org . springframework . retry . RetryContext . class ) ; org . fishwife . jrugged . spring . retry . ClassifierSimpleRetryPolicy policy = new org . fishwife . jrugged . spring . retry . ClassifierSimpleRetryPolicy ( 4 ) ; org . mockito . Mockito . when ( context . getLastThrowable ( ) ) . thenReturn ( new java . lang . RuntimeException ( ) ) ; "<AssertPlaceHolder>" ; } canRetry ( org . springframework . retry . RetryContext ) { java . lang . Throwable t = context . getLastThrowable ( ) ; return ( ( t == null ) || ( classify ( t ) ) ) && ( ( context . getRetryCount ( ) ) < ( getMaxAttempts ( ) ) ) ; }
org . junit . Assert . assertFalse ( policy . canRetry ( context ) )
checkRelativeImageUrlInContextRelativeCssResource ( ) { final java . lang . String actual = victim . rewrite ( ro . isdc . wro . model . resource . processor . support . TestImageUrlRewriter . DEFAULT_CSS_URI , ro . isdc . wro . model . resource . processor . support . TestImageUrlRewriter . RELATIVE_IMAGE_URL ) ; final java . lang . String expected = "/path/to/" + ( ro . isdc . wro . model . resource . processor . support . TestImageUrlRewriter . RELATIVE_IMAGE_URL ) ; "<AssertPlaceHolder>" ; } rewrite ( java . lang . String , java . lang . String ) { org . apache . commons . lang3 . Validate . notNull ( cssUri ) ; org . apache . commons . lang3 . Validate . notNull ( imageUrl ) ; if ( org . apache . commons . lang3 . StringUtils . isEmpty ( imageUrl ) ) { return imageUrl ; } if ( ro . isdc . wro . model . resource . locator . ServletContextUriLocator . isValid ( cssUri ) ) { if ( ro . isdc . wro . model . resource . locator . ServletContextUriLocator . isValid ( imageUrl ) ) { return prependContextPath ( imageUrl ) ; } if ( ro . isdc . wro . model . resource . locator . ServletContextUriLocator . isProtectedResource ( cssUri ) ) { return ( context . proxyPrefix ) + ( computeNewImageLocation ( cssUri , imageUrl ) ) ; } final java . lang . String aggregatedPathPrefix = computeAggregationPathPrefix ( context . aggregatedFolderPath ) ; ro . isdc . wro . model . resource . processor . support . ImageUrlRewriter . LOG . debug ( "computed<sp>aggregatedPathPrefix<sp>{}" , aggregatedPathPrefix ) ; java . lang . String newImageLocation = computeNewImageLocation ( ( aggregatedPathPrefix + cssUri ) , imageUrl ) ; if ( newImageLocation . startsWith ( ServletContextUriLocator . PREFIX ) ) { newImageLocation = prependContextPath ( newImageLocation ) ; } ro . isdc . wro . model . resource . processor . support . ImageUrlRewriter . LOG . debug ( "newImageLocation:<sp>{}" , newImageLocation ) ; return newImageLocation ; } if ( ro . isdc . wro . model . resource . locator . ClasspathUriLocator . isValid ( cssUri ) ) { final java . lang . String proxyUrl = ( context . proxyPrefix ) + ( computeNewImageLocation ( cssUri , imageUrl ) ) ; final java . lang . String contextRelativeUrl = prependContextPath ( imageUrl ) ; return ro . isdc . wro . model . resource . locator . ServletContextUriLocator . isValid ( imageUrl ) ? contextRelativeUrl : proxyUrl ; } if ( ro . isdc . wro . model . resource . locator . UrlUriLocator . isValid ( cssUri ) ) { final java . lang . String computedCssUri = ( ro . isdc . wro . model . resource . locator . ServletContextUriLocator . isValid ( imageUrl ) ) ? computeCssUriForExternalServer ( cssUri ) : cssUri ; return computeNewImageLocation ( computedCssUri , imageUrl ) ; } throw new ro . isdc . wro . WroRuntimeException ( ( ( ( "Could<sp>not<sp>replace<sp>imageUrl:<sp>" + imageUrl ) + ",<sp>contained<sp>at<sp>location:<sp>" ) + cssUri ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetTrustBundlesByDomain_noEntityManager_assertException ( ) { final org . nhindirect . config . store . dao . impl . TrustBundleDaoImpl dao = new org . nhindirect . config . store . dao . impl . TrustBundleDaoImpl ( ) ; boolean exceptionOccured = false ; try { dao . getTrustBundlesByDomain ( 1234 ) ; } catch ( java . lang . IllegalStateException ex ) { exceptionOccured = true ; } "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( exceptionOccured )
testFloatObjNull ( ) { java . lang . Class < com . j256 . ormlite . field . types . FloatObjectTypeTest . LocalFloatObj > clazz = com . j256 . ormlite . field . types . FloatObjectTypeTest . LocalFloatObj . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . FloatObjectTypeTest . LocalFloatObj , java . lang . Object > dao = createDao ( clazz , true ) ; com . j256 . ormlite . field . types . FloatObjectTypeTest . LocalFloatObj foo = new com . j256 . ormlite . field . types . FloatObjectTypeTest . LocalFloatObj ( ) ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , null , null , null , null , DataType . FLOAT_OBJ , com . j256 . ormlite . field . types . FloatObjectTypeTest . FLOAT_COLUMN , false , true , false , false , false , false , true , false ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
org . junit . Assert . assertEquals ( 1 , dao . create ( foo ) )
testRoundTripSorted ( ) { java . util . List < java . lang . String [ ] > input = createTable ( ) ; java . lang . String sql = "select<sp>*<sp>from<sp>" + ( tableId ) ; org . sagebionetworks . repo . model . table . RowSet result = waitForConsistentQuery ( adminUserInfo , sql ) ; "<AssertPlaceHolder>" ; org . sagebionetworks . repo . model . table . DownloadFromTableRequest request = new org . sagebionetworks . repo . model . table . DownloadFromTableRequest ( ) ; request . setSql ( sql ) ; request . setWriteHeader ( true ) ; request . setIncludeRowIdAndRowVersion ( true ) ; org . sagebionetworks . repo . model . table . SortItem sortItem = new org . sagebionetworks . repo . model . table . SortItem ( ) ; sortItem . setColumn ( "c" ) ; sortItem . setDirection ( SortDirection . DESC ) ; request . setSort ( com . google . common . collect . Lists . newArrayList ( sortItem ) ) ; java . util . List < java . lang . String [ ] > results = downloadCSV ( request ) ; input = com . google . common . collect . Lists . newArrayList ( input . get ( 0 ) , input . get ( 4 ) , input . get ( 2 ) , input . get ( 1 ) , input . get ( 3 ) ) ; checkResults ( results , input , true ) ; } waitForConsistentQuery ( org . sagebionetworks . repo . model . UserInfo , java . lang . String ) { org . sagebionetworks . repo . model . table . Query query = new org . sagebionetworks . repo . model . table . Query ( ) ; query . setSql ( sql ) ; return waitForConsistentQuery ( user , query ) ; }
org . junit . Assert . assertNotNull ( result )
testEstimate ( ) { org . qcri . rheem . core . optimizer . OptimizationContext optimizationContext = mock ( org . qcri . rheem . core . optimizer . OptimizationContext . class ) ; when ( optimizationContext . getConfiguration ( ) ) . thenReturn ( new org . qcri . rheem . core . api . Configuration ( ) ) ; org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimator partialEstimator1 = new org . qcri . rheem . core . optimizer . cardinality . DefaultCardinalityEstimator ( 0.9 , 1 , false , ( cards ) -> ( cards [ 0 ] ) * 2 ) ; org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimator partialEstimator2 = new org . qcri . rheem . core . optimizer . cardinality . DefaultCardinalityEstimator ( 0.8 , 1 , false , ( cards ) -> ( cards [ 0 ] ) * 3 ) ; org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimator estimator = new org . qcri . rheem . core . optimizer . cardinality . AggregatingCardinalityEstimator ( java . util . Arrays . asList ( partialEstimator1 , partialEstimator2 ) ) ; org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate inputEstimate = new org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate ( 10 , 100 , 0.3 ) ; org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate outputEstimate = estimator . estimate ( optimizationContext , inputEstimate ) ; org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate expectedEstimate = new org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate ( ( 2 * 10 ) , ( 2 * 100 ) , ( 0.3 * 0.9 ) ) ; "<AssertPlaceHolder>" ; } estimate ( org . qcri . rheem . core . optimizer . OptimizationContext , org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate [ ] ) { final de . hpi . isg . profiledb . store . model . TimeMeasurement timeMeasurement = optimizationContext . getJob ( ) . getStopWatch ( ) . start ( "Optimization" , "Cardinality&Load<sp>Estimation" , "Push<sp>Estimation" , "Estimate<sp>source<sp>cardinalities" ) ; try ( java . sql . Connection connection = this . getPlatform ( ) . createDatabaseDescriptor ( optimizationContext . getConfiguration ( ) ) . createJdbcConnection ( ) ) { final java . lang . String sql = java . lang . String . format ( "SELECT<sp>count(*)<sp>FROM<sp>%s;" , this . getTableName ( ) ) ; final java . sql . ResultSet resultSet = connection . createStatement ( ) . executeQuery ( sql ) ; if ( ! ( resultSet . next ( ) ) ) { throw new java . sql . SQLException ( ( ( "No<sp>query<sp>result<sp>for<sp>\"" + sql ) + "\"." ) ) ; } long cardinality = resultSet . getLong ( 1 ) ; return new org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate ( cardinality , cardinality , 1.0 ) ; } catch ( java . lang . Exception e ) { org . slf4j . LoggerFactory . getLogger ( this . getClass ( ) ) . error ( "Could<sp>not<sp>estimate<sp>cardinality<sp>for<sp>{}." , this , e ) ; return new org . qcri . rheem . core . optimizer . cardinality . CardinalityEstimate ( 10 , 10000000 , 0.9 ) ; } finally { timeMeasurement . stop ( ) ; } }
org . junit . Assert . assertEquals ( expectedEstimate , outputEstimate )
testRestartProperties ( ) { com . dremio . provision . Cluster storedCluster = clusterCreateHelper ( ) ; com . dremio . provision . ClusterModifyRequest request = new com . dremio . provision . ClusterModifyRequest ( ) ; request . setId ( storedCluster . getId ( ) . getId ( ) ) ; request . setTag ( "12" ) ; storedCluster . setState ( ClusterState . RUNNING ) ; request . setDynamicConfig ( new com . dremio . provision . DynamicConfig ( 2 ) ) ; request . setVirtualCoreCount ( 2 ) ; request . setDesiredState ( ClusterDesiredState . RUNNING ) ; request . setSubPropertyList ( new java . util . ArrayList < com . dremio . provision . Property > ( ) ) ; com . dremio . provision . ClusterConfig config = com . dremio . provision . service . TestAPI . resource . toClusterConfig ( request ) ; final com . dremio . provision . Cluster modifiedCluster5 = com . dremio . provision . service . TestAPI . service . toCluster ( config , ClusterState . RUNNING , storedCluster ) ; com . dremio . provision . service . ProvisioningServiceImpl . Action action = com . dremio . provision . service . TestAPI . service . toAction ( storedCluster , modifiedCluster5 ) ; "<AssertPlaceHolder>" ; } toAction ( com . dremio . provision . Cluster , com . dremio . provision . Cluster ) { com . google . common . base . Preconditions . checkNotNull ( modifiedCluster . getClusterConfig ( ) . getTag ( ) , "Version<sp>in<sp>modified<sp>cluster<sp>has<sp>to<sp>be<sp>set" ) ; final java . lang . String storedVersion = storedCluster . getClusterConfig ( ) . getTag ( ) ; final java . lang . String incomingVersion = modifiedCluster . getClusterConfig ( ) . getTag ( ) ; if ( ! ( incomingVersion . equals ( storedVersion ) ) ) { throw new java . util . ConcurrentModificationException ( java . lang . String . format ( ( "Version<sp>of<sp>submitted<sp>Cluster<sp>does<sp>not<sp>match<sp>stored.<sp>" + "Stored<sp>Version:<sp>%s<sp>.<sp>Provided<sp>Version:<sp>%s<sp>.<sp>Please<sp>refetch" ) , storedVersion , incomingVersion ) ) ; } if ( ( com . dremio . provision . ClusterState . DELETED ) == ( storedCluster . getDesiredState ( ) ) ) { throw new java . lang . IllegalStateException ( "Cluster<sp>in<sp>the<sp>process<sp>of<sp>deletion.<sp>No<sp>modification<sp>is<sp>allowed" ) ; } if ( ( ( com . dremio . provision . ClusterState . STOPPING ) == ( storedCluster . getState ( ) ) ) || ( ( com . dremio . provision . ClusterState . STARTING ) == ( storedCluster . getState ( ) ) ) ) { throw new java . lang . IllegalStateException ( ( "Cluster<sp>in<sp>the<sp>process<sp>of<sp>stopping/restarting.<sp>No<sp>modification<sp>is<sp>" + "allowed" ) ) ; } if ( com . google . common . base . Objects . equal ( storedCluster , modifiedCluster ) ) { return com . dremio . provision . service . ProvisioningServiceImpl . Action . NONE ; } if ( com . google . common . base . Objects . equal ( storedCluster . getClusterConfig ( ) , modifiedCluster . getClusterConfig ( ) ) ) { if ( ( storedCluster . getState ( ) ) != ( modifiedCluster . getState ( ) ) ) { switch ( modifiedCluster . getState ( ) ) { case RUNNING : return com . dremio . provision . service . ProvisioningServiceImpl . Action . START ; case STOPPED : return com . dremio . provision . service . ProvisioningServiceImpl . Action . STOP ; case DELETED : return com . dremio . provision . service . ProvisioningServiceImpl . Action . DELETE ; default : com . dremio . provision . service . ProvisioningServiceImpl . logger . warn ( "Request<sp>to<sp>change<sp>to<sp>non-actionable<sp>state<sp>{}" , storedCluster . getState ( ) ) ; return com . dremio . provision . service . ProvisioningServiceImpl . Action . NONE ; } } else { return com . dremio . provision . service . ProvisioningServiceImpl . Action . NONE ; } } if ( ! ( com . dremio . provision . service . ProvisioningServiceImpl . equals ( storedCluster . getClusterConfig ( ) . getSubPropertyList ( ) , modifiedCluster . getClusterConfig ( ) . getSubPropertyList ( ) ) ) ) { return com . dremio . provision . service . ProvisioningServiceImpl . Action . RESTART ; } com . dremio . provision . ClusterSpec storedClusterSpec = storedCluster . getClusterConfig ( ) . getClusterSpec ( ) ; com . dremio . provision . ClusterSpec tempClusterSpec = new com . dremio . provision . ClusterSpec ( ) ; tempClusterSpec . setQueue ( storedClusterSpec . getQueue ( ) ) ; tempClusterSpec . setMemoryMBOffHeap ( storedClusterSpec . getMemoryMBOffHeap ( ) ) ; tempClusterSpec . setMemoryMBOnHeap ( storedClusterSpec . getMemoryMBOnHeap ( ) ) ; tempClusterSpec . setVirtualCoreCount ( storedClusterSpec . getVirtualCoreCount ( ) ) ; tempClusterSpec . setContainerCount ( modifiedCluster . getClusterConfig ( ) . getClusterSpec ( ) . getContainerCount ( ) ) ; if ( ( ( ( tempClusterSpec . getContainerCount ( ) ) != ( storedClusterSpec . getContainerCount ( ) ) ) && ( com . google . common . base . Objects . equal ( modifiedCluster . getClusterConfig ( ) . getClusterSpec ( ) , tempClusterSpec ) ) ) && ( ( ( com . dremio . provision . ClusterState . RUNNING ) == ( storedCluster . getState ( ) ) ) && ( ( com . dremio . provision . ClusterState . RUNNING ) == ( modifiedCluster . getState ( ) ) ) ) ) { return com . dremio . provision . service . ProvisioningServiceImpl . Action . RESIZE ; } return com . dremio . provision . service . ProvisioningServiceImpl . Action . RESTART ; }
org . junit . Assert . assertEquals ( ProvisioningServiceImpl . Action . RESTART , action )
testAppendArgOrValueInteger ( ) { int value = 23213 ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; cmpInt . appendArgOrValue ( null , numberFieldType , sb , new java . util . ArrayList < com . j256 . ormlite . stmt . ArgumentHolder > ( ) , value ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( getClass ( ) . getSimpleName ( ) ) + ":name=" ) + ( field . getName ( ) ) ) + ",class=" ) + ( field . getDeclaringClass ( ) . getSimpleName ( ) ) ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Integer . toString ( value ) ) + "<sp>" ) , sb . toString ( ) )
testIgnoredCommentsAndWhitespace ( ) { org . apache . shindig . gadgets . GadgetBlacklist bl = createBlacklist ( ( ( "#<sp>comment\n<sp>\t" + ( someUri ) ) + "<sp>\n<sp>#<sp>comment\n\n" ) ) ; "<AssertPlaceHolder>" ; } isBlacklisted ( org . apache . shindig . common . uri . Uri ) { java . lang . String uriString = gadgetUri . toString ( ) . toLowerCase ( ) ; if ( exactMatches . contains ( uriString ) ) { return true ; } for ( java . util . regex . Pattern pattern : regexpMatches ) { if ( pattern . matcher ( uriString ) . matches ( ) ) { return true ; } } return false ; }
org . junit . Assert . assertTrue ( bl . isBlacklisted ( someUri ) )
getProtocolHandlerTest ( ) { com . github . knightliao . hermesjsonrpc . server . handler . HandlerFactory handlerFactory = new com . github . knightliao . hermesjsonrpc . server . handler . HandlerFactory ( ) ; com . github . knightliao . hermesjsonrpc . server . handler . RpcHandler rpcHandler = handlerFactory . getProtocolHandler ( ProtocolEnum . GSON . getModelName ( ) ) ; "<AssertPlaceHolder>" ; } getModelName ( ) { return modelName ; }
org . junit . Assert . assertTrue ( ( rpcHandler instanceof com . github . knightliao . hermesjsonrpc . server . handler . RpcHandler ) )
testGetOp ( ) { java . util . concurrent . Future < java . lang . String > future = contentLengthFuture ( org . apache . hadoop . hdfs . web . TestWebHdfsContentLength . errResponse ) ; try { org . apache . hadoop . hdfs . web . TestWebHdfsContentLength . fs . getFileStatus ( org . apache . hadoop . hdfs . web . TestWebHdfsContentLength . p ) ; org . junit . Assert . fail ( ) ; } catch ( java . io . IOException ioe ) { } "<AssertPlaceHolder>" ; } getContentLength ( java . util . concurrent . Future ) { java . lang . String request = null ; try { request = future . get ( 2 , TimeUnit . SECONDS ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( e . toString ( ) ) ; } java . util . regex . Matcher matcher = org . apache . hadoop . hdfs . web . TestWebHdfsContentLength . contentLengthPattern . matcher ( request ) ; return matcher . find ( ) ? matcher . group ( 2 ) : null ; }
org . junit . Assert . assertEquals ( null , getContentLength ( future ) )
testGetSiteNavigationMenus ( ) { com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group . getGroupId ( ) , com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) ) ; java . util . List < com . liferay . site . navigation . model . SiteNavigationMenu > siteNavigationMenusOriginal = com . liferay . site . navigation . service . SiteNavigationMenuLocalServiceUtil . getSiteNavigationMenus ( _group . getGroupId ( ) ) ; int siteNavigationMenusOriginalSize = siteNavigationMenusOriginal . size ( ) ; com . liferay . site . navigation . service . SiteNavigationMenuLocalServiceUtil . addSiteNavigationMenu ( com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) , _group . getGroupId ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , serviceContext ) ; com . liferay . site . navigation . service . SiteNavigationMenuLocalServiceUtil . addSiteNavigationMenu ( com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) , _group . getGroupId ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , serviceContext ) ; java . util . List < com . liferay . site . navigation . model . SiteNavigationMenu > siteNavigationMenusAfter = com . liferay . site . navigation . service . SiteNavigationMenuLocalServiceUtil . getSiteNavigationMenus ( _group . getGroupId ( ) ) ; int siteNavigationMenusAfterSize = siteNavigationMenusAfter . size ( ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( ( siteNavigationMenusOriginalSize + 2 ) , siteNavigationMenusAfterSize )
matrixPostTest ( ) { java . lang . String key = com . graphhopper . directions . api . client . api . MatrixApiTest . KEY ; com . graphhopper . directions . api . client . model . MatrixRequest body = new com . graphhopper . directions . api . client . model . MatrixRequest ( ) ; com . graphhopper . directions . api . client . api . List < com . graphhopper . directions . api . client . api . List < java . lang . Double > > pointList = new com . graphhopper . directions . api . client . api . ArrayList ( ) ; pointList . add ( com . graphhopper . directions . api . client . api . Arrays . asList ( new java . lang . Double [ ] { 11.588051 , 49.932707 } ) ) ; pointList . add ( com . graphhopper . directions . api . client . api . Arrays . asList ( new java . lang . Double [ ] { 10.747375 , 50.241935 } ) ) ; pointList . add ( com . graphhopper . directions . api . client . api . Arrays . asList ( new java . lang . Double [ ] { 11.983337 , 50.118817 } ) ) ; body . setPoints ( pointList ) ; body . setOutArrays ( com . graphhopper . directions . api . client . api . Arrays . asList ( "weights" , "distances" , "times" ) ) ; com . graphhopper . directions . api . client . model . MatrixResponse response = api . matrixPost ( key , body ) ; "<AssertPlaceHolder>" ; } getDistances ( ) { return distances ; }
org . junit . Assert . assertEquals ( 3 , response . getDistances ( ) . size ( ) )
zipTypeTest ( ) { java . lang . String name = "Showcase" ; java . lang . String path = ( ( ( this . path ) + ( java . io . File . separator ) ) + name ) + ".csar" ; java . io . InputStream fis = new java . io . FileInputStream ( path ) ; org . eclipse . winery . repository . backend . IRepository repository = org . eclipse . winery . repository . backend . RepositoryFactory . getRepository ( org . eclipse . winery . yaml . common . Utils . getTmpDir ( java . nio . file . Paths . get ( "repository" ) ) ) ; org . eclipse . winery . repository . importing . CsarImporter csarImporter = new org . eclipse . winery . repository . importing . CsarImporter ( ) ; org . eclipse . winery . repository . importing . CsarImportOptions options = new org . eclipse . winery . repository . importing . CsarImportOptions ( ) ; options . setOverwrite ( true ) ; options . setAsyncWPDParsing ( true ) ; options . setValidate ( false ) ; csarImporter . readCSAR ( fis , options ) ; org . eclipse . winery . yaml . converter . Converter converter = new org . eclipse . winery . yaml . converter . Converter ( repository ) ; fis = new java . io . FileInputStream ( path ) ; java . io . InputStream zip = converter . convertX2Y ( fis ) ; java . io . File zipFile = new java . io . File ( ( ( ( ( outPath ) + ( java . io . File . separator ) ) + name ) + ".csar" ) ) ; if ( ! ( zipFile . getParentFile ( ) . exists ( ) ) ) { zipFile . getParentFile ( ) . mkdirs ( ) ; } java . nio . file . Files . copy ( zip , zipFile . toPath ( ) , StandardCopyOption . REPLACE_EXISTING ) ; org . eclipse . winery . yaml . common . Utils . deleteTmpDir ( java . nio . file . Paths . get ( "repository" ) ) ; "<AssertPlaceHolder>" ; } get ( int ) { return list . get ( i ) ; }
org . junit . Assert . assertTrue ( zipFile . exists ( ) )
testCheckConditionsEqualsIgnoreCase ( ) { java . lang . String expected = "abc" ; java . lang . String actual = "Abc" ; com . github . noraui . gherkin . GherkinConditionedLoopedStep gherkinConditionedLoopedStep = new com . github . noraui . gherkin . GherkinConditionedLoopedStep ( "1" , "I<sp>wait<sp>'4'<sp>seconds." , expected , actual ) ; "<AssertPlaceHolder>" ; } checkCondition ( ) { java . lang . String actu = ( ( com . github . noraui . utils . Context . getValue ( this . actual ) ) != null ) ? com . github . noraui . utils . Context . getValue ( this . actual ) : this . actual ; if ( actu == null ) { return false ; } return actu . matches ( ( "(?i)" + ( this . expected ) ) ) ; }
org . junit . Assert . assertTrue ( gherkinConditionedLoopedStep . checkCondition ( ) )
canOnlyGenerateNull ( ) { com . pholser . junit . quickcheck . generator . VoidGenerator generator = new com . pholser . junit . quickcheck . generator . VoidGenerator ( ) ; java . lang . Void value = generator . generate ( null , null ) ; "<AssertPlaceHolder>" ; } generate ( com . pholser . junit . quickcheck . random . SourceOfRandomness , com . pholser . junit . quickcheck . generator . GenerationStatus ) { return new java . math . BigDecimal ( random . nextDouble ( ) ) ; }
org . junit . Assert . assertNull ( value )
testAddConflict ( ) { com . vladsch . flexmark . util . collection . OrderedMultiMap < java . lang . String , java . lang . Integer > orderedMap = new com . vladsch . flexmark . util . collection . OrderedMultiMap < java . lang . String , java . lang . Integer > ( ) ; orderedMap . put ( "0" , 0 ) ; orderedMap . put ( "1" , 1 ) ; thrown . expect ( com . vladsch . flexmark . util . collection . IllegalStateException . class ) ; "<AssertPlaceHolder>" ; } putKeyValue ( K , V ) { return ! ( addKeyValue ( k , v ) ) ? v : null ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Integer ) ( 1 ) ) , orderedMap . putKeyValue ( "1" , 0 ) )
testContentTransformedFromHeader ( ) { com . google . common . collect . Multimap < java . lang . String , java . lang . String > map = com . google . common . collect . LinkedHashMultimap . create ( ) ; map . put ( "Content-Type" , "text/plain" ) ; when ( response . getHeaders ( ) ) . thenReturn ( map ) ; when ( response . createTransformer ( java . lang . String . class , "text/plain" ) ) . thenReturn ( transformer ) ; com . google . common . io . ByteSource bs = com . google . common . io . ByteSource . wrap ( "hello" . getBytes ( Charsets . UTF_8 ) ) ; when ( response . contentAsByteSource ( ) ) . thenReturn ( bs ) ; when ( transformer . unmarshall ( java . lang . String . class , bs ) ) . thenReturn ( "hello<sp>world" ) ; java . lang . String v = response . contentTransformed ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } unmarshall ( java . lang . Class , com . google . common . io . ByteSource ) { T object = null ; java . io . InputStream stream = null ; try { stream = content . openBufferedStream ( ) ; object = javax . xml . bind . JAXB . unmarshal ( stream , type ) ; } catch ( java . io . IOException ex ) { throw new sonia . scm . net . ahc . ContentTransformerException ( "could<sp>not<sp>unmarshall<sp>content" , ex ) ; } catch ( javax . xml . bind . DataBindingException ex ) { throw new sonia . scm . net . ahc . ContentTransformerException ( "could<sp>not<sp>unmarshall<sp>content" , ex ) ; } finally { sonia . scm . util . IOUtil . close ( stream ) ; } return object ; }
org . junit . Assert . assertEquals ( "hello<sp>world" , v )
shouldNotEqualNull ( ) { eu . printingin3d . javascad . vrl . Vertex v = new eu . printingin3d . javascad . vrl . Vertex ( eu . printingin3d . javascad . testutils . RandomUtils . getRandomCoords ( ) , java . awt . Color . BLACK ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } eu . printingin3d . javascad . vrl . Vertex other = ( ( eu . printingin3d . javascad . vrl . Vertex ) ( obj ) ) ; if ( ( color ) == null ) { if ( ( other . color ) != null ) { return false ; } } else if ( ! ( color . equals ( other . color ) ) ) { return false ; } return coords . equals ( other . coords ) ; }
org . junit . Assert . assertFalse ( v . equals ( null ) )
testDCEligible ( ) { java . lang . String localhostname = java . net . InetAddress . getLocalHost ( ) . getHostName ( ) ; java . lang . String scope = "dc:" + localhostname ; "<AssertPlaceHolder>" ; } isDCEligible ( java . lang . String ) { boolean eligible = false ; try { java . util . List < java . lang . String > datacenters = com . ebay . jetstream . config . mongo . MongoScopesUtil . parseServerInfo ( changedBeanScope ) ; java . lang . String localhostname = java . net . InetAddress . getLocalHost ( ) . getCanonicalHostName ( ) ; int index = localhostname . indexOf ( "." ) ; if ( index != ( - 1 ) ) { java . lang . String domainName = localhostname . substring ( ( index + 1 ) ) ; if ( domainName != null ) { for ( java . lang . String datacenter : datacenters ) { if ( domainName . contains ( datacenter ) ) { eligible = true ; break ; } } } } } catch ( java . lang . Exception e ) { com . ebay . jetstream . config . mongo . MongoScopesUtil . LOGGER . info ( "isDCEligible<sp>method<sp>ran<sp>into<sp>exception<sp>" , e ) ; } return eligible ; }
org . junit . Assert . assertFalse ( com . ebay . jetstream . config . mongo . MongoScopesUtil . isDCEligible ( scope ) )
testShouldNotConsumeAnythingIfNoOptionIsDefined ( ) { java . lang . String [ ] remaining = cli . parse ( "1" , "2" , "3" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "1" , "2" , "3" } , remaining )
testCreateValue_null ( ) { "<AssertPlaceHolder>" ; } createValue ( java . lang . Object ) { if ( value instanceof com . google . api . ads . admanager . axis . v201808 . Value ) { return ( ( com . google . api . ads . admanager . axis . v201808 . Value ) ( value ) ) ; } else if ( value == null ) { return new com . google . api . ads . admanager . axis . v201808 . TextValue ( ) ; } else { if ( value instanceof java . lang . Boolean ) { com . google . api . ads . admanager . axis . v201808 . BooleanValue booleanValue = new com . google . api . ads . admanager . axis . v201808 . BooleanValue ( ) ; booleanValue . setValue ( ( ( java . lang . Boolean ) ( value ) ) ) ; return booleanValue ; } else if ( ( ( value instanceof java . lang . Double ) || ( value instanceof java . lang . Long ) ) || ( value instanceof java . lang . Integer ) ) { com . google . api . ads . admanager . axis . v201808 . NumberValue numberValue = new com . google . api . ads . admanager . axis . v201808 . NumberValue ( ) ; numberValue . setValue ( value . toString ( ) ) ; return numberValue ; } else if ( value instanceof java . lang . String ) { com . google . api . ads . admanager . axis . v201808 . TextValue textValue = new com . google . api . ads . admanager . axis . v201808 . TextValue ( ) ; textValue . setValue ( ( ( java . lang . String ) ( value ) ) ) ; return textValue ; } else if ( value instanceof com . google . api . ads . admanager . axis . v201808 . DateTime ) { com . google . api . ads . admanager . axis . v201808 . DateTimeValue dateTimeValue = new com . google . api . ads . admanager . axis . v201808 . DateTimeValue ( ) ; dateTimeValue . setValue ( ( ( com . google . api . ads . admanager . axis . v201808 . DateTime ) ( value ) ) ) ; return dateTimeValue ; } else if ( value instanceof com . google . api . ads . admanager . axis . v201808 . Date ) { com . google . api . ads . admanager . axis . v201808 . DateValue dateValue = new com . google . api . ads . admanager . axis . v201808 . DateValue ( ) ; dateValue . setValue ( ( ( com . google . api . ads . admanager . axis . v201808 . Date ) ( value ) ) ) ; return dateValue ; } else if ( value instanceof com . google . api . ads . admanager . axis . v201808 . Targeting ) { com . google . api . ads . admanager . axis . v201808 . TargetingValue targetingValue = new com . google . api . ads . admanager . axis . v201808 . TargetingValue ( ) ; targetingValue . setValue ( ( ( com . google . api . ads . admanager . axis . v201808 . Targeting ) ( value ) ) ) ; return targetingValue ; } else if ( value instanceof java . util . Set < ? > ) { com . google . api . ads . admanager . axis . v201808 . SetValue setValue = new com . google . api . ads . admanager . axis . v201808 . SetValue ( ) ; java . util . Set < com . google . api . ads . admanager . axis . v201808 . Value > values = new java . util . LinkedHashSet < com . google . api . ads . admanager . axis . v201808 . Value > ( ) ; for ( java . lang . Object entry : ( ( java . util . Set < ? > ) ( value ) ) ) { com . google . api . ads . admanager . axis . utils . v201808 . Pql . validateSetValueEntryForSet ( com . google . api . ads . admanager . axis . utils . v201808 . Pql . createValue ( entry ) , values ) ; values . add ( com . google . api . ads . admanager . axis . utils . v201808 . Pql . createValue ( entry ) ) ; } setValue . setValues ( values . toArray ( new com . google . api . ads . admanager . axis . v201808 . Value [ ] { } ) ) ; return setValue ; } else { throw new java . lang . IllegalArgumentException ( ( ( "Unsupported<sp>Value<sp>type<sp>[" + ( value . getClass ( ) ) ) + "]" ) ) ; } } }
org . junit . Assert . assertEquals ( null , ( ( com . google . api . ads . admanager . axis . v201808 . TextValue ) ( com . google . api . ads . admanager . axis . utils . v201808 . Pql . createValue ( null ) ) ) . getValue ( ) )
testGenerateCode_CannotWriteFolder ( ) { thrown . expect ( com . btc . redg . generator . exceptions . RedGGenerationException . class ) ; thrown . expectMessage ( "Creation<sp>of<sp>package<sp>folder<sp>structure<sp>failed" ) ; java . sql . Connection connection = com . btc . redg . generator . extractor . DatabaseManager . connectToDatabase ( "org.h2.Driver" , "jdbc:h2:mem:redg-test-all" , "" , "" ) ; java . io . File tempFile = com . btc . redg . generator . Helpers . getResourceAsFile ( "codegenerator/test.sql" ) ; "<AssertPlaceHolder>" ; com . btc . redg . generator . extractor . DatabaseManager . executePreparationScripts ( connection , new java . io . File [ ] { tempFile } ) ; java . nio . file . Path p ; if ( java . lang . System . getProperty ( "os.name" ) . toLowerCase ( ) . contains ( "win" ) ) { p = java . nio . file . Paths . get ( "C:/windows/system32/redg" ) ; } else { p = java . nio . file . Paths . get ( "/dev/redg" ) ; } com . btc . redg . generator . RedGGenerator . generateCode ( connection , new schemacrawler . schemacrawler . IncludeAll ( ) , new schemacrawler . schemacrawler . IncludeAll ( ) , null , "" , p , null , null , null , null , false , true ) ; } getResourceAsFile ( java . lang . String ) { try { com . btc . redg . generator . InputStream in = java . lang . ClassLoader . getSystemClassLoader ( ) . getResourceAsStream ( resourcePath ) ; if ( in == null ) { return null ; } com . btc . redg . generator . File tempFile = com . btc . redg . generator . File . createTempFile ( java . lang . String . valueOf ( in . hashCode ( ) ) , ".tmp" ) ; tempFile . deleteOnExit ( ) ; try ( com . btc . redg . generator . FileOutputStream out = new com . btc . redg . generator . FileOutputStream ( tempFile ) ) { byte [ ] buffer = new byte [ 1024 ] ; int bytesRead ; while ( ( bytesRead = in . read ( buffer ) ) != ( - 1 ) ) { out . write ( buffer , 0 , bytesRead ) ; } } return tempFile ; } catch ( com . btc . redg . generator . IOException e ) { e . printStackTrace ( ) ; return null ; } }
org . junit . Assert . assertNotNull ( tempFile )
testGetBlobProviders ( ) { java . util . Map < java . lang . String , org . nuxeo . ecm . core . blob . BlobProvider > providers = blobManager . getBlobProviders ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return getCollectedDocumentIds ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , providers . size ( ) )
testSetGrayed_marksItemCached ( ) { grid = new org . eclipse . nebula . widgets . grid . Grid ( shell , org . eclipse . swt . SWT . VIRTUAL ) ; org . eclipse . nebula . widgets . grid . GridItem item = new org . eclipse . nebula . widgets . grid . GridItem ( grid , org . eclipse . swt . SWT . NONE ) ; item . setGrayed ( true ) ; "<AssertPlaceHolder>" ; } isCached ( ) { return parent . isVirtual ( ) ? cached : true ; }
org . junit . Assert . assertTrue ( item . isCached ( ) )
testGetGroupMissing ( ) { org . freedesktop . IniStyleFile file = new org . freedesktop . IniStyleFile ( "default-group" ) ; java . util . Map < java . lang . String , java . lang . String > group = file . getGroup ( "some-random-group" ) ; "<AssertPlaceHolder>" ; } getGroup ( java . lang . String ) { if ( ! ( data . containsKey ( group ) ) ) { return null ; } return new java . util . HashMap ( data . get ( group ) ) ; }
org . junit . Assert . assertEquals ( null , group )
testSizeBoundedBatching ( ) { final java . util . concurrent . LinkedBlockingQueue < com . spotify . google . cloud . pubsub . client . PublisherTest . Request > t = new java . util . concurrent . LinkedBlockingQueue ( ) ; topics . put ( "t" , t ) ; publisher = com . spotify . google . cloud . pubsub . client . Publisher . builder ( ) . project ( "test" ) . pubsub ( pubsub ) . batchSize ( 2 ) . maxLatencyMs ( com . spotify . google . cloud . pubsub . client . DAYS . toMillis ( 1 ) ) . build ( ) ; final com . spotify . google . cloud . pubsub . client . Message m1 = com . spotify . google . cloud . pubsub . client . Message . of ( "1" ) ; final com . spotify . google . cloud . pubsub . client . Message m2 = com . spotify . google . cloud . pubsub . client . Message . of ( "2" ) ; publisher . publish ( "t" , m1 ) ; java . lang . Thread . sleep ( 1000 ) ; verify ( pubsub , never ( ) ) . publish ( anyString ( ) , anyString ( ) , anyListOf ( com . spotify . google . cloud . pubsub . client . Message . class ) ) ; publisher . publish ( "t" , m2 ) ; verify ( pubsub , timeout ( 5000 ) ) . publish ( anyString ( ) , anyString ( ) , anyListOf ( com . spotify . google . cloud . pubsub . client . Message . class ) ) ; final com . spotify . google . cloud . pubsub . client . PublisherTest . Request request = t . take ( ) ; "<AssertPlaceHolder>" ; } publish ( java . lang . String , java . lang . String , com . spotify . google . cloud . pubsub . client . Message [ ] ) { return publish ( project , topic , asList ( messages ) ) ; }
org . junit . Assert . assertThat ( request . messages . size ( ) , org . hamcrest . Matchers . is ( 2 ) )
initializeName ( ) { gov . uspto . patent . model . entity . NamePerson name = new gov . uspto . patent . model . entity . NamePerson ( "John" , "Smith" , "DOE" ) ; java . lang . String abbrev = name . getInitials ( ) ; java . lang . String expect = "JSD" ; "<AssertPlaceHolder>" ; } getInitials ( ) { java . lang . String shortest = super . getShortestSynonym ( ) ; java . lang . String check1 = ( shortest . isEmpty ( ) ) ? getName ( ) : shortest ; java . lang . String [ ] reduced = gov . uspto . common . text . StringCaseUtil . removeLowercaseTitleWords ( check1 . split ( "[\\s-]+" ) ) ; java . lang . String [ ] words = java . lang . String . join ( "<sp>" , reduced ) . split ( "[\\s-]+" , 2 ) ; java . lang . StringBuilder stb = new java . lang . StringBuilder ( ) ; for ( java . lang . String word : words ) { stb . append ( abbreviateText ( word , 3 ) ) . append ( "-" ) ; } if ( ( stb . length ( ) ) > 0 ) { stb . replace ( ( ( stb . length ( ) ) - 1 ) , stb . length ( ) , "" ) ; } return stb . toString ( ) ; }
org . junit . Assert . assertEquals ( expect , abbrev )
testGetPrefixedOsPropertiesWindowsAndShimConfigTrumpsWindowsConfig ( ) { when ( windowsChecker . isWindows ( ) ) . thenReturn ( true ) ; shimProperties . setProperty ( "java.system.flatclass" , "false" ) ; shimProperties . setProperty ( "windows.java.system.flatclass" , "false" ) ; shimProperties . setProperty ( "mr1.java.system.flatclass" , "false" ) ; shimProperties . setProperty ( "windows.mr1.java.system.flatclass" , "true" ) ; shimProperties . setProperty ( ShimProperties . SHIM_CP_CONFIG , "mr1" ) ; "<AssertPlaceHolder>" ; } isWindows ( ) { return org . apache . commons . lang . SystemUtils . IS_OS_WINDOWS ; }
org . junit . Assert . assertEquals ( "true" , shimProperties . getProperty ( "java.system.flatclass" ) )
testDeleteService ( ) { java . lang . String clusterName = "c1" ; java . lang . String serviceName = "HDFS" ; org . apache . ambari . funtest . server . ConnectionParams params = new org . apache . ambari . funtest . server . ConnectionParams ( ) ; params . setServerName ( "localhost" ) ; params . setServerApiPort ( serverPort ) ; params . setServerAgentPort ( serverAgentPort ) ; params . setUserName ( "admin" ) ; params . setPassword ( "admin" ) ; org . apache . ambari . funtest . server . utils . ClusterUtils clusterUtils = injector . getInstance ( org . apache . ambari . funtest . server . utils . ClusterUtils . class ) ; clusterUtils . createSampleCluster ( params ) ; hostComponentDesiredStateEntities = hostComponentDesiredStateDAO . findAll ( ) ; "<AssertPlaceHolder>" ; jsonResponse = org . apache . ambari . funtest . server . utils . RestApiUtils . executeRequest ( new org . apache . ambari . funtest . server . api . cluster . DeleteClusterWebRequest ( params , clusterName ) ) ; org . apache . ambari . funtest . server . tests . DeleteServiceTest . LOG . info ( jsonResponse ) ; } size ( ) { java . util . Set < java . lang . String > nodes = new java . util . HashSet < java . lang . String > ( ) ; for ( org . apache . ambari . eventdb . model . WorkflowDag . WorkflowDagEntry entry : entries ) { nodes . add ( entry . getSource ( ) ) ; nodes . addAll ( entry . getTargets ( ) ) ; } return nodes . size ( ) ; }
org . junit . Assert . assertEquals ( hostComponentDesiredStateEntities . size ( ) , 0 )
shouldBroadcastMessageToRecoveredProcess ( ) { broker . BrokerIntegrationTest . DummyProcess dummy1 = new broker . BrokerIntegrationTest . DummyProcess ( "Dummy<sp>1" , 1 , 2 ) ; broker . BrokerIntegrationTest . DummyProcess dummy2 = new broker . BrokerIntegrationTest . DummyProcess ( "Dummy<sp>2" , 2 , 2 ) ; dummy1 . start ( ) ; dummy2 . start ( ) ; failureInjector . killProcess ( 2 ) ; java . lang . Thread . sleep ( 50 ) ; failureInjector . restoreProcess ( 2 ) ; java . lang . Thread . sleep ( 50 ) ; java . lang . Thread . sleep ( 50 ) ; dummy1 . send ( new message . HeartbeatMessage ( 1 ) ) ; java . lang . Thread . sleep ( ( ( broker . ActiveMqBroker . DELAY ) + 50 ) ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; }
org . junit . Assert . assertNotNull ( dummy2 . getMessage ( ) )
testEquals1481087 ( ) { org . jfree . chart . labels . StandardCategoryItemLabelGenerator g1 = new org . jfree . chart . labels . StandardCategoryItemLabelGenerator ( "{0}" , new java . text . DecimalFormat ( "0.00" ) ) ; org . jfree . chart . labels . StandardCategoryToolTipGenerator g2 = new org . jfree . chart . labels . StandardCategoryToolTipGenerator ( "{0}" , new java . text . DecimalFormat ( "0.00" ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( o instanceof com . mysql . fabric . Server ) ) { return false ; } com . mysql . fabric . Server s = ( ( com . mysql . fabric . Server ) ( o ) ) ; return s . getUuid ( ) . equals ( getUuid ( ) ) ; }
org . junit . Assert . assertFalse ( g1 . equals ( g2 ) )
testGetClientProperties ( ) { try { org . geotools . data . complex . config . XMLConfigDigester reader = new org . geotools . data . complex . config . XMLConfigDigester ( ) ; java . net . URL url = getClass ( ) . getResource ( "/test-data/MappedFeatureMissingNamespaceXlink.xml" ) ; org . geotools . data . complex . config . AppSchemaDataAccessDTO config = reader . parse ( url ) ; org . geotools . data . complex . config . AppSchemaDataAccessConfigurator . buildMappings ( config ) ; org . junit . Assert . fail ( "No<sp>exception<sp>caught" ) ; } catch ( java . lang . Exception ex ) { "<AssertPlaceHolder>" ; } } buildMappings ( org . geotools . data . complex . config . AppSchemaDataAccessDTO ) { org . geotools . data . complex . config . AppSchemaDataAccessConfigurator mappingsBuilder ; mappingsBuilder = new org . geotools . data . complex . config . AppSchemaDataAccessConfigurator ( config ) ; java . util . Set < org . geotools . data . complex . FeatureTypeMapping > mappingObjects = mappingsBuilder . buildMappings ( ) ; return mappingObjects ; }
org . junit . Assert . assertSame ( java . lang . IllegalArgumentException . class , ex . getClass ( ) )
testReadSubsamplingBounds1028 ( ) { com . twelvemonkeys . imageio . plugins . jpeg . JPEGImageReader reader = createReader ( ) ; reader . setInput ( com . twelvemonkeys . imageio . plugins . jpeg . ImageIO . createImageInputStream ( getClassLoaderResource ( "/jpeg/read-error1028.jpg" ) ) ) ; com . twelvemonkeys . imageio . plugins . jpeg . ImageReadParam param = reader . getDefaultReadParam ( ) ; param . setSourceSubsampling ( 3 , 3 , 1 , 1 ) ; java . awt . image . BufferedImage image = reader . read ( 0 , param ) ; "<AssertPlaceHolder>" ; } read ( int , javax . imageio . ImageReadParam ) { java . util . Iterator < javax . imageio . ImageTypeSpecifier > imageTypes = getImageTypes ( imageIndex ) ; javax . imageio . ImageTypeSpecifier rawType = getRawImageType ( imageIndex ) ; if ( ( header . getColorMode ( ) ) != ( SGI . COLORMODE_NORMAL ) ) { processWarningOccurred ( java . lang . String . format ( "Unsupported<sp>color<sp>mode:<sp>%d,<sp>colors<sp>may<sp>look<sp>incorrect" , header . getColorMode ( ) ) ) ; } int width = getWidth ( imageIndex ) ; int height = getHeight ( imageIndex ) ; com . twelvemonkeys . imageio . plugins . sgi . BufferedImage destination = getDestination ( param , imageTypes , width , height ) ; com . twelvemonkeys . imageio . plugins . sgi . Rectangle srcRegion = new com . twelvemonkeys . imageio . plugins . sgi . Rectangle ( ) ; com . twelvemonkeys . imageio . plugins . sgi . Rectangle destRegion = new com . twelvemonkeys . imageio . plugins . sgi . Rectangle ( ) ; computeRegions ( param , width , height , destination , srcRegion , destRegion ) ; com . twelvemonkeys . imageio . plugins . sgi . WritableRaster destRaster = clipToRect ( destination . getRaster ( ) , destRegion , ( param != null ? param . getDestinationBands ( ) : null ) ) ; checkReadParamBandSettings ( param , rawType . getNumBands ( ) , destRaster . getNumBands ( ) ) ; com . twelvemonkeys . imageio . plugins . sgi . WritableRaster rowRaster = rawType . createBufferedImage ( width , 1 ) . getRaster ( ) ; com . twelvemonkeys . imageio . plugins . sgi . Raster clippedRow = clipRowToRect ( rowRaster , srcRegion , ( param != null ? param . getSourceBands ( ) : null ) , ( param != null ? param . getSourceXSubsampling ( ) : 1 ) ) ; int [ ] scanlineOffsets ; int [ ] scanlineLengths ; int compression = header . getCompression ( ) ; if ( compression == ( SGI . COMPRESSION_RLE ) ) { scanlineOffsets = new int [ height * ( header . getChannels ( ) ) ] ; scanlineLengths = new int [ height * ( header . getChannels ( ) ) ] ; imageInput . readFully ( scanlineOffsets , 0 , scanlineOffsets . length ) ; imageInput . readFully ( scanlineLengths , 0 , scanlineLengths . length ) ; } else { scanlineOffsets = null ; scanlineLengths = null ; } int xSub = ( param != null ) ? param . getSourceXSubsampling ( ) : 1 ; int ySub = ( param != null ) ? param . getSourceYSubsampling ( ) : 1 ; processImageStarted ( imageIndex ) ; for ( int c = 0 ; c < ( header . getChannels ( ) ) ; c ++ ) { com . twelvemonkeys . imageio . plugins . sgi . WritableRaster destChannel = destRaster . createWritableChild ( destRaster . getMinX ( ) , destRaster . getMinY ( ) , destRaster . getWidth ( ) , destRaster . getHeight ( ) , 0 , 0 , new int [ ] { c } ) ; com . twelvemonkeys . imageio . plugins . sgi . Raster srcChannel = clippedRow . createChild ( clippedRow . getMinX ( ) , 0 , clippedRow . getWidth ( ) , 1 , 0 , 0 , new int [ ] { c } ) ; for ( int y = 0 ; y < height ; y ++ ) { switch ( header . getBytesPerPixel ( ) ) { case 1 : byte [ ] rowDataByte = ( ( com . twelvemonkeys . imageio . plugins . sgi . DataBufferByte ) ( rowRaster . getDataBuffer ( ) ) ) . getData ( c ) ; readRowByte ( height , srcRegion , scanlineOffsets , scanlineLengths , compression , xSub , ySub , c , rowDataByte , destChannel , srcChannel , y ) ; break ; case 2 : short [ ] rowDataUShort = ( ( com . twelvemonkeys . imageio . plugins . sgi . DataBufferUShort ) ( rowRaster . getDataBuffer ( ) ) ) . getData ( c ) ; readRowUShort ( height , srcRegion , scanlineOffsets , scanlineLengths , compression , xSub , ySub , c , rowDataUShort , destChannel , srcChannel , y ) ; break ; default : throw new java . lang . AssertionError ( ) ; } processImageProgress ( ( ( ( ( 100.0F * y ) / height ) * c ) / ( header . getChannels ( ) ) ) ) ; if ( ( ( height - 1 ) - y ) < ( srcRegion . y ) ) { break ; } if ( abortRequested ( ) ) { break ; } } if ( abortRequested ( ) ) { processReadAborted ( ) ; break ; } } processImageComplete ( ) ; return destination ; }
org . junit . Assert . assertNotNull ( image )
testIncludeMetadata ( ) { java . util . ArrayList < com . nextdoor . bender . operation . substitution . Substitution > substitutions = new java . util . ArrayList < com . nextdoor . bender . operation . substitution . Substitution > ( ) ; substitutions . add ( new com . nextdoor . bender . operation . substitution . metadata . MetadataSubstitution ( "foo" , java . util . Arrays . asList ( "eventSha1Hash" ) , java . util . Collections . emptyList ( ) , true ) ) ; com . nextdoor . bender . testutils . DummyDeserializerHelper . DummpyMapEvent devent = new com . nextdoor . bender . testutils . DummyDeserializerHelper . DummpyMapEvent ( ) ; com . nextdoor . bender . InternalEvent ievent = new com . nextdoor . bender . InternalEvent ( "" , null , 10 ) ; ievent . setEventObj ( devent ) ; ievent . setEventTime ( 20 ) ; com . nextdoor . bender . operation . substitution . SubstitutionOperation op = new com . nextdoor . bender . operation . substitution . SubstitutionOperation ( substitutions ) ; op . perform ( ievent ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( "eventSha1Hash" , "da39a3ee5e6b4b0d3255bfef95601890afd80709" ) ; } } ; "<AssertPlaceHolder>" ; } getField ( java . lang . String ) { if ( ( this . payload ) == null ) { throw new com . nextdoor . bender . deserializer . FieldNotFoundException ( ( field + "<sp>is<sp>not<sp>in<sp>payload<sp>because<sp>payload<sp>is<sp>null" ) ) ; } com . google . gson . JsonObject json = this . payload . getAsJsonObject ( ) ; java . lang . Object obj ; try { obj = com . nextdoor . bender . deserializer . json . JsonPathProvider . read ( json , field ) ; } catch ( com . jayway . jsonpath . InvalidPathException e ) { throw new com . nextdoor . bender . deserializer . FieldNotFoundException ( ( ( "Field<sp>cannot<sp>be<sp>found<sp>because<sp>" + field ) + "<sp>is<sp>an<sp>invalid<sp>path" ) ) ; } if ( ( obj == null ) || ( obj instanceof com . google . gson . JsonNull ) ) { throw new com . nextdoor . bender . deserializer . FieldNotFoundException ( ( field + "<sp>is<sp>not<sp>in<sp>payload." ) ) ; } if ( obj instanceof com . google . gson . JsonPrimitive ) { if ( ( ( com . google . gson . JsonPrimitive ) ( obj ) ) . isString ( ) ) { return ( ( com . google . gson . JsonPrimitive ) ( obj ) ) . getAsString ( ) ; } } return obj ; }
org . junit . Assert . assertEquals ( expected , devent . getField ( "foo" ) )
testDefaultTTLWith10MaxAgeAndExpires ( ) { final java . time . LocalDateTime expires = now . plusYears ( 1 ) ; final org . codehaus . httpcache4j . cache . Headers headers = createDefaultHeaders ( ) . add ( HeaderConstants . CACHE_CONTROL , "max-age=10" ) . add ( org . codehaus . httpcache4j . cache . HeaderUtils . toHttpDate ( HeaderConstants . EXPIRES , expires ) ) ; long ttl = org . codehaus . httpcache4j . cache . DefaultCacheItem . getTTL ( new org . codehaus . httpcache4j . cache . HTTPResponse ( Status . OK , headers ) , DEFAULT_TTL ) ; "<AssertPlaceHolder>" ; } toHttpDate ( java . lang . String , org . codehaus . httpcache4j . LocalDateTime ) { return new org . codehaus . httpcache4j . Header ( headerName , org . codehaus . httpcache4j . HeaderUtils . toGMTString ( time ) ) ; }
org . junit . Assert . assertEquals ( DEFAULT_TTL , ttl )
testGemeenteVanInschrijvingNietGevuld ( ) { final boolean gevuld = new nl . bzk . migratiebrp . conversie . model . lo3 . Lo3PersoonslijstBuilder ( ) . build ( ) . isGemeenteVanInschrijvingGevuld ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return built ; }
org . junit . Assert . assertFalse ( gevuld )
testEmptyIntArray ( ) { org . eclipse . microprofile . config . spi . ConfigBuilder builder = org . eclipse . microprofile . config . spi . ConfigProviderResolver . instance ( ) . getBuilder ( ) ; java . lang . System . setProperty ( ConfigConstants . DYNAMIC_REFRESH_INTERVAL_PROP_NAME , ( "" + 0 ) ) ; com . ibm . ws . microprofile . config . converter . test . NullableConfigSource source = new com . ibm . ws . microprofile . config . converter . test . NullableConfigSource ( ) ; source . put ( "key1" , null ) ; builder . withSources ( source ) ; org . eclipse . microprofile . config . Config config = builder . build ( ) ; int [ ] key1 = config . getValue ( "key1" , int [ ] . class ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . String , int ) { if ( ( rows . size ( ) ) > index ) { com . ibm . ws . jsp . tsx . db . QueryRow qr = ( ( com . ibm . ws . jsp . tsx . db . QueryRow ) ( rows . elementAt ( index ) ) ) ; return qr . getValue ( propertyName ) ; } else return null ; }
org . junit . Assert . assertEquals ( 0 , key1 . length )
shouldRejectNullName ( ) { cluster . setName ( null ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = cTest . validate ( cluster , org . openstack . atlas . api . mgmt . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; }
org . junit . Assert . assertFalse ( resultMessage ( result , org . openstack . atlas . api . mgmt . validation . validators . POST ) , result . passedValidation ( ) )
testSetStatus ( ) { rot . setStatus ( DataStatus . VOID ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return net . sf . marineapi . nmea . util . DataStatus . valueOf ( getCharValue ( net . sf . marineapi . nmea . parser . APBParser . SIGNAL_STATUS ) ) ; }
org . junit . Assert . assertEquals ( DataStatus . VOID , rot . getStatus ( ) )
testNoKeyStoreFile ( ) { org . apache . wss4j . common . crypto . Crypto crypto = org . apache . wss4j . common . crypto . CryptoFactory . getInstance ( "nofile.properties" ) ; "<AssertPlaceHolder>" ; } getInstance ( java . util . Properties ) { if ( properties == null ) { org . apache . wss4j . common . crypto . CryptoFactory . LOG . debug ( "Cannot<sp>load<sp>Crypto<sp>instance<sp>as<sp>properties<sp>object<sp>is<sp>null" ) ; throw new org . apache . wss4j . common . ext . WSSecurityException ( WSSecurityException . ErrorCode . FAILURE , "empty" , new java . lang . Object [ ] { "Cannot<sp>load<sp>Crypto<sp>instance<sp>as<sp>properties<sp>object<sp>is<sp>null" } ) ; } return org . apache . wss4j . common . crypto . CryptoFactory . getInstance ( properties , org . apache . wss4j . common . util . Loader . getClassLoader ( org . apache . wss4j . common . crypto . CryptoFactory . class ) , null ) ; }
org . junit . Assert . assertNotNull ( crypto )
testIsClosed ( ) { org . bff . javampd . server . MPD mpd = mpdBuilder . build ( ) ; "<AssertPlaceHolder>" ; } isClosed ( ) { return this . closed ; }
org . junit . Assert . assertFalse ( mpd . isClosed ( ) )
testConstuctor_Failed ( ) { com . dp . nebula . wormhole . engine . core . WriterThread writer = createWriterThread ( "com.dp.nebula.wormhole.engine.common.NotExistWriter" ) ; "<AssertPlaceHolder>" ; } createWriterThread ( com . dp . nebula . wormhole . common . interfaces . IWriter ) { try { java . lang . Class clazz = java . lang . Class . forName ( "com.dp.nebula.wormhole.engine.core.WriterThread" ) ; java . lang . reflect . Constructor con = clazz . getDeclaredConstructor ( com . dp . nebula . wormhole . common . interfaces . ILineReceiver . class , com . dp . nebula . wormhole . common . interfaces . IWriter . class ) ; con . setAccessible ( true ) ; return ( ( com . dp . nebula . wormhole . engine . core . WriterThread ) ( con . newInstance ( lineReceiver , writer ) ) ) ; } catch ( java . lang . Exception e ) { return null ; } }
org . junit . Assert . assertNull ( writer )
testJavaSerialization ( ) { org . apache . eagle . alert . engine . model . PartitionedEvent partitionedEvent = new org . apache . eagle . alert . engine . model . PartitionedEvent ( ) ; partitionedEvent . setPartitionKey ( partitionedEvent . hashCode ( ) ) ; partitionedEvent . setPartition ( org . apache . eagle . alert . engine . serialization . JavaSerializationTest . createSampleStreamGroupbyPartition ( "sampleStream" , java . util . Arrays . asList ( "name" , "host" ) ) ) ; org . apache . eagle . alert . engine . model . StreamEvent event = new org . apache . eagle . alert . engine . model . StreamEvent ( ) ; event . setStreamId ( "sampleStream" ) ; event . setTimestamp ( java . lang . System . currentTimeMillis ( ) ) ; event . setData ( new java . lang . Object [ ] { "CPU" , "LOCALHOST" , true , Long . MAX_VALUE , 60.0 } ) ; partitionedEvent . setEvent ( event ) ; int javaSerializationLength = org . apache . commons . lang3 . SerializationUtils . serialize ( partitionedEvent ) . length ; org . apache . eagle . alert . engine . serialization . JavaSerializationTest . LOG . info ( "Java<sp>serialization<sp>length:<sp>{},<sp>event:<sp>{}" , javaSerializationLength , partitionedEvent ) ; int compactLength = 0 ; compactLength += "sampleStream" . getBytes ( ) . length ; compactLength += org . apache . eagle . alert . utils . ByteUtils . intToBytes ( partitionedEvent . getPartition ( ) . hashCode ( ) ) . length ; compactLength += org . apache . eagle . alert . utils . ByteUtils . longToBytes ( partitionedEvent . getTimestamp ( ) ) . length ; compactLength += "CPU" . getBytes ( ) . length ; compactLength += "LOCALHOST" . getBytes ( ) . length ; compactLength += 1 ; compactLength += org . apache . eagle . alert . utils . ByteUtils . longToBytes ( Long . MAX_VALUE ) . length ; compactLength += org . apache . eagle . alert . utils . ByteUtils . doubleToBytes ( 60.0 ) . length ; org . apache . eagle . alert . engine . serialization . JavaSerializationTest . LOG . info ( "Compact<sp>serialization<sp>length:<sp>{},<sp>event:<sp>{}" , compactLength , partitionedEvent ) ; "<AssertPlaceHolder>" ; } doubleToBytes ( double ) { return org . apache . eagle . alert . utils . ByteUtils . longToBytes ( java . lang . Double . doubleToLongBits ( v ) ) ; }
org . junit . Assert . assertTrue ( ( ( compactLength * 20 ) < javaSerializationLength ) )
clinicallyMeasuredObservationsNullFlavorTest ( ) { org . oscarehr . e2e . populator . body . ClinicallyMeasuredObservationsPopulator cmoPopulator = new org . oscarehr . e2e . populator . body . ClinicallyMeasuredObservationsPopulator ( new org . oscarehr . e2e . model . PatientExport ( Constants . Runtime . INVALID_VALUE ) ) ; "<AssertPlaceHolder>" ; } populateNullFlavorClinicalStatement ( ) { org . marc . everest . rmim . uv . cdar2 . pocd_mt000040uv . Observation observation = new org . marc . everest . rmim . uv . cdar2 . pocd_mt000040uv . Observation ( org . marc . everest . rmim . uv . cdar2 . vocabulary . x_ActMoodDocumentObservation . Eventoccurrence ) ; observation . setId ( org . oscarehr . e2e . util . EverestUtils . buildUniqueId ( Constants . IdPrefixes . AdvanceDirectives , 0 ) ) ; observation . setCode ( new org . marc . everest . datatypes . generic . CD < java . lang . String > ( ) { { setNullFlavor ( NullFlavor . NoInformation ) ; } } ) ; observation . setText ( new org . marc . everest . datatypes . ED ( ) { { setNullFlavor ( NullFlavor . NoInformation ) ; } } ) ; observation . setStatusCode ( ActStatus . Completed ) ; observation . setEffectiveTime ( new org . marc . everest . datatypes . generic . IVL < org . marc . everest . datatypes . TS > ( ) { { setNullFlavor ( NullFlavor . NoInformation ) ; } } ) ; return observation ; }
org . junit . Assert . assertNull ( cmoPopulator . populateNullFlavorClinicalStatement ( ) )
testText ( ) { com . eviware . soapui . support . xml . XPathData data = new com . eviware . soapui . support . xml . XPathData ( "//in/name/text()" , false ) ; "<AssertPlaceHolder>" ; } getFullPath ( ) { return buildXPath ( null ) ; }
org . junit . Assert . assertEquals ( "//in/name/text()" , data . getFullPath ( ) )
testGetApplicationName ( ) { final java . lang . String testApplicationName = "MY_TEST_APP" ; org . finra . herd . core . ArgumentParser argParser = new org . finra . herd . core . ArgumentParser ( testApplicationName ) ; "<AssertPlaceHolder>" ; } getApplicationName ( ) { return applicationName ; }
org . junit . Assert . assertEquals ( testApplicationName , argParser . getApplicationName ( ) )
whenAllResourcesAreRetrieved_thenTheResultIsNotNull ( ) { final java . util . List < com . baeldung . domain . Foo > resources = getApi ( ) . findAll ( ) ; "<AssertPlaceHolder>" ; } findAll ( ) { return meals ; }
org . junit . Assert . assertNotNull ( resources )
testSingleElementIteration ( ) { org . petitparser . parser . Parser parser = lowerCase ( ) ; org . petitparser . utils . Mirror mirror = org . petitparser . utils . Mirror . of ( parser ) ; java . util . List < org . petitparser . parser . Parser > parsers = mirror . stream ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } stream ( ) { return java . util . stream . StreamSupport . stream ( java . util . Spliterators . spliteratorUnknownSize ( iterator ( ) , ( ( java . util . Spliterator . DISTINCT ) | ( java . util . Spliterator . NONNULL ) ) ) , false ) ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( parser ) , parsers )
testIntersectionWithSet ( ) { org . dresdenocl . tools . codegen . ocl2java . types . OclSet < java . lang . String > set1 ; org . dresdenocl . tools . codegen . ocl2java . types . OclSet < java . lang . String > set2 ; org . dresdenocl . tools . codegen . ocl2java . types . OclSet < java . lang . String > set3 ; org . dresdenocl . tools . codegen . ocl2java . types . OclSet < java . lang . String > set4 ; java . lang . String object1 ; java . lang . String object2 ; java . lang . String object3 ; set1 = new org . dresdenocl . tools . codegen . ocl2java . types . OclSet < java . lang . String > ( ) ; set2 = new org . dresdenocl . tools . codegen . ocl2java . types . OclSet < java . lang . String > ( ) ; set4 = new org . dresdenocl . tools . codegen . ocl2java . types . OclSet < java . lang . String > ( ) ; object1 = "1" ; object2 = "2" ; object3 = "3" ; set1 . add ( object1 ) ; set1 . add ( object2 ) ; set4 . add ( object1 ) ; set4 . add ( object2 ) ; set4 . add ( object3 ) ; set2 . add ( object1 ) ; set2 . add ( object2 ) ; set3 = set1 . intersection ( set4 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof org . dresdenocl . metamodels . xsd . internal . model . XSDModel ) { return resource . equals ( ( ( org . dresdenocl . metamodels . xsd . internal . model . XSDModel ) ( obj ) ) . resource ) ; } return false ; }
org . junit . Assert . assertTrue ( set3 . equals ( set2 ) )