input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
regexDateTest ( ) { org . finra . datagenerator . consumer . DataPipe pipeToTransform = new org . finra . datagenerator . consumer . DataPipe ( ) ; org . finra . datagenerator . consumer . EquivalenceClassTransformer eqTransformer = new org . finra . datagenerator . consumer . EquivalenceClassTransformer ( ) ; java . lang . String testRegularExpression = "^(0[1-9]|1[012])[-<sp>/.](0[1-9]|[12][0-9]|3[01])[-<sp>/.](19|20)\\d\\d$" ; pipeToTransform . getDataMap ( ) . put ( "TEST" , ( ( "%regex(" + testRegularExpression ) + ")" ) ) ; eqTransformer . transform ( pipeToTransform ) ; java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( testRegularExpression ) ; java . util . regex . Matcher didItMatch = pattern . matcher ( pipeToTransform . getDataMap ( ) . get ( "TEST" ) ) ; "<AssertPlaceHolder>" ; } getDataMap ( ) { return dataMap ; }
|
org . junit . Assert . assertTrue ( didItMatch . matches ( ) )
|
testInitializingManipulator ( ) { org . apache . uima . jcas . JCas jCas = uk . gov . dstl . baleen . uima . testing . JCasSingleton . getJCasInstance ( ) ; uk . gov . dstl . baleen . uima . BaleenContentExtractor contentExtractor = new uk . gov . dstl . baleen . contentextractors . StructureContentExtractorTest . TestStructureContentExtractor ( ) ; java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap ( ) ; params . put ( "contentManipulators" , new java . lang . String [ ] { "RemoveEmptyText" } ) ; contentExtractor . initialize ( new org . apache . uima . resource . impl . CustomResourceSpecifier_impl ( ) , params ) ; contentExtractor . processStream ( null , "source" , jCas ) ; long count = org . apache . uima . fit . util . JCasUtil . select ( jCas , uk . gov . dstl . baleen . types . metadata . Metadata . class ) . stream ( ) . filter ( ( m ) -> ( m . getKey ( ) . equals ( "baleen:content-manipulators" ) ) && ( m . getValue ( ) . contains ( "RemoveEmptyText" ) ) ) . count ( ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return words . contains ( word ) ; }
|
org . junit . Assert . assertEquals ( 1 , count )
|
nullForCompatibleTypeMustResultInEdmException ( ) { "<AssertPlaceHolder>" ; } compatibleTo ( org . apache . olingo . commons . api . edm . EdmType ) { return startType . compatibleTo ( targetType ) ; }
|
org . junit . Assert . assertFalse ( type . compatibleTo ( null ) )
|
testGetVersionStorage ( ) { org . apache . jackrabbit . oak . api . Tree vs = getTestRoot ( ) . getTree ( VersionConstants . VERSION_STORE_PATH ) ; "<AssertPlaceHolder>" ; } exists ( ) { return delegate . exists ( ) ; }
|
org . junit . Assert . assertFalse ( vs . exists ( ) )
|
arrayContains ( ) { java . util . List < ru . lessons . lesson_10 . User > users = new java . util . ArrayList < ru . lessons . lesson_10 . User > ( ) ; users . add ( new ru . lessons . lesson_10 . User ( "1" , "first" ) ) ; users . add ( new ru . lessons . lesson_10 . User ( "2" , "second" ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( users . contains ( new ru . lessons . lesson_10 . User ( "1" , "first" ) ) )
|
testNewPacket ( ) { try { org . pcap4j . packet . EthernetPacket p = org . pcap4j . packet . EthernetPacket . newPacket ( packet . getRawData ( ) , 0 , packet . getRawData ( ) . length ) ; "<AssertPlaceHolder>" ; } catch ( org . pcap4j . packet . IllegalRawDataException e ) { throw new java . lang . AssertionError ( e ) ; } } getRawData ( ) { byte [ ] rawData = new byte [ length ( ) ] ; rawData [ 0 ] = getType ( ) . value ( ) ; rawData [ 1 ] = length ; rawData [ 2 ] = pointer ; rawData [ 3 ] = flag . value ( ) ; rawData [ 3 ] = ( ( byte ) ( ( rawData [ 3 ] ) | ( ( overflow ) << 4 ) ) ) ; if ( ( data ) != null ) { java . lang . System . arraycopy ( data . getRawData ( ) , 0 , rawData , 4 , data . length ( ) ) ; } return rawData ; }
|
org . junit . Assert . assertEquals ( packet , p )
|
testSimpleLookupBeforeFirst ( ) { System . out . println ( "testSimpleLookupFirstFound" ) ; java . lang . String BNumber ; java . lang . String result ; java . lang . String expResult ; java . lang . String Group ; long eventDate = 0 ; Group = "Default" ; BNumber = "0470000000" ; java . text . SimpleDateFormat sdfEvt = new java . text . SimpleDateFormat ( "yyyyMMddhhmmss" ) ; try { eventDate = ( sdfEvt . parse ( "20120101120000" ) . getTime ( ) ) / 1000 ; } catch ( java . lang . Exception ex ) { OpenRate . process . AbstractValidityFromLookupTest . message = "Error<sp>getting<sp>event<sp>date<sp>in<sp>test<sp><AbstractNPLookupTest>" ; org . junit . Assert . fail ( OpenRate . process . AbstractValidityFromLookupTest . message ) ; } result = OpenRate . process . AbstractValidityFromLookupTest . instance . getValidityFromMatch ( Group , BNumber , eventDate ) ; expResult = "NOMATCH" ; "<AssertPlaceHolder>" ; } getValidityFromMatch ( java . lang . String , java . lang . String , long ) { return NPC . getValiditySegmentMatch ( Group , resourceId , time ) ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testGetRegisteredCallback ( ) { io . joynr . proxy . StatelessAsyncCallbackDirectoryTest . MyTestCallback callback = new io . joynr . proxy . StatelessAsyncCallbackDirectoryTest . MyTestCallback ( ) ; subject . register ( callback ) ; io . joynr . proxy . StatelessAsyncCallback result = subject . get ( io . joynr . proxy . StatelessAsyncCallbackDirectoryTest . USE_CASE ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { io . joynr . messaging . routing . RoutingTableImpl . logger . trace ( "entering<sp>get(participantId={})" , participantId ) ; dumpRoutingTableEntry ( ) ; io . joynr . messaging . routing . RoutingTableImpl . RoutingEntry routingEntry = hashMap . get ( participantId ) ; if ( routingEntry == null ) { io . joynr . messaging . routing . RoutingTableImpl . logger . trace ( "leaving<sp>get(participantId={})<sp>=<sp>null" , participantId ) ; return null ; } io . joynr . messaging . routing . RoutingTableImpl . logger . trace ( "leaving<sp>get(participantId={})<sp>=<sp>{}" , participantId , routingEntry . getAddress ( ) ) ; return routingEntry . getAddress ( ) ; }
|
org . junit . Assert . assertEquals ( callback , result )
|
testBooleanObj ( ) { java . lang . Class < com . j256 . ormlite . field . types . BooleanCharTypeTest . LocalBooleanChar > clazz = com . j256 . ormlite . field . types . BooleanCharTypeTest . LocalBooleanChar . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . BooleanCharTypeTest . LocalBooleanChar , java . lang . Object > dao = createDao ( clazz , true ) ; boolean val = true ; java . lang . String valStr = java . lang . Boolean . toString ( val ) ; com . j256 . ormlite . field . types . BooleanCharTypeTest . LocalBooleanChar foo = new com . j256 . ormlite . field . types . BooleanCharTypeTest . LocalBooleanChar ( ) ; foo . bool = val ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , val , '1' , '1' , valStr , DataType . BOOLEAN_CHAR , com . j256 . ormlite . field . types . BooleanCharTypeTest . BOOLEAN_COLUMN , false , false , false , true , false , false , true , false ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
|
org . junit . Assert . assertEquals ( 1 , dao . create ( foo ) )
|
testNotifyMonitorsOfConnectionWhenStoragePoolConnectionHostFailure ( ) { final com . cloud . legacymodel . exceptions . ConnectionException connectionException = new com . cloud . legacymodel . exceptions . ConnectionException ( true , "storage<sp>pool<sp>could<sp>not<sp>be<sp>connected<sp>on<sp>host" ) ; org . mockito . Mockito . when ( hostDao . findById ( org . mockito . Mockito . anyLong ( ) ) ) . thenReturn ( host ) ; org . mockito . Mockito . doThrow ( connectionException ) . when ( storagePoolMonitor ) . processConnect ( org . mockito . Mockito . eq ( host ) , org . mockito . Mockito . eq ( cmds ) , org . mockito . Mockito . eq ( false ) ) ; org . mockito . Mockito . doReturn ( true ) . when ( mgr ) . handleDisconnectWithoutInvestigation ( org . mockito . Mockito . any ( attache . getClass ( ) ) , org . mockito . Mockito . any ( com . cloud . model . enumeration . Event . class ) , org . mockito . Mockito . anyBoolean ( ) , org . mockito . Mockito . anyBoolean ( ) ) ; try { mgr . notifyMonitorsOfConnection ( attache , cmds , false ) ; org . junit . Assert . fail ( "Connection<sp>Exception<sp>was<sp>expected" ) ; } catch ( final com . cloud . legacymodel . exceptions . ConnectionException e ) { "<AssertPlaceHolder>" ; } org . mockito . Mockito . verify ( mgr , org . mockito . Mockito . times ( 1 ) ) . handleDisconnectWithoutInvestigation ( org . mockito . Mockito . any ( attache . getClass ( ) ) , org . mockito . Mockito . eq ( Event . AgentDisconnected ) , org . mockito . Mockito . eq ( true ) , org . mockito . Mockito . eq ( true ) ) ; } getMessage ( ) { return message ; }
|
org . junit . Assert . assertEquals ( e . getMessage ( ) , connectionException . getMessage ( ) )
|
testGetDelegationTokens ( ) { org . apache . hadoop . security . token . Token < ? > [ ] delTokens = fsView . addDelegationTokens ( "sanjay" , new org . apache . hadoop . security . Credentials ( ) ) ; "<AssertPlaceHolder>" ; } getExpectedDelegationTokenCount ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( getExpectedDelegationTokenCount ( ) , delTokens . length )
|
testGetNumPoints ( ) { "<AssertPlaceHolder>" ; } getNumPoints ( ) { return points . size ( ) ; }
|
org . junit . Assert . assertEquals ( 5 , shell . getNumPoints ( ) )
|
testNewifyConstructorReferences4 ( ) { org . codehaus . jdt . groovy . model . GroovyCompilationUnit foo = createUnit ( "p" , "def<sp>m()<sp>{\n" 3 , ( "package<sp>p\n" + ( ( ( "def<sp>m()<sp>{\n" 5 + "<sp>Foo(int<sp>i)<sp>{}\n" ) + "def<sp>m()<sp>{\n" 2 ) + "def<sp>m()<sp>{\n" 0 ) ) ) ; createUnit ( "def<sp>m()<sp>{\n" 1 , "Bar" , ( "import<sp>p.Foo\n" + ( ( ( ( ( "@Newify(Foo)\n" + "def<sp>m()<sp>{\n" ) + "<sp>Foo()\n" ) + "def<sp>m()<sp>{\n" 6 ) + "def<sp>m()<sp>{\n" 4 ) + "}\n" ) ) ) ; long ctorRefs = searchForReferences ( foo . getType ( "def<sp>m()<sp>{\n" 3 ) . getMethods ( ) [ 0 ] ) . stream ( ) . filter ( ( match ) -> ( ( org . eclipse . jdt . core . IMethod ) ( match . getElement ( ) ) ) . getResource ( ) . getName ( ) . equals ( "Bar.groovy" ) ) . count ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } org . codehaus . groovy . eclipse . quickfix . proposals . ProblemDescriptor other = ( ( org . codehaus . groovy . eclipse . quickfix . proposals . ProblemDescriptor ) ( obj ) ) ; if ( ! ( java . util . Arrays . equals ( messages , other . messages ) ) ) { return false ; } if ( ( type ) == null ) { if ( ( other . type ) != null ) { return false ; } } else if ( ! ( type . equals ( other . type ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertEquals ( 2 , ctorRefs )
|
testAuth ( ) { org . opendaylight . netconf . nettyutil . handler . NetconfXMLToHelloMessageDecoder parser = new org . opendaylight . netconf . nettyutil . handler . NetconfXMLToHelloMessageDecoder ( ) ; java . io . File authHelloFile = new java . io . File ( getClass ( ) . getResource ( "/netconfMessages/client_hello_with_auth.xml" ) . getFile ( ) ) ; final java . util . List < java . lang . Object > out = new java . util . ArrayList ( ) ; parser . decode ( null , io . netty . buffer . Unpooled . wrappedBuffer ( com . google . common . io . Files . toByteArray ( authHelloFile ) ) , out ) ; "<AssertPlaceHolder>" ; } size ( ) { return store . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , out . size ( ) )
|
listColumns ( ) { java . util . Set < java . lang . Object > set1 = new java . util . HashSet ( ) ; java . util . Set < java . lang . Object > set2 = new java . util . HashSet ( ) ; try { java . util . List < com . jsql . model . bean . database . Column > cs = com . jsql . model . accessible . DataAccess . listColumns ( new com . jsql . model . bean . database . Table ( this . jsqlTableName , "0" , new com . jsql . model . bean . database . Database ( this . jsqlDatabaseName , "0" ) ) ) ; java . util . List < java . lang . String > columnsFound = new java . util . ArrayList ( ) ; for ( com . jsql . model . bean . database . Column c : cs ) { columnsFound . add ( c . toString ( ) ) ; } set1 . addAll ( columnsFound ) ; set2 . addAll ( this . columnToFind ) ; com . test . AbstractTestSuite . LOGGER . info ( ( ( ( ( "listColumns:<sp>found<sp>" + set1 ) + "\nto<sp>find<sp>" ) + set2 ) + "\n" ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . AssertionError e ) { java . util . Set < java . lang . Object > tmp = new java . util . TreeSet ( ) ; for ( java . lang . Object x : set1 ) { if ( ! ( set2 . contains ( x ) ) ) { tmp . add ( x ) ; } } for ( java . lang . Object x : set2 ) { if ( ! ( set1 . contains ( x ) ) ) { tmp . add ( x ) ; } } throw new java . lang . AssertionError ( ( ( ( "Error<sp>listColumns:<sp>" + tmp ) + "\n" ) + e ) ) ; } } isEmpty ( ) { return this . properties . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( ( ! ( set1 . isEmpty ( ) ) ) && ( ! ( set2 . isEmpty ( ) ) ) ) && ( set1 . equals ( set2 ) ) ) )
|
testRemoveToken ( ) { org . apache . jackrabbit . oak . spi . security . authentication . token . TokenInfo readOnlyInfo = readOnlyTp . getTokenInfo ( generateToken ( ) ) ; "<AssertPlaceHolder>" ; } remove ( ) { com . google . common . base . Preconditions . checkState ( ( ! ( isEmpty ( ) ) ) , "Cannot<sp>remove<sp>item<sp>from<sp>empty<sp>list" ) ; org . apache . jackrabbit . oak . index . indexer . document . NodeStateEntry ret = head . next . data ; head . next . isValid = false ; head . next = head . next . next ; ( size ) -- ; memUsage -= ret . estimatedMemUsage ( ) ; if ( ( size ) == 0 ) { tail = head ; } return ret ; }
|
org . junit . Assert . assertFalse ( readOnlyInfo . remove ( ) )
|
testRemoveCtxIdentifier ( ) { final org . societies . api . context . model . CtxEntity ctxEntity ; final java . util . concurrent . Future < org . societies . api . context . model . CtxEntity > futureCtxEntity = internalCtxBroker . createEntity ( "entType" ) ; ctxEntity = futureCtxEntity . get ( ) ; final java . util . concurrent . Future < org . societies . api . context . model . CtxModelObject > removed = internalCtxBroker . remove ( ctxEntity . getId ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertNotNull ( removed )
|
empty ( ) { relationResolver = new org . drools . verifier . core . relations . RelationResolver ( new org . drools . verifier . core . maps . InspectorList ( configuration ) ) ; "<AssertPlaceHolder>" ; } subsumes ( org . drools . verifier . core . checks . SingleRangeCheck$PartitionKey ) { return java . util . stream . IntStream . range ( 0 , keys . length ) . allMatch ( ( i ) -> ( ( keys [ i ] ) == null ) || ( keys [ i ] . equals ( other . keys [ i ] ) ) ) ; }
|
org . junit . Assert . assertTrue ( relationResolver . subsumes ( new org . drools . verifier . core . maps . InspectorList ( configuration ) ) )
|
should_count_by_like ( ) { createSimple ( "testFindAll1" ) ; createSimple ( "testFindAll2" ) ; com . ctp . cdi . query . test . domain . Simple example = new com . ctp . cdi . query . test . domain . Simple ( "test" ) ; java . lang . Long count = dao . countLike ( example , Simple_ . name ) ; "<AssertPlaceHolder>" ; } countLike ( E , javax . persistence . metamodel . SingularAttribute [ ] ) { return executeCountQuery ( example , true , attributes ) ; }
|
org . junit . Assert . assertEquals ( java . lang . Long . valueOf ( 2 ) , count )
|
testDatasetNull ( ) { dataset = null ; java . lang . String expected = "Can't<sp>delete<sp>Private<sp>URL.<sp>Dataset<sp>is<sp>null." ; java . lang . String actual = null ; try { testEngine . submit ( new edu . harvard . iq . dataverse . engine . command . impl . DeletePrivateUrlCommand ( null , dataset ) ) ; } catch ( edu . harvard . iq . dataverse . engine . command . exception . CommandException ex ) { actual = ex . getMessage ( ) ; } "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testOCFilesWithFolderFirst ( ) { java . util . List < com . owncloud . android . datamodel . OCFile > sortedArray = new java . util . ArrayList ( ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/ah.txt" ) . setFolder ( ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/h.txt" ) . setFolder ( ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/oh.txt" ) . setFolder ( ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/h.txt" ) . setFolder ( ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/h.txt" ) . setFolder ( ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/h.txt" ) . setFolder ( ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/h.txt" ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/h.txt" ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/uh.txt" ) ) ; sortedArray . add ( new com . owncloud . android . datamodel . OCFile ( "/h<sp>2.txt" ) ) ; "<AssertPlaceHolder>" ; } sortAndTest ( java . util . List ) { return test ( sortedList , sort ( sortedList ) ) ; }
|
org . junit . Assert . assertTrue ( sortAndTest ( sortedArray ) )
|
testSplit ( ) { byte [ ] in = new byte [ ] { 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 } ; byte [ ] out = io . craft . atom . util . ByteUtil . split ( in , 2 , 6 ) ; "<AssertPlaceHolder>" ; System . out . println ( java . lang . String . format ( "[CRAFT-ATOM-UTIL]<sp>(^_^)<sp><%s><sp>Case<sp>-><sp>make<sp>split.<sp>" , io . craft . atom . test . CaseCounter . incr ( 1 ) ) ) ; } split ( byte [ ] , int , int ) { if ( bytes == null ) { return null ; } if ( start < 0 ) { throw new java . lang . IllegalArgumentException ( "start<sp><<sp>0" ) ; } if ( end > ( bytes . length ) ) { throw new java . lang . IllegalArgumentException ( "end<sp>><sp>size" ) ; } if ( start > end ) { throw new java . lang . IllegalArgumentException ( "start<sp>><sp>end" ) ; } int len = end - start ; byte [ ] dest = new byte [ len ] ; java . lang . System . arraycopy ( bytes , start , dest , 0 , len ) ; return dest ; }
|
org . junit . Assert . assertArrayEquals ( new byte [ ] { 1 , 1 , 1 , 1 } , out )
|
forEachValue ( ) { org . eclipse . collections . api . list . MutableList < java . lang . String > collection = Lists . mutable . of ( ) ; org . eclipse . collections . api . map . MutableMap < java . lang . Integer , java . lang . String > map = new org . eclipse . collections . impl . map . fixed . SingletonMap ( 1 , "1" ) ; map . forEachValue ( org . eclipse . collections . impl . block . procedure . CollectionAddProcedure . on ( collection ) ) ; "<AssertPlaceHolder>" ; } newListWith ( E [ ] ) { return new org . eclipse . collections . impl . list . mutable . FastList < > ( elements ) ; }
|
org . junit . Assert . assertEquals ( org . eclipse . collections . impl . list . mutable . FastList . newListWith ( "1" ) , collection )
|
testBold ( ) { java . lang . String expected = "<strong>text</strong>" ; java . lang . String actual = _htmlBBCodeTranslator . parse ( "[b]text[/b]" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { if ( com . liferay . portal . kernel . util . Validator . isNull ( s ) ) { throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>image<sp>adaptive<sp>media<sp>configuration:<sp>" + s ) ) ; } java . lang . String [ ] fields = com . liferay . adaptive . media . image . internal . configuration . AMImageConfigurationEntryParser . _fieldSeparatorPattern . split ( s ) ; if ( ( ( fields . length ) != 4 ) && ( ( fields . length ) != 5 ) ) { throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>image<sp>adaptive<sp>media<sp>configuration:<sp>" + s ) ) ; } java . lang . String name = fields [ 0 ] ; name = _http . decodeURL ( name ) ; java . lang . String description = fields [ 1 ] ; description = _http . decodeURL ( description ) ; java . lang . String uuid = fields [ 2 ] ; if ( ( com . liferay . portal . kernel . util . Validator . isNull ( name ) ) || ( com . liferay . portal . kernel . util . Validator . isNull ( uuid ) ) ) { throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>image<sp>adaptive<sp>media<sp>configuration:<sp>" + s ) ) ; } java . lang . String [ ] attributes = com . liferay . adaptive . media . image . internal . configuration . AMImageConfigurationEntryParser . _attributeSeparatorPattern . split ( fields [ 3 ] ) ; java . util . Map < java . lang . String , java . lang . String > properties = new java . util . HashMap ( ) ; for ( java . lang . String attribute : attributes ) { java . lang . String [ ] keyValuePair = com . liferay . adaptive . media . image . internal . configuration . AMImageConfigurationEntryParser . _keyValueSeparatorPattern . split ( attribute ) ; properties . put ( keyValuePair [ 0 ] , keyValuePair [ 1 ] ) ; } boolean enabled = true ; if ( ( fields . length ) == 5 ) { java . lang . String disabledAttribute = fields [ 4 ] ; java . util . regex . Matcher matcher = com . liferay . adaptive . media . image . internal . configuration . AMImageConfigurationEntryParser . _disabledSeparatorPattern . matcher ( disabledAttribute ) ; if ( ! ( matcher . matches ( ) ) ) { throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>image<sp>adaptive<sp>media<sp>configuration:<sp>" + s ) ) ; } enabled = com . liferay . portal . kernel . util . GetterUtil . getBoolean ( matcher . group ( 1 ) ) ; } return new com . liferay . adaptive . media . image . internal . configuration . AMImageConfigurationEntryImpl ( name , description , uuid , properties , enabled ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testResolvePackageWithSrcPath ( ) { final javax . enterprise . inject . spi . Bean moduleServiceBean = ( ( javax . enterprise . inject . spi . Bean ) ( beanManager . getBeans ( org . kie . workbench . common . services . shared . project . KieModuleService . class ) . iterator ( ) . next ( ) ) ) ; final javax . enterprise . context . spi . CreationalContext cc = beanManager . createCreationalContext ( moduleServiceBean ) ; final org . kie . workbench . common . services . shared . project . KieModuleService moduleService = ( ( org . kie . workbench . common . services . shared . project . KieModuleService ) ( beanManager . getReference ( moduleServiceBean , org . kie . workbench . common . services . shared . project . KieModuleService . class , cc ) ) ) ; final java . net . URL rootUrl = this . getClass ( ) . getResource ( "/ModuleBackendTestModuleStructureInvalidNoKModule/src" ) ; final org . uberfire . java . nio . file . Path nioRootPath = fs . getPath ( rootUrl . toURI ( ) ) ; final org . uberfire . backend . vfs . Path rootPath = paths . convert ( nioRootPath ) ; final org . guvnor . common . services . project . model . Package result = moduleService . resolvePackage ( rootPath ) ; "<AssertPlaceHolder>" ; } resolvePackage ( org . uberfire . backend . vfs . Path ) { try { if ( resource == null ) { return null ; } final org . guvnor . common . services . project . model . Module module = resolveModule ( resource , false ) ; if ( module == null ) { return null ; } if ( ( isPom ( resource ) ) || ( kModuleService . isKModule ( resource ) ) ) { return null ; } return makePackage ( module , resource ) ; } catch ( java . lang . Exception e ) { throw org . guvnor . common . services . backend . exceptions . ExceptionUtilities . handleException ( e ) ; } }
|
org . junit . Assert . assertNull ( result )
|
testRoundTripOfPojoWithPrimitiveNumbers ( ) { com . owlike . genson . JsonSerDeserSymetricTest . PojoWithPrimitives expected = new com . owlike . genson . JsonSerDeserSymetricTest . PojoWithPrimitives ( 2.1F , ( ( short ) ( 3 ) ) , ( ( byte ) ( 11 ) ) , 'a' ) ; "<AssertPlaceHolder>" ; } deserialize ( com . owlike . genson . stream . ObjectReader , com . owlike . genson . Context ) { T obj ; if ( options . isAsTimestamp ( ) ) { switch ( options . getTimestampFormat ( ) ) { case ARRAY : obj = readArray ( reader ) ; break ; case OBJECT : obj = readObject ( reader ) ; break ; default : throw new java . lang . IllegalArgumentException ( "Unsupported<sp>timestamp<sp>format" ) ; } } else { obj = parseFunction . apply ( reader . valueAsString ( ) ) ; } return obj ; }
|
org . junit . Assert . assertEquals ( expected , genson . deserialize ( genson . serialize ( expected ) , com . owlike . genson . JsonSerDeserSymetricTest . PojoWithPrimitives . class ) )
|
testSerialization ( ) { java . util . List u1 = new java . util . ArrayList ( ) ; u1 . add ( "URL<sp>A1" ) ; u1 . add ( "URL<sp>A2" ) ; u1 . add ( "URL<sp>A3" ) ; java . util . List u2 = new java . util . ArrayList ( ) ; u2 . add ( "URL<sp>B1" ) ; u2 . add ( "URL<sp>B2" ) ; u2 . add ( "URL<sp>B3" ) ; org . jfree . chart . urls . CustomXYURLGenerator g1 = new org . jfree . chart . urls . CustomXYURLGenerator ( ) ; g1 . addURLSeries ( u1 ) ; g1 . addURLSeries ( u2 ) ; org . jfree . chart . urls . CustomXYURLGenerator g2 = ( ( org . jfree . chart . urls . CustomXYURLGenerator ) ( org . jfree . chart . TestUtilities . serialised ( g1 ) ) ) ; "<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 ( g1 , g2 )
|
testArrayType ( ) { "<AssertPlaceHolder>" ; } getDataTypeNameFromSQLType ( int ) { if ( sqlType == ( java . sql . Types . ARRAY ) ) { return org . teiid . translator . TypeFacility . RUNTIME_NAMES . OBJECT ; } return org . teiid . translator . JDBCSQLTypeInfo . getTypeName ( sqlType ) ; }
|
org . junit . Assert . assertEquals ( TypeFacility . RUNTIME_NAMES . OBJECT , org . teiid . translator . TypeFacility . getDataTypeNameFromSQLType ( Types . ARRAY ) )
|
testGetFilePreviousDir ( ) { classUnderTest . setFilePreviousDir ( "aTestString" ) ; "<AssertPlaceHolder>" ; } getFilePreviousDir ( ) { return _filePreviousDir ; }
|
org . junit . Assert . assertEquals ( "aTestString" , classUnderTest . getFilePreviousDir ( ) )
|
testConcurrentUpdate ( ) { final org . kie . workbench . common . widgets . metadata . client . TestDocument document = createTestDocument ( ) ; final org . uberfire . backend . vfs . ObservablePath path = document . getLatestPath ( ) ; registerDocument ( document ) ; final org . mockito . ArgumentCaptor < org . uberfire . mvp . ParameterizedCommand > updateCommandCaptor = org . mockito . ArgumentCaptor . forClass ( org . uberfire . mvp . ParameterizedCommand . class ) ; verify ( path , times ( 1 ) ) . onConcurrentUpdate ( updateCommandCaptor . capture ( ) ) ; final org . uberfire . mvp . ParameterizedCommand updateCommand = updateCommandCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; final org . uberfire . backend . vfs . ObservablePath . OnConcurrentUpdateEvent info = mock ( ObservablePath . OnConcurrentUpdateEvent . class ) ; updateCommand . execute ( info ) ; verify ( document , times ( 1 ) ) . setConcurrentUpdateSessionInfo ( eq ( info ) ) ; } getValue ( ) { return rootPath ; }
|
org . junit . Assert . assertNotNull ( updateCommand )
|
testLotsOfFrames ( ) { final java . lang . String baseMessage = "<sp>syslog<sp>19<sp>this<sp>is<sp>message<sp>" ; final java . util . List < java . lang . String > messages = new java . util . ArrayList ( ) ; for ( int i = 100 ; i < 1000 ; i ++ ) { messages . add ( ( ( ( i + baseMessage ) + i ) + "\n" ) ) ; } run ( messages ) ; "<AssertPlaceHolder>" ; } size ( ) { return bytes . length ; }
|
org . junit . Assert . assertEquals ( messages . size ( ) , events . size ( ) )
|
testUnrecognizedFormat ( ) { java . lang . String [ ] expect = new java . lang . String [ ] { "fatal:<sp>Unknown<sp>archive<sp>format<sp>'nonsense'" , "" } ; java . lang . String [ ] actual = executeUnchecked ( ( "git<sp>archive<sp>--format=nonsense<sp>" + ( emptyTree ) ) ) ; "<AssertPlaceHolder>" ; } executeUnchecked ( java . lang . String [ ] ) { java . util . List < java . lang . String > result = new java . util . ArrayList ( cmds . length ) ; for ( java . lang . String cmd : cmds ) { result . addAll ( org . eclipse . jgit . pgm . CLIGitCommand . executeUnchecked ( cmd , db ) ) ; } return result . toArray ( new java . lang . String [ 0 ] ) ; }
|
org . junit . Assert . assertArrayEquals ( expect , actual )
|
testCanPrescribeIsFalseEmptyStringProvider ( ) { org . oscarehr . common . model . Drug d = getTestDrug ( ) ; d . setProviderNo ( "" ) ; "<AssertPlaceHolder>" ; } canPrescribe ( org . oscarehr . common . model . Drug ) { if ( d == null ) { org . oscarehr . managers . RxManager . logger . debug ( "drug<sp>was<sp>null<sp>returning<sp>false" ) ; return false ; } if ( ( ( d . getProviderNo ( ) ) == null ) || ( d . getProviderNo ( ) . equals ( "" ) ) ) { org . oscarehr . managers . RxManager . logger . debug ( "provider<sp>was<sp>null<sp>or<sp>blank<sp>returning<sp>false" ) ; return false ; } if ( ( ( d . getDemographicId ( ) ) == null ) || ( ( d . getDemographicId ( ) ) < 0 ) ) { org . oscarehr . managers . RxManager . logger . debug ( "demographic<sp>was<sp>null<sp>returning<sp>false" ) ; return false ; } if ( ( d . getRxDate ( ) ) == null ) { org . oscarehr . managers . RxManager . logger . debug ( "rx<sp>date<sp>was<sp>null<sp>returning<sp>false" ) ; return false ; } if ( ( ( d . getEndDate ( ) ) == null ) || ( d . getRxDate ( ) . after ( d . getEndDate ( ) ) ) ) { org . oscarehr . managers . RxManager . logger . debug ( "drug<sp>endDate<sp>was<sp>null" ) ; return false ; } if ( ( ( d . getSpecial ( ) ) == null ) || ( d . getSpecial ( ) . equals ( "" ) ) ) { org . oscarehr . managers . RxManager . logger . debug ( "drug<sp>special<sp>instructions<sp>was<sp>null<sp>returning<sp>false" ) ; return false ; } return true ; }
|
org . junit . Assert . assertFalse ( canPrescribe ( d ) )
|
testGetParameters ( ) { org . openscience . cdk . qsar . DescriptorSpecification spec = new org . openscience . cdk . qsar . DescriptorSpecification ( org . openscience . cdk . qsar . DescriptorValueTest . DESC_REF , org . openscience . cdk . qsar . DescriptorValueTest . DESC_IMPL_TITLE , org . openscience . cdk . qsar . DescriptorValueTest . DESC_IMPL_ID , org . openscience . cdk . qsar . DescriptorValueTest . DESC_IMPL_VENDOR ) ; org . openscience . cdk . qsar . result . DoubleResult doubleVal = new org . openscience . cdk . qsar . result . DoubleResult ( 0.7 ) ; org . openscience . cdk . qsar . DescriptorValue value = new org . openscience . cdk . qsar . DescriptorValue ( spec , new java . lang . String [ 0 ] , new java . lang . Object [ 0 ] , doubleVal , new java . lang . String [ ] { "bla" } ) ; "<AssertPlaceHolder>" ; } getParameters ( ) { java . lang . Object [ ] params = new java . lang . Object [ 2 ] ; params [ 0 ] = mass ; params [ 1 ] = tolerance ; return params ; }
|
org . junit . Assert . assertEquals ( 0 , value . getParameters ( ) . length )
|
resizer_Null ( ) { try { net . coobird . thumbnailator . Thumbnails . of ( "non-existent-file" ) . size ( 200 , 200 ) . resizer ( null ) ; } catch ( java . lang . NullPointerException e ) { "<AssertPlaceHolder>" ; throw e ; } } resizer ( net . coobird . thumbnailator . resizers . Resizer ) { if ( resizer == null ) { throw new java . lang . NullPointerException ( "Resizer<sp>is<sp>null." ) ; } this . resizerFactory = new net . coobird . thumbnailator . resizers . FixedResizerFactory ( resizer ) ; return this ; }
|
org . junit . Assert . assertEquals ( "Resizer<sp>is<sp>null." , e . getMessage ( ) )
|
testStorageReuseOldStorage ( ) { startFramework ( ) ; org . eclipse . concierge . test . util . SyntheticBundleBuilder builder = org . eclipse . concierge . test . util . SyntheticBundleBuilder . newBuilder ( ) ; builder . bundleSymbolicName ( "bundle" ) ; installBundle ( builder ) ; checkStorageStructure ( ) ; stopFramework ( ) ; checkStorageStructure ( ) ; java . util . HashMap < java . lang . String , java . lang . String > launchArgs = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; startFramework ( launchArgs ) ; org . osgi . framework . BundleContext bundleContext = framework . getBundleContext ( ) ; org . osgi . framework . Bundle [ ] bundles = bundleContext . getBundles ( ) ; "<AssertPlaceHolder>" ; } getBundles ( ) { org . osgi . framework . dto . FrameworkDTO framework = context . getBundle ( 0 ) . adapt ( org . osgi . framework . dto . FrameworkDTO . class ) ; return framework . bundles ; }
|
org . junit . Assert . assertEquals ( 2 , bundles . length )
|
defaultSupportedContentTypesAndGifForEntityLink ( ) { java . lang . String ctGif = com . sap . core . odata . core . commons . ContentType . create ( "image" , "gif" ) . toContentTypeString ( ) ; when ( ( ( com . sap . core . odata . api . processor . feature . CustomContentType ) ( processor ) ) . getCustomContentTypes ( com . sap . core . odata . api . processor . part . EntityLinkProcessor . class ) ) . thenReturn ( java . util . Arrays . asList ( ctGif ) ) ; java . util . List < java . lang . String > types = service . getSupportedContentTypes ( com . sap . core . odata . api . processor . part . EntityLinkProcessor . class ) ; "<AssertPlaceHolder>" ; } getSupportedContentTypes ( java . lang . Class ) { return com . sap . core . odata . core . commons . ContentType . create ( service . getSupportedContentTypes ( processorFeature ) ) ; }
|
org . junit . Assert . assertTrue ( types . contains ( ctGif ) )
|
testGetAverageTimeMillis_averageRoundsUp ( ) { frame . addElapsedTime ( 3 ) ; frame . addElapsedTime ( 3 ) ; frame . addElapsedTime ( 4 ) ; "<AssertPlaceHolder>" ; } getAverageTimeMilis ( ) { return java . lang . Math . round ( ( ( this . elapsedTimeStatistics . getValueCount ( ) ) == 0 ? 0 : ( this . elapsedTimeStatistics . getValueSum ( ) ) / ( this . elapsedTimeStatistics . getValueCount ( ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( 3 , frame . getAverageTimeMilis ( ) )
|
testPreferencesAreSet ( ) { profile . preferences ( ) . set ( "Personal<sp>Info" , "Country" , "Norway" ) ; com . opera . core . systems . OperaSettings settings = new com . opera . core . systems . OperaSettings ( profile ) ; driver = new com . opera . core . systems . testing . drivers . TestDriverBuilder ( ) . using ( settings ) . get ( ) ; "<AssertPlaceHolder>" ; } preferences ( ) { return preferences ; }
|
org . junit . Assert . assertEquals ( "Norway" , driver . preferences ( ) . get ( "Personal<sp>Info" , "Country" ) . getValue ( ) )
|
testBuildQuery ( ) { com . google . api . ads . admanager . axis . utils . v201805 . StatementBuilder statementBuilder = new com . google . api . ads . admanager . axis . utils . v201805 . StatementBuilder ( ) . select ( "id,<sp>name" ) . from ( "line_item" ) . where ( "name<sp>like<sp>:prefix" ) . orderBy ( "id<sp>ASC" ) . limit ( 100 ) . offset ( 0 ) . withBindVariableValue ( "prefix" , "debug-%" ) ; java . lang . String expected = "SELECT<sp>id,<sp>name<sp>FROM<sp>line_item<sp>WHERE<sp>name<sp>like<sp>:prefix<sp>ORDER<sp>BY<sp>id<sp>ASC<sp>" + "LIMIT<sp>100<sp>OFFSET<sp>0" ; "<AssertPlaceHolder>" ; } buildQuery ( ) { return queryBuilder . buildQuery ( ) ; }
|
org . junit . Assert . assertEquals ( expected , statementBuilder . buildQuery ( ) )
|
testLeftJoin ( ) { org . apache . eagle . alert . engine . coordinator . PolicyDefinition def = org . apache . eagle . alert . engine . interpreter . PolicyInterpreterTest . mapper . readValue ( org . apache . eagle . alert . engine . interpreter . PolicyInterpreterTest . class . getResourceAsStream ( "/interpreter/policy.json" ) , org . apache . eagle . alert . engine . coordinator . PolicyDefinition . class ) ; com . fasterxml . jackson . databind . node . ArrayNode array = ( ( com . fasterxml . jackson . databind . node . ArrayNode ) ( org . apache . eagle . alert . engine . interpreter . PolicyInterpreterTest . mapper . readTree ( org . apache . eagle . alert . engine . interpreter . PolicyInterpreterTest . class . getResourceAsStream ( "/interpreter/streams.json" ) ) ) ) ; org . apache . eagle . alert . engine . interpreter . Map < java . lang . String , org . apache . eagle . alert . engine . coordinator . StreamDefinition > allDefinitions = new org . apache . eagle . alert . engine . interpreter . HashMap ( ) ; for ( com . fasterxml . jackson . databind . JsonNode node : array ) { org . apache . eagle . alert . engine . coordinator . StreamDefinition streamDef = org . apache . eagle . alert . engine . interpreter . PolicyInterpreterTest . mapper . readValue ( node . toString ( ) , org . apache . eagle . alert . engine . coordinator . StreamDefinition . class ) ; allDefinitions . put ( streamDef . getStreamId ( ) , streamDef ) ; } org . apache . eagle . alert . engine . interpreter . PolicyValidationResult result = org . apache . eagle . alert . engine . interpreter . PolicyInterpreter . validate ( def , allDefinitions ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return success ; }
|
org . junit . Assert . assertTrue ( result . isSuccess ( ) )
|
testVoerStapUitMetMutatieBericht ( ) { leverberichten . add ( new nl . bzk . brp . model . levering . MutatieBericht ( admhnd ) ) ; final boolean stapResultaat = voorkomenFilterStap . voerStapUit ( onderwerp , context , resultaat ) ; "<AssertPlaceHolder>" ; verify ( voorkomenFilterService ) . voerVoorkomenFilterUitVoorMutatieLevering ( any ( nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView . class ) , eq ( dienst ) , anyMap ( ) ) ; } voerStapUit ( nl . bzk . brp . model . basis . BrpObject , nl . bzk . brp . business . stappen . StappenContext , nl . bzk . brp . business . stappen . StappenResultaat ) { verwerkingsResultaat = new nl . bzk . brp . webservice . business . stappen . BerichtVerwerkingsResultaatImpl ( ) ; valideer ( onderwerp , verwerkingsResultaat ) ; return true ; }
|
org . junit . Assert . assertTrue ( stapResultaat )
|
filterHasWarningsFieldFalse ( ) { org . spincast . core . request . Form form = getFormFactory ( ) . createForm ( "myFormName" , null ) ; org . spincast . core . json . JsonObject model = getJsonManager ( ) . create ( ) ; org . spincast . core . json . JsonObject validationElement = getJsonManager ( ) . create ( ) ; model . set ( getSpincastConfig ( ) . getValidationElementDefaultName ( ) , validationElement ) ; form . setValidationObject ( validationElement ) ; form . addSuccess ( "age" , "age1" , "message" ) ; form . addError ( "age" , "age2" , "message" ) ; java . lang . String html = getTemplatingEngine ( ) . evaluate ( "<sp>{%<sp>if<sp>validation['myFormName.age']<sp>|<sp>validationHasWarnings()<sp>%}yes{%<sp>endif<sp>%}" , model ) . trim ( ) ; "<AssertPlaceHolder>" ; } evaluate ( java . lang . String , java . util . Map ) { return evaluate ( content , params , getLocaleToUse ( ) ) ; }
|
org . junit . Assert . assertEquals ( "" , html )
|
checkHandlerCreation ( ) { info . smart_tools . smartactors . ioc . ikey . IKey key = mock ( info . smart_tools . smartactors . ioc . ikey . IKey . class ) ; info . smart_tools . smartactors . base . interfaces . iaction . IAction handler = new info . smart_tools . smartactors . core . scope_creation_event_handler . ScopeCreationEventHandler ( key ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( handler )
|
clientChecksInboundMetadataSize_trailer ( ) { server . start ( serverListener ) ; client = newClientTransport ( server ) ; io . grpc . internal . AbstractTransportTest . startTransport ( client , mockClientTransportListener ) ; io . grpc . internal . AbstractTransportTest . MockServerTransportListener serverTransportListener = serverListener . takeListenerOrFail ( io . grpc . internal . AbstractTransportTest . TIMEOUT_MS , TimeUnit . MILLISECONDS ) ; serverTransport = serverTransportListener . transport ; io . grpc . Metadata . Key < java . lang . String > tellTaleKey = Metadata . Key . of ( "tell-tale" , Metadata . ASCII_STRING_MARSHALLER ) ; io . grpc . Metadata tooLargeMetadata = new io . grpc . Metadata ( ) ; tooLargeMetadata . put ( tellTaleKey , "true" ) ; tooLargeMetadata . put ( Metadata . Key . of ( "foo-bin" , Metadata . BINARY_BYTE_MARSHALLER ) , new byte [ GrpcUtil . DEFAULT_MAX_HEADER_LIST_SIZE ] ) ; io . grpc . internal . ClientStream clientStream = client . newStream ( methodDescriptor , new io . grpc . Metadata ( ) , callOptions ) ; io . grpc . internal . AbstractTransportTest . ClientStreamListenerBase clientStreamListener = new io . grpc . internal . AbstractTransportTest . ClientStreamListenerBase ( ) ; clientStream . start ( clientStreamListener ) ; clientStream . writeMessage ( methodDescriptor . streamRequest ( "foo" ) ) ; clientStream . halfClose ( ) ; clientStream . request ( 1 ) ; io . grpc . internal . AbstractTransportTest . StreamCreation serverStreamCreation = serverTransportListener . takeStreamOrFail ( io . grpc . internal . AbstractTransportTest . TIMEOUT_MS , TimeUnit . MILLISECONDS ) ; serverStreamCreation . stream . request ( 1 ) ; serverStreamCreation . stream . writeHeaders ( new io . grpc . Metadata ( ) ) ; serverStreamCreation . stream . writeMessage ( methodDescriptor . streamResponse ( "response" ) ) ; serverStreamCreation . stream . close ( Status . OK , tooLargeMetadata ) ; io . grpc . Status status = clientStreamListener . status . get ( io . grpc . internal . AbstractTransportTest . TIMEOUT_MS , TimeUnit . MILLISECONDS ) ; java . util . List < io . grpc . Status . Code > codeOptions = java . util . Arrays . asList ( Status . Code . UNKNOWN , Status . Code . RESOURCE_EXHAUSTED , Status . Code . INTERNAL ) ; if ( ! ( codeOptions . contains ( status . getCode ( ) ) ) ) { org . junit . Assert . fail ( ( "Status<sp>code<sp>was<sp>not<sp>expected:<sp>" + status ) ) ; } io . grpc . Metadata metadata = clientStreamListener . trailers . get ( io . grpc . internal . AbstractTransportTest . TIMEOUT_MS , TimeUnit . MILLISECONDS ) ; "<AssertPlaceHolder>" ; } get ( int ) { return values [ id ] ; }
|
org . junit . Assert . assertNull ( metadata . get ( tellTaleKey ) )
|
test_GetItem_By_Name ( ) { when ( element . findFirst ( mmarquee . automation . BaseAutomationTest . isTreeScope ( TreeScope . Descendants ) , any ( ) ) ) . thenReturn ( targetElement ) ; mmarquee . automation . controls . AutomationList list = new mmarquee . automation . controls . AutomationList ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( selection ) ) ; mmarquee . automation . controls . AutomationListItem item = list . getItem ( "myName" ) ; "<AssertPlaceHolder>" ; verify ( element , atLeastOnce ( ) ) . findFirst ( any ( ) , any ( ) ) ; } getElement ( ) { return this . element ; }
|
org . junit . Assert . assertEquals ( targetElement , item . getElement ( ) )
|
testCreate ( ) { ws . create ( "create.txt" ) ; net . coding . ide . model . File createdFile = new net . coding . ide . model . File ( ws . getWorkingDir ( ) , "create.txt" ) ; "<AssertPlaceHolder>" ; } getWorkingDir ( ) { return workingDir . toFile ( ) ; }
|
org . junit . Assert . assertTrue ( createdFile . exists ( ) )
|
readOutlineAddedInNotOutlineMode ( ) { java . lang . String filename = ( com . itextpdf . kernel . pdf . PdfOutlineTest . sourceFolder ) + "addOutlinesWithoutOutlineModeResult.pdf" ; com . itextpdf . kernel . pdf . PdfDocument pdfDoc = new com . itextpdf . kernel . pdf . PdfDocument ( new com . itextpdf . kernel . pdf . PdfReader ( filename ) ) ; java . util . List < com . itextpdf . kernel . pdf . PdfOutline > pageOutlines = pdfDoc . getPage ( 102 ) . getOutlines ( true ) ; try { "<AssertPlaceHolder>" ; } finally { pdfDoc . close ( ) ; } } size ( ) { return segments . size ( ) ; }
|
org . junit . Assert . assertEquals ( 5 , pageOutlines . size ( ) )
|
testAllFiles ( ) { java . io . File dir = new java . io . File ( "./src/test/testdata/gs-glui-instance" ) ; java . io . File [ ] files = dir . listFiles ( ) ; "<AssertPlaceHolder>" ; long start = java . lang . System . currentTimeMillis ( ) ; for ( java . io . File f : files ) { if ( f . getName ( ) . equals ( "instance.xml" ) ) { new com . gs . fw . common . freyaxml . test . gsglui . instance . GsGluiInstanceLayoutUnmarshaller ( ) . parse ( f . getCanonicalPath ( ) ) ; } } System . out . println ( ( ( "took<sp>" + ( ( java . lang . System . currentTimeMillis ( ) ) - start ) ) + "<sp>ms" ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( files . length ) > 0 ) )
|
copiesInputStreamLargerThanInternalBuffer ( ) { final byte [ ] bytes = createByteArray ( ( ( org . apache . isis . core . commons . lang . IoUtils_CopyTest . BUF_INTERNAL_SIZE ) + 1 ) ) ; final java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( bytes ) ; final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; org . apache . isis . core . commons . lang . InputStreamExtensions . copyTo ( bais , baos ) ; "<AssertPlaceHolder>" ; } arrayEqualTo ( byte [ ] ) { return new org . apache . isis . core . commons . lang . IoUtils_CopyTest . ArrayMatcher ( bytes ) ; }
|
org . junit . Assert . assertThat ( baos . toByteArray ( ) , arrayEqualTo ( bytes ) )
|
merger__empty_should_merge_the_given_list_as_arg ( ) { io . github . seleniumquery . by . common . elementfilter . ElementFilter filter = createSomeElementFilter ( ) ; io . github . seleniumquery . by . common . elementfilter . ElementFilterList elementFilterList = new io . github . seleniumquery . by . common . elementfilter . ElementFilterList ( filter ) ; io . github . seleniumquery . by . common . elementfilter . ElementFilterList mergedList = ElementFilterList . FILTER_NOTHING_LIST . merge ( elementFilterList ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { return isAnd ( IsEvaluator . IS_EVALUATOR , selector ) ; }
|
org . junit . Assert . assertThat ( mergedList , org . hamcrest . CoreMatchers . is ( elementFilterList ) )
|
testArrayGetObjectChangeValue ( ) { com . eclipsesource . v8 . V8Array array = v8 . executeArrayScript ( "foo<sp>=<sp>[];<sp>foo" ) ; v8 . executeVoidScript ( "foo[0]<sp>=<sp>{foo:'bar'}" ) ; com . eclipsesource . v8 . V8Object obj = array . getObject ( 0 ) ; "<AssertPlaceHolder>" ; array . close ( ) ; obj . close ( ) ; } getString ( java . lang . String ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertEquals ( "bar" , obj . getString ( "foo" ) )
|
test_double_registration ( ) { com . noctarius . snowcast . impl . SequencerDefinition definition = new com . noctarius . snowcast . impl . SequencerDefinition ( "empty" , com . noctarius . snowcast . SnowcastEpoch . byTimestamp ( 1 ) , 128 , ( ( short ) ( 1 ) ) ) ; com . hazelcast . nio . Address address = new com . hazelcast . nio . Address ( "localhost" , 1000 ) ; com . noctarius . snowcast . impl . SequencerPartition partition = new com . noctarius . snowcast . impl . SequencerPartition ( 1 ) ; java . lang . Integer logicalNodeId = partition . attachLogicalNode ( definition , address ) ; "<AssertPlaceHolder>" ; partition . checkOrRegisterSequencerDefinition ( definition ) ; } attachLogicalNode ( java . lang . String , com . noctarius . snowcast . impl . SequencerDefinition ) { long epochOffset = sequencerDefinition . getEpoch ( ) . getEpochOffset ( ) ; int maxLogicalNodeCount = sequencerDefinition . getMaxLogicalNodeCount ( ) ; short backupCount = sequencerDefinition . getBackupCount ( ) ; com . hazelcast . client . impl . protocol . ClientMessage request = com . hazelcast . client . impl . protocol . codec . SnowcastAttachLogicalNodeCodec . encodeRequest ( sequencerName , epochOffset , maxLogicalNodeCount , backupCount ) ; com . hazelcast . client . impl . protocol . ClientMessage response = invoke ( sequencerName , request ) ; return com . hazelcast . client . impl . protocol . codec . SnowcastAttachLogicalNodeCodec . decodeResponse ( response ) . response ; }
|
org . junit . Assert . assertNotNull ( logicalNodeId )
|
testListGrammarsOptions ( ) { java . lang . String customizationId = "id" ; com . ibm . watson . speech_to_text . v1 . model . ListGrammarsOptions listGrammarsOptions = new com . ibm . watson . speech_to_text . v1 . model . ListGrammarsOptions . Builder ( ) . customizationId ( customizationId ) . build ( ) ; "<AssertPlaceHolder>" ; } customizationId ( ) { return customizationId ; }
|
org . junit . Assert . assertEquals ( customizationId , listGrammarsOptions . customizationId ( ) )
|
transform_keepFalseNoTransformFilter1Test ( ) { datawave . query . predicate . EventDataQueryFilter mockFilter1 = org . easymock . EasyMock . createMock ( datawave . query . predicate . EventDataQueryFilter . class ) ; datawave . query . predicate . EventDataQueryFilter mockFilter2 = org . easymock . EasyMock . createMock ( datawave . query . predicate . EventDataQueryFilter . class ) ; org . apache . accumulo . core . data . Key key = new org . apache . accumulo . core . data . Key ( ) ; org . apache . accumulo . core . data . Key key2 = new org . apache . accumulo . core . data . Key ( "123" ) ; org . easymock . EasyMock . expect ( mockFilter1 . keep ( key ) ) . andReturn ( false ) ; org . easymock . EasyMock . expect ( mockFilter2 . keep ( key ) ) . andReturn ( false ) ; org . easymock . EasyMock . expect ( mockFilter1 . transform ( key ) ) . andReturn ( null ) ; org . easymock . EasyMock . expect ( mockFilter2 . transform ( key ) ) . andReturn ( key2 ) ; org . easymock . EasyMock . replay ( mockFilter1 , mockFilter2 ) ; filter . addFilter ( mockFilter1 ) ; filter . addFilter ( mockFilter2 ) ; org . apache . accumulo . core . data . Key result = filter . transform ( key ) ; org . easymock . EasyMock . verify ( mockFilter1 , mockFilter2 ) ; "<AssertPlaceHolder>" ; } verify ( java . lang . String , int ) { if ( name . equals ( "between" ) ) { if ( numArgs != 3 ) { throw new java . lang . IllegalArgumentException ( "Wrong<sp>number<sp>of<sp>arguments<sp>to<sp>between<sp>function" ) ; } } else if ( name . equals ( "length" ) ) { if ( numArgs != 3 ) { throw new java . lang . IllegalArgumentException ( "Wrong<sp>number<sp>of<sp>arguments<sp>to<sp>length<sp>function" ) ; } } else if ( name . equals ( QueryFunctions . OPTIONS_FUNCTION ) ) { if ( ( numArgs % 2 ) != 0 ) { throw new java . lang . IllegalArgumentException ( "Expected<sp>even<sp>number<sp>of<sp>arguments<sp>to<sp>options<sp>function" ) ; } } else if ( ( name . equals ( QueryFunctions . UNIQUE_FUNCTION ) ) || ( name . equals ( QueryFunctions . GROUPBY_FUNCTION ) ) ) { if ( numArgs == 0 ) { throw new java . lang . IllegalArgumentException ( ( ( "Expected<sp>at<sp>least<sp>one<sp>argument<sp>to<sp>the<sp>" + name ) + "<sp>function" ) ) ; } } else { throw new java . lang . IllegalArgumentException ( ( "Unknown<sp>Query<sp>function:<sp>" + name ) ) ; } }
|
org . junit . Assert . assertTrue ( ( result == key2 ) )
|
testEventComplete ( ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; org . glassfish . admin . rest . ProgressStatusEventTest . writer . writeTo ( org . glassfish . admin . rest . ProgressStatusEventTest . EVENT_COMPLETE , null , null , null , MediaType . APPLICATION_JSON_TYPE , null , baos ) ; baos . close ( ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ; org . glassfish . api . admin . progress . ProgressStatusEvent event = org . glassfish . admin . rest . ProgressStatusEventTest . reader . readFrom ( bais , MediaType . APPLICATION_JSON ) ; "<AssertPlaceHolder>" ; } readFrom ( java . io . InputStream , java . lang . String ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; com . sun . enterprise . util . io . FileUtils . copy ( is , baos , 0 ) ; java . lang . String str = baos . toString ( "UTF-8" ) ; try { org . codehaus . jettison . json . JSONObject json = new org . codehaus . jettison . json . JSONObject ( str ) ; return com . sun . enterprise . admin . remote . reader . AdminCommandStateJsonProprietaryReader . readAdminCommandState ( json ) ; } catch ( org . codehaus . jettison . json . JSONException ex ) { com . sun . enterprise . admin . remote . reader . AdminCommandStateJsonProprietaryReader . LoggerRef . logger . log ( Level . SEVERE , AdminLoggerInfo . mUnexpectedException , ex ) ; throw new java . io . IOException ( ex ) ; } }
|
org . junit . Assert . assertEquals ( event , org . glassfish . admin . rest . ProgressStatusEventTest . EVENT_COMPLETE )
|
testSendExit ( ) { final java . lang . String messageId = "testSendExit" ; final com . arjuna . webservices11 . wsarj . InstanceIdentifier instanceIdentifier = new com . arjuna . webservices11 . wsarj . InstanceIdentifier ( "8" ) ; javax . xml . ws . wsaddressing . W3CEndpointReference endpoint = com . arjuna . wst . tests . TestUtil . getCoordinatorCompletionCoordinatorEndpoint ( instanceIdentifier . getInstanceIdentifier ( ) ) ; final org . jboss . ws . api . addressing . MAP map = com . arjuna . webservices11 . wsaddr . AddressingHelper . createRequestContext ( TestUtil . coordinatorCompletionCoordinatorServiceURI , messageId ) ; com . arjuna . webservices11 . wsba . client . CoordinatorCompletionCoordinatorClient . getClient ( ) . sendExit ( endpoint , map , new com . arjuna . webservices11 . wsarj . InstanceIdentifier ( "sender" ) ) ; final com . arjuna . wst . tests . arq . TestCoordinatorCompletionCoordinatorProcessor . CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor . getCoordinatorCompletionCoordinatorDetails ( messageId , 10000 ) ; "<AssertPlaceHolder>" ; checkDetails ( details , true , true , messageId , instanceIdentifier ) ; } hasExit ( ) { return exit ; }
|
org . junit . Assert . assertTrue ( details . hasExit ( ) )
|
shouldStartPreviousSurvivedMutationsAtAStatusOfSurvivedWhenCoverageHasNotChanged ( ) { final org . pitest . mutationtest . engine . MutationDetails md = makeMutation ( "foo" ) ; setHistoryForAllMutationsTo ( DetectionStatus . SURVIVED ) ; when ( this . history . hasCoverageChanged ( any ( org . pitest . classinfo . ClassName . class ) , any ( java . math . BigInteger . class ) ) ) . thenReturn ( false ) ; final java . util . Collection < org . pitest . mutationtest . MutationResult > actual = this . testee . analyse ( java . util . Collections . singletonList ( md ) ) ; "<AssertPlaceHolder>" ; } iterator ( ) { return new java . util . Iterator < java . lang . String > ( ) { @ org . pitest . mutationtest . report . html . Override public boolean hasNext ( ) { return ( org . pitest . mutationtest . report . html . InputStreamLineIterable . this . next ) != null ; } @ org . pitest . mutationtest . report . html . Override public org . pitest . mutationtest . report . html . String next ( ) { return org . pitest . mutationtest . report . html . InputStreamLineIterable . this . next ( ) ; } @ org . pitest . mutationtest . report . html . Override public void remove ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } } ; }
|
org . junit . Assert . assertEquals ( DetectionStatus . SURVIVED , actual . iterator ( ) . next ( ) . getStatus ( ) )
|
testGetRootComments ( ) { java . util . List < com . liferay . portal . kernel . comment . Comment > rootComments = _commentManager . getRootComments ( com . liferay . document . library . kernel . model . DLFileEntryConstants . getClassName ( ) , _fileEntry . getFileEntryId ( ) , WorkflowConstants . STATUS_APPROVED , QueryUtil . ALL_POS , QueryUtil . ALL_POS ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( rootComments . toString ( ) , 2 , rootComments . size ( ) )
|
setActionCodeTest ( ) { int action_code = DialogAction . ACTION_OK ; da . setActionCode ( action_code ) ; "<AssertPlaceHolder>" ; } getActionCode ( ) { return actionCode ; }
|
org . junit . Assert . assertEquals ( da . getActionCode ( ) , DialogAction . ACTION_OK )
|
testSpec06 ( ) { javax . el . ELProcessor processor = new javax . el . ELProcessor ( ) ; java . lang . Object result = processor . getValue ( "(x->y->x-y)(2)(1)" , org . apache . el . parser . Integer . class ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . String , java . lang . Class ) { javax . el . ValueExpression ve = factory . createValueExpression ( context , javax . el . ELProcessor . bracket ( expression ) , expectedType ) ; return ve . getValue ( context ) ; }
|
org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 1 ) , result )
|
testSerializationLineChart ( ) { com . orsoncharts . Chart3D c1 = com . orsoncharts . Chart3DFactory . createLineChart ( "title" , "subtitle" , createCategoryDataset ( ) , "rowAxis" , "columnAxis" , "valueAxis" ) ; com . orsoncharts . Chart3D c2 = ( ( com . orsoncharts . Chart3D ) ( com . orsoncharts . TestUtils . serialized ( c1 ) ) ) ; "<AssertPlaceHolder>" ; } serialized ( java . io . Serializable ) { 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 ( c1 , c2 )
|
testCreateTransactionChain ( ) { try ( org . opendaylight . controller . cluster . databroker . ClientBackedDataStore clientBackedDataStore = new org . opendaylight . controller . cluster . databroker . ClientBackedDataStore ( actorUtils , org . opendaylight . controller . cluster . databroker . ClientBackedDataStoreTest . UNKNOWN_ID , clientActor ) ) { final org . opendaylight . mdsal . dom . spi . store . DOMStoreTransactionChain txChain = clientBackedDataStore . createTransactionChain ( ) ; "<AssertPlaceHolder>" ; verify ( clientActor , org . mockito . Mockito . times ( 1 ) ) . createLocalHistory ( ) ; } } createTransactionChain ( ) { return txContextFactory . createTransactionChain ( ) ; }
|
org . junit . Assert . assertNotNull ( txChain )
|
toCompilableType_A$String$List$List$String_StringIsNull ( ) { org . junithelper . core . extractor . TypeNameConverter target = new org . junithelper . core . extractor . TypeNameConverter ( config ) ; java . lang . String typeName = null ; java . util . List < java . lang . String > generics = new java . util . ArrayList < java . lang . String > ( ) ; java . util . List < java . lang . String > importedList = new java . util . ArrayList < java . lang . String > ( ) ; java . lang . String callerClassPackageName = null ; java . lang . String actual = target . toCompilableType ( typeName , generics , importedList , callerClassPackageName ) ; java . lang . String expected = null ; "<AssertPlaceHolder>" ; } toCompilableType ( java . lang . String , java . util . List , java . util . List , java . lang . String ) { if ( typeName == null ) { return typeName ; } typeName = typeName . replaceAll ( "\\.\\.\\." , "[]" ) ; if ( typeName . matches ( ".+?\\..+" ) ) { return typeName ; } boolean isArray = false ; java . lang . String arrayPart = "[]" 0 ; if ( typeName . matches ( ".+?\\[\\s*\\]" ) ) { isArray = true ; java . util . regex . Matcher mat = java . util . regex . Pattern . compile ( "\\[\\s*\\]" ) . matcher ( typeName ) ; while ( mat . find ( ) ) { arrayPart += "[]" ; } typeName = typeName . replaceAll ( "\\[\\]" , "" ) ; } if ( typeName . matches ( ( ( ( org . junithelper . core . constant . RegExp . Anything_ZeroOrMore_Min ) + ( org . junithelper . core . constant . RegExp . Generics ) ) + ( org . junithelper . core . constant . RegExp . Anything_ZeroOrMore_Min ) ) ) ) { typeName = typeName . replaceAll ( RegExp . Generics , StringValue . Empty ) ; } boolean isTypeAvailable = false ; java . lang . String destTypeName = "[]" 9 ; try { if ( org . junithelper . core . util . PrimitiveTypeUtil . isPrimitive ( typeName ) ) { isTypeAvailable = true ; if ( ! ( destTypeName . matches ( "[]" 7 ) ) ) destTypeName = org . junithelper . core . util . PrimitiveTypeUtil . getTypeDefaultValue ( typeName ) ; } else { try { java . lang . Class . forName ( ( ",<sp>" 3 + typeName ) ) ; isTypeAvailable = true ; } catch ( java . lang . Exception ignore ) { java . util . List < java . io . File > files = org . junithelper . core . file . FileSearcherFactory . create ( ) . searchFilesRecursivelyByName ( ( ( ( config . directoryPathOfProductSourceCode ) + ",<sp>" 1 ) + ( callerClassPackageName . replaceAll ( "\\." , "/" ) ) ) , ( typeName + ( RegExp . FileExtension . JavaFile ) ) ) ; if ( ( files != null ) && ( ( files . size ( ) ) > 0 ) ) { isTypeAvailable = true ; } } if ( ! isTypeAvailable ) { java . lang . Class . forName ( typeName ) ; } } } catch ( java . lang . Exception e ) { for ( java . lang . String importedPackage : importedList ) { importedPackage = importedPackage . replaceAll ( "//" , StringValue . Empty ) . trim ( ) ; try { java . lang . String regexp = ( "[]" 8 + ( typeName . replaceAll ( "\\[" , "\\\\[" ) . replaceAll ( "\\]" , "\\\\]" ) ) ) + "[]" 4 ; if ( importedPackage . matches ( regexp ) ) { isTypeAvailable = true ; break ; } if ( ( ! ( importedPackage . contains ( "[]" 2 ) ) ) && ( importedPackage . endsWith ( "[]" 3 ) ) ) { try { java . lang . Class . forName ( ( ( importedPackage . replace ( "*" , "" ) ) + typeName ) ) ; isTypeAvailable = true ; } catch ( java . lang . Exception ignore ) { } } } catch ( java . lang . Exception e2 ) { e2 . printStackTrace ( ) ; } } } if ( generics != null ) { java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; if ( ( generics . size ( ) ) > 0 ) { buf . append ( "<" ) ; buf . append ( generics . get ( 0 ) ) ; if ( ( generics . size ( ) ) > 1 ) { for ( int i = 1 ; i < ( generics . size ( ) ) ; i ++ ) { buf . append ( ",<sp>" ) ; buf . append ( generics . get ( i ) ) ; } } buf . append ( ",<sp>" 2 ) ; } typeName += buf . toString ( ) ; } if ( ( typeName == null ) || ( typeName . equals ( StringValue . Empty ) ) ) { typeName = "[]" 9 ; } if ( ( destTypeName == null ) || ( destTypeName . equals ( StringValue . Empty ) ) ) { destTypeName = "[]" 9 ; } if ( ( arrayPart == null ) || ( ( arrayPart . length ( ) ) == 0 ) ) { arrayPart = "[]" ; } if ( isTypeAvailable ) { return isArray ? typeName + arrayPart : typeName ; } else { return isArray ? destTypeName + arrayPart : destTypeName ; } }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testSend503Response ( ) { setUp ( ) ; boolean was503 = false ; shootist . sendInitialInvite ( ) ; java . lang . Thread . sleep ( 1000 ) ; for ( javax . sip . message . Response res : shootist . responses ) { if ( ( res . getStatusCode ( ) ) != ( javax . sip . message . Response . SERVICE_UNAVAILABLE ) ) was503 = true ; } "<AssertPlaceHolder>" ; } sleep ( int ) { try { java . lang . Thread . sleep ( timeout ) ; } catch ( java . lang . InterruptedException e ) { e . printStackTrace ( ) ; } }
|
org . junit . Assert . assertTrue ( was503 )
|
test_object_equals_hashcode ( ) { com . levelup . java . hamcrest . ObjectMatchers . Drink softDrink1 = new com . levelup . java . hamcrest . ObjectMatchers . Drink ( "coca-cola" , "Coke<sp>Zero" , "Soft<sp>Drink" ) ; com . levelup . java . hamcrest . ObjectMatchers . Drink softDrink2 = new com . levelup . java . hamcrest . ObjectMatchers . Drink ( "coca-cola" , "Coke<sp>Zero" , "Soft<sp>Drink" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( softDrink1 , org . hamcrest . CoreMatchers . equalTo ( softDrink2 ) )
|
clearIgnoredObjectsArrayAfterTestExecution ( ) { com . wounit . rules . MockEditingContext editingContext = ( ( com . wounit . rules . MockEditingContext ) ( initEditingContext ( com . wounit . rules . TEST_MODEL_NAME ) ) ) ; editingContext . before ( ) ; com . wounit . model . FooEntity entity = new com . wounit . model . FooEntity ( ) ; editingContext . insertSavedObject ( entity ) ; editingContext . after ( ) ; "<AssertPlaceHolder>" ; } after ( ) { ignoredObjects . clear ( ) ; super . after ( ) ; }
|
org . junit . Assert . assertThat ( editingContext . ignoredObjects . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) )
|
test_DataRows_FetchOffset ( ) { createPaintingsDataSet ( ) ; org . apache . cayenne . query . SQLSelect < org . apache . cayenne . DataRow > q1 = org . apache . cayenne . query . SQLSelect . dataRowQuery ( "SELECT<sp>*<sp>FROM<sp>PAINTING" ) ; q1 . offset ( 4 ) ; "<AssertPlaceHolder>" ; } select ( org . apache . cayenne . ObjectContext ) { return query . select ( context ) ; }
|
org . junit . Assert . assertEquals ( 16 , context . select ( q1 ) . size ( ) )
|
testFormatEqualTo0Percent ( ) { hudson . plugins . view . dashboard . test . TestStatisticsPortlet instance = new hudson . plugins . view . dashboard . test . TestStatisticsPortlet ( "test" , false , null , null , null , false ) ; java . text . DecimalFormat df = new java . text . DecimalFormat ( "0%" ) ; double val = 0.0 ; java . lang . String expResult = "0%" ; java . lang . String result = instance . format ( df , val ) ; "<AssertPlaceHolder>" ; } format ( java . text . DecimalFormat , double ) { if ( ( val < 1.0 ) && ( val > 0.99 ) ) { return useAlternatePercentagesOnLimits ? ">99%" : "<100%" ; } if ( ( val > 0.0 ) && ( val < 0.01 ) ) { return useAlternatePercentagesOnLimits ? "<1%" : ">0%" ; } return df . format ( val ) ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testHealthCheck ( ) { final javax . ws . rs . core . Response response = client . target ( "http://localhost:8081/healthcheck" ) . request ( ) . get ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( response . getStatus ( ) , org . hamcrest . CoreMatchers . is ( 200 ) )
|
testDisposeFactoryCreated ( ) { org . eclipse . swt . graphics . Image image = org . eclipse . swt . internal . graphics . Graphics . getImage ( Fixture . IMAGE1 ) ; try { image . dispose ( ) ; org . junit . Assert . fail ( "It<sp>is<sp>not<sp>allowed<sp>to<sp>dispose<sp>of<sp>a<sp>factory-created<sp>image" ) ; } catch ( java . lang . IllegalStateException e ) { "<AssertPlaceHolder>" ; } } isDisposed ( ) { org . eclipse . swt . widgets . Control c = getMessageControl ( ) ; return ( c != null ) && ( c . isDisposed ( ) ) ; }
|
org . junit . Assert . assertFalse ( image . isDisposed ( ) )
|
testRequestWithRequestConsumerWhichDoesNotReply ( ) { org . apache . activemq . artemis . api . core . SimpleString requestAddress = org . apache . activemq . artemis . utils . RandomUtil . randomSimpleString ( ) ; org . apache . activemq . artemis . api . core . SimpleString requestQueue = org . apache . activemq . artemis . utils . RandomUtil . randomSimpleString ( ) ; org . apache . activemq . artemis . api . core . client . ClientSessionFactory sf = createSessionFactory ( locator ) ; final org . apache . activemq . artemis . api . core . client . ClientSession session = sf . createSession ( false , true , true ) ; session . start ( ) ; session . createTemporaryQueue ( requestAddress , requestQueue ) ; org . apache . activemq . artemis . api . core . client . ClientConsumer requestConsumer = session . createConsumer ( requestQueue ) ; requestConsumer . setMessageHandler ( new org . apache . activemq . artemis . api . core . client . MessageHandler ( ) { @ org . apache . activemq . artemis . tests . integration . client . Override public void onMessage ( final org . apache . activemq . artemis . api . core . client . ClientMessage request ) { } } ) ; org . apache . activemq . artemis . api . core . client . ClientRequestor requestor = new org . apache . activemq . artemis . api . core . client . ClientRequestor ( session , requestAddress ) ; org . apache . activemq . artemis . api . core . client . ClientMessage request = session . createMessage ( false ) ; org . apache . activemq . artemis . api . core . client . ClientMessage reply = requestor . request ( request , 500 ) ; "<AssertPlaceHolder>" ; session . close ( ) ; } request ( org . apache . activemq . artemis . api . core . client . ClientMessage , long ) { request . putStringProperty ( ClientMessageImpl . REPLYTO_HEADER_NAME , replyQueue ) ; requestProducer . send ( request ) ; return replyConsumer . receive ( timeout ) ; }
|
org . junit . Assert . assertNull ( reply )
|
testMultipleWordQueryInStringFieldUsingScan ( ) { java . util . ArrayList < java . lang . String > names = new java . util . ArrayList < java . lang . String > ( java . util . Arrays . asList ( "christian<sp>john<sp>wayne" , "rock<sp>bale" ) ) ; edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary dictionary = new edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary ( names ) ; java . util . List < edu . uci . ics . texera . api . span . Span > list1 = new java . util . ArrayList < edu . uci . ics . texera . api . span . Span > ( ) ; edu . uci . ics . texera . api . span . Span span1 = new edu . uci . ics . texera . api . span . Span ( "firstName" , 0 , 20 , "christian<sp>john<sp>wayne" , "christian<sp>john<sp>wayne" ) ; edu . uci . ics . texera . api . span . Span span2 = new edu . uci . ics . texera . api . span . Span ( "lastName" , 0 , 9 , "rock<sp>bale" , "rock<sp>bale" ) ; list1 . add ( span1 ) ; list1 . add ( span2 ) ; edu . uci . ics . texera . api . schema . Attribute [ ] schemaAttributes = new edu . uci . ics . texera . api . schema . Attribute [ ( TestConstants . ATTRIBUTES_PEOPLE . length ) + 1 ] ; for ( int count = 0 ; count < ( ( schemaAttributes . length ) - 1 ) ; count ++ ) { schemaAttributes [ count ] = edu . uci . ics . texera . api . constants . test . TestConstants . ATTRIBUTES_PEOPLE [ count ] ; } schemaAttributes [ ( ( schemaAttributes . length ) - 1 ) ] = edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTest . RESULTS_ATTRIBUTE ; edu . uci . ics . texera . api . field . IField [ ] fields1 = new edu . uci . ics . texera . api . field . IField [ ] { new edu . uci . ics . texera . api . field . StringField ( "christian<sp>john<sp>wayne" ) , new edu . uci . ics . texera . api . field . StringField ( "rock<sp>bale" ) , new edu . uci . ics . texera . api . field . IntegerField ( 42 ) , new edu . uci . ics . texera . api . field . DoubleField ( 5.99 ) , new edu . uci . ics . texera . api . field . DateField ( new java . text . SimpleDateFormat ( "MM-dd-yyyy" ) . parse ( "01-13-1974" ) ) , new edu . uci . ics . texera . api . field . TextField ( "Tall<sp>Fair" ) , new edu . uci . ics . texera . api . field . ListField < edu . uci . ics . texera . api . span . Span > ( list1 ) } ; edu . uci . ics . texera . api . tuple . Tuple tuple1 = new edu . uci . ics . texera . api . tuple . Tuple ( new edu . uci . ics . texera . api . schema . Schema ( schemaAttributes ) , fields1 ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > expectedResults = new java . util . ArrayList < edu . uci . ics . texera . api . tuple . Tuple > ( ) ; expectedResults . add ( tuple1 ) ; java . util . List < java . lang . String > attributeNames = java . util . Arrays . asList ( TestConstants . FIRST_NAME , TestConstants . LAST_NAME ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > returnedResults = edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTestHelper . getQueryResults ( edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTest . PEOPLE_TABLE , dictionary , attributeNames , KeywordMatchingType . SUBSTRING_SCANBASED ) ; boolean contains = edu . uci . ics . texera . api . utils . TestUtils . equals ( expectedResults , returnedResults ) ; "<AssertPlaceHolder>" ; } equals ( java . util . List , java . util . List ) { expectedResults = Tuple . Builder . removeIfExists ( expectedResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; exactResults = Tuple . Builder . removeIfExists ( exactResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; if ( ( expectedResults . size ( ) ) != ( exactResults . size ( ) ) ) return false ; return ( expectedResults . containsAll ( exactResults ) ) && ( exactResults . containsAll ( expectedResults ) ) ; }
|
org . junit . Assert . assertTrue ( contains )
|
testOptionalParameterFound ( ) { when ( request . getParameter ( io . lumify . web . BaseRequestHandlerTest . TEST_PARAM ) ) . thenReturn ( io . lumify . web . BaseRequestHandlerTest . TEST_PARAM_VALUE ) ; "<AssertPlaceHolder>" ; verify ( request , times ( 1 ) ) . getParameter ( eq ( io . lumify . web . BaseRequestHandlerTest . TEST_PARAM ) ) ; } getOptionalParameter ( javax . servlet . http . HttpServletRequest , java . lang . String ) { com . google . common . base . Preconditions . checkNotNull ( request , "The<sp>provided<sp>request<sp>was<sp>invalid" ) ; return getParameter ( request , parameterName , true ) ; }
|
org . junit . Assert . assertEquals ( io . lumify . web . BaseRequestHandlerTest . TEST_PARAM_VALUE , mock . getOptionalParameter ( request , io . lumify . web . BaseRequestHandlerTest . TEST_PARAM ) )
|
testBadUsername ( ) { java . util . Map < java . lang . String , java . lang . Object > serverProps = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; serverProps . put ( org . wildfly . security . sasl . digest . DigestTest . REALM_PROPERTY , "TestRealm" ) ; javax . security . sasl . SaslServer server = new org . wildfly . security . sasl . test . SaslServerBuilder ( org . wildfly . security . sasl . digest . DigestServerFactory . class , org . wildfly . security . sasl . digest . DigestTest . DIGEST ) . setUserName ( "Borris" ) . setPassword ( "gpwd" . toCharArray ( ) ) . setProtocol ( "TestProtocol" ) . setServerName ( "TestServer" ) . build ( ) ; javax . security . auth . callback . CallbackHandler clientCallback = org . wildfly . security . sasl . digest . DigestCallbackHandlerUtils . createClearPwdClientCallbackHandler ( "George" , "gpwd" , null ) ; javax . security . sasl . SaslClient client = javax . security . sasl . Sasl . createSaslClient ( new java . lang . String [ ] { org . wildfly . security . sasl . digest . DigestTest . DIGEST } , "George" , "TestProtocol" , "TestServer" , java . util . Collections . < java . lang . String , java . lang . Object > emptyMap ( ) , clientCallback ) ; "<AssertPlaceHolder>" ; byte [ ] message = server . evaluateResponse ( new byte [ 0 ] ) ; message = client . evaluateChallenge ( message ) ; try { server . evaluateResponse ( message ) ; org . junit . Assert . fail ( "Expection<sp>exception<sp>not<sp>thrown." ) ; } catch ( java . io . IOException e ) { } } hasInitialResponse ( ) { return delegate . hasInitialResponse ( ) ; }
|
org . junit . Assert . assertFalse ( client . hasInitialResponse ( ) )
|
testGetCompatibleString ( ) { org . pentaho . di . core . row . value . ValueMetaInteger valueMetaInteger = new org . pentaho . di . core . row . value . ValueMetaInteger ( "INTEGER" ) ; valueMetaInteger . setType ( 5 ) ; valueMetaInteger . setStorageType ( 1 ) ; "<AssertPlaceHolder>" ; } getCompatibleString ( java . lang . Object ) { try { java . lang . String string ; switch ( type ) { case TYPE_DATE : switch ( storageType ) { case STORAGE_TYPE_NORMAL : string = convertDateToCompatibleString ( ( ( java . util . Date ) ( object ) ) ) ; break ; case STORAGE_TYPE_BINARY_STRING : string = convertDateToCompatibleString ( ( ( java . util . Date ) ( convertBinaryStringToNativeType ( ( ( byte [ ] ) ( object ) ) ) ) ) ) ; break ; case STORAGE_TYPE_INDEXED : if ( object == null ) { string = null ; } else { string = convertDateToCompatibleString ( ( ( java . util . Date ) ( index [ ( ( java . lang . Integer ) ( object ) ) . intValue ( ) ] ) ) ) ; } break ; default : throw new org . pentaho . di . core . exception . KettleValueException ( ( ( ( ( toString ( ) ) + "<sp>:<sp>Unknown<sp>storage<sp>type<sp>" ) + ( storageType ) ) + "<sp>specified." ) ) ; } break ; case TYPE_NUMBER : switch ( storageType ) { case STORAGE_TYPE_NORMAL : string = convertNumberToCompatibleString ( ( ( java . lang . Double ) ( object ) ) ) ; break ; case STORAGE_TYPE_BINARY_STRING : string = convertNumberToCompatibleString ( ( ( java . lang . Double ) ( convertBinaryStringToNativeType ( ( ( byte [ ] ) ( object ) ) ) ) ) ) ; break ; case STORAGE_TYPE_INDEXED : string = ( object == null ) ? null : convertNumberToCompatibleString ( ( ( java . lang . Double ) ( index [ ( ( java . lang . Integer ) ( object ) ) . intValue ( ) ] ) ) ) ; break ; default : throw new org . pentaho . di . core . exception . KettleValueException ( ( ( ( ( toString ( ) ) + "<sp>:<sp>Unknown<sp>storage<sp>type<sp>" ) + ( storageType ) ) + "<sp>specified." ) ) ; } break ; case TYPE_INTEGER : switch ( storageType ) { case STORAGE_TYPE_NORMAL : string = convertIntegerToCompatibleString ( ( ( java . lang . Long ) ( object ) ) ) ; break ; case STORAGE_TYPE_BINARY_STRING : try { string = convertIntegerToCompatibleString ( ( ( java . lang . Long ) ( convertBinaryStringToNativeType ( ( ( byte [ ] ) ( object ) ) ) ) ) ) ; } catch ( java . lang . ClassCastException e ) { string = convertIntegerToCompatibleString ( ( ( java . lang . Long ) ( object ) ) ) ; } break ; case STORAGE_TYPE_INDEXED : string = ( object == null ) ? null : convertIntegerToCompatibleString ( ( ( java . lang . Long ) ( index [ ( ( java . lang . Integer ) ( object ) ) . intValue ( ) ] ) ) ) ; break ; default : throw new org . pentaho . di . core . exception . KettleValueException ( ( ( ( ( toString ( ) ) + "<sp>:<sp>Unknown<sp>storage<sp>type<sp>" ) + ( storageType ) ) + "<sp>specified." ) ) ; } break ; default : return getString ( object ) ; } return string ; } catch ( java . lang . ClassCastException e ) { throw new org . pentaho . di . core . exception . KettleValueException ( ( ( ( ( ( ( ( ( toString ( ) ) + "<sp>:<sp>There<sp>was<sp>a<sp>data<sp>type<sp>error:<sp>the<sp>data<sp>type<sp>of<sp>" ) + ( object . getClass ( ) . getName ( ) ) ) + "<sp>object<sp>[" ) + object ) + "]<sp>does<sp>not<sp>correspond<sp>to<sp>value<sp>meta<sp>[" ) + ( toStringMeta ( ) ) ) + "]" ) ) ; } }
|
org . junit . Assert . assertEquals ( "2" , valueMetaInteger . getCompatibleString ( new java . lang . Long ( 2 ) ) )
|
testNodeChildrenUpdatedUntil ( ) { long start = java . lang . System . currentTimeMillis ( ) ; activity = createActivity ( ( "ActivityDescendantsUpdatedUntil-" + start ) ) ; java . util . List < com . ibm . sbt . services . client . connections . activities . ActivityNode > nodes = createActivityDescendants ( activity ) ; com . ibm . sbt . services . client . connections . activities . ActivityNode node = nodes . get ( 2 ) ; java . util . Map < java . lang . String , java . lang . String > params = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; params . put ( "until" , ( "" + ( node . getUpdated ( ) . getTime ( ) ) ) ) ; com . ibm . sbt . services . client . base . datahandlers . EntityList < com . ibm . sbt . services . client . connections . activities . ActivityNode > activityNodes = activityService . getActivityNodeChildren ( activity . getActivityUuid ( ) , params ) ; System . out . println ( ( ( ( "Nodes<sp>" + ( activityNodes . size ( ) ) ) + "<sp>update<sp>until:<sp>" ) + ( com . ibm . sbt . services . client . connections . activities . ActivityNodeChildrenSinceTest . dateFormat . format ( node . getUpdated ( ) ) ) ) ) ; dumpNodes ( activityNodes ) ; "<AssertPlaceHolder>" ; } size ( ) { return count ; }
|
org . junit . Assert . assertEquals ( 2 , activityNodes . size ( ) )
|
_string ( ) { io . jenkins . plugins . casc . Configurator c = io . jenkins . plugins . casc . impl . configurators . PrimitiveConfiguratorTest . registry . lookupOrFail ( java . lang . String . class ) ; final java . lang . Object value = c . configure ( new io . jenkins . plugins . casc . model . Scalar ( "abc" ) , io . jenkins . plugins . casc . impl . configurators . PrimitiveConfiguratorTest . context ) ; "<AssertPlaceHolder>" ; } configure ( io . jenkins . plugins . casc . model . CNode , io . jenkins . plugins . casc . ConfigurationContext ) { T object = super . configure ( c , context ) ; for ( java . lang . reflect . Method method : target . getMethods ( ) ) { if ( ( ( method . getParameterCount ( ) ) == 0 ) && ( ( method . getAnnotation ( javax . annotation . PostConstruct . class ) ) != null ) ) { try { method . invoke ( object , null ) ; } catch ( java . lang . IllegalAccessException | java . lang . reflect . InvocationTargetException e ) { throw new io . jenkins . plugins . casc . ConfiguratorException ( this , ( "Failed<sp>to<sp>invoke<sp>configurator<sp>method<sp>" + method ) , e ) ; } } } return object ; }
|
org . junit . Assert . assertEquals ( "abc" , value )
|
testManyPOSTs ( ) { int requests = 30 ; sync = new java . util . concurrent . CountDownLatch ( requests ) ; for ( int t = 0 ; t < requests ; t ++ ) { postMeasurementHistory ( ) ; } sync . await ( MAX_AWAIT_SECONDS , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return org . openehealth . ipf . platform . camel . ihe . xds . MyRejectionHandlingStrategy . COUNTER . get ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , sync . getCount ( ) )
|
testAvailableLocales ( ) { java . util . Set < java . util . Locale > expectedAvailableLocales = com . liferay . portal . kernel . util . SetUtil . fromArray ( new java . util . Locale [ ] { com . liferay . portal . kernel . util . LocaleUtil . BRAZIL } ) ; com . liferay . dynamic . data . mapping . model . DDMForm ddmForm = com . liferay . dynamic . data . mapping . test . util . DDMFormTestUtil . createDDMForm ( ) ; com . liferay . dynamic . data . mapping . form . renderer . internal . DefaultDDMFormValuesFactory defaultDDMFormValuesFactory = new com . liferay . dynamic . data . mapping . form . renderer . internal . DefaultDDMFormValuesFactory ( ddmForm , com . liferay . portal . kernel . util . LocaleUtil . BRAZIL ) ; com . liferay . dynamic . data . mapping . storage . DDMFormValues ddmFormValues = defaultDDMFormValuesFactory . create ( ) ; "<AssertPlaceHolder>" ; } getAvailableLocales ( ) { java . util . Locale [ ] availableLocales = getFormBuilderContextAvailableLocales ( ) ; if ( availableLocales != null ) { return availableLocales ; } availableLocales = getFormAvailableLocales ( ) ; if ( availableLocales != null ) { return availableLocales ; } return new java . util . Locale [ ] { getSiteDefaultLocale ( ) } ; }
|
org . junit . Assert . assertEquals ( expectedAvailableLocales , ddmFormValues . getAvailableLocales ( ) )
|
clear ( ) { net . vvakame . util . jsonpullparser . util . JsonArray jsonArray = new net . vvakame . util . jsonpullparser . util . JsonArray ( ) ; jsonArray . add ( "hoge" ) ; jsonArray . clear ( ) ; "<AssertPlaceHolder>" ; } clear ( ) { stateMap . clear ( ) ; super . clear ( ) ; }
|
org . junit . Assert . assertThat ( jsonArray . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
|
testColumnVector ( ) { double [ ] columnVector = B . getColumnVector ( 0 ) ; double [ ] expecteds = new double [ ] { 1.0 , 2.0 , 3.0 } ; "<AssertPlaceHolder>" ; } getColumnVector ( int ) { if ( col > ( n ) ) { throw new java . lang . IllegalArgumentException ( ( ( ( ( ( "Column<sp>" + col ) + "<sp>not<sp>found.<sp>Matrix<sp>size<sp>is<sp>" ) + ( m ) ) + "x" ) + ( n ) ) ) ; } double [ ] columnVector = new double [ m ] ; for ( int i = 0 ; i < ( columnVector . length ) ; i ++ ) { columnVector [ i ] = A [ i ] [ col ] ; } return columnVector ; }
|
org . junit . Assert . assertArrayEquals ( expecteds , columnVector , 0.0 )
|
streamReversed ( ) { final java . util . List < com . groupon . lex . metrics . timeseries . TimeSeriesCollection > expected = com . groupon . monsoon . remote . history . ClientServerTest . generateCollection ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; reverse ( expected ) ; when ( history . streamReversed ( ) ) . thenAnswer ( ( invocation ) -> expected . stream ( ) ) ; final java . util . List < com . groupon . lex . metrics . timeseries . TimeSeriesCollection > result = client . streamReversed ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; verify ( history , times ( 1 ) ) . streamReversed ( ) ; verifyNoMoreInteractions ( history ) ; } collect ( java . util . stream . Collector ) { try ( final java . util . stream . Stream < T > s = stream . get ( ) ) { return s . collect ( collector ) ; } }
|
org . junit . Assert . assertEquals ( expected , result )
|
testDeleteAll ( ) { int count = getAplicacionManager ( ) . count ( ) ; es . ieci . tecdoc . fwktd . csv . api . vo . AplicacionVO aplicacion = getAplicacionManager ( ) . get ( es . ieci . tecdoc . fwktd . csv . api . manager . impl . AplicacionManagerImplTest . ID_APLICACION_BORRAR ) ; getAplicacionManager ( ) . deleteAll ( java . util . Arrays . asList ( aplicacion ) ) ; "<AssertPlaceHolder>" ; } getAplicacionManager ( ) { return fwktd_sir_aplicacionManager ; }
|
org . junit . Assert . assertEquals ( getAplicacionManager ( ) . count ( ) , ( count - 1 ) )
|
testCreateRedo ( ) { org . springframework . test . web . servlet . request . MockHttpServletRequestBuilder postRequest = org . springframework . test . web . servlet . request . MockMvcRequestBuilders . post ( "/customers/create" ) . param ( "redo" , "" ) ; org . terasoluna . tourreservation . app . managecustomer . CustomerForm form = prepareNewForm ( ) ; setFormForPost ( form , postRequest ) ; try { org . springframework . test . web . servlet . ResultActions results = mockMvc . perform ( postRequest ) ; results . andExpect ( status ( ) . isOk ( ) ) ; results . andExpect ( view ( ) . name ( "managecustomer/createForm" ) ) ; org . terasoluna . tourreservation . app . managecustomer . CustomerForm backForm = ( ( org . terasoluna . tourreservation . app . managecustomer . CustomerForm ) ( results . andReturn ( ) . getRequest ( ) . getAttribute ( "customerForm" ) ) ) ; "<AssertPlaceHolder>" ; return ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } org . junit . Assert . fail ( ) ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "customerKana=" + ( customerKana ) ) + "&customerName=" ) + ( customerName ) ) + "&customerBirthDay=" 0 ) + ( customerBirthYear ) ) + "&customerBirthMonth=" ) + ( customerBirthMonth ) ) + "&customerBirthDay=" ) + ( customerBirthDay ) ) + "&customerBirthDay=" 1 ) + ( customerJob ) ) + "&customerMail=" ) + ( customerMail ) ) + "&customerPass=" ) + ( customerPass ) ) + "&customerPassConfirm=" ) + ( customerPassConfirm ) ) + "&customerTel=" ) + ( customerTel ) ) + "&customerPost=" ) + ( customerPost ) ) + "&customerAdd=" ) + ( customerAdd ) ; }
|
org . junit . Assert . assertEquals ( form . toString ( ) , backForm . toString ( ) )
|
testUpdate ( ) { challengeTeam = newChallengeTeam ( ) ; challengeTeam = challengeTeamDAO . create ( challengeTeam ) ; challengeTeam . setMessage ( "Please,<sp>please,<sp>join<sp>our<sp>Team!!" ) ; org . sagebionetworks . repo . model . ChallengeTeam updated = challengeTeamDAO . update ( challengeTeam ) ; challengeTeam . setEtag ( updated . getEtag ( ) ) ; "<AssertPlaceHolder>" ; } getEtag ( ) { return etag ; }
|
org . junit . Assert . assertEquals ( challengeTeam , updated )
|
equals_shouldReturnTrueIfThisIdAndSupportedOpenmrsVersionAndSupportedResourceAreEqualToGivenSearchConfigs ( ) { org . openmrs . module . webservices . rest . web . resource . api . SearchQuery searchQuery1 = new org . openmrs . module . webservices . rest . web . resource . api . SearchQuery . Builder ( "Enables<sp>to<sp>search<sp>by<sp>patient" ) . withRequiredParameters ( "patient" ) . build ( ) ; org . openmrs . module . webservices . rest . web . resource . api . SearchConfig searchConfig1 = new org . openmrs . module . webservices . rest . web . resource . api . SearchConfig ( "default" , "v1/order" , "1.8.*" , searchQuery1 ) ; org . openmrs . module . webservices . rest . web . resource . api . SearchQuery searchQuery2 = new org . openmrs . module . webservices . rest . web . resource . api . SearchQuery . Builder ( "Enables<sp>to<sp>search<sp>by<sp>patient" ) . withRequiredParameters ( "patient" ) . build ( ) ; org . openmrs . module . webservices . rest . web . resource . api . SearchConfig searchConfig2 = new org . openmrs . module . webservices . rest . web . resource . api . SearchConfig ( "default" , "v1/order" , "1.8.*" , searchQuery2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org . openmrs . module . webservices . rest . web . resource . api . SearchQuery ) ) { return false ; } org . openmrs . module . webservices . rest . web . resource . api . SearchQuery other = ( ( org . openmrs . module . webservices . rest . web . resource . api . SearchQuery ) ( obj ) ) ; if ( ( optionalParameters ) == null ) { if ( ( other . optionalParameters ) != null ) return false ; } else if ( ! ( optionalParameters . equals ( other . optionalParameters ) ) ) return false ; if ( ( requiredParameters ) == null ) { if ( ( other . requiredParameters ) != null ) return false ; } else if ( ! ( requiredParameters . equals ( other . requiredParameters ) ) ) return false ; return true ; }
|
org . junit . Assert . assertTrue ( searchConfig1 . equals ( searchConfig2 ) )
|
shouldReturnStateNotFoundIfRestrictionToBeDeletedWasNotFound ( ) { doThrow ( new ch . puzzle . itc . mobiliar . common . exception . AMWException ( "bad" ) ) . when ( rest . permissionBoundary ) . removeRestriction ( 1 , true ) ; javax . ws . rs . core . Response response = rest . deleteRestriction ( 1 , true ) ; "<AssertPlaceHolder>" ; } deleteRestriction ( java . lang . Integer , boolean ) { try { permissionBoundary . removeRestriction ( id , reload ) ; } catch ( ch . puzzle . itc . mobiliar . common . exception . AMWException e ) { return javax . ws . rs . core . Response . status ( ch . mobi . itc . mobiliar . rest . permissions . NOT_FOUND ) . entity ( new ch . mobi . itc . mobiliar . rest . exceptions . ExceptionDto ( e . getMessage ( ) ) ) . build ( ) ; } return javax . ws . rs . core . Response . status ( ch . mobi . itc . mobiliar . rest . permissions . NO_CONTENT ) . build ( ) ; }
|
org . junit . Assert . assertEquals ( ch . mobi . itc . mobiliar . rest . permissions . NOT_FOUND . getStatusCode ( ) , response . getStatus ( ) )
|
testRemainingCapacity ( ) { final int cap = 128 ; final java . util . concurrent . BlockingQueue < java . lang . Integer > dbq = new com . conversantmedia . util . concurrent . MPMCBlockingQueue ( cap ) ; for ( int i = 0 ; i < cap ; i ++ ) { "<AssertPlaceHolder>" ; dbq . offer ( java . lang . Integer . valueOf ( i ) ) ; } } remainingCapacity ( ) { return ( size ) - ( stackTop . get ( ) ) ; }
|
org . junit . Assert . assertEquals ( ( cap - i ) , dbq . remainingCapacity ( ) )
|
testInstanceIdIsSet ( ) { java . lang . String instanceId = ( ( java . lang . String ) ( com . google . apphosting . api . ApiProxy . getCurrentEnvironment ( ) . getAttributes ( ) . get ( "com.google.appengine.instance.id" ) ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return map . get ( name ) ; }
|
org . junit . Assert . assertNotNull ( instanceId )
|
applyToRightTest ( ) { java . util . List < org . threadly . util . Pair < java . lang . String , java . lang . String > > pairs = makeRandomPairs ( ) ; java . util . List < java . lang . String > rightCollected = new java . util . ArrayList ( pairs . size ( ) ) ; org . threadly . util . Pair . applyToRight ( pairs , ( s ) -> rightCollected . add ( s ) ) ; "<AssertPlaceHolder>" ; } collectRight ( java . util . Collection ) { if ( source . isEmpty ( ) ) { return java . util . Collections . emptyList ( ) ; } java . util . List < T > result = new java . util . ArrayList ( source . size ( ) ) ; for ( org . threadly . util . Pair < ? , ? extends T > p : source ) { if ( ( p . right ) != null ) { result . add ( p . right ) ; } } return result ; }
|
org . junit . Assert . assertEquals ( org . threadly . util . Pair . collectRight ( pairs ) , rightCollected )
|
testBuyAndSellLeavesNoEntryInSnapshot ( ) { name . abuchen . portfolio . model . Client client = new name . abuchen . portfolio . model . Client ( ) ; name . abuchen . portfolio . model . Security a = new name . abuchen . portfolio . SecurityBuilder ( ) . addPrice ( "2010-01-01" , 1000 ) . addTo ( client ) ; name . abuchen . portfolio . model . Portfolio portfolio = new name . abuchen . portfolio . PortfolioBuilder ( ) . buy ( a , "2010-01-01" , 1000000 , 10000 ) . sell ( a , "2010-01-02" , 700000 , 12000 ) . sell ( a , "2010-01-03" , 300000 , 12000 ) . addTo ( client ) ; java . time . LocalDate date = java . time . LocalDate . parse ( "2010-01-31" ) ; name . abuchen . portfolio . snapshot . PortfolioSnapshot snapshot = name . abuchen . portfolio . snapshot . PortfolioSnapshot . create ( portfolio , new name . abuchen . portfolio . TestCurrencyConverter ( ) , date ) ; "<AssertPlaceHolder>" ; } getPositions ( ) { return positions ; }
|
org . junit . Assert . assertTrue ( snapshot . getPositions ( ) . isEmpty ( ) )
|
chunk ( ) { "<AssertPlaceHolder>" ; } newBag ( ) { return new org . eclipse . collections . impl . bag . sorted . mutable . TreeBag < > ( ) ; }
|
org . junit . Assert . assertEquals ( this . newBag ( ) , this . newBag ( ) . chunk ( 2 ) )
|
testReadCSR ( ) { java . security . KeyPair keypair = org . shredzone . acme4j . util . KeyPairUtils . createKeyPair ( 2048 ) ; org . shredzone . acme4j . util . CSRBuilder builder = new org . shredzone . acme4j . util . CSRBuilder ( ) ; builder . addDomains ( "example.com" , "example.org" ) ; builder . sign ( keypair ) ; org . bouncycastle . pkcs . PKCS10CertificationRequest original = builder . getCSR ( ) ; byte [ ] pemFile ; try ( java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ) { builder . write ( baos ) ; pemFile = baos . toByteArray ( ) ; } try ( java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( pemFile ) ) { org . bouncycastle . pkcs . PKCS10CertificationRequest read = org . shredzone . acme4j . util . CertificateUtils . readCSR ( bais ) ; "<AssertPlaceHolder>" ; } } getEncoded ( ) { return getCSR ( ) . getEncoded ( ) ; }
|
org . junit . Assert . assertThat ( original . getEncoded ( ) , is ( equalTo ( read . getEncoded ( ) ) ) )
|
testParseSimpleWithDecimalsTrunc ( ) { java . lang . String source = ( ( ( "1" + ( getDecimalCharacter ( ) ) ) + "232323232323<sp>+<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "434343434343i" ; org . apache . commons . math3 . complex . Complex expected = new org . apache . commons . math3 . complex . Complex ( 1.232323232323 , 1.434343434343 ) ; org . apache . commons . math3 . complex . Complex actual = complexFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( com . google . javascript . jscomp . AbstractCompiler ) { try { com . google . javascript . jscomp . JsAst . logger_ . fine ( ( "Parsing:<sp>" + ( sourceFile . getName ( ) ) ) ) ; com . google . javascript . jscomp . parsing . ParserRunner . ParseResult result = com . google . javascript . jscomp . parsing . ParserRunner . parse ( sourceFile , sourceFile . getCode ( ) , compiler . getParserConfig ( ) , compiler . getDefaultErrorReporter ( ) , com . google . javascript . jscomp . JsAst . logger_ ) ; root = result . ast ; compiler . setOldParseTree ( sourceFile . getName ( ) , result . oldAst ) ; } catch ( java . io . IOException e ) { compiler . report ( com . google . javascript . jscomp . JSError . make ( AbstractCompiler . READ_ERROR , sourceFile . getName ( ) ) ) ; } if ( ( ( root ) == null ) || ( compiler . hasHaltingErrors ( ) ) ) { root = com . google . javascript . rhino . IR . script ( ) ; } else { compiler . prepareAst ( root ) ; } root . setStaticSourceFile ( sourceFile ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
localDateConversion ( ) { com . dslplatform . json . LocalDate today = com . dslplatform . json . LocalDate . now ( ) ; com . dslplatform . json . JsonWriter jw = new com . dslplatform . json . JsonWriter ( null ) ; com . dslplatform . json . JodaTimeConverter . serialize ( today , jw ) ; com . dslplatform . json . JsonReader < java . lang . Object > jr = dslJson . newReader ( jw . toString ( ) . getBytes ( "UTF-8" ) ) ; jr . read ( ) ; com . dslplatform . json . LocalDate value = com . dslplatform . json . JodaTimeConverter . deserializeLocalDate ( jr ) ; "<AssertPlaceHolder>" ; } deserializeLocalDate ( com . dslplatform . json . JsonReader ) { final char [ ] tmp = reader . readSimpleQuote ( ) ; final int len = ( ( reader . getCurrentIndex ( ) ) - ( reader . getTokenStart ( ) ) ) - 1 ; if ( ( ( len == 10 ) && ( ( tmp [ 4 ] ) == '-' ) ) && ( ( tmp [ 7 ] ) == '-' ) ) { final int year = com . dslplatform . json . NumberConverter . read4 ( tmp , 0 ) ; final int month = com . dslplatform . json . NumberConverter . read2 ( tmp , 5 ) ; final int day = com . dslplatform . json . NumberConverter . read2 ( tmp , 8 ) ; return new org . joda . time . LocalDate ( year , month , day ) ; } else { return com . dslplatform . json . JodaTimeConverter . localDateParser . parseLocalDate ( new java . lang . String ( tmp , 0 , len ) ) ; } }
|
org . junit . Assert . assertEquals ( today , value )
|
testEmpty ( ) { java . util . Iterator < ? > iterator = new net . sourceforge . pmd . util . CompoundIterator ( ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( attributes != null ) && ( ( index ) < ( attributes . getLength ( ) ) ) ; }
|
org . junit . Assert . assertFalse ( iterator . hasNext ( ) )
|
testFilterNot ( ) { io . katharsis . queryspec . QuerySpec spec = new io . katharsis . queryspec . QuerySpec ( io . katharsis . resource . mock . models . Task . class ) ; io . katharsis . queryspec . FilterSpec spec1 = new io . katharsis . queryspec . FilterSpec ( java . util . Arrays . asList ( "id" ) , FilterOperator . LE , 1L ) ; spec . addFilter ( io . katharsis . queryspec . FilterSpec . not ( spec1 ) ) ; java . util . List < io . katharsis . resource . mock . models . Task > results = spec . apply ( tasks ) ; "<AssertPlaceHolder>" ; } size ( ) { return list . size ( ) ; }
|
org . junit . Assert . assertEquals ( 4 , results . size ( ) )
|
testGetStartIndexReply ( ) { long index = 100 ; org . apache . ratis . logservice . util . GetLogStartIndexReplyProto proto = org . apache . ratis . logservice . util . LogServiceProtoUtil . toGetLogStartIndexReplyProto ( index , null ) ; "<AssertPlaceHolder>" ; } getStartIndex ( ) { return ( entries . size ( ) ) == 0 ? org . apache . ratis . server . impl . RaftServerConstants . INVALID_LOG_INDEX : entries . getTermIndex ( 0 ) . getIndex ( ) ; }
|
org . junit . Assert . assertEquals ( index , proto . getStartIndex ( ) )
|
testRFC2109DomainMatch4 ( ) { org . apache . ogt . http . impl . cookie . BasicClientCookie cookie = new org . apache . ogt . http . impl . cookie . BasicClientCookie ( "name" , "value" ) ; org . apache . ogt . http . cookie . CookieOrigin origin = new org . apache . ogt . http . cookie . CookieOrigin ( "www.somedomain.com" , 80 , "/" , false ) ; org . apache . ogt . http . cookie . CookieAttributeHandler h = new org . apache . ogt . http . impl . cookie . RFC2109DomainHandler ( ) ; cookie . setDomain ( "somedomain.com" ) ; "<AssertPlaceHolder>" ; } match ( org . apache . ogt . http . cookie . Cookie , org . apache . ogt . http . cookie . CookieOrigin ) { if ( cookie == null ) { throw new java . lang . IllegalArgumentException ( "Cookie<sp>may<sp>not<sp>be<sp>null" ) ; } if ( origin == null ) { throw new java . lang . IllegalArgumentException ( "Cookie<sp>origin<sp>may<sp>not<sp>be<sp>null" ) ; } java . lang . String host = origin . getHost ( ) ; java . lang . String domain = cookie . getDomain ( ) ; if ( domain == null ) { return false ; } return ( host . equals ( domain ) ) || ( ( domain . startsWith ( "." ) ) && ( host . endsWith ( domain ) ) ) ; }
|
org . junit . Assert . assertFalse ( h . match ( cookie , origin ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.