input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testPagination ( ) { com . hm . achievement . command . pagination . CommandPagination pagination = new com . hm . achievement . command . pagination . CommandPagination ( toPaginate , 18 , langConfig ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( getPaginationHeader ( 1 , 4 ) , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "10" , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , getPaginationFooter ( ) ) ; java . util . List < java . lang . String > result = new java . util . ArrayList ( ) ; pagination . sendPage ( 1 , result :: add ) ; "<AssertPlaceHolder>" ; } sendPage ( int , org . bukkit . command . CommandSender ) { sendPage ( page , to :: sendMessage ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
testGetEngineManager ( ) { org . eclipse . core . resources . IWorkspaceRoot workspaceRoot = org . eclipse . core . resources . ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; org . eclipse . core . resources . IProject theProject = workspaceRoot . getProject ( org . eclipse . thym . core . HybridProjectTest . PROJECT_NAME ) ; org . eclipse . thym . core . HybridProject hProject = org . eclipse . thym . core . HybridProject . getHybridProject ( theProject ) ; "<AssertPlaceHolder>" ; } getEngineManager ( ) { if ( ( this . engineManager ) == null ) { engineManager = new org . eclipse . thym . core . engine . HybridMobileEngineManager ( this ) ; } return engineManager ; } | org . junit . Assert . assertNotNull ( hProject . getEngineManager ( ) ) |
testRecursiveGeneric ( ) { class MergeableImpl implements com . google . auto . value . AutoValueTest . Mergeable < MergeableImpl > { @ com . google . auto . value . Override public MergeableImpl merge ( MergeableImpl other ) { return this ; } } MergeableImpl mergeable = new MergeableImpl ( ) ; com . google . auto . value . AutoValueTest . Delta < MergeableImpl > instance = com . google . auto . value . AutoValueTest . Delta . create ( mergeable ) ; "<AssertPlaceHolder>" ; } create ( java . lang . Object ) { return new tests . MixedDepsImplementingInterfaces ( tests . MixedDepsImplementingInterfacesFactory . checkNotNull ( o , 1 ) ) ; } | org . junit . Assert . assertSame ( mergeable , instance . meta ( ) ) |
shouldCompareWithRankingYieldingANonZeroValueReturnThatValue ( ) { @ org . uma . jmetal . util . comparator . SuppressWarnings ( "unchecked" ) java . util . Comparator < org . uma . jmetal . solution . Solution < ? > > rankComparator = mock ( java . util . Comparator . class ) ; when ( rankComparator . compare ( any ( org . uma . jmetal . solution . Solution . class ) , any ( org . uma . jmetal . solution . Solution . class ) ) ) . thenReturn ( 1 ) ; org . springframework . test . util . ReflectionTestUtils . setField ( comparator , "rankComparator" , rankComparator ) ; org . uma . jmetal . solution . Solution < ? > solution1 = mock ( org . uma . jmetal . solution . Solution . class ) ; org . uma . jmetal . solution . Solution < ? > solution2 = mock ( org . uma . jmetal . solution . Solution . class ) ; "<AssertPlaceHolder>" ; verify ( rankComparator ) . compare ( solution1 , solution2 ) ; } compare ( S extends org . uma . jmetal . solution . Solution , S extends org . uma . jmetal . solution . Solution ) { if ( ( overallConstraintViolation . getAttribute ( solution1 ) ) == null ) { return 0 ; } double overall1 ; double overall2 ; overall1 = ( numberOfViolatedConstraints . getAttribute ( solution1 ) ) * ( overallConstraintViolation . getAttribute ( solution1 ) ) ; overall2 = ( numberOfViolatedConstraints . getAttribute ( solution2 ) ) * ( overallConstraintViolation . getAttribute ( solution2 ) ) ; if ( ( overall1 < 0 ) && ( overall2 < 0 ) ) { if ( overall1 > overall2 ) { return - 1 ; } else if ( overall2 > overall1 ) { return 1 ; } else { return 0 ; } } else if ( ( overall1 == 0 ) && ( overall2 < 0 ) ) { return - 1 ; } else if ( ( overall1 < 0 ) && ( overall2 == 0 ) ) { return 1 ; } else { return 0 ; } } | org . junit . Assert . assertEquals ( 1 , comparator . compare ( solution1 , solution2 ) ) |
testBuildDefaultValidatorFactory ( ) { javax . validation . ValidatorFactory factory = javax . validation . Validation . buildDefaultValidatorFactory ( ) ; javax . validation . Validator validator = factory . getValidator ( ) ; "<AssertPlaceHolder>" ; } getValidator ( ) { return new org . hibernate . validator . engine . ValidatorImpl ( constraintValidatorFactory , messageInterpolator , traversableResolver , constraintHelper , beanMetaDataCache , failFast ) ; } | org . junit . Assert . assertNotNull ( validator ) |
largeIndent ( ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; com . dslplatform . json . PrettifyOutputStream prettifyStream = new com . dslplatform . json . PrettifyOutputStream ( out , PrettifyOutputStream . IndentType . TABS , 800 ) ; prettifyStream . write ( "[42]" . getBytes ( StandardCharsets . UTF_8 ) ) ; java . lang . String expected = ( ( "[\n" + ( indent ( '\t' , 800 ) ) ) + "42\n" ) + "]" ; "<AssertPlaceHolder>" ; } toString ( ) { return new java . lang . String ( buffer , 0 , position , com . dslplatform . json . JsonWriter . UTF_8 ) ; } | org . junit . Assert . assertEquals ( expected , out . toString ( ) ) |
reconnectData ( ) { org . terracotta . lease . LeaseReconnectData reconnectData = leaseAcquirer . getReconnectData ( ) ; "<AssertPlaceHolder>" ; } getConnectionSequenceNumber ( ) { return connectionSequenceNumber ; } | org . junit . Assert . assertEquals ( 0 , reconnectData . getConnectionSequenceNumber ( ) ) |
testThatLanguageIsEnglish ( ) { util . validator . LanguageChecker languageChecker = new util . validator . LanguageChecker ( ) ; java . lang . String expectedLanguage = "en" ; java . lang . String actualLanguage = languageChecker . getRecognisedLanguage ( "Find<sp>information<sp>on<sp>medical<sp>topics,<sp>symptoms,<sp>drugs,<sp>procedures,<sp>news<sp>and<sp>more,<sp>written<sp>in<sp>everyday<sp>language." ) . get ( ) . getLanguage ( ) ; "<AssertPlaceHolder>" ; } getRecognisedLanguage ( org . openqa . selenium . WebDriver ) { return net . itarray . automotion . tools . helpers . LanguageChecker . getRecognisedLanguage ( driver ) ; } | org . junit . Assert . assertEquals ( expectedLanguage , actualLanguage ) |
clearCacheAcceptedVerifyReturnValue ( ) { when ( chargePointService . clearCache ( any ( io . motown . ocpp . v15 . soap . chargepoint . ClearCacheRequest . class ) , eq ( io . motown . ocpp . v15 . soap . chargepoint . CHARGING_STATION_ID . getId ( ) ) ) ) . thenReturn ( getClearCacheResponse ( ClearCacheStatus . ACCEPTED ) ) ; boolean requestResult = client . clearCache ( io . motown . ocpp . v15 . soap . chargepoint . CHARGING_STATION_ID ) ; "<AssertPlaceHolder>" ; } clearCache ( io . motown . ocpp . v15 . soap . chargepoint . ChargingStationId ) { io . motown . ocpp . v15 . soap . chargepoint . ChargePointService chargePointService = this . createChargingStationService ( id ) ; io . motown . ocpp . v15 . soap . chargepoint . ClearCacheRequest request = new io . motown . ocpp . v15 . soap . chargepoint . ClearCacheRequest ( ) ; boolean requestResult ; io . motown . ocpp . v15 . soap . chargepoint . ClearCacheResponse response = chargePointService . clearCache ( request , id . getId ( ) ) ; if ( ClearCacheStatus . ACCEPTED . equals ( response . getStatus ( ) ) ) { io . motown . ocpp . v15 . soap . chargepoint . ChargingStationOcpp15SoapClient . LOG . info ( "Clear<sp>cache<sp>on<sp>{}<sp>has<sp>been<sp>accepted" , id . getId ( ) ) ; requestResult = true ; } else { io . motown . ocpp . v15 . soap . chargepoint . ChargingStationOcpp15SoapClient . LOG . warn ( "Clear<sp>cache<sp>on<sp>{}<sp>has<sp>been<sp>rejected" , id . getId ( ) ) ; requestResult = false ; } return requestResult ; } | org . junit . Assert . assertTrue ( requestResult ) |
testEncodingAndDecoding ( ) { int randomLimit = 500 ; boolean success = true ; byte [ ] raw = new byte [ ( ( int ) ( ( java . lang . Math . random ( ) ) * randomLimit ) ) ] ; for ( int i = 0 ; i < ( raw . length ) ; ++ i ) { if ( ( i % 1024 ) < 256 ) raw [ i ] = ( ( byte ) ( i % 1024 ) ) ; else raw [ i ] = ( ( byte ) ( ( ( int ) ( ( java . lang . Math . random ( ) ) * 255 ) ) - 128 ) ) ; } flex . messaging . util . Base64 . Encoder encoder = new flex . messaging . util . Base64 . Encoder ( 100 ) ; encoder . encode ( raw ) ; java . lang . String encoded = encoder . drain ( ) ; flex . messaging . util . Base64 . Decoder decoder = new flex . messaging . util . Base64 . Decoder ( ) ; decoder . decode ( encoded ) ; byte [ ] check = decoder . flush ( ) ; if ( ( check . length ) != ( raw . length ) ) { success = false ; } else { for ( int i = 0 ; i < ( check . length ) ; ++ i ) { if ( ( check [ i ] ) != ( raw [ i ] ) ) { success = false ; break ; } } } "<AssertPlaceHolder>" ; } flush ( ) { if ( ( flex . messaging . log . Log . log ) != null ) { flex . messaging . log . Log . log . loggers . clear ( ) ; flex . messaging . log . Log . log . targets . clear ( ) ; flex . messaging . log . Log . log . targetLevel = LogEvent . NONE ; } } | org . junit . Assert . assertTrue ( success ) |
request_interceptor_used ( ) { com . amazon . ask . dispatcher . request . interceptor . RequestInterceptor requestInterceptor = mock ( com . amazon . ask . dispatcher . request . interceptor . RequestInterceptor . class ) ; builder . addRequestHandler ( mockRequestHandler ) ; builder . addRequestInterceptor ( requestInterceptor ) ; com . amazon . ask . builder . SkillConfiguration configuration = builder . getConfigBuilder ( ) . build ( ) ; "<AssertPlaceHolder>" ; } getRequestInterceptors ( ) { return requestInterceptors ; } | org . junit . Assert . assertEquals ( configuration . getRequestInterceptors ( ) . get ( 0 ) , requestInterceptor ) |
whenAnyActionDoTypeResult ( ) { chapter1 . jvm . Calculator calc = new chapter1 . jvm . Calculator ( "Hello<sp>world" ) ; java . lang . String message = "Hello<sp>world" ; java . lang . String result = calc . sayResult ( ) ; "<AssertPlaceHolder>" ; } sayResult ( ) { return result ; } | org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( message ) ) |
testCommitOnLastOperator ( ) { com . github . davidmoten . rx . jdbc . Database db = db ( ) ; long count = db . beginTransaction ( ) . concatMap ( com . github . davidmoten . rx . Functions . constant ( rx . Observable . just ( 99 , 88 ) ) ) . doOnEach ( com . github . davidmoten . rx . RxUtil . log ( ) ) . compose ( db . update ( "update<sp>person<sp>set<sp>score=?" ) . parameterTransformer ( ) ) . compose ( db . commitOnComplete_ ( ) ) . compose ( db . select ( "select<sp>count(*)<sp>from<sp>person<sp>where<sp>score=88" ) . dependsOnTransformer ( ) . getAs ( com . github . davidmoten . rx . jdbc . Long . class ) ) . toBlocking ( ) . single ( ) ; "<AssertPlaceHolder>" ; } getAs ( java . lang . Class ) { return get ( com . github . davidmoten . rx . jdbc . tuple . Tuples . single ( cls ) ) ; } | org . junit . Assert . assertEquals ( 3 , count ) |
testExportFeatures ( ) { "<AssertPlaceHolder>" ; } exportFeatures ( ) { return new org . ff4j . conf . XmlParser ( ) . exportFeatures ( getFeatureStore ( ) . readAll ( ) ) ; } | org . junit . Assert . assertNotNull ( ff4j . exportFeatures ( ) ) |
compliantUntilDateIsNullWhenNoInstalledProductsAndNoEntitlements ( ) { org . candlepin . model . Consumer consumer = mockConsumer ( ) ; org . candlepin . policy . js . compliance . ComplianceStatus status = compliance . getStatus ( consumer , new java . util . Date ( ) ) ; "<AssertPlaceHolder>" ; } getCompliantUntil ( ) { return this . compliantUntil ; } | org . junit . Assert . assertNull ( status . getCompliantUntil ( ) ) |
testUnassignedParserRuleCall ( ) { org . eclipse . xtend2 . lib . StringConcatenation _builder = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder . append ( "Rule:<sp>Called;" ) ; _builder . newLine ( ) ; _builder . append ( "Called<sp>returns<sp>Sub:<sp>name=ID;" ) ; _builder . newLine ( ) ; final java . lang . String actual = this . toPda ( _builder ) ; org . eclipse . xtend2 . lib . StringConcatenation _builder_1 = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder_1 . append ( "Rule:" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "start<sp>-><sp>>>Called" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "<<Called<sp>-><sp>stop" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( ">>Called<sp>-><sp>name=ID" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "name=ID<sp>-><sp><<Called" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "Called:" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "Rule:<sp>Called;" 0 ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "name=ID<sp>-><sp>stop" ) ; _builder_1 . newLine ( ) ; final java . lang . String expected = _builder_1 . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . Joiner . on ( "\n" ) . join ( getList ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
ValidUUIDContentEncryptionKeyFromKeyIdentifierTest ( ) { java . util . UUID validUUID = java . util . UUID . randomUUID ( ) ; com . microsoft . windowsazure . services . media . implementation . templates . playreadylicense . ContentEncryptionKeyFromKeyIdentifier contentEncryptionKeyFromKeyIdentifier = new com . microsoft . windowsazure . services . media . implementation . templates . playreadylicense . ContentEncryptionKeyFromKeyIdentifier ( validUUID ) ; java . util . UUID resultUUID = contentEncryptionKeyFromKeyIdentifier . getKeyIdentifier ( ) ; "<AssertPlaceHolder>" ; } getKeyIdentifier ( ) { return keyIdentifier ; } | org . junit . Assert . assertEquals ( resultUUID , validUUID ) |
testIdEqObjectId ( ) { com . j256 . ormlite . stmt . WhereTest . FooId foo = new com . j256 . ormlite . stmt . WhereTest . FooId ( ) ; int id = 112132 ; foo . id = id ; com . j256 . ormlite . stmt . Where < com . j256 . ormlite . stmt . WhereTest . FooId , java . lang . Integer > where = new com . j256 . ormlite . stmt . Where < com . j256 . ormlite . stmt . WhereTest . FooId , java . lang . Integer > ( new com . j256 . ormlite . table . TableInfo < com . j256 . ormlite . stmt . WhereTest . FooId , java . lang . Integer > ( databaseType , com . j256 . ormlite . stmt . WhereTest . FooId . class ) , null , databaseType ) ; com . j256 . ormlite . dao . BaseDaoImpl < com . j256 . ormlite . stmt . WhereTest . FooId , java . lang . Integer > fooDao = new com . j256 . ormlite . dao . BaseDaoImpl < com . j256 . ormlite . stmt . WhereTest . FooId , java . lang . Integer > ( connectionSource , com . j256 . ormlite . stmt . WhereTest . FooId . class ) { } ; where . idEq ( fooDao , foo ) ; java . lang . StringBuilder whereSb = new java . lang . StringBuilder ( ) ; where . appendSql ( null , whereSb , new java . util . ArrayList < com . j256 . ormlite . stmt . ArgumentHolder > ( ) ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; databaseType . appendEscapedEntityName ( sb , com . j256 . ormlite . stmt . WhereTest . ID_COLUMN_NAME ) ; sb . append ( "<sp>=<sp>" ) . append ( id ) ; sb . append ( '<sp>' ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( getClass ( ) . getSimpleName ( ) ) + ":name=" ) + ( field . getName ( ) ) ) + ",class=" ) + ( field . getDeclaringClass ( ) . getSimpleName ( ) ) ; } | org . junit . Assert . assertEquals ( sb . toString ( ) , whereSb . toString ( ) ) |
serializationTestWithURI ( ) { org . apache . rya . api . domain . RyaSubGraph bundle = new org . apache . rya . api . domain . RyaSubGraph ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; bundle . addStatement ( new org . apache . rya . api . domain . RyaStatement ( new org . apache . rya . api . domain . RyaIRI ( "uri:123" ) , new org . apache . rya . api . domain . RyaIRI ( "uri:234" ) , new org . apache . rya . api . domain . RyaIRI ( "uri:345" ) ) ) ; bundle . addStatement ( new org . apache . rya . api . domain . RyaStatement ( new org . apache . rya . api . domain . RyaIRI ( "uri:345" ) , new org . apache . rya . api . domain . RyaIRI ( "uri:567" ) , new org . apache . rya . api . domain . RyaIRI ( "uri:789" ) ) ) ; byte [ ] bundleBytes = org . apache . rya . indexing . pcj . fluo . app . RyaSubGraphKafkaSerDeTest . serializer . toBytes ( bundle ) ; org . apache . rya . api . domain . RyaSubGraph deserializedBundle = org . apache . rya . indexing . pcj . fluo . app . RyaSubGraphKafkaSerDeTest . serializer . fromBytes ( bundleBytes ) ; "<AssertPlaceHolder>" ; } fromBytes ( byte [ ] ) { try { java . lang . String json = new java . lang . String ( arg0 , "UTF-8" ) ; return java . util . Optional . of ( org . apache . rya . indexing . pcj . fluo . app . batch . serializer . BatchInformationSerializer . gson . fromJson ( json , org . apache . rya . indexing . pcj . fluo . app . batch . BatchInformation . class ) ) ; } catch ( java . lang . Exception e ) { org . apache . rya . indexing . pcj . fluo . app . batch . serializer . BatchInformationSerializer . log . info ( "Invalid<sp>String<sp>encoding.<sp>BatchInformation<sp>cannot<sp>be<sp>deserialized." ) ; return java . util . Optional . empty ( ) ; } } | org . junit . Assert . assertEquals ( bundle , deserializedBundle ) |
testGetDoublesBiggerArray ( ) { com . eclipsesource . v8 . V8Array a = v8 . executeArrayScript ( "[1.1,2.2,3,4]" ) ; double [ ] result = new double [ 40 ] ; int size = a . getDoubles ( 0 , 4 , result ) ; "<AssertPlaceHolder>" ; a . close ( ) ; } executeArrayScript ( java . lang . String ) { return executeArrayScript ( script , null , 0 ) ; } | org . junit . Assert . assertEquals ( 4 , size ) |
testParseNonDefaultSetting ( ) { java . lang . String source = ( "[1" + ( getDecimalCharacter ( ) ) ) + "2323]" ; org . apache . commons . math4 . geometry . euclidean . oned . Vector1D expected = new org . apache . commons . math4 . geometry . euclidean . oned . Cartesian1D ( 1.2323 ) ; org . apache . commons . math4 . geometry . euclidean . oned . Vector1D actual = vector1DFormatSquare . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . apache . commons . math4 . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . apache . commons . math4 . exception . MathParseException ( source , parsePosition . getErrorIndex ( ) , org . apache . commons . math4 . geometry . euclidean . twod . Vector2D . class ) ; } return result ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testEquals09 ( ) { java . util . List < org . dresdenocl . modelinstancetype . types . IModelInstanceString > elements01 ; elements01 = new java . util . ArrayList < org . dresdenocl . modelinstancetype . types . IModelInstanceString > ( ) ; elements01 . add ( org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceString ( "one" ) ) ; elements01 . add ( org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceString ( "two" ) ) ; elements01 . add ( org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceString ( "three" ) ) ; org . dresdenocl . modelinstancetype . types . IModelInstanceCollection < org . dresdenocl . modelinstancetype . types . IModelInstanceString > modelInstanceCollection01 ; modelInstanceCollection01 = org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceCollection ( elements01 , org . dresdenocl . modelbus . test . modelinstance . types . base . JavaModelInstanceCollectionTest . typeOrderedSet ) ; java . util . List < org . dresdenocl . modelinstancetype . types . IModelInstanceString > elements02 ; elements02 = new java . util . ArrayList < org . dresdenocl . modelinstancetype . types . IModelInstanceString > ( ) ; elements02 . add ( org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceString ( "one" ) ) ; elements02 . add ( org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceString ( "two" ) ) ; elements02 . add ( org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceString ( "three" ) ) ; org . dresdenocl . modelinstancetype . types . IModelInstanceCollection < org . dresdenocl . modelinstancetype . types . IModelInstanceString > modelInstanceCollection02 ; modelInstanceCollection02 = org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceCollection ( elements02 , org . dresdenocl . modelbus . test . modelinstance . types . base . JavaModelInstanceCollectionTest . typeSequence ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof org . dresdenocl . metamodels . xsd . internal . model . XSDModel ) { return resource . equals ( ( ( org . dresdenocl . metamodels . xsd . internal . model . XSDModel ) ( obj ) ) . resource ) ; } return false ; } | org . junit . Assert . assertFalse ( modelInstanceCollection01 . equals ( modelInstanceCollection02 ) ) |
testSetErrors ( ) { org . batfish . common . BatfishException exception = new org . batfish . common . BatfishException ( "sample<sp>exception" ) ; org . batfish . common . BatfishException . BatfishStackTrace stackTrace = new org . batfish . common . BatfishException . BatfishStackTrace ( exception ) ; java . util . SortedMap < java . lang . String , org . batfish . common . BatfishException . BatfishStackTrace > errors = new java . util . TreeMap ( ) ; errors . put ( "error" , stackTrace ) ; _element . setErrors ( errors ) ; "<AssertPlaceHolder>" ; } getErrors ( ) { return _errors ; } | org . junit . Assert . assertThat ( _element . getErrors ( ) . get ( "error" ) , org . hamcrest . core . Is . is ( stackTrace ) ) |
test ( ) { cn . com . warlock . wisp . core . plugin . router . IWispRouter wispRouter = new cn . com . warlock . wisp . plugin . router . empty . WispRouterEmpty ( ) ; try { wispRouter . init ( ) ; wispRouter . start ( ) ; wispRouter . shutdown ( ) ; } catch ( cn . com . warlock . wisp . core . exception . WispRouterException e ) { "<AssertPlaceHolder>" ; } } shutdown ( ) { if ( ( firstInjector ) != null ) { try { firstInjector . shutdown ( ) ; } catch ( cn . com . warlock . wisp . core . exception . WispInjectorException e ) { cn . com . warlock . wisp . injector . impl . InjectorMgrImpl . LOGGER . warn ( e . toString ( ) ) ; } } } | org . junit . Assert . assertTrue ( false ) |
testIICellImg ( ) { final net . imglib2 . img . Img < net . imglib2 . type . numeric . integer . ByteType > in = generateByteTestCellImg ( true , 40 , 20 ) ; final net . imagej . ops . Op nullary = net . imagej . ops . special . computer . Computers . nullary ( ops , Ops . Math . Zero . class , net . imglib2 . type . numeric . integer . ByteType . class ) ; ops . run ( net . imagej . ops . map . MapNullaryII . class , in , nullary ) ; for ( final net . imglib2 . type . numeric . integer . ByteType ps : in ) "<AssertPlaceHolder>" ; } get ( ) { net . imagej . ops . slice . SlicesII . SlicesIICursor . localize ( tmpPosition ) ; final long [ ] offset = tmpPosition . clone ( ) ; for ( int d = 0 ; d < ( max . length ) ; d ++ ) { offset [ d ] += sliceOffset [ d ] ; } final net . imglib2 . view . IntervalView < T > res = net . imglib2 . view . Views . offsetInterval ( src , offset , sliceDims ) ; return dropSingltonDimensions ? net . imglib2 . view . Views . dropSingletonDimensions ( res ) : res ; } | org . junit . Assert . assertEquals ( ps . get ( ) , 0 ) |
whenWriteMultipleLinesUsingCharSink_thenWritten ( ) { final java . util . List < java . lang . String > names = com . google . common . collect . Lists . newArrayList ( "John" , "Jane" , "Adam" , "Tom" ) ; final java . io . File file = new java . io . File ( "src/test/resources/test.out" ) ; final com . google . common . io . CharSink sink = com . google . common . io . Files . asCharSink ( file , Charsets . UTF_8 ) ; sink . writeLines ( names , "<sp>" ) ; final java . lang . String result = com . google . common . io . Files . toString ( file , Charsets . UTF_8 ) ; final java . lang . String expectedValue = com . google . common . base . Joiner . on ( "<sp>" ) . join ( names ) ; "<AssertPlaceHolder>" ; } trim ( ) { engine . eval ( new java . io . InputStreamReader ( com . baeldung . scripting . NashornUnitTest . class . getResourceAsStream ( "/js/trim.js" ) ) ) ; } | org . junit . Assert . assertEquals ( expectedValue , result . trim ( ) ) |
checkId ( ) { java . util . Map < java . lang . String , java . lang . String [ ] > parameters = new java . util . HashMap < java . lang . String , java . lang . String [ ] > ( ) ; parameters . put ( "id" , new java . lang . String [ ] { "1" } ) ; jrds . webapp . ParamsBean pb = new jrds . webapp . ParamsBean ( jrds . mockobjects . GetMoke . getRequest ( parameters ) , jrds . webapp . TestUrlParser . hl ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( new java . lang . Integer ( 1 ) , pb . getId ( ) ) |
shouldReturnEmptyQueryOnEmptyListOfSmembers ( ) { when ( localParamsMock . get ( "command" ) ) . thenReturn ( "smembers" ) ; when ( localParamsMock . get ( "key" ) ) . thenReturn ( "simpleKey" ) ; when ( localParamsMock . get ( QueryParsing . V ) ) . thenReturn ( "string_field" ) ; when ( jedisMock . smembers ( anyString ( ) ) ) . thenReturn ( new com . sematext . solr . redis . HashSet < java . lang . String > ( ) ) ; when ( requestMock . getSchema ( ) ) . thenReturn ( schema ) ; when ( schema . getQueryAnalyzer ( ) ) . thenReturn ( new org . apache . lucene . analysis . standard . StandardAnalyzer ( ) ) ; redisQParser = new com . sematext . solr . redis . RedisQParser ( "string_field" , localParamsMock , paramsMock , requestMock , commandHandler ) ; final org . apache . lucene . search . Query query = redisQParser . parse ( ) ; verify ( jedisMock ) . smembers ( "simpleKey" ) ; org . apache . lucene . search . IndexSearcher searcher = new org . apache . lucene . search . IndexSearcher ( new org . apache . lucene . index . MultiReader ( ) ) ; final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = com . sematext . solr . redis . TestRedisQParser . extractTerms ( searcher , query ) ; "<AssertPlaceHolder>" ; } extractTerms ( org . apache . lucene . search . IndexSearcher , org . apache . lucene . search . Query ) { final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = new com . sematext . solr . redis . HashSet ( ) ; org . apache . lucene . search . Query rewrittenQuery = searcher . rewrite ( query ) ; if ( rewrittenQuery instanceof org . apache . lucene . search . ConstantScoreQuery ) { org . apache . lucene . search . ConstantScoreQuery constantScoreQuery = ( ( org . apache . lucene . search . ConstantScoreQuery ) ( rewrittenQuery ) ) ; rewrittenQuery = constantScoreQuery . getQuery ( ) ; } searcher . createNormalizedWeight ( rewrittenQuery , true ) . extractTerms ( terms ) ; return terms ; } | org . junit . Assert . assertEquals ( 0 , terms . size ( ) ) |
shouldNotExecuteJsp ( ) { br . com . caelum . vraptor . test . VRaptorTestResult result = navigate ( ) . post ( "/test/test8" ) . withoutJsp ( ) . execute ( ) ; java . lang . String html = result . getResponseBody ( ) ; "<AssertPlaceHolder>" ; } getResponseBody ( ) { try { return response . getContentAsString ( ) ; } catch ( java . io . UnsupportedEncodingException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertTrue ( html . isEmpty ( ) ) |
should_return_null_cause_if_buildcause_has_not_been_initialized ( ) { final com . groupon . jenkins . github . services . GithubRepositoryService githubRepositoryService = mock ( com . groupon . jenkins . github . services . GithubRepositoryService . class ) ; final com . groupon . jenkins . dynamic . build . DynamicBuildModel model = new com . groupon . jenkins . dynamic . build . DynamicBuildModel ( newBuild ( ) . get ( ) , githubRepositoryService ) ; "<AssertPlaceHolder>" ; } getBuildCause ( ) { final com . groupon . jenkins . dynamic . build . cause . BuildCause buildCause = this . build . getCause ( com . groupon . jenkins . dynamic . build . cause . BuildCause . class ) ; return buildCause == null ? com . groupon . jenkins . dynamic . build . cause . BuildCause . NULL_BUILD_CAUSE : buildCause ; } | org . junit . Assert . assertEquals ( BuildCause . NULL_BUILD_CAUSE , model . getBuildCause ( ) ) |
zouGeenMeldingMoetenGevenOmdatVoorvoegselsAndersZijn ( ) { betrokkenheden . add ( createOuderBetrokkenheidBericht ( "123" ) ) ; final nl . bzk . brp . model . objecttype . operationeel . PersoonModel eerderkindModel = mock ( nl . bzk . brp . model . objecttype . operationeel . PersoonModel . class ) ; createPathToEerderKindModel ( eerderkindModel ) ; final nl . bzk . brp . model . groep . bericht . PersoonGeboorteGroepBericht persoonGeboorteGroepBericht = new nl . bzk . brp . model . groep . bericht . PersoonGeboorteGroepBericht ( ) ; persoonGeboorteGroepBericht . setDatumGeboorte ( nl . bzk . brp . util . DatumUtil . vandaag ( ) ) ; kindBericht . setGeboorte ( persoonGeboorteGroepBericht ) ; final nl . bzk . brp . model . groep . operationeel . actueel . PersoonGeboorteGroepModel persoonGeboorteGroepModel = mock ( nl . bzk . brp . model . groep . operationeel . actueel . PersoonGeboorteGroepModel . class ) ; final nl . bzk . brp . model . groep . bericht . PersoonGeslachtsaanduidingGroepBericht persoonGeslachtsaanduidingGroepBericht = new nl . bzk . brp . model . groep . bericht . PersoonGeslachtsaanduidingGroepBericht ( ) ; persoonGeslachtsaanduidingGroepBericht . setGeslachtsaanduiding ( Geslachtsaanduiding . MAN ) ; kindBericht . setGeslachtsaanduiding ( persoonGeslachtsaanduidingGroepBericht ) ; final nl . bzk . brp . model . groep . operationeel . actueel . PersoonGeslachtsaanduidingGroepModel persoonGeslachtsaanduidingGroepModel = mock ( nl . bzk . brp . model . groep . operationeel . actueel . PersoonGeslachtsaanduidingGroepModel . class ) ; final nl . bzk . brp . model . groep . bericht . PersoonSamengesteldeNaamGroepBericht persoonSamengesteldeNaamGroepBericht = new nl . bzk . brp . model . groep . bericht . PersoonSamengesteldeNaamGroepBericht ( ) ; persoonSamengesteldeNaamGroepBericht . setGeslachtsnaam ( new nl . bzk . brp . model . attribuuttype . Geslachtsnaamcomponent ( "Janssen" ) ) ; persoonSamengesteldeNaamGroepBericht . setScheidingsteken ( new nl . bzk . brp . model . attribuuttype . Scheidingsteken ( "/" ) ) ; persoonSamengesteldeNaamGroepBericht . setVoornamen ( new nl . bzk . brp . model . attribuuttype . Voornaam ( "Jan" ) ) ; persoonSamengesteldeNaamGroepBericht . setVoorvoegsel ( new nl . bzk . brp . model . attribuuttype . Voorvoegsel ( "den" ) ) ; kindBericht . setSamengesteldeNaam ( persoonSamengesteldeNaamGroepBericht ) ; final nl . bzk . brp . model . groep . operationeel . actueel . PersoonSamengesteldeNaamGroepModel persoonSamengesteldeNaamGroepModel = mock ( nl . bzk . brp . model . groep . operationeel . actueel . PersoonSamengesteldeNaamGroepModel . class ) ; when ( eerderkindModel . getGeboorte ( ) ) . thenReturn ( persoonGeboorteGroepModel ) ; when ( persoonGeboorteGroepModel . getDatumGeboorte ( ) ) . thenReturn ( nl . bzk . brp . util . DatumUtil . vandaag ( ) ) ; when ( eerderkindModel . getGeslachtsaanduiding ( ) ) . thenReturn ( persoonGeslachtsaanduidingGroepModel ) ; when ( persoonGeslachtsaanduidingGroepModel . getGeslachtsaanduiding ( ) ) . thenReturn ( Geslachtsaanduiding . MAN ) ; when ( eerderkindModel . getSamengesteldeNaam ( ) ) . thenReturn ( persoonSamengesteldeNaamGroepModel ) ; when ( persoonSamengesteldeNaamGroepModel . getGeslachtsnaam ( ) ) . thenReturn ( new nl . bzk . brp . model . attribuuttype . Geslachtsnaamcomponent ( "Janssen" ) ) ; when ( persoonSamengesteldeNaamGroepModel . getScheidingsteken ( ) ) . thenReturn ( new nl . bzk . brp . model . attribuuttype . Scheidingsteken ( "/" ) ) ; when ( persoonSamengesteldeNaamGroepModel . getVoornamen ( ) ) . thenReturn ( new nl . bzk . brp . model . attribuuttype . Voornaam ( "Jan" ) ) ; when ( persoonSamengesteldeNaamGroepModel . getVoorvoegsel ( ) ) . thenReturn ( new nl . bzk . brp . model . attribuuttype . Voorvoegsel ( "op<sp>den" ) ) ; java . util . List < nl . bzk . brp . model . validatie . Melding > meldingen = brby0126 . executeer ( relatieModel , relatieBericht , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertThat ( meldingen . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) ) |
convertValue ( ) { eu . dnetlib . iis . common . schemas . ReportEntry reportEntry = new eu . dnetlib . iis . common . schemas . ReportEntry ( "report.key" , eu . dnetlib . iis . common . schemas . ReportEntryType . DURATION , "3842000" ) ; com . google . gson . JsonElement json = converter . convertValue ( reportEntry ) ; com . google . gson . JsonElement expectedJson = new com . google . gson . JsonParser ( ) . parse ( "{milliseconds:<sp>3842000,<sp>humanReadable:<sp>\"1h<sp>04m<sp>02s\"}" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String [ ] ) { org . apache . commons . cli . Options options = new org . apache . commons . cli . Options ( ) ; @ eu . dnetlib . iis . common . java . SuppressWarnings ( "static-access" ) org . apache . commons . cli . Option constructorParams = org . apache . commons . cli . OptionBuilder . withArgName ( "STRING" ) . hasArg ( ) . withDescription ( "Constructor<sp>parameter" ) . withLongOpt ( "ConstructorParam" ) . create ( eu . dnetlib . iis . common . java . CmdLineParser . constructorPrefix ) ; options . addOption ( constructorParams ) ; @ eu . dnetlib . iis . common . java . SuppressWarnings ( "static-access" ) org . apache . commons . cli . Option inputs = org . apache . commons . cli . OptionBuilder . withArgName ( "Value<sp>of<sp>some<sp>other<sp>parameter." 6 ) . hasArgs ( 2 ) . withValueSeparator ( ) . withDescription ( "Value<sp>of<sp>some<sp>other<sp>parameter." 0 ) . withLongOpt ( "Input" ) . create ( eu . dnetlib . iis . common . java . CmdLineParser . inputPrefix ) ; options . addOption ( inputs ) ; @ eu . dnetlib . iis . common . java . SuppressWarnings ( "static-access" ) org . apache . commons . cli . Option outputs = org . apache . commons . cli . OptionBuilder . withArgName ( "Value<sp>of<sp>some<sp>other<sp>parameter." 6 ) . hasArgs ( 2 ) . withValueSeparator ( ) . withDescription ( "Value<sp>of<sp>some<sp>other<sp>parameter." 1 ) . create ( eu . dnetlib . iis . common . java . CmdLineParser . outputPrefix ) ; options . addOption ( outputs ) ; @ eu . dnetlib . iis . common . java . SuppressWarnings ( "static-access" ) org . apache . commons . cli . Option specialParameter = org . apache . commons . cli . OptionBuilder . withArgName ( "parameter_name=string" ) . hasArgs ( 2 ) . withValueSeparator ( ) . withDescription ( java . lang . String . format ( ( "Value<sp>of<sp>special<sp>parameter.<sp>" + "Value<sp>of<sp>some<sp>other<sp>parameter." 2 ) , org . apache . commons . lang3 . StringUtils . join ( eu . dnetlib . iis . common . java . CmdLineParser . mandatorySpecialParameters , "Value<sp>of<sp>some<sp>other<sp>parameter." 4 ) ) ) . create ( eu . dnetlib . iis . common . java . CmdLineParser . specialParametersPrefix ) ; options . addOption ( specialParameter ) ; @ eu . dnetlib . iis . common . java . SuppressWarnings ( "static-access" ) org . apache . commons . cli . Option otherParameter = org . apache . commons . cli . OptionBuilder . withArgName ( "parameter_name=string" ) . hasArgs ( 2 ) . withValueSeparator ( ) . withDescription ( java . lang . String . format ( "Value<sp>of<sp>some<sp>other<sp>parameter." ) ) . create ( eu . dnetlib . iis . common . java . CmdLineParser . processParametersPrefix ) ; options . addOption ( otherParameter ) ; org . apache . commons . cli . Option help = new org . apache . commons . cli . Option ( "Value<sp>of<sp>some<sp>other<sp>parameter." 3 , "print<sp>this<sp>message" ) ; options . addOption ( help ) ; org . apache . commons . cli . CommandLineParser parser = new org . apache . commons . cli . GnuParser ( ) ; try { org . apache . commons . cli . CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( "Value<sp>of<sp>some<sp>other<sp>parameter." 3 ) ) { org . apache . commons . cli . HelpFormatter formatter = new org . apache . commons . cli . HelpFormatter ( ) ; formatter . printHelp ( "" , options ) ; java . lang . System . exit ( 1 ) ; } return cmdLine ; } catch ( org . apache . commons . cli . ParseException e ) { throw new eu . dnetlib . iis . common . java . CmdLineParserException ( "Value<sp>of<sp>some<sp>other<sp>parameter." 5 , e ) ; } } | org . junit . Assert . assertEquals ( expectedJson , json ) |
shouldExecuteMapReduceViaJavaScriptInTask ( ) { org . infinispan . client . hotrod . RemoteCache remoteCache = org . infinispan . server . test . task . AbstractDistributedServerTaskIT . managers . get ( 1 ) . getCache ( DistributedJSExecutingServerTask . CACHE_NAME ) ; remoteCache . put ( 1 , "word1<sp>word2<sp>word3" ) ; remoteCache . put ( 2 , "word1<sp>word2" ) ; remoteCache . put ( 3 , "word1" ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Long > > result = ( ( java . util . List < java . util . Map < java . lang . String , java . lang . Long > > ) ( remoteCache . execute ( DistributedJSExecutingServerTask . NAME , java . util . Collections . emptyMap ( ) ) ) ) ; "<AssertPlaceHolder>" ; verifyMapReduceResult ( result . get ( 0 ) ) ; verifyMapReduceResult ( result . get ( 1 ) ) ; } size ( ) { return cache . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , result . size ( ) ) |
rootFileVersionNull ( ) { org . apache . taverna . scufl2 . ucfpackage . UCFPackage container = new org . apache . taverna . scufl2 . ucfpackage . UCFPackage ( ) ; container . setPackageMediaType ( UCFPackage . MIME_WORKFLOW_BUNDLE ) ; container . addResource ( "Hello<sp>there" , "helloworld.txt" , "text/plain" ) ; container . setRootFile ( "helloworld.txt" , "1.2.3" ) ; container . save ( tmpFile ) ; org . apache . taverna . scufl2 . ucfpackage . UCFPackage reloaded = new org . apache . taverna . scufl2 . ucfpackage . UCFPackage ( tmpFile ) ; reloaded . setRootFile ( "helloworld.txt" ) ; reloaded . save ( tmpFile ) ; @ org . apache . taverna . scufl2 . ucfpackage . SuppressWarnings ( "unused" ) org . apache . taverna . scufl2 . ucfpackage . UCFPackage again = new org . apache . taverna . scufl2 . ucfpackage . UCFPackage ( tmpFile ) ; "<AssertPlaceHolder>" ; } getRootFileVersion ( java . lang . String ) { return getResourceEntry ( rootFile ) . getVersion ( ) ; } | org . junit . Assert . assertNull ( reloaded . getRootFileVersion ( "helloworld.txt" ) ) |
shouldNotFindAnythingWhenSearchingForNullUid ( ) { java . util . List < org . unitedinternet . cosmo . model . CollectionSubscription > subscriptions = this . subscriptionDao . findByTargetCollectionUid ( null ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( buffer . size ( ) ) == 0 ; } | org . junit . Assert . assertTrue ( subscriptions . isEmpty ( ) ) |
testLoadFromStream ( ) { java . lang . String path = "modelimport/keras/examples/mnist_mlp/mnist_mlp_tf_keras_1_model.h5" ; java . io . File root = testDir . newFolder ( ) ; final java . io . File f = new org . nd4j . linalg . io . ClassPathResource ( path ) . getTempFileFromArchive ( root ) ; try ( java . io . InputStream is = new java . io . BufferedInputStream ( new java . io . FileInputStream ( f ) ) ) { org . deeplearning4j . nn . multilayer . MultiLayerNetwork model = org . deeplearning4j . nn . modelimport . keras . KerasModelImport . importKerasSequentialModelAndWeights ( is ) ; "<AssertPlaceHolder>" ; } } importKerasSequentialModelAndWeights ( org . deeplearning4j . nn . modelimport . keras . InputStream ) { org . deeplearning4j . nn . modelimport . keras . File f = null ; try { f = org . deeplearning4j . nn . modelimport . keras . KerasModelImport . toTempFile ( modelHdf5Stream ) ; return org . deeplearning4j . nn . modelimport . keras . KerasModelImport . importKerasSequentialModelAndWeights ( f . getAbsolutePath ( ) ) ; } finally { if ( f != null ) f . delete ( ) ; } } | org . junit . Assert . assertNotNull ( model ) |
testComplementMap ( ) { int [ ] expected = new int [ ] { 0 , 3 , 4 , 5 } ; int [ ] input = new int [ ] { 1 , 2 } ; int size = ( expected . length ) + ( input . length ) ; int [ ] complement = com . splicemachine . utils . IntArrays . complementMap ( input , size ) ; "<AssertPlaceHolder>" ; } printArrays ( int [ ] , int , int [ ] , int [ ] ) { return ( ( ( ( ( ( ( "FilterMap:<sp>" + ( java . util . Arrays . toString ( input ) ) ) + "<sp>Size:<sp>" ) + size ) + "\nResult:<sp>" ) + ( java . util . Arrays . toString ( expected ) ) ) + "\nActual:<sp>" ) + ( java . util . Arrays . toString ( actual ) ) ) + "\n" ; } | org . junit . Assert . assertArrayEquals ( printArrays ( input , size , expected , complement ) , expected , complement ) |
testValue ( ) { java . util . Map < java . lang . String , java . lang . String > values = new java . util . HashMap ( ) ; values . put ( "foo" , "bar" ) ; final org . microbule . config . core . MapConfig config = new org . microbule . config . core . MapConfig ( values ) ; "<AssertPlaceHolder>" ; } value ( java . lang . String ) { final java . util . Optional < java . lang . String > value = delegate . value ( key ) ; recordedJson . add ( key , value . < com . google . gson . JsonElement > map ( JsonPrimitive :: new ) . orElse ( JsonNull . INSTANCE ) ) ; return value ; } | org . junit . Assert . assertEquals ( "bar" , config . value ( "foo" ) . get ( ) ) |
contentTypeShouldAddToNonResponse ( ) { serializationFuture . complete ( "hi" ) ; java . lang . String contentType = getResult ( com . spotify . apollo . route . Middlewares . replyContentType ( "text/plain" ) . apply ( serializationDelegate ( ) ) ) . header ( "Content-Type" ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { final com . squareup . okhttp . OkHttpClient client = new com . squareup . okhttp . OkHttpClient ( ) ; config . connectTimeoutMillis ( ) . ifPresent ( ( millis ) -> client . setConnectTimeout ( millis , TimeUnit . MILLISECONDS ) ) ; config . readTimeoutMillis ( ) . ifPresent ( ( millis ) -> client . setReadTimeout ( millis , TimeUnit . MILLISECONDS ) ) ; config . writeTimeoutMillis ( ) . ifPresent ( ( millis ) -> client . setWriteTimeout ( millis , TimeUnit . MILLISECONDS ) ) ; client . setConnectionPool ( new com . squareup . okhttp . ConnectionPool ( config . maxIdleConnections ( ) . orElse ( 5 ) , config . connectionKeepAliveDurationMillis ( ) . orElse ( ( ( 5 * 60 ) * 1000 ) ) ) ) ; config . maxAsyncRequests ( ) . ifPresent ( ( max ) -> client . getDispatcher ( ) . setMaxRequests ( max ) ) ; config . maxAsyncRequestsPerHost ( ) . ifPresent ( ( max ) -> client . getDispatcher ( ) . setMaxRequestsPerHost ( max ) ) ; config . followRedirects ( ) . ifPresent ( client :: setFollowRedirects ) ; closer . register ( ( ) -> client . getDispatcher ( ) . getExecutorService ( ) . shutdown ( ) ) ; return client ; } | org . junit . Assert . assertThat ( contentType , org . hamcrest . CoreMatchers . equalTo ( "text/plain" ) ) |
testSkipListenerInvocationF ( ) { org . camunda . bpm . engine . test . bpmn . multiinstance . DelegateEvent . clearEvents ( ) ; org . camunda . bpm . engine . repository . ProcessDefinition processDefinition = testRule . deployAndGetDefinition ( modify ( instance ) . activityBuilder ( "user2" ) . camundaExecutionListenerClass ( ExecutionListener . EVENTNAME_START , org . camunda . bpm . engine . test . bpmn . multiinstance . DelegateExecutionListener . class . getName ( ) ) . done ( ) ) ; org . camunda . bpm . engine . runtime . ProcessInstance processInstance = runtimeService . startProcessInstanceById ( processDefinition . getId ( ) ) ; org . camunda . bpm . engine . batch . Batch batch = runtimeService . createModification ( processDefinition . getId ( ) ) . cancelAllForActivity ( "user2" ) . processInstanceIds ( java . util . Arrays . asList ( processInstance . getId ( ) ) ) . skipCustomListeners ( ) . executeAsync ( ) ; helper . executeSeedJob ( batch ) ; helper . executeJobs ( batch ) ; "<AssertPlaceHolder>" ; } getEvents ( ) { return org . camunda . bpm . engine . test . bpmn . multiinstance . DelegateEvent . RECORDED_EVENTS ; } | org . junit . Assert . assertEquals ( 0 , org . camunda . bpm . engine . test . bpmn . multiinstance . DelegateEvent . getEvents ( ) . size ( ) ) |
testGetLCSMatchMap ( ) { java . lang . String s1 = "Mr.<sp>John<sp>Smith-Murray<sp>died<sp>at<sp>Denver,<sp>CO." ; java . lang . String s2 = "Mr.<sp>John<sp>Smith<sp>-<sp>Murray<sp>died<sp>at<sp>Denver<sp>,<sp>CO<sp>." ; java . util . Map < java . lang . Integer , java . lang . Integer > match = edu . illinois . cs . cogcomp . core . algorithms . LongestCommonSubsequence . getCharacterLCSMap ( s1 , s2 ) ; for ( int i = 0 ; i < ( s1 . length ( ) ) ; i ++ ) { "<AssertPlaceHolder>" ; } } get ( java . lang . String ) { item = item . trim ( ) ; java . lang . String sql = "select<sp>value<sp>from<sp>counts<sp>where<sp>item<sp>=<sp>?" ; try { edu . illinois . cs . cogcomp . nlp . pmi . Connection c = edu . illinois . cs . cogcomp . nlp . pmi . CountsCache . getConnection ( dbFile ) ; edu . illinois . cs . cogcomp . nlp . pmi . PreparedStatement stmt = c . prepareStatement ( sql ) ; stmt . setString ( 1 , item ) ; edu . illinois . cs . cogcomp . nlp . pmi . ResultSet rs = stmt . executeQuery ( ) ; if ( rs . next ( ) ) { return rs . getLong ( 1 ) ; } else { return - 1 ; } } catch ( java . lang . Exception ex ) { throw new java . lang . RuntimeException ( ex ) ; } } | org . junit . Assert . assertEquals ( s1 . charAt ( i ) , s2 . charAt ( ( ( match . get ( ( i + 1 ) ) ) - 1 ) ) ) |
testIsQueryLimitReachedForNumberOfRowsGreaterQueryLimit ( ) { final org . pentaho . reporting . engine . classic . core . MasterReport report = new org . pentaho . reporting . engine . classic . core . MasterReport ( ) ; final javax . swing . table . DefaultTableModel model = new javax . swing . table . DefaultTableModel ( 501 , 10 ) ; report . setDataFactory ( new org . pentaho . reporting . engine . classic . core . TableDataFactory ( "default" , model ) ) ; report . setQueryLimit ( 500 ) ; final org . pentaho . reporting . engine . classic . core . layout . output . AbstractReportProcessor reportProcessor = new org . pentaho . reporting . engine . classic . core . testsupport . dummyoutput . DummyReportProcessor ( report ) ; reportProcessor . prepareReportProcessing ( ) ; "<AssertPlaceHolder>" ; } isQueryLimitReached ( ) { return isQueryLimitReached ; } | org . junit . Assert . assertEquals ( reportProcessor . isQueryLimitReached ( ) , true ) |
testPassiveScan ( ) { net . continuumsecurity . restyburp . ScanQueueMap sq ; driver . get ( HOMEPAGE ) ; driver . get ( LOGINPAGE ) ; login ( "bob" , "password" ) ; driver . get ( SEARCHPAGE ) ; net . continuumsecurity . restyburp . BurpServiceTest . burp . setConfig ( new net . continuumsecurity . burpclient . ScanPolicy ( ) . enablePassive ( ) . getPolicy ( ) ) ; net . continuumsecurity . restyburp . BurpServiceTest . burp . scan ( HOMEPAGE ) ; while ( ( net . continuumsecurity . restyburp . BurpServiceTest . burp . getPercentageComplete ( ) ) < 100 ) { net . continuumsecurity . restyburp . BurpServiceTest . log . debug ( ( "Complete:<sp>" + ( net . continuumsecurity . restyburp . BurpServiceTest . burp . getPercentageComplete ( ) ) ) ) ; java . lang . Thread . sleep ( 2000 ) ; } for ( net . continuumsecurity . restyburp . model . ScanIssueBean issue : net . continuumsecurity . restyburp . BurpServiceTest . burp . getIssues ( ) ) { net . continuumsecurity . restyburp . BurpServiceTest . log . debug ( ( ( ( "Issue:<sp>" + ( issue . getIssueName ( ) ) ) + "<sp>in<sp>" ) + ( issue . getUrl ( ) ) ) ) ; } "<AssertPlaceHolder>" ; } getIssues ( ) { java . util . List < net . continuumsecurity . restyburp . model . ScanIssueBean > issues = new java . util . ArrayList < net . continuumsecurity . restyburp . model . ScanIssueBean > ( ) ; for ( java . lang . String key : getUrls ( ) ) { net . continuumsecurity . restyburp . ScanQueueMap . log . debug ( ( "<sp>Getting<sp>issues<sp>for:<sp>" + key ) ) ; for ( burp . IScanQueueItem scanQueue : getQueue ( key ) ) { net . continuumsecurity . restyburp . ScanQueueMap . log . debug ( ( ( "<sp>ScanQueueItem<sp>has<sp>" + ( scanQueue . getIssues ( ) . length ) ) + "<sp>issues." ) ) ; for ( burp . IScanIssue issue : scanQueue . getIssues ( ) ) { net . continuumsecurity . restyburp . ScanQueueMap . log . debug ( ( "<sp>Found<sp>issue,<sp>adding:<sp>" + ( issue . getIssueName ( ) ) ) ) ; issues . add ( new net . continuumsecurity . restyburp . model . ScanIssueBean ( issue ) ) ; } } } return issues ; } | org . junit . Assert . assertEquals ( 2 , net . continuumsecurity . restyburp . BurpServiceTest . burp . getIssues ( ) . size ( ) ) |
should_save_configuration_property_and_return_by_name ( ) { java . lang . String key = org . apache . commons . lang3 . RandomStringUtils . randomAlphabetic ( 10 ) ; java . lang . String val = org . apache . commons . lang3 . RandomStringUtils . randomAlphabetic ( 10 ) ; configurationService . save ( key , val ) ; java . lang . String savedVal = configurationService . get ( key ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return com . devicehive . configuration . Messages . BidBundle . bidBundle . getString ( key ) ; } | org . junit . Assert . assertThat ( savedVal , org . hamcrest . Matchers . equalTo ( val ) ) |
shouldReturnFalseWhenTT2OrTTBoosterDoseIsNotGiven ( ) { boolean didRuleSucceed = rule . apply ( new org . ei . drishti . util . SafeMap ( ) . put ( "ttDose" , "tt1" ) ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , java . lang . String ) { data . put ( key , value ) ; return this ; } | org . junit . Assert . assertFalse ( didRuleSucceed ) |
testGetRequest ( ) { gov . hhs . fha . nhinc . docretrieve . entity . OutboundDocRetrieveOrchestratable instance = new gov . hhs . fha . nhinc . docretrieve . entity . OutboundStandardDocRetrieveOrchestratable ( ) ; ihe . iti . xds_b . _2007 . RetrieveDocumentSetRequestType expResult = null ; ihe . iti . xds_b . _2007 . RetrieveDocumentSetRequestType result = instance . getRequest ( ) ; "<AssertPlaceHolder>" ; } getRequest ( ) { return request ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testSetInstancesAddClass ( ) { org . eclipse . aether . impl . DefaultServiceLocator locator = new org . eclipse . aether . impl . DefaultServiceLocator ( ) ; locator . setServices ( java . lang . String . class , "one" , "two" ) ; locator . addService ( java . lang . String . class , java . lang . String . class ) ; "<AssertPlaceHolder>" ; } getServices ( java . lang . Class ) { org . eclipse . aether . impl . DefaultServiceLocator . Entry < T > entry = getEntry ( type , false ) ; return entry != null ? entry . getInstances ( ) : null ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "one" , "two" , "" ) , locator . getServices ( java . lang . String . class ) ) |
testNonDefaultSetting ( ) { org . apache . commons . math4 . linear . RealMatrix m = org . apache . commons . math4 . linear . MatrixUtils . createRealMatrix ( new double [ ] [ ] { new double [ ] { 1 , 1 , 1 } , new double [ ] { 1 , 1 , 1 } } ) ; java . lang . String expected = "[1,<sp>1,<sp>1;<sp>1,<sp>1,<sp>1]" ; java . lang . String actual = realMatrixFormatOctave . format ( m ) ; "<AssertPlaceHolder>" ; } format ( org . apache . commons . math4 . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
addsConstantBinding ( ) { final org . eclipse . rdf4j . query . algebra . Projection projection = org . apache . rya . api . function . projection . ProjectionEvaluatorTest . getProjection ( ( "grandchild" 2 + ( ( ( "WHERE<sp>{" + "grandchild" 4 ) + "?child<sp><urn:hasChild><sp>?grandchild<sp>.<sp>" ) + "}" ) ) ) ; final org . eclipse . rdf4j . model . ValueFactory vf = org . eclipse . rdf4j . model . impl . SimpleValueFactory . getInstance ( ) ; org . eclipse . rdf4j . query . impl . MapBindingSet bs = new org . eclipse . rdf4j . query . impl . MapBindingSet ( ) ; bs . addBinding ( "grandchild" 5 , vf . createIRI ( "urn:Alice" ) ) ; bs . addBinding ( "grandchild" 1 , vf . createIRI ( "grandchild" 0 ) ) ; bs . addBinding ( "grandchild" , vf . createIRI ( "urn:Charlie" ) ) ; final org . apache . rya . api . model . VisibilityBindingSet original = new org . apache . rya . api . model . VisibilityBindingSet ( bs , "a|b" ) ; bs = new org . eclipse . rdf4j . query . impl . MapBindingSet ( ) ; bs . addBinding ( "subject" , vf . createIRI ( "urn:Alice" ) ) ; bs . addBinding ( "grandchild" 3 , vf . createIRI ( "urn:hasGrandchild" ) ) ; bs . addBinding ( "object" , vf . createIRI ( "urn:Charlie" ) ) ; final org . apache . rya . api . model . VisibilityBindingSet expected = new org . apache . rya . api . model . VisibilityBindingSet ( bs , "a|b" ) ; final org . apache . rya . api . model . VisibilityBindingSet result = org . apache . rya . api . function . projection . ProjectionEvaluator . make ( projection ) . project ( original ) ; "<AssertPlaceHolder>" ; } project ( java . lang . Iterable ) { if ( ( projections == null ) || ( ! ( projections . iterator ( ) . hasNext ( ) ) ) ) { return false ; } final java . util . List < org . bson . conversions . Bson > projectOpts = new java . util . LinkedList ( ) ; final java . util . Set < java . lang . String > bindingNamesUnion = new java . util . HashSet ( ) ; java . util . Set < java . lang . String > bindingNamesIntersection = null ; for ( final org . eclipse . rdf4j . query . algebra . ProjectionElemList projection : projections ) { if ( projection . getElements ( ) . isEmpty ( ) ) { return false ; } final org . bson . Document valueDoc = new org . bson . Document ( ) ; final org . bson . Document hashDoc = new org . bson . Document ( ) ; final org . bson . Document typeDoc = new org . bson . Document ( ) ; final java . util . Set < java . lang . String > projectionBindingNames = new java . util . HashSet ( ) ; for ( final org . eclipse . rdf4j . query . algebra . ProjectionElem elem : projection . getElements ( ) ) { java . lang . String to = elem . getTargetName ( ) ; if ( ! ( org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . isValidFieldName ( to ) ) ) { to = replace ( to ) ; } java . lang . String from = elem . getSourceName ( ) ; if ( varToOriginalName . containsValue ( from ) ) { from = varToOriginalName . inverse ( ) . get ( from ) ; } projectionBindingNames . add ( to ) ; if ( to . equals ( from ) ) { valueDoc . append ( to , 1 ) ; hashDoc . append ( to , 1 ) ; typeDoc . append ( to , 1 ) ; } else { valueDoc . append ( to , org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . valueFieldExpr ( from ) ) ; hashDoc . append ( to , org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . hashFieldExpr ( from ) ) ; typeDoc . append ( to , org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . typeFieldExpr ( from ) ) ; } } bindingNamesUnion . addAll ( projectionBindingNames ) ; if ( bindingNamesIntersection == null ) { bindingNamesIntersection = new java . util . HashSet ( projectionBindingNames ) ; } else { bindingNamesIntersection . retainAll ( projectionBindingNames ) ; } projectOpts . add ( new org . bson . Document ( ) . append ( org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . VALUES , valueDoc ) . append ( org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . HASHES , hashDoc ) . append ( org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . TYPES , typeDoc ) . append ( org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . LEVEL , ( "$" + ( org . apache . rya . mongodb . aggregation . AggregationPipelineQueryNode . LEVEL ) ) ) . append ( org . apache . rya . mongodb . aggregation . TIMESTAMP , ( "$" + ( TIMESTAMP ) ) ) ) ; } if ( ( projectOpts . size ( ) ) == 1 ) { pipeline . add ( com . mongodb . client . model . Aggregates . project ( projectOpts . get ( 0 ) ) ) ; } else { final java . lang . String listKey = "PROJECTIONS" ; final org . bson . conversions . Bson projectIndividual = com . mongodb . client . model . Projections . | org . junit . Assert . assertEquals ( expected , result ) |
testSetAlarmStateAndHistory ( ) { java . lang . String metricName = ( this . getClass ( ) . getName ( ) ) + ( java . lang . System . currentTimeMillis ( ) ) ; com . amazonaws . services . cloudwatch . model . PutMetricAlarmRequest [ ] rqs = createTwoNewAlarms ( metricName ) ; com . amazonaws . services . cloudwatch . model . PutMetricAlarmRequest rq1 = rqs [ 0 ] ; com . amazonaws . services . cloudwatch . model . PutMetricAlarmRequest rq2 = rqs [ 1 ] ; com . amazonaws . services . cloudwatch . model . DescribeAlarmHistoryRequest alarmHistoryRequest = new com . amazonaws . services . cloudwatch . model . DescribeAlarmHistoryRequest ( ) . withAlarmName ( rq1 . getAlarmName ( ) ) . withHistoryItemType ( "StateUpdate" ) ; com . amazonaws . services . cloudwatch . model . DescribeAlarmHistoryResult historyResult = cloudwatch . describeAlarmHistory ( alarmHistoryRequest ) ; "<AssertPlaceHolder>" ; } getAlarmHistoryItems ( ) { return alarmHistoryItems ; } | org . junit . Assert . assertEquals ( 1 , historyResult . getAlarmHistoryItems ( ) . size ( ) ) |
testThree ( ) { int [ ] input = new int [ ] { 2180 , 8 , 8 , - 4 , 4 , 4 , - 4 , 4 , 0 , 4 , - 4 , 8 , 4 , 0 , 16 , 4 , 0 , 0 , - 4 , 4 , 20 , 4 , - 12 , 4 , 4 , 8 , - 8 , - 12 , - 4 , - 4 , 0 , 0 , 0 , 0 , 4 , 8 , 0 , 0 , 0 , 0 , 24 , 4 , - 8 , 24 , - 4 , - 5 , - 15 , - 6 , 4 , 8 , - 8 , - 16 , 15 , 10 , 0 , 0 , - 8 , - 16 , - 8 , 12 , 5 , - 6 , 0 , 7 } ; int [ ] output = new int [ ] { 284 , 272 , 272 , 282 , 287 , 270 , 270 , 268 , 275 , 264 , 277 , 263 , 262 , 265 , 266 , 276 , 276 , 262 , 271 , 275 , 277 , 271 , 271 , 273 , 285 , 288 , 274 , 268 , 267 , 285 , 279 , 268 , 263 , 266 , 276 , 257 , 264 , 271 , 269 , 275 , 271 , 282 , 291 , 288 , 261 , 256 , 268 , 276 , 272 , 285 , 260 , 271 , 285 , 278 , 285 , 268 , 277 , 267 , 263 , 277 , 268 , 254 , 276 , 278 } ; org . jcodec . common . dct . SimpleIDCT10Bit . idct10 ( input , 0 ) ; "<AssertPlaceHolder>" ; } idct10 ( int [ ] , int ) { for ( int i = 0 ; i < 8 ; i ++ ) org . jcodec . common . dct . SimpleIDCT10Bit . idctRow ( buf , ( off + ( i << 3 ) ) ) ; for ( int i = 0 ; i < 8 ; i ++ ) org . jcodec . common . dct . SimpleIDCT10Bit . idctCol ( buf , ( off + i ) ) ; } | org . junit . Assert . assertArrayEquals ( output , input ) |
testWithImplementationHidingInstance ( ) { java . lang . Object actual = new com . picocontainer . PicoBuilder ( ) . withComponentFactory ( new com . picocontainer . behaviors . ImplementationHiding ( ) ) . build ( ) ; java . lang . Object expected = new com . picocontainer . DefaultPicoContainer ( parent , lifecycle , ncm , new com . picocontainer . behaviors . ImplementationHiding ( ) . wrap ( ai ) ) ; "<AssertPlaceHolder>" ; } toXml ( java . lang . Object ) { return xs . toXML ( expected ) ; } | org . junit . Assert . assertEquals ( toXml ( expected ) , toXml ( actual ) ) |
saveRole_shouldSaveGivenRoleToTheDatabase ( ) { org . openmrs . Role role = new org . openmrs . Role ( "new<sp>role" , "new<sp>desc" ) ; userService . saveRole ( role ) ; "<AssertPlaceHolder>" ; } getRole ( java . lang . String ) { return ( ( org . openmrs . Role ) ( sessionFactory . getCurrentSession ( ) . get ( org . openmrs . Role . class , r ) ) ) ; } | org . junit . Assert . assertNotNull ( userService . getRole ( "new<sp>role" ) ) |
testCreateOKJobId ( ) { org . eclipse . kura . message . KuraPayload request = new org . eclipse . kura . message . KuraPayload ( ) ; request . addMetric ( DeploymentPackageOptions . METRIC_DP_NAME , "name" ) ; request . addMetric ( DeploymentPackageOptions . METRIC_JOB_ID , 123L ) ; org . eclipse . kura . core . deployment . uninstall . DeploymentPackageUninstallOptions options = new org . eclipse . kura . core . deployment . uninstall . DeploymentPackageUninstallOptions ( request ) ; "<AssertPlaceHolder>" ; } getJobId ( ) { return this . jobId ; } | org . junit . Assert . assertEquals ( 123L , ( ( long ) ( options . getJobId ( ) ) ) ) |
testCreateWithCreationTypeNotNested ( ) { final org . kie . workbench . common . dmn . client . editors . types . common . DataType dataType = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final org . kie . workbench . common . dmn . client . editors . types . common . DataType reference = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > expectedAffectedDataTypes = asList ( mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) , mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ) ; final org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition itemDefinition = mock ( org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition . class ) ; final org . kie . workbench . common . dmn . client . editors . types . persistence . CreationType creationType = org . kie . workbench . common . dmn . client . editors . types . persistence . CreationType . ABOVE ; when ( itemDefinitionCreateHandler . insertItemDefinition ( reference , creationType ) ) . thenReturn ( itemDefinition ) ; when ( dataTypeCreateHandler . insert ( dataType , reference , creationType , itemDefinition ) ) . thenReturn ( expectedAffectedDataTypes ) ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > actualAffectedDataTypes = recordEngine . create ( dataType , reference , creationType ) ; "<AssertPlaceHolder>" ; } create ( org . kie . workbench . common . dmn . client . editors . types . common . DataType , org . kie . workbench . common . dmn . client . editors . types . common . DataType , org . kie . workbench . common . dmn . client . editors . types . persistence . CreationType ) { if ( creationType == ( org . kie . workbench . common . dmn . client . editors . types . persistence . CreationType . NESTED ) ) { final org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition nestedItemDefinition = itemDefinitionCreateHandler . insertNestedItemDefinition ( reference ) ; return dataTypeCreateHandler . insertNested ( record , reference , nestedItemDefinition ) ; } else { final org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition itemDefinition = itemDefinitionCreateHandler . insertItemDefinition ( reference , creationType ) ; return dataTypeCreateHandler . insert ( record , reference , creationType , itemDefinition ) ; } } | org . junit . Assert . assertEquals ( expectedAffectedDataTypes , actualAffectedDataTypes ) |
testRemoveAndVerifyResult ( ) { com . sun . sgs . test . app . util . TestScalableList . txnScheduler . runTask ( new com . sun . sgs . test . util . TestAbstractKernelRunnable ( ) { public void run ( ) throws com . sun . sgs . test . app . util . Exception { com . sun . sgs . app . util . ScalableList < java . lang . String > list = new com . sun . sgs . app . util . ScalableList < java . lang . String > ( 6 , 6 ) ; list . add ( "A" ) ; list . add ( "B" ) ; list . add ( "C" ) ; java . lang . Object obj = list . remove ( 1 ) ; "<AssertPlaceHolder>" ; com . sun . sgs . app . AppContext . getDataManager ( ) . removeObject ( list ) ; } } , com . sun . sgs . test . app . util . TestScalableList . taskOwner ) ; } toString ( ) { return ( ( host ) + ":" ) + ( id ) ; } | org . junit . Assert . assertEquals ( "B" , obj . toString ( ) ) |
sa04_Query_onPojo_value ( ) { org . apache . juneau . rest . annotation2 . ParameterInfo x = org . apache . juneau . rest . annotation2 . QueryAnnotationTest . sa . getParameterInfo ( "/sa04" , "get" , "query" , "Q" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return "exit" ; } | org . junit . Assert . assertEquals ( "Q" , x . getName ( ) ) |
should_throw_error_if_iterable_is_null ( ) { thrown . expect ( org . fest . util . NullPointerException . class ) ; java . lang . Iterable < ? > elements = null ; "<AssertPlaceHolder>" ; } newArrayList ( T [ ] ) { org . fest . util . Preconditions . checkNotNull ( elements ) ; java . util . ArrayList < T > list = org . fest . util . Lists . newArrayList ( ) ; for ( T e : elements ) { list . add ( e ) ; } return list ; } | org . junit . Assert . assertNull ( org . fest . util . Lists . newArrayList ( elements ) ) |
testWrite ( ) { @ org . jetbrains . annotations . NotNull net . openhft . chronicle . wire . Wire wire = createWire ( ) ; wire . write ( ) ; wire . write ( ) ; wire . write ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( "NestedClass{" + "text='" ) + ( text ) ) + '\'' ) + ",<sp>number=" ) + ( number ) ) + '}' ; } | org . junit . Assert . assertEquals ( "" , wire . toString ( ) ) |
testAppendByteBuffer ( ) { byte [ ] testData = runtime . getMethodName ( ) . getBytes ( org . apache . bookkeeper . client . api . UTF_8 ) ; handle . writeAsync ( entryId , java . nio . ByteBuffer . wrap ( testData , 1 , ( ( testData . length ) / 2 ) ) ) ; byte [ ] expectedData = new byte [ ( testData . length ) / 2 ] ; java . lang . System . arraycopy ( testData , 1 , expectedData , 0 , ( ( testData . length ) / 2 ) ) ; io . netty . buffer . ByteBuf buffer = entryQueue . take ( ) ; byte [ ] bufferData = io . netty . buffer . ByteBufUtil . getBytes ( buffer ) ; "<AssertPlaceHolder>" ; verify ( handle , times ( 1 ) ) . writeAsync ( eq ( entryId ) , any ( io . netty . buffer . ByteBuf . class ) ) ; } getBytes ( byte [ ] ) { int copied = 0 ; for ( int idx = 0 ; ( idx < ( buffers . size ( ) ) ) && ( copied < ( dst . length ) ) ; idx ++ ) { io . netty . buffer . ByteBuf b = buffers . get ( idx ) ; int len = java . lang . Math . min ( b . readableBytes ( ) , ( ( dst . length ) - copied ) ) ; b . getBytes ( b . readerIndex ( ) , dst , copied , len ) ; copied += len ; } return copied ; } | org . junit . Assert . assertArrayEquals ( expectedData , bufferData ) |
readsMaxCacheFromConfiguration ( ) { final org . everrest . core . impl . EverrestConfiguration configuration = new org . everrest . core . impl . EverrestConfiguration ( ) ; configuration . setAsynchronousCacheSize ( 123 ) ; asynchronousJobPool = new org . everrest . core . impl . async . AsynchronousJobPool ( configuration ) ; "<AssertPlaceHolder>" ; } getMaxCacheSize ( ) { return maxCacheSize ; } | org . junit . Assert . assertEquals ( 123 , asynchronousJobPool . getMaxCacheSize ( ) ) |
shouldRejectInvalidIPv4Address ( ) { org . openstack . atlas . docs . loadbalancers . api . v1 . Node node1 = new org . openstack . atlas . docs . loadbalancers . api . v1 . Node ( ) ; node1 . setAddress ( "0.0.0.0" ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( node1 , org . openstack . atlas . api . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } passedValidation ( ) { return expectationResultList . isEmpty ( ) ; } | org . junit . Assert . assertFalse ( result . passedValidation ( ) ) |
testNodeTypeOutNoURIFilterNoAction ( ) { org . hawkular . apm . api . model . config . CollectorConfiguration cc = new org . hawkular . apm . api . model . config . CollectorConfiguration ( ) ; org . hawkular . apm . api . model . config . txn . TransactionConfig btc = new org . hawkular . apm . api . model . config . txn . TransactionConfig ( ) ; cc . getTransactions ( ) . put ( "testapp" , btc ) ; org . hawkular . apm . api . model . config . txn . Processor p1 = new org . hawkular . apm . api . model . config . txn . Processor ( ) ; btc . getProcessors ( ) . add ( p1 ) ; p1 . setNodeType ( NodeType . Component ) ; p1 . setDirection ( Direction . In ) ; org . hawkular . apm . api . model . config . txn . SetPropertyAction pa1 = new org . hawkular . apm . api . model . config . txn . SetPropertyAction ( ) ; p1 . getActions ( ) . add ( pa1 ) ; pa1 . setName ( "test" ) ; org . hawkular . apm . api . model . config . txn . TextExpression expr = new org . hawkular . apm . api . model . config . txn . TextExpression ( ) ; expr . setSource ( DataSource . Content ) ; expr . setKey ( "1" ) ; pa1 . setExpression ( expr ) ; org . hawkular . apm . client . collector . internal . ProcessorManager pm = new org . hawkular . apm . client . collector . internal . ProcessorManager ( cc ) ; org . hawkular . apm . api . model . trace . Trace trace = new org . hawkular . apm . api . model . trace . Trace ( ) ; org . hawkular . apm . api . model . trace . Component service = new org . hawkular . apm . api . model . trace . Component ( ) ; trace . getNodes ( ) . add ( service ) ; trace . setTransaction ( "testapp" ) ; pm . process ( trace , service , Direction . Out , null , "first" , "second" ) ; "<AssertPlaceHolder>" ; } hasProperty ( java . lang . String ) { for ( org . hawkular . apm . api . model . Property property : this . properties ) { if ( property . getName ( ) . equals ( name ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( service . hasProperty ( "test" ) ) |
getVersionGetsNullIfNotPresent ( ) { java . lang . String validString = "$iothub/twin/res/?$rid=7" ; com . microsoft . azure . sdk . iot . device . transport . mqtt . TopicParser testParser = new com . microsoft . azure . sdk . iot . device . transport . mqtt . TopicParser ( validString ) ; java . lang . String version = mockit . Deencapsulation . invoke ( testParser , "getVersion" , 3 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNull ( version ) |
removeEvidenceRemovesEvidenceFromTheDispute ( ) { java . lang . String disputeId = createSampleDispute ( ) . getId ( ) ; java . lang . String evidenceId = gateway . dispute ( ) . addTextEvidence ( disputeId , "text<sp>evidence" ) . getTarget ( ) . getId ( ) ; com . braintreegateway . Result < com . braintreegateway . Dispute > result = gateway . dispute ( ) . removeEvidence ( disputeId , evidenceId ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return success ; } | org . junit . Assert . assertTrue ( result . isSuccess ( ) ) |
testIntronicThreePrimeOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t59012355\t.\tN\t<INS:ME>\t.\t.\tSVTYPE=INS;END=59012355" ) ; final java . lang . String expected = "1\t59012355\t.\tN\t<INS:ME>\t.\t.\tEND=59012355;" + ( "SVANN=insertion&5_prime_UTR_intron_variant&mobile_element_insertion&structural_variant&" + "coding_transcript_variant|HIGH|OMA1|115209|transcript|NM_145243.3|Coding|;SVTYPE=INS" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetId_1 ( ) { org . jinstagram . entity . users . feed . MediaFeedData fixture = new org . jinstagram . entity . users . feed . MediaFeedData ( ) ; fixture . setId ( "" ) ; fixture . setCreatedTime ( "" ) ; fixture . setVideos ( new org . jinstagram . entity . common . Videos ( ) ) ; fixture . setCaption ( new org . jinstagram . entity . common . Caption ( ) ) ; fixture . setUser ( new org . jinstagram . entity . common . User ( ) ) ; fixture . setImageFilter ( "" ) ; fixture . setImages ( new org . jinstagram . entity . common . Images ( ) ) ; fixture . setType ( "" ) ; fixture . setTags ( new java . util . ArrayList < java . lang . String > ( ) ) ; fixture . setLink ( "" ) ; fixture . setUserHasLiked ( true ) ; fixture . setUsersInPhotoList ( new java . util . ArrayList < org . jinstagram . entity . common . UsersInPhoto > ( ) ) ; fixture . setComments ( new org . jinstagram . entity . common . Comments ( ) ) ; fixture . setLocation ( new org . jinstagram . entity . common . Location ( ) ) ; fixture . setLikes ( new org . jinstagram . entity . common . Likes ( ) ) ; java . lang . String result = fixture . getId ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( "" , result ) |
testParse2 ( ) { net . openhft . chronicle . wire . TextWireTest . MyDto myDto1 = new net . openhft . chronicle . wire . TextWireTest . MyDto ( ) ; myDto1 . strings . add ( "hello" ) ; myDto1 . strings . add ( "world" ) ; java . lang . String cs = myDto1 . toString ( ) ; System . out . println ( cs ) ; net . openhft . chronicle . wire . TextWireTest . MyDto o = net . openhft . chronicle . wire . Marshallable . fromString ( cs ) ; "<AssertPlaceHolder>" ; assert ( o . strings . size ( ) ) == 2 ; } toString ( ) { return ( ( ( ( ( "NestedClass{" + "text='" ) + ( text ) ) + '\'' ) + ",<sp>number=" ) + ( number ) ) + '}' ; } | org . junit . Assert . assertEquals ( cs , o . toString ( ) ) |
validate_statusIsSet_valid ( ) { confirmation . setStatus ( UpdateStatus . Accepted ) ; "<AssertPlaceHolder>" ; } validate ( ) { return true ; } | org . junit . Assert . assertThat ( confirmation . validate ( ) , org . hamcrest . CoreMatchers . equalTo ( true ) ) |
writeHeartbeatMessage ( ) { cocaine . message . Message msg = cocaine . message . Messages . heartbeat ( ) ; byte [ ] bytes = pack . write ( java . util . Arrays . asList ( 1 , 0 , java . util . Arrays . asList ( ) ) ) ; byte [ ] result = pack . write ( msg , cocaine . msgpack . MessageTemplate . getInstance ( ) ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { return cocaine . msgpack . MessageTemplate . instance ; } | org . junit . Assert . assertArrayEquals ( bytes , result ) |
should_addGenerationUnit ( ) { p . addGenerationUnit ( u ) ; "<AssertPlaceHolder>" ; } getSubGenerationUnitsAsList ( ) { java . util . List < ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . GenerationUnit > gus = new java . util . ArrayList < ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . GenerationUnit > ( ) ; if ( ( generationSubPackages ) != null ) { for ( ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . GenerationSubPackage generationSubPackage : generationSubPackages ) { gus . addAll ( generationSubPackage . getSubGenerationUnitsAsList ( ) ) ; } } gus . addAll ( generationUnits ) ; if ( ( packageGenerationUnit ) != null ) { gus . add ( packageGenerationUnit ) ; } return ch . puzzle . itc . mobiliar . business . generator . control . extracted . templates . GenerationPackage . removeDuplicates ( gus ) ; } | org . junit . Assert . assertEquals ( 1 , p . getSubGenerationUnitsAsList ( ) . size ( ) ) |
testGetJulianDate ( ) { org . esa . snap . core . datamodel . ProductData . UTC utc = ProductData . UTC . parse ( "12-10-2006" , "dd-MM-yyyy" ) ; org . esa . s3tbx . meris . radiometry . equalization . EqualizationAlgorithm algorithm = new org . esa . s3tbx . meris . radiometry . equalization . EqualizationAlgorithm ( utc , new org . esa . s3tbx . meris . radiometry . equalization . EqualizationLUT ( new java . io . Reader [ 0 ] ) ) ; long expectedJD = ( org . esa . s3tbx . meris . radiometry . equalization . EqualizationAlgorithm . toJulianDay ( 2006 , 9 , 12 ) ) - ( org . esa . s3tbx . meris . radiometry . equalization . EqualizationAlgorithm . toJulianDay ( 2002 , 4 , 1 ) ) ; "<AssertPlaceHolder>" ; } getJulianDate ( ) { return julianDate ; } | org . junit . Assert . assertEquals ( expectedJD , algorithm . getJulianDate ( ) ) |
testSerialization ( ) { org . jfree . chart . axis . ColorBar a1 = new org . jfree . chart . axis . ColorBar ( "Test<sp>Axis" ) ; org . jfree . chart . axis . ColorBar a2 = ( ( org . jfree . chart . axis . ColorBar ) ( org . jfree . chart . TestUtilities . serialised ( a1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( a1 , a2 ) |
testInitialiseWithClass ( ) { org . mule . runtime . core . api . object . AbstractObjectFactory factory = getUninitialisedObjectFactory ( ) ; factory . setObjectClass ( java . lang . Object . class ) ; ( ( org . mule . runtime . core . internal . context . MuleContextWithRegistry ) ( muleContext ) ) . getRegistry ( ) . applyProcessorsAndLifecycle ( factory ) ; "<AssertPlaceHolder>" ; } getInstance ( org . mule . runtime . core . api . MuleContext ) { return new org . mule . tck . testmodels . fruit . Banana ( ) ; } | org . junit . Assert . assertNotNull ( factory . getInstance ( muleContext ) ) |
testSearchResourceReferenceOnlyCorrectPath ( ) { org . hl7 . fhir . instance . model . api . IIdType oid1 ; { ca . uhn . fhir . jpa . dao . r4 . Organization org = new ca . uhn . fhir . jpa . dao . r4 . Organization ( ) ; org . setActive ( true ) ; oid1 = myOrganizationDao . create ( org , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } org . hl7 . fhir . instance . model . api . IIdType tid1 ; { ca . uhn . fhir . jpa . dao . r4 . Task task = new ca . uhn . fhir . jpa . dao . r4 . Task ( ) ; task . setRequester ( new ca . uhn . fhir . jpa . dao . r4 . Reference ( oid1 ) ) ; tid1 = myTaskDao . create ( task , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } org . hl7 . fhir . instance . model . api . IIdType tid2 ; { ca . uhn . fhir . jpa . dao . r4 . Task task = new ca . uhn . fhir . jpa . dao . r4 . Task ( ) ; task . setOwner ( new ca . uhn . fhir . jpa . dao . r4 . Reference ( oid1 ) ) ; tid2 = myTaskDao . create ( task , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } ca . uhn . fhir . jpa . searchparam . SearchParameterMap map ; ca . uhn . fhir . jpa . dao . r4 . List < org . hl7 . fhir . instance . model . api . IIdType > ids ; map = new ca . uhn . fhir . jpa . searchparam . SearchParameterMap ( ) ; map . add ( Task . SP_REQUESTER , new ca . uhn . fhir . jpa . dao . r4 . ReferenceParam ( oid1 . getValue ( ) ) ) ; ids = toUnqualifiedVersionlessIds ( myTaskDao . search ( map ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return data . contains ( o ) ; } | org . junit . Assert . assertThat ( ids , contains ( tid1 ) ) |
testDoHealthChecks ( ) { org . talend . components . jms . JmsDatastoreProperties props = new org . talend . components . jms . JmsDatastoreProperties ( "test" ) ; props . serverUrl . setValue ( "tcp://localhost:61616" ) ; datastoreRuntime . initialize ( null , props ) ; java . lang . Iterable < org . talend . daikon . properties . ValidationResult > healthResult = datastoreRuntime . doHealthChecks ( null ) ; "<AssertPlaceHolder>" ; } doHealthChecks ( org . talend . components . api . container . RuntimeContainer ) { return singletonList ( ValidationResult . OK ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( ValidationResult . OK ) , healthResult ) |
testNonRoutedExtraction ( ) { final org . opendaylight . mdsal . binding . dom . adapter . ContextReferenceExtractor extractor = org . opendaylight . mdsal . binding . dom . adapter . ContextReferenceExtractor . from ( org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . controller . md . sal . test . bi . ba . rpcservice . rev140701 . RockTheHouseInput . class ) ; final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . controller . md . sal . test . bi . ba . rpcservice . rev140701 . RockTheHouseInput input = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . controller . md . sal . test . bi . ba . rpcservice . rev140701 . RockTheHouseInputBuilder ( ) . build ( ) ; final org . opendaylight . yangtools . yang . binding . InstanceIdentifier < ? > extractedValue = extractor . extract ( input ) ; "<AssertPlaceHolder>" ; } extract ( org . opendaylight . yangtools . yang . binding . DataObject ) { try { return ( ( org . opendaylight . yangtools . yang . binding . InstanceIdentifier < ? > ) ( handle . invokeExact ( obj ) ) ) ; } catch ( final java . lang . Throwable e ) { com . google . common . base . Throwables . throwIfUnchecked ( e ) ; throw new java . lang . IllegalStateException ( e ) ; } } | org . junit . Assert . assertNull ( extractedValue ) |
testEvaluate6 ( ) { com . huawei . streaming . expression . RelationExpression relationExpression = new com . huawei . streaming . expression . RelationExpression ( ExpressionOperator . NOT_EQUAL , new com . huawei . streaming . expression . ConstExpression ( com . huawei . streaming . support . SupportConst . I_TWO ) , new com . huawei . streaming . expression . ConstExpression ( com . huawei . streaming . support . SupportConst . I_THREE ) ) ; com . huawei . streaming . event . IEvent event = new com . huawei . streaming . event . TupleEvent ( ) ; java . lang . Object actualResult = relationExpression . evaluate ( event ) ; "<AssertPlaceHolder>" ; } evaluate ( com . huawei . streaming . event . IEvent [ ] ) { if ( ( null == eventsPerStream ) || ( 0 == ( eventsPerStream . length ) ) ) { com . huawei . streaming . expression . ArithmeticExpression . LOG . error ( "Streams<sp>events<sp>are<sp>null." ) ; throw new com . huawei . streaming . exception . StreamingRuntimeException ( "Streams<sp>events<sp>are<sp>null." ) ; } com . huawei . streaming . expression . IExpression leftExpr = getLeftExpr ( ) ; com . huawei . streaming . expression . IExpression rightExpr = getRightExpr ( ) ; java . lang . Object lo = leftExpr . evaluate ( eventsPerStream ) ; java . lang . Object ro = rightExpr . evaluate ( eventsPerStream ) ; return compute ( lo , ro ) ; } | org . junit . Assert . assertTrue ( ( ( java . lang . Boolean ) ( actualResult ) ) ) |
testAvailability ( ) { setUp ( org . codice . ddf . spatial . ogc . wfs . v1_0_0 . catalog . source . WfsSourceTest . NO_PROPERTY_SCHEMA , null , null , org . codice . ddf . spatial . ogc . wfs . v1_0_0 . catalog . source . WfsSourceTest . ONE_FEATURE , null ) ; "<AssertPlaceHolder>" ; } isAvailable ( ) { return isAvailable ; } | org . junit . Assert . assertTrue ( source . isAvailable ( ) ) |
testEquals ( ) { org . jfree . data . time . Day day1 = new org . jfree . data . time . Day ( 29 , org . jfree . date . MonthConstants . MARCH , 2002 ) ; org . jfree . data . time . Day day2 = new org . jfree . data . time . Day ( 29 , org . jfree . date . MonthConstants . MARCH , 2002 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org . jfree . base . modules . PackageState ) ) { return false ; } final org . jfree . base . modules . PackageState packageState = ( ( org . jfree . base . modules . PackageState ) ( o ) ) ; if ( ! ( this . module . getModuleClass ( ) . equals ( packageState . module . getModuleClass ( ) ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( day1 . equals ( day2 ) ) |
runCommand ( ) { org . bson . Document runCommand = com . ibm . profiler . mongo . ProfiledMongoClientTest . db . runCommand ( new org . bson . Document ( "buildInfo" , 1 ) ) ; runCommand = com . ibm . profiler . mongo . ProfiledMongoClientTest . db . runCommand ( new org . bson . Document ( "buildInfo" , 1 ) , org . bson . Document . class ) ; runCommand = com . ibm . profiler . mongo . ProfiledMongoClientTest . db . runCommand ( new org . bson . Document ( "buildInfo" , 1 ) , com . mongodb . ReadPreference . primary ( ) ) ; runCommand = com . ibm . profiler . mongo . ProfiledMongoClientTest . db . runCommand ( new org . bson . Document ( "buildInfo" , 1 ) , com . mongodb . ReadPreference . primary ( ) , org . bson . Document . class ) ; "<AssertPlaceHolder>" ; } runCommand ( org . bson . conversions . Bson , com . mongodb . ReadPreference , java . lang . Class ) { com . ibm . commerce . cache . OperationMetric metric = null ; if ( MongoLogger . GATHERER . isEnabled ( ) ) { metric = startMetric ( "Mongo<sp>:<sp>runCommand" , java . util . Arrays . asList ( "command" , command . toString ( ) ) ) ; } TResult runCommand = database . runCommand ( command , readPreference , resultClass ) ; int resultSize = 0 ; if ( com . ibm . service . detailed . MongoLogger . isResultSetSizeMeasured ( ) ) { resultSize = com . ibm . commerce . cache . CacheUtilities . safeToString ( runCommand ) . length ( ) ; } stopMetric ( metric , resultSize ) ; return runCommand ; } | org . junit . Assert . assertNotNull ( runCommand ) |
testOutdated ( ) { logger . info ( "testOutdated" ) ; io . fabric8 . kubernetes . client . KubernetesClient client = server . getClient ( ) . inNamespace ( "test" ) ; server . expect ( ) . withPath ( path ) . andReturn ( 200 , "Failed<sp>WebSocket<sp>Connection" ) . once ( ) ; server . expect ( ) . withPath ( path ) . andReturnChunked ( 200 , io . fabric8 . kubernetes . client . mock . WatchOverHTTP . outdatedEvent , "\n" ) . once ( ) ; final boolean [ ] onCloseCalled = new boolean [ ] { false } ; try ( io . fabric8 . kubernetes . client . Watch watch = client . pods ( ) . withName ( "pod1" ) . withResourceVersion ( "1" ) . watch ( new io . fabric8 . kubernetes . client . Watcher < io . fabric8 . kubernetes . api . model . Pod > ( ) { @ io . fabric8 . kubernetes . client . mock . Override public void eventReceived ( io . fabric8 . kubernetes . client . mock . Action action , io . fabric8 . kubernetes . api . model . Pod resource ) { throw new junit . framework . AssertionFailedError ( ) ; } @ io . fabric8 . kubernetes . client . mock . Override public void onClose ( io . fabric8 . kubernetes . client . KubernetesClientException cause ) { onCloseCalled [ 0 ] = true ; } } ) ) { } "<AssertPlaceHolder>" ; } onClose ( io . fabric8 . kubernetes . client . KubernetesClientException ) { System . out . println ( ( "Watch<sp>Closed:<sp>" + cause ) ) ; if ( cause != null ) { cause . printStackTrace ( ) ; } } | org . junit . Assert . assertTrue ( onCloseCalled [ 0 ] ) |
assetGetReturnsExpectedUri ( ) { java . lang . String expectedUri = java . lang . String . format ( "Assets('%s')" , java . net . URLEncoder . encode ( com . microsoft . windowsazure . services . media . models . AssetEntityTest . sampleAssetId , "UTF-8" ) ) ; com . microsoft . windowsazure . services . media . entityoperations . EntityGetOperation < com . microsoft . windowsazure . services . media . models . AssetInfo > getter = com . microsoft . windowsazure . services . media . models . Asset . get ( com . microsoft . windowsazure . services . media . models . AssetEntityTest . sampleAssetId ) ; "<AssertPlaceHolder>" ; } getUri ( ) { return uri ; } | org . junit . Assert . assertEquals ( expectedUri , getter . getUri ( ) ) |
testParseCatalogXML ( ) { java . io . File resource = getResource ( "owl-mirror.txt" ) ; java . io . InputStream inputStream = new java . io . FileInputStream ( resource ) ; java . io . File parentFolder = resource . getParentFile ( ) ; java . util . Map < org . semanticweb . owlapi . model . IRI , org . semanticweb . owlapi . model . IRI > mappings = owltools . io . LocalMirrorIRIMapper . parseDirectoryMappingFile ( inputStream , parentFolder ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . bitSetSize ; } | org . junit . Assert . assertTrue ( ( ( mappings . size ( ) ) == 2 ) ) |
testPersistence ( ) { java . lang . System . setProperty ( "grid.buffer" , "10" ) ; reset ( additionsChannel , replayChannel , locksChannel ) ; it . redhat . hacep . rules . TestPersistence . logger . info ( "Start<sp>test<sp>serialized<sp>rules" ) ; it . redhat . hacep . cluster . RulesConfigurationTestImpl rulesConfigurationTest = RulesConfigurationTestImpl . RulesTestBuilder . buildRulesWithRetract ( ) ; rulesConfigurationTest . registerChannel ( "additions" , additionsChannel , replayChannel ) ; rulesConfigurationTest . registerChannel ( "locks" , locksChannel , replayChannel ) ; it . redhat . hacep . configuration . RulesManager rulesManager = new it . redhat . hacep . configuration . RulesManager ( rulesConfigurationTest ) ; rulesManager . start ( null , null , null ) ; org . infinispan . Cache < java . lang . String , java . lang . Object > cache = startNodes ( 1 , rulesManager ) . getCache ( it . redhat . hacep . rules . TestPersistence . CACHE_NAME ) ; java . lang . String key = "1" ; it . redhat . hacep . cache . session . HAKieSession session1 = new it . redhat . hacep . cache . session . HAKieSession ( rulesManager , it . redhat . hacep . rules . TestPersistence . executorService ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 1L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 2L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 3L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 4L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 5L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 6L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 7L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 8L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 9L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 10L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 1L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 2L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 3L ) ) ; cache . put ( key , session1 ) ; session1 . insert ( generateFactTenSecondsAfter ( 1 , 10L ) ) ; cache . put ( key , session1 ) ; stopNodes ( ) ; org . infinispan . Cache < java . lang . String , java . lang . Object > cacheDeserialized = startNodes ( 1 , rulesManager ) . getCache ( it . redhat . hacep . rules . TestPersistence . CACHE_NAME ) ; java . lang . Object o = cacheDeserialized . get ( key ) ; "<AssertPlaceHolder>" ; it . redhat . hacep . cache . session . HAKieSerializedSession haKieSerializedSession = ( ( it . redhat . hacep . cache . session . HAKieSerializedSession ) ( o ) ) ; it . redhat . hacep . cache . session . HAKieSession sessionRebuilt = haKieSerializedSession . rebuild ( ) ; sessionRebuilt . insert ( generateFactTenSecondsAfter ( 1 , 0L ) ) ; cacheDeserialized . put ( key , sessionRebuilt ) ; sessionRebuilt . insert ( generateFactTenSecondsAfter ( 1 , 0L ) ) ; cacheDeserialized . put ( key , sessionRebuilt ) ; sessionRebuilt . insert ( generateFactTenSecondsAfter ( 1 , 10L ) ) ; cacheDeserialized . put ( key , sessionRebuilt ) ; org . mockito . InOrder order = org . mockito . Mockito . inOrder ( additionsChannel , locksChannel ) ; order . verify ( additionsChannel ) . send ( eq ( 1L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 2L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 3L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 4L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 5L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 6L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 7L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 8L ) ) ; order . verify ( additionsChannel ) . send ( eq ( 9L ) ) ; order . verify ( locksChannel ) . send ( eq ( "INSERTED" ) ) ; order . verify ( locksChannel ) . send ( eq ( "REMOVED" ) ) ; order . verify ( additionsChannel ) . send ( eq ( 3L ) ) ; order . verify ( locksChannel ) . send ( eq ( "INSERTED" ) ) ; order . verify ( locksChannel ) . send ( eq ( "REMOVED" ) ) ; order . verify ( locksChannel ) . send ( eq ( "INSERTED" ) ) ; order . verifyNoMoreInteractions ( ) ; it . redhat . hacep . rules . TestPersistence . logger . info ( "End<sp>test<sp>serialized<sp>rules" ) ; rulesManager . stop ( ) ; } generateFactTenSecondsAfter ( long , long ) { now = now . plusSeconds ( 10 ) ; return new it . redhat . hacep . cluster . TestFact ( ppid , amount , new java . util . Date ( now . toInstant ( | org . junit . Assert . assertTrue ( ( o instanceof it . redhat . hacep . cache . session . HAKieSerializedSession ) ) |
asyncServiceInvocationShouldRunAsynchronouslyWithMethodCalll ( ) { java . util . concurrent . Future < java . lang . String > response = ping . ping ( "foo" ) ; server . setResponse ( "bar" ) ; "<AssertPlaceHolder>" ; } get ( ) { return instance ; } | org . junit . Assert . assertEquals ( "bar" , response . get ( ) ) |
testFindByPrimaryKeyExisting ( ) { com . liferay . asset . kernel . model . AssetEntry newAssetEntry = addAssetEntry ( ) ; com . liferay . asset . kernel . model . AssetEntry existingAssetEntry = _persistence . findByPrimaryKey ( newAssetEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingAssetEntry , newAssetEntry ) |
testBuildDeploymentCamelContextCustomBuilder ( ) { when ( runtimeManager . getIdentifier ( ) ) . thenReturn ( identifier ) ; when ( runtimeManager . getEnvironment ( ) ) . thenReturn ( runtimeEnvironment ) ; org . kie . api . runtime . Environment environment = org . kie . api . KieServices . get ( ) . newEnvironment ( ) ; environment . set ( JBPMConstants . CAMEL_CONTEXT_BUILDER_KEY , new org . apache . camel . component . jbpm . config . CamelContextBuilder ( ) { @ org . apache . camel . component . jbpm . server . Override public org . apache . camel . CamelContext buildCamelContext ( ) { return null ; } } ) ; when ( runtimeEnvironment . getEnvironment ( ) ) . thenReturn ( environment ) ; org . kie . internal . runtime . manager . RuntimeManagerRegistry . get ( ) . register ( runtimeManager ) ; org . apache . camel . component . jbpm . server . CamelKieServerExtension extension = new org . apache . camel . component . jbpm . server . CamelKieServerExtension ( ) ; org . apache . camel . CamelContext context = extension . buildDeploymentContext ( identifier , this . getClass ( ) . getClassLoader ( ) ) ; "<AssertPlaceHolder>" ; } getClassLoader ( ) { java . util . Set < java . net . URL > classpathURLs = new java . util . LinkedHashSet ( ) ; this . addRelevantProjectDependenciesToClasspath ( classpathURLs ) ; this . addExtraPluginDependenciesToClasspath ( classpathURLs ) ; this . addRelevantPluginDependenciesToClasspath ( classpathURLs ) ; if ( logClasspath ) { getLog ( ) . info ( "Classpath:" ) ; for ( java . net . URL url : classpathURLs ) { getLog ( ) . info ( ( "<sp>" + ( url . getFile ( ) . toString ( ) ) ) ) ; } } return new java . net . URLClassLoader ( classpathURLs . toArray ( new java . net . URL [ classpathURLs . size ( ) ] ) ) ; } | org . junit . Assert . assertNull ( context ) |
testSearchByNameAndDescription1 ( ) { addDisplayTemplate ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateLocalServiceTest . _classNameId , 0 , com . liferay . dynamic . data . mapping . service . test . DDMTemplateLocalServiceTest . _resourceClassNameId , "Event" , "Event" , WorkflowConstants . STATUS_APPROVED ) ; addDisplayTemplate ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateLocalServiceTest . _classNameId , 0 , com . liferay . dynamic . data . mapping . service . test . DDMTemplateLocalServiceTest . _resourceClassNameId , "Contact" , "Contact" , WorkflowConstants . STATUS_APPROVED ) ; addDisplayTemplate ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateLocalServiceTest . _classNameId , 0 , com . liferay . dynamic . data . mapping . service . test . DDMTemplateLocalServiceTest . _resourceClassNameId , "Meeting" , "Meeting" , WorkflowConstants . STATUS_APPROVED ) ; java . util . List < com . liferay . dynamic . data . mapping . model . DDMTemplate > templates = com . liferay . dynamic . data . mapping . service . DDMTemplateLocalServiceUtil . search ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , new long [ ] { group . getGroupId ( ) } , null , null , 0 , "Event" , "Meeting" , null , null , null , WorkflowConstants . STATUS_APPROVED , true , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( templates . toString ( ) , 2 , templates . size ( ) ) |
testNullKey ( ) { com . ibm . ws . microprofile . openapi . impl . model . security . SecurityRequirementImpl securityRequirement = new com . ibm . ws . microprofile . openapi . impl . model . security . SecurityRequirementImpl ( ) ; com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl petStore_auth = new com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl ( ) ; com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl api_key = new com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl ( ) ; petStore_auth . setType ( oauth ) ; petStore_auth . setFlows ( flows ) ; api_key . setType ( apiKey ) ; api_key . setName ( "api_key" ) ; api_key . setIn ( in ) ; java . util . List < java . lang . String > scope = java . util . Arrays . asList ( "write:pets" , "read:pets" ) ; securityRequirement . addScheme ( "petStore_auth" , scope ) ; securityRequirement . addScheme ( "api_key" ) ; com . ibm . ws . microprofile . openapi . impl . model . OpenAPIImpl model = new com . ibm . ws . microprofile . openapi . impl . model . OpenAPIImpl ( ) ; com . ibm . ws . microprofile . openapi . impl . model . ComponentsImpl components = new com . ibm . ws . microprofile . openapi . impl . model . ComponentsImpl ( ) ; java . util . Map < java . lang . String , org . eclipse . microprofile . openapi . models . security . SecurityScheme > securitySchemes = new java . util . HashMap < java . lang . String , org . eclipse . microprofile . openapi . models . security . SecurityScheme > ( ) ; securitySchemes . put ( "petStore_auth" , null ) ; securitySchemes . put ( "api_key" , api_key ) ; components . setSecuritySchemes ( securitySchemes ) ; model . setComponents ( components ) ; com . ibm . ws . microprofile . openapi . utils . OpenAPIModelWalker . Context context = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationContextHelper ( model ) ; com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper vh = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper ( ) ; com . ibm . ws . microprofile . openapi . impl . validation . SecurityRequirementValidator validator = com . ibm . ws . microprofile . openapi . impl . validation . SecurityRequirementValidator . getInstance ( ) ; validator . validate ( vh , context , key , securityRequirement ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , vh . getEventsSize ( ) ) |
testBuildWithParametersAndDisabledDefaultConstaints ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String name = "name" ; java . lang . String abbrName = "abbr<sp>name" ; org . lnu . is . domain . department . type . DepartmentType context = new org . lnu . is . domain . department . type . DepartmentType ( ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>DepartmentType<sp>e<sp>WHERE<sp>(<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . department . type . DepartmentType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expected , actualQuery ) |
testCountStringEmptyArray ( ) { java . lang . String [ ] array = new java . lang . String [ ] { } ; "<AssertPlaceHolder>" ; } count ( T [ ] , java . util . function . Predicate ) { return com . liferay . portal . kernel . util . ArrayUtil . count ( array , predicate ) ; } | org . junit . Assert . assertEquals ( 0 , com . liferay . portal . kernel . util . ArrayUtil . count ( array , ( s ) -> true ) ) |
isReadOnly_readOnlyNullable_returnsTrue ( ) { com . vaadin . v7 . data . util . sqlcontainer . ColumnProperty cp = new com . vaadin . v7 . data . util . sqlcontainer . ColumnProperty ( "NAME" , true , true , true , false , "Ville" , java . lang . String . class ) ; "<AssertPlaceHolder>" ; } isReadOnly ( ) { java . lang . String readonlyClass = getAttribute ( "class" ) ; java . lang . String [ ] cssSelectors = readonlyClass . split ( "\\s" ) ; for ( java . lang . String selector : cssSelectors ) { if ( selector . equals ( "v-readonly" ) ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( cp . isReadOnly ( ) ) |
coercingAppleSourcePathsWithFlags ( ) { java . lang . reflect . Type type = com . facebook . buck . rules . coercer . TypeCoercerTest . TestFields . class . getField ( "listOfSourcesWithFlags" ) . getGenericType ( ) ; com . facebook . buck . rules . coercer . TypeCoercer < ? > coercer = typeCoercerFactory . typeCoercerForType ( type ) ; com . google . common . collect . ImmutableList < ? > input = com . google . common . collect . ImmutableList . of ( com . google . common . collect . ImmutableList . of ( "foo.m" , com . google . common . collect . ImmutableList . of ( "-Wall" , "-Werror" ) ) , com . google . common . collect . ImmutableList . of ( "bar.m" , com . google . common . collect . ImmutableList . of ( "-fobjc-arc" ) ) ) ; java . lang . Object result = coercer . coerce ( cellRoots , filesystem , java . nio . file . Paths . get ( "" ) , EmptyTargetConfiguration . INSTANCE , input ) ; com . google . common . collect . ImmutableList < com . facebook . buck . core . sourcepath . SourceWithFlags > expectedResult = com . google . common . collect . ImmutableList . of ( com . facebook . buck . core . sourcepath . SourceWithFlags . of ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "foo.m" ) , com . google . common . collect . ImmutableList . of ( "-Wall" , "-Werror" ) ) , com . facebook . buck . core . sourcepath . SourceWithFlags . of ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "bar.m" ) , com . google . common . collect . ImmutableList . of ( "-fobjc-arc" ) ) ) ; "<AssertPlaceHolder>" ; } of ( com . facebook . buck . core . config . BuckConfig ) { return new com . facebook . buck . event . chrome_trace . ChromeTraceBuckConfig ( delegate ) ; } | org . junit . Assert . assertEquals ( expectedResult , result ) |
testBNode ( ) { org . eclipse . rdf4j . query . algebra . Extension extension = new org . eclipse . rdf4j . query . algebra . Extension ( new org . eclipse . rdf4j . query . algebra . SingletonSet ( ) , new org . eclipse . rdf4j . query . algebra . ExtensionElem ( new org . eclipse . rdf4j . query . algebra . Var ( "x" ) , "x" ) , new org . eclipse . rdf4j . query . algebra . ExtensionElem ( new org . eclipse . rdf4j . query . algebra . BNodeGenerator ( ) , "z" ) ) ; org . eclipse . rdf4j . query . algebra . Projection projection = new org . eclipse . rdf4j . query . algebra . Projection ( extension , new org . eclipse . rdf4j . query . algebra . ProjectionElemList ( new org . eclipse . rdf4j . query . algebra . ProjectionElem ( "x" , "subject" ) , new org . eclipse . rdf4j . query . algebra . ProjectionElem ( "y" , "predicate" ) , new org . eclipse . rdf4j . query . algebra . ProjectionElem ( "z" , "object" ) ) ) ; org . apache . rya . forwardchain . rule . ConstructConsequentVisitor visitor = new org . apache . rya . forwardchain . rule . ConstructConsequentVisitor ( ) ; projection . visit ( visitor ) ; java . util . Set < org . eclipse . rdf4j . query . algebra . StatementPattern > expected = com . google . common . collect . Sets . newHashSet ( new org . eclipse . rdf4j . query . algebra . StatementPattern ( org . apache . rya . forwardchain . rule . ConstructConsequentVisitorTest . s ( null ) , org . apache . rya . forwardchain . rule . ConstructConsequentVisitorTest . p ( null ) , org . apache . rya . forwardchain . rule . ConstructConsequentVisitorTest . anon ( org . apache . rya . forwardchain . rule . ConstructConsequentVisitorTest . o ( null ) ) ) ) ; "<AssertPlaceHolder>" ; } getConsequents ( ) { return consequentStatementPatterns ; } | org . junit . Assert . assertEquals ( expected , visitor . getConsequents ( ) ) |
loginUsingKeytab ( ) { java . io . File keytabFile = generateKeytab ( keytabFileName , principal ) ; javax . security . auth . Subject subject = org . smartdata . utils . SecurityUtil . loginUsingKeytab ( principal , keytabFile ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "Login<sp>successful<sp>for<sp>user:<sp>" + ( subject . getPrincipals ( ) . iterator ( ) . next ( ) ) ) ) ; } next ( ) { key = new org . smartdata . erasurecode . RandomDatum ( random ) ; value = new org . smartdata . erasurecode . RandomDatum ( random ) ; } | org . junit . Assert . assertEquals ( principal , subject . getPrincipals ( ) . iterator ( ) . next ( ) . getName ( ) ) |
testGetNextTermBegin_FixedTerms_Months ( ) { java . util . Date startDate = java . util . Date . from ( java . time . ZonedDateTime . ofLocal ( java . time . LocalDate . of ( 2016 , 9 , 23 ) . atStartOfDay ( ) , java . time . ZoneId . systemDefault ( ) , null ) . toInstant ( ) ) ; contract . setStartDate ( startDate ) ; contract . setFixedTerms ( true ) ; contract . setFirstMinRuntimeCount ( 6 ) ; contract . setFirstMinRuntimeType ( IntervalType . MONTHS ) ; contract . setFollowingMinRuntimeCount ( 3 ) ; contract . setFollowingMinRuntimeType ( IntervalType . MONTHS ) ; java . util . Date actual = contract . getNextTermBegin ( ) ; java . util . Date expected = java . util . Date . from ( java . time . ZonedDateTime . ofLocal ( java . time . LocalDate . of ( 2017 , 4 , 1 ) . atStartOfDay ( ) , java . time . ZoneId . systemDefault ( ) , null ) . toInstant ( ) ) ; "<AssertPlaceHolder>" ; } getNextTermBegin ( ) { return getNextTermBeginAfter ( calendarBuilder . getInstance ( ) . getTime ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testClearProfile ( ) { final org . pac4j . cas . profile . CasRestProfile profile = new org . pac4j . cas . profile . CasRestProfile ( ID , USERNAME ) ; profile . clearSensitiveData ( ) ; "<AssertPlaceHolder>" ; } getTicketGrantingTicketId ( ) { return ( ( java . lang . String ) ( getAttribute ( org . pac4j . cas . profile . CasRestProfile . TGT_KEY ) ) ) ; } | org . junit . Assert . assertNull ( profile . getTicketGrantingTicketId ( ) ) |
testGenerateAclXmlSpec ( ) { scott . barleydb . api . specification . SpecRegistry registry = new scott . barleydb . api . specification . SpecRegistry ( ) ; scott . barleydb . build . specification . staticspec . processor . StaticDefinitionProcessor processor = new scott . barleydb . build . specification . staticspec . processor . StaticDefinitionProcessor ( ) ; @ scott . barleydb . test . SuppressWarnings ( "unused" ) scott . barleydb . api . specification . DefinitionsSpec aclSpec = processor . process ( new org . example . acl . AclSpec ( ) , registry ) ; javax . xml . bind . JAXBContext jc = javax . xml . bind . JAXBContext . newInstance ( scott . barleydb . api . specification . SpecRegistry . class , org . example . etl . model . StructureType . class , org . example . etl . model . SyntaxType . class , org . example . etl . EtlSpec . class ) ; javax . xml . bind . Marshaller marshaller = jc . createMarshaller ( ) ; marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , true ) ; marshaller . marshal ( registry , System . out ) ; java . io . ByteArrayOutputStream bout = new java . io . ByteArrayOutputStream ( ) ; marshaller . marshal ( registry , bout ) ; byte [ ] data1 = bout . toByteArray ( ) ; javax . xml . bind . Unmarshaller um = jc . createUnmarshaller ( ) ; registry = ( ( scott . barleydb . api . specification . SpecRegistry ) ( um . unmarshal ( new java . io . ByteArrayInputStream ( data1 ) ) ) ) ; bout = new java . io . ByteArrayOutputStream ( ) ; marshaller . marshal ( registry , bout ) ; byte [ ] data2 = bout . toByteArray ( ) ; "<AssertPlaceHolder>" ; java . io . FileOutputStream fout = new java . io . FileOutputStream ( new java . io . File ( "target/generated/src/test/java/org/example/acl/aclspec.xml" ) ) ; marshaller . marshal ( registry , fout ) ; fout . flush ( ) ; fout . close ( ) ; } unmarshal ( scott . barleydb . api . specification . EntitySpec$NodeSpecList ) { java . util . LinkedHashMap < java . lang . String , scott . barleydb . api . specification . NodeSpec > map = new java . util . LinkedHashMap < java . lang . String , scott . barleydb . api . specification . NodeSpec > ( ) ; for ( scott . barleydb . api . specification . NodeSpec spec : nodeSpecs . data ) { map . put ( spec . getName ( ) , spec ) ; } return map ; } | org . junit . Assert . assertTrue ( java . util . Arrays . equals ( data1 , data2 ) ) |
testDoGetDSWFilesAsDownload ( ) { java . util . Map < java . lang . String , java . io . InputStream > mockFileData = mock ( java . util . Map . class ) ; org . pentaho . agilebi . modeler . ModelerWorkspace mockModelerWorkspace = mock ( org . pentaho . agilebi . modeler . ModelerWorkspace . class ) ; org . pentaho . platform . plugin . services . importexport . legacy . MondrianCatalogRepositoryHelper mockMondrianCatalogRepositoryHelper = mock ( org . pentaho . platform . plugin . services . importexport . legacy . MondrianCatalogRepositoryHelper . class ) ; org . pentaho . metadata . model . LogicalModel mockLogicalModel = mock ( org . pentaho . metadata . model . LogicalModel . class ) ; java . lang . String mockObject = "not<sp>null" ; java . lang . String dswId = "dswId" ; doReturn ( true ) . when ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardServiceTest . dataSourceWizardService ) . canManageACL ( ) ; doReturn ( mockFileData ) . when ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardServiceTest . dataSourceWizardService ) . getMetadataFiles ( dswId ) ; doReturn ( mockModelerWorkspace ) . when ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardServiceTest . dataSourceWizardService ) . createModelerWorkspace ( ) ; doReturn ( null ) . when ( mockModelerWorkspace ) . getLogicalModel ( ModelerPerspective . ANALYSIS ) ; doReturn ( mockLogicalModel ) . when ( mockModelerWorkspace ) . getLogicalModel ( ModelerPerspective . REPORTING ) ; doReturn ( mockObject ) . when ( mockLogicalModel ) . getProperty ( "MondrianCatalogRef" ) ; doReturn ( mockMondrianCatalogRepositoryHelper ) . when ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardServiceTest . dataSourceWizardService ) . createMondrianCatalogRepositoryHelper ( ) ; doNothing ( ) . when ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardServiceTest . dataSourceWizardService ) . parseMondrianSchemaNameWrapper ( dswId , mockFileData ) ; java . util . Map < java . lang . String , java . io . InputStream > response = org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardServiceTest . dataSourceWizardService . doGetDSWFilesAsDownload ( "dswId" ) ; "<AssertPlaceHolder>" ; verify ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardServiceTest . dataSourceWizardService , times ( 1 ) ) . doGetDSWFilesAsDownload ( "dswId" ) ; } doGetDSWFilesAsDownload ( java . lang . String ) { if ( ! ( canManageACL ( ) ) ) { throw new org . pentaho . platform . api . engine . PentahoAccessControlException ( ) ; } java . util . Map < java . lang . String , java . io . InputStream > fileData = getMetadataFiles ( dswId ) ; org . pentaho . metadata . model . Domain domain = metadataDomainRepository . getDomain ( dswId ) ; org . pentaho . agilebi . modeler . ModelerWorkspace model = createModelerWorkspace ( ) ; model . setDomain ( domain ) ; org . pentaho . metadata . model . LogicalModel logicalModel = model . getLogicalModel ( ModelerPerspective . ANALYSIS ) ; if ( logicalModel == null ) { logicalModel = model . getLogicalModel ( ModelerPerspective . REPORTING ) ; } if ( ( logicalModel . getProperty ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardService . MONDRIAN_CATALOG_REF ) ) != null ) { org . pentaho . platform . plugin . services . importexport . legacy . MondrianCatalogRepositoryHelper helper = createMondrianCatalogRepositoryHelper ( ) ; java . lang . String catalogRef = ( ( java . lang . String ) ( logicalModel . getProperty ( org . pentaho . platform . dataaccess . datasource . api . DataSourceWizardService . MONDRIAN_CATALOG_REF ) ) ) ; fileData . putAll ( helper . getModrianSchemaFiles ( catalogRef ) ) ; parseMondrianSchemaNameWrapper ( dswId , fileData ) ; } return fileData ; } | org . junit . Assert . assertEquals ( mockFileData , response ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.