input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testDelegatorWithSuperclass ( ) { net . neoremind . dynamicproxy . sample . Echo echo = factory . createDelegatorProxy ( new net . neoremind . dynamicproxy . provider . ConstantProvider < net . neoremind . dynamicproxy . sample . EchoImpl > ( new net . neoremind . dynamicproxy . sample . EchoImpl ( ) ) , new java . lang . Class [ ] { net . neoremind . dynamicproxy . sample . Echo . class , net . neoremind . dynamicproxy . sample . EchoImpl . class } ) ; "<AssertPlaceHolder>" ; } createDelegatorProxy ( java . lang . ClassLoader , net . neoremind . dynamicproxy . ObjectProvider , net . neoremind . dynamicproxy . Class [ ] ) { @ net . neoremind . dynamicproxy . SuppressWarnings ( "unchecked" ) T result = ( ( T ) ( getCapableProxyCreator ( proxyClasses ) . createDelegatorProxy ( classLoader , delegateProvider , proxyClasses ) ) ) ; return result ; } | org . junit . Assert . assertTrue ( ( echo instanceof net . neoremind . dynamicproxy . sample . EchoImpl ) ) |
sendPingTCPProbe ( ) { net . tomp2p . p2p . Peer sender = null ; net . tomp2p . connection . ChannelCreator cc = null ; try { net . tomp2p . peers . PeerAddress pa = net . tomp2p . peers . PeerAddress . create ( Number160 . ZERO , java . net . Inet4Address . getByName ( net . tomp2p . rpc . TestRealPing . IP ) , net . tomp2p . rpc . TestRealPing . PORT , net . tomp2p . rpc . TestRealPing . PORT , ( ( net . tomp2p . rpc . TestRealPing . PORT ) + 1 ) ) ; sender = new net . tomp2p . p2p . PeerBuilder ( new net . tomp2p . peers . Number160 ( "0x9876" ) ) . ports ( net . tomp2p . rpc . TestRealPing . PORT ) . enableMaintenance ( false ) . start ( ) ; net . tomp2p . rpc . PingRPC handshake = new net . tomp2p . rpc . PingRPC ( sender . peerBean ( ) , sender . connectionBean ( ) ) ; net . tomp2p . futures . FutureChannelCreator fcc = sender . connectionBean ( ) . reservation ( ) . create ( 0 , 1 ) ; fcc . awaitUninterruptibly ( ) ; cc = fcc . channelCreator ( ) ; net . tomp2p . futures . FutureResponse fr = handshake . pingTCPProbe ( pa , cc , new net . tomp2p . connection . DefaultConnectionConfiguration ( ) ) ; fr . awaitUninterruptibly ( ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( net . tomp2p . rpc . TestRealPing . WAIT ) ; } finally { if ( cc != null ) { cc . shutdown ( ) . await ( ) ; } if ( sender != null ) { sender . shutdown ( ) . await ( ) ; } } } isSuccess ( ) { if ( ! ( super . isSuccess ( ) ) ) { return false ; } return checkResults ( result ( ) , rawResult . size ( ) , dataSize ) ; } | org . junit . Assert . assertEquals ( true , fr . isSuccess ( ) ) |
testAtLeastOneThreadExists ( ) { "<AssertPlaceHolder>" ; } getAllThreads ( ) { return org . apache . commons . lang3 . ThreadUtils . findThreads ( org . apache . commons . lang3 . ThreadUtils . ALWAYS_TRUE_PREDICATE ) ; } | org . junit . Assert . assertTrue ( ( ( org . apache . commons . lang3 . ThreadUtils . getAllThreads ( ) . size ( ) ) > 0 ) ) |
testCorrectePeriode ( ) { java . util . List < nl . bzk . brp . model . validatie . Melding > meldingen = brby0904 . executeer ( null , maakPersoonOverlijden ( maakLand ( "24" , "land" , 19000101 , null ) , 19000101 ) , maakActie ( "id.actie1" , 19000101 , null ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) ) |
testParseResponseCapEmpty ( ) { "<AssertPlaceHolder>" ; } parseResponseCaps ( java . lang . String ) { final java . util . LinkedList < com . ircclouds . irc . api . negotiators . CompositeNegotiator . Cap > caps = new java . util . LinkedList < com . ircclouds . irc . api . negotiators . CompositeNegotiator . Cap > ( ) ; for ( java . lang . String capdesc : responseText . split ( "\\s+" ) ) { if ( capdesc . isEmpty ( ) ) { continue ; } caps . add ( new com . ircclouds . irc . api . negotiators . CompositeNegotiator . Cap ( capdesc ) ) ; } return caps ; } | org . junit . Assert . assertEquals ( java . util . Collections . emptyList ( ) , com . ircclouds . irc . api . negotiators . CompositeNegotiator . parseResponseCaps ( "" ) ) |
verifyEnrichment ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( resources ) |
testShouldParseValidStringToEnumIgnoringCase ( ) { final org . apache . flink . configuration . ConfigOption < java . lang . String > configOption = org . apache . flink . configuration . ConfigurationTest . createStringConfigOption ( ) ; final org . apache . flink . configuration . Configuration configuration = new org . apache . flink . configuration . Configuration ( ) ; configuration . setString ( configOption . key ( ) , org . apache . flink . configuration . ConfigurationTest . TestEnum . VALUE1 . toString ( ) . toLowerCase ( ) ) ; final org . apache . flink . configuration . ConfigurationTest . TestEnum parsedEnumValue = configuration . getEnum ( org . apache . flink . configuration . ConfigurationTest . TestEnum . class , configOption ) ; "<AssertPlaceHolder>" ; } getEnum ( java . lang . Class , org . apache . flink . configuration . ConfigOption ) { checkNotNull ( enumClass , "enumClass<sp>must<sp>not<sp>be<sp>null" ) ; checkNotNull ( configOption , "configOption<sp>must<sp>not<sp>be<sp>null" ) ; final java . lang . String configValue = getString ( configOption ) ; try { return java . lang . Enum . valueOf ( enumClass , configValue . toUpperCase ( Locale . ROOT ) ) ; } catch ( java . lang . IllegalArgumentException | java . lang . NullPointerException e ) { final java . lang . String errorMessage = java . lang . String . format ( "Value<sp>for<sp>config<sp>option<sp>%s<sp>must<sp>be<sp>one<sp>of<sp>%s<sp>(was<sp>%s)" , configOption . key ( ) , java . util . Arrays . toString ( enumClass . getEnumConstants ( ) ) , configValue ) ; throw new java . lang . IllegalArgumentException ( errorMessage , e ) ; } } | org . junit . Assert . assertEquals ( org . apache . flink . configuration . ConfigurationTest . TestEnum . VALUE1 , parsedEnumValue ) |
testClose ( ) { org . jboss . jbossts . xts . bytemanSupport . participantCompletion . ParticipantCompletionCoordinatorRules . setParticipantCount ( 1 ) ; com . arjuna . mw . wst11 . UserBusinessActivity uba = com . arjuna . mw . wst11 . UserBusinessActivity . getUserBusinessActivity ( ) ; com . arjuna . mw . wst11 . BusinessActivityManager bam = com . arjuna . mw . wst11 . BusinessActivityManager . getBusinessActivityManager ( ) ; com . arjuna . wst11 . BAParticipantManager bpm = null ; com . arjuna . wstx . tests . common . DemoBusinessParticipant p = new com . arjuna . wstx . tests . common . DemoBusinessParticipant ( com . arjuna . wstx . tests . common . DemoBusinessParticipant . CLOSE , "1235" ) ; try { uba . begin ( ) ; bpm = bam . enlistForBusinessAgreementWithParticipantCompletion ( p , p . identifier ( ) ) ; bpm . completed ( ) ; } catch ( java . lang . Exception eouter ) { try { uba . cancel ( ) ; } catch ( java . lang . Exception einner ) { } throw eouter ; } uba . close ( ) ; "<AssertPlaceHolder>" ; } passed ( ) { return _passed ; } | org . junit . Assert . assertTrue ( p . passed ( ) ) |
testGetParametersWithDefaultEntity ( ) { org . lnu . is . domain . employee . type . EmployeeType entity = new org . lnu . is . domain . employee . type . EmployeeType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testAddNullAttribute ( ) { java . util . ArrayList < com . amazonaws . services . simpledb . model . ReplaceableAttribute > attributes = new java . util . ArrayList < com . amazonaws . services . simpledb . model . ReplaceableAttribute > ( ) ; simpleDbApi . addAttribute ( "x" , null , attributes ) ; "<AssertPlaceHolder>" ; } get ( int ) { rangeCheck ( index , false ) ; return ( ( T ) ( elementData [ index ] ) ) ; } | org . junit . Assert . assertNull ( attributes . get ( 0 ) . getValue ( ) ) |
testZSS816 ( ) { long duration = 15 * 1000 ; long t1 = new java . util . Date ( ) . getTime ( ) ; getTo ( "issue3/818-formula-update.zul" ) ; long t2 = new java . util . Date ( ) . getTime ( ) ; "<AssertPlaceHolder>" ; } getTo ( java . lang . String ) { url = normalizeTestUrl ( url ) ; driver ( ) . get ( url ) ; waitUntilProcessEnd ( 1000 ) ; ( ( org . openqa . selenium . remote . RemoteWebDriver ) ( driver ( ) ) ) . executeScript ( ( ( "zsstsDebug<sp>=<sp>" + ( org . zkoss . zss . test . selenium . Setup . isJsDebug ( ) ) ) + ";" ) ) ; java . lang . String agentJs = org . zkoss . zss . test . selenium . AgentScripts . instance ( ) . getScript ( ) ; ( ( org . openqa . selenium . remote . RemoteWebDriver ) ( driver ( ) ) ) . executeScript ( agentJs ) ; eval ( "jq(window).error(function(){zk._Erbx.push('js<sp>error...')})" ) ; } | org . junit . Assert . assertTrue ( ( ( t2 - t1 ) < duration ) ) |
testCase63 ( ) { org . evosuite . testcase . DefaultTestCase tc = buildTestCase63 ( ) ; java . util . List < org . evosuite . symbolic . BranchCondition > branch_conditions = executeTest ( tc ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; } | org . junit . Assert . assertEquals ( 5 , branch_conditions . size ( ) ) |
RgroupSymbolNumberedPrime ( ) { org . openscience . cdk . renderer . generators . standard . AtomSymbol atomSymbol = atomGenerator . generatePseudoSymbol ( "R2'" , HydrogenPosition . Right ) ; java . util . List < java . awt . Shape > shapes = atomSymbol . getOutlines ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; } | org . junit . Assert . assertThat ( shapes . size ( ) , org . hamcrest . CoreMatchers . is ( 3 ) ) |
testRetryableFalseResult ( ) { setupTask ( new com . sun . sgs . impl . kernel . schedule . TestImmediateRetryPolicy . RetryableException ( false ) ) ; org . easymock . EasyMock . expect ( task . isRecurring ( ) ) . andStubReturn ( true ) ; replayMocks ( ) ; com . sun . sgs . kernel . schedule . SchedulerRetryAction action = policy . getRetryAction ( task ) ; "<AssertPlaceHolder>" ; verifyMocks ( ) ; } getRetryAction ( com . sun . sgs . kernel . schedule . ScheduledTask ) { if ( task == null ) { throw new java . lang . IllegalArgumentException ( "task<sp>cannot<sp>be<sp>null" ) ; } java . lang . Throwable result = task . getLastFailure ( ) ; if ( result == null ) { throw new java . lang . IllegalStateException ( ( "task's<sp>last<sp>failure<sp>" + "cannot<sp>be<sp>null" ) ) ; } if ( ( result instanceof com . sun . sgs . app . ExceptionRetryStatus ) && ( ( ( com . sun . sgs . app . ExceptionRetryStatus ) ( result ) ) . shouldRetry ( ) ) ) { if ( ( task . getTryCount ( ) ) > ( retryBackoffThreshold ) ) { if ( ( result instanceof com . sun . sgs . app . TransactionTimeoutException ) && ( ( ( task . getTimeout ( ) ) * 2L ) < ( ( long ) ( Integer . MAX_VALUE ) ) ) ) { com . sun . sgs . impl . kernel . schedule . NowOrLaterRetryPolicy . logger . logThrow ( Level . WARNING , task . getLastFailure ( ) , ( "Task<sp>has<sp>been<sp>retried<sp>{0}<sp>times:<sp>{1}\n" + ( "Increasing<sp>its<sp>timeout<sp>to<sp>{2}<sp>ms<sp>and<sp>" + "scheduling<sp>its<sp>retry<sp>for<sp>later" ) ) , task . getTryCount ( ) , task , ( ( task . getTimeout ( ) ) * 2 ) ) ; task . setTimeout ( ( ( task . getTimeout ( ) ) * 2 ) ) ; } else { com . sun . sgs . impl . kernel . schedule . NowOrLaterRetryPolicy . logger . logThrow ( Level . WARNING , task . getLastFailure ( ) , ( "Task<sp>has<sp>been<sp>retried<sp>{0}<sp>times:<sp>{1}\n" + "scheduling<sp>its<sp>retry<sp>for<sp>later" ) , task . getTryCount ( ) , task ) ; } return com . sun . sgs . kernel . schedule . SchedulerRetryAction . RETRY_LATER ; } else { return com . sun . sgs . kernel . schedule . SchedulerRetryAction . RETRY_NOW ; } } else { if ( com . sun . sgs . impl . kernel . schedule . NowOrLaterRetryPolicy . logger . isLoggable ( Level . FINE ) ) { if ( task . isRecurring ( ) ) { com . sun . sgs . impl . kernel . schedule . NowOrLaterRetryPolicy . logger . log ( Level . FINE , ( "skipping<sp>a<sp>recurrence<sp>of<sp>a<sp>task<sp>because<sp>it<sp>" + "failed<sp>with<sp>a<sp>non-retryable<sp>exception:<sp>{0}" ) , task ) ; } else { com . sun . sgs . impl . kernel . schedule . NowOrLaterRetryPolicy . logger . log ( Level . FINE , ( "dropping<sp>a<sp>task<sp>because<sp>it<sp>failed<sp>with<sp>a<sp>" + "non-retryable<sp>exception:<sp>{0}" ) , task ) ; } } return com . sun . sgs . kernel . schedule . SchedulerRetryAction . DROP ; } } | org . junit . Assert . assertEquals ( SchedulerRetryAction . DROP , action ) |
filterTest ( ) { java . lang . Integer [ ] a = new cn . hutool . core . util . Integer [ ] { 1 , 2 , 3 , 4 , 5 , 6 } ; java . lang . Integer [ ] filter = cn . hutool . core . util . ArrayUtil . filter ( a , new cn . hutool . core . lang . Editor < java . lang . Integer > ( ) { @ cn . hutool . core . util . Override public cn . hutool . core . util . Integer edit ( java . lang . Integer t ) { return ( t % 2 ) == 0 ? t : null ; } } ) ; "<AssertPlaceHolder>" ; } edit ( java . lang . String ) { return t + 1 ; } | org . junit . Assert . assertArrayEquals ( filter , new java . lang . Integer [ ] { 2 , 4 , 6 } ) |
emptyPathIteratorTest ( ) { com . beijunyi . parallelgit . filesystem . GitPath path = gfs . getPath ( "" ) ; java . util . Iterator < java . nio . file . Path > it = path . iterator ( ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( ( next ) != null ) || ( findNext ( ) ) ; } | org . junit . Assert . assertFalse ( it . hasNext ( ) ) |
addServiceTest ( ) { org . pentaho . platform . settings . ServerPortRegistry . clear ( ) ; org . pentaho . platform . settings . Service service = new org . pentaho . platform . settings . Service ( "foo" , "foo<sp>description" ) ; org . pentaho . platform . settings . ServerPortRegistry . addService ( service ) ; org . pentaho . platform . settings . Service readService = org . pentaho . platform . settings . ServerPortRegistry . getService ( "foo" ) ; "<AssertPlaceHolder>" ; } getServiceDescription ( ) { return serviceDescription ; } | org . junit . Assert . assertEquals ( service . getServiceDescription ( ) , readService . getServiceDescription ( ) ) |
shouldFailAndAlertFor409Status ( ) { when ( client . postEntryWithToken ( org . mockito . Matchers . any ( ) , org . mockito . Matchers . < java . lang . String > any ( ) ) ) . thenReturn ( response ) ; when ( response . getStatus ( ) ) . thenReturn ( 409 ) ; ahelper . handleUsageRecord ( baseUsage , token , emap ) ; "<AssertPlaceHolder>" ; verify ( alertRepository , times ( 1 ) ) . save ( org . mockito . Matchers . < org . openstack . atlas . service . domain . events . entities . Alert > any ( ) ) ; verify ( loadBalancerEventRepository , times ( 1 ) ) . save ( org . mockito . Matchers . < org . openstack . atlas . service . domain . events . entities . LoadBalancerServiceEvent > any ( ) ) ; } getFailedRecords ( ) { return failedRecords ; } | org . junit . Assert . assertEquals ( 1 , ahelper . getFailedRecords ( ) . size ( ) ) |
testCoordinateDimensionGeometryCollectionEmpty ( ) { org . locationtech . jts . geom . Geometry geom = org . geotools . geometry . jts . coordinatesequence . CoordinateSequencesTest . gf . createGeometryCollection ( new org . locationtech . jts . geom . Geometry [ 0 ] ) ; "<AssertPlaceHolder>" ; } coordinateDimension ( org . locationtech . jts . geom . Geometry ) { if ( g instanceof org . geotools . geometry . jts . CurvedGeometry < ? > ) { return ( ( org . geotools . geometry . jts . CurvedGeometry < ? > ) ( g ) ) . getCoordinatesDimension ( ) ; } if ( g instanceof org . locationtech . jts . geom . Point ) return org . geotools . geometry . jts . coordinatesequence . CoordinateSequences . coordinateDimension ( ( ( org . locationtech . jts . geom . Point ) ( g ) ) . getCoordinateSequence ( ) ) ; if ( g instanceof org . locationtech . jts . geom . LineString ) return org . geotools . geometry . jts . coordinatesequence . CoordinateSequences . coordinateDimension ( ( ( org . locationtech . jts . geom . LineString ) ( g ) ) . getCoordinateSequence ( ) ) ; if ( g instanceof org . locationtech . jts . geom . Polygon ) return org . geotools . geometry . jts . coordinatesequence . CoordinateSequences . coordinateDimension ( ( ( org . locationtech . jts . geom . Polygon ) ( g ) ) . getExteriorRing ( ) . getCoordinateSequence ( ) ) ; org . locationtech . jts . geom . CoordinateSequence cs = org . geotools . geometry . jts . coordinatesequence . CoordinateSequences . CoordinateSequenceFinder . find ( g ) ; return org . geotools . geometry . jts . coordinatesequence . CoordinateSequences . coordinateDimension ( cs ) ; } | org . junit . Assert . assertEquals ( 3 , org . geotools . geometry . jts . coordinatesequence . CoordinateSequences . coordinateDimension ( geom ) ) |
identifierExpression ( ) { io . burt . jmespath . Expression < java . lang . Object > expected = Property ( "foo" ) ; io . burt . jmespath . Expression < java . lang . Object > actual = compile ( "foo" ) ; "<AssertPlaceHolder>" ; } compile ( java . lang . String ) { return runtime . compile ( str ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) ) |
testSimpleWrappedMethods ( ) { net . roboconf . messaging . api . extensions . IMessagingClient messagingClient = org . mockito . Mockito . mock ( net . roboconf . messaging . api . extensions . IMessagingClient . class ) ; net . roboconf . messaging . api . internal . jmx . JmxWrapperForMessagingClient client = new net . roboconf . messaging . api . internal . jmx . JmxWrapperForMessagingClient ( messagingClient ) ; client . closeConnection ( ) ; client . deleteMessagingServerArtifacts ( org . mockito . Mockito . mock ( net . roboconf . core . model . beans . Application . class ) ) ; "<AssertPlaceHolder>" ; client . openConnection ( ) ; client . subscribe ( org . mockito . Mockito . mock ( net . roboconf . messaging . api . extensions . MessagingContext . class ) ) ; client . unsubscribe ( org . mockito . Mockito . mock ( net . roboconf . messaging . api . extensions . MessagingContext . class ) ) ; org . mockito . Mockito . verify ( messagingClient ) . closeConnection ( ) ; org . mockito . Mockito . verify ( messagingClient ) . deleteMessagingServerArtifacts ( org . mockito . Mockito . any ( net . roboconf . core . model . beans . Application . class ) ) ; org . mockito . Mockito . verify ( messagingClient ) . getConfiguration ( ) ; org . mockito . Mockito . verify ( messagingClient ) . openConnection ( ) ; org . mockito . Mockito . verify ( messagingClient ) . subscribe ( org . mockito . Mockito . any ( net . roboconf . messaging . api . extensions . MessagingContext . class ) ) ; org . mockito . Mockito . verify ( messagingClient ) . unsubscribe ( org . mockito . Mockito . any ( net . roboconf . messaging . api . extensions . MessagingContext . class ) ) ; org . mockito . Mockito . verifyNoMoreInteractions ( messagingClient ) ; } getConfiguration ( ) { return java . util . Collections . singletonMap ( MessagingConstants . MESSAGING_TYPE_PROPERTY , MessagingConstants . FACTORY_TEST ) ; } | org . junit . Assert . assertEquals ( 0 , client . getConfiguration ( ) . size ( ) ) |
deleteFunctionWhenOverwrittenByFunctionShouldThrowException ( ) { functionA_ID_4 . overwrite ( functionA_ID_3 ) ; functionA_ID_3 . setResource ( resource ) ; "<AssertPlaceHolder>" ; when ( functionRepositoryMock . find ( ch . puzzle . itc . mobiliar . business . function . boundary . FunctionsBoundaryTest . ID_3 ) ) . thenReturn ( functionA_ID_3 ) ; functionsBoundary . deleteFunction ( functionA_ID_3 . getId ( ) ) ; } isOverwrittenBySubTypeOrResourceFunction ( ) { return ! ( getOverwritingChildFunction ( ) . isEmpty ( ) ) ; } | org . junit . Assert . assertTrue ( functionA_ID_3 . isOverwrittenBySubTypeOrResourceFunction ( ) ) |
Property ( ) { java . lang . String testENTITY = "testEntity" ; org . odata4j . edm . EdmEntityType . Builder entityType = EntityType ( testENTITY ) ; EntityTypesimpleProperty ( 400 , entityType ) ; org . odata4j . edm . EdmDataServices . Builder builder = org . odata4j . edm . EdmDataServices . newBuilder ( ) ; org . odata4j . edm . EdmSchema . Builder schema = org . odata4j . edm . EdmSchema . newBuilder ( ) . addEntityTypes ( entityType ) . setNamespace ( com . fujitsu . dc . test . unit . core . model . impl . es . odata . PropertyLimitCheckerTest . NS ) ; org . odata4j . edm . EdmDataServices metadata = builder . addSchemas ( schema ) . build ( ) ; com . fujitsu . dc . core . model . impl . es . doc . PropertyDocHandler handler = new com . fujitsu . dc . core . model . impl . es . doc . PropertyDocHandler ( ) ; org . json . simple . JSONObject staticFields = new org . json . simple . JSONObject ( ) ; staticFields . put ( "Type" , "Edm.String" ) ; handler . setStaticFields ( staticFields ) ; java . util . Map < java . lang . String , java . lang . String > entityTypeMap = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; entityTypeMap . put ( "_EntityType.Name_uniqueKey" , testENTITY ) ; handler . setEntityTypeMap ( entityTypeMap ) ; handler . setEntityTypeId ( "_uniqueKey" ) ; java . util . Map < java . lang . String , java . lang . Object > manyToOneKindMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; manyToOneKindMap . put ( EntityType . EDM_TYPE_NAME , "_uniqueKey" ) ; handler . setManyToOnelinkId ( manyToOneKindMap ) ; com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker checker = new com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker ( metadata , handler ) ; java . util . List < com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError > errors = checker . checkPropertyLimits ( ) ; "<AssertPlaceHolder>" ; } checkPropertyLimits ( ) { java . util . List < com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError > result = new java . util . ArrayList < com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError > ( ) ; if ( null == ( metadata ) ) { return result ; } java . util . Iterator < org . odata4j . edm . EdmEntityType > iter = metadata . getEntityTypes ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { org . odata4j . edm . EdmEntityType target = iter . next ( ) ; checkPropertyLimitsForEntityTypeInternal ( result , target ) ; } java . util . Iterator < org . odata4j . edm . EdmComplexType > complexTypeIter = metadata . getComplexTypes ( ) . iterator ( ) ; while ( complexTypeIter . hasNext ( ) ) { int simplePropCount = 0 ; int complexPropCount = 0 ; org . odata4j . edm . EdmComplexType complexType = complexTypeIter . next ( ) ; for ( org . odata4j . edm . EdmProperty prop : complexType . getProperties ( ) ) { if ( prop . getName ( ) . startsWith ( "_" ) ) { continue ; } if ( prop . getType ( ) . isSimple ( ) ) { simplePropCount ++ ; } else { complexPropCount ++ ; } } if ( ( simpleMaxForOverAllLayers ) < simplePropCount ) { java . lang . String message = java . lang . String . format ( "Total<sp>property[%s]<sp>count<sp>exceeds<sp>the<sp>limit[%d]." , complexType . getName ( ) , simpleMaxForOverAllLayers ) ; com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . log . info ( message ) ; result . add ( new com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError ( complexType . getName ( ) , message ) ) ; } if ( ( complexMaxForOverallLayers ) < complexPropCount ) { java . lang . String message = java . lang . String . format ( "Total<sp>property[%s]<sp>count<sp>exceeds<sp>the<sp>limit[%d]." , complexType . getName ( ) , complexMaxForOverallLayers ) ; com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . log . info ( message ) ; result . add ( new com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError ( complexType . getName ( ) , message ) ) ; } } return result ; } | org . junit . Assert . assertEquals ( 1 , errors . size ( ) ) |
testPutBatchRecords ( ) { com . streamsets . pipeline . api . service . dataformats . DataFormatGeneratorService dataFormatGeneratorService = org . mockito . Mockito . mock ( com . streamsets . pipeline . api . service . dataformats . DataFormatGeneratorService . class ) ; try { org . mockito . Mockito . when ( dataFormatGeneratorService . getGenerator ( org . mockito . Mockito . any ( ) ) ) . thenReturn ( org . mockito . Mockito . mock ( com . streamsets . pipeline . api . service . dataformats . DataGenerator . class ) ) ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( ) ; } org . mockito . Mockito . when ( context . getService ( com . streamsets . pipeline . api . service . dataformats . DataFormatGeneratorService . class ) ) . thenReturn ( dataFormatGeneratorService ) ; org . mockito . Mockito . when ( context . createELEval ( org . mockito . Mockito . any ( ) ) ) . thenReturn ( org . mockito . Mockito . mock ( com . streamsets . pipeline . api . el . ELEval . class ) ) ; org . mockito . Mockito . when ( context . createELVars ( ) ) . thenReturn ( org . mockito . Mockito . mock ( com . streamsets . pipeline . api . el . ELVars . class ) ) ; try { com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducerImpl pulsarMessageProducer = new com . streamsets . pipeline . stage . destination . pulsar . PulsarMessageProducerImpl ( com . streamsets . pipeline . stage . Utils . TestUtilsPulsar . getTargetConfig ( ) , context ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = pulsarMessageProducer . init ( context ) ; "<AssertPlaceHolder>" ; org . apache . pulsar . client . api . TypedMessageBuilder typedMessageBuilderMock = org . mockito . Mockito . mock ( org . apache . pulsar . client . api . TypedMessageBuilder . class ) ; org . mockito . Mockito . when ( typedMessageBuilderMock . key ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( typedMessageBuilderMock ) ; org . mockito . Mockito . when ( typedMessageBuilderMock . value ( org . mockito . Mockito . any ( ) ) ) . thenReturn ( typedMessageBuilderMock ) ; org . apache . pulsar . client . api . Producer producerMock = org . mockito . Mockito . mock ( org . apache . pulsar . client . api . Producer . class ) ; org . mockito . Mockito . when ( producerMock . newMessage ( ) ) . thenReturn ( typedMessageBuilderMock ) ; com . google . common . cache . LoadingCache < java . lang . String , org . apache . pulsar . client . api . Producer > messageProducersMock = org . mockito . Mockito . mock ( com . google . common . cache . LoadingCache . class ) ; org . mockito . Mockito . when ( messageProducersMock . get ( org . mockito . Mockito . any ( ) ) ) . thenReturn ( producerMock ) ; pulsarMessageProducer . setMessageProducers ( messageProducersMock ) ; com . streamsets . pipeline . api . Batch batch = com . streamsets . pipeline . stage . Utils . TestUtilsPulsar . getBatch ( ) ; pulsarMessageProducer . put ( batch ) ; } catch ( com . streamsets . pipeline . api . StageException e ) { org . junit . Assert . fail ( ) ; } catch ( java . util . concurrent . ExecutionException e ) { org . junit . Assert . fail ( ) ; } } isEmpty ( ) { return false ; } | org . junit . Assert . assertTrue ( issues . isEmpty ( ) ) |
zouGeenRelatieMoetenVerbrekenOmdatRelatieAlVerbrokenIs ( ) { nl . bzk . brp . model . objecttype . operationeel . BetrokkenheidModel betrokkenheid = mock ( nl . bzk . brp . model . objecttype . operationeel . BetrokkenheidModel . class ) ; nl . bzk . brp . model . objecttype . operationeel . RelatieModel relatieModel = mock ( nl . bzk . brp . model . objecttype . operationeel . RelatieModel . class ) ; nl . bzk . brp . model . groep . operationeel . actueel . RelatieStandaardGroepModel relatieStandaardGroep = mock ( nl . bzk . brp . model . groep . operationeel . actueel . RelatieStandaardGroepModel . class ) ; java . util . Set < nl . bzk . brp . model . objecttype . operationeel . BetrokkenheidModel > betrokkenheden = new java . util . HashSet < nl . bzk . brp . model . objecttype . operationeel . BetrokkenheidModel > ( ) ; betrokkenheden . add ( betrokkenheid ) ; when ( persoonModel . heeftBetrokkenheden ( ) ) . thenReturn ( true ) ; when ( persoonModel . getBetrokkenheden ( ) ) . thenReturn ( betrokkenheden ) ; when ( betrokkenheid . getRelatie ( ) ) . thenReturn ( relatieModel ) ; when ( relatieModel . getSoort ( ) ) . thenReturn ( SoortRelatie . HUWELIJK ) ; when ( relatieModel . getGegevens ( ) ) . thenReturn ( relatieStandaardGroep ) ; when ( relatieStandaardGroep . getDatumEinde ( ) ) . thenReturn ( nl . bzk . brp . util . DatumUtil . gisteren ( ) ) ; vr00012 . executeer ( persoonModel , persoonBericht , null ) ; "<AssertPlaceHolder>" ; } getBetrokkenheden ( ) { return betrokkenheden ; } | org . junit . Assert . assertNull ( persoonBericht . getBetrokkenheden ( ) ) |
testProcessUninstalledBundleAndPopulateTaskListWhenUninstalled ( ) { org . mockito . Mockito . doReturn ( org . osgi . framework . Bundle . UNINSTALLED ) . when ( bundle ) . getState ( ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( tasks , org . mockito . Mockito . never ( ) ) . add ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . eq ( org . codice . ddf . admin . application . service . migratable . BundleProcessorTest . NAME_VERSION ) , org . mockito . Mockito . notNull ( ) ) ; org . mockito . Mockito . verify ( bundleProcessor , org . mockito . Mockito . never ( ) ) . installBundle ( context , report , bundle ) ; org . mockito . Mockito . verify ( bundleProcessor , org . mockito . Mockito . never ( ) ) . startBundle ( report , bundle ) ; org . mockito . Mockito . verify ( bundleProcessor , org . mockito . Mockito . never ( ) ) . stopBundle ( report , bundle ) ; } processUninstalledBundleAndPopulateTaskList ( org . osgi . framework . Bundle , org . codice . ddf . admin . application . service . migratable . TaskList ) { final org . codice . ddf . admin . application . service . migratable . JsonBundle . SimpleState state = org . codice . ddf . admin . application . service . migratable . JsonBundle . getSimpleState ( bundle ) ; if ( state != ( JsonBundle . SimpleState . UNINSTALLED ) ) { final java . lang . String name = org . codice . ddf . admin . application . service . migratable . JsonBundle . getFullName ( bundle ) ; tasks . add ( Operation . UNINSTALL , name , ( r ) -> uninstallBundle ( r , bundle ) ) ; return true ; } return false ; } | org . junit . Assert . assertThat ( bundleProcessor . processUninstalledBundleAndPopulateTaskList ( bundle , tasks ) , org . hamcrest . Matchers . equalTo ( false ) ) |
shouldIgnoreStartSuiteLineThatContainsFullPath ( ) { java . lang . String line = "Test<sp>Suite<sp>'/Users/ray/Development/Projects/Java/xcodebuild-hudson-plugin/work/jobs/PBS<sp>Streamer/workspace/build/Debug-iphonesimulator/TestSuite.octest(Tests)'<sp>started<sp>at<sp>2010-10-02<sp>13:39:22<sp>GMT<sp>0000" ; parser . handleLine ( line ) ; "<AssertPlaceHolder>" ; } handleLine ( java . lang . String ) { java . util . regex . Matcher m = au . com . rayh . XCodeBuildOutputParser . START_SUITE . matcher ( line ) ; if ( m . matches ( ) ) { currentTestSuite = new au . com . rayh . report . TestSuite ( java . net . InetAddress . getLocalHost ( ) . getHostName ( ) , m . group ( 1 ) , au . com . rayh . XCodeBuildOutputParser . dateFormat . parse ( m . group ( 2 ) ) ) ; return ; } m = au . com . rayh . XCodeBuildOutputParser . END_SUITE . matcher ( line ) ; if ( m . matches ( ) ) { if ( ( currentTestSuite ) == null ) return ; currentTestSuite . setEndTime ( au . com . rayh . XCodeBuildOutputParser . dateFormat . parse ( m . group ( 2 ) ) ) ; writeTestReport ( ) ; currentTestSuite = null ; return ; } m = au . com . rayh . XCodeBuildOutputParser . START_TESTCASE . matcher ( line ) ; if ( m . matches ( ) ) { currentTestCase = new au . com . rayh . report . TestCase ( currentTestSuite . getName ( ) , m . group ( 1 ) ) ; return ; } m = au . com . rayh . XCodeBuildOutputParser . END_TESTCASE . matcher ( line ) ; if ( m . matches ( ) ) { requireTestSuite ( ) ; requireTestCase ( m . group ( 1 ) ) ; currentTestCase . setTime ( java . lang . Float . valueOf ( m . group ( 2 ) ) ) ; currentTestSuite . getTestCases ( ) . add ( currentTestCase ) ; currentTestSuite . addTest ( ) ; currentTestCase = null ; return ; } m = au . com . rayh . XCodeBuildOutputParser . ERROR_TESTCASE . matcher ( line ) ; if ( m . matches ( ) ) { java . lang . String errorLocation = m . group ( 1 ) ; java . lang . String testSuite = m . group ( 2 ) ; java . lang . String testCase = m . group ( 3 ) ; java . lang . String errorMessage = m . group ( 4 ) ; requireTestSuite ( testSuite ) ; requireTestCase ( testCase ) ; au . com . rayh . report . TestFailure failure = new au . com . rayh . report . TestFailure ( errorMessage , errorLocation ) ; currentTestCase . getFailures ( ) . add ( failure ) ; return ; } m = au . com . rayh . XCodeBuildOutputParser . FAILED_TESTCASE . matcher ( line ) ; if ( m . matches ( ) ) { requireTestSuite ( ) ; requireTestCase ( m . group ( 1 ) ) ; currentTestSuite . addTest ( ) ; currentTestSuite . addFailure ( ) ; currentTestCase . setTime ( java . lang . Float . valueOf ( m . group ( 2 ) ) ) ; currentTestSuite . getTestCases ( ) . add ( currentTestCase ) ; currentTestCase = null ; return ; } m = au . com . rayh . XCodeBuildOutputParser . FAILED_WITH_EXIT_CODE . matcher ( line ) ; if ( m . matches ( ) ) { exitCode = java . lang . Integer . valueOf ( m . group ( 1 ) ) ; return ; } if ( line . matches ( "BUILD<sp>FAILED" ) ) { exitCode = - 1 ; } } | org . junit . Assert . assertNull ( parser . currentTestSuite ) |
shouldCatchUnexpectedError ( ) { when ( tvMazeHandlerMock . getInfos ( anyString ( ) , eq ( InfoProvider . IdType . TVDB ) ) ) . thenThrow ( org . nzbhydra . mediainfo . IllegalArgumentException . class ) ; try { testee . convert ( "" , InfoProvider . IdType . TVDB ) ; org . junit . Assert . fail ( "Should've<sp>failed" ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } convert ( java . lang . String , org . nzbhydra . mediainfo . InfoProvider$IdType ) { if ( value == null ) { throw new org . nzbhydra . mediainfo . InfoProviderException ( ( ( "Unable<sp>to<sp>convert<sp>IDType<sp>" + fromType ) + "<sp>with<sp>null<sp>value" ) ) ; } org . nzbhydra . mediainfo . InfoProvider . logger . debug ( "Conversion<sp>of<sp>{}<sp>ID<sp>{}<sp>requested" , fromType , value ) ; try { org . nzbhydra . mediainfo . MediaInfo info ; switch ( fromType ) { case IMDB : if ( ! ( value . startsWith ( "tt" ) ) ) { value = "tt" + value ; } case TMDB : case MOVIETITLE : org . nzbhydra . mediainfo . MovieInfo movieInfo ; if ( fromType == ( org . nzbhydra . mediainfo . InfoProvider . IdType . TMDB ) ) { movieInfo = movieInfoRepository . findByTmdbId ( value ) ; } else if ( fromType == ( org . nzbhydra . mediainfo . InfoProvider . IdType . IMDB ) ) { movieInfo = movieInfoRepository . findByImdbId ( value ) ; } else { movieInfo = movieInfoRepository . findByTitle ( value ) ; } if ( movieInfo != null ) { info = new org . nzbhydra . mediainfo . MediaInfo ( movieInfo ) ; } else { org . nzbhydra . mediainfo . TmdbSearchResult result = tmdbHandler . getInfos ( value , fromType ) ; info = new org . nzbhydra . mediainfo . MediaInfo ( result ) ; if ( fromType == ( org . nzbhydra . mediainfo . InfoProvider . IdType . TMDB ) ) { info . setTmdbId ( value ) ; } else if ( fromType == ( org . nzbhydra . mediainfo . InfoProvider . IdType . IMDB ) ) { info . setImdbId ( value ) ; } movieInfo = new org . nzbhydra . mediainfo . MovieInfo ( info . getImdbId ( ) . orElse ( null ) , info . getTmdbId ( ) . orElse ( null ) , info . getTitle ( ) . orElse ( null ) , info . getYear ( ) . orElse ( null ) , info . getPosterUrl ( ) . orElse ( null ) ) ; movieInfoRepository . save ( movieInfo ) ; } break ; case TVMAZE : case TVDB : case TVRAGE : case TVTITLE : org . nzbhydra . mediainfo . TvInfo tvInfo ; if ( fromType == ( org . nzbhydra . mediainfo . InfoProvider . IdType . TVMAZE ) ) { tvInfo = tvInfoRepository . findByTvmazeId ( value ) ; } else if ( fromType == ( org . nzbhydra . mediainfo . InfoProvider . IdType . TVDB ) ) { tvInfo = tvInfoRepository . findByTvdbId ( value ) ; } else if ( fromType == ( org . nzbhydra . mediainfo . InfoProvider . IdType . TVRAGE ) ) { tvInfo = tvInfoRepository . findByTvrageId ( value ) ; } else { tvInfo = tvInfoRepository . findByTitle ( value ) ; } if ( tvInfo != null ) { info = new org . nzbhydra . mediainfo . MediaInfo ( tvInfo ) ; } else { org . nzbhydra . mediainfo . TvMazeSearchResult result = tvMazeHandler . getInfos ( value , fromType ) ; info = new org . nzbhydra . mediainfo . MediaInfo ( result ) ; tvInfo = new org . nzbhydra . mediainfo . TvInfo ( info . getTvDbId ( ) . orElse ( null ) , info . getTvRageId ( ) . orElse ( null ) , info . getTvMazeId ( ) . orElse ( null ) , info . getTitle ( ) . orElse ( null ) , info . getYear ( ) . orElse ( null ) , info . getPosterUrl ( ) . orElse ( null ) ) ; tvInfoRepository . save ( tvInfo ) ; } break ; default : throw new java . lang . IllegalArgumentException ( "Wrong<sp>IdType" ) ; } org . nzbhydra . mediainfo . InfoProvider . logger . debug ( ( "Conversion<sp>successful:<sp>" + info ) ) ; return info ; } catch ( java . lang . Exception e ) { org . nzbhydra . mediainfo . InfoProvider . logger . error ( ( ( ( "Error<sp>while<sp>converting<sp>" + fromType ) + "<sp>" ) + value ) , e ) ; com . google . common . base . Throwables . throwIfInstanceOf ( e , org . nzbhydra . mediainfo . InfoProviderException . class ) ; throw new org . nzbhydra . mediainfo . InfoProviderException ( "Unexpected<sp>error<sp>while<sp>converting<sp>infos" , e ) ; } } | org . junit . Assert . assertEquals ( org . nzbhydra . mediainfo . InfoProviderException . class , e . getClass ( ) ) |
shouldExportPrefixQuery ( ) { com . couchbase . client . java . search . queries . PrefixQuery fts = com . couchbase . client . java . search . SearchQuery . prefix ( "someterm" ) ; com . couchbase . client . java . search . SearchQuery query = new com . couchbase . client . java . search . SearchQuery ( "foo" , fts ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "query" , com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "prefix" , "someterm" ) ) ; "<AssertPlaceHolder>" ; } export ( ) { return "INSERT<sp>INTO<sp>" + ( bucket . toString ( ) ) ; } | org . junit . Assert . assertEquals ( expected , query . export ( ) ) |
dispatchRemoteAsyncPull ( ) { org . ebayopensource . turmeric . runtime . sif . service . Service service = org . ebayopensource . turmeric . runtime . sif . service . ServiceFactory . create ( "test1" , "remote" , serverUri . toURL ( ) ) ; javax . xml . ws . Response < java . lang . String > resp = service . createDispatch ( "echoString" ) . invokeAsync ( ECHO_STRING ) ; java . lang . String outMessage = resp . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { synchronized ( responses ) { if ( ! ( isDone ( ) ) ) responses . wait ( ) ; if ( ( m_interruptedException ) != null ) { throw m_interruptedException ; } return responses ; } } | org . junit . Assert . assertEquals ( ECHO_STRING , outMessage ) |
twoTranslateValuesTest ( ) { com . itextpdf . kernel . geom . AffineTransform expected = new com . itextpdf . kernel . geom . AffineTransform ( 1.0 , 0.0 , 0.0 , 1.0 , 17.25 , 43.5 ) ; com . itextpdf . kernel . geom . AffineTransform actual = com . itextpdf . svg . utils . TransformUtils . parseTransform ( "translate(23,58)" ) ; "<AssertPlaceHolder>" ; } parseTransform ( java . lang . String ) { if ( transform == null ) { throw new com . itextpdf . svg . exceptions . SvgProcessingException ( com . itextpdf . svg . exceptions . SvgLogMessageConstant . TRANSFORM_NULL ) ; } if ( transform . isEmpty ( ) ) { throw new com . itextpdf . svg . exceptions . SvgProcessingException ( com . itextpdf . svg . exceptions . SvgLogMessageConstant . TRANSFORM_EMPTY ) ; } com . itextpdf . kernel . geom . AffineTransform matrix = new com . itextpdf . kernel . geom . AffineTransform ( ) ; java . util . List < java . lang . String > listWithTransformations = com . itextpdf . svg . utils . TransformUtils . splitString ( transform ) ; for ( java . lang . String transformation : listWithTransformations ) { com . itextpdf . kernel . geom . AffineTransform newMatrix = com . itextpdf . svg . utils . TransformUtils . transformationStringToMatrix ( transformation ) ; if ( newMatrix != null ) { matrix . concatenate ( newMatrix ) ; } } return matrix ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testDefaultHTTTPStatusErrorCode ( ) { exceptionReport = new org . n52 . wps . server . ExceptionReport ( "Test<sp>error" , "" ) ; "<AssertPlaceHolder>" ; } getHTTPStatusCode ( ) { switch ( errorKey ) { case org . n52 . wps . server . ExceptionReport . OPERATION_NOT_SUPPORTED : return javax . servlet . http . HttpServletResponse . SC_NOT_IMPLEMENTED ; case org . n52 . wps . server . ExceptionReport . MISSING_PARAMETER_VALUE : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . INVALID_PARAMETER_VALUE : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . VERSION_NEGOTIATION_FAILED : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . INVALID_UPDATE_SEQUENCE : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . NO_APPLICABLE_CODE : return javax . servlet . http . HttpServletResponse . SC_INTERNAL_SERVER_ERROR ; default : return javax . servlet . http . HttpServletResponse . SC_INTERNAL_SERVER_ERROR ; } } | org . junit . Assert . assertTrue ( ( ( exceptionReport . getHTTPStatusCode ( ) ) == ( javax . servlet . http . HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ) ) |
testResourcesListingDirection ( ) { com . cloudinary . test . Map result = api . resourcesByTag ( com . cloudinary . test . AbstractApiTest . DIRECTION_TAG , com . cloudinary . utils . ObjectUtils . asMap ( "type" , "upload" , "direction" , "asc" , "max_results" , 500 ) ) ; com . cloudinary . test . List < com . cloudinary . test . Map > resources = ( ( com . cloudinary . test . List < com . cloudinary . test . Map > ) ( result . get ( "resources" ) ) ) ; com . cloudinary . test . ArrayList < java . lang . String > resourceIds = new com . cloudinary . test . ArrayList < java . lang . String > ( ) ; for ( com . cloudinary . test . Map resource : resources ) { resourceIds . add ( ( ( java . lang . String ) ( resource . get ( "public_id" ) ) ) ) ; } result = api . resourcesByTag ( com . cloudinary . test . AbstractApiTest . DIRECTION_TAG , com . cloudinary . utils . ObjectUtils . asMap ( "type" , "upload" , "direction" , ( - 1 ) , "max_results" , 500 ) ) ; com . cloudinary . test . List < com . cloudinary . test . Map > resourcesDesc = ( ( com . cloudinary . test . List < com . cloudinary . test . Map > ) ( result . get ( "resources" ) ) ) ; com . cloudinary . test . ArrayList < java . lang . String > resourceIdsDesc = new com . cloudinary . test . ArrayList < java . lang . String > ( ) ; for ( com . cloudinary . test . Map resource : resourcesDesc ) { resourceIdsDesc . add ( ( ( java . lang . String ) ( resource . get ( "public_id" ) ) ) ) ; } com . cloudinary . test . Collections . reverse ( resourceIds ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { if ( key == null ) { throw new org . cloudinary . json . JSONException ( "Null<sp>key." ) ; } java . lang . Object object = this . opt ( key ) ; if ( object == null ) { throw new org . cloudinary . json . JSONException ( ( ( "JSONObject[" + ( org . cloudinary . json . JSONObject . quote ( key ) ) ) + "]<sp>not<sp>found." ) ) ; } return object ; } | org . junit . Assert . assertEquals ( resourceIds , resourceIdsDesc ) |
test_withAmount_double_same ( ) { org . joda . money . BigMoney test = org . joda . money . TestBigMoney . GBP_2_34 . withAmount ( 2.34 ) ; "<AssertPlaceHolder>" ; } withAmount ( double ) { return withAmount ( amount , RoundingMode . UNNECESSARY ) ; } | org . junit . Assert . assertSame ( org . joda . money . TestBigMoney . GBP_2_34 , test ) |
testTimedAssert ( ) { final java . util . concurrent . atomic . AtomicInteger count = new java . util . concurrent . atomic . AtomicInteger ( 3 ) ; org . sagebionetworks . util . TimedAssert . waitForAssert ( 10000 , 10 , new java . lang . Runnable ( ) { @ org . sagebionetworks . util . Override public void run ( ) { if ( ( count . incrementAndGet ( ) ) < 3 ) { org . junit . Assert . fail ( ) ; } } } ) ; "<AssertPlaceHolder>" ; } get ( ) { org . junit . Assert . assertNotNull ( "Only<sp>call<sp>get()<sp>once<sp>after<sp>start()" , future ) ; T result = future . get ( ) ; future = null ; return result ; } | org . junit . Assert . assertEquals ( 4 , count . get ( ) ) |
testCDSInsertionInExonForward ( ) { de . charite . compbio . jannovar . reference . GenomeVariant change = new de . charite . compbio . jannovar . reference . GenomeVariant ( new de . charite . compbio . jannovar . reference . GenomePosition ( de . charite . compbio . jannovar . reference . TranscriptSequenceChangeHelperTest . refDict , Strand . FWD , 1 , 6642119 , PositionType . ZERO_BASED ) , "" , "CTTG" ) ; java . lang . String resultTranscript = helperForward . getCDSWithGenomeVariant ( change ) ; java . lang . StringBuilder expectedBuilder = new java . lang . StringBuilder ( projectorForward . getTranscriptStartingAtCDS ( ) ) ; expectedBuilder . insert ( 692 , "CTTG" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "LegacyDeletion<sp>[deletedSeq=" + ( deletedSeq . toHGVSString ( ) ) ) + ",<sp>location=" ) + ( location ) ) + "]" ; } | org . junit . Assert . assertEquals ( expectedBuilder . toString ( ) , resultTranscript ) |
create_MailOperationException ( ) { ctrl . init ( ) ; when ( us . createNewUser ( any ( org . oscm . internal . usermanagement . POUserAndSubscriptions . class ) , anyString ( ) ) ) . thenThrow ( new org . oscm . internal . types . exception . MailOperationException ( ) ) ; org . oscm . ui . dialog . mp . createuser . CreateUserCtrlTest . setData ( ctrl . getModel ( ) ) ; when ( java . lang . Boolean . valueOf ( applicationBean . isInternalAuthMode ( ) ) ) . thenReturn ( Boolean . TRUE ) ; java . lang . String outcome = ctrl . create ( ) ; "<AssertPlaceHolder>" ; verify ( ctrl . ui , times ( 1 ) ) . handleError ( ( ( java . lang . String ) ( isNull ( ) ) ) , eq ( BaseBean . ERROR_USER_CREATE_MAIL ) ) ; } create ( ) { if ( ( ( serviceForCreation ) == null ) || ( ( selectedTechService ) == null ) ) { return OUTCOME_ERROR ; } boolean isPublicService = serviceForCreation . isPublicService ( ) ; rewritePasswordsValues ( ) ; serviceForCreation = new org . oscm . ui . model . ServiceDetails ( org . oscm . ui . beans . ServiceBean . cleanupParameter ( serviceForCreation . getVoServiceDetails ( ) ) ) ; selectedService = new org . oscm . ui . model . ServiceDetails ( getProvisioningService ( ) . createService ( selectedTechService , serviceForCreation . getVoServiceDetails ( ) , getImageUploader ( ) . getVOImageResource ( ) ) ) ; selectedService . setPublicService ( isPublicService ) ; boolean addedMsg = false ; java . util . List < org . oscm . internal . vo . VOCategory > categories = selectedCategoryToVOUnwrapper ( this . categorySelection ) ; try { marketplaceBean . publishService ( selectedService , categories ) ; } catch ( org . oscm . internal . types . exception . ObjectNotFoundException e ) { if ( ( org . oscm . internal . types . exception . DomainObjectException . ClassEnum . MARKETPLACE ) == ( e . getDomainObjectClassEnum ( ) ) ) { addMessage ( null , FacesMessage . SEVERITY_ERROR , org . oscm . ui . beans . ERROR_SERVICE_SAVED_MARKETPLACE_DELETED , new java . lang . String [ ] { selectedService . getServiceId ( ) , marketplaceBean . getMarketplace ( ) . getName ( ) , marketplaceBean . getMarketplace ( ) . getMarketplaceId ( ) } ) ; addedMsg = true ; } else { throw e ; } } catch ( org . oscm . internal . types . exception . PublishingToMarketplaceNotPermittedException e ) { addMessage ( null , FacesMessage . SEVERITY_ERROR , org . oscm . ui . beans . ERROR_SERVICE_SAVED_PUBLISHING_NOT_PERMITTED , new java . lang . String [ ] { selectedService . getServiceId ( ) , marketplaceBean . getMarketplace ( ) . getName ( ) , marketplaceBean . getMarketplace ( ) . getMarketplaceId ( ) } ) ; addedMsg = true ; } if ( ! addedMsg ) { addMessage ( null , FacesMessage . SEVERITY_INFO , org . oscm . ui . beans . INFO_SERVICE_CREATED , selectedService . getServiceId ( ) ) ; } sessionBean . setSelectedServiceKeyForSupplier ( java . lang . Long . valueOf ( selectedService . getKey ( ) ) ) ; prepareParameters ( ) ; services = null ; menuBean . setCurrentPageLink ( MenuBean . LINK_SERVICE_EDIT ) ; if ( org . oscm . ui . beans . ServiceBean . logger . isDebugLoggingEnabled ( ) ) { } return OUTCOME_SUCCESS ; } | org . junit . Assert . assertEquals ( BaseBean . OUTCOME_ERROR , outcome ) |
getValueFromJsonObjectInputObjectNull ( ) { java . lang . String key = "key" ; java . lang . String expResult = "" ; java . lang . String result = com . microsoft . azure . sdk . iot . deps . util . Tools . getValueFromJsonObject ( null , key ) ; "<AssertPlaceHolder>" ; } getValueFromJsonObject ( javax . json . JsonObject , java . lang . String ) { java . lang . String retVal ; if ( ( ( ( jsonObject == null ) || ( jsonObject == ( javax . json . JsonObject . NULL ) ) ) || ( key == null ) ) || ( ( key . length ( ) ) == 0 ) ) { retVal = "" ; } else { javax . json . JsonValue jsonValue = jsonObject . get ( key ) ; if ( jsonValue != ( javax . json . JsonValue . NULL ) ) { retVal = com . microsoft . azure . sdk . iot . deps . util . Tools . getValueFromJsonString ( jsonObject . getJsonString ( key ) ) ; } else { retVal = "" ; } } return retVal ; } | org . junit . Assert . assertEquals ( expResult , result ) |
shouldHaveIconToIndicateFailingTest ( ) { java . lang . Object node = org . infinitest . intellij . plugin . swingui . WhenShowingMainFrame . eventWithError ( ) ; org . infinitest . intellij . plugin . swingui . JLabel treeCell = ( ( org . infinitest . intellij . plugin . swingui . JLabel ) ( cellRenderer . getTreeCellRendererComponent ( resultsPane . getTree ( ) , node , false , false , false , 0 , false ) ) ) ; "<AssertPlaceHolder>" . isEqualTo ( expectedIcon ( "failure" ) ) ; } getIcon ( ) { return org . infinitest . intellij . idea . facet . IconLoader . getIcon ( "/infinitest.png" ) ; } | org . junit . Assert . assertThat ( treeCell . getIcon ( ) . toString ( ) ) |
runTest ( ) { boolean result = checkNoError ( "Social_Search_Get_Results" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; } | org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result ) |
readOffsetLatestNone ( ) { "<AssertPlaceHolder>" ; } readLatestOffsets ( ) { java . util . List < java . lang . Long > storedOffsetPersistenceTimes = getStoredOffsetPersistenceTimes ( true ) ; if ( storedOffsetPersistenceTimes . isEmpty ( ) ) { return java . util . Collections . emptyMap ( ) ; } long persistedTime = storedOffsetPersistenceTimes . get ( 0 ) ; java . util . Map < org . apache . kafka . common . TopicPartition , java . lang . Long > offsets = readOffsets ( persistedTime ) ; return offsets == null ? java . util . Collections . < org . apache . kafka . common . TopicPartition , java . lang . Long > emptyMap ( ) : offsets ; } | org . junit . Assert . assertThat ( reader . readLatestOffsets ( ) , org . hamcrest . core . Is . is ( java . util . Collections . < org . apache . kafka . common . TopicPartition , java . lang . Long > emptyMap ( ) ) ) |
testGetFileFromResource ( ) { java . lang . String filename = "/data/TextFile.txt" ; java . io . File file = org . talend . commons . utils . resource . ResourceUtil . getFileFromResource ( this . getClass ( ) , filename ) ; "<AssertPlaceHolder>" ; } getFileFromResource ( java . lang . Class , java . lang . String ) { java . net . URL url = clazz . getResource ( path ) ; if ( url == null ) { return null ; } java . net . URL fileURL = org . eclipse . core . runtime . FileLocator . toFileURL ( url ) ; java . net . URI escapedUri = new java . net . URI ( fileURL . getProtocol ( ) , fileURL . getPath ( ) , fileURL . getQuery ( ) ) ; return new java . io . File ( escapedUri ) ; } | org . junit . Assert . assertNotNull ( file ) |
givenUserExists_whenSavingExistUser_thenUserIsUpdated ( ) { com . baeldung . model . User user = new com . baeldung . model . User ( ) ; user . setName ( "Jack" ) ; mongoOps . insert ( user ) ; user = mongoOps . findOne ( org . springframework . data . mongodb . core . query . Query . query ( org . springframework . data . mongodb . core . query . Criteria . where ( "name" ) . is ( "Jack" ) ) , com . baeldung . model . User . class ) ; user . setName ( "Jim" ) ; userRepository . save ( user ) ; "<AssertPlaceHolder>" ; } findAll ( org . springframework . data . domain . Pageable ) { return persistenceAuditEventRepository . findAll ( pageable ) . map ( auditEventConverter :: convertToAuditEvent ) ; } | org . junit . Assert . assertThat ( mongoOps . findAll ( com . baeldung . model . User . class ) . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
testPutValues ( ) { com . liferay . portal . kernel . json . JSONArray jsonArray1 = _createJSONArray ( ) ; jsonArray1 . put ( "alpha" ) . put ( "beta" ) . put ( "gamma" ) ; com . liferay . portal . kernel . json . JSONArray jsonArray2 = com . liferay . portal . kernel . json . JSONUtil . put ( "alpha" , "beta" , "gamma" ) ; for ( int i = 0 ; i < ( jsonArray1 . length ( ) ) ; i ++ ) { "<AssertPlaceHolder>" ; } } get ( java . lang . String ) { return com . liferay . journal . content . search . web . configuration . JournalContentSearchWebConfigurationUtil . _configuration . get ( key ) ; } | org . junit . Assert . assertEquals ( jsonArray1 . get ( i ) , jsonArray2 . get ( i ) ) |
testFromEbXMLEmpty ( ) { org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLClassification ebXML = transformer . toEbXML ( new org . openehealth . ipf . commons . ihe . xds . core . transform . ebxml . Author ( ) , objectLibrary ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLRetrieveDocumentSetRequest ) { if ( ebXML == null ) { return null ; } org . openehealth . ipf . commons . ihe . xds . core . requests . RetrieveDocumentSet request = new org . openehealth . ipf . commons . ihe . xds . core . requests . RetrieveDocumentSet ( ) ; request . getDocuments ( ) . addAll ( ebXML . getDocuments ( ) ) ; return request ; } | org . junit . Assert . assertEquals ( new org . openehealth . ipf . commons . ihe . xds . core . transform . ebxml . Author ( ) , transformer . fromEbXML ( ebXML ) ) |
testWorkspaceCount ( ) { this . workspaceManager . getOrCreateWorkspace ( "hendrix" ) ; "<AssertPlaceHolder>" ; } getWorkspaceCount ( ) { return this . workspaces . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , this . workspaceManager . getWorkspaceCount ( ) ) |
testObtenerListaDeDescuentodescuentos ( ) { log . debug ( "Muestra<sp>lista<sp>de<sp>tipos<sp>de<sp>descuentos" ) ; mx . edu . um . mateo . general . model . Usuario usuario = obtieneUsuario ( ) ; mx . edu . um . mateo . general . model . Organizacion organizacion = usuario . getEmpresa ( ) . getOrganizacion ( ) ; mx . edu . um . mateo . inscripciones . model . Descuento descuento = new mx . edu . um . mateo . inscripciones . model . Descuento ( "Descuento" , "A" , "S" , organizacion ) ; currentSession ( ) . save ( descuento ) ; mx . edu . um . mateo . inscripciones . model . AlumnoDescuento alumnoDescuento ; for ( int i = 0 ; i < 5 ; i ++ ) { alumnoDescuento = new mx . edu . um . mateo . inscripciones . model . AlumnoDescuento ( "1080506" , descuento , new java . util . Date ( ) , usuario , "S" , "A" ) ; instance . graba ( alumnoDescuento , usuario ) ; "<AssertPlaceHolder>" ; } java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap ( ) ; params . put ( "usuario" , usuario . getId ( ) ) ; java . util . Map < java . lang . String , java . lang . Object > result = instance . lista ( params ) ; } getId ( ) { return id ; } | org . junit . Assert . assertNotNull ( alumnoDescuento . getId ( ) ) |
testGetUserExists ( ) { com . intuit . wasabi . authenticationobjects . UserInfo user = defaultAuthentication . getUserExists ( com . intuit . wasabi . authentication . impl . DefaultAuthenticationTest . ADMIN_EXAMPLE_COM ) ; com . intuit . wasabi . authenticationobjects . UserInfo expected = com . intuit . wasabi . authenticationobjects . UserInfo . from ( UserInfo . Username . valueOf ( com . intuit . wasabi . authentication . impl . DefaultAuthenticationTest . WASABI_ADMIN ) ) . withEmail ( com . intuit . wasabi . authentication . impl . DefaultAuthenticationTest . ADMIN_EXAMPLE_COM ) . withLastName ( "Admin" ) . withUserId ( com . intuit . wasabi . authentication . impl . DefaultAuthenticationTest . WASABI_ADMIN ) . withFirstName ( "Wasabi" ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return this . item ; } | org . junit . Assert . assertEquals ( user , expected ) |
testLoadElementByUuid ( ) { java . util . List < java . lang . String > uuidList = getAllUuids ( ) ; for ( java . lang . String uuid : uuidList ) { sernet . gs . service . RetrieveInfo ri = new sernet . gs . service . RetrieveInfo ( ) ; ri . setParent ( true ) ; sernet . verinice . service . commands . LoadElementByUuid < sernet . verinice . model . common . CnATreeElement > command = new sernet . verinice . service . commands . LoadElementByUuid < sernet . verinice . model . common . CnATreeElement > ( uuid , ri ) ; command = commandService . executeCommand ( command ) ; sernet . verinice . model . common . CnATreeElement element = command . getElement ( ) ; "<AssertPlaceHolder>" ; checkScopeId ( element ) ; } } getElement ( ) { return element ; } | org . junit . Assert . assertNotNull ( element ) |
getTempDefaultValueForEnumeration_OK ( ) { parameterParserSpy . setTempDefaultValueForEnumeration ( "success" ) ; java . lang . String result = parameterParserSpy . getTempDefaultValueForEnumeration ( ) ; "<AssertPlaceHolder>" ; } getTempDefaultValueForEnumeration ( ) { return tempDefaultValueForEnumeration ; } | org . junit . Assert . assertEquals ( "success" , result ) |
testMergeJournalsBadRecordAfterFirst ( ) { org . junit . Assume . assumeFalse ( isWindowsEnvironment ( ) ) ; final org . apache . nifi . provenance . RepositoryConfiguration config = org . apache . nifi . provenance . ITestPersistentProvenanceRepository . createConfiguration ( ) ; config . setMaxEventFileLife ( 3 , TimeUnit . SECONDS ) ; org . apache . nifi . provenance . ITestPersistentProvenanceRepository . TestablePersistentProvenanceRepository testRepo = new org . apache . nifi . provenance . ITestPersistentProvenanceRepository . TestablePersistentProvenanceRepository ( config , org . apache . nifi . provenance . ITestPersistentProvenanceRepository . DEFAULT_ROLLOVER_MILLIS ) ; testRepo . initialize ( getEventReporter ( ) , null , null , null ) ; final java . util . Map < java . lang . String , java . lang . String > attributes = new java . util . HashMap ( ) ; final org . apache . nifi . provenance . ProvenanceEventBuilder builder = new org . apache . nifi . provenance . StandardProvenanceEventRecord . Builder ( ) ; builder . setEventTime ( java . lang . System . currentTimeMillis ( ) ) ; builder . setEventType ( ProvenanceEventType . RECEIVE ) ; builder . setTransitUri ( "nifi://unit-test" ) ; attributes . put ( "uuid" , "12345678-0000-0000-0000-012345678912" ) ; builder . fromFlowFile ( org . apache . nifi . provenance . TestUtil . createFlowFile ( 3L , 3000L , attributes ) ) ; builder . setComponentId ( "1234" ) ; builder . setComponentType ( "dummy<sp>processor" ) ; final org . apache . nifi . provenance . ProvenanceEventRecord record = builder . build ( ) ; final java . util . concurrent . ExecutorService exec = java . util . concurrent . Executors . newFixedThreadPool ( 10 ) ; final java . util . List < java . util . concurrent . Future < ? > > futures = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < 10000 ; i ++ ) { futures . add ( exec . submit ( new java . lang . Runnable ( ) { @ org . apache . nifi . provenance . Override public void run ( ) { testRepo . registerEvent ( record ) ; } } ) ) ; } for ( java . util . concurrent . Future < ? > future : futures ) { while ( ! ( future . isDone ( ) ) ) { java . lang . Thread . sleep ( 10 ) ; } } org . apache . nifi . provenance . serialization . RecordWriter firstWriter = testRepo . getWriters ( ) [ 0 ] ; corruptJournalFile ( firstWriter . getFile ( ) , ( ( ( org . apache . nifi . provenance . ITestPersistentProvenanceRepository . headerSize ) + 15 ) + ( org . apache . nifi . provenance . ITestPersistentProvenanceRepository . recordSize ) ) , "RECEIVE" , "BADTYPE" ) ; testRepo . recoverJournalFiles ( ) ; final java . io . File storageDir = config . getStorageDirectories ( ) . values ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } checkJournalRecords ( java . io . File , java . lang . Boolean ) { java . io . File [ ] storagefiles = storageDir . listFiles ( ) ; long counter = 0 ; org . junit . Assert . assertNotNull ( storagefiles ) ; for ( final java . io . File file : storagefiles ) { if ( file . isFile ( ) ) { try ( org . apache . nifi . provenance . serialization . RecordReader reader = org . apache . nifi . provenance . serialization . RecordReaders . newRecordReader ( file , null , 2048 ) ) { org . apache . nifi . provenance . ProvenanceEventRecord r ; org . apache . nifi . provenance . ProvenanceEventRecord last = null ; while ( ( r = reader . nextRecord ( ) ) != null ) { if ( exact ) { org . junit . Assert . assertTrue ( ( ( counter ++ ) == ( r . getEventId ( ) ) ) ) ; } else { org . junit . Assert . assertTrue ( ( ( counter ++ ) <= ( r . getEventId ( ) ) ) ) ; } } } } } return counter ; } | org . junit . Assert . assertTrue ( ( ( checkJournalRecords ( storageDir , false ) ) < 10000 ) ) |
testSizeIsOneIfTreeHasOneEntry ( ) { "<AssertPlaceHolder>" ; } create ( int , int ) { com . github . davidmoten . rtree3d . RTree < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > tree = com . github . davidmoten . rtree3d . RTree . maxChildren ( maxChildren ) . create ( ) ; for ( int i = 1 ; i <= n ; i ++ ) tree = tree . add ( com . github . davidmoten . rtree3d . RTreeTest . e ( i ) ) ; return tree ; } | org . junit . Assert . assertEquals ( 1 , com . github . davidmoten . rtree3d . RTreeTest . create ( 3 , 1 ) . size ( ) ) |
testCompletionWithWordIndexZero ( ) { final org . jline . reader . impl . DefaultParser . ArgumentList parsedLine = new org . jline . reader . impl . DefaultParser . ArgumentList ( "" , java . util . Collections . emptyList ( ) , 0 , ( - 1 ) , ( - 1 ) ) ; final java . util . List < org . jline . reader . Candidate > candidates = new java . util . ArrayList ( ) ; org . apache . nifi . toolkit . cli . TestCLICompleter . completer . complete ( org . apache . nifi . toolkit . cli . TestCLICompleter . lineReader , parsedLine , candidates ) ; "<AssertPlaceHolder>" ; } getTopLevelCommands ( ) { return topLevelCommandMap . keySet ( ) ; } | org . junit . Assert . assertEquals ( org . apache . nifi . toolkit . cli . TestCLICompleter . completer . getTopLevelCommands ( ) . size ( ) , candidates . size ( ) ) |
clientProfileTest ( ) { java . lang . String host = "host" ; java . lang . String email = "docker@camel.apache.org" ; java . lang . String username = "user" ; java . lang . String password = "password" ; java . lang . Integer port = 2241 ; java . lang . Integer requestTimeout = 40 ; boolean secure = true ; java . lang . String certPath = "/docker/cert/path" ; java . lang . String cmdExecFactory = DockerConstants . DEFAULT_CMD_EXEC_FACTORY ; org . apache . camel . component . docker . DockerClientProfile clientProfile1 = new org . apache . camel . component . docker . DockerClientProfile ( ) ; clientProfile1 . setHost ( host ) ; clientProfile1 . setEmail ( email ) ; clientProfile1 . setUsername ( username ) ; clientProfile1 . setPassword ( password ) ; clientProfile1 . setPort ( port ) ; clientProfile1 . setRequestTimeout ( requestTimeout ) ; clientProfile1 . setSecure ( secure ) ; clientProfile1 . setCertPath ( certPath ) ; clientProfile1 . setCmdExecFactory ( cmdExecFactory ) ; org . apache . camel . component . docker . DockerClientProfile clientProfile2 = new org . apache . camel . component . docker . DockerClientProfile ( ) ; clientProfile2 . setHost ( host ) ; clientProfile2 . setEmail ( email ) ; clientProfile2 . setUsername ( username ) ; clientProfile2 . setPassword ( password ) ; clientProfile2 . setPort ( port ) ; clientProfile2 . setRequestTimeout ( requestTimeout ) ; clientProfile2 . setSecure ( secure ) ; clientProfile2 . setCertPath ( certPath ) ; clientProfile2 . setCmdExecFactory ( cmdExecFactory ) ; "<AssertPlaceHolder>" ; } setCmdExecFactory ( java . lang . String ) { this . cmdExecFactory = cmdExecFactory ; } | org . junit . Assert . assertEquals ( clientProfile1 , clientProfile2 ) |
testDetailedMapToString ( ) { java . util . Map < java . lang . String , java . lang . String > map = com . google . common . collect . Maps . newHashMap ( ) ; map . put ( "0" , "zero" ) ; map . put ( "1" , null ) ; map . put ( "2" , "0" 1 ) ; map . put ( "3" , null ) ; java . lang . String actual = com . pardot . rhombus . util . StringUtil . detailedMapToString ( map ) ; java . lang . String expected = "{\n" + ( ( ( ( "0" 0 + "\t2:<sp>(java.lang.String)<sp>two\n" ) + "\t1:<sp>(NULL)<sp>NULL\n" ) + "\t0:<sp>(java.lang.String)<sp>zero\n" ) + "}" ) ; "<AssertPlaceHolder>" ; } detailedMapToString ( java . util . Map ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "{\n" ) ; for ( java . lang . Object key : map . keySet ( ) ) { sb . append ( "\t" ) ; sb . append ( java . lang . String . valueOf ( key ) ) ; sb . append ( ":<sp>(" ) ; java . lang . Object value = map . get ( key ) ; sb . append ( ( value == null ? "NULL" : value . getClass ( ) . getName ( ) ) ) ; sb . append ( ")<sp>" ) ; sb . append ( ( value == null ? "NULL" : java . lang . String . valueOf ( value ) ) ) ; sb . append ( "\n" ) ; } sb . append ( "}" ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testSmallint ( ) { org . apache . rocketmq . mysql . schema . column . IntColumnParser parser = new org . apache . rocketmq . mysql . schema . column . IntColumnParser ( "smallint" , "smallint(5)<sp>unsigned" ) ; java . lang . Long v1 = ( ( java . lang . Long ) ( parser . getValue ( ( ( int ) ( Short . MIN_VALUE ) ) ) ) ) ; java . lang . Long v2 = ( ( long ) ( ( Short . MAX_VALUE ) + 1 ) ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . Object ) { if ( value == null ) { return null ; } if ( value instanceof java . lang . String ) { return value ; } byte [ ] bytes = ( ( byte [ ] ) ( value ) ) ; switch ( charset ) { case "utf8" : case "utf8mb4" : return new java . lang . String ( bytes , org . apache . commons . codec . Charsets . UTF_8 ) ; case "latin1" : case "ascii" : return new java . lang . String ( bytes , org . apache . commons . codec . Charsets . ISO_8859_1 ) ; case "ucs2" : return new java . lang . String ( bytes , org . apache . commons . codec . Charsets . UTF_16 ) ; default : return new java . lang . String ( bytes , org . apache . commons . codec . Charsets . toCharset ( charset ) ) ; } } | org . junit . Assert . assertEquals ( v1 , v2 ) |
testGetSetNumID ( ) { try ( org . apache . poi . xwpf . usermodel . XWPFDocument doc = new org . apache . poi . xwpf . usermodel . XWPFDocument ( ) ) { org . apache . poi . xwpf . usermodel . XWPFParagraph p = doc . createParagraph ( ) ; p . setNumID ( new java . math . BigInteger ( "10" ) ) ; "<AssertPlaceHolder>" ; } } getNumID ( ) { if ( ( paragraph . getPPr ( ) ) != null ) { if ( ( paragraph . getPPr ( ) . getNumPr ( ) ) != null ) { if ( ( paragraph . getPPr ( ) . getNumPr ( ) . getNumId ( ) ) != null ) { return paragraph . getPPr ( ) . getNumPr ( ) . getNumId ( ) . getVal ( ) ; } } } return null ; } | org . junit . Assert . assertEquals ( "10" , p . getNumID ( ) . toString ( ) ) |
tree_iter_2_09 ( ) { int [ ] keys = new int [ ] { 1 , 2 , 3 , 4 , 7 , 8 , 9 , 10 , 11 } ; org . apache . jena . dboe . index . RangeIndex rIndex = makeRangeIndex ( 2 ) ; org . apache . jena . dboe . index . test . IndexTestLib . add ( rIndex , keys ) ; java . util . List < java . lang . Integer > x = toIntList ( rIndex . iterator ( r ( 5 ) , r ( 7 ) ) ) ; java . util . List < java . lang . Integer > expected = toIntList ( ) ; "<AssertPlaceHolder>" ; } r ( int ) { return org . apache . jena . tdb . base . record . RecordLib . intToRecord ( v , org . apache . jena . tdb . base . record . RecordLib . TestRecordLength ) ; } | org . junit . Assert . assertEquals ( expected , x ) |
testPostNotSupported ( ) { org . jscep . transport . response . Capabilities caps = new org . jscep . transport . response . Capabilities ( ) ; "<AssertPlaceHolder>" ; } isPostSupported ( ) { return caps . contains ( Capability . POST_PKI_OPERATION ) ; } | org . junit . Assert . assertFalse ( caps . isPostSupported ( ) ) |
testContains ( ) { System . out . println ( "contains" ) ; final int [ ] count = new int [ 1 ] ; instance . executeQuery ( "select<sp>s<sp>from<sp>java.lang.String<sp>s<sp>where<sp>contains(referrers(s),<sp>\"classof(it).name<sp>==<sp>\'java.lang.Class\'\")" , new org . netbeans . modules . profiler . oql . engine . api . OQLEngine . ObjectVisitor ( ) { public boolean visit ( java . lang . Object o ) { ( count [ 0 ] ) ++ ; return false ; } } ) ; "<AssertPlaceHolder>" ; } visit ( org . netbeans . modules . css . lib . api . Node ) { if ( ( node . type ( ) ) == ( org . netbeans . modules . css . lib . api . NodeType . token ) ) { for ( int i = node . from ( ) ; i < ( node . to ( ) ) ; i ++ ) { sourceCopy . setCharAt ( i , Character . MAX_VALUE ) ; } } return false ; } | org . junit . Assert . assertTrue ( ( ( count [ 0 ] ) > 0 ) ) |
testWithCustomClassLoader ( ) { io . cdap . cdap . proto . id . DatasetId kv = DatasetFrameworkTestUtil . NAMESPACE_ID . dataset ( "kv" ) ; final java . util . concurrent . atomic . AtomicReference < java . lang . String > lastClassLoaded = new java . util . concurrent . atomic . AtomicReference ( null ) ; java . lang . ClassLoader loader = new java . lang . ClassLoader ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public java . lang . Class < ? > loadClass ( java . lang . String name ) throws io . cdap . cdap . data2 . dataset2 . lib . table . ClassNotFoundException { lastClassLoaded . set ( name ) ; return super . loadClass ( name ) ; } } ; io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . createInstance ( "keyValueTable" , kv , DatasetProperties . EMPTY ) ; io . cdap . cdap . api . dataset . lib . KeyValueTable kvTable = io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . getInstance ( kv ) ; java . lang . reflect . Type type = io . cdap . cdap . data2 . dataset2 . lib . table . Custom . class ; io . cdap . cdap . internal . io . TypeRepresentation typeRep = new io . cdap . cdap . internal . io . TypeRepresentation ( type ) ; io . cdap . cdap . api . data . schema . Schema schema = new io . cdap . cdap . internal . io . ReflectionSchemaGenerator ( ) . generate ( type ) ; final io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDataset < io . cdap . cdap . data2 . dataset2 . lib . table . Custom > objectStore = new io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDataset ( "kv" , kvTable , typeRep , schema , loader ) ; org . apache . tephra . TransactionExecutor txnl = io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . newInMemoryTransactionExecutor ( objectStore ) ; objectStore . getRecordType ( ) ; txnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { objectStore . write ( "dummy" , new io . cdap . cdap . data2 . dataset2 . lib . table . Custom ( 382 , com . google . common . collect . Lists . newArrayList ( "blah" ) ) ) ; } } ) ; txnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { "<AssertPlaceHolder>" ; } } ) ; txnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { deleteAndVerify ( objectStore , io . cdap . cdap . api . common . Bytes . toBytes ( "dummy" ) ) ; } } ) ; io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . deleteInstance ( kv ) ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( io . cdap . cdap . data2 . dataset2 . lib . table . Custom . class . getName ( ) , lastClassLoaded . get ( ) ) |
testExecuteInTransaction ( ) { final com . jmethods . catatumbo . entities . StringField entity = new com . jmethods . catatumbo . entities . StringField ( ) ; entity . setName ( "Run<sp>in<sp>transaction<sp>test" ) ; final com . jmethods . catatumbo . entities . StringField insertedEntity = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; com . jmethods . catatumbo . entities . StringField updatedEntity = com . jmethods . catatumbo . EntityManagerTest . em . executeInTransaction ( new com . jmethods . catatumbo . TransactionalTask < com . jmethods . catatumbo . entities . StringField > ( ) { @ com . jmethods . catatumbo . Override public com . jmethods . catatumbo . entities . StringField execute ( com . jmethods . catatumbo . DatastoreTransaction transaction ) { com . jmethods . catatumbo . entities . StringField loadedEntity = transaction . load ( com . jmethods . catatumbo . entities . StringField . class , insertedEntity . getId ( ) ) ; loadedEntity . setName ( "Updated<sp>from<sp>runInTransaction" ) ; loadedEntity = transaction . update ( loadedEntity ) ; return loadedEntity ; } } ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertTrue ( updatedEntity . getName ( ) . equals ( "Updated<sp>from<sp>runInTransaction" ) ) |
emptyMap ( ) { java . util . Map < java . lang . String , org . mule . tck . testmodels . fruit . Fruit > map = new java . util . ArrayList < org . mule . tck . testmodels . fruit . Fruit > ( ) . stream ( ) . collect ( collector ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return delegate . isEmpty ( ) ; } | org . junit . Assert . assertThat ( map . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
resolveParallelBenchmarkCountFromFormula ( ) { org . optaplanner . benchmark . config . PlannerBenchmarkConfig config = new org . optaplanner . benchmark . config . PlannerBenchmarkConfig ( ) ; config . setParallelBenchmarkCount ( ( ( org . optaplanner . core . config . util . ConfigUtils . AVAILABLE_PROCESSOR_COUNT ) + "+1" ) ) ; "<AssertPlaceHolder>" ; } resolveParallelBenchmarkCount ( ) { int availableProcessorCount = java . lang . Runtime . getRuntime ( ) . availableProcessors ( ) ; int resolvedParallelBenchmarkCount ; if ( ( parallelBenchmarkCount ) == null ) { resolvedParallelBenchmarkCount = 1 ; } else if ( parallelBenchmarkCount . equals ( org . optaplanner . benchmark . config . PlannerBenchmarkConfig . PARALLEL_BENCHMARK_COUNT_AUTO ) ) { resolvedParallelBenchmarkCount = resolveParallelBenchmarkCountAutomatically ( availableProcessorCount ) ; } else { resolvedParallelBenchmarkCount = org . optaplanner . core . config . util . ConfigUtils . resolveThreadPoolSizeScript ( "parallelBenchmarkCount" , parallelBenchmarkCount , org . optaplanner . benchmark . config . PlannerBenchmarkConfig . PARALLEL_BENCHMARK_COUNT_AUTO ) ; } if ( resolvedParallelBenchmarkCount < 1 ) { throw new java . lang . IllegalArgumentException ( ( ( ( ( "The<sp>parallelBenchmarkCount<sp>(" + ( parallelBenchmarkCount ) ) + ")<sp>resulted<sp>in<sp>a<sp>resolvedParallelBenchmarkCount<sp>(" ) + resolvedParallelBenchmarkCount ) + ")<sp>that<sp>is<sp>lower<sp>than<sp>1." ) ) ; } if ( resolvedParallelBenchmarkCount > availableProcessorCount ) { org . optaplanner . benchmark . config . PlannerBenchmarkConfig . logger . warn ( ( "Because<sp>the<sp>resolvedParallelBenchmarkCount<sp>({})<sp>is<sp>higher<sp>" + ( "than<sp>the<sp>availableProcessorCount<sp>({}),<sp>it<sp>is<sp>reduced<sp>to<sp>" + "availableProcessorCount." ) ) , resolvedParallelBenchmarkCount , availableProcessorCount ) ; resolvedParallelBenchmarkCount = availableProcessorCount ; } return resolvedParallelBenchmarkCount ; } | org . junit . Assert . assertEquals ( java . lang . Runtime . getRuntime ( ) . availableProcessors ( ) , config . resolveParallelBenchmarkCount ( ) ) |
testGetMaxCount ( ) { "<AssertPlaceHolder>" ; } getMaxCount ( ) { return maxCount ; } | org . junit . Assert . assertEquals ( Long . MAX_VALUE , builder . getMaxCount ( ) ) |
testLoop ( ) { java . util . List < org . jglue . totorom . TVertex > list = graph . v ( 1 ) . loop ( ( v ) -> v . out ( ) , 3 ) . toList ( ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertEquals ( 2 , list . size ( ) ) |
test13 ( ) { java . lang . String role = "Role1" ; boolean expResult = true ; boolean result = instance . hasRole ( role ) ; "<AssertPlaceHolder>" ; } hasRole ( java . lang . String ) { return getUser ( ) . getRoles ( ) . contains ( role ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
shouldReturnResultWithoutModification ( ) { final uk . gov . gchq . gaffer . graph . hook . OperationChainLimiter hook = fromJson ( uk . gov . gchq . gaffer . graph . hook . OperationChainLimiterTest . OP_CHAIN_LIMITER_PATH ) ; final java . lang . Object result = mock ( java . lang . Object . class ) ; final uk . gov . gchq . gaffer . operation . OperationChain opChain = new uk . gov . gchq . gaffer . operation . OperationChain . Builder ( ) . first ( new uk . gov . gchq . gaffer . operation . impl . generate . GenerateObjects ( ) ) . build ( ) ; final uk . gov . gchq . gaffer . user . User user = new uk . gov . gchq . gaffer . user . User . Builder ( ) . opAuths ( "NoScore" ) . build ( ) ; final java . lang . Object returnedResult = hook . postExecute ( result , opChain , new uk . gov . gchq . gaffer . store . Context ( user ) ) ; "<AssertPlaceHolder>" ; } postExecute ( T , uk . gov . gchq . gaffer . operation . OperationChain , uk . gov . gchq . gaffer . store . Context ) { return result ; } | org . junit . Assert . assertSame ( result , returnedResult ) |
testGetOwner ( ) { org . jaitools . tilecache . DiskCachedTile instance = new org . jaitools . tilecache . DiskCachedTile ( java . lang . Integer . valueOf ( 1234 ) , org . jaitools . tilecache . DiskCachedTileTest . image , 0 , 0 , org . jaitools . tilecache . DiskCachedTileTest . raster , false , null ) ; java . awt . image . RenderedImage result = instance . getOwner ( ) ; "<AssertPlaceHolder>" ; } getOwner ( ) { return ownerRef . get ( ) ; } | org . junit . Assert . assertEquals ( result , org . jaitools . tilecache . DiskCachedTileTest . image ) |
testAppendToBytes ( ) { java . lang . String username = "nathan" ; java . lang . String password = "password" ; byte [ ] data = com . ociweb . pronghorn . util . CharSequenceToUTF8Local . get ( ) . convert ( username ) . append ( ":" ) . append ( password ) . asBytes ( ) ; "<AssertPlaceHolder>" ; } asBytes ( ) { return java . util . Arrays . copyOfRange ( backing , 0 , length ) ; } | org . junit . Assert . assertTrue ( java . util . Arrays . equals ( ( ( username + ":" ) + password ) . getBytes ( ) , data ) ) |
testRewriteManagedPomDependencies ( ) { java . util . List < org . apache . maven . project . MavenProject > reactorProjects = createReactorProjects ( "internal-managed-snapshot-dependency" ) ; org . apache . maven . shared . release . config . ReleaseDescriptorBuilder builder = createMappedConfiguration ( reactorProjects , "internal-managed-snapshot-dependency" ) ; phase . execute ( org . apache . maven . shared . release . config . ReleaseUtils . buildReleaseDescriptor ( builder ) , new org . apache . maven . shared . release . env . DefaultReleaseEnvironment ( ) , reactorProjects ) ; "<AssertPlaceHolder>" ; } comparePomFiles ( java . util . List ) { return comparePomFiles ( reactorProjects , true ) ; } | org . junit . Assert . assertTrue ( comparePomFiles ( reactorProjects ) ) |
testCleanOnInitMultipleHandlers ( ) { generateLogFiles ( logsDir , org . apache . juli . TestFileHandler . PREFIX_1 , org . apache . juli . TestFileHandler . SUFIX_1 , 3 ) ; org . apache . juli . FileHandler fh1 = new org . apache . juli . FileHandler ( logsDir . getAbsolutePath ( ) , org . apache . juli . TestFileHandler . PREFIX_1 , org . apache . juli . TestFileHandler . SUFIX_1 , 2 ) ; org . apache . juli . FileHandler fh2 = new org . apache . juli . FileHandler ( logsDir . getAbsolutePath ( ) , org . apache . juli . TestFileHandler . PREFIX_1 , org . apache . juli . TestFileHandler . SUFIX_2 , 2 ) ; org . apache . juli . FileHandler fh3 = new org . apache . juli . FileHandler ( logsDir . getAbsolutePath ( ) , org . apache . juli . TestFileHandler . PREFIX_2 , org . apache . juli . TestFileHandler . SUFIX_1 , 2 ) ; org . apache . juli . FileHandler fh4 = new org . apache . juli . FileHandler ( logsDir . getAbsolutePath ( ) , org . apache . juli . TestFileHandler . PREFIX_3 , org . apache . juli . TestFileHandler . SUFIX_1 , 2 ) ; java . lang . Thread . sleep ( 1000 ) ; "<AssertPlaceHolder>" ; fh1 . close ( ) ; fh2 . close ( ) ; fh3 . close ( ) ; fh4 . close ( ) ; } sleep ( long ) { return sleep ( t1 , t1 , t1 , t1 ) ; } | org . junit . Assert . assertTrue ( ( ( logsDir . list ( ) . length ) == 16 ) ) |
testAllowedFormatsWithIllegalFormat ( ) { boolean errorFound = false ; java . lang . String [ ] formats = new java . lang . String [ ] { "jpg" } ; try { cloudinary . uploader ( ) . upload ( com . cloudinary . test . SRC_TEST_IMAGE , asMap ( "allowed_formats" , formats , "tags" , com . cloudinary . test . Arrays . asList ( com . cloudinary . test . SDK_TEST_TAG , com . cloudinary . test . AbstractUploaderTest . UPLOADER_TAG ) ) ) ; } catch ( java . lang . Exception e ) { errorFound = true ; } "<AssertPlaceHolder>" ; } uploader ( ) { return new com . cloudinary . Uploader ( this , uploaderStrategy ) ; } | org . junit . Assert . assertTrue ( errorFound ) |
testKind ( ) { final org . apache . flink . core . fs . FileSystem fs = org . apache . flink . core . fs . FileSystem . getLocalFileSystem ( ) ; "<AssertPlaceHolder>" ; } getKind ( ) { return org . apache . flink . core . fs . FileSystemKind . FILE_SYSTEM ; } | org . junit . Assert . assertEquals ( FileSystemKind . FILE_SYSTEM , fs . getKind ( ) ) |
testUsingMismatchedKeys ( ) { byte [ ] plaintext = org . cryptonode . jncryptor . AES256JNCryptorInputStreamTest . getRandomBytes ( 256 ) ; byte [ ] encryptionSalt = org . cryptonode . jncryptor . AES256JNCryptorInputStreamTest . getRandomBytes ( 8 ) ; byte [ ] hmacSalt = org . cryptonode . jncryptor . AES256JNCryptorInputStreamTest . getRandomBytes ( 8 ) ; final java . lang . String password = "Testing1234" ; org . cryptonode . jncryptor . JNCryptor cryptor = new org . cryptonode . jncryptor . AES256JNCryptor ( ) ; javax . crypto . SecretKey hmacKey = cryptor . keyForPassword ( password . toCharArray ( ) , hmacSalt ) ; javax . crypto . SecretKey encryptionKey = cryptor . keyForPassword ( password . toCharArray ( ) , encryptionSalt ) ; byte [ ] data = cryptor . encryptData ( plaintext , encryptionKey , hmacKey ) ; java . io . InputStream in = new org . cryptonode . jncryptor . AES256JNCryptorInputStream ( new java . io . ByteArrayInputStream ( data ) , password . toCharArray ( ) ) ; try { byte [ ] result = new byte [ 256 ] ; org . apache . commons . io . IOUtils . readFully ( in , result ) ; "<AssertPlaceHolder>" ; } finally { in . close ( ) ; } } encryptData ( byte [ ] , javax . crypto . SecretKey , javax . crypto . SecretKey ) { org . cryptonode . jncryptor . Validate . notNull ( plaintext , "Plaintext<sp>cannot<sp>be<sp>null." ) ; org . cryptonode . jncryptor . Validate . notNull ( encryptionKey , "Encryption<sp>key<sp>cannot<sp>be<sp>null." ) ; org . cryptonode . jncryptor . Validate . notNull ( hmacKey , "HMAC<sp>key<sp>cannot<sp>be<sp>null." ) ; byte [ ] iv = org . cryptonode . jncryptor . AES256JNCryptor . getSecureRandomData ( org . cryptonode . jncryptor . AES256JNCryptor . AES_BLOCK_SIZE ) ; try { javax . crypto . Cipher cipher = javax . crypto . Cipher . getInstance ( org . cryptonode . jncryptor . AES256JNCryptor . AES_CIPHER_ALGORITHM ) ; cipher . init ( Cipher . ENCRYPT_MODE , encryptionKey , new javax . crypto . spec . IvParameterSpec ( iv ) ) ; byte [ ] ciphertext = cipher . doFinal ( plaintext ) ; org . cryptonode . jncryptor . AES256v3Ciphertext output = new org . cryptonode . jncryptor . AES256v3Ciphertext ( iv , ciphertext ) ; javax . crypto . Mac mac = javax . crypto . Mac . getInstance ( org . cryptonode . jncryptor . AES256JNCryptor . HMAC_ALGORITHM ) ; mac . init ( hmacKey ) ; byte [ ] hmac = mac . doFinal ( output . getDataToHMAC ( ) ) ; output . setHmac ( hmac ) ; return output . getRawData ( ) ; } catch ( java . security . GeneralSecurityException e ) { throw new org . cryptonode . jncryptor . CryptorException ( "Failed<sp>to<sp>generate<sp>ciphertext." , e ) ; } } | org . junit . Assert . assertArrayEquals ( plaintext , result ) |
testConvertAll ( ) { java . lang . Long id = 1L ; java . lang . String name = "n<sp>a<sp>m<sp>e" ; org . lnu . is . domain . asset . status . AssetStatus source = new org . lnu . is . domain . asset . status . AssetStatus ( ) ; source . setId ( id ) ; source . setName ( name ) ; java . util . List < org . lnu . is . domain . asset . status . AssetStatus > sources = java . util . Arrays . asList ( source ) ; org . lnu . is . resource . asset . status . AssetStatusResource expected = new org . lnu . is . resource . asset . status . AssetStatusResource ( ) ; expected . setId ( id ) ; expected . setName ( name ) ; java . util . List < org . lnu . is . resource . asset . status . AssetStatusResource > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . resource . asset . status . AssetStatusResource > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; } | org . junit . Assert . assertEquals ( expecteds , actuals ) |
testInvalidSpdySettingsFrameNumSettings ( ) { short type = 4 ; byte flags = 0 ; int numSettings = 2 ; int length = ( 8 * numSettings ) + 4 ; byte idFlags = 0 ; int id = ( io . netty . handler . codec . spdy . SpdyFrameDecoderTest . RANDOM . nextInt ( ) ) & 16777215 ; int value = io . netty . handler . codec . spdy . SpdyFrameDecoderTest . RANDOM . nextInt ( ) ; io . netty . buffer . ByteBuf buf = io . netty . buffer . Unpooled . buffer ( ( ( io . netty . handler . codec . spdy . SpdyCodecUtil . SPDY_HEADER_SIZE ) + length ) ) ; io . netty . handler . codec . spdy . SpdyFrameDecoderTest . encodeControlFrameHeader ( buf , type , flags , length ) ; buf . writeInt ( 0 ) ; for ( int i = 0 ; i < numSettings ; i ++ ) { buf . writeByte ( idFlags ) ; buf . writeMedium ( id ) ; buf . writeInt ( value ) ; } decoder . decode ( buf ) ; verify ( delegate ) . readFrameError ( anyString ( ) ) ; "<AssertPlaceHolder>" ; buf . release ( ) ; } isReadable ( ) { return ( writerIndex ) > ( readerIndex ) ; } | org . junit . Assert . assertFalse ( buf . isReadable ( ) ) |
testSetAlpha_Color_float ( ) { System . out . println ( "setAlpha" ) ; java . awt . Color COLOR = new java . awt . Color ( 1.0F , 0.0F , 0.0F , 1.0F ) ; float ALPHA = 0.5F ; eu . hansolo . steelseries . tools . Util instance = Util . INSTANCE ; int expResult = 128 ; int result = instance . setAlpha ( COLOR , ALPHA ) . getAlpha ( ) ; "<AssertPlaceHolder>" ; } getAlpha ( ) { return alpha ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testGetPublicKey ( ) { net . named_data . jndn . security . identity . FilePrivateKeyStorage instance = new net . named_data . jndn . security . identity . FilePrivateKeyStorage ( ) ; net . named_data . jndn . security . certificate . PublicKey result = instance . getPublicKey ( new net . named_data . jndn . Name ( "/test/KEY/123" ) ) ; "<AssertPlaceHolder>" ; } getPublicKey ( net . named_data . jndn . Name ) { net . named_data . jndn . security . tpm . TpmKeyHandle key = findKey ( keyName ) ; if ( key == null ) return new net . named_data . jndn . util . Blob ( ) ; else return key . derivePublicKey ( ) ; } | org . junit . Assert . assertNotNull ( result ) |
testUnBindUserConfiguration ( ) { org . apache . jackrabbit . oak . spi . security . user . UserConfiguration uc = org . mockito . Mockito . mock ( org . apache . jackrabbit . oak . spi . security . user . UserConfiguration . class ) ; securityProvider . bindUserConfiguration ( uc ) ; securityProvider . unbindUserConfiguration ( uc ) ; "<AssertPlaceHolder>" ; for ( org . apache . jackrabbit . oak . spi . security . SecurityConfiguration sc : securityProvider . getConfigurations ( ) ) { if ( sc instanceof org . apache . jackrabbit . oak . spi . security . user . UserConfiguration ) { org . junit . Assert . fail ( ) ; } } } getConfiguration ( java . lang . Class ) { if ( ( org . apache . jackrabbit . oak . spi . security . authentication . AuthenticationConfiguration . class ) == configClass ) { return ( ( T ) ( new org . apache . jackrabbit . oak . spi . security . authentication . OpenAuthenticationConfiguration ( ) ) ) ; } else if ( ( org . apache . jackrabbit . oak . spi . security . authorization . AuthorizationConfiguration . class ) == configClass ) { return ( ( T ) ( new org . apache . jackrabbit . oak . spi . security . authorization . OpenAuthorizationConfiguration ( ) ) ) ; } else { throw new java . lang . IllegalArgumentException ( ( "Unsupported<sp>security<sp>configuration<sp>class<sp>" + configClass ) ) ; } } | org . junit . Assert . assertNull ( securityProvider . getConfiguration ( org . apache . jackrabbit . oak . spi . security . user . UserConfiguration . class ) ) |
testByteArray ( ) { byte [ ] some = new byte [ 12 ] ; java . util . Map < java . lang . String , java . lang . Object > row = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; row . put ( "someKey" , some ) ; long bytesUsed = org . sagebionetworks . repo . model . query . jdo . SizeLimitRowMapper . getRowSizeBytes ( row ) ; long expected = 12 ; "<AssertPlaceHolder>" ; } getRowSizeBytes ( java . util . Map ) { long bytesUsed = 0 ; java . util . Iterator it = rowMap . values ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { java . lang . Object value = it . next ( ) ; if ( value == null ) continue ; if ( value instanceof java . lang . String ) { java . lang . String sValue = ( ( java . lang . String ) ( value ) ) ; bytesUsed += ( sValue . length ( ) ) * ( org . sagebionetworks . repo . model . query . jdo . SizeLimitRowMapper . BYTES_PER_CHAR ) ; } else if ( value instanceof java . lang . Long ) { bytesUsed += org . sagebionetworks . repo . model . query . jdo . SizeLimitRowMapper . BYTES_PER_LONG ; } else if ( value instanceof java . lang . Integer ) { bytesUsed += org . sagebionetworks . repo . model . query . jdo . SizeLimitRowMapper . BYTES_PER_INTEGER ; } else if ( value instanceof java . lang . Double ) { bytesUsed += org . sagebionetworks . repo . model . query . jdo . SizeLimitRowMapper . BYTES_PER_DOUBLE ; } else if ( value instanceof byte [ ] ) { byte [ ] bytes = ( ( byte [ ] ) ( value ) ) ; bytesUsed += bytes . length ; } else { throw new java . lang . IllegalArgumentException ( ( "Unknown<sp>value<sp>type:<sp>" + ( value . getClass ( ) . getName ( ) ) ) ) ; } } return bytesUsed ; } | org . junit . Assert . assertEquals ( expected , bytesUsed ) |
connectionSQLExecutionFails ( ) { final org . zapodot . junit . db . internal . FilePathInitializationPlugin filePathInitializationPlugin = new org . zapodot . junit . db . internal . FilePathInitializationPlugin ( "classpath:initial.sql" , java . nio . charset . StandardCharsets . UTF_8 ) ; "<AssertPlaceHolder>" ; when ( connection . createStatement ( ) ) . thenReturn ( statement ) ; when ( statement . execute ( anyString ( ) ) ) . thenThrow ( new java . sql . SQLException ( "Error" ) ) ; try { filePathInitializationPlugin . connectionMade ( "name" , connection ) ; } finally { verify ( connection ) . createStatement ( ) ; verify ( statement ) . execute ( anyString ( ) ) ; verify ( statement ) . close ( ) ; verifyNoMoreInteractions ( connection , statement ) ; } } | org . junit . Assert . assertNotNull ( filePathInitializationPlugin ) |
runTest ( ) { boolean result = checkNoError ( "Social_Activities_Restore_Activity" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; } | org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result ) |
toStringValues ( ) { biweekly . property . Geo property = new biweekly . property . Geo ( 12.34 , 56.78 ) ; "<AssertPlaceHolder>" ; } toStringValues ( ) { biweekly . property . ValuedProperty < java . lang . String > property = new biweekly . property . ValuedProperty < java . lang . String > ( "value" ) ; org . junit . Assert . assertFalse ( property . toStringValues ( ) . isEmpty ( ) ) ; } | org . junit . Assert . assertFalse ( property . toStringValues ( ) . isEmpty ( ) ) |
shouldReturnTrueWhenValidatingValidPatternWithPredefinedClasses ( ) { java . lang . String validPattern = "\\d{2,3}\\w{1}" ; boolean valid = com . mifmif . common . regex . Generex . isValidPattern ( validPattern ) ; "<AssertPlaceHolder>" ; } isValidPattern ( java . lang . String ) { try { com . mifmif . common . regex . Generex . createRegExp ( regex ) ; return true ; } catch ( java . lang . IllegalArgumentException ignore ) { } catch ( java . lang . StackOverflowError ignore ) { } return false ; } | org . junit . Assert . assertThat ( valid , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( true ) ) ) |
shouldLinkTogetherTransactions ( ) { org . neo4j . kernel . impl . api . TransactionQueue . Applier applier = mock ( org . neo4j . kernel . impl . api . TransactionQueue . Applier . class ) ; int batchSize = 10 ; org . neo4j . kernel . impl . api . TransactionQueue queue = new org . neo4j . kernel . impl . api . TransactionQueue ( batchSize , applier ) ; org . neo4j . kernel . impl . api . TransactionToApply [ ] txs = new org . neo4j . kernel . impl . api . TransactionToApply [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { queue . queue ( ( txs [ i ] = new org . neo4j . kernel . impl . api . TransactionToApply ( mock ( org . neo4j . kernel . impl . transaction . TransactionRepresentation . class ) ) ) ) ; } verify ( applier , times ( 1 ) ) . apply ( any ( ) , any ( ) ) ; for ( int i = 0 ; i < ( ( txs . length ) - 1 ) ; i ++ ) { "<AssertPlaceHolder>" ; } } next ( ) { return entries . next ( ) ; } | org . junit . Assert . assertEquals ( txs [ ( i + 1 ) ] , txs [ i ] . next ( ) ) |
testRemoveDoubleType ( ) { double [ ] inputArray1 = new double [ ] { 0.1 , 3.1 , 5.1 } ; double [ ] outputArray = org . openl . rules . helpers . RulesUtilsTest . instance . testDoubleTypeRemove ( inputArray1 , 1 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( org . openl . rules . helpers . Arrays . equals ( new double [ ] { 0.1 , 5.1 } , outputArray ) ) |
testGetConfig ( ) { org . dspace . services . model . CacheConfig cacheConfig = org . dspace . services . caching . EhcacheCacheTest . cache . getConfig ( ) ; "<AssertPlaceHolder>" ; cacheConfig = null ; } getConfig ( ) { return cacheConfig ; } | org . junit . Assert . assertNotNull ( cacheConfig ) |
testOrder ( ) { int capacity = 1000 ; java . util . List < com . liferay . portal . kernel . search . Document > expectedDocuments = new java . util . ArrayList ( capacity ) ; com . liferay . portal . search . web . internal . search . results . portlet . SearchResultsSummariesHolder searchResultsSummariesHolder = new com . liferay . portal . search . web . internal . search . results . portlet . SearchResultsSummariesHolder ( capacity ) ; for ( int i = 0 ; i < capacity ; i ++ ) { com . liferay . portal . kernel . search . Document document = org . mockito . Mockito . mock ( com . liferay . portal . kernel . search . Document . class ) ; expectedDocuments . add ( document ) ; searchResultsSummariesHolder . put ( document , new com . liferay . portal . search . web . internal . result . display . context . SearchResultSummaryDisplayContext ( ) ) ; } java . util . List < com . liferay . portal . kernel . search . Document > actualDocuments = new java . util . ArrayList ( searchResultsSummariesHolder . getDocuments ( ) ) ; for ( int i = 0 ; i < capacity ; i ++ ) { "<AssertPlaceHolder>" ; } } get ( java . lang . String ) { return com . liferay . journal . content . search . web . configuration . JournalContentSearchWebConfigurationUtil . _configuration . get ( key ) ; } | org . junit . Assert . assertSame ( expectedDocuments . get ( i ) , actualDocuments . get ( i ) ) |
testSpaceLocalRepo ( ) { logTestStart ( ) ; java . io . File basedir = getBasedirForBuild ( ) ; org . apache . maven . shared . invoker . Invoker invoker = newInvoker ( ) ; org . apache . maven . shared . invoker . InvocationRequest request = new org . apache . maven . shared . invoker . DefaultInvocationRequest ( ) ; request . setBaseDirectory ( basedir ) ; request . setLocalRepositoryDirectory ( new java . io . File ( basedir , "repo<sp>with<sp>spaces" ) ) ; request . setDebug ( true ) ; request . setGoals ( java . util . Arrays . asList ( "validate" ) ) ; org . apache . maven . shared . invoker . InvocationResult result = invoker . execute ( request ) ; "<AssertPlaceHolder>" ; } getExitCode ( ) { return exitCode ; } | org . junit . Assert . assertEquals ( 0 , result . getExitCode ( ) ) |
testDeferredSubTypeBinding ( ) { final org . dummycreator . ClassBindings classBindings = new org . dummycreator . ClassBindings ( ) ; classBindings . add ( org . dummycreator . helperutils . TestChainBinding . B . class , new org . dummycreator . dummyfactories . ClassBasedFactory < org . dummycreator . helperutils . TestChainBinding . C > ( org . dummycreator . helperutils . TestChainBinding . C . class ) ) ; final org . dummycreator . DummyCreator dummyCreator = new org . dummycreator . DummyCreator ( classBindings ) ; final org . dummycreator . helperutils . TestChainBinding . B dummy = dummyCreator . create ( org . dummycreator . helperutils . TestChainBinding . B . class ) ; "<AssertPlaceHolder>" ; } create ( java . lang . Class ) { return new org . dummycreator . dummyfactories . ClassBasedFactory < T > ( clazz ) . createDummy ( classBindings ) ; } | org . junit . Assert . assertEquals ( org . dummycreator . helperutils . TestChainBinding . C . class , dummy . getClass ( ) ) |
testHierarchicalUnknownColumn ( ) { org . talend . components . processing . definition . fieldselector . FieldSelectorProperties properties = org . talend . components . processing . runtime . fieldselector . FieldSelectorDoFnTest . addSelector ( null , "id" , ".unknow" ) ; org . talend . components . processing . runtime . fieldselector . FieldSelectorDoFn function = new org . talend . components . processing . runtime . fieldselector . FieldSelectorDoFn ( ) . withProperties ( properties ) ; org . apache . beam . sdk . transforms . DoFnTester < org . apache . avro . generic . IndexedRecord , org . apache . avro . generic . IndexedRecord > fnTester = org . apache . beam . sdk . transforms . DoFnTester . of ( function ) ; java . util . List < org . apache . avro . generic . IndexedRecord > outputs = fnTester . processBundle ( inputHierarchical ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( tokenName . getValue ( ) ) == null ) { return 0 ; } return tokenName . getValue ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , outputs . size ( ) ) |
shouldNotifyOnSuccessfulCreate ( ) { diskCacheV111 . util . PnfsId parentId = new diskCacheV111 . util . PnfsId ( "000000000000000000000000000000000001" ) ; org . dcache . nfs . vfs . Inode parent = anInode ( ) . withId ( 1L ) . withPnfsId ( parentId ) . build ( ) ; org . dcache . nfs . vfs . Inode newFile = anInode ( ) . withId ( 2L ) . build ( ) ; given ( inner . create ( eq ( parent ) , any ( ) , eq ( "foo" ) , any ( ) , eq ( 493 ) ) ) . willReturn ( newFile ) ; org . dcache . nfs . vfs . Inode result = monitor . create ( parent , org . dcache . chimera . nfsv41 . door . REGULAR , "foo" , org . dcache . chimera . nfsv41 . door . MonitoringVfsTest . TEST_USER , 493 ) ; "<AssertPlaceHolder>" ; verify ( inner ) . create ( parent , org . dcache . chimera . nfsv41 . door . REGULAR , "foo" , org . dcache . chimera . nfsv41 . door . MonitoringVfsTest . TEST_USER , 493 ) ; verify ( receiver ) . notifyChildEvent ( EventType . IN_CREATE , parentId , "foo" , FileType . REGULAR ) ; verify ( receiver , never ( ) ) . notifySelfEvent ( any ( ) , any ( ) , any ( ) ) ; verify ( receiver , never ( ) ) . notifyMovedEvent ( any ( ) , any ( ) , any ( ) , any ( ) , any ( ) ) ; } create ( org . dcache . nfs . vfs . Inode , org . dcache . nfs . vfs . Stat$Type , java . lang . String , javax . security . auth . Subject , int ) { org . dcache . nfs . vfs . Inode target = super . create ( parent , type , name , subject , mode ) ; toPnfsId ( parent ) . ifPresent ( ( id ) -> eventReceiver . notifyChildEvent ( org . dcache . chimera . nfsv41 . door . IN_CREATE , id , name , asFileType ( type ) ) ) ; return target ; } | org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( newFile ) ) ) |
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . portal . kernel . model . EmailAddress > emailAddresses = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( emailAddresses . isEmpty ( ) ) |
testGet ( ) { java . lang . String expectedName = "id_Boolean" ; org . talend . components . common . config . jdbc . TalendType talendType = org . talend . components . common . config . jdbc . TalendType . get ( expectedName ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( expectedName , talendType . getName ( ) ) |
testRejectingAnonConnection ( ) { final java . lang . Process mosquitto = startMosquitto ( "src/test/resources/mosquitto/mosquitto_specified_users.conf" ) ; final pl . baczkowicz . mqttspy . common . generated . MqttConnectionDetails connectionDetails = createMqttConnectionDetails ( "tcp://localhost:10002" , null , null ) ; final pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection connection = new pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection ( reconnectionManager , "0" , connectionDetails ) ; connection . createClient ( createTestCallback ( "tcp://localhost:10002" ) ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( 1000 ) ; stopProcess ( mosquitto ) ; java . lang . Thread . sleep ( 2000 ) ; } connect ( ) { connectionState . setConnectionStatus ( ConnectionStatus . CONNECTING ) ; try { connectAndWait ( connectionDetails . getOptions ( ) ) ; pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection . logger . info ( "Successfully<sp>connected<sp>to<sp>{}" , connectionDetails . getName ( ) ) ; connectionState . setConnectionStatus ( ConnectionStatus . CONNECTED ) ; return true ; } catch ( pl . baczkowicz . spy . exceptions . SpyException e ) { pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection . logger . error ( "Connection<sp>attempt<sp>failed" , e ) ; connectionState . setConnectionStatus ( ConnectionStatus . NOT_CONNECTED ) ; } return false ; } | org . junit . Assert . assertFalse ( connection . connect ( ) ) |
shouldGetAllOrdersByPatient ( ) { org . springframework . mock . web . MockHttpServletRequest req = request ( RequestMethod . GET , getURI ( ) ) ; req . setParameter ( "patient" , org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_9 . OrderController1_9Test . PATIENT_UUID ) ; org . openmrs . module . webservices . rest . SimpleObject result = deserialize ( handle ( req ) ) ; org . openmrs . Patient patient = patientService . getPatientByUuid ( org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_9 . OrderController1_9Test . PATIENT_UUID ) ; java . util . List < org . openmrs . Order > orders = service . getOrdersByPatient ( patient ) ; "<AssertPlaceHolder>" ; } getResultsSize ( org . openmrs . module . webservices . rest . SimpleObject ) { return org . openmrs . module . webservices . rest . test . Util . getResultsList ( result ) . size ( ) ; } | org . junit . Assert . assertEquals ( orders . size ( ) , org . openmrs . module . webservices . rest . test . Util . getResultsSize ( result ) ) |
testGetPreviousResult_returns_last_result ( ) { org . joda . time . DateTime now = new org . joda . time . DateTime ( ) ; org . jmxtrans . agent . QueryResult expected = new org . jmxtrans . agent . QueryResult ( "mymetric" , 10 , now . minusSeconds ( 65 ) . getMillis ( ) ) ; writer . storeQueryResult ( expected ) ; writer . storeQueryResult ( new org . jmxtrans . agent . QueryResult ( "mymetric" , 20 , now . minusSeconds ( 54 ) . getMillis ( ) ) ) ; writer . storeQueryResult ( new org . jmxtrans . agent . QueryResult ( "mymetric" , 30 , now . minusSeconds ( 34 ) . getMillis ( ) ) ) ; org . jmxtrans . agent . QueryResult currentResult = new org . jmxtrans . agent . QueryResult ( "mymetric" , 50 , now . getMillis ( ) ) ; org . jmxtrans . agent . QueryResult actual = writer . getPreviousQueryResult ( currentResult ) ; "<AssertPlaceHolder>" ; } getPreviousQueryResult ( org . jmxtrans . agent . QueryResult ) { java . util . Queue < org . jmxtrans . agent . QueryResult > queue = previousQueryResultsByMetricName . get ( currentResult . getName ( ) ) ; if ( queue == null ) { return null ; } final long targetTimeInMillis = ( currentResult . getEpochInMillis ( ) ) - ( TimeUnit . MILLISECONDS . convert ( 60 , TimeUnit . SECONDS ) ) ; long closestDistanceToTarget = Long . MAX_VALUE ; org . jmxtrans . agent . QueryResult closestQueryResultToTarget = null ; for ( org . jmxtrans . agent . QueryResult queryResult : queue ) { if ( queryResult . isValueGreaterThan ( currentResult ) ) { } else { long distanceToTarget = java . lang . Math . abs ( ( ( queryResult . getEpochInMillis ( ) ) - targetTimeInMillis ) ) ; if ( distanceToTarget < closestDistanceToTarget ) { closestQueryResultToTarget = queryResult ; closestDistanceToTarget = distanceToTarget ; } } } return closestQueryResultToTarget ; } | org . junit . Assert . assertThat ( actual , is ( expected ) ) |
shouldBuildEmptyBraces ( ) { org . sculptor . framework . accessapi . ConditionalCriteria criteria = org . sculptor . framework . accessapi . ConditionalCriteriaBuilder . criteriaFor ( org . sculptor . framework . accessapi . ConditionalCriteriaBuilderTest . Person . class ) . lbrace ( ) . rbrace ( ) . buildSingle ( ) ; "<AssertPlaceHolder>" ; } buildSingle ( ) { assertBraceCount ( ) ; assertOperatorStack ( ) ; if ( ( criteriaStack . size ( ) ) > 1 ) { throw new java . lang . IllegalStateException ( ( "Invalid<sp>criteria,<sp>too<sp>many<sp>items<sp>in<sp>the<sp>build<sp>stack:<sp>" + ( criteriaStack . size ( ) ) ) ) ; } if ( criteriaStack . isEmpty ( ) ) { return null ; } return criteriaStack . peek ( ) ; } | org . junit . Assert . assertNull ( criteria ) |
getSubcsriptionsForManagers ( ) { java . util . Set < org . oscm . internal . types . enumtypes . SubscriptionStatus > states = java . util . EnumSet . of ( SubscriptionStatus . ACTIVE , SubscriptionStatus . PENDING , SubscriptionStatus . EXPIRED , SubscriptionStatus . PENDING_UPD , SubscriptionStatus . SUSPENDED , SubscriptionStatus . SUSPENDED_UPD ) ; customerOrg = createCustomer ( ) ; currentUser = createSupplier ( customerOrg ) ; java . util . List < org . oscm . domobjects . Subscription > list = subscriptionServiceBean . getSubscriptionsForManagers ( ) ; verify ( subscriptionDao , times ( 1 ) ) . getSubscriptionsForMyBrokerCustomers ( eq ( currentUser . getOrganization ( ) ) ) ; verify ( subscriptionDao , times ( 1 ) ) . getSubscriptionsForMyCustomers ( eq ( currentUser . getOrganization ( ) ) , eq ( states ) ) ; "<AssertPlaceHolder>" ; } getOrganization ( ) { return organization ; } | org . junit . Assert . assertNotNull ( list ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.