input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testJetx ( ) { jetbrick . template . JetEngine engine = jetbrick . template . JetEngine . create ( ) ; jetbrick . template . JetTemplate template = engine . getTemplate ( "/register.jetx" ) ; java . util . Map < java . lang . String , java . lang . Object > context = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; context . put ( "username" , "biezhi" ) ; context . put ( "email" , "admin@biezhi.me" ) ; context . put ( "url" , "<a<sp>href='http://biezhi.me'>https://biezhi.me/active/asdkjajdasjdkaweoi</a>" ) ; java . io . StringWriter writer = new java . io . StringWriter ( ) ; template . render ( context , writer ) ; java . lang . String output = writer . toString ( ) ; System . out . println ( output ) ; io . github . biezhi . ome . OhMyEmail . subject ( "Jetx" ) . from ( "" ) . to ( io . github . biezhi . ome . OhMyEmailTest . TO_EMAIL ) . html ( output ) . send ( ) ; "<AssertPlaceHolder>" ; } send ( ) { if ( ( ( text ) == null ) && ( ( html ) == null ) ) { throw new java . lang . IllegalArgumentException ( "At<sp>least<sp>one<sp>context<sp>has<sp>to<sp>be<sp>provided:<sp>Text<sp>or<sp>Html" ) ; } io . github . biezhi . ome . MimeMultipart cover ; boolean usingAlternative = false ; boolean hasAttachments = ( attachments . size ( ) ) > 0 ; try { if ( ( ( text ) != null ) && ( ( html ) == null ) ) { cover = new io . github . biezhi . ome . MimeMultipart ( "mixed" ) ; cover . addBodyPart ( textPart ( ) ) ; } else if ( ( ( text ) == null ) && ( ( html ) != null ) ) { cover = new io . github . biezhi . ome . MimeMultipart ( "mixed" ) ; cover . addBodyPart ( htmlPart ( ) ) ; } else { cover = new io . github . biezhi . ome . MimeMultipart ( "alternative" ) ; cover . addBodyPart ( textPart ( ) ) ; cover . addBodyPart ( htmlPart ( ) ) ; usingAlternative = true ; } io . github . biezhi . ome . MimeMultipart content = cover ; if ( usingAlternative && hasAttachments ) { content = new io . github . biezhi . ome . MimeMultipart ( "mixed" ) ; content . addBodyPart ( toBodyPart ( cover ) ) ; } for ( io . github . biezhi . ome . MimeBodyPart attachment : attachments ) { content . addBodyPart ( attachment ) ; } msg . setContent ( content ) ; msg . setSentDate ( new io . github . biezhi . ome . Date ( ) ) ; io . github . biezhi . ome . Transport . send ( msg ) ; } catch ( java . lang . Exception e ) { throw new io . github . biezhi . ome . SendMailException ( e ) ; } } | org . junit . Assert . assertTrue ( true ) |
testIntegerMapEscaping ( ) { final java . util . Map < java . lang . Integer , java . lang . Object > map1 = new java . util . HashMap ( ) ; map1 . put ( 1 , "value.#pizda" ) ; final java . lang . String marshalled = org . nohope . typetools . JacksonProcessorTest . marshall ( map1 ) ; final java . lang . Object restored = org . nohope . typetools . JacksonProcessorTest . unmarshall ( marshalled , java . lang . Object . class ) ; "<AssertPlaceHolder>" ; } unmarshall ( java . lang . String , java . lang . Class ) { try { return org . nohope . typetools . JacksonProcessorTest . MAPPER . readValue ( json , clazz ) ; } catch ( final java . lang . Exception e ) { final java . lang . String message = java . lang . String . format ( "Unable<sp>to<sp>unmarshall<sp>from<sp>json:<sp>%s<sp>to<sp>%s" , json , clazz ) ; throw new java . lang . AssertionError ( message , e ) ; } } | org . junit . Assert . assertEquals ( map1 , restored ) |
formatMethodAlreadyFormattedJavaDoc ( ) { java . lang . String classDef = "class<sp>Test<sp>{\n" + ( ( ( ( ( ( ( "\n" + "\t/**\n" ) + "\t<sp>*<sp>A<sp>simple<sp>comment,\n" ) + "\t<sp>*<sp>that<sp>is<sp>on<sp>two<sp>lines.\n" ) + "\t<sp>*/\n" ) + "\tvoid<sp>method()<sp>{\n" ) + "\t}\n" ) + "}" ) ; org . jlato . parser . Parser parser = new org . jlato . parser . Parser ( ParserConfiguration . Default . preserveWhitespaces ( true ) ) ; org . jlato . unit . printer . TypeDecl typeDecl = parser . parse ( ParseContext . TypeDecl , classDef ) ; "<AssertPlaceHolder>" ; } printToString ( org . jlato . tree . Tree , boolean ) { java . io . StringWriter writer = new java . io . StringWriter ( ) ; org . jlato . printer . Printer . printTo ( tree , new java . io . PrintWriter ( writer ) , format ) ; return writer . toString ( ) ; } | org . junit . Assert . assertEquals ( classDef , org . jlato . printer . Printer . printToString ( typeDecl , false ) ) |
testNewBond ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IBond bond = builder . newInstance ( org . openscience . cdk . interfaces . IBond . class ) ; "<AssertPlaceHolder>" ; } getBuilder ( ) { return org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ; } | org . junit . Assert . assertNotNull ( bond ) |
nullSchema ( ) { org . everit . json . schema . NullSchema actual = ( ( org . everit . json . schema . NullSchema ) ( org . everit . json . schema . loader . SchemaLoader . load ( org . everit . json . schema . loader . SchemaLoaderTest . get ( "nullSchema" ) ) ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return super . get ( name ) ; } | org . junit . Assert . assertNotNull ( actual ) |
getIsRegularFileAttributeOfFile_shouldReturnTrue ( ) { writeToCache ( "/file.txt" ) ; commitToMaster ( ) ; initGitFileSystem ( ) ; java . nio . file . attribute . BasicFileAttributes attributes = readPosixAttributes ( "/file.txt" ) ; "<AssertPlaceHolder>" ; } isRegularFile ( ) { return ( com . beijunyi . parallelgit . filesystem . io . REGULAR_FILE . equals ( getMode ( ) ) ) || ( isExecutableFile ( ) ) ; } | org . junit . Assert . assertEquals ( true , attributes . isRegularFile ( ) ) |
emptyConstructor ( ) { org . openscience . cdk . group . Partition p = new org . openscience . cdk . group . Partition ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return sp ; } | org . junit . Assert . assertEquals ( 0 , p . size ( ) ) |
executeOnNodeFailure ( ) { com . basho . riak . client . core . FutureOperation operation = org . powermock . api . mockito . PowerMockito . mock ( com . basho . riak . client . core . FutureOperation . class ) ; com . basho . riak . client . core . DefaultNodeManager nodeManager = new com . basho . riak . client . core . DefaultNodeManager ( ) ; nodeManager . init ( mockNodes ) ; boolean executed = nodeManager . executeOnNode ( operation , null ) ; for ( com . basho . riak . client . core . RiakNode mockNode : mockNodes ) { verify ( mockNode ) . execute ( operation ) ; } "<AssertPlaceHolder>" ; } execute ( com . basho . riak . client . core . FutureOperation ) { stateCheck ( com . basho . riak . client . core . RiakNode . State . RUNNING , com . basho . riak . client . core . RiakNode . State . HEALTH_CHECKING ) ; operation . setLastNode ( this ) ; io . netty . channel . Channel channel = getConnection ( ) ; if ( channel != null ) { inProgressMap . put ( channel , operation ) ; io . netty . channel . ChannelFuture writeFuture = channel . writeAndFlush ( operation ) ; writeFuture . addListener ( writeListener ) ; logger . debug ( "Operation<sp>{}<sp>being<sp>executed<sp>on<sp>RiakNode<sp>{}:{}" , java . lang . System . identityHashCode ( operation ) , remoteAddress , port ) ; return true ; } else { logger . debug ( "Operation<sp>{}<sp>not<sp>being<sp>executed<sp>Riaknode<sp>{}:{};<sp>no<sp>connections<sp>available" , java . lang . System . identityHashCode ( operation ) , remoteAddress , port ) ; return false ; } } | org . junit . Assert . assertFalse ( executed ) |
testCloseFileDataOutIsNullCase ( ) { textFileOutput = new org . pentaho . di . trans . steps . textfileoutput . TextFileOutput ( stepMockHelper . stepMeta , stepMockHelper . stepDataInterface , 0 , stepMockHelper . transMeta , stepMockHelper . trans ) ; textFileOutput . data = org . mockito . Mockito . mock ( org . pentaho . di . trans . steps . textfileoutput . TextFileOutputData . class ) ; "<AssertPlaceHolder>" ; textFileOutput . closeFile ( ) ; } | org . junit . Assert . assertNull ( textFileOutput . data . out ) |
testQName ( ) { javax . xml . namespace . QName elementName = new javax . xml . namespace . QName ( "http://my.name.org" , "myElement" ) ; org . apache . camel . dataformat . soap . name . QNameStrategy strategy = new org . apache . camel . dataformat . soap . name . QNameStrategy ( elementName ) ; javax . xml . namespace . QName actualElementName = strategy . findQNameForSoapActionOrType ( null , com . example . customerservice . GetCustomersByName . class ) ; "<AssertPlaceHolder>" ; } findQNameForSoapActionOrType ( java . lang . String , java . lang . Class ) { javax . xml . bind . annotation . XmlType xmlType = type . getAnnotation ( javax . xml . bind . annotation . XmlType . class ) ; if ( ( xmlType == null ) || ( ( xmlType . name ( ) ) == null ) ) { throw new java . lang . RuntimeException ( ( ( "The<sp>type<sp>" + ( type . getName ( ) ) ) + "<sp>needs<sp>to<sp>have<sp>an<sp>XmlType<sp>annotation<sp>with<sp>name" ) ) ; } java . lang . String localName = null ; java . lang . String nameSpace = null ; javax . xml . bind . annotation . XmlRootElement root = type . getAnnotation ( javax . xml . bind . annotation . XmlRootElement . class ) ; if ( root != null ) { localName = ( org . apache . camel . util . ObjectHelper . isEmpty ( localName ) ) ? root . name ( ) : localName ; nameSpace = ( isInValidNamespace ( nameSpace ) ) ? root . namespace ( ) : nameSpace ; } if ( org . apache . camel . util . ObjectHelper . isEmpty ( localName ) ) { localName = xmlType . name ( ) ; } if ( isInValidNamespace ( nameSpace ) ) { javax . xml . bind . annotation . XmlSchema xmlSchema = type . getPackage ( ) . getAnnotation ( javax . xml . bind . annotation . XmlSchema . class ) ; if ( xmlSchema != null ) { nameSpace = xmlSchema . namespace ( ) ; } } if ( isInValidNamespace ( nameSpace ) ) { nameSpace = xmlType . namespace ( ) ; } if ( ( org . apache . camel . util . ObjectHelper . isEmpty ( localName ) ) || ( isInValidNamespace ( nameSpace ) ) ) { throw new java . lang . IllegalStateException ( ( ( "Unable<sp>to<sp>determine<sp>localName<sp>or<sp>namespace<sp>for<sp>type<sp><" + ( type . getName ( ) ) ) + ">" ) ) ; } return new javax . xml . namespace . QName ( nameSpace , localName ) ; } | org . junit . Assert . assertEquals ( elementName , actualElementName ) |
lockShouldReturnFalseIfTableIsEmpty ( ) { initShouldNotCreateTheSchemaIfItAlreadyExists ( ) ; reset ( connection , metaData , statement , preparedStatement , resultSet ) ; expect ( connection . isClosed ( ) ) . andReturn ( false ) ; expect ( connection . prepareStatement ( ( ( "SELECT<sp>*<sp>FROM<sp>" + ( tableName ) ) + "<sp>FOR<sp>UPDATE" ) ) ) . andReturn ( preparedStatement ) ; preparedStatement . setQueryTimeout ( 10 ) ; expect ( preparedStatement . execute ( ) ) . andReturn ( true ) ; preparedStatement . close ( ) ; expect ( connection . isClosed ( ) ) . andReturn ( false ) ; expect ( connection . prepareStatement ( ( "SELECT<sp>COUNT(*)<sp>FROM<sp>" + ( tableName ) ) ) ) . andReturn ( preparedStatement ) ; preparedStatement . setQueryTimeout ( 10 ) ; expect ( preparedStatement . executeQuery ( ) ) . andReturn ( resultSet ) ; expect ( resultSet . next ( ) ) . andReturn ( Boolean . TRUE ) ; expect ( resultSet . getInt ( 1 ) ) . andReturn ( 0 ) ; preparedStatement . close ( ) ; replay ( connection , metaData , statement , preparedStatement , resultSet ) ; boolean lockAcquired = lock . lock ( ) ; verify ( connection , metaData , statement , preparedStatement , resultSet ) ; "<AssertPlaceHolder>" ; } lock ( ) { return acquireLock ( ) ; } | org . junit . Assert . assertFalse ( lockAcquired ) |
testSet_InitializesFormattedMessage ( ) { final org . apache . logging . log4j . message . ReusableSimpleMessage msg = new org . apache . logging . log4j . message . ReusableSimpleMessage ( ) ; msg . set ( "abc" ) ; "<AssertPlaceHolder>" ; } getFormattedMessage ( ) { return ( messageText ) != null ? messageText . toString ( ) : ( message ) == null ? null : message . getFormattedMessage ( ) ; } | org . junit . Assert . assertEquals ( "abc" , msg . getFormattedMessage ( ) ) |
testEmbedFlagEncodeDecode ( ) { java . util . Random rnd = new java . util . Random ( 2112093961 ) ; org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag [ ] values = EmbedDefinition . EmbedFlag . values ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { java . util . ArrayList < org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag > flags = new java . util . ArrayList ( ) ; for ( int j = 1 ; j < ( values . length ) ; j ++ ) { if ( rnd . nextBoolean ( ) ) { flags . add ( values [ j ] ) ; } } org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag [ ] flagArray = flags . toArray ( new org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag [ flags . size ( ) ] ) ; long encoded = org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag . encodeFlags ( flagArray ) ; "<AssertPlaceHolder>" ; } } decodeFlags ( long ) { if ( flaglong == 0 ) return new org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag [ 0 ] ; java . util . ArrayList < org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag > flags = new java . util . ArrayList ( ) ; for ( org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag f : org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag . values ( ) ) { if ( ( flaglong & ( f . bitValue ) ) != 0 ) flags . add ( f ) ; } return flags . toArray ( new org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag [ flags . size ( ) ] ) ; } | org . junit . Assert . assertArrayEquals ( flagArray , org . daxplore . presenter . shared . EmbedDefinition . EmbedFlag . decodeFlags ( encoded ) ) |
testSuggestEnabledOnRegexProp ( ) { org . apache . jackrabbit . oak . spi . state . NodeBuilder rules = builder . child ( org . apache . jackrabbit . oak . plugins . index . search . FulltextIndexConstants . INDEX_RULES ) ; rules . child ( TestUtil . NT_TEST ) ; org . apache . jackrabbit . oak . plugins . index . search . TestUtil . child ( rules , "oak:TestNode/properties/prop2" ) . setProperty ( org . apache . jackrabbit . oak . plugins . index . search . FulltextIndexConstants . PROP_NAME , ".*" ) . setProperty ( FulltextIndexConstants . PROP_IS_REGEX , true ) . setProperty ( FulltextIndexConstants . PROP_USE_IN_SUGGEST , true ) ; root = org . apache . jackrabbit . oak . plugins . index . search . TestUtil . registerTestNodeType ( builder ) . getNodeState ( ) ; org . apache . jackrabbit . oak . plugins . index . search . IndexDefinition idxDefn = new org . apache . jackrabbit . oak . plugins . index . search . IndexDefinition ( root , builder . getNodeState ( ) , "/foo" ) ; "<AssertPlaceHolder>" ; } isSuggestEnabled ( ) { return suggestEnabled ; } | org . junit . Assert . assertTrue ( idxDefn . isSuggestEnabled ( ) ) |
testFlush ( ) { final int [ ] flushCnt = new int [ 1 ] ; final java . io . OutputStream mockout = new java . io . OutputStream ( ) { @ org . eclipse . jgit . transport . Override public void write ( int arg0 ) throws java . io . IOException { org . junit . Assert . fail ( "should<sp>not<sp>write" ) ; } @ org . eclipse . jgit . transport . Override public void flush ( ) throws java . io . IOException { ( flushCnt [ 0 ] ) ++ ; } } ; try ( org . eclipse . jgit . transport . SideBandOutputStream out = new org . eclipse . jgit . transport . SideBandOutputStream ( org . eclipse . jgit . transport . SideBandOutputStream . CH_DATA , org . eclipse . jgit . transport . SideBandOutputStream . SMALL_BUF , mockout ) ) { out . flush ( ) ; } "<AssertPlaceHolder>" ; } flush ( ) { try { beginWrite ( ) ; dst . flush ( ) ; } catch ( java . io . InterruptedIOException e ) { throw writeTimedOut ( ) ; } finally { endWrite ( ) ; } } | org . junit . Assert . assertEquals ( 1 , flushCnt [ 0 ] ) |
testRestrictionWithInvalidType ( ) { org . apache . jackrabbit . oak . util . NodeUtil restriction = createAcl ( ) . getChild ( aceName ) . getChild ( org . apache . jackrabbit . oak . security . authorization . accesscontrol . REP_RESTRICTIONS ) ; restriction . setName ( org . apache . jackrabbit . oak . security . authorization . accesscontrol . REP_GLOB , "rep:glob" ) ; try { root . commit ( ) ; org . junit . Assert . fail ( "Creating<sp>restriction<sp>with<sp>invalid<sp>type<sp>should<sp>fail." ) ; } catch ( org . apache . jackrabbit . oak . api . CommitFailedException e ) { "<AssertPlaceHolder>" ; } } isAccessControlViolation ( ) { return isOfType ( org . apache . jackrabbit . oak . api . CommitFailedException . ACCESS_CONTROL ) ; } | org . junit . Assert . assertTrue ( e . isAccessControlViolation ( ) ) |
shouldApplyUpdateUniquenessConstraintRuleSchemaRuleCommandToTheStore ( ) { final org . neo4j . kernel . impl . api . BatchTransactionApplier applier = newApplier ( false ) ; final org . neo4j . kernel . impl . store . record . DynamicRecord record = org . neo4j . kernel . impl . store . record . DynamicRecord . dynamicRecord ( 21 , true ) ; final java . util . Collection < org . neo4j . kernel . impl . store . record . DynamicRecord > recordsAfter = singletonList ( record ) ; final org . neo4j . kernel . impl . store . record . ConstraintRule rule = org . neo4j . kernel . impl . transaction . command . NeoStoreTransactionApplierTest . uniquenessConstraintRule ( 0L , 1 , 2 , 3L ) ; final org . neo4j . kernel . impl . transaction . command . Command . SchemaRuleCommand command = new org . neo4j . kernel . impl . transaction . command . Command . SchemaRuleCommand ( java . util . Collections . emptyList ( ) , recordsAfter , rule ) ; boolean result = apply ( applier , command :: handle , transactionToApply ) ; "<AssertPlaceHolder>" ; verify ( schemaStore , times ( 1 ) ) . updateRecord ( record ) ; verify ( metaDataStore , times ( 1 ) ) . setLatestConstraintIntroducingTx ( transactionId ) ; verify ( cacheAccess , times ( 1 ) ) . addSchemaRule ( rule ) ; } apply ( org . neo4j . kernel . api . proc . Context , java . lang . Object [ ] , org . neo4j . kernel . api . ResourceTracker ) { try { java . lang . Thread . sleep ( 50 ) ; } catch ( java . lang . InterruptedException e ) { throw new org . neo4j . internal . kernel . api . exceptions . ProcedureException ( Status . General . UnknownError , e , "Interrupted" ) ; } return org . neo4j . collection . RawIterator . empty ( ) ; } | org . junit . Assert . assertFalse ( result ) |
testSize ( ) { org . apache . tajo . datum . Datum d = org . apache . tajo . datum . DatumFactory . createInt8 ( 5L ) ; "<AssertPlaceHolder>" ; } size ( ) { return taskRequestQueue . size ( ) ; } | org . junit . Assert . assertEquals ( 8 , d . size ( ) ) |
amfCreatorAnnotatedImmutableObject ( ) { flex . messaging . io . PropertyProxy result = org . springframework . flex . core . io . SpringPropertyProxy . proxyFor ( org . springframework . flex . core . io . domain . ImmutableValueObject . class , false , new org . springframework . core . convert . support . GenericConversionService ( ) ) ; "<AssertPlaceHolder>" ; } proxyFor ( java . lang . Class , boolean , org . springframework . core . convert . ConversionService ) { if ( org . springframework . flex . core . io . PropertyProxyUtils . hasAmfCreator ( beanType ) ) { org . springframework . flex . core . io . SpringPropertyProxy proxy = new org . springframework . flex . core . io . SpringPropertyProxy . DelayedWriteSpringPropertyProxy ( beanType , useDirectFieldAccess , conversionService ) ; return proxy ; } else { org . springframework . util . Assert . isTrue ( ( ( beanType . isEnum ( ) ) || ( org . springframework . util . ClassUtils . hasConstructor ( beanType ) ) ) , ( ( ( ( ( "Failed<sp>to<sp>create<sp>SpringPropertyProxy<sp>for<sp>" + ( beanType . getName ( ) ) ) + "<sp>-<sp>Classes<sp>mapped<sp>" ) + "for<sp>deserialization<sp>from<sp>AMF<sp>must<sp>have<sp>either<sp>a<sp>no-arg<sp>default<sp>constructor,<sp>" ) + "or<sp>a<sp>constructor<sp>annotated<sp>with<sp>" ) + ( org . springframework . flex . core . io . AmfCreator . class . getName ( ) ) ) ) ; org . springframework . flex . core . io . SpringPropertyProxy proxy = new org . springframework . flex . core . io . SpringPropertyProxy ( beanType , useDirectFieldAccess , conversionService ) ; try { java . lang . Object instance = org . springframework . beans . BeanUtils . instantiate ( beanType ) ; proxy . setPropertyNames ( org . springframework . flex . core . io . PropertyProxyUtils . findPropertyNames ( conversionService , useDirectFieldAccess , instance ) ) ; } catch ( org . springframework . beans . BeanInstantiationException ex ) { } return proxy ; } } | org . junit . Assert . assertEquals ( SpringPropertyProxy . DelayedWriteSpringPropertyProxy . class , result . getClass ( ) ) |
editMacro ( ) { when ( macroFactory . getGroovyMacroCode ( de . blizzy . documentr . web . macro . MacroControllerTest . MACRO ) ) . thenReturn ( de . blizzy . documentr . web . macro . MacroControllerTest . CODE ) ; java . lang . String result = controller . editMacro ( de . blizzy . documentr . web . macro . MacroControllerTest . MACRO , model ) ; "<AssertPlaceHolder>" ; verify ( model ) . addAttribute ( eq ( "macroForm" ) , argMacroForm ( de . blizzy . documentr . web . macro . MacroControllerTest . MACRO , de . blizzy . documentr . web . macro . MacroControllerTest . CODE ) ) ; } editMacro ( java . lang . String , org . springframework . ui . Model ) { java . lang . String code = macroFactory . getGroovyMacroCode ( name ) ; de . blizzy . documentr . web . macro . MacroForm form = new de . blizzy . documentr . web . macro . MacroForm ( name , code ) ; model . addAttribute ( "macroForm" , form ) ; return "/macro/edit" ; } | org . junit . Assert . assertEquals ( "/macro/edit" , result ) |
testEndpointRegistrationRequest ( ) { org . kaaproject . kaa . server . transport . channel . ChannelContext channelContextMock = org . mockito . Mockito . mock ( org . kaaproject . kaa . server . transport . channel . ChannelContext . class ) ; org . kaaproject . kaa . common . endpoint . gen . SyncRequest request = new org . kaaproject . kaa . common . endpoint . gen . SyncRequest ( ) ; request . setRequestId ( org . kaaproject . kaa . server . operations . service . akka . DefaultAkkaServiceTest . REQUEST_ID ) ; org . kaaproject . kaa . common . endpoint . gen . SyncRequestMetaData md = new org . kaaproject . kaa . common . endpoint . gen . SyncRequestMetaData ( ) ; md . setSdkToken ( org . kaaproject . kaa . server . operations . service . akka . DefaultAkkaServiceTest . SDK_TOKEN ) ; md . setEndpointPublicKeyHash ( clientPublicKeyHash ) ; md . setProfileHash ( clientPublicKeyHash ) ; request . setSyncRequestMetaData ( md ) ; org . kaaproject . kaa . common . endpoint . gen . ProfileSyncRequest profileSync = new org . kaaproject . kaa . common . endpoint . gen . ProfileSyncRequest ( ) ; profileSync . setEndpointPublicKey ( clientPublicKey ) ; profileSync . setProfileBody ( java . nio . ByteBuffer . wrap ( org . kaaproject . kaa . server . operations . service . akka . DefaultAkkaServiceTest . PROFILE_BODY . getBytes ( ) ) ) ; request . setProfileSyncRequest ( profileSync ) ; whenSync ( simpleResponse ) ; org . kaaproject . kaa . server . transport . message . MessageBuilder responseBuilder = org . mockito . Mockito . mock ( org . kaaproject . kaa . server . transport . message . MessageBuilder . class ) ; org . kaaproject . kaa . server . transport . message . ErrorBuilder errorBuilder = org . mockito . Mockito . mock ( org . kaaproject . kaa . server . transport . message . ErrorBuilder . class ) ; org . kaaproject . kaa . server . transport . message . SessionInitMessage message = toSignedRequest ( java . util . UUID . randomUUID ( ) , ChannelType . SYNC , channelContextMock , request , responseBuilder , errorBuilder ) ; "<AssertPlaceHolder>" ; akkaService . process ( message ) ; org . mockito . Mockito . verify ( operationsService , org . mockito . Mockito . timeout ( ( ( org . kaaproject . kaa . server . operations . service . akka . DefaultAkkaServiceTest . TIMEOUT ) * 10 ) ) . atLeastOnce ( ) ) . syncClientProfile ( org . mockito . Mockito . any ( org . kaaproject . kaa . server . operations . pojo . SyncContext . class ) , org . mockito . Mockito . any ( org . kaaproject . kaa . server . sync . ProfileClientSync . class ) ) ; org . mockito . Mockito . verify ( responseBuilder , org . mockito . Mockito . timeout ( org . kaaproject . kaa . server . operations . service . akka . DefaultAkkaServiceTest . TIMEOUT ) . atLeastOnce ( ) ) . build ( org . mockito . Mockito . any ( byte [ ] . class ) , org . mockito . Mockito . any ( boolean . class ) ) ; } getActorSystem ( ) { return akka ; } | org . junit . Assert . assertNotNull ( akkaService . getActorSystem ( ) ) |
waitForSuccessfulSubscriptionUpdate ( ) { io . joynr . pubsub . subscription . AttributeSubscriptionListener < java . lang . Integer > integerListener = mock ( io . joynr . pubsub . subscription . AttributeSubscriptionListener . class ) ; io . joynr . pubsub . SubscriptionQos subscriptionQos = new joynr . OnChangeSubscriptionQos ( ) ; io . joynr . proxy . Future < java . lang . String > subscriptionFuture = proxy . subscribeToTestAttribute ( integerListener , subscriptionQos ) ; java . lang . String subscriptionId = subscriptionFuture . get ( io . joynr . integration . AbstractSubscriptionEnd2EndTest . FUTURE_SUBSCRIPTION_ID_TIMEOUTMS ) ; subscriptionFuture = proxy . subscribeToTestAttribute ( subscriptionId , integerListener , subscriptionQos ) ; java . lang . String subscriptionId2 = subscriptionFuture . get ( io . joynr . integration . AbstractSubscriptionEnd2EndTest . FUTURE_SUBSCRIPTION_ID_TIMEOUTMS ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( io . joynr . integration . AbstractSubscriptionEnd2EndTest . EXPECTED_LATENCY_MS ) ; verify ( integerListener , times ( 2 ) ) . onSubscribed ( eq ( subscriptionId ) ) ; verify ( integerListener , times ( 0 ) ) . onError ( null ) ; verify ( integerListener , times ( 2 ) ) . onReceive ( anyInt ( ) ) ; proxy . unsubscribeFromTestAttribute ( subscriptionId ) ; verifyNoMoreInteractions ( integerListener ) ; getSubscriptionTestsPublisher ( ) . waitForAttributeUnsubscription ( "testAttribute" ) ; } get ( java . lang . String ) { io . joynr . messaging . routing . RoutingTableImpl . logger . trace ( "entering<sp>get(participantId={})" , participantId ) ; dumpRoutingTableEntry ( ) ; io . joynr . messaging . routing . RoutingTableImpl . RoutingEntry routingEntry = hashMap . get ( participantId ) ; if ( routingEntry == null ) { io . joynr . messaging . routing . RoutingTableImpl . logger . trace ( "leaving<sp>get(participantId={})<sp>=<sp>null" , participantId ) ; return null ; } io . joynr . messaging . routing . RoutingTableImpl . logger . trace ( "leaving<sp>get(participantId={})<sp>=<sp>{}" , participantId , routingEntry . getAddress ( ) ) ; return routingEntry . getAddress ( ) ; } | org . junit . Assert . assertEquals ( subscriptionId , subscriptionId2 ) |
testUpdateTitle ( ) { final java . lang . String name = "mockName" ; final org . kie . workbench . common . stunner . core . diagram . Diagram mockDiagram = mockDiagram ( name , null ) ; final org . kie . workbench . common . stunner . core . diagram . Metadata metadata = new org . kie . workbench . common . stunner . core . diagram . MetadataImpl ( ) ; marshaller . updateTitle ( metadata , mockDiagram . getGraph ( ) ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return super . getTitle ( ) ; } | org . junit . Assert . assertEquals ( metadata . getTitle ( ) , name ) |
testValidItem ( ) { java . lang . String id = "de7a758e-ed76-45c0-af82-aa731950693d" . replace ( "-" , "" ) ; ddf . catalog . content . data . ContentItem item = new ddf . catalog . content . data . impl . ContentItemImpl ( id , null , null , "" , null ) ; "<AssertPlaceHolder>" ; } validate ( ddf . catalog . content . data . ContentItem ) { if ( ( item == null ) || ( org . apache . commons . lang . StringUtils . isBlank ( item . getUri ( ) ) ) ) { return false ; } if ( org . apache . commons . lang . StringUtils . isNotBlank ( item . getQualifier ( ) ) ) { boolean qualifierValid = ddf . catalog . content . data . impl . ContentItemValidator . validateInput ( item . getQualifier ( ) , ddf . catalog . content . data . impl . ContentItemValidator . QUALIFIER_PATTERN ) ; if ( ! qualifierValid ) { return false ; } } if ( ddf . catalog . content . data . impl . ContentItemValidator . CONTENT_PATTERN . matcher ( item . getUri ( ) ) . matches ( ) ) { return true ; } return false ; } | org . junit . Assert . assertThat ( ddf . catalog . content . data . impl . ContentItemValidator . validate ( item ) , org . hamcrest . Matchers . is ( true ) ) |
getLast ( ) { com . gs . collections . api . collection . ImmutableCollection < java . lang . Integer > integers = this . classUnderTest ( ) ; "<AssertPlaceHolder>" ; } valueOf ( char ) { return function . valueOf ( charParameter ) ; } | org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( integers . size ( ) ) , integers . getLast ( ) ) |
fileFinderTest ( ) { try { java . nio . file . Files . write ( java . nio . file . Paths . get ( ( ( java . lang . System . getProperty ( "java.io.tmpdir" ) ) + "/test.xml" ) ) , java . util . Arrays . asList ( "Test" ) , java . nio . charset . Charset . forName ( "UTF-8" ) ) ; java . io . InputStream file = new com . uniovi . nmapgui . util . Filefinder ( ) . find ( "test" ) ; java . io . BufferedReader r = new java . io . BufferedReader ( new java . io . InputStreamReader ( file , java . nio . charset . StandardCharsets . UTF_8 ) ) ; java . lang . String str = null ; str = r . readLine ( ) ; "<AssertPlaceHolder>" ; java . nio . file . Files . delete ( java . nio . file . Paths . get ( ( ( java . lang . System . getProperty ( "java.io.tmpdir" ) ) + "/test.xml" ) ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; try { java . nio . file . Files . delete ( java . nio . file . Paths . get ( ( ( java . lang . System . getProperty ( "java.io.tmpdir" ) ) + "/test.xml" ) ) ) ; } catch ( java . io . IOException e1 ) { } org . junit . Assert . fail ( ) ; } } find ( java . lang . String ) { java . io . File xml = new java . io . File ( ( ( ( ( java . lang . System . getProperty ( "java.io.tmpdir" ) ) + "/" ) + filename ) + ".xml" ) ) ; return new java . io . FileInputStream ( xml ) ; } | org . junit . Assert . assertEquals ( "Test" , str ) |
retrieveInvalidChecksum ( ) { when ( mockChannel . getProperty ( JarLoader . THEIRS ) ) . thenReturn ( mockJarLoader ) ; java . io . File expected = fileSystemJarCache . map ( expectedChecksum . sum1 , expectedChecksum . sum2 ) ; writeToFile ( expected , "This<sp>is<sp>no<sp>going<sp>to<sp>match<sp>the<sp>checksum" ) ; mockCorrectLoad ( ) ; java . net . URL url = fileSystemJarCache . retrieve ( mockChannel , expectedChecksum . sum1 , expectedChecksum . sum2 ) ; "<AssertPlaceHolder>" ; } forURL ( java . net . URL ) { try { java . security . MessageDigest md = java . security . MessageDigest . getInstance ( JarLoaderImpl . DIGEST_ALGORITHM ) ; try ( java . io . InputStream istsream = url . openStream ( ) ; java . io . OutputStream ostream = new java . security . DigestOutputStream ( new hudson . remoting . Checksum . NullOutputStream ( ) , md ) ) { hudson . remoting . Util . copy ( istsream , ostream ) ; return new hudson . remoting . Checksum ( md . digest ( ) , ( ( md . getDigestLength ( ) ) / 8 ) ) ; } } catch ( java . security . NoSuchAlgorithmException e ) { throw new java . lang . AssertionError ( e ) ; } } | org . junit . Assert . assertEquals ( expectedChecksum , hudson . remoting . Checksum . forURL ( url ) ) |
testLongValuePositive2 ( ) { byte [ ] aBytes = new byte [ ] { 12 , 56 , 100 , 18 , - 105 , 34 , - 18 , 45 } ; long result = 880563758158769709L ; long aNumber = new java . math . BigInteger ( aBytes ) . longValue ( ) ; "<AssertPlaceHolder>" ; } longValue ( ) { return value ; } | org . junit . Assert . assertTrue ( ( aNumber == result ) ) |
testDequeuePacket ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( packet ) ) |
testPartijBijhoudingsGemeenteNull ( ) { overtreders = bral2104 . voerRegelUit ( maakHuidigeSituatie ( null , null ) , null , maakActie ( nl . bzk . brp . bijhouding . business . regels . impl . gegevenset . verbintenis . BRAL2104Test . PARTIJ_BREDA ) , maakBestaandeBetrokkenen ( true , new nl . bzk . brp . model . algemeen . stamgegeven . kern . PartijAttribuut [ ] { null } ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , overtreders . size ( ) ) |
testSerialization ( ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream out = new java . io . ObjectOutputStream ( baos ) ; org . apache . shindig . gadgets . http . HttpResponse response = new org . apache . shindig . gadgets . http . HttpResponseBuilder ( ) . addHeader ( "Foo" , "bar" ) . addHeader ( "Foo" , "baz" ) . addHeader ( "Blah" , "blah" ) . setHttpStatusCode ( 204 ) . setResponseString ( "This<sp>is<sp>the<sp>response<sp>string" ) . create ( ) ; out . writeObject ( response ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ; java . io . ObjectInputStream in = new java . io . ObjectInputStream ( bais ) ; org . apache . shindig . gadgets . http . HttpResponse deserialized = ( ( org . apache . shindig . gadgets . http . HttpResponse ) ( in . readObject ( ) ) ) ; "<AssertPlaceHolder>" ; } writeObject ( java . io . ObjectOutputStream ) { out . defaultWriteObject ( ) ; } | org . junit . Assert . assertEquals ( response , deserialized ) |
testToArray_EmptyString ( ) { java . sql . Array emptyArray = converter . toArray ( "" ) ; "<AssertPlaceHolder>" ; } getArray ( ) { return array ; } | org . junit . Assert . assertEquals ( 0 , ( ( java . lang . Object [ ] ) ( emptyArray . getArray ( ) ) ) . length ) |
testReturnTypeException ( ) { java . lang . Object expected = new java . lang . Object ( ) ; java . lang . Object result = org . slieb . throwables . BinaryOperatorWithThrowable . castBinaryOperatorWithThrowable ( ( v1 , v2 ) -> { throw new java . lang . Exception ( "expect<sp>exception" ) ; } ) . thatReturnsOnCatch ( expected ) . apply ( null , null ) ; "<AssertPlaceHolder>" ; } apply ( T , T ) { try { return applyWithThrowable ( v1 , v2 ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } } | org . junit . Assert . assertEquals ( expected , result ) |
quotaManagerCanRequestFileDeletionFromCacheAfterWriteWhenNotCacheOnInbound ( ) { when ( cache . getReader ( "url" ) ) . thenReturn ( cachedContent ) ; when ( backingStore . getReader ( "url" ) ) . thenReturn ( sourceContent ) ; when ( sourceContent . getSize ( ) ) . thenReturn ( 1274L ) ; when ( cache . put ( "url" , sourceContent ) ) . thenReturn ( true ) ; org . alfresco . repo . content . caching . quota . QuotaManagerStrategy quota = mock ( org . alfresco . repo . content . caching . quota . QuotaManagerStrategy . class ) ; cachingStore . setQuota ( quota ) ; when ( quota . beforeWritingCacheFile ( 1274L ) ) . thenReturn ( true ) ; when ( quota . afterWritingCacheFile ( 1234L ) ) . thenReturn ( false ) ; org . alfresco . service . cmr . repository . ContentReader returnedReader = cachingStore . getReader ( "url" ) ; verify ( cache ) . deleteFile ( "url" ) ; verify ( cache ) . remove ( "url" ) ; "<AssertPlaceHolder>" ; } remove ( java . lang . Object ) { cloneMap ( ) ; return map . remove ( key ) ; } | org . junit . Assert . assertSame ( returnedReader , sourceContent ) |
shouldExpandStringsComposedByOnlyTilde ( ) { java . lang . String result = expander . expand ( "~" ) ; java . lang . String expected = java . lang . System . getProperty ( "user.home" ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { readLock . lock ( ) ; try { return properties . getProperty ( key ) ; } finally { readLock . unlock ( ) ; } } | org . junit . Assert . assertEquals ( expected , result ) |
countPreviousContinuedBackslash_A$String$int$int ( ) { java . lang . String str = null ; int currentNotBackslashCharIndex = 0 ; int count = 0 ; int actual = org . junithelper . core . filter . impl . TrimInsideOfBraceFilter . countPreviousContinuedBackslash ( str , currentNotBackslashCharIndex , count ) ; int expected = 0 ; "<AssertPlaceHolder>" ; } countPreviousContinuedBackslash ( java . lang . String , int , int ) { org . junithelper . core . util . Assertion . on ( "currentNotBackslashCharIndex" ) . mustBeGreaterThanOrEqual ( currentNotBackslashCharIndex , 0 ) ; org . junithelper . core . util . Assertion . on ( "count" ) . mustBeGreaterThanOrEqual ( count , 0 ) ; java . lang . Character previous = null ; if ( currentNotBackslashCharIndex > 0 ) { int previousIndex = currentNotBackslashCharIndex - 1 ; previous = str . charAt ( previousIndex ) ; if ( previous == '\\' ) { return org . junithelper . core . filter . impl . TrimInsideOfBraceFilter . countPreviousContinuedBackslash ( str , previousIndex , ( count + 1 ) ) ; } else { return count ; } } return count ; } | org . junit . Assert . assertEquals ( expected , actual ) |
info ( ) { java . lang . String uuid = java . util . UUID . randomUUID ( ) . toString ( ) ; resetOutput ( ) ; org . spincast . plugins . logbackutils . tests . OnClasspathTest . logger . info ( uuid ) ; java . lang . String output = getOutput ( ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { java . lang . Object object = getElement ( jsonPath , true , getdefaultElementValidator ( ) , true ) ; if ( object == ( getdefaultElementValidator ( ) ) ) { return false ; } else { return true ; } } | org . junit . Assert . assertFalse ( output . contains ( uuid ) ) |
panopticOperationsHandlerSetUgi ( ) { java . lang . String user = "user" ; java . util . List < java . lang . String > groups = com . google . common . collect . Lists . newArrayList ( ) ; when ( primaryDatabaseClient . set_ugi ( user , groups ) ) . thenReturn ( com . google . common . collect . Lists . newArrayList ( "ugi" ) ) ; when ( metaStoreMappingFederated . getClient ( ) ) . thenReturn ( federatedDatabaseClient ) ; when ( federatedDatabaseClient . set_ugi ( user , groups ) ) . thenReturn ( com . google . common . collect . Lists . newArrayList ( "ugi" , "ugi2" ) ) ; com . hotels . bdp . waggledance . mapping . service . PanopticOperationHandler handler = service . getPanopticOperationHandler ( ) ; java . util . List < com . hotels . bdp . waggledance . mapping . model . DatabaseMapping > databaseMappings = service . getDatabaseMappings ( ) ; java . util . List < java . lang . String > result = handler . setUgi ( user , groups , databaseMappings ) ; "<AssertPlaceHolder>" ; } getDatabaseMappings ( ) { java . util . List < com . hotels . bdp . waggledance . mapping . model . DatabaseMapping > databaseMappings = java . util . Arrays . asList ( primaryMapping , otherMapping ) ; when ( wrapped . getDatabaseMappings ( ) ) . thenReturn ( databaseMappings ) ; org . junit . Assert . assertThat ( service . getDatabaseMappings ( ) , org . hamcrest . Matchers . is ( databaseMappings ) ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( java . util . Arrays . asList ( "ugi" , "ugi2" ) ) ) |
shouldReadPreparedEvent ( ) { org . kaazing . k3po . control . internal . event . PreparedEvent expectedPrepared = new org . kaazing . k3po . control . internal . event . PreparedEvent ( ) ; expectedPrepared . setScript ( "#<sp>comment" ) ; mockery . checking ( new org . jmock . Expectations ( ) { { oneOf ( input ) . read ( with ( any ( byte [ ] . class ) ) , with ( equal ( 0 ) ) , with ( any ( int . class ) ) ) ; will ( org . kaazing . k3po . control . internal . ControlTest . readInitialBytes ( 0 , ( "PREPARED\n" + ( ( ( "content-length:9\n" + "future-header:future-value\n" ) + "\n" ) + "#<sp>comment" ) ) . getBytes ( org . kaazing . k3po . control . internal . ControlTest . UTF_8 ) ) ) ; allowing ( input ) . available ( ) ; will ( returnValue ( 0 ) ) ; } } ) ; control . connect ( ) ; org . kaazing . k3po . control . internal . event . CommandEvent finished = control . readEvent ( ) ; "<AssertPlaceHolder>" ; } readEvent ( ) { return readEvent ( 0 , org . kaazing . k3po . control . internal . MILLISECONDS ) ; } | org . junit . Assert . assertEquals ( expectedPrepared , finished ) |
testTFcreation ( ) { java . util . HashMap < java . lang . String , java . lang . Integer > ground_truth = new java . util . HashMap < java . lang . String , java . lang . Integer > ( ) ; ground_truth . put ( "dog" , 1 ) ; ground_truth . put ( "fish" , 4 ) ; ground_truth . put ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 2 , 9 ) ; ground_truth . put ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 8 , 1 ) ; ground_truth . put ( "larg" , 1 ) ; ground_truth . put ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 5 , 1 ) ; ground_truth . put ( "small" 2 , 1 ) ; ground_truth . put ( "small" , 3 ) ; ground_truth . put ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 7 , 2 ) ; ground_truth . put ( "small" 3 , 1 ) ; ground_truth . put ( "swim" , 2 ) ; ground_truth . put ( "unknown" , 1 ) ; ground_truth . put ( "small" 1 , 3 ) ; org . apache . solr . common . SolrInputDocument doc = new org . apache . solr . common . SolrInputDocument ( ) ; java . lang . String id = ( java . lang . System . currentTimeMillis ( ) ) + "" ; doc . addField ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 4 , id ) ; doc . addField ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 6 , "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" ) ; solrServer . add ( doc ) ; solrServer . commit ( ) ; com . searchbox . sense . LOGGER . info ( ( ( "Getting<sp>TF<sp>for<sp>ONE<sp>document<sp>(q=id:" + id ) + "small" 0 ) ) ; java . util . Map < java . lang . String , java . util . HashMap < java . lang . String , java . lang . Integer > > tfms = com . searchbox . SolrUtils . getTermFrequencyMapForQuery ( solrServer , "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 6 , ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 1 + id ) ) ; for ( java . lang . String sid : tfms . keySet ( ) ) { com . searchbox . sense . LOGGER . info ( ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 9 + sid ) ) ; for ( java . util . Map . Entry < java . lang . String , java . lang . Integer > tf : tfms . get ( sid ) . entrySet ( ) ) { com . searchbox . sense . LOGGER . info ( ( ( ( "\t" + ( tf . getKey ( ) ) ) + "\t" ) + ( tf . getValue ( ) ) ) ) ; "<AssertPlaceHolder>" ; } } } getTermFrequencyMapForQuery ( org . apache . solr . client . solrj . SolrServer , java . lang . String , java . lang . String ) { java . util . Map < java . lang . String , java . util . HashMap < java . lang . String , java . lang . Integer > > vectors = new java . util . HashMap < java . lang . String , java . util . HashMap < java . lang . String , java . lang . Integer > > ( ) ; com . searchbox . SolrUtils . LOGGER . info ( ( ( ( "Getting<sp>TF<sp>for<sp>[" + fieldName ) + "]<sp>with<sp>q=" ) + query ) ) ; org . apache . solr . common . params . ModifiableSolrParams params = new org . apache . solr . common . params . ModifiableSolrParams ( ) ; params . set ( "qt" , "/tvrh" ) ; params . set ( "tv.tf" , "true" ) ; params . set ( "/tvrh" 0 , fieldName ) ; params . set ( "q" , query ) ; params . set ( "rows" , 50 ) ; org . apache . solr . client . solrj . response . QueryResponse response = server . query ( params ) ; org . apache . solr . common . util . NamedList termVectors = ( ( org . apache . solr . common . util . NamedList ) ( response . getResponse ( ) . get ( "/tvrh" 1 ) ) ) ; for ( int i = 1 ; i < ( termVectors . size ( ) ) ; i ++ ) { org . apache . solr . common . util . NamedList doc = ( ( org . apache . solr . common . util . NamedList ) ( termVectors . getVal ( i ) ) ) ; java . lang . String id = ( ( java . lang . String ) ( doc . get ( "uniqueKey" ) ) ) ; org . apache . solr . common . util . NamedList tf = ( ( org . apache . solr . common . util . NamedList ) ( doc . get ( fieldName ) ) ) ; java . util . HashMap < java . lang . String , java . lang . Integer > tfmap = new java . util . HashMap < java . lang . String , java . lang . Integer > ( ) ; if ( tf != null ) { for ( int tfi = 0 ; tfi < ( tf . size ( ) ) ; tfi ++ ) { java . lang . String term = tf . getName ( tfi ) ; java . lang . Integer count = ( ( java . lang . Integer ) ( ( ( org . apache . solr . common . util . NamedList ) ( tf . getVal ( tfi ) ) ) . get ( "tf" ) ) ) ; tfmap . put ( term , count ) ; } } vectors . put ( id , tfmap ) ; } return vectors ; } | org . junit . Assert . assertTrue ( ( ( "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 3 + ( tf . getKey ( ) ) ) + "jump<sp>jumping<sp>jumped<sp>swim<sp>swimming<sp>swam<sp>dog<sp>fish<sp>fish<sp>fish<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>happy<sp>sad<sp>large<sp>small<sp>small<sp>small<sp>unknown<sp>party<sp>internet<sp>studying<sp>fish<sp>study<sp>and<sp>the<sp>" 0 ) , ( ( ground_truth . get ( tf . getKey ( ) ) ) == ( tf . getValue ( ) ) ) ) |
copyBBForExcludeNull ( ) { org . slim3 . util . BeanUtilTest . SrcBB src = new org . slim3 . util . BeanUtilTest . SrcBB ( ) ; org . slim3 . util . BeanUtilTest . DestBB dest = new org . slim3 . util . BeanUtilTest . DestBB ( ) ; dest . aaa = "111" ; org . slim3 . util . BeanUtil . copy ( src , dest , new org . slim3 . util . CopyOptions ( ) . excludeNull ( ) ) ; "<AssertPlaceHolder>" ; } excludeNull ( ) { excludeNull = true ; return this ; } | org . junit . Assert . assertThat ( dest . aaa , org . hamcrest . CoreMatchers . is ( "111" ) ) |
testGetUsersForOrganization_hideOnbehalfUsers ( ) { container . login ( customerUser . getKey ( ) , org . oscm . identityservice . bean . ROLE_ORGANIZATION_ADMIN ) ; org . oscm . identityservice . bean . List < org . oscm . internal . vo . VOUserDetails > oldList = idService . getUsersForOrganization ( ) ; container . login ( supplierAdminUser . getKey ( ) , org . oscm . identityservice . bean . ROLE_SERVICE_MANAGER ) ; idService . createOnBehalfUser ( customer . getOrganizationId ( ) , "pwd123" ) ; container . login ( customerUser . getKey ( ) , org . oscm . identityservice . bean . ROLE_ORGANIZATION_ADMIN ) ; org . oscm . identityservice . bean . List < org . oscm . internal . vo . VOUserDetails > newList = idService . getUsersForOrganization ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; } | org . junit . Assert . assertEquals ( oldList . size ( ) , newList . size ( ) ) |
testXIOCharset ( ) { io . protostuff . MsgpackSimpleTest . ExampleMessage message = new io . protostuff . MsgpackSimpleTest . ExampleMessage ( ) ; message . field2 = "" ; byte [ ] xdata = io . protostuff . MsgpackXIOUtil . toByteArray ( message , io . protostuff . MsgpackSimpleTest . SCHEMA , false , io . protostuff . LinkedBuffer . allocate ( ) ) ; byte [ ] data = io . protostuff . MsgpackIOUtil . toByteArray ( message , io . protostuff . MsgpackSimpleTest . SCHEMA , false ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object , java . lang . Object ) { return ( a == b ) || ( ( a != null ) && ( a . equals ( b ) ) ) ; } | org . junit . Assert . assertTrue ( java . util . Arrays . equals ( data , xdata ) ) |
testCustomPredicate ( ) { org . trimou . engine . listener . EnhancedStatsCollector collector = new org . trimou . engine . listener . EnhancedStatsCollector ( ( t ) -> false , java . util . concurrent . TimeUnit . DAYS ) ; org . trimou . Mustache mustache = org . trimou . engine . MustacheEngineBuilder . newBuilder ( ) . addMustacheListener ( collector ) . build ( ) . compileMustache ( "qux" , "Oops" ) ; mustache . render ( null ) ; "<AssertPlaceHolder>" ; } getStats ( org . trimou . Mustache ) { org . trimou . util . Checker . checkArgumentNotNull ( mustache ) ; java . util . concurrent . ConcurrentMap < java . lang . Long , org . trimou . engine . listener . EnhancedStatsCollector . ExecutionData > times = data . getIfPresent ( mustache . getGeneratedId ( ) ) ; if ( times != null ) { return parseData ( mustache . getName ( ) , mustache . getGeneratedId ( ) , times . values ( ) ) ; } return null ; } | org . junit . Assert . assertNull ( collector . getStats ( mustache ) ) |
testWithEmptyGraphWithVertices ( ) { org . apache . flink . api . java . DataSet < org . apache . flink . graph . Vertex < org . apache . flink . types . LongValue , org . apache . flink . types . LongValue > > degree ; degree = emptyGraphWithVertices . run ( new org . apache . flink . graph . asm . degree . annotate . undirected . VertexDegree < org . apache . flink . types . LongValue , org . apache . flink . types . NullValue , org . apache . flink . types . NullValue > ( ) . setIncludeZeroDegreeVertices ( false ) ) ; "<AssertPlaceHolder>" ; degree = emptyGraphWithVertices . run ( new org . apache . flink . graph . asm . degree . annotate . undirected . VertexDegree < org . apache . flink . types . LongValue , org . apache . flink . types . NullValue , org . apache . flink . types . NullValue > ( ) . setIncludeZeroDegreeVertices ( true ) ) ; java . lang . String expectedResult = "(0,0)\n" + ( "(1,0)\n" + "(2,0)" ) ; org . apache . flink . test . util . TestBaseUtils . compareResultAsText ( degree . collect ( ) , expectedResult ) ; } collect ( ) { final java . lang . String id = new org . apache . flink . util . AbstractID ( ) . toString ( ) ; final org . apache . flink . api . common . typeutils . TypeSerializer < T > serializer = getType ( ) . createSerializer ( getExecutionEnvironment ( ) . getConfig ( ) ) ; this . output ( new org . apache . flink . api . java . Utils . CollectHelper < > ( id , serializer ) ) . name ( "collect()" ) ; org . apache . flink . api . common . JobExecutionResult res = getExecutionEnvironment ( ) . execute ( ) ; java . util . ArrayList < byte [ ] > accResult = res . getAccumulatorResult ( id ) ; if ( accResult != null ) { try { return org . apache . flink . api . common . accumulators . SerializedListAccumulator . deserializeList ( accResult , serializer ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( "Cannot<sp>find<sp>type<sp>class<sp>of<sp>collected<sp>data<sp>type." , e ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( "Serialization<sp>error<sp>while<sp>deserializing<sp>collected<sp>data" , e ) ; } } else { throw new java . lang . RuntimeException ( "The<sp>call<sp>to<sp>collect()<sp>could<sp>not<sp>retrieve<sp>the<sp>DataSet." ) ; } } | org . junit . Assert . assertEquals ( 0 , degree . collect ( ) . size ( ) ) |
testTemplateInUri3 ( ) { com . ning . atlas . spi . Uri < ? > uri = com . ning . atlas . spi . Uri . valueOf ( "hello:name?key={value}" ) ; "<AssertPlaceHolder>" ; } isTemplate ( ) { return isTemplate ; } | org . junit . Assert . assertThat ( uri . isTemplate ( ) , org . hamcrest . CoreMatchers . equalTo ( true ) ) |
testQueryDistinctId ( ) { org . nuxeo . ecm . core . api . DocumentModelList dml ; createDocs ( ) ; dml = session . query ( "SELECT<sp>DISTINCT<sp>ecm:uuid<sp>FROM<sp>File" ) ; "<AssertPlaceHolder>" ; } size ( ) { return getCollectedDocumentIds ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , dml . size ( ) ) |
testFindFailType ( ) { org . pf4j . ExtensionFinder instance = new org . pf4j . AbstractExtensionFinder ( pluginManager ) { @ org . pf4j . Override public java . util . Map < java . lang . String , java . util . Set < java . lang . String > > readPluginsStorages ( ) { return java . util . Collections . emptyMap ( ) ; } @ org . pf4j . Override public java . util . Map < java . lang . String , java . util . Set < java . lang . String > > readClasspathStorages ( ) { return java . util . Collections . emptyMap ( ) ; } } ; java . util . List < org . pf4j . ExtensionWrapper < org . pf4j . plugin . FailTestPlugin > > list = instance . find ( org . pf4j . plugin . FailTestPlugin . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return finders . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , list . size ( ) ) |
test_getPrimaryMonitor ( ) { org . eclipse . swt . widgets . Display display = new org . eclipse . swt . widgets . Display ( ) ; org . eclipse . swt . widgets . Monitor monitor = display . getPrimaryMonitor ( ) ; "<AssertPlaceHolder>" ; display . dispose ( ) ; } | org . junit . Assert . assertNotNull ( monitor ) |
testIsNotInLatestSchemaVersion ( ) { _innerPortalUpgradeProcess . updateSchemaVersion ( com . liferay . portal . upgrade . PortalUpgradeProcessTest . _ORIGINAL_SCHEMA_VERSION ) ; try ( java . sql . Connection connection = com . liferay . portal . kernel . dao . jdbc . DataAccess . getConnection ( ) ) { "<AssertPlaceHolder>" ; } } isInLatestSchemaVersion ( java . sql . Connection ) { com . liferay . portal . kernel . version . Version latestSchemaVersion = com . liferay . portal . upgrade . PortalUpgradeProcess . getLatestSchemaVersion ( ) ; if ( latestSchemaVersion . equals ( com . liferay . portal . upgrade . PortalUpgradeProcess . getCurrentSchemaVersion ( connection ) ) ) { return true ; } return false ; } | org . junit . Assert . assertFalse ( com . liferay . portal . upgrade . PortalUpgradeProcess . isInLatestSchemaVersion ( connection ) ) |
testOutputStreamFilter ( ) { org . linguafranca . pwdb . kdbx . File temp = org . linguafranca . pwdb . kdbx . File . createTempFile ( "temp" , "temp" ) ; org . linguafranca . pwdb . kdbx . OutputStream outputStream = new org . linguafranca . pwdb . kdbx . FileOutputStream ( temp ) ; org . linguafranca . xml . XmlOutputStreamFilter filter = new org . linguafranca . xml . XmlOutputStreamFilter ( outputStream , new org . linguafranca . pwdb . kdbx . simple . transformer . KdbxOutputTransformer . None ( ) ) ; outputStream . write ( "<test>hello<sp>world</test>" . getBytes ( ) ) ; outputStream . flush ( ) ; outputStream . close ( ) ; org . linguafranca . pwdb . kdbx . InputStream inputStream = new org . linguafranca . pwdb . kdbx . FileInputStream ( temp ) ; org . linguafranca . xml . XmlInputStreamFilter filter1 = new org . linguafranca . xml . XmlInputStreamFilter ( inputStream , new org . linguafranca . xml . XmlEventTransformer . None ( ) ) ; byte [ ] b = new byte [ 1024 ] ; int l = filter1 . read ( b ) ; java . lang . String s = new java . lang . String ( b , 0 , l ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( "<test>hello<sp>world</test>" , s ) |
testDefaultInjection ( ) { final org . apache . druid . guice . JsonConfigurator configurator = injector . getBinding ( org . apache . druid . guice . JsonConfigurator . class ) . getProvider ( ) . get ( ) ; final org . apache . druid . guice . JsonConfigProvider < org . apache . druid . query . lookup . LookupListeningAnnouncerConfig > configProvider = org . apache . druid . guice . JsonConfigProvider . of ( org . apache . druid . query . lookup . LookupListeningAnnouncerConfigTest . propertyBase , org . apache . druid . query . lookup . LookupListeningAnnouncerConfig . class ) ; configProvider . inject ( properties , configurator ) ; final org . apache . druid . query . lookup . LookupListeningAnnouncerConfig config = configProvider . get ( ) . get ( ) ; "<AssertPlaceHolder>" ; } getLookupTier ( ) { com . google . common . base . Preconditions . checkArgument ( ( ! ( ( lookupTierIsDatasource ) && ( null != ( lookupTier ) ) ) ) , "Cannot<sp>specify<sp>both<sp>`lookupTier`<sp>and<sp>`lookupTierIsDatasource`" ) ; final java . lang . String lookupTier = ( lookupTierIsDatasource ) ? dataSourceTaskIdHolder . getDataSource ( ) : this . lookupTier ; return com . google . common . base . Preconditions . checkNotNull ( ( lookupTier == null ? org . apache . druid . query . lookup . LookupListeningAnnouncerConfig . DEFAULT_TIER : org . apache . druid . java . util . common . StringUtils . emptyToNullNonDruidDataString ( lookupTier ) ) , "Cannot<sp>have<sp>empty<sp>lookup<sp>tier<sp>from<sp>%s" , ( lookupTierIsDatasource ? "bound<sp>value" : LookupModule . PROPERTY_BASE ) ) ; } | org . junit . Assert . assertEquals ( LookupListeningAnnouncerConfig . DEFAULT_TIER , config . getLookupTier ( ) ) |
InsertCommitTest ( ) { java . lang . String sql = ( "insert<sp>into<sp>" + ( normaltblTableName ) ) + "<sp>values(?,?,?,?,?)" ; java . util . List < java . lang . Object > param = new java . util . ArrayList < java . lang . Object > ( ) ; param . add ( com . taobao . tddl . qatest . matrix . transaction . RANDOM_ID ) ; param . add ( com . taobao . tddl . qatest . matrix . transaction . RANDOM_INT ) ; param . add ( gmt ) ; param . add ( name ) ; param . add ( fl ) ; andorCon = us . getConnection ( ) ; andorCon . setAutoCommit ( false ) ; java . lang . String [ ] columnParam = new java . lang . String [ ] { "PK" , "ID" , "GMT_CREATE" , "NAME" , "FLOATCOL" } ; con = getConnection ( ) ; con . setAutoCommit ( false ) ; try { int mysqlAffectRow = mysqlUpdateDataTranscation ( sql , param ) ; int andorAffectRow = andorUpdateDataTranscation ( sql , param ) ; "<AssertPlaceHolder>" ; sql = ( ( "select<sp>*<sp>from<sp>" + ( normaltblTableName ) ) + "<sp>where<sp>pk=" ) + ( RANDOM_ID ) ; selectOrderAssertTranscation ( sql , columnParam , null ) ; con . commit ( ) ; andorCon . commit ( ) ; } catch ( java . lang . Exception ex ) { try { con . rollback ( ) ; andorCon . rollback ( ) ; } catch ( java . lang . Exception ee ) { } } sql = ( ( "select<sp>*<sp>from<sp>" + ( normaltblTableName ) ) + "<sp>where<sp>pk=" ) + ( RANDOM_ID ) ; selectOrderAssertTranscation ( sql , columnParam , null ) ; try { andorCon . commit ( ) ; andorCon . commit ( ) ; andorCon . rollback ( ) ; andorCon . rollback ( ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( e . toString ( ) ) ; } } andorUpdateDataTranscation ( java . lang . String , java . util . List ) { int rs = 0 ; try { andorPs = andorCon . prepareStatement ( sql ) ; if ( param == null ) { rs = andorPs . executeUpdate ( ) ; } else { for ( int i = 0 ; i < ( param . size ( ) ) ; i ++ ) { andorPs . setObject ( ( i + 1 ) , param . get ( i ) ) ; } rs = andorPs . executeUpdate ( ) ; } } catch ( java . lang . Exception ex ) { throw new com . taobao . tddl . common . exception . TddlRuntimeException ( ex ) ; } finally { } return rs ; } | org . junit . Assert . assertEquals ( mysqlAffectRow , andorAffectRow ) |
shouldFailWhenANCVisitIsNotTheSecondOne ( ) { java . util . Map < java . lang . String , java . lang . String > fields = org . ei . drishti . common . util . EasyMap . create ( "ancVisitNumber" , "1" ) . map ( ) ; "<AssertPlaceHolder>" ; } apply ( org . ei . drishti . util . SafeMap ) { return new org . ei . drishti . service . reporting . ChildImmunization ( ) . isImmunizedWith ( ChildImmunizationFields . BCG_VALUE , reportFields ) ; } | org . junit . Assert . assertFalse ( rule . apply ( new org . ei . drishti . util . SafeMap ( fields ) ) ) |
testMergeAclEntriesAutomaticDefaultOther ( ) { java . util . List < org . apache . hadoop . fs . permission . AclEntry > existing = new com . google . common . collect . ImmutableList . Builder < org . apache . hadoop . fs . permission . AclEntry > ( ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . ALL ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . GROUP , org . apache . hadoop . hdfs . server . namenode . READ ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . OTHER , org . apache . hadoop . hdfs . server . namenode . NONE ) ) . build ( ) ; java . util . List < org . apache . hadoop . fs . permission . AclEntry > aclSpec = com . google . common . collect . Lists . newArrayList ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . READ_EXECUTE ) , aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . GROUP , org . apache . hadoop . hdfs . server . namenode . READ_EXECUTE ) ) ; java . util . List < org . apache . hadoop . fs . permission . AclEntry > expected = new com . google . common . collect . ImmutableList . Builder < org . apache . hadoop . fs . permission . AclEntry > ( ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . ALL ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . GROUP , org . apache . hadoop . hdfs . server . namenode . READ ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . ACCESS , org . apache . hadoop . hdfs . server . namenode . OTHER , org . apache . hadoop . hdfs . server . namenode . NONE ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . USER , org . apache . hadoop . hdfs . server . namenode . READ_EXECUTE ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . GROUP , org . apache . hadoop . hdfs . server . namenode . READ_EXECUTE ) ) . add ( aclEntry ( org . apache . hadoop . hdfs . server . namenode . DEFAULT , org . apache . hadoop . hdfs . server . namenode . OTHER , org . apache . hadoop . hdfs . server . namenode . NONE ) ) . build ( ) ; "<AssertPlaceHolder>" ; } mergeAclEntries ( java . util . List , java . util . List ) { org . apache . hadoop . hdfs . server . namenode . AclTransformation . ValidatedAclSpec aclSpec = new org . apache . hadoop . hdfs . server . namenode . AclTransformation . ValidatedAclSpec ( inAclSpec ) ; java . util . ArrayList < org . apache . hadoop . fs . permission . AclEntry > aclBuilder = com . google . common . collect . Lists . newArrayListWithCapacity ( org . apache . hadoop . hdfs . server . namenode . AclTransformation . MAX_ENTRIES ) ; java . util . List < org . apache . hadoop . fs . permission . AclEntry > foundAclSpecEntries = com . google . common . collect . Lists . newArrayListWithCapacity ( org . apache . hadoop . hdfs . server . namenode . AclTransformation . MAX_ENTRIES ) ; java . util . EnumMap < org . apache . hadoop . hdfs . server . namenode . AclEntryScope , org . apache . hadoop . fs . permission . AclEntry > providedMask = com . google . common . collect . Maps . newEnumMap ( org . apache . hadoop . hdfs . server . namenode . AclEntryScope . class ) ; java . util . EnumSet < org . apache . hadoop . hdfs . server . namenode . AclEntryScope > maskDirty = java . util . EnumSet . noneOf ( org . apache . hadoop . hdfs . server . namenode . AclEntryScope . class ) ; java . util . EnumSet < org . apache . hadoop . hdfs . server . namenode . AclEntryScope > scopeDirty = java . util . EnumSet . noneOf ( org . apache . hadoop . hdfs . server . namenode . AclEntryScope . class ) ; for ( org . apache . hadoop . fs . permission . AclEntry existingEntry : existingAcl ) { org . apache . hadoop . fs . permission | org . junit . Assert . assertEquals ( expected , mergeAclEntries ( existing , aclSpec ) ) |
testTrimMapNullsXform ( ) { java . util . Map < java . lang . String , java . lang . String > m = new java . util . HashMap ( ) ; m . put ( "akey" , "aval" ) ; m . put ( "blank" , "" ) ; m . put ( "null" , null ) ; java . util . Map < java . lang . String , java . lang . String > expected = com . google . common . collect . ImmutableMap . of ( "akey" , "aval" , "blank" , "" , "null" , "" ) ; java . util . Map < java . lang . String , java . lang . String > xformed = org . apache . hadoop . hive . metastore . utils . MetaStoreServerUtils . trimMapNulls ( m , true ) ; "<AssertPlaceHolder>" ; } trimMapNulls ( java . util . Map , boolean ) { if ( dnMap == null ) { return null ; } if ( retrieveMapNullsAsEmptyStrings ) { return com . google . common . collect . Maps . newLinkedHashMap ( com . google . common . collect . Maps . transformValues ( dnMap , transFormNullsToEmptyString ) ) ; } else { return com . google . common . collect . Maps . newLinkedHashMap ( com . google . common . collect . Maps . filterValues ( dnMap , com . google . common . base . Predicates . notNull ( ) ) ) ; } } | org . junit . Assert . assertThat ( xformed , org . hamcrest . core . Is . is ( expected ) ) |
case1 ( ) { org . openstack . atlas . usagerefactor . List < org . openstack . atlas . service . domain . usage . entities . LoadBalancerMergedHostUsage > mergedRecords = usagePollerHelper . processExistingEvents ( lbHostMap ) ; "<AssertPlaceHolder>" ; org . openstack . atlas . usagerefactor . junit . AssertLoadBalancerMergedHostUsage . hasValues ( 1234 , 123 , 0L , 0L , 0L , 0L , 0 , 0 , 1 , 0 , UsageEvent . UNSUSPEND_LOADBALANCER , "2013-04-10<sp>20:02:00" , mergedRecords . get ( 0 ) ) ; } size ( ) { return size ; } | org . junit . Assert . assertEquals ( 1 , mergedRecords . size ( ) ) |
deleteRecursiveOnServiceException ( ) { when ( mClient . listObjectsChunked ( org . mockito . Matchers . anyString ( ) , org . mockito . Matchers . anyString ( ) , org . mockito . Matchers . anyString ( ) , org . mockito . Matchers . anyLong ( ) , org . mockito . Matchers . anyString ( ) ) ) . thenThrow ( org . jets3t . service . ServiceException . class ) ; boolean result = mGCSUnderFileSystem . deleteDirectory ( alluxio . underfs . gcs . GCSUnderFileSystemTest . PATH , alluxio . underfs . options . DeleteOptions . defaults ( ) . setRecursive ( true ) ) ; "<AssertPlaceHolder>" ; } setRecursive ( boolean ) { bitField0_ |= 2 ; recursive_ = value ; onChanged ( ) ; return this ; } | org . junit . Assert . assertFalse ( result ) |
getSize ( ) { org . optaplanner . core . impl . heuristic . selector . entity . EntitySelector childEntitySelector = org . optaplanner . core . impl . heuristic . selector . SelectorTestUtils . mockEntitySelector ( org . optaplanner . core . impl . testdata . domain . TestdataEntity . class , new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "e1" ) , new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "e2" ) , new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "e3" ) , new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "e4" ) ) ; org . optaplanner . core . impl . heuristic . selector . common . decorator . SelectionProbabilityWeightFactory < org . optaplanner . core . impl . testdata . domain . TestdataSolution , org . optaplanner . core . impl . testdata . domain . TestdataEntity > probabilityWeightFactory = ( scoreDirector , entity ) -> { switch ( entity . getCode ( ) ) { case "e1" : return 1000.0 ; case "e2" : return 200.0 ; case "e3" : return 30.0 ; case "e4" : return 4.0 ; default : throw new java . lang . IllegalStateException ( ( ( "Unknown<sp>entity<sp>(" + entity ) + ")." ) ) ; } } ; org . optaplanner . core . impl . heuristic . selector . entity . decorator . ProbabilityEntitySelector entitySelector = new org . optaplanner . core . impl . heuristic . selector . entity . decorator . ProbabilityEntitySelector ( childEntitySelector , org . optaplanner . core . config . heuristic . selector . common . SelectionCacheType . STEP , probabilityWeightFactory ) ; entitySelector . constructCache ( mock ( org . optaplanner . core . impl . solver . scope . DefaultSolverScope . class ) ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return ( ( to ) - ( from ) ) / ( incrementUnit ) ; } | org . junit . Assert . assertEquals ( 4 , entitySelector . getSize ( ) ) |
testDecodeGeneralizedTimeWithoutTimeZoneWithFracSec ( ) { java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . clear ( ) ; cal . set ( Calendar . YEAR , 2010 ) ; cal . set ( Calendar . MONTH , Calendar . JULY ) ; cal . set ( Calendar . DAY_OF_MONTH , 12 ) ; cal . set ( Calendar . HOUR_OF_DAY , 21 ) ; cal . set ( Calendar . MINUTE , 45 ) ; cal . set ( Calendar . SECOND , 27 ) ; cal . set ( Calendar . MILLISECOND , 300 ) ; java . util . Date expectedDate = cal . getTime ( ) ; byte [ ] data = new byte [ ] { 24 , 16 , 50 , 48 , 49 , 48 , 48 , 55 , 49 , 50 , 50 , 49 , 52 , 53 , 50 , 55 , 46 , 51 } ; java . util . Date actualDate = org . kaazing . gateway . util . asn1 . Asn1Utils . decodeGeneralizedTime ( java . nio . ByteBuffer . wrap ( data ) ) ; "<AssertPlaceHolder>" ; } wrap ( org . kaazing . mina . netty . buffer . ByteBufferWrappingChannelBuffer ) { this . buffer = buffer . buffer ; order = buffer . order ; capacity = buffer . capacity ; setIndex ( buffer . readerIndex ( ) , buffer . writerIndex ( ) ) ; return this ; } | org . junit . Assert . assertEquals ( expectedDate , actualDate ) |
testNamespaceModifyItem ( ) { long namespaceId = 1 ; com . ctrip . framework . apollo . biz . entity . Namespace namespace = createNamespace ( namespaceId ) ; com . ctrip . framework . apollo . biz . entity . Release release = createRelease ( "{\"k1\":\"v1\"}" ) ; java . util . List < com . ctrip . framework . apollo . biz . entity . Item > items = java . util . Arrays . asList ( createItem ( "k1" , "v2" ) ) ; when ( releaseService . findLatestActiveRelease ( namespace ) ) . thenReturn ( release ) ; when ( itemService . findItemsWithoutOrdered ( namespaceId ) ) . thenReturn ( items ) ; when ( namespaceService . findParentNamespace ( namespace ) ) . thenReturn ( null ) ; boolean isModified = namespaceUnlockAspect . isModified ( namespace ) ; "<AssertPlaceHolder>" ; } isModified ( com . ctrip . framework . apollo . biz . entity . Namespace ) { com . ctrip . framework . apollo . biz . entity . Release release = releaseService . findLatestActiveRelease ( namespace ) ; java . util . List < com . ctrip . framework . apollo . biz . entity . Item > items = itemService . findItemsWithoutOrdered ( namespace . getId ( ) ) ; if ( release == null ) { return hasNormalItems ( items ) ; } java . util . Map < java . lang . String , java . lang . String > releasedConfiguration = gson . fromJson ( release . getConfigurations ( ) , GsonType . CONFIG ) ; java . util . Map < java . lang . String , java . lang . String > configurationFromItems = generateConfigurationFromItems ( namespace , items ) ; com . google . common . collect . MapDifference < java . lang . String , java . lang . String > difference = com . google . common . collect . Maps . difference ( releasedConfiguration , configurationFromItems ) ; return ! ( difference . areEqual ( ) ) ; } | org . junit . Assert . assertTrue ( isModified ) |
testGetParametersWithDefaultEntity ( ) { org . lnu . is . domain . reason . Reason entity = new org . lnu . is . domain . reason . Reason ( ) ; 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 ) |
testDontWriteDuplicateLogOnBatchDeletionJobExecution ( ) { org . camunda . bpm . engine . repository . ProcessDefinition definition = testHelper . deployAndGetDefinition ( ProcessModels . ONE_TASK_PROCESS ) ; org . camunda . bpm . engine . runtime . ProcessInstance processInstance = runtimeService . startProcessInstanceById ( definition . getId ( ) ) ; batch = runtimeService . deleteProcessInstancesAsync ( java . util . Arrays . asList ( processInstance . getId ( ) ) , null , "test<sp>reason" ) ; org . camunda . bpm . engine . runtime . Job seedJob = managementService . createJobQuery ( ) . singleResult ( ) ; managementService . executeJob ( seedJob . getId ( ) ) ; for ( org . camunda . bpm . engine . runtime . Job pending : managementService . createJobQuery ( ) . list ( ) ) { managementService . executeJob ( pending . getId ( ) ) ; } "<AssertPlaceHolder>" ; } userOperationLogQuery ( ) { return historyService . createUserOperationLogQuery ( ) ; } | org . junit . Assert . assertEquals ( 5 , userOperationLogQuery ( ) . count ( ) ) |
testAddNeuronWithIndex ( ) { instance . addNeuron ( 1 , testneuron3 ) ; java . util . List < org . neuroph . core . Neuron > lst = instance . getNeurons ( ) ; "<AssertPlaceHolder>" ; } get ( int ) { return rows . get ( index ) ; } | org . junit . Assert . assertEquals ( testneuron3 , lst . get ( 1 ) ) |
cacheShouldCreateMd5FileName ( ) { com . nostra13 . universalimageloader . cache . disc . naming . Md5FileNameGenerator nameGenerator = new com . nostra13 . universalimageloader . cache . disc . naming . Md5FileNameGenerator ( ) ; com . android . volley . Cache cache = new com . navercorp . volleyextensions . cache . universalimageloader . disc . impl . UniversalLimitedAgeDiscCache ( cacheDir , nameGenerator , 2 ) ; com . nostra13 . universalimageloader . cache . disc . naming . FileNameGenerator wrappedGenerator = com . navercorp . volleyextensions . cache . universalimageloader . disc . naming . CustomizedFileNameGeneratorFactory . createFileNameGenerator ( nameGenerator ) ; java . lang . String expected = wrappedGenerator . generate ( key ) ; cache . put ( key , entry ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , android . graphics . Bitmap ) { return this . delegate . put ( key , value ) ; } | org . junit . Assert . assertThat ( cacheDir . list ( ) [ 0 ] , org . hamcrest . CoreMatchers . is ( expected ) ) |
testProcessorEventsBug394277_02 ( ) { java . lang . String events = recordRichStringProcessorEvents ( "\'\'\'<sp>�\n<sp>�<sp>\'\'\'" ) ; java . lang . String expected = "announceNextLiteral()\n" + ( ( ( ( ( ( ( ( "acceptTemplateText()\n" + "acceptTemplateLineBreak()\n" ) + "acceptTemplateText()\n" ) + "acceptSemanticText(<sp>)\n" ) + "acceptSemanticText()\n" ) + "announceNextLiteral()\n" ) + "acceptSemanticText()\n" ) + "acceptSemanticLineBreak()\n" ) + "acceptTemplateText()" ) ; "<AssertPlaceHolder>" ; } recordRichStringProcessorEvents ( java . lang . String ) { org . eclipse . xtend . core . xtend . RichString richString = richString ( string ) ; org . eclipse . xtend . core . richstring . RichStringProcessor processor = new org . eclipse . xtend . core . richstring . RichStringProcessor ( ) ; org . eclipse . xtend . core . tests . richstring . RichStringProcessorTest . RecordingRichStringPartAcceptor acceptor = new org . eclipse . xtend . core . tests . richstring . RichStringProcessorTest . RecordingRichStringPartAcceptor ( ) ; processor . process ( richString , acceptor , new org . eclipse . xtend . core . richstring . DefaultIndentationHandler ( ) ) ; return acceptor . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , events ) |
testMoveActionServiceGeneration ( ) { java . lang . Boolean actionServiceRegistered = false ; java . util . List < it . geosolutions . geobatch . annotations . GenericActionService > actionList = it . geosolutions . geobatch . annotations . ActionServicePostProcessor . getActionList ( ) ; for ( it . geosolutions . geobatch . annotations . GenericActionService action : actionList ) { if ( it . geosolutions . geobatch . actions . commons . MoveConfiguration . class . getSimpleName ( ) . equals ( action . getId ( ) ) ) { actionServiceRegistered = true ; break ; } } "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertTrue ( actionServiceRegistered ) |
buildQueryConditionsWithParameters_should_work_with_different_placeholder_values_as_fieldkeys ( ) { final java . lang . String expectedQuery = "select<sp>item_id,<sp>sampleAttribute<sp>from<sp>`testDB.sampleEntity`<sp>where<sp>sampleAttribute<='3'<sp>and<sp>item_id<sp>=<sp>'5'" ; org . springframework . data . simpledb . query . SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest ( "selectWithDifferentPlaceholders" , org . springframework . data . simpledb . query . SampleEntity . class ) ; final java . lang . String toProcessRawQuery = repositoryMethod . getAnnotatedQuery ( ) ; final org . springframework . data . repository . query . Parameters parameters = getMockParameters ( new java . lang . String [ ] { ":attribute" , ":item" } , new java . lang . Class [ ] { java . lang . String . class , java . lang . String . class } ) ; java . lang . String resultedQuery = org . springframework . data . simpledb . query . QueryUtils . buildQuery ( toProcessRawQuery , parameters , "3" , "5" ) ; "<AssertPlaceHolder>" ; } getAnnotatedQuery ( ) { java . lang . String valueParameter = getValueParameters ( ) ; java . lang . String whereParameters = getWhereParameters ( ) ; java . lang . String [ ] selectParameters = getSelectParameters ( ) ; java . lang . String result = org . springframework . data . simpledb . query . parser . QueryParserUtils . buildQueryFromQueryParameters ( valueParameter , selectParameters , whereParameters , simpleDbDomain . getDomain ( getDomainClass ( ) ) ) ; assertParameterNamesInAnnotatedQuery ( result ) ; return result ; } | org . junit . Assert . assertThat ( resultedQuery , org . hamcrest . CoreMatchers . is ( expectedQuery ) ) |
sendAuthorizationListFailedVerifyReturnValue ( ) { when ( chargePointService . sendLocalList ( any ( io . motown . ocpp . v15 . soap . chargepoint . SendLocalListRequest . class ) , eq ( io . motown . ocpp . v15 . soap . chargepoint . CHARGING_STATION_ID . getId ( ) ) ) ) . thenReturn ( getSendLocalListResponse ( UpdateStatus . FAILED ) ) ; io . motown . ocpp . v15 . soap . chargepoint . RequestResult requestResult = client . sendAuthorizationList ( io . motown . ocpp . v15 . soap . chargepoint . CHARGING_STATION_ID , io . motown . ocpp . v15 . soap . chargepoint . AUTH_LIST_HASH , io . motown . ocpp . v15 . soap . chargepoint . LIST_VERSION , io . motown . ocpp . v15 . soap . chargepoint . IDENTIFYING_TOKENS , AuthorizationListUpdateType . FULL ) ; "<AssertPlaceHolder>" ; } sendAuthorizationList ( io . motown . ocpp . v15 . soap . chargepoint . ChargingStationId , java . lang . String , int , java . util . Set , io . motown . ocpp . v15 . soap . chargepoint . AuthorizationListUpdateType ) { io . motown . ocpp . v15 . soap . chargepoint . ChargePointService chargePointService = this . createChargingStationService ( id ) ; io . motown . ocpp . v15 . soap . chargepoint . SendLocalListRequest request = new io . motown . ocpp . v15 . soap . chargepoint . SendLocalListRequest ( ) ; request . setHash ( hash ) ; request . setListVersion ( listVersion ) ; switch ( updateType ) { case DIFFERENTIAL : request . setUpdateType ( UpdateType . DIFFERENTIAL ) ; break ; case FULL : request . setUpdateType ( UpdateType . FULL ) ; break ; default : throw new java . lang . AssertionError ( java . lang . String . format ( "Unknown<sp>update<sp>type<sp>[%s]." , updateType ) ) ; } request . getLocalAuthorisationList ( ) . addAll ( identifyingTokenConverterService . convertIdentifyingTokenList ( identifyingTokens ) ) ; io . motown . ocpp . v15 . soap . chargepoint . SendLocalListResponse response = chargePointService . sendLocalList ( request , id . getId ( ) ) ; if ( UpdateStatus . ACCEPTED . equals ( response . getStatus ( ) ) ) { io . motown . ocpp . v15 . soap . chargepoint . ChargingStationOcpp15SoapClient . LOG . info ( "Update<sp>of<sp>local<sp>authorization<sp>list<sp>on<sp>{}<sp>has<sp>been<sp>accepted" , id ) ; return RequestResult . SUCCESS ; } else { java . lang . String responseStatus = ( ( response . getStatus ( ) ) != null ) ? response . getStatus ( ) . value ( ) : io . motown . ocpp . v15 . soap . chargepoint . ChargingStationOcpp15SoapClient . UNKNOWN_STATUS ; io . motown . ocpp . v15 . soap . chargepoint . ChargingStationOcpp15SoapClient . LOG . warn ( "Update<sp>of<sp>local<sp>authorization<sp>list<sp>on<sp>{}<sp>has<sp>failed<sp>due<sp>to<sp>{}" , id , responseStatus ) ; return RequestResult . FAILURE ; } } | org . junit . Assert . assertEquals ( RequestResult . FAILURE , requestResult ) |
returnsFalseIfFileNamesAreNotEqual ( ) { java . nio . file . Path neq1 = java . nio . file . Paths . get ( getClass ( ) . getResource ( "/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1" ) . toURI ( ) ) ; java . nio . file . Path neq2 = java . nio . file . Paths . get ( getClass ( ) . getResource ( "/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2" ) . toURI ( ) ) ; "<AssertPlaceHolder>" ; } gitDirectoriesAreEqual ( java . nio . file . Path , java . nio . file . Path ) { uk . ac . ic . wlgitbridge . snapshot . servermock . util . Set < java . lang . String > dir1Contents = uk . ac . ic . wlgitbridge . snapshot . servermock . util . FileUtil . getAllRecursivelyInDirectoryApartFrom ( dir1 , dir1 . resolve ( ".git" ) ) ; uk . ac . ic . wlgitbridge . snapshot . servermock . util . Set < java . lang . String > dir2Contents = uk . ac . ic . wlgitbridge . snapshot . servermock . util . FileUtil . getAllRecursivelyInDirectoryApartFrom ( dir2 , dir2 . resolve ( ".git" ) ) ; return uk . ac . ic . wlgitbridge . snapshot . servermock . util . FileUtil . filesAreEqual ( dir1 , dir2 , dir1Contents , dir2Contents ) ; } | org . junit . Assert . assertFalse ( uk . ac . ic . wlgitbridge . snapshot . servermock . util . FileUtil . gitDirectoriesAreEqual ( neq1 , neq2 ) ) |
testGetMrsImageDataProviderForWriteWhenMissing ( ) { java . lang . String missingResource = "DoesNotExist" ; org . mrgeo . data . image . MrsImageDataProvider dp = org . mrgeo . data . DataProviderFactory . getMrsImageDataProvider ( missingResource , AccessMode . WRITE , providerProperties ) ; "<AssertPlaceHolder>" ; } getMrsImageDataProvider ( java . lang . String , org . mrgeo . data . DataProviderFactory$AccessMode , org . mrgeo . data . ProviderProperties ) { return org . mrgeo . data . DataProviderFactory . getMrsImageDataProvider ( name , accessMode , org . mrgeo . data . DataProviderFactory . getBasicConfig ( ) , props ) ; } | org . junit . Assert . assertNotNull ( dp ) |
testRead2 ( ) { org . support . project . knowledge . config . LocaleTextReader localeTextReader = org . support . project . knowledge . config . LocaleTextReader . get ( ) ; java . lang . String text = localeTextReader . read ( org . support . project . knowledge . config . LocaleTextReaderTest . path , Locale . JAPANESE ) ; java . lang . String check = org . support . project . common . util . FileUtil . read ( getClass ( ) . getResourceAsStream ( org . support . project . knowledge . config . LocaleTextReaderTest . path_ja ) ) ; "<AssertPlaceHolder>" ; } read ( java . io . InputStream ) { return org . support . project . common . util . FileUtil . read ( in , "UTF-8" ) ; } | org . junit . Assert . assertEquals ( text , check ) |
shouldAcceptsAllMethodsInsideAnnotatedClass ( ) { br . com . caelum . vraptor . interceptor . WithAnnotationAcceptor acceptor = new br . com . caelum . vraptor . interceptor . WithAnnotationAcceptor ( ) ; br . com . caelum . vraptor . controller . DefaultControllerInstance controllerInstance = new br . com . caelum . vraptor . controller . DefaultControllerInstance ( new br . com . caelum . vraptor . interceptor . example . ClassLevelAcceptsController ( ) ) ; acceptor . initialize ( annotation ) ; when ( controllerMethod . getAnnotations ( ) ) . thenReturn ( new java . lang . annotation . Annotation [ ] { } ) ; "<AssertPlaceHolder>" ; } validate ( java . lang . Class , java . util . List ) { java . lang . reflect . Method accepts = invoker . findMethod ( methods , br . com . caelum . vraptor . Accepts . class , originalType ) ; if ( ( accepts != null ) && ( ! ( isBooleanReturn ( accepts . getReturnType ( ) ) ) ) ) { throw new br . com . caelum . vraptor . InterceptionException ( java . lang . String . format ( "@%s<sp>method<sp>must<sp>return<sp>boolean" , br . com . caelum . vraptor . Accepts . class . getSimpleName ( ) ) ) ; } } | org . junit . Assert . assertTrue ( acceptor . validate ( controllerMethod , controllerInstance ) ) |
testSerialization2 ( ) { org . jfree . chart . plot . MeterPlot p1 = new org . jfree . chart . plot . MeterPlot ( new org . jfree . data . general . DefaultValueDataset ( 1.23 ) ) ; org . jfree . chart . plot . MeterPlot p2 = ( ( org . jfree . chart . plot . MeterPlot ) ( org . jfree . chart . TestUtils . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( p1 , p2 ) |
getSSLContextSuccess ( ) { com . microsoft . azure . sdk . iot . device . auth . IotHubAuthenticationProvider authentication = new com . microsoft . azure . sdk . iot . device . auth . IotHubX509HardwareAuthenticationProvider ( tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubX509HardwareIotHubAuthenticationProviderTest . hostname , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubX509HardwareIotHubAuthenticationProviderTest . gatewayHostname , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubX509HardwareIotHubAuthenticationProviderTest . deviceId , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubX509HardwareIotHubAuthenticationProviderTest . moduleId , mockSecurityProviderX509 ) ; new mockit . NonStrictExpectations ( ) { { mockit . Deencapsulation . invoke ( mockIotHubSSLContext , "getSSLContext" ) ; result = mockSSLContext ; mockSecurityProviderX509 . getSSLContext ( ) ; result = mockSSLContext ; mockit . Deencapsulation . newInstance ( com . microsoft . azure . sdk . iot . deps . auth . IotHubSSLContext . class , new java . lang . Class [ ] { javax . net . ssl . SSLContext . class } , mockSSLContext ) ; result = mockIotHubSSLContext ; mockit . Deencapsulation . invoke ( mockIotHubSSLContext , "getSSLContext" ) ; result = mockSSLContext ; } } ; mockit . Deencapsulation . setField ( authentication , "iotHubSSLContext" , null ) ; javax . net . ssl . SSLContext actualSSLContext = authentication . getSSLContext ( ) ; "<AssertPlaceHolder>" ; } getSSLContext ( ) { try { if ( ( ( this . iotHubSSLContext ) == null ) || ( this . sslContextNeedsUpdate ) ) { this . iotHubSSLContext = generateSSLContext ( ) ; this . sslContextNeedsUpdate = false ; } return this . iotHubSSLContext . getSSLContext ( ) ; } catch ( java . security . cert . CertificateException | java . security . NoSuchAlgorithmException | java . security . KeyManagementException | java . security . KeyStoreException e ) { throw new java . io . IOException ( e ) ; } } | org . junit . Assert . assertEquals ( mockSSLContext , actualSSLContext ) |
valenceDefault ( ) { org . openscience . cdk . isomorphism . matchers . Expr actual = org . openscience . cdk . smarts . SmartsExprReadTest . getAtomExpr ( "[v]" ) ; org . openscience . cdk . isomorphism . matchers . Expr expected = org . openscience . cdk . smarts . SmartsExprReadTest . expr ( org . openscience . cdk . smarts . VALENCE , 1 ) ; "<AssertPlaceHolder>" ; } expr ( org . openscience . cdk . isomorphism . matchers . Expr$Type , int ) { return new org . openscience . cdk . isomorphism . matchers . Expr ( type , val ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( expected ) ) |
testRegularPojo ( ) { org . kie . spring . beans . Person p = org . kie . spring . tests . KieSpringImportKieTest . context . getBean ( "person" , org . kie . spring . beans . Person . class ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( p ) |
getIndicatieOnjuistNOkTest ( ) { final java . lang . String code = "X" ; final java . lang . String resultNat = lo3StamtabelService . getIndicatieOnjuist ( code ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( code , resultNat ) |
testAdjacentVerticesIteratorRemove ( ) { edu . ucla . sspace . graph . Graph < edu . ucla . sspace . graph . WeightedEdge > g = new edu . ucla . sspace . graph . SparseWeightedGraph ( ) ; for ( int i = 0 ; i < 10 ; ++ i ) { for ( int j = i + 1 ; j < 10 ; ++ j ) { edu . ucla . sspace . graph . WeightedEdge e = new edu . ucla . sspace . graph . SimpleWeightedEdge ( i , j , 0.5 ) ; g . add ( e ) ; } } edu . ucla . sspace . graph . Set < java . lang . Integer > test = new edu . ucla . sspace . graph . HashSet < java . lang . Integer > ( ) ; edu . ucla . sspace . graph . Set < java . lang . Integer > adjacent = g . getNeighbors ( 0 ) ; edu . ucla . sspace . graph . Iterator < java . lang . Integer > it = adjacent . iterator ( ) ; "<AssertPlaceHolder>" ; it . next ( ) ; it . remove ( ) ; } hasNext ( ) { return iter . hasNext ( ) ; } | org . junit . Assert . assertTrue ( it . hasNext ( ) ) |
testDeleteExistingEntryReferralCoreAPIManageDSAIT ( ) { org . apache . directory . server . core . api . CoreSession session = getService ( ) . getAdminSession ( ) ; org . apache . directory . api . ldap . model . name . Dn dn = new org . apache . directory . api . ldap . model . name . Dn ( "ou=Roles,o=MNN,c=WW,ou=system" ) ; session . delete ( dn , true ) ; try { session . lookup ( dn , Strings . EMPTY_STRING_ARRAY ) ; org . junit . Assert . fail ( ) ; } catch ( org . apache . directory . api . ldap . model . exception . LdapNoSuchObjectException lnsoe ) { "<AssertPlaceHolder>" ; } } lookup ( org . apache . directory . api . ldap . model . name . Dn , java . lang . String [ ] ) { org . apache . directory . server . core . api . OperationManager operationManager = directoryService . getOperationManager ( ) ; org . apache . directory . server . core . api . interceptor . context . LookupOperationContext lookupContext = new org . apache . directory . server . core . api . interceptor . context . LookupOperationContext ( this , dn , attrIds ) ; return operationManager . lookup ( lookupContext ) ; } | org . junit . Assert . assertTrue ( true ) |
getPreferredProcessorsWithFullyQualifiedNames ( ) { edu . illinois . library . cantaloupe . config . Configuration config = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) ; config . setProperty ( "processor.ManualSelectionStrategy.jpg" , edu . illinois . library . cantaloupe . processor . GraphicsMagickProcessor . class . getName ( ) ) ; config . setProperty ( Key . PROCESSOR_FALLBACK , edu . illinois . library . cantaloupe . processor . ImageMagickProcessor . class . getName ( ) ) ; java . util . List < java . lang . Class < ? extends edu . illinois . library . cantaloupe . processor . Processor > > expected = java . util . List . of ( edu . illinois . library . cantaloupe . processor . GraphicsMagickProcessor . class , edu . illinois . library . cantaloupe . processor . ImageMagickProcessor . class ) ; "<AssertPlaceHolder>" ; } getPreferredProcessors ( edu . illinois . library . cantaloupe . image . Format ) { if ( Format . JP2 . equals ( sourceFormat ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . JP2_CANDIDATES ; } else if ( Format . JPG . equals ( sourceFormat ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . JPG_CANDIDATES ; } else if ( Format . PDF . equals ( sourceFormat ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . PDF_CANDIDATES ; } else if ( Format . Type . VIDEO . equals ( sourceFormat . getType ( ) ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . VIDEO_CANDIDATES ; } return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . FALLBACK_CANDIDATES ; } | org . junit . Assert . assertEquals ( expected , instance . getPreferredProcessors ( Format . JPG ) ) |
casertaTorinoDistanceTest ( ) { org . geosdi . geoplatform . support . google . services . DistanceMatrix distanceMatrix = this . gpDistanceMatrixService . getDistanceMatrix ( new java . lang . String [ ] { "Caserta" } , new java . lang . String [ ] { "Torino" } ) . mode ( TravelMode . DRIVING ) . language ( "it" ) . await ( ) ; "<AssertPlaceHolder>" ; org . geosdi . geoplatform . support . google . services . DistanceMatrixRow distanceMatrixRow = distanceMatrix . rows [ 0 ] ; for ( org . geosdi . geoplatform . support . google . services . DistanceMatrixElement element : distanceMatrixRow . elements ) { org . geosdi . geoplatform . support . google . services . GPDistanceMatrixServiceTest . logger . info ( "######################KM<sp>:<sp>{}<sp>-<sp>Duration<sp>:<sp>{}<sp>-<sp>Fare<sp>:<sp>{}\n" , element . distance , element . duration , element . fare ) ; } } getDistanceMatrix ( java . lang . String [ ] , java . lang . String [ ] ) { return com . google . maps . DistanceMatrixApi . getDistanceMatrix ( this . geoApiContext , origins , destinations ) ; } | org . junit . Assert . assertNotNull ( distanceMatrix ) |
testConvertRrdIntoJrb ( ) { org . opennms . netmgt . rrd . model . v3 . RRDv3 rrd = org . opennms . core . xml . JaxbUtils . unmarshal ( org . opennms . netmgt . rrd . model . v3 . RRDv3 . class , new java . io . File ( "src/test/resources/rrd-dump.xml" ) ) ; org . opennms . netmgt . rrd . model . v1 . RRDv1 jrb = org . opennms . netmgt . rrd . model . RrdConvertUtils . convert ( rrd ) ; "<AssertPlaceHolder>" ; } convert ( org . opennms . netmgt . rrd . model . v1 . RRDv1 ) { org . opennms . netmgt . rrd . model . v3 . RRDv3 rrd = new org . opennms . netmgt . rrd . model . v3 . RRDv3 ( ) ; rrd . setStep ( jrb . getStep ( ) ) ; rrd . setLastUpdate ( jrb . getLastUpdate ( ) ) ; for ( org . opennms . netmgt . rrd . model . v1 . RRA rrav1 : jrb . getRras ( ) ) { org . opennms . netmgt . rrd . model . v3 . RRA rrav3 = new org . opennms . netmgt . rrd . model . v3 . RRA ( ) ; rrav3 . setConsolidationFunction ( rrav1 . getConsolidationFunction ( ) . name ( ) ) ; rrav3 . setPdpPerRow ( rrav1 . getPdpPerRow ( ) ) ; rrav3 . setRows ( rrav1 . getRows ( ) ) ; rrav3 . getParameters ( ) . setXff ( rrav1 . getXff ( ) ) ; for ( org . opennms . netmgt . rrd . model . v1 . RRADS rradsv1 : rrav1 . getDataSources ( ) ) { org . opennms . netmgt . rrd . model . v3 . RRADS rradsv3 = new org . opennms . netmgt . rrd . model . v3 . RRADS ( ) ; rradsv3 . setUnknownDataPoints ( rradsv1 . getUnknownDataPoints ( ) ) ; rradsv3 . setValue ( rradsv1 . getValue ( ) ) ; rrav3 . getDataSources ( ) . add ( rradsv3 ) ; } rrd . addRRA ( rrav3 ) ; } for ( org . opennms . netmgt . rrd . model . v1 . DS dsv1 : jrb . getDataSources ( ) ) { org . opennms . netmgt . rrd . model . v3 . DS dsv3 = new org . opennms . netmgt . rrd . model . v3 . DS ( ) ; dsv3 . setName ( dsv1 . getName ( ) ) ; dsv3 . setLastDs ( dsv1 . getLastDs ( ) ) ; dsv3 . setMin ( dsv1 . getMax ( ) ) ; dsv3 . setMax ( dsv1 . getMax ( ) ) ; dsv3 . setMinHeartbeat ( dsv1 . getMinHeartbeat ( ) ) ; dsv3 . setUnknownSec ( dsv1 . getUnknownSec ( ) ) ; dsv3 . setValue ( dsv1 . getValue ( ) ) ; dsv3 . setType ( dsv1 . getType ( ) . value ( ) ) ; rrd . addDataSource ( dsv3 ) ; } return rrd ; } | org . junit . Assert . assertNotNull ( jrb ) |
testGeldigAuthenticatieMiddelBeschikbaar ( ) { nl . bzk . brp . bevraging . business . dto . antwoord . AuthenticatieMiddelDTO dto = authenticatieService . zoekAuthenticatieMiddelEnPartijMetOndertekeningCertificaat ( java . lang . Long . valueOf ( 12 ) , org . apache . commons . codec . binary . Hex . decodeHex ( nl . bzk . brp . bevraging . business . service . impl . AuthenticatieServiceImplTest . SIGNATURE . toCharArray ( ) ) , "Subject" ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { final nl . bzk . brp . domain . expressie . Datumdeel datumdeel = new nl . bzk . brp . domain . expressie . Datumdeel ( ) ; datumdeel . waarde = waarde ; datumdeel . type = nl . bzk . brp . domain . expressie . Datumdeel . Type . WAARDE ; return datumdeel ; } | org . junit . Assert . assertNotNull ( dto ) |
testAutoMap ( ) { "<AssertPlaceHolder>" ; } automap ( ) { if ( ( ( property ) == null ) || ( ( property . getVocabulary ( ) ) == null ) ) { addActionError ( getText ( "manage.translation.cantfind.vocabulary" ) ) ; } else { org . gbif . ipt . model . Vocabulary vocab = property . getVocabulary ( ) ; int count = 0 ; for ( java . util . Map . Entry < java . lang . String , java . lang . String > sourceValueEntry : getSourceValuesMap ( ) . entrySet ( ) ) { if ( ! ( getTmap ( ) . containsValue ( sourceValueEntry . getValue ( ) ) ) ) { org . gbif . ipt . model . VocabularyConcept vc = vocab . findConcept ( sourceValueEntry . getValue ( ) ) ; if ( vc != null ) { getTmap ( ) . put ( sourceValueEntry . getKey ( ) , vc . getIdentifier ( ) ) ; count ++ ; } } } addActionMessage ( getText ( "manage.translation.mapped.terms" , new java . lang . String [ ] { java . lang . String . valueOf ( count ) } ) ) ; } return SUCCESS ; } | org . junit . Assert . assertEquals ( 3 , action . automap ( ) ) |
filter_A$Function1 ( ) { java . lang . String value = "vvv" ; com . m3 . scalaflavor4j . Some < java . lang . String > target = new com . m3 . scalaflavor4j . Some < java . lang . String > ( value ) ; com . m3 . scalaflavor4j . F1 < java . lang . String , java . lang . Boolean > f = new com . m3 . scalaflavor4j . F1 < java . lang . String , java . lang . Boolean > ( ) { @ com . m3 . scalaflavor4j . Override public com . m3 . scalaflavor4j . Boolean apply ( java . lang . String v1 ) { return true ; } } ; com . m3 . scalaflavor4j . Option < java . lang . String > actual = target . filter ( f ) ; "<AssertPlaceHolder>" ; } isDefined ( ) { return false ; } | org . junit . Assert . assertThat ( actual . isDefined ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testUserGets ( ) { java . lang . String code = "" ; try { code = _setupTestUser ( false ) ; _checkUserIntoDb ( code ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } return ; } _checkUserIntoDb ( java . lang . String ) { org . isf . menu . model . User foundUser ; foundUser = ( ( org . isf . menu . model . User ) ( org . isf . menu . test . Tests . jpa . find ( org . isf . menu . model . User . class , code ) ) ) ; org . isf . menu . test . Tests . testUser . check ( foundUser ) ; return ; } | org . junit . Assert . assertEquals ( true , false ) |
getBestNameLocale_shouldReturnNull ( ) { java . util . Locale localeToSearch = new java . util . Locale ( "en" ) ; org . openmrs . Concept concept = new org . openmrs . Concept ( ) ; org . openmrs . ConceptName conceptName = concept . getName ( localeToSearch ) ; "<AssertPlaceHolder>" ; } getName ( java . util . Locale ) { return getName ( locale , false ) ; } | org . junit . Assert . assertNull ( conceptName ) |
toGetTest ( ) { org . apache . flink . api . common . functions . RichMapFunction < java . lang . Integer , streamkv . api . java . types . KVOperation < java . lang . Integer , java . lang . String > > toGet = new streamkv . api . java . util . KVUtils . ToGet < > ( 2 ) ; toGet . open ( null ) ; "<AssertPlaceHolder>" ; try { toGet . map ( ( ( java . lang . Integer ) ( null ) ) ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { } } get ( int , K ) { return new streamkv . api . java . types . KVOperation < > ( ( ( short ) ( id ) ) , key , null , null , streamkv . api . java . types . KVOperation . KVOperationType . GET ) ; } | org . junit . Assert . assertEquals ( streamkv . api . java . types . KVOperation . get ( 2 , 2 ) , toGet . map ( 2 ) ) |
decimalPointParsingMinusTest ( ) { com . itextpdf . svg . renderers . impl . PathSvgNodeRenderer path = new com . itextpdf . svg . renderers . impl . PathSvgNodeRenderer ( ) ; java . lang . String input = "2.35.96<sp>3.25-.25" ; java . lang . String expected = "2.35<sp>.96<sp>3.25<sp>-.25" ; java . lang . String actual = path . separateDecimalPoints ( input ) ; "<AssertPlaceHolder>" ; } separateDecimalPoints ( java . lang . String ) { java . lang . StringBuilder res = new java . lang . StringBuilder ( ) ; boolean decimalPointEncountered = false ; for ( int i = 0 ; i < ( input . length ( ) ) ; i ++ ) { char c = input . charAt ( i ) ; if ( decimalPointEncountered && ( ( c == '-' ) || ( java . lang . Character . isWhitespace ( c ) ) ) ) { decimalPointEncountered = false ; } if ( c == '.' ) { if ( decimalPointEncountered ) { res . append ( "<sp>" ) ; } else { decimalPointEncountered = true ; } } else if ( c == '-' ) { res . append ( "<sp>" ) ; } res . append ( c ) ; } return res . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testProcessingOrderClientPublishServiceServerDeliver ( ) { final java . util . Queue < java . lang . String > events = new java . util . concurrent . ConcurrentLinkedQueue ( ) ; org . cometd . bayeux . server . LocalSession client = _bayeux . newLocalSession ( "cln" ) ; client . handshake ( ) ; final org . cometd . bayeux . server . LocalSession service = _bayeux . newLocalSession ( "0.cln.ext.rcv" 7 ) ; service . handshake ( ) ; final java . lang . String channelName = "/service/foo" ; client . addExtension ( new org . cometd . server . MessageProcessingOrderTest . ClientExtension ( events , "0" ) ) ; client . getChannel ( channelName ) . addListener ( new org . cometd . server . MessageProcessingOrderTest . ClientListener ( events , "0" ) ) ; _bayeux . addExtension ( new org . cometd . server . MessageProcessingOrderTest . ServerExtension ( events ) ) ; client . getServerSession ( ) . addExtension ( new org . cometd . server . MessageProcessingOrderTest . ServerSessionExtension ( events , "0" ) ) ; service . getServerSession ( ) . addExtension ( new org . cometd . server . MessageProcessingOrderTest . ServerSessionExtension ( events , "0.cln.ext.rcv" 2 ) ) ; org . cometd . bayeux . server . ServerChannel channel = _bayeux . createChannelIfAbsent ( channelName ) . getReference ( ) ; channel . addListener ( new org . cometd . server . MessageProcessingOrderTest . ServerListener ( events ) ) ; channel . addListener ( new org . cometd . bayeux . server . ServerChannel . MessageListener ( ) { @ org . cometd . server . Override public void onMessage ( org . cometd . bayeux . server . ServerSession session , org . cometd . bayeux . server . ServerChannel channel , org . cometd . bayeux . server . ServerMessage . Mutable message , org . cometd . bayeux . Promise < java . lang . Boolean > promise ) { events . offer ( "0.cln.ext.rcv" 3 ) ; session . deliver ( service , channelName , message . getData ( ) , promise ) ; } } ) ; client . getServerSession ( ) . addListener ( new org . cometd . server . MessageProcessingOrderTest . ServerSessionListener ( events , "0" ) ) ; service . getServerSession ( ) . addListener ( new org . cometd . server . MessageProcessingOrderTest . ServerSessionListener ( events , "0.cln.ext.rcv" 2 ) ) ; service . addExtension ( new org . cometd . server . MessageProcessingOrderTest . ClientExtension ( events , "0.cln.ext.rcv" 2 ) ) ; service . getChannel ( channelName ) . subscribe ( new org . cometd . server . MessageProcessingOrderTest . ClientListener ( events , "0.cln.ext.rcv" 2 ) ) ; client . getChannel ( channelName ) . publish ( "0.cln.ext.rcv" 0 ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( "0.cln.ext.rcv" 6 , "0.cln.ext.rcv" 5 , "0.cln.ext.rcv" 1 , "srv.chn.lst" , "0.cln.ext.rcv" 3 , "srv.ext.snd" , "0.cln.ext.rcv" 9 , "0.srv.ssn.lst" , "0.cln.ext.rcv" , "0.cln.lst" , "0.cln.ext.rcv" 4 , "0.srv.ssn.ext.snd.rpy" , "0.cln.ext.rcv.rpy" , "0.cln.ext.rcv" 8 ) ; "<AssertPlaceHolder>" ; } publish ( java . lang . Object ) { abort ( ) ; super . publish ( data ) ; } | org . junit . Assert . assertEquals ( expected , new java . util . ArrayList ( events ) ) |
isCurrentVmDiskStatsDifferentFromPreviousTestBothNull ( ) { boolean result = statsCollector . isCurrentVmDiskStatsDifferentFromPrevious ( null , null ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( result ) |
leesAlsCacheNietBestaatEnSchrijfMeteenWeg ( ) { int persoonId = 1 ; nl . bzk . brp . model . hisvolledig . PersoonHisVolledigCache cacheOrigineel = haalCacheVoorPersoonId ( persoonId ) ; if ( cacheOrigineel != null ) { verwijderCache ( cacheOrigineel ) ; } persoonHisVolledigRepository . haalPersoonOp ( persoonId ) ; nl . bzk . brp . model . hisvolledig . PersoonHisVolledigCache cacheNieuw = haalCacheVoorPersoonId ( persoonId ) ; "<AssertPlaceHolder>" ; } haalCacheVoorPersoonId ( int ) { return em . find ( nl . bzk . brp . model . hisvolledig . PersoonHisVolledigCache . class , persoonId ) ; } | org . junit . Assert . assertNotNull ( cacheNieuw ) |
constructorWithOwnerShouldSetOwner ( ) { ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner owner = ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner . MAIA ; resourceEntity = new ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceEntity ( owner ) ; "<AssertPlaceHolder>" ; } getOwner ( ) { return owner ; } | org . junit . Assert . assertEquals ( owner , resourceEntity . getOwner ( ) ) |
testParseAndMarshalModel1_1WithShowModel ( ) { java . lang . String subsystemXml = ( ( ( "<subsystem<sp>xmlns=\"" + ( Namespace . JMX_1_1 . getUriString ( ) ) ) + "\">" ) + "<show-model<sp>value=\"true\"/>" ) + "</subsystem>" ; java . lang . String finishedXml = ( ( ( "<subsystem<sp>xmlns=\"" + ( Namespace . CURRENT . getUriString ( ) ) ) + "\">" ) + "<sp><expose-resolved-model<sp>proper-property-format=\"false\"/>" ) + "</subsystem>" ; org . jboss . as . subsystem . test . AdditionalInitialization additionalInit = new org . jboss . as . jmx . JMXSubsystemTestCase . BaseAdditionalInitialization ( ) ; org . jboss . as . subsystem . test . KernelServices servicesA = createKernelServicesBuilder ( additionalInit ) . setSubsystemXml ( subsystemXml ) . build ( ) ; org . jboss . dmr . ModelNode modelA = servicesA . readWholeModel ( ) ; java . lang . String marshalled = servicesA . getPersistedSubsystemXml ( ) ; servicesA . shutdown ( ) ; "<AssertPlaceHolder>" ; compareXml ( null , finishedXml , marshalled , true ) ; org . jboss . as . subsystem . test . KernelServices servicesB = createKernelServicesBuilder ( additionalInit ) . setSubsystemXml ( marshalled ) . build ( ) ; org . jboss . dmr . ModelNode modelB = servicesB . readWholeModel ( ) ; super . compare ( modelA , modelB ) ; } contains ( java . lang . String ) { return registrations . containsKey ( host ) ; } | org . junit . Assert . assertTrue ( marshalled . contains ( Namespace . CURRENT . getUriString ( ) ) ) |
shouldBeFalseIfPropertyExistsAndIsEmpty ( ) { setState ( "foo.bar" , "" ) ; java . lang . System . setProperty ( "foo.bar" , "" ) ; "<AssertPlaceHolder>" ; } isActive ( org . togglz . core . repository . FeatureState , org . togglz . core . user . FeatureUser ) { return true ; } | org . junit . Assert . assertFalse ( strategy . isActive ( state , user ) ) |
testEmptySequence ( ) { java . lang . Object payload = java . util . Collections . emptySet ( ) ; org . mule . runtime . core . privileged . event . MuleSession session = new org . mule . runtime . core . privileged . event . DefaultMuleSession ( ) ; org . mule . runtime . api . message . Message toSplit = org . mule . runtime . api . message . Message . of ( payload ) ; org . mule . runtime . core . internal . routing . Splitter splitter = new org . mule . runtime . core . internal . routing . Splitter ( ) ; splitter . setMuleContext ( muleContext ) ; splitter . initialise ( ) ; org . mule . runtime . core . api . event . CoreEvent event = this . < org . mule . runtime . core . privileged . event . PrivilegedEvent . Builder > getEventBuilder ( ) . message ( toSplit ) . session ( session ) . build ( ) ; "<AssertPlaceHolder>" ; } process ( org . mule . runtime . core . api . event . CoreEvent ) { org . mule . test . module . extension . connector . PetStoreDefaultEncodingTestCase . messageHolder . set ( event . getMessage ( ) ) ; return event ; } | org . junit . Assert . assertSame ( event , splitter . process ( event ) ) |
shouldLimitTotalLinesExcludingSkipped ( ) { final java . lang . Throwable t = ch . qos . logback . classic . util . TestHelper . makeNestedException ( 0 ) ; t . printStackTrace ( pw ) ; final ch . qos . logback . classic . spi . ILoggingEvent le = createLoggingEvent ( t ) ; tpc . setOptionList ( java . util . Arrays . asList ( "3" , "shouldLimitTotalLinesExcludingSkipped" ) ) ; tpc . start ( ) ; final java . lang . String result = tpc . convert ( le ) ; java . lang . String [ ] lines = result . split ( CoreConstants . LINE_SEPARATOR ) ; "<AssertPlaceHolder>" . hasSize ( ( 3 + 1 ) ) ; } convert ( java . lang . Throwable ) { java . util . List < java . lang . String > strList = new java . util . LinkedList < java . lang . String > ( ) ; ch . qos . logback . core . helpers . ThrowableToStringArray . extract ( strList , t , null ) ; return strList . toArray ( new java . lang . String [ 0 ] ) ; } | org . junit . Assert . assertThat ( lines ) |
map_ ( ) { com . querydsl . collections . Map < java . lang . Integer , com . querydsl . core . group . Group > results = com . querydsl . collections . CollQueryFactory . from ( com . querydsl . collections . GroupByTest . post , com . querydsl . collections . GroupByTest . posts ) . from ( com . querydsl . collections . GroupByTest . comment , com . querydsl . collections . GroupByTest . comments ) . where ( com . querydsl . collections . GroupByTest . comment . post . id . eq ( com . querydsl . collections . GroupByTest . post . id ) ) . transform ( groupBy ( com . querydsl . collections . GroupByTest . post . id ) . as ( com . querydsl . collections . GroupByTest . post . name , map ( com . querydsl . collections . GroupByTest . comment . id , com . querydsl . collections . GroupByTest . comment . text ) ) ) ; com . querydsl . core . group . Group group = results . get ( 1 ) ; com . querydsl . collections . Map < java . lang . Integer , java . lang . String > comments = group . getMap ( com . querydsl . collections . GroupByTest . comment . id , com . querydsl . collections . GroupByTest . comment . text ) ; "<AssertPlaceHolder>" ; } size ( ) { query ( store , store . products . size ( ) . gt ( 0 ) ) ; } | org . junit . Assert . assertEquals ( 1 , comments . size ( ) ) |
testEqualsWithDifferentCap ( ) { org . eclipse . swt . graphics . LineAttributes attributes1 = new org . eclipse . swt . graphics . LineAttributes ( 1 , org . eclipse . swt . SWT . CAP_FLAT , org . eclipse . swt . SWT . JOIN_BEVEL ) ; org . eclipse . swt . graphics . LineAttributes attributes2 = new org . eclipse . swt . graphics . LineAttributes ( 1 , org . eclipse . swt . SWT . CAP_ROUND , org . eclipse . swt . SWT . JOIN_BEVEL ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; org . eclipse . rap . e4 . internal . RAPEventObjectSupplier . Subscriber other = ( ( org . eclipse . rap . e4 . internal . RAPEventObjectSupplier . Subscriber ) ( obj ) ) ; if ( ( requestor ) == null ) { if ( ( other . requestor ) != null ) return false ; } else if ( ! ( requestor . equals ( other . requestor ) ) ) return false ; if ( ( topic ) == null ) { if ( ( other . topic ) != null ) return false ; } else if ( ! ( topic . equals ( other . topic ) ) ) return false ; return true ; } | org . junit . Assert . assertFalse ( attributes1 . equals ( attributes2 ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.