input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testEqualsWithSameTimeSameResolution ( ) { au . gov . ga . earthsci . core . temporal . BigTime t1 = new au . gov . ga . earthsci . core . temporal . BigTime ( 1000 , BigTime . NANOSECOND_RESOLUTION ) ; au . gov . ga . earthsci . core . temporal . BigTime t2 = new au . gov . ga . earthsci . core . temporal . BigTime ( 1000 , BigTime . NANOSECOND_RESOLUTION ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( object == null ) || ( object == ( this ) ) ; }
|
org . junit . Assert . assertTrue ( t1 . equals ( t2 ) )
|
testRowCountWithInvalidRange1 ( ) { org . apache . hadoop . hbase . client . coprocessor . AggregationClient aClient = new org . apache . hadoop . hbase . client . coprocessor . AggregationClient ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . conf ) ; org . apache . hadoop . hbase . client . Scan scan = new org . apache . hadoop . hbase . client . Scan ( ) ; scan . addColumn ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . TEST_FAMILY , org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . TEST_QUALIFIER ) ; scan . setStartRow ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . ROWS [ 5 ] ) ; scan . setStopRow ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . ROWS [ 2 ] ) ; final org . apache . hadoop . hbase . coprocessor . ColumnInterpreter < java . lang . Long , java . lang . Long > ci = new org . apache . hadoop . hbase . client . coprocessor . LongColumnInterpreter ( ) ; long rowCount = - 1 ; try { rowCount = aClient . rowCount ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . TEST_TABLE , ci , scan ) ; } catch ( java . lang . Throwable e ) { org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . myLog . error ( ( "Exception<sp>thrown<sp>in<sp>the<sp>invalidRange<sp>method" + ( e . getStackTrace ( ) ) ) ) ; } "<AssertPlaceHolder>" ; } error ( java . lang . String ) { org . apache . hadoop . hbase . regionserver . HFileReadWriteTest . LOG . error ( ( ( ( ( ( "error<sp>in<sp>reader<sp>" + ( readerId ) ) + "<sp>(pread=" ) + ( pread ) ) + "):<sp>" ) + msg ) ) ; }
|
org . junit . Assert . assertEquals ( ( - 1 ) , rowCount )
|
testJsonErrorResponseReturnsXAmzRequestId ( ) { java . util . List < com . amazonaws . transform . JsonErrorUnmarshaller > exceptionUnmarshallers = new java . util . ArrayList < com . amazonaws . transform . JsonErrorUnmarshaller > ( ) ; exceptionUnmarshallers . add ( new com . amazonaws . transform . JsonErrorUnmarshaller ( ) { @ com . amazonaws . http . Override public com . amazonaws . AmazonServiceException unmarshall ( com . amazonaws . http . JsonErrorResponseHandler . JsonErrorResponse error ) throws com . amazonaws . http . Exception { return new com . amazonaws . AmazonServiceException ( "TestException" ) ; } } ) ; handler = new com . amazonaws . http . JsonErrorResponseHandler ( exceptionUnmarshallers ) ; response = com . amazonaws . http . HttpResponse . builder ( ) . statusCode ( 500 ) . header ( "X-Amzn-RequestId" , "55" ) . content ( new java . io . ByteArrayInputStream ( "{}" . getBytes ( StringUtils . UTF8 ) ) ) . build ( ) ; com . amazonaws . AmazonServiceException returnedException = handler . handle ( response ) ; "<AssertPlaceHolder>" ; } getRequestId ( ) { return requestId ; }
|
org . junit . Assert . assertEquals ( returnedException . getRequestId ( ) , "55" )
|
atomPubEditionAction_instance_supportsEditionExecution ( ) { com . getconverge . plugins . atompub . AtomPubEditionAction plugin = new com . getconverge . plugins . atompub . AtomPubEditionAction ( ) ; boolean expResult = true ; boolean supportEdition = plugin . isSupportEditionExecute ( ) ; "<AssertPlaceHolder>" ; } isSupportEditionExecute ( ) { return true ; }
|
org . junit . Assert . assertEquals ( expResult , supportEdition )
|
testGetEditText ( ) { final android . widget . EditText editText = new android . widget . EditText ( mActivity ) ; final de . psdev . formvalidations . Field field = de . psdev . formvalidations . Field . using ( editText ) ; "<AssertPlaceHolder>" ; } getEditText ( ) { return mEditText ; }
|
org . junit . Assert . assertSame ( editText , field . getEditText ( ) )
|
shouldHaveDifferentHashCodes ( ) { com . wesabe . api . util . guid . GUID guid1 = new com . wesabe . api . util . guid . GUID ( "yay" ) ; com . wesabe . api . util . guid . GUID guid2 = new com . wesabe . api . util . guid . GUID ( "boo" ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return com . google . common . base . Objects . hashCode ( date , currencyCode , rate ) ; }
|
org . junit . Assert . assertFalse ( ( ( guid1 . hashCode ( ) ) == ( guid2 . hashCode ( ) ) ) )
|
testBeginStepEmptyInputs ( ) { io . cloudslang . lang . runtime . env . RunEnvironment runEnv = createRunEnvironment ( ) ; stepExecutionData . beginStep ( new java . util . ArrayList < io . cloudslang . lang . entities . bindings . Argument > ( ) , null , runEnv , createRuntimeServices ( ) , "step1" , 1L , 2L , "2" ) ; java . util . Map < java . lang . String , io . cloudslang . lang . entities . bindings . values . Value > callArgs = runEnv . removeCallArguments ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return stack . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( callArgs . isEmpty ( ) )
|
testCloseAndCleanup ( ) { final org . apache . flink . configuration . Configuration flinkConfig = new org . apache . flink . configuration . Configuration ( ) ; flinkConfig . setString ( YarnConfigOptions . APP_MASTER_RPC_ADDRESS , "localhost" ) ; flinkConfig . setInteger ( YarnConfigOptions . APP_MASTER_RPC_PORT , 1427 ) ; org . apache . flink . yarn . highavailability . YarnHighAvailabilityServices services = new org . apache . flink . yarn . highavailability . YarnPreConfiguredMasterNonHaServices ( flinkConfig , hadoopConfig , HighAvailabilityServicesUtils . AddressResolution . NO_ADDRESS_RESOLUTION ) ; services . closeAndCleanupAllData ( ) ; final org . apache . flink . core . fs . FileSystem fileSystem = org . apache . flink . yarn . highavailability . YarnPreConfiguredMasterHaServicesTest . hdfsRootPath . getFileSystem ( ) ; final org . apache . flink . core . fs . Path workDir = new org . apache . flink . core . fs . Path ( org . apache . flink . yarn . highavailability . YarnPreConfiguredMasterHaServicesTest . hdfsCluster . getFileSystem ( ) . getWorkingDirectory ( ) . toString ( ) ) ; try { fileSystem . getFileStatus ( new org . apache . flink . core . fs . Path ( workDir , YarnHighAvailabilityServices . FLINK_RECOVERY_DATA_DIR ) ) ; org . junit . Assert . fail ( "Flink<sp>recovery<sp>data<sp>directory<sp>still<sp>exists" ) ; } catch ( java . io . FileNotFoundException e ) { } "<AssertPlaceHolder>" ; try { services . closeAndCleanupAllData ( ) ; org . junit . Assert . fail ( "should<sp>fail<sp>with<sp>an<sp>IllegalStateException" ) ; } catch ( java . lang . IllegalStateException e ) { } } isClosed ( ) { return this . socket . isClosed ( ) ; }
|
org . junit . Assert . assertTrue ( services . isClosed ( ) )
|
testModifyAddInnerAreaToSameSpecificArea ( ) { org . apache . directory . api . ldap . model . entry . Entry caArea = new org . apache . directory . api . ldap . model . entry . DefaultEntry ( "ou=caArea,<sp>ou=system" , "ObjectClass:<sp>top" , "ObjectClass:<sp>organizationalUnit" , "ou:<sp>caArea" , "administrativeRole:<sp>collectiveAttributeSpecificArea" ) ; org . apache . directory . server . core . admin . AdministrativePointServiceIT . connection . add ( caArea ) ; org . apache . directory . api . ldap . model . entry . Modification modification = new org . apache . directory . api . ldap . model . entry . DefaultModification ( org . apache . directory . api . ldap . model . entry . ModificationOperation . ADD_ATTRIBUTE , new org . apache . directory . api . ldap . model . entry . DefaultAttribute ( "administrativeRole" , "collectiveAttributeInnerArea" ) ) ; try { org . apache . directory . server . core . admin . AdministrativePointServiceIT . connection . modify ( "ou=caArea,<sp>ou=system" , modification ) ; org . junit . Assert . fail ( ) ; } catch ( org . apache . directory . api . ldap . model . exception . LdapUnwillingToPerformException lutpe ) { "<AssertPlaceHolder>" ; } } modify ( org . apache . directory . api . ldap . model . message . ModifyRequest , org . apache . directory . server . core . api . changelog . LogChange ) { org . apache . directory . server . core . api . interceptor . context . ModifyOperationContext modifyContext = new org . apache . directory . server . core . api . interceptor . context . ModifyOperationContext ( this , modifyRequest ) ; modifyContext . setLogChange ( log ) ; org . apache . directory . server . core . api . OperationManager operationManager = directoryService . getOperationManager ( ) ; try { operationManager . modify ( modifyContext ) ; } catch ( org . apache . directory . api . ldap . model . exception . LdapException e ) { modifyRequest . getResultResponse ( ) . addAllControls ( modifyContext . getResponseControls ( ) ) ; throw e ; } modifyRequest . getResultResponse ( ) . addAllControls ( modifyContext . getResponseControls ( ) ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testReadAndWrite ( ) { java . io . File path = new java . io . File ( org . apache . hadoop . io . nativeio . TestSharedFileDescriptorFactory . TEST_BASE , "testReadAndWrite" ) ; path . mkdirs ( ) ; org . apache . hadoop . io . nativeio . SharedFileDescriptorFactory factory = org . apache . hadoop . io . nativeio . SharedFileDescriptorFactory . create ( "woot_" , new java . lang . String [ ] { path . getAbsolutePath ( ) } ) ; java . io . FileInputStream inStream = factory . createDescriptor ( "testReadAndWrite" , 4096 ) ; java . io . FileOutputStream outStream = new java . io . FileOutputStream ( inStream . getFD ( ) ) ; outStream . write ( 101 ) ; inStream . getChannel ( ) . position ( 0 ) ; "<AssertPlaceHolder>" ; inStream . close ( ) ; outStream . close ( ) ; org . apache . hadoop . fs . FileUtil . fullyDelete ( path ) ; } read ( ) { if ( ( oneByteBuf ) == null ) { oneByteBuf = new byte [ 1 ] ; } int ret = read ( oneByteBuf , 0 , 1 ) ; return ret <= 0 ? - 1 : ( oneByteBuf [ 0 ] ) & 255 ; }
|
org . junit . Assert . assertEquals ( 101 , inStream . read ( ) )
|
testEnqueueAddNotSame ( ) { final int j = 10 ; for ( int i = 0 ; i < j ; i ++ ) { sQueue . sEnqueue ( new tlc2 . tool . queue . DummyTLCState ( ) ) ; } "<AssertPlaceHolder>" ; } size ( ) { return size ; }
|
org . junit . Assert . assertTrue ( ( ( sQueue . size ( ) ) == j ) )
|
testBevatAlleenAnummerWijzigingen ( ) { final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . PersoonNummerverwijzingHistorie historie = new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . PersoonNummerverwijzingHistorie ( new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Persoon ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . SoortPersoon . INGESCHREVENE ) ) ; final nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . VergelijkerResultaat resultaat = new nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . DeltaVergelijkerResultaat ( ) ; resultaat . voegToeOfVervangVerschil ( new nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil ( new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Persoon . class , "persoonNummerverwijzingHistorieSet" ) , null , historie , VerschilType . RIJ_TOEGEVOEGD , null , null ) ) ; "<AssertPlaceHolder>" ; } bevatAlleenAnummerWijzigingen ( ) { boolean result = false ; if ( bevatNummerverwijzingHistorieWijziging ( ) ) { for ( final nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil verschil : interneVerschilNaarVerschilGroepMap . keySet ( ) ) { if ( ! ( verschil . isToegestaanVoorAnummerWijziging ( ) ) ) { result = false ; break ; } result = true ; } } return result ; }
|
org . junit . Assert . assertTrue ( resultaat . bevatAlleenAnummerWijzigingen ( ) )
|
testGetGroupResultQuery ( ) { @ org . springframework . data . solr . core . query . result . SuppressWarnings ( "unchecked" ) org . springframework . data . solr . core . query . result . GroupResult < java . lang . Object > gr = new org . springframework . data . solr . core . query . result . SimpleGroupResult ( 1 , null , "name" , org . mockito . Mockito . mock ( org . springframework . data . domain . Page . class ) ) ; org . springframework . data . solr . core . query . Query query = org . mockito . Mockito . mock ( org . springframework . data . solr . core . query . Query . class ) ; java . util . Map < java . lang . Object , org . springframework . data . solr . core . query . result . GroupResult < java . lang . Object > > groupResultMap = new java . util . HashMap ( ) ; groupResultMap . put ( query , gr ) ; org . springframework . data . solr . core . query . result . SolrResultPage < java . lang . Object > result = new org . springframework . data . solr . core . query . result . SolrResultPage ( java . util . Collections . emptyList ( ) ) ; result . setGroupResults ( groupResultMap ) ; "<AssertPlaceHolder>" ; } getGroupResult ( org . springframework . data . solr . core . query . Field ) { org . springframework . util . Assert . notNull ( field , "group<sp>result<sp>field<sp>must<sp>not<sp>be<sp>null" ) ; return groupResults . get ( field . getName ( ) ) ; }
|
org . junit . Assert . assertEquals ( gr , result . getGroupResult ( query ) )
|
testDataDictionaryBuilder_source_invalid ( ) { boolean failedAsExpected = false ; try { dd . addConfigFileLocation ( "KR-SAP" , null ) ; } catch ( org . kuali . rice . krad . datadictionary . DataDictionaryException e ) { failedAsExpected = true ; } "<AssertPlaceHolder>" ; } addConfigFileLocation ( java . lang . String , java . lang . String ) { if ( ! ( moduleLoadOrder . contains ( namespaceCode ) ) ) { moduleLoadOrder . add ( namespaceCode ) ; } indexSource ( namespaceCode , location ) ; }
|
org . junit . Assert . assertTrue ( failedAsExpected )
|
testGetName ( ) { final org . pentaho . metadata . model . concept . Concept concept = mock ( org . pentaho . metadata . model . concept . Concept . class ) ; final org . pentaho . metadata . model . concept . types . LocalizedString localizedString = mock ( org . pentaho . metadata . model . concept . types . LocalizedString . class ) ; final java . lang . String result = "result" ; when ( localizedString . getLocalizedString ( eq ( locale ) ) ) . thenReturn ( result ) ; when ( concept . getProperty ( anyString ( ) ) ) . thenReturn ( localizedString ) ; final java . lang . String name = org . pentaho . di . starmodeler . ConceptUtil . getName ( concept , locale ) ; verify ( localizedString , times ( 1 ) ) . getLocalizedString ( eq ( locale ) ) ; "<AssertPlaceHolder>" ; } verify ( java . lang . String , javax . net . ssl . SSLSession ) { if ( isDebug ( ) ) { logDebug ( ( ( ( "Warning:<sp>URL<sp>Host:<sp>" + hostname ) + "<sp>vs.<sp>" ) + ( session . getPeerHost ( ) ) ) ) ; } return true ; }
|
org . junit . Assert . assertEquals ( result , name )
|
testMailLayoutCount ( ) { java . util . List < org . linagora . linshare . core . domain . entities . MailLayout > findAll = mailLayoutRepository . findAll ( ) ; "<AssertPlaceHolder>" ; } findAll ( ) { return webServiceUserFacade . findAll ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , findAll . size ( ) )
|
testFindTopKHeap2 ( ) { java . util . List < org . neo4j . graphalgo . impl . util . TopKConsumerTest . Item > topItems = org . neo4j . graphalgo . similarity . TopKConsumer . topK ( asList ( org . neo4j . graphalgo . impl . util . TopKConsumerTest . ITEM1 , org . neo4j . graphalgo . impl . util . TopKConsumerTest . ITEM3 , org . neo4j . graphalgo . impl . util . TopKConsumerTest . ITEM2 , org . neo4j . graphalgo . impl . util . TopKConsumerTest . ITEM4 ) , 2 , org . neo4j . graphalgo . impl . util . TopKConsumerTest . Item :: compareTo ) ; "<AssertPlaceHolder>" ; for ( org . neo4j . graphalgo . impl . util . TopKConsumerTest . Item topItem : topItems ) { System . out . println ( topItem ) ; } }
|
org . junit . Assert . assertEquals ( asList ( org . neo4j . graphalgo . impl . util . TopKConsumerTest . ITEM4 , org . neo4j . graphalgo . impl . util . TopKConsumerTest . ITEM3 ) , topItems )
|
testGet ( ) { initializeExpectedProject ( 1 ) ; expect ( resourceManager . get ( com . google . cloud . resourcemanager . ProjectTest . PROJECT_INFO . getProjectId ( ) ) ) . andReturn ( expectedProject ) ; replay ( resourceManager ) ; com . google . cloud . resourcemanager . Project loadedProject = resourceManager . get ( com . google . cloud . resourcemanager . ProjectTest . PROJECT_INFO . getProjectId ( ) ) ; "<AssertPlaceHolder>" ; } getProjectId ( ) { return projectId ; }
|
org . junit . Assert . assertEquals ( expectedProject , loadedProject )
|
checkMissingQOut ( ) { com . google . common . collect . Sets . SetView < java . io . File > missing = com . google . common . collect . Sets . difference ( outsNeeded . keySet ( ) , outsFound ) ; System . out . println ( missing ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { com . google . common . base . Preconditions . checkNotNull ( getPath ( ) ) ; try { org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( getPath ( ) . toUri ( ) , org . apache . hadoop . hive . ql . session . SessionState . getSessionConf ( ) ) ; return ( ! ( fs . exists ( getPath ( ) ) ) ) || ( ( fs . listStatus ( getPath ( ) , FileUtils . HIDDEN_FILES_PATH_FILTER ) . length ) == 0 ) ; } catch ( java . io . IOException e ) { throw new org . apache . hadoop . hive . ql . metadata . HiveException ( e ) ; } }
|
org . junit . Assert . assertTrue ( missing . isEmpty ( ) )
|
testExpandParts ( ) { org . drools . compiler . lang . dsl . DSLMappingFile file = new org . drools . compiler . lang . dsl . DSLTokenizedMappingFile ( ) ; java . lang . String dsl = ( "[when]foo=Foo()" + ( org . drools . compiler . lang . dsl . DefaultExpanderTest . NL ) ) + "[then]bar<sp>{num}=baz({num});" ; file . parseAndLoad ( new java . io . StringReader ( dsl ) ) ; "<AssertPlaceHolder>" ; org . drools . compiler . lang . dsl . DefaultExpander ex = new org . drools . compiler . lang . dsl . DefaultExpander ( ) ; ex . addDSLMapping ( file . getMapping ( ) ) ; } getErrors ( ) { return errors ; }
|
org . junit . Assert . assertEquals ( 0 , file . getErrors ( ) . size ( ) )
|
startsWithPrefix_PrefixIsEmpty ( ) { de . persosim . simulator . protocols . Oid oid = new de . persosim . simulator . protocols . OidTest . TestOid ( de . persosim . simulator . utils . HexString . toByteArray ( "00112233445566778899" ) ) ; byte [ ] prefix = new byte [ 0 ] ; "<AssertPlaceHolder>" ; } startsWithPrefix ( byte [ ] ) { if ( oidPrefix == null ) { throw new java . lang . NullPointerException ( "OID<sp>must<sp>not<sp>be<sp>null" ) ; } if ( ( oidPrefix . length ) > ( oidByteArray . length ) ) { return false ; } if ( ( oidPrefix . length ) == 0 ) { return true ; } for ( int i = 0 ; i < ( oidPrefix . length ) ; i ++ ) { if ( ( oidPrefix [ i ] ) != ( oidByteArray [ i ] ) ) { return false ; } } return true ; }
|
org . junit . Assert . assertTrue ( oid . startsWithPrefix ( prefix ) )
|
mergerDoesNotPreserveOverlappingAtStartBroadcast ( ) { org . atlasapi . query . content . merge . BroadcastMerger merger = org . atlasapi . query . content . merge . BroadcastMerger . parse ( "\"channelUri\"|\"2016-01-05T00:00:00Z\"|\"2016-01-06T00:00:00Z\"" ) ; org . atlasapi . media . entity . Broadcast broadcast = new org . atlasapi . media . entity . Broadcast ( "channelUri" , new org . joda . time . DateTime ( 2016 , 1 , 4 , 22 , 0 , 0 , org . joda . time . DateTimeZone . UTC ) , new org . joda . time . DateTime ( 2016 , 1 , 5 , 2 , 0 , 0 , org . joda . time . DateTimeZone . UTC ) ) ; com . google . common . collect . ImmutableSet < org . atlasapi . media . entity . Broadcast > merge = merger . merge ( com . google . common . collect . ImmutableSet . of ( ) , com . google . common . collect . ImmutableSet . of ( broadcast ) , true ) ; "<AssertPlaceHolder>" ; } of ( java . lang . Iterable ) { return org . atlasapi . output . QueryResult . of ( content , null ) ; }
|
org . junit . Assert . assertThat ( merge . isEmpty ( ) , org . hamcrest . core . Is . is ( true ) )
|
testGetLabelResource ( ) { System . out . println ( "getLabelResource" ) ; kg . apc . jmeter . modifiers . FifoPopPreProcessorGui instance = new kg . apc . jmeter . modifiers . FifoPopPreProcessorGui ( ) ; java . lang . String result = instance . getLabelResource ( ) ; "<AssertPlaceHolder>" ; } getLabelResource ( ) { return this . getClass ( ) . getSimpleName ( ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testInequalityWithNull ( ) { com . github . davidmoten . rtree . geometry . Circle circle = com . github . davidmoten . rtree . geometry . Geometries . circle ( 1 , 2 , 3 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { com . github . davidmoten . guavamini . Optional < com . github . davidmoten . rtree . geometry . internal . RectangleDouble > other = com . github . davidmoten . rtree . internal . util . ObjectsHelper . asClass ( obj , com . github . davidmoten . rtree . geometry . internal . RectangleDouble . class ) ; if ( other . isPresent ( ) ) { return ( ( ( com . github . davidmoten . guavamini . Objects . equal ( x1 , other . get ( ) . x1 ) ) && ( com . github . davidmoten . guavamini . Objects . equal ( x2 , other . get ( ) . x2 ) ) ) && ( com . github . davidmoten . guavamini . Objects . equal ( y1 , other . get ( ) . y1 ) ) ) && ( com . github . davidmoten . guavamini . Objects . equal ( y2 , other . get ( ) . y2 ) ) ; } else return false ; }
|
org . junit . Assert . assertFalse ( circle . equals ( null ) )
|
ifAcceptHeaderIsNullShouldReturnDefault ( ) { when ( request . getParameter ( "_format" ) ) . thenReturn ( null ) ; when ( request . getHeader ( "Accept" ) ) . thenReturn ( null ) ; when ( acceptHeaderToFormat . getFormat ( null ) ) . thenReturn ( "html" ) ; java . lang . String format = resolver . getAcceptFormat ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { br . com . caelum . vraptor . proxy . MethodInvocation < T > handler = new br . com . caelum . vraptor . proxy . MethodInvocation < T > ( ) { public java . lang . Object intercept ( java . lang . Object proxy , java . lang . reflect . Method method , java . lang . Object [ ] args , br . com . caelum . vraptor . proxy . SuperMethod superMethod ) { boolean alreadySetTheStrategy = ! ( strategy . getClass ( ) . equals ( br . com . caelum . vraptor . http . route . NoStrategy . class ) ) ; if ( alreadySetTheStrategy ) { return null ; } is ( type , method ) ; return null ; } } ; return proxifier . proxify ( type , handler ) ; }
|
org . junit . Assert . assertThat ( format , org . hamcrest . Matchers . is ( "html" ) )
|
givenViewNotSupportTag_whenGetMostSuitable_thenReturnNewViewAddOn ( ) { java . lang . Object viewNotSupportTag = mock ( java . lang . Object . class ) ; org . robobinding . widgetaddon . ViewAddOn newViewAddOn = mock ( org . robobinding . widgetaddon . ViewAddOn . class ) ; when ( factories . createViewAddOn ( viewNotSupportTag ) ) . thenReturn ( newViewAddOn ) ; org . robobinding . widgetaddon . ViewTagsBasedViewAddOns viewAddOns = new org . robobinding . widgetaddon . ViewTagsBasedViewAddOns ( factories , null ) ; org . robobinding . widgetaddon . ViewAddOn actual = viewAddOns . getMostSuitable ( viewNotSupportTag ) ; "<AssertPlaceHolder>" ; } getMostSuitable ( java . lang . Object ) { return viewAddOns . getMostSuitable ( view ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( newViewAddOn ) )
|
withZero ( ) { "<AssertPlaceHolder>" ; } flip ( int ) { if ( n == ( - 1 ) ) return 32 ; int pre = 0 ; int cur = 0 ; int max = 1 ; while ( n != 0 ) { if ( ( n & 1 ) == 1 ) { cur ++ ; } else { pre = ( ( n & 2 ) == 0 ) ? 0 : cur ; cur = 0 ; } max = java . lang . Math . max ( max , ( ( pre + cur ) + 1 ) ) ; n >>>= 1 ; } return max ; }
|
org . junit . Assert . assertEquals ( 1 , s . flip ( 0 ) )
|
storeRequest_getUniqueIdReturnedFromQueue ( ) { java . lang . String someId = "test<sp>id" ; when ( queue . store ( any ( ) ) ) . thenReturn ( someId ) ; java . lang . String id = session . storeRequest ( null ) ; "<AssertPlaceHolder>" ; } storeRequest ( eu . chargetime . ocpp . model . Request ) { return queue . store ( payload ) ; }
|
org . junit . Assert . assertThat ( id , org . hamcrest . CoreMatchers . equalTo ( someId ) )
|
itHasAValue ( ) { "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertThat ( param . getValue ( ) , org . hamcrest . CoreMatchers . is ( true ) )
|
test_ConstructorLorg_eclipse_swt_widgets_Control ( ) { org . eclipse . swt . layout . FormAttachment attachment = new org . eclipse . swt . layout . FormAttachment ( shell ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( attachment )
|
testLastOpList ( ) { org . stringtemplate . v4 . ST e = new org . stringtemplate . v4 . ST ( "<last(names)>" ) ; e . add ( "names" , java . util . Arrays . asList ( "Ter" , "Tom" , "Sriram" ) ) ; java . lang . String expecting = "Sriram" ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expecting , e . render ( ) )
|
testPrivilegeFromName ( ) { for ( javax . jcr . security . Privilege privilege : getPrivilegeManager ( root ) . getRegisteredPrivileges ( ) ) { javax . jcr . security . Privilege p = acMgr . privilegeFromName ( privilege . getName ( ) ) ; "<AssertPlaceHolder>" ; } } getName ( ) { return def . getName ( ) ; }
|
org . junit . Assert . assertEquals ( privilege , p )
|
fromCodeInvalidTokenTypeTests ( ) { int invalidCode = 666 ; java . lang . String expectedMessage = "code" ; try { @ com . microsoft . windowsazure . services . media . implementation . templates . playreadylicense . SuppressWarnings ( "unused" ) com . microsoft . windowsazure . services . media . implementation . templates . playreadylicense . PlayReadyLicenseType tokenPlayReadyLicenseType = com . microsoft . windowsazure . services . media . implementation . templates . playreadylicense . PlayReadyLicenseType . fromCode ( invalidCode ) ; org . junit . Assert . fail ( "Should<sp>throw" ) ; } catch ( java . security . InvalidParameterException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return "hello" ; }
|
org . junit . Assert . assertEquals ( e . getMessage ( ) , expectedMessage )
|
testProxyUriImageWithoutItemAndInvalidUrl ( ) { when ( request . getParameter ( eq ( "widgetId" ) ) ) . thenReturn ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletServiceTest . IMAGE_WIDGET_ID ) ; when ( imageWidget . getUrl ( ) ) . thenReturn ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletServiceTest . INVALID_URL ) ; when ( imageWidget . getItem ( ) ) . thenReturn ( null ) ; java . net . URI uri = org . eclipse . smarthome . ui . internal . proxy . ProxyServletServiceTest . service . uriFromRequest ( request ) ; "<AssertPlaceHolder>" ; } uriFromRequest ( javax . servlet . http . HttpServletRequest ) { try { java . net . URI uri = ( ( java . net . URI ) ( request . getAttribute ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ATTR_URI ) ) ) ; if ( uri != null ) { return uri ; } else { org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException pse = ( ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException ) ( request . getAttribute ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ATTR_SERVLET_EXCEPTION ) ) ) ; if ( pse != null ) { return null ; } } java . lang . String sitemapName = request . getParameter ( "sitemap" ) ; if ( sitemapName == null ) { throw new org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException ( javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST , "Parameter<sp>'sitemap'<sp>must<sp>be<sp>provided!" ) ; } java . lang . String widgetId = request . getParameter ( "widgetId" ) ; if ( widgetId == null ) { throw new org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException ( javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST , "Parameter<sp>'widgetId'<sp>must<sp>be<sp>provided!" ) ; } org . eclipse . smarthome . model . sitemap . Sitemap sitemap = ( ( org . eclipse . smarthome . model . sitemap . Sitemap ) ( modelRepository . getModel ( sitemapName ) ) ) ; if ( sitemap == null ) { throw new org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException ( javax . servlet . http . HttpServletResponse . SC_NOT_FOUND , java . lang . String . format ( "Sitemap<sp>'%s'<sp>could<sp>not<sp>be<sp>found!" , sitemapName ) ) ; } org . eclipse . smarthome . model . sitemap . Widget widget = itemUIRegistry . getWidget ( sitemap , widgetId ) ; if ( widget == null ) { throw new org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException ( javax . servlet . http . HttpServletResponse . SC_NOT_FOUND , java . lang . String . format ( "Widget<sp>'%s'<sp>could<sp>not<sp>be<sp>found!" , widgetId ) ) ; } java . lang . String uriString = null ; if ( widget instanceof org . eclipse . smarthome . model . sitemap . Image ) { uriString = ( ( org . eclipse . smarthome . model . sitemap . Image ) ( widget ) ) . getUrl ( ) ; } else if ( widget instanceof org . eclipse . smarthome . model . sitemap . Video ) { uriString = ( ( org . eclipse . smarthome . model . sitemap . Video ) ( widget ) ) . getUrl ( ) ; } else { throw new org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException ( javax . servlet . http . HttpServletResponse . SC_FORBIDDEN , java . lang . String . format ( "Widget<sp>type<sp>'%s'<sp>is<sp>not<sp>supported!" , widget . getClass ( ) . getName ( ) ) ) ; } java . lang . String itemName = widget . getItem ( ) ; if ( itemName != null ) { org . eclipse . smarthome . core . types . State state = itemUIRegistry . getItemState ( itemName ) ; if ( ( state != null ) && ( state instanceof org . eclipse . smarthome . core . library . types . StringType ) ) { try { uri = createURIFromString ( state . toString ( ) ) ; request . setAttribute ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ATTR_URI , uri ) ; return uri ; } catch ( java . net . MalformedURLException | java . net . URISyntaxException ex ) { } } } try { uri = createURIFromString ( uriString ) ; request . setAttribute ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ATTR_URI , uri ) ; return uri ; } catch ( java . net . MalformedURLException | java . net . URISyntaxException ex ) { throw new org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException ( javax . servlet . http . HttpServletResponse . SC_INTERNAL_SERVER_ERROR , java . lang . String . format ( "URL<sp>'%s'<sp>is<sp>not<sp>a<sp>valid<sp>URL." , uriString ) ) ; } } catch ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ProxyServletException pse ) { request . setAttribute ( org . eclipse . smarthome . ui . internal . proxy . ProxyServletService . ATTR_SERVLET_EXCEPTION , pse ) ; return null ; } }
|
org . junit . Assert . assertNull ( uri )
|
testCompareToEquals ( ) { org . jboss . forge . furnace . addons . AddonId left = org . jboss . forge . furnace . addons . AddonId . from ( "name" , "1.0.0-SNAPSHOT" ) ; org . jboss . forge . furnace . addons . AddonId right = org . jboss . forge . furnace . addons . AddonId . from ( "name" , "1.0.0-SNAPSHOT" ) ; "<AssertPlaceHolder>" ; } compareTo ( org . jboss . forge . furnace . versions . Version ) { if ( otherVersion == null ) throw new java . lang . NullPointerException ( "Cannot<sp>compare<sp>against<sp>null." ) ; if ( otherVersion instanceof org . jboss . forge . furnace . versions . SingleVersion ) { return this . comparable . compareTo ( ( ( org . jboss . forge . furnace . versions . SingleVersion ) ( otherVersion ) ) . comparable ) ; } else { return compareTo ( new org . jboss . forge . furnace . versions . SingleVersion ( otherVersion . toString ( ) ) ) ; } }
|
org . junit . Assert . assertEquals ( 0 , left . compareTo ( right ) )
|
testWordsNearestBasic1 ( ) { vec . setModelUtils ( new org . deeplearning4j . models . embeddings . reader . impl . BasicModelUtils < org . deeplearning4j . models . word2vec . VocabWord > ( ) ) ; java . lang . String target = "energy" ; org . nd4j . linalg . api . ndarray . INDArray arr1 = vec . getWordVectorMatrix ( target ) . dup ( ) ; System . out . println ( ( "[-]:<sp>" + arr1 ) ) ; System . out . println ( ( "[+]:<sp>" + ( org . nd4j . linalg . ops . transforms . Transforms . unitVec ( arr1 ) ) ) ) ; java . util . Collection < java . lang . String > list = vec . wordsNearest ( target , 10 ) ; org . deeplearning4j . models . embeddings . reader . impl . FlatModelUtilsTest . log . info ( "Transpose<sp>model<sp>results:" ) ; org . deeplearning4j . models . embeddings . reader . impl . FlatModelUtilsTest . printWords ( target , list , vec ) ; list = vec . wordsNearest ( target , 10 ) ; org . deeplearning4j . models . embeddings . reader . impl . FlatModelUtilsTest . log . info ( "Transpose<sp>model<sp>results<sp>2:" ) ; org . deeplearning4j . models . embeddings . reader . impl . FlatModelUtilsTest . printWords ( target , list , vec ) ; list = vec . wordsNearest ( target , 10 ) ; org . deeplearning4j . models . embeddings . reader . impl . FlatModelUtilsTest . log . info ( "Transpose<sp>model<sp>results<sp>3:" ) ; org . deeplearning4j . models . embeddings . reader . impl . FlatModelUtilsTest . printWords ( target , list , vec ) ; org . nd4j . linalg . api . ndarray . INDArray arr2 = vec . getWordVectorMatrix ( target ) . dup ( ) ; "<AssertPlaceHolder>" ; } dup ( ) { org . nd4j . linalg . api . ndarray . INDArray [ ] dupObservation = org . deeplearning4j . rl4j . learning . sync . Transition . dup ( observation ) ; org . nd4j . linalg . api . ndarray . INDArray nextObs = nextObservation . dup ( ) ; return new org . deeplearning4j . rl4j . learning . sync . Transition ( dupObservation , action , reward , isTerminal , nextObs ) ; }
|
org . junit . Assert . assertEquals ( arr1 , arr2 )
|
test_invalid_definition ( ) { org . milyn . javabean . factory . BasicFactoryDefinitionParser parser = new org . milyn . javabean . factory . BasicFactoryDefinitionParser ( ) ; org . milyn . javabean . factory . InvalidFactoryDefinitionException exception = null ; try { parser . parse ( "garbage" ) ; } catch ( org . milyn . javabean . factory . InvalidFactoryDefinitionException e ) { exception = e ; } if ( exception == null ) { org . junit . Assert . fail ( "The<sp>parser<sp>didn't<sp>throw<sp>an<sp>exception" ) ; } "<AssertPlaceHolder>" ; } getMessage ( ) { return getMessage ( org . milyn . validation . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertTrue ( exception . getMessage ( ) . contains ( "garbage" ) )
|
testDeleteProcessGroup ( ) { org . apache . nifi . groups . ProcessGroup pg = controller . getFlowManager ( ) . createProcessGroup ( "my-process-group" ) ; pg . setName ( "my-process-group" ) ; org . apache . nifi . controller . service . ControllerServiceNode cs = controller . getFlowManager ( ) . createControllerService ( "org.apache.nifi.NonExistingControllerService" , "my-controller-service" , systemBundle . getBundleDetails ( ) . getCoordinate ( ) , null , false , true ) ; pg . addControllerService ( cs ) ; controller . getFlowManager ( ) . getRootGroup ( ) . addProcessGroup ( pg ) ; controller . getFlowManager ( ) . getRootGroup ( ) . removeProcessGroup ( pg ) ; pg . getControllerServices ( true ) ; "<AssertPlaceHolder>" ; } getControllerServices ( java . util . Map ) { final java . util . Set < org . apache . nifi . web . api . dto . ControllerServiceDTO > serviceDtos = new java . util . HashSet ( ) ; for ( final Map . Entry < org . apache . nifi . components . PropertyDescriptor , java . lang . String > entry : componentProperties . entrySet ( ) ) { final org . apache . nifi . components . PropertyDescriptor descriptor = entry . getKey ( ) ; if ( ( descriptor . getControllerServiceDefinition ( ) ) != null ) { final java . lang . String controllerServiceId = entry . getValue ( ) ; if ( controllerServiceId != null ) { final org . apache . nifi . controller . service . ControllerServiceNode serviceNode = flowController . getFlowManager ( ) . getControllerServiceNode ( controllerServiceId ) ; if ( serviceNode != null ) { serviceDtos . add ( dtoFactory . createControllerServiceDto ( serviceNode ) ) ; final java . util . Set < org . apache . nifi . web . api . dto . ControllerServiceDTO > recursiveRefs = getControllerServices ( serviceNode . getProperties ( ) ) ; serviceDtos . addAll ( recursiveRefs ) ; } } } } return serviceDtos ; }
|
org . junit . Assert . assertTrue ( pg . getControllerServices ( true ) . isEmpty ( ) )
|
functionCallWithArgumentExpression ( ) { io . burt . jmespath . Expression < java . lang . Object > expected = FunctionCall ( "sort" , java . util . Arrays . asList ( Property ( "bar" ) ) ) ; io . burt . jmespath . Expression < java . lang . Object > actual = compile ( "sort(bar)" ) ; "<AssertPlaceHolder>" ; } compile ( java . lang . String ) { return runtime . compile ( str ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) )
|
testAbsoluteDissimilarity ( ) { net . ricecode . similarity . SimilarityStrategy s = new net . ricecode . similarity . DiceCoefficientStrategy ( ) ; java . lang . String first = "Mississippi" ; java . lang . String second = "Oklahoma" ; double expected = 0.0 ; double delta = 0.0 ; double actual = s . score ( first , second ) ; "<AssertPlaceHolder>" ; } score ( java . lang . String , java . lang . String ) { java . lang . String shorter ; java . lang . String longer ; if ( ( first . length ( ) ) > ( second . length ( ) ) ) { longer = first . toLowerCase ( ) ; shorter = second . toLowerCase ( ) ; } else { longer = second . toLowerCase ( ) ; shorter = first . toLowerCase ( ) ; } int halflength = ( ( shorter . length ( ) ) / 2 ) + 1 ; java . lang . String m1 = getSetOfMatchingCharacterWithin ( shorter , longer , halflength ) ; java . lang . String m2 = getSetOfMatchingCharacterWithin ( longer , shorter , halflength ) ; if ( ( ( m1 . length ( ) ) == 0 ) || ( ( m2 . length ( ) ) == 0 ) ) return 0.0 ; if ( ( m1 . length ( ) ) != ( m2 . length ( ) ) ) return 0.0 ; int transpositions = transpositions ( m1 , m2 ) ; double dist = ( ( ( ( m1 . length ( ) ) / ( ( double ) ( shorter . length ( ) ) ) ) + ( ( m2 . length ( ) ) / ( ( double ) ( longer . length ( ) ) ) ) ) + ( ( ( m1 . length ( ) ) - transpositions ) / ( ( double ) ( m1 . length ( ) ) ) ) ) / 3.0 ; return dist ; }
|
org . junit . Assert . assertEquals ( expected , actual , delta )
|
testListBoxWithoutDefaultValue ( ) { org . kie . workbench . common . forms . dynamic . model . config . SelectorData < java . lang . String > data = provider . getSelectorData ( context ) ; doTestVerifications ( data ) ; "<AssertPlaceHolder>" ; } getSelectedValue ( ) { return listBox . getValue ( ) ; }
|
org . junit . Assert . assertNull ( data . getSelectedValue ( ) )
|
stringToKeyUpDoestTrimOnChange ( ) { binder . bind ( s ) . toKeyUp ( box ) ; box . type ( "a<sp>" ) ; "<AssertPlaceHolder>" ; } get ( ) { int i = 0 ; for ( org . tessell . tests . model . properties . DummyModel model : models . get ( ) ) { if ( ( ( model . name . get ( ) ) != null ) && ( model . name . get ( ) . startsWith ( "foo" ) ) ) { i ++ ; } } return i ; }
|
org . junit . Assert . assertThat ( s . get ( ) , org . hamcrest . CoreMatchers . is ( "a" ) )
|
testSetEscapeDisabled ( ) { final com . orangesignal . csv . CsvConfig cfg = new com . orangesignal . csv . CsvConfig ( ) ; cfg . setEscapeDisabled ( false ) ; "<AssertPlaceHolder>" ; } isEscapeDisabled ( ) { return escapeDisabled ; }
|
org . junit . Assert . assertThat ( cfg . isEscapeDisabled ( ) , org . hamcrest . core . Is . is ( false ) )
|
testSystemId ( ) { result1 = org . onosproject . isis . io . util . IsisUtil . systemId ( com . google . common . primitives . Bytes . toArray ( org . onosproject . isis . io . util . IsisUtil . sourceAndLanIdToBytes ( systemId ) ) ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
|
org . junit . Assert . assertThat ( result1 , org . hamcrest . CoreMatchers . is ( systemId ) )
|
testW1Y1900Previous ( ) { org . jfree . data . time . Week previous = ( ( org . jfree . data . time . Week ) ( this . w1Y1900 . previous ( ) ) ) ; "<AssertPlaceHolder>" ; } previous ( ) { org . jfree . data . time . Month result ; if ( ( this . month ) != ( org . jfree . chart . date . MonthConstants . JANUARY ) ) { result = new org . jfree . data . time . Month ( ( ( this . month ) - 1 ) , this . year ) ; } else { if ( ( this . year ) > 1900 ) { result = new org . jfree . data . time . Month ( org . jfree . chart . date . MonthConstants . DECEMBER , ( ( this . year ) - 1 ) ) ; } else { result = null ; } } return result ; }
|
org . junit . Assert . assertNull ( previous )
|
testSetComparisonOperator ( ) { org . pentaho . hbase . shim . api . ColumnFilter cf = new org . pentaho . hbase . shim . api . ColumnFilterTest ( ) ; cf . setComparisonOperator ( ComparisonType . EQUAL ) ; "<AssertPlaceHolder>" ; } setComparisonOperator ( org . pentaho . hbase . shim . api . ColumnFilter$ComparisonType ) { m_comparison = c ; }
|
org . junit . Assert . assertEquals ( ComparisonType . EQUAL , cf . m_comparison )
|
shouldRejectLbConfigs ( ) { cluster . setNumberOfLoadBalancingConfigurations ( 2 ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = cTest . validate ( cluster , org . openstack . atlas . api . mgmt . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; }
|
org . junit . Assert . assertFalse ( resultMessage ( result , org . openstack . atlas . api . mgmt . validation . validators . POST ) , result . passedValidation ( ) )
|
testGetVersionHistory ( ) { org . apache . jackrabbit . oak . api . Tree vs = getTestRoot ( ) . getTree ( vhPath ) ; "<AssertPlaceHolder>" ; } exists ( ) { return delegate . exists ( ) ; }
|
org . junit . Assert . assertFalse ( vs . exists ( ) )
|
testValidEnvVariableSubstitution ( ) { java . io . File shellFile = null ; try { shellFile = org . apache . hadoop . util . Shell . appendScriptExtension ( tmpDir , "hello" ) ; java . util . Map < org . apache . hadoop . fs . Path , java . util . List < java . lang . String > > resources = new java . util . HashMap < org . apache . hadoop . fs . Path , java . util . List < java . lang . String > > ( ) ; java . io . FileOutputStream fos = new java . io . FileOutputStream ( shellFile ) ; org . apache . hadoop . fs . FileUtil . setExecutable ( shellFile , true ) ; java . util . Map < java . lang . String , java . lang . String > env = new java . util . LinkedHashMap < java . lang . String , java . lang . String > ( ) ; env . put ( "foo" , "2.4.6" ) ; env . put ( "testVar" , "version${foo}" ) ; java . util . List < java . lang . String > commands = new java . util . ArrayList < java . lang . String > ( ) ; org . apache . hadoop . yarn . server . nodemanager . DefaultContainerExecutor executor = new org . apache . hadoop . yarn . server . nodemanager . DefaultContainerExecutor ( ) ; org . apache . hadoop . conf . Configuration execConf = new org . apache . hadoop . conf . Configuration ( ) ; execConf . setBoolean ( YarnConfiguration . NM_LOG_CONTAINER_DEBUG_INFO , false ) ; executor . setConf ( execConf ) ; java . util . LinkedHashSet < java . lang . String > nmVars = new java . util . LinkedHashSet ( ) ; executor . writeLaunchEnv ( fos , env , resources , commands , new org . apache . hadoop . fs . Path ( localLogDir . getAbsolutePath ( ) ) , user , nmVars ) ; fos . flush ( ) ; fos . close ( ) ; java . util . Map < java . lang . String , java . lang . String > cmdEnv = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; cmdEnv . put ( "LANG" , "C" ) ; org . apache . hadoop . util . Shell . ShellCommandExecutor shexc = new org . apache . hadoop . util . Shell . ShellCommandExecutor ( new java . lang . String [ ] { shellFile . getAbsolutePath ( ) } , tmpDir , cmdEnv ) ; try { shexc . execute ( ) ; } catch ( org . apache . hadoop . util . Shell . ExitCodeException e ) { org . junit . Assert . fail ( "Should<sp>not<sp>catch<sp>exception" ) ; } "<AssertPlaceHolder>" ; } finally { if ( ( shellFile != null ) && ( shellFile . exists ( ) ) ) { shellFile . delete ( ) ; } } } getExitCode ( ) { return code ; }
|
org . junit . Assert . assertTrue ( ( ( shexc . getExitCode ( ) ) == 0 ) )
|
loadPropertiesFromFile ( ) { java . io . File file = java . io . File . createTempFile ( "test" , ".properties" ) ; org . apache . commons . io . FileUtils . writeStringToFile ( file , "a=b\nc=d\n" ) ; java . util . Properties properties = com . cloud . utils . PropertiesUtil . loadFromFile ( file ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return elements . get ( elementName ) ; }
|
org . junit . Assert . assertEquals ( "b" , properties . get ( "a" ) )
|
testAllTables ( ) { java . util . Set < org . obeonetwork . dsl . database . Table > tables = new org . obeonetwork . database . m2doc . services . DataBaseServices ( ) . allTables ( dataBase ) ; "<AssertPlaceHolder>" ; } size ( ) { return super . size ( ) ; }
|
org . junit . Assert . assertEquals ( 10 , tables . size ( ) )
|
fetchVersionFromUnused ( ) { final long vh = 10 ; final byte [ ] source = new byte [ ] { } ; final byte [ ] target = new byte [ ] { } ; "<AssertPlaceHolder>" ; } fetchVersion ( byte [ ] , int , long , byte [ ] ) { int offset = 0 ; int length = com . persistit . MVV . VERSION_NOT_FOUND ; if ( ( version == 0 ) && ( ( sourceLength == 0 ) || ( ( source [ 0 ] ) != ( com . persistit . MVV . TYPE_MVV_BYTE ) ) ) ) { length = sourceLength ; } else if ( ( sourceLength > 0 ) && ( ( source [ 0 ] ) == ( com . persistit . MVV . TYPE_MVV_BYTE ) ) ) { offset = 1 ; while ( offset < sourceLength ) { final long curVersion = com . persistit . util . Util . getLong ( source , offset ) ; final int curLength = com . persistit . util . Util . getShort ( source , ( offset + ( com . persistit . MVV . LENGTH_VERSION ) ) ) ; offset += com . persistit . MVV . LENGTH_PER_VERSION ; if ( curVersion == version ) { length = curLength ; break ; } offset += curLength ; } } if ( length > 0 ) { com . persistit . MVV . assertCapacity ( target . length , length ) ; java . lang . System . arraycopy ( source , offset , target , 0 , length ) ; } return length ; }
|
org . junit . Assert . assertEquals ( MVV . VERSION_NOT_FOUND , com . persistit . MVV . fetchVersion ( source , ( - 1 ) , vh , target ) )
|
deveObterCepComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroEndereco retornoConsultaCadastroEndereco = new com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroEndereco ( ) ; retornoConsultaCadastroEndereco . setCep ( "88132-020" ) ; "<AssertPlaceHolder>" ; } getCep ( ) { return this . cep ; }
|
org . junit . Assert . assertEquals ( "88132-020" , retornoConsultaCadastroEndereco . getCep ( ) )
|
testFindByProviderNoAndMessageNo ( ) { java . lang . String providerNo1 = "111" ; java . lang . String providerNo2 = "222" ; long message1 = 101 ; long message2 = 202 ; org . oscarehr . common . model . MessageList messageList1 = new org . oscarehr . common . model . MessageList ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( messageList1 ) ; messageList1 . setProviderNo ( providerNo1 ) ; messageList1 . setMessage ( message1 ) ; dao . persist ( messageList1 ) ; org . oscarehr . common . model . MessageList messageList2 = new org . oscarehr . common . model . MessageList ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( messageList2 ) ; messageList2 . setProviderNo ( providerNo2 ) ; messageList2 . setMessage ( message1 ) ; dao . persist ( messageList2 ) ; org . oscarehr . common . model . MessageList messageList3 = new org . oscarehr . common . model . MessageList ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( messageList3 ) ; messageList3 . setProviderNo ( providerNo1 ) ; messageList3 . setMessage ( message1 ) ; dao . persist ( messageList3 ) ; org . oscarehr . common . model . MessageList messageList4 = new org . oscarehr . common . model . MessageList ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( messageList4 ) ; messageList4 . setProviderNo ( providerNo1 ) ; messageList4 . setMessage ( message2 ) ; dao . persist ( messageList4 ) ; java . util . List < org . oscarehr . common . model . MessageList > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . MessageList > ( java . util . Arrays . asList ( messageList1 , messageList3 ) ) ; java . util . List < org . oscarehr . common . model . MessageList > result = dao . findByProviderNoAndMessageNo ( providerNo1 , message1 ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
|
org . junit . Assert . assertTrue ( true )
|
testMessageCode ( ) { "<AssertPlaceHolder>" ; } getMessageCode ( ) { return this . messageCode ; }
|
org . junit . Assert . assertEquals ( expected . getMessageCode ( ) , actual . getMessageCode ( ) )
|
testCreate ( ) { course . example . Customer customer = new course . example . Customer ( ) ; customer . setId ( 1 ) ; em . getTransaction ( ) . begin ( ) ; em . persist ( customer ) ; em . getTransaction ( ) . commit ( ) ; "<AssertPlaceHolder>" ; } setId ( java . lang . Long ) { this . id = id ; }
|
org . junit . Assert . assertNotNull ( customer )
|
testGeenPartijWelOmschrijvingDerde ( ) { java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > meldingen ; meldingen = bedrijfsregel . voerRegelUit ( null , bouwPersoon ( false , true ) , null , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) )
|
testSetNonRecursive ( ) { final B builder = getBuilderInstance ( ) ; builder . setNonRecursive ( ) ; final A chmod = builder . build ( ) ; "<AssertPlaceHolder>" ; } isRecursive ( ) { return recursive ; }
|
org . junit . Assert . assertEquals ( false , chmod . isRecursive ( ) )
|
testPullRebase ( ) { insertAndAdd ( remoteGeogig . geogig , lines3 ) ; org . locationtech . geogig . model . RevCommit commit = remoteGeogig . geogig . command ( org . locationtech . geogig . porcelain . CommitOp . class ) . call ( ) ; expectedMaster . addFirst ( commit ) ; org . locationtech . geogig . remotes . PullOp pull = pullOp ( ) ; pull . setRebase ( true ) . setAll ( true ) . call ( ) ; java . util . List < org . locationtech . geogig . model . RevCommit > logged = log ( localGeogig . repo ) ; "<AssertPlaceHolder>" ; } log ( java . lang . String ) { org . locationtech . geogig . model . ObjectId tip = getContext ( ) . command ( org . locationtech . geogig . plumbing . RevParse . class ) . setRefSpec ( refSpec ) . call ( ) . get ( ) ; java . util . Iterator < org . locationtech . geogig . model . RevCommit > iterator = getContext ( ) . command ( org . locationtech . geogig . porcelain . LogOp . class ) . setUntil ( tip ) . call ( ) ; return iterator ; }
|
org . junit . Assert . assertEquals ( expectedMaster , logged )
|
itShouldRemoveWorst ( ) { jsprit . core . problem . job . Service s1 = Service . Builder . newInstance ( "s1" ) . setLocation ( Location . Builder . newInstance ( ) . setCoordinate ( jsprit . core . util . Coordinate . newInstance ( 1 , 1 ) ) . build ( ) ) . build ( ) ; jsprit . core . problem . job . Service s2 = Service . Builder . newInstance ( "s2" ) . setLocation ( Location . Builder . newInstance ( ) . setCoordinate ( jsprit . core . util . Coordinate . newInstance ( 3 , 1 ) ) . build ( ) ) . build ( ) ; jsprit . core . problem . job . Service s3 = Service . Builder . newInstance ( "s3" ) . setLocation ( Location . Builder . newInstance ( ) . setCoordinate ( jsprit . core . util . Coordinate . newInstance ( 10 , 10 ) ) . build ( ) ) . build ( ) ; jsprit . core . problem . vehicle . VehicleImpl v = VehicleImpl . Builder . newInstance ( "v" ) . setStartLocation ( Location . Builder . newInstance ( ) . setCoordinate ( jsprit . core . util . Coordinate . newInstance ( 0 , 0 ) ) . build ( ) ) . build ( ) ; jsprit . core . problem . VehicleRoutingProblem vrp = VehicleRoutingProblem . Builder . newInstance ( ) . addJob ( s1 ) . addJob ( s2 ) . addJob ( s3 ) . addVehicle ( v ) . build ( ) ; jsprit . core . algorithm . ruin . RuinWorst worst = new jsprit . core . algorithm . ruin . RuinWorst ( vrp , 1 ) ; jsprit . core . problem . solution . route . VehicleRoute route = VehicleRoute . Builder . newInstance ( v ) . addService ( s1 ) . addService ( s2 ) . addService ( s3 ) . setJobActivityFactory ( vrp . getJobActivityFactory ( ) ) . build ( ) ; java . util . Collection < jsprit . core . problem . job . Job > unassigned = worst . ruinRoutes ( java . util . Arrays . asList ( route ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( s3 , unassigned . iterator ( ) . next ( ) )
|
testIsHiddenWhenElementIsHidden ( ) { final elemental2 . dom . Element element = mock ( elemental2 . dom . Element . class ) ; final elemental2 . dom . DOMTokenList classList = mock ( elemental2 . dom . DOMTokenList . class ) ; element . classList = classList ; when ( classList . contains ( org . kie . workbench . common . dmn . client . editors . types . common . HiddenHelper . HIDDEN_CSS_CLASS ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } isHidden ( elemental2 . dom . Element ) { return element . classList . contains ( org . kie . workbench . common . dmn . client . editors . types . common . HiddenHelper . HIDDEN_CSS_CLASS ) ; }
|
org . junit . Assert . assertTrue ( org . kie . workbench . common . dmn . client . editors . types . common . HiddenHelper . isHidden ( element ) )
|
testSelect ( ) { driver . get ( pages . select ) ; org . openqa . selenium . WebElement el = driver . findElement ( org . openqa . selenium . By . id ( "dog" ) ) ; el . click ( ) ; "<AssertPlaceHolder>" ; } isSelected ( ) { assertElementNotStale ( ) ; return ( ( java . lang . Boolean ) ( evaluateMethod ( ( ( "return<sp>" + ( OperaAtom . IS_SELECTED ) ) + "(locator)" ) ) ) ) ; }
|
org . junit . Assert . assertTrue ( el . isSelected ( ) )
|
testDelByKey ( ) { tokenManager . createRelationship ( com . scienjus . authorization . test . RedisTokenManagerTest . KEY , com . scienjus . authorization . test . RedisTokenManagerTest . TOKEN ) ; tokenManager . delRelationshipByKey ( com . scienjus . authorization . test . RedisTokenManagerTest . KEY ) ; "<AssertPlaceHolder>" ; } delRelationshipByKey ( java . lang . String ) { if ( ! ( singleTokenWithUser ) ) { throw new com . scienjus . authorization . exception . MethodNotSupportException ( "" ) ; } delSingleRelationshipByKey ( key ) ; }
|
org . junit . Assert . assertNull ( tokenManager . getKey ( com . scienjus . authorization . test . RedisTokenManagerTest . TOKEN ) )
|
matchDateTimeTestClosedEndedIntervalOutOfRangeCombined ( ) { org . dcm4che3 . data . Attributes testAttrs = new org . dcm4che3 . data . Attributes ( ) ; java . lang . String tmString = "121213.000-121213.999" ; java . lang . String daString = "20151006-20151009" ; java . util . List < org . dcm4chee . archive . entity . Study > studies = createDateTimeRangeQuery ( testAttrs , tmString , daString , true ) ; "<AssertPlaceHolder>" ; } size ( ) { return locationPks . size ( ) ; }
|
org . junit . Assert . assertThat ( studies . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
|
testCreateArguments ( ) { final org . apache . tools . ant . types . Parameter parameter = new org . apache . tools . ant . types . Parameter ( ) ; parameter . setName ( "key" ) ; parameter . setValue ( "value" ) ; task . addParameter ( parameter ) ; final java . util . Map < java . lang . String , java . lang . String > expected = java . util . Collections . singletonMap ( "key" , "value" ) ; "<AssertPlaceHolder>" ; } createArguments ( ) { final java . util . Map < java . lang . String , java . lang . String > args = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; for ( org . apache . tools . ant . types . Parameter p : parameters ) { args . put ( p . getName ( ) , p . getValue ( ) ) ; } return args ; }
|
org . junit . Assert . assertEquals ( expected , task . createArguments ( ) )
|
testSignaturePKI ( ) { org . apache . cxf . service . Service service = createService ( ) ; java . util . Map < java . lang . String , java . lang . Object > inProperties = new java . util . HashMap ( ) ; inProperties . put ( ConfigurationConstants . ACTION , ConfigurationConstants . SIGNATURE ) ; inProperties . put ( ConfigurationConstants . PW_CALLBACK_REF , new org . apache . cxf . ws . security . wss4j . KeystorePasswordCallback ( ) ) ; inProperties . put ( ConfigurationConstants . SIG_VER_PROP_FILE , "cxfca.properties" ) ; org . apache . cxf . ws . security . wss4j . WSS4JInInterceptor inInterceptor = new org . apache . cxf . ws . security . wss4j . WSS4JInInterceptor ( inProperties ) ; service . getInInterceptors ( ) . add ( inInterceptor ) ; org . apache . cxf . ws . security . wss4j . Echo echo = createClientProxy ( ) ; org . apache . cxf . endpoint . Client client = org . apache . cxf . frontend . ClientProxy . getClient ( echo ) ; client . getInInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingInInterceptor ( ) ) ; client . getOutInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingOutInterceptor ( ) ) ; org . apache . wss4j . stax . ext . WSSSecurityProperties properties = new org . apache . wss4j . stax . ext . WSSSecurityProperties ( ) ; java . util . List < org . apache . wss4j . stax . ext . WSSConstants . Action > actions = new java . util . ArrayList ( ) ; actions . add ( XMLSecurityConstants . SIGNATURE ) ; properties . setActions ( actions ) ; properties . setSignatureUser ( "alice" ) ; java . util . Properties cryptoProperties = org . apache . wss4j . common . crypto . CryptoFactory . getProperties ( "alice.properties" , this . getClass ( ) . getClassLoader ( ) ) ; properties . setSignatureCryptoProperties ( cryptoProperties ) ; properties . setCallbackHandler ( new org . apache . cxf . ws . security . wss4j . KeystorePasswordCallback ( ) ) ; properties . setUseSingleCert ( true ) ; properties . setSignatureKeyIdentifier ( WSSecurityTokenConstants . KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ohandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ( properties ) ; client . getOutInterceptors ( ) . add ( ohandler ) ; "<AssertPlaceHolder>" ; } echo ( int ) { return i ; }
|
org . junit . Assert . assertEquals ( "test" , echo . echo ( "test" ) )
|
shouldPutIfAbsentAndRecordPutIfAbsentMetric ( ) { expect ( inner . putIfAbsent ( eq ( keyBytes ) , aryEq ( valueAndTimestampBytes ) ) ) . andReturn ( null ) ; init ( ) ; metered . putIfAbsent ( key , valueAndTimestamp ) ; final org . apache . kafka . common . metrics . KafkaMetric metric = metric ( "put-if-absent-rate" ) ; "<AssertPlaceHolder>" ; verify ( inner ) ; } metricValue ( ) { long now = time . milliseconds ( ) ; synchronized ( this . lock ) { if ( ( this . metricValueProvider ) instanceof org . apache . kafka . common . metrics . Measurable ) return ( ( org . apache . kafka . common . metrics . Measurable ) ( metricValueProvider ) ) . measure ( config , now ) ; else if ( ( this . metricValueProvider ) instanceof org . apache . kafka . common . metrics . Gauge ) return ( ( org . apache . kafka . common . metrics . Gauge < ? > ) ( metricValueProvider ) ) . value ( config , now ) ; else throw new java . lang . IllegalStateException ( ( "Not<sp>a<sp>valid<sp>metric:<sp>" + ( this . metricValueProvider . getClass ( ) ) ) ) ; } }
|
org . junit . Assert . assertTrue ( ( ( ( java . lang . Double ) ( metric . metricValue ( ) ) ) > 0 ) )
|
indexOf_A$Object_exists ( ) { com . m3 . scalaflavor4j . Seq < java . lang . Integer > seq = com . m3 . scalaflavor4j . IndexedSeq . apply ( 1 , 2 , 3 ) ; java . lang . Integer elem = 2 ; int actual = seq . indexOf ( elem ) ; int expected = 1 ; "<AssertPlaceHolder>" ; } indexOf ( T ) { return - 1 ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testSignVerifyTrustPolicyWithNamespace ( ) { java . security . KeyPair keypair = com . intel . dcsg . cpg . crypto . RsaUtil . generateRsaKeyPair ( com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignatureTest . keySizeInBits ) ; java . security . cert . X509Certificate certificate = com . intel . dcsg . cpg . crypto . RsaUtil . generateX509Certificate ( "TrustDirector" , keypair , com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignatureTest . validityInDays ) ; com . intel . dcsg . cpg . xml . JAXB jaxb = new com . intel . dcsg . cpg . xml . JAXB ( ) ; java . lang . String xml = org . apache . commons . io . IOUtils . toString ( getClass ( ) . getResourceAsStream ( com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignatureTest . xmlpath ) , java . nio . charset . Charset . forName ( "UTF-8" ) ) ; java . lang . String editedXml = jaxb . write ( jaxb . read ( xml , com . intel . mtwilson . trustpolicy . xml . TrustPolicy . class ) ) ; com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignature signer = new com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignature ( ) ; java . lang . String signedXml = signer . generateDsig ( editedXml , keypair . getPrivate ( ) , certificate ) ; com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignatureTest . log . debug ( "signed<sp>xml:<sp>{}" , signedXml ) ; boolean isValid = com . intel . mtwilson . util . xml . dsig . XmlDsigVerify . isValid ( signedXml , certificate ) ; com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignatureTest . log . debug ( "xml<sp>signature<sp>valid?<sp>{}" , isValid ) ; "<AssertPlaceHolder>" ; java . lang . String editedXml2 = jaxb . write ( jaxb . read ( signedXml , com . intel . mtwilson . trustpolicy . xml . TrustPolicy . class ) ) ; com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignatureTest . log . debug ( "edited<sp>xml:<sp>{}" , editedXml2 ) ; boolean editedIsValid = com . intel . mtwilson . util . xml . dsig . XmlDsigVerify . isValid ( editedXml2 , certificate ) ; com . intel . mtwilson . v2 . vm . attestation . rpc . TrustPolicySignatureTest . log . debug ( "edited<sp>xml<sp>valid?<sp>{}" , editedIsValid ) ; } isValid ( java . security . cert . X509Certificate , java . util . Date ) { try { org . bouncycastle . cert . X509AttributeCertificateHolder holder = new org . bouncycastle . cert . X509AttributeCertificateHolder ( encoded ) ; org . bouncycastle . operator . ContentVerifierProvider verifierProvider = new org . bouncycastle . operator . bc . BcRSAContentVerifierProviderBuilder ( new org . bouncycastle . operator . DefaultDigestAlgorithmIdentifierFinder ( ) ) . build ( new org . bouncycastle . cert . X509CertificateHolder ( issuer . getEncoded ( ) ) ) ; if ( ! ( holder . isSignatureValid ( verifierProvider ) ) ) { com . intel . mtwilson . tag . model . X509AttributeCertificate . log . debug ( "Certificate<sp>signature<sp>cannot<sp>be<sp>validated<sp>with<sp>certificate:<sp>{}" , issuer . getIssuerX500Principal ( ) . getName ( ) ) ; return false ; } return ( ( date . compareTo ( notBefore ) ) > ( - 1 ) ) && ( ( date . compareTo ( notAfter ) ) < 1 ) ; } catch ( java . lang . Exception e ) { com . intel . mtwilson . tag . model . X509AttributeCertificate . log . error ( "Cannot<sp>initialize<sp>certificate<sp>verifier" , e ) ; return false ; } }
|
org . junit . Assert . assertTrue ( isValid )
|
testGetType ( ) { org . jinstagram . realtime . SubscriptionResponseData fixture = new org . jinstagram . realtime . SubscriptionResponseData ( ) ; fixture . setCallbackUrl ( "" ) ; fixture . setObject ( "" ) ; fixture . setAspect ( "" ) ; fixture . setObjectId ( "" ) ; fixture . setId ( "" ) ; fixture . setType ( "" ) ; java . lang . String result = fixture . getType ( ) ; "<AssertPlaceHolder>" ; } getType ( ) { return type ; }
|
org . junit . Assert . assertEquals ( "" , result )
|
testInitialized ( ) { final de . mirkosertic . bytecoder . core . ClassInitializerTest . TestClass test = new de . mirkosertic . bytecoder . core . ClassInitializerTest . TestClass ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 12 , test . x , 0 )
|
singleContext ( ) { final java . lang . String context = "org.apache.isis.applib.services.bookmark.BookmarkHolderAssociationContributions#object()" ; final java . lang . String msgId = "Work<sp>of<sp>art" ; final java . lang . String msgStr = "Objet<sp>d'art" ; poReader = new org . apache . isis . core . runtime . services . i18n . po . PoReader ( mockTranslationServicePo ) { @ org . apache . isis . core . runtime . services . i18n . po . Override protected java . util . List < java . lang . String > readPo ( final java . util . Locale locale ) { final java . util . List < java . lang . String > lines = com . google . common . collect . Lists . newArrayList ( ) ; lines . add ( java . lang . String . format ( "#:<sp>%s" , context ) ) ; lines . add ( java . lang . String . format ( "msgid<sp>\"%s\"" , msgId ) ) ; lines . add ( java . lang . String . format ( "msgstr<sp>\"%s\"" , msgStr ) ) ; return lines ; } } ; final java . lang . String translated = poReader . translate ( context , msgId ) ; "<AssertPlaceHolder>" ; } is ( org . apache . isis . core . metamodel . spec . feature . Contributed ) { return new com . google . common . base . Predicate < T > ( ) { @ org . apache . isis . core . metamodel . specloader . specimpl . Override public boolean apply ( org . apache . isis . core . metamodel . spec . feature . ObjectMember input ) { return contributed . isIncluded ( ) ; } } ; }
|
org . junit . Assert . assertThat ( translated , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( msgStr ) ) )
|
testAdditionalKeyForWrappedManagerReturnCurrentMeasure ( ) { org . uma . jmetal . util . measure . impl . ListenerTimeMeasure measure = new org . uma . jmetal . util . measure . impl . ListenerTimeMeasure ( ) ; java . lang . String key = "measure" ; org . uma . jmetal . util . measure . impl . SimpleMeasureManager wrapped = new org . uma . jmetal . util . measure . impl . SimpleMeasureManager ( ) ; org . uma . jmetal . util . measure . MeasureManager wrapper = measure . wrapManager ( wrapped , key ) ; "<AssertPlaceHolder>" ; } getPullMeasure ( java . lang . Object ) { return ( ( org . uma . jmetal . util . measure . PullMeasure < T > ) ( pullers . get ( key ) ) ) ; }
|
org . junit . Assert . assertEquals ( measure , wrapper . getPullMeasure ( key ) )
|
testGetAllCustomUITemplateByCrisisID ( ) { qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCustomUiTemplateResourceFacadeImp . entityManager . getTransaction ( ) . begin ( ) ; java . util . List < qa . qcri . aidr . dbmanager . dto . CustomUiTemplateDTO > result = qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCustomUiTemplateResourceFacadeImp . customUiTemplateResourceFacadeImp . getAllCustomUITemplateByCrisisID ( qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCustomUiTemplateResourceFacadeImp . crisis . getCrisisID ( ) ) ; qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestCustomUiTemplateResourceFacadeImp . entityManager . getTransaction ( ) . commit ( ) ; "<AssertPlaceHolder>" ; } getCrisisID ( ) { return this . crisisID ; }
|
org . junit . Assert . assertTrue ( ( ( result . size ( ) ) >= 1 ) )
|
testConstructors ( ) { gov . sandia . cognition . data . convert . number . StringToDoubleConverter instance = new gov . sandia . cognition . data . convert . number . StringToDoubleConverter ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( instance )
|
testPatternPropertyWithNoValue ( ) { java . util . Properties properties = new java . util . Properties ( ) ; properties . setProperty ( "nifi.security.identity.mapping.pattern.dn" , "" ) ; properties . setProperty ( "nifi.security.identity.mapping.value.dn" , "value" ) ; final org . apache . nifi . util . NiFiProperties nifiProperties = getNiFiProperties ( properties ) ; org . apache . nifi . web . security . NiFiAuthenticationProviderTest . TestableNiFiAuthenticationProvider provider = new org . apache . nifi . web . security . NiFiAuthenticationProviderTest . TestableNiFiAuthenticationProvider ( nifiProperties ) ; java . util . List < org . apache . nifi . authorization . util . IdentityMapping > mappings = provider . getMappings ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return bytes . length ; }
|
org . junit . Assert . assertEquals ( 0 , mappings . size ( ) )
|
runTest ( ) { boolean result = checkNoError ( "Social_Files_Upload_New_Version_of_a_File" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
|
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
|
test2 ( ) { com . examples . with . different . packagename . testcarver . ClassWithPublicStaticField x = new com . examples . with . different . packagename . testcarver . ClassWithPublicStaticField ( ) ; "<AssertPlaceHolder>" ; } testMe ( java . lang . String ) { java . lang . String tmpdir = java . lang . System . getProperty ( "java.io.tmpdir" ) ; java . io . File f = new java . io . File ( ( ( tmpdir + ( java . io . File . separator ) ) + "this_file_should_not_be_deleted_by_evosuite" ) ) ; org . apache . commons . io . FileUtils . deleteQuietly ( f ) ; }
|
org . junit . Assert . assertTrue ( x . testMe ( ClassWithPublicStaticField . x ) )
|
testTestNodeHashCodeIsNotEquals ( ) { il . co . topq . difido . model . execution . TestNode test0 = generateTestNode ( ) ; il . co . topq . difido . model . execution . TestNode test1 = generateTestNode ( ) ; test1 . setIndex ( 2 ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int result = 31 ; if ( ( uid ) != null ) { result = ( 31 * result ) + ( uid . hashCode ( ) ) ; } if ( ( name ) != null ) { result = ( 31 * result ) + ( name . hashCode ( ) ) ; } result = ( 31 * result ) + ( executionId ) ; if ( ( execution ) != null ) { result = ( 31 * result ) + ( execution . hashCode ( ) ) ; } if ( ( parent ) != null ) { result = ( 31 * result ) + ( parent . hashCode ( ) ) ; } if ( ( status ) != null ) { result = ( 31 * result ) + ( status . hashCode ( ) ) ; } if ( ( executionTimeStamp ) != null ) { result = ( 31 * result ) + ( executionTimeStamp . hashCode ( ) ) ; } result = ( 31 * result ) + ( new java . lang . Long ( executionDuration ) . intValue ( ) ) ; if ( ( machine ) != null ) { result = ( 31 * result ) + ( machine . hashCode ( ) ) ; } if ( ( description ) != null ) { result = ( 31 * result ) + ( description . hashCode ( ) ) ; } if ( ( timeStamp ) != null ) { result = ( 31 * result ) + ( timeStamp . hashCode ( ) ) ; } if ( ( url ) != null ) { result = ( 31 * result ) + ( url . hashCode ( ) ) ; } result = ( 31 * result ) + ( new java . lang . Long ( duration ) . intValue ( ) ) ; if ( ( parameters ) != null ) { result = ( 31 * result ) + ( parameters . hashCode ( ) ) ; } if ( ( properties ) != null ) { result = ( 31 * result ) + ( properties . hashCode ( ) ) ; } if ( ( scenarioProperties ) != null ) { result = ( 31 * result ) + ( scenarioProperties . hashCode ( ) ) ; } return result ; }
|
org . junit . Assert . assertTrue ( ( ( test0 . hashCode ( ) ) != ( test1 . hashCode ( ) ) ) )
|
givenMultiThread_whenStaticSyncBlock ( ) { java . util . concurrent . ExecutorService service = java . util . concurrent . Executors . newCachedThreadPool ( ) ; java . util . stream . IntStream . range ( 0 , 1000 ) . forEach ( ( count ) -> service . submit ( com . baeldung . concurrent . synchronize . BaeldungSynchronizedBlocks :: performStaticSyncTask ) ) ; service . awaitTermination ( 500 , TimeUnit . MILLISECONDS ) ; "<AssertPlaceHolder>" ; } getStaticCount ( ) { return com . baeldung . concurrent . synchronize . BaeldungSynchronizedBlocks . staticCount ; }
|
org . junit . Assert . assertEquals ( 1000 , com . baeldung . concurrent . synchronize . BaeldungSynchronizedBlocks . getStaticCount ( ) )
|
testGetSaveValidatorWhenItIsReadOnlyAndItIsNotCurrentLatest ( ) { editor . isReadOnly = true ; doReturn ( false ) . when ( versionRecordManager ) . isCurrentLatest ( ) ; final boolean success = editor . getSaveValidator ( ) . get ( ) ; verify ( versionRecordManager ) . restoreToCurrentVersion ( ) ; "<AssertPlaceHolder>" ; } restoreToCurrentVersion ( ) { restorePopUpPresenter . show ( getCurrentPath ( ) , getCurrentVersionRecordUri ( ) ) ; }
|
org . junit . Assert . assertFalse ( success )
|
testReactiveStreams ( ) { net . oneandone . troilus . reactive . MySubscriber subscriber = new net . oneandone . troilus . reactive . MySubscriber ( ) ; int num = 400 ; org . reactivestreams . Publisher < net . oneandone . troilus . Record > publisher = net . oneandone . troilus . SimpleResultList . newResultListPublisher ( num , 20 ) ; publisher . subscribe ( subscriber ) ; "<AssertPlaceHolder>" ; } getAll ( ) { synchronized ( this ) { if ( ! ( isCompleted . get ( ) ) ) { try { wait ( ) ; } catch ( java . lang . InterruptedException ignore ) { } } return com . google . common . collect . ImmutableList . copyOf ( elements ) ; } }
|
org . junit . Assert . assertEquals ( num , subscriber . getAll ( ) . size ( ) )
|
testValidTokenCredentialsWithConflict ( ) { java . util . concurrent . ExecutorService pool = java . util . concurrent . Executors . newFixedThreadPool ( 10 ) ; java . util . List < org . apache . jackrabbit . oak . api . ContentSession > sessions = new java . util . ArrayList < org . apache . jackrabbit . oak . api . ContentSession > ( ) ; try { org . apache . jackrabbit . oak . spi . security . authentication . token . TokenConfiguration tc = getSecurityProvider ( ) . getConfiguration ( org . apache . jackrabbit . oak . spi . security . authentication . token . TokenConfiguration . class ) ; javax . jcr . SimpleCredentials sc = ( ( javax . jcr . SimpleCredentials ) ( getAdminCredentials ( ) ) ) ; java . util . List < org . apache . jackrabbit . oak . spi . security . authentication . token . TokenProvider > tokenProviders = new java . util . ArrayList < org . apache . jackrabbit . oak . spi . security . authentication . token . TokenProvider > ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { org . apache . jackrabbit . oak . api . ContentSession session = login ( getAdminCredentials ( ) ) ; org . apache . jackrabbit . oak . api . Root r = session . getLatestRoot ( ) ; tokenProviders . add ( tc . getTokenProvider ( r ) ) ; sessions . add ( session ) ; } java . util . ArrayList < org . apache . jackrabbit . oak . security . authentication . token . TokenProviderImplTest . DataFuture > list = new java . util . ArrayList < org . apache . jackrabbit . oak . security . authentication . token . TokenProviderImplTest . DataFuture > ( ) ; for ( org . apache . jackrabbit . oak . spi . security . authentication . token . TokenProvider tokenProvider : tokenProviders ) { list . add ( createDataFuture ( pool , tokenProvider , sc . getUserID ( ) , java . util . Collections . < java . lang . String , java . lang . Object > emptyMap ( ) ) ) ; } for ( org . apache . jackrabbit . oak . security . authentication . token . TokenProviderImplTest . DataFuture df : list ) { "<AssertPlaceHolder>" ; } } finally { for ( org . apache . jackrabbit . oak . api . ContentSession session : sessions ) { if ( session != null ) { session . close ( ) ; } } if ( pool != null ) { pool . shutdown ( ) ; } } } get ( ) { return result ; }
|
org . junit . Assert . assertNotNull ( df . future . get ( ) )
|
testAddPropertiesDoesNotAddDefaultContentType ( ) { final org . apache . qpid . proton . message . Message message = io . vertx . proton . ProtonHelper . message ( ) ; message . setContentType ( "application/existing" ) ; adapter . addProperties ( message , org . eclipse . hono . service . AbstractProtocolAdapterBaseTest . newRegistrationAssertionResult ( "token" , "application/hono" ) ) ; "<AssertPlaceHolder>" ; } getContentType ( ) { if ( isValid ( ) ) { return message . getContentType ( ) ; } else { throw new java . lang . IllegalStateException ( "command<sp>is<sp>invalid" ) ; } }
|
org . junit . Assert . assertThat ( message . getContentType ( ) , org . hamcrest . CoreMatchers . is ( "application/existing" ) )
|
testRuntimeConfigGeneration ( ) { System . out . println ( "***<sp>DeployGeneratorTest<sp>/<sp>Runtime<sp>Config<sp>Generation" ) ; org . franca . deploymodel . extensions . ExtensionRegistry . addExtension ( new org . franca . deploymodel . ext . providers . ProviderExtension ( ) ) ; java . lang . String inputfile = TestConfiguration . fdeployArchFile ; org . eclipse . emf . common . util . URI root = org . eclipse . emf . common . util . URI . createURI ( "classpath:/" ) ; org . eclipse . emf . common . util . URI loc = org . eclipse . emf . common . util . URI . createFileURI ( inputfile ) ; org . franca . deploymodel . dsl . fDeploy . FDModel fdmodel = loader . loadModel ( loc , root ) ; "<AssertPlaceHolder>" ; java . util . List < org . franca . deploymodel . dsl . fDeploy . FDExtensionRoot > providers = org . franca . deploymodel . ext . providers . ProviderUtils . getProviders ( fdmodel ) ; assert ! ( providers . isEmpty ( ) ) ; org . franca . deploymodel . ext . providers . FDeployedProvider deployed = new org . franca . deploymodel . ext . providers . FDeployedProvider ( providers . get ( 0 ) ) ; org . franca . examples . deploy . generators . ExampleRuntimeConfigGenerator generator = new org . franca . examples . deploy . generators . ExampleRuntimeConfigGenerator ( ) ; java . lang . String code = generator . generateRuntimeConfig ( deployed ) . toString ( ) ; org . franca . deploymodel . extensions . ExtensionRegistry . reset ( ) ; System . out . println ( ( "Generated<sp>configuration<sp>file:\n" + code ) ) ; System . out . println ( "-----------------------------------------------------" ) ; } loadModel ( java . lang . String , java . lang . String ) { java . lang . String fn = filename ; if ( fn == null ) return null ; if ( ! ( fn . endsWith ( ( "." + ( org . franca . core . dsl . FrancaPersistenceManager . FRANCA_FILE_EXTENSION ) ) ) ) ) { fn += "." + ( org . franca . core . dsl . FrancaPersistenceManager . FRANCA_FILE_EXTENSION ) ; } org . franca . core . utils . ModelPersistenceHandler persistenceHandler = createModelPersistenceHandler ( resourceSetProvider . get ( ) ) ; return ( ( org . franca . core . franca . FModel ) ( persistenceHandler . loadModel ( fn , cwd ) ) ) ; }
|
org . junit . Assert . assertNotNull ( fdmodel )
|
insert_area_chart ( ) { int widgetSize = jq ( ".zswidget" ) . length ( ) ; click ( ".zstab-insertPanel" ) ; int tRow = 11 ; int lCol = 5 ; int bRow = 13 ; int rCol = 6 ; spreadsheet . setSelection ( tRow , lCol , bRow , rCol ) ; click ( ".zstbtn-areaChart" ) ; "<AssertPlaceHolder>" ; } jq ( java . lang . String ) { return jqFactory . create ( ( ( "'" + selector ) + "'" ) ) ; }
|
org . junit . Assert . assertEquals ( ( widgetSize + 1 ) , jq ( ".zswidget" ) . length ( ) )
|
shouldFindAll ( ) { final com . jeromeloisel . db . repository . elasticsearch . Person save = repository . save ( com . jeromeloisel . db . repository . elasticsearch . RepositoryIntegrationTest . PERSON ) ; "<AssertPlaceHolder>" ; repository . delete ( save ) ; } findAll ( java . util . List ) { if ( ids . isEmpty ( ) ) { return com . google . common . collect . ImmutableList . of ( ) ; } final com . google . common . collect . ImmutableList . Builder < T > builder = com . google . common . collect . ImmutableList . builder ( ) ; final org . elasticsearch . action . get . MultiGetResponse response = client . prepareMultiGet ( ) . add ( index , type , ids ) . execute ( ) . actionGet ( ) ; for ( final org . elasticsearch . action . get . MultiGetItemResponse item : response . getResponses ( ) ) { final org . elasticsearch . action . get . GetResponse get = item . getResponse ( ) ; if ( get . isSourceEmpty ( ) ) { continue ; } final java . lang . String json = get . getSourceAsString ( ) ; final T entity = deserializer . apply ( json ) ; builder . add ( ( ( T ) ( entity . withId ( get . getId ( ) ) ) ) ) ; } return builder . build ( ) ; }
|
org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableList . of ( save ) , repository . findAll ( com . google . common . collect . ImmutableList . of ( save . getId ( ) ) ) )
|
testForVarCharArrayWithOneElementIndex ( ) { java . lang . String [ ] strArr = new java . lang . String [ 1 ] ; strArr [ 0 ] = "abx" ; org . apache . phoenix . schema . types . PhoenixArray arr = org . apache . phoenix . schema . types . PArrayDataType . instantiatePhoenixArray ( PVarchar . INSTANCE , strArr ) ; byte [ ] bytes = PVarcharArray . INSTANCE . toBytes ( arr ) ; org . apache . hadoop . hbase . io . ImmutableBytesWritable ptr = new org . apache . hadoop . hbase . io . ImmutableBytesWritable ( bytes ) ; org . apache . phoenix . schema . types . PArrayDataTypeDecoder . positionAtArrayElement ( ptr , 0 , PVarchar . INSTANCE , PVarchar . INSTANCE . getByteSize ( ) ) ; int offset = ptr . getOffset ( ) ; int length = ptr . getLength ( ) ; byte [ ] bs = ptr . get ( ) ; byte [ ] res = new byte [ length ] ; java . lang . System . arraycopy ( bs , offset , res , 0 , length ) ; "<AssertPlaceHolder>" ; } toString ( org . apache . hadoop . hbase . Cell ) { return ( ( kv . toString ( ) ) + "/value=" ) + ( org . apache . hadoop . hbase . util . Bytes . toStringBinary ( kv . getValueArray ( ) , kv . getValueOffset ( ) , kv . getValueLength ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( "abx" , org . apache . hadoop . hbase . util . Bytes . toString ( res ) )
|
skillViolationAtStart_shouldWork ( ) { jsprit . core . analysis . SolutionAnalyser analyser = new jsprit . core . analysis . SolutionAnalyser ( vrp , solution , new jsprit . core . problem . cost . TransportDistance ( ) { @ jsprit . core . analysis . Override public double getDistance ( jsprit . core . problem . Location from , jsprit . core . problem . Location to ) { return vrp . getTransportCosts ( ) . getTransportCost ( from , to , 0.0 , null , null ) ; } } ) ; jsprit . core . problem . solution . route . VehicleRoute route = solution . getRoutes ( ) . iterator ( ) . next ( ) ; java . lang . Boolean violated = analyser . hasSkillConstraintViolationAtActivity ( route . getStart ( ) , route ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertFalse ( violated )
|
bidule ( ) { jrds . ProbeDesc pd = jrds . mockobjects . GetMoke . getPd ( ) ; pd . add ( "MokeDs2" , DsType . GAUGE ) ; @ SuppressWarnings ( "unchecked" ) jrds . Probe < java . lang . String , java . lang . Number > p = jrds . mockobjects . GenerateProbe . quickProbe ( testFolder ) ; p . setPd ( pd ) ; p . setStep ( 300 ) ; p . setName ( "dummy" ) ; boolean checked = p . getMainStore ( ) . checkStoreFile ( ArchivesSet . DEFAULT ) ; "<AssertPlaceHolder>" ; org . rrd4j . core . RrdDef def = ( ( org . rrd4j . core . RrdDb ) ( p . getMainStore ( ) . getStoreObject ( ) ) ) . getRrdDef ( ) ; def . setStep ( 300 ) ; org . rrd4j . core . RrdDb db = new org . rrd4j . core . RrdDb ( def ) ; long time = ( java . lang . System . currentTimeMillis ( ) ) / 1000 ; org . rrd4j . core . Sample s = db . createSample ( ) ; s . set ( ( time + ":1:1" ) ) ; s . update ( ) ; time += 60 ; s . set ( ( time + ":2:2" ) ) ; s . update ( ) ; time += 60 ; s . set ( ( time + ":3:3" ) ) ; s . update ( ) ; time += 60 ; s . set ( ( time + ":4:4" ) ) ; s . update ( ) ; time += 60 ; s . set ( ( time + ":5:5" ) ) ; s . update ( ) ; p . checkStore ( ) ; } checkStoreFile ( jrds . ArchivesSet ) { return false ; }
|
org . junit . Assert . assertTrue ( checked )
|
parse_doesNotFailWithManyObjects ( ) { com . eclipsesource . json . JsonArray array = new com . eclipsesource . json . JsonArray ( ) ; for ( int i = 0 ; i < 1001 ; i ++ ) { array . add ( new com . eclipsesource . json . JsonObject ( ) . add ( "a" , 7 ) ) ; } final java . lang . String input = array . toString ( ) ; com . eclipsesource . json . JsonValue result = com . eclipsesource . json . Json . parse ( input ) ; "<AssertPlaceHolder>" ; } isArray ( ) { return false ; }
|
org . junit . Assert . assertTrue ( result . isArray ( ) )
|
testRoundRobin ( ) { org . apache . servicecomb . loadbalance . RoundRobinRuleExt rule = new org . apache . servicecomb . loadbalance . RoundRobinRuleExt ( ) ; org . apache . servicecomb . loadbalance . LoadBalancer loadBalancer = new org . apache . servicecomb . loadbalance . LoadBalancer ( rule , "testService" ) ; java . util . List < org . apache . servicecomb . loadbalance . ServiceCombServer > servers = new java . util . ArrayList ( ) ; org . apache . servicecomb . core . Invocation invocation = org . mockito . Mockito . mock ( org . apache . servicecomb . core . Invocation . class ) ; for ( int i = 0 ; i < 2 ; i ++ ) { org . apache . servicecomb . loadbalance . ServiceCombServer server = org . mockito . Mockito . mock ( org . apache . servicecomb . loadbalance . ServiceCombServer . class ) ; org . mockito . Mockito . when ( server . toString ( ) ) . thenReturn ( ( "server<sp>" + i ) ) ; servers . add ( server ) ; loadBalancer . getLoadBalancerStats ( ) . noteResponseTime ( server , 1 ) ; } java . util . concurrent . atomic . AtomicInteger server1 = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; java . util . concurrent . atomic . AtomicInteger server2 = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; for ( int i = 0 ; i < 2000 ; i ++ ) { if ( rule . choose ( servers , invocation ) . toString ( ) . equals ( "server<sp>0" ) ) { server1 . incrementAndGet ( ) ; } else { server2 . incrementAndGet ( ) ; } } "<AssertPlaceHolder>" ; } get ( ) { return value ; }
|
org . junit . Assert . assertEquals ( server1 . get ( ) , server2 . get ( ) )
|
testWycheproofVectors ( ) { org . json . JSONObject json = com . google . crypto . tink . WycheproofTestUtil . readJson ( "../wycheproof/testvectors/aes_gcm_test.json" ) ; int errors = 0 ; int cntSkippedTests = 0 ; org . json . JSONArray testGroups = json . getJSONArray ( "iv" 0 ) ; for ( int i = 0 ; i < ( testGroups . length ( ) ) ; i ++ ) { org . json . JSONObject group = testGroups . getJSONObject ( i ) ; int keySize = group . getInt ( "keySize" ) ; org . json . JSONArray tests = group . getJSONArray ( "iv" 6 ) ; if ( ! ( java . util . Arrays . asList ( keySizeInBytes ) . contains ( ( keySize / 8 ) ) ) ) { cntSkippedTests += tests . length ( ) ; continue ; } for ( int j = 0 ; j < ( tests . length ( ) ) ; j ++ ) { org . json . JSONObject testcase = tests . getJSONObject ( j ) ; java . lang . String tcId = java . lang . String . format ( "testcase<sp>%d<sp>(%s)" , testcase . getInt ( "iv" 1 ) , testcase . getString ( "comment" ) ) ; byte [ ] iv = com . google . crypto . tink . subtle . Hex . decode ( testcase . getString ( "iv" ) ) ; byte [ ] key = com . google . crypto . tink . subtle . Hex . decode ( testcase . getString ( "key" ) ) ; byte [ ] msg = com . google . crypto . tink . subtle . Hex . decode ( testcase . getString ( "msg" ) ) ; byte [ ] aad = com . google . crypto . tink . subtle . Hex . decode ( testcase . getString ( "iv" 7 ) ) ; byte [ ] ct = com . google . crypto . tink . subtle . Hex . decode ( testcase . getString ( "iv" 8 ) ) ; byte [ ] tag = com . google . crypto . tink . subtle . Hex . decode ( testcase . getString ( "tag" ) ) ; byte [ ] ciphertext = com . google . crypto . tink . subtle . Bytes . concat ( iv , ct , tag ) ; java . lang . String result = testcase . getString ( "result" ) ; if ( ( iv . length ) != 12 ) { result = "iv" 4 ; } try { com . google . crypto . tink . subtle . AesGcmJce gcm = new com . google . crypto . tink . subtle . AesGcmJce ( key ) ; byte [ ] decrypted = gcm . decrypt ( ciphertext , aad ) ; boolean eq = com . google . crypto . tink . TestUtil . arrayEquals ( decrypted , msg ) ; if ( result . equals ( "iv" 4 ) ) { System . out . printf ( "iv" 3 , tcId , com . google . crypto . tink . subtle . Hex . encode ( msg ) , com . google . crypto . tink . subtle . Hex . encode ( decrypted ) ) ; errors ++ ; } else { if ( ! eq ) { System . out . printf ( "iv" 2 , tcId , com . google . crypto . tink . subtle . Hex . encode ( decrypted ) , com . google . crypto . tink . subtle . Hex . encode ( msg ) ) ; errors ++ ; } } } catch ( java . security . GeneralSecurityException ex ) { if ( result . equals ( "iv" 5 ) ) { System . out . printf ( "iv" 9 , tcId , ex ) ; errors ++ ; } } } } System . out . printf ( "key" 0 , cntSkippedTests ) ; "<AssertPlaceHolder>" ; } encode ( byte [ ] ) { java . lang . String chars = "0123456789abcdef" ; java . lang . StringBuilder result = new java . lang . StringBuilder ( ( 2 * ( bytes . length ) ) ) ; for ( byte b : bytes ) { int val = b & 255 ; result . append ( chars . charAt ( ( val / 16 ) ) ) ; result . append ( chars . charAt ( ( val % 16 ) ) ) ; } return result . toString ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , errors )
|
shouldCallGetMetaData ( ) { "<AssertPlaceHolder>" ; } getMetaData ( ) { try { return new org . modeshape . jca . JcrManagedConnectionMetaData ( mcf . getRepository ( ) , session ) ; } catch ( java . lang . Exception e ) { throw new javax . resource . ResourceException ( e ) ; } }
|
org . junit . Assert . assertNotNull ( conn . getMetaData ( ) )
|
events ( ) { "<AssertPlaceHolder>" ; } events ( ) { org . junit . Assert . assertThat ( facebook . events ( ) , org . hamcrest . CoreMatchers . instanceOf ( facebook4j . EventMethods . class ) ) ; }
|
org . junit . Assert . assertThat ( facebook . events ( ) , org . hamcrest . CoreMatchers . instanceOf ( facebook4j . EventMethods . class ) )
|
testBeanReferenceNoMarkersInProfileSection ( ) { java . util . Set < org . eclipse . core . resources . IMarker > markers = org . springframework . ide . eclipse . core . MarkerUtils . getAllMarkersInRange ( resource , 37 , 57 ) ; "<AssertPlaceHolder>" ; } size ( ) { return orderedStorage . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , markers . size ( ) )
|
testCreateMockBuilder ( ) { org . easymock . IMockBuilder < org . easymock . tests2 . MocksControlTest . A > builder = createMockBuilder ( org . easymock . tests2 . MocksControlTest . A . class ) ; org . easymock . tests2 . MocksControlTest . A a = builder . withConstructor ( int . class ) . withArgs ( 2 ) . createMock ( ) ; "<AssertPlaceHolder>" ; } createMock ( ) { org . junit . Assert . assertThrows ( org . easymock . tests . IllegalStateException . class , ( ) -> mocksControl . createMock ( . class ) ) ; }
|
org . junit . Assert . assertEquals ( 2 , a . i )
|
testClob ( ) { try ( org . sql2o . Connection connection = sql2o . open ( ) ) { connection . createQuery ( "create<sp>table<sp>testClob(id<sp>integer<sp>primary<sp>key,<sp>val<sp>clob)" ) . executeUpdate ( ) ; connection . createQuery ( "insert<sp>into<sp>testClob<sp>(id,<sp>val)<sp>values<sp>(:id,<sp>:val)" ) . addParameter ( "id" , 1 ) . addParameter ( "val" , "something" ) . executeUpdate ( ) ; java . lang . String val = connection . createQuery ( "select<sp>val<sp>from<sp>testClob<sp>where<sp>id<sp>=<sp>:id" ) . addParameter ( "id" , 1 ) . executeScalar ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } } executeScalar ( java . lang . Class ) { try { org . sql2o . converters . Converter < V > converter ; converter = throwIfNull ( returnType , getQuirks ( ) . converterOf ( returnType ) ) ; logExecution ( ) ; return executeScalar ( converter ) ; } catch ( org . sql2o . converters . ConverterException e ) { throw new org . sql2o . Sql2oException ( ( "Error<sp>occured<sp>while<sp>converting<sp>value<sp>from<sp>database<sp>to<sp>type<sp>" + returnType ) , e ) ; } }
|
org . junit . Assert . assertThat ( val , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( "something" ) ) )
|
questionsAreParsedCorrectly ( ) { com . ece . superkids . questions . entities . Question question = questionDatabase . getQuestion ( QuestionLevel . LEVEL_1 , QuestionCategory . SHAPES , 0 ) ; "<AssertPlaceHolder>" ; } getQuestion ( com . ece . superkids . questions . enums . QuestionLevel , com . ece . superkids . questions . enums . QuestionCategory , int ) { if ( ( questions . get ( level ) . get ( category ) . size ( ) ) <= number ) { return null ; } return questions . get ( level ) . get ( category ) . get ( number ) ; }
|
org . junit . Assert . assertEquals ( expected , question )
|
namePropertyFromNameValue ( ) { org . apache . jackrabbit . oak . api . PropertyState nameProperty = org . apache . jackrabbit . oak . plugins . memory . PropertyStates . createProperty ( "name" , "oak-prefix:value" , PropertyType . NAME ) ; javax . jcr . Value nameValue = valueFactory . createValue ( nameProperty ) ; org . apache . jackrabbit . oak . api . PropertyState namePropertyFromValue = org . apache . jackrabbit . oak . plugins . memory . PropertyStates . createProperty ( "name" , nameValue ) ; "<AssertPlaceHolder>" ; } createProperty ( java . lang . String , javax . jcr . Value ) { int type = value . getType ( ) ; switch ( type ) { case javax . jcr . PropertyType . STRING : return org . apache . jackrabbit . oak . plugins . memory . StringPropertyState . stringProperty ( name , org . apache . jackrabbit . oak . plugins . memory . PropertyStates . getString ( value , type ) ) ; case javax . jcr . PropertyType . BINARY : return org . apache . jackrabbit . oak . plugins . memory . BinaryPropertyState . binaryProperty ( name , value ) ; case javax . jcr . PropertyType . LONG : return org . apache . jackrabbit . oak . plugins . memory . LongPropertyState . createLongProperty ( name , value . getLong ( ) ) ; case javax . jcr . PropertyType . DOUBLE : return org . apache . jackrabbit . oak . plugins . memory . DoublePropertyState . doubleProperty ( name , value . getDouble ( ) ) ; case javax . jcr . PropertyType . BOOLEAN : return org . apache . jackrabbit . oak . plugins . memory . BooleanPropertyState . booleanProperty ( name , value . getBoolean ( ) ) ; case javax . jcr . PropertyType . DECIMAL : return org . apache . jackrabbit . oak . plugins . memory . DecimalPropertyState . decimalProperty ( name , value . getDecimal ( ) ) ; default : return new org . apache . jackrabbit . oak . plugins . memory . GenericPropertyState ( name , org . apache . jackrabbit . oak . plugins . memory . PropertyStates . getString ( value , type ) , org . apache . jackrabbit . oak . api . Type . fromTag ( type , false ) ) ; } }
|
org . junit . Assert . assertEquals ( nameProperty , namePropertyFromValue )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.