input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testBoxShadowTransparent ( ) { com . liferay . sass . compiler . SassCompiler sassCompiler = new com . liferay . sass . compiler . jni . internal . JniSassCompiler ( ) ; java . lang . String expectedOutput = "foo<sp>{<sp>box-shadow:<sp>2px<sp>4px<sp>7px<sp>rgba(0,<sp>0,<sp>0,<sp>0.5);<sp>}" ; java . lang . String actualOutput = sassCompiler . compileString ( "foo<sp>{<sp>box-shadow:<sp>2px<sp>4px<sp>7px<sp>rgba(0,<sp>0,<sp>0,<sp>0.5);<sp>}" , "" ) ; "<AssertPlaceHolder>" ; } stripNewLines ( java . lang . String ) { string = string . replaceAll ( "\\n|\\r" , "" ) ; return string . replaceAll ( "\\s+" , "<sp>" ) ; }
|
org . junit . Assert . assertEquals ( stripNewLines ( expectedOutput ) , stripNewLines ( actualOutput ) )
|
replaceSubstring_upperBoundary ( ) { java . lang . String str = "test<sp>string" ; java . lang . String result = org . oscm . string . Strings . replaceSubstring ( 0 , ( ( str . length ( ) ) + 1 ) , str , "replacement" ) ; "<AssertPlaceHolder>" ; } replaceSubstring ( int , int , java . lang . String , java . lang . String ) { java . lang . String result = null ; if ( ( ( ( ( str != null ) && ( value != null ) ) && ( from >= 0 ) ) && ( from <= to ) ) && ( to < ( str . length ( ) ) ) ) { java . lang . String head = null ; java . lang . String tail = null ; head = str . substring ( 0 , from ) ; tail = str . substring ( ( to + 1 ) , str . length ( ) ) ; result = ( head + value ) + tail ; } return result ; }
|
org . junit . Assert . assertNull ( result )
|
instantiation ( ) { org . junithelper . core . filter . TrimFilterUtil target = new org . junithelper . core . filter . TrimFilterUtil ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( target )
|
testSkip2 ( ) { int i = 0 ; while ( i < 256 ) { "<AssertPlaceHolder>" ; i += ( mPooledByteArrayBufferedInputStream . skip ( 7 ) ) + 1 ; } } read ( ) { return com . facebook . common . internal . Files . toByteArray ( mFile ) ; }
|
org . junit . Assert . assertEquals ( i , mPooledByteArrayBufferedInputStream . read ( ) )
|
testMetricLast3 ( ) { com . aliyun . hitsdb . client . value . request . LastPointQuery query = com . aliyun . hitsdb . client . value . request . LastPointQuery . builder ( ) . sub ( com . aliyun . hitsdb . client . value . request . LastPointSubQuery . builder ( com . aliyun . hitsdb . client . TestHiTSDBClientLastDataPointQuery . metric , com . aliyun . hitsdb . client . TestHiTSDBClientLastDataPointQuery . tags ) . build ( ) ) . build ( ) ; System . out . println ( query . toJSON ( ) ) ; java . util . List < com . aliyun . hitsdb . client . value . response . LastDataValue > lastDataValues = tsdb . queryLast ( query ) ; System . out . println ( lastDataValues ) ; "<AssertPlaceHolder>" ; } queryLast ( com . aliyun . hitsdb . client . Collection ) { java . lang . Object timelinesJSON = com . alibaba . fastjson . JSON . toJSON ( timelines ) ; com . alibaba . fastjson . JSONObject obj = new com . alibaba . fastjson . JSONObject ( ) ; obj . put ( "queries" , timelinesJSON ) ; java . lang . String jsonString = obj . toJSONString ( ) ; org . apache . http . HttpResponse httpResponse = httpclient . post ( HttpAPI . QUERY_LAST , jsonString ) ; com . aliyun . hitsdb . client . http . response . ResultResponse resultResponse = com . aliyun . hitsdb . client . http . response . ResultResponse . simplify ( httpResponse , this . httpCompress ) ; com . aliyun . hitsdb . client . http . response . HttpStatus httpStatus = resultResponse . getHttpStatus ( ) ; switch ( httpStatus ) { case ServerSuccessNoContent : return null ; case ServerSuccess : java . lang . String content = resultResponse . getContent ( ) ; com . aliyun . hitsdb . client . List < com . aliyun . hitsdb . client . LastDataValue > queryResultList = com . alibaba . fastjson . JSON . parseArray ( content , com . aliyun . hitsdb . client . LastDataValue . class ) ; return queryResultList ; case ServerNotSupport : throw new com . aliyun . hitsdb . client . HttpServerNotSupportException ( resultResponse ) ; case ServerError : throw new com . aliyun . hitsdb . client . HttpServerErrorException ( resultResponse ) ; default : throw new com . aliyun . hitsdb . client . HttpUnknowStatusException ( resultResponse ) ; } }
|
org . junit . Assert . assertEquals ( lastDataValues . size ( ) , 1 )
|
equalsItself ( ) { com . mpatric . mp3agic . ID3v2ChapterFrameData frameData = new com . mpatric . mp3agic . ID3v2ChapterFrameData ( false , "ch1" , 1 , 380 , 3 , 400 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( frameData , frameData )
|
testPut ( ) { com . googlecode . concurrenttrees . radixreversed . ConcurrentReversedRadixTree < java . lang . Integer > tree = new com . googlecode . concurrenttrees . radixreversed . ConcurrentReversedRadixTree < java . lang . Integer > ( getNodeFactory ( ) ) ; tree . put ( "TEST" , 1 ) ; tree . put ( "TEAM" , 2 ) ; tree . put ( "TOAST" , 3 ) ; java . lang . String expected = "β\n" + ( ( ( "βββ<sp>β<sp>MAET<sp>(2)\n" + "βββ<sp>β<sp>TS\n" ) + "<sp>βββ<sp>β<sp>AOT<sp>(3)\n" ) + "<sp>βββ<sp>β<sp>ET<sp>(1)\n" ) ; java . lang . String actual = com . googlecode . concurrenttrees . common . PrettyPrinter . prettyPrint ( tree ) ; "<AssertPlaceHolder>" ; } prettyPrint ( com . googlecode . concurrenttrees . radix . node . util . PrettyPrintable ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; com . googlecode . concurrenttrees . common . PrettyPrinter . prettyPrint ( tree . getNode ( ) , sb , "" , true , true ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testSerializeStatsReportMessage ( ) { final io . netty . buffer . ByteBuf buffer = io . netty . buffer . Unpooled . buffer ( org . opendaylight . protocol . bmp . parser . message . StatisticsReportHandlerTest . STATS_REPORT . length ) ; getBmpMessageRegistry ( ) . serializeMessage ( org . opendaylight . protocol . bmp . parser . message . TestUtil . createStatsReportMsg ( ) , buffer ) ; "<AssertPlaceHolder>" ; } readAllBytes ( io . netty . buffer . ByteBuf ) { return org . opendaylight . protocol . util . ByteArray . readBytes ( buffer , buffer . readableBytes ( ) ) ; }
|
org . junit . Assert . assertArrayEquals ( org . opendaylight . protocol . bmp . parser . message . StatisticsReportHandlerTest . STATS_REPORT , org . opendaylight . protocol . util . ByteArray . readAllBytes ( buffer ) )
|
example ( ) { org . psjava . ds . graph . MutableDirectedUnweightedGraph < java . lang . String > graph = org . psjava . ds . graph . MutableDirectedUnweightedGraph . create ( ) ; graph . insertVertex ( "A" ) ; graph . insertVertex ( "B" ) ; graph . insertVertex ( "C" ) ; graph . addEdge ( "A" , "B" ) ; graph . addEdge ( "A" , "C" ) ; org . psjava . ds . graph . RootedTree < java . lang . String , org . psjava . ds . graph . DirectedEdge < java . lang . String > > tree = org . psjava . ds . graph . RootedTree . wrap ( graph , "A" ) ; "<AssertPlaceHolder>" ; } wrap ( org . psjava . ds . graph . Graph , V ) { return new org . psjava . ds . graph . RootedTree < V , E > ( g , root ) ; }
|
org . junit . Assert . assertNotNull ( tree )
|
playerNameStatsAndArmyDefinesAPlayer ( ) { com . agical . simwar . player . Player player1 = new com . agical . simwar . TestingPlayer ( "P1" , new com . agical . simwar . game . Army ( 1 , 4 , 3 , 2 ) , Stats . NO_STATS , new com . agical . simwar . player . TestingPlayerCombatant ( ) ) ; com . agical . simwar . player . Player player2 = new com . agical . simwar . TestingPlayer ( "P1" , new com . agical . simwar . game . Army ( 1 , 4 , 3 , 2 ) , Stats . NO_STATS , new com . agical . simwar . player . TestingPlayerCombatant ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( player1 , player2 )
|
defaultFieldOnObjectStaticFinalIsNoOp ( ) { nl . jqno . equalsverifier . internal . reflection . StaticFinalContainer foo = new nl . jqno . equalsverifier . internal . reflection . StaticFinalContainer ( ) ; java . lang . Object original = foo . OBJECT ; doNullField ( foo , "OBJECT" ) ; "<AssertPlaceHolder>" ; } doNullField ( java . lang . Object , java . lang . String ) { getAccessorFor ( object , fieldName ) . defaultField ( ) ; }
|
org . junit . Assert . assertSame ( original , foo . OBJECT )
|
testGetStatements ( ) { java . util . List < org . nuxeo . ecm . platform . relations . api . Statement > stmts = new java . util . ArrayList ( ) ; "<AssertPlaceHolder>" ; graph . add ( statements ) ; stmts = graph . getStatements ( ) ; compareStatements ( stmts , statements ) ; } getStatements ( ) { return graph . getStatements ( ) ; }
|
org . junit . Assert . assertEquals ( stmts , graph . getStatements ( ) )
|
testMixInDelegation_getView ( ) { com . google . jenkins . plugins . delegate . AbstractRunnableItemGroupTest . TestImpl underTest = new com . google . jenkins . plugins . delegate . AbstractRunnableItemGroupTest . TestImpl ( mockFolder , "foo" , tabBar , views , mockMixIn ) ; when ( mockMixIn . getView ( "name" ) ) . thenReturn ( mockView ) ; "<AssertPlaceHolder>" ; verify ( mockMixIn ) . getView ( "name" ) ; } getView ( java . lang . String ) { return getViewGroupMixIn ( ) . getView ( name ) ; }
|
org . junit . Assert . assertSame ( mockView , underTest . getView ( "name" ) )
|
testArraySizeZero ( ) { com . eclipsesource . v8 . V8Array array = v8 . executeArrayScript ( "[];" ) ; "<AssertPlaceHolder>" ; array . close ( ) ; } length ( ) { return v8Object . executeIntegerFunction ( com . eclipsesource . v8 . debug . mirror . ArrayMirror . LENGTH , null ) ; }
|
org . junit . Assert . assertEquals ( 0 , array . length ( ) )
|
testMultidimArray ( ) { java . lang . Object [ ] [ ] array = new java . lang . Object [ 10 ] [ 10 ] ; boolean npe = false ; try { org . granite . util . TypeUtil . findResource ( array . getClass ( ) ) ; } catch ( java . lang . NullPointerException e ) { npe = true ; } "<AssertPlaceHolder>" ; } findResource ( java . lang . Class ) { while ( clazz . isArray ( ) ) clazz = clazz . getComponentType ( ) ; if ( clazz . isPrimitive ( ) ) return null ; java . net . URL url = org . granite . util . TypeUtil . getClassLoader ( clazz ) . getResource ( org . granite . util . TypeUtil . toResourceName ( clazz ) ) ; java . lang . String path = url . toString ( ) ; if ( ( path . indexOf ( '<sp>' ) ) != ( - 1 ) ) { try { url = new java . net . URL ( path . replace ( "<sp>" , "%20" ) ) ; } catch ( java . net . MalformedURLException e ) { } } return url ; }
|
org . junit . Assert . assertFalse ( npe )
|
testProvisionerRescanWorkingWithDiscoveredNodesDiscoveryDisabled ( ) { java . lang . System . setProperty ( "org.opennms.provisiond.enableDiscovery" , "false" ) ; try { m_populator . populateDatabase ( ) ; m_provisioner . scheduleRescanForExistingNodes ( ) ; "<AssertPlaceHolder>" ; } finally { m_populator . resetDatabase ( ) ; } } getScheduleLength ( ) { return m_scheduledNodes . size ( ) ; }
|
org . junit . Assert . assertEquals ( 4 , m_provisioner . getScheduleLength ( ) )
|
testAttemptLimited ( ) { int attemptLimit = 5 ; org . batfish . common . util . Backoff backoff = org . batfish . common . util . Backoff . builder ( ) . withAttemptLimit ( attemptLimit ) . build ( ) ; int i = 1 ; while ( backoff . hasNext ( ) ) { ++ i ; backoff . nextBackoff ( ) ; } "<AssertPlaceHolder>" ; } hasNext ( ) { return ( b ) != null ; }
|
org . junit . Assert . assertThat ( i , org . hamcrest . Matchers . equalTo ( attemptLimit ) )
|
localDateIsAfter ( ) { java . time . LocalDate ld = common . test . tool . dataset . DateAndTimes . LD_20150618 ; java . time . LocalDate ld2 = common . test . tool . dataset . DateAndTimes . LD_20150807 ; boolean isAfter0618 = false ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( isAfter0618 , org . hamcrest . Matchers . is ( true ) )
|
testIsUseCopyAsRtf ( ) { classUnderTest . setUseCopyAsRtf ( true ) ; "<AssertPlaceHolder>" ; } isUseCopyAsRtf ( ) { return _useCopyAsRtf ; }
|
org . junit . Assert . assertTrue ( classUnderTest . isUseCopyAsRtf ( ) )
|
iremoveEmptyRange ( ) { org . roaringbitmap . buffer . MappeableContainer ac = new org . roaringbitmap . buffer . MappeableArrayContainer ( ) ; ac . remove ( 1 , 1 ) ; "<AssertPlaceHolder>" ; } getCardinality ( ) { return ( ( int ) ( getLongCardinality ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , ac . getCardinality ( ) )
|
testGetWikiPage ( ) { System . out . println ( "getWikiPage" ) ; kg . apc . jmeter . vizualizers . MergeResultsGui instance = new kg . apc . jmeter . vizualizers . MergeResultsGui ( ) ; java . lang . String expResult = "MergeResults" ; java . lang . String result = instance . getWikiPage ( ) ; "<AssertPlaceHolder>" ; } getWikiPage ( ) { return "ResponseCodesPerSecond" ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
shouldChangeConceptDescriptionReferenceToParentConcept ( ) { org . openmrs . Concept c = new org . openmrs . Concept ( 123 ) ; c . addDescription ( new org . openmrs . ConceptDescription ( 1 ) ) ; c . addDescription ( new org . openmrs . ConceptDescription ( 2 ) ) ; org . openmrs . ConceptNumeric cn = new org . openmrs . ConceptNumeric ( c ) ; for ( org . openmrs . ConceptDescription cDesc : cn . getDescriptions ( ) ) { "<AssertPlaceHolder>" ; } } getConcept ( ) { return concept ; }
|
org . junit . Assert . assertSame ( cn , cDesc . getConcept ( ) )
|
shouldReportCorrectTerminationReason ( ) { org . neo4j . kernel . api . exceptions . Status status = Status . Transaction . Terminated ; org . neo4j . kernel . impl . api . KernelTransactionImplementation tx = newTransaction ( loginContext ( ) ) ; tx . markForTermination ( status ) ; "<AssertPlaceHolder>" ; } getReasonIfTerminated ( ) { return java . util . Optional . ofNullable ( terminationReason ) ; }
|
org . junit . Assert . assertSame ( status , tx . getReasonIfTerminated ( ) . get ( ) )
|
testIndexWithNewline ( ) { java . lang . String [ ] sentence = "He<sp>belongs<sp>to<sp>Apache<sp>\n<sp>Software<sp>Foundation<sp>." . split ( "<sp>" ) ; opennlp . tools . namefind . NameContextGenerator CG = new opennlp . tools . namefind . DefaultNameContextGenerator ( ( ( opennlp . tools . util . featuregen . AdaptiveFeatureGenerator [ ] ) ( null ) ) ) ; opennlp . tools . namefind . NameSample nameSample = new opennlp . tools . namefind . NameSample ( sentence , new opennlp . tools . util . Span [ ] { new opennlp . tools . util . Span ( 3 , 7 ) } , false ) ; opennlp . tools . util . ObjectStream < opennlp . tools . ml . model . Event > eventStream = new opennlp . tools . namefind . NameFinderEventStream ( opennlp . tools . util . ObjectStreamUtils . createObjectStream ( nameSample ) , "org" , CG , null ) ; opennlp . tools . ml . model . DataIndexer indexer = new opennlp . tools . ml . model . TwoPassDataIndexer ( ) ; indexer . init ( new opennlp . tools . util . TrainingParameters ( java . util . Collections . emptyMap ( ) ) , null ) ; indexer . index ( eventStream ) ; "<AssertPlaceHolder>" ; } getContexts ( ) { return contexts ; }
|
org . junit . Assert . assertEquals ( 5 , indexer . getContexts ( ) . length )
|
processShouldExtractFilesEvenIfRetrieveFileIsFalse ( ) { final java . util . List < java . lang . String > methodCalled = new java . util . ArrayList < java . lang . String > ( ) ; final java . lang . String downloadFlag = "download" ; final java . lang . String decompressFlag = "decompress" ; com . gisgraphy . importer . OpenStreetMapHouseNumberFileRetriever openStreetMapHouseNumberFileRetriever = new com . gisgraphy . importer . OpenStreetMapHouseNumberFileRetriever ( ) { @ com . gisgraphy . importer . Override protected void downloadFiles ( ) { methodCalled . add ( downloadFlag ) ; } @ com . gisgraphy . importer . Override public void decompressFiles ( ) throws java . io . IOException { methodCalled . add ( decompressFlag ) ; } } ; com . gisgraphy . importer . ImporterConfig importerConfig = new com . gisgraphy . importer . ImporterConfig ( ) ; importerConfig . setOpenstreetmapHouseNumberImporterEnabled ( true ) ; importerConfig . setRetrieveFiles ( false ) ; openStreetMapHouseNumberFileRetriever . setInternationalisationService ( createMockInternationalisationService ( ) ) ; openStreetMapHouseNumberFileRetriever . setImporterConfig ( importerConfig ) ; openStreetMapHouseNumberFileRetriever . process ( ) ; "<AssertPlaceHolder>" ; } get ( PK extends java . io . Serializable ) { org . springframework . util . Assert . notNull ( id , "Can<sp>not<sp>retrieve<sp>an<sp>Ogject<sp>with<sp>a<sp>null<sp>id" ) ; T returnValue = null ; try { returnValue = ( ( T ) ( this . getHibernateTemplate ( ) . get ( persistentClass , id ) ) ) ; } catch ( java . lang . Exception e ) { log . info ( ( ( ( "could<sp>not<sp>retrieve<sp>object<sp>of<sp>type<sp>" + ( persistentClass . getSimpleName ( ) ) ) + "<sp>with<sp>id<sp>" ) + id ) , e ) ; } return returnValue ; }
|
org . junit . Assert . assertEquals ( decompressFlag , methodCalled . get ( 0 ) )
|
translatesPlainEnumCorrectly ( ) { org . springframework . data . rest . webmvc . json . JacksonSerializersUnitTests . Sample result = mapper . readValue ( "{<sp>\"property\"<sp>:<sp>\"value\"}" , org . springframework . data . rest . webmvc . json . JacksonSerializersUnitTests . Sample . class ) ; "<AssertPlaceHolder>" . isEqualTo ( org . springframework . data . rest . webmvc . json . JacksonSerializersUnitTests . Sample . SampleEnum . VALUE ) ; }
|
org . junit . Assert . assertThat ( result . property )
|
testWriteAndRead ( ) { final com . spotify . netty4 . handler . codec . zmtp . ZMTPMessage message = com . spotify . netty4 . handler . codec . zmtp . ZMTPMessage . fromUTF8 ( com . spotify . netty4 . handler . codec . zmtp . ZMTPMessageTest . ALLOC , "hello" , "world" ) ; final io . netty . buffer . ByteBuf buffer = message . write ( com . spotify . netty4 . handler . codec . zmtp . ZMTPMessageTest . ALLOC , version ) ; final com . spotify . netty4 . handler . codec . zmtp . ZMTPMessage read = com . spotify . netty4 . handler . codec . zmtp . ZMTPMessage . read ( buffer , version ) ; "<AssertPlaceHolder>" ; } read ( io . netty . buffer . ByteBuf , com . spotify . netty4 . handler . codec . zmtp . ZMTPVersion ) { final int mark = in . readerIndex ( ) ; final com . spotify . netty4 . handler . codec . zmtp . ZMTPWireFormat wireFormat = com . spotify . netty4 . handler . codec . zmtp . ZMTPWireFormats . wireFormat ( version ) ; final com . spotify . netty4 . handler . codec . zmtp . ZMTPWireFormat . Header header = wireFormat . header ( ) ; final io . netty . util . internal . RecyclableArrayList frames = io . netty . util . internal . RecyclableArrayList . newInstance ( ) ; while ( true ) { final boolean read = header . read ( in ) ; if ( ! read ) { frames . recycle ( ) ; in . readerIndex ( mark ) ; return null ; } if ( ( in . readableBytes ( ) ) < ( header . length ( ) ) ) { frames . recycle ( ) ; in . readerIndex ( mark ) ; return null ; } if ( ( header . length ( ) ) > ( Integer . MAX_VALUE ) ) { throw new com . spotify . netty4 . handler . codec . zmtp . ZMTPParsingException ( ( "frame<sp>is<sp>too<sp>large:<sp>" + ( header . length ( ) ) ) ) ; } final io . netty . buffer . ByteBuf frame = in . readSlice ( ( ( int ) ( header . length ( ) ) ) ) ; frame . retain ( ) ; frames . add ( frame ) ; if ( ! ( header . more ( ) ) ) { @ com . spotify . netty4 . handler . codec . zmtp . SuppressWarnings ( "unchecked" ) final com . spotify . netty4 . handler . codec . zmtp . ZMTPMessage message = com . spotify . netty4 . handler . codec . zmtp . ZMTPMessage . from ( ( ( java . util . List < io . netty . buffer . ByteBuf > ) ( ( java . lang . Object ) ( frames ) ) ) ) ; frames . recycle ( ) ; return message ; } } }
|
org . junit . Assert . assertThat ( read , org . hamcrest . Matchers . is ( message ) )
|
retrieve ( ) { org . jdom2 . Document xml1 = new org . jdom2 . Document ( new org . jdom2 . Element ( "root" ) ) ; int id = getVersStore ( ) . create ( new org . mycore . common . content . MCRJDOMContent ( xml1 ) ) . getID ( ) ; org . mycore . datamodel . ifs2 . MCRVersionedMetadata sm1 = getVersStore ( ) . retrieve ( id ) ; org . mycore . common . content . MCRContent xml2 = sm1 . getMetadata ( ) ; "<AssertPlaceHolder>" ; } asString ( ) { return this . text ; }
|
org . junit . Assert . assertEquals ( new org . mycore . common . content . MCRJDOMContent ( xml1 ) . asString ( ) , xml2 . asString ( ) )
|
inOrderFail2 ( ) { javax . lang . model . element . ExecutableElement executableElement = org . androidannotations . helper . ValidatorParameterHelperTest . createMethod ( long . class , boolean . class ) ; org . androidannotations . ElementValidation valid = new org . androidannotations . ElementValidation ( "" , executableElement ) ; validator . inOrder ( ) . type ( boolean . class . getName ( ) ) . multiple ( ) . type ( long . class . getName ( ) ) . optional ( ) . type ( int . class . getName ( ) ) . optional ( ) . validate ( executableElement , valid ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return isValid ; }
|
org . junit . Assert . assertFalse ( valid . isValid ( ) )
|
testFindComponentById_componentDoesntExistInTree_nullReturned ( ) { @ org . vaadin . teemu . clara . SuppressWarnings ( "serial" ) com . vaadin . ui . Layout layout = new com . vaadin . ui . VerticalLayout ( ) { { com . vaadin . ui . Button b = new com . vaadin . ui . Button ( ) ; b . setId ( "button" ) ; addComponent ( b ) ; } } ; com . vaadin . ui . Component c = org . vaadin . teemu . clara . Clara . findComponentById ( layout , "foobar" ) ; "<AssertPlaceHolder>" ; } findComponentById ( com . vaadin . ui . Component , java . lang . String ) { if ( componentId == null ) { throw new java . lang . IllegalArgumentException ( "Component<sp>id<sp>must<sp>not<sp>be<sp>null." ) ; } if ( root == null ) { throw new java . lang . IllegalArgumentException ( "Root<sp>component<sp>must<sp>not<sp>be<sp>null." ) ; } if ( componentId . equals ( root . getId ( ) ) ) { return root ; } else if ( root instanceof com . vaadin . ui . HasComponents ) { for ( com . vaadin . ui . Component c : ( ( com . vaadin . ui . HasComponents ) ( root ) ) ) { com . vaadin . ui . Component result = org . vaadin . teemu . clara . Clara . findComponentById ( c , componentId ) ; if ( result != null ) { return result ; } } } return null ; }
|
org . junit . Assert . assertNull ( c )
|
whenPrioritySet_thenGet ( ) { final com . hazelcast . jet . core . Edge e = com . hazelcast . jet . core . Edge . from ( a ) . priority ( 2 ) ; "<AssertPlaceHolder>" ; } getPriority ( ) { return com . hazelcast . jet . impl . MasterJobContext . SNAPSHOT_RESTORE_EDGE_PRIORITY ; }
|
org . junit . Assert . assertEquals ( 2 , e . getPriority ( ) )
|
testQualifyAddressUserSimple ( ) { edu . internet2 . middleware . changelogconsumer . googleapps . utils . AddressFormatter addressFormatter = new edu . internet2 . middleware . changelogconsumer . googleapps . utils . AddressFormatter ( ) ; addressFormatter . setSubjectIdentifierExpression ( "${subjectId}" ) . setDomain ( "test.edu" ) ; edu . internet2 . middleware . subject . Subject subject = mock ( edu . internet2 . middleware . subject . Subject . class ) ; when ( subject . getId ( ) ) . thenReturn ( "jgasper" ) ; java . lang . String expected = "jgasper@test.edu" ; java . lang . String result = addressFormatter . qualifySubjectAddress ( subject ) ; "<AssertPlaceHolder>" ; } qualifySubjectAddress ( edu . internet2 . middleware . subject . Subject ) { final org . apache . commons . jexl2 . JexlContext context = new org . apache . commons . jexl2 . MapContext ( ) ; context . set ( "subject" , subject ) ; context . set ( "subjectId" , subject . getId ( ) ) ; java . lang . String address = subject . getId ( ) ; try { address = subjectIdentifierExp . evaluate ( context ) . toString ( ) ; } catch ( java . lang . Exception ex ) { } if ( ! ( address . contains ( "@" ) ) ) { address = java . lang . String . format ( "%s@%s" , address , this . domain ) ; } return address . replace ( ":" , "-" ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
getOrganizationByURL ( ) { com . podio . org . OrganizationMini org = getAPI ( ) . getOrganizationByURL ( "https://podio.com/hoist" ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( org . getId ( ) , 1 )
|
testLoginObjectInSubject ( ) { org . apache . hadoop . security . UserGroupInformation loginUgi = org . apache . hadoop . security . UserGroupInformation . getLoginUser ( ) ; org . apache . hadoop . security . UserGroupInformation anotherUgi = new org . apache . hadoop . security . UserGroupInformation ( loginUgi . getSubject ( ) ) ; javax . security . auth . login . LoginContext login1 = loginUgi . getSubject ( ) . getPrincipals ( org . apache . hadoop . security . User . class ) . iterator ( ) . next ( ) . getLogin ( ) ; javax . security . auth . login . LoginContext login2 = anotherUgi . getSubject ( ) . getPrincipals ( org . apache . hadoop . security . User . class ) . iterator ( ) . next ( ) . getLogin ( ) ; "<AssertPlaceHolder>" ; } getLogin ( ) { return user . getLogin ( ) ; }
|
org . junit . Assert . assertTrue ( ( login1 == login2 ) )
|
testAttachDiskWithOptions ( ) { initializeExpectedInstance ( 2 ) ; expect ( compute . getOptions ( ) ) . andReturn ( mockOptions ) ; com . google . cloud . compute . deprecated . AttachedDisk . PersistentDiskConfiguration configuration = AttachedDisk . PersistentDiskConfiguration . of ( com . google . cloud . compute . deprecated . InstanceTest . DISK_ID ) ; com . google . cloud . compute . deprecated . Operation operation = new com . google . cloud . compute . deprecated . Operation . Builder ( serviceMockReturnsOptions ) . setOperationId ( com . google . cloud . compute . deprecated . ZoneOperationId . of ( "project" , "op" ) ) . build ( ) ; expect ( compute . attachDisk ( com . google . cloud . compute . deprecated . InstanceTest . INSTANCE_ID , configuration , Compute . OperationOption . fields ( ) ) ) . andReturn ( operation ) ; replay ( compute ) ; initializeInstance ( ) ; "<AssertPlaceHolder>" ; } attachDisk ( com . google . cloud . compute . deprecated . AttachedDisk . PersistentDiskConfiguration , com . google . cloud . compute . deprecated . Compute . OperationOption [ ] ) { return compute . attachDisk ( getInstanceId ( ) , configuration , options ) ; }
|
org . junit . Assert . assertSame ( operation , instance . attachDisk ( configuration , Compute . OperationOption . fields ( ) ) )
|
testTotalTimeParseException ( ) { statusList . add ( "time:<sp>junk:junk" ) ; when ( commandExecutor . sendCommand ( properties . getStatus ( ) ) ) . thenReturn ( statusList ) ; "<AssertPlaceHolder>" ; } getElapsedTime ( ) { return serverStatus . getElapsedTime ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , serverStatus . getElapsedTime ( ) )
|
testx86_64Arch ( ) { java . util . Properties props = new java . util . Properties ( ) ; props . setProperty ( "os.name" , "dummy" ) ; props . setProperty ( "os.arch" , "x86_64" ) ; java . lang . Process process = new java . lang . Process ( props ) ; "<AssertPlaceHolder>" ; } arch ( ) { if ( isX64 ( ) ) { return "x64" ; } else if ( isIa32 ( ) ) { return "ia32" ; } else if ( isArm ( ) ) { return "arm" ; } return null ; }
|
org . junit . Assert . assertEquals ( "x64" , process . arch ( ) )
|
testSideEffect ( ) { final java . util . List < org . jglue . totorom . TVertex > collected = new java . util . ArrayList < org . jglue . totorom . TVertex > ( ) ; graph . v ( 1 ) . sideEffect ( ( v ) -> { collected . add ( v ) ; } ) . iterate ( ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , collected . size ( ) )
|
shouldSaveAndMergeData ( ) { ioUtils . copy ( "json1" , jsonFile ) ; java . util . SortedMap < java . lang . String , jscover . report . FileData > map = new java . util . TreeMap ( ) ; given ( jsonDataMerger . mergeJSONCoverageStrings ( "json1" , "json2" ) ) . willReturn ( map ) ; given ( jsonDataMerger . toJSON ( map ) ) . willReturn ( "jsonMerged" ) ; jsonDataSaver . saveJSONData ( destDir , "json2" , null , uriFileTranslator ) ; java . lang . String json = ioUtils . loadFromFileSystem ( jsonFile ) ; "<AssertPlaceHolder>" ; } loadFromFileSystem ( jscover . util . File ) { jscover . util . InputStream is = null ; try { is = new jscover . util . FileInputStream ( dataFile ) ; return toString ( is ) ; } catch ( java . lang . Throwable e ) { throw new java . lang . RuntimeException ( java . lang . String . format ( "Problem<sp>loading<sp>file:<sp>'%s'" , dataFile ) , e ) ; } finally { closeQuietly ( is ) ; } }
|
org . junit . Assert . assertThat ( json , org . hamcrest . CoreMatchers . equalTo ( "jsonMerged" ) )
|
shouldUsePropertySetterAndGetterFromSubclassHandler ( ) { org . openmrs . module . webservices . rest . web . HivDrugOrderSubclassHandler handler = new org . openmrs . module . webservices . rest . web . HivDrugOrderSubclassHandler ( ) ; resource . registerSubclassHandler ( handler ) ; org . openmrs . module . webservices . rest . web . HivDrugOrder o = handler . newDelegate ( ) ; resource . setProperty ( o , "standardRegimenCode" , "Peds-1a" ) ; java . lang . Object valueSet = resource . getProperty ( o , "standardRegimenCode" ) ; "<AssertPlaceHolder>" ; } getProperty ( org . openmrs . module . webservices . rest . web . v1_0 . wrapper . openmrs1_8 . UserAndPassword1_8 , java . lang . String ) { try { if ( propertyName . equals ( "password" ) ) { return instance . getPassword ( ) ; } else { java . lang . reflect . Method annotatedGetter = org . openmrs . module . webservices . rest . util . ReflectionUtil . findPropertyGetterMethod ( this , propertyName ) ; if ( annotatedGetter != null ) { return annotatedGetter . invoke ( this , instance ) ; } return org . apache . commons . beanutils . PropertyUtils . getProperty ( instance . getUser ( ) , propertyName ) ; } } catch ( java . lang . Exception ex ) { throw new org . openmrs . module . webservices . rest . web . response . ConversionException ( propertyName , ex ) ; } }
|
org . junit . Assert . assertEquals ( "Peds-1a" , valueSet )
|
testAddApplicationContextListener_returnsTrueEvenIfAlreadyAdded ( ) { applicationContext = org . eclipse . rap . rwt . internal . application . ApplicationContextImpl_Test . createApplicationContextSpy ( ) ; applicationContext . activate ( ) ; applicationContext . addApplicationContextListener ( appContextListener ) ; boolean result = applicationContext . addApplicationContextListener ( appContextListener ) ; "<AssertPlaceHolder>" ; } addApplicationContextListener ( org . eclipse . rap . rwt . service . ApplicationContextListener ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( listener , "listener" ) ; boolean result = false ; synchronized ( listenersLock ) { if ( state . get ( ) . equals ( org . eclipse . rap . rwt . internal . application . ApplicationContextImpl . State . ACTIVE ) ) { result = true ; appContextListeners . add ( listener ) ; } } return result ; }
|
org . junit . Assert . assertTrue ( result )
|
testCacheNull ( ) { de . sstoehr . harreader . model . HarEntry entry = new de . sstoehr . harreader . model . HarEntry ( ) ; entry . setCache ( null ) ; "<AssertPlaceHolder>" ; } getCache ( ) { if ( ( cache ) == null ) { cache = new de . sstoehr . harreader . model . HarCache ( ) ; } return cache ; }
|
org . junit . Assert . assertNotNull ( entry . getCache ( ) )
|
contentModifyWithSpaceInTitle ( ) { java . lang . String title = newTitleWithCleanup ( "_Delete<sp>1" ) ; net . sourceforge . jwbf . core . contentRep . SimpleArticle sa = new net . sourceforge . jwbf . core . contentRep . SimpleArticle ( title ) ; java . lang . String text = "test<sp>" + ( random . nextInt ( 1000 ) ) ; sa . setText ( text ) ; bot . writeContent ( sa ) ; java . lang . String resultText = bot . getArticle ( title ) . getText ( ) ; "<AssertPlaceHolder>" ; } getText ( ) { if ( isReload ( net . sourceforge . jwbf . core . contentRep . Article . TEXT_RELOAD ) ) { setReload ( net . sourceforge . jwbf . core . contentRep . Article . TEXT_RELOAD ) ; setText ( read ( ) . getText ( ) ) ; } return sa . getText ( ) ; }
|
org . junit . Assert . assertEquals ( text , resultText )
|
testUpstreamOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t59012449\t.\tN\t<CNV>\t.\t.\tSVTYPE=CNV;END=59012899" ) ; final java . lang . String expected = "1\t59012449\t.\tN\t<CNV>\t.\t.\tEND=59012899;" + ( "SVANN=upstream_gene_variant&structural_variant&coding_transcript_variant|MODIFIER|OMA1|115209|transcript|NM_145243.3|Coding|;" + "SVTYPE=CNV" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testTransitionOutOfBlocking ( ) { final org . statefulj . fsm . Foo stateful = new org . statefulj . fsm . Foo ( ) ; final java . lang . String eventA = "eventA" ; final java . lang . String eventB = "eventB" ; org . statefulj . fsm . model . State < org . statefulj . fsm . Foo > stateA = new org . statefulj . fsm . model . impl . StateImpl < org . statefulj . fsm . Foo > ( "stateA" , false , true ) ; org . statefulj . fsm . model . State < org . statefulj . fsm . Foo > stateB = new org . statefulj . fsm . model . impl . StateImpl < org . statefulj . fsm . Foo > ( "stateB" ) ; stateA . addTransition ( eventB , stateB ) ; java . util . List < org . statefulj . fsm . model . State < org . statefulj . fsm . Foo > > states = new java . util . LinkedList < org . statefulj . fsm . model . State < org . statefulj . fsm . Foo > > ( ) ; states . add ( stateA ) ; states . add ( stateB ) ; org . statefulj . fsm . Persister < org . statefulj . fsm . Foo > persister = new org . statefulj . persistence . memory . MemoryPersisterImpl < org . statefulj . fsm . Foo > ( stateful , states , stateA ) ; final org . statefulj . fsm . FSM < org . statefulj . fsm . Foo > fsm = new org . statefulj . fsm . FSM < org . statefulj . fsm . Foo > ( "TooBusy" , persister ) ; fsm . setRetryAttempts ( 1000 ) ; new java . lang . Thread ( new java . lang . Runnable ( ) { @ org . statefulj . fsm . Override public void run ( ) { try { java . lang . Thread . sleep ( 500 ) ; fsm . onEvent ( stateful , eventB ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } } } ) . start ( ) ; org . statefulj . fsm . model . State < org . statefulj . fsm . Foo > state = fsm . onEvent ( stateful , eventA ) ; "<AssertPlaceHolder>" ; } onEvent ( java . lang . String , java . lang . Object [ ] ) { java . util . ArrayList < java . lang . Object > parmList = new java . util . ArrayList < java . lang . Object > ( java . util . Arrays . asList ( parms ) ) ; java . lang . Object id = parmList . remove ( 0 ) ; return onEvent ( event , id , parmList . toArray ( ) ) ; }
|
org . junit . Assert . assertEquals ( stateB , state )
|
whenMonsterWantWalkToNextCellIfCellNotNull ( ) { ru . bomberman . test . Cell [ ] [ ] gameBoard = new ru . bomberman . test . Cell [ 4 ] [ 4 ] ; for ( int row = 0 ; row < 4 ; row ++ ) { for ( int column = 0 ; column < 4 ; column ++ ) { gameBoard [ row ] [ column ] = new ru . bomberman . test . Cell ( ) ; } } ru . bomberman . test . Monster monster1 = new ru . bomberman . test . Monster ( "M1" , 1 , gameBoard , 0 , 0 ) ; ru . bomberman . test . Monster monster2 = new ru . bomberman . test . Monster ( "M2" , 1 , gameBoard , 0 , 1 ) ; ru . szhernovoy . bomberman . view . GameBoard game = new ru . szhernovoy . bomberman . view . GameBoard ( gameBoard , 2 , 3 ) ; gameBoard [ 0 ] [ 0 ] . setCharacter ( monster1 ) ; gameBoard [ 0 ] [ 1 ] . setCharacter ( monster2 ) ; monster1 . move ( Direction . RIGHT ) ; ru . bomberman . test . AbstractCharacter result = gameBoard [ 0 ] [ 1 ] . getCharacter ( ) ; "<AssertPlaceHolder>" ; } move ( ru . szhernovoy . bomberman . model . Direction ) { }
|
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( ( ( ru . bomberman . test . AbstractCharacter ) ( monster2 ) ) ) )
|
WebDavODataTYPE_ODATA_COLLECTION ( ) { java . lang . String odatacolName = "odataCol" ; java . lang . String webDavColName = "davCol" ; java . lang . String svcColName = "svcCol" ; com . fujitsu . dc . core . model . DavCmp odataCol = com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . newDavCmp ( com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . ODATA_COL_NAME ) ; com . fujitsu . dc . core . model . DavCmp webDavCol = com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . newDavCmp ( com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . WEBDAV_COL_NAME ) ; com . fujitsu . dc . core . model . DavCmp svcCol = com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . newDavCmp ( com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . SVC_COL_NAME ) ; java . util . Map < java . lang . String , com . fujitsu . dc . core . model . DavCmp > odataCols = new java . util . HashMap < java . lang . String , com . fujitsu . dc . core . model . DavCmp > ( ) ; java . util . Map < java . lang . String , com . fujitsu . dc . core . model . DavCmp > webDavCols = new java . util . HashMap < java . lang . String , com . fujitsu . dc . core . model . DavCmp > ( ) ; java . util . Map < java . lang . String , com . fujitsu . dc . core . model . DavCmp > svcCols = new java . util . HashMap < java . lang . String , com . fujitsu . dc . core . model . DavCmp > ( ) ; java . lang . String entryName = "bar/90_contents/davCol/" + odatacolName ; java . lang . String key = "bar/90_contents/davCol/" + odatacolName ; odataCols . put ( key , odataCol ) ; key = "bar/90_contents/" + webDavColName ; webDavCols . put ( key , webDavCol ) ; key = "bar/90_contents/" + svcColName ; svcCols . put ( key , svcCol ) ; java . util . Map < java . lang . String , java . lang . String > davFileMap = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . TestBarRunner testBarRunner = new com . fujitsu . dc . test . unit . core . bar . BarFileContentsTest . TestBarRunner ( ) ; int res = testBarRunner . getEntryType ( entryName , odataCols , webDavCols , svcCols , davFileMap ) ; "<AssertPlaceHolder>" ; } getEntryType ( java . lang . String , java . util . Map , java . util . Map , java . util . Map , java . util . Map ) { if ( odataCols . containsKey ( entryName ) ) { return com . fujitsu . dc . core . bar . BarFileReadRunner . TYPE_ODATA_COLLECTION ; } else if ( webdavCols . containsKey ( entryName ) ) { return com . fujitsu . dc . core . bar . BarFileReadRunner . TYPE_WEBDAV_COLLECTION ; } else if ( serviceCols . containsKey ( entryName ) ) { return com . fujitsu . dc . core . bar . BarFileReadRunner . TYPE_SERVICE_COLLECTION ; } else if ( davFiles . containsKey ( entryName ) ) { return com . fujitsu . dc . core . bar . BarFileReadRunner . TYPE_DAV_FILE ; } for ( java . util . Map . Entry < java . lang . String , com . fujitsu . dc . core . model . DavCmp > entry : odataCols . entrySet ( ) ) { java . lang . String odataColPath = entry . getKey ( ) ; if ( entryName . startsWith ( odataColPath ) ) { return com . fujitsu . dc . core . bar . BarFileReadRunner . TYPE_ODATA_COLLECTION ; } } for ( java . util . Map . Entry < java . lang . String , com . fujitsu . dc . core . model . DavCmp > entry : serviceCols . entrySet ( ) ) { java . lang . String serviceColPath = entry . getKey ( ) ; if ( entryName . startsWith ( serviceColPath ) ) { return com . fujitsu . dc . core . bar . BarFileReadRunner . TYPE_SVC_FILE ; } } return com . fujitsu . dc . core . bar . BarFileReadRunner . TYPE_MISMATCH ; }
|
org . junit . Assert . assertEquals ( 1 , res )
|
oneBelow ( ) { set . set ( 1 ) ; final int ret = set . previousClearBit ( 2 ) ; "<AssertPlaceHolder>" ; } previousClearBit ( int ) { if ( i < 0 ) { if ( i == ( - 1 ) ) return - 1 ; throw new java . lang . IndexOutOfBoundsException ( ( "i=" + i ) ) ; } final long [ ] [ ] [ ] bits = this . bits ; final int aSize = ( bits . length ) - 1 ; int w = i > > ( com . zaxxer . sparsebits . SparseBitSet . SHIFT3 ) ; int w3 = w & ( com . zaxxer . sparsebits . SparseBitSet . MASK3 ) ; int w2 = ( w > > ( com . zaxxer . sparsebits . SparseBitSet . SHIFT2 ) ) & ( com . zaxxer . sparsebits . SparseBitSet . MASK2 ) ; int w1 = w > > ( com . zaxxer . sparsebits . SparseBitSet . SHIFT1 ) ; if ( w1 > aSize ) return i ; w1 = java . lang . Math . min ( w1 , aSize ) ; int w4 = i % ( com . zaxxer . sparsebits . SparseBitSet . LENGTH4 ) ; long word ; long [ ] [ ] a2 ; long [ ] a3 ; for ( ; w1 >= 0 ; -- w1 ) { if ( ( a2 = bits [ w1 ] ) == null ) return ( ( ( ( w1 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT1 ) ) + ( w2 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT2 ) ) ) + w3 ) << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT3 ) ) + w4 ; for ( ; w2 >= 0 ; -- w2 ) { if ( ( a3 = a2 [ w2 ] ) == null ) return ( ( ( ( w1 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT1 ) ) + ( w2 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT2 ) ) ) + w3 ) << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT3 ) ) + w4 ; for ( ; w3 >= 0 ; -- w3 ) { if ( ( word = a3 [ w3 ] ) == 0 ) return ( ( ( ( w1 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT1 ) ) + ( w2 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT2 ) ) ) + w3 ) << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT3 ) ) + w4 ; for ( int bitIdx = w4 ; bitIdx >= 0 ; -- bitIdx ) { if ( ( word & ( 1L << bitIdx ) ) == 0 ) return ( ( ( ( w1 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT1 ) ) + ( w2 << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT2 ) ) ) + w3 ) << ( com . zaxxer . sparsebits . SparseBitSet . SHIFT3 ) ) + bitIdx ; } w4 = com . zaxxer . sparsebits . SparseBitSet . LENGTH4_SIZE ; } w3 = com . zaxxer . sparsebits . SparseBitSet . LENGTH3_SIZE ; } w2 = com . zaxxer . sparsebits . SparseBitSet . LENGTH2_SIZE ; } return - 1 ; }
|
org . junit . Assert . assertEquals ( 2 , ret )
|
basicTest ( ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; eu . dnetlib . iis . common . java . io . JsonStreamWriter < eu . dnetlib . iis . common . avro . Document > writer = new eu . dnetlib . iis . common . java . io . JsonStreamWriter < eu . dnetlib . iis . common . avro . Document > ( eu . dnetlib . iis . common . avro . Document . SCHEMA$ , out ) ; java . util . List < eu . dnetlib . iis . common . avro . Document > documents = eu . dnetlib . iis . common . java . io . DataStoreExamples . getDocument ( ) ; for ( eu . dnetlib . iis . common . avro . Document d : documents ) { writer . write ( d ) ; } writer . close ( ) ; java . lang . String actual = out . toString ( ) ; java . io . Reader in = new java . io . InputStreamReader ( java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( "eu/dnetlib/iis/common/java/io/document.json" ) , "UTF-8" ) ; java . lang . String expected = eu . dnetlib . iis . common . java . io . JsonStreamWriterTest . toString ( in ) ; "<AssertPlaceHolder>" ; } toString ( java . io . Reader ) { java . io . StringWriter writer = new java . io . StringWriter ( ) ; org . apache . commons . io . IOUtils . copy ( in , writer ) ; return writer . toString ( ) . replace ( "\r" , "" ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testIndexPointAll ( ) { org . nd4j . linalg . api . ndarray . INDArray zeros = org . nd4j . linalg . factory . Nd4j . zeros ( 3 , 3 , 3 ) ; org . nd4j . linalg . indexing . INDArrayIndex x = org . nd4j . linalg . indexing . NDArrayIndex . point ( 1 ) ; org . nd4j . linalg . indexing . INDArrayIndex y = org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ; org . nd4j . linalg . indexing . INDArrayIndex z = org . nd4j . linalg . indexing . NDArrayIndex . point ( 1 ) ; org . nd4j . linalg . api . ndarray . INDArray value = org . nd4j . linalg . factory . Nd4j . ones ( 1 , 3 ) ; zeros . put ( new org . nd4j . linalg . indexing . INDArrayIndex [ ] { x , y , z } , value ) ; java . lang . String f1 = "<sp>[[0,00,0,00,0,00]\n" 5 + ( ( ( ( ( ( ( "<sp>[[0,00,0,00,0,00]\n" 4 + "<sp>[0,00,0,00,0,00]]\n" ) + "<sp>[[0,00,1,00,0,00]\n" ) + "<sp>[0,00,1,00,0,00]\n" ) + "<sp>[[0,00,0,00,0,00]\n" 1 ) + "<sp>[[0,00,0,00,0,00]\n" ) + "<sp>[[0,00,0,00,0,00]\n" 4 ) + "<sp>[0,00,0,00,0,00]]]" ) ; java . lang . String f2 = "[[[0.00,0.00,0.00]\n" + ( ( ( ( ( ( ( "<sp>[0.00,0.00,0.00]\n" + "<sp>[0.00,0.00,0.00]]\n" ) + "<sp>[[0,00,0,00,0,00]\n" 3 ) + "<sp>[[0,00,0,00,0,00]\n" 0 ) + "<sp>[0.00,1.00,0.00]]\n" ) + "<sp>[[0.00,0.00,0.00]\n" ) + "<sp>[0.00,0.00,0.00]\n" ) + "<sp>[[0,00,0,00,0,00]\n" 2 ) ; if ( ( ! ( zeros . toString ( ) . equals ( f1 ) ) ) && ( ! ( zeros . toString ( ) . equals ( f2 ) ) ) ) "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder buff = new java . lang . StringBuilder ( "[" ) ; int sz = objects . size ( ) ; int i ; for ( i = 0 ; i < sz ; i ++ ) { java . lang . Object e = objects . get ( i ) ; buff . append ( e ) ; if ( i < ( sz - 1 ) ) buff . append ( "<sp>,<sp>" ) ; } buff . append ( "]" ) ; return buff . toString ( ) ; }
|
org . junit . Assert . assertEquals ( f2 , zeros . toString ( ) )
|
testElements ( ) { permissionCollection . add ( new org . jboss . as . controller . access . permission . ManagementPermissionCollectionTestCase . TestManagementPermission ( Action . ActionEffect . ADDRESS ) ) ; permissionCollection . add ( new org . jboss . as . controller . access . permission . ManagementPermissionCollectionTestCase . TestManagementPermission ( Action . ActionEffect . READ_CONFIG ) ) ; permissionCollection . add ( new org . jboss . as . controller . access . permission . ManagementPermissionCollectionTestCase . TestManagementPermission ( Action . ActionEffect . READ_RUNTIME ) ) ; java . util . Enumeration < java . security . Permission > elements = permissionCollection . elements ( ) ; while ( elements . hasMoreElements ( ) ) { org . jboss . as . controller . access . permission . ManagementPermission permission = ( ( org . jboss . as . controller . access . permission . ManagementPermission ) ( elements . nextElement ( ) ) ) ; org . jboss . as . controller . access . Action . ActionEffect actionEffect = permission . getActionEffect ( ) ; "<AssertPlaceHolder>" ; } } getActionEffect ( ) { return actionEffect ; }
|
org . junit . Assert . assertTrue ( ( ( ( actionEffect == ( Action . ActionEffect . ADDRESS ) ) || ( actionEffect == ( Action . ActionEffect . READ_CONFIG ) ) ) || ( actionEffect == ( Action . ActionEffect . READ_RUNTIME ) ) ) )
|
testConvertToType03 ( ) { javax . el . ELContext context = new javax . el . TesterELContext ( new javax . el . TesterELResolverOne ( ) ) ; javax . el . ValueExpression ve = javax . el . ELManager . getExpressionFactory ( ) . createValueExpression ( context , "2" , java . lang . String . class ) ; java . lang . String result = ( ( java . lang . String ) ( ve . getValue ( context ) ) ) ; "<AssertPlaceHolder>" ; } getValue ( org . apache . el . lang . EvaluationContext ) { java . lang . Object obj = this . children [ 0 ] . getValue ( ctx ) ; if ( obj == null ) { return java . lang . Long . valueOf ( 0 ) ; } if ( obj instanceof java . math . BigDecimal ) { return ( ( java . math . BigDecimal ) ( obj ) ) . negate ( ) ; } if ( obj instanceof java . math . BigInteger ) { return ( ( java . math . BigInteger ) ( obj ) ) . negate ( ) ; } if ( obj instanceof java . lang . String ) { if ( isStringFloat ( ( ( java . lang . String ) ( obj ) ) ) ) { return java . lang . Double . valueOf ( ( - ( java . lang . Double . parseDouble ( ( ( java . lang . String ) ( obj ) ) ) ) ) ) ; } return java . lang . Long . valueOf ( ( - ( java . lang . Long . parseLong ( ( ( java . lang . String ) ( obj ) ) ) ) ) ) ; } if ( obj instanceof java . lang . Long ) { return java . lang . Long . valueOf ( ( - ( ( ( java . lang . Long ) ( obj ) ) . longValue ( ) ) ) ) ; } if ( obj instanceof java . lang . Double ) { return java . lang . Double . valueOf ( ( - ( ( ( java . lang . Double ) ( obj ) ) . doubleValue ( ) ) ) ) ; } if ( obj instanceof java . lang . Integer ) { return java . lang . Integer . valueOf ( ( - ( ( ( java . lang . Integer ) ( obj ) ) . intValue ( ) ) ) ) ; } if ( obj instanceof java . lang . Float ) { return java . lang . Float . valueOf ( ( - ( ( ( java . lang . Float ) ( obj ) ) . floatValue ( ) ) ) ) ; } if ( obj instanceof java . lang . Short ) { return java . lang . Short . valueOf ( ( ( short ) ( - ( ( ( java . lang . Short ) ( obj ) ) . shortValue ( ) ) ) ) ) ; } if ( obj instanceof java . lang . Byte ) { return java . lang . Byte . valueOf ( ( ( byte ) ( - ( ( ( java . lang . Byte ) ( obj ) ) . byteValue ( ) ) ) ) ) ; } java . lang . Long num = ( ( java . lang . Long ) ( coerceToNumber ( ctx , obj , org . apache . el . parser . Long . class ) ) ) ; return java . lang . Long . valueOf ( ( - ( num . longValue ( ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( "2" , result )
|
testClone ( ) { final org . esa . beam . visat . actions . masktools . MagicWandModel model = new org . esa . beam . visat . actions . masktools . MagicWandModel ( ) ; model . setTolerance ( 0.005 ) ; model . setMinTolerance ( 0.0 ) ; model . setMaxTolerance ( 0.01 ) ; model . setNormalize ( true ) ; model . setMode ( MagicWandModel . Mode . PLUS ) ; model . addSpectrum ( 1 , 2 , 3 , 4 , 5 , 6 ) ; model . addSpectrum ( 2 , 3 , 4 , 5 , 6 , 7 ) ; model . setMode ( MagicWandModel . Mode . MINUS ) ; model . addSpectrum ( 3 , 4 , 5 , 6 , 7 , 8 ) ; model . addSpectrum ( 4 , 5 , 6 , 7 , 8 , 9 ) ; final org . esa . beam . visat . actions . masktools . MagicWandModel modelCopy = model . clone ( ) ; "<AssertPlaceHolder>" ; } clone ( ) { try { org . esa . beam . framework . datamodel . ImageInfo imageInfo = ( ( org . esa . beam . framework . datamodel . ImageInfo ) ( super . clone ( ) ) ) ; if ( ( colorPaletteDef ) != null ) { imageInfo . colorPaletteDef = ( ( org . esa . beam . framework . datamodel . ColorPaletteDef ) ( colorPaletteDef . clone ( ) ) ) ; } if ( ( rgbChannelDef ) != null ) { imageInfo . rgbChannelDef = ( ( org . esa . beam . framework . datamodel . RGBChannelDef ) ( rgbChannelDef . clone ( ) ) ) ; } return imageInfo ; } catch ( java . lang . CloneNotSupportedException e ) { throw new java . lang . RuntimeException ( e ) ; } }
|
org . junit . Assert . assertEquals ( model , modelCopy )
|
testMultipleCountDistinct ( ) { sqlText = "select<sp>c2,<sp>count(distinct<sp>c1)<sp>from<sp>t1<sp>group<sp>by<sp>c2<sp>order<sp>by<sp>count(distinct<sp>c2),<sp>c2" ; expected = "C2<sp>|<sp>2<sp>|\n" + ( ( ( "select<sp>count(distinct<sp>c1),<sp>count(distinct<sp>c2)<sp>from<sp>t1" 4 + "NULL<sp>|<sp>0<sp>|\n" ) + "select<sp>count(distinct<sp>c1),<sp>count(distinct<sp>c2)<sp>from<sp>t1" 3 ) + "<sp>10<sp>|<sp>1<sp>|" ) ; rs = methodWatcher . executeQuery ( sqlText ) ; resultString = TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) ; "<AssertPlaceHolder>" ; rs . close ( ) ; } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; }
|
org . junit . Assert . assertEquals ( ( ( ( ( ( ( "select<sp>count(distinct<sp>c1),<sp>count(distinct<sp>c2)<sp>from<sp>t1" 2 + sqlText ) + "select<sp>count(distinct<sp>c1),<sp>count(distinct<sp>c2)<sp>from<sp>t1" 2 ) + "select<sp>count(distinct<sp>c1),<sp>count(distinct<sp>c2)<sp>from<sp>t1" 6 ) + expected ) + "select<sp>count(distinct<sp>c1),<sp>count(distinct<sp>c2)<sp>from<sp>t1" 0 ) + resultString ) , expected , resultString )
|
testGetCompletedTodolistGroupByDateByProject_NullTest2 ( ) { java . util . List < com . onboard . domain . model . Todo > list = new java . util . ArrayList < com . onboard . domain . model . Todo > ( ) ; when ( mockTodoMapper . selectByExample ( any ( com . onboard . domain . mapper . model . TodoExample . class ) ) ) . thenReturn ( list ) ; java . util . TreeMap < java . util . Date , java . util . List < com . onboard . domain . model . Todolist > > retMap = todoService . getCompletedTodolistGroupByDateByProject ( com . onboard . service . collaboration . impl . test . TodoServiceImplTest . id , com . onboard . service . collaboration . impl . test . TodoServiceImplTest . endDate , com . onboard . service . collaboration . impl . test . TodoServiceImplTest . DEFAULT_LIMIT ) ; verify ( mockTodoMapper ) . selectByExample ( any ( com . onboard . domain . mapper . model . TodoExample . class ) ) ; "<AssertPlaceHolder>" ; } getCompletedTodolistGroupByDateByProject ( int , java . util . Date , int ) { com . onboard . domain . model . Todo sample = new com . onboard . domain . model . Todo ( false ) ; sample . setProjectId ( projectId ) ; sample . setStatus ( IterationItemStatus . CLOSED . getValue ( ) ) ; com . onboard . domain . mapper . model . TodoExample example = new com . onboard . domain . mapper . model . TodoExample ( sample ) ; example . getOredCriteria ( ) . get ( 0 ) . andUpdatedLessThanOrEqualTo ( until ) ; example . setOrderByClause ( "updated<sp>desc" ) ; example . setLimit ( limit ) ; java . util . List < com . onboard . domain . model . Todo > originTodos = todoMapper . selectByExample ( example ) ; if ( ( originTodos == null ) || ( ( originTodos . size ( ) ) == 0 ) ) { return null ; } java . util . List < com . onboard . domain . model . Todo > todos = appendTodosOfLastDay ( originTodos , until , example ) ; return getTodolistsGroupByDate ( todos ) ; }
|
org . junit . Assert . assertNull ( retMap )
|
shouldRunCopyJobInTestMode ( ) { final com . google . cloud . bigquery . TableId srcTable = com . google . cloud . bigquery . TableId . of ( "foo" , "bar" , "src" ) ; final com . google . cloud . bigquery . TableId dstTable = com . google . cloud . bigquery . TableId . of ( "foo" , "bar" , "dst" ) ; final com . spotify . flo . Task < com . google . cloud . bigquery . TableId > task = com . spotify . flo . Task . named ( "task" ) . ofType ( com . google . cloud . bigquery . TableId . class ) . operator ( com . spotify . flo . contrib . bigquery . BigQueryOperator . create ( ) ) . process ( ( bq ) -> bq . job ( com . google . cloud . bigquery . JobInfo . of ( com . google . cloud . bigquery . CopyJobConfiguration . of ( dstTable , srcTable ) ) ) . success ( ( response ) -> dstTable ) ) ; try ( com . spotify . flo . TestScope scope = com . spotify . flo . FloTesting . scope ( ) ) { final com . google . cloud . bigquery . TableId result = com . spotify . flo . context . FloRunner . runTask ( task ) . future ( ) . get ( 30 , com . spotify . flo . contrib . bigquery . SECONDS ) ; "<AssertPlaceHolder>" ; } } future ( ) { return future ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( dstTable ) )
|
testGenerateCodeFlowURI ( ) { com . github . jreddit . oauth . param . RedditScopeBuilder builder = new com . github . jreddit . oauth . param . RedditScopeBuilder ( ) ; builder . addScope ( RedditScope . EDIT ) ; java . lang . String url = subject . generateCodeFlowURI ( builder , RedditDuration . PERMANENT ) ; org . apache . commons . validator . routines . UrlValidator urlValidator = new org . apache . commons . validator . routines . UrlValidator ( ) ; "<AssertPlaceHolder>" ; } generateCodeFlowURI ( com . github . jreddit . oauth . param . RedditScopeBuilder , com . github . jreddit . oauth . param . RedditDuration ) { java . util . Map < java . lang . String , java . lang . String > params = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; params . put ( com . github . jreddit . oauth . RedditOAuthAgent . PARAM_CLIENT_ID , redditApp . getClientID ( ) ) ; params . put ( com . github . jreddit . oauth . RedditOAuthAgent . PARAM_RESPONSE_TYPE , "code" ) ; params . put ( com . github . jreddit . oauth . RedditOAuthAgent . PARAM_STATE , java . util . UUID . randomUUID ( ) . toString ( ) ) ; params . put ( com . github . jreddit . oauth . RedditOAuthAgent . PARAM_REDIRECT_URI , redditApp . getRedirectURI ( ) ) ; params . put ( com . github . jreddit . oauth . RedditOAuthAgent . PARAM_DURATION , duration . value ( ) ) ; params . put ( com . github . jreddit . oauth . RedditOAuthAgent . PARAM_SCOPE , scopeBuilder . build ( ) ) ; return ( com . github . jreddit . oauth . RedditOAuthAgent . REDDIT_AUTHORIZE ) + ( com . github . jreddit . request . util . KeyValueFormatter . format ( params , true ) ) ; }
|
org . junit . Assert . assertTrue ( urlValidator . isValid ( url ) )
|
testEDateDecrease ( ) { org . apache . poi . ss . formula . functions . EDate eDate = new org . apache . poi . ss . formula . functions . EDate ( ) ; java . util . Date startDate = new java . util . Date ( ) ; int offset = - 2 ; org . apache . poi . ss . formula . eval . NumberEval result = ( ( org . apache . poi . ss . formula . eval . NumberEval ) ( eDate . evaluate ( new org . apache . poi . ss . formula . eval . ValueEval [ ] { new org . apache . poi . ss . formula . eval . NumberEval ( org . apache . poi . ss . usermodel . DateUtil . getExcelDate ( startDate ) ) , new org . apache . poi . ss . formula . eval . NumberEval ( offset ) } , null ) ) ) ; java . util . Date resultDate = org . apache . poi . ss . usermodel . DateUtil . getJavaDate ( result . getNumberValue ( ) ) ; java . util . Calendar instance = org . apache . poi . util . LocaleUtil . getLocaleCalendar ( ) ; instance . setTime ( startDate ) ; instance . add ( Calendar . MONTH , offset ) ; "<AssertPlaceHolder>" ; } add ( org . apache . poi . hssf . view . brush . JComponent , org . apache . poi . hssf . view . brush . PendingPaintings$Painting ) { org . apache . poi . hssf . view . brush . PendingPaintings pending = org . apache . poi . hssf . view . brush . PendingPaintings . pendingPaintingsFor ( c ) ; if ( pending != null ) { pending . paintings . add ( newPainting ) ; } }
|
org . junit . Assert . assertEquals ( resultDate , instance . getTime ( ) )
|
test_doNowOrToday_TODAY_happyPath_TIMESTAMP ( ) { try { java . util . Date res = liquibase . util . NowAndTodayUtil . doNowOrToday ( "TODAY" , "TIMESTAMP" ) ; "<AssertPlaceHolder>" ; } catch ( liquibase . exception . DateParseException e ) { org . junit . Assert . fail ( ( "Unexpected<sp>exception<sp>running<sp>TIMESTAMP<sp>happy<sp>path<sp>TODAY<sp>test:<sp>" + ( e . getMessage ( ) ) ) ) ; e . printStackTrace ( ) ; } } doNowOrToday ( java . lang . String , java . lang . String ) { if ( ! ( liquibase . util . NowAndTodayUtil . isNowOrTodayFormat ( value ) ) ) { return null ; } java . util . Calendar c = java . util . Calendar . getInstance ( ) ; java . lang . String lowerValue = value . toLowerCase ( ) ; if ( lowerValue . startsWith ( liquibase . util . NowAndTodayUtil . NOW ) ) { liquibase . util . NowAndTodayUtil . parseNow ( value , lowerValue , c ) ; } else if ( lowerValue . startsWith ( liquibase . util . NowAndTodayUtil . TODAY ) ) { liquibase . util . NowAndTodayUtil . parseToday ( value , lowerValue , c ) ; } else { throw new liquibase . exception . DateParseException ( ( ( "Programmer<sp>error:<sp>" + value ) + "<sp>does<sp>not<sp>start<sp>with<sp>'NOW'<sp>or<sp>'TODAY'" ) ) ; } java . util . Date today = c . getTime ( ) ; if ( ( colType == null ) || ( ( colType . length ( ) ) == 0 ) ) { throw new liquibase . exception . DateParseException ( "Must<sp>supply<sp>non-null<sp>column<sp>type<sp>when<sp>using<sp>'NOW'<sp>or<sp>'TODAY'<sp>value." ) ; } else if ( colType . equalsIgnoreCase ( "timestamp" ) ) { return new java . sql . Timestamp ( today . getTime ( ) ) ; } else if ( colType . equalsIgnoreCase ( "time" ) ) { return new java . sql . Time ( today . getTime ( ) ) ; } else if ( ( colType . equalsIgnoreCase ( "date" ) ) || ( colType . equalsIgnoreCase ( "datetime" ) ) ) { return new java . sql . Date ( today . getTime ( ) ) ; } else { throw new liquibase . exception . DateParseException ( ( ( "Unrecognized<sp>colType<sp>" + colType ) + "<sp>when<sp>using<sp>'NOW'<sp>or<sp>'TODAY'<sp>value;<sp>expected<sp>one<sp>of<sp>date,<sp>time,<sp>datetime,<sp>or<sp>timestamp" ) ) ; } }
|
org . junit . Assert . assertTrue ( ( res instanceof java . sql . Timestamp ) )
|
shouldPassWithNoRules ( ) { org . neo4j . server . preflight . PreFlightTasks check = new org . neo4j . server . preflight . PreFlightTasks ( org . neo4j . logging . NullLogProvider . getInstance ( ) ) ; "<AssertPlaceHolder>" ; } run ( ) { try { startSignal . countDown ( ) ; startSignal . await ( ) ; checkPointing . forceCheckPoint ( org . neo4j . kernel . impl . transaction . log . checkpoint . CheckPointerImplTest . INFO ) ; completed . countDown ( ) ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } }
|
org . junit . Assert . assertTrue ( check . run ( ) )
|
setsJavaArgs ( ) { final java . lang . String result = forkingExecutor . javaArgs ( "-Dfoo=bar" ) . execute ( ( ) -> java . lang . System . getProperty ( "foo" ) ) ; "<AssertPlaceHolder>" ; } execute ( com . spotify . flo . Fn ) { try ( final com . spotify . flo . context . ForkingExecutor . Execution < T > execution = new com . spotify . flo . context . ForkingExecutor . Execution ( f ) ) { executions . add ( execution ) ; execution . start ( ) ; return execution . waitFor ( ) ; } }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( "bar" ) )
|
testArrayDeserialization ( ) { com . owlike . genson . Genson genson = createTimestampGenson ( java . time . LocalDate . class , TimestampFormat . ARRAY , londonZoneId ) ; java . time . LocalDate dt = java . time . LocalDate . of ( 2011 , 1 , 31 ) ; java . lang . String json = "[2011,<sp>1,<sp>31]" ; "<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 ( dt , genson . deserialize ( json , java . time . LocalDate . class ) )
|
testCalculateOverlapsAndReduce ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ; org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( builder ) ; org . openscience . cdk . interfaces . IAtomContainer Molecule1 = sp . parseSmiles ( "O1C=CC=C1" ) ; org . openscience . cdk . interfaces . IAtomContainer Molecule2 = sp . parseSmiles ( "C1CCCC1" ) ; org . openscience . smsd . algorithm . rgraph . CDKRMapHandler instance = new org . openscience . smsd . algorithm . rgraph . CDKRMapHandler ( ) ; instance . calculateOverlapsAndReduce ( Molecule1 , Molecule2 , true , false , false ) ; "<AssertPlaceHolder>" ; } getMappings ( ) { return mappings ; }
|
org . junit . Assert . assertNotNull ( instance . getMappings ( ) . size ( ) )
|
extractInterpolationVariablesNoVariables ( ) { java . lang . String string = "foo<sp>bar<sp>baz" ; java . util . Collection < org . drools . workbench . models . datamodel . rule . InterpolationVariable > interpolationVariables = org . optaplanner . workbench . models . datamodel . util . TemplateUtils . extractInterpolationVariables ( string ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return belowThreshold ? list . isEmpty ( ) : set . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( interpolationVariables . isEmpty ( ) )
|
whenCallExtractSimpleQueryParamWithEmptyString ( ) { java . util . Map < java . lang . String , com . stratio . explorer . notebook . form . Input > params = com . stratio . explorer . notebook . form . Input . extractSimpleQueryParam ( ScriptTypes . EMPTY ) ; "<AssertPlaceHolder>" ; } extractSimpleQueryParam ( java . lang . String ) { java . util . Map < java . lang . String , com . stratio . explorer . notebook . form . Input > params = new java . util . HashMap < java . lang . String , com . stratio . explorer . notebook . form . Input > ( ) ; if ( script == null ) return params ; java . lang . String replaced = script ; java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( "([_])?[$][{]([^=}]*([=][^}]*)?)[}]" ) ; java . util . regex . Matcher match = pattern . matcher ( replaced ) ; while ( match . find ( ) ) { java . lang . String hiddenPart = match . group ( 1 ) ; boolean hidden = false ; if ( "_" . equals ( hiddenPart ) ) { hidden = true ; } java . lang . String m = match . group ( 2 ) ; java . lang . String namePart ; java . lang . String valuePart ; int p = m . indexOf ( '=' ) ; if ( p > 0 ) { namePart = m . substring ( 0 , p ) ; valuePart = m . substring ( ( p + 1 ) ) ; } else { namePart = m ; valuePart = null ; } java . lang . String varName ; java . lang . String displayName = null ; java . lang . String type = null ; java . lang . String defaultValue = "" ; com . stratio . explorer . notebook . form . Input . ParamOption [ ] paramOptions = null ; java . lang . String varNamePart ; java . lang . String [ ] typeArray = com . stratio . explorer . notebook . form . Input . getType ( namePart ) ; if ( typeArray != null ) { type = typeArray [ 0 ] ; varNamePart = typeArray [ 1 ] ; } else { varNamePart = namePart ; } java . lang . String [ ] varNameArray = com . stratio . explorer . notebook . form . Input . getNameAndDisplayName ( varNamePart ) ; if ( varNameArray != null ) { varName = varNameArray [ 0 ] ; displayName = varNameArray [ 1 ] ; } else { varName = varNamePart . trim ( ) ; } if ( valuePart != null ) { int optionP = valuePart . indexOf ( "," ) ; if ( optionP > 0 ) { defaultValue = valuePart . substring ( 0 , optionP ) ; java . lang . String optionPart = valuePart . substring ( ( optionP + 1 ) ) ; java . lang . String [ ] options = com . stratio . explorer . notebook . form . Input . splitPipe ( optionPart ) ; paramOptions = new com . stratio . explorer . notebook . form . Input . ParamOption [ options . length ] ; for ( int i = 0 ; i < ( options . length ) ; i ++ ) { java . lang . String [ ] optNameArray = com . stratio . explorer . notebook . form . Input . getNameAndDisplayName ( options [ i ] ) ; if ( optNameArray != null ) { paramOptions [ i ] = new com . stratio . explorer . notebook . form . Input . ParamOption ( optNameArray [ 0 ] , optNameArray [ 1 ] ) ; } else { paramOptions [ i ] = new com . stratio . explorer . notebook . form . Input . ParamOption ( options [ i ] , null ) ; } } } else { defaultValue = valuePart ; } } com . stratio . explorer . notebook . form . Input param = new com . stratio . explorer . notebook . form . Input ( varName , displayName , type , defaultValue , paramOptions , hidden ) ; params . put ( varName , param ) ; } params . remove ( "pql" ) ; return params ; }
|
org . junit . Assert . assertTrue ( params . isEmpty ( ) )
|
shouldGenerateIsNullPredicate ( ) { java . lang . String lhs = uniqueString ( ) ; java . lang . String actual = annis . sqlgen . SqlConstraints . isNull ( lhs ) ; java . lang . String expected = lhs + "<sp>IS<sp>NULL" ; "<AssertPlaceHolder>" ; } isNull ( java . lang . String ) { return lhs + "<sp>IS<sp>NULL" ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testGetClouderaDirectorIdTagName ( ) { com . cloudera . director . aws . shaded . com . typesafe . config . Config config = com . cloudera . director . aws . shaded . com . typesafe . config . ConfigFactory . parseMap ( com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > builder ( ) . put ( Tags . ResourceTags . CLOUDERA_DIRECTOR_ID . getTagKey ( ) , "foo" ) . build ( ) ) ; com . cloudera . director . aws . CustomTagMappings customTagMappings = new com . cloudera . director . aws . CustomTagMappings ( config ) ; "<AssertPlaceHolder>" ; } getClouderaDirectorIdTagName ( ) { return getCustomTagName ( Tags . ResourceTags . CLOUDERA_DIRECTOR_ID . getTagKey ( ) ) ; }
|
org . junit . Assert . assertEquals ( "foo" , customTagMappings . getClouderaDirectorIdTagName ( ) )
|
testFindByPrimaryKeyExisting ( ) { com . liferay . friendly . url . model . FriendlyURLEntry newFriendlyURLEntry = addFriendlyURLEntry ( ) ; com . liferay . friendly . url . model . FriendlyURLEntry existingFriendlyURLEntry = _persistence . findByPrimaryKey ( newFriendlyURLEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertEquals ( existingFriendlyURLEntry , newFriendlyURLEntry )
|
testCreateDatabaseType ( ) { "<AssertPlaceHolder>" ; } createDatabaseType ( ) { return new org . pentaho . platform . plugin . services . importexport . exportManifest . bindings . DatabaseType ( ) ; }
|
org . junit . Assert . assertNotNull ( factory . createDatabaseType ( ) )
|
testInsertGetStorage_policyTable ( ) { org . smartdata . model . StoragePolicy storagePolicy = new org . smartdata . model . StoragePolicy ( ( ( byte ) ( 1 ) ) , "pName" ) ; storagePolicyDao . insertStoragePolicyTable ( storagePolicy ) ; "<AssertPlaceHolder>" ; if ( ( ! ( storagePolicyDao . isExist ( "pName" ) ) ) || ( ! ( storagePolicyDao . isExist ( 1 ) ) ) ) { throw new java . lang . Exception ( "isExist()<sp>error" ) ; } if ( ( storagePolicyDao . getStoragePolicyName ( 1 ) ) != "pName" ) { throw new java . lang . Exception ( "getStoragePolicyName()<sp>error" ) ; } if ( ( storagePolicyDao . getStorageSid ( "pName" ) ) != 1 ) { throw new java . lang . Exception ( "getStorageSid()<sp>error" ) ; } storagePolicyDao . getStoragePolicyIdNameMap ( ) ; storagePolicyDao . deleteStoragePolicy ( "pName" ) ; if ( storagePolicyDao . isExist ( "pName" ) ) { throw new java . lang . Exception ( "deleteStoragePolicy()<sp>error" ) ; } } getStoragePolicyName ( int ) { updateCache ( ) ; try { return mapStoragePolicyIdName . get ( sid ) ; } catch ( org . springframework . dao . EmptyResultDataAccessException e ) { return null ; } catch ( java . lang . Exception e ) { throw new org . smartdata . metastore . MetaStoreException ( e ) ; } }
|
org . junit . Assert . assertTrue ( storagePolicyDao . getStoragePolicyName ( 1 ) . equals ( "pName" ) )
|
shouldResetCreationTimeWithRunnerStatusIsStopped ( ) { runner . setStatus ( Runner . Status . STOPPED ) ; runner . resetCreationTime ( ) ; "<AssertPlaceHolder>" ; } getCreationTime ( ) { return org . eclipse . che . ide . ext . runner . client . models . RunnerImpl . DATE_TIME_FORMAT . format ( new java . util . Date ( creationTime ) ) ; }
|
org . junit . Assert . assertThat ( runner . getCreationTime ( ) , org . hamcrest . CoreMatchers . equalTo ( org . eclipse . che . ide . ext . runner . client . models . RunnerImpl . DATE_TIME_FORMAT . format ( new java . util . Date ( java . lang . System . currentTimeMillis ( ) ) ) ) )
|
checkNonExitingResource ( ) { java . lang . String uri = "http://localhost/dummy" ; boolean isStatementExist = testStoreManager . isStatementExist ( f . createIRI ( uri ) , null , null ) ; "<AssertPlaceHolder>" ; } isStatementExist ( org . eclipse . rdf4j . model . Resource , org . eclipse . rdf4j . model . IRI , org . eclipse . rdf4j . model . Value ) { try ( org . eclipse . rdf4j . repository . RepositoryConnection conn = getRepositoryConnection ( ) ) { nl . dtls . fairdatapoint . repository . impl . StoreManagerImpl . LOGGER . info ( "Check<sp>if<sp>statements<sp>exists" ) ; return conn . hasStatement ( rsrc , pred , value , false ) ; } catch ( org . eclipse . rdf4j . repository . RepositoryException e ) { throw new nl . dtls . fairdatapoint . repository . StoreManagerException ( ( "Error<sp>check<sp>statement<sp>existence<sp>:" + ( e . getMessage ( ) ) ) ) ; } }
|
org . junit . Assert . assertFalse ( isStatementExist )
|
testNullValuesSkipped ( ) { beans = com . google . common . collect . ImmutableList . of ( new com . cloudera . csd . validation . constraints . components . UniqueFieldValidatorImplTest . TestBean ( null , "b" ) , new com . cloudera . csd . validation . constraints . components . UniqueFieldValidatorImplTest . TestBean ( null , "b" ) ) ; doNothing ( ) . when ( validator ) . addViolation ( eq ( context ) , anyString ( ) ) ; validator . initialize ( getAnnotation ( "beans" ) ) ; "<AssertPlaceHolder>" ; verify ( validator , never ( ) ) . addViolation ( eq ( context ) , anyString ( ) ) ; } isValid ( java . lang . String , javax . validation . ConstraintValidatorContext ) { if ( ( null == nameForCrossEntityAggregate ) || ( nameForCrossEntityAggregate . isEmpty ( ) ) ) { return true ; } return com . cloudera . csd . validation . monitoring . MonitoringConventions . isValidMetricNameFormat ( nameForCrossEntityAggregate ) ; }
|
org . junit . Assert . assertTrue ( validator . isValid ( beans , context ) )
|
getPeople_shouldNotGetVoided ( ) { java . util . List < org . openmrs . Person > people = hibernatePersonDAO . getPeople ( "" , false , false ) ; logPeople ( people ) ; for ( org . openmrs . Person p : people ) "<AssertPlaceHolder>" ; } getVoided ( ) { return voided ; }
|
org . junit . Assert . assertFalse ( p . getVoided ( ) )
|
getCountShouldBeMinus1WhenEmpty ( ) { "<AssertPlaceHolder>" ; } getCount ( ) { return results . length ; }
|
org . junit . Assert . assertEquals ( ( - 1 ) , adapter . getCount ( ) )
|
testParseValueForDatabaseWriteNoSyn ( ) { java . lang . Long expected = new java . lang . Long ( 123 ) ; java . lang . Object result = parser . parseValueForDatabaseWrite ( "123" ) ; "<AssertPlaceHolder>" ; } parseValueForDatabaseWrite ( java . lang . String ) { if ( Boolean . TRUE . toString ( ) . equalsIgnoreCase ( value ) ) { return Boolean . TRUE ; } else if ( Boolean . FALSE . toString ( ) . equalsIgnoreCase ( value ) ) { return Boolean . FALSE ; } throw new java . lang . IllegalArgumentException ( ( "Not<sp>a<sp>boolean:<sp>" + value ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testDecreasingSteps ( ) { double previousError = Double . NaN ; for ( int i = 0 ; i < 10 ; ++ i ) { double step = org . hipparchus . util . FastMath . pow ( 2.0 , ( - ( i + 1 ) ) ) ; double error = ( integrateWithSpecifiedStep ( 4.0 , 0.0 , 1.0 , step ) ) - ( org . hipparchus . util . FastMath . sin ( 4.0 ) ) ; if ( i > 0 ) { "<AssertPlaceHolder>" ; } previousError = error ; } } abs ( int ) { final int i = x > > > 31 ; return ( x ^ ( ( ~ i ) + 1 ) ) + i ; }
|
org . junit . Assert . assertTrue ( ( ( org . hipparchus . util . FastMath . abs ( error ) ) < ( org . hipparchus . util . FastMath . abs ( previousError ) ) ) )
|
proxyConfigOverWritesRegistryConfig ( ) { org . openqa . grid . internal . Registry registry = org . openqa . grid . internal . Registry . newInstance ( ) ; registry . getConfiguration ( ) . getAllParams ( ) . put ( "A" , "A1" ) ; org . openqa . grid . common . RegistrationRequest req = org . openqa . grid . common . RegistrationRequest . build ( "-role" , "webdriver" , "-A" , "A2" , "-host" , "localhost" ) ; req . getConfiguration ( ) . put ( RegistrationRequest . PROXY_CLASS , null ) ; org . openqa . grid . internal . RemoteProxy p = org . openqa . grid . internal . BaseRemoteProxy . getNewInstance ( req , registry ) ; "<AssertPlaceHolder>" ; } getConfig ( ) { return config ; }
|
org . junit . Assert . assertEquals ( "A2" , p . getConfig ( ) . get ( "A" ) )
|
testGetEXISTS ( ) { java . lang . String actual = table . getEXISTS ( ) ; java . lang . String expected = "exists" ; "<AssertPlaceHolder>" ; } getEXISTS ( ) { return "exists" ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
equalsItself ( ) { com . mpatric . mp3agic . ID3v2ChapterTOCFrameData frameData = new com . mpatric . mp3agic . ID3v2ChapterTOCFrameData ( false , true , false , "toc1" , new java . lang . String [ ] { "ch1" , "ch2" } ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( frameData , frameData )
|
shouldReturnSubstitutedValuesWithNesting ( ) { com . github . resource4j . ResourceKey bundle = com . github . resource4j . ResourceKey . bundle ( "test.bundle" ) ; com . github . resource4j . ResourceKey key1 = bundle . child ( "value1" ) ; com . github . resource4j . ResourceKey key2 = bundle . child ( "value2" ) ; com . github . resource4j . ResourceKey key3 = bundle . child ( "value3" ) ; java . lang . String value = "OK" ; repository . put ( key1 , withoutContext ( ) , value ) ; repository . put ( key2 , withoutContext ( ) , ref ( key1 ) ) ; repository . put ( key3 , withoutContext ( ) , ref ( key2 ) ) ; com . github . resource4j . OptionalString result = resources . get ( key3 , withoutContext ( ) ) ; "<AssertPlaceHolder>" ; } asIs ( ) { return value ; }
|
org . junit . Assert . assertEquals ( value , result . asIs ( ) )
|
testLastUpdatedNoFolderId ( ) { java . lang . String tableName = "testSyncStateNoFolderId" ; com . ripariandata . timberwolf . writer . hbase . IHBaseTable hbaseTable = mockTable ( manager , tableName ) ; java . lang . String userName = "Robert<sp>the<sp>User" ; java . lang . String folderId = "ExistingAAFolderAA" ; final java . lang . String state = "ExistingFolderState" ; hbaseTable . put ( statePut ( userName , folderId , state ) ) ; hbaseTable . flush ( ) ; com . ripariandata . timberwolf . writer . hbase . HBaseUserFolderSyncStateStorage updates = new com . ripariandata . timberwolf . writer . hbase . HBaseUserFolderSyncStateStorage ( manager , tableName ) ; java . lang . String retrievedState = updates . getLastSyncState ( userName , "NonExistingAAFolderAA" ) ; "<AssertPlaceHolder>" ; } getLastSyncState ( java . lang . String , java . lang . String ) { java . util . Map < java . lang . String , java . lang . String > folders = syncStates . get ( user ) ; if ( folders == null ) { return null ; } return folders . get ( folderId ) ; }
|
org . junit . Assert . assertEquals ( null , retrievedState )
|
test ( ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; net . unit8 . wscl . dto . ResourceRequest req = new net . unit8 . wscl . dto . ResourceRequest ( "hoge" ) ; java . util . UUID uuid = java . util . UUID . randomUUID ( ) ; req . setClassLoaderId ( uuid ) ; org . fressian . FressianWriter fw = new org . fressian . FressianWriter ( baos , new org . fressian . handlers . ILookup < java . lang . Class , java . util . Map < java . lang . String , org . fressian . handlers . WriteHandler > > ( ) { @ net . unit8 . wscl . handler . Override public java . util . Map < java . lang . String , org . fressian . handlers . WriteHandler > valAt ( java . lang . Class key ) { if ( key . equals ( net . unit8 . wscl . dto . ResourceRequest . class ) ) { return net . unit8 . wscl . util . FressianUtils . map ( net . unit8 . wscl . dto . ResourceRequest . class . getName ( ) , new net . unit8 . wscl . handler . ResourceRequestWriteHandler ( ) ) ; } else { return null ; } } } ) ; fw . writeObject ( req ) ; org . fressian . FressianReader fr = new org . fressian . FressianReader ( new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) , new org . fressian . handlers . ILookup < java . lang . Object , org . fressian . handlers . ReadHandler > ( ) { @ net . unit8 . wscl . handler . Override public org . fressian . handlers . ReadHandler valAt ( java . lang . Object key ) { if ( key . equals ( net . unit8 . wscl . dto . ResourceRequest . class . getName ( ) ) ) return new net . unit8 . wscl . handler . ResourceRequestReadHandler ( ) ; else return null ; } } ) ; net . unit8 . wscl . dto . ResourceRequest restoredReq = ( ( net . unit8 . wscl . dto . ResourceRequest ) ( fr . readObject ( ) ) ) ; "<AssertPlaceHolder>" ; } getClassLoaderId ( ) { return classLoaderId ; }
|
org . junit . Assert . assertEquals ( uuid , restoredReq . getClassLoaderId ( ) )
|
testGetHostName ( ) { final java . lang . String hostName = org . apache . commons . lang3 . SystemUtils . getHostName ( ) ; final java . lang . String expected = ( org . apache . commons . lang3 . SystemUtils . IS_OS_WINDOWS ) ? java . lang . System . getenv ( "COMPUTERNAME" ) : java . lang . System . getenv ( "HOSTNAME" ) ; "<AssertPlaceHolder>" ; } getHostName ( ) { return org . apache . commons . lang3 . SystemUtils . IS_OS_WINDOWS ? java . lang . System . getenv ( "COMPUTERNAME" ) : java . lang . System . getenv ( "HOSTNAME" ) ; }
|
org . junit . Assert . assertEquals ( expected , hostName )
|
testGetTrustBundles_exceptionInQuery_assertException ( ) { final javax . persistence . EntityManager manager = mock ( javax . persistence . EntityManager . class ) ; doThrow ( new java . lang . RuntimeException ( "Just<sp>Passing<sp>Through" ) ) . when ( manager ) . createQuery ( ( ( java . lang . String ) ( any ( ) ) ) ) ; final org . nhindirect . config . store . dao . impl . TrustBundleDaoImpl dao = new org . nhindirect . config . store . dao . impl . TrustBundleDaoImpl ( ) ; dao . setEntityManager ( manager ) ; boolean exceptionOccured = false ; try { dao . getTrustBundles ( ) ; } catch ( org . nhindirect . config . store . ConfigurationStoreException ex ) { exceptionOccured = true ; } "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( exceptionOccured )
|
testPut_withEnumField ( ) { com . dotweblabs . twirl . object . EntityEnum entityEnum = new com . dotweblabs . twirl . object . EntityEnum ( ) ; entityEnum . setTestEnum ( EntityEnum . TestEnum . ONE ) ; store . put ( entityEnum ) ; com . dotweblabs . twirl . object . EntityEnum saved = store . get ( com . dotweblabs . twirl . object . EntityEnum . class , entityEnum . getId ( ) ) ; "<AssertPlaceHolder>" ; } getTestEnum ( ) { return testEnum ; }
|
org . junit . Assert . assertEquals ( EntityEnum . TestEnum . ONE , saved . getTestEnum ( ) )
|
testExec ( ) { ch . rgw . tools . JdbcLink link = new ch . rgw . tools . JdbcLink ( "org.h2.Driver" , "jdbc:h2:mem:test_mem" , "" ) ; link . connect ( "" , "" ) ; int rows = link . exec ( "" ) ; "<AssertPlaceHolder>" ; link . disconnect ( ) ; } exec ( java . lang . String ) { return jdbcLink . exec ( sql ) ; }
|
org . junit . Assert . assertEquals ( 0 , rows )
|
testSetItemCount_disposeInReverseOrder ( ) { final java . util . List < java . lang . String > log = new java . util . ArrayList < java . lang . String > ( ) ; org . eclipse . nebula . widgets . grid . GridTestUtil . createGridItems ( grid , 5 , 0 ) ; for ( org . eclipse . nebula . widgets . grid . GridItem item : grid . getItems ( ) ) { item . addDisposeListener ( new org . eclipse . swt . events . DisposeListener ( ) { @ org . eclipse . nebula . widgets . grid . Override public void widgetDisposed ( org . eclipse . swt . events . DisposeEvent event ) { org . eclipse . nebula . widgets . grid . GridItem item = ( ( org . eclipse . nebula . widgets . grid . GridItem ) ( event . getSource ( ) ) ) ; log . add ( item . getText ( ) ) ; } } ) ; } grid . setItemCount ( 0 ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "root_4" , "root_3" , "root_2" , "root_1" , "root_0" } ; "<AssertPlaceHolder>" ; } toArray ( java . lang . Object [ ] ) { int size = wrappedSet . size ( ) ; org . eclipse . jface . internal . databinding . viewers . ViewerElementWrapper [ ] wrappedArray = ( ( org . eclipse . jface . internal . databinding . viewers . ViewerElementWrapper [ ] ) ( wrappedSet . toArray ( new org . eclipse . jface . internal . databinding . viewers . ViewerElementWrapper [ size ] ) ) ) ; java . lang . Object [ ] result = a ; if ( ( a . length ) < size ) { result = ( ( java . lang . Object [ ] ) ( java . lang . reflect . Array . newInstance ( a . getClass ( ) . getComponentType ( ) , size ) ) ) ; } for ( int i = 0 ; i < size ; i ++ ) result [ i ] = wrappedArray [ i ] . unwrap ( ) ; return result ; }
|
org . junit . Assert . assertArrayEquals ( expected , log . toArray ( new java . lang . String [ 0 ] ) )
|
testGetPerson ( ) { log . debug ( "testing<sp>get..." ) ; final java . lang . Long id = 7L ; final org . appfuse . tutorial . model . Person person = new org . appfuse . tutorial . model . Person ( ) ; given ( dao . get ( id ) ) . willReturn ( person ) ; org . appfuse . tutorial . model . Person result = manager . get ( id ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertSame ( person , result )
|
downloadVideo ( ) { org . restlet . resource . ClientResource client = new org . restlet . resource . ClientResource ( com . buddycloud . mediaserver . download . DownloadVideoTest . URL ) ; client . setChallengeResponse ( ChallengeScheme . HTTP_BASIC , com . buddycloud . mediaserver . download . BASE_USER , com . buddycloud . mediaserver . download . BASE_TOKEN ) ; java . io . File file = new java . io . File ( ( ( ( com . buddycloud . mediaserver . download . DownloadVideoTest . TEST_OUTPUT_DIR ) + ( java . io . File . separator ) ) + "downloaded.avi" ) ) ; java . io . FileOutputStream outputStream = org . apache . commons . io . FileUtils . openOutputStream ( file ) ; client . get ( ) . write ( outputStream ) ; outputStream . close ( ) ; "<AssertPlaceHolder>" ; org . apache . commons . io . FileUtils . deleteDirectory ( new java . io . File ( com . buddycloud . mediaserver . download . DownloadVideoTest . TEST_OUTPUT_DIR ) ) ; } write ( java . io . OutputStream ) { outputStream . write ( fileData ) ; }
|
org . junit . Assert . assertTrue ( file . exists ( ) )
|
testDatesInFutureRejected ( ) { final dk . dma . ais . filter . FutureFilter f = new dk . dma . ais . filter . FutureFilter ( ) ; java . lang . String ais = "$PGHP,1,2014,12,28,19,10,22,760,207,,,1,39*2A\r\n!ABVDM,1,1,,B,16vdSv00001ukHBHCo;MOh0R0<0i,0*39" ; dk . dma . ais . packet . AisPacket p = dk . dma . ais . packet . AisPacket . readFromString ( ais ) ; System . out . println ( "Date" ) ; System . out . println ( new java . util . Date ( p . getBestTimestamp ( ) ) ) ; "<AssertPlaceHolder>" ; } rejectedByFilter ( dk . dma . ais . packet . AisPacket ) { return ( ( packet . getBestTimestamp ( ) ) + ( threshold ) ) < ( java . lang . System . currentTimeMillis ( ) ) ; }
|
org . junit . Assert . assertTrue ( f . rejectedByFilter ( p ) )
|
test ( ) { java . lang . String url = wbean . buildUrl ( RESTBeanForTest . ROOT , RESTBeanForTest . CALLBACK_MISSING_TASKUUID_PATH ) ; final java . lang . String hi = "hello" ; restf . asyncJsonPost ( url , hi , new org . zstack . header . rest . JsonAsyncRESTCallback < java . lang . String > ( null ) { @ org . zstack . test . core . rest . Override public void fail ( org . zstack . header . errorcode . ErrorCode err ) { logger . error ( java . lang . String . format ( "fail:<sp>%s" , err ) ) ; if ( SysErrors . TIMEOUT . toString ( ) . equals ( err . getCode ( ) ) ) { success = true ; } else { success = false ; } latch . countDown ( ) ; } @ org . zstack . test . core . rest . Override public void success ( java . lang . String ret ) { logger . error ( java . lang . String . format ( "received<sp>%s<sp>that<sp>should<sp>not<sp>receive" , ret ) ) ; success = false ; latch . countDown ( ) ; } @ org . zstack . test . core . rest . Override public java . lang . Class < java . lang . String > getReturnClass ( ) { return java . lang . String . class ; } } , TimeUnit . SECONDS , 5 ) ; latch . await ( 1 , TimeUnit . MINUTES ) ; "<AssertPlaceHolder>" ; } getReturnClass ( ) { return java . lang . String . class ; }
|
org . junit . Assert . assertTrue ( success )
|
testExecutionColumnsWithNullCell ( ) { java . lang . String ddl = "CREATE<sp>FOREIGN<sp>TABLE<sp>Sheet1<sp>(\n" + ( ( "\tcolumn1<sp>string<sp>OPTIONS<sp>(SEARCHABLE<sp>\'Unsearchable\',<sp>\"teiid_excel:CELL_NUMBER\"<sp>\'1\'),\n" + "\tcolumn2<sp>string<sp>OPTIONS<sp>(SEARCHABLE<sp>\'Unsearchable\',<sp>\"teiid_excel:CELL_NUMBER\"<sp>\'2\')\n" ) + ")<sp>OPTIONS<sp>(\"teiid_excel:FILE\"<sp>\'3219.xlsx\');" ) ; org . teiid . file . VirtualFileConnection connection = org . mockito . Mockito . mock ( org . teiid . file . VirtualFileConnection . class ) ; org . mockito . Mockito . stub ( connection . getFiles ( "3219.xlsx" ) ) . toReturn ( org . teiid . file . JavaVirtualFile . getFiles ( "3219.xlsx" , new java . io . File ( org . teiid . core . util . UnitTestUtil . getTestDataPath ( ) , "3219.xlsx" ) ) ) ; java . util . ArrayList results = org . teiid . translator . excel . TestExcelExecution . helpExecute ( ddl , connection , "select<sp>*<sp>from<sp>Sheet1" ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; }
|
org . junit . Assert . assertEquals ( results . size ( ) , 7 )
|
iteratorRemove ( ) { int count = ( view1 . size ( ) ) - 1 ; for ( java . util . Iterator < ? > i = view1 . iterator ( ) ; i . hasNext ( ) ; count -- ) { i . next ( ) ; i . remove ( ) ; "<AssertPlaceHolder>" ; } } size ( ) { return size ; }
|
org . junit . Assert . assertEquals ( count , view1 . size ( ) )
|
testGetOptionalChannels ( ) { System . out . println ( "Testing<sp>RoundRobinChannelSelector.getOptionalChannels" ) ; channelSelector . configure ( context ) ; "<AssertPlaceHolder>" ; } getOptionalChannels ( org . apache . flume . Event ) { com . telefonica . iot . cygnus . channelselectors . RoundRobinChannelSelector . LOGGER . debug ( "Returning<sp>empty<sp>optional<sp>channels" ) ; return new java . util . ArrayList < org . apache . flume . Channel > ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , channelSelector . getOptionalChannels ( event ) . size ( ) )
|
testIsTargetUserPrivate_1 ( ) { org . jinstagram . entity . relationships . RelationshipData fixture = new org . jinstagram . entity . relationships . RelationshipData ( ) ; fixture . setIncomingStatus ( "" ) ; fixture . setOutgoingStatus ( "" ) ; fixture . setTargetUserPrivate ( true ) ; boolean result = fixture . isTargetUserPrivate ( ) ; "<AssertPlaceHolder>" ; } isTargetUserPrivate ( ) { return targetUserPrivate ; }
|
org . junit . Assert . assertEquals ( true , result )
|
listenerAlreadyCanceledTest ( ) { org . threadly . concurrent . future . ListenableFuture < ? > lf = makeListenableFutureFactory ( ) . makeCanceled ( ) ; org . threadly . test . concurrent . TestRunnable tr = new org . threadly . test . concurrent . TestRunnable ( ) ; lf . listener ( tr ) ; lf . listener ( tr , org . threadly . concurrent . SameThreadSubmitterExecutor . instance ( ) ) ; lf . listener ( tr , org . threadly . concurrent . SameThreadSubmitterExecutor . instance ( ) , ListenableFuture . ListenerOptimizationStrategy . SingleThreadIfExecutorMatchOrDone ) ; "<AssertPlaceHolder>" ; } getRunCount ( ) { return runCount . get ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , tr . getRunCount ( ) )
|
testSimpleShutdown ( ) { org . mobicents . tools . sip . balancer . EventListener failureEventListener = new org . mobicents . tools . sip . balancer . EventListener ( ) { boolean once = false ; @ org . mobicents . tools . sip . balancer . operation . Override public synchronized void uasAfterResponse ( int statusCode , org . mobicents . tools . sip . balancer . AppServer source ) { if ( ! ( once ) ) { once = true ; System . out . println ( ( "HERE<sp>" + ( once ) ) ) ; } } @ org . mobicents . tools . sip . balancer . operation . Override public void uasAfterRequestReceived ( java . lang . String method , org . mobicents . tools . sip . balancer . AppServer source ) { } @ org . mobicents . tools . sip . balancer . operation . Override public void uacAfterRequestSent ( java . lang . String method , org . mobicents . tools . sip . balancer . AppServer source ) { } @ org . mobicents . tools . sip . balancer . operation . Override public void uacAfterResponse ( int statusCode , org . mobicents . tools . sip . balancer . AppServer source ) { } } ; for ( org . mobicents . tools . sip . balancer . AppServer as : servers ) as . setEventListener ( failureEventListener ) ; shootist . callerSendsBye = true ; shootist . sendInitialInvite ( ) ; java . lang . Thread . sleep ( 12000 ) ; "<AssertPlaceHolder>" ; } getNodes ( ) { return new java . util . LinkedList < org . mobicents . tools . heartbeat . api . Node > ( balancerContext . aliveNodes ) ; }
|
org . junit . Assert . assertEquals ( 1 , balancer . getNodes ( ) . size ( ) )
|
testRegisterDuplicateViewName ( ) { final java . lang . String plainSQL = InProcessViewSupportTestData . masterChildSql ; net . sf . jsqlparser . statement . select . SelectBody select = org . geotools . arcsde . data . ViewRegisteringFactoryHelper . parseSqlQuery ( plainSQL ) ; store . registerView ( InProcessViewSupportTestData . typeName , ( ( net . sf . jsqlparser . statement . select . PlainSelect ) ( select ) ) ) ; try { store . registerView ( InProcessViewSupportTestData . typeName , ( ( net . sf . jsqlparser . statement . select . PlainSelect ) ( select ) ) ) ; org . junit . Assert . fail ( "Expected<sp>IAE<sp>on<sp>duplicate<sp>view<sp>name" ) ; } catch ( java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } registerView ( java . lang . String , net . sf . jsqlparser . statement . select . PlainSelect ) { if ( typeName == null ) throw new java . lang . NullPointerException ( "typeName" ) ; if ( select == null ) throw new java . lang . NullPointerException ( "select" ) ; if ( java . util . Arrays . asList ( getTypeNames ( ) ) . contains ( typeName ) ) { throw new java . lang . IllegalArgumentException ( ( typeName + "<sp>already<sp>exists<sp>as<sp>a<sp>FeatureType" ) ) ; } verifyQueryIsSupported ( select ) ; final org . geotools . arcsde . session . ISession session = getSession ( Transaction . AUTO_COMMIT ) ; try { final net . sf . jsqlparser . statement . select . PlainSelect qualifiedSelect = org . geotools . arcsde . data . view . SelectQualifier . qualify ( session , select ) ; final com . esri . sde . sdk . client . SeQueryInfo queryInfo ; try { org . geotools . arcsde . data . ArcSDEDataStore . LOGGER . fine ( "creating<sp>definition<sp>query<sp>info" ) ; queryInfo = org . geotools . arcsde . data . view . QueryInfoParser . parse ( session , qualifiedSelect ) ; } catch ( com . esri . sde . sdk . client . SeException e ) { throw new org . geotools . arcsde . ArcSdeException ( ( "Error<sp>Parsing<sp>select:<sp>" + qualifiedSelect ) , e ) ; } org . geotools . arcsde . data . FeatureTypeInfo typeInfo = org . geotools . arcsde . data . ArcSDEAdapter . createInprocessViewSchema ( session , typeName , typeInfoCache . getNamesapceURI ( ) , qualifiedSelect , queryInfo ) ; typeInfoCache . addInprocessViewInfo ( typeInfo ) ; } finally { session . dispose ( ) ; } }
|
org . junit . Assert . assertTrue ( true )
|
doubleValueFunctionToComparator ( ) { com . gs . collections . api . list . MutableList < java . lang . Double > list = com . gs . collections . impl . list . mutable . FastList . newListWith ( 5.0 , 4.0 , 3.0 , 2.0 , 1.0 ) . shuffleThis ( ) ; com . gs . collections . api . block . function . Function < java . lang . Double , java . lang . Double > function = Double :: doubleValue ; list . sortThis ( com . gs . collections . impl . block . factory . Comparators . byFunction ( function ) ) ; "<AssertPlaceHolder>" ; } byFunction ( com . gs . collections . api . block . function . Function ) { if ( function instanceof com . gs . collections . api . block . function . primitive . BooleanFunction ) { return com . gs . collections . impl . block . factory . Functions . toBooleanComparator ( ( ( com . gs . collections . api . block . function . primitive . BooleanFunction < T > ) ( function ) ) ) ; } if ( function instanceof com . gs . collections . api . block . function . primitive . ByteFunction ) { return com . gs . collections . impl . block . factory . Functions . toByteComparator ( ( ( com . gs . collections . api . block . function . primitive . ByteFunction < T > ) ( function ) ) ) ; } if ( function instanceof com . gs . collections . api . block . function . primitive . CharFunction ) { return com . gs . collections . impl . block . factory . Functions . toCharComparator ( ( ( com . gs . collections . api . block . function . primitive . CharFunction < T > ) ( function ) ) ) ; } if ( function instanceof com . gs . collections . api . block . function . primitive . DoubleFunction ) { return com . gs . collections . impl . block . factory . Functions . toDoubleComparator ( ( ( com . gs . collections . api . block . function . primitive . DoubleFunction < T > ) ( function ) ) ) ; } if ( function instanceof com . gs . collections . api . block . function . primitive . FloatFunction ) { return com . gs . collections . impl . block . factory . Functions . toFloatComparator ( ( ( com . gs . collections . api . block . function . primitive . FloatFunction < T > ) ( function ) ) ) ; } if ( function instanceof com . gs . collections . api . block . function . primitive . IntFunction ) { return com . gs . collections . impl . block . factory . Functions . toIntComparator ( ( ( com . gs . collections . api . block . function . primitive . IntFunction < T > ) ( function ) ) ) ; } if ( function instanceof com . gs . collections . api . block . function . primitive . LongFunction ) { return com . gs . collections . impl . block . factory . Functions . toLongComparator ( ( ( com . gs . collections . api . block . function . primitive . LongFunction < T > ) ( function ) ) ) ; } if ( function instanceof com . gs . collections . api . block . function . primitive . ShortFunction ) { return com . gs . collections . impl . block . factory . Functions . toShortComparator ( ( ( com . gs . collections . api . block . function . primitive . ShortFunction < T > ) ( function ) ) ) ; } return com . gs . collections . impl . block . factory . Comparators . byFunction ( function , com . gs . collections . impl . block . factory . Comparators . naturalOrder ( ) ) ; }
|
org . junit . Assert . assertEquals ( com . gs . collections . impl . list . mutable . FastList . newListWith ( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ) , list )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.