input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testEncodeDataRow ( ) { final java . util . UUID rowUUID = java . util . UUID . randomUUID ( ) ; final com . nearinfinity . honeycomb . hbase . rowkey . DataRowKey row = new com . nearinfinity . honeycomb . hbase . rowkey . DataRowKey ( com . nearinfinity . honeycomb . hbase . rowkey . DataRowKeyTest . TABLE_ID , rowUUID ) ; final byte [ ] expectedEncoding = com . nearinfinity . honeycomb . hbase . VarEncoder . appendByteArraysWithPrefix ( com . nearinfinity . honeycomb . hbase . rowkey . DataRowKeyTest . DATA_ROW_PREFIX , com . nearinfinity . honeycomb . hbase . VarEncoder . encodeULong ( com . nearinfinity . honeycomb . hbase . rowkey . DataRowKeyTest . TABLE_ID ) , com . nearinfinity . honeycomb . mysql . Util . UUIDToBytes ( rowUUID ) ) ; "<AssertPlaceHolder>" ; } encode ( ) { byte [ ] table = com . nearinfinity . honeycomb . hbase . VarEncoder . encodeULong ( tableId ) ; return com . nearinfinity . honeycomb . hbase . VarEncoder . appendByteArraysWithPrefix ( prefix , table ) ; }
org . junit . Assert . assertArrayEquals ( expectedEncoding , row . encode ( ) )
chunkOnValueTestNumberOfChunks ( ) { analyze . parsing . ChunkingParser cp = new analyze . parsing . ChunkingParser ( ) ; java . lang . String operation = "ON<sp>COL(date)" ; model . SequentialData result = cp . parseOperation ( operation , userData ) ; "<AssertPlaceHolder>" ; } size ( ) { return chunkedData . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , result . size ( ) )
testWriteChars ( ) { org . apache . giraph . utils . UnsafeByteArrayOutputStream os = new org . apache . giraph . utils . UnsafeByteArrayOutputStream ( ) ; int length = os . getByteArray ( ) . length ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; for ( int i = 0 ; i < length ; i ++ ) { sb . append ( "ც" ) ; } java . lang . String s = sb . toString ( ) ; os . writeChars ( s ) ; org . apache . giraph . utils . UnsafeByteArrayInputStream is = new org . apache . giraph . utils . UnsafeByteArrayInputStream ( os . getByteArray ( ) ) ; for ( int i = 0 ; i < ( s . length ( ) ) ; i ++ ) { "<AssertPlaceHolder>" ; } os . close ( ) ; } readChar ( ) { require ( org . apache . giraph . utils . ByteUtils . SIZE_OF_CHAR ) ; char value = org . apache . giraph . utils . UnsafeArrayReads . UNSAFE . getChar ( buffer , ( ( org . apache . giraph . utils . UnsafeArrayReads . BYTE_ARRAY_OFFSET ) + ( position ) ) ) ; position += org . apache . giraph . utils . ByteUtils . SIZE_OF_CHAR ; return value ; }
org . junit . Assert . assertEquals ( s . charAt ( i ) , is . readChar ( ) )
testObjectMethodReturnsInteger ( ) { com . eclipsesource . v8 . V8CallbackTest . ICallback callback = mock ( com . eclipsesource . v8 . V8CallbackTest . ICallback . class ) ; doReturn ( 7 ) . when ( callback ) . objectMethodNoParameter ( ) ; v8 . registerJavaMethod ( callback , "objectMethodNoParameter" , "foo" , new java . lang . Class < ? > [ ] { } ) ; int result = v8 . executeIntegerFunction ( "foo" , null ) ; "<AssertPlaceHolder>" ; } executeIntegerFunction ( java . lang . String , com . eclipsesource . v8 . V8Array ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertEquals ( 7 , result )
testLoadMultipleModulesInSameRequest ( ) { ensureFiles ( new java . lang . String [ ] { org . eclipse . rap . rwt . internal . resources . JavaScriptModuleLoaderImpl_Test . JS_FILE_1 } , false ) ; ensureFiles ( new java . lang . String [ ] { org . eclipse . rap . rwt . internal . resources . JavaScriptModuleLoaderImpl_Test . JS_FILE_2 } , true ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . executeLifeCycleFromServerThread ( ) ; org . eclipse . rap . rwt . testfixture . internal . TestMessage message = org . eclipse . rap . rwt . testfixture . internal . Fixture . getProtocolMessage ( ) ; java . lang . String expectedOne = ( ( "rwt-resources/" + ( getRegistryPath ( false ) ) ) + "/" ) + ( org . eclipse . rap . rwt . internal . resources . JavaScriptModuleLoaderImpl_Test . JS_FILE_1 ) ; java . lang . String expectedTwo = ( ( "rwt-resources/" + ( getRegistryPath ( true ) ) ) + "/" ) + ( org . eclipse . rap . rwt . internal . resources . JavaScriptModuleLoaderImpl_Test . JS_FILE_2 ) ; org . eclipse . rap . rwt . internal . protocol . Operation . CallOperation operationOne = findLoadOperation ( message , expectedOne ) ; org . eclipse . rap . rwt . internal . protocol . Operation . CallOperation operationTwo = findLoadOperation ( message , expectedTwo ) ; java . util . List < org . eclipse . rap . rwt . internal . protocol . Operation > operations = message . getOperations ( ) ; "<AssertPlaceHolder>" ; } indexOf ( org . eclipse . nebula . widgets . grid . GridItem ) { checkWidget ( ) ; if ( item == null ) { org . eclipse . swt . SWT . error ( SWT . ERROR_NULL_ARGUMENT ) ; } if ( item . isDisposed ( ) ) { org . eclipse . swt . SWT . error ( SWT . ERROR_INVALID_ARGUMENT ) ; } if ( ! ( hasChildren ) ) { throw new java . lang . IllegalArgumentException ( "GridItem<sp>has<sp>no<sp>children!" ) ; } return ( item . getParentItem ( ) ) == ( this ) ? item . index : - 1 ; }
org . junit . Assert . assertTrue ( ( ( operations . indexOf ( operationOne ) ) < ( operations . indexOf ( operationTwo ) ) ) )
withEmptyString ( ) { "<AssertPlaceHolder>" ; } check ( java . lang . String , java . lang . String ) { return computeFrequency ( a ) . equals ( computeFrequency ( b ) ) ; }
org . junit . Assert . assertTrue ( s . check ( "" , "" ) )
testIdentityPreProcessing ( ) { java . lang . String script = "var<sp>result<sp>=<sp>raw;" ; final net . meisen . dissertation . impl . dataintegration . ScriptPreProcessor processor = create ( script ) ; final net . meisen . dissertation . impl . datasets . SingleStaticDataSet rec = new net . meisen . dissertation . impl . datasets . SingleStaticDataSet ( "TEST" ) ; "<AssertPlaceHolder>" ; } process ( net . meisen . dissertation . model . datasets . IDataRecord ) { final javax . script . ScriptContext recordCtx = new javax . script . SimpleScriptContext ( ) ; recordCtx . setAttribute ( "raw" , raw , ScriptContext . ENGINE_SCOPE ) ; recordCtx . setAttribute ( "result" , new net . meisen . dissertation . impl . dataintegration . PreProcessedDataRecord ( raw ) , ScriptContext . ENGINE_SCOPE ) ; java . lang . Object res ; try { res = engine . eval ( this . script , recordCtx ) ; if ( res == null ) { res = recordCtx . getAttribute ( "result" ) ; } } catch ( final javax . script . ScriptException e ) { exceptionRegistry . throwRuntimeException ( net . meisen . dissertation . impl . dataintegration . ScriptPreProcessorException . class , 1001 , e , e . getMessage ( ) , this . script ) ; return null ; } if ( res instanceof net . meisen . dissertation . model . datasets . IDataRecord ) { return ( ( net . meisen . dissertation . model . datasets . IDataRecord ) ( res ) ) ; } else { exceptionRegistry . throwRuntimeException ( net . meisen . dissertation . impl . dataintegration . ScriptPreProcessorException . class , 1002 , ( res == null ? null : res . getClass ( ) . getName ( ) ) , res ) ; return null ; } }
org . junit . Assert . assertEquals ( rec , processor . process ( rec ) )
whenResolveWithExistingVantageButMissingDataTypeThenReturnsNoOpinion ( ) { java . util . List < com . khartec . waltz . model . authoritativesource . AuthoritativeRatingVantagePoint > vantagePoints = new java . util . ArrayList ( ) ; vantagePoints . add ( com . khartec . waltz . model . authoritativesource . ImmutableAuthoritativeRatingVantagePoint . builder ( ) . vantagePoint ( vantagePoint ) . rank ( 1 ) . dataTypeCode ( "TRADE_DATA" ) . applicationId ( 200L ) . rating ( AuthoritativenessRating . SECONDARY ) . build ( ) ) ; com . khartec . waltz . service . authoritative_source . AuthoritativeSourceResolver authoritativeSourceResolver = new com . khartec . waltz . service . authoritative_source . AuthoritativeSourceResolver ( vantagePoints ) ; com . khartec . waltz . model . rating . AuthoritativenessRating rating = authoritativeSourceResolver . resolve ( vantagePoint , sourceApp , "REF_DATA" ) ; "<AssertPlaceHolder>" ; } resolve ( com . khartec . waltz . model . EntityReference , com . khartec . waltz . model . EntityReference , java . lang . String ) { java . util . Map < java . lang . String , java . util . Map < java . lang . Long , java . util . Optional < com . khartec . waltz . model . authoritativesource . AuthoritativeRatingVantagePoint > > > ouGroup = byOuThenDataTypeThenApp . get ( vantagePoint ) ; if ( isEmpty ( ouGroup ) ) return com . khartec . waltz . model . rating . AuthoritativenessRating . NO_OPINION ; java . util . Map < java . lang . Long , java . util . Optional < com . khartec . waltz . model . authoritativesource . AuthoritativeRatingVantagePoint > > dataTypeGroup = ouGroup . get ( dataTypeCode ) ; if ( isEmpty ( dataTypeGroup ) ) return com . khartec . waltz . model . rating . AuthoritativenessRating . NO_OPINION ; java . util . Optional < com . khartec . waltz . model . authoritativesource . AuthoritativeRatingVantagePoint > maybeRating = dataTypeGroup . getOrDefault ( source . id ( ) , java . util . Optional . empty ( ) ) ; return maybeRating . map ( ( r ) -> r . rating ( ) ) . orElse ( AuthoritativenessRating . DISCOURAGED ) ; }
org . junit . Assert . assertEquals ( AuthoritativenessRating . NO_OPINION , rating )
testConvert ( ) { java . lang . String name = "DegreeN" ; java . lang . String abbrName = "AN" ; org . lnu . is . domain . degree . type . DegreeType source = new org . lnu . is . domain . degree . type . DegreeType ( ) ; source . setName ( name ) ; source . setAbbrName ( abbrName ) ; org . lnu . is . resource . degree . type . DegreeTypeResource expected = new org . lnu . is . resource . degree . type . DegreeTypeResource ( ) ; expected . setName ( name ) ; expected . setAbbrName ( abbrName ) ; org . lnu . is . resource . degree . type . DegreeTypeResource actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
permutations ( ) { java . util . List < java . lang . Integer > vals = com . google . common . primitives . Ints . asList ( new int [ ] { 1 , 2 , 3 } ) ; java . util . Collection < java . util . List < java . lang . Integer > > orderPerm = com . google . common . collect . Collections2 . permutations ( vals ) ; for ( java . util . List < java . lang . Integer > val : orderPerm ) { com . levelup . java . guava . Collections2Example . logger . info ( val ) ; } "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 6 , orderPerm . size ( ) )
testWithEmptyGraphWithVertices ( ) { org . apache . flink . api . java . DataSet < org . apache . flink . graph . library . clustering . directed . TriangleListing . Result < org . apache . flink . types . LongValue > > tl = emptyGraphWithVertices . run ( new org . apache . flink . graph . library . clustering . directed . TriangleListing ( ) ) ; "<AssertPlaceHolder>" ; } collect ( ) { final java . lang . String id = new org . apache . flink . util . AbstractID ( ) . toString ( ) ; final org . apache . flink . api . common . typeutils . TypeSerializer < T > serializer = getType ( ) . createSerializer ( getExecutionEnvironment ( ) . getConfig ( ) ) ; this . output ( new org . apache . flink . api . java . Utils . CollectHelper < > ( id , serializer ) ) . name ( "collect()" ) ; org . apache . flink . api . common . JobExecutionResult res = getExecutionEnvironment ( ) . execute ( ) ; java . util . ArrayList < byte [ ] > accResult = res . getAccumulatorResult ( id ) ; if ( accResult != null ) { try { return org . apache . flink . api . common . accumulators . SerializedListAccumulator . deserializeList ( accResult , serializer ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( "Cannot<sp>find<sp>type<sp>class<sp>of<sp>collected<sp>data<sp>type." , e ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( "Serialization<sp>error<sp>while<sp>deserializing<sp>collected<sp>data" , e ) ; } } else { throw new java . lang . RuntimeException ( "The<sp>call<sp>to<sp>collect()<sp>could<sp>not<sp>retrieve<sp>the<sp>DataSet." ) ; } }
org . junit . Assert . assertEquals ( 0 , tl . collect ( ) . size ( ) )
testWeldClassForGenericSuperclass ( ) { org . jboss . weld . metadata . TypeStore ts = new org . jboss . weld . metadata . TypeStore ( ) ; org . jboss . weld . annotated . enhanced . EnhancedAnnotatedType < org . jboss . weld . tests . interceptors . generic . StringProcessor > weldClass = new org . jboss . weld . resources . ClassTransformer ( ts , new org . jboss . weld . resources . SharedObjectCache ( ) , org . jboss . weld . resources . ReflectionCacheFactory . newInstance ( ts ) , org . jboss . weld . bootstrap . api . helpers . RegistrySingletonProvider . STATIC_INSTANCE ) . getEnhancedAnnotatedType ( org . jboss . weld . tests . interceptors . generic . StringProcessor . class , AnnotatedTypeIdentifier . NULL_BDA_ID ) ; java . util . Collection < org . jboss . weld . annotated . enhanced . EnhancedAnnotatedMethod < ? , ? super org . jboss . weld . tests . interceptors . generic . StringProcessor > > methods = weldClass . getEnhancedMethods ( ) ; java . util . List < org . jboss . weld . annotated . enhanced . EnhancedAnnotatedMethod < ? , ? > > interceptableMethods = org . jboss . weld . util . Beans . getInterceptableMethods ( weldClass ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
org . junit . Assert . assertEquals ( 3 , interceptableMethods . size ( ) )
testNack ( ) { conn . connect ( defUser , defPass ) ; subscribe ( conn , "sub1" , Stomp . Headers . Subscribe . AckModeValues . CLIENT ) ; sendJmsMessage ( getName ( ) ) ; org . apache . activemq . artemis . tests . integration . stomp . util . ClientStompFrame frame = conn . receiveFrame ( ) ; java . lang . String messageID = frame . getHeader ( Stomp . Headers . Message . MESSAGE_ID ) ; nack ( conn , "sub1" , messageID ) ; unsubscribe ( conn , "sub1" ) ; conn . disconnect ( ) ; javax . jms . MessageConsumer consumer = session . createConsumer ( queue ) ; javax . jms . Message message = consumer . receive ( 1000 ) ; "<AssertPlaceHolder>" ; } receive ( long ) { session . lock ( ) ; try { if ( ActiveMQRALogger . LOGGER . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ( ( ( "receive<sp>" + ( this ) ) + "<sp>timeout=" ) + timeout ) ) ; } checkState ( ) ; javax . jms . Message message = consumer . receive ( timeout ) ; if ( ActiveMQRALogger . LOGGER . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ( ( ( "received<sp>" + ( this ) ) + "<sp>result=" ) + message ) ) ; } if ( message == null ) { return null ; } else { return wrapMessage ( message ) ; } } finally { session . unlock ( ) ; } }
org . junit . Assert . assertNull ( message )
cascadeFromGenericInterfaceMethodImplementedInBaseClassOfMockedSubClass ( mockit . CascadingWithGenericsTest$SubClass ) { mockit . CascadingWithGenericsTest . Bar cascaded = mock . genericMethod ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( cascaded )
testSearchCategoryF ( ) { request . setSearchCategory ( null ) ; "<AssertPlaceHolder>" ; } getSearchCategory ( ) { return ( ( java . lang . String ) ( getParameter ( org . piwik . java . tracking . PiwikRequest . SEARCH_CATEGORY ) ) ) ; }
org . junit . Assert . assertNull ( request . getSearchCategory ( ) )
quotaManagerCanVetoCacheFileWriting ( ) { when ( backingStore . getReader ( "url" ) ) . thenReturn ( sourceContent ) ; org . alfresco . repo . content . caching . quota . QuotaManagerStrategy quota = mock ( org . alfresco . repo . content . caching . quota . QuotaManagerStrategy . class ) ; cachingStore . setQuota ( quota ) ; when ( sourceContent . getSize ( ) ) . thenReturn ( 1274L ) ; when ( quota . beforeWritingCacheFile ( 1274L ) ) . thenReturn ( false ) ; org . alfresco . service . cmr . repository . ContentReader returnedReader = cachingStore . getReader ( "url" ) ; verify ( cache , never ( ) ) . put ( "url" , sourceContent ) ; "<AssertPlaceHolder>" ; verify ( quota , never ( ) ) . afterWritingCacheFile ( anyLong ( ) ) ; } put ( K extends java . io . Serializable , V extends java . io . Serializable ) { cloneMap ( ) ; return map . put ( key , value ) ; }
org . junit . Assert . assertSame ( returnedReader , sourceContent )
delete_mntner_fails_because_of_authorisation_no_objects_returned ( ) { try { net . ripe . db . whois . api . RestTest . target ( getPort ( ) , "whois/references/TEST/mntner/OWNER-MNT" ) . request ( ) . delete ( net . ripe . db . whois . api . rest . domain . WhoisResources . class ) ; org . junit . Assert . fail ( ) ; } catch ( javax . ws . rs . NotAuthorizedException e ) { final net . ripe . db . whois . api . rest . domain . WhoisResources whoisResources = e . getResponse ( ) . readEntity ( net . ripe . db . whois . api . rest . domain . WhoisResources . class ) ; "<AssertPlaceHolder>" ; } } getWhoisObjects ( ) { return ( objects ) != null ? objects . getWhoisObjects ( ) : java . util . Collections . < net . ripe . db . whois . api . rest . domain . WhoisObject > emptyList ( ) ; }
org . junit . Assert . assertThat ( whoisResources . getWhoisObjects ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . empty ( ) ) )
shouldCheckLinkIsNotOnTime ( ) { com . autentia . tnt . businessobject . Link outOfTimeLink = new com . autentia . tnt . businessobject . Link ( ) ; java . util . Date yesterday = new java . util . Date ( ) ; java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . setTime ( yesterday ) ; cal . add ( Calendar . DATE , ( - 1 ) ) ; yesterday = cal . getTime ( ) ; outOfTimeLink . setInsertDate ( yesterday ) ; boolean isOnTime = sut . isOnTime ( outOfTimeLink ) ; "<AssertPlaceHolder>" ; } isOnTime ( com . autentia . tnt . businessobject . Link ) { java . util . Date nowDate = new java . util . Date ( ) ; java . util . Date insertDate = link . getInsertDate ( ) ; java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . setTime ( insertDate ) ; int dayOfInsertion = cal . get ( Calendar . DAY_OF_MONTH ) ; cal . set ( Calendar . DAY_OF_MONTH , ( dayOfInsertion + 1 ) ) ; return nowDate . before ( cal . getTime ( ) ) ; }
org . junit . Assert . assertThat ( isOnTime , org . hamcrest . core . Is . is ( false ) )
testBasicRoleWithDefaultscatchAllPrefix ( ) { org . apache . activemq . artemis . core . server . management . JMXAccessControlList controlList = new org . apache . activemq . artemis . core . server . management . JMXAccessControlList ( ) ; controlList . addToDefaultAccess ( "setSomething" , "admin" ) ; controlList . addToDefaultAccess ( "*" , "admin" ) ; controlList . addToRoleAccess ( "org.myDomain" , null , "list*" , "view" ) ; java . util . List < java . lang . String > roles = controlList . getRolesForObject ( new javax . management . ObjectName ( "org.myDomain.foo:*" ) , "setSomethingMore" ) ; "<AssertPlaceHolder>" ; } toArray ( ) { char [ ] result = new char [ size ] ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { result [ i ] = ( ( char ) ( read ( ) ) ) ; } return result ; }
org . junit . Assert . assertArrayEquals ( roles . toArray ( ) , new java . lang . String [ ] { "admin" } )
testMaakentityConvertorRubriek_8330 ( ) { nl . bzk . migratiebrp . test . brpnaarlo3 . adapter . ConverterContext ctx = createContext ( nl . bzk . migratiebrp . test . brpnaarlo3 . adapter . entity . IstStapelVoorkomenConverterTest . MINIMAAL ) ; converter . convertInhoudelijk ( ctx , IstStapelVoorkomenConverter . HEADER_RUBRIEK_8330 , rubriek8330 . toString ( ) ) ; converter . maakEntity ( ctx ) ; nl . bzk . algemeenbrp . dal . domein . brp . entity . StapelVoorkomen stapelVoorkomen = ctx . getStapel ( java . lang . Integer . parseInt ( volgnummer ) ) . getStapelvoorkomens ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } getRubriek8330DatumEindeOnderzoek ( ) { return rubriek8330DatumEindeOnderzoek ; }
org . junit . Assert . assertEquals ( rubriek8330 , stapelVoorkomen . getRubriek8330DatumEindeOnderzoek ( ) )
test_reduce_empty_char_sequence ( ) { char [ ] a = new char [ ] { } ; int result = server . reduce_char_sequence ( a ) ; "<AssertPlaceHolder>" ; } reduce_char_sequence ( char [ ] ) { return seq . length ; }
org . junit . Assert . assertEquals ( 0 , result )
testThrowCheckedException ( ) { java . io . IOException expected = new java . io . IOException ( "EXPECTED<sp>ERROR" ) ; java . io . IOException actual = null ; try { org . slieb . throwables . DoubleUnaryOperatorWithThrowable . aDoubleUnaryOperatorThatUnsafelyThrowsUnchecked ( ( v1 ) -> { throw expected ; } ) . applyAsDouble ( 0 ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( java . io . IOException e ) { actual = e ; } "<AssertPlaceHolder>" ; } applyAsDouble ( T ) { try { return applyAsDoubleWithThrowable ( v1 ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } }
org . junit . Assert . assertEquals ( expected , actual )
testProxyMetadataURL ( ) { createAppContext ( "http://foo.org/geoserver" ) ; org . geoserver . catalog . MetadataLinkInfo link = new org . geoserver . catalog . impl . MetadataLinkInfoImpl ( ) ; link . setContent ( "http://bar.com/geoserver/metadata.xml?foo=bar" ) ; java . lang . String url = org . vfny . geoserver . util . ResponseUtils . proxifyMetadataLink ( link , "http://localhost/geoserver" ) ; "<AssertPlaceHolder>" ; } getContent ( ) { return content ; }
org . junit . Assert . assertEquals ( link . getContent ( ) , url )
testUndelete_CheckInUse ( ) { when ( blobStoreUsageChecker . test ( eq ( underTest ) , any ( org . sonatype . nexus . blobstore . api . BlobId . class ) , anyString ( ) ) ) . thenReturn ( true ) ; boolean result = underTest . undelete ( blobStoreUsageChecker , new org . sonatype . nexus . blobstore . api . BlobId ( "fakeid" ) , attributes , false ) ; "<AssertPlaceHolder>" ; verify ( attributes ) . setDeleted ( false ) ; verify ( attributes ) . setDeletedReason ( null ) ; verify ( attributes ) . store ( ) ; } is ( java . lang . String ) { return org . sonatype . nexus . rapture . PasswordPlaceholder . VALUE . equals ( value ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( true ) )
testDivideValueWith0 ( ) { final com . dfremont . blog . ClassToTest classToTest = new com . dfremont . blog . ClassToTest ( ) ; int param1 = 10 ; int param2 = 0 ; try { classToTest . divide ( param1 , param2 ) ; org . junit . Assert . fail ( "Expected<sp>error!" ) ; } catch ( java . lang . ArithmeticException e ) { "<AssertPlaceHolder>" ; } } divide ( int , int ) { if ( argDivider == 0 ) { throw new java . lang . ArithmeticException ( "Division<sp>by<sp>zero<sp>prohibited!" ) ; } return argValue / argDivider ; }
org . junit . Assert . assertEquals ( "Division<sp>by<sp>zero<sp>prohibited!" , e . getMessage ( ) )
withHostWhenHostIsEmpty ( ) { final com . azure . common . implementation . http . UrlBuilder builder = new com . azure . common . implementation . http . UrlBuilder ( ) . withHost ( "www.example.com" ) ; builder . withHost ( "" ) ; "<AssertPlaceHolder>" ; } host ( ) { return this . host ; }
org . junit . Assert . assertNull ( builder . host ( ) )
isResizingRequired_NotNumber ( ) { paramHandler . setCountCPU ( "a1" ) ; java . lang . String result = vSystemProcessor . isResizingRequired ( paramHandler ) ; "<AssertPlaceHolder>" ; } isResizingRequired ( org . oscm . app . iaas . PropertyHandler ) { java . lang . String countCPU = paramHandler . getCountCPU ( ) ; try { java . lang . Integer . valueOf ( countCPU ) ; } catch ( java . lang . NumberFormatException e ) { return null ; } java . lang . String masterTemplateId = paramHandler . getMasterTemplateId ( ) ; java . lang . String slaveTemplateId = paramHandler . getSlaveTemplateId ( ) ; org . oscm . app . iaas . data . VSystemConfiguration configuration = getVSystemConfiguration ( paramHandler ) ; for ( org . oscm . app . iaas . data . VServerConfiguration server : configuration . getVServers ( ) ) { java . lang . String existingCPU = server . getNumOfCPU ( ) ; java . lang . String diskImageId = server . getDiskImageId ( ) ; if ( ( existingCPU != null ) && ( ! ( existingCPU . equals ( countCPU ) ) ) ) { if ( ( diskImageId != null ) && ( ( diskImageId . equals ( masterTemplateId ) ) || ( diskImageId . equals ( slaveTemplateId ) ) ) ) { org . oscm . app . iaas . VSystemProcessorBean . logger . debug ( ( ( ( "Server<sp>" + ( server . getServerId ( ) ) ) + "<sp>to<sp>be<sp>resized<sp>to<sp>CPU#<sp>" ) + countCPU ) ) ; org . oscm . app . iaas . SubPropertyHandler subPropertyHandler = paramHandler . getTemporaryVserver ( server ) ; subPropertyHandler . setCountCPU ( countCPU ) ; subPropertyHandler . setState ( FlowState . VSERVER_MODIFICATION_REQUESTED ) ; subPropertyHandler . setOperation ( Operation . VSERVER_MODIFICATION ) ; paramHandler . setState ( FlowState . VSYSTEM_RESIZE_VSERVERS ) ; return server . getServerId ( ) ; } } } return null ; }
org . junit . Assert . assertNull ( result )
io_decimals_int64 ( ) { java . util . Map < java . lang . String , com . asakusafw . directio . hive . serde . ValueSerde > edits = new java . util . HashMap ( ) ; edits . put ( "decimalOption" , com . asakusafw . directio . hive . serde . ValueSerdeFactory . getDecimal ( 18 , 2 ) ) ; int count = 100 ; com . asakusafw . directio . hive . parquet . ParquetFileFormat < com . asakusafw . directio . hive . serde . mock . MockTypes > format = format ( com . asakusafw . directio . hive . serde . mock . MockTypes . class , edits ) ; java . util . List < com . asakusafw . directio . hive . serde . mock . MockTypes > inputs = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < count ; i ++ ) { com . asakusafw . directio . hive . serde . mock . MockTypes in = new com . asakusafw . directio . hive . serde . mock . MockTypes ( ) ; in . decimalOption . modify ( new java . math . BigDecimal ( "7.89" ) ) ; inputs . add ( in ) ; } java . util . List < com . asakusafw . directio . hive . serde . mock . MockTypes > outputs = restore ( format , inputs ) ; com . asakusafw . directio . hive . serde . mock . MockTypes sample = inputs . get ( 0 ) ; for ( com . asakusafw . directio . hive . serde . mock . MockTypes out : outputs ) { "<AssertPlaceHolder>" ; } } equalTo ( java . lang . Object ) { return new com . asakusafw . testdriver . rule . ExpectConstant ( value , new com . asakusafw . testdriver . rule . Equals ( ) ) ; }
org . junit . Assert . assertThat ( out . decimalOption , equalTo ( sample . decimalOption ) )
testStageAttachment_NullTest ( ) { int companyId = 1 ; int projectId = 2 ; java . lang . String name = "ANewAttachment" ; long size = 12312312 ; byte [ ] file = name . getBytes ( ) ; java . lang . String expectPath = "/attachment/2/stage/1" ; com . onboard . domain . model . Attachment sampleAttachment = getASampleAttachment ( ) ; com . onboard . service . collaboration . AttachmentService spyAttachmentService = spy ( attachmentService ) ; doReturn ( sampleAttachment ) . when ( spyAttachmentService ) . create ( any ( com . onboard . domain . model . Attachment . class ) ) ; doNothing ( ) . when ( spyAttachmentService ) . deleteFromTrash ( com . onboard . service . collaboration . impl . test . AttachmentServiceImplTest . id ) ; when ( mockFileService . writeFile ( expectPath , file ) ) . thenReturn ( false ) ; com . onboard . domain . model . Attachment result = spyAttachmentService . stageAttachment ( companyId , projectId , name , size , com . onboard . service . collaboration . impl . test . AttachmentServiceImplTest . contentTypeString , file ) ; "<AssertPlaceHolder>" ; verify ( mockFileService ) . writeFile ( expectPath , file ) ; verify ( spyAttachmentService ) . deleteFromTrash ( com . onboard . service . collaboration . impl . test . AttachmentServiceImplTest . id ) ; } stageAttachment ( int , int , java . lang . String , long , java . lang . String , byte [ ] ) { com . onboard . domain . model . Attachment attachment = new com . onboard . domain . model . Attachment ( ) ; attachment . setName ( name ) ; attachment . setContentType ( contentType ) ; attachment . setAttachId ( com . onboard . service . collaboration . impl . NONE_ATTACH_ID ) ; attachment . setAttachType ( com . onboard . service . collaboration . impl . NONE_ATTACH_TYPE ) ; attachment . setCreated ( new java . util . Date ( ) ) ; attachment . setSize ( size ) ; attachment . setCreatorId ( sessionService . getCurrentUser ( ) . getId ( ) ) ; attachment . setCreatorName ( sessionService . getCurrentUser ( ) . getName ( ) ) ; attachment . setCreatorAvatar ( sessionService . getCurrentUser ( ) . getAvatar ( ) ) ; attachment . setProjectId ( projectId ) ; attachment . setCompanyId ( companyId ) ; attachment = create ( attachment ) ; java . lang . String path = org . springframework . util . StringUtils . arrayToDelimitedString ( new java . lang . String [ ] { "" , "attachment" , java . lang . String . valueOf ( projectId ) , "stage" , java . lang . String . valueOf ( attachment . getId ( ) ) } , "/" ) ; if ( fileService . writeFile ( path , file ) ) { return attachment ; } else { deleteFromTrash ( attachment . getId ( ) ) ; return null ; } }
org . junit . Assert . assertNull ( result )
testIsIncludePathColors ( ) { System . out . println ( "isIncludePathColors" ) ; mudmap2 . backend . legend . Legend instance = new mudmap2 . backend . legend . Legend ( layer , Legend . Orientation . HORIZONTAL , 500 ) ; "<AssertPlaceHolder>" ; } isIncludePathColors ( ) { return includePathColors ; }
org . junit . Assert . assertFalse ( instance . isIncludePathColors ( ) )
testDefaultsToValueMetaName ( ) { org . pentaho . agilebi . modeler . models . annotations . data . DataProvider dataProvider = new org . pentaho . agilebi . modeler . models . annotations . data . DataProvider ( ) ; java . util . ArrayList < org . pentaho . agilebi . modeler . models . annotations . data . ColumnMapping > columnMappings = new java . util . ArrayList < org . pentaho . agilebi . modeler . models . annotations . data . ColumnMapping > ( ) ; dataProvider . setColumnMappings ( columnMappings ) ; org . pentaho . agilebi . modeler . models . annotations . SharedDimensionImportStrategy importStrategy = new org . pentaho . agilebi . modeler . models . annotations . SharedDimensionImportStrategy ( dataProvider ) ; org . pentaho . di . core . row . ValueMeta valueMeta = new org . pentaho . di . core . row . ValueMeta ( ) ; valueMeta . setName ( "c1" ) ; "<AssertPlaceHolder>" ; } displayName ( org . pentaho . di . core . row . ValueMetaInterface ) { java . util . List < org . pentaho . agilebi . modeler . models . annotations . data . ColumnMapping > columnMappings = dataProvider . getColumnMappings ( ) ; for ( org . pentaho . agilebi . modeler . models . annotations . data . ColumnMapping columnMapping : columnMappings ) { if ( columnMapping . getColumnName ( ) . equalsIgnoreCase ( valueMeta . getName ( ) ) ) { return columnMapping . getName ( ) ; } } return valueMeta . getName ( ) ; }
org . junit . Assert . assertEquals ( "c1" , importStrategy . displayName ( valueMeta ) )
test_generateRandomIndividual ( ) { for ( int i = 2 ; i <= 40 ; i ++ ) { aima . core . search . local . Individual < java . lang . Integer > individual = aima . core . environment . nqueens . NQueensGenAlgoUtil . generateRandomIndividual ( i ) ; "<AssertPlaceHolder>" ; } } length ( ) { return representation . size ( ) ; }
org . junit . Assert . assertEquals ( i , individual . length ( ) )
givenUnit_whenProduct_ThenGetProductUnit ( ) { javax . measure . Unit < javax . measure . quantity . Area > squareMetre = com . baeldung . measurement . METRE . multiply ( com . baeldung . measurement . METRE ) . asType ( javax . measure . quantity . Area . class ) ; javax . measure . Quantity < javax . measure . quantity . Length > line = tec . units . ri . quantity . Quantities . getQuantity ( 2 , com . baeldung . measurement . METRE ) ; "<AssertPlaceHolder>" ; } getUnit ( ) { return unit ; }
org . junit . Assert . assertEquals ( line . multiply ( line ) . getUnit ( ) , squareMetre )
testNULL ( ) { com . streamsets . pipeline . api . el . ELEval elEval = new com . streamsets . datacollector . el . ELEvaluator ( null , false , elDefinitionExtractor ) ; com . streamsets . pipeline . api . el . ELVars variables = elEval . createVariables ( ) ; java . lang . Object result = elEval . eval ( variables , "${NULL}" , java . lang . Object . class ) ; "<AssertPlaceHolder>" ; } createVariables ( ) { return new com . streamsets . datacollector . el . ELVariables ( constants ) ; }
org . junit . Assert . assertNull ( result )
whenOption_thenIterable ( ) { com . baeldung . atlassian . fugue . Option < java . lang . String > some = com . baeldung . atlassian . fugue . Option . some ( "value" ) ; java . lang . Iterable < java . lang . String > strings = com . baeldung . atlassian . fugue . Iterables . concat ( some , com . baeldung . atlassian . fugue . Arrays . asList ( "a" , "b" , "c" ) ) ; com . baeldung . atlassian . fugue . List < java . lang . String > stringList = new com . baeldung . atlassian . fugue . ArrayList ( ) ; com . baeldung . atlassian . fugue . Iterables . addAll ( stringList , strings ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
org . junit . Assert . assertEquals ( 4 , stringList . size ( ) )
testCreateSettingsPanel ( ) { System . out . println ( "createSettingsPanel" ) ; kg . apc . jmeter . vizualizers . ResponseTimesPercentilesGui instance = new kg . apc . jmeter . vizualizers . ResponseTimesPercentilesGui ( ) ; kg . apc . jmeter . vizualizers . JSettingsPanel result = instance . createSettingsPanel ( ) ; "<AssertPlaceHolder>" ; } createSettingsPanel ( ) { return new kg . apc . jmeter . vizualizers . JSettingsPanel ( this , ( ( ( ( ( ( ( JSettingsPanel . TIMELINE_OPTION ) | ( JSettingsPanel . GRADIENT_OPTION ) ) | ( JSettingsPanel . FINAL_ZEROING_OPTION ) ) | ( JSettingsPanel . LIMIT_POINT_OPTION ) ) | ( JSettingsPanel . MAXY_OPTION ) ) | ( JSettingsPanel . RELATIVE_TIME_OPTION ) ) | ( JSettingsPanel . MARKERS_OPTION ) ) ) ; }
org . junit . Assert . assertNotNull ( result )
wordAlignReadingBytes ( ) { final byte [ ] data = new byte [ ] { 1 , 2 , 3 , 4 } ; final java . io . ByteArrayInputStream stream = new java . io . ByteArrayInputStream ( data ) ; final com . flagstone . transform . coder . LittleDecoder fixture = new com . flagstone . transform . coder . LittleDecoder ( stream ) ; fixture . readByte ( ) ; fixture . alignToWord ( ) ; "<AssertPlaceHolder>" ; } mark ( ) { return locations . push ( ( ( pos ) + ( index ) ) ) ; }
org . junit . Assert . assertEquals ( 4 , fixture . mark ( ) )
shouldAllowStubbedMockReferenceAccess ( ) { java . util . Set expectedMock = mock ( java . util . Set . class ) ; java . util . Set returnedMock = when ( expectedMock . isEmpty ( ) ) . thenReturn ( false ) . getMock ( ) ; "<AssertPlaceHolder>" ; } getMock ( ) { return mock ; }
org . junit . Assert . assertEquals ( expectedMock , returnedMock )
testHasAGroupThatStartsWithANumber ( ) { nameForCrossEntityAggregate = "name_7for_aggregate" ; "<AssertPlaceHolder>" ; } isValid ( java . lang . String , javax . validation . ConstraintValidatorContext ) { if ( ( null == nameForCrossEntityAggregate ) || ( nameForCrossEntityAggregate . isEmpty ( ) ) ) { return true ; } return com . cloudera . csd . validation . monitoring . MonitoringConventions . isValidMetricNameFormat ( nameForCrossEntityAggregate ) ; }
org . junit . Assert . assertTrue ( validator . isValid ( nameForCrossEntityAggregate , context ) )
testSetProperty ( ) { final int EXPECTED = 20 ; java . lang . reflect . Method method = null ; com . sap . core . odata . processor . core . jpa . mock . data . JPATypeMock typeMock = new com . sap . core . odata . processor . core . jpa . mock . data . JPATypeMock ( ) ; try { method = com . sap . core . odata . processor . core . jpa . mock . data . JPATypeMock . class . getMethod ( "setMInt" , new java . lang . Class [ ] { int . class } ) ; setProperty ( method , typeMock , EXPECTED ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( ( ( com . sap . core . odata . processor . core . jpa . common . ODataJPATestConstants . EXCEPTION_MSG_PART_1 ) + ( e . getMessage ( ) ) ) + ( com . sap . core . odata . processor . core . jpa . common . ODataJPATestConstants . EXCEPTION_MSG_PART_2 ) ) ) ; } "<AssertPlaceHolder>" ; } getMInt ( ) { return mInt ; }
org . junit . Assert . assertEquals ( typeMock . getMInt ( ) , EXPECTED )
resolve_by_range_b_absent_e ( ) { final com . groupon . lex . metrics . transformers . IdentifierNameResolver resolver = new com . groupon . lex . metrics . transformers . IdentifierNameResolver ( com . groupon . lex . metrics . transformers . IdentifierNameResolverTest . IDENTIFIER , java . util . Optional . of ( new com . groupon . lex . metrics . transformers . IdentifierNameResolver . SubSelectRange ( java . util . Optional . of ( ( - 1 ) ) , java . util . Optional . empty ( ) ) ) ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String [ ] ) { return com . groupon . lex . metrics . SimpleGroupPath . CACHE . apply ( new com . groupon . lex . metrics . PathArray ( path ) ) ; }
org . junit . Assert . assertEquals ( com . groupon . lex . metrics . SimpleGroupPath . valueOf ( "bar" ) , resolver . apply ( ctx ) . map ( ( p ) -> com . groupon . lex . metrics . SimpleGroupPath . valueOf ( p . getPath ( ) ) ) . get ( ) )
outOfOrderScript ( ) { java . lang . String scriptPath = setupScript ( "rack=myrack,node=myhost" , mFolder . newFile ( ) ) ; try ( java . io . Closeable c = new alluxio . ConfigurationRule ( com . google . common . collect . ImmutableMap . of ( PropertyKey . LOCALITY_SCRIPT , scriptPath ) , mConfiguration ) . toResource ( ) ) { alluxio . wire . TieredIdentity identity = alluxio . network . TieredIdentityFactory . create ( mConfiguration ) ; alluxio . wire . TieredIdentity expected = new alluxio . wire . TieredIdentity ( java . util . Arrays . asList ( new alluxio . wire . TieredIdentity . LocalityTier ( "node" , "myhost" ) , new alluxio . wire . TieredIdentity . LocalityTier ( "rack" , "myrack" ) ) ) ; "<AssertPlaceHolder>" ; } } create ( alluxio . conf . AlluxioConfiguration ) { alluxio . wire . TieredIdentity scriptIdentity = alluxio . network . TieredIdentityFactory . fromScript ( conf ) ; java . util . List < alluxio . wire . TieredIdentity . LocalityTier > tiers = new java . util . ArrayList ( ) ; java . util . List < java . lang . String > orderedTierNames = conf . getList ( PropertyKey . LOCALITY_ORDER , "," ) ; for ( int i = 0 ; i < ( orderedTierNames . size ( ) ) ; i ++ ) { java . lang . String tierName = orderedTierNames . get ( i ) ; java . lang . String value = null ; if ( scriptIdentity != null ) { alluxio . wire . TieredIdentity . LocalityTier scriptTier = scriptIdentity . getTier ( i ) ; com . google . common . base . Preconditions . checkState ( scriptTier . getTierName ( ) . equals ( tierName ) ) ; value = scriptTier . getValue ( ) ; } if ( conf . isSet ( Template . LOCALITY_TIER . format ( tierName ) ) ) { value = conf . get ( Template . LOCALITY_TIER . format ( tierName ) ) ; } tiers . add ( new alluxio . wire . TieredIdentity . LocalityTier ( tierName , value ) ) ; } if ( ( ( ( tiers . size ( ) ) > 0 ) && ( tiers . get ( 0 ) . getTierName ( ) . equals ( Constants . LOCALITY_NODE ) ) ) && ( ( tiers . get ( 0 ) . getValue ( ) ) == null ) ) { java . lang . String name = alluxio . util . network . NetworkAddressUtils . getLocalNodeName ( conf ) ; tiers . set ( 0 , new alluxio . wire . TieredIdentity . LocalityTier ( alluxio . Constants . LOCALITY_NODE , name ) ) ; } return new alluxio . wire . TieredIdentity ( tiers ) ; }
org . junit . Assert . assertEquals ( expected , identity )
testCutGeometryCrossingValidArea ( ) { java . lang . String wkb = "AAAAAAMAAAABAAAAIMBX4dme0ZBrwBBHY3zBphTAV9GcHhAtwMAKRti7qZ+AwFfQgOTrwUTACf2L\n" + ( ( ( ( ( ( ( ( "jG5AAMBX0vLFEfX8wAq1GbA7goDAV8UJiMU1/MAHPA1tlZ4AwFeuj65DdMjAAyjMe3bMAMBXc9vp\n" + "X9V8v/XZFFTLswDAVytuJlbfZL/btb3kSQgAwFcQKQ78CxQ9MAAAAAAAAMBZSreoXYG4vowviwAA\n" ) + "AADAWUvVvOkHnMAD+j4NI0sAwFjlAT80DDjAA9TAl2fugMBYg9muyzeowATuKNtAgoDAWGFB3LdZ\n" ) + "JMAGMd3VXb+AwFhJc+py+vDACDw/gWQHAMBYMRpZMQ2AwAuBh446e4DAWCkYEYQ22MANF6kb09cA\n" ) + "wFgg/h0uW3zAD6SUb7kgAMBYF6GYVzWAwBMR+WWpdEDAWBhD/wDaIMAW2xdMREiAwFgKqiyQ+gTA\n" ) + "Gix578FUgMBYA1s+gKpwwBsTo7wYhYDAV/qZDD5aYMAbwu+JuyoAwFfqj6KbhxTAHIrvGplNAMBX\n" ) + "4hOw7Jx0wBy+1+x/XkDAV9vVZESR7MAca5H4ZYHAwFfWkK/y7sDAG3TJ1EFXgMBX1+eqod08wBrq\n" ) + "ABEuC8DAV+jS2XIy3MAYBQgfRHnAwFfslYpsZkDAFphJ8XbhQMBX6mVp0arUwBOSV/ye1QDAV+HZ\n" ) + "ntGQa8AQR2N8waYU" ) ; org . locationtech . jts . geom . Geometry geometry = new org . locationtech . jts . io . WKBReader ( ) . read ( org . geotools . data . Base64 . decode ( wkb ) ) ; org . opengis . referencing . crs . CoordinateReferenceSystem lambertPolar = getLambertPolar ( ) ; org . geotools . geometry . jts . ReferencedEnvelope renderingEnvelope = new org . geotools . geometry . jts . ReferencedEnvelope ( ( - 1.4542204652543461E7 ) , 1.5480411404320458E7 , ( - 1.870549711355389E7 ) , 1.1278026995319324E7 , lambertPolar ) ; org . geotools . geometry . jts . ReferencedEnvelope validAreaBounds = new org . geotools . geometry . jts . ReferencedEnvelope ( ( - 180 ) , 180 , 0 , 90 , org . geotools . referencing . crs . DefaultGeographicCRS . WGS84 ) ; org . geotools . renderer . crs . ProjectionHandler ph = new org . geotools . renderer . crs . ProjectionHandler ( org . geotools . referencing . crs . DefaultGeographicCRS . WGS84 , validAreaBounds , renderingEnvelope ) ; org . locationtech . jts . geom . Geometry preProcessed = ph . preProcess ( geometry ) ; "<AssertPlaceHolder>" ; } preProcess ( org . locationtech . jts . geom . Geometry ) { if ( ( validAreaBounds ) == null ) return densify ( geometry ) ; if ( noReprojection ) { return densify ( geometry ) ; } org . locationtech . jts . geom . Geometry mask ; org . geotools . geometry . jts . ReferencedEnvelope ge = new org . geotools . geometry . jts . ReferencedEnvelope ( geometry . getEnvelopeInternal ( ) , geometryCRS ) ; org . geotools . geometry . jts . ReferencedEnvelope geWGS84 = ge . transform ( org . geotools . renderer . crs . WGS84 , true ) ; geWGS84 . expandBy ( org . geotools . renderer . crs . ProjectionHandler . EPS ) ; if ( ( validArea ) == null ) { if ( validAreaBounds . contains ( ( ( org . locationtech . jts . geom . Envelope ) ( geWGS84 ) ) ) ) { return densify ( geometry ) ; } org . geotools . geometry . jts . ReferencedEnvelope envIntWgs84 = new org . geotools . geometry . jts . ReferencedEnvelope ( validAreaBounds . intersection ( geWGS84 ) , WGS84 ) ; if ( ( ( envIntWgs84 . getHeight ( ) ) <= 0 ) || ( ( envIntWgs84 . getWidth ( ) ) <= 0 ) ) { if ( validAreaBounds . contains ( 180 , ( ( ( validAreaBounds . getMinY ( ) ) + ( validAreaBounds . getMaxY ( ) ) ) / 2 ) ) ) { org . geotools . geometry . jts . ReferencedEnvelope translated = new org . geotools . geometry . jts . ReferencedEnvelope ( validAreaBounds ) ; translated . translate ( ( - 360 ) , 0 ) ; if ( translated . contains ( ( ( org . locationtech . jts . geom . Envelope ) ( geWGS84 ) ) ) ) { return densify ( geometry ) ; } envIntWgs84 = translated . intersection ( geWGS84 ) ; } else if ( validAreaBounds . contains ( ( - 180 ) , ( ( ( validAreaBounds . getMinY ( ) ) + ( validAreaBounds . getMaxY ( ) ) ) / 2 ) ) ) { org . geotools . geometry . jts . ReferencedEnvelope translated = new org . geotools . geometry . jts . ReferencedEnvelope ( validAreaBounds ) ; translated . translate ( 360 , 0 ) ; if ( translated . contains ( ( ( org . locationtech . jts . geom . Envelope ) ( geWGS84 ) ) ) ) { return densify ( geometry ) ; } envIntWgs84 = translated . intersection ( geWGS84 ) ; } if ( ( ( envIntWgs84 . getHeight ( ) ) <= 0 ) || ( ( envIntWgs84 . getWidth ( ) ) <= 0 ) ) { return null ; } } org . geotools . geometry . jts . ReferencedEnvelope envInt = envIntWgs84 . transform ( geometryCRS , true ) ; mask = org . geotools . geometry . jts . JTS . toGeometry ( ( ( org . locationtech . jts . geom . Envelope ) ( envInt ) ) ) ; } else { if ( validaAreaTester . contains ( org . geotools . geometry . jts . JTS . toGeometry ( geWGS84 ) ) ) { return densify ( geometry ) ; } org . geotools . geometry . jts . ReferencedEnvelope envIntWgs84 = new org . geotools . geometry . jts . ReferencedEnvelope ( validAreaBounds . intersection ( geWGS84 ) , WGS84 ) ; if ( envIntWgs84 . isEmpty ( ) ) { return null ; } org . locationtech . jts . geom . Polygon polyIntWgs84 = org . geotools . geometry . jts . JTS . toGeometry ( envIntWgs84 ) ; org . locationtech . jts . geom . Geometry maskWgs84 = intersect ( validArea , polyIntWgs84 , geometryCRS ) ; if ( ( maskWgs84 == null ) || ( maskWgs84 . isEmpty ( ) ) ) { return null ; } mask = org . geotools . geometry . jts . JTS . transform ( maskWgs84 , org . geotools . referencing . CRS . findMathTransform ( org . geotools . renderer . crs . WGS84 , geometryCRS ) ) ; } return densify ( intersect ( geometry , mask , geometryCRS ) ) ; }
org . junit . Assert . assertNull ( preProcessed )
testSerialDiffPipelineAggregation ( ) { com . liferay . portal . search . aggregation . pipeline . SerialDiffPipelineAggregation serialDiffPipelineAggregation = com . liferay . portal . search . aggregations . test . AggregationsInstantiationTest . _aggregations . serialDiff ( "name" , "bucketsPath" ) ; "<AssertPlaceHolder>" ; } serialDiff ( java . lang . String , java . lang . String ) { return new com . liferay . portal . search . internal . aggregation . pipeline . SerialDiffPipelineAggregationImpl ( name , bucketsPath ) ; }
org . junit . Assert . assertNotNull ( serialDiffPipelineAggregation )
givenAnEmptyIntArray_whenUsingStream_thenFindAverage ( ) { int [ ] array = new int [ ] { } ; double expectedAvgOfArray = Double . NaN ; double actualAvgOfArray = com . baeldung . array . SumAndAverageInArray . findAverageUsingStream ( array ) ; "<AssertPlaceHolder>" ; } findAverageUsingStream ( int [ ] ) { return java . util . Arrays . stream ( array ) . average ( ) . orElse ( Double . NaN ) ; }
org . junit . Assert . assertEquals ( expectedAvgOfArray , actualAvgOfArray , 0.0 )
isLinuxOS ( ) { boolean iswin = com . att . aro . core . util . Util . isLinuxOS ( ) ; java . lang . String os = java . lang . System . getProperty ( "os.name" ) ; boolean haswinLinux = os . contains ( "Linux" ) ; "<AssertPlaceHolder>" ; } isLinuxOS ( ) { boolean iswin = com . att . aro . core . util . Util . isLinuxOS ( ) ; java . lang . String os = java . lang . System . getProperty ( "os.name" ) ; boolean haswinLinux = os . contains ( "Linux" ) ; org . junit . Assert . assertEquals ( haswinLinux , iswin ) ; }
org . junit . Assert . assertEquals ( haswinLinux , iswin )
lockShouldReturnFalseIfTheRowIsAlreadyLocked ( ) { java . sql . Connection connection = null ; try { lock = createLock ( props ) ; connection = lock ( tableName , clustername ) ; "<AssertPlaceHolder>" ; } finally { close ( connection ) ; } } lock ( ) { return acquireLock ( ) ; }
org . junit . Assert . assertFalse ( lock . lock ( ) )
testToDouble ( ) { byte [ ] bytes = org . apache . hadoop . hbase . util . Bytes . toBytes ( 123.45 ) ; "<AssertPlaceHolder>" ; } toDouble ( byte [ ] ) { return java . lang . Double . parseDouble ( "5.0" ) ; }
org . junit . Assert . assertEquals ( org . apache . hadoop . hbase . util . Bytes . toDouble ( bytes ) , util . toDouble ( bytes ) , 0.0 )
testNestedFailureIsHidden ( ) { topLevelIncCallsNestedIncThatRollsback ( this . counter ) ; "<AssertPlaceHolder>" ; } getCounterValue ( test . backend . jvstm . domain . Counter ) { return c . getValue ( ) ; }
org . junit . Assert . assertEquals ( 1 , getCounterValue ( this . counter ) )
testMeanEdgeCase_C ( ) { org . nd4j . linalg . api . ndarray . INDArray arr = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 30 , 30 , DataType . DOUBLE ) . reshape ( new int [ ] { 3 , 10 , 1 } ) . dup ( 'c' ) ; org . nd4j . linalg . api . ndarray . INDArray arr2 = arr . mean ( 2 ) ; org . nd4j . linalg . api . ndarray . INDArray exp = arr . get ( org . nd4j . linalg . indexing . NDArrayIndex . all ( ) , org . nd4j . linalg . indexing . NDArrayIndex . all ( ) , org . nd4j . linalg . indexing . NDArrayIndex . point ( 0 ) ) ; "<AssertPlaceHolder>" ; } point ( long ) { return new org . nd4j . linalg . indexing . PointIndex ( point ) ; }
org . junit . Assert . assertEquals ( exp , arr2 )
testBerichtMetOverrulMetOverrulbareFouten2 ( ) { System . out . println ( "----<sp>testBerichtMetOverrulMetOverrulbareFouten2" ) ; nl . bzk . brp . business . dto . bijhouding . AbstractBijhoudingsBericht bericht = new nl . bzk . brp . business . dto . bijhouding . VerhuizingBericht ( ) ; nl . bzk . brp . business . dto . BerichtContext context = new nl . bzk . brp . business . dto . BerichtContext ( new nl . bzk . brp . business . dto . BerichtenIds ( 1L , 1L ) , 1 , new nl . bzk . brp . model . gedeeld . Partij ( ) , "ref" ) ; bericht . setOverruledMeldingen ( java . util . Arrays . asList ( new nl . bzk . brp . model . validatie . OverruleMelding ( MeldingCode . AUTH0001 . getNaam ( ) ) ) ) ; nl . bzk . brp . business . dto . BerichtResultaat resultaat = new nl . bzk . brp . business . dto . BerichtResultaat ( java . util . Arrays . asList ( new nl . bzk . brp . model . validatie . Melding ( nl . bzk . brp . model . validatie . SoortMelding . INFO , nl . bzk . brp . model . validatie . MeldingCode . BRAL0012 ) , new nl . bzk . brp . model . validatie . Melding ( nl . bzk . brp . model . validatie . SoortMelding . FOUT_OVERRULEBAAR , nl . bzk . brp . model . validatie . MeldingCode . AUTH0001 ) , new nl . bzk . brp . model . validatie . Melding ( nl . bzk . brp . model . validatie . SoortMelding . INFO , nl . bzk . brp . model . validatie . MeldingCode . BRAL2032 ) , new nl . bzk . brp . model . validatie . Melding ( nl . bzk . brp . model . validatie . SoortMelding . FOUT_OVERRULEBAAR , nl . bzk . brp . model . validatie . MeldingCode . AUTH0001 ) , new nl . bzk . brp . model . validatie . Melding ( nl . bzk . brp . model . validatie . SoortMelding . FOUT_OVERRULEBAAR , nl . bzk . brp . model . validatie . MeldingCode . AUTH0001 ) , new nl . bzk . brp . model . validatie . Melding ( nl . bzk . brp . model . validatie . SoortMelding . WAARSCHUWING , nl . bzk . brp . model . validatie . MeldingCode . ALG0001 ) ) ) ; bedrijfsregelValidatieStap . corrigeerVoorOverrulebareFouten ( bericht , context , resultaat ) ; "<AssertPlaceHolder>" ; } bevatVerwerkingStoppendeFouten ( ) { for ( nl . bzk . brp . model . validatie . Melding melding : getMeldingen ( ) ) { if ( ( ( melding . getSoort ( ) ) == ( nl . bzk . brp . model . algemeen . stamgegeven . ber . SoortMelding . DEBLOKKEERBAAR ) ) || ( ( melding . getSoort ( ) ) == ( nl . bzk . brp . model . algemeen . stamgegeven . ber . SoortMelding . FOUT ) ) ) { return true ; } } return false ; }
org . junit . Assert . assertEquals ( false , resultaat . bevatVerwerkingStoppendeFouten ( ) )
testGetText ( ) { java . lang . String s = util . getText ( new java . io . File ( "README.md" ) , "UTF-8" ) ; "<AssertPlaceHolder>" ; } getText ( java . io . File , java . lang . String ) { try ( java . io . InputStream is = new java . io . BufferedInputStream ( new java . io . FileInputStream ( file ) ) ; java . io . ByteArrayOutputStream memory = new java . io . ByteArrayOutputStream ( ) ) { byte [ ] bytes = new byte [ 1024 ] ; int i ; while ( true ) { i = is . read ( bytes ) ; if ( i == ( - 1 ) ) { break ; } else { memory . write ( bytes , 0 , i ) ; } } java . nio . ByteBuffer bbuf = java . nio . ByteBuffer . wrap ( memory . toByteArray ( ) ) ; java . nio . charset . Charset cset = getCharset ( charset ) ; java . nio . CharBuffer cbuf = cset . decode ( bbuf ) ; return cbuf . toString ( ) ; } catch ( java . io . IOException e ) { com . github . emailtohl . building . common . utils . TextUtil . logger . error ( ( ( "" + ( file . getName ( ) ) ) + "" ) , e ) ; throw new java . lang . RuntimeException ( ( ( "" + ( file . getName ( ) ) ) + "" ) ) ; } }
org . junit . Assert . assertNotNull ( s )
testPrincipalIfSSLPeerIsNotAuthenticated ( ) { javax . net . ssl . SSLSession session = mock ( javax . net . ssl . SSLSession . class ) ; when ( session . getPeerPrincipal ( ) ) . thenReturn ( KafkaPrincipal . ANONYMOUS ) ; org . apache . kafka . common . security . authenticator . DefaultKafkaPrincipalBuilder builder = new org . apache . kafka . common . security . authenticator . DefaultKafkaPrincipalBuilder ( null , null ) ; org . apache . kafka . common . security . auth . KafkaPrincipal principal = builder . build ( new org . apache . kafka . common . security . auth . SslAuthenticationContext ( session , java . net . InetAddress . getLocalHost ( ) , SecurityProtocol . PLAINTEXT . name ( ) ) ) ; "<AssertPlaceHolder>" ; builder . close ( ) ; verify ( session , atLeastOnce ( ) ) . getPeerPrincipal ( ) ; } name ( ) { return name ; }
org . junit . Assert . assertEquals ( KafkaPrincipal . ANONYMOUS , principal )
testFixed ( ) { org . apache . avro . Schema expected = org . apache . avro . Schema . createFixed ( "myfixed" , null , null , 16 ) ; expected . addAlias ( "myOldFixed" ) ; org . apache . avro . Schema schema = org . apache . avro . SchemaBuilder . fixed ( "myfixed" ) . aliases ( "myOldFixed" ) . size ( 16 ) ; "<AssertPlaceHolder>" ; } size ( int ) { n = ( n << 1 ) ^ ( n > > 31 ) ; if ( n <= ( ( 1 << ( 7 * 1 ) ) - 1 ) ) return 1 ; if ( n <= ( ( 1 << ( 7 * 2 ) ) - 1 ) ) return 2 ; if ( n <= ( ( 1 << ( 7 * 3 ) ) - 1 ) ) return 3 ; if ( n <= ( ( 1 << ( 7 * 4 ) ) - 1 ) ) return 4 ; return 5 ; }
org . junit . Assert . assertEquals ( expected , schema )
shouldGiveTheSameInstanceOfAnnotatedSingletonClassWithinAScenario ( ) { factory = new cucumber . runtime . java . guice . impl . GuiceFactory ( injector ( cucumber . api . guice . CucumberModules . createScenarioModule ( ) ) ) ; instancesFromSameScenario = getInstancesFromSameScenario ( factory , cucumber . runtime . java . guice . impl . GuiceFactoryTest . AnnotatedSingletonClass . class ) ; "<AssertPlaceHolder>" ; } elementsAreAllEqual ( ) { return new cucumber . runtime . java . guice . matcher . ElementsAreAllEqualMatcher < E > ( ) ; }
org . junit . Assert . assertThat ( instancesFromSameScenario , elementsAreAllEqual ( ) )
testNativeSortView1 ( ) { org . nd4j . linalg . api . ndarray . INDArray matrix = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . linspace ( 0 , 9 , 10 , DataType . DOUBLE ) ; int cnt = 0 ; for ( long i = ( matrix . rows ( ) ) - 1 ; i >= 0 ; i -- ) { matrix . getRow ( ( ( int ) ( i ) ) ) . assign ( cnt ) ; cnt ++ ; } org . nd4j . linalg . factory . Nd4j . sort ( matrix . getColumn ( 0 ) , true ) ; log . info ( "Matrix:<sp>{}" , matrix ) ; "<AssertPlaceHolder>" ; } getColumn ( long ) { org . nd4j . linalg . factory . Nd4j . getCompressor ( ) . autoDecompress ( this ) ; if ( ( isColumnVector ( ) ) && ( c == 0 ) ) return this ; else if ( ( isColumnVector ( ) ) && ( c > 0 ) ) throw new java . lang . IllegalArgumentException ( "Illegal<sp>index<sp>for<sp>column" ) ; return tensorAlongDimension ( c , 0 ) ; }
org . junit . Assert . assertEquals ( exp , matrix . getColumn ( 0 ) )
trimLabelsMilliseconds3 ( ) { java . util . List < java . lang . String > input = java . util . Arrays . asList ( "2014/11/26<sp>09:01:00.000000000" , "2014/11/26<sp>09:02:00.020000000" , "2014/11/26<sp>09:03:00.040000000" , "2014/11/26<sp>09:04:00.060000000" , "2014/11/26<sp>09:05:00.080000000" ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( "2014/11/26<sp>09:01:00.00" , "09:02:00.02" , "09:03:00.04" , "09:04:00.06" , "09:05:00.08" ) ; java . util . List < java . lang . String > found = org . diirt . graphene . TimeScales . trimLabels ( input ) ; "<AssertPlaceHolder>" ; } trimLabels ( java . util . List ) { if ( ( labels . size ( ) ) <= 1 ) { return labels ; } int greatestChangingPrecision = org . diirt . graphene . TimeScales . calculateGreatestChangingField ( labels ) ; java . util . ArrayList < java . lang . String > rtn = new java . util . ArrayList < java . lang . String > ( labels . size ( ) ) ; org . diirt . graphene . TimeScales . DateTrimmer firstDate = new org . diirt . graphene . TimeScales . DateTrimmer ( labels . get ( 0 ) ) ; rtn . add ( firstDate . getCompactForm ( org . diirt . graphene . TimeScales . DateTrimmer . NO_PRECISION , greatestChangingPrecision ) ) ; for ( int i = 1 ; i < ( labels . size ( ) ) ; i ++ ) { java . lang . String prevLabel = labels . get ( ( i - 1 ) ) ; java . lang . String nextLabel = labels . get ( i ) ; int redundancePrecision = org . diirt . graphene . TimeScales . greatestRedundancePrecision ( prevLabel , nextLabel ) ; org . diirt . graphene . TimeScales . DateTrimmer f = new org . diirt . graphene . TimeScales . DateTrimmer ( nextLabel ) ; java . lang . String trimmedLabel = f . getCompactForm ( redundancePrecision , greatestChangingPrecision ) ; rtn . add ( trimmedLabel ) ; } return rtn ; }
org . junit . Assert . assertThat ( found , equalTo ( expected ) )
forEachWithIndex ( ) { org . eclipse . collections . api . collection . MutableCollection < java . lang . Integer > result = org . eclipse . collections . impl . set . mutable . UnifiedSet . newSet ( ) ; this . classUnderTest ( ) . forEachWithIndex ( ( object , index ) -> result . add ( object ) ) ; "<AssertPlaceHolder>" ; } classUnderTest ( ) { return SortedBags . immutable . empty ( ) ; }
org . junit . Assert . assertEquals ( this . classUnderTest ( ) , result )
testOneOfWithNamedIndividuals ( ) { java . lang . String owl = "Prefix(owl:=<http://www.w3.org/2002/07/owl#>)\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( "Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)\n" + "import<sp>org.drools.semantics.NamedIndividual;\n" 2 ) + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n" ) + "Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)\n" ) + "end<sp>\n" 0 ) + "end<sp>\n" 0 ) + "end<sp>\n" 1 ) + "end<sp>\n" 0 ) + "import<sp>org.drools.semantics.NamedIndividual;\n" 3 ) + "Declaration(Class(<http://t/x#Y>))\n" ) + "end<sp>\n" 4 ) + "import<sp>org.drools.semantics.NamedIndividual;\n" 5 ) + "Declaration(NamedIndividual(<http://t/x#b>))\n" ) + "import<sp>org.drools.semantics.NamedIndividual;\n" 9 ) ; java . lang . String drl2 = "end<sp>\n" 2 + ( ( ( ( ( ( ( ( "import<sp>org.drools.semantics.NamedIndividual;\n" + "import<sp>org.drools.semantics.NamedIndividual;\n" 1 ) + "rule<sp>Init<sp>when<sp>\n" ) + "then<sp>\n" ) + "import<sp>org.drools.semantics.NamedIndividual;\n" 0 http : org . drools . io . Resource res = org . drools . io . ResourceFactory . newByteArrayResource ( owl . getBytes ( ) ) ; org . semanticweb . owlapi . model . OWLOntology onto = factory . parseOntology ( res ) ; org . drools . semantics . builder . model . OntoModel ontoModel = factory . buildModel ( "import<sp>org.drools.semantics.NamedIndividual;\n" 8 , res , org . drools . semantics . builder . DLFactoryConfiguration . newConfiguration ( OntoModel . Mode . NONE , DLFactoryConfiguration . defaultAxiomGenerators ) ) ; java . lang . String drl = new org . drools . semantics . builder . reasoner . TemplateRecognitionRuleBuilder ( ) . createDRL ( onto , ontoModel ) ; org . drools . builder . KnowledgeBuilder kBuilder = org . drools . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; kBuilder . add ( new org . drools . io . impl . ByteArrayResource ( drl . getBytes ( ) ) , ResourceType . DRL ) ; kBuilder . add ( new org . drools . io . impl . ByteArrayResource ( drl2 . getBytes ( ) ) , ResourceType . DRL ) ; if ( kBuilder . hasErrors ( ) ) { org . junit . Assert . fail ( kBuilder . getErrors ( ) . toString ( ) ) ; } org . drools . KnowledgeBase kbase = org . drools . KnowledgeBaseFactory . newKnowledgeBase ( ) ; kbase . addKnowledgePackages ( kBuilder . getKnowledgePackages ( ) ) ; org . drools . runtime . StatefulKnowledgeSession kSession = kbase . newStatefulKnowledgeSession ( ) ; kSession . fireAllRules ( ) ; for ( java . lang . Object o : kSession . getObjects ( ) ) { System . err . println ( o ) ; } for ( java . lang . Object o : kSession . getObjects ( new org . drools . ClassObjectFilter ( org . drools . semantics . NamedIndividual . class ) ) ) { org . drools . semantics . NamedIndividual e = ( ( org . drools . semantics . NamedIndividual ) ( o ) ) ; "<AssertPlaceHolder>" ; } } hasTrait ( java . lang . String ) { return ( ( __$$dynamic_traits_map$$ ) != null ) && ( __$$dynamic_traits_map$$ . containsKey ( type ) ) ; }
org . junit . Assert . assertTrue ( ( ( org . drools . semantics . NamedIndividual ) ( o ) ) . hasTrait ( "end<sp>\n" 3 ) )
should_stay_one ( ) { gus . add ( new ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . GenerationUnit ( null , null , null , null ) ) ; ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . List < ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . GenerationUnit > result = ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . GenerationPackage . removeDuplicates ( gus ) ; "<AssertPlaceHolder>" ; } size ( ) { return keySet ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , result . size ( ) )
runTest ( ) { responderExample1 . runSimpleResponderExample ( ) ; responderExample2 . runSimpleResponderExample ( ) ; multipleRequesterResponder . runMultipleRequesterResponder ( ) ; java . lang . Thread . sleep ( 500 ) ; requesterExample . runSimpleRequesterExample ( "test:simple-queue2" , "test:simple-queue3" ) ; "<AssertPlaceHolder>" ; } isPassed ( ) { try { passedLatch . await ( 15 , TimeUnit . SECONDS ) ; } catch ( java . lang . InterruptedException e ) { return false ; } return ( passedLatch . getCount ( ) ) == 0 ; }
org . junit . Assert . assertTrue ( requesterExample . isPassed ( ) )
testManyCommandsOneConnection ( ) { org . junit . Assume . assumeTrue ( com . basho . riak . client . api . ITestClusterLifecycle . testLifecycle ) ; com . basho . riak . client . api . RiakClient client = null ; int i = 0 ; try { client = new com . basho . riak . client . api . RiakClient ( com . basho . riak . client . api . ITestClusterLifecycle . cluster ) ; com . basho . riak . client . api . ITestClusterLifecycle . cluster . start ( ) ; final com . basho . riak . client . core . query . Namespace namespace = new com . basho . riak . client . core . query . Namespace ( "plain" , java . lang . Integer . toString ( com . basho . riak . client . api . ITestClusterLifecycle . random . nextInt ( ) ) ) ; for ( i = 0 ; i < 1000 ; i ++ ) { createAndStoreObject ( client , new com . basho . riak . client . core . query . Location ( namespace , java . lang . Integer . toString ( i ) ) ) ; } } catch ( java . lang . Exception ex ) { logger . debug ( "Exception<sp>occurred" , ex ) ; logger . debug ( "Cluster<sp>state:<sp>{},<sp>iteration:<sp>{}" , com . basho . riak . client . api . ITestClusterLifecycle . cluster . getNodes ( ) . get ( 0 ) . getNodeState ( ) . toString ( ) , i ) ; org . junit . Assert . fail ( ex . getMessage ( ) ) ; } finally { final java . lang . Boolean shutdownClean = client . shutdown ( ) . get ( 3 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } } get ( long , com . basho . riak . client . core . TimeUnit ) { boolean succeed = latch . await ( timeout , unit ) ; if ( ! succeed ) { throw new com . basho . riak . client . core . TimeoutException ( ) ; } else if ( ( exception ) != null ) { if ( ( exception . getClass ( ) ) == ( com . basho . riak . client . core . ExecutionException . class ) ) { throw ( ( com . basho . riak . client . core . ExecutionException ) ( exception ) ) ; } throw new com . basho . riak . client . core . ExecutionException ( exception ) ; } else { return finalValue ; } }
org . junit . Assert . assertTrue ( shutdownClean )
verifyExtraMethodNames ( ) { java . lang . reflect . Method getExtraMethod = org . androidtransfuse . util . ExtraUtil . class . getMethod ( ExtraUtil . GET_EXTRA , android . os . Bundle . class , java . lang . String . class , boolean . class ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( getExtraMethod )
toLowerCase ( ) { java . util . Map < java . lang . String , java . lang . String > input = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; input . put ( "ONE" , "TWO" ) ; input . put ( null , "THREE" ) ; input . put ( "FOUR" , null ) ; java . util . Map < java . lang . String , java . lang . String > expected = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; expected . put ( "one" , "two" ) ; expected . put ( null , "three" ) ; expected . put ( "four" , null ) ; java . util . Map < java . lang . String , java . lang . String > actual = ezvcard . util . StringUtils . toLowerCase ( input ) ; "<AssertPlaceHolder>" ; } toLowerCase ( java . util . Map ) { java . util . Map < java . lang . String , java . lang . String > lowerCaseMap = new java . util . HashMap < java . lang . String , java . lang . String > ( map . size ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > entry : map . entrySet ( ) ) { java . lang . String key = entry . getKey ( ) ; key = ( key == null ) ? null : key . toLowerCase ( ) ; java . lang . String value = entry . getValue ( ) ; value = ( value == null ) ? null : value . toLowerCase ( ) ; lowerCaseMap . put ( key , value ) ; } return lowerCaseMap ; }
org . junit . Assert . assertEquals ( expected , actual )
testEnumPTypes ( ) { java . lang . String inputFile1 = tmpDir . copyResourceFileName ( "set1.txt" ) ; org . apache . crunch . Pipeline pipeline = new org . apache . crunch . impl . mr . MRPipeline ( org . apache . crunch . EnumPairIT . class ) ; org . apache . crunch . PCollection < java . lang . String > set1 = pipeline . readTextFile ( inputFile1 ) ; org . apache . crunch . PTable < java . lang . String , org . apache . crunch . EnumPairIT . etypes > data = set1 . parallelDo ( new org . apache . crunch . DoFn < java . lang . String , org . apache . crunch . Pair < java . lang . String , org . apache . crunch . EnumPairIT . etypes > > ( ) { @ org . apache . crunch . Override public void process ( java . lang . String input , org . apache . crunch . Emitter < org . apache . crunch . Pair < java . lang . String , org . apache . crunch . EnumPairIT . etypes > > emitter ) { emitter . emit ( new org . apache . crunch . Pair < java . lang . String , org . apache . crunch . EnumPairIT . etypes > ( input , org . apache . crunch . EnumPairIT . etypes . type1 ) ) ; } } , org . apache . crunch . types . writable . Writables . tableOf ( org . apache . crunch . types . writable . Writables . strings ( ) , org . apache . crunch . types . PTypes . enums ( org . apache . crunch . EnumPairIT . etypes . class , set1 . getTypeFamily ( ) ) ) ) ; java . lang . Iterable < org . apache . crunch . Pair < java . lang . String , org . apache . crunch . EnumPairIT . etypes > > materialized = data . materialize ( ) ; pipeline . run ( ) ; for ( org . apache . crunch . Pair < java . lang . String , org . apache . crunch . EnumPairIT . etypes > pair : materialized ) { "<AssertPlaceHolder>" ; } } second ( ) { return second ; }
org . junit . Assert . assertEquals ( org . apache . crunch . EnumPairIT . etypes . type1 , pair . second ( ) )
testSerialization ( ) { final org . apache . hc . core5 . net . URIAuthority orig = new org . apache . hc . core5 . net . URIAuthority ( "somehost" , 8080 ) ; final java . io . ByteArrayOutputStream outbuffer = new java . io . ByteArrayOutputStream ( ) ; final java . io . ObjectOutputStream outStream = new java . io . ObjectOutputStream ( outbuffer ) ; outStream . writeObject ( orig ) ; outStream . close ( ) ; final byte [ ] raw = outbuffer . toByteArray ( ) ; final java . io . ByteArrayInputStream inBuffer = new java . io . ByteArrayInputStream ( raw ) ; final java . io . ObjectInputStream inStream = new java . io . ObjectInputStream ( inBuffer ) ; final org . apache . hc . core5 . net . URIAuthority clone = ( ( org . apache . hc . core5 . net . URIAuthority ) ( inStream . readObject ( ) ) ) ; "<AssertPlaceHolder>" ; } toByteArray ( ) { final java . nio . ByteBuffer dup = this . buf . duplicate ( ) ; dup . flip ( ) ; final byte [ ] bytes = new byte [ dup . remaining ( ) ] ; dup . get ( bytes ) ; return bytes ; }
org . junit . Assert . assertEquals ( orig , clone )
testNoSubgraph ( ) { edu . ucla . sspace . graph . Graph < edu . ucla . sspace . graph . Edge > g = new edu . ucla . sspace . graph . SparseUndirectedGraph ( ) ; for ( int i = 1 ; i < 9 ; i ++ ) { g . add ( i ) ; } edu . ucla . sspace . graph . SubgraphIterator < edu . ucla . sspace . graph . Edge , edu . ucla . sspace . graph . Graph < edu . ucla . sspace . graph . Edge > > iter = new edu . ucla . sspace . graph . SubgraphIterator < edu . ucla . sspace . graph . Edge , edu . ucla . sspace . graph . Graph < edu . ucla . sspace . graph . Edge > > ( g , 3 ) ; int numSubgraphs = 0 ; while ( iter . hasNext ( ) ) { iter . next ( ) ; numSubgraphs ++ ; } "<AssertPlaceHolder>" ; } next ( ) { if ( ( next ) == null ) throw new java . util . NoSuchElementException ( "No<sp>futher<sp>entries" ) ; edu . ucla . sspace . matrix . MatrixEntry me = next ; try { next = advance ( ) ; } catch ( java . io . IOException ioe ) { throw new java . io . IOError ( ioe ) ; } return me ; }
org . junit . Assert . assertEquals ( 0 , numSubgraphs )
stop ( ) { java . lang . String aMessage = "helloFromRun" ; java . io . InputStream stream = new java . io . ByteArrayInputStream ( aMessage . getBytes ( ) ) ; externalProcessReader = new com . att . aro . core . commandline . impl . ExternalProcessReaderImpl ( ) ; externalProcessReader . setInputStream ( stream ) ; subscriber = org . mockito . Mockito . mock ( com . att . aro . core . commandline . IExternalProcessReaderSubscriber . class ) ; externalProcessReader . addSubscriber ( subscriber ) ; org . mockito . Mockito . doAnswer ( new org . mockito . stubbing . Answer < java . lang . Object > ( ) { @ com . att . aro . core . commandline . impl . Override public java . lang . Object answer ( org . mockito . invocation . InvocationOnMock invocation ) throws java . lang . Throwable { java . lang . String method = invocation . getMethod ( ) . getName ( ) ; java . lang . Object [ ] args = invocation . getArguments ( ) ; if ( method . equals ( "newMessage" ) ) { if ( ( args [ 0 ] ) != null ) { com . att . aro . core . commandline . impl . ExternalProcessReaderImplTest . message += ( ( java . lang . String ) ( args [ 0 ] ) ) ; } } return null ; } } ) . when ( subscriber ) . newMessage ( org . mockito . Mockito . anyString ( ) ) ; externalProcessReader . setStop ( ) ; externalProcessReader . run ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( ( obj == null ) || ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) ) { return false ; } com . att . aro . core . peripheral . pojo . CollectOptions other = ( ( com . att . aro . core . peripheral . pojo . CollectOptions ) ( obj ) ) ; if ( ( attnrProfile ) != ( other . attnrProfile ) ) { return false ; } if ( ( attnrProfileName ) == null ) { if ( ( other . attnrProfileName ) != null ) { return false ; } } else if ( ! ( attnrProfileName . equals ( other . attnrProfileName ) ) ) { return false ; } if ( ( dsDelay ) != ( other . dsDelay ) ) { return false ; } if ( ( orientation ) != ( other . orientation ) ) { return false ; } if ( ( secureStatus ) != ( other . secureStatus ) ) { return false ; } if ( ( throttleDL ) != ( other . throttleDL ) ) { return false ; } if ( ( throttleUL ) != ( other . throttleUL ) ) { return false ; } if ( ( totalLines ) != ( other . totalLines ) ) { return false ; } if ( ( usDelay ) != ( other . usDelay ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( com . att . aro . core . commandline . impl . ExternalProcessReaderImplTest . message . equals ( "" ) )
testDoMainXargsFileViaProperty ( ) { java . lang . System . setProperty ( "org.eclipse.concierge.init.xargs" , "someunknownfileviaproperty.xargs" ) ; org . eclipse . concierge . Concierge framework = org . eclipse . concierge . Concierge . doMain ( new java . lang . String [ ] { } ) ; "<AssertPlaceHolder>" ; framework . stop ( ) ; } doMain ( java . lang . String [ ] ) { final org . eclipse . concierge . compat . service . XargsFileLauncher xargsLauncher = new org . eclipse . concierge . compat . service . XargsFileLauncher ( System . err ) ; java . lang . String xargsFile = null ; final java . lang . StringBuffer argsBuf = new java . lang . StringBuffer ( ) ; for ( int i = 0 ; ( args != null ) && ( i < ( args . length ) ) ; i ++ ) { if ( "-all" 0.e qualsIgnoreCase ( args [ i ] ) ) { System . err . println ( ( "" + ( ( ( ( ( ( ( ( ( "-all" 7 + "<sp>{file.xargs}<sp>" ) + "Loads<sp>xargs<sp>file,<sp>must<sp>end<sp>with<sp>.xargs\n" ) + "-start" 1 ) + "Install<sp>and<sp>start<sp>one<sp>bundle<sp>(can<sp>be<sp>used<sp>multiple<sp>times,<sp>in<sp>specified<sp>order)\n" ) + "-start" 3 ) + "Install<sp>and<sp>start<sp>all<sp>bundles<sp>from<sp>specified<sp>directory\n" ) + "-start" 0 ) + "-all" 9 ) + "-all" 1 ) ) ) ; return null ; } else if ( args [ i ] . endsWith ( ".xargs" ) ) { xargsFile = args [ i ] ; break ; } else { argsBuf . append ( args [ i ] ) ; if ( args [ i ] . startsWith ( "-start" 2 ) ) { argsBuf . append ( '\n' ) ; } else if ( ( ( ( ( args [ i ] . equalsIgnoreCase ( "-all" 2 ) ) || ( args [ i ] . equalsIgnoreCase ( "-all" 4 ) ) ) || ( args [ i ] . equalsIgnoreCase ( "-all" 6 ) ) ) || ( args [ i ] . equalsIgnoreCase ( "-start" ) ) ) || ( args [ i ] . equalsIgnoreCase ( "-all" ) ) ) { if ( ( i - 1 ) < ( args . length ) ) { i ++ ; argsBuf . append ( '<sp>' ) ; argsBuf . append ( args [ i ] ) ; argsBuf . append ( '\n' ) ; } } } } if ( ( xargsFile == null ) && ( ( argsBuf . length ( ) ) == 0 ) ) { xargsFile = java . lang . System . getProperty ( "-all" 8 ) ; if ( xargsFile == null ) { xargsFile = "init.xargs" ; } } final org . eclipse . concierge . Concierge fw ; if ( xargsFile != null ) { final java . io . File xargs = new java . io . File ( xargsFile ) ; if ( xargs . exists ( ) ) { fw = xargsLauncher . processXargsFile ( xargs ) ; } else { System . err . println ( ( ( "Concierge:<sp>xargs<sp>file<sp>'" + ( xargs . toString ( ) ) ) + "-all" 5 ) ) ; fw = ( ( org . eclipse . concierge . Concierge ) ( new org . eclipse . concierge . Factory ( ) . newFramework ( null ) ) ) ; fw . init ( ) ; fw . start ( ) ; } } else { java . io . InputStream inputStream = new java . io . ByteArrayInputStream ( argsBuf . toString ( ) . getBytes ( java . nio . charset . Charset . forName ( "-all" 3 ) ) ) ; final java . util . Map < java . lang . String , java . lang . String > passedProperties = xargsLauncher . getPropertiesFromXargsInputStream ( inputStream ) ; inputStream = new java . io . ByteArrayInputStream ( argsBuf . toString ( ) . getBytes ( java . nio . charset . Charset . forName ( "-all" 3 ) ) ) ; fw = xargsLauncher . processXargsInputStream ( passedProperties , inputStream ) ; } return fw ; }
org . junit . Assert . assertNotNull ( framework )
testSearchWithSpace ( ) { int total = 5 ; for ( int i = 0 ; i < total ; i ++ ) { com . liferay . data . engine . service . test . DEDataEngineTestUtil . insertDEDataDefinition ( _adminUser , _group , ( "Description<sp>" + i ) , ( "Name" + i ) , _deDataDefinitionService ) ; } com . liferay . data . engine . service . test . DEDataEngineTestUtil . insertDEDataDefinition ( _adminUser , _group , "Spaced<sp>Words<sp>" , "Name" , _deDataDefinitionService ) ; com . liferay . data . engine . service . test . DEDataEngineTestUtil . insertDEDataDefinition ( _adminUser , _group , "Spaced<sp>" , "Name" , _deDataDefinitionService ) ; java . util . List < com . liferay . data . engine . model . DEDataDefinition > deDataDefinitions = searchDEDataDefinitions ( _group , "Spaced<sp>Words" ) ; com . liferay . portal . search . test . util . IdempotentRetryAssert . retryAssert ( 3 , TimeUnit . SECONDS , ( ) -> { "<AssertPlaceHolder>" ; return null ; } ) ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( deDataDefinitions . toString ( ) , 2 , deDataDefinitions . size ( ) )
testGetTileCenterColor ( ) { System . out . println ( "getTileCenterColor" ) ; mudmap2 . backend . World instance = new mudmap2 . backend . World ( "MyWorld" ) ; java . awt . Color expResult = instance . tileCenterColor ; java . awt . Color result = instance . getTileCenterColor ( ) ; "<AssertPlaceHolder>" ; } getTileCenterColor ( ) { return tileCenterColor ; }
org . junit . Assert . assertEquals ( expResult , result )
testStageOnNothingIsNoOp ( ) { co . cask . coopr . store . provisioner . PluginMetaStoreService service = getPluginResourceMetaStoreService ( ) ; co . cask . coopr . store . provisioner . PluginResourceTypeView view = service . getResourceTypeView ( account1 , type1 ) ; co . cask . coopr . provisioner . plugin . ResourceMeta hadoop = new co . cask . coopr . provisioner . plugin . ResourceMeta ( "hadoop" , 1 , co . cask . coopr . provisioner . plugin . ResourceStatus . STAGED ) ; view . add ( hadoop ) ; view . stage ( hadoop . getName ( ) , ( ( hadoop . getVersion ( ) ) + 1 ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String , int ) { try { java . sql . Connection conn = dbConnectionPool . getConnection ( ) ; try { return getMeta ( conn , name , version ) ; } finally { conn . close ( ) ; } } catch ( java . sql . SQLException e ) { co . cask . coopr . store . provisioner . SQLPluginResourceTypeView . LOG . error ( "Exception<sp>getting<sp>metadata<sp>of<sp>version<sp>{}<sp>of<sp>resource<sp>{}<sp>for<sp>tenant<sp>{}." , version , name , tenant , e ) ; throw new java . io . IOException ( e ) ; } }
org . junit . Assert . assertEquals ( ResourceStatus . STAGED , view . get ( hadoop . getName ( ) , hadoop . getVersion ( ) ) . getStatus ( ) )
currentLeaseBeforeGettingALeaseGivesInvalidLease ( ) { org . terracotta . lease . Lease lease = leaseMaintainer . getCurrentLease ( ) ; "<AssertPlaceHolder>" ; } isValidAndContiguous ( org . terracotta . lease . Lease ) { return false ; }
org . junit . Assert . assertFalse ( lease . isValidAndContiguous ( lease ) )
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . calendar . model . CalendarBooking . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "calendarBookingId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "calendarBookingId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
two_Rekords_with_the_same_properties_have_the_same_hash_code ( ) { com . noodlesandwich . rekord . Rekord < com . noodlesandwich . rekord . Bier > bier = Bier . rekord . with ( Bier . volume , com . noodlesandwich . rekord . test . Measurement . of ( 568 ) . ml ( ) ) . with ( Bier . head , com . noodlesandwich . rekord . test . Measurement . of ( 2 ) . cm ( ) ) ; com . noodlesandwich . rekord . Rekord < com . noodlesandwich . rekord . Bier > anotherBier = Bier . rekord . with ( Bier . volume , com . noodlesandwich . rekord . test . Measurement . of ( 568 ) . ml ( ) ) . with ( Bier . head , com . noodlesandwich . rekord . test . Measurement . of ( 2 ) . cm ( ) ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return com . noodlesandwich . rekord . implementation . FixedRekordHelpers . hashCode ( this ) ; }
org . junit . Assert . assertThat ( bier . hashCode ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( anotherBier . hashCode ( ) ) ) )
testHeaders ( ) { java . util . Map < java . lang . String , java . lang . String > headers = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; headers . put ( HttpHeaders . CONTENT_TYPE , Request . CONTENT_TYPE_JSON ) ; headers . put ( HttpHeaders . ACCEPT , Request . UA_VERSION_JSON ) ; "<AssertPlaceHolder>" ; } getRequestHeaders ( ) { java . util . Map < java . lang . String , java . lang . String > headers = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; headers . put ( HttpHeaders . CONTENT_TYPE , com . urbanairship . api . reports . CONTENT_TYPE_JSON ) ; headers . put ( HttpHeaders . ACCEPT , com . urbanairship . api . reports . UA_VERSION_JSON ) ; return headers ; }
org . junit . Assert . assertEquals ( request . getRequestHeaders ( ) , headers )
multipleConstructorsCanBeDeserialized ( ) { com . google . firebase . database . MapperTest . MultipleConstructorBean bean = com . google . firebase . database . MapperTest . deserialize ( "{'value':<sp>'foo'}" , com . google . firebase . database . MapperTest . MultipleConstructorBean . class ) ; "<AssertPlaceHolder>" ; } deserialize ( java . lang . String , java . lang . Class ) { java . util . Map < java . lang . String , java . lang . Object > json = com . google . firebase . database . TestHelpers . fromSingleQuotedString ( jsonString ) ; return com . google . firebase . database . utilities . encoding . CustomClassMapper . convertToCustomClass ( json , clazz ) ; }
org . junit . Assert . assertEquals ( "foo" , bean . value )
givenEmptyOptional_thenValidationSucceeds ( ) { org . baeldung . User user = createUser ( ) ; java . util . Set < javax . validation . ConstraintViolation < org . baeldung . User > > violations = validator . validate ( user ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , violations . size ( ) )
getString_test ( ) { pref . edit ( ) . putString ( "string" , "value" ) . commit ( ) ; com . amazonaws . mobileconnectors . pinpoint . internal . core . system . AndroidPreferences preferences = new com . amazonaws . mobileconnectors . pinpoint . internal . core . system . AndroidPreferences ( context , com . amazonaws . mobileconnectors . pinpoint . internal . core . system . AndroidPreferencesTest . preferencesKey ) ; java . lang . String value = preferences . getString ( "string" , "other" ) ; "<AssertPlaceHolder>" ; } getString ( java . lang . String , java . lang . String ) { return preferences . getString ( key , optValue ) ; }
org . junit . Assert . assertThat ( value , org . hamcrest . Matchers . is ( "value" ) )
testLabel ( ) { org . apache . cayenne . access . jdbc . ColumnDescriptor column = new org . apache . cayenne . access . jdbc . ColumnDescriptor ( ) ; column . setDataRowKey ( "abc" ) ; "<AssertPlaceHolder>" ; } getDataRowKey ( ) { return ( dataRowKey ) != null ? dataRowKey : getName ( ) ; }
org . junit . Assert . assertEquals ( "abc" , column . getDataRowKey ( ) )
testXMLFormatNonStringValue ( ) { final org . apache . logging . log4j . message . ObjectMapMessage msg = new org . apache . logging . log4j . message . ObjectMapMessage ( ) . with ( "key" , 1L ) ; final java . lang . String result = msg . getFormattedMessage ( new java . lang . String [ ] { "XML" } ) ; final java . lang . String expected = "<Map>\n<sp><Entry<sp>key=\"key\">1</Entry>\n</Map>" ; "<AssertPlaceHolder>" ; } getFormattedMessage ( java . lang . String [ ] ) { if ( ( message ) != null ) { return message ; } return super . getFormattedMessage ( formats ) ; }
org . junit . Assert . assertEquals ( expected , result )
isActive_shouldBeInactiveAsOfDateForVoidedMembership ( ) { org . openmrs . CohortMembership newMember = new org . openmrs . CohortMembership ( 4 ) ; java . text . SimpleDateFormat dateFormat = new java . text . SimpleDateFormat ( "yyyy-MM-dd<sp>HH:mm:ss" ) ; java . util . Date startDate = dateFormat . parse ( "2017-01-01<sp>00:00:00" ) ; java . util . Date endDate = dateFormat . parse ( "2017-01-31<sp>00:00:00" ) ; newMember . setStartDate ( startDate ) ; newMember . setEndDate ( endDate ) ; newMember . setVoided ( true ) ; java . util . Date dateToTest = dateFormat . parse ( "2017-02-01<sp>00:00:00" ) ; "<AssertPlaceHolder>" ; } isActive ( java . util . Date ) { java . util . Date date = ( asOfDate == null ) ? new java . util . Date ( ) : asOfDate ; return ( ( ! ( this . getVoided ( ) ) ) && ( ( org . openmrs . util . OpenmrsUtil . compare ( startDate , date ) ) <= 0 ) ) && ( ( org . openmrs . util . OpenmrsUtil . compareWithNullAsLatest ( date , endDate ) ) <= 0 ) ; }
org . junit . Assert . assertFalse ( newMember . isActive ( dateToTest ) )
testMetricCollector ( ) { java . util . Map < java . lang . String , org . geoserver . status . monitoring . collector . SystemInfoCollector > collectors = org . geoserver . status . monitoring . SystemInfoCollectorTest . context . getBeansOfType ( org . geoserver . status . monitoring . collector . SystemInfoCollector . class ) ; "<AssertPlaceHolder>" ; org . geoserver . status . monitoring . collector . SystemInfoCollector systemInfoCollector = collectors . values ( ) . iterator ( ) . next ( ) ; org . geoserver . status . monitoring . collector . Metrics collected = systemInfoCollector . retrieveAllSystemInfo ( ) ; java . util . List < org . geoserver . status . monitoring . collector . MetricValue > metrics = collected . getMetrics ( ) ; for ( org . geoserver . status . monitoring . collector . MetricValue m : metrics ) { if ( m . getAvailable ( ) ) { System . out . println ( ( ( ( ( ( m . getName ( ) ) + "<sp>IS<sp>available<sp>-><sp>" ) + ( m . getValue ( ) ) ) + "<sp>" ) + ( m . getUnit ( ) ) ) ) ; } else { System . err . println ( ( ( m . getName ( ) ) + "<sp>IS<sp>NOT<sp>available" ) ) ; } collector . checkThat ( ( ( "Metric<sp>for<sp>" + ( m . getName ( ) ) ) + "<sp>available<sp>but<sp>value<sp>is<sp>not<sp>retrived" ) , ( ( ( m . getAvailable ( ) ) && ( ! ( m . getValue ( ) . equals ( BaseSystemInfoCollector . DEFAULT_VALUE ) ) ) ) || ( ( ! ( m . getAvailable ( ) ) ) && ( m . getValue ( ) . equals ( BaseSystemInfoCollector . DEFAULT_VALUE ) ) ) ) , org . hamcrest . CoreMatchers . equalTo ( true ) ) ; } } size ( ) { if ( ( featureCache ) != null ) { return featureCache . size ( ) ; } if ( ( org . geoserver . wfs . FeatureSizeFeatureCollection . FEATURE_CACHE_LIMIT ) > 0 ) { try { int count = featureSource . getCount ( query ) ; if ( count == 0 ) { featureCache = new java . util . ArrayList ( ) ; return count ; } if ( count > 0 ) { return count ; } java . util . List < org . opengis . feature . simple . SimpleFeature > tempFeatureCache = new java . util . ArrayList ( ) ; try ( org . geotools . data . simple . SimpleFeatureIterator it = featureSource . getFeatures ( query ) . features ( ) ) { count = 0 ; while ( it . hasNext ( ) ) { org . opengis . feature . simple . SimpleFeature feature = it . next ( ) ; if ( ( tempFeatureCache . size ( ) ) < ( org . geoserver . wfs . FeatureSizeFeatureCollection . FEATURE_CACHE_LIMIT ) ) { tempFeatureCache . add ( feature ) ; } count ++ ; } if ( count <= ( org . geoserver . wfs . FeatureSizeFeatureCollection . FEATURE_CACHE_LIMIT ) ) { featureCache = tempFeatureCache ; } else { tempFeatureCache . clear ( ) ; } return count ; } } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } return super . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , collectors . size ( ) )
initialization ( ) { ws . prova . service . ProvaService service = new ws . prova . service . impl . ProvaServiceImpl ( ) ; service . init ( ) ; "<AssertPlaceHolder>" ; service . destroy ( ) ; } init ( ) { id = java . util . UUID . randomUUID ( ) . toString ( ) ; engines = new java . util . concurrent . ConcurrentHashMap < java . lang . String , ws . prova . api2 . ProvaCommunicator > ( ) ; System . out . println ( ( ( "Prova<sp>Service<sp>" + ( id ) ) + "<sp>created" ) ) ; }
org . junit . Assert . assertNotNull ( service )
autoCreateDirCanBeDisabled ( ) { org . springframework . context . annotation . AnnotationConfigApplicationContext context = new org . springframework . context . annotation . AnnotationConfigApplicationContext ( ) ; org . springframework . boot . test . EnvironmentTestUtils . addEnvironment ( context , "autoCreateDir:false" ) ; context . register ( org . springframework . cloud . stream . module . ftp . FtpSinkPropertiesTests . Conf . class ) ; context . refresh ( ) ; org . springframework . cloud . stream . module . ftp . FtpSinkProperties properties = context . getBean ( org . springframework . cloud . stream . module . ftp . FtpSinkProperties . class ) ; "<AssertPlaceHolder>" ; } isAutoCreateDir ( ) { return this . autoCreateDir ; }
org . junit . Assert . assertTrue ( ( ! ( properties . isAutoCreateDir ( ) ) ) )
testCompletenessOfMissingActivityPosition ( ) { org . apache . taverna . scufl2 . api . profiles . ProcessorBinding pb = new org . apache . taverna . scufl2 . api . profiles . ProcessorBinding ( ) ; pb . setActivityPosition ( null ) ; org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator cv = new org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator ( ) ; org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener rcvl = new org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener ( ) ; cv . checkCorrectness ( pb , true , rcvl ) ; java . util . Set < org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem > nullFieldProblems = rcvl . getNullFieldProblems ( ) ; boolean problem = false ; for ( org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem nlp : nullFieldProblems ) { if ( ( nlp . getBean ( ) . equals ( pb ) ) && ( nlp . getFieldName ( ) . equals ( "activityPosition" ) ) ) { problem = true ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( getClass ( ) ) == ( obj . getClass ( ) ) ; }
org . junit . Assert . assertFalse ( problem )
givenDirectedGraph_whenGetStronglyConnectedSubgraphs_thenPathExistsBetweenStronglyconnectedVertices ( ) { org . jgrapht . alg . interfaces . StrongConnectivityAlgorithm < java . lang . String , org . jgrapht . graph . DefaultEdge > scAlg = new org . jgrapht . alg . KosarajuStrongConnectivityInspector ( directedGraph ) ; java . util . List < org . jgrapht . graph . DirectedSubgraph < java . lang . String , org . jgrapht . graph . DefaultEdge > > stronglyConnectedSubgraphs = scAlg . stronglyConnectedSubgraphs ( ) ; java . util . List < java . lang . String > stronglyConnectedVertices = new java . util . ArrayList ( stronglyConnectedSubgraphs . get ( 3 ) . vertexSet ( ) ) ; java . lang . String randomVertex1 = stronglyConnectedVertices . get ( 0 ) ; java . lang . String randomVertex2 = stronglyConnectedVertices . get ( 3 ) ; org . jgrapht . alg . shortestpath . AllDirectedPaths < java . lang . String , org . jgrapht . graph . DefaultEdge > allDirectedPaths = new org . jgrapht . alg . shortestpath . AllDirectedPaths ( directedGraph ) ; java . util . List < org . jgrapht . GraphPath < java . lang . String , org . jgrapht . graph . DefaultEdge > > possiblePathList = allDirectedPaths . getAllPaths ( randomVertex1 , randomVertex2 , false , stronglyConnectedVertices . size ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( possiblePathList . size ( ) ) > 0 ) )
paste_special_all ( ) { int tRow = 15 ; int lCol = 6 ; int bRow = 18 ; int rCol = 7 ; org . zkoss . test . zss . CellCacheAggeration . Builder builder = getCellCacheAggerationBuilder ( tRow , lCol , bRow , rCol ) ; org . zkoss . test . zss . CellCacheAggeration copyFrom = builder . build ( ) ; keyboardDirector . ctrlCopy ( tRow , lCol , bRow , rCol ) ; mouseDirector . openCellContextMenu ( 11 , 10 ) ; click ( ".z-menupopup:visible<sp>.zsmenuitem-pasteSpecial" ) ; click ( "$_pasteSpecialDialog<sp>$okBtn" ) ; "<AssertPlaceHolder>" ; } click ( org . zkoss . test . JQuery ) { timeBlocker . waitUntil ( new com . google . common . base . Predicate < java . lang . Void > ( ) { @ org . zkoss . test . zss . Override public boolean apply ( java . lang . Void input ) { return target . isVisible ( ) ; } } ) ; try { new org . zkoss . test . JavascriptActions ( webDriver ) . mouseOver ( target , MouseButton . LEFT ) . mouseDown ( target , MouseButton . LEFT ) . mouseUp ( target , MouseButton . LEFT ) . click ( target ) . perform ( ) ; } catch ( org . openqa . selenium . WebDriverException ex ) { } if ( ( browser . isSafari ( ) ) || ( browser . isGecko ( ) ) ) { timeBlocker . waitUntil ( 1 ) ; } timeBlocker . waitResponse ( ) ; }
org . junit . Assert . assertEquals ( copyFrom , builder . offset ( 11 , 10 ) . build ( ) )
getFileFromUriShouldReturnResultFromGetFromFileUriIfFileScheme ( ) { final android . net . Uri uri = android . net . Uri . parse ( "file:///storage/emulated/0/kouchat-1600x1600.png" ) ; final java . io . File tempFile = new java . io . File ( "tmp.txt" ) ; when ( androidFileUtils . getFileFromFileUri ( uri ) ) . thenReturn ( tempFile ) ; final java . io . File fileFromUri = androidFileUtils . getFileFromUri ( uri , contentResolver ) ; "<AssertPlaceHolder>" ; verify ( androidFileUtils ) . getFileFromFileUri ( uri ) ; } getFileFromUri ( android . net . Uri , android . content . ContentResolver ) { if ( uri == null ) { return null ; } if ( uri . getScheme ( ) . equals ( net . usikkert . kouchat . android . filetransfer . AndroidFileUtils . URI_SCHEME_CONTENT ) ) { return getFileFromContentUri ( uri , contentResolver ) ; } if ( uri . getScheme ( ) . equals ( net . usikkert . kouchat . android . filetransfer . AndroidFileUtils . URI_SCHEME_FILE ) ) { return getFileFromFileUri ( uri ) ; } return null ; }
org . junit . Assert . assertSame ( tempFile , fileFromUri )
testFindByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . RecentLayoutSetBranch newRecentLayoutSetBranch = addRecentLayoutSetBranch ( ) ; com . liferay . portal . kernel . model . RecentLayoutSetBranch existingRecentLayoutSetBranch = _persistence . findByPrimaryKey ( newRecentLayoutSetBranch . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingRecentLayoutSetBranch , newRecentLayoutSetBranch )
testAssertionGroupsRequestWithInternalArtifacts ( ) { System . out . println ( "\n***Starting<sp>testAssertionGroupsRequestWithInternalArtifacts" ) ; org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionGroupsRequest request = new org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionGroupsRequest ( ) ; org . ebayopensource . turmeric . services . assertionsservice . junit . AssertionGroupAsset reference = createAssertionGroup ( ) ; request . getAssertionGroups ( ) . add ( reference ) ; java . util . List < org . ebayopensource . turmeric . services . assertionsservice . junit . AssertableArtifact > artifacts = createInternalArtifacts ( ) ; request . getArtifacts ( ) . addAll ( artifacts ) ; java . lang . String result = processRequest ( request , org . ebayopensource . turmeric . services . assertionsservice . junit . POSITIVE_CASE ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "testAssertionGroupsRequestWithInternalArtifacts<sp>:<sp>" + result ) ) ; } processRequest ( org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionsRequest , java . lang . String ) { java . lang . String result = org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . FAIL ; try { org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionsResponse response = consumer . applyAssertions ( request ) ; if ( response == null ) { throw new org . ebayopensource . turmeric . runtime . common . exceptions . ServiceException ( null , "Response<sp>object<sp>can<sp>not<sp>be<sp>null" , null ) ; } if ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . validateServiceResponse ( response , criteria ) . equalsIgnoreCase ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . SUCCESS ) ) { result = org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . PASS ; } if ( ( result != ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . PASS ) ) || ( ! ( criteria . equals ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . POSITIVE_CASE ) ) ) ) { displayResponse ( response ) ; } } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; result = org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . FAIL ; } return result ; }
org . junit . Assert . assertEquals ( org . ebayopensource . turmeric . services . assertionsservice . junit . PASS , result )
testFindBoardsByUserActivityWithNoPermissionsOnTest ( ) { io . lavagna . service . Helper . createUser ( userRepository , "test" , "test-user" ) ; io . lavagna . service . User user = userRepository . findUserByName ( "test" , "test-user" ) ; io . lavagna . service . List < io . lavagna . service . ProjectWithEventCounts > projects = projectService . findProjectsActivityByUserInProjects ( user . getId ( ) , io . lavagna . service . Collections . < java . lang . Integer > emptyList ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( 0 , projects . size ( ) )
test ( ) { com . arjuna . ats . internal . jts . OTSImpleManager . current ( ) . begin ( ) ; com . hp . mwtests . ts . jts . local . transactions . DummyThread t = new com . hp . mwtests . ts . jts . local . transactions . DummyThread ( ) ; t . start ( ) ; t . join ( ) ; "<AssertPlaceHolder>" ; } transactional ( ) { return _transactional ; }
org . junit . Assert . assertTrue ( t . transactional ( ) )
testGetUsbEndpoints ( ) { final java . util . List < javax . usb . UsbEndpoint > endpoints = this . iface . getUsbEndpoints ( ) ; "<AssertPlaceHolder>" ; } getUsbEndpoints ( ) { return this . endpoints ; }
org . junit . Assert . assertEquals ( 0 , endpoints . size ( ) )
testFreeze ( ) { java . sql . Connection connection = connectionPool . getConnection ( ) ; java . lang . Thread . sleep ( 1000 ) ; "<AssertPlaceHolder>" ; connection . createStatement ( ) . executeQuery ( org . netcrusher . DbTest . SQL_CHECK ) ; crusher . freezeAllPairs ( ) ; reactor . getScheduler ( ) . schedule ( ( ) -> { crusher . unfreezeAllPairs ( ) ; return true ; } , 3000 , TimeUnit . MILLISECONDS ) ; connection . createStatement ( ) . executeQuery ( org . netcrusher . DbTest . SQL_CHECK ) ; connection . close ( ) ; } getClientAddresses ( ) { return reactor . getSelector ( ) . execute ( ( ) -> { if ( state . not ( State . CLOSED ) ) { return this . pairs . values ( ) . stream ( ) . map ( org . netcrusher . tcp . TcpPair :: getClientAddress ) . collect ( java . util . stream . Collectors . toList ( ) ) ; } else { return java . util . Collections . emptyList ( ) ; } } ) ; }
org . junit . Assert . assertEquals ( 1 , crusher . getClientAddresses ( ) . size ( ) )
testSet_AtomContainer_AtomContainer ( ) { org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer target = sp . parseSmiles ( "C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C" ) ; org . openscience . cdk . interfaces . IAtomContainer query = sp . parseSmiles ( "Nc1ccccc1" ) ; org . openscience . smsd . algorithm . rgraph . CDKMCSHandler instance = new org . openscience . smsd . algorithm . rgraph . CDKMCSHandler ( query , target , true , false , false ) ; "<AssertPlaceHolder>" ; } getFirstAtomMapping ( ) { if ( allAtomMCS . iterator ( ) . hasNext ( ) ) { return allAtomMCS . iterator ( ) . next ( ) ; } return new org . openscience . smsd . AtomAtomMapping ( source , target ) ; }
org . junit . Assert . assertNotNull ( instance . getFirstAtomMapping ( ) )
testDifferenceDaysStringString ( ) { int d = org . support . project . common . util . DateUtils . differenceDays ( "2015/01/01" , "2015/01/05" ) ; "<AssertPlaceHolder>" ; } differenceDays ( java . lang . String , java . lang . String ) { java . util . Date date1 = org . support . project . common . util . DateUtils . gateDayFormat ( ) . parse ( strDate1 ) ; java . util . Date date2 = org . support . project . common . util . DateUtils . gateDayFormat ( ) . parse ( strDate2 ) ; return org . support . project . common . util . DateUtils . differenceDays ( date1 , date2 ) ; }
org . junit . Assert . assertEquals ( ( - 4 ) , d )
canAddClosureAsASpec ( ) { org . gradle . api . specs . AndSpec < java . lang . Object > spec = new org . gradle . api . specs . AndSpec < java . lang . Object > ( createAtomicElements ( true ) ) ; spec = spec . and ( org . gradle . util . TestUtil . toClosure ( "{<sp>false<sp>}" ) ) ; "<AssertPlaceHolder>" ; } isSatisfiedBy ( T ) { org . gradle . api . specs . Spec < ? super T > [ ] specs = org . gradle . api . specs . OrSpec . getSpecsArray ( ) ; if ( ( specs . length ) == 0 ) { return true ; } for ( org . gradle . api . specs . Spec < ? super T > spec : specs ) { if ( spec . isSatisfiedBy ( object ) ) { return true ; } } return false ; }
org . junit . Assert . assertFalse ( spec . isSatisfiedBy ( new java . lang . Object ( ) ) )
givenStaticMap_whenUpdated_thenCorrect ( ) { MapInitializer . articleMapOne . put ( "NewArticle1" , "Convert<sp>array<sp>to<sp>List" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Integer ) { return emf . unwrap ( org . hibernate . SessionFactory . class ) . getCurrentSession ( ) . get ( org . baeldung . demo . model . Foo . class , id ) ; }
org . junit . Assert . assertEquals ( MapInitializer . articleMapOne . get ( "NewArticle1" ) , "Convert<sp>array<sp>to<sp>List" )
testExec1 ( ) { java . lang . String outputDateStr = convDateFormat . exec ( null ) ; "<AssertPlaceHolder>" ; } exec ( org . apache . pig . data . Tuple ) { if ( ( input == null ) || ( ( input . get ( 0 ) ) == null ) ) { return null ; } java . lang . String url = ( ( java . lang . String ) ( input . get ( 0 ) ) ) ; java . lang . String referer = ( ( java . lang . String ) ( input . get ( 1 ) ) ) ; java . lang . String userAgent = ( ( input . get ( 2 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 2 ) ) ) : "-" ; java . lang . String statusCode = ( ( input . get ( 3 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 3 ) ) ) : "-" ; java . lang . String ip = ( ( input . get ( 4 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 4 ) ) ) : "-" ; java . lang . String mimeType = ( ( input . get ( 5 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 5 ) ) ) : "-" ; java . lang . String requestMethod = ( ( input . get ( 6 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 6 ) ) ) : "-" ; org . wikimedia . analytics . kraken . pageview . Pageview pageview = new org . wikimedia . analytics . kraken . pageview . Pageview ( url , referer , userAgent , statusCode , ip , mimeType , requestMethod ) ; output = tupleFactory . newTuple ( 3 ) ; output . set ( 0 , ( pageview . isPageview ( ) ? 1 : 0 ) ) ; output . set ( 1 , ( pageview . isWebstatscollectorPageview ( ) ? 1 : 0 ) ) ; output . set ( 2 , ( pageview . isWikistatsMobileReportPageview ( ) ? 1 : 0 ) ) ; return output ; }
org . junit . Assert . assertNull ( outputDateStr )