input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testEchoBytes ( ) { java . util . Random random = new java . util . Random ( ) ; int length = random . nextInt ( ( 1024 * 16 ) ) ; byte [ ] data = new byte [ length ] ; random . nextBytes ( data ) ; byte [ ] echoed = org . apache . avro . TestProtocolReflect . proxy . echoBytes ( data ) ; "<AssertPlaceHolder>" ; } echoBytes ( java . nio . ByteBuffer ) { return data ; }
|
org . junit . Assert . assertArrayEquals ( data , echoed )
|
findReturnsNullWhenVersionTagValueDoesNotEndWithAnCloseChar ( ) { java . lang . String mavenVersionRange = "()1.0" ; findReturnsValueWhenVersionTagValueIsSet ( mavenVersionRange ) ; "<AssertPlaceHolder>" ; } find ( ) { org . apache . maven . artifact . versioning . ArtifactVersion childMavenVersion = getHighestArtifactVersion ( getPrerequisitesMavenVersion ( ) , getEnforcerMavenVersion ( ) ) ; if ( ! ( mavenProject . hasParent ( ) ) ) { return childMavenVersion ; } org . apache . maven . artifact . versioning . ArtifactVersion parentMavenVersion = new org . codehaus . mojo . versions . RequiredMavenVersionFinder ( mavenProject . getParent ( ) ) . find ( ) ; return getHighestArtifactVersion ( childMavenVersion , parentMavenVersion ) ; }
|
org . junit . Assert . assertNull ( new org . codehaus . mojo . versions . RequiredMavenVersionFinder ( mavenProject ) . find ( ) )
|
isConsistent_duplicates ( ) { org . bitcoinj . core . Transaction tx = createFakeTx ( org . bitcoinj . wallet . PARAMS , org . bitcoinj . wallet . COIN , myAddress ) ; org . bitcoinj . core . TransactionOutput output = new org . bitcoinj . core . TransactionOutput ( PARAMS , tx , valueOf ( 0 , 5 ) , OTHER_ADDRESS ) ; tx . addOutput ( output ) ; wallet . receiveFromBlock ( tx , null , BlockChain . NewBlockType . BEST_CHAIN , 0 ) ; "<AssertPlaceHolder>" ; org . bitcoinj . core . Transaction txClone = org . bitcoinj . wallet . PARAMS . getDefaultSerializer ( ) . makeTransaction ( tx . bitcoinSerialize ( ) ) ; try { wallet . receiveFromBlock ( txClone , null , BlockChain . NewBlockType . BEST_CHAIN , 0 ) ; org . junit . Assert . fail ( "Illegal<sp>argument<sp>not<sp>thrown<sp>when<sp>it<sp>should<sp>have<sp>been." ) ; } catch ( java . lang . IllegalStateException ex ) { } } isConsistent ( ) { try { isConsistentOrThrow ( ) ; return true ; } catch ( java . lang . IllegalStateException x ) { org . bitcoinj . wallet . Wallet . log . error ( x . getMessage ( ) ) ; try { org . bitcoinj . wallet . Wallet . log . error ( toString ( ) ) ; } catch ( java . lang . RuntimeException x2 ) { org . bitcoinj . wallet . Wallet . log . error ( "Printing<sp>inconsistent<sp>wallet<sp>failed" , x2 ) ; } return false ; } }
|
org . junit . Assert . assertTrue ( wallet . isConsistent ( ) )
|
testAlreadyHasAlias ( ) { java . lang . String [ ] aliases = initAliases ( ) ; com . ewcms . publication . freemarker . directive . ArticleDirective directive = new com . ewcms . publication . freemarker . directive . ArticleDirective ( ) ; for ( java . lang . String alias : aliases ) { java . lang . String name = directive . getPropertyName ( alias ) ; "<AssertPlaceHolder>" ; } } getPropertyName ( java . lang . String ) { java . lang . String property = aliasProperties . get ( name ) ; if ( com . ewcms . common . lang . EmptyUtil . isNull ( property ) ) { com . ewcms . publication . freemarker . directive . ArticleDirective . logger . error ( "Get<sp>not<sp>property<sp>name<sp>of<sp>\"{}\"" , name ) ; throw new freemarker . template . TemplateModelException ( ( ( "Get<sp>not<sp>property<sp>name<sp>of<sp>\"" + name ) + "\"" ) ) ; } return property ; }
|
org . junit . Assert . assertNotNull ( name )
|
testSerial ( ) { com . ctrip . xpipe . tuple . Pair < java . lang . Boolean , java . lang . String > pair = new com . ctrip . xpipe . tuple . Pair ( true , "hello" ) ; java . lang . String encode = JsonCodec . INSTANCE . encode ( pair ) ; logger . info ( "{}" , encode ) ; com . ctrip . xpipe . tuple . Pair < java . lang . Boolean , java . lang . String > decode = JsonCodec . INSTANCE . decode ( encode , new com . ctrip . xpipe . api . codec . GenericTypeReference < com . ctrip . xpipe . tuple . Pair < java . lang . Boolean , java . lang . String > > ( ) { } ) ; "<AssertPlaceHolder>" ; } decode ( io . netty . channel . ChannelHandlerContext , io . netty . buffer . ByteBuf , java . util . List ) { try { while ( in . isReadable ( ) ) { switch ( currentState ) { case INIT_BLOCK : if ( ! ( isHeaderComplete ( in ) ) ) { return ; } checkMagic ( in ) ; analyzeHeader ( in ) ; break ; case DECOMPRESS_DATA : if ( ( in . readableBytes ( ) ) < ( compressedLength ) ) { return ; } io . netty . buffer . ByteBuf uncompressed = null ; try { switch ( blockType ) { case BLOCK_TYPE_NON_COMPRESSED : uncompressed = in . retainedSlice ( in . readerIndex ( ) , decompressedLength ) ; break ; case BLOCK_TYPE_COMPRESSED : uncompressed = ctx . alloc ( ) . buffer ( decompressedLength , decompressedLength ) ; com . github . luben . zstd . Zstd . decompress ( uncompressed . internalNioBuffer ( uncompressed . writerIndex ( ) , decompressedLength ) , safeNioBuffer ( in ) ) ; uncompressed . writerIndex ( ( ( uncompressed . writerIndex ( ) ) + ( decompressedLength ) ) ) ; break ; default : throw new io . netty . handler . codec . compression . DecompressionException ( java . lang . String . format ( "unexpected<sp>blockType:<sp>%d<sp>(expected:<sp>%d<sp>or<sp>%d)" , blockType , com . ctrip . xpipe . redis . proxy . handler . BLOCK_TYPE_NON_COMPRESSED , com . ctrip . xpipe . redis . proxy . handler . BLOCK_TYPE_COMPRESSED ) ) ; } in . skipBytes ( compressedLength ) ; checkDecompressLength ( uncompressed ) ; if ( validateCheckSum ) { checkChecksum ( uncompressed , currentChecksum ) ; } out . add ( uncompressed ) ; uncompressed = null ; currentState = com . ctrip . xpipe . redis . proxy . handler . ZstdDecoder . State . INIT_BLOCK ; } catch ( java . lang . Exception e ) { throw new io . netty . handler . codec . compression . DecompressionException ( e ) ; } finally { if ( uncompressed != null ) { uncompressed . release ( ) ; } } break ; case FINISHED : case CORRUPTED : in . skipBytes ( in . readableBytes ( ) ) ; break ; default : throw new java . lang . IllegalStateException ( ) ; } } } catch ( java . lang . Exception e ) { currentState = com . ctrip . xpipe . redis . proxy . handler . ZstdDecoder . State . CORRUPTED ; throw e ; } }
|
org . junit . Assert . assertEquals ( pair , decode )
|
testAddAutocompleteSectionAfterSettingWithSection ( ) { com . github . bordertech . wcomponents . WSingleSelect field = new com . github . bordertech . wcomponents . WSingleSelect ( ) ; java . lang . String sectionName = "foo" ; java . lang . String otherSectionName = "bar" ; field . setAutocomplete ( Person . FAMILY ) ; field . addAutocompleteSection ( otherSectionName ) ; java . lang . String expected = com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . getCombinedForSection ( sectionName , com . github . bordertech . wcomponents . autocomplete . AutocompleteUtil . getNamedSection ( otherSectionName ) , Person . FAMILY . getValue ( ) ) ; field . addAutocompleteSection ( sectionName ) ; "<AssertPlaceHolder>" ; } getAutocomplete ( ) { return getComponentModel ( ) . autocomplete ; }
|
org . junit . Assert . assertEquals ( expected , field . getAutocomplete ( ) )
|
test_isQualifierEqual_AnnotationLiteral_Different_array ( ) { org . apache . webbeans . test . util . TestQualifier q1 = new org . apache . webbeans . test . util . TestQualifierAnnotationLiteral ( ) ; org . apache . webbeans . test . util . TestQualifierAnnotationLiteral q2 = new org . apache . webbeans . test . util . TestQualifierAnnotationLiteral ( ) ; q2 . setFloatArray ( new float [ ] { 47.0F , 11.0F } ) ; "<AssertPlaceHolder>" ; } isCdiAnnotationEqual ( java . lang . annotation . Annotation , java . lang . annotation . Annotation ) { if ( ( annotation1 == null ) && ( annotation2 == null ) ) { return true ; } if ( ( ( annotation1 == null ) && ( annotation2 != null ) ) || ( ( annotation1 != null ) && ( annotation2 == null ) ) ) { return false ; } if ( annotation1 == annotation2 ) { return true ; } java . lang . Class < ? extends java . lang . annotation . Annotation > qualifier1AnnotationType = annotation1 . annotationType ( ) ; if ( ( qualifier1AnnotationType == null ) || ( ! ( qualifier1AnnotationType . equals ( annotation2 . annotationType ( ) ) ) ) ) { return false ; } java . util . List < java . lang . reflect . Method > bindingCdiAnnotationMethods = org . apache . webbeans . util . AnnotationUtil . getBindingCdiAnnotationMethods ( qualifier1AnnotationType ) ; return org . apache . webbeans . util . AnnotationUtil . areParamEquals ( annotation1 , annotation2 , bindingCdiAnnotationMethods ) ; }
|
org . junit . Assert . assertFalse ( org . apache . webbeans . util . AnnotationUtil . isCdiAnnotationEqual ( q1 , q2 ) )
|
testToFixedgrid50plus1 ( ) { java . util . SortedSet < org . onosproject . net . OchSignal > input = org . onosproject . net . DefaultOchSignalComparator . newOchSignalTreeSet ( ) ; input . addAll ( com . google . common . collect . ImmutableList . of ( org . onosproject . net . OchSignal . newFlexGridSlot ( ( 8 - 3 ) ) , org . onosproject . net . OchSignal . newFlexGridSlot ( ( 8 - 1 ) ) , org . onosproject . net . OchSignal . newFlexGridSlot ( ( 8 + 1 ) ) , org . onosproject . net . OchSignal . newFlexGridSlot ( ( 8 + 3 ) ) ) ) ; org . onosproject . net . OchSignal expected = org . onosproject . net . OchSignal . newDwdmSlot ( org . onosproject . net . ChannelSpacing . CHL_50GHZ , 1 ) ; "<AssertPlaceHolder>" ; } toFixedGrid ( java . util . List , org . onosproject . net . ChannelSpacing ) { int ratio = ( ( int ) ( ( spacing . frequency ( ) . asHz ( ) ) / ( ChannelSpacing . CHL_12P5GHZ . frequency ( ) . asHz ( ) ) ) ) ; checkArgument ( ( ( lambdas . size ( ) ) == ratio ) , "%s<sp>!=<sp>%s" , lambdas . size ( ) , ratio ) ; lambdas . forEach ( ( x ) -> checkArgument ( ( ( x . gridType ( ) ) == GridType . FLEX ) , x . gridType ( ) ) ) ; lambdas . forEach ( ( x ) -> checkArgument ( ( ( x . channelSpacing ( ) ) == ChannelSpacing . CHL_6P25GHZ ) , x . channelSpacing ( ) ) ) ; lambdas . forEach ( ( x ) -> checkArgument ( ( ( x . slotGranularity ( ) ) == 1 ) , x . slotGranularity ( ) ) ) ; java . util . stream . IntStream . range ( 1 , lambdas . size ( ) ) . forEach ( ( i ) -> checkArgument ( ( ( lambdas . get ( i ) . spacingMultiplier ( ) ) == ( ( lambdas . get ( ( i - 1 ) ) . spacingMultiplier ( ) ) + 2 ) ) ) ) ; int spacingMultiplier = ( ( lambdas . stream ( ) . mapToInt ( org . onosproject . net . OchSignal :: spacingMultiplier ) . sum ( ) ) / ( lambdas . size ( ) ) ) / ( ( int ) ( ( spacing . frequency ( ) . asHz ( ) ) / ( org . onosproject . net . ChannelSpacing . CHL_6P25GHZ . frequency ( ) . asHz ( ) ) ) ) ; return new org . onosproject . net . OchSignal ( GridType . DWDM , spacing , spacingMultiplier , lambdas . size ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , org . onosproject . net . OchSignal . toFixedGrid ( com . google . common . collect . Lists . newArrayList ( input ) , org . onosproject . net . ChannelSpacing . CHL_50GHZ ) )
|
testConvertValid ( ) { com . streamsets . pipeline . api . impl . FileRefTypeSupport frTs = new com . streamsets . pipeline . api . impl . FileRefTypeSupport ( ) ; byte [ ] data = "This<sp>is<sp>streamsets<sp>file<sp>ref<sp>support" . getBytes ( ) ; com . streamsets . pipeline . api . TestFileRef . ByteArrayRef byteArrayRef = new com . streamsets . pipeline . api . TestFileRef . ByteArrayRef ( data ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . Object ) { return value != null ? supporter . convert ( value ) : null ; }
|
org . junit . Assert . assertSame ( byteArrayRef , frTs . convert ( byteArrayRef ) )
|
testAddReplaceValue ( ) { v8 . add ( "foo" , true ) ; v8 . add ( "foo" , "test" ) ; java . lang . String result = v8 . executeStringScript ( "foo" ) ; "<AssertPlaceHolder>" ; } executeStringScript ( java . lang . String ) { return executeStringScript ( script , null , 0 ) ; }
|
org . junit . Assert . assertEquals ( "test" , result )
|
shouldAndWhereConditionsFromMultipeWhereClauseSqlGenerators ( ) { java . lang . String selectClause = uniqueString ( ) ; java . lang . String fromClause = uniqueString ( ) ; setupSelectAndFromClause ( selectClause , fromClause ) ; java . lang . String whereCondition1 = "a" + ( uniqueString ( ) ) ; java . lang . String whereCondition2 = "b" + ( uniqueString ( ) ) ; given ( whereClauseSqlGenerator . whereConditions ( eq ( queryData ) , eq ( alternative ) , anyString ( ) ) ) . willReturn ( newSet ( whereCondition1 ) ) ; annis . sqlgen . WhereClauseSqlGenerator whereClauseSqlGenerator2 = mock ( annis . sqlgen . WhereClauseSqlGenerator . class ) ; given ( whereClauseSqlGenerator2 . whereConditions ( eq ( queryData ) , eq ( alternative ) , anyString ( ) ) ) . willReturn ( newSet ( whereCondition2 ) ) ; whereClauseSqlGenerators . add ( whereClauseSqlGenerator2 ) ; java . lang . String sql = generator . toSql ( queryData ) ; java . lang . String expected = createMinimalSqlStatement ( selectClause , fromClause ) ; expected += ( ( ( ( ( "WHERE\n" + "<sp>" ) + whereCondition1 ) + "<sp>AND\n" ) + "<sp>" ) + whereCondition2 ) + "\n" ; "<AssertPlaceHolder>" ; } createMinimalSqlStatement ( java . lang . String , java . lang . String ) { java . lang . String expected = ( ( ( ( ( ( "SELECT<sp>" + selectClause ) + "\n" ) + "FROM" ) + "\n" ) + "<sp>" ) + fromClause ) + "\n" ; return expected ; }
|
org . junit . Assert . assertThat ( sql , org . hamcrest . CoreMatchers . is ( expected ) )
|
restoreWithFilterRecordsWarningWhenFileIsNotNormalAndMatching ( ) { java . nio . file . Path symlink = ddfHome . resolve ( createSoftLink ( "symlink" , path ) ) ; when ( mockPathUtils . resolveAgainstDDFHome ( any ( java . nio . file . Path . class ) ) ) . thenReturn ( symlink ) ; entry = new org . codice . ddf . configuration . migration . ImportMigrationExternalEntryImpl ( mockContext , org . codice . ddf . configuration . migration . ImportMigrationExternalEntryImplTest . METADATA_MAP ) ; "<AssertPlaceHolder>" ; verify ( mockPathUtils ) . getChecksumFor ( any ( java . nio . file . Path . class ) ) ; verifyReportHasMatchingWarning ( report , "is<sp>not<sp>a<sp>regular<sp>file" ) ; } restore ( boolean , java . nio . file . PathMatcher ) { org . apache . commons . lang . Validate . notNull ( filter , "invalid<sp>null<sp>path<sp>filter" ) ; if ( ( restored ) == null ) { this . restored = false ; if ( filter . matches ( path ) ) { this . restored = handleRestore ( required , filter ) ; } else { this . restored = handleRestoreWhenFilterNotMatching ( required ) ; } } return restored ; }
|
org . junit . Assert . assertThat ( entry . restore ( true , ( p ) -> true ) , org . hamcrest . CoreMatchers . equalTo ( true ) )
|
assertProperties ( ) { boolean showSQL = getShardingProperties ( "defaultMasterSlaveDataSourceOrchestration" ) . getValue ( ShardingPropertiesConstant . SQL_SHOW ) ; "<AssertPlaceHolder>" ; } getValue ( int ) { if ( metaData . isAggregationDistinctColumnIndex ( columnIndex ) ) { return ( org . apache . shardingsphere . core . constant . AggregationType . COUNT ) == ( metaData . getAggregationType ( columnIndex ) ) ? 1 : super . getValue ( columnIndex , java . lang . Object . class ) ; } if ( metaData . isDerivedCountColumnIndex ( columnIndex ) ) { return 1 ; } if ( metaData . isDerivedSumColumnIndex ( columnIndex ) ) { return super . getValue ( metaData . getAggregationDistinctColumnIndex ( columnIndex ) , java . lang . Object . class ) ; } return super . getValue ( columnIndex , java . lang . Object . class ) ; }
|
org . junit . Assert . assertTrue ( showSQL )
|
testConstructor ( ) { org . openhealthtools . mdht . uml . cda . hitsp . operations . ResultOperations obj = new org . openhealthtools . mdht . uml . cda . hitsp . operations . ResultOperations ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testCnnSamePaddingModeStrided ( ) { int nOut = 2 ; int [ ] minibatchSizes = new int [ ] { 1 , 3 } ; int width = 16 ; int height = 16 ; int [ ] kernelSizes = new int [ ] { 2 , 3 } ; int [ ] strides = new int [ ] { 1 , 2 , 3 } ; int [ ] inputDepths = new int [ ] { 1 , 3 } ; org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 12345 ) ; for ( int inputDepth : inputDepths ) { for ( int minibatchSize : minibatchSizes ) { for ( int stride : strides ) { for ( int k : kernelSizes ) { for ( boolean convFirst : new boolean [ ] { true , false } ) { org . nd4j . linalg . api . ndarray . INDArray input = org . nd4j . linalg . factory . Nd4j . rand ( minibatchSize , ( ( width * height ) * inputDepth ) ) ; org . nd4j . linalg . api . ndarray . INDArray labels = org . nd4j . linalg . factory . Nd4j . zeros ( minibatchSize , nOut ) ; for ( int i = 0 ; i < minibatchSize ; i ++ ) { labels . putScalar ( new int [ ] { i , i % nOut } , 1.0 ) ; } org . deeplearning4j . gradientcheck . Layer convLayer = new org . deeplearning4j . gradientcheck . ConvolutionLayer . Builder ( ) . name ( "layer<sp>0" ) . kernelSize ( k , k ) . stride ( stride , stride ) . padding ( 0 , 0 ) . nIn ( inputDepth ) . nOut ( 2 ) . build ( ) ; org . deeplearning4j . gradientcheck . Layer poolLayer = new org . deeplearning4j . gradientcheck . SubsamplingLayer . Builder ( ) . poolingType ( SubsamplingLayer . PoolingType . MAX ) . kernelSize ( k , k ) . stride ( stride , stride ) . padding ( 0 , 0 ) . build ( ) ; org . deeplearning4j . nn . conf . MultiLayerConfiguration conf = new org . deeplearning4j . nn . conf . NeuralNetConfiguration . Builder ( ) . seed ( 12345 ) . updater ( new org . nd4j . linalg . learning . config . NoOp ( ) ) . activation ( Activation . TANH ) . convolutionMode ( org . deeplearning4j . nn . conf . ConvolutionMode . Same ) . list ( ) . layer ( 0 , ( convFirst ? convLayer : poolLayer ) ) . layer ( 1 , ( convFirst ? poolLayer : convLayer ) ) . layer ( 2 , new org . deeplearning4j . gradientcheck . OutputLayer . Builder ( LossFunctions . LossFunction . MCXENT ) . activation ( Activation . SOFTMAX ) . nOut ( nOut ) . build ( ) ) . setInputType ( org . deeplearning4j . nn . conf . inputs . InputType . convolutionalFlat ( height , width , inputDepth ) ) . build ( ) ; org . deeplearning4j . nn . multilayer . MultiLayerNetwork net = new org . deeplearning4j . nn . multilayer . MultiLayerNetwork ( conf ) ; net . init ( ) ; for ( int i = 0 ; i < ( net . getLayers ( ) . length ) ; i ++ ) { System . out . println ( ( ( ( "nParams,<sp>layer<sp>" + i ) + ":<sp>" ) + ( net . getLayer ( i ) . numParams ( ) ) ) ) ; } java . lang . String msg = ( ( ( ( ( ( ( ( ( ( "Minibatch=" + minibatchSize ) + ",<sp>inDepth=" ) + inputDepth ) + ",<sp>height=" ) + height ) + ",<sp>kernelSize=" ) + k ) + ",<sp>stride<sp>=<sp>" ) + stride ) + ",<sp>convLayer<sp>first<sp>=<sp>" ) + convFirst ; System . out . println ( msg ) ; boolean gradOK = org . deeplearning4j . gradientcheck . GradientCheckUtil . checkGradients ( net , org . deeplearning4j . gradientcheck . CNNGradientCheckTest . DEFAULT_EPS , org . deeplearning4j . gradientcheck . CNNGradientCheckTest . DEFAULT_MAX_REL_ERROR , org . deeplearning4j . gradientcheck . CNNGradientCheckTest . DEFAULT_MIN_ABS_ERROR , org . deeplearning4j . gradientcheck . CNNGradientCheckTest . PRINT_RESULTS , org . deeplearning4j . gradientcheck . CNNGradientCheckTest . RETURN_ON_FIRST_FAILURE , input , labels ) ; "<AssertPlaceHolder>" ; org . deeplearning4j . TestUtils . testModelSerialization ( net ) ; } } } } } } checkGradients ( org . deeplearning4j . nn . multilayer . MultiLayerNetwork , double , double , double , boolean , boolean , org . nd4j . linalg . api . ndarray . INDArray , org . nd4j . linalg . api . ndarray . INDArray ) { return org . deeplearning4j . gradientcheck . GradientCheckUtil . checkGradients ( mln , epsilon , maxRelError , minAbsoluteError , print , exitOnFirstError , input , labels , null , null ) ; }
|
org . junit . Assert . assertTrue ( msg , gradOK )
|
toRequestFailureTest ( ) { final java . lang . Throwable cause = new java . lang . Throwable ( ) ; final org . opendaylight . controller . cluster . access . concepts . RequestException exception = new org . opendaylight . controller . cluster . access . concepts . RuntimeRequestException ( "fail" , cause ) ; final org . opendaylight . controller . cluster . access . commands . TransactionFailure failure = object ( ) . toRequestFailure ( exception ) ; "<AssertPlaceHolder>" ; } toRequestFailure ( org . opendaylight . controller . cluster . access . concepts . RequestException ) { return new org . opendaylight . controller . cluster . access . commands . ConnectClientFailure ( getTarget ( ) , getSequence ( ) , cause ) ; }
|
org . junit . Assert . assertNotNull ( failure )
|
deletedQueriesDisappear ( ) { final org . apache . rya . streams . api . queries . QueryRepository queries = new org . apache . rya . streams . api . queries . InMemoryQueryRepository ( new org . apache . rya . streams . api . queries . InMemoryQueryChangeLog ( ) , org . apache . rya . streams . api . queries . InMemoryQueryRepositoryTest . SCHEDULE ) ; final java . util . Set < org . apache . rya . streams . api . entity . StreamsQuery > expected = new java . util . HashSet ( ) ; expected . add ( queries . add ( "query<sp>1" , true , true ) ) ; final java . util . UUID deletedMeId = queries . add ( "query<sp>2" , false , true ) . getQueryId ( ) ; expected . add ( queries . add ( "query<sp>3" , true , false ) ) ; queries . delete ( deletedMeId ) ; final java . util . Set < org . apache . rya . streams . api . entity . StreamsQuery > stored = queries . list ( ) ; "<AssertPlaceHolder>" ; } list ( ) { lock . lock ( ) ; try { checkState ( ) ; updateCache ( ) ; return queriesCache . values ( ) . stream ( ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; } finally { lock . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( expected , stored )
|
testOnException ( ) { java . util . concurrent . atomic . AtomicReference < org . slieb . throwables . java . lang . Throwable > reference = new java . util . concurrent . atomic . AtomicReference ( ) ; org . slieb . throwables . java . lang . Exception expected = new org . slieb . throwables . java . lang . Exception ( "expected" ) ; try { org . slieb . throwables . ToDoubleBiFunctionWithThrowable . castToDoubleBiFunctionWithThrowable ( ( v1 , v2 ) -> { throw expected ; } ) . onException ( reference :: set ) . applyAsDouble ( null , null ) ; } catch ( java . lang . Throwable ignored ) { } "<AssertPlaceHolder>" ; } get ( ) { try { return getWithThrowable ( ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } }
|
org . junit . Assert . assertEquals ( expected , reference . get ( ) )
|
testBasicSetupEncoder_UsingSubscribe ( ) { org . numenta . nupic . Parameters p = org . numenta . nupic . network . NetworkTestHarness . getParameters ( ) . copy ( ) ; p = p . union ( org . numenta . nupic . network . NetworkTestHarness . getDayDemoTestEncoderParams ( ) ) ; p . set ( KEY . RANDOM , new org . numenta . nupic . util . MersenneTwister ( 42 ) ) ; org . numenta . nupic . encoders . MultiEncoder me = org . numenta . nupic . encoders . MultiEncoder . builder ( ) . name ( "" ) . build ( ) ; org . numenta . nupic . network . Layer < java . util . Map < java . lang . String , java . lang . Object > > l = new org . numenta . nupic . network . Layer ( p , me , null , null , null , null ) ; final int [ ] [ ] expected = new int [ 7 ] [ 8 ] ; expected [ 0 ] = new int [ ] { 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 } ; expected [ 1 ] = new int [ ] { 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 } ; expected [ 2 ] = new int [ ] { 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 } ; expected [ 3 ] = new int [ ] { 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 } ; expected [ 4 ] = new int [ ] { 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 } ; expected [ 5 ] = new int [ ] { 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 } ; expected [ 6 ] = new int [ ] { 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 } ; rx . observers . TestObserver < org . numenta . nupic . network . Inference > tester ; l . subscribe ( ( tester = new rx . observers . TestObserver < org . numenta . nupic . network . Inference > ( ) { int seq = 0 ; @ org . numenta . nupic . network . Override public void onCompleted ( ) { } @ org . numenta . nupic . network . Override public void onNext ( org . numenta . nupic . network . Inference output ) { "<AssertPlaceHolder>" ; } } ) ) ; java . util . Map < java . lang . String , java . lang . Object > inputs = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; for ( double i = 0 ; i < 7 ; i ++ ) { inputs . put ( "dayOfWeek" , i ) ; l . compute ( inputs ) ; } checkObserver ( tester ) ; } getSDR ( ) { return sdr ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( expected [ ( ( seq ) ++ ) ] , output . getSDR ( ) ) )
|
testU_ALPHA ( ) { "<AssertPlaceHolder>" ; } u ( java . lang . String ) { if ( ( value == null ) || ( value . isEmpty ( ) ) ) { return "" ; } return org . terasoluna . gfw . web . el . Functions . extraEncodeQuery ( org . springframework . web . util . UriUtils . encodeQueryParam ( value , "UTF-8" ) ) ; }
|
org . junit . Assert . assertThat ( org . terasoluna . gfw . web . el . Functions . u ( "a" ) , org . hamcrest . CoreMatchers . is ( "a" ) )
|
whenUsingHelloMethod_thenCorrect ( ) { final java . lang . String endpointResponse = baeldungProxy . hello ( "Baeldung" ) ; final java . lang . String localResponse = baeldungImpl . hello ( "Baeldung" ) ; "<AssertPlaceHolder>" ; } hello ( java . lang . String ) { java . lang . String message = "Hello,<sp>" + name ; return message ; }
|
org . junit . Assert . assertEquals ( localResponse , endpointResponse )
|
orderMasterAfter ( ) { java . io . InputStream inputStream = null ; parameters . put ( "customer" , 103 ) ; parameters . put ( "order" , 10123 ) ; if ( ( inputStream = runAndRenderSampleReport ( "samplereports/Reporting<sp>Feature<sp>Examples/Drill<sp>to<sp>Details/OrderMasterAfter.rptdesign" , "xlsx" ) ) != null ) { try { "<AssertPlaceHolder>" ; } finally { inputStream . close ( ) ; } } } runAndRenderSampleReport ( java . lang . String , java . lang . String ) { if ( ( uk . co . spudsoft . birt . emitters . excel . tests . SampleReportsTest . basePath ) != null ) { java . io . File file = new java . io . File ( ( ( uk . co . spudsoft . birt . emitters . excel . tests . SampleReportsTest . basePath ) + filename ) ) ; if ( file . exists ( ) ) { return runAndRenderReport ( file . getAbsolutePath ( ) , extension ) ; } } return null ; }
|
org . junit . Assert . assertNotNull ( inputStream )
|
hasSpeedOverGround ( ) { "<AssertPlaceHolder>" ; } hasSpeedOverGround ( ) { return net . sf . marineapi . ais . util . SpeedOverGround . isAvailable ( fSOG ) ; }
|
org . junit . Assert . assertEquals ( true , msg . hasSpeedOverGround ( ) )
|
testParseHtml ( ) { java . lang . String html = "<html><head><title>First<sp>parse</title></head>" + "<body><id>1</id><></></body></html>" ; org . jsoup . nodes . Document doc = org . jsoup . Jsoup . parse ( html ) ; "<AssertPlaceHolder>" ; System . out . println ( doc ) ; } parse ( java . lang . Object ) { if ( ( this . tpl ) == null ) return null ; return cn . bc . core . util . FreeMarkerUtils . format ( this . tpl , data ) ; }
|
org . junit . Assert . assertNotNull ( doc )
|
testNullInfo ( ) { com . ibm . ws . microprofile . openapi . impl . validation . InfoValidator validator = com . ibm . ws . microprofile . openapi . impl . validation . InfoValidator . getInstance ( ) ; com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper vh = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper ( ) ; com . ibm . ws . microprofile . openapi . impl . model . info . InfoImpl info = null ; validator . validate ( vh , context , info ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , vh . getEventsSize ( ) )
|
testAppend ( ) { org . nd4j . linalg . api . ndarray . INDArray linspace = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 4 , 4 , DataType . DOUBLE ) . reshape ( 2 , 2 ) ; org . nd4j . linalg . api . ndarray . INDArray otherAppend = org . nd4j . linalg . factory . Nd4j . append ( linspace , 3 , 1.0 , ( - 1 ) ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] [ ] { new double [ ] { 1 , 2 , 1 , 1 , 1 } , new double [ ] { 3 , 4 , 1 , 1 , 1 } } ) ; "<AssertPlaceHolder>" ; } append ( org . nd4j . linalg . factory . INDArray , int , double , int ) { if ( padAmount == 0 ) return arr ; long [ ] paShape = org . nd4j . linalg . util . ArrayUtil . copy ( arr . shape ( ) ) ; if ( axis < 0 ) axis = axis + ( arr . shape ( ) . length ) ; paShape [ axis ] = padAmount ; org . nd4j . linalg . factory . INDArray concatArray = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( paShape , val , arr . dataType ( ) ) ; return org . nd4j . linalg . factory . Nd4j . concat ( axis , arr , concatArray ) ; }
|
org . junit . Assert . assertEquals ( assertion , otherAppend )
|
aliphatic_carbon ( ) { uk . ac . ebi . beam . Atom actual = uk . ac . ebi . beam . FromSubsetAtoms . fromSubset ( AtomImpl . AliphaticSubset . Carbon , 3 , 0 ) ; uk . ac . ebi . beam . Atom expect = new uk . ac . ebi . beam . AtomImpl . BracketAtom ( Element . Carbon , 1 , 0 ) ; "<AssertPlaceHolder>" ; } fromSubset ( uk . ac . ebi . beam . Atom , int , int ) { if ( ! ( a . subset ( ) ) ) return a ; uk . ac . ebi . beam . Element e = a . element ( ) ; if ( ( a . aromatic ( ) ) && ( deg <= sum ) ) sum ++ ; int hCount = ( a . aromatic ( ) ) ? uk . ac . ebi . beam . Element . implicitAromHydrogenCount ( e , sum ) : uk . ac . ebi . beam . Element . implicitHydrogenCount ( e , sum ) ; return new uk . ac . ebi . beam . AtomImpl . BracketAtom ( ( - 1 ) , a . element ( ) , hCount , 0 , 0 , a . aromatic ( ) ) ; }
|
org . junit . Assert . assertThat ( expect , org . hamcrest . CoreMatchers . is ( actual ) )
|
testTraverseParent ( ) { a . traverseParent ( ( p , c ) -> { if ( p . equals ( root ) ) { grandparentSeen = true ; } return true ; } ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( o == null ) || ( ( o . getClass ( ) ) != ( getClass ( ) ) ) ) { return false ; } uk . gov . dstl . baleen . entity . linking . util . StringTriple st = ( ( uk . gov . dstl . baleen . entity . linking . util . StringTriple ) ( o ) ) ; return ( ( subject . equals ( st . getSubject ( ) ) ) && ( predicate . equals ( st . getPredicate ( ) ) ) ) && ( object . equals ( st . getObject ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( grandparentSeen )
|
testHeadRuleMap ( ) { java . lang . String filename = "src/main/resources/headrules/headrule_en_stanford.txt" ; edu . emory . clir . clearnlp . conversion . headrule . HeadRuleMap map = new edu . emory . clir . clearnlp . conversion . headrule . HeadRuleMap ( edu . emory . clir . clearnlp . util . IOUtils . createFileInputStream ( filename ) ) ; java . lang . String str = map . toString ( ) ; "<AssertPlaceHolder>" ; } createByteArrayInputStream ( java . lang . String ) { return new java . io . ByteArrayInputStream ( s . getBytes ( ) ) ; }
|
org . junit . Assert . assertEquals ( str , new edu . emory . clir . clearnlp . conversion . headrule . HeadRuleMap ( edu . emory . clir . clearnlp . util . IOUtils . createByteArrayInputStream ( str ) ) . toString ( ) )
|
managedPoolMustNotCountShutDownAsLeak ( ) { config . setSize ( 2 ) ; stormpot . ManagedPool managedPool = assumeManagedPool ( ) ; claimRelease ( 2 , pool , stormpot . PoolTest . longTimeout ) ; pool . shutdown ( ) . await ( stormpot . PoolTest . longTimeout ) ; allocator . clearLists ( ) ; java . lang . System . gc ( ) ; java . lang . System . gc ( ) ; java . lang . System . gc ( ) ; "<AssertPlaceHolder>" ; } getLeakedObjectsCount ( ) { return allocator . countLeakedObjects ( ) ; }
|
org . junit . Assert . assertThat ( managedPool . getLeakedObjectsCount ( ) , is ( 0L ) )
|
startBillingRun ( ) { boolean result = startBillingRun ( 0 ) ; "<AssertPlaceHolder>" ; } startBillingRun ( java . lang . String ) { java . lang . String result ; try { boolean status = ejbClientFacade . startBillingRun ( getCurrentTime ( currentDate ) ) ; result = "BillingService.startBillingRun<sp>successful<sp>executed.\nReturn<sp>state<sp>is<sp>" + status ; } catch ( java . text . ParseException e ) { result = "BillingService.startBillingRun<sp>failed.\nReason:\nThe<sp>format<sp>for<sp>currentDate<sp>is<sp>" + ( org . oscm . jmx . internal . mbean . StartBillingRun . DATE_FORMAT . toUpperCase ( ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; result = "BillingService.startBillingRun<sp>failed.\nException:\n" + e ; } return result ; }
|
org . junit . Assert . assertTrue ( result )
|
getSource ( ) { java . lang . Object source = new java . lang . Object ( ) ; org . bff . javampd . server . ErrorEvent errorEvent = new org . bff . javampd . server . ErrorEvent ( source ) ; "<AssertPlaceHolder>" ; } getSource ( ) { java . lang . Object source = new java . lang . Object ( ) ; org . bff . javampd . server . ErrorEvent errorEvent = new org . bff . javampd . server . ErrorEvent ( source ) ; org . junit . Assert . assertEquals ( errorEvent . getSource ( ) , source ) ; }
|
org . junit . Assert . assertEquals ( errorEvent . getSource ( ) , source )
|
testDeepClone ( ) { int [ ] [ ] test = new int [ ] [ ] { new int [ ] { 0 , 1 } , new int [ ] { 2 , 3 } , new int [ ] { 4 , 5 } } ; int [ ] [ ] result = ( ( int [ ] [ ] ) ( nom . tam . util . nom . tam . util . ArrayFuncs . deepClone ( test ) ) ) ; for ( int i = 0 ; i < ( test . length ) ; i += 1 ) { for ( int j = 0 ; j < ( test [ i ] . length ) ; j += 1 ) { "<AssertPlaceHolder>" ; } } } deepClone ( java . lang . Object ) { if ( o == null ) { return null ; } if ( ! ( o . getClass ( ) . isArray ( ) ) ) { return nom . tam . util . ArrayFuncs . genericClone ( o ) ; } if ( o . getClass ( ) . getComponentType ( ) . isPrimitive ( ) ) { int length = java . lang . reflect . Array . getLength ( o ) ; java . lang . Object result = java . lang . reflect . Array . newInstance ( o . getClass ( ) . getComponentType ( ) , length ) ; java . lang . System . arraycopy ( o , 0 , result , 0 , length ) ; return result ; } else { java . lang . Class < ? > baseClass = nom . tam . util . ArrayFuncs . getBaseClass ( o ) ; int [ ] dims = nom . tam . util . ArrayFuncs . getDimensions ( o ) ; java . util . Arrays . fill ( dims , 1 , dims . length , 0 ) ; java . lang . Object copy = nom . tam . util . ArrayFuncs . newInstance ( baseClass , dims ) ; for ( int i = 0 ; i < ( dims [ 0 ] ) ; i ++ ) { java . lang . reflect . Array . set ( copy , i , nom . tam . util . ArrayFuncs . deepClone ( java . lang . reflect . Array . get ( o , i ) ) ) ; } return copy ; } }
|
org . junit . Assert . assertEquals ( test [ i ] [ j ] , result [ i ] [ j ] )
|
testNoConvertGt ( ) { java . lang . String testString = ">" ; "<AssertPlaceHolder>" ; } unescapeToXML ( java . lang . String ) { if ( com . github . bordertech . wcomponents . util . Util . empty ( input ) ) { return input ; } java . lang . String encoded = com . github . bordertech . wcomponents . WebUtilities . doubleEncodeBrackets ( input ) ; java . lang . String unescaped = com . github . bordertech . wcomponents . util . HtmlToXMLUtil . UNESCAPE_HTML_TO_XML . translate ( encoded ) ; java . lang . String decoded = com . github . bordertech . wcomponents . WebUtilities . doubleDecodeBrackets ( unescaped ) ; return decoded ; }
|
org . junit . Assert . assertEquals ( testString , com . github . bordertech . wcomponents . util . HtmlToXMLUtil . unescapeToXML ( testString ) )
|
shouldBeInvoked ( ) { "<AssertPlaceHolder>" ; } getName ( ) { return "A" ; }
|
org . junit . Assert . assertEquals ( "A" , bean . getName ( ) )
|
test_AT_025_6_Idle_to_WorkForBrokerWithJDL ( ) { org . ourgrid . deployer . xmpp . XMPPAccount user1 = req_101_Util . createLocalUser ( "workerA.ourgrid.org" 0 , "server011" , "011011" ) ; org . ourgrid . common . specification . worker . WorkerSpecification workerSpec = workerAcceptanceUtil . createClassAdWorkerSpec ( "workerA.ourgrid.org" , "xmpp.ourgrid.org" , null , null ) ; java . lang . String workerAPublicKey = "publicKeyA" ; br . edu . ufcg . lsd . commune . identification . DeploymentID workerDID = req_019_Util . createAndPublishWorkerManagement ( component , workerSpec , workerAPublicKey ) ; req_010_Util . workerLogin ( component , workerSpec , workerDID ) ; req_025_Util . changeWorkerStatusToIdle ( component , workerDID ) ; java . lang . String brokerPubKey = "brokerPublicKey" ; org . ourgrid . common . interfaces . control . PeerControl peerControl = peerAcceptanceUtil . getPeerControl ( ) ; br . edu . ufcg . lsd . commune . container . ObjectDeployment pcOD = peerAcceptanceUtil . getPeerControlDeployment ( ) ; org . ourgrid . common . interfaces . control . PeerControlClient peerControlClient = org . easymock . classextension . EasyMock . createMock ( org . ourgrid . common . interfaces . control . PeerControlClient . class ) ; br . edu . ufcg . lsd . commune . identification . DeploymentID pccID = new br . edu . ufcg . lsd . commune . identification . DeploymentID ( new br . edu . ufcg . lsd . commune . identification . ContainerID ( "pcc" , "broker" , "broker" ) , brokerPubKey ) ; br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . publishTestObject ( component , pccID , peerControlClient , org . ourgrid . common . interfaces . control . PeerControlClient . class ) ; br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . setExecutionContext ( component , pcOD , pccID ) ; try { peerControl . addUser ( peerControlClient , ( ( ( user1 . getUsername ( ) ) + "@" ) + ( user1 . getServerAddress ( ) ) ) ) ; } catch ( br . edu . ufcg . lsd . commune . CommuneRuntimeException e ) { } br . edu . ufcg . lsd . commune . identification . DeploymentID lwpcOID = req_108_Util . login ( component , user1 , brokerPubKey ) ; org . ourgrid . common . interfaces . LocalWorkerProviderClient lwpc = ( ( org . ourgrid . common . interfaces . LocalWorkerProviderClient ) ( br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . getBoundObject ( lwpcOID ) ) ) ; org . ourgrid . acceptance . util . WorkerAllocation allocationWorker = new org . ourgrid . acceptance . util . WorkerAllocation ( workerDID ) ; org . ourgrid . common . interfaces . to . RequestSpecification requestSpec1 = new org . ourgrid . common . interfaces . to . RequestSpecification ( 0 , new org . ourgrid . common . specification . job . JobSpecification ( "label" ) , 1 , org . ourgrid . acceptance . peer . PeerAcceptanceTestCase . buildRequirements ( null , null , null , null ) , 1 , 0 , 0 ) ; req_011_Util . requestForLocalConsumer ( component , new br . edu . ufcg . lsd . commune . testinfra . util . TestStub ( lwpcOID , lwpc ) , requestSpec1 , allocationWorker ) ; "<AssertPlaceHolder>" ; req_025_Util . changeWorkerStatusToAllocatedForBroker ( component , lwpcOID , workerDID , workerSpec , requestSpec1 ) ; org . ourgrid . common . interfaces . to . UserInfo userInfo1 = new org . ourgrid . common . interfaces . to . UserInfo ( user1 . getUsername ( ) , user1 . getServerAddress ( ) , brokerPubKey , org . ourgrid . common . interfaces . to . UserState . CONSUMING ) ; java . util . List < org . ourgrid . common . interfaces . to . UserInfo > usersInfo = br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . createList ( userInfo1 ) ; req_106_Util . getUsersStatus ( usersInfo ) ; org . ourgrid . common . interfaces . to . WorkerInfo workerInfoA = new org . ourgrid . common . interfaces . to . WorkerInfo ( workerSpec , org . ourgrid . common . interfaces . to . LocalWorkerState . IN_USE , lwpcOID . getServiceID ( ) . toString ( ) ) ; java . util . List < org . ourgrid . common . interfaces . to . WorkerInfo > localWorkersInfo = br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . createList ( workerInfoA ) ; req_036_Util . getLocalWorkersStatus ( localWorkersInfo ) ; } isPeerInterestedOnBroker ( br . edu . ufcg . lsd . commune . identification . ServiceID ) { br . edu . ufcg . lsd . commune . container . ObjectDeployment deployment = getContainerObject ( application , org . ourgrid . acceptance . util . LOCAL_WORKER_PROVIDER ) ; return br . edu . ufcg . lsd . commune . testinfra . AcceptanceTestUtil . isInterested ( application , workerProviderClientID , deployment . getDeploymentID ( ) ) ; }
|
org . junit . Assert . assertTrue ( peerAcceptanceUtil . isPeerInterestedOnBroker ( lwpcOID . getServiceID ( ) ) )
|
testMarshal_WrappedLongObjectId1 ( ) { com . jmethods . catatumbo . entities . WrappedLongObjectIdEntity entity = com . jmethods . catatumbo . entities . WrappedLongObjectIdEntity . getSample1 ( ) ; com . google . cloud . datastore . FullEntity < ? > nativeEntity = ( ( com . google . cloud . datastore . FullEntity < ? > ) ( com . jmethods . catatumbo . impl . Marshaller . marshal ( com . jmethods . catatumbo . impl . MarshallerTest . em , entity , Intent . INSERT ) ) ) ; com . google . cloud . datastore . IncompleteKey incompleteKey = nativeEntity . getKey ( ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return key ; }
|
org . junit . Assert . assertNotNull ( incompleteKey )
|
listShouldNotContainIncorrectObject ( ) { java . lang . Object incorrect = new java . lang . Object ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertFalse ( list . contains ( incorrect ) )
|
testStrip ( ) { com . aliyun . odps . graph . JobConf conf = new com . aliyun . odps . graph . JobConf ( ) ; com . aliyun . odps . data . TableInfo t = com . aliyun . odps . data . TableInfo . builder ( ) . tableName ( "bbb" ) . partSpec ( "ds='20140511'" ) . build ( ) ; conf . addInput ( t ) ; java . lang . String input = conf . get ( GRAPH_CONF . INPUT_DESC ) ; java . lang . String jsonStr = "[{\"projName\":\"\",\"tblName\":\"bbb\",\"partSpec\":[\"ds=20140511\"],\"cols\":\"\"}]" ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return substituteVars ( getProps ( ) . getProperty ( name ) ) ; }
|
org . junit . Assert . assertEquals ( jsonStr , input )
|
testURLWithText2 ( ) { java . lang . String content = "text<sp>[[http://www.liferay.com<sp>link<sp>text]]<sp>text" ; java . lang . String expected = "text<sp>[[http://www.liferay.com|link<sp>text]]<sp>text" ; java . lang . String actual = _translate ( content ) ; "<AssertPlaceHolder>" ; } _translate ( com . liferay . portal . kernel . exception . PortalException ) { if ( portalException instanceof com . liferay . dynamic . data . mapping . exception . StorageFieldRequiredException ) { return new com . liferay . dynamic . data . mapping . kernel . StorageFieldRequiredException ( portalException . getMessage ( ) , portalException . getCause ( ) ) ; } return portalException ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testGetJobExecutionCount ( ) { when ( jobService . countJobExecutionsForJob ( "job" ) ) . thenReturn ( 10 ) ; "<AssertPlaceHolder>" ; } getExecutionCount ( ) { return executionCount ; }
|
org . junit . Assert . assertEquals ( 10 , metrics . getExecutionCount ( ) )
|
getValueStringByKey_value_null ( ) { java . util . HashMap < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "key2" , null ) ; java . lang . String keyName = "key2" ; java . lang . String expResult = "" ; java . lang . String result = com . microsoft . azure . sdk . iot . service . Tools . getValueStringByKey ( map , keyName ) ; "<AssertPlaceHolder>" ; } getValueStringByKey ( java . util . Map , java . lang . String ) { java . lang . String retVal ; if ( ( map == null ) || ( keyName == null ) ) { retVal = "" ; } else { java . lang . Object val = map . get ( keyName ) ; if ( val != null ) retVal = val . toString ( ) . trim ( ) ; else retVal = "" ; } return retVal ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testResourceOutputStream ( ) { java . io . File file = java . io . File . createTempFile ( "fileresourcetest" , ".tmp" ) ; file . deleteOnExit ( ) ; org . jboss . forge . addon . resource . FileResource < ? > fileResource = resourceFactory . create ( org . jboss . forge . addon . resource . FileResource . class , file ) ; try ( java . io . OutputStream os = fileResource . getResourceOutputStream ( ) ) { os . write ( "CONTENT" . getBytes ( ) ) ; os . flush ( ) ; } java . util . List < java . lang . String > fileContent = java . nio . file . Files . readAllLines ( file . toPath ( ) , java . nio . charset . Charset . defaultCharset ( ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { java . util . Map < java . lang . Object , java . lang . Object > map = org . jboss . forge . addon . environment . impl . EnvironmentImpl . CATEGORIZED_MAP . get ( key . getName ( ) ) ; if ( map == null ) { map = new java . util . concurrent . ConcurrentHashMap < java . lang . Object , java . lang . Object > ( ) ; org . jboss . forge . addon . environment . impl . EnvironmentImpl . CATEGORIZED_MAP . put ( key . getName ( ) , map ) ; } return ( ( java . util . Map < K , V > ) ( map ) ) ; }
|
org . junit . Assert . assertEquals ( "CONTENT" , fileContent . get ( 0 ) )
|
testListStoragesByGroup ( ) { com . github . tobato . fastdfs . service . TrackerClientTest . LOGGER . debug ( "testListStoragesByGroup.." ) ; java . util . List < com . github . tobato . fastdfs . domain . fdfs . StorageState > list = trackerClient . listStorages ( TestConstants . DEFAULT_GROUP ) ; "<AssertPlaceHolder>" ; com . github . tobato . fastdfs . service . TrackerClientTest . LOGGER . debug ( "result={}" , list ) ; } listStorages ( java . lang . String ) { com . github . tobato . fastdfs . service . TrackerListStoragesCommand command = new com . github . tobato . fastdfs . service . TrackerListStoragesCommand ( groupName ) ; return trackerConnectionManager . executeFdfsTrackerCmd ( command ) ; }
|
org . junit . Assert . assertNotNull ( list )
|
thankWithTranslatedMessage ( ) { com . baeldung . lombok . Translator translator = mock ( com . baeldung . lombok . Translator . class ) ; when ( translator . translate ( "thank<sp>you" ) ) . thenReturn ( com . baeldung . lombok . ThankingServiceIntegrationTest . TRANSLATED ) ; com . baeldung . lombok . ThankingService thankingService = new com . baeldung . lombok . ThankingService ( translator ) ; "<AssertPlaceHolder>" ; } thank ( ) { return translator . translate ( "thank<sp>you" ) ; }
|
org . junit . Assert . assertEquals ( com . baeldung . lombok . ThankingServiceIntegrationTest . TRANSLATED , thankingService . thank ( ) )
|
testScan ( ) { com . alicloud . openservices . tablestore . timeline . TestTimeline . FakeStore store = new com . alicloud . openservices . tablestore . timeline . TestTimeline . FakeStore ( ) ; try { com . alicloud . openservices . tablestore . timeline . Timeline timeline = new com . alicloud . openservices . tablestore . timeline . Timeline ( "1" , store ) ; com . alicloud . openservices . tablestore . timeline . ScanParameterBuilder builder = com . alicloud . openservices . tablestore . timeline . ScanParameterBuilder . scanForward ( ) ; com . alicloud . openservices . tablestore . timeline . ScanParameter parameter = builder . maxCount ( 100 ) . from ( 10 ) . to ( 20 ) . build ( ) ; timeline . scan ( parameter ) ; "<AssertPlaceHolder>" ; } catch ( com . alicloud . openservices . tablestore . timeline . common . TimelineException ex ) { org . junit . Assert . fail ( ) ; } } scan ( com . alicloud . openservices . tablestore . timeline . ScanParameter ) { if ( parameter == null ) { throw new com . alicloud . openservices . tablestore . timeline . common . TimelineException ( com . alicloud . openservices . tablestore . timeline . common . TimelineExceptionType . INVALID_USE , "scan<sp>parameter<sp>is<sp>null" ) ; } return this . store . scan ( this . timelineID , parameter ) ; }
|
org . junit . Assert . assertEquals ( parameter , store . parameter )
|
systemPropsOverrideSystemconfig ( ) { com . openshift . client . configuration . SystemConfiguration systemConfiguration = new com . openshift . client . fakes . SystemConfigurationFake ( new com . openshift . client . configuration . DefaultConfiguration ( ) ) { @ com . openshift . internal . client . Override protected void init ( java . util . Properties properties ) { properties . put ( com . openshift . internal . client . KEY_RHLOGIN , com . openshift . internal . client . ConfigurationTest . USERNAME ) ; } } ; com . openshift . client . fakes . UserConfigurationFake userConfiguration = new com . openshift . client . fakes . UserConfigurationFake ( systemConfiguration ) { @ com . openshift . internal . client . Override protected void initFile ( java . io . Writer writer ) throws java . io . IOException { writer . append ( com . openshift . internal . client . KEY_RHLOGIN ) . append ( '=' ) . append ( com . openshift . internal . client . ConfigurationTest . USERNAME2 ) . append ( '\n' ) ; } } ; com . openshift . client . configuration . IOpenShiftConfiguration configuration = new com . openshift . client . fakes . EmptySystemPropertiesFake ( userConfiguration ) ; configuration . setRhlogin ( com . openshift . internal . client . ConfigurationTest . USERNAME3 ) ; "<AssertPlaceHolder>" ; } getRhlogin ( ) { return removeQuotes ( properties . getProperty ( com . openshift . client . configuration . AbstractOpenshiftConfiguration . KEY_RHLOGIN ) ) ; }
|
org . junit . Assert . assertEquals ( com . openshift . internal . client . ConfigurationTest . USERNAME3 , configuration . getRhlogin ( ) )
|
testExposesJID ( ) { final org . xmpp . packet . JID jid = new org . xmpp . packet . JID ( "test" ) ; final org . xmpp . component . DummyAbstractComponent component = new org . xmpp . component . DummyAbstractComponent ( ) ; component . initialize ( jid , null ) ; "<AssertPlaceHolder>" ; } initialize ( org . xmpp . packet . JID , org . xmpp . component . ComponentManager ) { compMan = componentManager ; this . jid = jid ; startExecutor ( ) ; }
|
org . junit . Assert . assertEquals ( jid , component . jid )
|
testDiscrete ( ) { int rows = 10 ; int cols = 5 ; java . util . List < edu . cmu . tetrad . graph . Node > variables = new java . util . LinkedList ( ) ; for ( int i = 0 ; i < cols ; i ++ ) { edu . cmu . tetrad . data . DiscreteVariable variable = new edu . cmu . tetrad . data . DiscreteVariable ( ( "X" + ( i + 1 ) ) , 3 ) ; variables . add ( variable ) ; } edu . cmu . tetrad . data . DataSet dataSet = new edu . cmu . tetrad . data . ColtDataSet ( rows , variables ) ; edu . cmu . tetrad . util . RandomUtil randomUtil = edu . cmu . tetrad . util . RandomUtil . getInstance ( ) ; for ( int i = 0 ; i < rows ; i ++ ) { for ( int j = 0 ; j < cols ; j ++ ) { dataSet . setInt ( i , j , randomUtil . nextInt ( 3 ) ) ; } } edu . cmu . tetrad . data . ColtDataSet _dataSet = new edu . cmu . tetrad . data . ColtDataSet ( ( ( edu . cmu . tetrad . data . ColtDataSet ) ( dataSet ) ) ) ; "<AssertPlaceHolder>" ; } nextInt ( int ) { return randomGenerator . nextInt ( n ) ; }
|
org . junit . Assert . assertEquals ( dataSet , _dataSet )
|
testNoAuthNeededWithSSL ( ) { final net . trajano . auth . HttpHeaderAuthModule module = new net . trajano . auth . HttpHeaderAuthModule ( ) ; final javax . security . auth . message . MessagePolicy mockRequestPolicy = mock ( javax . security . auth . message . MessagePolicy . class ) ; when ( mockRequestPolicy . isMandatory ( ) ) . thenReturn ( false ) ; final javax . security . auth . callback . CallbackHandler h = mock ( javax . security . auth . callback . CallbackHandler . class ) ; module . initialize ( mockRequestPolicy , null , h , options ) ; final javax . security . auth . message . MessageInfo messageInfo = mock ( javax . security . auth . message . MessageInfo . class ) ; final javax . servlet . http . HttpServletRequest servletRequest = mock ( javax . servlet . http . HttpServletRequest . class ) ; when ( servletRequest . getMethod ( ) ) . thenReturn ( "GET" ) ; when ( servletRequest . isSecure ( ) ) . thenReturn ( true ) ; when ( servletRequest . getRequestURI ( ) ) . thenReturn ( "/util/ejb2" ) ; when ( messageInfo . getRequestMessage ( ) ) . thenReturn ( servletRequest ) ; final javax . security . auth . Subject client = new javax . security . auth . Subject ( ) ; "<AssertPlaceHolder>" ; verifyZeroInteractions ( h ) ; } validateRequest ( javax . security . auth . message . MessageInfo , javax . security . auth . Subject , javax . security . auth . Subject ) { final javax . servlet . http . HttpServletRequest req = ( ( javax . servlet . http . HttpServletRequest ) ( messageInfo . getRequestMessage ( ) ) ) ; final javax . servlet . http . HttpServletResponse resp = ( ( javax . servlet . http . HttpServletResponse ) ( messageInfo . getResponseMessage ( ) ) ) ; try { if ( ( ! ( mandatory ) ) && ( ! ( req . isSecure ( ) ) ) ) { return javax . security . auth . message . AuthStatus . SUCCESS ; } if ( ! ( req . isSecure ( ) ) ) { resp . sendError ( HttpURLConnection . HTTP_FORBIDDEN , net . trajano . auth . HttpHeaderAuthModule . R . getString ( "SSLReq" ) ) ; return javax . security . auth . message . AuthStatus . SEND_FAILURE ; } final java . lang . String userName = req . getHeader ( userNameHeader ) ; if ( ( userName == null ) && ( mandatory ) ) { return javax . security . auth . message . AuthStatus . FAILURE ; } else if ( ( userName == null ) && ( ! ( mandatory ) ) ) { return javax . security . auth . message . AuthStatus . SUCCESS ; } handler . handle ( new javax . security . auth . callback . Callback [ ] { new javax . security . auth . message . callback . CallerPrincipalCallback ( client , userName ) , new javax . security . auth . message . callback . GroupPrincipalCallback ( client , groups ( req ) ) } ) ; return javax . security . auth . message . AuthStatus . SUCCESS ; } catch ( java . io . IOException | javax . security . auth . callback . UnsupportedCallbackException e ) { net . trajano . auth . HttpHeaderAuthModule . LOG . throwing ( this . getClass ( ) . getName ( ) , "validateRequest" , e ) ; throw new javax . security . auth . message . AuthException ( e . getMessage ( ) ) ; } }
|
org . junit . Assert . assertEquals ( AuthStatus . SUCCESS , module . validateRequest ( messageInfo , client , null ) )
|
setValue_JapaneseCharsPlusInvalid ( ) { svc . setDescription ( ( "" + "" ) ) ; tppd . setValue ( svc ) ; org . oscm . internal . vo . VOService result = tppd . getValue ( org . oscm . internal . vo . VOService . class ) ; "<AssertPlaceHolder>" ; } getDescription ( ) { if ( ( description ) == null ) { description = new java . util . ArrayList < org . oscm . billingservice . business . model . billingresult . DescriptionType > ( ) ; } return this . description ; }
|
org . junit . Assert . assertEquals ( "" , result . getDescription ( ) )
|
testGetSize ( ) { java . util . Map < java . lang . Integer , java . lang . Integer > mapping1 = new java . util . TreeMap < java . lang . Integer , java . lang . Integer > ( ) ; mapping1 . put ( 1 , 1 ) ; mapping1 . put ( 2 , 2 ) ; mapping1 . put ( 3 , 3 ) ; java . util . Map < java . lang . Integer , java . lang . Integer > mapping2 = new java . util . TreeMap < java . lang . Integer , java . lang . Integer > ( ) ; mapping2 . put ( 1 , 2 ) ; mapping2 . put ( 2 , 1 ) ; mapping2 . put ( 3 , 3 ) ; java . util . List < java . util . Map < java . lang . Integer , java . lang . Integer > > mappings = new java . util . ArrayList < java . util . Map < java . lang . Integer , java . lang . Integer > > ( 2 ) ; mappings . add ( mapping1 ) ; mappings . add ( mapping2 ) ; org . openscience . cdk . smsd . helper . FinalMappings instance = new org . openscience . cdk . smsd . helper . FinalMappings ( ) ; instance . set ( mappings ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return size ; }
|
org . junit . Assert . assertEquals ( 2 , instance . getSize ( ) )
|
returnValueIfPresent ( ) { java . util . Map < java . lang . String , java . lang . Object > map = org . neo4j . helpers . collection . MapUtil . map ( "partitionProperty" , "partition" ) ; org . neo4j . graphalgo . core . ProcedureConfiguration procedureConfiguration = org . neo4j . graphalgo . core . ProcedureConfiguration . create ( map ) ; java . lang . String value = procedureConfiguration . get ( "partitionProperty" , "defaultValue" ) ; "<AssertPlaceHolder>" ; } get ( long , double ) { return weights . getOrDefault ( id , defaultValue ) ; }
|
org . junit . Assert . assertEquals ( "partition" , value )
|
testError ( ) { com . github . flowengine . engine . TaskExecResult result = runCmd ( "cmd.exe<sp>/c<sp>erroraasd.exe<sp>'hello<sp>world'<sp>" ) ; java . lang . Thread . sleep ( 500 ) ; "<AssertPlaceHolder>" ; } getExitValue ( ) { return exitValue ; }
|
org . junit . Assert . assertTrue ( ( ( result . getExitValue ( ) ) != 0 ) )
|
testRfcHashExample ( ) { java . lang . String clientKey = "dGhlIHNhbXBsZSBub25jZQ==" ; java . lang . String serverAccept = com . firefly . codec . websocket . model . AcceptHash . hashKey ( clientKey ) ; java . lang . String expectedHash = "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { return _string . equalsIgnoreCase ( s ) ; }
|
org . junit . Assert . assertThat ( serverAccept , org . hamcrest . Matchers . is ( expectedHash ) )
|
testEmptyArray ( ) { long result = com . oberasoftware . jasdb . core . utils . conversion . LongUtils . bytesToLong ( new byte [ 0 ] ) ; "<AssertPlaceHolder>" ; } bytesToLong ( byte [ ] ) { long v = 0 ; if ( ( bytes != null ) && ( ( bytes . length ) == ( com . oberasoftware . jasdb . core . utils . conversion . LongUtils . LONG_SIZE ) ) ) { for ( int i = ( com . oberasoftware . jasdb . core . utils . conversion . LongUtils . LONG_SIZE ) - 1 ; i >= 0 ; i -- ) { v |= ( ( long ) ( bytes [ i ] ) ) & ( com . oberasoftware . jasdb . core . utils . conversion . LongUtils . BITMASK ) ; if ( i != 0 ) { v <<= com . oberasoftware . jasdb . core . utils . conversion . LongUtils . SHIFT_SIZE ; } } } return v ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( 0L ) )
|
testWrappingCorrectly ( ) { queue = new org . apache . flume . channel . file . FlumeEventQueue ( backingStore , backingStoreSupplier . getInflightTakes ( ) , backingStoreSupplier . getInflightPuts ( ) , backingStoreSupplier . getQueueSetDir ( ) ) ; int size = Integer . MAX_VALUE ; for ( int i = 1 ; i <= size ; i ++ ) { if ( ! ( queue . addHead ( new org . apache . flume . channel . file . FlumeEventPointer ( i , i ) ) ) ) { break ; } } for ( int i = ( queue . getSize ( ) ) / 2 ; i > 0 ; i -- ) { "<AssertPlaceHolder>" ; } for ( int i = 1 ; i <= size ; i ++ ) { if ( ! ( queue . addHead ( new org . apache . flume . channel . file . FlumeEventPointer ( i , i ) ) ) ) { break ; } } } removeHead ( long ) { if ( ( backingStore . getSize ( ) ) == 0 ) { return null ; } long value = remove ( 0 , transactionID ) ; com . google . common . base . Preconditions . checkState ( ( value != ( org . apache . flume . channel . file . FlumeEventQueue . EMPTY ) ) , ( "Empty<sp>value<sp>" + ( channelNameDescriptor ) ) ) ; org . apache . flume . channel . file . FlumeEventPointer ptr = org . apache . flume . channel . file . FlumeEventPointer . fromLong ( value ) ; backingStore . decrementFileID ( ptr . getFileID ( ) ) ; return ptr ; }
|
org . junit . Assert . assertNotNull ( queue . removeHead ( 0 ) )
|
testRemove ( ) { com . liferay . document . library . kernel . model . DLFileShortcut newDLFileShortcut = addDLFileShortcut ( ) ; _persistence . remove ( newDLFileShortcut ) ; com . liferay . document . library . kernel . model . DLFileShortcut existingDLFileShortcut = _persistence . fetchByPrimaryKey ( newDLFileShortcut . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertNull ( existingDLFileShortcut )
|
shouldRunQueryTestMode ( ) { final com . spotify . flo . Task < java . lang . String > task = com . spotify . flo . Task . named ( "task" ) . ofType ( java . lang . String . class ) . operator ( com . spotify . flo . contrib . bigquery . BigQueryOperator . create ( ) ) . process ( ( bq ) -> bq . query ( "SELECT<sp>foo<sp>FROM<sp>input" ) . success ( ( result ) -> "success!" ) ) ; try ( com . spotify . flo . TestScope scope = com . spotify . flo . FloTesting . scope ( ) ) { final java . lang . String result = com . spotify . flo . context . FloRunner . runTask ( task ) . future ( ) . get ( 30 , com . spotify . flo . contrib . bigquery . SECONDS ) ; "<AssertPlaceHolder>" ; } } future ( ) { return future ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( "success!" ) )
|
testProcessFilter2 ( ) { _pathContext = com . liferay . portal . servlet . filters . virtualhost . VirtualHostFilterTest . _PATH_PROXY ; _pathProxy = com . liferay . portal . servlet . filters . virtualhost . VirtualHostFilterTest . _PATH_PROXY ; _mockHttpServletRequest . setRequestURI ( com . liferay . portal . servlet . filters . virtualhost . VirtualHostFilterTest . _LAST_PATH ) ; java . lang . String lastPath = getLastPath ( _mockHttpServletRequest , _mockHttpServletResponse , _mockFilterChain ) ; "<AssertPlaceHolder>" ; } getLastPath ( org . springframework . mock . web . MockHttpServletRequest , org . springframework . mock . web . MockHttpServletResponse , org . springframework . mock . web . MockFilterChain ) { _virtualHostFilter . init ( _mockFilterConfig ) ; _virtualHostFilter . processFilter ( request , response , filterChain ) ; com . liferay . portal . kernel . struts . LastPath lastPath = ( ( com . liferay . portal . kernel . struts . LastPath ) ( request . getAttribute ( WebKeys . LAST_PATH ) ) ) ; if ( lastPath != null ) { return lastPath . getPath ( ) ; } return com . liferay . petra . string . StringPool . BLANK ; }
|
org . junit . Assert . assertEquals ( com . liferay . portal . servlet . filters . virtualhost . VirtualHostFilterTest . _LAST_PATH , lastPath )
|
testAll ( ) { com . alibaba . otter . canal . parse . index . MemoryLogPositionManager memoryLogPositionManager = new com . alibaba . otter . canal . parse . index . MemoryLogPositionManager ( ) ; com . alibaba . otter . canal . parse . index . FileMixedLogPositionManager logPositionManager = new com . alibaba . otter . canal . parse . index . FileMixedLogPositionManager ( com . alibaba . otter . canal . parse . index . FileMixedLogPositionManagerTest . dataDir , 1000 , memoryLogPositionManager ) ; logPositionManager . start ( ) ; com . alibaba . otter . canal . protocol . position . LogPosition position2 = doTest ( logPositionManager ) ; sleep ( 1500 ) ; com . alibaba . otter . canal . parse . index . FileMixedLogPositionManager logPositionManager2 = new com . alibaba . otter . canal . parse . index . FileMixedLogPositionManager ( com . alibaba . otter . canal . parse . index . FileMixedLogPositionManagerTest . dataDir , 1000 , memoryLogPositionManager ) ; logPositionManager2 . start ( ) ; com . alibaba . otter . canal . protocol . position . LogPosition getPosition2 = logPositionManager2 . getLatestIndexBy ( destination ) ; "<AssertPlaceHolder>" ; logPositionManager . stop ( ) ; logPositionManager2 . stop ( ) ; } getLatestIndexBy ( java . lang . String ) { com . alibaba . otter . canal . protocol . position . LogPosition logPosition = memoryLogPositionManager . getLatestIndexBy ( destination ) ; if ( logPosition == ( nullPosition ) ) { return null ; } else { return logPosition ; } }
|
org . junit . Assert . assertEquals ( position2 , getPosition2 )
|
testGetZone ( ) { org . easymock . EasyMock . expect ( computeRpcMock . getZone ( com . google . cloud . compute . deprecated . ComputeImplTest . ZONE_ID . getZone ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . EMPTY_RPC_OPTIONS ) ) . andReturn ( com . google . cloud . compute . deprecated . ComputeImplTest . ZONE . toPb ( ) ) ; org . easymock . EasyMock . replay ( computeRpcMock ) ; compute = options . getService ( ) ; com . google . cloud . compute . deprecated . Zone zone = compute . getZone ( com . google . cloud . compute . deprecated . ComputeImplTest . ZONE_ID . getZone ( ) ) ; "<AssertPlaceHolder>" ; } getZone ( ) { return zone ; }
|
org . junit . Assert . assertEquals ( com . google . cloud . compute . deprecated . ComputeImplTest . ZONE , zone )
|
test_return_long ( ) { int result = server . return_long ( ) ; "<AssertPlaceHolder>" ; } return_long ( ) { return - 17 ; }
|
org . junit . Assert . assertEquals ( ( - 17 ) , result )
|
gaussianZScoreTransformWithDetectionIntervalTest3 ( ) { metricData . put ( 0L , 0.64 ) ; metricData . put ( 151200L , ( - 1.13 ) ) ; metricData . put ( 302400L , 0.0 ) ; metricData . put ( 453600L , 0.9 ) ; metricData . put ( 604800L , ( - 0.96 ) ) ; metricData . put ( 756000L , ( - 0.52 ) ) ; metricData . put ( 907200L , 0.24 ) ; metricData . put ( 1058400L , ( - 0.01 ) ) ; metricData . put ( 1209600L , 0.53 ) ; metricData . put ( 1360800L , ( - 0.34 ) ) ; metricData . put ( 1512000L , 1.11 ) ; metricData . put ( 1663200L , ( - 0.21 ) ) ; metricData . put ( 1814400L , 0.54 ) ; metric . setDatapoints ( metricData ) ; metrics . add ( metric ) ; java . util . List < java . lang . String > constants = new java . util . ArrayList ( ) ; java . lang . String detectionInterval = "7d" ; constants . add ( detectionInterval ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > results = gaussianZScoreTransform . transform ( null , metrics , constants ) ; java . util . Map < java . lang . Long , java . lang . Double > resultDatapoints = results . get ( 0 ) . getDatapoints ( ) ; expected . put ( 0L , 0.0 ) ; expected . put ( 151200L , 0.0 ) ; expected . put ( 302400L , 0.0 ) ; expected . put ( 453600L , 0.0 ) ; expected . put ( 604800L , 0.0 ) ; expected . put ( 756000L , 0.0 ) ; expected . put ( 907200L , 26.66 ) ; expected . put ( 1058400L , 0.0 ) ; expected . put ( 1209600L , 79.17 ) ; expected . put ( 1360800L , 57.4 ) ; expected . put ( 1512000L , 100.0 ) ; expected . put ( 1663200L , 29.94 ) ; expected . put ( 1814400L , 1.72 ) ; for ( java . lang . Long timestamp : expected . keySet ( ) ) { "<AssertPlaceHolder>" ; } } get ( com . salesforce . dva . argus . entity . MetricSchemaRecordQuery ) { requireNotDisposed ( ) ; com . salesforce . dva . argus . system . SystemAssert . requireArgument ( ( query != null ) , "IOException<sp>when<sp>trying<sp>to<sp>perform<sp>ES<sp>request." 1 ) ; long size = ( ( long ) ( query . getLimit ( ) ) ) * ( query . getPage ( ) ) ; com . salesforce . dva . argus . system . SystemAssert . requireArgument ( ( ( size > 0 ) && ( size <= ( Integer . MAX_VALUE ) ) ) , "IOException<sp>when<sp>trying<sp>to<sp>perform<sp>ES<sp>request." 2 ) ; java . util . Map < java . lang . String , java . lang . String > tags = new java . util . HashMap ( ) ; tags . put ( "type" , "REGEXP_WITHOUT_AGGREGATION" ) ; long start = java . lang . System . currentTimeMillis ( ) ; boolean scroll = false ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) . append ( "IOException<sp>when<sp>trying<sp>to<sp>perform<sp>ES<sp>request." 0 ) . append ( com . salesforce . dva . argus . service . schema . ElasticSearchSchemaService . INDEX_NAME ) . append ( "IOException<sp>when<sp>trying<sp>to<sp>perform<sp>ES<sp>request." 0 ) . append ( com . salesforce . dva . argus . service . schema . ElasticSearchSchemaService . TYPE_NAME ) . append ( "IOException<sp>when<sp>trying<sp>to<sp>perform<sp>ES<sp>request." 0 ) . append ( "_search" ) ; int from = 0 ; int scrollSize ; if ( ( ( query . getLimit ( ) ) * ( query . getPage ( ) ) ) > 10000 ) { sb . append ( "?scroll=" ) . append ( com . salesforce . dva . argus . service . schema . ElasticSearchSchemaService . KEEP_SCROLL_CONTEXT_OPEN_FOR ) ; scroll = true ; int total = ( query . getLimit ( ) ) * ( query . getPage ( ) ) ; scrollSize = ( ( int ) ( total / ( ( total / 10000 ) + 1 ) ) ) ; } else { from = ( query . getLimit ( ) ) * ( ( query . getPage ( ) ) - 1 ) ; scrollSize = query . getLimit ( ) ; } java . lang . String requestUrl = sb . toString ( ) ; java . lang . String queryJson = _constructTermQuery ( query , from , scrollSize ) ; try { com . salesforce . dva . argus . service . schema . ElasticSearchSchemaService . _logger . debug ( "get<sp>POST<sp>requestUrl<sp>{}<sp>queryJson<sp>{}" , requestUrl , queryJson ) ; org . elasticsearch . client . Response response = _esRestClient . performRequest ( com . salesforce . dva . argus . service . schema . ElasticSearchSchemaService . HttpMethod . POST . getName ( ) , requestUrl , java . util . Collections . emptyMap ( ) , new org . apache . http . entity . StringEntity ( queryJson ) ) ; com . salesforce . dva . argus . service . schema . MetricSchemaRecordList list = toEntity ( extractResponse ( response ) , new com . fasterxml . jackson . core . type . TypeReference < com . salesforce . dva . argus . service . schema . MetricSchemaRecordList > ( ) { } ) ; if ( scroll ) { requestUrl = new java . lang . StringBuilder ( ) . append ( "IOException<sp>when<sp>trying<sp>to<sp>perform<sp>ES<sp>request." 0 ) . append ( "_search" ) . append ( "IOException<sp>when<sp>trying<sp>to<sp>perform<sp>ES<sp>request." 0 ) . append ( "scroll" ) . toString ( ) ; java . util . List < com . salesforce . dva . argus . entity . MetricSchemaRecord > records = new java .
|
org . junit . Assert . assertEquals ( expected . get ( timestamp ) , resultDatapoints . get ( timestamp ) , 0.01 )
|
testConvert ( ) { java . lang . Long enrolmentId = 1L ; org . lnu . is . domain . enrolment . Enrolment enrolment = new org . lnu . is . domain . enrolment . Enrolment ( ) ; enrolment . setId ( enrolmentId ) ; java . lang . Long enrolmentSubjectId = 2L ; org . lnu . is . domain . enrolment . subject . EnrolmentSubject enrolmentSubject = new org . lnu . is . domain . enrolment . subject . EnrolmentSubject ( ) ; enrolmentSubject . setId ( enrolmentSubjectId ) ; java . lang . Long personEnrolmentSubjectId = 3L ; org . lnu . is . domain . person . enrolment . subject . PersonEnrolmentSubject personEnrolmentSubject = new org . lnu . is . domain . person . enrolment . subject . PersonEnrolmentSubject ( ) ; personEnrolmentSubject . setId ( personEnrolmentSubjectId ) ; java . lang . Double mark = 1.2 ; org . lnu . is . resource . enrolment . enrolment . subject . EnrolmentEnrolmentSubjectResource source = new org . lnu . is . resource . enrolment . enrolment . subject . EnrolmentEnrolmentSubjectResource ( ) ; source . setEnrolmentId ( enrolmentId ) ; source . setEnrolmentSubjectId ( enrolmentSubjectId ) ; source . setPersonEnrolmentSubjectId ( personEnrolmentSubjectId ) ; source . setMark ( mark ) ; org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject expected = new org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject ( ) ; expected . setEnrolment ( enrolment ) ; expected . setEnrolmentSubject ( enrolmentSubject ) ; expected . setPersonEnrolmentSubject ( personEnrolmentSubject ) ; expected . setMark ( mark ) ; org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
registration_succeeds_for_navigation_target_with_inherited_title_annotation ( ) { routeRegistryInitializer . onStartup ( java . util . Collections . singleton ( com . vaadin . flow . server . startup . RouteRegistryInitializerTest . ChildWithDynamicTitle . class ) , servletContext ) ; "<AssertPlaceHolder>" ; } getTargetUrl ( java . lang . Class ) { java . util . Optional < java . lang . String > targetUrl = super . getTargetUrl ( navigationTarget ) ; if ( targetUrl . isPresent ( ) ) { return targetUrl ; } return parentRegistry . getTargetUrl ( navigationTarget ) ; }
|
org . junit . Assert . assertEquals ( "bar" , registry . getTargetUrl ( com . vaadin . flow . server . startup . RouteRegistryInitializerTest . ChildWithDynamicTitle . class ) . get ( ) )
|
testDataSourceConfigurationNullPassword ( ) { java . lang . String username = "sa" ; java . lang . String password = null ; org . apache . beam . sdk . io . jdbc . JdbcIO . DataSourceConfiguration config = JdbcIO . DataSourceConfiguration . create ( "org.apache.derby.jdbc.ClientDriver" , ( ( "jdbc:derby://localhost:" + ( org . apache . beam . sdk . io . jdbc . JdbcIOTest . port ) ) + "/target/beam" ) ) . withUsername ( username ) . withPassword ( password ) ; try ( java . sql . Connection conn = config . buildDatasource ( ) . getConnection ( ) ) { "<AssertPlaceHolder>" ; } } isValid ( int ) { return connection . isValid ( timeout ) ; }
|
org . junit . Assert . assertTrue ( conn . isValid ( 0 ) )
|
getParentUUIDComponent_ShouldDeferToCougarUUID ( ) { java . lang . String parentUUIDComponent = "abcde-1234-fghij-5678-klmno" ; when ( cougarUuid . getParentUUIDComponent ( ) ) . thenReturn ( parentUUIDComponent ) ; victim = new com . betfair . cougar . modules . zipkin . impl . ZipkinRequestUUIDImpl ( cougarUuid , null ) ; "<AssertPlaceHolder>" ; } getParentUUIDComponent ( ) { return cougarUuid . getParentUUIDComponent ( ) ; }
|
org . junit . Assert . assertEquals ( parentUUIDComponent , victim . getParentUUIDComponent ( ) )
|
testEndingWithUnderscoreOneGroup ( ) { nameForCrossEntityAggregate = "aggregate_" ; "<AssertPlaceHolder>" ; } isValid ( java . lang . String , javax . validation . ConstraintValidatorContext ) { if ( ( null == nameForCrossEntityAggregate ) || ( nameForCrossEntityAggregate . isEmpty ( ) ) ) { return true ; } return com . cloudera . csd . validation . monitoring . MonitoringConventions . isValidMetricNameFormat ( nameForCrossEntityAggregate ) ; }
|
org . junit . Assert . assertFalse ( validator . isValid ( nameForCrossEntityAggregate , context ) )
|
testDisconnect ( ) { java . io . File zkDataDir = org . apache . twill . internal . zookeeper . LeaderElectionTest . tmpFolder . newFolder ( ) ; org . apache . twill . internal . zookeeper . InMemoryZKServer ownZKServer = org . apache . twill . internal . zookeeper . InMemoryZKServer . builder ( ) . setDataDir ( zkDataDir ) . build ( ) ; ownZKServer . startAndWait ( ) ; try { org . apache . twill . zookeeper . ZKClientService zkClient = ZKClientService . Builder . of ( ownZKServer . getConnectionStr ( ) ) . build ( ) ; zkClient . startAndWait ( ) ; try { final java . util . concurrent . Semaphore leaderSem = new java . util . concurrent . Semaphore ( 0 ) ; final java . util . concurrent . Semaphore followerSem = new java . util . concurrent . Semaphore ( 0 ) ; org . apache . twill . internal . zookeeper . LeaderElection leaderElection = new org . apache . twill . internal . zookeeper . LeaderElection ( zkClient , "/testDisconnect" , new org . apache . twill . api . ElectionHandler ( ) { @ org . apache . twill . internal . zookeeper . Override public void leader ( ) { leaderSem . release ( ) ; } @ org . apache . twill . internal . zookeeper . Override public void follower ( ) { followerSem . release ( ) ; } } ) ; leaderElection . start ( ) ; leaderSem . tryAcquire ( 20 , TimeUnit . SECONDS ) ; int zkPort = ownZKServer . getLocalAddress ( ) . getPort ( ) ; ownZKServer . stopAndWait ( ) ; followerSem . tryAcquire ( 20 , TimeUnit . SECONDS ) ; ownZKServer = org . apache . twill . internal . zookeeper . InMemoryZKServer . builder ( ) . setDataDir ( zkDataDir ) . setPort ( zkPort ) . build ( ) ; ownZKServer . startAndWait ( ) ; leaderSem . tryAcquire ( 20 , TimeUnit . SECONDS ) ; ownZKServer . stopAndWait ( ) ; followerSem . tryAcquire ( 20 , TimeUnit . SECONDS ) ; com . google . common . util . concurrent . ListenableFuture < ? > cancelFuture = leaderElection . stop ( ) ; ownZKServer = org . apache . twill . internal . zookeeper . InMemoryZKServer . builder ( ) . setDataDir ( zkDataDir ) . setPort ( zkPort ) . build ( ) ; ownZKServer . startAndWait ( ) ; com . google . common . util . concurrent . Futures . getUnchecked ( cancelFuture ) ; "<AssertPlaceHolder>" ; } finally { zkClient . stopAndWait ( ) ; } } finally { ownZKServer . stopAndWait ( ) ; } } startAndWait ( ) { return com . google . common . util . concurrent . Futures . getUnchecked ( start ( ) ) ; }
|
org . junit . Assert . assertFalse ( leaderSem . tryAcquire ( 10 , TimeUnit . SECONDS ) )
|
testFailedPolicy ( ) { org . springframework . retry . support . RetryTemplate retryTemplate = new org . springframework . retry . support . RetryTemplate ( ) ; retryTemplate . setRetryPolicy ( new org . springframework . retry . policy . NeverRetryPolicy ( ) { @ org . springframework . retry . support . Override public void registerThrowable ( org . springframework . retry . RetryContext context , java . lang . Throwable throwable ) { throw new java . lang . RuntimeException ( "Planned" ) ; } } ) ; try { retryTemplate . execute ( new org . springframework . retry . RetryCallback < java . lang . Object , java . lang . Exception > ( ) { @ org . springframework . retry . support . Override public java . lang . Object doWithRetry ( org . springframework . retry . RetryContext context ) throws org . springframework . retry . support . Exception { throw new java . lang . RuntimeException ( "Realllly<sp>bad!" ) ; } } ) ; org . junit . Assert . fail ( "Expected<sp>Error" ) ; } catch ( org . springframework . retry . TerminatedRetryException e ) { "<AssertPlaceHolder>" ; } } getCause ( ) { return cause ; }
|
org . junit . Assert . assertEquals ( "Planned" , e . getCause ( ) . getMessage ( ) )
|
testHref ( ) { java . lang . String href = "http://www.eclipse.org" ; hyperlink . setHref ( href ) ; "<AssertPlaceHolder>" ; } getHref ( ) { return href ; }
|
org . junit . Assert . assertEquals ( href , hyperlink . getHref ( ) )
|
testGetLines ( ) { final java . lang . String timestamp1 = "2012-11-21_11-41-14" ; final java . lang . String timestamp2 = "2012-11-21_11-42-05" ; java . util . List < hudson . plugins . jobConfigHistory . SideBySideView . Line > result = prepareGetLines ( timestamp1 , timestamp2 ) ; "<AssertPlaceHolder>" ; } prepareGetLines ( java . lang . String , java . lang . String ) { when ( mockedRequest . getParameter ( "timestamp1" ) ) . thenReturn ( timestamp1 ) ; when ( mockedRequest . getParameter ( "timestamp2" ) ) . thenReturn ( timestamp2 ) ; when ( mockedProject . hasPermission ( AbstractProject . CONFIGURE ) ) . thenReturn ( true ) ; when ( mockedProject . getRootDir ( ) ) . thenReturn ( testConfigs . getResource ( "jobs/Test1" ) ) ; hudson . plugins . jobConfigHistory . JobConfigHistoryProjectAction sut = createAction ( ) ; java . util . List < hudson . plugins . jobConfigHistory . SideBySideView . Line > result = sut . getLines ( ) ; return result ; }
|
org . junit . Assert . assertEquals ( 8 , result . size ( ) )
|
testSelectInside ( ) { try { cambridge . parser . TemplateTokenizer tokenizer = new cambridge . parser . TemplateTokenizer ( cambridge . ParserTest . class . getResourceAsStream ( "full.html" ) ) ; cambridge . parser . TemplateParser parser = new cambridge . parser . TemplateParser ( tokenizer , Expressions . cambridgeExpressionLanguage ) ; cambridge . model . TemplateDocument t = parser . parse ( ) ; cambridge . model . FragmentList fragments = t . select ( "inside<sp>/html/body" ) ; java . io . StringWriter builder = new java . io . StringWriter ( ) ; for ( cambridge . model . Fragment f : fragments ) { f . eval ( cambridge . ParserTest . bindings , builder ) ; } inside = inside . replaceAll ( "\\n" , ( ( java . lang . String ) ( java . lang . System . getProperties ( ) . get ( "line.separator" ) ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } catch ( cambridge . TemplateParsingException e ) { e . printStackTrace ( ) ; } catch ( cambridge . BehaviorInstantiationException e ) { e . printStackTrace ( ) ; } catch ( cambridge . TemplateEvaluationException e ) { e . printStackTrace ( ) ; } } toString ( ) { return ( ( ( ( ( ( getMessage ( ) ) + "<sp>(" ) + "Line:<sp>" ) + ( line ) ) + ",<sp>Col:<sp>" ) + ( col ) ) + ")" ; }
|
org . junit . Assert . assertEquals ( inside , builder . toString ( ) )
|
TransitionIsInternal ( ) { com . github . oxo42 . stateless4j . triggers . InternalTriggerBehaviour < com . github . oxo42 . stateless4j . State , com . github . oxo42 . stateless4j . Trigger > ignored = new com . github . oxo42 . stateless4j . triggers . InternalTriggerBehaviour ( Trigger . X , com . github . oxo42 . stateless4j . InternalTriggerBehaviourTests . returnTrue , com . github . oxo42 . stateless4j . InternalTriggerBehaviourTests . nopAction ) ; "<AssertPlaceHolder>" ; } isInternal ( ) { return true ; }
|
org . junit . Assert . assertTrue ( ignored . isInternal ( ) )
|
testRotate_2x4 ( ) { org . la4j . matrix . Matrix a = m ( org . la4j . matrix . MatrixTest . a ( 1.0 , 2.0 , 3.0 , 4.0 ) , org . la4j . matrix . MatrixTest . a ( 5.0 , 6.0 , 7.0 , 8.0 ) ) ; org . la4j . matrix . Matrix b = m ( org . la4j . matrix . MatrixTest . a ( 5.0 , 1.0 ) , org . la4j . matrix . MatrixTest . a ( 6.0 , 2.0 ) , org . la4j . matrix . MatrixTest . a ( 7.0 , 3.0 ) , org . la4j . matrix . MatrixTest . a ( 8.0 , 4.0 ) ) ; "<AssertPlaceHolder>" ; } rotate ( ) { org . la4j . Matrix result = org . la4j . matrix . ColumnMajorSparseMatrix . zero ( columns , rows ) ; java . util . Iterator < java . lang . Integer > nzRows = iteratorOfNonZeroRows ( ) ; java . util . List < java . lang . Integer > reversedNzRows = new java . util . LinkedList < java . lang . Integer > ( ) ; while ( nzRows . hasNext ( ) ) { reversedNzRows . add ( 0 , nzRows . next ( ) ) ; } for ( int i : reversedNzRows ) { org . la4j . iterator . VectorIterator it = nonZeroIteratorOfRow ( i ) ; while ( it . hasNext ( ) ) { double x = it . next ( ) ; int j = it . index ( ) ; result . set ( j , ( ( ( rows ) - 1 ) - i ) , x ) ; } } return result ; }
|
org . junit . Assert . assertEquals ( b , a . rotate ( ) )
|
testSetLocalValue ( ) { System . out . println ( "<sp>setLocalValue" ) ; final java . lang . String varName = "foo" ; final int [ ] values = new int [ ] { 1 , 2 } ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 2 ) ; class Task implements java . lang . Runnable { private final int threadIndex ; public Task ( int threadIndex ) { this . threadIndex = threadIndex ; } public void run ( ) { org . geotools . filter . function . EnvFunction . setLocalValue ( varName , values [ threadIndex ] ) ; latch . countDown ( ) ; try { latch . await ( ) ; } catch ( java . lang . InterruptedException ex ) { throw new java . lang . IllegalStateException ( ex ) ; } java . lang . Object result = ff . function ( "env" , ff . literal ( varName ) ) . evaluate ( null ) ; int value = ( ( java . lang . Number ) ( result ) ) . intValue ( ) ; "<AssertPlaceHolder>" ; } } java . util . concurrent . Future f1 = executor . submit ( new Task ( 0 ) ) ; java . util . concurrent . Future f2 = executor . submit ( new Task ( 1 ) ) ; f1 . get ( ) ; f2 . get ( ) ; } intValue ( ) { return ( ( java . lang . Number ) ( value ) ) . intValue ( ) ; }
|
org . junit . Assert . assertEquals ( values [ threadIndex ] , value )
|
testGetBinaryDataAsStream ( ) { java . lang . String id = "testGetBinary.txt" ; java . io . File test = new java . io . File ( org . segrada . service . binarydata . BinaryDataServiceFileTest . repositoryPath , id ) ; byte [ ] data = "HELLO\nWORLD!" . getBytes ( ) ; com . google . common . io . Files . write ( data , test ) ; java . io . InputStream is = binaryDataServiceFile . getBinaryDataAsStream ( id ) ; byte [ ] check = new byte [ is . available ( ) ] ; is . read ( check ) ; "<AssertPlaceHolder>" ; } getBinaryDataAsStream ( java . lang . String ) { if ( ( fileIdentifier == null ) || ( fileIdentifier . isEmpty ( ) ) ) return null ; try { return binaryDataService . getBinaryDataAsStream ( fileIdentifier ) ; } catch ( java . io . IOException e ) { return null ; } }
|
org . junit . Assert . assertArrayEquals ( data , check )
|
hitRatio ( ) { long hit = 10 ; long miss = 20 ; cache . hit = hit ; cache . miss = miss ; double actualHitRatio = 1 / 3.0 ; double expectedHitRatio = cache . hitRatio ( ) ; "<AssertPlaceHolder>" ; } hitRatio ( ) { return offHeapCache . hitRatio ( ) ; }
|
org . junit . Assert . assertEquals ( expectedHitRatio , actualHitRatio , 0 )
|
testExistsNoZipConfig ( ) { setFunctionFound ( true ) ; java . lang . Boolean result = lambdaDeployService . deployLambda ( getDeployConfig ( ) , null , UpdateModeValue . Config ) ; calledGetFunction ( ) ; calledCreateFunction ( false ) ; calledUpdateCode ( false ) ; calledUpdateConfiguration ( true ) ; "<AssertPlaceHolder>" ; } calledUpdateConfiguration ( java . lang . Boolean ) { if ( called ) { org . mockito . ArgumentCaptor < com . amazonaws . services . lambda . model . UpdateFunctionConfigurationRequest > args = org . mockito . ArgumentCaptor . forClass ( com . amazonaws . services . lambda . model . UpdateFunctionConfigurationRequest . class ) ; verify ( awsLambdaClient , times ( 1 ) ) . updateFunctionConfiguration ( args . capture ( ) ) ; com . amazonaws . services . lambda . model . UpdateFunctionConfigurationRequest expected = new com . amazonaws . services . lambda . model . UpdateFunctionConfigurationRequest ( ) . withDescription ( description ) . withFunctionName ( functionName ) . withHandler ( handler ) . withMemorySize ( memory ) . withRole ( role ) . withRuntime ( runtime ) . withVpcConfig ( new com . amazonaws . services . lambda . model . VpcConfig ( ) . withSubnetIds ( subnets ) . withSecurityGroupIds ( securityGroups ) ) . withTimeout ( timeout ) . withKMSKeyArn ( kmsArn ) . withEnvironment ( new com . amazonaws . services . lambda . model . Environment ( ) . withVariables ( environment ) ) . withDeadLetterConfig ( new com . amazonaws . services . lambda . model . DeadLetterConfig ( ) . withTargetArn ( deadLetterQueueArn ) ) ; org . junit . Assert . assertEquals ( expected , args . getValue ( ) ) ; } else { verify ( awsLambdaClient , never ( ) ) . updateFunctionConfiguration ( any ( com . amazonaws . services . lambda . model . UpdateFunctionConfigurationRequest . class ) ) ; } }
|
org . junit . Assert . assertTrue ( result )
|
deveObterVersaoAplicativoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . evento . NFEnviaEventoRetorno eventoRetorno = new com . fincatto . documentofiscal . nfe310 . classes . evento . NFEnviaEventoRetorno ( ) ; final java . lang . String versaoAplicativo = "v10.0" ; eventoRetorno . setVersaoAplicativo ( versaoAplicativo ) ; "<AssertPlaceHolder>" ; } getVersaoAplicativo ( ) { return this . versaoAplicativo ; }
|
org . junit . Assert . assertEquals ( versaoAplicativo , eventoRetorno . getVersaoAplicativo ( ) )
|
testGetScriptFileWithNoScript ( ) { edu . illinois . library . cantaloupe . config . Configuration config = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) ; config . setProperty ( Key . DELEGATE_SCRIPT_PATHNAME , "" ) ; "<AssertPlaceHolder>" ; } getScriptFile ( ) { final edu . illinois . library . cantaloupe . config . Configuration config = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) ; final java . lang . String configValue = config . getString ( Key . DELEGATE_SCRIPT_PATHNAME , "" ) ; if ( ! ( configValue . isEmpty ( ) ) ) { java . nio . file . Path script = edu . illinois . library . cantaloupe . script . DelegateProxyService . findScript ( configValue ) ; if ( ! ( java . nio . file . Files . exists ( script ) ) ) { throw new java . nio . file . NoSuchFileException ( ( "File<sp>not<sp>found:<sp>" + ( script . toString ( ) ) ) ) ; } return script ; } return null ; }
|
org . junit . Assert . assertNull ( edu . illinois . library . cantaloupe . script . DelegateProxyService . getScriptFile ( ) )
|
whenCollectBySet_thenGetSet ( ) { java . util . Set < java . lang . String > empNames = com . stackify . stream . EmployeeTest . empList . stream ( ) . map ( Employee :: getName ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
|
org . junit . Assert . assertEquals ( empNames . size ( ) , 3 )
|
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . portal . kernel . model . UserTrackerPath missingUserTrackerPath = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
|
org . junit . Assert . assertNull ( missingUserTrackerPath )
|
testClear ( ) { subject . add ( elements [ 0 ] ) ; subject . clear ( ) ; "<AssertPlaceHolder>" ; } size ( ) { final javax . swing . DefaultComboBoxModel < java . lang . String > model = ( ( javax . swing . DefaultComboBoxModel ) ( comboBox . getModel ( ) ) ) ; return model . getSize ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , subject . size ( ) )
|
testEulerNumber_crossC8 ( ) { ij . process . ImageProcessor image = new ij . process . ByteProcessor ( 10 , 10 ) ; for ( int i = 2 ; i < 8 ; i ++ ) { image . set ( i , 4 , 255 ) ; image . set ( i , 5 , 255 ) ; image . set ( 4 , i , 255 ) ; image . set ( 5 , i , 255 ) ; } int euler = inra . ijpb . measure . IntrinsicVolumes2D . eulerNumber ( image , 8 ) ; "<AssertPlaceHolder>" ; } eulerNumber ( ij . process . ImageProcessor , int ) { int [ ] lut = inra . ijpb . measure . region2d . IntrinsicVolumesAnalyzer2D . eulerNumberIntLut ( conn ) ; int [ ] histo = new inra . ijpb . measure . region2d . BinaryConfigurationsHistogram2D ( ) . process ( image ) ; return ( inra . ijpb . measure . region2d . BinaryConfigurationsHistogram2D . applyLut ( histo , lut ) ) / 4 ; }
|
org . junit . Assert . assertEquals ( 1 , euler )
|
newResponse ( ) { org . jboss . elasticsearch . river . remote . mgm . state . JRStateResponse rb = JRStateAction . INSTANCE . newResponse ( ) ; "<AssertPlaceHolder>" ; } newResponse ( ) { return new org . jboss . elasticsearch . river . remote . mgm . state . JRStateResponse ( ) ; }
|
org . junit . Assert . assertNotNull ( rb )
|
test_toString ( ) { org . joda . money . CurrencyUnit test = org . joda . money . CurrencyUnit . of ( "GBP" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "MoneyAmountStyle['" + ( getZeroCharacter ( ) ) ) + "','" ) + ( getPositiveSignCharacter ( ) ) ) + "','" ) + ( getNegativeSignCharacter ( ) ) ) + "','" ) + ( getDecimalPointCharacter ( ) ) ) + "','" ) + ( getGroupingStyle ( ) ) ) + "," ) + ( getGroupingCharacter ( ) ) ) + "','" ) + ( getGroupingSize ( ) ) ) + "'," ) + ( isForcedDecimalPoint ( ) ) ) + "'," ) + ( isAbsValue ( ) ) ) + "]" ; }
|
org . junit . Assert . assertEquals ( "GBP" , test . toString ( ) )
|
testStopPointsByRoute ( ) { when ( transitDataService . getRouteForId ( "MTA<sp>NYCT_M102" ) ) . thenReturn ( routeBean ) ; when ( transitDataService . getStopsForRoute ( "MTA<sp>NYCT_M102" ) ) . thenReturn ( stopsForRouteBean ) ; when ( transitDataService . stopHasUpcomingScheduledService ( anyString ( ) , anyLong ( ) , anyString ( ) , anyString ( ) , anyString ( ) ) ) . thenReturn ( true ) ; uk . org . siri . siri_2 . LineDirectionStructure lds = new uk . org . siri . siri_2 . LineDirectionStructure ( ) ; uk . org . siri . siri_2 . DirectionRefStructure drs = new uk . org . siri . siri_2 . DirectionRefStructure ( ) ; uk . org . siri . siri_2 . LineRefStructure lrs = new uk . org . siri . siri_2 . LineRefStructure ( ) ; lds . setDirectionRef ( drs ) ; lds . setLineRef ( lrs ) ; drs . setValue ( "0" ) ; lrs . setValue ( "MTA<sp>NYCT_M102" ) ; uk . org . siri . siri_2 . LocationStructure ls = new uk . org . siri . siri_2 . LocationStructure ( ) ; java . math . BigDecimal lat = new java . math . BigDecimal ( 40.81694 ) ; java . math . BigDecimal lon = new java . math . BigDecimal ( ( - 73.938614 ) ) ; ls . setLatitude ( lat . setScale ( 6 , BigDecimal . ROUND_HALF_DOWN ) ) ; ls . setLongitude ( lon . setScale ( 6 , BigDecimal . ROUND_HALF_DOWN ) ) ; uk . org . siri . siri_2 . NaturalLanguageStringStructure stopName = new uk . org . siri . siri_2 . NaturalLanguageStringStructure ( ) ; stopName . setValue ( "MALCOLM<sp>X<sp>BL/W<sp>139<sp>ST" ) ; java . util . List < uk . org . siri . siri_2 . NaturalLanguageStringStructure > stopNames = new java . util . ArrayList < uk . org . siri . siri_2 . NaturalLanguageStringStructure > ( ) ; stopNames . add ( stopName ) ; uk . org . siri . siri_2 . StopPointRefStructure stopPointRef = new uk . org . siri . siri_2 . StopPointRefStructure ( ) ; stopPointRef . setValue ( "MTA_400062" ) ; java . lang . Boolean monitored = true ; uk . org . siri . siri_2 . AnnotatedStopPointStructure mockStopPoint = new uk . org . siri . siri_2 . AnnotatedStopPointStructure ( ) ; mockStopPoint . setLines ( new uk . org . siri . siri_2 . AnnotatedStopPointStructure . Lines ( ) ) ; mockStopPoint . getLines ( ) . getLineRefOrLineDirection ( ) . add ( lds ) ; mockStopPoint . setLocation ( ls ) ; mockStopPoint . getStopName ( ) . add ( stopName ) ; mockStopPoint . setStopPointRef ( stopPointRef ) ; mockStopPoint . setMonitored ( monitored ) ; java . util . List < java . lang . String > agencyIds = new java . util . ArrayList < java . lang . String > ( ) ; java . lang . String agencyId = "MTA<sp>NYCT" ; agencyIds . add ( agencyId ) ; java . util . List < org . onebusaway . gtfs . model . AgencyAndId > routeIds = new java . util . ArrayList < org . onebusaway . gtfs . model . AgencyAndId > ( ) ; org . onebusaway . gtfs . model . AgencyAndId routeId = org . onebusaway . transit_data_federation . services . AgencyAndIdLibrary . convertFromString ( "MTA<sp>NYCT_M102" ) ; routeIds . add ( routeId ) ; org . onebusaway . nyc . webapp . actions . api . siri . model . DetailLevel detailLevel = org . onebusaway . nyc . webapp . actions . api . siri . model . DetailLevel . NORMAL ; long time = java . lang . System . currentTimeMillis ( ) ; java . util . Map < org . onebusaway . nyc . webapp . actions . api . siri . impl . SiriSupportV2 . Filters , java . lang . String > filters = new java . util . HashMap < org . onebusaway . nyc . webapp . actions . api . siri . impl . SiriSupportV2 . Filters , java . lang . String > ( ) ; java . util . Map < java . lang . Boolean , java . util . List < uk . org . siri . siri_2 . AnnotatedStopPointStructure > > actualResult = realtimeService . getAnnotatedStopPointStructures ( agencyIds , routeIds , detailLevel , time , filters ) ; uk . org . siri . siri_2 . AnnotatedStopPointStructure actualStopPoint = actualResult . get ( true ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } isEqual ( uk . org . siri . siri_2 . AnnotatedStopPointStructure , uk . org . siri . siri_2 . AnnotatedStopPointStructure ) { boolean linesEq = org . apache . commons . lang . builder . EqualsBuilder . reflectionEquals ( sp1 . getLines ( ) . getLineRefOrLineDirection ( ) , sp2 . getLines ( ) . getLineRefOrLineDirection ( ) ) ; boolean stopNameEq = org . apache . commons . lang . builder . EqualsBuilder . reflectionEquals ( sp1 . getStopName ( ) , sp2 . getStopName ( ) ) ; boolean sprEq = org . apache . commons . lang . builder . EqualsBuilder . reflectionEquals ( sp1 . getStopPointRef ( ) , sp2 . getStopPointRef ( ) ) ; boolean locationEq = org . apache . commons . lang . builder . EqualsBuilder . reflectionEquals ( sp1 . getLocation ( ) , sp2 . getLocation ( ) ) ; boolean monEq = org . apache . commons . lang . builder . EqualsBuilder . reflectionEquals ( sp1 . isMonitored ( ) , sp2 . isMonitored ( ) ) ; if ( ( ( ( linesEq && stopNameEq ) && sprEq ) && locationEq ) && monEq ) return true ; return false ; }
|
org . junit . Assert . assertTrue ( isEqual ( mockStopPoint , actualStopPoint ) )
|
testGetGroupResultFunction ( ) { @ org . springframework . data . solr . core . query . result . SuppressWarnings ( "unchecked" ) org . springframework . data . solr . core . query . result . GroupResult < java . lang . Object > gr = new org . springframework . data . solr . core . query . result . SimpleGroupResult ( 1 , null , "name" , org . mockito . Mockito . mock ( org . springframework . data . domain . Page . class ) ) ; org . springframework . data . solr . core . query . Function func = org . mockito . Mockito . mock ( org . springframework . data . solr . core . query . Function . class ) ; java . util . Map < java . lang . Object , org . springframework . data . solr . core . query . result . GroupResult < java . lang . Object > > groupResultMap = new java . util . HashMap ( ) ; groupResultMap . put ( func , gr ) ; org . springframework . data . solr . core . query . result . SolrResultPage < java . lang . Object > result = new org . springframework . data . solr . core . query . result . SolrResultPage ( java . util . Collections . emptyList ( ) ) ; result . setGroupResults ( groupResultMap ) ; "<AssertPlaceHolder>" ; } getGroupResult ( org . springframework . data . solr . core . query . Field ) { org . springframework . util . Assert . notNull ( field , "group<sp>result<sp>field<sp>must<sp>not<sp>be<sp>null" ) ; return groupResults . get ( field . getName ( ) ) ; }
|
org . junit . Assert . assertEquals ( gr , result . getGroupResult ( func ) )
|
shouldDeterminePropertiesAreNotEqualWhenValuesAreDifferent ( ) { final org . apache . tinkerpop . gremlin . structure . Property mockPropertyA = mock ( org . apache . tinkerpop . gremlin . structure . Property . class ) ; final org . apache . tinkerpop . gremlin . structure . Property mockPropertyB = mock ( org . apache . tinkerpop . gremlin . structure . Property . class ) ; final org . apache . tinkerpop . gremlin . structure . Element mockElement = mock ( org . apache . tinkerpop . gremlin . structure . Element . class ) ; when ( mockPropertyA . isPresent ( ) ) . thenReturn ( true ) ; when ( mockPropertyB . isPresent ( ) ) . thenReturn ( true ) ; when ( mockPropertyA . element ( ) ) . thenReturn ( mockElement ) ; when ( mockPropertyB . element ( ) ) . thenReturn ( mockElement ) ; when ( mockPropertyA . key ( ) ) . thenReturn ( "k" ) ; when ( mockPropertyB . key ( ) ) . thenReturn ( "k" ) ; when ( mockPropertyA . value ( ) ) . thenReturn ( "v" ) ; when ( mockPropertyB . value ( ) ) . thenReturn ( "v1" ) ; "<AssertPlaceHolder>" ; } areEqual ( org . apache . tinkerpop . gremlin . structure . Element , java . lang . Object ) { if ( ( null == b ) || ( null == a ) ) return false ; if ( a == b ) return true ; if ( ! ( ( ( ( a instanceof org . apache . tinkerpop . gremlin . structure . Vertex ) && ( b instanceof org . apache . tinkerpop . gremlin . structure . Vertex ) ) || ( ( a instanceof org . apache . tinkerpop . gremlin . structure . Edge ) && ( b instanceof org . apache . tinkerpop . gremlin . structure . Edge ) ) ) || ( ( a instanceof org . apache . tinkerpop . gremlin . structure . VertexProperty ) && ( b instanceof org . apache . tinkerpop . gremlin . structure . VertexProperty ) ) ) ) return false ; return org . apache . tinkerpop . gremlin . structure . util . ElementHelper . haveEqualIds ( a , ( ( org . apache . tinkerpop . gremlin . structure . Element ) ( b ) ) ) ; }
|
org . junit . Assert . assertFalse ( org . apache . tinkerpop . gremlin . structure . util . ElementHelper . areEqual ( mockPropertyA , mockPropertyB ) )
|
testExclude ( ) { java . util . Properties config = new java . util . Properties ( ) ; config . put ( org . apache . metron . stellar . dsl . functions . resolver . STELLAR_SEARCH_EXCLUDES_KEY . param ( ) , "org.apache.metron.*" ) ; org . apache . metron . stellar . dsl . functions . resolver . ClasspathFunctionResolver resolver = org . apache . metron . stellar . dsl . functions . resolver . ClasspathFunctionResolverTest . create ( config ) ; java . util . List < java . lang . String > actual = com . google . common . collect . Lists . newArrayList ( resolver . getFunctions ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( java . util . Map m : variableMappings ) { size += m . size ( ) ; } return size ; }
|
org . junit . Assert . assertEquals ( 0 , actual . size ( ) )
|
addSetMember_shouldAppendConceptToExistingConceptSet ( ) { org . openmrs . Concept concept = new org . openmrs . Concept ( ) ; org . openmrs . Concept setMember1 = new org . openmrs . Concept ( 1 ) ; concept . addSetMember ( setMember1 ) ; org . openmrs . Concept setMember2 = new org . openmrs . Concept ( 2 ) ; concept . addSetMember ( setMember2 ) ; "<AssertPlaceHolder>" ; } getSetMembers ( ) { java . util . List < org . openmrs . Concept > conceptMembers = new java . util . ArrayList ( ) ; java . util . Collection < org . openmrs . ConceptSet > sortedConceptSet = getSortedConceptSets ( ) ; for ( org . openmrs . ConceptSet conceptSet : sortedConceptSet ) { conceptMembers . add ( conceptSet . getConcept ( ) ) ; } return java . util . Collections . unmodifiableList ( conceptMembers ) ; }
|
org . junit . Assert . assertEquals ( setMember2 , concept . getSetMembers ( ) . get ( 1 ) )
|
refreshModelContent ( ) { when ( scenarioSimulationModelMock . getSimulation ( ) ) . thenReturn ( simulationMock ) ; java . util . Set < Map . Entry < java . lang . Integer , org . drools . workbench . screens . scenariosimulation . model . Scenario > > entries = new java . util . HashSet ( ) ; int scenarioNumber = 1 ; int scenarioIndex = scenarioNumber - 1 ; entries . add ( new java . util . AbstractMap . SimpleEntry < > ( scenarioNumber , new org . drools . workbench . screens . scenariosimulation . model . Scenario ( ) ) ) ; when ( scenarioMapMock . entrySet ( ) ) . thenReturn ( entries ) ; presenter . refreshModelContent ( scenarioMapMock ) ; verify ( simulationMock , times ( 1 ) ) . replaceScenario ( eq ( scenarioIndex ) , any ( ) ) ; "<AssertPlaceHolder>" ; verify ( scenarioSimulationViewMock , times ( 1 ) ) . refreshContent ( eq ( simulationMock ) ) ; verify ( statusMock , times ( 1 ) ) . setSimulation ( eq ( simulationMock ) ) ; verify ( dataManagementStrategyMock , times ( 1 ) ) . setModel ( eq ( scenarioSimulationModelMock ) ) ; } getModel ( ) { return model ; }
|
org . junit . Assert . assertEquals ( scenarioSimulationModelMock , presenter . getModel ( ) )
|
testInvariantNotCalledWhenPureInContract ( ) { de . vksi . c4j . systemtest . config . purebehaviorskiponly . PureBehaviorSkipOnlySystemTest . TargetClassWithPureInContract target = new de . vksi . c4j . systemtest . config . purebehaviorskiponly . PureBehaviorSkipOnlySystemTest . TargetClassWithPureInContract ( ) ; de . vksi . c4j . systemtest . config . purebehaviorskiponly . PureBehaviorSkipOnlySystemTest . ContractClassWithPureInContract . invariantCalled = false ; target . pureMethod ( ) ; "<AssertPlaceHolder>" ; } pureMethod ( ) { }
|
org . junit . Assert . assertFalse ( de . vksi . c4j . systemtest . config . purebehaviorskiponly . PureBehaviorSkipOnlySystemTest . ContractClassWithPureInContract . invariantCalled )
|
shouldReturnAnInstanceOfCollectionMergingDefaultProcessorForForm ( ) { org . codegist . crest . param . CollectionMergingParamProcessor expected = mock ( org . codegist . crest . param . CollectionMergingParamProcessor . class ) ; whenNew ( org . codegist . crest . param . CollectionMergingParamProcessor . class ) . withArguments ( "-" ) . thenReturn ( expected ) ; org . codegist . crest . param . ParamProcessor actual = org . codegist . crest . param . ParamProcessors . newInstance ( ParamType . FORM , "-" ) ; "<AssertPlaceHolder>" ; } newInstance ( org . codegist . crest . config . ParamType , java . lang . String ) { switch ( type ) { case COOKIE : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingCookieParamProcessor ( listSeparator ) : DefaultCookieParamProcessor . INSTANCE ; default : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingParamProcessor ( listSeparator ) : DefaultParamProcessor . INSTANCE ; } }
|
org . junit . Assert . assertSame ( expected , actual )
|
drupalEditionActionHelper_updatedNewsItem_isDrupalNodeOutdatedIsTrue ( ) { dk . i2m . converge . core . content . NewsItem newsItem = getUpdatedNewsItem ( ) ; dk . i2m . converge . core . content . NewsItemEditionState state = getNewsItemEditionState ( ) ; state . setNewsItem ( newsItem ) ; boolean isDrupalNodeOutdated = dk . i2m . converge . plugins . drupalclient . DrupalEditionActionHelper . isDrupalNodeOutdated ( newsItem , state ) ; "<AssertPlaceHolder>" ; } isDrupalNodeOutdated ( dk . i2m . converge . core . content . NewsItem , dk . i2m . converge . core . content . NewsItemEditionState ) { long storyLastUpdated = newsItem . getUpdated ( ) . getTimeInMillis ( ) ; long storyUploadedLastUpdated ; try { storyUploadedLastUpdated = java . lang . Long . valueOf ( version . getValue ( ) ) ; } catch ( java . lang . NumberFormatException ex ) { storyUploadedLastUpdated = 0 ; } return storyLastUpdated != storyUploadedLastUpdated ; }
|
org . junit . Assert . assertTrue ( isDrupalNodeOutdated )
|
testNthElementFull ( ) { int [ ] array = new int [ ] { 5 , 6 , 4 , 3 , 2 , 6 , 7 , 9 , 3 } ; int pivot = 4 ; com . jujutsu . tsne . barneshut . VpTree . nth_element ( array , 0 , pivot , 9 ) ; "<AssertPlaceHolder>" ; } nth_element ( int [ ] , int , int , int ) { int [ ] tmp = new int [ high - low ] ; for ( int i = 0 ; i < ( tmp . length ) ; i ++ ) { tmp [ i ] = array [ ( low + i ) ] ; } java . util . Arrays . sort ( tmp ) ; for ( int i = 0 ; i < ( tmp . length ) ; i ++ ) { array [ ( low + i ) ] = tmp [ i ] ; } }
|
org . junit . Assert . assertEquals ( 5 , array [ pivot ] )
|
passwordMustBeGreaterThan6Chars ( ) { com . javafortesters . chap015stringsrevisited . exercises . User aUser = new com . javafortesters . chap015stringsrevisited . exercises . User ( "username" , "I23456" ) ; "<AssertPlaceHolder>" ; } getPassword ( ) { return password ; }
|
org . junit . Assert . assertEquals ( "I23456" , aUser . getPassword ( ) )
|
testSendNotificationWithAppKeyWithSpecialCharacter ( ) { int erroCode = ErrorCodeEnum . NOERROR . value ( ) ; java . lang . String msgTitle = "jpush" ; java . lang . String msgContent = "jpush+" ; cn . jpush . api . MessageResult result = jpush . sendNotificationWithAppKey ( sendNo , msgTitle , msgContent ) ; "<AssertPlaceHolder>" ; } getErrcode ( ) { return errcode ; }
|
org . junit . Assert . assertEquals ( erroCode , result . getErrcode ( ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.