input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testService ( ) { java . lang . String name = "Per<sp>Spilling" ; springService . changePhoneNumber ( name , "12345678" ) ; no . kodemaker . ps . jdbiapp . domain . Person person = personDao . findByName ( name ) . get ( 0 ) ; springService . changePhoneNumber ( name , "21212121" ) ; no . kodemaker . ps . jdbiapp . domain . Person person2 = personDao . findByName ( name ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } getPhone ( ) { return phone ; } | org . junit . Assert . assertTrue ( ( ! ( person2 . getPhone ( ) . equals ( person . getPhone ( ) ) ) ) ) |
testUsingHttpClientRecordsSpan ( ) { org . apache . http . message . BasicHttpResponse expectedResponse = new org . apache . http . message . BasicHttpResponse ( HttpVersion . HTTP_1_1 , 200 , "OK" ) ; org . apache . http . client . HttpClient client = new com . yammer . telemetry . agent . handlers . ApacheHttpClientClassHandlerTest . TestableHttpClient ( expectedResponse ) ; java . net . URL localResourceUrl = com . yammer . telemetry . test . TransformedTest . class . getResource ( "/telemetry.yml" ) ; com . yammer . telemetry . agent . handlers . HttpResponse httpResponse = client . execute ( new org . apache . http . client . methods . HttpGet ( localResourceUrl . toURI ( ) ) ) ; "<AssertPlaceHolder>" ; } execute ( java . lang . String ) { try ( com . yammer . telemetry . tracing . Span span = com . yammer . telemetry . tracing . SpanHelper . startSpan ( ( "Execute:<sp>" + sql ) ) ) { span . addAnnotation ( AnnotationNames . SERVICE_NAME , connection . getUrl ( ) ) ; span . addAnnotation ( AnnotationNames . CLIENT_SENT ) ; boolean result = underlying . execute ( sql ) ; span . addAnnotation ( AnnotationNames . CLIENT_RECEIVED ) ; return result ; } } | org . junit . Assert . assertEquals ( expectedResponse , httpResponse ) |
testParseOldFile ( ) { hudson . scm . CVSChangeLogSet result = new hudson . scm . CVSChangeLogParser ( ) . parse ( null , getDataFile ( "changelogOldFormat.xml" ) ) ; "<AssertPlaceHolder>" ; } getDataFile ( java . lang . String ) { return new java . io . File ( hudson . scm . LegacyConvertorTest . class . getResource ( name ) . toURI ( ) ) . getAbsolutePath ( ) ; } | org . junit . Assert . assertNotNull ( result ) |
testCompareLongLTEDecimal ( ) { java . lang . String tableName = generateUniqueName ( ) ; java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) , org . apache . phoenix . end2end . PrimitiveTypeIT . PROPS ) ; org . apache . phoenix . end2end . PrimitiveTypeIT . initTableValues ( conn , tableName ) ; java . lang . String query = ( "SELECT<sp>l<sp>FROM<sp>" + tableName ) + "<sp>where<sp>l<sp><=<sp>1.5" ; try { java . sql . PreparedStatement statement = conn . prepareStatement ( query ) ; java . sql . ResultSet rs = statement . executeQuery ( ) ; "<AssertPlaceHolder>" ; } finally { conn . close ( ) ; } } next ( ) { if ( ! ( org . apache . phoenix . util . CursorUtil . moreValues ( cursorName ) ) ) { return null ; } else if ( ( fetchSize ) == ( rowsRead ) ) { return null ; } org . apache . phoenix . schema . tuple . Tuple next = delegate . next ( ) ; org . apache . phoenix . util . CursorUtil . updateCursor ( cursorName , next , delegate . peek ( ) ) ; ( rowsRead ) ++ ; return next ; } | org . junit . Assert . assertFalse ( rs . next ( ) ) |
shouldCheckGetCustomerByLogin ( ) { java . lang . String login = "agoncal" ; org . agoncal . sample . jaxrs . testing . Customer customer = org . agoncal . sample . jaxrs . testing . CustomerCRUDRestServiceIT . client . target ( "http://localhost:8282/customer" ) . path ( login ) . request ( ) . get ( org . agoncal . sample . jaxrs . testing . Customer . class ) ; "<AssertPlaceHolder>" ; } getLogin ( ) { return login ; } | org . junit . Assert . assertEquals ( login , customer . getLogin ( ) ) |
testHashCode ( ) { nl . bzk . migratiebrp . conversie . model . exceptions . OngeldigeAutorisatieException e = new nl . bzk . migratiebrp . conversie . model . exceptions . OngeldigeAutorisatieException ( ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int result = ( ( bronnen ) != null ) ? bronnen . hashCode ( ) : 0 ; result = ( 31 * result ) + ( ( ouder1 ) != null ? ouder1 . hashCode ( ) : 0 ) ; result = ( 31 * result ) + ( ( ouder2 ) != null ? ouder2 . hashCode ( ) : 0 ) ; result = ( 31 * result ) + ( ( kind ) != null ? kind . hashCode ( ) : 0 ) ; return result ; } | org . junit . Assert . assertTrue ( ( 0 < ( e . hashCode ( ) ) ) ) |
readErrorCompletelyReadsErrorStream ( java . io . InputStream ) { final com . microsoft . azure . sdk . iot . service . transport . http . HttpMethod httpsMethod = com . microsoft . azure . sdk . iot . service . transport . http . HttpMethod . GET ; byte [ ] expectedError = new byte [ ] { 1 , 2 , 3 } ; new mockit . NonStrictExpectations ( ) { { mockUrl . getProtocol ( ) ; result = "https" ; mockUrl . openConnection ( ) ; result = mockUrlConn ; mockUrlConn . getRequestMethod ( ) ; result = httpsMethod . name ( ) ; mockUrlConn . getErrorStream ( ) ; result = mockIs ; mockIs . read ( ) ; returns ( 1 , 2 , 3 , ( - 1 ) ) ; } } ; com . microsoft . azure . sdk . iot . service . transport . http . HttpConnection conn = new com . microsoft . azure . sdk . iot . service . transport . http . HttpConnection ( mockUrl , httpsMethod ) ; conn . connect ( ) ; byte [ ] testError = conn . readError ( ) ; "<AssertPlaceHolder>" ; } readError ( ) { byte [ ] error = new byte [ 0 ] ; try ( java . io . InputStream errorStream = this . connection . getErrorStream ( ) ) { if ( errorStream != null ) { error = com . microsoft . azure . sdk . iot . service . transport . http . HttpConnection . readInputStream ( errorStream ) ; } } return error ; } | org . junit . Assert . assertThat ( testError , org . hamcrest . CoreMatchers . is ( expectedError ) ) |
testSetQuantile ( ) { org . hipparchus . stat . descriptive . rank . PSquarePercentile percentile = new org . hipparchus . stat . descriptive . rank . PSquarePercentile ( 10.0 ) ; percentile = new org . hipparchus . stat . descriptive . rank . PSquarePercentile ( 100 ) ; "<AssertPlaceHolder>" ; try { percentile = new org . hipparchus . stat . descriptive . rank . PSquarePercentile ( 0 ) ; } catch ( org . hipparchus . exception . MathIllegalArgumentException ex ) { } try { new org . hipparchus . stat . descriptive . rank . PSquarePercentile ( 0.0 ) ; } catch ( org . hipparchus . exception . MathIllegalArgumentException ex ) { } } quantile ( ) { return quantile ; } | org . junit . Assert . assertEquals ( 1.0 , percentile . quantile ( ) , 0 ) |
testCreateBothNull ( ) { final io . pkts . buffer . Buffer buffer = io . pkts . buffer . Buffers . wrap ( null , null ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { throw new java . lang . RuntimeException ( io . pkts . buffer . BoundedInputStreamBuffer . NOT_IMPLEMENTED_JUST_YET ) ; } | org . junit . Assert . assertThat ( buffer . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testConvolutionLayerSetup ( ) { org . deeplearning4j . nn . conf . MultiLayerConfiguration . Builder builder = inComplete ( ) ; builder . setInputType ( org . deeplearning4j . nn . conf . inputs . InputType . convolutionalFlat ( 28 , 28 , 1 ) ) ; org . deeplearning4j . nn . conf . MultiLayerConfiguration completed = complete ( ) . build ( ) ; org . deeplearning4j . nn . conf . MultiLayerConfiguration test = builder . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { org . nd4j . storage . CompressedRamStorage < T > storage = new org . nd4j . storage . CompressedRamStorage < > ( ) ; storage . compressor = this . compressor ; storage . useInplaceCompression = this . useInplaceCompression ; storage . emulateIsAbsent = this . emulateIsAbsent ; return storage ; } | org . junit . Assert . assertEquals ( completed , test ) |
testSaveListOfTLhaOutputStreamStringCsvConfigCsvListHandlerOfTString ( ) { final java . io . File file = tempFolder . newFile ( "test.lzh" ) ; final com . orangesignal . jlha . LhaOutputStream lha = new com . orangesignal . jlha . LhaOutputStream ( new java . io . FileOutputStream ( file ) ) ; try { com . orangesignal . csv . Csv . save ( com . orangesignal . csv . CsvTest . data , lha , com . orangesignal . csv . CsvTest . encoding , com . orangesignal . csv . CsvTest . cfg , new com . orangesignal . csv . handlers . StringArrayListHandler ( ) , "test.csv" ) ; } finally { com . orangesignal . csv . Csv . closeQuietly ( lha ) ; } final com . orangesignal . jlha . LhaFile lhaFile = new com . orangesignal . jlha . LhaFile ( file ) ; try { final java . util . List < java . lang . String [ ] > list = com . orangesignal . csv . Csv . load ( lhaFile , com . orangesignal . csv . CsvTest . encoding , com . orangesignal . csv . CsvTest . cfg , new com . orangesignal . csv . handlers . StringArrayListHandler ( ) ) ; "<AssertPlaceHolder>" ; } finally { lhaFile . close ( ) ; } } size ( ) { return headers . size ( ) ; } | org . junit . Assert . assertThat ( list . size ( ) , org . hamcrest . core . Is . is ( 2 ) ) |
testDynamic ( ) { org . apache . mina . codec . delimited . ByteBufferEncoder < org . apache . mina . generated . thrift . UserProfile > encoder = getEncoder ( ) ; org . apache . mina . codec . delimited . serialization . ThriftDynamicMessageDecoder decoder = new org . apache . mina . codec . delimited . serialization . ThriftDynamicMessageDecoder ( ) ; for ( org . apache . mina . generated . thrift . UserProfile object : getObjects ( ) ) { org . apache . mina . codec . delimited . serialization . ThriftDynamicMessageDecoder . ThriftSerializedMessage message = decoder . decode ( org . apache . mina . codec . IoBuffer . wrap ( encoder . encode ( object ) ) ) ; "<AssertPlaceHolder>" ; } } get ( java . lang . Object ) { org . apache . mina . coap . retry . ExpiringMap < K , V > . ExpiringValue < V > expValue = map . get ( key ) ; if ( expValue != null ) { return expValue . value ; } return null ; } | org . junit . Assert . assertEquals ( object , message . get ( org . apache . mina . generated . thrift . UserProfile . class ) ) |
testFromXml_EmptyString ( ) { final org . esa . snap . core . datamodel . MetadataElement metadataElement = serializer . fromXml ( "" ) ; "<AssertPlaceHolder>" ; } fromXml ( java . lang . String ) { return new org . esa . snap . core . gpf . annotations . ParameterBlockConverter ( ) . convertXmlToObject ( xml , new com . bc . calvalus . processing . ta . TAConfig ( ) ) ; } | org . junit . Assert . assertNull ( metadataElement ) |
testGetJobInstance ( ) { final javax . batch . operations . JobOperator mockJobOperator = mockery . mock ( javax . batch . operations . JobOperator . class ) ; final javax . transaction . TransactionManager mockTranMgr = mockery . mock ( javax . transaction . TransactionManager . class ) ; final javax . transaction . Transaction mockTran = mockery . mock ( javax . transaction . Transaction . class ) ; final javax . batch . runtime . JobInstance retMe = mockery . mock ( javax . batch . runtime . JobInstance . class ) ; mockery . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockTranMgr ) . suspend ( ) ; will ( returnValue ( mockTran ) ) ; oneOf ( mockJobOperator ) . getJobInstance ( 0 ) ; will ( returnValue ( retMe ) ) ; oneOf ( mockTranMgr ) . resume ( mockTran ) ; } } ) ; "<AssertPlaceHolder>" ; } buildJobOperator ( javax . batch . operations . JobOperator , javax . transaction . TransactionManager ) { com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran retMe = new com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran ( ) ; retMe . setTransactionManager ( mockTranMgr ) ; retMe . setJobOperator ( mockJobOperator ) ; return retMe ; } | org . junit . Assert . assertEquals ( retMe , buildJobOperator ( mockJobOperator , mockTranMgr ) . getJobInstance ( 0 ) ) |
testAnalyze ( ) { final java . util . List < io . vertigo . commons . analytics . metric . Metric > metrics = analyticsManager . getMetrics ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return lines . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , metrics . size ( ) ) |
testPositiveInfinity ( ) { org . apache . commons . math3 . geometry . euclidean . twod . Vector2D c = Vector2D . POSITIVE_INFINITY ; java . lang . String expected = "{(Infinity);<sp>(Infinity)}" ; java . lang . String actual = vector2DFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( java . lang . Object [ ] ) { return format . format ( arguments ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetSize ( ) { java . lang . String label = "R3" ; org . openscience . cdk . smsd . helper . LabelContainer instance = new org . openscience . cdk . smsd . helper . LabelContainer ( ) ; instance . addLabel ( label ) ; int expectedValue = 3 ; int result = instance . getSize ( ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return size ; } | org . junit . Assert . assertEquals ( expectedValue , result ) |
getIsolationMethodTest ( ) { com . cloud . network . PhysicalNetwork . IsolationMethod method = new com . cloud . network . PhysicalNetwork . IsolationMethod ( "bla" ) ; final com . cloud . network . PhysicalNetwork . IsolationMethod isolationMethod = PhysicalNetwork . IsolationMethod . getIsolationMethod ( "bla" ) ; "<AssertPlaceHolder>" ; } getIsolationMethod ( java . lang . String ) { com . cloud . network . PhysicalNetwork . IsolationMethod rc = null ; for ( com . cloud . network . PhysicalNetwork . IsolationMethod method : com . cloud . network . PhysicalNetwork . IsolationMethod . registeredIsolationMethods ) { if ( method . methodPrefix . equals ( prfx ) ) { rc = method ; if ( ! ( rc . getProvider ( ) . equals ( com . cloud . network . PhysicalNetwork . IsolationMethod . UNKNOWN_PROVIDER ) ) ) { break ; } } } if ( rc == null ) { throw new com . cloud . network . PhysicalNetwork . IsolationMethod . IsolationMethodNotRegistered ( ( ( "No<sp>registration<sp>of<sp>prefix<sp>'" + prfx ) + "'<sp>found." ) ) ; } return rc ; } | org . junit . Assert . assertEquals ( method , isolationMethod ) |
testToQuery ( ) { final java . util . Set < org . kie . workbench . common . services . refactoring . model . index . terms . valueterms . ValueIndexTerm > terms = new java . util . HashSet ( ) ; final org . apache . lucene . search . Query expectedResult = mock ( org . apache . lucene . search . Query . class ) ; doNothing ( ) . when ( query ) . checkNotNullAndNotEmpty ( terms ) ; doReturn ( expectedResult ) . when ( query ) . buildFromMultipleTerms ( terms ) ; final org . apache . lucene . search . Query actualResult = query . toQuery ( terms ) ; verify ( query ) . checkNotNullAndNotEmpty ( terms ) ; "<AssertPlaceHolder>" ; } checkNotNullAndNotEmpty ( java . util . Set ) { org . kie . soup . commons . validation . PortablePreconditions . checkNotNull ( "terms" , terms ) ; if ( terms . isEmpty ( ) ) { throw new java . lang . IllegalArgumentException ( "At<sp>least<sp>1<sp>term<sp>must<sp>be<sp>submitted<sp>when<sp>querying<sp>referenced<sp>resources" ) ; } } | org . junit . Assert . assertEquals ( expectedResult , actualResult ) |
testSetOn2D ( ) { edu . ucla . sspace . matrix . Matrix m = new edu . ucla . sspace . matrix . OnDiskMatrix ( 3 , 3 ) ; for ( int i = 0 ; i < 3 ; ++ i ) { for ( int j = 0 ; j < 3 ; ++ j ) { m . set ( i , j , ( ( i + 1 ) * ( j + 1 ) ) ) ; } } for ( int i = 0 ; i < 3 ; ++ i ) { for ( int j = 0 ; j < 3 ; ++ j ) { "<AssertPlaceHolder>" ; } } } get ( int , int ) { if ( row > column ) { int tmp = column ; column = row ; row = tmp ; } return backing . get ( row , column ) ; } | org . junit . Assert . assertEquals ( ( ( i + 1 ) * ( j + 1 ) ) , m . get ( i , j ) , 0 ) |
testNewPDBAtom_String ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IPDBAtom atom = builder . newInstance ( org . openscience . cdk . interfaces . IPDBAtom . class , "O" ) ; "<AssertPlaceHolder>" ; } newInstance ( java . lang . Class , java . lang . Object [ ] ) { return factory . ofClass ( clazz , params ) ; } | org . junit . Assert . assertNotNull ( atom ) |
manageDomains_with_UPDATE_should_create_domain_if_not_existing ( ) { final java . lang . String domainName = getDomainName ( "sample_update" ) ; org . springframework . data . simpledb . core . domain . DomainManager manager = new org . springframework . data . simpledb . core . domain . DomainManager ( ) ; manager . manageDomain ( domainName , DomainManagementPolicy . UPDATE , sdb ) ; "<AssertPlaceHolder>" ; manager . dropDomain ( domainName , sdb ) ; } exists ( java . lang . String , com . amazonaws . services . simpledb . AmazonSimpleDB ) { try { com . amazonaws . services . simpledb . model . ListDomainsResult listDomainsResult = sdb . listDomains ( new com . amazonaws . services . simpledb . model . ListDomainsRequest ( ) ) ; java . util . List < java . lang . String > domainNames = listDomainsResult . getDomainNames ( ) ; java . lang . String nextToken = listDomainsResult . getNextToken ( ) ; while ( ( nextToken != null ) && ( ! ( nextToken . isEmpty ( ) ) ) ) { listDomainsResult = sdb . listDomains ( new com . amazonaws . services . simpledb . model . ListDomainsRequest ( ) . withNextToken ( nextToken ) ) ; domainNames . addAll ( listDomainsResult . getDomainNames ( ) ) ; nextToken = listDomainsResult . getNextToken ( ) ; } return domainNames . contains ( domainName ) ; } catch ( com . amazonaws . AmazonClientException amazonException ) { throw org . springframework . data . simpledb . exception . SimpleDbExceptionTranslator . getTranslatorInstance ( ) . translateAmazonClientException ( amazonException ) ; } } | org . junit . Assert . assertTrue ( manager . exists ( domainName , sdb ) ) |
detectCollectionType ( ) { final boolean isCollectionType = org . eclipse . lyo . oslc4j . core . model . ResourceShapeFactory . isCollectionType ( org . eclipse . lyo . oslc4j . core . model . ResourceShapeFactoryTest . Dummy . class . getMethod ( "getValue" ) . getReturnType ( ) ) ; "<AssertPlaceHolder>" . isTrue ( ) ; } getReturnType ( ) { return returnType ; } | org . junit . Assert . assertThat ( isCollectionType ) |
testSetEndBy ( ) { java . util . Collection < org . opengis . temporal . Period > result = instant1 . getEndedBy ( ) ; java . util . Collection < org . opengis . temporal . Period > endedby = null ; ( ( org . geotools . temporal . object . DefaultInstant ) ( instant1 ) ) . setEndBy ( endedby ) ; "<AssertPlaceHolder>" ; } getEndedBy ( ) { return endBy ; } | org . junit . Assert . assertEquals ( instant1 . getEndedBy ( ) , result ) |
withOneAndTwo ( ) { "<AssertPlaceHolder>" ; } convert ( int , int ) { int c = a ^ b ; int ones = 0 ; while ( c > 0 ) { ones ++ ; c &= c - 1 ; } return ones ; } | org . junit . Assert . assertEquals ( 2 , s . convert ( 1 , 2 ) ) |
testOnItemFrameDamageHangingBreakByEntityEvent ( ) { world . bentobox . bentobox . listeners . flags . worldsettings . ItemFrameListener ifl = new world . bentobox . bentobox . listeners . flags . worldsettings . ItemFrameListener ( ) ; org . bukkit . entity . Hanging hanging = mock ( org . bukkit . entity . ItemFrame . class ) ; org . bukkit . event . hanging . HangingBreakByEntityEvent e = new org . bukkit . event . hanging . HangingBreakByEntityEvent ( hanging , world . bentobox . bentobox . listeners . flags . worldsettings . ItemFrameListenerTest . enderman ) ; ifl . onItemFrameDamage ( e ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return cancelled ; } | org . junit . Assert . assertTrue ( e . isCancelled ( ) ) |
createConsumerMultiKeyAuth ( ) { com . t1t . apim . rest . KongConsumer consumer = new com . t1t . apim . rest . KongConsumer ( ) . withUsername ( "someid" ) ; consumer = com . t1t . apim . rest . KongClientIntegrationTest . kongClient . createConsumer ( consumer ) ; com . t1t . apim . rest . KongPluginKeyAuthResponse response = com . t1t . apim . rest . KongClientIntegrationTest . kongClient . createConsumerKeyAuthCredentials ( consumer . getId ( ) , new com . t1t . apim . rest . KongPluginKeyAuthRequest ( ) ) ; com . t1t . apim . rest . KongPluginKeyAuthResponse response2 = com . t1t . apim . rest . KongClientIntegrationTest . kongClient . createConsumerKeyAuthCredentials ( consumer . getId ( ) , new com . t1t . apim . rest . KongPluginKeyAuthRequest ( ) . withKey ( "ABCABCX" ) ) ; com . t1t . apim . rest . KongPluginKeyAuthResponseList responseList = com . t1t . apim . rest . KongClientIntegrationTest . kongClient . getConsumerKeyAuthCredentials ( consumer . getId ( ) ) ; java . lang . String responseKey = responseList . getData ( ) . get ( 0 ) . getKey ( ) ; com . t1t . apim . rest . KongClientIntegrationTest . kongClient . deleteConsumerKeyAuthCredential ( consumer . getId ( ) , response . getId ( ) ) ; com . t1t . apim . rest . KongClientIntegrationTest . kongClient . deleteConsumerKeyAuthCredential ( consumer . getId ( ) , response2 . getId ( ) ) ; com . t1t . apim . rest . KongClientIntegrationTest . kongClient . deleteConsumer ( consumer . getId ( ) ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return key ; } | org . junit . Assert . assertTrue ( ( ( responseKey . equalsIgnoreCase ( response . getKey ( ) ) ) || ( responseKey . equalsIgnoreCase ( response2 . getKey ( ) ) ) ) ) |
flatMapAlreadyDoneMapperThrowExceptionTest ( ) { java . lang . RuntimeException failure = new org . threadly . util . SuppressedStackRuntimeException ( ) ; org . threadly . concurrent . future . ListenableFuture < ? > lf = makeListenableFutureFactory ( ) . makeWithResult ( null ) ; org . threadly . concurrent . future . ListenableFuture < java . lang . Void > mappedLF = lf . flatMap ( ( o ) -> { throw failure ; } ) ; "<AssertPlaceHolder>" ; org . threadly . concurrent . future . ListenableFutureInterfaceTest . verifyFutureFailure ( mappedLF , failure ) ; } isDone ( ) { return futureImp . isDone ( ) ; } | org . junit . Assert . assertTrue ( mappedLF . isDone ( ) ) |
testFetchByPrimaryKeyExisting ( ) { com . liferay . portal . tools . service . builder . test . model . BigDecimalEntry newBigDecimalEntry = addBigDecimalEntry ( ) ; com . liferay . portal . tools . service . builder . test . model . BigDecimalEntry existingBigDecimalEntry = _persistence . fetchByPrimaryKey ( newBigDecimalEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingBigDecimalEntry , newBigDecimalEntry ) |
testByteBufferReuse ( ) { byte [ ] someBytes = org . apache . hadoop . hbase . util . Bytes . toBytes ( "some<sp>bytes" ) ; java . nio . ByteBuffer bb = java . nio . ByteBuffer . allocate ( someBytes . length ) ; java . nio . ByteBuffer bbToReuse = write ( bb , someBytes ) ; bbToReuse = write ( bbToReuse , org . apache . hadoop . hbase . util . Bytes . toBytes ( "less" ) ) ; "<AssertPlaceHolder>" ; } toBytes ( java . nio . ByteBuffer ) { java . nio . ByteBuffer dup = buf . duplicate ( ) ; dup . position ( 0 ) ; return org . apache . hadoop . hbase . util . Bytes . readBytes ( dup ) ; } | org . junit . Assert . assertTrue ( ( bb == bbToReuse ) ) |
testNullToEmptyLongObject ( ) { @ org . apache . commons . lang3 . SuppressWarnings ( "boxing" ) final java . lang . Long [ ] original = new java . lang . Long [ ] { 1L , 2L } ; "<AssertPlaceHolder>" ; } nullToEmpty ( java . lang . Object [ ] ) { if ( org . apache . commons . lang3 . ArrayUtils . isEmpty ( array ) ) { return org . apache . commons . lang3 . ArrayUtils . EMPTY_OBJECT_ARRAY ; } return array ; } | org . junit . Assert . assertArrayEquals ( original , org . apache . commons . lang3 . ArrayUtils . nullToEmpty ( original ) ) |
testNotDuplicatedDisplayedMnemonic ( ) { es . gob . afirma . ui . wizardmultifirmacontrafirma . PanelMultifirmaAccessibilityTest . logger . info ( "testNotDuplicatedDisplayedMnemonic" ) ; try { final es . gob . afirma . ui . wizardmultifirmacontrafirma . PanelMultifirma panelMultifirma = new es . gob . afirma . ui . wizardmultifirmacontrafirma . PanelMultifirma ( null ) ; final java . util . List < java . lang . Integer > keyCodes = new java . util . ArrayList ( ) ; java . util . Set < java . lang . Integer > keyCodesSet = null ; final java . awt . Component [ ] components = panelMultifirma . getComponents ( ) ; for ( final java . awt . Component componentWizard : components ) { if ( componentWizard instanceof javax . swing . JRootPane ) { final java . awt . Component [ ] componentsRootPane = ( ( javax . swing . JRootPane ) ( componentWizard ) ) . getComponents ( ) ; for ( final java . awt . Component componentRootPane : componentsRootPane ) { if ( componentRootPane instanceof javax . swing . JPanel ) { getKeyCodeList ( ( ( javax . swing . JPanel ) ( componentRootPane ) ) , keyCodes ) ; } else if ( componentRootPane instanceof javax . swing . JLayeredPane ) { final java . awt . Component [ ] componentsLayeredPane = ( ( javax . swing . JLayeredPane ) ( componentRootPane ) ) . getComponents ( ) ; for ( final java . awt . Component componentLayeredPane : componentsLayeredPane ) { if ( componentLayeredPane instanceof javax . swing . JPanel ) { getKeyCodeList ( ( ( javax . swing . JPanel ) ( componentLayeredPane ) ) , keyCodes ) ; } } } } } } keyCodesSet = new java . util . HashSet ( keyCodes ) ; "<AssertPlaceHolder>" ; } catch ( final es . gob . afirma . ui . wizardmultifirmacontrafirma . java . awt e ) { } } getKeyCodeList ( javax . swing . JPanel , java . util . List ) { final java . awt . Component [ ] components = panel . getComponents ( ) ; int keyCode = 0 ; for ( int i = 0 ; i < ( components . length ) ; i ++ ) { final java . awt . Component component = panel . getComponent ( i ) ; if ( ! ( component instanceof javax . swing . JPanel ) ) { if ( component instanceof javax . swing . JLabel ) { final javax . swing . JLabel label = ( ( javax . swing . JLabel ) ( component ) ) ; keyCode = label . getDisplayedMnemonic ( ) ; if ( keyCode != 0 ) { keyCodeList . add ( new java . lang . Integer ( keyCode ) ) ; } } else if ( component instanceof javax . swing . JButton ) { final javax . swing . JButton button = ( ( javax . swing . JButton ) ( component ) ) ; keyCode = button . getMnemonic ( ) ; if ( keyCode != 0 ) { keyCodeList . add ( new java . lang . Integer ( keyCode ) ) ; } } else if ( component instanceof javax . swing . JCheckBox ) { final javax . swing . JCheckBox checkBox = ( ( javax . swing . JCheckBox ) ( component ) ) ; keyCode = checkBox . getMnemonic ( ) ; if ( keyCode != 0 ) { keyCodeList . add ( new java . lang . Integer ( keyCode ) ) ; } } } else { getKeyCodeList ( ( ( javax . swing . JPanel ) ( component ) ) , keyCodeList ) ; } } | org . junit . Assert . assertTrue ( ( ( keyCodesSet . size ( ) ) == ( keyCodes . size ( ) ) ) ) |
testFindByEmail ( ) { com . github . emailtohl . building . site . entities . user . User user = userRepository . findByEmail ( u . getEmail ( ) ) ; "<AssertPlaceHolder>" ; } getEmail ( ) { return email ; } | org . junit . Assert . assertEquals ( u . getEmail ( ) , user . getEmail ( ) ) |
externalVars2 ( ) { final javax . xml . parsers . DocumentBuilderFactory factory = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) ; final javax . xml . parsers . DocumentBuilder builder = factory . newDocumentBuilder ( ) ; final org . xml . sax . InputSource source = new org . xml . sax . InputSource ( new org . exist . xquery . StringReader ( org . exist . xquery . XPathQueryTest . strings ) ) ; final org . w3c . dom . Document doc = builder . parse ( source ) ; final org . xmldb . api . modules . XQueryService service = ( ( org . xmldb . api . modules . XQueryService ) ( testCollection . getService ( "XQueryService" , "1.0" ) ) ) ; final org . exist . xquery . CompiledExpression expr = service . compile ( "declare<sp>variable<sp>$local:node<sp>external;<sp>$local:node//string" ) ; service . declareVariable ( "local:node" , doc . getDocumentElement ( ) ) ; final org . exist . xquery . ResourceSet result = service . execute ( expr ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return model . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , result . getSize ( ) ) |
testEqualsWrongObject ( ) { "<AssertPlaceHolder>" ; } toString ( ) { return this . jsonString ; } | org . junit . Assert . assertFalse ( empty . equals ( new java . lang . String ( empty . toString ( ) ) ) ) |
testLocked_NullActiveDocument ( ) { when ( editor . getActiveDocument ( ) ) . thenReturn ( null ) ; when ( document . getCurrentPath ( ) ) . thenReturn ( path ) ; final org . uberfire . ext . editor . commons . client . menu . HasLockSyncMenuStateHelper . LockSyncMenuStateHelper . Operation op = lockSyncHelper . enable ( mock ( org . uberfire . backend . vfs . Path . class ) , true , false ) ; "<AssertPlaceHolder>" ; } enable ( org . uberfire . backend . vfs . Path , boolean , boolean ) { final org . kie . workbench . common . widgets . metadata . client . KieDocument activeDocument = editor . getActiveDocument ( ) ; if ( ( activeDocument == null ) || ( ! ( activeDocument . getCurrentPath ( ) . equals ( file ) ) ) ) { return Operation . VETO ; } return super . enable ( file , isLocked , isLockedByCurrentUser ) ; } | org . junit . Assert . assertEquals ( Operation . VETO , op ) |
testEqualsForNotEqualityOfObjectArrays ( ) { java . lang . Double [ ] a1 = new java . lang . Double [ ] { 1.0 , null , 3.0 , 4.0 } ; java . lang . Double [ ] a2 = new java . lang . Double [ ] { 4.0 , 3.0 , null , 1.0 } ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object , java . lang . Object ) { if ( ( array1 == null ) || ( array2 == null ) ) { return false ; } if ( ( ! ( array1 . getClass ( ) . isArray ( ) ) ) || ( ! ( array2 . getClass ( ) . isArray ( ) ) ) ) { return false ; } if ( array1 == array2 ) { return true ; } int len = java . lang . reflect . Array . getLength ( array1 ) ; if ( len != ( java . lang . reflect . Array . getLength ( array2 ) ) ) { return false ; } for ( int i = 0 ; i < len ; i ++ ) { java . lang . Object value1 = java . lang . reflect . Array . get ( array1 , i ) ; java . lang . Object value2 = java . lang . reflect . Array . get ( array2 , i ) ; if ( value1 == null ) { if ( value2 != null ) { return false ; } continue ; } else if ( value2 == null ) { return false ; } if ( value1 . getClass ( ) . isArray ( ) ) { if ( ! ( cz . zcu . kiv . jop . util . ArrayUtils . equals ( value1 , value2 ) ) ) { return false ; } continue ; } if ( ! ( value1 . equals ( value2 ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertFalse ( cz . zcu . kiv . jop . util . ArrayUtils . equals ( a1 , a2 ) ) |
testAppbaseOverride ( ) { java . lang . System . setProperty ( "appbase_override" , "https://barbaz.com/newapp" ) ; for ( java . lang . String appbase : com . threerings . getdown . data . SysPropsTest . APPBASES ) { "<AssertPlaceHolder>" ; } } overrideAppbase ( java . lang . String ) { java . lang . String appbaseOverride = com . threerings . getdown . data . SysProps . appbaseOverride ( ) ; if ( appbaseOverride != null ) { return appbaseOverride ; } else { return com . threerings . getdown . data . SysProps . replaceDomain ( appbase ) ; } } | org . junit . Assert . assertEquals ( "https://barbaz.com/newapp" , com . threerings . getdown . data . SysProps . overrideAppbase ( appbase ) ) |
getFeatureStateShouldRunWithinGivenNamespaceWhenCurrentNamespaceIsNotDefault ( ) { com . google . appengine . api . NamespaceManager . set ( org . togglz . appengine . repository . FixedNamespaceStateRepositoryTest . ORIGINAL_NAMESPACE ) ; repository = new org . togglz . appengine . repository . FixedNamespaceStateRepository ( org . togglz . appengine . repository . FixedNamespaceStateRepositoryTest . ACME_NAMESPACE , new org . togglz . core . repository . StateRepository ( ) { @ org . togglz . appengine . repository . Override public void setFeatureState ( org . togglz . core . repository . FeatureState featureState ) { } @ org . togglz . appengine . repository . Override public org . togglz . core . repository . FeatureState getFeatureState ( org . togglz . core . Feature feature ) { "<AssertPlaceHolder>" ; return null ; } } ) ; repository . getFeatureState ( org . togglz . appengine . repository . FixedNamespaceStateRepositoryTest . TestFeature . F1 ) ; } get ( ) { java . lang . ClassLoader classLoader = org . togglz . spring . util . ContextClassLoaderApplicationContextHolder . getContextClassLoader ( ) ; while ( classLoader != null ) { org . springframework . context . ApplicationContext applicationContext = org . togglz . spring . util . ContextClassLoaderApplicationContextHolder . contextMap . get ( classLoader ) ; if ( applicationContext != null ) { return applicationContext ; } classLoader = classLoader . getParent ( ) ; } return null ; } | org . junit . Assert . assertEquals ( org . togglz . appengine . repository . FixedNamespaceStateRepositoryTest . ACME_NAMESPACE , com . google . appengine . api . NamespaceManager . get ( ) ) |
testGetStartOffset ( ) { System . out . println ( "getStartOffset" ) ; kg . apc . jmeter . graphs . JRowsSelectorPanel instance = new kg . apc . jmeter . graphs . JRowsSelectorPanel ( new kg . apc . jmeter . graphs . GraphPanel ( ) ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getStartOffset ( ) ; "<AssertPlaceHolder>" ; } getStartOffset ( ) { return startOffset ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testNoParameterMetaData ( ) { java . lang . String query = "SELECT<sp>a_string,<sp>b_string<sp>FROM<sp>atable<sp>WHERE<sp>organization_id='000000000000000'" ; java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) , TestUtil . TEST_PROPERTIES ) ; java . sql . PreparedStatement statement = conn . prepareStatement ( query ) ; java . sql . ParameterMetaData pmd = statement . getParameterMetaData ( ) ; "<AssertPlaceHolder>" ; } getParameterCount ( ) { return params . length ; } | org . junit . Assert . assertEquals ( 0 , pmd . getParameterCount ( ) ) |
nodeName ( ) { final java . lang . String query = "let<sp>$a<sp>:=<sp><a><b>-1</b><b>-2</b></a><sp>" + "for<sp>$b<sp>in<sp>$a/b[fn:node-name(.)<sp>=<sp>xs:QName('b')]<sp>return<sp>$b" ; final org . xmldb . api . base . ResourceSet result = org . exist . xquery . XQueryFunctionsTest . existEmbeddedServer . executeQuery ( query ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return model . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , result . getSize ( ) ) |
getSimilarity ( ) { org . xm . similarity . word . CharBasedSimilarity sim = org . xm . similarity . word . CharBasedSimilarity . getInstance ( ) ; java . lang . String s1 = "" ; java . lang . String s2 = "" ; System . out . println ( ( ( ( ( ( sim . getSimilarity ( s1 , s2 ) ) + "" 0 ) + s1 ) + "," ) + s2 ) ) ; "<AssertPlaceHolder>" ; java . lang . String s3 = "" ; java . lang . String s4 = "" ; System . out . println ( ( ( ( ( ( sim . getSimilarity ( s3 , s4 ) ) + "" 0 ) + s3 ) + "," ) + s4 ) ) ; java . lang . String s5 = "" ; java . lang . String s6 = "" ; System . out . println ( ( ( ( ( ( sim . getSimilarity ( s5 , s6 ) ) + "" 0 ) + s5 ) + "," ) + s6 ) ) ; java . lang . String word1 = "" ; java . lang . String word2 = "" ; double wordpk = sim . getSimilarity ( word1 , word2 ) ; System . out . println ( ( ( ( ( word1 + "<sp><sp>" ) + word2 ) + "<sp>" ) + wordpk ) ) ; } getSimilarity ( java . lang . String , java . lang . String ) { return ( ( getSC ( phrase1 , phrase2 ) ) + ( getSC ( phrase2 , phrase1 ) ) ) / 2.0 ; } | org . junit . Assert . assertTrue ( ( ( sim . getSimilarity ( s1 , s2 ) ) > 0 ) ) |
authenticateUsernamePassword_shouldAuthenticateSuccessful ( ) { org . openengsb . core . api . security . model . Authentication authenticate = passwordAuthenticator . authenticate ( "testuser" , new org . openengsb . connector . usernamepassword . Password ( "password" ) ) ; "<AssertPlaceHolder>" ; } getUsername ( ) { return username ; } | org . junit . Assert . assertThat ( authenticate . getUsername ( ) , org . hamcrest . Matchers . is ( "testuser" ) ) |
holding ( ) { monitor . down = false ; monitor . update ( ) ; monitor . down = true ; monitor . update ( ) ; monitor . down = true ; monitor . update ( ) ; "<AssertPlaceHolder>" ; } monitor ( boolean , boolean , boolean ) { return new com . gemserk . componentsengine . input . ButtonMonitorTest . MonitorMatcher ( isPressed , isReleased , isHolded ) ; } | org . junit . Assert . assertThat ( monitor , com . gemserk . componentsengine . input . ButtonMonitorTest . MonitorMatcher . monitor ( false , false , true ) ) |
testDormandPrince ( ) { double tEnd = test ( 1 ) ; "<AssertPlaceHolder>" ; } test ( int ) { double e = 1.0E-15 ; org . apache . commons . math4 . ode . FirstOrderIntegrator integrator = new org . apache . commons . math4 . ode . nonstiff . DormandPrince853Integrator ( e , 100.0 , 1.0E-7 , 1.0E-7 ) ; org . apache . commons . math4 . analysis . solvers . BaseSecantSolver rootSolver = new org . apache . commons . math4 . analysis . solvers . PegasusSolver ( e , e ) ; org . apache . commons . math4 . ode . events . EventHandler evt1 = new org . apache . commons . math4 . ode . events . OverlappingEventsTest . Event ( 0 , eventType ) ; org . apache . commons . math4 . ode . events . EventHandler evt2 = new org . apache . commons . math4 . ode . events . OverlappingEventsTest . Event ( 1 , eventType ) ; integrator . addEventHandler ( evt1 , 0.1 , e , 999 , rootSolver ) ; integrator . addEventHandler ( evt2 , 0.1 , e , 999 , rootSolver ) ; double t = 0.0 ; double tEnd = 10.0 ; double [ ] y = new double [ ] { 0.0 , 0.0 } ; java . util . List < java . lang . Double > events1 = new java . util . ArrayList ( ) ; java . util . List < java . lang . Double > events2 = new java . util . ArrayList ( ) ; while ( t < tEnd ) { t = integrator . integrate ( this , t , y , tEnd , y ) ; if ( ( y [ 0 ] ) >= 1.0 ) { y [ 0 ] = 0.0 ; events1 . add ( t ) ; } if ( ( y [ 1 ] ) >= 1.0 ) { y [ 1 ] = 0.0 ; events2 . add ( t ) ; } } org . junit . Assert . assertEquals ( org . apache . commons . math4 . ode . events . OverlappingEventsTest . EVENT_TIMES1 . length , events1 . size ( ) ) ; org . junit . Assert . assertEquals ( org . apache . commons . math4 . ode . events . OverlappingEventsTest . EVENT_TIMES2 . length , events2 . size ( ) ) ; for ( int i = 0 ; i < ( org . apache . commons . math4 . ode . events . OverlappingEventsTest . EVENT_TIMES1 . length ) ; i ++ ) { org . junit . Assert . assertEquals ( org . apache . commons . math4 . ode . events . OverlappingEventsTest . EVENT_TIMES1 [ i ] , events1 . get ( i ) , 1.0E-7 ) ; } for ( int i = 0 ; i < ( org . apache . commons . math4 . ode . events . OverlappingEventsTest . EVENT_TIMES2 . length ) ; i ++ ) { org . junit . Assert . assertEquals ( org . apache . commons . math4 . ode . events . OverlappingEventsTest . EVENT_TIMES2 [ i ] , events2 . get ( i ) , 1.0E-7 ) ; } | org . junit . Assert . assertEquals ( 10.0 , tEnd , 1.0E-7 ) |
testSuperSets ( ) { java . lang . Long beginPort = 1000L ; java . lang . Long endPort = 2000L ; storm . mesos . resources . ResourceEntries . RangeResourceEntry newRange ; storm . mesos . resources . ResourceEntries . RangeResourceEntry expectedRange ; existingRange = new storm . mesos . resources . ResourceEntries . RangeResourceEntry ( beginPort , endPort ) ; newRange = new storm . mesos . resources . ResourceEntries . RangeResourceEntry ( ( beginPort - 250 ) , ( endPort + 250 ) ) ; expectedRange = new storm . mesos . resources . ResourceEntries . RangeResourceEntry ( ( beginPort - 250 ) , ( endPort + 250 ) ) ; existingRange . add ( newRange ) ; "<AssertPlaceHolder>" ; } isEqual ( storm . mesos . resources . ResourceEntries$RangeResourceEntry , storm . mesos . resources . ResourceEntries$RangeResourceEntry ) { return ( r1 . getBegin ( ) . equals ( r2 . getBegin ( ) ) ) && ( r1 . getEnd ( ) . equals ( r2 . getEnd ( ) ) ) ; } | org . junit . Assert . assertTrue ( isEqual ( expectedRange , existingRange ) ) |
remove_all_elements_from_the_collection__collection_is_now_empty ( ) { com . artemis . utils . IntBag bag = new com . artemis . utils . IntBag ( 20 ) ; bag . add ( 8008 ) ; bag . add ( 8009 ) ; com . artemis . utils . IntBagIterator intBagIterator = new com . artemis . utils . IntBagIterator ( bag ) ; intBagIterator . next ( ) ; intBagIterator . remove ( ) ; intBagIterator . next ( ) ; intBagIterator . remove ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; } | org . junit . Assert . assertEquals ( 0 , bag . size ( ) ) |
twoMillionEntries ( ) { "<AssertPlaceHolder>" ; int howMany = 2000000 ; int size = ( ( int ) ( mem . capacity ( ) ) ) / howMany ; size -= ( size / 100 ) * 1 ; org . apache . directmemory . memory . MallocTest . logger . info ( ( "payload<sp>size=" + size ) ) ; org . apache . directmemory . memory . MallocTest . logger . info ( ( "entries=" + howMany ) ) ; org . apache . directmemory . memory . MallocTest . logger . info ( "starting..." ) ; long start = java . lang . System . currentTimeMillis ( ) ; byte [ ] payload = new byte [ size ] ; for ( int i = 0 ; i < howMany ; i ++ ) { mem . store ( payload ) ; } org . apache . directmemory . memory . MallocTest . logger . info ( ( ( "...done<sp>in<sp>" + ( ( java . lang . System . currentTimeMillis ( ) ) - start ) ) + "<sp>msecs." ) ) ; } | org . junit . Assert . assertNotNull ( mem ) |
toMillis ( ) { final java . util . Date currentDate = new java . util . Date ( ) ; final java . lang . String formatDate = org . sentilo . common . utils . DateUtils . toStringTimestamp ( currentDate ) ; "<AssertPlaceHolder>" ; } toMillis ( java . lang . String ) { return org . sentilo . common . utils . DateUtils . stringToDate ( timestamp ) . getTime ( ) ; } | org . junit . Assert . assertTrue ( ( ( org . sentilo . common . utils . DateUtils . toMillis ( formatDate ) ) > 0 ) ) |
testIdentityMatrix ( ) { org . jbasics . math . BigDecimalMatrix i3 = org . jbasics . math . BigDecimalMatrix . createIdentityMatrix ( 3 ) ; org . jbasics . math . BigDecimalMatrix expected = org . jbasics . math . BigDecimalMatrix . create ( ) . withRowFromLongs ( 1 , 0 , 0 ) . withRowFromLongs ( 0 , 1 , 0 ) . withRowFromLongs ( 0 , 0 , 1 ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return new org . jbasics . pattern . builder . ReflectionBuilderFactoryTest . TestPair ( this . left , this . right ) ; } | org . junit . Assert . assertEquals ( expected , i3 ) |
test_no_abort ( ) { final java . lang . String cfcSrc = "<cfscript>\r\n" + ( "a<sp>=<sp>23;\r\n" + "</cfscript>" ) ; com . cflint . api . CFLintResult lintresult = cfBugs . scan ( cfcSrc , "test" ) ; "<AssertPlaceHolder>" ; } getIssues ( ) { return cflint . getBugs ( ) . getBugList ( ) ; } | org . junit . Assert . assertEquals ( 0 , lintresult . getIssues ( ) . size ( ) ) |
testIsClosedNull ( ) { com . j256 . ormlite . support . DatabaseConnectionProxy proxy = new com . j256 . ormlite . support . DatabaseConnectionProxy ( null ) ; "<AssertPlaceHolder>" ; proxy . close ( ) ; } isClosed ( ) { if ( ( proxy ) == null ) { return true ; } else { return proxy . isClosed ( ) ; } } | org . junit . Assert . assertTrue ( proxy . isClosed ( ) ) |
testBboxFilterWithEmptyAttributeName ( ) { org . opengis . filter . spatial . BBOX emptyAttNameFilter = ff . bbox ( "" , ( - 10 ) , ( - 10 ) , 10 , 10 , "EPSG:4326" ) ; java . lang . String typeName = org . geotools . arcsde . data . ArcSDEFeatureSourceTest . testData . getTempTableName ( ) ; org . geotools . data . simple . SimpleFeatureSource source ; source = org . geotools . arcsde . data . ArcSDEFeatureSourceTest . store . getFeatureSource ( typeName ) ; org . geotools . data . simple . SimpleFeatureCollection features ; features = source . getFeatures ( emptyAttNameFilter ) ; org . geotools . data . simple . SimpleFeatureIterator iterator = features . features ( ) ; try { "<AssertPlaceHolder>" ; } finally { iterator . close ( ) ; } } hasNext ( ) { if ( ( nextName ) != null ) { return true ; } if ( ( configs ) == null ) { try { java . lang . String fullName = ( com . sun . media . jai . util . Service . prefix ) + ( service . getName ( ) ) ; if ( ( loader ) == null ) configs = java . lang . ClassLoader . getSystemResources ( fullName ) ; else configs = loader . getResources ( fullName ) ; } catch ( java . io . IOException x ) { com . sun . media . jai . util . Service . fail ( service , ( ":<sp>" + x ) ) ; } } while ( ( ( pending ) == null ) || ( ! ( pending . hasNext ( ) ) ) ) { if ( ! ( configs . hasMoreElements ( ) ) ) { return false ; } pending = com . sun . media . jai . util . Service . parse ( service , ( ( java . net . URL ) ( configs . nextElement ( ) ) ) , returned ) ; } nextName = ( ( java . lang . String ) ( pending . next ( ) ) ) ; return true ; } | org . junit . Assert . assertTrue ( iterator . hasNext ( ) ) |
tesTransformReturnsNullIfSpecValidationFails ( ) { java . util . Map < java . lang . String , org . apache . beam . runners . dataflow . worker . counters . NameContext > pcollectionNameMapping = new java . util . HashMap ( ) ; org . apache . beam . runners . dataflow . worker . fn . control . ElementCountMonitoringInfoToCounterUpdateTransformer testObject = new org . apache . beam . runners . dataflow . worker . fn . control . ElementCountMonitoringInfoToCounterUpdateTransformer ( mockSpecValidator , pcollectionNameMapping ) ; java . util . Optional < java . lang . String > error = java . util . Optional . of ( "Error<sp>text" ) ; when ( mockSpecValidator . validate ( any ( ) ) ) . thenReturn ( error ) ; "<AssertPlaceHolder>" ; } transform ( org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo ) { java . util . Optional < java . lang . String > validationResult = validate ( monitoringInfo ) ; if ( validationResult . isPresent ( ) ) { org . apache . beam . runners . dataflow . worker . fn . control . ElementCountMonitoringInfoToCounterUpdateTransformer . LOG . info ( validationResult . get ( ) ) ; return null ; } long value = monitoringInfo . getMetric ( ) . getCounterData ( ) . getInt64Value ( ) ; final java . lang . String pcollectionId = monitoringInfo . getLabelsMap ( ) . get ( MonitoringInfoConstants . Labels . PCOLLECTION ) ; final java . lang . String pcollectionName = pcollectionIdToNameContext . get ( pcollectionId ) . userName ( ) ; java . lang . String counterName = pcollectionName + "-ElementCount" ; com . google . api . services . dataflow . model . NameAndKind name = new com . google . api . services . dataflow . model . NameAndKind ( ) ; name . setName ( counterName ) . setKind ( "SUM" ) ; return new com . google . api . services . dataflow . model . CounterUpdate ( ) . setNameAndKind ( name ) . setCumulative ( true ) . setInteger ( org . apache . beam . runners . dataflow . worker . counters . DataflowCounterUpdateExtractor . longToSplitInt ( value ) ) ; } | org . junit . Assert . assertEquals ( null , testObject . transform ( null ) ) |
selectArraySingle ( ) { com . fasterxml . jackson . databind . JsonNode nodeBook = com . nebhale . jsonpath . internal . component . NODE . get ( "store" ) . get ( "book" ) ; com . fasterxml . jackson . databind . node . ArrayNode expected = com . fasterxml . jackson . databind . node . JsonNodeFactory . instance . arrayNode ( ) ; expected . add ( nodeBook . get ( 0 ) . get ( "title" ) ) ; expected . add ( nodeBook . get ( 1 ) . get ( "title" ) ) ; expected . add ( nodeBook . get ( 2 ) . get ( "title" ) ) ; expected . add ( nodeBook . get ( 3 ) . get ( "title" ) ) ; com . fasterxml . jackson . databind . JsonNode result = new com . nebhale . jsonpath . internal . component . ChildPathComponent ( null , "title" ) . select ( nodeBook ) ; "<AssertPlaceHolder>" ; } select ( com . fasterxml . jackson . databind . JsonNode ) { this . selectCalled = true ; return input ; } | org . junit . Assert . assertEquals ( expected , result ) |
whenUseCacheGauge_thenCorrectGauge ( ) { com . baeldung . metrics . core . Gauge < java . util . List < java . lang . Long > > activeUsersGauge = new com . baeldung . metrics . core . ActiveUsersGauge ( 15 , java . util . concurrent . TimeUnit . MINUTES ) ; java . util . List < java . lang . Long > expected = new java . util . ArrayList < java . lang . Long > ( ) ; expected . add ( 12L ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertThat ( activeUsersGauge . getValue ( ) , org . hamcrest . CoreMatchers . equalTo ( expected ) ) |
testFindbyUsername_notFound ( ) { this . server . expect ( requestTo ( ( ( userServiceUrl ) + "/users/user1" ) ) ) . andRespond ( withStatus ( com . hantsylabs . sample . springmicroservice . auth . NOT_FOUND ) ) ; com . hantsylabs . sample . springmicroservice . auth . User user = this . client . findByUsername ( "user1" ) ; "<AssertPlaceHolder>" ; this . server . verify ( ) ; } findByUsername ( java . lang . String ) { try { org . springframework . http . ResponseEntity < com . hantsylabs . sample . springmicroservice . auth . User > response = this . restTemplate . getForEntity ( ( ( userServiceUrl ) + "/users/{username}" ) , com . hantsylabs . sample . springmicroservice . auth . User . class , username ) ; return response . getBody ( ) ; } catch ( org . springframework . web . client . HttpClientErrorException e ) { if ( ( e . getStatusCode ( ) ) == ( NOT_FOUND ) ) { return null ; } } return null ; } | org . junit . Assert . assertNull ( user ) |
testIsHeadingToDestinationTrue ( ) { empty . setHeadingToDestinationTrue ( true ) ; "<AssertPlaceHolder>" ; } isHeadingToDestinationTrue ( ) { return ( getCharValue ( net . sf . marineapi . nmea . parser . APBParser . HEADING_TO_DEST_TYPE ) ) == 'T' ; } | org . junit . Assert . assertTrue ( empty . isHeadingToDestinationTrue ( ) ) |
deveObterNumeroRECOPIComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItemProduto produto = new com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItemProduto ( ) ; final java . lang . String numeroRECOPI = "13245678901234567890" ; produto . setNumeroRECOPI ( numeroRECOPI ) ; "<AssertPlaceHolder>" ; } getNumeroRECOPI ( ) { return this . numeroRECOPI ; } | org . junit . Assert . assertEquals ( numeroRECOPI , produto . getNumeroRECOPI ( ) ) |
testRandomGenerateCurlyBracketTokens ( ) { final int randomNumberOfTokensBetween0And10 = new java . util . Random ( ) . nextInt ( ( ( com . openpojo . log . utils . MessageFormatterTest . MAX_NUMBER_OF_RANDOM_TOKENS ) + 1 ) ) ; java . lang . String assertString = "" ; for ( int counter = 0 ; counter < randomNumberOfTokensBetween0And10 ; counter ++ ) { assertString += ( ( com . openpojo . log . utils . MessageFormatterTest . GENERATE_CURLY_BRACKET_TOKEN_PREFIX ) + counter ) + ( com . openpojo . log . utils . MessageFormatterTest . GENERATE_CURLY_BRACKET_TOKEN_POSTFIX ) ; } "<AssertPlaceHolder>" ; } generateCurlyBracketTokens ( int ) { java . lang . String generatedTokens = "" ; for ( int counter = 0 ; counter < numberOfTokens ; counter ++ ) { generatedTokens += ( ( com . openpojo . log . utils . MessageFormatter . DEFAULT_FIELDS_FORMAT_PREFIX ) + counter ) + ( com . openpojo . log . utils . MessageFormatter . DEFAULT_FIELDS_FORMAT_POSTFIX ) ; } return generatedTokens ; } | org . junit . Assert . assertEquals ( assertString , com . openpojo . log . utils . MessageFormatter . generateCurlyBracketTokens ( randomNumberOfTokensBetween0And10 ) ) |
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . dynamic . data . lists . model . DDLRecordVersion missingDDLRecordVersion = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; } | org . junit . Assert . assertNull ( missingDDLRecordVersion ) |
whenAddingAServiceAndNewVehicleDoesNotHaveTheCapacity_itShouldReturnFalse ( ) { com . graphhopper . jsprit . core . problem . job . Service service = mock ( com . graphhopper . jsprit . core . problem . job . Service . class ) ; when ( service . getSize ( ) ) . thenReturn ( Capacity . Builder . newInstance ( ) . addDimension ( 0 , 2 ) . build ( ) ) ; com . graphhopper . jsprit . core . problem . Capacity atBeginning = Capacity . Builder . newInstance ( ) . addDimension ( 0 , 1 ) . addDimension ( 1 , 2 ) . addDimension ( 2 , 1 ) . build ( ) ; com . graphhopper . jsprit . core . problem . Capacity atEnd = Capacity . Builder . newInstance ( ) . addDimension ( 0 , 0 ) . addDimension ( 1 , 0 ) . addDimension ( 2 , 0 ) . build ( ) ; com . graphhopper . jsprit . core . problem . solution . route . state . RouteAndActivityStateGetter stateGetter = mock ( com . graphhopper . jsprit . core . problem . solution . route . state . RouteAndActivityStateGetter . class ) ; when ( stateGetter . getRouteState ( route , InternalStates . LOAD_AT_BEGINNING , com . graphhopper . jsprit . core . problem . Capacity . class ) ) . thenReturn ( atBeginning ) ; when ( stateGetter . getRouteState ( route , InternalStates . LOAD_AT_END , com . graphhopper . jsprit . core . problem . Capacity . class ) ) . thenReturn ( atEnd ) ; when ( stateGetter . getRouteState ( route , InternalStates . MAXLOAD , com . graphhopper . jsprit . core . problem . Capacity . class ) ) . thenReturn ( atBeginning ) ; com . graphhopper . jsprit . core . problem . misc . JobInsertionContext iContext = mock ( com . graphhopper . jsprit . core . problem . misc . JobInsertionContext . class ) ; when ( iContext . getJob ( ) ) . thenReturn ( service ) ; when ( iContext . getRoute ( ) ) . thenReturn ( route ) ; com . graphhopper . jsprit . core . problem . vehicle . VehicleType type = mock ( com . graphhopper . jsprit . core . problem . vehicle . VehicleType . class ) ; when ( type . getCapacityDimensions ( ) ) . thenReturn ( Capacity . Builder . newInstance ( ) . addDimension ( 0 , 2 ) . addDimension ( 1 , 1 ) . addDimension ( 2 , 2 ) . build ( ) ) ; com . graphhopper . jsprit . core . problem . vehicle . Vehicle vehicle = mock ( com . graphhopper . jsprit . core . problem . vehicle . Vehicle . class ) ; when ( vehicle . getType ( ) ) . thenReturn ( type ) ; when ( iContext . getNewVehicle ( ) ) . thenReturn ( vehicle ) ; com . graphhopper . jsprit . core . problem . constraint . ServiceLoadRouteLevelConstraint constraint = new com . graphhopper . jsprit . core . problem . constraint . ServiceLoadRouteLevelConstraint ( stateGetter ) ; "<AssertPlaceHolder>" ; } fulfilled ( com . graphhopper . jsprit . core . problem . misc . JobInsertionContext ) { for ( java . lang . String skill : insertionContext . getJob ( ) . getRequiredSkills ( ) . values ( ) ) { if ( ! ( insertionContext . getNewVehicle ( ) . getSkills ( ) . containsSkill ( skill ) ) ) { return false ; } } com . graphhopper . jsprit . core . problem . Skills requiredSkillsForRoute = states . getRouteState ( insertionContext . getRoute ( ) , InternalStates . SKILLS , com . graphhopper . jsprit . core . problem . Skills . class ) ; if ( requiredSkillsForRoute == null ) requiredSkillsForRoute = com . graphhopper . jsprit . core . problem . constraint . HardSkillConstraint . defaultSkills ; for ( java . lang . String skill : requiredSkillsForRoute . values ( ) ) { if ( ! ( insertionContext . getNewVehicle ( ) . getSkills ( ) . containsSkill ( skill ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertFalse ( constraint . fulfilled ( iContext ) ) |
shouldBeAbleToRemoveNodeProperties ( ) { java . util . Map < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; properties . put ( "foo" , "bar" ) ; properties . put ( "number" , 15 ) ; long nodeId = createNode ( properties ) ; org . neo4j . server . rest . web . DatabaseActionsTest . actions . removeAllNodeProperties ( nodeId ) ; try ( org . neo4j . graphdb . Transaction tx = org . neo4j . server . rest . web . DatabaseActionsTest . database . getGraph ( ) . beginTx ( ) ) { org . neo4j . graphdb . Node node = org . neo4j . server . rest . web . DatabaseActionsTest . database . getGraph ( ) . getNodeById ( nodeId ) ; "<AssertPlaceHolder>" ; tx . success ( ) ; } } getPropertyKeys ( ) { assertInUnterminatedTransaction ( ) ; return singleton ( propertyKey ) ; } | org . junit . Assert . assertFalse ( node . getPropertyKeys ( ) . iterator ( ) . hasNext ( ) ) |
testDeleteOpRequireAuth ( ) { for ( org . apache . hadoop . hdfs . web . HttpOpParam . Op op : DeleteOpParam . Op . values ( ) ) { "<AssertPlaceHolder>" ; } } getRequireAuth ( ) { return false ; } | org . junit . Assert . assertFalse ( op . getRequireAuth ( ) ) |
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . dynamic . data . lists . model . DDLRecordSet . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "recordSetId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . dynamic . data . lists . model . DDLRecordSet > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testValueValid ( ) { java . util . Set < javax . validation . ConstraintViolation < org . kie . workbench . common . stunner . cm . definition . property . subprocess . IsCase > > violations = this . validator . validate ( tested ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return violations . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( violations . isEmpty ( ) ) |
testIsReadyToPublishTrue ( ) { com . amazonaws . mobileconnectors . iot . MockMqttClient mockClient = new com . amazonaws . mobileconnectors . iot . MockMqttClient ( ) ; com . amazonaws . mobileconnectors . iot . AWSIotMqttManager testClient = new com . amazonaws . mobileconnectors . iot . AWSIotMqttManager ( "test-client" , com . amazonaws . regions . Region . getRegion ( Regions . US_EAST_1 ) , com . amazonaws . mobileconnectors . iot . AWSIotMqttManagerTest . TEST_ENDPOINT_PREFIX ) ; testClient . setMqttClient ( mockClient ) ; com . amazonaws . mobileconnectors . iot . AWSIotMqttManagerTest . TestClientStatusCallback csb = new com . amazonaws . mobileconnectors . iot . AWSIotMqttManagerTest . TestClientStatusCallback ( ) ; java . security . KeyStore testKeystore = com . amazonaws . mobileconnectors . iot . AWSIotKeystoreHelper . getIotKeystore ( com . amazonaws . mobileconnectors . iot . AWSIotMqttManagerTest . CERT_ID , com . amazonaws . mobileconnectors . iot . AWSIotMqttManagerTest . KEYSTORE_PATH , com . amazonaws . mobileconnectors . iot . AWSIotMqttManagerTest . KEYSTORE_NAME , com . amazonaws . mobileconnectors . iot . AWSIotMqttManagerTest . KEYSTORE_PASSWORD ) ; testClient . connect ( testKeystore , csb ) ; mockClient . mockConnectSuccess ( ) ; "<AssertPlaceHolder>" ; } isReadyToPublish ( ) { return ( ( mqttClient ) != null ) && ( mqttClient . isConnected ( ) ) ; } | org . junit . Assert . assertTrue ( testClient . isReadyToPublish ( ) ) |
noErrorsOrWarnings ( ) { org . eclipse . core . resources . IMarker [ ] markers = testProject . findMarkers ( org . eclipse . pde . ds . internal . annotations . tests . DS_PROBLEM_MARKER , true , org . eclipse . core . resources . IResource . DEPTH_INFINITE ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 0 , markers . length ) |
testFindBatchJob ( ) { org . slc . sli . ingestion . model . NewBatchJob job = new org . slc . sli . ingestion . model . NewBatchJob ( org . slc . sli . ingestion . model . da . BatchJobMongoDATest . BATCHJOBID , "SLI" ) ; when ( batchJobMongoTemplate . findOne ( ( ( org . springframework . data . mongodb . core . query . Query ) ( any ( ) ) ) , eq ( org . slc . sli . ingestion . model . NewBatchJob . class ) ) ) . thenReturn ( job ) ; org . slc . sli . ingestion . model . NewBatchJob resultJob = mockBatchJobMongoDA . findBatchJobById ( org . slc . sli . ingestion . model . da . BatchJobMongoDATest . BATCHJOBID ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( resultJob . getId ( ) , org . slc . sli . ingestion . model . da . BatchJobMongoDATest . BATCHJOBID ) |
testGetExportModelCount ( ) { if ( ! ( isGetExportModelCountTested ( ) ) ) { return ; } initContext ( ) ; addStagedModels ( ) ; portletDataContext . setEndDate ( getEndDate ( ) ) ; portletDataHandler . prepareManifestSummary ( portletDataContext ) ; com . liferay . exportimport . kernel . lar . ManifestSummary manifestSummary = portletDataContext . getManifestSummary ( ) ; "<AssertPlaceHolder>" ; } getExportModelCount ( com . liferay . exportimport . kernel . lar . ManifestSummary ) { long totalModelCount = - 1 ; for ( com . liferay . exportimport . kernel . lar . StagedModelType stagedModelType : getStagedModelTypes ( ) ) { long modelCount = manifestSummary . getModelAdditionCount ( stagedModelType ) ; if ( modelCount == ( - 1 ) ) { continue ; } if ( totalModelCount == ( - 1 ) ) { totalModelCount = modelCount ; } else { totalModelCount += modelCount ; } } return totalModelCount ; } | org . junit . Assert . assertEquals ( getExportModelCount ( ) , portletDataHandler . getExportModelCount ( manifestSummary ) ) |
testValidateUrl_IPV6_3 ( ) { boolean result = org . oscm . validator . ADMValidator . isUrl ( "http://[::FDA0:1:1234]:8080" ) ; "<AssertPlaceHolder>" ; } isUrl ( java . lang . String ) { return org . oscm . validator . ADMValidator . URL_VALIDATOR . isValid ( value ) ; } | org . junit . Assert . assertTrue ( result ) |
testRewritePomExtension ( ) { java . util . List < org . apache . maven . project . MavenProject > reactorProjects = createReactorProjects ( "internal-snapshot-extension" ) ; org . apache . maven . shared . release . config . ReleaseDescriptorBuilder builder = createDefaultConfiguration ( reactorProjects , "internal-snapshot-extension" ) ; phase . execute ( org . apache . maven . shared . release . config . ReleaseUtils . buildReleaseDescriptor ( builder ) , new org . apache . maven . shared . release . env . DefaultReleaseEnvironment ( ) , reactorProjects ) ; "<AssertPlaceHolder>" ; } comparePomFiles ( java . util . List ) { return comparePomFiles ( reactorProjects , true ) ; } | org . junit . Assert . assertTrue ( comparePomFiles ( reactorProjects ) ) |
testUtf8FolderNameDelete ( ) { testWithHandler ( new com . sun . mail . imap . IMAPFolderTest . IMAPTest ( ) { @ com . sun . mail . imap . Override public void test ( javax . mail . Store store , com . sun . mail . imap . IMAPHandler handler ) throws java . io . IOException , javax . mail . MessagingException { javax . mail . Folder test = store . getFolder ( com . sun . mail . imap . IMAPFolderTest . utf8Folder ) ; "<AssertPlaceHolder>" ; } } , new com . sun . mail . imap . IMAPFolderTest . IMAPUtf8Handler ( ) { @ com . sun . mail . imap . Override public void delete ( java . lang . String line ) throws java . io . IOException { java . util . StringTokenizer st = new java . util . StringTokenizer ( line ) ; st . nextToken ( ) ; st . nextToken ( ) ; java . lang . String name = com . sun . mail . imap . IMAPFolderTest . unquote ( st . nextToken ( ) ) ; if ( name . equals ( com . sun . mail . imap . IMAPFolderTest . utf8Folder ) ) ok ( ) ; else no ( "wrong<sp>name" ) ; } } ) ; } delete ( File ) { if ( tmp != null ) { try { if ( ( ! ( tmp . delete ( ) ) ) && ( tmp . exists ( ) ) ) { try { try { tmp . deleteOnExit ( ) ; } catch ( final java . lang . LinkageError shutdown ) { throw new java . lang . RuntimeException ( shutdown ) ; } } catch ( final java . lang . RuntimeException shutdown ) { if ( ! ( tmp . delete ( ) ) ) { super . error ( tmp . getAbsolutePath ( ) , shutdown , ErrorManager . CLOSE_FAILURE ) ; } } } } catch ( java . lang . SecurityException SE ) { super . error ( tmp . toString ( ) , SE , ErrorManager . CLOSE_FAILURE ) ; } } } | org . junit . Assert . assertTrue ( test . delete ( false ) ) |
padStartLengthNegative ( ) { final java . lang . String s = "Norman<sp>the<sp>pike" ; final java . lang . String padded = org . scijava . util . StringUtils . padStart ( s , ( - 1 ) , '~' ) ; "<AssertPlaceHolder>" ; } padStart ( java . lang . String , int , char ) { if ( s == null ) { return null ; } final java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; final int padding = length - ( s . length ( ) ) ; for ( int i = 0 ; i < padding ; i ++ ) { builder . append ( padChar ) ; } return builder . append ( s ) . toString ( ) ; } | org . junit . Assert . assertEquals ( s , padded ) |
testSoftBoVW2 ( ) { final org . openimaj . image . feature . local . aggregate . SoftBagOfVisualWords < byte [ ] , float [ ] > bovw = new org . openimaj . image . feature . local . aggregate . SoftBagOfVisualWords < byte [ ] , float [ ] > ( new org . openimaj . ml . clustering . assignment . soft . ByteKNNAssigner ( centroids , false , 5 ) ) ; final org . openimaj . feature . SparseDoubleFV vector = bovw . aggregate ( features ) ; "<AssertPlaceHolder>" ; } length ( ) { return this . length ; } | org . junit . Assert . assertEquals ( 10 , vector . length ( ) ) |
testConceptNameFailoverToLocaleClientWhenLocaleDefaultPresent ( ) { org . openmrs . Concept concept = new org . openmrs . Concept ( ) ; org . openmrs . ConceptName en = makePreferred ( "name<sp>en" , ClientConceptNamer . DEFAULT ) ; org . openmrs . ConceptName enClient = makePreferred ( "name<sp>en<sp>client" , ClientConceptNamer . DEFAULT_CLIENT ) ; org . openmrs . ConceptName fr = makePreferred ( "name<sp>fr" , new java . util . Locale ( "fr" ) ) ; org . openmrs . ConceptName frClient = makePreferred ( "name<sp>fr<sp>client" , new java . util . Locale . Builder ( ) . setLanguage ( "fr" ) . setRegion ( ClientConceptNamer . CLIENT_REGION ) . setVariant ( ClientConceptNamer . VARIANT ) . build ( ) ) ; concept . setNames ( java . util . Arrays . asList ( en , enClient , fr , frClient ) ) ; java . lang . String name = new org . openmrs . projectbuendia . ClientConceptNamer ( new java . util . Locale ( "fr" ) ) . getClientName ( concept ) ; "<AssertPlaceHolder>" ; } getClientName ( org . openmrs . Concept ) { java . lang . String variant = locale . getVariant ( ) ; java . util . Locale . Builder builder = new java . util . Locale . Builder ( ) . setLocale ( locale ) ; if ( ! ( org . openmrs . projectbuendia . ClientConceptNamer . VARIANT . equals ( variant ) ) ) { builder . setVariant ( org . openmrs . projectbuendia . ClientConceptNamer . VARIANT ) ; if ( "" . equals ( locale . getCountry ( ) ) ) { builder . setRegion ( org . openmrs . projectbuendia . ClientConceptNamer . CLIENT_REGION ) ; } } java . lang . String name = getPreferredStringInLocaleOrNull ( concept , builder . build ( ) ) ; if ( name != null ) return name ; name = getPreferredStringInLocaleOrNull ( concept , locale ) ; if ( name != null ) return name ; if ( "" . equals ( locale . getCountry ( ) ) ) { name = getPreferredStringInLocaleOrNull ( concept , new java . util . Locale ( locale . getLanguage ( ) ) ) ; if ( name != null ) return name ; } name = getPreferredStringInLocaleOrNull ( concept , org . openmrs . projectbuendia . ClientConceptNamer . DEFAULT_CLIENT ) ; if ( name != null ) return name ; name = getPreferredStringInLocaleOrNull ( concept , org . openmrs . projectbuendia . ClientConceptNamer . DEFAULT ) ; if ( name != null ) return name ; org . openmrs . ConceptName defaultName = concept . getName ( ) ; if ( defaultName == null ) { org . openmrs . projectbuendia . ClientConceptNamer . log . error ( ( ( ( "No<sp>name<sp>found<sp>for<sp>concept:<sp>uuid=" + ( concept . getUuid ( ) ) ) + ",<sp>id=" ) + ( concept . getId ( ) ) ) ) ; return ( "[Concept<sp>" + ( concept . getId ( ) ) ) + "]" ; } return defaultName . getName ( ) ; } | org . junit . Assert . assertEquals ( "name<sp>fr<sp>client" , name ) |
jsonParameter_notEqual_class ( ) { org . oscm . json . JsonParameterOption jsonParamOpt = givenJsonParameterOption ( ) ; org . oscm . json . JsonParameter jsonParam = givenJsonParameter ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ( o == null ) || ( ( org . oscm . converter . utils . Pair . getClass ( ) ) != ( o . getClass ( ) ) ) ) { return false ; } org . oscm . converter . utils . Pair < ? , ? > pair = ( ( org . oscm . converter . utils . Pair < ? , ? > ) ( o ) ) ; return ( first . equals ( pair . first ) ) && ( second . equals ( pair . second ) ) ; } | org . junit . Assert . assertFalse ( jsonParam . equals ( jsonParamOpt ) ) |
testGetStatementBuilderFactoryforJoinSelect ( ) { org . apache . olingo . odata2 . api . uri . info . GetEntitySetUriInfo getEntitySetView = getUriInfo ( ) ; org . apache . olingo . odata2 . jpa . processor . api . jpql . JPQLContext selectContext = org . apache . olingo . odata2 . jpa . processor . api . jpql . JPQLContext . createBuilder ( JPQLContextType . JOIN , getEntitySetView ) . build ( ) ; org . apache . olingo . odata2 . jpa . processor . api . jpql . JPQLStatement . JPQLStatementBuilder statementBuilder = new org . apache . olingo . odata2 . jpa . processor . core . factory . ODataJPAFactoryImpl ( ) . getJPQLBuilderFactory ( ) . getStatementBuilder ( selectContext ) ; "<AssertPlaceHolder>" ; } getStatementBuilder ( org . apache . olingo . odata2 . jpa . processor . api . jpql . JPQLContextView ) { org . apache . olingo . odata2 . jpa . processor . api . jpql . JPQLStatement . JPQLStatementBuilder builder = null ; switch ( context . getType ( ) ) { case SELECT : case SELECT_COUNT : builder = new org . apache . olingo . odata2 . jpa . processor . core . jpql . JPQLSelectStatementBuilder ( context ) ; break ; case SELECT_SINGLE : builder = new org . apache . olingo . odata2 . jpa . processor . core . jpql . JPQLSelectSingleStatementBuilder ( context ) ; break ; case JOIN : case JOIN_COUNT : builder = new org . apache . olingo . odata2 . jpa . processor . core . jpql . JPQLJoinStatementBuilder ( context ) ; break ; case JOIN_SINGLE : builder = new org . apache . olingo . odata2 . jpa . processor . core . jpql . JPQLJoinSelectSingleStatementBuilder ( context ) ; break ; default : break ; } return builder ; } | org . junit . Assert . assertTrue ( ( statementBuilder instanceof org . apache . olingo . odata2 . jpa . processor . core . jpql . JPQLJoinStatementBuilder ) ) |
defaultSIASearch ( ) { org . purl . wf4ever . astrotaverna . vorepo . VORepository repo = new org . purl . wf4ever . astrotaverna . vorepo . VORepository ( ) ; java . util . List < net . ivoa . xml . voresource . v1 . Service > resources = repo . resourceSearch ( net . ivoa . xml . sia . v1 . SimpleImageAccess . class ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( ( ( resources . size ( ) ) > 20 ) ) |
testGetExtraHiddenFieldsNoProcessors ( ) { compositeRequestDataValueProcessor = new org . terasoluna . gfw . web . mvc . support . CompositeRequestDataValueProcessor ( ) ; java . util . Map < java . lang . String , java . lang . String > map = compositeRequestDataValueProcessor . getExtraHiddenFields ( request ) ; "<AssertPlaceHolder>" ; } getExtraHiddenFields ( javax . servlet . http . HttpServletRequest ) { return null ; } | org . junit . Assert . assertNotNull ( map ) |
make ( ) { this . deploy ( new java . io . File ( getOverridableFile ( "p2artifacts" ) , "nexus-p2-its-bundle/pom.xml" ) , "com.sonatype.nexus.plugin.p2" , "com.sonatype.nexus.p2.its.bundle" , "1.0.0" , "pom" ) ; deploy ( new java . io . File ( getOverridableFile ( "p2artifacts" ) , "nexus-p2-its-bundle/com.sonatype.nexus.p2.its.bundle_1.0.0.jar" ) , "com.sonatype.nexus.plugin.p2" , "com.sonatype.nexus.p2.its.bundle" , "1.0.0" , "jar" ) ; org . sonatype . nexus . test . utils . TaskScheduleUtil . waitForAllTasksToStop ( ) ; final java . io . File tempFile = java . io . File . createTempFile ( "p2-metadata" , ".properties" ) ; try { java . net . URL url = new java . net . URL ( ( ( getNexusTestRepoUrl ( ) ) + ( org . sonatype . tycho . p2 . facade . internal . DefaultTychoRepositoryIndex . INDEX_RELPATH ) ) ) ; downloadFile ( url , tempFile . getAbsolutePath ( ) ) ; org . sonatype . tycho . p2 . facade . internal . DefaultTychoRepositoryIndex index = new com . sonatype . nexus . proxy . p2 . its . NXCM856MetadataLocation . NXCM856MetadataLocationIT . TestTychoRepositoryIndex ( tempFile ) ; java . util . List < org . sonatype . tycho . p2 . facade . internal . GAV > projectGAVs = index . getProjectGAVs ( ) ; for ( org . sonatype . tycho . p2 . facade . internal . GAV gav : projectGAVs ) { System . err . println ( gav . toExternalForm ( ) ) ; } "<AssertPlaceHolder>" ; } finally { tempFile . delete ( ) ; } } | org . junit . Assert . assertTrue ( projectGAVs . contains ( new org . sonatype . tycho . p2 . facade . internal . GAV ( "com.sonatype.nexus.plugin.p2" , "com.sonatype.nexus.p2.its.bundle" , "1.0.0" ) ) ) |
sizeEnforcingInputStream_markReset ( ) { java . io . ByteArrayInputStream in = new java . io . ByteArrayInputStream ( "foo" . getBytes ( Charsets . UTF_8 ) ) ; io . grpc . internal . MessageDeframer . SizeEnforcingInputStream stream = new io . grpc . internal . MessageDeframer . SizeEnforcingInputStream ( in , 3 , statsTraceCtx ) ; stream . skip ( 1 ) ; stream . mark ( 10 ) ; stream . skip ( 2 ) ; stream . reset ( ) ; long skipped = stream . skip ( 2 ) ; "<AssertPlaceHolder>" ; stream . close ( ) ; io . grpc . internal . MessageDeframerTest . checkSizeEnforcingInputStreamStats ( tracer , 3 ) ; } reset ( ) { hpackReader = newReader ( bytesIn ) ; hpackWriter = new io . grpc . okhttp . internal . framed . Hpack . Writer ( bytesOut ) ; } | org . junit . Assert . assertEquals ( 2 , skipped ) |
testExists_False ( ) { initializeExpectedBucket ( 4 ) ; com . google . cloud . storage . Storage [ ] expectedOptions = new Storage . BucketGetOption [ ] { Storage . BucketGetOption . fields ( ) } ; expect ( storage . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( storage . get ( com . google . cloud . storage . BucketTest . BUCKET_INFO . getName ( ) , expectedOptions ) ) . andReturn ( null ) ; replay ( storage ) ; initializeBucket ( ) ; "<AssertPlaceHolder>" ; } exists ( ) { boolean exists = bucket . exists ( ) ; if ( exists ) { } else { } return exists ; } | org . junit . Assert . assertFalse ( bucket . exists ( ) ) |
normalizeSpaces_shouldKeepSingleSpaces ( ) { final java . lang . String input = "a<sp>b<sp>c" ; final java . lang . String value = org . erlide . util . StringUtils . normalizeSpaces ( input ) ; final java . lang . String expected = "a<sp>b<sp>c" ; "<AssertPlaceHolder>" ; } normalizeSpaces ( java . lang . String ) { return string . replaceAll ( "[\t\n\r<sp>]+" , "<sp>" ) ; } | org . junit . Assert . assertEquals ( value , expected ) |
testCreateSearchIndexValidation ( ) { org . finra . herd . model . api . xml . SearchIndexValidationCreateRequest searchIndexValidationCreateRequest = new org . finra . herd . model . api . xml . SearchIndexValidationCreateRequest ( new org . finra . herd . model . api . xml . SearchIndexKey ( SEARCH_INDEX_NAME ) , PERFORM_FULL_SEARCH_INDEX_VALIDATION ) ; org . finra . herd . model . api . xml . SearchIndexValidation searchIndexValidation = new org . finra . herd . model . api . xml . SearchIndexValidation ( new org . finra . herd . model . api . xml . SearchIndexKey ( SEARCH_INDEX_NAME ) , SEARCH_INDEX_STATISTICS_CREATION_DATE , false , false , false ) ; when ( searchIndexValidationService . createSearchIndexValidation ( searchIndexValidationCreateRequest ) ) . thenReturn ( searchIndexValidation ) ; org . finra . herd . model . api . xml . SearchIndexValidation response = searchIndexValidationRestController . createSearchIndexValidation ( searchIndexValidationCreateRequest ) ; verify ( searchIndexValidationService , times ( 1 ) ) . createSearchIndexValidation ( searchIndexValidationCreateRequest ) ; response . setValidateStartTime ( org . finra . herd . rest . SEARCH_INDEX_STATISTICS_CREATION_DATE ) ; "<AssertPlaceHolder>" ; } createSearchIndexValidation ( org . finra . herd . model . api . xml . SearchIndexValidationCreateRequest ) { validateSearchIndexValidationRequest ( request ) ; org . finra . herd . model . jpa . SearchIndexEntity searchIndexEntity = searchIndexDaoHelper . getSearchIndexEntity ( request . getSearchIndexKey ( ) ) ; java . lang . String searchIndexType = searchIndexEntity . getType ( ) . getCode ( ) ; java . lang . String indexName = request . getSearchIndexKey ( ) . getSearchIndexName ( ) ; boolean sizeCheck = false ; boolean spotCheckPercentage = false ; boolean spotCheckMostRecent = false ; if ( SearchIndexTypeEntity . SearchIndexTypes . BUS_OBJCT_DFNTN . name ( ) . equalsIgnoreCase ( searchIndexType ) ) { if ( org . apache . commons . lang . BooleanUtils . isTrue ( request . isPerformFullSearchIndexValidation ( ) ) ) { businessObjectDefinitionService . indexValidateAllBusinessObjectDefinitions ( indexName ) ; } sizeCheck = businessObjectDefinitionService . indexSizeCheckValidationBusinessObjectDefinitions ( indexName ) ; spotCheckPercentage = businessObjectDefinitionService . indexSpotCheckPercentageValidationBusinessObjectDefinitions ( indexName ) ; spotCheckMostRecent = businessObjectDefinitionService . indexSpotCheckMostRecentValidationBusinessObjectDefinitions ( indexName ) ; } else if ( SearchIndexTypeEntity . SearchIndexTypes . TAG . name ( ) . equalsIgnoreCase ( searchIndexType ) ) { if ( org . apache . commons . lang . BooleanUtils . isTrue ( request . isPerformFullSearchIndexValidation ( ) ) ) { tagService . indexValidateAllTags ( indexName ) ; } sizeCheck = tagService . indexSizeCheckValidationTags ( indexName ) ; spotCheckPercentage = tagService . indexSpotCheckPercentageValidationTags ( indexName ) ; spotCheckMostRecent = tagService . indexSpotCheckMostRecentValidationTags ( indexName ) ; } return new org . finra . herd . model . api . xml . SearchIndexValidation ( request . getSearchIndexKey ( ) , getXMLGregorianCalendarValue ( new java . util . Date ( ) ) , sizeCheck , spotCheckPercentage , spotCheckMostRecent ) ; } | org . junit . Assert . assertEquals ( searchIndexValidation , response ) |
testCleanPasswordFromRequestStringMatchedAtEndSingleQuote ( ) { final java . lang . String input = "'username=foo&password=bar'" ; final java . lang . String expected = "'username=foo'" ; final java . lang . String result = com . cloud . utils . StringUtils . cleanString ( input ) ; "<AssertPlaceHolder>" ; } cleanString ( java . lang . String ) { java . lang . String cleanResult = "" ; if ( stringToClean != null ) { cleanResult = com . cloud . utils . StringUtils . REGEX_PASSWORD_QUERYSTRING . matcher ( stringToClean ) . replaceAll ( "" ) ; cleanResult = com . cloud . utils . StringUtils . REGEX_PASSWORD_JSON . matcher ( cleanResult ) . replaceAll ( "" ) ; final java . util . regex . Matcher detailsMatcher = com . cloud . utils . StringUtils . REGEX_PASSWORD_DETAILS . matcher ( cleanResult ) ; while ( detailsMatcher . find ( ) ) { final java . util . regex . Matcher detailsIndexMatcher = com . cloud . utils . StringUtils . REGEX_PASSWORD_DETAILS_INDEX . matcher ( detailsMatcher . group ( ) ) ; if ( detailsIndexMatcher . find ( ) ) { cleanResult = com . cloud . utils . StringUtils . cleanDetails ( cleanResult , detailsIndexMatcher . group ( ) ) ; } } } return cleanResult ; } | org . junit . Assert . assertEquals ( result , expected ) |
testHealthy ( ) { java . lang . String string0 = com . examples . with . different . packagename . BMICalculator . calculateBMICategory ( ( - 1.0 ) , 18.5 ) ; "<AssertPlaceHolder>" ; } calculateBMICategory ( double , double ) { double bmi = weight / ( height * height ) ; if ( bmi < 18.5 ) { return "underweight" ; } else if ( bmi < 25 ) { return "healthy" ; } else if ( bmi < 30 ) { return "overweight" ; } else if ( bmi < 40 ) { return "obese" ; } else { return "very<sp>obese" ; } } | org . junit . Assert . assertEquals ( "healthy" , string0 ) |
testDashesInClassPath_MSHARED_134 ( ) { java . io . File jarFile = new java . io . File ( "target/test/dummyWithDashes.jar" ) ; org . codehaus . plexus . archiver . jar . JarArchiver jarArchiver = getCleanJarArchiver ( jarFile ) ; org . apache . maven . archiver . MavenArchiver archiver = getMavenArchiver ( jarArchiver ) ; org . apache . maven . execution . MavenSession session = getDummySession ( ) ; org . apache . maven . project . MavenProject project = getDummyProject ( ) ; java . util . Set < org . apache . maven . artifact . Artifact > artifacts = getArtifacts ( getMockArtifact1 ( ) , getArtifactWithDot ( ) , getMockArtifact2 ( ) , getMockArtifact3 ( ) ) ; project . setArtifacts ( artifacts ) ; org . apache . maven . archiver . MavenArchiveConfiguration config = new org . apache . maven . archiver . MavenArchiveConfiguration ( ) ; config . setForced ( false ) ; final org . apache . maven . archiver . ManifestConfiguration mftConfig = config . getManifest ( ) ; mftConfig . setMainClass ( "org.apache.maven.Foo" ) ; mftConfig . setAddClasspath ( true ) ; mftConfig . setAddExtensions ( true ) ; mftConfig . setClasspathPrefix ( "./lib/" ) ; archiver . createArchive ( session , project , config ) ; "<AssertPlaceHolder>" ; } createArchive ( org . apache . maven . execution . MavenSession , org . apache . maven . project . MavenProject , org . apache . maven . archiver . MavenArchiveConfiguration ) { org . apache . maven . project . MavenProject workingProject = null ; workingProject = ( ( org . apache . maven . project . MavenProject ) ( project . clone ( ) ) ) ; boolean forced = archiveConfiguration . isForced ( ) ; if ( archiveConfiguration . isAddMavenDescriptor ( ) ) { if ( workingProject . getArtifact ( ) . isSnapshot ( ) ) { workingProject . setVersion ( workingProject . getArtifact ( ) . getVersion ( ) ) ; } java . lang . String groupId = workingProject . getGroupId ( ) ; java . lang . String artifactId = workingProject . getArtifactId ( ) ; archiver . addFile ( project . getFile ( ) , ( ( ( ( "META-INF/maven/" + groupId ) + "/" ) + artifactId ) + "/pom.xml" ) ) ; java . io . File customPomPropertiesFile = archiveConfiguration . getPomPropertiesFile ( ) ; java . io . File dir = new java . io . File ( workingProject . getBuild ( ) . getDirectory ( ) , "maven-archiver" ) ; java . io . File pomPropertiesFile = new java . io . File ( dir , "pom.properties" ) ; new org . apache . maven . archiver . PomPropertiesUtil ( ) . createPomProperties ( session , workingProject , archiver , customPomPropertiesFile , pomPropertiesFile , forced ) ; } java . io . File manifestFile = archiveConfiguration . getManifestFile ( ) ; if ( manifestFile != null ) { archiver . setManifest ( manifestFile ) ; } org . codehaus . plexus . archiver . jar . Manifest manifest = getManifest ( session , workingProject , archiveConfiguration ) ; archiver . addConfiguredManifest ( manifest ) ; archiver . setCompress ( archiveConfiguration . isCompress ( ) ) ; archiver . setRecompressAddedZips ( archiveConfiguration . isRecompressAddedZips ( ) ) ; archiver . setIndex ( archiveConfiguration . isIndex ( ) ) ; archiver . setDestFile ( archiveFile ) ; if ( archiveConfiguration . getManifest ( ) . isAddClasspath ( ) ) { java . util . List < java . lang . String > artifacts = project . getRuntimeClasspathElements ( ) ; for ( java . lang . String artifact : artifacts ) { java . io . File f = new java . io . File ( artifact ) ; archiver . addConfiguredIndexJars ( f ) ; } } archiver . setForced ( forced ) ; if ( ( ! ( archiveConfiguration . isForced ( ) ) ) && ( archiver . isSupportingForced ( ) ) ) { } archiver . createArchive ( ) ; } | org . junit . Assert . assertTrue ( jarFile . exists ( ) ) |
testForTinyIntArray ( ) { java . lang . Byte [ ] byteArr = new java . lang . Byte [ 2 ] ; byteArr [ 0 ] = 1 ; byteArr [ 1 ] = 2 ; com . salesforce . phoenix . schema . PhoenixArray arr = com . salesforce . phoenix . schema . PArrayDataType . instantiatePhoenixArray ( PDataType . TINYINT , byteArr ) ; PDataType . TINYINT_ARRAY . toObject ( arr , PDataType . TINYINT_ARRAY ) ; byte [ ] bytes = PDataType . TINYINT_ARRAY . toBytes ( arr ) ; com . salesforce . phoenix . schema . PhoenixArray resultArr = ( ( com . salesforce . phoenix . schema . PhoenixArray ) ( PDataType . TINYINT_ARRAY . toObject ( bytes , 0 , bytes . length ) ) ) ; "<AssertPlaceHolder>" ; } toObject ( java . lang . Object , com . salesforce . phoenix . schema . PDataType , com . salesforce . phoenix . schema . ColumnModifier ) { return toObject ( object , actualType ) ; } | org . junit . Assert . assertEquals ( arr , resultArr ) |
shouldConsiderTwoEquivalentObjectsEqual ( ) { com . mpatric . mp3agic . ID3v2TextFrameData frameData1 = new com . mpatric . mp3agic . ID3v2TextFrameData ( false , new com . mpatric . mp3agic . EncodedText ( EncodedText . TEXT_ENCODING_ISO_8859_1 , com . mpatric . mp3agic . ID3v2TextFrameDataTest . TEST_TEXT ) ) ; com . mpatric . mp3agic . ID3v2TextFrameData frameData2 = new com . mpatric . mp3agic . ID3v2TextFrameData ( false , new com . mpatric . mp3agic . EncodedText ( EncodedText . TEXT_ENCODING_ISO_8859_1 , com . mpatric . mp3agic . ID3v2TextFrameDataTest . TEST_TEXT ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( frameData1 , frameData2 ) |
fromStringInputNotNullOutputNotNull2 ( ) { final java . lang . String value = "RelativeColorimetric" ; final org . apache . pdfbox . pdmodel . graphics . state . RenderingIntent retval = org . apache . pdfbox . pdmodel . graphics . state . RenderingIntent . fromString ( value ) ; "<AssertPlaceHolder>" ; } fromString ( java . lang . String ) { for ( org . apache . pdfbox . pdmodel . graphics . state . RenderingIntent instance : org . apache . pdfbox . pdmodel . graphics . state . RenderingIntent . values ( ) ) { if ( instance . value . equals ( value ) ) { return instance ; } } return org . apache . pdfbox . pdmodel . graphics . state . RenderingIntent . RELATIVE_COLORIMETRIC ; } | org . junit . Assert . assertEquals ( RenderingIntent . RELATIVE_COLORIMETRIC , retval ) |
shouldNotGetMutationTokenWithGet ( ) { java . lang . String subPath = "sub.value" ; io . netty . buffer . ByteBuf fragment = io . netty . buffer . Unpooled . copiedBuffer ( "\"mutated\"" , CharsetUtil . UTF_8 ) ; io . netty . util . ReferenceCountUtil . releaseLater ( fragment ) ; com . couchbase . client . core . message . kv . subdoc . simple . SubGetRequest getRequest = new com . couchbase . client . core . message . kv . subdoc . simple . SubGetRequest ( com . couchbase . client . core . cluster . SubdocumentMessageTest . testSubKey , subPath , bucket ( ) ) ; com . couchbase . client . core . message . kv . subdoc . simple . SimpleSubdocResponse response = cluster ( ) . < com . couchbase . client . core . message . kv . subdoc . simple . SimpleSubdocResponse > send ( getRequest ) . toBlocking ( ) . single ( ) ; io . netty . util . ReferenceCountUtil . releaseLater ( response . content ( ) ) ; "<AssertPlaceHolder>" ; } mutationToken ( ) { return mutationToken ; } | org . junit . Assert . assertNull ( response . mutationToken ( ) ) |
isManyToMany_return_false_if_has_multiple_incoming_and_one_outgoing_transition ( ) { flowNodeTransitionsWrapper . setInputTransitionsSize ( 2 ) ; flowNodeTransitionsWrapper . setAllOutgoingTransitionDefinitions ( java . util . Arrays . asList ( transition1 ) ) ; "<AssertPlaceHolder>" ; } isManyToMany ( ) { return ( hasMultipleIncomingTransitions ( ) ) && ( hasMultipleOutgoingTransitions ( ) ) ; } | org . junit . Assert . assertFalse ( flowNodeTransitionsWrapper . isManyToMany ( ) ) |
getsLineCountWithNoEOLEndOfText ( ) { styledText . setText ( "1\n2\n3" ) ; "<AssertPlaceHolder>" ; } getLineCount ( ) { return syncExec ( new org . eclipse . swtbot . swt . finder . results . IntResult ( ) { @ org . eclipse . swtbot . swt . finder . widgets . Override public org . eclipse . swtbot . swt . finder . widgets . Integer run ( ) { return widget . getLineCount ( ) ; } } ) ; } | org . junit . Assert . assertEquals ( 3 , styledText . getLineCount ( ) ) |
testReadWithDelimiter ( ) { final ch . cyberduck . core . Path container = new ch . cyberduck . core . Path ( "test-us-east-1-cyberduck" , java . util . EnumSet . of ( Path . Type . directory , Path . Type . volume ) ) ; final ch . cyberduck . core . Path test = new ch . cyberduck . core . s3 . S3TouchFeature ( session ) . touch ( new ch . cyberduck . core . Path ( new ch . cyberduck . core . Path ( container , java . util . UUID . randomUUID ( ) . toString ( ) , java . util . EnumSet . of ( Path . Type . directory ) ) , java . util . UUID . randomUUID ( ) . toString ( ) , java . util . EnumSet . of ( Path . Type . file ) ) , new ch . cyberduck . core . transfer . TransferStatus ( ) ) ; final ch . cyberduck . core . s3 . S3AccessControlListFeature f = new ch . cyberduck . core . s3 . S3AccessControlListFeature ( session ) ; "<AssertPlaceHolder>" ; new ch . cyberduck . core . s3 . S3DefaultDeleteFeature ( session ) . delete ( java . util . Collections . singletonList ( test ) , new ch . cyberduck . core . DisabledLoginCallback ( ) , new ch . cyberduck . core . features . Delete . DisabledCallback ( ) ) ; } getPermission ( ch . cyberduck . core . Path ) { return new ch . cyberduck . core . sds . SDSAttributesFinderFeature ( session , nodeid ) . find ( file ) . getAcl ( ) ; } | org . junit . Assert . assertNotNull ( f . getPermission ( test ) ) |
none ( ) { org . openscience . cdk . hash . Suppressed suppressed = org . openscience . cdk . hash . Suppressed . none ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { "<AssertPlaceHolder>" ; } } contains ( org . openscience . cdk . interfaces . IIsotope ) { for ( java . util . Iterator < org . openscience . cdk . interfaces . IIsotope > it = isotopes ( ) . iterator ( ) ; it . hasNext ( ) ; ) { org . openscience . cdk . interfaces . IIsotope thisIsotope = it . next ( ) ; if ( isTheSame ( thisIsotope , isotope ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( suppressed . contains ( i ) ) |
testNN ( ) { int n = 10 ; org . deeplearning4j . clustering . kdtree . KDTree kdTree = new org . deeplearning4j . clustering . kdtree . KDTree ( n ) ; for ( int i = - 1 ; i < n ; i ++ ) { java . util . List < java . lang . Double > vec = new java . util . ArrayList ( n ) ; for ( int k = 0 ; k < n ; k ++ ) { vec . add ( ( k == i ? 1.0 : 0.0 ) ) ; } org . nd4j . linalg . api . ndarray . INDArray indVec = org . nd4j . linalg . factory . Nd4j . create ( com . google . common . primitives . Doubles . toArray ( vec ) , new long [ ] { 1 , vec . size ( ) } , DataType . FLOAT ) ; kdTree . insert ( indVec ) ; } java . util . Random rand = new java . util . Random ( ) ; java . util . List < java . lang . Double > pt = new java . util . ArrayList ( n ) ; for ( int k = 0 ; k < n ; k ++ ) { pt . add ( rand . nextDouble ( ) ) ; } org . nd4j . linalg . primitives . Pair < java . lang . Double , org . nd4j . linalg . api . ndarray . INDArray > result = kdTree . nn ( org . nd4j . linalg . factory . Nd4j . create ( com . google . common . primitives . Doubles . toArray ( pt ) , new long [ ] { 1 , pt . size ( ) } , DataType . FLOAT ) ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return intArray2 . getKey ( ) . backingArray ; } | org . junit . Assert . assertTrue ( ( ( result . getKey ( ) ) < ( Double . MAX_VALUE ) ) ) |
testSetNonDefaultDelimiters ( ) { java . lang . String templates = ( ( "delimiters<sp>\"%\",<sp>\"%\"" + ( org . stringtemplate . v4 . misc . Misc . newline ) ) + "ta(x)<sp>::=<sp>\"[%x%]\"" ) + ( org . stringtemplate . v4 . misc . Misc . newline ) ; writeFile ( tmpdir , "t.stg" , templates ) ; org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroupFile ( ( ( ( tmpdir ) + "/" ) + "t.stg" ) ) ; org . stringtemplate . v4 . ST st = group . getInstanceOf ( "ta" ) ; st . add ( "x" , "hi" ) ; java . lang . String expected = "[hi]" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
testSerialIterator ( ) { java . util . List < org . apache . hadoop . yarn . api . records . SchedulingRequest > schedulingRequestList = java . util . Arrays . asList ( org . apache . hadoop . yarn . server . resourcemanager . scheduler . constraint . TestPlacementProcessor . schedulingRequest ( 1 , 1 , 1 , 512 , "foo" ) , org . apache . hadoop . yarn . server . resourcemanager . scheduler . constraint . TestPlacementProcessor . schedulingRequest ( 1 , 2 , 1 , 512 , "foo" ) , org . apache . hadoop . yarn . server . resourcemanager . scheduler . constraint . TestPlacementProcessor . schedulingRequest ( 1 , 3 , 1 , 512 , "foo" ) , org . apache . hadoop . yarn . server . resourcemanager . scheduler . constraint . TestPlacementProcessor . schedulingRequest ( 1 , 4 , 1 , 512 , "foo" ) ) ; org . apache . hadoop . yarn . server . resourcemanager . scheduler . constraint . processor . BatchedRequests batchedRequests = new org . apache . hadoop . yarn . server . resourcemanager . scheduler . constraint . processor . BatchedRequests ( BatchedRequests . IteratorType . SERIAL , null , schedulingRequestList , 1 ) ; java . util . Iterator < org . apache . hadoop . yarn . api . records . SchedulingRequest > requestIterator = batchedRequests . iterator ( ) ; long prevAllocId = 0 ; while ( requestIterator . hasNext ( ) ) { org . apache . hadoop . yarn . api . records . SchedulingRequest request = requestIterator . next ( ) ; "<AssertPlaceHolder>" ; prevAllocId = request . getAllocationRequestId ( ) ; } } getAllocationRequestId ( ) { return allocationRequestId ; } | org . junit . Assert . assertTrue ( ( ( request . getAllocationRequestId ( ) ) > prevAllocId ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.