input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testWindowIdAhead ( ) { long first = 1431714014123L ; int ahead = 678 ; for ( int windowWidthMillis : new int [ ] { 500 , 123 } ) { long window1 = com . datatorrent . stram . engine . WindowGenerator . getWindowId ( first , first , windowWidthMillis ) ; long window2 = com . datatorrent . stram . engine . WindowGenerator . getAheadWindowId ( window1 , first , windowWidthMillis , ahead ) ; for ( int i = 0 ; i < ahead ; i ++ ) { window1 = com . datatorrent . stram . engine . WindowGenerator . getNextWindowId ( window1 , first , windowWidthMillis ) ; } "<AssertPlaceHolder>" ; } } getNextWindowId ( long , long , long ) { return com . datatorrent . stram . engine . WindowGenerator . getAheadWindowId ( windowId , firstWindowMillis , windowWidthMillis , 1 ) ; }
|
org . junit . Assert . assertEquals ( window2 , window1 )
|
is_still_scheduled_should_be_false ( ) { doReturn ( new java . util . ArrayList < org . quartz . Trigger > ( ) ) . when ( scheduler ) . getTriggersOfJob ( any ( org . quartz . JobKey . class ) ) ; final boolean stillScheduled = quartzSchedulerExecutor . isStillScheduled ( org . bonitasoft . engine . scheduler . impl . QuartzSchedulerExecutorTest . GROUP_NAME , org . bonitasoft . engine . scheduler . impl . QuartzSchedulerExecutorTest . JOB_NAME ) ; "<AssertPlaceHolder>" . as ( "should<sp>return<sp>false" ) . isFalse ( ) ; } isStillScheduled ( java . lang . String , java . lang . String ) { boolean stillScheduled = false ; try { final java . util . List < ? extends org . quartz . Trigger > triggers = scheduler . getTriggersOfJob ( new org . quartz . JobKey ( jobName , groupName ) ) ; for ( final org . quartz . Trigger trigger : triggers ) { if ( ( trigger . getNextFireTime ( ) ) != null ) { stillScheduled = true ; } } return stillScheduled ; } catch ( final org . quartz . SchedulerException e ) { throw new org . bonitasoft . engine . scheduler . exception . SSchedulerException ( e ) ; } }
|
org . junit . Assert . assertThat ( stillScheduled )
|
testRuleRef ( ) { java . lang . String grammar = "grammar<sp>T;\n" + ( ( ( ( ( ( "s\n" + "@init<sp>{setBuildParseTree(true);}\n" ) + "@after<sp>{System.out.println($r.ctx.toStringTree(this));}\n" ) + "s\n" 2 ) + "a<sp>:<sp>b<sp>\'x\'\n" ) + "s\n" 0 ) + "b<sp>:<sp>\'y\'<sp>;\n" ) ; java . lang . String result = execParser ( "T.g4" , grammar , "TParser" , "s\n" 1 , "s\n" 3 , "yx" , false ) ; java . lang . String expecting = "(a<sp>(b<sp>y)<sp>x)\n" ; "<AssertPlaceHolder>" ; } execParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { return execParser ( grammarFileName , grammarStr , parserName , lexerName , startRuleName , input , debug , false ) ; }
|
org . junit . Assert . assertEquals ( expecting , result )
|
testBRY9901DrieDubbeleID ( ) { nl . bzk . brp . business . dto . bijhouding . AbstractBijhoudingsBericht simplegGeboorteBericht = maakSimpleInschrijvingBericht2 ( ) ; nl . bzk . brp . model . bericht . kern . FamilierechtelijkeBetrekkingBericht famBericht = ( ( nl . bzk . brp . model . bericht . kern . FamilierechtelijkeBetrekkingBericht ) ( simplegGeboorteBericht . getAdministratieveHandeling ( ) . getActies ( ) . get ( 0 ) . getRootObjecten ( ) . get ( 0 ) ) ) ; nl . bzk . brp . model . bericht . kern . PersoonBericht kind = famBericht . getKindBetrokkenheid ( ) . getPersoon ( ) ; java . util . Iterator < nl . bzk . brp . model . bericht . kern . OuderBericht > it = famBericht . getOuderBetrokkenheden ( ) . iterator ( ) ; nl . bzk . brp . model . bericht . kern . PersoonBericht ouder1 = it . next ( ) . getPersoon ( ) ; nl . bzk . brp . model . bericht . kern . PersoonBericht ouder2 = it . next ( ) . getPersoon ( ) ; ouder1 . setCommunicatieID ( kind . getCommunicatieID ( ) ) ; ouder2 . setCommunicatieID ( kind . getCommunicatieID ( ) ) ; nl . bzk . brp . business . util . BerichtAdministratieUtil . verrijktBerichtMetIdentificeerbaarObjectIndex ( simplegGeboorteBericht ) ; java . util . List < nl . bzk . brp . model . validatie . Melding > meldingen = bedrijfsregel . executeer ( simplegGeboorteBericht ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , meldingen . size ( ) )
|
ThirdTest ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testFrozenColumn ( ) { sheet = spreadsheet . getBook ( ) . getSheet ( "column" ) ; "<AssertPlaceHolder>" ; } getColumnFreeze ( ) { return getNative ( ) . getViewInfo ( ) . getNumOfColumnFreeze ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , sheet . getColumnFreeze ( ) )
|
testLimitMiddleAll ( ) { try ( net . sf . eclipsefp . haskell . util . CappedStringWriter w = new net . sf . eclipsefp . haskell . util . CappedStringWriter ( 2 ) ) { w . write ( "toto" ) ; w . write ( "titi" ) ; "<AssertPlaceHolder>" ; } } toString ( ) { return getDisplayName ( ) ; }
|
org . junit . Assert . assertEquals ( "" , w . toString ( ) )
|
testSetToRelease ( ) { com . ebay . jetstream . event . channel . kafka . PartitionReaderTest . reader . setToRelease ( ) ; "<AssertPlaceHolder>" ; } isTaken ( ) { return m_taken . get ( ) ; }
|
org . junit . Assert . assertFalse ( com . ebay . jetstream . event . channel . kafka . PartitionReaderTest . reader . isTaken ( ) )
|
getByName ( ) { for ( org . bukkit . WorldType worldType : org . bukkit . WorldType . values ( ) ) { "<AssertPlaceHolder>" ; } } getByName ( java . lang . String ) { return org . bukkit . WorldType . BY_NAME . get ( name . toUpperCase ( ) ) ; }
|
org . junit . Assert . assertThat ( org . bukkit . WorldType . getByName ( worldType . getName ( ) ) , org . hamcrest . CoreMatchers . is ( worldType ) )
|
testGetTalendJobJavaProject ( ) { boolean enbleMavenNature = false ; org . talend . core . runtime . process . ITalendProcessJavaProject talendJavaProject = org . talend . designer . runprocess . java . TalendJavaProjectManager . getTalendJobJavaProject ( property , enbleMavenNature ) ; validateProject ( talendJavaProject , enbleMavenNature ) ; java . lang . String projectTechName = ( ( ( ( org . talend . repository . ProjectManager . getInstance ( ) . getCurrentProject ( ) . getTechnicalLabel ( ) ) + "_" ) + ( property . getLabel ( ) . toUpperCase ( ) ) ) + "_" ) + ( property . getVersion ( ) ) ; "<AssertPlaceHolder>" ; } getProject ( ) { return getJavaProject ( ) . getProject ( ) ; }
|
org . junit . Assert . assertEquals ( projectTechName , talendJavaProject . getProject ( ) . getName ( ) )
|
testEquals ( ) { org . jfree . data . time . Month m1 = new org . jfree . data . time . Month ( org . jfree . chart . date . MonthConstants . MAY , 2002 ) ; org . jfree . data . time . Month m2 = new org . jfree . data . time . Month ( org . jfree . chart . date . MonthConstants . MAY , 2002 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( m1 , m2 )
|
testGetForeground_onVirtual_resolvesItem ( ) { grid = new org . eclipse . nebula . widgets . grid . Grid ( shell , org . eclipse . swt . SWT . VIRTUAL ) ; grid . setItemCount ( 1 ) ; org . eclipse . nebula . widgets . grid . GridItem item = grid . getItem ( 0 ) ; item . getForeground ( ) ; "<AssertPlaceHolder>" ; } isResolved ( ) { return parent . isVirtual ( ) ? ( data ) != null : true ; }
|
org . junit . Assert . assertTrue ( item . isResolved ( ) )
|
bar ( ) { org . eclim . test . junit . run . Foo foo = new org . eclim . test . junit . run . Foo ( ) ; "<AssertPlaceHolder>" ; } bar ( ) { org . eclim . test . junit . run . Foo foo = new org . eclim . test . junit . run . Foo ( ) ; org . junit . Assert . assertEquals ( 42 , foo . bar ( ) ) ; }
|
org . junit . Assert . assertEquals ( 42 , foo . bar ( ) )
|
testPredict ( ) { logger . info ( "testPredict" ) ; com . datumbox . framework . common . Configuration configuration = getConfiguration ( ) ; com . datumbox . framework . core . common . dataobjects . Dataframe [ ] data = com . datumbox . framework . core . Datasets . carsCategorical ( configuration ) ; com . datumbox . framework . core . common . dataobjects . Dataframe trainingData = data [ 0 ] ; com . datumbox . framework . core . common . dataobjects . Dataframe validationData = data [ 1 ] ; java . lang . String storageName = this . getClass ( ) . getSimpleName ( ) ; com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler . TrainingParameters nsParams = new com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler . TrainingParameters ( ) ; com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler numericalScaler = com . datumbox . framework . core . machinelearning . MLBuilder . create ( nsParams , configuration ) ; numericalScaler . fit_transform ( trainingData ) ; numericalScaler . save ( storageName ) ; com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder . TrainingParameters ceParams = new com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder . TrainingParameters ( ) ; com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder categoricalEncoder = com . datumbox . framework . core . machinelearning . MLBuilder . create ( ceParams , configuration ) ; categoricalEncoder . fit_transform ( trainingData ) ; categoricalEncoder . save ( storageName ) ; com . datumbox . framework . core . machinelearning . ensemblelearning . BootstrapAggregating . TrainingParameters param = new com . datumbox . framework . core . machinelearning . ensemblelearning . BootstrapAggregating . TrainingParameters ( ) ; param . setMaxWeakClassifiers ( 5 ) ; com . datumbox . framework . core . machinelearning . classification . MultinomialNaiveBayes . TrainingParameters trainingParameters = new com . datumbox . framework . core . machinelearning . classification . MultinomialNaiveBayes . TrainingParameters ( ) ; trainingParameters . setMultiProbabilityWeighted ( true ) ; param . setWeakClassifierTrainingParameters ( trainingParameters ) ; com . datumbox . framework . core . machinelearning . ensemblelearning . BootstrapAggregating instance = com . datumbox . framework . core . machinelearning . MLBuilder . create ( param , configuration ) ; instance . fit ( trainingData ) ; instance . save ( storageName ) ; trainingData . close ( ) ; instance . close ( ) ; numericalScaler . close ( ) ; categoricalEncoder . close ( ) ; numericalScaler = com . datumbox . framework . core . machinelearning . MLBuilder . load ( com . datumbox . framework . core . machinelearning . preprocessing . MinMaxScaler . class , storageName , configuration ) ; categoricalEncoder = com . datumbox . framework . core . machinelearning . MLBuilder . load ( com . datumbox . framework . core . machinelearning . preprocessing . OneHotEncoder . class , storageName , configuration ) ; instance = com . datumbox . framework . core . machinelearning . MLBuilder . load ( com . datumbox . framework . core . machinelearning . ensemblelearning . BootstrapAggregating . class , storageName , configuration ) ; numericalScaler . transform ( validationData ) ; categoricalEncoder . transform ( validationData ) ; instance . predict ( validationData ) ; java . util . Map < java . lang . Integer , java . lang . Object > expResult = new java . util . HashMap ( ) ; java . util . Map < java . lang . Integer , java . lang . Object > result = new java . util . HashMap ( ) ; for ( Map . Entry < java . lang . Integer , com . datumbox . framework . core . common . dataobjects . Record > e : validationData . entries ( ) ) { java . lang . Integer rId = e . getKey ( ) ; com . datumbox . framework . core . common . dataobjects . Record r = e . getValue ( ) ; expResult . put ( rId , r . getY ( ) ) ; result . put ( rId , r . getYPredicted ( ) ) ; } "<AssertPlaceHolder>" ; numericalScaler . delete ( ) ; categoricalEncoder . delete ( ) ; instance . delete ( ) ; validationData . close ( ) ; } getYPredicted ( ) { return yPredicted ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
shouldReturnThatHasNoDomain ( ) { com . openshift . client . utils . DomainTestUtils . destroyAllDomains ( user ) ; java . lang . Boolean hasDomain = user . hasDomain ( ) ; "<AssertPlaceHolder>" ; } hasDomain ( ) { return ( api . getDomains ( ) . size ( ) ) > 0 ; }
|
org . junit . Assert . assertFalse ( hasDomain )
|
testEmpty3 ( ) { final org . eclipse . kapua . client . gateway . Topic topic = org . eclipse . kapua . client . gateway . Topic . of ( ( ( java . lang . String ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } of ( java . util . List ) { if ( ( segments == null ) || ( segments . isEmpty ( ) ) ) { return null ; } segments . forEach ( org . eclipse . kapua . client . gateway . Topic :: ensureNotSpecial ) ; return new org . eclipse . kapua . client . gateway . Topic ( new java . util . ArrayList ( segments ) ) ; }
|
org . junit . Assert . assertNull ( topic )
|
hasTextualContextTypeWithXmlContentTypeShouldReturnTrue ( ) { subject . setContenttype ( "application/xml;<sp>charset:<sp>UTF-8" ) ; "<AssertPlaceHolder>" ; } hasTextualRequestContent ( ) { return ( this . hasContenttype ( ) ) && ( isTextualContentType ( this . contenttype ) ) ; }
|
org . junit . Assert . assertThat ( subject . hasTextualRequestContent ( ) , org . hamcrest . CoreMatchers . is ( true ) )
|
deveObterCnpjComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroDados retornoConsultaCadastroDados = new com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroDados ( ) ; retornoConsultaCadastroDados . setCnpj ( "28087726000122" ) ; "<AssertPlaceHolder>" ; } getCnpj ( ) { return this . cnpj ; }
|
org . junit . Assert . assertEquals ( "28087726000122" , retornoConsultaCadastroDados . getCnpj ( ) )
|
testCompareToEquals ( ) { org . bff . javampd . MPDItem item1 = new org . bff . javampd . album . MPDAlbum ( "Album1" , "Artist1" ) ; org . bff . javampd . MPDItem item2 = new org . bff . javampd . album . MPDAlbum ( "Album1" , "Artist1" ) ; "<AssertPlaceHolder>" ; } compareTo ( org . bff . javampd . MPDItem ) { org . bff . javampd . song . MPDSong song = ( ( org . bff . javampd . song . MPDSong ) ( item ) ) ; java . lang . StringBuilder sb ; sb = new java . lang . StringBuilder ( getName ( ) ) ; sb . append ( ( ( getAlbumName ( ) ) == null ? "" : getAlbumName ( ) ) ) ; sb . append ( org . bff . javampd . song . MPDSong . formatToComparableString ( getTrack ( ) ) ) ; java . lang . String thisSong = sb . toString ( ) ; sb = new java . lang . StringBuilder ( song . getName ( ) ) ; sb . append ( ( ( song . getAlbumName ( ) ) == null ? "" : song . getAlbumName ( ) ) ) ; sb . append ( org . bff . javampd . song . MPDSong . formatToComparableString ( song . getTrack ( ) ) ) ; java . lang . String songToCompare = sb . toString ( ) ; return thisSong . compareTo ( songToCompare ) ; }
|
org . junit . Assert . assertTrue ( ( ( item1 . compareTo ( item2 ) ) == 0 ) )
|
resolveTermWhenTermIdIsNullReturnsNull ( ) { final org . phenotips . vocabulary . VocabularyTerm term = this . vocabularyManager . resolveTerm ( null ) ; "<AssertPlaceHolder>" ; } resolveTerm ( java . lang . String ) { org . phenotips . vocabulary . VocabularyTerm term = this . vm . resolveTerm ( termId ) ; if ( term == null ) { return javax . ws . rs . core . Response . status ( Response . Status . NOT_FOUND ) . build ( ) ; } org . json . JSONObject rep = term . toJSON ( ) ; rep . put ( "links" , this . autolinker . get ( ) . forResource ( getClass ( ) , this . uriInfo ) . withExtraParameters ( "vocabulary-id" , term . getVocabulary ( ) . getIdentifier ( ) ) . build ( ) ) ; return javax . ws . rs . core . Response . ok ( rep , MediaType . APPLICATION_JSON_TYPE ) . build ( ) ; }
|
org . junit . Assert . assertNull ( term )
|
testPriorityQueueXorMapped ( ) { int [ ] array1 = new int [ ] { 1232 , 3324 , 123 , 43243 , 1322 , 7897 , 8767 } ; int [ ] array2 = new int [ ] { 39173 , 39174 , 39175 , 39176 , 39177 , 39178 , 39179 } ; int [ ] array3 = new int [ ] { 1232 , 3324 , 123 , 43243 , 1322 , 7897 , 8767 , 39173 , 39174 , 39175 , 39176 , 39177 , 39178 , 39179 } ; org . roaringbitmap . buffer . ImmutableRoaringBitmap data1 = org . roaringbitmap . buffer . TestFastAggregation . toMapped ( org . roaringbitmap . buffer . MutableRoaringBitmap . bitmapOf ( array1 ) ) ; org . roaringbitmap . buffer . ImmutableRoaringBitmap data2 = org . roaringbitmap . buffer . TestFastAggregation . toMapped ( org . roaringbitmap . buffer . MutableRoaringBitmap . bitmapOf ( array2 ) ) ; org . roaringbitmap . buffer . ImmutableRoaringBitmap data3 = org . roaringbitmap . buffer . TestFastAggregation . toMapped ( org . roaringbitmap . buffer . MutableRoaringBitmap . bitmapOf ( array3 ) ) ; "<AssertPlaceHolder>" ; org . roaringbitmap . buffer . BufferFastAggregation . priorityqueue_xor ( data1 ) ; } bitmapOf ( int [ ] ) { final org . roaringbitmap . buffer . MutableRoaringBitmap ans = new org . roaringbitmap . buffer . MutableRoaringBitmap ( ) ; ans . add ( dat ) ; return ans ; }
|
org . junit . Assert . assertEquals ( data3 , org . roaringbitmap . buffer . BufferFastAggregation . priorityqueue_xor ( data1 , data2 ) )
|
testBigEntryPoint ( ) { com . orientechnologies . orient . core . metadata . schema . OSchema schema = com . orientechnologies . orient . graph . sql . OMatchStatementExecutionTest . db . getMetadata ( ) . getSchema ( ) ; schema . createClass ( "testBigEntryPoint1" ) ; schema . createClass ( "testBigEntryPoint2" ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { com . orientechnologies . orient . core . record . impl . ODocument doc = com . orientechnologies . orient . graph . sql . OMatchStatementExecutionTest . db . newInstance ( "testBigEntryPoint1" ) ; doc . field ( "a" , i ) ; doc . save ( ) ; } com . orientechnologies . orient . core . record . impl . ODocument doc = com . orientechnologies . orient . graph . sql . OMatchStatementExecutionTest . db . newInstance ( "testBigEntryPoint2" ) ; doc . field ( "b" , "b" ) ; doc . save ( ) ; java . util . List < com . orientechnologies . orient . core . record . impl . ODocument > qResult = com . orientechnologies . orient . graph . sql . OMatchStatementExecutionTest . db . command ( new com . orientechnologies . orient . core . sql . OCommandSQL ( "MATCH<sp>{class:<sp>testBigEntryPoint1,<sp>as:<sp>a},<sp>{class:<sp>testBigEntryPoint2,<sp>as:<sp>b}<sp>return<sp>$elements<sp>limit<sp>1" ) ) . execute ( ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented<sp>yet" ) ; }
|
org . junit . Assert . assertEquals ( 1 , qResult . size ( ) )
|
isDefined_A$ ( ) { java . lang . String value = "vvv" ; com . m3 . scalaflavor4j . Some < java . lang . String > target = new com . m3 . scalaflavor4j . Some < java . lang . String > ( value ) ; boolean actual = target . isDefined ( ) ; boolean expected = true ; "<AssertPlaceHolder>" ; } isDefined ( ) { return false ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testDynAnyTypeCode ( ) { java . lang . String msg ; org . omg . CORBA . TypeCode tc = null ; org . omg . DynamicAny . DynStruct dynAny = null ; tc = orb . create_exception_tc ( org . jacorb . test . orb . dynany . DynAnyEmptyExTest . ID , org . jacorb . test . orb . dynany . DynAnyEmptyExTest . NAME , org . jacorb . test . orb . dynany . DynAnyEmptyExTest . MEMBERS ) ; dynAny = createDynAnyFromTypeCode ( tc ) ; msg = "Incorrect<sp>TypeCode<sp>retrieved<sp>from<sp>DynAny::type<sp>operation" ; "<AssertPlaceHolder>" ; } type ( ) { if ( ( org . jacorb . test . bugs . bug532 . ByteSequenceHelper . __typeCode ) == null ) { org . jacorb . test . bugs . bug532 . ByteSequenceHelper . __typeCode = org . jacorb . test . bugs . bug532 . org . omg . CORBA . ORB . init ( ) . get_primitive_tc ( org . omg . CORBA . TCKind . tk_octet ) ; org . jacorb . test . bugs . bug532 . ByteSequenceHelper . __typeCode = org . jacorb . test . bugs . bug532 . org . omg . CORBA . ORB . init ( ) . create_sequence_tc ( 0 , org . jacorb . test . bugs . bug532 . ByteSequenceHelper . __typeCode ) ; org . jacorb . test . bugs . bug532 . ByteSequenceHelper . __typeCode = org . jacorb . test . bugs . bug532 . org . omg . CORBA . ORB . init ( ) . create_alias_tc ( org . jacorb . test . bugs . bug532 . ByteSequenceHelper . id ( ) , "ByteSequence" , org . jacorb . test . bugs . bug532 . ByteSequenceHelper . __typeCode ) ; } return org . jacorb . test . bugs . bug532 . ByteSequenceHelper . __typeCode ; }
|
org . junit . Assert . assertTrue ( msg , dynAny . type ( ) . equal ( tc ) )
|
testEOFExceptionOnDeserializeEdit ( ) { RepositoryRecordSchema . REPOSITORY_RECORD_SCHEMA_V1 . writeTo ( dataOutputStream ) ; java . io . DataInputStream dataInputStream = createDataInputStream ( ) ; schemaRepositoryRecordSerde . readHeader ( dataInputStream ) ; org . apache . nifi . controller . repository . RepositoryRecord repositoryRecord = schemaRepositoryRecordSerde . deserializeRecord ( dataInputStream , 2 ) ; "<AssertPlaceHolder>" ; dataInputStream = createDataInputStream ( ) ; schemaRepositoryRecordSerde . readHeader ( dataInputStream ) ; try { schemaRepositoryRecordSerde . deserializeEdit ( dataInputStream , new java . util . HashMap ( ) , 2 ) ; org . junit . Assert . fail ( "Expected<sp>EOFException" ) ; } catch ( final java . io . EOFException eof ) { } } deserializeRecord ( java . io . DataInputStream , int ) { if ( ( externalRecords ) != null ) { final org . wali . DummyRecord record = externalRecords . poll ( ) ; if ( record != null ) { return record ; } externalRecords = null ; } final int recordLocationIndicator = in . read ( ) ; if ( recordLocationIndicator == ( org . wali . DummyRecordSerde . EXTERNAL_FILE_INDICATOR ) ) { final java . lang . String externalFilename = in . readUTF ( ) ; final java . io . File externalFile = new java . io . File ( externalFilename ) ; try ( final java . io . InputStream fis = new java . io . FileInputStream ( externalFile ) ; final java . io . InputStream bufferedIn = new java . io . BufferedInputStream ( fis ) ; final java . io . DataInputStream dis = new java . io . DataInputStream ( bufferedIn ) ) { externalRecords = new java . util . concurrent . LinkedBlockingQueue ( ) ; org . wali . DummyRecord record ; while ( ( record = deserializeRecordInline ( dis , version , true ) ) != null ) { externalRecords . offer ( record ) ; } return externalRecords . poll ( ) ; } } else if ( recordLocationIndicator == ( org . wali . DummyRecordSerde . INLINE_RECORD_INDICATOR ) ) { return deserializeRecordInline ( in , version , false ) ; } else { throw new java . io . IOException ( ( "Encountered<sp>invalid<sp>record<sp>location<sp>indicator:<sp>" + recordLocationIndicator ) ) ; } }
|
org . junit . Assert . assertNull ( repositoryRecord )
|
testSumDeltaMinusDeltaSum ( ) { final int ulps = 3 ; for ( int i = 0 ; i < ( org . apache . commons . math3 . special . BetaTest . SUM_DELTA_MINUS_DELTA_SUM_REF . length ) ; i ++ ) { final double [ ] ref = org . apache . commons . math3 . special . BetaTest . SUM_DELTA_MINUS_DELTA_SUM_REF [ i ] ; final double a = ref [ 0 ] ; final double b = ref [ 1 ] ; final double expected = ref [ 2 ] ; final double actual = org . apache . commons . math3 . special . BetaTest . sumDeltaMinusDeltaSum ( a , b ) ; final double tol = ulps * ( org . apache . commons . math3 . util . FastMath . ulp ( expected ) ) ; final java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; builder . append ( a ) . append ( ",<sp>" ) . append ( b ) ; "<AssertPlaceHolder>" ; } } toString ( ) { java . lang . String repst = "OP_INSTANCE:\n" ; repst += ( ( ( ( ( ( this . getOperationApplied ( ) ) + ":(" ) + ( this . original . getClass ( ) . getCanonicalName ( ) ) ) + ")<sp>`" ) + ( fr . inria . astor . util . StringUtil . trunc ( this . original ) ) ) + "<sp>`<sp>-topatch--><sp>`" ) + ( fr . inria . astor . util . StringUtil . trunc ( modified ) ) ; repst += ( "`<sp>(" + ( ( this . modified ) != null ? this . modified . getClass ( ) . getCanonicalName ( ) : "null" ) ) + ")<sp>" ; return repst ; }
|
org . junit . Assert . assertEquals ( builder . toString ( ) , expected , actual , tol )
|
shouldThrowExceptionWhenAddingNullKeyToCache ( ) { try { uk . gov . gchq . gaffer . cache . impl . JcsCacheTest . cache . put ( null , 2 ) ; org . junit . Assert . fail ( "Expected<sp>an<sp>exception" ) ; } catch ( final uk . gov . gchq . gaffer . cache . exception . CacheOperationException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( ( ( super . getMessage ( ) ) + "<sp>in<sp>string<sp>\'" ) + ( this . visibility ) ) + "\'<sp>at<sp>position<sp>" ) + ( super . getErrorOffset ( ) ) ; }
|
org . junit . Assert . assertNotNull ( e . getMessage ( ) )
|
testGetItems_By_Index_Mocked ( ) { java . util . List < mmarquee . automation . AutomationElement > result = new java . util . ArrayList ( ) ; result . add ( new mmarquee . automation . AutomationElement ( listElement ) ) ; when ( element . findAll ( any ( mmarquee . automation . uiautomation . TreeScope . class ) , any ( com . sun . jna . ptr . PointerByReference . class ) ) ) . thenReturn ( result ) ; mmarquee . automation . controls . AutomationList list = new mmarquee . automation . controls . AutomationList ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( selection ) ) ; mmarquee . automation . controls . AutomationListItem item = list . getItem ( 0 ) ; "<AssertPlaceHolder>" ; } getItem ( java . util . regex . Pattern ) { java . util . List < mmarquee . automation . controls . Element > collection ; mmarquee . automation . controls . Element foundElement = null ; collection = this . findAll ( new mmarquee . uiautomation . TreeScope ( mmarquee . uiautomation . TreeScope . DESCENDANTS ) , this . createControlTypeCondition ( ControlType . TreeItem ) ) ; for ( mmarquee . automation . controls . Element element : collection ) { java . lang . String name = element . getName ( ) ; if ( ( name != null ) && ( namePattern . matcher ( name ) . matches ( ) ) ) { foundElement = element ; break ; } } if ( foundElement == null ) { throw new mmarquee . automation . controls . ItemNotFoundException ( namePattern . toString ( ) ) ; } return new mmarquee . automation . controls . TreeViewItem ( new mmarquee . automation . controls . ElementBuilder ( foundElement ) ) ; }
|
org . junit . Assert . assertTrue ( ( item != null ) )
|
testPostAuthentication ( ) { java . lang . String appId = "1000" ; java . lang . String app2Id = "1001" ; java . lang . String keyId = "1000000" ; java . lang . String encStringValue = "ssssdafdsafdsafdsafdasfdsafdsa" ; java . lang . String service = "http://loacahost:8080/ki4so-app/home.do" ; java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; parameters . put ( WebConstants . SERVICE_PARAM_NAME , service ) ; credential . setParameters ( parameters ) ; com . github . ebnew . ki4so . core . app . App app = new com . github . ebnew . ki4so . core . app . App ( ) ; app . setAppId ( appId ) ; com . github . ebnew . ki4so . core . app . App clientApp = new com . github . ebnew . ki4so . core . app . App ( ) ; clientApp . setAppId ( app2Id ) ; com . github . ebnew . ki4so . core . key . Ki4soKey key = new com . github . ebnew . ki4so . core . key . Ki4soKey ( ) ; key . setKeyId ( keyId ) ; org . mockito . Mockito . when ( appService . findKi4soServerApp ( ) ) . thenReturn ( app ) ; org . mockito . Mockito . when ( appService . findAppByHost ( service ) ) . thenReturn ( clientApp ) ; com . github . ebnew . ki4so . core . key . KeyService keyService = org . mockito . Mockito . mock ( com . github . ebnew . ki4so . core . key . KeyService . class ) ; org . mockito . Mockito . when ( keyService . findKeyByAppId ( appId ) ) . thenReturn ( key ) ; org . mockito . Mockito . when ( keyService . findKeyByAppId ( app2Id ) ) . thenReturn ( key ) ; this . handler . setKeyService ( keyService ) ; com . github . ebnew . ki4so . core . authentication . EncryCredentialManager encryCredentialManager = org . mockito . Mockito . mock ( com . github . ebnew . ki4so . core . authentication . EncryCredentialManager . class ) ; org . mockito . Mockito . when ( encryCredentialManager . encrypt ( org . mockito . Mockito . any ( com . github . ebnew . ki4so . core . model . EncryCredentialInfo . class ) ) ) . thenReturn ( encStringValue ) ; this . handler . setEncryCredentialManager ( encryCredentialManager ) ; com . github . ebnew . ki4so . core . authentication . status . UserLoggedStatusStore userLoggedStatusStore = org . mockito . Mockito . mock ( com . github . ebnew . ki4so . core . authentication . status . UserLoggedStatusStore . class ) ; this . handler . setUserLoggedStatusStore ( userLoggedStatusStore ) ; authentication = this . handler . postAuthentication ( credential , principal ) ; "<AssertPlaceHolder>" ; } postAuthentication ( com . github . ebnew . ki4so . core . authentication . Credential , com . github . ebnew . ki4so . core . authentication . Principal ) { java . util . Date createTime = new java . util . Date ( ) ; com . github . ebnew . ki4so . core . authentication . AuthenticationImpl authentication = new com . github . ebnew . ki4so . core . authentication . AuthenticationImpl ( ) ; authentication . setAuthenticatedDate ( createTime ) ; authentication . setPrincipal ( principal ) ; encryCredentialWithKi4soKey ( authentication , credential , principal ) ; encryCredentialWithAppKey ( authentication , credential , principal ) ; return authentication ; }
|
org . junit . Assert . assertNotNull ( authentication )
|
testIsUnionOnUnionWithMultipleElements ( ) { org . apache . avro . Schema schema = org . apache . avro . Schema . createUnion ( org . apache . avro . Schema . create ( Type . NULL ) , org . apache . avro . Schema . create ( Type . LONG ) ) ; "<AssertPlaceHolder>" ; } isUnion ( ) { return ( this ) instanceof org . apache . avro . Schema . UnionSchema ; }
|
org . junit . Assert . assertTrue ( schema . isUnion ( ) )
|
genericEncoderV2GenericDecoderV1 ( ) { org . apache . avro . Schema reader = load ( "users_v1.schema" ) ; org . apache . avro . Schema writer = load ( "users_v2.schema" ) ; org . springframework . cloud . stream . schema . SchemaRegistryClient client = mock ( org . springframework . cloud . stream . schema . SchemaRegistryClient . class ) ; org . springframework . cloud . stream . codec . avro . AvroCodec codec = new org . springframework . cloud . stream . codec . avro . AvroCodec ( ) ; codec . setReaderSchema ( reader ) ; codec . setSchemaRegistryClient ( client ) ; when ( client . register ( any ( ) ) ) . thenReturn ( 2 ) ; when ( client . fetch ( eq ( 2 ) ) ) . thenReturn ( writer ) ; org . apache . avro . generic . GenericRecord record = new org . apache . avro . generic . GenericData . Record ( writer ) ; record . put ( "name" , "joe" ) ; record . put ( "favoriteNumber" , 42 ) ; record . put ( "favoriteColor" , "blue" ) ; record . put ( "favoritePlace" , "Paris" ) ; byte [ ] results = codec . encode ( record ) ; org . apache . avro . generic . GenericRecord decoded = codec . decode ( results , org . apache . avro . generic . GenericRecord . class ) ; "<AssertPlaceHolder>" ; } get ( int ) { switch ( field$ ) { case 0 : return name ; case 1 : return favoriteNumber ; case 2 : return favoriteColor ; default : throw new org . apache . avro . AvroRuntimeException ( "Bad<sp>index" ) ; } }
|
org . junit . Assert . assertEquals ( record . get ( "name" ) . toString ( ) , decoded . get ( "name" ) . toString ( ) )
|
doesNotFailWhenThereIsNoDataTypeResolution ( ) { when ( muleContext . getRegistry ( ) ) . thenReturn ( muleRegistry ) ; when ( muleRegistry . lookupTransformer ( org . mockito . Mockito . any ( org . mule . runtime . api . metadata . DataType . class ) , org . mockito . Mockito . any ( org . mule . runtime . api . metadata . DataType . class ) ) ) . thenReturn ( null ) ; org . mule . runtime . core . internal . transformer . DynamicDataTypeConversionResolver resolver = new org . mule . runtime . core . internal . transformer . DynamicDataTypeConversionResolver ( muleContext ) ; java . util . List < org . mule . runtime . api . metadata . DataType > targetValues = new java . util . ArrayList ( ) ; targetValues . add ( DataType . STRING ) ; org . mule . runtime . core . api . transformer . Transformer resolvedConverter = resolver . resolve ( DataType . INPUT_STREAM , targetValues ) ; "<AssertPlaceHolder>" ; } resolve ( org . mule . runtime . extension . api . runtime . operation . ExecutionContext , java . lang . Class [ ] ) { java . util . function . Supplier < java . lang . Object > [ ] parameterValues = new java . util . function . Supplier [ argumentResolvers . length ] ; int i = 0 ; for ( org . mule . runtime . module . extension . internal . runtime . resolver . ArgumentResolver < ? > argumentResolver : argumentResolvers ) { parameterValues [ i ] = wrapParameterResolution ( parameterTypes [ i ] , argumentResolver . resolve ( executionContext ) ) ; i ++ ; } return parameterValues ; }
|
org . junit . Assert . assertEquals ( null , resolvedConverter )
|
testSameElementLookedUpDifferentWaysShouldBeEqual ( ) { driver . get ( pages . simpleTestPage ) ; org . openqa . selenium . WebElement body = driver . findElement ( org . openqa . selenium . By . tagName ( "body" ) ) ; org . openqa . selenium . WebElement xbody = driver . findElements ( org . openqa . selenium . By . xpath ( "//body" ) ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } get ( org . openqa . selenium . remote . SessionId ) { return sessionIdToDriver . get ( sessionId ) ; }
|
org . junit . Assert . assertEquals ( body , xbody )
|
shouldOpenDataStoreOnNonSpatialDatabase ( ) { org . neo4j . graphdb . GraphDatabaseService db = null ; try { db = new org . neo4j . test . TestGraphDatabaseFactory ( ) . newImpermanentDatabase ( new java . io . File ( "other-db" ) ) ; org . geotools . data . neo4j . Neo4jSpatialDataStore store = new org . geotools . data . neo4j . Neo4jSpatialDataStore ( db ) ; org . geotools . geometry . jts . ReferencedEnvelope bounds = store . getBounds ( "map" ) ; "<AssertPlaceHolder>" ; } finally { if ( db != null ) db . shutdown ( ) ; } } getBounds ( java . lang . String ) { org . geotools . geometry . jts . ReferencedEnvelope result = boundsIndex . get ( typeName ) ; if ( result == null ) { org . neo4j . gis . spatial . Layer layer = spatialDatabase . getLayer ( typeName ) ; if ( layer != null ) { try ( org . neo4j . graphdb . Transaction tx = database . beginTx ( ) ) { com . vividsolutions . jts . geom . Envelope bbox = org . neo4j . gis . spatial . Utilities . fromNeo4jToJts ( layer . getIndex ( ) . getBoundingBox ( ) ) ; result = convertEnvelopeToRefEnvelope ( typeName , bbox ) ; boundsIndex . put ( typeName , result ) ; tx . success ( ) ; } } } return result ; }
|
org . junit . Assert . assertThat ( bounds , org . hamcrest . CoreMatchers . equalTo ( null ) )
|
resolveValidNetworkId_name_deterministic ( ) { org . oscm . app . ror . client . LPlatformClient lPlatformClient = mock ( org . oscm . app . ror . client . LPlatformClient . class ) ; org . oscm . app . ror . data . LPlatformConfiguration lPlatformConfiguration = mock ( org . oscm . app . ror . data . LPlatformConfiguration . class ) ; org . oscm . app . iaas . data . VSystemConfiguration vSystemConfiguration = null ; paramHandler . getIaasContext ( ) . add ( vSystemConfiguration ) ; parameters . put ( PropertyHandler . NETWORK_ID , new org . oscm . app . v2_0 . data . Setting ( org . oscm . app . iaas . PropertyHandler . NETWORK_ID , ( ( NETWORKID1 ) + "_name" ) ) ) ; java . util . List < org . oscm . app . iaas . data . Network > networks = new java . util . ArrayList ( ) ; networks . add ( new org . oscm . app . iaas . data . Network ( ( ( NETWORKID1 ) + "_name" ) , "net" , NETWORKID1 , 2 ) ) ; networks . add ( new org . oscm . app . iaas . data . Network ( ( ( NETWORKID2 ) + "_name" ) , "net" , NETWORKID2 , 2 ) ) ; doReturn ( lPlatformClient ) . when ( rorVServerCommunication ) . getLPlatformClient ( paramHandler ) ; doReturn ( lPlatformConfiguration ) . when ( lPlatformClient ) . getConfiguration ( ) ; doReturn ( networks ) . when ( lPlatformConfiguration ) . getNetworks ( ) ; java . lang . String resolvedId = rorVServerCommunication . resolveValidNetworkId ( paramHandler ) ; "<AssertPlaceHolder>" ; } resolveValidNetworkId ( org . oscm . app . iaas . PropertyHandler ) { java . lang . String id = paramHandler . getNetworkId ( ) ; if ( ( id != null ) && ( ( id . trim ( ) . length ( ) ) == 0 ) ) { id = null ; } try { org . oscm . app . ror . client . LPlatformClient lPlatformClient = getLPlatformClient ( paramHandler ) ; org . oscm . app . iaas . data . VSystemConfiguration config = paramHandler . getIaasContext ( ) . getVSystemConfiguration ( ) ; if ( config == null ) { config = lPlatformClient . getConfiguration ( ) ; paramHandler . getIaasContext ( ) . add ( config ) ; } java . util . List < org . oscm . app . iaas . data . Network > networks = config . getNetworks ( ) ; if ( id == null ) { if ( ( networks != null ) && ( ( networks . size ( ) ) == 1 ) ) { return networks . iterator ( ) . next ( ) . getId ( ) ; } throw new org . oscm . app . v2_0 . exceptions . SuspendException ( org . oscm . app . iaas . i18n . Messages . getAll ( "error_invalid_networkid" , new java . lang . Object [ ] { id } ) ) ; } java . lang . String nameToId = null ; boolean nameDeterministic = true ; if ( networks != null ) { for ( org . oscm . app . iaas . data . Network net : networks ) { if ( id . equals ( net . getId ( ) ) ) { return id ; } if ( id . equals ( net . getName ( ) ) ) { if ( nameToId == null ) { nameToId = net . getId ( ) ; } else { nameDeterministic = false ; } } } } if ( nameToId != null ) { if ( nameDeterministic ) { return nameToId ; } else { throw new org . oscm . app . v2_0 . exceptions . SuspendException ( org . oscm . app . iaas . i18n . Messages . getAll ( "error_invalid_networkid" , new java . lang . Object [ ] { id } ) ) ; } } } catch ( java . lang . Exception e ) { org . oscm . app . ror . RORVServerCommunication . logger . error ( "Error<sp>while<sp>validating<sp>configured<sp>networkId" , e ) ; org . oscm . app . v2_0 . exceptions . SuspendException exception = getSuspendException ( e , "error_invalid_networkid" ) ; throw exception ; } return null ; }
|
org . junit . Assert . assertEquals ( NETWORKID1 , resolvedId )
|
getEmptyProcessInstances ( ) { org . kie . internal . runtime . StatefulKnowledgeSession ksession = reloadKnowledgeSession ( ) ; "<AssertPlaceHolder>" ; ksession . dispose ( ) ; } getProcessInstances ( ) { return processInstanceManager . getProcessInstances ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , ksession . getProcessInstances ( ) . size ( ) )
|
question5346011 ( ) { org . neo4j . graphdb . GraphDatabaseService service = new org . neo4j . test . TestGraphDatabaseFactory ( ) . newImpermanentDatabase ( ) ; try ( org . neo4j . graphdb . Transaction tx = service . beginTx ( ) ) { org . neo4j . graphdb . index . RelationshipIndex index = service . index ( ) . forRelationships ( "exact" ) ; org . neo4j . graphdb . Node node1 = service . createNode ( ) ; org . neo4j . graphdb . Node node2 = service . createNode ( ) ; java . lang . String uuid = "xyz" ; org . neo4j . graphdb . Relationship relationship = node1 . createRelationshipTo ( node2 , org . neo4j . graphdb . RelationshipType . withName ( "related" ) ) ; index . add ( relationship , "uuid" , uuid ) ; try ( org . neo4j . graphdb . index . IndexHits < org . neo4j . graphdb . Relationship > hits = index . get ( "uuid" , uuid , node1 , node2 ) ) { "<AssertPlaceHolder>" ; } tx . success ( ) ; } service . shutdown ( ) ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , hits . size ( ) )
|
testGetResourceStringAndSucceed ( ) { mockStatic ( java . util . ResourceBundle . class ) ; expect ( java . util . ResourceBundle . getBundle ( "SomeBundleName" , Locale . ENGLISH ) ) . andReturn ( bundle ) ; final java . lang . String key = "DUMMY" ; final java . lang . String message = "This<sp>is<sp>a<sp>Message" ; expect ( bundle . getString ( key ) ) . andReturn ( message ) ; replayAll ( ) ; java . lang . String result = instance . getResourceString ( key ) ; verifyAll ( ) ; "<AssertPlaceHolder>" ; } getResourceString ( java . lang . String ) { if ( isNull ( bundle ) ) { java . util . Locale locale = getLocale ( ) ; if ( isNotNull ( locale ) ) { this . bundle = java . util . ResourceBundle . getBundle ( "SomeBundleName" , locale ) ; } else { handleError ( ) ; } } return bundle . getString ( key ) ; }
|
org . junit . Assert . assertEquals ( message , result )
|
shouldFindAllActiveCustomers ( ) { java . util . List < net . rrm . ehour . domain . Customer > customers = customerDao . findAllActive ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return nodes . size ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , customers . size ( ) )
|
testInteger ( ) { long value = com . alicloud . openservices . tablestore . common . TestUtil . randomLong ( ) ; com . alicloud . openservices . tablestore . model . PrimaryKeyValue v = com . alicloud . openservices . tablestore . model . PrimaryKeyValue . fromLong ( value ) ; "<AssertPlaceHolder>" ; checkType ( v ) ; } asLong ( ) { if ( ( this . type ) != ( PrimaryKeyType . INTEGER ) ) { throw new java . lang . IllegalStateException ( "The<sp>type<sp>of<sp>primary<sp>key<sp>is<sp>not<sp>INTEGER." ) ; } return ( ( java . lang . Long ) ( value ) ) ; }
|
org . junit . Assert . assertEquals ( v . asLong ( ) , value )
|
testPushV8ObjectToArray ( ) { com . eclipsesource . v8 . V8Array array = new com . eclipsesource . v8 . V8Array ( v8 ) ; com . eclipsesource . v8 . V8Object child = new com . eclipsesource . v8 . V8Object ( v8 ) ; com . eclipsesource . v8 . utils . V8ObjectUtils . pushValue ( v8 , array , child ) ; com . eclipsesource . v8 . V8Object result = ( ( com . eclipsesource . v8 . V8Object ) ( array . get ( 0 ) ) ) ; "<AssertPlaceHolder>" ; array . close ( ) ; result . close ( ) ; child . close ( ) ; } get ( byte [ ] ) { v8 . checkThread ( ) ; checkReleased ( ) ; byteBuffer . get ( dst ) ; return this ; }
|
org . junit . Assert . assertEquals ( child , result )
|
testMultipleLoginModules ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; int moduleCount = 3 ; java . util . Map < java . lang . Integer , java . util . Map < java . lang . String , java . lang . Object > > moduleOptions = new java . util . HashMap ( ) ; for ( int i = 0 ; i < moduleCount ; i ++ ) { java . util . Map < java . lang . String , java . lang . Object > options = new java . util . HashMap ( ) ; options . put ( "index" , ( "Index" + i ) ) ; options . put ( "module" , ( "Module" + i ) ) ; moduleOptions . put ( i , options ) ; java . lang . String module = jaasConfigProp ( ( "test.Module" + i ) , LoginModuleControlFlag . REQUIRED , options ) ; builder . append ( '<sp>' ) ; builder . append ( module ) ; } java . lang . String jaasConfigProp = builder . toString ( ) ; java . lang . String clientContextName = "CLIENT" ; javax . security . auth . login . Configuration configuration = new org . apache . kafka . common . security . JaasConfig ( clientContextName , jaasConfigProp ) ; javax . security . auth . login . AppConfigurationEntry [ ] dynamicEntries = configuration . getAppConfigurationEntry ( clientContextName ) ; "<AssertPlaceHolder>" ; for ( int i = 0 ; i < moduleCount ; i ++ ) { javax . security . auth . login . AppConfigurationEntry entry = dynamicEntries [ i ] ; checkEntry ( entry , ( "test.Module" + i ) , LoginModuleControlFlag . REQUIRED , moduleOptions . get ( i ) ) ; } java . lang . String serverContextName = "SERVER" ; writeConfiguration ( serverContextName , jaasConfigProp ) ; javax . security . auth . login . AppConfigurationEntry [ ] staticEntries = javax . security . auth . login . Configuration . getConfiguration ( ) . getAppConfigurationEntry ( serverContextName ) ; for ( int i = 0 ; i < moduleCount ; i ++ ) { javax . security . auth . login . AppConfigurationEntry staticEntry = staticEntries [ i ] ; checkEntry ( staticEntry , dynamicEntries [ i ] . getLoginModuleName ( ) , LoginModuleControlFlag . REQUIRED , dynamicEntries [ i ] . getOptions ( ) ) ; } } getAppConfigurationEntry ( java . lang . String ) { if ( this . loginContextName . equals ( name ) ) return configEntries . toArray ( new javax . security . auth . login . AppConfigurationEntry [ 0 ] ) ; else return null ; }
|
org . junit . Assert . assertEquals ( moduleCount , dynamicEntries . length )
|
testSelectUnionAll ( ) { java . lang . String sql = "(select<sp>*<sp>from<sp>xx)<sp>union<sp>all<sp>(select<sp>*<sp>from<sp>xx)" ; com . dianping . zebra . util . SqlType sqlType = com . dianping . zebra . util . SqlUtils . getSqlType ( sql ) ; "<AssertPlaceHolder>" ; } getSqlType ( java . lang . String ) { if ( com . dianping . zebra . util . StringUtils . isBlank ( sql ) ) { return SqlType . UNKNOWN_SQL_TYPE ; } com . dianping . zebra . util . SqlType sqlType = null ; java . lang . String lowerSql = sql . toLowerCase ( ) ; boolean inComment = false ; int begin = 0 ; for ( ; begin < ( lowerSql . length ( ) ) ; ++ begin ) { char currentChar = lowerSql . charAt ( begin ) ; if ( ! inComment ) { if ( currentChar == '/' ) { inComment = true ; } else if ( currentChar > '<sp>' ) { break ; } } else if ( currentChar == '/' ) { inComment = ! inComment ; } } if ( ( ( lowerSql . length ( ) ) - begin ) < ( com . dianping . zebra . util . SqlUtils . EXECUTE_KEY . length ( ) ) ) { return SqlType . UNKNOWN_SQL_TYPE ; } switch ( lowerSql . charAt ( begin ) ) { case 's' : if ( ( lowerSql . charAt ( ( begin + 1 ) ) ) == 'e' ) { sqlType = com . dianping . zebra . util . SqlUtils . selectHandler ( lowerSql , begin ) ; } else { sqlType = com . dianping . zebra . util . SqlUtils . showHandler ( lowerSql , begin ) ; } break ; case 'i' : sqlType = com . dianping . zebra . util . SqlUtils . insertHandler ( lowerSql , begin ) ; break ; case 'u' : sqlType = com . dianping . zebra . util . SqlUtils . updateHandler ( lowerSql , begin ) ; break ; case 'd' : if ( ( lowerSql . charAt ( ( begin + 1 ) ) ) == 'e' ) { sqlType = com . dianping . zebra . util . SqlUtils . deleteHandler ( lowerSql , begin ) ; } else { sqlType = com . dianping . zebra . util . SqlUtils . dropHandler ( lowerSql , begin ) ; } break ; case 'r' : sqlType = com . dianping . zebra . util . SqlUtils . replaceHandler ( lowerSql , begin ) ; break ; case 't' : sqlType = com . dianping . zebra . util . SqlUtils . truncateHandler ( lowerSql , begin ) ; break ; case 'c' : sqlType = com . dianping . zebra . util . SqlUtils . createHandler ( lowerSql , begin ) ; break ; case 'l' : sqlType = com . dianping . zebra . util . SqlUtils . loadHandler ( lowerSql , begin ) ; break ; case 'm' : sqlType = com . dianping . zebra . util . SqlUtils . mergeHandler ( lowerSql , begin ) ; break ; case 'e' : sqlType = com . dianping . zebra . util . SqlUtils . explainHandler ( lowerSql , begin ) ; break ; case 'a' : sqlType = com . dianping . zebra . util . SqlUtils . alterHandler ( lowerSql , begin ) ; break ; default : sqlType = com . dianping . zebra . util . SqlUtils . executeHandler ( lowerSql , begin ) ; break ; } return sqlType ; }
|
org . junit . Assert . assertEquals ( SqlType . UNKNOWN_SQL_TYPE , sqlType )
|
testSearchElement ( ) { org . ebayopensource . turmeric . tools . annoparser . Element elem = xsdIntf . searchIndependentElement ( "formatBucketParam" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertEquals ( "formatBucketParam" , elem . getName ( ) )
|
deveObterAmbienteComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . cancelamento . NFRetornoInfoCancelamento retornoInfoCancelamento = new com . fincatto . documentofiscal . nfe400 . classes . evento . cancelamento . NFRetornoInfoCancelamento ( ) ; final com . fincatto . documentofiscal . DFAmbiente ambiente = com . fincatto . documentofiscal . DFAmbiente . HOMOLOGACAO ; retornoInfoCancelamento . setAmbiente ( ambiente ) ; "<AssertPlaceHolder>" ; } getAmbiente ( ) { return this . ambiente ; }
|
org . junit . Assert . assertEquals ( ambiente , retornoInfoCancelamento . getAmbiente ( ) )
|
testHashCode_WithoutWrapper ( ) { java . sql . Connection wrapped = org . axonframework . common . jdbc . ConnectionWrapperFactory . wrap ( connection , closeHandler ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return java . util . Objects . hash ( globalIndex ) ; }
|
org . junit . Assert . assertEquals ( wrapped . hashCode ( ) , wrapped . hashCode ( ) )
|
testWeirdQuoteWithTrim ( ) { java . lang . String csv = "<sp>ddddd\",ddd,<sp>\"dd,dd\"" ; java . util . List < java . lang . String [ ] > strings = org . simpleflatmapper . lightningcsv . CsvParser . dsl ( ) . trimSpaces ( ) . forEach ( csv , new org . simpleflatmapper . util . ListCollector < java . lang . String [ ] > ( ) ) . getList ( ) ; "<AssertPlaceHolder>" ; strings = new java . util . ArrayList < java . lang . String [ ] > ( ) ; for ( java . lang . String [ ] row : org . simpleflatmapper . lightningcsv . CsvParser . dsl ( ) . trimSpaces ( ) . reader ( csv ) ) { strings . add ( row ) ; } org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "ddddd\"" , "ddd" , "dd,dd" } , strings . get ( 0 ) ) ; } get ( java . lang . Object ) { return null ; }
|
org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "ddddd\"" , "ddd" , "dd,dd" } , strings . get ( 0 ) )
|
testGetPipelineViewWithLastJobProvided ( ) { hudson . model . FreeStyleProject build = jenkins . createFreeStyleProject ( "build" ) ; hudson . model . FreeStyleProject test = jenkins . createFreeStyleProject ( "test" ) ; hudson . model . FreeStyleProject deploy = jenkins . createFreeStyleProject ( "deploy" ) ; build . getPublishersList ( ) . add ( new hudson . tasks . BuildTrigger ( test . getName ( ) , false ) ) ; test . getPublishersList ( ) . add ( new hudson . tasks . BuildTrigger ( deploy . getName ( ) , false ) ) ; jenkins . getInstance ( ) . rebuildDependencyGraph ( ) ; jenkins . buildAndAssertSuccess ( build ) ; jenkins . waitUntilNoActivity ( ) ; java . util . List < se . diabol . jenkins . pipeline . DeliveryPipelineView . ComponentSpec > specs = new java . util . ArrayList ( ) ; specs . add ( new se . diabol . jenkins . pipeline . DeliveryPipelineView . ComponentSpec ( "Comp" , "build" , "test" , se . diabol . jenkins . pipeline . DeliveryPipelineViewTest . DO_NOT_SHOW_UPSTREAM ) ) ; se . diabol . jenkins . pipeline . DeliveryPipelineView view = new se . diabol . jenkins . pipeline . DeliveryPipelineView ( "Pipeline" ) ; view . setComponentSpecs ( specs ) ; view . setSorting ( se . diabol . jenkins . pipeline . sort . NameComparator . class . getName ( ) ) ; jenkins . getInstance ( ) . addView ( view ) ; view . getPipelines ( ) ; "<AssertPlaceHolder>" ; } getError ( ) { return error ; }
|
org . junit . Assert . assertNull ( view . getError ( ) )
|
unusedImplication ( ) { com . facebook . buck . core . model . targetgraph . TargetNode < ? > root = new com . facebook . buck . versions . VersionRootBuilder ( "//:root" ) . setVersionUniverse ( "universe" ) . build ( ) ; com . facebook . buck . core . model . BuildTarget versioned1 = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//:versioned1" ) ; com . facebook . buck . core . model . BuildTarget versioned2 = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//:versioned2" ) ; com . facebook . buck . versions . VersionUniverseVersionSelector selector = new com . facebook . buck . versions . VersionUniverseVersionSelector ( com . facebook . buck . core . model . targetgraph . TargetGraphFactory . newInstance ( root ) , com . google . common . collect . ImmutableMap . of ( "universe" , com . facebook . buck . versions . VersionUniverse . builder ( ) . putVersions ( versioned1 , com . facebook . buck . versions . VersionUniverseVersionSelectorTest . ONE ) . putVersions ( versioned2 , com . facebook . buck . versions . VersionUniverseVersionSelectorTest . ONE ) . build ( ) ) ) ; com . google . common . collect . ImmutableMap < com . facebook . buck . core . model . BuildTarget , com . facebook . buck . versions . Version > versions = selector . resolve ( root . getBuildTarget ( ) , com . google . common . collect . ImmutableMap . of ( versioned1 , com . google . common . collect . ImmutableSet . of ( com . facebook . buck . versions . VersionUniverseVersionSelectorTest . ONE , com . facebook . buck . versions . VersionUniverseVersionSelectorTest . TWO ) , versioned2 , com . google . common . collect . ImmutableSet . of ( com . facebook . buck . versions . VersionUniverseVersionSelectorTest . ONE , com . facebook . buck . versions . VersionUniverseVersionSelectorTest . TWO ) ) ) ; "<AssertPlaceHolder>" ; } of ( java . nio . file . Path , java . nio . file . Path , java . nio . file . Path , com . facebook . buck . io . filesystem . ProjectFilesystemView ) { return new com . facebook . buck . parser . manifest . BuildFileManifestCache ( superRootPath , rootPath , buildFileName , fileSystemView ) ; }
|
org . junit . Assert . assertThat ( versions , org . hamcrest . Matchers . equalTo ( com . google . common . collect . ImmutableMap . of ( versioned1 , com . facebook . buck . versions . VersionUniverseVersionSelectorTest . ONE , versioned2 , com . facebook . buck . versions . VersionUniverseVersionSelectorTest . ONE ) ) )
|
testLdap ( ) { java . util . Properties props = new java . util . Properties ( ) ; props . put ( Context . INITIAL_CONTEXT_FACTORY , "com.sun.jndi.ldap.LdapCtxFactory" ) ; props . put ( Context . PROVIDER_URL , "ldap://estinfra1.lan.est.fujitsu.de:389" ) ; org . oscm . identityservice . local . ILdapResultMapper < org . oscm . internal . vo . VOUserDetails > mapper = new org . oscm . identityservice . local . ILdapResultMapper < org . oscm . internal . vo . VOUserDetails > ( ) { @ org . oscm . identityservice . ldap . Override public java . lang . String [ ] getAttributes ( ) { return new java . lang . String [ ] { "uid" , "sn" , "givenName" , "scalixEmailAddress" } ; } @ org . oscm . identityservice . ldap . Override public org . oscm . internal . vo . VOUserDetails map ( java . lang . String [ ] values ) { org . oscm . internal . vo . VOUserDetails user = new org . oscm . internal . vo . VOUserDetails ( ) ; user . setUserId ( values [ 0 ] ) ; user . setLastName ( values [ 1 ] ) ; user . setFirstName ( values [ 2 ] ) ; user . setEMail ( values [ 3 ] ) ; return user ; } } ; org . oscm . identityservice . ldap . LdapAccessServiceBean ldapAccess = new org . oscm . identityservice . ldap . LdapAccessServiceBean ( ) ; ldapAccess . cs = new org . oscm . test . stubs . ConfigurationServiceStub ( ) { @ org . oscm . identityservice . ldap . Override public org . oscm . domobjects . ConfigurationSetting getConfigurationSetting ( org . oscm . internal . types . enumtypes . ConfigurationKey informationId , java . lang . String contextId ) { org . oscm . domobjects . ConfigurationSetting setting = new org . oscm . domobjects . ConfigurationSetting ( ) ; setting . setInformationId ( ConfigurationKey . LDAP_SEARCH_LIMIT ) ; setting . setValue ( "1" ) ; return setting ; } } ; java . util . List < org . oscm . internal . vo . VOUserDetails > result = ldapAccess . search ( props , "ou=people,dc=est,dc=fujitsu,dc=de" , "uid=p*" , mapper , false ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return false ; }
|
org . junit . Assert . assertFalse ( result . isEmpty ( ) )
|
testBeginRollebackOnlyTx ( ) { txService . begin ( ) ; txService . setRollbackOnly ( ) ; try { txService . begin ( ) ; System . out . println ( ( "++++" + ( txService . getNumberOfActiveTransactions ( ) ) ) ) ; org . junit . Assert . fail ( ( "Impossible<sp>to<sp>begin<sp>a<sp>tx<sp>with<sp>state<sp>" + ( TransactionState . ROLLBACKONLY ) ) ) ; } catch ( final org . bonitasoft . engine . transaction . STransactionCreationException e ) { "<AssertPlaceHolder>" ; } finally { txService . complete ( ) ; } } getState ( ) { return state ; }
|
org . junit . Assert . assertEquals ( TransactionState . ROLLBACKONLY , txService . getState ( ) )
|
rollupNotFreshEnoughWhenBeforeEarliestAllowedDay ( ) { final org . joda . time . DateMidnight latestRollupDate = new org . joda . time . DateMidnight ( 2013 , 10 , 6 ) ; final org . joda . time . DateMidnight today = new org . joda . time . DateMidnight ( 2013 , 10 , 9 ) ; final java . util . Date endDate = df . parse ( "2013-10-09T01:00:00+0000" ) ; final java . util . Date modifiedDate = df . parse ( "2013-10-09T23:00:00+0000" ) ; final com . intuit . wasabi . experimentobjects . Experiment . State state = com . intuit . wasabi . experimentobjects . Experiment . State . TERMINATED ; final int maxAgeAllowedInDays = 2 ; com . intuit . wasabi . analytics . impl . Rollup rollup = rollupWith ( latestRollupDate , today , maxAgeAllowedInDays , endDate , modifiedDate , state ) ; "<AssertPlaceHolder>" ; } isFreshEnough ( ) { if ( ( latestAvailableRollupDate ) == null ) { return false ; } org . joda . time . DateMidnight earliestValidDate = comparisonDate ( ) . minusDays ( getMaxAllowedRollupAgeDays ( ) ) ; return ! ( latestAvailableRollupDate . isBefore ( earliestValidDate ) ) ; }
|
org . junit . Assert . assertThat ( rollup . isFreshEnough ( ) , org . hamcrest . Matchers . is ( false ) )
|
testCanSerialiseEntityElement ( ) { final uk . gov . gchq . gaffer . data . element . Entity entity = new uk . gov . gchq . gaffer . data . element . Entity ( uk . gov . gchq . gaffer . commonutil . TestGroups . ENTITY , uk . gov . gchq . gaffer . store . serialiser . ElementSerialiserTest . TEST_VERTEX ) ; final byte [ ] serialisedEntity = elementSerialiser . serialise ( entity ) ; final uk . gov . gchq . gaffer . data . element . Element deserialisedEntity = elementSerialiser . deserialise ( serialisedEntity ) ; "<AssertPlaceHolder>" ; } deserialise ( java . lang . Object [ ] ) { if ( ( objects . length ) == 1 ) { if ( ( objects [ 0 ] ) instanceof java . lang . Long ) { return new java . util . Date ( ( ( long ) ( objects [ 0 ] ) ) ) ; } else if ( null == ( objects [ 0 ] ) ) { return null ; } } throw new uk . gov . gchq . gaffer . exception . SerialisationException ( "Could<sp>not<sp>de-serialise<sp>objects<sp>to<sp>a<sp>java.util.Date" ) ; }
|
org . junit . Assert . assertEquals ( entity , deserialisedEntity )
|
testDeclareExtendsJavaParent ( ) { java . lang . String drl = "package<sp>org.drools.test;<sp>\n" + ( ( "import<sp>org.drools.compiler.Person;<sp>\n" + "declare<sp>Student<sp>extends<sp>Person<sp>end<sp>\n" ) + "" ) ; org . kie . internal . builder . KnowledgeBuilder kBuilder = org . kie . internal . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; kBuilder . add ( new org . drools . core . io . impl . ByteArrayResource ( drl . getBytes ( ) ) , ResourceType . DRL ) ; if ( kBuilder . hasErrors ( ) ) { System . err . println ( kBuilder . getErrors ( ) ) ; } "<AssertPlaceHolder>" ; } hasErrors ( ) { return messages . stream ( ) . anyMatch ( ( m ) -> DMNMessage . Severity . ERROR . equals ( m . getSeverity ( ) ) ) ; }
|
org . junit . Assert . assertFalse ( kBuilder . hasErrors ( ) )
|
testSerialization ( ) { org . jfree . chart . labels . StandardPieToolTipGenerator g1 = new org . jfree . chart . labels . StandardPieToolTipGenerator ( ) ; org . jfree . chart . labels . StandardPieToolTipGenerator g2 = ( ( org . jfree . chart . labels . StandardPieToolTipGenerator ) ( org . jfree . chart . TestUtils . serialised ( g1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( g1 , g2 )
|
testRegionServerPort ( ) { org . apache . hadoop . hbase . MiniHBaseCluster cluster = org . apache . hadoop . hbase . util . TestRegionMover . TEST_UTIL . getHBaseCluster ( ) ; org . apache . hadoop . hbase . regionserver . HRegionServer regionServer = cluster . getRegionServer ( 0 ) ; java . lang . String rsName = regionServer . getServerName ( ) . getHostname ( ) ; final int PORT = 16021 ; org . apache . hadoop . conf . Configuration conf = org . apache . hadoop . hbase . util . TestRegionMover . TEST_UTIL . getConfiguration ( ) ; java . lang . String originalPort = conf . get ( HConstants . REGIONSERVER_PORT ) ; conf . set ( HConstants . REGIONSERVER_PORT , java . lang . Integer . toString ( PORT ) ) ; org . apache . hadoop . hbase . util . RegionMover . RegionMoverBuilder rmBuilder = new org . apache . hadoop . hbase . util . RegionMover . RegionMoverBuilder ( rsName , conf ) ; "<AssertPlaceHolder>" ; if ( originalPort != null ) { conf . set ( HConstants . REGIONSERVER_PORT , originalPort ) ; } } toString ( org . apache . hadoop . hbase . util . BloomFilterChunk ) { return ( ( ( org . apache . hadoop . hbase . util . BloomFilterUtil . formatStats ( bloomFilter ) ) + ( org . apache . hadoop . hbase . util . BloomFilterUtil . STATS_RECORD_SEP ) ) + "Actual<sp>error<sp>rate:<sp>" ) + ( java . lang . String . format ( "%.8f" , bloomFilter . actualErrorRate ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( PORT , rmBuilder . port )
|
testDispose ( ) { sg . dispose ( ) ; "<AssertPlaceHolder>" ; } isRunning ( ) { return ! ( stopped ) ; }
|
org . junit . Assert . assertFalse ( sg . isRunning ( ) )
|
testEasyrecDataModel_getNumUsersWithPreferenceForDual ( ) { org . easyrec . mahout . model . EasyrecDataModel easyrecDataModel = new org . easyrec . mahout . model . EasyrecDataModel ( org . easyrec . mahout . EasyrecDataModelTest . TENANT_ID , org . easyrec . mahout . EasyrecDataModelTest . RATE_ACTION_TYPE_ID , org . easyrec . mahout . EasyrecDataModelTest . HAS_RATING_VALUES , mahoutDataModelMappingDAO ) ; int numberUsersWithPreference = easyrecDataModel . getNumUsersWithPreferenceFor ( 1 , 2 ) ; "<AssertPlaceHolder>" ; } getNumUsersWithPreferenceFor ( long , long ) { return inMemoryDelegate . getNumUsersWithPreferenceFor ( itemID1 , itemID2 ) ; }
|
org . junit . Assert . assertEquals ( 2 , numberUsersWithPreference )
|
when_isFormSubbmited_is_called_with_form ( ) { initializeRequestParameterMap ( new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "form" , "form" ) ; } } ) ; javax . faces . component . UIForm form = mock ( javax . faces . component . UIForm . class ) ; when ( form . getClientId ( facesContext ) ) . thenReturn ( "form" ) ; boolean result = utils . isFormSubmitted ( facesContext , form ) ; "<AssertPlaceHolder>" ; } isFormSubmitted ( javax . faces . context . FacesContext , javax . faces . component . UIForm ) { if ( form != null ) { java . lang . String clientId = form . getClientId ( context ) ; java . lang . String formRequestParam = context . getExternalContext ( ) . getRequestParameterMap ( ) . get ( clientId ) ; return isFormValueSubmitted ( clientId , formRequestParam ) ; } return false ; }
|
org . junit . Assert . assertTrue ( result )
|
testParseAuthParamA ( ) { java . lang . String header = "Digest<sp>a=b" ; java . io . StringReader input = new java . io . StringReader ( header ) ; java . util . Map < java . lang . String , java . lang . String > result = org . apache . tomcat . util . http . parser . Authorization . parseAuthorizationDigest ( input ) ; "<AssertPlaceHolder>" ; } get ( java . lang . CharSequence ) { org . apache . tomcat . lite . http . MultiMap . Entry entry = getEntry ( key ) ; return entry == null ? null : entry . value ; }
|
org . junit . Assert . assertEquals ( "b" , result . get ( "a" ) )
|
decode_4 ( ) { final java . lang . String arg = "foo" ; final java . lang . String exp = "Zm9v" ; "<AssertPlaceHolder>" ; } decode ( byte [ ] ) { if ( ( data . length ) == 0 ) { return data ; } int lastRealDataIndex = ( data . length ) - 1 ; while ( ( data [ lastRealDataIndex ] ) == ( org . erlide . util . Base64 . EQUAL_SIGN ) ) { lastRealDataIndex -- ; } final int padBytes = ( ( data . length ) - 1 ) - lastRealDataIndex ; final int byteLength = ( ( ( data . length ) * 6 ) / 8 ) - padBytes ; final byte [ ] result = new byte [ byteLength ] ; int dataIndex = 0 ; int resultIndex = 0 ; int allBits = 0 ; final int resultChunks = ( lastRealDataIndex + 1 ) / 4 ; for ( int i = 0 ; i < resultChunks ; i ++ ) { allBits = 0 ; for ( int j = 0 ; j < 4 ; j ++ ) { allBits = ( allBits << 6 ) | ( org . erlide . util . Base64 . decodeDigit ( data [ ( dataIndex ++ ) ] ) ) ; } for ( int j = resultIndex + 2 ; j >= resultIndex ; j -- ) { result [ j ] = ( ( byte ) ( allBits & 255 ) ) ; allBits = allBits > > > 8 ; } resultIndex += 3 ; } if ( padBytes == 1 ) { allBits = 0 ; for ( int j = 0 ; j < 3 ; j ++ ) { allBits = ( allBits << 6 ) | ( org . erlide . util . Base64 . decodeDigit ( data [ ( dataIndex ++ ) ] ) ) ; } allBits = allBits << 6 ; allBits = allBits > > > 8 ; for ( int j = resultIndex + 1 ; j >= resultIndex ; j -- ) { result [ j ] = ( ( byte ) ( allBits & 255 ) ) ; allBits = allBits > > > 8 ; } } else if ( padBytes == 2 ) { allBits = 0 ; for ( int j = 0 ; j < 2 ; j ++ ) { allBits = ( allBits << 6 ) | ( org . erlide . util . Base64 . decodeDigit ( data [ ( dataIndex ++ ) ] ) ) ; } allBits = allBits << 6 ; allBits = allBits << 6 ; allBits = allBits > > > 8 ; allBits = allBits > > > 8 ; result [ resultIndex ] = ( ( byte ) ( allBits & 255 ) ) ; } return result ; }
|
org . junit . Assert . assertEquals ( arg , new java . lang . String ( org . erlide . util . Base64 . decode ( exp . getBytes ( ) ) ) )
|
testIsValidConfPrimitiveNotEqual ( ) { java . util . Map < java . lang . String , java . lang . Object > map4 = org . apache . storm . shade . com . google . common . collect . ImmutableMap . of ( "k0" , 2L ) ; java . util . Map < java . lang . String , java . lang . Object > map5 = org . apache . storm . shade . com . google . common . collect . ImmutableMap . of ( "k0" , 3L ) ; "<AssertPlaceHolder>" ; } isValidConf ( java . util . Map , java . util . Map ) { org . apache . storm . shade . com . google . common . collect . MapDifference < java . lang . String , java . lang . Object > diff = org . apache . storm . shade . com . google . common . collect . Maps . difference ( orig , deser ) ; if ( diff . areEqual ( ) ) { return true ; } for ( Map . Entry < java . lang . String , java . lang . Object > entryOnLeft : diff . entriesOnlyOnLeft ( ) . entrySet ( ) ) { org . apache . storm . utils . Utils . LOG . warn ( ( "Config<sp>property<sp>({})<sp>is<sp>found<sp>in<sp>original<sp>config,<sp>but<sp>missing<sp>from<sp>the<sp>" + ( "serialized-deserialized<sp>config.<sp>This<sp>is<sp>due<sp>to<sp>an<sp>internal<sp>error<sp>in<sp>" + "serialization.<sp>Name:<sp>{}<sp>-<sp>Value:<sp>{}" ) ) , entryOnLeft . getKey ( ) , entryOnLeft . getKey ( ) , entryOnLeft . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . Object > entryOnRight : diff . entriesOnlyOnRight ( ) . entrySet ( ) ) { org . apache . storm . utils . Utils . LOG . warn ( ( "Config<sp>property<sp>({})<sp>is<sp>not<sp>found<sp>in<sp>original<sp>config,<sp>but<sp>present<sp>in<sp>" + ( "serialized-deserialized<sp>config.<sp>This<sp>is<sp>due<sp>to<sp>an<sp>internal<sp>error<sp>in<sp>" + "serialization.<sp>Name:<sp>{}<sp>-<sp>Value:<sp>{}" ) ) , entryOnRight . getKey ( ) , entryOnRight . getKey ( ) , entryOnRight . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , org . apache . storm . shade . com . google . common . collect . MapDifference . ValueDifference < java . lang . Object > > entryDiffers : diff . entriesDiffering ( ) . entrySet ( ) ) { java . lang . Object leftValue = entryDiffers . getValue ( ) . leftValue ( ) ; java . lang . Object rightValue = entryDiffers . getValue ( ) . rightValue ( ) ; org . apache . storm . utils . Utils . LOG . warn ( "Config<sp>value<sp>differs<sp>after<sp>json<sp>serialization.<sp>Name:<sp>{}<sp>-<sp>Original<sp>Value:<sp>{}<sp>-<sp>DeSer.<sp>Value:<sp>{}" , entryDiffers . getKey ( ) , leftValue , rightValue ) ; } return false ; }
|
org . junit . Assert . assertFalse ( org . apache . storm . utils . Utils . isValidConf ( map4 , map5 ) )
|
testConfigureStaticNatRulesOnLogicalRouterRollback ( ) { resource . configure ( "NiciraNvpResource" , parameters ) ; final com . cloud . agent . api . ConfigureStaticNatRulesOnLogicalRouterCommand cmd = mock ( com . cloud . agent . api . ConfigureStaticNatRulesOnLogicalRouterCommand . class ) ; final com . cloud . agent . api . to . StaticNatRuleTO rule = new com . cloud . agent . api . to . StaticNatRuleTO ( 1 , "11.11.11.11" , null , null , "10.10.10.10" , null , null , null , false , false ) ; final java . util . List < com . cloud . agent . api . to . StaticNatRuleTO > rules = new java . util . ArrayList < com . cloud . agent . api . to . StaticNatRuleTO > ( ) ; rules . add ( rule ) ; when ( cmd . getRules ( ) ) . thenReturn ( rules ) ; when ( cmd . getLogicalRouterUuid ( ) ) . thenReturn ( "aaaaa" ) ; final com . cloud . network . nicira . NatRule [ ] rulepair = resource . generateStaticNatRulePair ( "10.10.10.10" , "11.11.11.11" ) ; rulepair [ 0 ] . setUuid ( java . util . UUID . randomUUID ( ) ) ; rulepair [ 1 ] . setUuid ( java . util . UUID . randomUUID ( ) ) ; when ( nvpApi . createLogicalRouterNatRule ( eq ( "aaaaa" ) , ( ( com . cloud . network . nicira . NatRule ) ( any ( ) ) ) ) ) . thenReturn ( rulepair [ 0 ] ) . thenThrow ( new com . cloud . network . nicira . NiciraNvpApiException ( ) ) ; @ com . cloud . network . resource . SuppressWarnings ( "unchecked" ) final java . util . List < com . cloud . network . nicira . NatRule > storedRules = java . util . Collections . EMPTY_LIST ; when ( nvpApi . findNatRulesByLogicalRouterUuid ( "aaaaa" ) ) . thenReturn ( storedRules ) ; final com . cloud . agent . api . ConfigureStaticNatRulesOnLogicalRouterAnswer a = ( ( com . cloud . agent . api . ConfigureStaticNatRulesOnLogicalRouterAnswer ) ( resource . executeRequest ( cmd ) ) ) ; "<AssertPlaceHolder>" ; verify ( nvpApi , atLeastOnce ( ) ) . deleteLogicalRouterNatRule ( eq ( "aaaaa" ) , eq ( rulepair [ 0 ] . getUuid ( ) ) ) ; } getResult ( ) { return result ; }
|
org . junit . Assert . assertFalse ( a . getResult ( ) )
|
testArrayMulti ( ) { java . lang . String name = "myName" ; io . swagger . models . parameters . SerializableParameter parameter = new io . swagger . models . parameters . QueryParameter ( ) ; parameter . setName ( "myName" ) ; parameter . setType ( "array" ) ; parameter . setCollectionFormat ( "multi" ) ; java . util . List < java . lang . String > paramsList = new java . util . ArrayList ( ) ; paramsList . add ( "toto" ) ; paramsList . add ( "tutu" ) ; paramsList . add ( "titi" ) ; io . vertx . core . MultiMap params = io . vertx . core . MultiMap . caseInsensitiveMultiMap ( ) ; params . add ( name , paramsList ) ; java . lang . Object result = abstractSerializableParameterExtractor . extract ( name , parameter , params ) ; "<AssertPlaceHolder>" ; } extract ( java . lang . String , io . swagger . models . parameters . Parameter , io . vertx . ext . web . RoutingContext ) { io . swagger . models . parameters . FormParameter formParam = ( ( io . swagger . models . parameters . FormParameter ) ( parameter ) ) ; if ( "file" . equals ( formParam . getType ( ) ) ) { for ( io . vertx . ext . web . FileUpload file : context . fileUploads ( ) ) { if ( file . name ( ) . equals ( name ) ) { return file . uploadedFileName ( ) ; } } if ( formParam . getRequired ( ) ) throw new java . lang . IllegalArgumentException ( ( "Missing<sp>required<sp>parameter:<sp>" + name ) ) ; return null ; } else return this . extract ( name , parameter , context . request ( ) . formAttributes ( ) ) ; }
|
org . junit . Assert . assertArrayEquals ( paramsList . toArray ( ) , ( ( java . util . List ) ( result ) ) . toArray ( ) )
|
testCreateSslContextJksStoreOpenSSL ( ) { org . junit . Assume . assumeTrue ( io . netty . handler . ssl . OpenSsl . isAvailable ( ) ) ; org . junit . Assume . assumeTrue ( io . netty . handler . ssl . OpenSsl . supportsKeyManagerFactory ( ) ) ; org . apache . qpid . jms . transports . TransportOptions options = createJksSslOptions ( ) ; io . netty . handler . ssl . SslContext context = org . apache . qpid . jms . transports . TransportSupport . createOpenSslContext ( options ) ; "<AssertPlaceHolder>" ; } createOpenSslContext ( org . apache . qpid . jms . transports . TransportOptions ) { try { java . lang . String contextProtocol = options . getContextProtocol ( ) ; org . apache . qpid . jms . transports . TransportSupport . LOG . trace ( "Getting<sp>SslContext<sp>instance<sp>using<sp>protocol:<sp>{}" , contextProtocol ) ; javax . net . ssl . KeyManagerFactory keyManagerFactory = org . apache . qpid . jms . transports . TransportSupport . loadKeyManagerFactory ( options , SslProvider . OPENSSL ) ; javax . net . ssl . TrustManagerFactory trustManagerFactory = org . apache . qpid . jms . transports . TransportSupport . loadTrustManagerFactory ( options ) ; io . netty . handler . ssl . SslContextBuilder builder = io . netty . handler . ssl . SslContextBuilder . forClient ( ) . sslProvider ( SslProvider . OPENSSL ) ; if ( options . getContextProtocol ( ) . equals ( TransportOptions . DEFAULT_CONTEXT_PROTOCOL ) ) { builder . protocols ( "TLSv1.2" ) ; } else { builder . protocols ( options . getContextProtocol ( ) ) ; } builder . keyManager ( keyManagerFactory ) ; builder . trustManager ( trustManagerFactory ) ; return builder . build ( ) ; } catch ( java . lang . Exception e ) { org . apache . qpid . jms . transports . TransportSupport . LOG . error ( "Failed<sp>to<sp>create<sp>SslContext:<sp>{}" , e , e ) ; throw e ; } }
|
org . junit . Assert . assertNotNull ( context )
|
testSerialization2 ( ) { org . jfree . chart . plot . ThermometerPlot p1 = new org . jfree . chart . plot . ThermometerPlot ( ) ; p1 . setSubrangePaint ( 1 , new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; org . jfree . chart . plot . ThermometerPlot p2 = ( ( org . jfree . chart . plot . ThermometerPlot ) ( org . jfree . chart . TestUtilities . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; mdz . hc . ProcessValue other = ( ( mdz . hc . ProcessValue ) ( obj ) ) ; if ( ( state ) != ( other . state ) ) return false ; if ( ( timestamp ) == null ) { if ( ( other . timestamp ) != null ) return false ; } else if ( ! ( timestamp . equals ( other . timestamp ) ) ) return false ; if ( ( value ) == null ) { if ( ( other . value ) != null ) return false ; } else if ( ! ( value . equals ( other . value ) ) ) return false ; return true ; }
|
org . junit . Assert . assertTrue ( p1 . equals ( p2 ) )
|
removeOrDecrementTestNewKey ( ) { boolean result = org . talend . dataprep . qa . util . FileComparator . removeOrDecrement ( map , org . talend . dataprep . qa . util . FileComparatorTest . TEST_KEY ) ; "<AssertPlaceHolder>" ; } removeOrDecrement ( java . util . Map , java . lang . String ) { boolean decremented = false ; java . lang . Integer value = map . get ( key ) ; if ( value != null ) { value -- ; if ( value == 0 ) { map . remove ( key ) ; } else { map . put ( key , value ) ; } decremented = true ; } return decremented ; }
|
org . junit . Assert . assertFalse ( result )
|
testSingletonScope ( ) { com . myapp . UniqueThing thing1 = context . getBean ( com . myapp . UniqueThing . class ) ; com . myapp . UniqueThing thing2 = context . getBean ( com . myapp . UniqueThing . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertSame ( thing1 , thing2 )
|
testCourseStartedAndExpiredMoreThanAWeekAgo ( ) { final java . lang . String expectedOutput = "Course<sp>access<sp>expired<sp>on<sp>November<sp>1" ; final java . lang . String expiry = "2018-11-01T00:00:00+05:00" ; final java . lang . String start = "2018-10-01T00:00:00+05:00" ; final java . lang . String output = org . edx . mobile . util . images . CourseCardUtils . getFormattedDate ( context , today , expiry , start , end , StartType . TIMESTAMP , null ) ; "<AssertPlaceHolder>" ; } getFormattedDate ( android . content . Context , java . util . Date , java . lang . String , java . lang . String , java . lang . String , org . edx . mobile . model . api . StartType , java . lang . String ) { final java . lang . CharSequence formattedDate ; if ( org . edx . mobile . util . images . CourseCardUtils . isDatePassed ( today , start ) ) { if ( expiry != null ) { final java . util . Date expiryDate = org . edx . mobile . util . DateUtil . convertToDate ( expiry ) ; final long dayDifferenceInMillies ; if ( today . after ( expiryDate ) ) { dayDifferenceInMillies = ( today . getTime ( ) ) - ( expiryDate . getTime ( ) ) ; } else { dayDifferenceInMillies = ( expiryDate . getTime ( ) ) - ( today . getTime ( ) ) ; } if ( org . edx . mobile . util . images . CourseCardUtils . isDatePassed ( today , expiry ) ) { if ( dayDifferenceInMillies > ( org . edx . mobile . util . images . CourseCardUtils . SEVEN_DAYS_IN_MILLIS ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expired_on , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( expiryDate . getTime ( ) ) ) ; } else { final java . lang . CharSequence timeSpan = android . text . format . DateUtils . getRelativeTimeSpanString ( expiryDate . getTime ( ) , today . getTime ( ) , DateUtils . SECOND_IN_MILLIS , DateUtils . FORMAT_ABBREV_RELATIVE ) . toString ( ) . toLowerCase ( ) ; formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expired , "date" , timeSpan ) ; } } else { if ( dayDifferenceInMillies > ( org . edx . mobile . util . images . CourseCardUtils . SEVEN_DAYS_IN_MILLIS ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expires_on , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( expiryDate . getTime ( ) ) ) ; } else { final java . lang . CharSequence timeSpan = android . text . format . DateUtils . getRelativeTimeSpanString ( expiryDate . getTime ( ) , today . getTime ( ) , DateUtils . SECOND_IN_MILLIS , DateUtils . FORMAT_ABBREV_RELATIVE ) . toString ( ) . toLowerCase ( ) ; formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expires , "date" , timeSpan ) ; } } } else { final java . util . Date endDate = org . edx . mobile . util . DateUtil . convertToDate ( end ) ; if ( endDate == null ) { return null ; } else if ( org . edx . mobile . util . images . CourseCardUtils . isDatePassed ( today , end ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_ended , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( endDate . getTime ( ) ) ) ; } else { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_ending , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( endDate . getTime ( ) ) ) ; } } } else { if ( ( start_type == ( org . edx . mobile . model . api . StartType . TIMESTAMP ) ) && ( ! ( android . text . TextUtils . isEmpty ( start ) ) ) ) { final java . util . Date startDate = org . edx . mobile . util . DateUtil . convertToDate ( start ) ; formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_starting , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( startDate . getTime ( ) ) ) ; } else if ( ( start_type == ( org . edx . mobile . model . api . StartType . STRING ) ) && ( ! ( android . text . TextUtils . isEmpty ( start_display ) ) ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_starting , "date" , start_display ) ; } else { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_starting , "date" , context . getString ( R . string . assessment_soon ) ) ; } } return formattedDate . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expectedOutput , output )
|
generatorCreatesNoCandidatesForExcludedUri ( ) { org . atlasapi . media . entity . Item item = new org . atlasapi . media . entity . Item ( ) ; item . setCanonicalUri ( "excluded" ) ; java . util . List < org . atlasapi . equiv . results . scores . ScoredCandidates < org . atlasapi . media . entity . Content > > generated = generators . generate ( item , resultDescription , equivToTelescopeResults ) ; "<AssertPlaceHolder>" ; } generate ( T extends org . atlasapi . media . entity . Content , org . atlasapi . equiv . results . description . ResultDescription , org . atlasapi . equiv . update . metadata . EquivToTelescopeResult ) { org . atlasapi . equiv . results . scores . DefaultScoredCandidates . Builder < T > equivalents = org . atlasapi . equiv . results . scores . DefaultScoredCandidates . fromSource ( "Barb<sp>Alias" ) ; if ( ! ( subject . getAliases ( ) . isEmpty ( ) ) ) { equivalents = findByCommonAlias ( subject , equivalents , desc , equivToTelescopeResult ) ; } return equivalents . build ( ) ; }
|
org . junit . Assert . assertTrue ( generated . isEmpty ( ) )
|
shouldSelectNRandomDifferentSolutionsReturnTheCorrectNumberOfSolutions ( ) { int listSize = 20 ; int solutionsToBeReturned = 4 ; org . uma . jmetal . util . List < org . uma . jmetal . solution . BinarySolution > list = new org . uma . jmetal . util . ArrayList ( listSize ) ; for ( int i = 0 ; i < listSize ; i ++ ) { list . add ( mock ( org . uma . jmetal . solution . BinarySolution . class ) ) ; } org . uma . jmetal . util . List < org . uma . jmetal . solution . BinarySolution > result = org . uma . jmetal . util . SolutionListUtils . selectNRandomDifferentSolutions ( solutionsToBeReturned , list ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertEquals ( solutionsToBeReturned , result . size ( ) )
|
testGetParameterNotFound ( ) { new mockit . Expectations ( ) { { swaggerOperation . getParamByName ( "name" ) ; result = null ; } } ; "<AssertPlaceHolder>" ; } getParameter ( java . lang . String ) { if ( ( parameterMap ) != null ) { java . lang . String [ ] values = parameterMap . get ( name ) ; return values == null ? null : values [ 0 ] ; } return this . vertxRequest . getParam ( name ) ; }
|
org . junit . Assert . assertNull ( request . getParameter ( "name" ) )
|
testFindMostRecentByServiceCode ( ) { java . util . List < org . oscarehr . common . model . BillingService > bss = dao . findMostRecentByServiceCode ( "VOTGVNO" ) ; "<AssertPlaceHolder>" ; } findMostRecentByServiceCode ( java . lang . String ) { javax . persistence . Query query = entityManager . createNativeQuery ( ( "select<sp>*<sp>from<sp>billingservice<sp>b<sp>where<sp>b.service_code<sp>like<sp>:serviceCode<sp>and<sp>b.billingservice_date<sp>=<sp>" + "(select<sp>max(b2.billingservice_date)<sp>from<sp>billingservice<sp>b2<sp>where<sp>b2.service_code<sp>=<sp>b.service_code<sp>and<sp>b2.billingservice_date<sp><=<sp>now())" ) , org . oscarehr . common . model . BillingService . class ) ; query . setParameter ( "serviceCode" , ( serviceCode + "%" ) ) ; return query . getResultList ( ) ; }
|
org . junit . Assert . assertNotNull ( bss )
|
testDeleteQueue ( ) { com . crowdriff . styx . Styx styx = new com . crowdriff . styx . Styx ( new java . lang . String [ ] { "localhost:6700" , "localhost:6701" , "localhost:6702" } ) ; com . crowdriff . styx . TestUtils . clearStorage ( styx . getConnection ( ) ) ; com . crowdriff . styx . StyxQueue q = styx . getQueue ( "testQ" ) ; q . put ( "hello<sp>world1" ) ; q . put ( "hello<sp>world2" ) ; q . put ( "hello<sp>world3" ) ; styx . deleteQueue ( q ) ; java . util . List < redis . clients . jedis . Jedis > all = styx . getConnection ( ) . getAll ( ) ; for ( redis . clients . jedis . Jedis j : all ) { "<AssertPlaceHolder>" ; } } getAll ( ) { return all ; }
|
org . junit . Assert . assertEquals ( null , j . get ( "testQ" ) )
|
shouldCopyReturnACopyOfTheSolution ( ) { int numberOfObjectives = 3 ; double [ ] values = new double [ ] { 1.0 , 2.0 , 3.0 } ; org . uma . jmetal . util . point . PointSolution solution = new org . uma . jmetal . util . point . PointSolution ( numberOfObjectives ) ; org . springframework . test . util . ReflectionTestUtils . setField ( solution , "objectives" , values ) ; org . uma . jmetal . util . point . PointSolution newSolution = ( ( org . uma . jmetal . util . point . PointSolution ) ( solution . copy ( ) ) ) ; "<AssertPlaceHolder>" ; } copy ( ) { return null ; }
|
org . junit . Assert . assertEquals ( solution , newSolution )
|
assertYearsMonthsDaysInvariant_T1UntilT2_Eq_T2UntilT1Inv ( ) { net . time4j . Duration < net . time4j . CalendarUnit > p1 = this . start . until ( this . end , net . time4j . Duration . in ( net . time4j . CalendarUnit . YEARS , net . time4j . CalendarUnit . MONTHS , net . time4j . CalendarUnit . DAYS ) ) ; net . time4j . Duration < net . time4j . CalendarUnit > p2 = this . end . until ( this . start , net . time4j . Duration . in ( net . time4j . CalendarUnit . YEARS , net . time4j . CalendarUnit . MONTHS , net . time4j . CalendarUnit . DAYS ) ) ; "<AssertPlaceHolder>" ; } inverse ( ) { return net . time4j . engine . CalendarDays . of ( java . lang . Math . negateExact ( this . days ) ) ; }
|
org . junit . Assert . assertThat ( p1 , org . hamcrest . CoreMatchers . is ( p2 . inverse ( ) ) )
|
testAsColumnObjects ( ) { org . numenta . nupic . model . Connections cn = new org . numenta . nupic . model . Connections ( ) ; cn . setColumnDimensions ( new int [ ] { 64 , 64 } ) ; cn . setCellsPerColumn ( 4 ) ; org . numenta . nupic . algorithms . TemporalMemory . init ( cn ) ; int [ ] indexes = new int [ ] { 0 , 3 , 4 , 4095 } ; java . util . Set < java . lang . Integer > idxSet = new java . util . HashSet < java . lang . Integer > ( java . util . stream . IntStream . of ( indexes ) . boxed ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ; java . util . List < org . numenta . nupic . model . Column > columns = cn . asColumnObjects ( idxSet ) ; for ( org . numenta . nupic . model . Column column : columns ) "<AssertPlaceHolder>" ; } getIndex ( ) { return index ; }
|
org . junit . Assert . assertTrue ( idxSet . contains ( column . getIndex ( ) ) )
|
testGetUserInUserNameWhenHasPoundNoUser ( ) { java . lang . String testUser = "#zone" ; java . lang . String expected = "" ; java . lang . String actual = org . irods . jargon . core . utils . MiscIRODSUtils . getUserInUserName ( testUser ) ; "<AssertPlaceHolder>" ; } getUserInUserName ( java . lang . String ) { if ( ( userName == null ) || ( userName . isEmpty ( ) ) ) { return "" ; } int indexOfPound = userName . indexOf ( '#' ) ; if ( indexOfPound == ( - 1 ) ) { return userName ; } else { return userName . substring ( 0 , indexOfPound ) ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testGetSuperAdminListReturnsNull ( ) { when ( authorizationRepository . getSuperAdminRoleList ( ) ) . thenReturn ( null ) ; java . util . List < com . intuit . wasabi . authorizationobjects . UserRole > roles = defaultAuthorization . getSuperAdminRoleList ( ) ; "<AssertPlaceHolder>" ; } getSuperAdminRoleList ( ) { com . intuit . wasabi . repository . cassandra . impl . CassandraAuthorizationRepository . LOGGER . debug ( "Getting<sp>super<sp>admin<sp>role<sp>list" ) ; java . util . List < com . intuit . wasabi . repository . cassandra . pojo . UserRole > allUserRoles = userRoleAccessor . getAllUserRoles ( ) . all ( ) ; com . intuit . wasabi . repository . cassandra . impl . CassandraAuthorizationRepository . LOGGER . debug ( "Received<sp>all<sp>roles<sp>{}" , allUserRoles ) ; java . util . List < com . intuit . wasabi . authorizationobjects . UserRole > superAdmins = allUserRoles . stream ( ) . filter ( ( userRole ) -> ( Role . SUPERADMIN . toString ( ) . equalsIgnoreCase ( userRole . getRole ( ) . toString ( ) ) ) && ( com . intuit . wasabi . repository . cassandra . impl . CassandraAuthorizationRepository . ALL_APPLICATIONS . equals ( userRole . getAppName ( ) ) ) ) . map ( ( userRole ) -> getRoleWithUserInfo ( userRole ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; com . intuit . wasabi . repository . cassandra . impl . CassandraAuthorizationRepository . LOGGER . debug ( "Returning<sp>{}<sp>roles" , superAdmins ) ; return superAdmins ; }
|
org . junit . Assert . assertEquals ( null , roles )
|
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . dynamic . data . mapping . model . DDMFormInstanceRecordVersion missingDDMFormInstanceRecordVersion = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
|
org . junit . Assert . assertNull ( missingDDMFormInstanceRecordVersion )
|
testUsernameIsNullSetAuthenticator ( ) { com . ewcms . publication . deploy . DeployOperatorable operator = new com . ewcms . publication . deploy . provider . DeployOperatorBaseTest . DeployOperatorBaseImpl . Builder ( ) . build ( ) ; org . apache . commons . vfs2 . FileSystemOptions opts = new org . apache . commons . vfs2 . FileSystemOptions ( ) ; com . ewcms . publication . deploy . provider . DeployOperatorBase operatorBase = ( ( com . ewcms . publication . deploy . provider . DeployOperatorBase ) ( operator ) ) ; operatorBase . setAuthenticator ( opts , null , null ) ; org . apache . commons . vfs2 . UserAuthenticator auth = org . apache . commons . vfs2 . impl . DefaultFileSystemConfigBuilder . getInstance ( ) . getUserAuthenticator ( opts ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { return com . ewcms . content . document . util . analyzer . dic . Dictionary . singleton ; }
|
org . junit . Assert . assertNull ( auth )
|
testSort ( ) { p . set ( joist . util . Copy . list ( "c" , "b" ) ) ; p . sort ( org . tessell . tests . model . properties . ListPropertyTest . naturalComparator ) ; "<AssertPlaceHolder>" ; } get ( ) { int i = 0 ; for ( org . tessell . tests . model . properties . DummyModel model : models . get ( ) ) { if ( ( ( model . name . get ( ) ) != null ) && ( model . name . get ( ) . startsWith ( "foo" ) ) ) { i ++ ; } } return i ; }
|
org . junit . Assert . assertThat ( p . get ( ) , org . hamcrest . Matchers . contains ( "b" , "c" ) )
|
testToBigInteger ( ) { java . lang . String ip = "ffff::ffff" ; java . math . BigInteger expectedIp = new java . math . BigInteger ( "340277174624079928635746076935439056895" ) ; java . math . BigInteger actualIp = new org . openstack . atlas . util . ip . IPv6 ( ip ) . toBigInteger ( ) ; "<AssertPlaceHolder>" ; } compareTo ( org . openstack . atlas . api . validation . expectation . Expectation ) { return ( id ) - ( o . id ) ; }
|
org . junit . Assert . assertEquals ( expectedIp . compareTo ( actualIp ) , 0 )
|
testVarLongSmall ( ) { long [ ] array = new long [ ] { 1 , 2 , 3 , - 5 , 0 , 12345678987L , Long . MIN_VALUE } ; org . apache . giraph . utils . UnsafeByteArrayOutputStream os = new org . apache . giraph . utils . UnsafeByteArrayOutputStream ( ) ; writeLongs ( os , array ) ; long [ ] resArray = new long [ array . length ] ; org . apache . giraph . utils . UnsafeByteArrayInputStream is = new org . apache . giraph . utils . UnsafeByteArrayInputStream ( os . getByteArray ( ) ) ; readLongs ( is , resArray ) ; "<AssertPlaceHolder>" ; } readLongs ( java . io . DataInput , long [ ] ) { for ( int i = 0 ; i < ( array . length ) ; i ++ ) { array [ i ] = org . apache . giraph . utils . Varint . readSignedVarLong ( in ) ; } }
|
org . junit . Assert . assertArrayEquals ( array , resArray )
|
testEnableMouseCursorTwiceWithId ( ) { expect ( renderDeviceMock . createMouseCursor ( "test" , 10 , 20 ) ) . andReturn ( mouseCursor ) ; renderDeviceMock . enableMouseCursor ( mouseCursor ) ; replay ( renderDeviceMock ) ; niftyMouse . registerMouseCursor ( "id" , "test" , 10 , 20 ) ; niftyMouse . enableMouseCursor ( "id" ) ; niftyMouse . enableMouseCursor ( "id" ) ; "<AssertPlaceHolder>" ; } getCurrentId ( ) { return currentId ; }
|
org . junit . Assert . assertEquals ( "id" , niftyMouse . getCurrentId ( ) )
|
warningMessageTest ( ) { java . io . BufferedReader br = new java . io . BufferedReader ( new java . io . InputStreamReader ( new java . io . FileInputStream ( org . jboss . additional . testsuite . jdkall . present . logging . profiles . NonExistingProfileTestCase . loggingTestLog ) , java . nio . charset . Charset . forName ( "UTF-8" ) ) ) ; java . lang . String line ; boolean warningFound = false ; while ( ( line = br . readLine ( ) ) != null ) { if ( line . contains ( "JBAS011509" ) ) { warningFound = true ; break ; } } br . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { this . context . close ( ) ; }
|
org . junit . Assert . assertTrue ( warningFound )
|
testCreateConfig ( ) { org . osgi . service . cm . Configuration config = cm . getConfiguration ( "test" ) ; "<AssertPlaceHolder>" ; } getPid ( ) { return getPid ( true ) ; }
|
org . junit . Assert . assertEquals ( "test" , config . getPid ( ) )
|
shouldReturnPrimitiveInteger ( ) { final int rows = mapper . updateReturnsPrimitiveInteger ( new org . apache . ibatis . submitted . dml_return_types . User ( 1 , "shouldReturnPrimitiveInteger" ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 1 , rows )
|
test3 ( ) { com . milaboratory . mixcr . util . RunMiXCR . RunMiXCRAnalysis params = new com . milaboratory . mixcr . util . RunMiXCR . RunMiXCRAnalysis ( "/Users/poslavsky/Projects/milab/temp/R1_part.fastq.gz" , "/Users/poslavsky/Projects/milab/temp/R2_part.fastq.gz" ) ; com . milaboratory . mixcr . util . RunMiXCR . AlignResult align = com . milaboratory . mixcr . util . RunMiXCR . align ( params ) ; java . util . List < com . milaboratory . core . io . sequence . PairedRead > reads = new java . util . ArrayList ( ) ; try ( com . milaboratory . core . io . sequence . fastq . PairedFastqReader fReader = new com . milaboratory . core . io . sequence . fastq . PairedFastqReader ( "/Users/poslavsky/Projects/milab/temp/R1_part.fastq.gz" , "/Users/poslavsky/Projects/milab/temp/R2_part.fastq.gz" , true ) ) { for ( com . milaboratory . core . io . sequence . PairedRead s : cc . redberry . pipe . CUtils . it ( fReader ) ) reads . add ( s ) ; } java . io . File tempFile = com . milaboratory . util . TempFileManager . getTempFile ( ) ; try ( com . milaboratory . mixcr . util . VDJCAlignmentsWriter writer = new com . milaboratory . mixcr . util . VDJCAlignmentsWriter ( tempFile ) ) { writer . header ( align . aligner , null ) ; for ( com . milaboratory . mixcr . util . VDJCAlignments alignment : align . alignments ) writer . write ( alignment ) ; } try ( com . milaboratory . mixcr . util . VDJCAlignmentsReader reader = new com . milaboratory . mixcr . util . VDJCAlignmentsReader ( tempFile ) ) { int tr = 0 ; for ( com . milaboratory . mixcr . util . VDJCAlignments alignment : cc . redberry . pipe . CUtils . it ( reader ) ) { com . milaboratory . core . io . sequence . PairedRead actual = reads . get ( ( ( int ) ( alignment . getMinReadId ( ) ) ) ) ; ++ tr ; "<AssertPlaceHolder>" ; } System . out . println ( tr ) ; } } getOriginalReads ( ) { if ( ( targets ) == null ) return null ; com . milaboratory . mixcr . basictypes . VDJCAlignments [ ] result = new com . milaboratory . mixcr . basictypes . VDJCAlignments [ targets . size ( ) ] ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) result [ i ] = targets . get ( i ) . getAlignments ( ) ; return com . milaboratory . mixcr . basictypes . VDJCAlignments . mergeOriginalReads ( result ) ; }
|
org . junit . Assert . assertEquals ( actual , alignment . getOriginalReads ( ) . get ( 0 ) )
|
testExpectedHashVariableLength ( ) { byte [ ] bytes = new byte [ 512 ] ; new java . util . Random ( 23 ) . nextBytes ( bytes ) ; for ( int i = 0 ; i <= ( bytes . length ) ; i ++ ) { int expected = org . greenrobot . essentials . hash . otherhashes . MurmurHash3Yonik . murmurhash3_x86_32 ( bytes , 0 , i , 0 ) ; checksum . reset ( ) ; checksum . update ( bytes , 0 , i ) ; int value = ( ( int ) ( checksum . getValue ( ) ) ) ; "<AssertPlaceHolder>" ; } } getValue ( ) { return ( hash ) & 4294967295L ; }
|
org . junit . Assert . assertEquals ( expected , value )
|
itReturnsASetOfCredentials ( ) { try { provider . getValue ( context ) ; org . junit . Assert . fail ( "should<sp>have<sp>thrown<sp>a<sp>WebApplicationException<sp>but<sp>didn't" ) ; } catch ( javax . ws . rs . WebApplicationException e ) { "<AssertPlaceHolder>" . isEqualTo ( Credentials . CHALLENGE ) ; } } getResponse ( ) { return javax . ws . rs . core . Response . status ( com . wesabe . grendel . representations . ValidationException . UNPROCESSABLE_ENTITY ) . type ( MediaType . TEXT_PLAIN ) . entity ( msgBuilder . toString ( ) ) . build ( ) ; }
|
org . junit . Assert . assertThat ( e . getResponse ( ) )
|
test ( ) { org . seasar . extension . jdbc . gen . internal . exception . NextVersionExceededRuntimeException e = new org . seasar . extension . jdbc . gen . internal . exception . NextVersionExceededRuntimeException ( "aaa" ) ; "<AssertPlaceHolder>" ; System . out . println ( e . getMessage ( ) ) ; } getDdlInfoFilePath ( ) { return ddlInfoFilePath ; }
|
org . junit . Assert . assertEquals ( "aaa" , e . getDdlInfoFilePath ( ) )
|
gettingOCSPNonceShouldReturnNull_inCaseOfOlderAiaOcsp ( ) { this . configuration . setPreferAiaOcsp ( true ) ; org . digidoc4j . impl . CommonOCSPSource source = new org . digidoc4j . impl . CommonOCSPSource ( this . configuration ) ; java . security . cert . X509Certificate certificate = this . pkcs12EccSignatureToken . getCertificate ( ) ; source . getAccessLocation ( certificate ) ; org . bouncycastle . asn1 . x509 . Extension nonce = source . createNonce ( certificate ) ; "<AssertPlaceHolder>" ; } createNonce ( java . security . cert . X509Certificate ) { this . LOGGER . debug ( "Creating<sp>TM<sp>OCSP<sp>nonce<sp>..." ) ; try { return new org . bouncycastle . asn1 . x509 . Extension ( org . bouncycastle . asn1 . ocsp . OCSPObjectIdentifiers . id_pkix_ocsp_nonce , false , this . createSequence ( ) . getEncoded ( ) ) ; } catch ( java . io . IOException e ) { throw new org . digidoc4j . exceptions . DigiDoc4JException ( e ) ; } }
|
org . junit . Assert . assertNull ( nonce )
|
testConfigure_ConfigurableObject ( ) { com . ngdata . hbaseindexer . ConfigureUtilTest . ConfigurableObject configurable = new com . ngdata . hbaseindexer . ConfigureUtilTest . ConfigurableObject ( ) ; java . util . Map < java . lang . String , java . lang . String > params = com . google . common . collect . Maps . newHashMap ( ) ; params . put ( "key" , "value" ) ; com . ngdata . hbaseindexer . ConfigureUtil . configure ( configurable , params ) ; "<AssertPlaceHolder>" ; } configure ( java . lang . Object , java . util . Map ) { if ( obj instanceof com . ngdata . hbaseindexer . Configurable ) { ( ( com . ngdata . hbaseindexer . Configurable ) ( obj ) ) . configure ( config ) ; } }
|
org . junit . Assert . assertEquals ( params , configurable . params )
|
matchingWildcardSucceeds ( ) { result = topicGraph . getAtomsByTitleQuery ( "Arth*" , filter ) ; "<AssertPlaceHolder>" ; } getAtomsByTitleQuery ( java . lang . String , net . fortytwo . smsn . brain . model . Filter ) { return filterAndSort ( wrapper . getVerticesByTitle ( query ) , filter ) ; }
|
org . junit . Assert . assertEquals ( 1 , result . size ( ) )
|
loadReturnsEmptyDataWhenExceptionThrownWhenObtainingInputStream ( ) { doThrow ( java . io . IOException . class ) . when ( this . oncoTree ) . getInputStream ( any ( java . net . URL . class ) ) ; final java . util . Collection < org . apache . solr . common . SolrInputDocument > data = this . oncoTree . load ( this . url ) ; verify ( this . logger ) . error ( "Failed<sp>to<sp>load<sp>vocabulary<sp>source:<sp>{}" , ( ( java . lang . Object ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( org . apache . commons . lang3 . StringUtils . isBlank ( this . status ) ) && ( org . apache . commons . lang3 . StringUtils . isBlank ( this . notes ) ) ) && ( ( ( this . pubmedIds ) == null ) || ( this . pubmedIds . isEmpty ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( data . isEmpty ( ) )
|
testFetchByPrimaryKeyExisting ( ) { com . liferay . asset . display . page . model . AssetDisplayPageEntry newAssetDisplayPageEntry = addAssetDisplayPageEntry ( ) ; com . liferay . asset . display . page . model . AssetDisplayPageEntry existingAssetDisplayPageEntry = _persistence . fetchByPrimaryKey ( newAssetDisplayPageEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertEquals ( existingAssetDisplayPageEntry , newAssetDisplayPageEntry )
|
testExtractsMostSpecificDriverName ( ) { java . lang . StackTraceElement [ ] stackTrace = new java . lang . StackTraceElement [ 3 ] ; stackTrace [ 0 ] = new java . lang . StackTraceElement ( "SomeClass" , "someMethod" , "SomeClass.java" , 5 ) ; stackTrace [ 1 ] = new java . lang . StackTraceElement ( "RemoteWebDriver" , "someMethod" , "RemoteWebDriver.java" , 5 ) ; stackTrace [ 2 ] = new java . lang . StackTraceElement ( "FirefoxDriver" , "someMethod" , "FirefoxDriver.java" , 5 ) ; java . lang . String gotName = org . openqa . selenium . WebDriverException . getDriverName ( stackTrace ) ; "<AssertPlaceHolder>" ; } getDriverName ( java . lang . StackTraceElement [ ] ) { java . lang . String driverName = "unknown" ; for ( java . lang . StackTraceElement e : stackTraceElements ) { if ( e . getClassName ( ) . endsWith ( "Driver" ) ) { java . lang . String [ ] bits = e . getClassName ( ) . split ( "\\." ) ; driverName = bits [ ( ( bits . length ) - 1 ) ] ; } } return driverName ; }
|
org . junit . Assert . assertEquals ( "FirefoxDriver" , gotName )
|
offsetOneDay ( ) { net . time4j . clock . AdjustableClock clock = net . time4j . clock . AdjustableClock . of ( SystemClock . INSTANCE ) . withOffset ( 1 , java . util . concurrent . TimeUnit . DAYS ) ; net . time4j . PlainDate tomorrow = net . time4j . SystemClock . inLocalView ( ) . today ( ) . plus ( 1 , CalendarUnit . DAYS ) ; "<AssertPlaceHolder>" ; } inLocalView ( ) { return new net . time4j . ZonalClock ( this , net . time4j . tz . Timezone . ofSystem ( ) ) ; }
|
org . junit . Assert . assertThat ( clock . inLocalView ( ) . today ( ) , org . hamcrest . CoreMatchers . is ( tomorrow ) )
|
shouldMatchAllWhenNoPropertyFilterIsSet ( ) { eventFilter . getPropFilters ( ) . clear ( ) ; java . util . Set < org . unitedinternet . cosmo . model . ICalendarItem > queryEvents = calendarDao . findCalendarItems ( calendar , filter ) ; "<AssertPlaceHolder>" ; } findCalendarItems ( org . unitedinternet . cosmo . model . CollectionItem , org . unitedinternet . cosmo . calendar . query . CalendarFilter ) { try { org . unitedinternet . cosmo . dao . query . hibernate . CalendarFilterConverter filterConverter = new org . unitedinternet . cosmo . dao . query . hibernate . CalendarFilterConverter ( ) ; try { if ( collection instanceof org . unitedinternet . cosmo . model . hibernate . HibCollectionItem ) { java . util . Set < org . unitedinternet . cosmo . model . ICalendarItem > results = new java . util . HashSet < org . unitedinternet . cosmo . model . ICalendarItem > ( ) ; java . util . Set < org . unitedinternet . cosmo . model . Item > itemsToProcess = collection . getChildren ( ) ; org . unitedinternet . cosmo . calendar . query . CalendarFilterEvaluater evaluater = new org . unitedinternet . cosmo . calendar . query . CalendarFilterEvaluater ( ) ; for ( org . unitedinternet . cosmo . model . Item child : itemsToProcess ) { if ( child instanceof org . unitedinternet . cosmo . model . ICalendarItem ) { org . unitedinternet . cosmo . model . ICalendarItem content = ( ( org . unitedinternet . cosmo . model . ICalendarItem ) ( child ) ) ; net . fortuna . ical4j . model . Calendar calendar = entityConverter . convertContent ( content ) ; if ( ( calendar != null ) && ( evaluater . evaluate ( calendar , filter ) ) ) { results . add ( content ) ; } } } return results ; } catch ( org . hibernate . HibernateException e ) { this . em . clear ( ) ; throw org . springframework . orm . hibernate5 . SessionFactoryUtils . convertHibernateAccessException ( e ) ; } }
|
org . junit . Assert . assertEquals ( 5 , queryEvents . size ( ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.