input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testForbiddenReplacementRightPriorities ( ) { "<AssertPlaceHolder>" ; } getReplacedField ( ) { org . nuxeo . ecm . core . schema . types . SchemaImpl nuxeo = new org . nuxeo . ecm . core . schema . types . SchemaImpl ( "testSchema" , new org . nuxeo . ecm . core . schema . Namespace ( "hhtp://test.com/schema/test" , "tst" ) ) ; nuxeo . addField ( "test-test" , StringType . INSTANCE , null , 0 , null ) ; return service . createSchema ( nuxeo ) . getField ( "test__dash__test" ) ; } | org . junit . Assert . assertNotNull ( getReplacedField ( ) ) |
copyStringValidOutputStreamNegBufSz ( ) { java . lang . String probe = "A<sp>string<sp>⍅ï" ; java . io . ByteArrayOutputStream OutputStream = new org . apache . maven . shared . utils . io . IOUtilTest . DontCloseByteArrayOutputStream ( ) ; org . apache . maven . shared . utils . io . IOUtil . copy ( probe , OutputStream , ( - 1 ) ) ; "<AssertPlaceHolder>" ; } copy ( java . io . InputStream , java . io . OutputStream , int ) { final byte [ ] buffer = new byte [ bufferSize ] ; int n ; while ( ( - 1 ) != ( n = input . read ( buffer ) ) ) { output . write ( buffer , 0 , n ) ; } } | org . junit . Assert . assertThat ( OutputStream . toByteArray ( ) , org . hamcrest . CoreMatchers . is ( probe . getBytes ( ) ) ) |
HKEY_PERFORMANCE_NLSTEXT_getByShortName ( ) { "<AssertPlaceHolder>" ; } getRegistryHiveByName ( java . lang . String ) { return com . rapid7 . client . dcerpc . msrrp . dto . RegistryHive . registryHiveByName . get ( fullName . trim ( ) . toUpperCase ( ) ) ; } | org . junit . Assert . assertNull ( com . rapid7 . client . dcerpc . msrrp . dto . RegistryHive . getRegistryHiveByName ( "" ) ) |
testEvaluateTwoIndexThreeVarOrder3 ( ) { final org . eclipse . rdf4j . model . IRI superclass = org . apache . rya . indexing . external . AccumuloPcjIT . VF . createIRI ( "o" 3 ) ; final org . eclipse . rdf4j . model . IRI superclass2 = org . apache . rya . indexing . external . AccumuloPcjIT . VF . createIRI ( "uri:superclass2" ) ; conn . add ( subclass , RDF . TYPE , superclass ) ; conn . add ( subclass2 , RDF . TYPE , superclass2 ) ; conn . add ( obj , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloPcjIT . VF . createLiteral ( "label" ) ) ; conn . add ( obj2 , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloPcjIT . VF . createLiteral ( "label2" ) ) ; conn . add ( obj , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloPcjIT . VF . createLiteral ( "label" ) ) ; conn . add ( obj2 , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloPcjIT . VF . createLiteral ( "label2" ) ) ; final java . lang . String indexSparqlString = "" + ( ( ( ( "o" 9 + "o" 6 ) + "o" 7 ) + "<sp>?pig<sp><http://www.w3.org/2000/01/rdf-schema#label><sp>?duck<sp>" ) + "label2" 1 ) ; final java . lang . String indexSparqlString2 = "" + ( ( ( ( ( "label2" 0 + "o" 6 ) + "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" ) + "o" 1 ) + "<sp>?c<sp>a<sp>?f<sp>.<sp>" ) + "label2" 1 ) ; final java . lang . String queryString = "" + ( ( ( ( ( ( ( "o" 4 + "o" 6 ) + "o" 8 ) + "<sp>?e<sp><http://www.w3.org/2000/01/rdf-schema#label><sp>?l.<sp>" ) + "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" ) + "o" 1 ) + "<sp>?c<sp>a<sp>?f<sp>.<sp>" ) + "label2" 1 ) ; final org . apache . rya . indexing . external . AccumuloPcjIT . CountingResultHandler crh1 = new org . apache . rya . indexing . external . AccumuloPcjIT . CountingResultHandler ( ) ; final org . apache . rya . indexing . external . AccumuloPcjIT . CountingResultHandler crh2 = new org . apache . rya . indexing . external . AccumuloPcjIT . CountingResultHandler ( ) ; org . apache . rya . indexing . external . PcjIntegrationTestingUtil . createAndPopulatePcj ( conn , accCon , ( ( tablename ) + 1 ) , indexSparqlString , new java . lang . String [ ] { "dog" , "o" 0 , "label2" 3 } , com . google . common . base . Optional . absent ( ) ) ; org . apache . rya . indexing . external . PcjIntegrationTestingUtil . createAndPopulatePcj ( conn , accCon , ( ( tablename ) + 2 ) , indexSparqlString2 , new java . lang . String [ ] { "o" , "label2" 4 , "label2" 2 , "o" 5 , "o" 2 } , com . google . common . base . Optional . absent ( ) ) ; conn . prepareTupleQuery ( QueryLanguage . SPARQL , queryString ) . evaluate ( crh1 ) ; org . apache . rya . indexing . external . PcjIntegrationTestingUtil . deleteCoreRyaTables ( accCon , prefix ) ; pcjConn . prepareTupleQuery ( QueryLanguage . SPARQL , queryString ) . evaluate ( crh2 ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return count ; } | org . junit . Assert . assertEquals ( crh1 . getCount ( ) , crh2 . getCount ( ) ) |
testValueOf ( ) { org . everrest . core . impl . header . AcceptMediaType acceptMediaType = org . everrest . core . impl . header . AcceptMediaTypeTest . acceptMediaType ( "text" , "xml" ) ; when ( headerDelegate . fromString ( "text/xml" ) ) . thenReturn ( acceptMediaType ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String ) { return javax . ws . rs . ext . RuntimeDelegate . getInstance ( ) . createHeaderDelegate ( org . everrest . core . impl . header . AcceptMediaType . class ) . fromString ( header ) ; } | org . junit . Assert . assertSame ( acceptMediaType , org . everrest . core . impl . header . AcceptMediaType . valueOf ( "text/xml" ) ) |
shouldNotFlushCleanEntriesForNamespace ( ) { final org . apache . kafka . streams . state . internals . ThreadCache cache = new org . apache . kafka . streams . state . internals . ThreadCache ( logContext , 100000 , new org . apache . kafka . streams . processor . internals . MockStreamsMetrics ( new org . apache . kafka . common . metrics . Metrics ( ) ) ) ; final java . util . List < byte [ ] > received = new java . util . ArrayList ( ) ; cache . addDirtyEntryFlushListener ( namespace1 , ( dirty ) -> { for ( final org . apache . kafka . streams . state . internals . ThreadCache . DirtyEntry dirtyEntry : dirty ) { received . add ( dirtyEntry . key ( ) . get ( ) ) ; } } ) ; final java . util . List < byte [ ] > toInsert = java . util . Arrays . asList ( new byte [ ] { 0 } , new byte [ ] { 1 } , new byte [ ] { 2 } ) ; for ( final byte [ ] bytes : toInsert ) { cache . put ( namespace1 , org . apache . kafka . common . utils . Bytes . wrap ( bytes ) , cleanEntry ( bytes ) ) ; } cache . put ( namespace2 , org . apache . kafka . common . utils . Bytes . wrap ( new byte [ ] { 4 } ) , cleanEntry ( new byte [ ] { 4 } ) ) ; cache . flush ( namespace1 ) ; "<AssertPlaceHolder>" ; } flush ( java . util . Map ) { long nowMs = java . lang . System . currentTimeMillis ( ) ; for ( java . util . Map < java . lang . String , java . lang . Object > data : unflushed ) { data . put ( "time_ms" , nowMs ) ; data . put ( "flushed" , true ) ; java . lang . String dataJson ; try { dataJson = org . apache . kafka . connect . tools . VerifiableSinkTask . JSON_SERDE . writeValueAsString ( data ) ; } catch ( com . fasterxml . jackson . core . JsonProcessingException e ) { dataJson = "Bad<sp>data<sp>can't<sp>be<sp>written<sp>as<sp>json:<sp>" + ( e . getMessage ( ) ) ; } System . out . println ( dataJson ) ; } unflushed . clear ( ) ; } | org . junit . Assert . assertEquals ( java . util . Collections . emptyList ( ) , received ) |
server ( ) { org . jboss . hal . dmr . ResourceAddress input = new org . jboss . hal . dmr . ResourceAddress ( ) . add ( "host" , "*" ) . add ( "server" , "server-one" ) ; org . jboss . hal . dmr . ResourceAddress expected = new org . jboss . hal . dmr . ResourceAddress ( ) . add ( "host" , "*" ) . add ( "server" , "*" ) ; org . jboss . hal . dmr . ResourceAddress result = processor . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( org . jboss . hal . meta . AddressTemplate ) { org . jboss . hal . meta . AddressTemplate modified = org . jboss . hal . meta . AddressTemplate . ROOT ; if ( ( template != null ) && ( ! ( AddressTemplate . ROOT . equals ( template ) ) ) ) { java . util . List < java . lang . String [ ] > segments = stream ( template . spliterator ( ) , false ) . map ( ( segment ) -> { if ( segment . contains ( "=" ) ) { return com . google . common . base . Splitter . on ( '=' ) . omitEmptyStrings ( ) . trimResults ( ) . limit ( 2 ) . splitToList ( segment ) . toArray ( new java . lang . String [ 2 ] ) ; } return new java . lang . String [ ] { segment , null } ; } ) . collect ( toList ( ) ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; org . jboss . hal . meta . description . SegmentProcessor . process ( segments , ( segment ) -> { builder . append ( "/" ) . append ( segment [ 0 ] ) ; if ( ( segment [ 1 ] ) != null ) { builder . append ( "=" ) . append ( segment [ 1 ] ) ; } } ) ; modified = org . jboss . hal . meta . AddressTemplate . of ( builder . toString ( ) ) ; } org . jboss . hal . meta . description . ResourceDescriptionTemplateProcessor . logger . debug ( "{}<sp>-><sp>{}" , template , modified ) ; return modified ; } | org . junit . Assert . assertEquals ( expected , result ) |
rootPath ( ) { org . apache . hadoop . fs . Path path = new org . apache . hadoop . fs . Path ( "/foo" ) ; com . hotels . bdp . circustrain . distcpcopier . CircusTrainCopyListing . setRootPath ( conf , path ) ; "<AssertPlaceHolder>" ; } getRootPath ( org . apache . hadoop . conf . Configuration ) { java . lang . String pathString = conf . get ( com . hotels . bdp . circustrain . distcpcopier . CircusTrainCopyListing . CONF_ROOT_PATH ) ; if ( pathString == null ) { throw new com . hotels . bdp . circustrain . api . CircusTrainException ( "No<sp>root<sp>path<sp>was<sp>set." ) ; } return new org . apache . hadoop . fs . Path ( pathString ) ; } | org . junit . Assert . assertThat ( com . hotels . bdp . circustrain . distcpcopier . CircusTrainCopyListing . getRootPath ( conf ) , org . hamcrest . CoreMatchers . is ( path ) ) |
testGetParameters ( ) { java . lang . String strValue = "strValue" ; org . lnu . is . domain . mark . scale . MarkScale markScale = new org . lnu . is . domain . mark . scale . MarkScale ( ) ; markScale . setId ( 1L ) ; org . lnu . is . domain . mark . scale . value . MarkScaleValue entity = new org . lnu . is . domain . mark . scale . value . MarkScaleValue ( ) ; entity . setStrValue ( strValue ) ; entity . setMarkScale ( markScale ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "strValue" , strValue ) ; expected . put ( "markScale" , markScale ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; when ( markScaleDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( markScale ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; } | org . junit . Assert . assertEquals ( expected , actual ) |
getByUrlTest ( ) { System . out . print ( "-><sp>getByUrl()<sp>-<sp>" ) ; ua . com . alexcoffee . model . category . Category category = ua . com . alexcoffee . service . impl . CategoryServiceImplTest . categoryService . get ( ua . com . alexcoffee . service . impl . URL ) ; "<AssertPlaceHolder>" ; System . out . println ( "OK!" ) ; } get ( java . lang . String ) { if ( isEmpty ( title ) ) { throw new java . lang . IllegalArgumentException ( "No<sp>photo<sp>title!" ) ; } final ua . com . alexcoffee . model . photo . Photo photo = this . repository . findByTitle ( title ) ; if ( isNull ( photo ) ) { throw new java . lang . NullPointerException ( ( ( "Can't<sp>find<sp>photo<sp>by<sp>title<sp>" + title ) + "!" ) ) ; } return photo ; } | org . junit . Assert . assertNotNull ( category ) |
testDropTenantTableOnlyDeletesTenantData ( ) { java . util . Properties props = new java . util . Properties ( ) ; props . setProperty ( PhoenixRuntime . CURRENT_SCN_ATTRIB , java . lang . Long . toString ( nextTimestamp ( ) ) ) ; java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) , props ) ; try { conn . setAutoCommit ( true ) ; conn . createStatement ( ) . executeUpdate ( ( "delete<sp>from<sp>" + ( PARENT_TABLE_NAME ) ) ) ; conn . createStatement ( ) . executeUpdate ( ( ( "upsert<sp>into<sp>" + ( PARENT_TABLE_NAME ) ) + "<sp>(tenant_id,<sp>tenant_type_id,<sp>id,<sp>user)<sp>values<sp>('AC/DC',<sp>'abc',<sp>1,<sp>'Bon<sp>Scott')" ) ) ; conn . createStatement ( ) . executeUpdate ( ( ( ( ( ( ( "upsert<sp>into<sp>" + ( PARENT_TABLE_NAME ) ) + "<sp>(tenant_id,<sp>tenant_type_id,<sp>id,<sp>user)<sp>values<sp>('" ) + ( TENANT_ID ) ) + "',<sp>'" ) + ( TENANT_TYPE_ID ) ) + "',<sp>1,<sp>'Billy<sp>Gibbons')" ) ) ; conn . createStatement ( ) . executeUpdate ( ( ( ( ( "upsert<sp>into<sp>" + ( PARENT_TABLE_NAME ) ) + "<sp>(tenant_id,<sp>tenant_type_id,<sp>id,<sp>user)<sp>values<sp>('" ) + ( TENANT_ID ) ) + "',<sp>'def',<sp>1,<sp>'Billy<sp>Gibbons')" ) ) ; conn . close ( ) ; props = new java . util . Properties ( ) ; props . setProperty ( PhoenixRuntime . CURRENT_SCN_ATTRIB , java . lang . Long . toString ( nextTimestamp ( ) ) ) ; conn = java . sql . DriverManager . getConnection ( com . salesforce . phoenix . end2end . PHOENIX_JDBC_TENANT_SPECIFIC_URL , props ) ; conn . createStatement ( ) . execute ( ( "drop<sp>view<sp>" + ( TENANT_TABLE_NAME ) ) ) ; conn . close ( ) ; props = new java . util . Properties ( ) ; props . setProperty ( PhoenixRuntime . CURRENT_SCN_ATTRIB , java . lang . Long . toString ( nextTimestamp ( ) ) ) ; conn = java . sql . DriverManager . getConnection ( getUrl ( ) , props ) ; java . sql . ResultSet rs = conn . createStatement ( ) . executeQuery ( ( "select<sp>count(*)<sp>from<sp>" + ( PARENT_TABLE_NAME ) ) ) ; rs . next ( ) ; "<AssertPlaceHolder>" ; } finally { conn . close ( ) ; } } getInt ( java . lang . String ) { return getInt ( findColumn ( columnLabel ) ) ; } | org . junit . Assert . assertEquals ( 2 , rs . getInt ( 1 ) ) |
twoEdmxWithoutValidation ( ) { java . io . InputStream reader = createStreamReader ( edmxRefFor1680364709 ) ; org . apache . olingo . odata2 . client . api . edm . EdmDataServices result = org . apache . olingo . odata2 . client . api . ODataClient . newInstance ( ) . readMetadata ( reader , true ) ; "<AssertPlaceHolder>" ; } readMetadata ( java . io . InputStream , boolean ) { return new org . apache . olingo . odata2 . client . core . ep . deserializer . XmlMetadataDeserializer ( ) . readMetadata ( content , validate ) ; } | org . junit . Assert . assertNotNull ( result ) |
testRewriteBasicPomWithTagBase ( ) { java . util . List < org . apache . maven . project . MavenProject > reactorProjects = createReactorProjects ( "basic-pom-with-tag-base" ) ; org . apache . maven . shared . release . config . ReleaseDescriptorBuilder builder = createDescriptorFromProjects ( reactorProjects , "basic-pom-with-tag-base" ) ; builder . setScmTagBase ( "file://localhost/tmp/scm-repo/releases" ) ; mapNextVersion ( builder , "groupId:artifactId" ) ; phase . execute ( org . apache . maven . shared . release . config . ReleaseUtils . buildReleaseDescriptor ( builder ) , new org . apache . maven . shared . release . env . DefaultReleaseEnvironment ( ) , reactorProjects ) ; "<AssertPlaceHolder>" ; } comparePomFiles ( java . util . List ) { return comparePomFiles ( reactorProjects , true ) ; } | org . junit . Assert . assertTrue ( comparePomFiles ( reactorProjects ) ) |
testConstructorWithString ( ) { ast . Variable x = new ast . Variable ( "x" ) ; ast . Lambda toTest = new ast . Lambda ( "x" , x ) ; ast . Lambda reference = new ast . Lambda ( x , x ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( reference , toTest ) |
testGetName ( ) { org . apache . hadoop . hbase . rest . model . TableRegionModel model = buildTestModel ( ) ; java . lang . String modelName = model . getName ( ) ; org . apache . hadoop . hbase . HRegionInfo hri = new org . apache . hadoop . hbase . HRegionInfo ( org . apache . hadoop . hbase . TableName . valueOf ( org . apache . hadoop . hbase . rest . model . TestTableRegionModel . TABLE ) , org . apache . hadoop . hbase . rest . model . TestTableRegionModel . START_KEY , org . apache . hadoop . hbase . rest . model . TestTableRegionModel . END_KEY , false , org . apache . hadoop . hbase . rest . model . TestTableRegionModel . ID ) ; "<AssertPlaceHolder>" ; } getRegionNameAsString ( ) { if ( ( metaEntry ) != null ) { return metaEntry . getRegionNameAsString ( ) ; } else if ( ( hdfsEntry ) != null ) { if ( ( hdfsEntry . hri ) != null ) { return hdfsEntry . hri . getRegionNameAsString ( ) ; } } else { for ( org . apache . hadoop . hbase . util . HBaseFsck . OnlineEntry e : deployedEntries ) { return e . hri . getRegionNameAsString ( ) ; } } return null ; } | org . junit . Assert . assertEquals ( modelName , hri . getRegionNameAsString ( ) ) |
testTimeUUID ( ) { com . emc . storageos . db . client . model . Volume volume = new com . emc . storageos . db . client . model . Volume ( ) ; java . net . URI id1 = com . emc . storageos . db . client . URIUtil . createId ( com . emc . storageos . db . client . model . Volume . class ) ; java . net . URI pool1 = com . emc . storageos . db . client . URIUtil . createId ( com . emc . storageos . db . client . model . StoragePool . class ) ; volume . setId ( id1 ) ; volume . setLabel ( "volume1" ) ; volume . setPool ( pool1 ) ; volume . setInactive ( false ) ; volume . setAllocatedCapacity ( 1000L ) ; volume . setProvisionedCapacity ( 2000L ) ; volume . setAssociatedSourceVolume ( java . net . URI . create ( "test" ) ) ; volume . setVolumeGroupIds ( new com . emc . storageos . db . client . model . StringSet ( com . google . common . collect . Sets . newHashSet ( "v1" , "v2" ) ) ) ; getDbClient ( ) . updateObject ( volume ) ; com . emc . storageos . db . client . impl . DataObjectType doType = com . emc . storageos . db . client . impl . TypeMap . getDoType ( com . emc . storageos . db . client . model . Volume . class ) ; com . netflix . astyanax . connectionpool . OperationResult < com . netflix . astyanax . model . ColumnList < com . emc . storageos . db . client . impl . CompositeColumnName > > result = ( ( com . emc . storageos . db . client . impl . DbClientImpl ) ( getDbClient ( ) ) ) . getLocalContext ( ) . getKeyspace ( ) . prepareQuery ( doType . getCF ( ) ) . getKey ( volume . getId ( ) . toString ( ) ) . execute ( ) ; java . util . List < java . lang . Long > columnTimeUUIDStamps = new java . util . ArrayList < java . lang . Long > ( ) ; for ( com . netflix . astyanax . model . Column < com . emc . storageos . db . client . impl . CompositeColumnName > column : result . getResult ( ) ) { if ( ( column . getName ( ) . getTimeUUID ( ) ) != null ) { columnTimeUUIDStamps . add ( com . netflix . astyanax . util . TimeUUIDUtils . getMicrosTimeFromUUID ( column . getName ( ) . getTimeUUID ( ) ) ) ; } } java . util . Collections . sort ( columnTimeUUIDStamps ) ; for ( int i = 1 ; i < ( columnTimeUUIDStamps . size ( ) ) ; i ++ ) { "<AssertPlaceHolder>" ; } } get ( java . lang . String ) { com . emc . storageos . coordinator . client . service . impl . DualInetAddress address = getControllerNodeIPLookupMap ( ) . get ( nodeId ) ; if ( address == null ) { address = getExternalInetAddressLookupMap ( ) . get ( nodeId ) ; } return address ; } | org . junit . Assert . assertEquals ( 1 , ( ( columnTimeUUIDStamps . get ( i ) ) - ( columnTimeUUIDStamps . get ( ( i - 1 ) ) ) ) ) |
testFloatFromComputation ( ) { int x = 10 ; float theValue ; if ( x > 10 ) { theValue = de . mirkosertic . bytecoder . core . PHITest . floatValue ( ( - 10.0F ) ) ; } else { theValue = de . mirkosertic . bytecoder . core . PHITest . floatValue ( ( - 20.0F ) ) ; } "<AssertPlaceHolder>" ; } floatValue ( java . lang . Float ) { return aValue . floatValue ( ) ; } | org . junit . Assert . assertEquals ( ( - 20 ) , theValue , 0 ) |
testFindCorrespondingResultWhereClassResultNameIsNotSubstring ( ) { hudson . tasks . junit . ClassResult classResult = new hudson . tasks . junit . ClassResult ( null , "aaaa" ) ; hudson . tasks . junit . CaseResult caseResult = new hudson . tasks . junit . CaseResult ( null , "tc_bbbb" , null ) ; classResult . add ( caseResult ) ; hudson . tasks . test . TestResult result = classResult . findCorrespondingResult ( "tc_bbbb" ) ; "<AssertPlaceHolder>" ; } findCorrespondingResult ( java . lang . String ) { if ( ( getId ( ) . equals ( id ) ) || ( id == null ) ) { return this ; } java . lang . String firstElement = null ; java . lang . String subId = null ; int sepIndex = id . indexOf ( '/' ) ; if ( sepIndex < 0 ) { firstElement = id ; subId = null ; } else { firstElement = id . substring ( 0 , sepIndex ) ; subId = id . substring ( ( sepIndex + 1 ) ) ; if ( ( subId . length ( ) ) == 0 ) { subId = null ; } } java . lang . String packageName = null ; if ( firstElement . equals ( getId ( ) ) ) { sepIndex = subId . indexOf ( '/' ) ; if ( sepIndex < 0 ) { packageName = subId ; subId = null ; } else { packageName = subId . substring ( 0 , sepIndex ) ; subId = subId . substring ( ( sepIndex + 1 ) ) ; } } else { packageName = firstElement ; subId = null ; } hudson . tasks . junit . PackageResult child = byPackage ( packageName ) ; if ( child != null ) { if ( subId != null ) { return child . findCorrespondingResult ( subId ) ; } else { return child ; } } else { return null ; } } | org . junit . Assert . assertEquals ( caseResult , result ) |
testSort ( ) { int [ ] input = new int [ ] { 3 , 2 , 1 } ; int [ ] result = new int [ ] { 1 , 2 , 3 } ; chapter3 . bubblesort . JaegyuBubbleSort bubbleSort = new chapter3 . bubblesort . JaegyuBubbleSort ( ) ; "<AssertPlaceHolder>" ; } sort ( int [ ] ) { int p = 0 ; int r = ( input . length ) - 1 ; this . mergeSort ( input , p , r ) ; return input ; } | org . junit . Assert . assertArrayEquals ( result , bubbleSort . sort ( input ) ) |
testReducerValidValues ( ) { org . apache . hadoop . io . Text key = new org . apache . hadoop . io . Text ( "key123" ) ; co . nubetech . hiho . dedup . HihoTuple hihoTuple = new co . nubetech . hiho . dedup . HihoTuple ( ) ; hihoTuple . setKey ( key ) ; java . lang . String value1 = new java . lang . String ( "value1" ) ; java . lang . String value2 = new java . lang . String ( "value2" ) ; java . lang . String value3 = new java . lang . String ( "value3" ) ; java . util . ArrayList < java . lang . String > values = new java . util . ArrayList < java . lang . String > ( ) ; values . add ( value1 ) ; values . add ( value2 ) ; values . add ( value3 ) ; org . apache . hadoop . mapreduce . Reducer . Context context = mock ( Reducer . Context . class ) ; org . apache . hadoop . mapreduce . Counters counters = new org . apache . hadoop . mapreduce . Counters ( ) ; org . apache . hadoop . mapreduce . Counter counter = counters . findCounter ( DedupRecordCounter . OUTPUT ) ; when ( context . getCounter ( DedupRecordCounter . OUTPUT ) ) . thenReturn ( counter ) ; co . nubetech . hiho . dedup . DedupValueReducer dedupValueReducer = new co . nubetech . hiho . dedup . DedupValueReducer ( ) ; dedupValueReducer . reduce ( hihoTuple , values , context ) ; verify ( context ) . write ( value1 , key ) ; "<AssertPlaceHolder>" ; } write ( K , V ) { writeObject ( value ) ; out . write ( co . nubetech . hiho . mapreduce . lib . output . NoKeyOnlyValueOutputFormat . NoKeyRecordWriter . newline ) ; } | org . junit . Assert . assertEquals ( 1 , context . getCounter ( DedupRecordCounter . OUTPUT ) . getValue ( ) ) |
testEncodeDecodeNull ( ) { java . util . Map < java . lang . String , java . lang . String > empty = new java . util . HashMap ( ) ; byte [ ] encodedHeaders = com . workiva . frugal . protocol . HeaderUtils . encode ( null ) ; java . util . Map < java . lang . String , java . lang . String > decodedHeaders = com . workiva . frugal . protocol . HeaderUtils . decodeFromFrame ( encodedHeaders ) ; "<AssertPlaceHolder>" ; } decodeFromFrame ( byte [ ] ) { if ( ( bytes . length ) < 5 ) { throw new org . apache . thrift . protocol . TProtocolException ( org . apache . thrift . protocol . TProtocolException . INVALID_DATA , ( "invalid<sp>frame<sp>size<sp>" + ( bytes . length ) ) ) ; } if ( ( bytes [ 0 ] ) != ( com . workiva . frugal . protocol . HeaderUtils . V0 ) ) { throw new org . apache . thrift . protocol . TProtocolException ( org . apache . thrift . protocol . TProtocolException . BAD_VERSION , ( "unsupported<sp>header<sp>version<sp>" + ( bytes [ 0 ] ) ) ) ; } return com . workiva . frugal . protocol . HeaderUtils . readPairs ( bytes , 5 , ( ( com . workiva . frugal . util . ProtocolUtils . readInt ( bytes , 1 ) ) + 5 ) ) ; } | org . junit . Assert . assertEquals ( empty , decodedHeaders ) |
testBuildToolboxWithProfileRestrictions ( ) { when ( profileFilter . test ( eq ( org . kie . workbench . common . stunner . core . client . components . toolbox . actions . MorphActionsToolboxFactoryTest . MORPH_TARGET_ID ) ) ) . thenReturn ( false ) ; final java . util . Optional < org . kie . workbench . common . stunner . core . client . components . toolbox . Toolbox < ? > > toolbox = tested . build ( canvasHandler , element ) ; verify ( profileManager , times ( 1 ) ) . isDefinitionIdAllowed ( eq ( metadata ) ) ; "<AssertPlaceHolder>" ; } isPresent ( ) { return isPresent ; } | org . junit . Assert . assertFalse ( toolbox . isPresent ( ) ) |
shouldConvertFromStringJson ( ) { java . lang . String someJson = "[<sp>123,<sp>\"value\",<sp>true,<sp>[<sp>123<sp>],<sp>{<sp>\"sub\":<sp>\"obj\"<sp>}]" ; com . couchbase . client . java . document . json . JsonArray expected = com . couchbase . client . java . document . json . JsonArray . create ( ) . add ( 123 ) . add ( "value" ) . add ( true ) . add ( com . couchbase . client . java . document . json . JsonArray . from ( 123 ) ) . add ( com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "sub" , "obj" ) ) ; com . couchbase . client . java . document . json . JsonArray converted = com . couchbase . client . java . document . json . JsonArray . fromJson ( someJson ) ; "<AssertPlaceHolder>" ; } fromJson ( java . lang . String ) { try { return CouchbaseAsyncBucket . JSON_ARRAY_TRANSCODER . stringToJsonArray ( s ) ; } catch ( java . lang . Exception e ) { throw new java . lang . IllegalArgumentException ( "Cannot<sp>convert<sp>string<sp>to<sp>JsonArray" , e ) ; } } | org . junit . Assert . assertEquals ( expected , converted ) |
validCrl01 ( ) { java . security . cert . X509Certificate caCert = ( ( java . security . cert . X509Certificate ) ( com . itextpdf . signatures . testutils . Pkcs12FileHelper . readFirstChain ( ( ( com . itextpdf . signatures . verify . CrlVerifierTest . certsSrc ) + "rootRsa.p12" ) , com . itextpdf . signatures . verify . CrlVerifierTest . password ) [ 0 ] ) ) ; com . itextpdf . signatures . testutils . builder . TestCrlBuilder crlBuilder = new com . itextpdf . signatures . testutils . builder . TestCrlBuilder ( caCert , com . itextpdf . io . util . DateTimeUtil . addDaysToDate ( com . itextpdf . io . util . DateTimeUtil . getCurrentTimeDate ( ) , ( - 1 ) ) ) ; "<AssertPlaceHolder>" ; } verifyTest ( com . itextpdf . signatures . testutils . builder . TestOcspResponseBuilder ) { return verifyTest ( rootRsaOcspBuilder , ( ( com . itextpdf . signatures . verify . OcspVerifierTest . certsSrc ) + "signCertRsa01.p12" ) , com . itextpdf . io . util . DateTimeUtil . getCurrentTimeDate ( ) ) ; } | org . junit . Assert . assertTrue ( verifyTest ( crlBuilder ) ) |
testDoWork_None ( ) { final java . lang . String key = "foo:bar" ; final net . greghaines . jesque . meta . dao . impl . KeysDAORedisImpl . KeyDAOPoolWork work = new net . greghaines . jesque . meta . dao . impl . KeysDAORedisImpl . KeyDAOPoolWork ( key ) ; this . mockCtx . checking ( new org . jmock . Expectations ( ) { { oneOf ( jedis ) . type ( key ) ; will ( returnValue ( KeyType . NONE . toString ( ) ) ) ; } } ) ; final net . greghaines . jesque . meta . KeyInfo keyInfo = work . doWork ( this . jedis ) ; "<AssertPlaceHolder>" ; } doWork ( redis . clients . jedis . Jedis ) { doPublish ( jedis , getNamespace ( ) , channel , jobJson ) ; return null ; } | org . junit . Assert . assertNull ( keyInfo ) |
setReadOnly ( ) { connection . setReadOnly ( true ) ; "<AssertPlaceHolder>" ; } isReadOnly ( ) { return false ; } | org . junit . Assert . assertFalse ( connection . isReadOnly ( ) ) |
testBatchBigRequest ( ) { org . redisson . config . Config config = org . redisson . BaseTest . createConfig ( ) ; config . useSingleServer ( ) . setTimeout ( 15000 ) ; org . redisson . api . RedissonRxClient redisson = org . redisson . Redisson . createRx ( config ) ; org . redisson . api . RBatchRx batch = redisson . createBatch ( batchOptions ) ; for ( int i = 0 ; i < 210 ; i ++ ) { batch . getMap ( "test" ) . fastPut ( "1" , "2" ) ; batch . getMap ( "test" ) . fastPut ( "2" , "3" ) ; batch . getMap ( "test" ) . put ( "2" , "5" ) ; batch . getAtomicLong ( "counter" ) . incrementAndGet ( ) ; batch . getAtomicLong ( "counter" ) . incrementAndGet ( ) ; } org . redisson . api . BatchResult < ? > res = sync ( batch . execute ( ) ) ; "<AssertPlaceHolder>" ; redisson . shutdown ( ) ; } getResponses ( ) { return responses ; } | org . junit . Assert . assertEquals ( ( 210 * 5 ) , res . getResponses ( ) . size ( ) ) |
testDivideByZero ( ) { org . araqne . logdb . query . expr . Expression num = new org . araqne . logdb . query . expr . NumberConstant ( 10 ) ; org . araqne . logdb . query . expr . Expression divisor = new org . araqne . logdb . query . expr . NumberConstant ( 0 ) ; java . lang . Object ret = evaluate ( num , divisor ) ; "<AssertPlaceHolder>" ; } evaluate ( org . araqne . logdb . query . expr . Expression , org . araqne . logdb . query . expr . Expression ) { org . araqne . logdb . query . expr . Mod mod = new org . araqne . logdb . query . expr . Mod ( new org . araqne . logdb . QueryContext ( null ) , java . util . Arrays . asList ( num , divisor ) ) ; java . lang . Object ret = mod . eval ( new org . araqne . logdb . Row ( ) ) ; return ret ; } | org . junit . Assert . assertNull ( ret ) |
testBuildWithParametersAndDisabledDefaultConstraints ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . person . Person person = new org . lnu . is . domain . person . Person ( ) ; org . lnu . is . domain . address . type . AddressType addressType = new org . lnu . is . domain . address . type . AddressType ( ) ; org . lnu . is . domain . admin . unit . AdminUnit adminUnit = new org . lnu . is . domain . admin . unit . AdminUnit ( ) ; org . lnu . is . domain . street . type . StreetType streetType = new org . lnu . is . domain . street . type . StreetType ( ) ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; org . lnu . is . domain . person . address . PersonAddress context = new org . lnu . is . domain . person . address . PersonAddress ( ) ; context . setPerson ( person ) ; context . setAddressType ( addressType ) ; context . setAdminUnit ( adminUnit ) ; context . setStreetType ( streetType ) ; context . setBegDate ( begDate ) ; context . setEndDate ( endDate ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>PersonAddress<sp>e<sp>WHERE<sp>(<sp>e.person<sp>=<sp>:person<sp>AND<sp>e.addressType<sp>=<sp>:addressType<sp>AND<sp>e.adminUnit<sp>=<sp>:adminUnit<sp>AND<sp>e.streetType<sp>=:streetType<sp>AND<sp>e.begDate<sp><=<sp>:begDate<sp>AND<sp>e.endDate<sp>>=<sp>:endDate<sp>)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . person . address . PersonAddress > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
testSunnyDay ( ) { java . util . concurrent . Callable < java . lang . String > callback = new java . util . concurrent . Callable < java . lang . String > ( ) { public java . lang . String call ( ) throws org . springframework . batch . poller . scheduling . Exception { java . util . Set < java . lang . String > executions = new java . util . HashSet < java . lang . String > ( repository ) ; if ( executions . isEmpty ( ) ) { return null ; } return executions . iterator ( ) . next ( ) ; } } ; org . springframework . batch . poller . scheduling . TaskSchedulerPoller < java . lang . String > poller = new org . springframework . batch . poller . scheduling . TaskSchedulerPoller < java . lang . String > ( ) ; sleepAndCreateStringInBackground ( 500L ) ; java . lang . String value = poller . poll ( callback ) . get ( 1000L , TimeUnit . MILLISECONDS ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String , java . lang . Class ) { return parser . parseExpression ( expression ) . getValue ( context , target , type ) ; } | org . junit . Assert . assertEquals ( "foo" , value ) |
testDiToAvroDouble ( ) { org . apache . avro . Schema expectedSchema = org . talend . daikon . avro . AvroUtils . _double ( ) ; org . apache . avro . Schema designSchema = org . apache . avro . SchemaBuilder . builder ( ) . record ( "Record" ) . fields ( ) . name ( "booleanField" ) . type ( ) . booleanType ( ) . noDefault ( ) . endRecord ( ) ; org . talend . codegen . enforcer . IncomingSchemaEnforcer enforcer = new org . talend . codegen . enforcer . IncomingSchemaEnforcer ( designSchema ) ; org . apache . avro . Schema actualSchema = enforcer . diToAvro ( "id_Double" , null ) ; "<AssertPlaceHolder>" ; } diToAvro ( java . lang . String , java . lang . String ) { org . apache . avro . Schema fieldSchema = org . talend . daikon . avro . LogicalTypeUtils . getSchemaByLogicalType ( logicalType ) ; if ( fieldSchema != null ) { return fieldSchema ; } if ( "id_String" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . STRING ) ; } else if ( "id_Boolean" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . BOOLEAN ) ; } else if ( "id_Byte" 0.e quals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . INT ) ; } else if ( "id_Byte" 1.e quals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . LONG ) ; } else if ( "id_Double" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . DOUBLE ) ; } else if ( "id_Float" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . FLOAT ) ; } else if ( "id_Byte" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _byte ( ) ; } else if ( "id_Short" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _short ( ) ; } else if ( "id_Character" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _character ( ) ; } else if ( "id_BigDecimal" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _decimal ( ) ; } else if ( "id_Date" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _date ( ) ; } else { throw new java . lang . UnsupportedOperationException ( ( "Unrecognized<sp>type<sp>" + diType ) ) ; } return fieldSchema ; } | org . junit . Assert . assertEquals ( expectedSchema , actualSchema ) |
shouldNotOutputLogLinesOfFailingTestIfMaxLinesIsZero ( ) { com . facebook . buck . event . listener . TestResultFormatter formatter = createFormatterWithMaxLogLines ( 0 ) ; com . facebook . buck . test . TestCaseSummary summary = new com . facebook . buck . test . TestCaseSummary ( "com.example.FooTest" , com . google . common . collect . ImmutableList . of ( failingTest ) ) ; java . nio . file . Files . write ( logPath , com . google . common . collect . ImmutableList . of ( "None" , "of" , "these" , "will" , "appear" ) , StandardCharsets . UTF_8 ) ; com . facebook . buck . test . TestResults results = com . facebook . buck . test . TestResults . builder ( ) . setBuildTarget ( com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//foo:bar" ) ) . setTestCases ( com . google . common . collect . ImmutableList . of ( summary ) ) . addTestLogPaths ( logPath ) . build ( ) ; com . google . common . collect . ImmutableList . Builder < java . lang . String > builder = com . google . common . collect . ImmutableList . builder ( ) ; formatter . reportResult ( builder , results ) ; java . lang . String expected = java . lang . String . format ( com . google . common . base . Joiner . on ( '\n' ) . join ( "FAIL<sp>200ms<sp>0<sp>Passed<sp>0<sp>Skipped<sp>1<sp>Failed<sp>com.example.FooTest" , "FAILURE<sp>%s<sp>%s:<sp>%s" , "%s" ) , failingTest . getTestCaseName ( ) , failingTest . getTestName ( ) , failingTest . getMessage ( ) , stackTrace ) ; "<AssertPlaceHolder>" ; } toString ( com . google . common . collect . ImmutableList$Builder ) { return com . google . common . base . Joiner . on ( '\n' ) . join ( builder . build ( ) ) ; } | org . junit . Assert . assertEquals ( expected , toString ( builder ) ) |
testFromEbXML_MPQ ( ) { multiplePatientsQueryTransformer . toEbXML ( multiplePatientsQuery , ebXML ) ; org . openehealth . ipf . commons . ihe . xds . core . requests . query . FindDocumentsForMultiplePatientsQuery mpResult = new org . openehealth . ipf . commons . ihe . xds . core . requests . query . FindDocumentsForMultiplePatientsQuery ( ) ; multiplePatientsQueryTransformer . fromEbXML ( mpResult , ebXML ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . requests . query . GetAllQuery , org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLAdhocQueryRequest ) { if ( ( query == null ) || ( ebXML == null ) ) { return ; } org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper slots = new org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper ( ebXML ) ; java . lang . String patientId = slots . toString ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . PATIENT_ID ) ; query . setPatientId ( org . openehealth . ipf . commons . ihe . xds . core . metadata . Hl7v2Based . parse ( patientId , org . openehealth . ipf . commons . ihe . xds . core . metadata . Identifiable . class ) ) ; query . setStatusDocuments ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_STATUS ) ) ; query . setStatusFolders ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . FOLDER_STATUS ) ) ; query . setStatusSubmissionSets ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . SUBMISSION_SET_STATUS ) ) ; query . setConfidentialityCodes ( slots . toCodeQueryList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE , org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE_SCHEME ) ) ; query . setFormatCodes ( slots . toCodeList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_FORMAT_CODE ) ) ; query . setHomeCommunityId ( ebXML . getHome ( ) ) ; query . setDocumentEntryTypes ( slots . toDocumentEntryType ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_TYPE ) ) ; } | org . junit . Assert . assertEquals ( multiplePatientsQuery , mpResult ) |
testSingletonWithDefinedPredefinedKey ( ) { com . picocontainer . MutablePicoContainer mpc = new com . picocontainer . containers . JSR330PicoContainer ( ) . addComponent ( "test" , com . picocontainer . containers . JSR330PicoContainerTestCase . TestSingletonAnnotation . class ) . addComponent ( "test2" , com . picocontainer . containers . JSR330PicoContainerTestCase . TestSingletonAnnotation . class ) ; "<AssertPlaceHolder>" ; } getComponent ( com . googlecode . jtype . Generic ) { return null ; } | org . junit . Assert . assertSame ( mpc . getComponent ( "test" ) , mpc . getComponent ( "test" ) ) |
testApplyRowChangeRowSet ( ) { appendAbleRowSetRequest . setToAppend ( rowSet ) ; org . sagebionetworks . repo . model . table . TableUpdateResponse result = manager . applyRowChange ( mockProgressCallback , user , appendAbleRowSetRequest ) ; "<AssertPlaceHolder>" ; verify ( mockTableManagerSupport ) . getColumnModelsForTable ( viewId ) ; } applyRowChange ( org . sagebionetworks . common . util . progress . ProgressCallback , org . sagebionetworks . repo . model . UserInfo , org . sagebionetworks . repo . model . table . UploadToTableRequest ) { return tableUploadManager . uploadCSV ( progressCallback , user , change , this ) ; } | org . junit . Assert . assertNotNull ( result ) |
testNewChemSequence ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IChemSequence sequence = builder . newInstance ( org . openscience . cdk . interfaces . IChemSequence . class ) ; "<AssertPlaceHolder>" ; } getBuilder ( ) { return org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ; } | org . junit . Assert . assertNotNull ( sequence ) |
testSerialization ( ) { org . jfree . chart . renderer . xy . XYDifferenceRenderer r1 = new org . jfree . chart . renderer . xy . XYDifferenceRenderer ( java . awt . Color . RED , java . awt . Color . BLUE , false ) ; org . jfree . chart . renderer . xy . XYDifferenceRenderer r2 = ( ( org . jfree . chart . renderer . xy . XYDifferenceRenderer ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( r1 , r2 ) |
testNotEqualsNode1 ( ) { edu . ucla . sspace . dependency . DependencyTreeNode node1 = new edu . ucla . sspace . dependency . SimpleDependencyTreeNode ( "cat" , "n" , 0 ) ; edu . ucla . sspace . dependency . DependencyTreeNode node2 = new edu . ucla . sspace . dependency . SimpleDependencyTreeNode ( "doc" , "n" , 0 ) ; edu . ucla . sspace . dependency . DependencyTreeNode node3 = new edu . ucla . sspace . dependency . SimpleDependencyTreeNode ( "dog" , "n" , 0 ) ; edu . ucla . sspace . dependency . DependencyRelation rel1 = new edu . ucla . sspace . dependency . SimpleDependencyRelation ( node1 , "c" , node2 ) ; edu . ucla . sspace . dependency . DependencyRelation rel2 = new edu . ucla . sspace . dependency . SimpleDependencyRelation ( node3 , "c" , node2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return o instanceof org . tartarus . snowball . ext . portugueseStemmer ; } | org . junit . Assert . assertFalse ( rel1 . equals ( rel2 ) ) |
testGetMinBondOrderNoSuchAtom ( ) { org . openscience . cdk . interfaces . IAtomContainer container = ( ( org . openscience . cdk . interfaces . IAtomContainer ) ( newChemObject ( ) ) ) ; org . openscience . cdk . interfaces . IChemObjectBuilder builder = container . getBuilder ( ) ; org . openscience . cdk . interfaces . IAtom a1 = builder . newAtom ( ) ; org . openscience . cdk . interfaces . IAtom a2 = builder . newAtom ( ) ; container . addAtom ( a1 ) ; "<AssertPlaceHolder>" ; } getMinimumBondOrder ( org . openscience . cdk . interfaces . IAtom ) { org . openscience . cdk . interfaces . IBond . Order min = null ; for ( org . openscience . cdk . interfaces . IBond bond : bonds ( ) ) { if ( ! ( bond . contains ( atom ) ) ) continue ; if ( ( min == null ) || ( ( bond . getOrder ( ) . numeric ( ) ) < ( min . numeric ( ) ) ) ) { min = bond . getOrder ( ) ; } } if ( min == null ) { if ( ! ( contains ( atom ) ) ) throw new org . openscience . cdk . exception . NoSuchAtomException ( "Atom<sp>does<sp>not<sp>belong<sp>to<sp>this<sp>container!" ) ; if ( ( ( atom . getImplicitHydrogenCount ( ) ) != null ) && ( ( atom . getImplicitHydrogenCount ( ) ) > 0 ) ) min = org . openscience . cdk . interfaces . IBond . Order . SINGLE ; else min = org . openscience . cdk . interfaces . IBond . Order . UNSET ; } return min ; } | org . junit . Assert . assertThat ( container . getMinimumBondOrder ( a2 ) , org . hamcrest . CoreMatchers . is ( IBond . Order . UNSET ) ) |
testGetStudiesMeasuringLabelModel ( ) { d_wizard . getIndicationModel ( ) . setValue ( d_wizard . getIndicationsModel ( ) . get ( 0 ) ) ; d_wizard . getOutcomeMeasureModel ( ) . setValue ( d_wizard . getAvailableOutcomeMeasures ( ) . get ( 0 ) ) ; org . drugis . addis . entities . Indication indic = d_wizard . getIndicationsModel ( ) . get ( 0 ) ; org . drugis . addis . entities . OutcomeMeasure endp = ( ( org . drugis . addis . entities . OutcomeMeasure ) ( d_wizard . getOutcomeMeasureModel ( ) . getValue ( ) ) ) ; d_wizard . getIndicationModel ( ) . setValue ( indic ) ; d_wizard . getOutcomeMeasureModel ( ) . setValue ( endp ) ; com . jgoodies . binding . value . ValueModel model = d_wizard . getStudiesMeasuringLabelModel ( ) ; java . lang . String endpVal = endp . toString ( ) ; java . lang . String indVal = indic . toString ( ) ; java . lang . String correctString = ( ( "Studies<sp>measuring<sp>" + indVal ) + "<sp>on<sp>" ) + endpVal ; "<AssertPlaceHolder>" ; } getValue ( ) { if ( ( super . getValue ( ) ) == null ) { return initializePlaceholder ( ) ; } return super . getValue ( ) ; } | org . junit . Assert . assertEquals ( correctString , model . getValue ( ) ) |
resolveBooleanWithBooleanStringValue ( ) { org . mule . runtime . core . privileged . util . AttributeEvaluator attributeEvaluator = new org . mule . runtime . core . privileged . util . AttributeEvaluator ( "#[mel:expression]" , BOOLEAN ) ; attributeEvaluator . initialize ( mockExpressionManager ) ; final java . lang . String expectedValue = "true" ; doReturn ( new org . mule . runtime . api . metadata . TypedValue ( java . lang . Boolean . valueOf ( expectedValue ) , BOOLEAN ) ) . when ( session ) . evaluate ( anyString ( ) , any ( org . mule . runtime . api . metadata . DataType . class ) ) ; "<AssertPlaceHolder>" ; } resolveValue ( java . lang . String ) { if ( value == null ) { return value ; } try { return this . resolutionCache . get ( value , ( ) -> { int prefixIndex = value . indexOf ( org . mule . runtime . config . internal . dsl . model . config . DefaultConfigurationPropertiesResolver . PLACEHOLDER_PREFIX ) ; if ( prefixIndex == ( - 1 ) ) { return value ; } return replaceAllPlaceholders ( value ) ; } ) ; } catch ( java . lang . Exception e ) { if ( ( e . getCause ( ) ) instanceof java . lang . RuntimeException ) { throw ( ( java . lang . RuntimeException ) ( e . getCause ( ) ) ) ; } else { throw new org . mule . runtime . api . exception . MuleRuntimeException ( createStaticMessage ( ( "Failure<sp>processing<sp>configuration<sp>attribute<sp>" + value ) , e ) ) ; } } } | org . junit . Assert . assertThat ( attributeEvaluator . resolveValue ( event ) , org . hamcrest . core . Is . is ( java . lang . Boolean . valueOf ( expectedValue ) ) ) |
givenKeyPresent_whenComputeIfPresentRemappingNull_thenMappingRemoved ( ) { java . lang . Object oldValue = new java . lang . Object ( ) ; concurrentMap . put ( "test" , oldValue ) ; concurrentMap . computeIfPresent ( "test" , ( s , o ) -> null ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Integer ) { return emf . unwrap ( org . hibernate . SessionFactory . class ) . getCurrentSession ( ) . get ( org . baeldung . demo . model . Foo . class , id ) ; } | org . junit . Assert . assertNull ( concurrentMap . get ( "test" ) ) |
shouldFailWebSocketConnectionWhenServerSendCloseFrameWithRsv2 ( ) { final org . apache . mina . core . service . IoHandler handler = context . mock ( org . apache . mina . core . service . IoHandler . class ) ; context . checking ( new org . jmock . Expectations ( ) { { oneOf ( handler ) . sessionCreated ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; oneOf ( handler ) . sessionOpened ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; oneOf ( handler ) . sessionClosed ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; atMost ( 1 ) . of ( handler ) . exceptionCaught ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) , with ( org . hamcrest . core . AllOf . allOf ( any ( java . io . IOException . class ) , org . junit . internal . matchers . ThrowableMessageMatcher . hasMessage ( equal ( LoggingUtils . EARLY_TERMINATION_OF_IOSESSION_MESSAGE ) ) ) ) ) ; } } ) ; org . apache . mina . core . future . ConnectFuture connectFuture = connector . connect ( "ws://localhost:8080/echo" , null , handler ) ; connectFuture . awaitUninterruptibly ( ) ; "<AssertPlaceHolder>" ; k3po . finish ( ) ; } isConnected ( ) { return channel . isConnected ( ) ; } | org . junit . Assert . assertTrue ( connectFuture . isConnected ( ) ) |
testCleanUpGerritCausesOneManual ( ) { hudson . model . AbstractBuild build = mockBuild ( "projectX" , 2 ) ; com . sonymobile . tools . gerrit . gerritevents . dto . events . PatchsetCreated event = com . sonyericsson . hudson . plugins . gerrit . trigger . mock . Setup . createPatchsetCreated ( ) ; com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . GerritCause cause = new com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . GerritCause ( event , true ) ; when ( build . getCause ( com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . GerritCause . class ) ) . thenReturn ( cause ) ; com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . GerritManualCause manualCause = new com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . GerritManualCause ( ) ; manualCause . setEvent ( event ) ; manualCause . setSilentMode ( true ) ; hudson . model . CauseAction causeAction = mock ( hudson . model . CauseAction . class ) ; java . util . List < hudson . model . Cause > causes = new java . util . LinkedList < hudson . model . Cause > ( ) ; causes . add ( cause ) ; causes . add ( manualCause ) ; causes . add ( cause ) ; when ( causeAction . getCauses ( ) ) . thenReturn ( causes ) ; when ( build . getAction ( hudson . model . CauseAction . class ) ) . thenReturn ( causeAction ) ; com . sonyericsson . hudson . plugins . gerrit . trigger . gerritnotifier . ToGerritRunListener toGerritRunListener = new com . sonyericsson . hudson . plugins . gerrit . trigger . gerritnotifier . ToGerritRunListener ( ) ; toGerritRunListener . cleanUpGerritCauses ( cause , build ) ; "<AssertPlaceHolder>" ; } size ( ) { return internal . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , causes . size ( ) ) |
test_getTrustManager ( ) { javax . net . ssl . TrustManager [ ] tm ; try { tm = org . restfulwhois . rdap . client . util . SSLUtil . getTrustManager ( org . restfulwhois . rdap . client . util . SSLUtil . loadKeyStore ( path , "123456" ) ) ; } catch ( org . restfulwhois . rdap . client . exception . RdapClientException e ) { tm = null ; } "<AssertPlaceHolder>" ; } loadKeyStore ( java . lang . String , java . lang . String ) { java . security . KeyStore ks ; try { ks = java . security . KeyStore . getInstance ( java . security . KeyStore . getDefaultType ( ) ) ; java . io . FileInputStream in = new java . io . FileInputStream ( filePath ) ; ks . load ( in , password . toCharArray ( ) ) ; } catch ( java . security . KeyStoreException e ) { throw new org . restfulwhois . rdap . client . exception . RdapClientException ( e . getMessage ( ) ) ; } catch ( java . security . cert . CertificateException e ) { throw new org . restfulwhois . rdap . client . exception . RdapClientException ( e . getMessage ( ) ) ; } catch ( java . security . NoSuchAlgorithmException e ) { throw new org . restfulwhois . rdap . client . exception . RdapClientException ( e . getMessage ( ) ) ; } catch ( java . io . IOException e ) { throw new org . restfulwhois . rdap . client . exception . RdapClientException ( e . getMessage ( ) ) ; } return ks ; } | org . junit . Assert . assertNotNull ( tm ) |
testPrintStream ( ) { java . lang . String file = "PrintStream_file.tmp" ; java . lang . String expected = "testPrintStream" ; org . evosuite . runtime . mock . java . io . MockPrintStream out = new org . evosuite . runtime . mock . java . io . MockPrintStream ( file ) ; out . println ( expected ) ; out . close ( ) ; java . util . Scanner in = new java . util . Scanner ( new org . evosuite . runtime . mock . java . io . MockFileInputStream ( file ) ) ; java . lang . String result = in . nextLine ( ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { } | org . junit . Assert . assertEquals ( expected , result ) |
isShowSecondCategory_EmptyCategory ( ) { givenModel ( newCategories ( false , "red" , "blue" ) , newEntries ( "s1" ) ) ; boolean result = ctrl . isShowSecondCategory ( ) ; "<AssertPlaceHolder>" ; } isShowSecondCategory ( ) { return ( model . getNumberOfColumns ( ) ) >= 2 ; } | org . junit . Assert . assertTrue ( result ) |
pathRevToBuffer ( ) { org . apache . jackrabbit . oak . plugins . document . Path p = org . apache . jackrabbit . oak . plugins . document . Path . fromString ( "/foo/bar/quux" ) ; org . apache . jackrabbit . oak . plugins . document . RevisionVector rv = org . apache . jackrabbit . oak . plugins . document . RevisionVector . fromString ( "r3-4-1,br4-9-2" ) ; org . apache . jackrabbit . oak . plugins . document . PathRev expected = new org . apache . jackrabbit . oak . plugins . document . PathRev ( p , rv ) ; org . apache . jackrabbit . oak . plugins . document . persistentCache . DataTypeUtil . pathRevToBuffer ( expected , wb ) ; java . nio . ByteBuffer rb = org . apache . jackrabbit . oak . plugins . document . persistentCache . DataTypeUtilTest . readBufferFrom ( wb ) ; "<AssertPlaceHolder>" ; } pathRevFromBuffer ( java . nio . ByteBuffer ) { return new org . apache . jackrabbit . oak . plugins . document . PathRev ( org . apache . jackrabbit . oak . plugins . document . persistentCache . DataTypeUtil . pathFromBuffer ( buffer ) , org . apache . jackrabbit . oak . plugins . document . persistentCache . DataTypeUtil . revisionVectorFromBuffer ( buffer ) ) ; } | org . junit . Assert . assertEquals ( expected , org . apache . jackrabbit . oak . plugins . document . persistentCache . DataTypeUtil . pathRevFromBuffer ( rb ) ) |
bare_body_quote ( ) { java . lang . String [ ] [ ] result = read ( "c'" ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( new java . lang . String [ ] [ ] { new java . lang . String [ ] { "c'" } } ) ) |
test_createIndexFile_list_null ( ) { final boolean created = new org . talend . updates . runtime . nexus . component . ComponentIndexManager ( ) . createIndexFile ( new java . io . File ( "abc.txt" ) , ( ( java . util . List < org . talend . updates . runtime . nexus . component . ComponentIndexBean > ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } createIndexFile ( java . io . File , java . util . List ) { throw new java . io . FileNotFoundException ( ) ; } | org . junit . Assert . assertFalse ( created ) |
getCauseExceptionWithNonMuleCause ( ) { java . io . IOException causeException = new java . io . IOException ( "" ) ; org . mule . runtime . core . internal . exception . MessagingException exception = new org . mule . runtime . core . internal . exception . MessagingException ( createStaticMessage ( "" ) , testEvent , causeException ) ; "<AssertPlaceHolder>" ; } getRootCause ( ) { java . lang . Throwable rootException = org . mule . runtime . core . internal . config . ExceptionHelper . getRootException ( this ) ; if ( rootException == null ) { rootException = this ; } return rootException ; } | org . junit . Assert . assertThat ( exception . getRootCause ( ) , org . hamcrest . CoreMatchers . is ( causeException ) ) |
getGreenWithSpecialCharColor ( ) { fi . helsinki . cs . tmc . cli . io . Color color = fi . helsinki . cs . tmc . cli . io . ColorUtil . getColor ( "green$" ) ; "<AssertPlaceHolder>" ; } getColor ( java . lang . String ) { try { fi . helsinki . cs . tmc . cli . io . Color color = fi . helsinki . cs . tmc . cli . io . Color . valueOf ( name . toUpperCase ( ) ) ; if ( ( color == ( Color . NONE ) ) || ( color == ( Color . RESET ) ) ) { color = null ; } return color ; } catch ( java . lang . IllegalArgumentException | java . lang . NullPointerException e ) { return null ; } } | org . junit . Assert . assertEquals ( null , color ) |
shouldBuildDefaultConfigurationWhenConfigStreamIsUnavailable ( ) { org . mockito . Mockito . when ( mockServletContext . getResourceAsStream ( org . mockito . Mockito . anyString ( ) ) ) . thenThrow ( new java . lang . RuntimeException ( "BOOM!" ) ) ; victim = new ro . isdc . wro . config . factory . ServletContextPropertyWroConfigurationFactory ( mockServletContext ) ; "<AssertPlaceHolder>" ; } create ( ) { if ( ( factoryList ) == null ) { factoryList = newWroModelFactoryFactoryList ( ) ; } if ( ( factoryList ) != null ) { final java . lang . StringBuffer logMessageBuffer = new java . lang . StringBuffer ( ) ; for ( final ro . isdc . wro . model . factory . WroModelFactory factory : factoryList ) { try { injector . inject ( factory ) ; final java . lang . Class < ? extends ro . isdc . wro . model . factory . WroModelFactory > factoryClass = factory . getClass ( ) . asSubclass ( ro . isdc . wro . model . factory . WroModelFactory . class ) ; logMessageBuffer . append ( ( ( "<sp>Using<sp>" + ( getClassName ( factoryClass ) ) ) + "<sp>for<sp>model<sp>creation..\n" ) ) ; return factory . create ( ) ; } catch ( final ro . isdc . wro . WroRuntimeException e ) { ro . isdc . wro . extensions . model . factory . SmartWroModelFactory . LOG . debug ( "[FAIL]<sp>creating<sp>model...<sp>will<sp>try<sp>another<sp>factory:<sp>{}" , e . getCause ( ) ) ; logMessageBuffer . append ( ( ( "[FAIL]<sp>Model<sp>creation<sp>using<sp>" + ( getClassName ( factory . getClass ( ) ) ) ) + "<sp>failed.<sp>Trying<sp>another<sp>...\n" ) ) ; logMessageBuffer . append ( ( ( ( "[FAIL]<sp>Exception<sp>occured<sp>while<sp>building<sp>the<sp>model<sp>using:<sp>" + ( getClassName ( factory . getClass ( ) ) ) ) + "<sp>" ) + ( e . getMessage ( ) ) ) ) ; if ( ( ! ( autoDetectWroFile ) ) && ( ( e . getCause ( ) ) instanceof java . io . IOException ) ) { throw e ; } } } ro . isdc . wro . extensions . model . factory . SmartWroModelFactory . LOG . error ( logMessageBuffer . toString ( ) ) ; } throw new ro . isdc . wro . WroRuntimeException ( "Cannot<sp>create<sp>model<sp>using<sp>any<sp>of<sp>provided<sp>factories" ) ; } | org . junit . Assert . assertNotNull ( victim . create ( ) ) |
getParameterValueInQueryURLEncoded ( ) { final net . jadler . Request req = net . jadler . Request . builder ( ) . method ( net . jadler . RequestTest . METHOD ) . requestURI ( java . net . URI . create ( java . lang . String . format ( "http://localhost/?%s=%s" , net . jadler . RequestTest . PARAM_NAME_URL_ENCODED , net . jadler . RequestTest . PARAM_VALUE_URL_ENCODED ) ) ) . build ( ) ; "<AssertPlaceHolder>" ; } getParameters ( ) { return this . parameters ; } | org . junit . Assert . assertThat ( req . getParameters ( ) . getValue ( net . jadler . RequestTest . PARAM_NAME_URL_ENCODED ) , is ( net . jadler . RequestTest . PARAM_VALUE_URL_ENCODED ) ) |
write_min ( ) { com . asakusafw . runtime . value . ByteOption option = new com . asakusafw . runtime . value . ByteOption ( ) ; option . modify ( Byte . MIN_VALUE ) ; com . asakusafw . runtime . value . ByteOption restored = restore ( option ) ; "<AssertPlaceHolder>" ; } get ( ) { if ( canGet ) { return next ; } throw new java . io . IOException ( ) ; } | org . junit . Assert . assertThat ( restored . get ( ) , is ( option . get ( ) ) ) |
test2OK ( ) { org . kie . dmn . feel . lang . CompilerContext ctx = org . kie . dmn . feel . lang . examples . CompileEvaluateTest . feel . newCompilerContext ( ) ; ctx . addInputVariableType ( "MyPerson" , new org . kie . dmn . feel . lang . impl . MapBackedType ( ) . addField ( "FullName" , BuiltInType . STRING ) ) ; org . kie . dmn . feel . lang . CompiledExpression compiledExpression = org . kie . dmn . feel . lang . examples . CompileEvaluateTest . feel . compile ( "MyPerson.FullName" , ctx ) ; java . util . Map < java . lang . String , java . lang . Object > inputs = new java . util . HashMap ( ) ; inputs . put ( "MyPerson" , prototype ( entry ( "FullName" , "John<sp>Doe" ) ) ) ; java . lang . Object result = org . kie . dmn . feel . lang . examples . CompileEvaluateTest . feel . evaluate ( compiledExpression , inputs ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Comparable ) { return new org . drools . verifier . core . index . matchers . ExactMatcher ( keyDefinition , comparable ) ; } | org . junit . Assert . assertThat ( result , is ( "John<sp>Doe" ) ) |
testSetsInCombinedGrammarSentToLexer ( ) { org . antlr . tool . Grammar g = new org . antlr . tool . Grammar ( ( "grammar<sp>t;\n" + "A<sp>:<sp>\'{\'<sp>~(\'}\')*<sp>\'}\';\n" ) ) ; java . lang . String result = g . getLexerGrammar ( ) ; java . lang . String expecting = ( ( ( "lexer<sp>grammar<sp>t;" + ( newline ) ) + "//<sp>$ANTLR<sp>src<sp>\"<string>\"<sp>2" ) + ( newline ) ) + "A<sp>:<sp>'{'<sp>~('}')*<sp>'}';" ; "<AssertPlaceHolder>" ; } getLexerGrammar ( ) { if ( ( ( lexerGrammarST . getAttribute ( "literals" ) ) == null ) && ( ( lexerGrammarST . getAttribute ( "rules" ) ) == null ) ) { return null ; } lexerGrammarST . add ( "name" , name ) ; if ( ( getActions ( ) . get ( "lexer" ) ) != null ) { lexerGrammarST . add ( "actionNames" , getActions ( ) . get ( "lexer" ) . keySet ( ) ) ; lexerGrammarST . add ( "actions" , getActions ( ) . get ( "lexer" ) . values ( ) ) ; } if ( ( options ) != null ) { for ( java . lang . String optionName : options . keySet ( ) ) { if ( ! ( org . antlr . tool . Grammar . doNotCopyOptionsToLexer . contains ( optionName ) ) ) { java . lang . Object value = options . get ( optionName ) ; lexerGrammarST . addAggr ( "options.{name,value}" , optionName , value ) ; } } } return lexerGrammarST . render ( ) ; } | org . junit . Assert . assertEquals ( result , expecting ) |
testCutoff2 ( ) { opennlp . tools . ngram . NGramModel ngramModel = new opennlp . tools . ngram . NGramModel ( ) ; opennlp . tools . util . StringList tokens = new opennlp . tools . util . StringList ( "the" , "brown" , "fox" , "jumped" ) ; ngramModel . add ( tokens , 1 , 3 ) ; ngramModel . cutoff ( 1 , 3 ) ; "<AssertPlaceHolder>" ; } size ( ) { return mNGrams . size ( ) ; } | org . junit . Assert . assertEquals ( 9 , ngramModel . size ( ) ) |
nullJob ( ) { java . util . Map < java . lang . String , java . lang . Long > metrics = new com . hotels . bdp . circustrain . metrics . JobMetrics ( null , com . hotels . bdp . circustrain . metrics . JobMetricsTest . GROUP , com . hotels . bdp . circustrain . metrics . JobMetricsTest . COUNTER ) . getMetrics ( ) ; "<AssertPlaceHolder>" ; } getMetrics ( ) { if ( ( metrics ) != null ) { return metrics ; } return com . google . common . collect . ImmutableMap . of ( ) ; } | org . junit . Assert . assertThat ( metrics . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) ) |
testIsValidDefinitionContainer ( ) { org . apache . tiles . request . Request request = createMock ( org . apache . tiles . request . Request . class ) ; java . util . Map < java . lang . String , org . apache . tiles . Definition > definitions = createMock ( java . util . Map . class ) ; java . util . Map < java . lang . String , java . lang . Object > scope = createMock ( java . util . Map . class ) ; expect ( request . getContext ( "request" ) ) . andReturn ( scope ) ; expect ( scope . get ( org . apache . tiles . impl . mgmt . CachingTilesContainerTest . DEFAULT_DEFINITIONS_ATTRIBUTE_NAME ) ) . andReturn ( definitions ) ; expect ( definitions . get ( "definition" ) ) . andReturn ( null ) ; expect ( wrapped . isValidDefinition ( "definition" , request ) ) . andReturn ( true ) ; replay ( wrapped , request , definitions , scope ) ; "<AssertPlaceHolder>" ; verify ( wrapped , request , definitions , scope ) ; } isValidDefinition ( java . lang . String , org . apache . tiles . request . Request ) { return container . isValidDefinition ( definition , request ) ; } | org . junit . Assert . assertTrue ( container . isValidDefinition ( "definition" , request ) ) |
testParsesNulls ( ) { org . apache . beam . sdk . schemas . Schema schema = org . apache . beam . sdk . schemas . Schema . builder ( ) . addByteField ( "f_byte" ) . addNullableField ( "f_string" , FieldType . STRING ) . build ( ) ; java . lang . String rowString = "{\n" + ( ( "\"f_byte\"<sp>:<sp>12,\n" + "\"f_string\"<sp>:<sp>null\n" ) + "}" ) ; org . apache . beam . sdk . util . RowJsonDeserializer deserializer = org . apache . beam . sdk . util . RowJsonDeserializer . forSchema ( schema ) ; org . apache . beam . sdk . values . Row parsedRow = newObjectMapperWith ( deserializer ) . readValue ( rowString , org . apache . beam . sdk . values . Row . class ) ; org . apache . beam . sdk . values . Row expectedRow = org . apache . beam . sdk . values . Row . withSchema ( schema ) . addValues ( ( ( byte ) ( 12 ) ) , null ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return observer ; } | org . junit . Assert . assertEquals ( expectedRow , parsedRow ) |
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . asset . kernel . model . AssetCategory > assetCategories = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( assetCategories . isEmpty ( ) ) |
testBBoxOnly2DCoordinates ( ) { org . w3c . dom . Document doc = getAsDOM ( "wfs?request=getfeature&service=wfs&version=1.1.0&typename=sf:With3D&bbox=-200,-200,200,200,EPSG:4979" ) ; org . w3c . dom . NodeList features = doc . getElementsByTagName ( "sf:With3D" ) ; "<AssertPlaceHolder>" ; } getLength ( ) { return length ; } | org . junit . Assert . assertEquals ( 3 , features . getLength ( ) ) |
setConfigurationSetting_writeLockSet ( ) { java . lang . reflect . Method method = org . oscm . configurationservice . bean . ConfigurationServiceBean . class . getMethod ( "setConfigurationSetting" , org . oscm . domobjects . ConfigurationSetting . class ) ; java . util . List < java . lang . annotation . Annotation > annotations = givenSetConfigurationSettingAnnotations ( ) ; "<AssertPlaceHolder>" ; } hasAnnotation ( java . util . List ) { return new org . hamcrest . BaseMatcher < java . lang . Object > ( ) { private java . lang . Class < ? > aClass ; private java . lang . reflect . Method method ; private java . lang . annotation . Annotation annotation ; @ org . oscm . test . matchers . Override public boolean matches ( java . lang . Object object ) { boolean result = false ; if ( object instanceof java . lang . Class < ? > ) { aClass = ( ( java . lang . Class < ? > ) ( object ) ) ; for ( java . lang . annotation . Annotation expectedAnnotation : expectedAnnotations ) { annotation = expectedAnnotation ; org . junit . Assert . assertNotNull ( aClass . getAnnotation ( expectedAnnotation . annotationType ( ) ) ) ; } result = true ; } else if ( object instanceof java . lang . reflect . Method ) { method = ( ( java . lang . reflect . Method ) ( object ) ) ; for ( java . lang . annotation . Annotation expectedAnnotation : expectedAnnotations ) { annotation = expectedAnnotation ; org . junit . Assert . assertNotNull ( method . getAnnotation ( expectedAnnotation . annotationType ( ) ) ) ; } result = true ; } return result ; } @ org . oscm . test . matchers . Override public void describeTo ( org . hamcrest . Description description ) { if ( ( aClass ) != null ) { description . appendText ( ( ( ( "Class<sp>" + ( aClass . getName ( ) ) ) + "<sp>has<sp>no<sp>Annotation<sp>" ) + ( annotation . annotationType ( ) . getName ( ) ) ) ) ; } else if ( ( method ) != null ) { description . appendText ( ( ( ( "Method<sp>" + ( method . getName ( ) ) ) + "<sp>has<sp>no<sp>Annotation<sp>" ) + ( annotation . annotationType ( ) . getName ( ) ) ) ) ; } } } ; } | org . junit . Assert . assertThat ( method , hasAnnotation ( annotations ) ) |
shouldBeAbleToRetrieveASessionUri ( ) { local . add ( expected ) ; "<AssertPlaceHolder>" ; } get ( org . openqa . selenium . remote . SessionId ) { java . util . Objects . requireNonNull ( id , "Session<sp>ID<sp>must<sp>be<sp>set" ) ; org . openqa . selenium . grid . data . Session session = makeRequest ( new org . openqa . selenium . remote . http . HttpRequest ( GET , ( "/se/grid/session/" + id ) ) , org . openqa . selenium . grid . data . Session . class ) ; if ( session == null ) { throw new org . openqa . selenium . NoSuchSessionException ( ( "Unable<sp>to<sp>find<sp>session<sp>with<sp>ID:<sp>" + id ) ) ; } return session ; } | org . junit . Assert . assertEquals ( expected , remote . get ( id ) ) |
activateEditorIfEditorWidgetNull ( ) { reset ( editorView , eventBus ) ; embeddedTextEditorPresenter . activate ( ) ; java . lang . reflect . Field delayedFocus = org . eclipse . che . ide . jseditor . client . texteditor . EmbeddedTextEditorPresenter . class . getDeclaredField ( "delayedFocus" ) ; delayedFocus . setAccessible ( true ) ; boolean fieldValue = ( ( boolean ) ( delayedFocus . get ( embeddedTextEditorPresenter ) ) ) ; "<AssertPlaceHolder>" ; } activate ( ) { } | org . junit . Assert . assertTrue ( fieldValue ) |
testNullFieldString ( ) { java . sql . Array arr = new org . postgresql . jdbc . PgArray ( ( ( org . postgresql . core . BaseConnection ) ( conn ) ) , 1 , ( ( java . lang . String ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( "LSN{" + ( asString ( ) ) ) + '}' ; } | org . junit . Assert . assertNull ( arr . toString ( ) ) |
testOnConnectionChangedAddedPre_layerized ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( true ) ) |
error ( ) { io . reactivex . Flowable < java . lang . String > f = io . reactivex . Flowable . error ( new java . lang . IllegalArgumentException ( ) ) ; java . io . InputStream is = com . github . davidmoten . rx2 . Strings . toInputStream ( f , com . github . davidmoten . rx2 . internal . flowable . FlowableStringInputStreamTest . utf8 ) ; try { is . read ( ) ; org . junit . Assert . fail ( "Should<sp>have<sp>thrown" ) ; } catch ( java . io . IOException ex ) { if ( ! ( ( ex . getCause ( ) ) instanceof java . lang . IllegalArgumentException ) ) { throw ex ; } } try { is . read ( new byte [ 1 ] ) ; org . junit . Assert . fail ( "Should<sp>have<sp>thrown" ) ; } catch ( java . io . IOException ex ) { if ( ! ( ( ex . getCause ( ) ) instanceof java . lang . IllegalArgumentException ) ) { throw ex ; } } "<AssertPlaceHolder>" ; } available ( ) { byte [ ] a = bytes ; int idx = index ; return a != null ? java . lang . Math . max ( 0 , ( ( a . length ) - idx ) ) : 0 ; } | org . junit . Assert . assertEquals ( 0 , is . available ( ) ) |
testCreateConfigFiles_loggingProperties ( ) { delegate . createConfigFiles ( project , AppEngineStandardFacet . JRE7 , monitor ) ; org . eclipse . core . resources . IFile loggingProperties = project . getFile ( "src/main/webapp/WEB-INF/logging.properties" ) ; "<AssertPlaceHolder>" ; } getFile ( java . lang . String ) { org . eclipse . core . runtime . IPath path = new org . eclipse . core . runtime . Path ( filePath ) ; if ( ( path . segmentCount ( ) ) > 1 ) { org . eclipse . core . resources . IWorkspaceRoot root = org . eclipse . core . resources . ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; org . eclipse . core . resources . IFile file = root . getFile ( path ) ; if ( ( file != null ) && ( file . exists ( ) ) ) { return file ; } } return null ; } | org . junit . Assert . assertTrue ( loggingProperties . exists ( ) ) |
noContentNotLogged ( ) { final cc . kune . core . shared . dto . StateContentDTO response = ( ( cc . kune . core . shared . dto . StateContentDTO ) ( contentService . getContent ( null , new cc . kune . core . shared . domain . utils . StateToken ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getContent ( java . lang . String , cc . kune . core . shared . domain . utils . StateToken ) { cc . kune . domain . Group defaultGroup ; final cc . kune . domain . User user = userSessionManager . getUser ( ) ; if ( isUserLoggedIn ( ) ) { defaultGroup = groupManager . getGroupOfUserWithId ( user . getId ( ) ) ; if ( ( groupManager . findEnabledTools ( defaultGroup . getId ( ) ) . size ( ) ) <= 1 ) { defaultGroup = groupManager . getSiteDefaultGroup ( ) ; } } else { defaultGroup = groupManager . getSiteDefaultGroup ( ) ; } try { final cc . kune . domain . Content content = finderService . getContentOrDefContent ( token , defaultGroup ) ; return getContentOrDefContent ( userHash , content . getStateToken ( ) , user , content ) ; } catch ( final javax . persistence . NoResultException e ) { throw new cc . kune . core . client . errors . ContentNotFoundException ( ) ; } catch ( final cc . kune . core . client . errors . ToolNotFoundException e ) { throw new cc . kune . core . client . errors . ContentNotFoundException ( ) ; } catch ( final cc . kune . core . client . errors . NoDefaultContentException e ) { return mapper . map ( stateService . createNoHome ( user , ( token . hasNothing ( ) ? user . getShortName ( ) : token . getGroup ( ) ) ) , cc . kune . core . shared . dto . StateNoContentDTO . class ) ; } } | org . junit . Assert . assertNotNull ( response ) |
testBerichtSyntaxException ( ) { final java . lang . String berichtOrigineel = org . apache . commons . io . IOUtils . toString ( nl . moderniseringgba . isc . esb . message . sync . impl . DeblokkeringAntwoordBerichtTest . class . getResourceAsStream ( "deblokkeringAntwoordBerichtSyntaxExceptionBericht.xml" ) ) ; final nl . moderniseringgba . isc . esb . message . sync . SyncBericht syncBericht = factory . getBericht ( berichtOrigineel ) ; "<AssertPlaceHolder>" ; } getBericht ( java . lang . String ) { try { final javax . xml . bind . JAXBElement < ? > element = NotificatieXml . SINGLETON . stringToElement ( berichtAlsString ) ; return maakBericht ( element . getValue ( ) ) ; } catch ( final javax . xml . bind . JAXBException e ) { nl . bzk . migratiebrp . bericht . model . notificatie . factory . NotificatieBerichtFactory . LOG . warn ( "Verwerken<sp>bericht<sp>mislukt" , e ) ; return new nl . bzk . migratiebrp . bericht . model . notificatie . impl . OngeldigBericht ( berichtAlsString , e . getMessage ( ) ) ; } } | org . junit . Assert . assertTrue ( ( syncBericht instanceof nl . moderniseringgba . isc . esb . message . sync . impl . OngeldigBericht ) ) |
testAttachDiskRequest ( ) { try { com . fit2cloud . aliyun . ecs . model . request . AttachDiskRequest r = new com . fit2cloud . aliyun . ecs . model . request . AttachDiskRequest ( "i-25uh6z38k" , "d-2583k8j4o" ) ; com . fit2cloud . aliyun . Response response = client . attachDisk ( r ) ; System . out . println ( ( "testAttachDiskRequest<sp>::<sp>" + response ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } attachDisk ( com . fit2cloud . aliyun . ecs . model . request . AttachDiskRequest ) { return gson . fromJson ( request . execute ( "AttachDisk" , attachDiskRequest . toMap ( ) ) , com . fit2cloud . aliyun . Response . class ) ; } | org . junit . Assert . assertTrue ( true ) |
testNoItems ( ) { System . out . println ( "CountAggregatorTest<sp>-<sp>No<sp>Items" ) ; org . calrissian . flowmix . api . aggregator . CountAggregator instance = new org . calrissian . flowmix . api . aggregator . CountAggregator ( ) ; instance . add ( ( ( long ) ( 33 ) ) ) ; instance . add ( ( ( long ) ( 33 ) ) ) ; instance . add ( ( ( long ) ( 33 ) ) ) ; instance . add ( ( ( long ) ( 33 ) ) ) ; instance . evict ( ( ( long ) ( 33 ) ) ) ; instance . evict ( ( ( long ) ( 33 ) ) ) ; instance . evict ( ( ( long ) ( 33 ) ) ) ; instance . evict ( ( ( long ) ( 33 ) ) ) ; java . lang . Long result = instance . aggregateResult ( ) ; java . lang . Long expectedResult = ( ( long ) ( 0 ) ) ; "<AssertPlaceHolder>" ; } aggregateResult ( ) { return count ; } | org . junit . Assert . assertEquals ( expectedResult , result ) |
createLogUnitTest ( ) { java . util . Map < java . lang . String , java . lang . String > reqHeaders = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; reqHeaders . put ( "reqHeaderKey1" , "reqHeaderValue1" ) ; java . util . Map < java . lang . String , java . lang . String > resHeaders = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; reqHeaders . put ( "resHeaderKey1" , "resHeaderValue1" ) ; com . aliyuncs . http . HttpRequest httpRequest = createMockHttpRequest ( "http://www.aliyun.com/path?query=ecs#ref" , MethodType . POST , "req<sp>body" , null , reqHeaders ) ; com . aliyuncs . http . HttpResponse httpResponse = createMockHttpResponse ( 200 , "OK" , "res<sp>body" , null , resHeaders ) ; "<AssertPlaceHolder>" ; } createLogUnit ( com . aliyuncs . http . HttpRequest , com . aliyuncs . http . HttpResponse ) { return new com . aliyuncs . utils . LogUtils . LogUnit ( httpRequest , httpResponse ) ; } | org . junit . Assert . assertNotNull ( com . aliyuncs . utils . LogUtils . createLogUnit ( httpRequest , httpResponse ) ) |
loginUserWithoutKey ( ) { de . mpg . imeji . logic . controller . resource . UserController controller = new de . mpg . imeji . logic . controller . resource . UserController ( util . JenaUtil . testUser ) ; de . mpg . imeji . logic . vo . User usertest = controller . retrieve ( JenaUtil . TEST_USER_EMAIL ) ; usertest . setApiKey ( null ) ; controller . update ( usertest , usertest ) ; de . mpg . imeji . rest . process . AdminProcess . login ( generateBasicAuthenticationHeader ( JenaUtil . TEST_USER_EMAIL , JenaUtil . TEST_USER_PWD ) ) ; java . lang . String key = controller . retrieve ( JenaUtil . TEST_USER_EMAIL ) . getApiKey ( ) ; "<AssertPlaceHolder>" ; } getApiKey ( ) { return apiKey ; } | org . junit . Assert . assertTrue ( ( ( key != null ) && ( ! ( "" . equals ( key ) ) ) ) ) |
testDataNodeConversion ( ) { org . pentaho . metastore . api . IMetaStoreElement expected = new org . pentaho . metastore . stores . memory . MemoryMetaStoreElement ( ) ; expected . setName ( "parent" ) ; expected . addChild ( new org . pentaho . metastore . stores . memory . MemoryMetaStoreAttribute ( "date" , new java . util . Date ( ) ) ) ; expected . addChild ( new org . pentaho . metastore . stores . memory . MemoryMetaStoreAttribute ( "long" , 32L ) ) ; expected . addChild ( new org . pentaho . metastore . stores . memory . MemoryMetaStoreAttribute ( "double" , 3.2 ) ) ; expected . addChild ( new org . pentaho . metastore . stores . memory . MemoryMetaStoreAttribute ( "long" 0 , "value" ) ) ; org . pentaho . metastore . stores . memory . MemoryMetaStoreAttribute collection = new org . pentaho . metastore . stores . memory . MemoryMetaStoreAttribute ( "collection" , "collection-value" ) ; for ( int i = 0 ; i < 10 ; i ++ ) { collection . addChild ( new org . pentaho . metastore . stores . memory . MemoryMetaStoreAttribute ( ( "key-" + i ) , ( "value-" + i ) ) ) ; } expected . addChild ( collection ) ; org . pentaho . platform . api . repository2 . unified . data . node . DataNode dataNode = new org . pentaho . platform . api . repository2 . unified . data . node . DataNode ( "test" ) ; metaStore . elementToDataNode ( expected , dataNode ) ; org . pentaho . metastore . api . IMetaStoreElement verify = new org . pentaho . metastore . stores . memory . MemoryMetaStoreElement ( ) ; metaStore . dataNodeToElement ( dataNode , verify ) ; "<AssertPlaceHolder>" ; org . pentaho . di . repository . pur . metastore . PurRepositoryMetaStoreTest . validate ( expected , verify ) ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( expected . getName ( ) , verify . getName ( ) ) |
testToBeanToJson_NonNull ( ) { org . tests . model . json . EBasicJsonMap bean = new org . tests . model . json . EBasicJsonMap ( ) ; bean . setId ( 99L ) ; bean . setContent ( new java . util . LinkedHashMap ( ) ) ; io . ebean . text . json . JsonWriteOptions options = new io . ebean . text . json . JsonWriteOptions ( ) ; options . setInclude ( JsonConfig . Include . NON_NULL ) ; java . lang . String asJson = io . ebean . Ebean . json ( ) . toJson ( bean , options ) ; java . lang . String expectedJson = "{\"id\":99,\"content\":{}}" ; "<AssertPlaceHolder>" ; } toJson ( java . lang . String , java . util . Collection ) { try { beginAssocMany ( name ) ; for ( java . lang . Object bean : c ) { io . ebeaninternal . server . deploy . BeanDescriptor < ? > d = getDescriptor ( bean . getClass ( ) ) ; d . jsonWrite ( this , ( ( io . ebean . bean . EntityBean ) ( bean ) ) , null ) ; } endAssocMany ( ) ; } catch ( java . io . IOException e ) { throw new io . ebean . text . json . JsonIOException ( e ) ; } } | org . junit . Assert . assertEquals ( expectedJson , asJson ) |
testNotNullOptions ( ) { fr . opensagres . xdocreport . converter . Options options = fr . opensagres . xdocreport . converter . Options . getFrom ( "ODT" ) ; fr . opensagres . odfdom . converter . pdf . PdfOptions pdfOptions = fr . opensagres . xdocreport . converter . odt . odfdom . itext . ODF2PDFViaITextConverter . getInstance ( ) . toPdfOptions ( options ) ; "<AssertPlaceHolder>" ; } toPdfOptions ( fr . opensagres . xdocreport . converter . Options ) { if ( options == null ) { return null ; } java . lang . Object value = options . getSubOptions ( fr . opensagres . poi . xwpf . converter . pdf . PdfOptions . class ) ; if ( value instanceof fr . opensagres . poi . xwpf . converter . pdf . PdfOptions ) { return ( ( fr . opensagres . poi . xwpf . converter . pdf . PdfOptions ) ( value ) ) ; } fr . opensagres . poi . xwpf . converter . pdf . PdfOptions pdfOptions = fr . opensagres . poi . xwpf . converter . pdf . PdfOptions . create ( ) ; java . lang . String fontEncoding = fr . opensagres . xdocreport . converter . OptionsHelper . getFontEncoding ( options ) ; if ( fr . opensagres . xdocreport . core . utils . StringUtils . isNotEmpty ( fontEncoding ) ) { pdfOptions . fontEncoding ( fontEncoding ) ; } return pdfOptions ; } | org . junit . Assert . assertNotNull ( pdfOptions ) |
testListAndroidAppsShouldSucceed ( ) { com . google . firebase . projectmanagement . AndroidApp app1 = new com . google . firebase . projectmanagement . AndroidApp ( com . google . firebase . projectmanagement . FirebaseProjectManagementTest . TEST_APP_ID , androidAppService ) ; com . google . firebase . projectmanagement . AndroidApp app2 = new com . google . firebase . projectmanagement . AndroidApp ( com . google . firebase . projectmanagement . FirebaseProjectManagementTest . TEST_APP_ID_2 , androidAppService ) ; com . google . firebase . projectmanagement . AndroidApp app3 = new com . google . firebase . projectmanagement . AndroidApp ( com . google . firebase . projectmanagement . FirebaseProjectManagementTest . TEST_APP_ID_3 , androidAppService ) ; when ( androidAppService . listAndroidApps ( com . google . firebase . projectmanagement . FirebaseProjectManagementTest . TEST_PROJECT_ID ) ) . thenReturn ( com . google . common . collect . ImmutableList . of ( app1 , app2 , app3 ) ) ; java . util . List < com . google . firebase . projectmanagement . AndroidApp > androidApps = projectManagement . listAndroidApps ( ) ; com . google . common . collect . ImmutableSet . Builder < java . lang . String > appIdsBuilder = com . google . common . collect . ImmutableSet . < java . lang . String > builder ( ) ; for ( com . google . firebase . projectmanagement . AndroidApp androidApp : androidApps ) { appIdsBuilder . add ( androidApp . getAppId ( ) ) ; } "<AssertPlaceHolder>" ; } build ( ) { return new com . google . firebase . messaging . MulticastMessage ( this ) ; } | org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableSet . of ( com . google . firebase . projectmanagement . FirebaseProjectManagementTest . TEST_APP_ID , com . google . firebase . projectmanagement . FirebaseProjectManagementTest . TEST_APP_ID_2 , com . google . firebase . projectmanagement . FirebaseProjectManagementTest . TEST_APP_ID_3 ) , appIdsBuilder . build ( ) ) |
testSignedUsernameToken ( ) { org . apache . cxf . service . Service service = createService ( ) ; org . apache . wss4j . stax . ext . WSSSecurityProperties inProperties = new org . apache . wss4j . stax . ext . WSSSecurityProperties ( ) ; inProperties . setCallbackHandler ( new org . apache . cxf . ws . security . wss4j . TestPwdCallback ( ) ) ; java . util . Properties cryptoProperties = org . apache . wss4j . common . crypto . CryptoFactory . getProperties ( "insecurity.properties" , this . getClass ( ) . getClassLoader ( ) ) ; inProperties . setSignatureVerificationCryptoProperties ( cryptoProperties ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor inhandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor ( inProperties ) ; service . getInInterceptors ( ) . add ( inhandler ) ; org . apache . cxf . ws . security . wss4j . StaxCryptoCoverageChecker checker = new org . apache . cxf . ws . security . wss4j . StaxCryptoCoverageChecker ( ) ; checker . setSignBody ( false ) ; checker . setSignUsernameToken ( true ) ; service . getInInterceptors ( ) . add ( checker ) ; org . apache . cxf . ws . security . wss4j . Echo echo = createClientProxy ( ) ; org . apache . cxf . endpoint . Client client = org . apache . cxf . frontend . ClientProxy . getClient ( echo ) ; client . getInInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingInInterceptor ( ) ) ; client . getOutInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingOutInterceptor ( ) ) ; org . apache . wss4j . stax . ext . WSSSecurityProperties properties = new org . apache . wss4j . stax . ext . WSSSecurityProperties ( ) ; java . util . List < org . apache . wss4j . stax . ext . WSSConstants . Action > actions = new java . util . ArrayList ( ) ; actions . add ( WSSConstants . USERNAMETOKEN ) ; actions . add ( XMLSecurityConstants . SIGNATURE ) ; properties . setActions ( actions ) ; properties . setSignatureUser ( "myalias" ) ; properties . addSignaturePart ( new org . apache . xml . security . stax . ext . SecurePart ( new javax . xml . namespace . QName ( org . apache . wss4j . stax . ext . WSSConstants . NS_WSSE10 , "UsernameToken" ) , SecurePart . Modifier . Element ) ) ; properties . addSignaturePart ( new org . apache . xml . security . stax . ext . SecurePart ( new javax . xml . namespace . QName ( org . apache . wss4j . stax . ext . WSSConstants . NS_SOAP11 , "Body" ) , SecurePart . Modifier . Element ) ) ; java . util . Properties outCryptoProperties = org . apache . wss4j . common . crypto . CryptoFactory . getProperties ( "outsecurity.properties" , this . getClass ( ) . getClassLoader ( ) ) ; properties . setSignatureCryptoProperties ( outCryptoProperties ) ; properties . setTokenUser ( "username" ) ; properties . setCallbackHandler ( new org . apache . cxf . ws . security . wss4j . TestPwdCallback ( ) ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ohandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ( properties ) ; client . getOutInterceptors ( ) . add ( ohandler ) ; checker . setEncryptUsernameToken ( false ) ; "<AssertPlaceHolder>" ; checker . setEncryptUsernameToken ( true ) ; try { echo . echo ( "test" ) ; org . junit . Assert . fail ( "Failure<sp>expected<sp>as<sp>UsernameToken<sp>isn't<sp>encrypted" ) ; } catch ( org . apache . cxf . ws . security . wss4j . javax ex ) { } } echo ( int ) { return i ; } | org . junit . Assert . assertEquals ( "test" , echo . echo ( "test" ) ) |
testInvalidKeepAliveHeader ( ) { org . apache . ogt . http . protocol . HttpContext context = new org . apache . ogt . http . protocol . BasicHttpContext ( null ) ; org . apache . ogt . http . HttpResponse response = new org . apache . ogt . http . message . BasicHttpResponse ( new org . apache . ogt . http . message . BasicStatusLine ( org . apache . ogt . http . HttpVersion . HTTP_1_1 , org . apache . ogt . http . HttpStatus . SC_OK , "OK" ) ) ; response . addHeader ( "Keep-Alive" , "timeout=whatever,<sp>max=20" ) ; org . apache . ogt . http . conn . ConnectionKeepAliveStrategy keepAliveStrat = new org . apache . ogt . http . impl . client . DefaultConnectionKeepAliveStrategy ( ) ; long d = keepAliveStrat . getKeepAliveDuration ( response , context ) ; "<AssertPlaceHolder>" ; } getKeepAliveDuration ( org . apache . ogt . http . HttpResponse , org . apache . ogt . http . protocol . HttpContext ) { if ( response == null ) { throw new java . lang . IllegalArgumentException ( "HTTP<sp>response<sp>may<sp>not<sp>be<sp>null" ) ; } org . apache . ogt . http . HeaderElementIterator it = new org . apache . ogt . http . message . BasicHeaderElementIterator ( response . headerIterator ( HTTP . CONN_KEEP_ALIVE ) ) ; while ( it . hasNext ( ) ) { org . apache . ogt . http . HeaderElement he = it . nextElement ( ) ; java . lang . String param = he . getName ( ) ; java . lang . String value = he . getValue ( ) ; if ( ( value != null ) && ( param . equalsIgnoreCase ( "timeout" ) ) ) { try { return ( java . lang . Long . parseLong ( value ) ) * 1000 ; } catch ( java . lang . NumberFormatException ignore ) { } } } return - 1 ; } | org . junit . Assert . assertEquals ( ( - 1 ) , d ) |
isUnixSymlinkIsFalseIfMoreThanOneFlagIsSet ( ) { try ( org . apache . commons . compress . archivers . zip . ZipFile zf = new org . apache . commons . compress . archivers . zip . ZipFile ( org . apache . commons . compress . AbstractTestCase . getFile ( "COMPRESS-379.jar" ) ) ) { org . apache . commons . compress . archivers . zip . ZipArchiveEntry ze = zf . getEntry ( "META-INF/maven/" ) ; "<AssertPlaceHolder>" ; } } isUnixSymlink ( ) { return ( ( getUnixMode ( ) ) & ( UnixStat . FILE_TYPE_FLAG ) ) == ( UnixStat . LINK_FLAG ) ; } | org . junit . Assert . assertFalse ( ze . isUnixSymlink ( ) ) |
testValidateObjectId ( ) { final com . allanbank . mongodb . bson . builder . DocumentBuilder fileResult = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; fileResult . addString ( "_id" , "id" ) . add ( GridFs . MD5_FIELD , "abcdef" ) ; final com . allanbank . mongodb . bson . builder . DocumentBuilder commandDoc = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; commandDoc . add ( "filemd5" , "id" ) ; commandDoc . add ( "root" , "fs" ) ; final com . allanbank . mongodb . bson . builder . DocumentBuilder cmdResult = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; cmdResult . add ( "ok" , 1 ) . add ( GridFs . MD5_FIELD , "abcdef" ) ; final com . allanbank . mongodb . MongoDatabase mockDb = createMock ( com . allanbank . mongodb . MongoDatabase . class ) ; final com . allanbank . mongodb . MongoCollection mockFiles = createMock ( com . allanbank . mongodb . MongoCollection . class ) ; final com . allanbank . mongodb . MongoCollection mockChunks = createMock ( com . allanbank . mongodb . MongoCollection . class ) ; expect ( mockFiles . findOne ( anyObject ( com . allanbank . mongodb . bson . DocumentAssignable . class ) ) ) . andReturn ( fileResult . build ( ) ) ; expect ( mockDb . getCollection ( ( "fs" + ( GridFs . FILES_SUFFIX ) ) ) ) . andReturn ( mockFiles ) ; expect ( mockDb . getCollection ( ( "fs" + ( GridFs . CHUNKS_SUFFIX ) ) ) ) . andReturn ( mockChunks ) ; expect ( mockDb . runCommand ( commandDoc . build ( ) ) ) . andReturn ( cmdResult . build ( ) ) ; replay ( mockDb , mockFiles , mockChunks ) ; final com . allanbank . mongodb . gridfs . GridFs fs = new com . allanbank . mongodb . gridfs . GridFs ( mockDb ) ; "<AssertPlaceHolder>" ; verify ( mockDb , mockFiles , mockChunks ) ; } validate ( com . allanbank . mongodb . bson . element . ObjectId ) { final com . allanbank . mongodb . bson . Document fileDoc = myFilesCollection . findOne ( where ( com . allanbank . mongodb . gridfs . GridFs . ID_FIELD ) . equals ( id ) ) ; if ( fileDoc == null ) { throw new java . io . FileNotFoundException ( id . toString ( ) ) ; } return doValidate ( fileDoc ) ; } | org . junit . Assert . assertTrue ( fs . validate ( new com . allanbank . mongodb . bson . element . ObjectId ( ) ) ) |
isABigFlower_withMockito_OK ( ) { when ( flowerService . isABigFlower ( eq ( "violetta" ) , anyInt ( ) ) ) . thenReturn ( true ) ; com . baeldung . app . api . Flower flower = new com . baeldung . app . api . Flower ( "violetta" , 15 ) ; java . lang . Boolean response = flowerController . isABigFlower ( flower ) ; "<AssertPlaceHolder>" ; } isABigFlower ( com . baeldung . app . api . Flower ) { return flowerService . isABigFlower ( flower . getName ( ) , flower . getPetals ( ) ) ; } | org . junit . Assert . assertTrue ( response ) |
testImplGenWithoutImplWithOptionTrue ( ) { java . lang . String [ ] args = new java . lang . String [ 8 ] ; args [ 0 ] = "generate" ; args [ 1 ] = "-l" ; args [ 2 ] = "java-vertx" ; args [ 3 ] = "-i" ; args [ 4 ] = "testUUID.json" ; args [ 5 ] = "-o" ; args [ 6 ] = "temp/test-server" ; args [ 7 ] = "-DapiImplGeneration=true" ; io . swagger . codegen . SwaggerCodegen . main ( args ) ; java . io . File testApiVerticleFile = new java . io . File ( "temp/test-server/src/main/java/io/swagger/server/api/verticle/TestApiImpl.java" ) ; "<AssertPlaceHolder>" ; org . apache . commons . io . FileUtils . deleteDirectory ( new java . io . File ( "temp" ) ) ; } | org . junit . Assert . assertTrue ( testApiVerticleFile . exists ( ) ) |
typeAndAnnotationAndName ( ) { org . awaitility . FakeRepositoryWithAnnotation repository = new org . awaitility . FakeRepositoryWithAnnotation ( ) ; new org . awaitility . Asynch ( repository ) . perform ( ) ; org . awaitility . Awaitility . await ( ) . until ( org . awaitility . Awaitility . fieldIn ( repository ) . ofType ( int . class ) . andAnnotatedWith ( org . awaitility . ExampleAnnotation . class ) . andWithName ( "value" ) , org . hamcrest . Matchers . equalTo ( 1 ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return currentConditionValue ; } | org . junit . Assert . assertEquals ( 1 , repository . getValue ( ) ) |
EndpointValues ( ) { try { for ( com . github . cypher . sdk . api . Endpoint endpoint : com . github . cypher . sdk . api . Endpoint . values ( ) ) { new java . net . URL ( "https://matrix.org" . concat ( endpoint . toString ( ) ) ) ; } } catch ( java . net . MalformedURLException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { java . lang . String errorCode = getErrorCode ( ) ; java . lang . String errorMessage = ( errorResponse . has ( "error" ) ) ? errorResponse . get ( "error" ) . getAsString ( ) : "" ; if ( ! ( errorMessage . isEmpty ( ) ) ) { return java . lang . Integer . toString ( super . getStatusCode ( ) ) . concat ( ":<sp>" ) . concat ( errorMessage ) ; } else if ( ! ( errorCode . isEmpty ( ) ) ) { return java . lang . Integer . toString ( super . getStatusCode ( ) ) . concat ( ":<sp>" ) . concat ( errorCode ) ; } else { return java . lang . Integer . toString ( super . getStatusCode ( ) ) ; } } | org . junit . Assert . assertFalse ( e . getMessage ( ) , true ) |
sendMailLocalTest ( ) { java . util . Map < java . lang . String , java . lang . Object > variables = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; variables . put ( "name" , "Tom<sp>Wang" ) ; variables . put ( "to" , "tom@localhost" ) ; variables . put ( "from" , "noreply@localhost" ) ; org . activiti . engine . runtime . ProcessInstance processInstance = activitiRule . getRuntimeService ( ) . startProcessInstanceByKey ( "testMailTask" , variables ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( processInstance ) |
shouldNoCollectWhenLessThenMax ( ) { scores = new com . codenjoy . dojo . a2048 . services . Scores ( 40 ) ; sum ( 10 ) ; sum ( 20 ) ; sum ( 30 ) ; "<AssertPlaceHolder>" ; } getScore ( ) { return score ; } | org . junit . Assert . assertEquals ( 40 , scores . getScore ( ) ) |
testActivateAndIntArrayData ( ) { java . lang . String [ ] args = new java . lang . String [ ] { "--run_cfg=src/main/resources/configuration/UnitTestConfig.cfg" } ; cc . mallet . configuration . LDACommandLineParser cp = new cc . mallet . configuration . LDACommandLineParser ( args ) ; cc . mallet . configuration . Configuration config = new cc . mallet . configuration . ParsedLDAConfiguration ( cp ) ; int [ ] expectedInts = new int [ ] { 100 , 200 , 400 , 800 , 1600 , 3200 , 6400 , 12800 , - 1 } ; config . activateSubconfig ( "demo" ) ; int [ ] defaultVal = new int [ ] { - 1 } ; int [ ] gottenInts = config . getIntArrayProperty ( "dataset_sizes" , defaultVal ) ; "<AssertPlaceHolder>" ; } getIntArrayProperty ( java . lang . String , int [ ] ) { switch ( key ) { case "dn_diagnostic_interval" : { return new int [ 0 ] ; } case "diagnostic_interval" : { return new int [ 0 ] ; } default : { return defaultValues ; } } } | org . junit . Assert . assertArrayEquals ( expectedInts , gottenInts ) |
shouldSetAndGetOpScores ( ) { final uk . gov . gchq . gaffer . store . operation . handler . ScoreOperationChainHandler handler = new uk . gov . gchq . gaffer . store . operation . handler . ScoreOperationChainHandler ( ) ; final java . util . LinkedHashMap < java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > , java . lang . Integer > opScores = new java . util . LinkedHashMap ( ) ; opScores . put ( uk . gov . gchq . gaffer . operation . Operation . class , 1 ) ; opScores . put ( uk . gov . gchq . gaffer . operation . impl . get . GetElements . class , 2 ) ; opScores . put ( uk . gov . gchq . gaffer . operation . impl . get . GetAllElements . class , 3 ) ; handler . setOpScores ( opScores ) ; final java . util . Map < java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > , java . lang . Integer > result = handler . getOpScores ( ) ; "<AssertPlaceHolder>" ; } getOpScores ( ) { return java . util . Collections . unmodifiableMap ( opScores ) ; } | org . junit . Assert . assertEquals ( opScores , result ) |
testProjectSubfolder ( ) { java . lang . String orgPath = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/project/t1t2.hale" ; java . lang . String path = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/project/t1t2_alt.hale" ; eu . esdihumboldt . hale . common . core . io . PathUpdate update = new eu . esdihumboldt . hale . common . core . io . PathUpdate ( java . net . URI . create ( ( "file:/" + orgPath ) ) , java . net . URI . create ( ( "file:/" + path ) ) ) ; java . net . URI file = java . net . URI . create ( "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1.xsd" ) ; java . lang . String correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1.xsd" ; java . lang . String newpath = update . changePath ( file ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return new java . lang . String ( fContent , 0 , fLength ) ; } | org . junit . Assert . assertEquals ( correct , newpath ) |
testStripSecretsFromParameters_nullInput ( ) { final java . lang . String secret1 = "client_secret" ; final java . lang . String secret2 = "secret2" ; final java . lang . String [ ] secrets = new java . lang . String [ ] { secret1 , secret2 } ; java . lang . String output = com . ibm . ws . security . common . web . WebUtils . stripSecretsFromParameters ( null , secrets ) ; "<AssertPlaceHolder>" ; } stripSecretsFromParameters ( java . util . Map , java . lang . String [ ] ) { java . lang . String retVal = null ; if ( ( pMap != null ) && ( ( pMap . size ( ) ) > 0 ) ) { java . util . List < java . lang . String > secretList = null ; if ( ( secretStrings != null ) && ( ( secretStrings . length ) != 0 ) ) { secretList = java . util . Arrays . asList ( secretStrings ) ; } else { secretList = new java . util . ArrayList ( ) ; } java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; java . util . Set < java . lang . String > keys = pMap . keySet ( ) ; for ( java . lang . String key : keys ) { sb . append ( ( ( "{" + key ) + "=" ) ) ; if ( secretList . contains ( key ) ) { sb . append ( "*****" ) ; } else { java . lang . String [ ] values = pMap . get ( key ) ; sb . append ( java . util . Arrays . toString ( values ) ) ; } sb . append ( "}" ) ; } retVal = sb . toString ( ) ; } return retVal ; } | org . junit . Assert . assertNull ( output ) |
shouldVisitSimpleProperties ( ) { final org . openspotlight . persist . util . SimplePersistVisitorSupportTest . SimpleObject1 root = createSampleData ( ) ; final java . util . concurrent . atomic . AtomicInteger count = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; org . openspotlight . persist . util . SimpleNodeTypeVisitorSupport . acceptVisitorOn ( org . openspotlight . persist . util . SimplePersistVisitorSupportTest . SimpleObject4 . class , root , new org . openspotlight . persist . util . SimpleNodeTypeVisitor < org . openspotlight . persist . util . SimplePersistVisitorSupportTest . SimpleObject4 > ( ) { @ org . openspotlight . persist . util . Override public void visitBean ( final org . openspotlight . persist . util . SimplePersistVisitorSupportTest . SimpleObject4 bean ) { count . incrementAndGet ( ) ; } } ) ; "<AssertPlaceHolder>" ; } visitBean ( org . openspotlight . persist . util . SimplePersistVisitorSupportTest$NodeObject ) { bean . getName ( ) . toString ( ) ; names . add ( bean . getName ( ) ) ; } | org . junit . Assert . assertThat ( count . get ( ) , org . hamcrest . core . Is . is ( 2 ) ) |
testCloseSuccess ( ) { org . mockito . Mockito . when ( context . getService ( com . streamsets . pipeline . api . service . dataformats . DataFormatGeneratorService . class ) ) . thenReturn ( org . mockito . Mockito . mock ( com . streamsets . pipeline . api . service . dataformats . DataFormatGeneratorService . class ) ) ; org . mockito . Mockito . when ( context . createELEval ( org . mockito . Mockito . any ( ) ) ) . thenReturn ( org . mockito . Mockito . mock ( com . streamsets . pipeline . api . el . ELEval . class ) ) ; com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducerImpl pulsarMessageProducer = new com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducerImpl ( com . streamsets . pipeline . stage . Utils . TestUtilsPulsar . getTargetConfig ( ) , context ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = pulsarMessageProducer . init ( context ) ; "<AssertPlaceHolder>" ; pulsarMessageProducer . close ( ) ; } isEmpty ( ) { return false ; } | org . junit . Assert . assertTrue ( issues . isEmpty ( ) ) |
testGetPageSize ( ) { org . apache . ambari . server . controller . spi . PageRequest pageRequest = new org . apache . ambari . server . controller . internal . PageRequestImpl ( PageRequest . StartingPoint . Beginning , 20 , 99 , null , null ) ; "<AssertPlaceHolder>" ; } getPageSize ( ) { return pageSize ; } | org . junit . Assert . assertEquals ( 20 , pageRequest . getPageSize ( ) ) |
beanBinder_withConverter_nullRepresentationIsNotDisabled ( ) { java . lang . String customNullPointerRepresentation = "foo" ; com . vaadin . flow . data . binder . Binder < com . vaadin . flow . tests . data . bean . Person > binder = new com . vaadin . flow . data . binder . Binder ( com . vaadin . flow . tests . data . bean . Person . class ) ; binder . forField ( nameField ) . withConverter ( ( value ) -> value , ( value ) -> value == null ? customNullPointerRepresentation : value ) . bind ( "firstName" ) ; com . vaadin . flow . tests . data . bean . Person person = new com . vaadin . flow . tests . data . bean . Person ( ) ; binder . setBean ( person ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( customNullPointerRepresentation , nameField . getValue ( ) ) |
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . wiki . model . WikiNode > wikiNodes = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( wikiNodes . isEmpty ( ) ) |
enitySetsCountIs1 ( ) { "<AssertPlaceHolder>" ; } getEntitySets ( ) { org . odata4j . consumer . ODataClientRequest request = org . odata4j . consumer . ODataClientRequest . get ( getServiceRootUri ( ) ) ; return org . core4j . Enumerable . create ( getClient ( ) . getCollections ( request ) ) . cast ( org . odata4j . core . EntitySetInfo . class ) ; } | org . junit . Assert . assertThat ( consumer . getEntitySets ( ) . count ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.