input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testLookupSymbolNode ( ) { final tlc2 . util . ContextTest . DummySymbolNode name = new tlc2 . util . ContextTest . DummySymbolNode ( ) ; final java . lang . Object value = new java . lang . Object ( ) ; final tlc2 . util . Context ctx = tlc2 . util . Context . branch ( Context . Empty ) ; tlc2 . util . Context cons = ctx . cons ( name , value ) ; java . lang . Object lookup = cons . lookup ( name ) ; "<AssertPlaceHolder>" ; } lookup ( util . UniqueString ) { int loc = var . getVarLoc ( ) ; if ( loc < 0 ) return null ; return this . values [ loc ] ; } | org . junit . Assert . assertEquals ( value , lookup ) |
testParseColumnVisibility ( ) { java . util . Properties properties = new java . util . Properties ( ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; properties . setProperty ( AccumuloSerDeParameters . COLUMN_MAPPINGS , ":rowid,cf:f2,cf:f3" ) ; properties . setProperty ( serdeConstants . LIST_COLUMNS , "field1,field2,field3" ) ; properties . setProperty ( serdeConstants . LIST_TYPE_NAME , "string,string,string" ) ; properties . setProperty ( AccumuloSerDeParameters . VISIBILITY_LABEL_KEY , "foo&bar" ) ; org . apache . hadoop . hive . accumulo . serde . AccumuloSerDeParameters params = new org . apache . hadoop . hive . accumulo . serde . AccumuloSerDeParameters ( conf , properties , org . apache . hadoop . hive . accumulo . serde . AccumuloSerDe . class . getName ( ) ) ; org . apache . accumulo . core . security . ColumnVisibility cv = params . getTableVisibilityLabel ( ) ; "<AssertPlaceHolder>" ; } getTableVisibilityLabel ( ) { java . lang . String visibilityLabel = tableProperties . getProperty ( org . apache . hadoop . hive . accumulo . serde . AccumuloSerDeParameters . VISIBILITY_LABEL_KEY , null ) ; if ( ( null == visibilityLabel ) || ( visibilityLabel . isEmpty ( ) ) ) { return org . apache . hadoop . hive . accumulo . serde . AccumuloSerDeParameters . DEFAULT_VISIBILITY_LABEL ; } return new org . apache . accumulo . core . security . ColumnVisibility ( visibilityLabel ) ; } | org . junit . Assert . assertEquals ( new org . apache . accumulo . core . security . ColumnVisibility ( "foo&bar" ) , cv ) |
testToArray ( ) { com . carrotsearch . hppc . KTypeStack < java . lang . Integer > l1 = com . carrotsearch . hppc . KTypeStack . from ( 1 , 2 , 3 ) ; java . lang . Object [ ] result = l1 . toArray ( ) ; "<AssertPlaceHolder>" ; } toArray ( ) { final int size = size ( ) ; return toArray ( com . carrotsearch . hppc . Intrinsics . < KType > newArray ( size ) ) ; } | org . junit . Assert . assertArrayEquals ( new java . lang . Object [ ] { 1 , 2 , 3 } , result ) |
shouldNotSkipAccountSetupWhenNothingSet ( ) { org . exoplatform . commons . utils . PropertyManager . setProperty ( AccountSetupService . ACCOUNT_SETUP_SKIP_PROPERTY , "" ) ; org . exoplatform . commons . utils . PropertyManager . setProperty ( PropertyManager . DEVELOPING , "" ) ; when ( settingService . get ( any ( org . exoplatform . commons . api . settings . data . Context . class ) , any ( org . exoplatform . commons . api . settings . data . Scope . class ) , eq ( AccountSetupService . ACCOUNT_SETUP_NODE ) ) ) . thenReturn ( null ) ; org . exoplatform . platform . common . account . setup . web . AccountSetupService accountSetupService = new org . exoplatform . platform . common . account . setup . web . AccountSetupService ( settingService , organizationService ) ; boolean mustSkip = accountSetupService . mustSkipAccountSetup ( ) ; "<AssertPlaceHolder>" ; } mustSkipAccountSetup ( ) { if ( ( skipSetup ) == null ) { org . exoplatform . commons . api . settings . SettingValue accountSetupNode = settingService . get ( Context . GLOBAL , Scope . GLOBAL , org . exoplatform . platform . common . account . setup . web . AccountSetupService . ACCOUNT_SETUP_NODE ) ; java . lang . String propertySetupSkip = org . exoplatform . commons . utils . PropertyManager . getProperty ( org . exoplatform . platform . common . account . setup . web . AccountSetupService . ACCOUNT_SETUP_SKIP_PROPERTY ) ; if ( propertySetupSkip == null ) { org . exoplatform . platform . common . account . setup . web . AccountSetupService . LOG . debug ( "Property<sp>accountsetup.skip<sp>not<sp>found<sp>in<sp>configuration.properties" ) ; propertySetupSkip = "false" ; } skipSetup = ( ( accountSetupNode != null ) || ( propertySetupSkip . equals ( "true" ) ) ) || ( org . exoplatform . commons . utils . PropertyManager . isDevelopping ( ) ) ; } return skipSetup ; } | org . junit . Assert . assertFalse ( mustSkip ) |
exists_A$Function1_Nil ( ) { com . m3 . scalaflavor4j . ForkJoinParSeq < java . lang . String > target = com . m3 . scalaflavor4j . ForkJoinParSeq . apply ( emptyList ) ; boolean actual = target . exists ( new com . m3 . scalaflavor4j . F1 < java . lang . String , java . lang . Boolean > ( ) { public com . m3 . scalaflavor4j . Boolean apply ( java . lang . String v1 ) { return ( v1 != null ) && ( v1 . contains ( "f" ) ) ; } } ) ; "<AssertPlaceHolder>" ; } contains ( T ) { return false ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( false ) ) |
TestMaterieleHistorieNummerVerwijzing ( ) { nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon persoon = new nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon ( nl . bzk . algemeenbrp . dal . domein . brp . enums . SoortPersoon . INGESCHREVENE ) ; nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonNummerverwijzingHistorie his = new nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonNummerverwijzingHistorie ( persoon ) ; nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonNummerverwijzingHistorie his2 = new nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonNummerverwijzingHistorie ( persoon ) ; his2 . setActieVerval ( brpActie ) ; his2 . setDatumTijdVerval ( nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonTest . TIJDSTIP ) ; persoon . getPersoonNummerverwijzingHistorieSet ( ) . add ( his ) ; persoon . getPersoonNummerverwijzingHistorieSet ( ) . add ( his2 ) ; "<AssertPlaceHolder>" ; } getNietVervallenMaterieleGroepen ( ) { return delegates . get ( 0 ) . getNietVervallenMaterieleGroepen ( ) ; } | org . junit . Assert . assertEquals ( 1 , persoon . getNietVervallenMaterieleGroepen ( ) . size ( ) ) |
testResilientIfFileDoesNotExist ( ) { jenkins . security . apitoken . ApiTokenStats tokenStats = jenkins . security . apitoken . ApiTokenStats . load ( tmp . getRoot ( ) ) ; "<AssertPlaceHolder>" ; } load ( java . io . File ) { hudson . XmlFile file = jenkins . security . apitoken . ApiTokenStats . getConfigFile ( parent ) ; jenkins . security . apitoken . ApiTokenStats apiTokenStats ; if ( file . exists ( ) ) { try { apiTokenStats = ( ( jenkins . security . apitoken . ApiTokenStats ) ( file . unmarshal ( jenkins . security . apitoken . ApiTokenStats . class ) ) ) ; } catch ( java . io . IOException e ) { jenkins . security . apitoken . ApiTokenStats . LOGGER . log ( Level . WARNING , ( "Failed<sp>to<sp>load<sp>" + file ) , e ) ; apiTokenStats = new jenkins . security . apitoken . ApiTokenStats ( ) ; } } else { apiTokenStats = new jenkins . security . apitoken . ApiTokenStats ( ) ; } apiTokenStats . setParent ( parent ) ; return apiTokenStats ; } | org . junit . Assert . assertNotNull ( tokenStats ) |
applyTest ( ) { java . lang . String [ ] [ ] tests = new java . lang . String [ ] [ ] { new java . lang . String [ ] { "{{<sp>5<sp>|<sp>at_most:4<sp>}}" , "4" , "{}" } , new java . lang . String [ ] { "{{<sp>5<sp>|<sp>at_most:5<sp>}}" , "5" , "{}" } , new java . lang . String [ ] { "{{<sp>5<sp>|<sp>at_most:6<sp>}}" , "5" , "{}" } , new java . lang . String [ ] { "{{<sp>4.5<sp>|<sp>at_most:5<sp>}}" , "{{<sp>5<sp>|<sp>at_most:4<sp>}}" 2 , "{}" } , new java . lang . String [ ] { "{{<sp>width<sp>|<sp>at_most:5<sp>}}" , "5" , "{<sp>\"width\":<sp>6<sp>}" } , new java . lang . String [ ] { "{{<sp>width<sp>|<sp>at_most:5<sp>}}" , "4" , "{<sp>\"width\"{{<sp>5<sp>|<sp>at_most:4<sp>}}" 0 } , new java . lang . String [ ] { "{{<sp>5<sp>|<sp>at_most:4<sp>}}" 1 , "4" , "{<sp>\"width\"{{<sp>5<sp>|<sp>at_most:4<sp>}}" 0 } } ; for ( java . lang . String [ ] test : tests ) { liqp . Template template = liqp . Template . parse ( test [ 0 ] ) ; java . lang . String rendered = java . lang . String . valueOf ( template . render ( test [ 2 ] ) ) ; "<AssertPlaceHolder>" ; } } render ( java . util . Map ) { if ( this . protectionSettings . isRenderTimeLimited ( ) ) { return render ( variables , liqp . Executors . newSingleThreadExecutor ( ) , true ) ; } else { if ( ( this . templateSize ) > ( this . protectionSettings . maxTemplateSizeBytes ) ) { throw new java . lang . RuntimeException ( ( ( "template<sp>exceeds<sp>" + ( this . protectionSettings . maxTemplateSizeBytes ) ) + "<sp>bytes" ) ) ; } return renderUnguarded ( variables ) ; } } | org . junit . Assert . assertThat ( rendered , org . hamcrest . CoreMatchers . is ( test [ 1 ] ) ) |
testTesLinkReportGettersAndSetters ( ) { "<AssertPlaceHolder>" ; } getBuildId ( ) { return buildId ; } | org . junit . Assert . assertTrue ( ( ( this . report . getBuildId ( ) ) == 100 ) ) |
testComplement2 ( ) { org . antlr . v4 . runtime . misc . IntervalSet s = org . antlr . v4 . runtime . misc . IntervalSet . of ( 100 , 101 ) ; org . antlr . v4 . runtime . misc . IntervalSet s2 = org . antlr . v4 . runtime . misc . IntervalSet . of ( 100 , 102 ) ; java . lang . String expecting = "102" ; java . lang . String result = s . complement ( s2 ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( a ) + ".." ) + ( b ) ; } | org . junit . Assert . assertEquals ( expecting , result ) |
testAddEmailsMultiple2 ( ) { store . addEmail ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . IDSTRING , org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL1 ) ; store . addEmails ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . IDSTRING , new java . util . HashSet ( java . util . Arrays . asList ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL3 , org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL4 ) ) ) ; java . util . Set < java . lang . String > results = store . getEmails ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . IDSTRING ) ; "<AssertPlaceHolder>" ; } getEmails ( java . lang . String ) { return java . util . Collections . singleton ( emailAddress ) ; } | org . junit . Assert . assertThat ( results , org . hamcrest . Matchers . is ( new java . util . HashSet ( java . util . Arrays . asList ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL1 , org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL3 , org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL4 ) ) ) ) |
getterReturnsRegistrationIdIfFound ( ) { clearPersistentExpectations ( ) ; clearPersistentExpectations ( ) ; createPersistentPrimaryExpectations ( ) ; createPersistentPrimaryExpectations ( ) ; com . microsoft . azure . sdk . iot . provisioning . security . hsm . SecurityProviderTPMHsm securityProviderTPMEmulator = new com . microsoft . azure . sdk . iot . provisioning . security . hsm . SecurityProviderTPMHsm ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . security . hsm . SecurityProviderTPMHsmTest . VALID_REGISTRATION_IDS [ 0 ] ) ; java . lang . String testRegId = securityProviderTPMEmulator . getRegistrationId ( ) ; "<AssertPlaceHolder>" ; } getRegistrationId ( ) { return registrationId ; } | org . junit . Assert . assertEquals ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . security . hsm . SecurityProviderTPMHsmTest . VALID_REGISTRATION_IDS [ 0 ] , testRegId ) |
testServiceLocationFromInvoker ( ) { java . io . File wsdlFile = getProtobufRelatedInput ( "-genType" 0 ) ; intfProps . put ( "sipp_version" , "sipp_version" 4 ) ; fillProperties ( intfProps , intfProperty ) ; java . io . File binDir = new java . io . File ( destDir , "bin" ) ; java . lang . String [ ] testArgs = new java . lang . String [ ] { "sipp_version" 8 , "bin" 0 , "-mdest" , ( destDir ) + "-genType" 8 , "-genType" , "sipp_version" 3 , "-genType" 1 , wsdlFile . getAbsolutePath ( ) , "-gip" , "-genType" 2 , "-adminname" , "bin" 0 , "-genType" 7 , "-genType" 9 , "sipp_version" 9 , ( destDir ) + "/gen-src" , "sipp_version" 7 , "sipp_version" 6 , "-dest" , destDir . getAbsolutePath ( ) , "-genType" 3 , binDir . getAbsolutePath ( ) , "-genType" 7 , "INTERMEDIATE" , "sipp_version" 1 , "1.0.0" , "sipp_version" 5 , destDir . getAbsolutePath ( ) } ; performDirectCodeGen ( testArgs , binDir ) ; java . lang . reflect . Constructor < ? > constr = null ; java . lang . Class < ? > cls = loadClass ( "sipp_version" 0 ) ; java . lang . Thread . currentThread ( ) . setContextClassLoader ( originalLoader ) ; java . lang . reflect . Method [ ] mtds = cls . getDeclaredMethods ( ) ; for ( java . lang . reflect . Constructor < ? > c : cls . getDeclaredConstructors ( ) ) { if ( ( c . getParameterTypes ( ) . length ) == 1 ) { constr = c ; } } java . lang . Object constructorObj = null ; constructorObj = constr . newInstance ( new java . lang . String ( "-genType" 4 ) ) ; java . lang . Object obj = null ; for ( java . lang . reflect . Method m : mtds ) { if ( m . getName ( ) . equals ( "-genType" 6 ) ) { obj = m . invoke ( constructorObj ) ; } } java . lang . Class < ? > cl = obj . getClass ( ) ; java . lang . reflect . Method [ ] mtd = cl . getDeclaredMethods ( ) ; for ( java . lang . reflect . Method mt : mtd ) { if ( mt . getName ( ) . equals ( "-genType" 5 ) ) { obj = mt . invoke ( obj ) ; } } for ( java . lang . reflect . Method m : mtds ) { if ( m . getName ( ) . equals ( "sipp_version" 2 ) ) { java . net . URL serviceLocation = ( ( java . net . URL ) ( m . invoke ( obj ) ) ) ; "<AssertPlaceHolder>" ; } } } toString ( ) { return ( ( ( ( "MetricId:<sp>name=" + ( m_metricName ) ) + ",<sp>svc=" ) + ( m_adminName ) ) + ",<sp>op=" ) + ( ( m_operationName ) == null ? "_null_" : m_operationName ) ; } | org . junit . Assert . assertEquals ( "bin" 1 , serviceLocation . toString ( ) ) |
whenSaturatedAddTwoIntegerValues_shouldAddThemAndReturnIntMaxIfOverflow ( ) { int result = com . google . common . math . IntMath . saturatedAdd ( Integer . MAX_VALUE , 1000 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( Integer . MAX_VALUE , result ) |
graphiteReporter ( ) { when ( validatedGraphite . isEnabled ( ) ) . thenReturn ( true ) ; com . hotels . bdp . circustrain . api . metrics . ScheduledReporterFactory reporterFactory = new com . hotels . bdp . circustrain . metrics . conf . MetricsConf ( ) . runningScheduledReporterFactory ( new com . codahale . metrics . MetricRegistry ( ) , validatedGraphite ) ; "<AssertPlaceHolder>" ; } runningScheduledReporterFactory ( com . codahale . metrics . MetricRegistry , com . hotels . bdp . circustrain . metrics . conf . ValidatedGraphite ) { if ( validatedGraphite . isEnabled ( ) ) { return new com . hotels . bdp . circustrain . metrics . GraphiteScheduledReporterFactory ( runningMetricRegistry , validatedGraphite . getHost ( ) , validatedGraphite . getFormattedPrefix ( ) ) ; } return new com . hotels . bdp . circustrain . api . metrics . LoggingScheduledReporterFactory ( runningMetricRegistry ) ; } | org . junit . Assert . assertTrue ( ( reporterFactory instanceof com . hotels . bdp . circustrain . metrics . GraphiteScheduledReporterFactory ) ) |
testAddAll ( ) { int [ ] d1 = new int [ ] { 2 , 4 , 5 , 17 , - 1 , - 2 , 5 , - 123 } ; zemberek . core . collections . IntVector darray = new zemberek . core . collections . IntVector ( ) ; zemberek . core . collections . IntVector i = new zemberek . core . collections . IntVector ( d1 ) ; darray . addAll ( i ) ; "<AssertPlaceHolder>" ; } addAll ( java . lang . Iterable ) { for ( zemberek . morphology . lexicon . DictionaryItem item : items ) { add ( item ) ; } } | org . junit . Assert . assertEquals ( i , darray ) |
testIssue1211 ( ) { org . hipparchus . geometry . euclidean . threed . PolyhedronsSet polyset = org . hipparchus . geometry . partitioning . RegionParser . parsePolyhedronsSet ( loadTestData ( "issue-1211.bsp" ) ) ; org . hipparchus . random . RandomGenerator random = new org . hipparchus . random . Well1024a ( - 5081013540859288566L ) ; int nrays = 1000 ; for ( int i = 0 ; i < nrays ; i ++ ) { org . hipparchus . geometry . euclidean . threed . Vector3D origin = Vector3D . ZERO ; org . hipparchus . geometry . euclidean . threed . Vector3D direction = new org . hipparchus . geometry . euclidean . threed . Vector3D ( ( ( 2 * ( random . nextDouble ( ) ) ) - 1 ) , ( ( 2 * ( random . nextDouble ( ) ) ) - 1 ) , ( ( 2 * ( random . nextDouble ( ) ) ) - 1 ) ) . normalize ( ) ; org . hipparchus . geometry . euclidean . threed . Line line = new org . hipparchus . geometry . euclidean . threed . Line ( origin , origin . add ( direction ) , polyset . getTolerance ( ) ) ; org . hipparchus . geometry . partitioning . SubHyperplane < org . hipparchus . geometry . euclidean . threed . Euclidean3D > plane = polyset . firstIntersection ( origin , line ) ; if ( plane != null ) { org . hipparchus . geometry . euclidean . threed . Vector3D intersectionPoint = ( ( org . hipparchus . geometry . euclidean . threed . Plane ) ( plane . getHyperplane ( ) ) ) . intersection ( line ) ; double dotProduct = direction . dotProduct ( intersectionPoint . subtract ( origin ) ) ; "<AssertPlaceHolder>" ; } } } subtract ( org . hipparchus . geometry . Vector ) { org . hipparchus . geometry . euclidean . twod . Vector2D p3 = ( ( org . hipparchus . geometry . euclidean . twod . Vector2D ) ( p ) ) ; return new org . hipparchus . geometry . euclidean . twod . Vector2D ( ( ( x ) - ( p3 . x ) ) , ( ( y ) - ( p3 . y ) ) ) ; } | org . junit . Assert . assertTrue ( ( dotProduct > 0 ) ) |
testUnmarshallingNullDate ( ) { java . lang . String stringifiedTestObject = "<test><date></date></test>" ; com . fiveamsolutions . plc . util . JAXBDateTimeAdapterTest . ATestClass testObject = unmarshall ( stringifiedTestObject ) ; "<AssertPlaceHolder>" ; } getDate ( ) { return date ; } | org . junit . Assert . assertNull ( testObject . getDate ( ) ) |
testGetBody ( ) { "<AssertPlaceHolder>" ; } getBody ( ) { return body ; } | org . junit . Assert . assertEquals ( body , view . getBody ( ) ) |
testResolveTemplatesEmptyMap ( ) { javax . ws . rs . client . WebTarget created = org . jboss . resteasy . test . client . WebTargetUnitTest . base . path ( "{id}/{question}/{question}" ) ; java . util . Map < java . lang . String , java . lang . Object > values = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; javax . ws . rs . client . WebTarget result = created . resolveTemplates ( values ) ; "<AssertPlaceHolder>" ; } resolveTemplates ( java . util . Map ) { if ( templateValues == null ) throw new java . lang . IllegalArgumentException ( Messages . MESSAGES . templateValuesParamNull ( ) ) ; if ( templateValues . containsKey ( null ) ) throw new java . lang . IllegalArgumentException ( Messages . MESSAGES . mapKeyNull ( ) ) ; return uriTemplate ( buildCharSequence ( templateValues , false , true , true ) ) ; } | org . junit . Assert . assertEquals ( result , created ) |
testSimpleAppend ( ) { org . apache . flume . sink . hdfs . TestHDFSEventSink . LOG . debug ( "Starting..." ) ; final long txnMax = 25 ; final java . lang . String fileName = "FlumeData" ; final long rollCount = 5 ; final long batchSize = 2 ; final int numBatches = 4 ; java . lang . String newPath = ( testPath ) + "num<sp>files" 3 ; int totalEvents = 0 ; int i = 1 ; int j = 1 ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( conf ) ; org . apache . hadoop . fs . Path dirPath = new org . apache . hadoop . fs . Path ( newPath ) ; fs . delete ( dirPath , true ) ; fs . mkdirs ( dirPath ) ; org . apache . flume . Context context = new org . apache . flume . Context ( ) ; context . put ( "hdfs.path" , newPath ) ; context . put ( "num<sp>files" 1 , fileName ) ; context . put ( "hdfs.txnEventMax" , java . lang . String . valueOf ( txnMax ) ) ; context . put ( "num<sp>files" 2 , java . lang . String . valueOf ( rollCount ) ) ; context . put ( "hdfs.batchSize" , java . lang . String . valueOf ( batchSize ) ) ; org . apache . flume . conf . Configurables . configure ( sink , context ) ; org . apache . flume . Channel channel = new org . apache . flume . channel . MemoryChannel ( ) ; org . apache . flume . conf . Configurables . configure ( channel , context ) ; sink . setChannel ( channel ) ; sink . start ( ) ; java . util . Calendar eventDate = java . util . Calendar . getInstance ( ) ; java . util . List < java . lang . String > bodies = com . google . common . collect . Lists . newArrayList ( ) ; for ( i = 1 ; i < numBatches ; i ++ ) { org . apache . flume . Transaction txn = channel . getTransaction ( ) ; txn . begin ( ) ; for ( j = 1 ; j <= txnMax ; j ++ ) { org . apache . flume . Event event = new org . apache . flume . event . SimpleEvent ( ) ; eventDate . clear ( ) ; eventDate . set ( 2011 , i , i , i , 0 ) ; event . getHeaders ( ) . put ( "timestamp" , java . lang . String . valueOf ( eventDate . getTimeInMillis ( ) ) ) ; event . getHeaders ( ) . put ( "hostname" , ( "Host" + i ) ) ; java . lang . String body = ( ( "Test." + i ) + "num<sp>files" 0 ) + j ; event . setBody ( body . getBytes ( ) ) ; bodies . add ( body ) ; channel . put ( event ) ; totalEvents ++ ; } txn . commit ( ) ; txn . close ( ) ; sink . process ( ) ; } sink . stop ( ) ; org . apache . hadoop . fs . FileStatus [ ] dirStat = fs . listStatus ( dirPath ) ; org . apache . hadoop . fs . Path [ ] fList = org . apache . hadoop . fs . FileUtil . stat2Paths ( dirStat ) ; "<AssertPlaceHolder>" ; verifyOutputSequenceFiles ( fs , conf , dirPath . toUri ( ) . getPath ( ) , fileName , bodies ) ; } stop ( ) { try { table . close ( ) ; table = null ; } catch ( java . io . IOException e ) { throw new org . apache . flume . FlumeException ( "Error<sp>closing<sp>table." , e ) ; } } | org . junit . Assert . assertEquals ( "num<sp>files" , ( totalEvents / rollCount ) , fList . length ) |
testUnassignedWithNoDefaultPool ( ) { init ( ) ; java . util . Map < org . apache . accumulo . core . dataImpl . KeyExtent , org . apache . accumulo . server . master . state . TServerInstance > assignments = new java . util . HashMap ( ) ; java . util . Map < org . apache . accumulo . core . dataImpl . KeyExtent , org . apache . accumulo . server . master . state . TServerInstance > unassigned = new java . util . HashMap ( ) ; for ( org . apache . accumulo . core . dataImpl . KeyExtent ke : tableExtents . get ( org . apache . accumulo . server . master . balancer . BAR . getTableName ( ) ) ) { unassigned . put ( ke , null ) ; } java . util . SortedMap < org . apache . accumulo . server . master . state . TServerInstance , org . apache . accumulo . core . master . thrift . TabletServerStatus > current = createCurrent ( 15 ) ; java . util . List < org . apache . accumulo . server . master . state . TServerInstance > removals = new java . util . ArrayList ( ) ; for ( java . util . Map . Entry < org . apache . accumulo . server . master . state . TServerInstance , org . apache . accumulo . core . master . thrift . TabletServerStatus > e : current . entrySet ( ) ) { if ( ( ( ( ( ( ( ( ( ( e . getKey ( ) . host ( ) . equals ( "192.168.0.15" 0 ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.7" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.8" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.9" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.10" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.11" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.12" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.13" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.14" ) ) ) || ( e . getKey ( ) . host ( ) . equals ( "192.168.0.15" ) ) ) { removals . add ( e . getKey ( ) ) ; } } for ( org . apache . accumulo . server . master . state . TServerInstance r : removals ) { current . remove ( r ) ; } this . getAssignments ( java . util . Collections . unmodifiableSortedMap ( current ) , java . util . Collections . unmodifiableMap ( unassigned ) , assignments ) ; "<AssertPlaceHolder>" ; for ( java . util . Map . Entry < org . apache . accumulo . core . dataImpl . KeyExtent , org . apache . accumulo . server . master . state . TServerInstance > e : assignments . entrySet ( ) ) { if ( tabletInBounds ( e . getKey ( ) , e . getValue ( ) ) ) { org . junit . Assert . fail ( ( ( ( "192.168.0.15" 1 + ( e . getKey ( ) ) ) + "<sp>-><sp>" ) + ( e . getValue ( ) . host ( ) ) ) ) ; } } } size ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertEquals ( unassigned . size ( ) , assignments . size ( ) ) |
testSetOptionalExpressionFunctionsItem ( ) { org . apache . apex . malhar . lib . filter . FilterTest . filter . setOptionalExpressionFunctionsItem ( 10 , "org.apache.commons.lang3.BooleanUtils.*" ) ; prepareFilterOperator ( org . apache . apex . malhar . lib . filter . FilterTest . DummyPublicPOJO . class , "({$}.val<sp>==<sp>1)" ) ; "<AssertPlaceHolder>" ; } getExpressionFunctions ( ) { return expressionFunctions ; } | org . junit . Assert . assertEquals ( 6 , org . apache . apex . malhar . lib . filter . FilterTest . filter . getExpressionFunctions ( ) . size ( ) ) |
testSetLocalPhoneAutocomplete ( ) { com . github . bordertech . wcomponents . WTextField field = new com . github . bordertech . wcomponents . WTextField ( ) ; java . lang . String expected = Telephone . LOCAL . getValue ( ) ; field . setLocalPhoneAutocomplete ( ) ; "<AssertPlaceHolder>" ; } getAutocomplete ( ) { return getComponentModel ( ) . autocomplete ; } | org . junit . Assert . assertEquals ( expected , field . getAutocomplete ( ) ) |
testGetReferencedColumnNameFunctionQuotesSingle ( ) { org . sagebionetworks . table . query . model . DerivedColumn element = org . sagebionetworks . table . query . util . SqlElementUntils . createDerivedColumn ( "max('bar')" ) ; "<AssertPlaceHolder>" ; } getReferencedColumnName ( ) { org . sagebionetworks . table . query . model . ColumnNameReference hasQuotedValue = getReferencedColumn ( ) ; if ( hasQuotedValue != null ) { return hasQuotedValue . toSqlWithoutQuotes ( ) ; } return null ; } | org . junit . Assert . assertEquals ( "bar" , element . getReferencedColumnName ( ) ) |
ignoreSystemFolder ( ) { org . jboss . as . cli . completion . modules . test . ModuleNameTabCompleterTestCase . createModules ( "org" , "com" ) ; new java . io . File ( ( ( org . jboss . as . cli . completion . modules . test . ModuleNameTabCompleterTestCase . MODULES_DIR ) + "/system/bar" ) ) . mkdirs ( ) ; "<AssertPlaceHolder>" ; } complete ( java . lang . String ) { cmdCompleter . complete ( ctx , buffer , buffer . length ( ) , candidates ) ; return candidates . get ( 0 ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "com" , "org" ) , complete ( null ) ) |
helper ( ) { java . lang . Exception e = new java . lang . Exception ( ) ; com . alibaba . citrus . webx . util . ErrorHandlerHelper . getInstance ( newRequest ) . init ( "app1" , e , null ) ; pipeline . newInvocation ( ) . invoke ( ) ; com . alibaba . citrus . webx . util . ErrorHandlerHelper helper = ( ( com . alibaba . citrus . webx . util . ErrorHandlerHelper ) ( rundata . getContext ( ) . get ( "error" ) ) ) ; "<AssertPlaceHolder>" ; } getException ( ) { java . lang . IllegalStateException e1 = new java . lang . IllegalStateException ( ) ; java . lang . IllegalArgumentException e2 = new java . lang . IllegalArgumentException ( ) ; java . io . IOException e3 = new java . io . IOException ( ) ; e1 . initCause ( e3 ) ; e2 . initCause ( e1 ) ; e3 . initCause ( e2 ) ; return e3 ; } | org . junit . Assert . assertEquals ( e , helper . getException ( ) ) |
treeParentDoesNotContainChild ( ) { final org . zkoss . ganttz . util . MutableTreeModel < org . zkoss . ganttz . util . MutableTreeModelTest . Prueba > model = org . zkoss . ganttz . util . MutableTreeModel . create ( org . zkoss . ganttz . util . MutableTreeModelTest . Prueba . class ) ; org . zkoss . ganttz . util . MutableTreeModelTest . Prueba parent = new org . zkoss . ganttz . util . MutableTreeModelTest . Prueba ( ) ; model . addToRoot ( parent ) ; org . zkoss . ganttz . util . MutableTreeModelTest . Prueba child = new org . zkoss . ganttz . util . MutableTreeModelTest . Prueba ( ) ; "<AssertPlaceHolder>" ; } contains ( java . util . Collection , org . libreplan . business . common . BaseEntity ) { for ( org . libreplan . business . common . BaseEntity each : collection ) { if ( each . getId ( ) . equals ( entity . getId ( ) ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( model . contains ( parent , child ) ) |
testIntValuePositive1 ( ) { byte [ ] aBytes = new byte [ ] { 12 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 3 } ; int resInt = 1496144643 ; int aNumber = new java . math . BigInteger ( aBytes ) . intValue ( ) ; "<AssertPlaceHolder>" ; } intValue ( ) { return ( ( int ) ( value ) ) ; } | org . junit . Assert . assertTrue ( ( aNumber == resInt ) ) |
testSparqlXPath ( ) { java . net . URL url = com . google . common . io . Resources . getResource ( "sparql-ext-test-xml-01.sparql" ) ; java . lang . String text = com . google . common . io . Resources . toString ( url , StandardCharsets . UTF_8 ) ; org . apache . jena . query . Query query = org . apache . jena . query . QueryFactory . create ( text ) ; org . apache . jena . sparql . algebra . Op op = org . apache . jena . sparql . algebra . Algebra . compile ( query ) ; java . util . List < java . lang . String > actual = new java . util . ArrayList ( ) ; try ( org . apache . jena . rdfconnection . RDFConnection conn = org . apache . jena . rdfconnection . RDFConnectionFactory . connect ( org . apache . jena . query . DatasetFactory . create ( ) ) ) { conn . querySelect ( query , ( b ) -> actual . add ( b . get ( "str" ) . toString ( ) ) ) ; } "<AssertPlaceHolder>" ; } toString ( org . aksw . jena_sparql_api . utils . Model , org . aksw . jena_sparql_api . utils . RDFWriter ) { org . aksw . jena_sparql_api . utils . ByteArrayOutputStream baos = new org . aksw . jena_sparql_api . utils . ByteArrayOutputStream ( ) ; writer . write ( model , baos , "" ) ; return baos . toString ( ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "1" , "2" ) , actual ) |
notAllowedPayloadPosition ( ) { wsattacker . library . intelligentdos . helper . IterateModel iterateModel = wsattacker . library . intelligentdos . helper . IterateModel . custom ( ) . startAt ( 2 ) . stopAt ( 2 ) . build ( ) ; xmlElementCount . setNumberOfElementsIterator ( iterateModel ) ; "<AssertPlaceHolder>" ; xmlElementCount . nextParam ( ) ; xmlElementCount . getTamperedRequest ( "" , PayloadPosition . ATTRIBUTE ) ; } hasFurtherParams ( ) { return externalEntitiesIterator . hasNext ( ) ; } | org . junit . Assert . assertThat ( xmlElementCount . hasFurtherParams ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testAnalyze_badZip ( ) { org . owasp . dependencycheck . analyzer . ArchiveAnalyzer instance = new org . owasp . dependencycheck . analyzer . ArchiveAnalyzer ( ) ; instance . initialize ( getSettings ( ) ) ; try ( org . owasp . dependencycheck . Engine engine = new org . owasp . dependencycheck . Engine ( getSettings ( ) ) ) { instance . prepare ( null ) ; java . io . File file = org . owasp . dependencycheck . BaseTest . getResourceAsFile ( this , "test.zip" ) ; org . owasp . dependencycheck . dependency . Dependency dependency = new org . owasp . dependencycheck . dependency . Dependency ( file ) ; getSettings ( ) . setBoolean ( Settings . KEYS . AUTO_UPDATE , false ) ; getSettings ( ) . setBoolean ( Settings . KEYS . ANALYZER_NEXUS_ENABLED , false ) ; getSettings ( ) . setBoolean ( Settings . KEYS . ANALYZER_CENTRAL_ENABLED , false ) ; int initial_size = engine . getDependencies ( ) . length ; instance . analyze ( dependency , engine ) ; int ending_size = engine . getDependencies ( ) . length ; "<AssertPlaceHolder>" ; } finally { instance . close ( ) ; } } getDependencies ( ) { return composerDependencies ; } | org . junit . Assert . assertEquals ( initial_size , ending_size ) |
testMatchedCommunities ( ) { org . batfish . datamodel . routing_policy . expr . CommunityHalvesExpr expr = new org . batfish . datamodel . routing_policy . expr . CommunityHalvesExpr ( new org . batfish . datamodel . routing_policy . expr . LiteralCommunityHalf ( 1 ) , new org . batfish . datamodel . routing_policy . expr . LiteralCommunityHalf ( 1 ) ) ; java . util . Set < java . lang . Long > communityCandidates = com . google . common . collect . ImmutableSet . of ( communityStringToLong ( "1:1" ) , 2L ) ; "<AssertPlaceHolder>" ; } matchedCommunities ( org . batfish . datamodel . routing_policy . Environment , java . util . Set , java . util . Set ) { return new org . batfish . datamodel . matchers . CommunitySetExprMatchers . MatchedCommunities ( environment , communityCandidates , org . hamcrest . Matchers . equalTo ( expectedMatchedCommunities ) ) ; } | org . junit . Assert . assertThat ( expr , matchedCommunities ( null , communityCandidates , com . google . common . collect . ImmutableSet . of ( communityStringToLong ( "1:1" ) ) ) ) |
testSerialization ( ) { org . jfree . data . xy . XYSeries s1 = new org . jfree . data . xy . XYSeries ( "Series" ) ; s1 . add ( 1.0 , 1.1 ) ; org . jfree . data . xy . XYSeriesCollection c1 = new org . jfree . data . xy . XYSeriesCollection ( ) ; c1 . addSeries ( s1 ) ; org . jfree . data . xy . XYSeriesCollection c2 = ( ( org . jfree . data . xy . XYSeriesCollection ) ( org . jfree . chart . TestUtilities . serialised ( c1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( c1 , c2 ) |
test_ALGRSA_OAEP_WITH_ENC_A192CBC_HS384 ( ) { org . picketlink . json . jose . JWE jwe = new org . picketlink . json . jose . JWEBuilder ( ) . algorithm ( JWE . ALG_RSA_OAEP ) . encryptionAlgorithm ( JWE . ENC_A192CBC_HS384 , 384 ) . compressionAlgorithm ( "DEF" ) . build ( ) ; useJCEUnlimitedStrengthPolicyFiles ( ) ; java . lang . String payLoad = "{\"alg\":<sp>\"ALG_RSA_OAEP\",\"enc\":<sp>\"ENC_A192CBC_HS384\",\"zip\":<sp>\"DEF\"}" ; org . picketlink . json . jose . crypto . JWEEncrypter encrypter = new org . picketlink . json . jose . crypto . JWEEncrypter ( ( ( java . security . interfaces . RSAPublicKey ) ( keyPair1 . getPublic ( ) ) ) ) ; java . lang . String encryptedPayload = encrypter . encrypt ( jwe , payLoad . getBytes ( ) ) ; java . lang . String [ ] cryptoPart = org . picketlink . json . util . JOSEUtil . split ( encryptedPayload ) ; org . picketlink . json . jose . crypto . JWEDecrypter decrypter = new org . picketlink . json . jose . crypto . JWEDecrypter ( ( ( java . security . interfaces . RSAPrivateKey ) ( keyPair1 . getPrivate ( ) ) ) ) ; byte [ ] decryptedByteArray = decrypter . decrypt ( jwe , cryptoPart [ 1 ] , cryptoPart [ 2 ] , cryptoPart [ 3 ] , cryptoPart [ 4 ] ) ; java . lang . String decryptedPayload = new java . lang . String ( decryptedByteArray ) ; "<AssertPlaceHolder>" ; } decrypt ( org . picketlink . json . jose . JWE , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { if ( encryptedKey == null ) { throw new java . lang . RuntimeException ( "The<sp>encrypted<sp>key<sp>must<sp>not<sp>be<sp>null" ) ; } if ( iv == null ) { throw new java . lang . RuntimeException ( "The<sp>initialization<sp>vector<sp>(IV)<sp>must<sp>not<sp>be<sp>null" ) ; } if ( authTag == null ) { throw new java . lang . RuntimeException ( "The<sp>authentication<sp>tag<sp>must<sp>not<sp>be<sp>null" ) ; } java . lang . String alg = jweHeader . getAlgorithm ( ) ; javax . crypto . SecretKey cek ; if ( alg . equals ( org . picketlink . json . JsonConstants . JWE . ALG_RSA1_5 ) ) { int keyLength = java . lang . Integer . parseInt ( jweHeader . getCEKBitLength ( ) ) ; java . security . SecureRandom randomGen = new java . security . SecureRandom ( ) ; javax . crypto . SecretKey randomCEK = org . picketlink . json . jose . crypto . AES . generateKey ( keyLength , randomGen ) ; try { cek = org . picketlink . json . jose . crypto . RSA1_5 . decryptCEK ( privateKey , org . picketlink . json . util . Base64Util . b64Decode ( encryptedKey ) , keyLength ) ; if ( cek == null ) { cek = randomCEK ; } } catch ( java . lang . Exception e ) { cek = randomCEK ; } } else if ( alg . equals ( org . picketlink . json . JsonConstants . JWE . ALG_RSA_OAEP ) ) { cek = org . picketlink . json . jose . crypto . RSA_OAEP . decryptCEK ( privateKey , org . picketlink . json . util . Base64Util . b64Decode ( encryptedKey ) ) ; } else if ( alg . equals ( org . picketlink . json . JsonConstants . JWE . ALG_RSA_OAEP_256 ) ) { cek = org . picketlink . json . jose . crypto . RSA_OAEP_256 . decryptCEK ( privateKey , org . picketlink . json . util . Base64Util . b64Decode ( encryptedKey ) ) ; } else { throw new java . lang . RuntimeException ( "Unsupported<sp>JWE<sp>algorithm,<sp>must<sp>be<sp>RSA1_5<sp>or<sp>RSA_OAEP" ) ; } byte [ ] aad = org . picketlink . json . util . Base64Util . b64Encode ( jweHeader . toString ( ) ) . getBytes ( java . nio . charset . Charset . forName ( "UTF-8" ) ) ; java . lang . String enc = jweHeader . getEncryptionAlgorithm ( ) ; byte [ ] plainText ; if ( ( ( enc . equals ( org . picketlink . json . JsonConstants . JWE . ENC_A128CBC_HS256 ) ) || ( enc . equals ( org . picketlink . json . JsonConstants . JWE . ENC_A192CBC_HS384 ) ) ) || ( enc . equals ( org . picketlink . json . JsonConstants . JWE . ENC_A256CBC_HS512 ) ) ) { plainText = org . picketlink . json . jose . crypto . AESCBC . decryptAuthenticated ( cek , org . picketlink . json . util . Base64Util . b64Decode ( iv ) , org . picketlink . json . util . Base64Util . b64Decode ( cipherText ) , aad , org . picketlink . json . util . Base64Util . b64Decode ( authTag ) ) ; } else if ( ( ( enc . equals ( org . picketlink . json . JsonConstants . JWE . ENC_A128GCM ) ) || ( enc . equals ( org . picketlink . json . JsonConstants . JWE . ENC_A192GCM ) ) ) || ( enc . equals ( org . picketlink . json . JsonConstants . JWE . ENC_A256GCM ) ) ) { plainText = org . picketlink . json . jose . crypto . AESGCM . decrypt ( cek , org . picketlink . json . util . Base64Util . b64Decode ( iv ) , org . picketlink . json . util . Base64Util . b64Decode ( cipherText ) , aad , org . picketlink . json . util . Base64Util . b64Decode ( authTag ) ) ; } else { throw new java . lang . RuntimeException ( "Unsupported<sp>encryption<sp>method,<sp>must<sp>be<sp>A128CBC_HS256,<sp>A192CBC_HS384,<sp>A256CBC_HS512,<sp>A128GCM,<sp>A192GCM<sp>or<sp>A256GCM" ) ; } try { return org . picketlink . json . jose . crypto . DeflateUtils . decompress ( plainText ) ; } catch ( java . io . IOException | org . junit . Assert . assertEquals ( payLoad , decryptedPayload ) |
test4 ( ) { introclassJava . median_3b2376ab_003 mainClass = new introclassJava . median_3b2376ab_003 ( ) ; java . lang . String expected = "Please<sp>enter<sp>3<sp>numbers<sp>separated<sp>by<sp>spaces<sp>><sp>6<sp>is<sp>the<sp>median" ; mainClass . scanner = new java . util . Scanner ( "6<sp>8<sp>2" ) ; mainClass . exec ( ) ; java . lang . String out = mainClass . output . replace ( "\n" , "<sp>" ) . trim ( ) ; "<AssertPlaceHolder>" ; } replace ( int , java . lang . Object ) { org . mozilla . javascript . xmlimpl . XMLList xlChildToReplace = child ( index ) ; if ( ( xlChildToReplace . length ( ) ) > 0 ) { org . mozilla . javascript . xmlimpl . XML childToReplace = xlChildToReplace . item ( 0 ) ; insertChildAfter ( childToReplace , xml ) ; removeChild ( index ) ; } return this ; } | org . junit . Assert . assertEquals ( expected . replace ( "<sp>" , "" ) , out . replace ( "<sp>" , "" ) ) |
redirect_proxy_should_be_created_by_specifing_source_class_and_calling_destination_class ( ) { java . util . ArrayList list = com . lordofthejars . nosqlunit . proxy . RedirectProxy . createProxy ( java . util . ArrayList . class , new com . lordofthejars . nosqlunit . core . WhenARedirectProxyIsRequired . MyNewList ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( this . list . size ( ) ) + 2 ; } | org . junit . Assert . assertThat ( list . size ( ) , org . hamcrest . CoreMatchers . is ( 2 ) ) |
testMonitor ( ) { org . apache . hadoop . ha . TestHealthMonitor . LOG . info ( "Mocking<sp>bad<sp>health<sp>check,<sp>waiting<sp>for<sp>UNHEALTHY" ) ; svc . isHealthy = false ; waitForState ( hm , HealthMonitor . State . SERVICE_UNHEALTHY ) ; org . apache . hadoop . ha . TestHealthMonitor . LOG . info ( "Returning<sp>to<sp>healthy<sp>state,<sp>waiting<sp>for<sp>HEALTHY" ) ; svc . isHealthy = true ; waitForState ( hm , HealthMonitor . State . SERVICE_HEALTHY ) ; org . apache . hadoop . ha . TestHealthMonitor . LOG . info ( "Returning<sp>an<sp>IOException,<sp>as<sp>if<sp>node<sp>went<sp>down" ) ; int countBefore = createProxyCount . get ( ) ; svc . actUnreachable = true ; waitForState ( hm , HealthMonitor . State . SERVICE_NOT_RESPONDING ) ; while ( ( createProxyCount . get ( ) ) < ( countBefore + 3 ) ) { java . lang . Thread . sleep ( 10 ) ; } org . apache . hadoop . ha . TestHealthMonitor . LOG . info ( "Returning<sp>to<sp>healthy<sp>state,<sp>waiting<sp>for<sp>HEALTHY" ) ; svc . actUnreachable = false ; waitForState ( hm , HealthMonitor . State . SERVICE_HEALTHY ) ; hm . shutdown ( ) ; hm . join ( ) ; "<AssertPlaceHolder>" ; } isAlive ( ) { for ( org . apache . hadoop . hdfs . server . datanode . BPServiceActor actor : bpServices ) { if ( actor . isAlive ( ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( hm . isAlive ( ) ) |
testRequestWithValidFinishTimeEndQuery ( ) { org . apache . hadoop . yarn . api . protocolrecords . GetApplicationsRequest request = org . apache . hadoop . yarn . server . resourcemanager . webapp . ApplicationsRequestBuilder . create ( ) . withFinishTimeEnd ( "999" ) . build ( ) ; org . apache . hadoop . yarn . api . protocolrecords . GetApplicationsRequest expectedRequest = getDefaultRequest ( ) ; expectedRequest . setFinishRange ( 0L , 999L ) ; "<AssertPlaceHolder>" ; } setFinishRange ( long , long ) { if ( begin > end ) { throw new java . lang . IllegalArgumentException ( ( ( ( ( ( "begin<sp>><sp>end<sp>in<sp>range<sp>(begin,<sp>" + "end):<sp>(" ) + begin ) + ",<sp>" ) + end ) + ")" ) ) ; } this . finish = org . apache . commons . lang3 . Range . between ( begin , end ) ; } | org . junit . Assert . assertEquals ( expectedRequest , request ) |
testHasInstanceId5 ( ) { com . liferay . portal . kernel . model . PortletInstance portletInstance = com . liferay . portal . kernel . model . PortletInstance . fromPortletInstanceKey ( getPortletInstanceKey ( ) ) ; "<AssertPlaceHolder>" ; } hasInstanceId ( ) { return com . liferay . portal . kernel . util . Validator . isNotNull ( _instanceId ) ; } | org . junit . Assert . assertFalse ( portletInstance . hasInstanceId ( ) ) |
testToNoQueryUri_EmptyPath ( ) { final java . lang . String suri = "http://localhost/jenkins" ; final java . net . URI uri = com . offbytwo . jenkins . client . util . UrlUtils . toNoApiUri ( new java . net . URI ( suri ) , "jenkins" , "" ) ; final java . lang . String expected = "http://localhost/jenkins" ; "<AssertPlaceHolder>" ; } toString ( ) { return literalVersion ; } | org . junit . Assert . assertEquals ( expected , uri . toString ( ) ) |
canReadJMX ( ) { java . io . File jmx = new java . io . File ( "src/test/resources/simple_prometheus_example.jmx" ) ; org . apache . jorphan . collections . HashTree tree = org . apache . jmeter . save . SaveService . loadTree ( jmx ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( ( tree != null ) ) |
testDifferentDimensionsFailure ( ) { org . locationtech . jts . geom . Geometry g1 = gb . box ( 10 , 10 , 20 , 20 ) ; org . locationtech . jts . geom . Geometry g2 = gb . boxZ ( 10 , 10 , 20 , 20 , 99 ) ; "<AssertPlaceHolder>" ; } hasSameValuesAndStructure ( org . locationtech . jts . geom . Geometry , org . locationtech . jts . geom . Geometry ) { if ( ! ( g1 . equalsExact ( g2 , org . geotools . geometry . jts . GeometryCoordinateSequenceTransformerTest . ORD_TOLERANCE ) ) ) return false ; if ( ( g1 . getFactory ( ) ) != ( g2 . getFactory ( ) ) ) return false ; org . locationtech . jts . geom . CoordinateSequence seq = org . geotools . geometry . jts . GeometryCoordinateSequenceTransformerTest . CoordinateSequenceFinder . find ( g1 ) ; if ( ! ( org . geotools . geometry . jts . GeometryCoordinateSequenceTransformerTest . CoordinateSequenceSchemaChecker . check ( g2 , seq . getClass ( ) , seq . getDimension ( ) ) ) ) return false ; return true ; } | org . junit . Assert . assertFalse ( hasSameValuesAndStructure ( g1 , g2 ) ) |
delegatesGetCurrentLease ( ) { when ( delegate . getCurrentLease ( ) ) . thenReturn ( lease ) ; org . terracotta . lease . CleaningLeaseMaintainer cleaner = new org . terracotta . lease . CleaningLeaseMaintainer ( delegate , connection , thread1 , thread2 ) ; "<AssertPlaceHolder>" ; verify ( delegate ) . getCurrentLease ( ) ; } getCurrentLease ( ) { return currentLease . get ( ) ; } | org . junit . Assert . assertEquals ( lease , cleaner . getCurrentLease ( ) ) |
testAddCompleTypeView ( ) { org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest . localView = new org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest ( ) ; org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest . objComplexType = new org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexType ( org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest . localView ) ; try { org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest . objComplexType . getBuilder ( ) . build ( ) ; } catch ( org . apache . olingo . odata2 . jpa . processor . api . exception . ODataJPAModelException e ) { org . junit . Assert . fail ( ( ( ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_1 ) + ( e . getMessage ( ) ) ) + ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_2 ) ) ) ; } catch ( org . apache . olingo . odata2 . jpa . processor . api . exception . ODataJPARuntimeException e ) { org . junit . Assert . fail ( ( ( ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_1 ) + ( e . getMessage ( ) ) ) + ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_2 ) ) ) ; } org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest . objComplexType . addJPAEdmCompleTypeView ( org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest . localView ) ; "<AssertPlaceHolder>" ; } getConsistentEdmComplexTypes ( ) { return consistentComplextTypes ; } | org . junit . Assert . assertTrue ( ( ( org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmComplexTypeTest . objComplexType . getConsistentEdmComplexTypes ( ) . size ( ) ) > 1 ) ) |
testUnlink ( ) { final com . allanbank . mongodb . bson . builder . DocumentBuilder fileResult = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; fileResult . addString ( "_id" , "id" ) ; final com . allanbank . mongodb . bson . builder . DocumentBuilder chunkResult = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; chunkResult . addBinary ( "data" , new byte [ ] { 1 , 2 , 3 , 4 } ) ; final com . allanbank . mongodb . MongoDatabase mockDb = createMock ( com . allanbank . mongodb . MongoDatabase . class ) ; final com . allanbank . mongodb . MongoCollection mockFiles = createMock ( com . allanbank . mongodb . MongoCollection . class ) ; final com . allanbank . mongodb . MongoCollection mockChunks = createMock ( com . allanbank . mongodb . MongoCollection . class ) ; final com . allanbank . mongodb . client . FutureCallback < java . lang . Long > futureChunks = new com . allanbank . mongodb . client . FutureCallback < java . lang . Long > ( ) ; final com . allanbank . mongodb . client . FutureCallback < java . lang . Long > futureFiles = new com . allanbank . mongodb . client . FutureCallback < java . lang . Long > ( ) ; expect ( mockDb . getCollection ( ( "fs" + ( GridFs . FILES_SUFFIX ) ) ) ) . andReturn ( mockFiles ) ; expect ( mockDb . getCollection ( ( "fs" + ( GridFs . CHUNKS_SUFFIX ) ) ) ) . andReturn ( mockChunks ) ; expect ( mockFiles . findOne ( anyObject ( com . allanbank . mongodb . bson . DocumentAssignable . class ) ) ) . andReturn ( fileResult . build ( ) ) ; expect ( mockChunks . deleteAsync ( anyObject ( com . allanbank . mongodb . bson . DocumentAssignable . class ) ) ) . andReturn ( futureChunks ) ; futureChunks . callback ( java . lang . Long . valueOf ( 1234 ) ) ; expect ( mockFiles . deleteAsync ( anyObject ( com . allanbank . mongodb . bson . DocumentAssignable . class ) ) ) . andReturn ( futureFiles ) ; futureFiles . callback ( java . lang . Long . valueOf ( 1 ) ) ; replay ( mockDb , mockFiles , mockChunks ) ; final com . allanbank . mongodb . gridfs . GridFs fs = new com . allanbank . mongodb . gridfs . GridFs ( mockDb ) ; "<AssertPlaceHolder>" ; verify ( mockDb , mockFiles , mockChunks ) ; } unlink ( com . allanbank . mongodb . bson . element . ObjectId ) { final com . allanbank . mongodb . bson . Document fileDoc = myFilesCollection . findOne ( where ( com . allanbank . mongodb . gridfs . GridFs . ID_FIELD ) . equals ( id ) ) ; if ( fileDoc == null ) { return false ; } return doUnlink ( fileDoc ) ; } | org . junit . Assert . assertTrue ( fs . unlink ( "foo" ) ) |
testDeleteConnectionByName ( ) { "<AssertPlaceHolder>" ; for ( java . util . Iterator < org . pentaho . database . model . IDatabaseConnection > iterator = org . pentaho . platform . dataaccess . datasource . wizard . service . impl . ConnectionServiceImplIT . connectionServiceImpl . getConnections ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { if ( iterator . next ( ) . getName ( ) . equals ( org . pentaho . platform . dataaccess . datasource . wizard . service . impl . ConnectionServiceImplIT . EXIST_CONNECTION_NAME ) ) { org . junit . Assert . fail ( "connection<sp>should<sp>be<sp>deleted" ) ; } } } deleteConnection ( java . lang . String ) { for ( org . pentaho . database . model . IDatabaseConnection connection : connectionList ) { if ( connection . getName ( ) . equals ( name ) ) { return deleteConnection ( connection ) ; } } org . pentaho . platform . dataaccess . datasource . wizard . service . impl . InMemoryConnectionServiceImpl . logger . error ( org . pentaho . platform . dataaccess . datasource . wizard . service . messages . Messages . getErrorString ( "ConnectionServiceInMemoryDelegate.ERROR_0006_UNABLE_TO_DELETE_CONNECTION" , name , null ) ) ; throw new org . pentaho . platform . dataaccess . datasource . wizard . service . ConnectionServiceException ( org . pentaho . platform . dataaccess . datasource . wizard . service . messages . Messages . getErrorString ( "ConnectionServiceInMemoryDelegate.ERROR_0006_UNABLE_TO_DELETE_CONNECTION" , name , null ) ) ; } | org . junit . Assert . assertTrue ( org . pentaho . platform . dataaccess . datasource . wizard . service . impl . ConnectionServiceImplIT . connectionServiceImpl . deleteConnection ( org . pentaho . platform . dataaccess . datasource . wizard . service . impl . ConnectionServiceImplIT . EXIST_CONNECTION_NAME ) ) |
testSetKnsLegacyDataAdapter ( ) { lda . setKnsLegacyDataAdapter ( null ) ; "<AssertPlaceHolder>" ; } getKnsLegacyDataAdapter ( ) { return knsLegacyDataAdapter ; } | org . junit . Assert . assertNull ( lda . getKnsLegacyDataAdapter ( ) ) |
testWrongUsage ( ) { org . apache . commons . math3 . geometry . euclidean . twod . PolygonsSet ps = new org . apache . commons . math3 . geometry . euclidean . twod . PolygonsSet ( new org . apache . commons . math3 . geometry . partitioning . BSPTree < org . apache . commons . math3 . geometry . euclidean . twod . Euclidean2D > ( ) , 1.0E-10 ) ; "<AssertPlaceHolder>" ; try { ps . getSize ( ) ; org . junit . Assert . fail ( "an<sp>exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( java . lang . NullPointerException npe ) { } } | org . junit . Assert . assertNotNull ( ps ) |
testGetToolRegistrationNone ( ) { org . sakaiproject . event . api . SessionState state = mock ( org . sakaiproject . event . api . SessionState . class ) ; org . sakaiproject . site . tool . Set < org . sakaiproject . tool . api . Tool > other = siteAction . getToolRegistrations ( state , "other" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { int count = countAllResources ( ) ; return count == 0 ; } | org . junit . Assert . assertTrue ( other . isEmpty ( ) ) |
shouldHandleLocalDate ( ) { final java . time . LocalDate o = java . time . LocalDate . now ( ) ; "<AssertPlaceHolder>" ; } serializeDeserialize ( java . lang . Object , java . lang . Class ) { final org . apache . tinkerpop . shaded . kryo . Kryo kryo = builder . get ( ) . create ( ) . createMapper ( ) ; try ( final java . io . ByteArrayOutputStream stream = new java . io . ByteArrayOutputStream ( ) ) { final org . apache . tinkerpop . shaded . kryo . io . Output out = new org . apache . tinkerpop . shaded . kryo . io . Output ( stream ) ; kryo . writeObject ( out , o ) ; out . flush ( ) ; try ( final java . io . InputStream inputStream = new java . io . ByteArrayInputStream ( stream . toByteArray ( ) ) ) { final org . apache . tinkerpop . shaded . kryo . io . Input input = new org . apache . tinkerpop . shaded . kryo . io . Input ( inputStream ) ; return kryo . readObject ( input , clazz ) ; } } } | org . junit . Assert . assertEquals ( o , serializeDeserialize ( o , java . time . LocalDate . class ) ) |
shouldReturnAnInstanceOfDefaultProcessorForHeader ( ) { org . codegist . crest . param . ParamProcessor actual = org . codegist . crest . param . ParamProcessors . newInstance ( ParamType . HEADER , null ) ; "<AssertPlaceHolder>" ; } newInstance ( org . codegist . crest . config . ParamType , java . lang . String ) { switch ( type ) { case COOKIE : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingCookieParamProcessor ( listSeparator ) : DefaultCookieParamProcessor . INSTANCE ; default : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingParamProcessor ( listSeparator ) : DefaultParamProcessor . INSTANCE ; } } | org . junit . Assert . assertSame ( DefaultParamProcessor . INSTANCE , actual ) |
testReadFromWithIllegalMessageNum2 ( ) { target = new org . o3project . odenos . core . component . network . topology . TopologyChanged ( prev , curr , org . o3project . odenos . core . component . network . topology . TopologyChanged . Action . update ) ; org . msgpack . MessagePack msg = new org . msgpack . MessagePack ( ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; org . msgpack . packer . Packer pk = msg . createPacker ( out ) ; byte [ ] bytes ; java . io . ByteArrayInputStream in ; org . msgpack . unpacker . Unpacker upk = null ; try { pk . writeMapBegin ( 2 ) ; pk . write ( "version" ) ; pk . write ( target . version ) ; pk . write ( "action" ) ; pk . write ( target . action ) ; pk . write ( "prev" ) ; pk . write ( target . prev ) ; pk . write ( "curr" ) ; pk . write ( target . curr ) ; pk . writeMapEnd ( ) ; bytes = out . toByteArray ( ) ; in = new java . io . ByteArrayInputStream ( bytes ) ; upk = msg . createUnpacker ( in ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( "Exception<sp>in<sp>test<sp>setup" ) ; } target = org . mockito . Mockito . spy ( new org . o3project . odenos . core . component . network . topology . TopologyChanged ( ) ) ; try { target . readFrom ( upk ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; return ; } org . junit . Assert . fail ( "could<sp>not<sp>catch<sp>an<sp>exception" ) ; } readFrom ( org . msgpack . unpacker . Unpacker ) { int size = upk . readMapBegin ( ) ; if ( size != ( org . o3project . odenos . remoteobject . event . BaseObjectChanged . MSG_NUM ) ) { throw new java . io . IOException ( ) ; } while ( ( size -- ) > 0 ) { java . lang . String field = upk . readString ( ) ; switch ( field ) { case "action" : action = upk . readString ( ) ; break ; case "prev" : if ( ! ( upk . trySkipNil ( ) ) ) { prev = upk . read ( this . msgClass ) ; } break ; case "curr" : if ( ! ( upk . trySkipNil ( ) ) ) { curr = upk . read ( this . msgClass ) ; } break ; default : throw new java . io . IOException ( ) ; } } upk . readMapEnd ( ) ; } | org . junit . Assert . assertTrue ( ( e instanceof java . io . IOException ) ) |
testMultiCompensate ( ) { org . jboss . jbossts . xts . bytemanSupport . participantCompletion . ParticipantCompletionCoordinatorRules . setParticipantCount ( 2 ) ; com . arjuna . mw . wst11 . UserBusinessActivity uba = com . arjuna . mw . wst11 . UserBusinessActivity . getUserBusinessActivity ( ) ; com . arjuna . mw . wst11 . BusinessActivityManager bam = com . arjuna . mw . wst11 . BusinessActivityManager . getBusinessActivityManager ( ) ; com . arjuna . wst11 . BAParticipantManager bpm1 = null ; com . arjuna . wst11 . BAParticipantManager bpm2 = null ; com . arjuna . wstx . tests . common . DemoBusinessParticipant p = new com . arjuna . wstx . tests . common . DemoBusinessParticipant ( com . arjuna . wstx . tests . common . DemoBusinessParticipant . COMPENSATE , "1241" ) ; com . arjuna . wstx . tests . common . FailureBusinessParticipant fp = new com . arjuna . wstx . tests . common . FailureBusinessParticipant ( com . arjuna . wstx . tests . common . FailureBusinessParticipant . FAIL_IN_COMPENSATE , "5680" ) ; try { uba . begin ( ) ; bpm1 = bam . enlistForBusinessAgreementWithParticipantCompletion ( p , "1241" ) ; bpm2 = bam . enlistForBusinessAgreementWithParticipantCompletion ( fp , "5680" ) ; bpm1 . completed ( ) ; bpm2 . completed ( ) ; } catch ( java . lang . Exception eouter ) { try { uba . cancel ( ) ; } catch ( java . lang . Exception einner ) { } throw eouter ; } uba . cancel ( ) ; "<AssertPlaceHolder>" ; } passed ( ) { return _passed ; } | org . junit . Assert . assertTrue ( p . passed ( ) ) |
testVarArgsUnboxing ( ) { final org . apache . commons . lang3 . reflect . MethodUtilsTest . TestBean testBean = new org . apache . commons . lang3 . reflect . MethodUtilsTest . TestBean ( ) ; final int [ ] actual = ( ( int [ ] ) ( org . apache . commons . lang3 . reflect . MethodUtils . invokeMethod ( testBean , "unboxing" , java . lang . Integer . valueOf ( 1 ) , java . lang . Integer . valueOf ( 2 ) ) ) ) ; "<AssertPlaceHolder>" ; } valueOf ( long [ ] ) { int len = words . length ; while ( ( len > 0 ) && ( ( words [ ( len - 1 ) ] ) == 0 ) ) { len -- ; } int [ ] array = new int [ len * ( Long . SIZE ) ] ; int bitIndex = 0 ; for ( int i = 0 ; i < len ; i ++ ) { java . util . BitSet . addLong ( array , words [ i ] , bitIndex ) ; bitIndex += Long . SIZE ; } return new java . util . BitSet ( array ) ; } | org . junit . Assert . assertArrayEquals ( new int [ ] { 1 , 2 } , actual ) |
getClassTest ( ) { mConfiguration . set ( PropertyKey . WEB_THREADS , "java.lang.String" ) ; "<AssertPlaceHolder>" ; } getClass ( alluxio . conf . PropertyKey ) { return conf ( key ) . getClass ( key ) ; } | org . junit . Assert . assertEquals ( java . lang . String . class , mConfiguration . getClass ( PropertyKey . WEB_THREADS ) ) |
coalesceTokenRangesTests ( ) { io . cassandrareaper . service . SegmentGenerator sg = new io . cassandrareaper . service . SegmentGenerator ( java . math . BigInteger . valueOf ( 1 ) , java . math . BigInteger . valueOf ( 1600 ) ) ; java . util . Map < java . util . List < java . lang . String > , java . util . List < java . lang . String > > rangeToEndpoint = com . google . common . collect . Maps . newHashMap ( ) ; rangeToEndpoint . put ( java . util . Arrays . asList ( "1" , "200" ) , java . util . Arrays . asList ( "node1" , "node2" , "node3" ) ) ; rangeToEndpoint . put ( java . util . Arrays . asList ( "200" , "400" ) , java . util . Arrays . asList ( "node1" , "node2" , "node3" ) ) ; rangeToEndpoint . put ( java . util . Arrays . asList ( "400" , "1000" 0 ) , java . util . Arrays . asList ( "node1" ) ) ; rangeToEndpoint . put ( java . util . Arrays . asList ( "1000" 0 , "800" ) , java . util . Arrays . asList ( "node1" , "node2" ) ) ; rangeToEndpoint . put ( java . util . Arrays . asList ( "800" , "1000" ) , java . util . Arrays . asList ( "node1" , "node2" ) ) ; rangeToEndpoint . put ( java . util . Arrays . asList ( "1100" , "1200" ) , java . util . Arrays . asList ( "node2" , "node3" , "node1" ) ) ; java . util . Map < java . util . List < java . lang . String > , java . util . List < io . cassandrareaper . service . RingRange > > replicasToRangeMap = io . cassandrareaper . service . RepairRunService . buildReplicasToRangeMap ( rangeToEndpoint ) ; java . util . List < io . cassandrareaper . core . Segment > segments = sg . coalesceTokenRanges ( java . math . BigInteger . valueOf ( 1200 ) , replicasToRangeMap ) ; "<AssertPlaceHolder>" ; } coalesceTokenRanges ( java . math . BigInteger , java . util . Map ) { java . util . List < io . cassandrareaper . core . Segment > coalescedRepairSegments = com . google . common . collect . Lists . newArrayList ( ) ; java . util . List < io . cassandrareaper . service . RingRange > tokenRangesForCurrentSegment = com . google . common . collect . Lists . newArrayList ( ) ; java . math . BigInteger tokenCount = java . math . BigInteger . ZERO ; for ( java . util . Map . Entry < java . util . List < java . lang . String > , java . util . List < io . cassandrareaper . service . RingRange > > tokenRangesByReplica : replicasToRange . entrySet ( ) ) { io . cassandrareaper . service . SegmentGenerator . LOG . info ( "Coalescing<sp>segments<sp>for<sp>nodes<sp>{}" , tokenRangesByReplica . getKey ( ) ) ; for ( io . cassandrareaper . service . RingRange tokenRange : tokenRangesByReplica . getValue ( ) ) { if ( ( ( tokenRange . span ( rangeSize ) . add ( tokenCount ) . compareTo ( targetSegmentSize ) ) > 0 ) && ( ! ( tokenRangesForCurrentSegment . isEmpty ( ) ) ) ) { io . cassandrareaper . service . SegmentGenerator . LOG . info ( "Got<sp>enough<sp>tokens<sp>for<sp>one<sp>segment<sp>({})<sp>:<sp>{}" , tokenCount , tokenRangesForCurrentSegment ) ; coalescedRepairSegments . add ( io . cassandrareaper . core . Segment . builder ( ) . withTokenRanges ( tokenRangesForCurrentSegment ) . build ( ) ) ; tokenRangesForCurrentSegment = com . google . common . collect . Lists . newArrayList ( ) ; tokenCount = java . math . BigInteger . ZERO ; } tokenCount = tokenCount . add ( tokenRange . span ( rangeSize ) ) ; tokenRangesForCurrentSegment . add ( tokenRange ) ; } if ( ! ( tokenRangesForCurrentSegment . isEmpty ( ) ) ) { coalescedRepairSegments . add ( io . cassandrareaper . core . Segment . builder ( ) . withTokenRanges ( tokenRangesForCurrentSegment ) . build ( ) ) ; tokenRangesForCurrentSegment = com . google . common . collect . Lists . newArrayList ( ) ; } } com . google . common . base . Preconditions . checkState ( io . cassandrareaper . service . SegmentGenerator . allTokensHaveBeenCoalesced ( coalescedRepairSegments , replicasToRange ) , "Number<sp>of<sp>coalesced<sp>tokens<sp>doesn't<sp>match<sp>with<sp>the<sp>total<sp>number<sp>of<sp>tokens" ) ; return coalescedRepairSegments ; } | org . junit . Assert . assertEquals ( 3 , segments . size ( ) ) |
testCount ( ) { int numAnexos = getDao ( ) . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { return tiposAsuntos . size ( ) ; } | org . junit . Assert . assertTrue ( ( numAnexos > 0 ) ) |
readsInterfacedEnumIfConverterIsRegistered ( ) { org . bson . Document document = new org . bson . Document ( "property" , org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . InterfacedEnum . INSTANCE . name ( ) ) ; org . springframework . core . convert . converter . Converter < java . lang . String , org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . SomeInterface > enumConverter = new org . springframework . core . convert . converter . Converter < java . lang . String , org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . SomeInterface > ( ) { @ org . springframework . data . mongodb . core . convert . Override public org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . SomeInterface convert ( java . lang . String source ) { return org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . InterfacedEnum . valueOf ( source ) ; } } ; converter . setCustomConversions ( new org . springframework . data . mongodb . core . convert . MongoCustomConversions ( org . springframework . data . mongodb . core . convert . Arrays . asList ( enumConverter ) ) ) ; converter . afterPropertiesSet ( ) ; org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . DocWithInterfacedEnum result = converter . read ( org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . DocWithInterfacedEnum . class , document ) ; "<AssertPlaceHolder>" . isEqualTo ( org . springframework . data . mongodb . core . convert . MappingMongoConverterUnitTests . InterfacedEnum . INSTANCE ) ; } read ( java . lang . Class , org . bson . conversions . Bson ) { return ( ( S ) ( person ) ) ; } | org . junit . Assert . assertThat ( result . property ) |
testObjectFieldConverterResultToJavaStreamNotObject ( ) { int COLUMN = 1 ; com . j256 . ormlite . support . DatabaseResults results = ( ( com . j256 . ormlite . support . DatabaseResults ) ( createMock ( com . j256 . ormlite . support . DatabaseResults . class ) ) ) ; java . lang . String value = "NotASerializedObject" ; expect ( results . getBlobStream ( COLUMN ) ) . andReturn ( new java . io . ByteArrayInputStream ( value . getBytes ( ) ) ) ; replay ( results ) ; com . j256 . ormlite . db . DerbyEmbeddedDatabaseType type = new com . j256 . ormlite . db . DerbyEmbeddedDatabaseType ( ) ; com . j256 . ormlite . field . FieldConverter converter = type . getFieldConverter ( DataType . SERIALIZABLE . getDataPersister ( ) , null ) ; java . lang . Object obj = converter . resultToJava ( null , results , COLUMN ) ; verify ( results ) ; "<AssertPlaceHolder>" ; } getFieldConverter ( com . j256 . ormlite . field . DataPersister , com . j256 . ormlite . field . FieldType ) { switch ( dataType . getSqlType ( ) ) { case BOOLEAN : return com . j256 . ormlite . db . SqlServerDatabaseType . booleanConverter ; case BYTE : return com . j256 . ormlite . db . SqlServerDatabaseType . byteConverter ; default : return super . getFieldConverter ( dataType , fieldType ) ; } } | org . junit . Assert . assertEquals ( value , obj ) |
testWeeklyReportStartTimeInThePast ( ) { cc . blynk . server . core . model . widgets . ui . reporting . source . ReportDataStream reportDataStream = new cc . blynk . server . core . model . widgets . ui . reporting . source . ReportDataStream ( ( ( short ) ( 1 ) ) , cc . blynk . server . core . model . enums . PinType . VIRTUAL , "Temperature" , true ) ; cc . blynk . server . core . model . widgets . ui . reporting . source . ReportSource reportSource2 = new cc . blynk . server . core . model . widgets . ui . reporting . source . TileTemplateReportSource ( new cc . blynk . server . core . model . widgets . ui . reporting . source . ReportDataStream [ ] { reportDataStream } , 1 , new int [ ] { 0 , 1 } ) ; java . time . ZonedDateTime zonedNow = java . time . ZonedDateTime . now ( java . time . ZoneId . of ( "UTC" ) ) ; long now = ( zonedNow . toEpochSecond ( ) ) * 1000 ; cc . blynk . server . core . model . widgets . ui . reporting . Report report = new cc . blynk . server . core . model . widgets . ui . reporting . Report ( 1 , "Report" , new cc . blynk . server . core . model . widgets . ui . reporting . source . ReportSource [ ] { reportSource2 } , new cc . blynk . server . core . model . widgets . ui . reporting . type . WeeklyReport ( now , cc . blynk . server . core . model . widgets . ui . reporting . type . ReportDurationType . INFINITE , 0 , 0 , 1 ) , "test@gmail.com" , cc . blynk . server . core . model . widgets . outputs . graph . GraphGranularityType . MINUTE , true , CSV_FILE_PER_DEVICE_PER_PIN , null , java . time . ZoneId . of ( "Europe/Kiev" ) , 0 , 0 , null ) ; long expectedDelayInSeconds = report . calculateDelayInSeconds ( ) ; "<AssertPlaceHolder>" ; } calculateDelayInSeconds ( ) { cc . blynk . server . core . model . widgets . ui . reporting . type . DailyReport basePeriodicReportType = ( ( cc . blynk . server . core . model . widgets . ui . reporting . type . DailyReport ) ( reportType ) ) ; java . time . ZonedDateTime zonedNow = java . time . ZonedDateTime . now ( tzName ) ; java . time . ZonedDateTime zonedStartAt = basePeriodicReportType . getNextTriggerTime ( zonedNow , tzName ) ; if ( basePeriodicReportType . isExpired ( zonedStartAt , tzName ) ) { throw new cc . blynk . server . core . protocol . exceptions . IllegalCommandBodyException ( "Report<sp>is<sp>expired." ) ; } java . time . Duration duration = java . time . Duration . between ( zonedNow , zonedStartAt ) ; long initialDelaySeconds = duration . getSeconds ( ) ; if ( initialDelaySeconds < 0 ) { throw new cc . blynk . server . core . protocol . exceptions . IllegalCommandBodyException ( "Initial<sp>delay<sp>in<sp>less<sp>than<sp>zero." ) ; } return initialDelaySeconds ; } | org . junit . Assert . assertTrue ( ( expectedDelayInSeconds > 0 ) ) |
testParseExactlyErr ( ) { actions = new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "type" , "aaa" ) ; put ( "eth" , "12" ) ; } } ; target = new org . o3project . odenos . core . component . network . flow . query . OFPFlowActionPushVlanQuery ( actions ) ; "<AssertPlaceHolder>" ; } parse ( ) { if ( ! ( super . parse ( ) ) ) { return false ; } if ( ! ( org . o3project . odenos . core . component . network . BasicQuery . checkMapExactly ( this . actions , new java . lang . String [ ] { } ) ) ) { return false ; } return true ; } | org . junit . Assert . assertThat ( target . parse ( ) , org . hamcrest . CoreMatchers . is ( false ) ) |
getVisibleServices ( ) { runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . usergroupservice . bean . Override public org . oscm . usergroupservice . bean . Void call ( ) throws org . oscm . usergroupservice . bean . Exception { java . lang . String marketplaceId = java . lang . String . valueOf ( marketplaceOne . getKey ( ) ) ; org . oscm . domobjects . UserGroup userGroup = createGroups ( 1 ) . get ( 0 ) ; org . oscm . domobjects . CatalogEntry catalogEntry = new org . oscm . domobjects . CatalogEntry ( ) ; catalogEntry . setProduct ( product ) ; catalogEntry . setMarketplace ( marketplaceOne ) ; mgr . merge ( catalogEntry ) ; final java . lang . String unitId = java . lang . String . valueOf ( userGroup . getKey ( ) ) ; org . oscm . domobjects . UserGroupToInvisibleProduct ug2ip = new org . oscm . domobjects . UserGroupToInvisibleProduct ( ) ; userGroup = ( ( org . oscm . domobjects . UserGroup ) ( mgr . merge ( userGroup ) ) ) ; ug2ip . setProduct ( product ) ; ug2ip . setUserGroup ( userGroup ) ; ug2ip . setForallusers ( false ) ; ug2ip = ( ( org . oscm . domobjects . UserGroupToInvisibleProduct ) ( mgr . merge ( ug2ip ) ) ) ; java . util . List < org . oscm . domobjects . UserGroupToInvisibleProduct > ug2ipList = new java . util . ArrayList ( ) ; ug2ipList . add ( ug2ip ) ; userGroup . setUserGroupToInvisibleProducts ( ug2ipList ) ; mgr . merge ( userGroup ) ; final java . util . List < org . oscm . domobjects . Product > visibleServices = localDao . getVisibleServices ( unitId , new org . oscm . paginator . Pagination ( 0 , 0 ) , marketplaceId ) ; boolean result = false ; for ( org . oscm . domobjects . Product visibleService : visibleServices ) { if ( ( visibleService . getKey ( ) ) == ( product . getKey ( ) ) ) { result = true ; } } "<AssertPlaceHolder>" ; return null ; } } ) ; } getKey ( ) { return key ; } | org . junit . Assert . assertTrue ( result ) |
setSelectName_smallerThanPrevious ( ) { selectValuesMeta . setSelectName ( new java . lang . String [ ] { org . pentaho . di . trans . steps . selectvalues . SelectValuesMetaTest . FIRST_FIELD , org . pentaho . di . trans . steps . selectvalues . SelectValuesMetaTest . SECOND_FIELD } ) ; selectValuesMeta . setSelectName ( new java . lang . String [ ] { org . pentaho . di . trans . steps . selectvalues . SelectValuesMetaTest . FIRST_FIELD } ) ; "<AssertPlaceHolder>" ; } getSelectName ( ) { java . lang . String [ ] selectName = new java . lang . String [ selectFields . length ] ; for ( int i = 0 ; i < ( selectName . length ) ; i ++ ) { selectName [ i ] = selectFields [ i ] . getName ( ) ; } return selectName ; } | org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { org . pentaho . di . trans . steps . selectvalues . SelectValuesMetaTest . FIRST_FIELD } , selectValuesMeta . getSelectName ( ) ) |
testExtractNhinCodedElement ( ) { org . opensaml . saml . saml2 . core . Attribute attrib = mock ( org . opensaml . saml . saml2 . core . Attribute . class ) ; java . util . List < org . opensaml . core . xml . XMLObject > attrVals = new java . util . ArrayList ( ) ; when ( attrib . getAttributeValues ( ) ) . thenReturn ( attrVals ) ; java . lang . String CodeId = null ; gov . hhs . fha . nhinc . common . nhinccommon . CeType ceTypeResult = helper . extractNhinCodedElement ( attrib , CodeId ) ; "<AssertPlaceHolder>" ; } extractNhinCodedElement ( org . opensaml . saml . saml2 . core . Attribute , java . lang . String ) { gov . hhs . fha . nhinc . opensaml . extraction . AttributeHelper . LOG . debug ( "Entering<sp>AttributeHelper.extractNhinCodedElement..." ) ; gov . hhs . fha . nhinc . common . nhinccommon . CeType ce = new gov . hhs . fha . nhinc . common . nhinccommon . CeType ( ) ; ce . setCode ( "" ) ; ce . setCodeSystem ( "" ) ; ce . setCodeSystemName ( "" ) ; ce . setDisplayName ( "" ) ; java . util . List < org . opensaml . core . xml . XMLObject > attrVals = attrib . getAttributeValues ( ) ; if ( org . apache . commons . collections . CollectionUtils . isNotEmpty ( attrVals ) ) { gov . hhs . fha . nhinc . opensaml . extraction . AttributeHelper . LOG . trace ( "AttributeValue<sp>is:<sp>{}" , attrVals . get ( 0 ) . getClass ( ) ) ; org . w3c . dom . NodeList nodelist = null ; if ( ( attrVals . get ( 0 ) ) instanceof org . opensaml . core . xml . schema . impl . XSAnyImpl ) { org . opensaml . core . xml . schema . impl . XSAnyImpl elem = ( ( org . opensaml . core . xml . schema . impl . XSAnyImpl ) ( attrVals . get ( 0 ) ) ) ; nodelist = elem . getDOM ( ) . getChildNodes ( ) ; } else { gov . hhs . fha . nhinc . opensaml . extraction . AttributeHelper . LOG . error ( "The<sp>value<sp>for<sp>the<sp>{}<sp>attribute<sp>is<sp>a:<sp>{}<sp>expected<sp>an<sp>XSAnyImpl" , codeId , attrVals . get ( 0 ) . getClass ( ) ) ; } if ( ( nodelist != null ) && ( ( nodelist . getLength ( ) ) > 0 ) ) { int numNodes = nodelist . getLength ( ) ; for ( int idx = 0 ; idx < numNodes ; idx ++ ) { gov . hhs . fha . nhinc . opensaml . extraction . AttributeHelper . compareAttrMap ( nodelist , ce , codeId , idx ) ; } } else { gov . hhs . fha . nhinc . opensaml . extraction . AttributeHelper . LOG . error ( "The<sp>AttributeValue<sp>for<sp>{}<sp>should<sp>have<sp>a<sp>Child<sp>Node" , codeId ) ; } } else { gov . hhs . fha . nhinc . opensaml . extraction . AttributeHelper . LOG . error ( "Attributes<sp>for<sp>{}<sp>are<sp>invalid:<sp>{}<sp>" , codeId , attrVals ) ; } gov . hhs . fha . nhinc . opensaml . extraction . AttributeHelper . LOG . debug ( "Exiting<sp>AttributeHelper.extractNhinCodedElement..." ) ; return ce ; } | org . junit . Assert . assertEquals ( "" , ceTypeResult . getCode ( ) ) |
testExpression43 ( ) { java . lang . String expr = "6.02214E23" ; double expected = 6.02214E23 ; net . objecthunter . exp4j . Expression e = new net . objecthunter . exp4j . ExpressionBuilder ( expr ) . build ( ) ; double result = e . evaluate ( ) ; "<AssertPlaceHolder>" ; } evaluate ( ) { final net . objecthunter . exp4j . ArrayStack output = new net . objecthunter . exp4j . ArrayStack ( ) ; for ( int i = 0 ; i < ( tokens . length ) ; i ++ ) { net . objecthunter . exp4j . tokenizer . Token t = tokens [ i ] ; else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_VARIABLE ) ) { final java . lang . String name = ( ( net . objecthunter . exp4j . tokenizer . VariableToken ) ( t ) ) . getName ( ) ; final java . lang . Double value = this . variables . get ( name ) ; if ( value == null ) { throw new java . lang . IllegalArgumentException ( ( ( "No<sp>value<sp>has<sp>been<sp>set<sp>for<sp>the<sp>setVariable<sp>'" + name ) + "'." ) ) ; } output . push ( value ) ; } else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_OPERATOR ) ) { net . objecthunter . exp4j . tokenizer . OperatorToken op = ( ( net . objecthunter . exp4j . tokenizer . OperatorToken ) ( t ) ) ; if ( ( output . size ( ) ) < ( op . getOperator ( ) . getNumOperands ( ) ) ) { throw new java . lang . IllegalArgumentException ( ( ( "Invalid<sp>number<sp>of<sp>operands<sp>available<sp>for<sp>'" + ( op . getOperator ( ) . getSymbol ( ) ) ) + "'<sp>operator" ) ) ; } if ( ( op . getOperator ( ) . getNumOperands ( ) ) == 2 ) { double rightArg = output . pop ( ) ; double leftArg = output . pop ( ) ; output . push ( op . getOperator ( ) . apply ( leftArg , rightArg ) ) ; } else if ( ( op . getOperator ( ) . getNumOperands ( ) ) == 1 ) { double arg = output . pop ( ) ; output . push ( op . getOperator ( ) . apply ( arg ) ) ; } } else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_FUNCTION ) ) { net . objecthunter . exp4j . tokenizer . FunctionToken func = ( ( net . objecthunter . exp4j . tokenizer . FunctionToken ) ( t ) ) ; final int numArguments = func . getFunction ( ) . getNumArguments ( ) ; if ( ( output . size ( ) ) < numArguments ) { throw new java . lang . IllegalArgumentException ( ( ( "Invalid<sp>number<sp>of<sp>arguments<sp>available<sp>for<sp>'" + ( func . getFunction ( ) . getName ( ) ) ) + "'<sp>function" ) ) ; } double [ ] args = new double [ numArguments ] ; for ( int j = numArguments - 1 ; j >= 0 ; j -- ) { args [ j ] = output . pop ( ) ; } output . push ( func . getFunction ( ) . apply ( args ) ) ; } } if ( ( output . size ( ) ) > 1 ) { throw new java . lang . IllegalArgumentException ( "Invalid<sp>number<sp>of<sp>items<sp>on<sp>the<sp>output<sp>queue.<sp>Might<sp>be<sp>caused<sp>by<sp>an<sp>invalid<sp>number<sp>of<sp>arguments<sp>for<sp>a<sp>function." ) ; } return output . pop ( ) ; } | org . junit . Assert . assertTrue ( ( expected == result ) ) |
testUnmarshal ( ) { org . opennms . netmgt . jasper . measurement . MeasurementDataSource ds = new org . opennms . netmgt . jasper . measurement . MeasurementDataSource ( getClass ( ) . getResourceAsStream ( "/responses/response1.xml" ) ) ; "<AssertPlaceHolder>" ; } getResourceAsStream ( java . lang . String ) { return getClass ( ) . getResourceAsStream ( resource ) ; } | org . junit . Assert . assertNotNull ( ds . response ) |
shouldReturnFalseForHyphenFollowingLetter ( ) { boolean start = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isWordStart ( "x-" , 1 ) ; "<AssertPlaceHolder>" ; } isWordStart ( java . lang . String , int ) { checkNotNull ( entityName ) ; int length = entityName . length ( ) ; checkElementIndex ( index , length ) ; edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType indexCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , index ) ; if ( ! ( indexCharType . isWordLetter ( ) ) ) { return false ; } if ( index == 0 ) { return true ; } edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType prevCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index - 1 ) ) ; if ( prevCharType != indexCharType ) { return ! ( ( indexCharType == ( EntityNameCharType . LETTER ) ) && ( prevCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) ) ; } if ( indexCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) { boolean hasFollowingCharacter = index < ( length - 1 ) ; return hasFollowingCharacter && ( ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index + 1 ) ) ) == ( EntityNameCharType . LETTER ) ) ; } return false ; } | org . junit . Assert . assertEquals ( false , start ) |
selfTest ( ) { com . itextpdf . kernel . geom . AffineTransform affineTransform = new com . itextpdf . kernel . geom . AffineTransform ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) { return false ; } com . itextpdf . kernel . colors . Color color = ( ( com . itextpdf . kernel . colors . Color ) ( o ) ) ; return ( ( colorSpace ) != null ? colorSpace . getPdfObject ( ) . equals ( color . colorSpace . getPdfObject ( ) ) : ( color . colorSpace ) == null ) && ( java . util . Arrays . equals ( colorValue , color . colorValue ) ) ; } | org . junit . Assert . assertTrue ( affineTransform . equals ( affineTransform ) ) |
testHttpAccept ( ) { org . locationtech . udig . project . ui . internal . actions . MapDropAction action = new org . locationtech . udig . project . ui . internal . actions . MapDropAction ( ) ; java . lang . Object layersView = org . eclipse . ui . PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) . findView ( LayersView . ID ) ; action . init ( null , null , ViewerDropLocation . NONE , layersView , "http://localhost:8080/geoserver/wfs" ) ; boolean acceptable = action . accept ( ) ; "<AssertPlaceHolder>" ; } accept ( ) { java . lang . Object data = getData ( ) ; if ( data . getClass ( ) . isArray ( ) ) { java . lang . Object [ ] objects = ( ( java . lang . Object [ ] ) ( data ) ) ; for ( java . lang . Object object : objects ) { if ( canAccept ( object ) ) { return true ; } } return false ; } else if ( canAccept ( data ) ) { return true ; } return canAccept ( data ) ; } | org . junit . Assert . assertTrue ( acceptable ) |
testSerializeDeserialize ( ) { java . nio . ByteBuffer buffer = org . apache . zeppelin . resource . Resource . serializeObject ( "hello" ) ; "<AssertPlaceHolder>" ; } deserializeObject ( java . nio . ByteBuffer ) { if ( buf == null ) { return null ; } java . io . InputStream ins = org . apache . zeppelin . resource . ByteBufferInputStream . get ( buf ) ; java . io . ObjectInputStream oin ; java . lang . Object object = null ; oin = new java . io . ObjectInputStream ( ins ) ; object = oin . readObject ( ) ; oin . close ( ) ; ins . close ( ) ; return object ; } | org . junit . Assert . assertEquals ( "hello" , org . apache . zeppelin . resource . Resource . deserializeObject ( buffer ) ) |
testFavoredNodesEndToEndForAppend ( ) { for ( int i = 0 ; i < ( org . apache . hadoop . hdfs . server . namenode . TestFavoredNodesEndToEnd . NUM_FILES ) ; i ++ ) { java . util . Random rand = new java . util . Random ( ( ( java . lang . System . currentTimeMillis ( ) ) + i ) ) ; java . net . InetSocketAddress [ ] datanode = getDatanodes ( rand ) ; org . apache . hadoop . fs . Path p = new org . apache . hadoop . fs . Path ( ( "/filename" + i ) ) ; org . apache . hadoop . hdfs . server . namenode . TestFavoredNodesEndToEnd . dfs . create ( p , org . apache . hadoop . fs . permission . FsPermission . getDefault ( ) , true , 4096 , ( ( short ) ( 3 ) ) , 4096L , null , null , null ) . close ( ) ; org . apache . hadoop . fs . FSDataOutputStream out = org . apache . hadoop . hdfs . server . namenode . TestFavoredNodesEndToEnd . dfs . append ( p , java . util . EnumSet . of ( CreateFlag . APPEND ) , 4096 , null , datanode ) ; out . write ( org . apache . hadoop . hdfs . server . namenode . TestFavoredNodesEndToEnd . SOME_BYTES ) ; out . close ( ) ; org . apache . hadoop . fs . BlockLocation [ ] locations = getBlockLocations ( p ) ; for ( org . apache . hadoop . fs . BlockLocation loc : locations ) { java . lang . String [ ] hosts = loc . getNames ( ) ; java . lang . String [ ] hosts1 = getStringForInetSocketAddrs ( datanode ) ; "<AssertPlaceHolder>" ; } } } compareNodes ( java . lang . String [ ] , java . lang . String [ ] ) { for ( int i = 0 ; i < ( dnList1 . length ) ; i ++ ) { boolean matched = false ; for ( int j = 0 ; j < ( dnList2 . length ) ; j ++ ) { if ( dnList1 [ i ] . equals ( dnList2 [ j ] ) ) { matched = true ; break ; } } if ( matched == false ) { org . junit . Assert . fail ( ( ( dnList1 [ i ] ) + "<sp>not<sp>a<sp>favored<sp>node" ) ) ; } } return true ; } | org . junit . Assert . assertTrue ( compareNodes ( hosts , hosts1 ) ) |
getsJAXBContextResolverAsContextResolver ( ) { org . everrest . core . impl . provider . JAXBContextResolver contextResolver = jaxbContextResolver . getContext ( null ) ; "<AssertPlaceHolder>" ; } getContext ( java . lang . Class ) { return this ; } | org . junit . Assert . assertSame ( jaxbContextResolver , contextResolver ) |
stressTestLinkFile ( ) { java . net . URI uri = getClass ( ) . getResource ( "/biofiles/variant-test-file.vcf.gz" ) . toURI ( ) ; java . util . concurrent . atomic . AtomicInteger numFailures = new java . util . concurrent . atomic . AtomicInteger ( ) ; java . util . concurrent . atomic . AtomicInteger numOk = new java . util . concurrent . atomic . AtomicInteger ( ) ; int numThreads = 10 ; int numOperations = 250 ; java . util . concurrent . ExecutorService executorService = java . util . concurrent . Executors . newFixedThreadPool ( numThreads ) ; for ( int i = 0 ; i < numOperations ; i ++ ) { executorService . submit ( ( ) -> { try { fileManager . link ( org . opencb . opencga . catalog . managers . studyFqn , uri , "." , new org . opencb . commons . datastore . core . ObjectMap ( ) , org . opencb . opencga . catalog . managers . sessionIdUser ) ; numOk . incrementAndGet ( ) ; } catch ( ignore ) { org . opencb . opencga . catalog . managers . ignore . printStackTrace ( ) ; numFailures . incrementAndGet ( ) ; } } ) ; } executorService . awaitTermination ( 1 , TimeUnit . SECONDS ) ; executorService . shutdown ( ) ; int unexecuted = executorService . shutdownNow ( ) . size ( ) ; System . out . println ( ( ( "Do<sp>not<sp>execute<sp>" + unexecuted ) + "<sp>tasks!" ) ) ; System . out . println ( ( "numFailures<sp>=<sp>" + numFailures ) ) ; System . out . println ( ( "numOk.get()<sp>=<sp>" + ( numOk . get ( ) ) ) ) ; "<AssertPlaceHolder>" ; } get ( ) { if ( ( org . opencb . opencga . analysis . old . execution . plugins . PluginFactory . pluginFactory ) == null ) { org . opencb . opencga . analysis . old . execution . plugins . PluginFactory . pluginFactory = new org . opencb . opencga . analysis . old . execution . plugins . PluginFactory ( ) ; } return org . opencb . opencga . analysis . old . execution . plugins . PluginFactory . pluginFactory ; } | org . junit . Assert . assertEquals ( numOperations , numOk . get ( ) ) |
checkPersistingTreeSigWorks ( ) { org . apache . hadoop . hive . ql . optimizer . signature . OpTreeSignature sig = signatureFactory . getSignature ( getFilTsOp ( 3 , 4 ) ) ; org . apache . hadoop . hive . ql . optimizer . signature . OpTreeSignature sig2 = persistenceLoop ( sig , org . apache . hadoop . hive . ql . optimizer . signature . OpTreeSignature . class ) ; "<AssertPlaceHolder>" ; } persistenceLoop ( T , java . lang . Class ) { org . apache . hadoop . hive . ql . optimizer . signature . RuntimeStatsPersister sp = RuntimeStatsPersister . INSTANCE ; java . lang . String stored = sp . encode ( sig ) ; System . out . println ( stored ) ; T sig2 = sp . decode ( stored , clazz ) ; return sig2 ; } | org . junit . Assert . assertEquals ( sig , sig2 ) |
shiftRemoveEarlyBreakTest ( ) { net . openhft . smoothie . SmoothieMap < java . lang . Long , java . lang . Integer > map = new net . openhft . smoothie . SmoothieMap < java . lang . Long , java . lang . Integer > ( ) { @ net . openhft . smoothie . Override protected long keyHashCode ( @ org . jetbrains . annotations . Nullable java . lang . Object key ) { return ( ( java . lang . Long ) ( key ) ) . longValue ( ) ; } } ; map . put ( 0L , 0 ) ; map . put ( ( 2L << ( 64 - ( Segment . LOG_HASH_TABLE_SIZE ) ) ) , 2 ) ; map . put ( ( 3L << ( 64 - ( Segment . LOG_HASH_TABLE_SIZE ) ) ) , 3 ) ; map . removeIf ( ( k , v ) -> true ) ; "<AssertPlaceHolder>" ; } size ( ) { return 64 - ( java . lang . Long . bitCount ( bitSet ) ) ; } | org . junit . Assert . assertEquals ( 0 , map . size ( ) ) |
shouldDeserializeAndSerialize ( ) { java . lang . String operationsRecord = edu . illinois . codingtracker . helpers . ResourceHelper . readFileContent ( edu . illinois . codingtracker . tests . SerializerDeserializerTest . operationsRecordFile ) ; for ( edu . illinois . codingtracker . operations . UserOperation userOperation : edu . illinois . codingtracker . operations . OperationDeserializer . getUserOperations ( operationsRecord ) ) { edu . illinois . codingtracker . recording . TextRecorder . record ( userOperation ) ; } java . lang . String generatedOperationsRecord = edu . illinois . codingtracker . helpers . ResourceHelper . readFileContent ( mainRecordFile ) ; "<AssertPlaceHolder>" ; } readFileContent ( org . eclipse . core . resources . IFile ) { return edu . illinois . codingtracker . helpers . ResourceHelper . readFileContent ( edu . illinois . codingtracker . helpers . ResourceHelper . getFileForResource ( workspaceFile ) , edu . illinois . codingtracker . helpers . ResourceHelper . getCharsetForFile ( workspaceFile ) ) ; } | org . junit . Assert . assertEquals ( operationsRecord , generatedOperationsRecord ) |
testInvalidPrpertyChange ( ) { final com . allanbank . mongodb . client . Message message = new com . allanbank . mongodb . client . message . Command ( "db" , com . allanbank . mongodb . client . message . Command . COMMAND_COLLECTION , com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . build ( ) ) ; final org . easymock . Capture < java . beans . PropertyChangeListener > propListenerCapture = new org . easymock . Capture < java . beans . PropertyChangeListener > ( ) ; final com . allanbank . mongodb . client . connection . Connection mockConnection = createMock ( com . allanbank . mongodb . client . connection . Connection . class ) ; expect ( myMockConnectionFactory . connect ( ) ) . andReturn ( mockConnection ) ; mockConnection . addPropertyChangeListener ( capture ( propListenerCapture ) ) ; expectLastCall ( ) ; mockConnection . send ( message , null ) ; expectLastCall ( ) ; replay ( mockConnection ) ; myTestInstance . send ( message , null ) ; propListenerCapture . getValue ( ) . propertyChange ( new java . beans . PropertyChangeEvent ( mockConnection , ( ( com . allanbank . mongodb . client . connection . Connection . OPEN_PROP_NAME ) + "g" ) , Boolean . TRUE , Boolean . FALSE ) ) ; propListenerCapture . getValue ( ) . propertyChange ( new java . beans . PropertyChangeEvent ( mockConnection , com . allanbank . mongodb . client . connection . Connection . OPEN_PROP_NAME , Boolean . FALSE , Boolean . TRUE ) ) ; propListenerCapture . getValue ( ) . propertyChange ( new java . beans . PropertyChangeEvent ( mockConnection , com . allanbank . mongodb . client . connection . Connection . OPEN_PROP_NAME , Boolean . TRUE , java . lang . Integer . valueOf ( 1 ) ) ) ; "<AssertPlaceHolder>" ; verify ( mockConnection ) ; } getConnectionCount ( ) { return myConnections . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , myTestInstance . getConnectionCount ( ) ) |
testTwoNull ( ) { org . openscience . cdk . tools . diff . tree . IDifference result = org . openscience . cdk . tools . diff . tree . BooleanDifference . construct ( "Foo" , null , null ) ; "<AssertPlaceHolder>" ; } construct ( java . lang . String , java . lang . Boolean , java . lang . Boolean ) { if ( java . util . Objects . equals ( first , second ) ) { return null ; } return new org . openscience . cdk . tools . diff . tree . BooleanDifference ( name , first , second ) ; } | org . junit . Assert . assertNull ( result ) |
getConverter_noConverterAvailable_null ( ) { org . apache . tika . xmp . convert . ITikaToXMPConverter converter = org . apache . tika . xmp . convert . TikaToXMP . getConverter ( org . apache . tika . xmp . TikaToXMPTest . GENERIC_MIMETYPE ) ; "<AssertPlaceHolder>" ; } getConverter ( java . lang . String ) { if ( mimetype == null ) { throw new java . lang . IllegalArgumentException ( "mimetype<sp>must<sp>not<sp>be<sp>null" ) ; } org . apache . tika . xmp . convert . ITikaToXMPConverter converter = null ; org . apache . tika . mime . MediaType type = org . apache . tika . mime . MediaType . parse ( mimetype ) ; if ( type != null ) { java . lang . Class < ? extends org . apache . tika . xmp . convert . ITikaToXMPConverter > clazz = org . apache . tika . xmp . convert . TikaToXMP . getConverterMap ( ) . get ( type ) ; if ( clazz != null ) { try { converter = clazz . newInstance ( ) ; } catch ( java . lang . Exception e ) { throw new org . apache . tika . exception . TikaException ( ( "TikaToXMP<sp>converter<sp>class<sp>cannot<sp>be<sp>instantiated<sp>for<sp>mimetype:<sp>" + ( type . toString ( ) ) ) , e ) ; } } } return converter ; } | org . junit . Assert . assertNull ( converter ) |
testGetClient ( ) { com . xti . jenkins . plugin . awslambda . util . LambdaClientConfig lambdaClientConfig = new com . xti . jenkins . plugin . awslambda . util . LambdaClientConfig ( "abc" , "def" , "eu-west-1" , com . xti . jenkins . plugin . awslambda . util . JenkinsProxy . getConfig ( ) ) ; "<AssertPlaceHolder>" ; } getClient ( ) { if ( useDefaultAWSCredentials ) { return new com . amazonaws . services . lambda . AWSLambdaClient ( new com . amazonaws . auth . DefaultAWSCredentialsProviderChain ( ) , getClientConfiguration ( ) ) . withRegion ( com . amazonaws . regions . Region . getRegion ( com . amazonaws . regions . Regions . fromName ( region ) ) ) ; } else { return new com . amazonaws . services . lambda . AWSLambdaClient ( new com . amazonaws . auth . BasicAWSCredentials ( accessKeyId , secretKey ) , getClientConfiguration ( ) ) . withRegion ( com . amazonaws . regions . Region . getRegion ( com . amazonaws . regions . Regions . fromName ( region ) ) ) ; } } | org . junit . Assert . assertNotNull ( lambdaClientConfig . getClient ( ) ) |
testGroupSequence3 ( ) { org . apache . bval . jsr . descriptor . BeanD < ? > bean = ( ( org . apache . bval . jsr . descriptor . BeanD < ? > ) ( org . apache . bval . jsr . ApacheValidatorFactory . getDefault ( ) . usingContext ( ) . getValidator ( ) . getConstraintsForClass ( org . apache . bval . jsr . groups . GClass2 . class ) ) ) ; class TestPredicate implements java . util . function . Predicate < org . apache . bval . jsr . groups . GroupStrategy > { final java . util . List < org . apache . bval . jsr . groups . GroupStrategy > strategies = new java . util . ArrayList ( ) ; @ org . apache . bval . jsr . groups . Override public boolean test ( org . apache . bval . jsr . groups . GroupStrategy t ) { return strategies . add ( t ) ; } } final TestPredicate p = new TestPredicate ( ) ; bean . getGroupStrategy ( ) . applyTo ( p ) ; org . apache . bval . jsr . groups . Group g1 = org . apache . bval . jsr . groups . Group . of ( org . apache . bval . jsr . groups . GClass1 . class ) ; org . apache . bval . jsr . groups . Group g2 = org . apache . bval . jsr . groups . Group . of ( org . apache . bval . jsr . groups . GClass2 . class ) ; "<AssertPlaceHolder>" ; } of ( java . lang . Class ) { return new org . apache . bval . jsr . groups . Group ( group ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( g1 , org . apache . bval . jsr . groups . GroupStrategy . simple ( g1 , g2 ) ) , p . strategies ) |
testRemoveEntities_18 ( ) { try { java . io . StringReader reader = new java . io . StringReader ( "&#" ) ; java . io . StringWriter writer = new java . io . StringWriter ( ) ; org . milyn . xml . XmlUtil . removeEntities ( reader , writer ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception excep ) { org . junit . Assert . fail ( ( "Unhandled<sp>exception:<sp>" + ( excep . getMessage ( ) ) ) ) ; } } toString ( ) { return new org . apache . commons . lang . builder . ToStringBuilder ( this ) . append ( "dao" , dao ) . toString ( ) ; } | org . junit . Assert . assertEquals ( "&#" , writer . toString ( ) ) |
whenAllResourcesAreRetrieved_thenTheResultIsNotNull ( ) { final java . util . List < org . baeldung . persistence . model . Foo > resources = getApi ( ) . findAll ( ) ; "<AssertPlaceHolder>" ; } findAll ( ) { return meals ; } | org . junit . Assert . assertNotNull ( resources ) |
testExecuteWithGettingSomething ( ) { org . cyclopsgroup . jmxterm . MockSession s = new org . cyclopsgroup . jmxterm . MockSession ( output , null ) ; s . setBean ( "something" ) ; command . setSession ( s ) ; command . execute ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( this . getClass ( ) . getSimpleName ( ) ) + ":" ) + ( getArgs ( ) ) ; } | org . junit . Assert . assertEquals ( "something" , output . toString ( ) . trim ( ) ) |
testSetMessageIndex ( ) { empty . setMessageIndex ( 1 ) ; "<AssertPlaceHolder>" ; } getMessageIndex ( ) { return getIntValue ( net . sf . marineapi . nmea . parser . TXTParser . MESSAGE_INDEX ) ; } | org . junit . Assert . assertEquals ( 1 , empty . getMessageIndex ( ) ) |
testForwardClosure ( ) { com . addthis . hydra . util . DirectedGraph < java . lang . String > graph = new com . addthis . hydra . util . DirectedGraph ( ) ; graph . addEdge ( "D" , "D" ) ; graph . addEdge ( "D" , "F" ) ; graph . addEdge ( "D" , "G" ) ; graph . addEdge ( "G" , "H" ) ; graph . addEdge ( "H" , "F" ) ; graph . addEdge ( "F" , "D" ) ; graph . addEdge ( "A" , "B" ) ; graph . addEdge ( "B" , "G" ) ; java . lang . String [ ] resultArray = new java . lang . String [ ] { "D" , "F" , "G" , "H" } ; java . util . Set < java . lang . String > results = new java . util . HashSet ( java . util . Arrays . asList ( resultArray ) ) ; "<AssertPlaceHolder>" ; } sinksClosure ( T ) { java . util . Set < T > retval = new java . util . HashSet ( ) ; java . util . Set < com . addthis . hydra . util . DirectedGraph . Node < T > > workSet = new java . util . HashSet ( ) ; com . addthis . hydra . util . DirectedGraph . Node < T > root = nodes . get ( key ) ; if ( root != null ) { workSet . add ( root ) ; } while ( ! ( workSet . isEmpty ( ) ) ) { com . addthis . hydra . util . DirectedGraph . Node < T > node = workSet . iterator ( ) . next ( ) ; retval . add ( node . key ) ; workSet . remove ( node ) ; for ( T sink : node . sinkEdges ) { if ( ! ( retval . contains ( sink ) ) ) { com . addthis . hydra . util . DirectedGraph . Node < T > sinkNode = nodes . get ( sink ) ; if ( sinkNode != null ) { workSet . add ( sinkNode ) ; } } } } return retval ; } | org . junit . Assert . assertEquals ( results , graph . sinksClosure ( "D" ) ) |
setNullType ( ) { try { org . springframework . integration . xquery . transformer . XQueryTransformer transformer = new org . springframework . integration . xquery . transformer . XQueryTransformer ( ) ; transformer . setResultType ( null ) ; } catch ( java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } setResultType ( java . lang . Class ) { org . springframework . util . Assert . notNull ( resultType , "Provide<sp>a<sp>non<sp>null<sp>value<sp>for<sp>the<sp>result<sp>type" ) ; org . springframework . util . Assert . isTrue ( ( ( resultMapper ) == null ) , "Only<sp>one<sp>of<sp>the<sp>result<sp>mapper<sp>of<sp>the<sp>resultType<sp>can<sp>be<sp>set" ) ; org . springframework . util . Assert . isTrue ( ( ( ( ( ( java . lang . String . class ) == resultType ) || ( ( org . springframework . integration . xquery . transformer . Boolean . class ) == resultType ) ) || ( ( org . springframework . integration . xquery . transformer . Number . class ) == resultType ) ) || ( ( org . w3c . dom . Node . class ) == resultType ) ) , ( "Valid<sp>values<sp>for<sp>the<sp>result<sp>type<sp>class<sp>is<sp>String,<sp>Boolean,<sp>Number<sp>or<sp>Node,<sp>" + "for<sp>any<sp>other<sp>type,<sp>provide<sp>a<sp>custom<sp>implementation<sp>of<sp>XQueryResultMapper" ) ) ; this . resultType = resultType ; } | org . junit . Assert . assertEquals ( "Provide<sp>a<sp>non<sp>null<sp>value<sp>for<sp>the<sp>result<sp>type" , e . getMessage ( ) ) |
testCapabilitiesRequestNoVersion ( ) { org . codice . ddf . spatial . ogc . csw . catalog . common . GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest ( ) ; gcr . setAcceptVersions ( null ) ; net . opengis . cat . csw . v_2_0_2 . CapabilitiesType ct = null ; try { ct = org . codice . ddf . spatial . ogc . csw . catalog . endpoint . TestCswEndpoint . csw . getCapabilities ( gcr ) ; } catch ( org . codice . ddf . spatial . ogc . csw . catalog . common . CswException e ) { org . junit . Assert . fail ( ( "CswException<sp>caught<sp>during<sp>getCapabilities<sp>GET<sp>request:<sp>" + ( e . getMessage ( ) ) ) ) ; } "<AssertPlaceHolder>" ; verifyOperationsMetadata ( ct ) ; verifyServiceIdentification ( ct ) ; verifyServiceProvider ( ct ) ; verifyFilterCapabilities ( ct ) ; } getCapabilities ( net . opengis . cat . csw . v_2_0_2 . GetCapabilitiesType ) { capabilitiesType = buildCapabilitiesType ( ) ; if ( ( request . getAcceptVersions ( ) ) != null ) { validateVersion ( request . getAcceptVersions ( ) . toString ( ) ) ; } java . util . List < java . lang . String > sectionList = null ; if ( ( request . getSections ( ) ) != null ) { sectionList = request . getSections ( ) . getSection ( ) ; } return buildCapabilitiesType ( sectionList ) ; } | org . junit . Assert . assertNotNull ( ct ) |
testHashCodeWithTheSameId ( ) { import1 . setId ( new org . kie . workbench . common . dmn . api . property . dmn . Id ( "123" ) ) ; import2 . setId ( new org . kie . workbench . common . dmn . api . property . dmn . Id ( "123" ) ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return org . kie . workbench . common . stunner . core . util . HashUtil . combineHashCodes ( ( ( id ) != null ? id . hashCode ( ) : 0 ) , ( ( description ) != null ? description . hashCode ( ) : 0 ) , ( ( text ) != null ? text . hashCode ( ) : 0 ) , ( ( expressionLanguage ) != null ? expressionLanguage . hashCode ( ) : 0 ) ) ; } | org . junit . Assert . assertEquals ( import1 . hashCode ( ) , import2 . hashCode ( ) ) |
testCanValidate ( ) { java . lang . String orders = org . apache . commons . io . FileUtils . readFileToString ( new java . io . File ( "src/test/resources/orders.xml" ) ) ; muleContext . getClient ( ) . dispatch ( "http://localhost:8080/orders" , orders , null ) ; org . mule . api . MuleMessage result = muleContext . getClient ( ) . request ( "jms://topic:orders.submitted" , 15000 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( result ) |
testUpdateNotificationRegistrationStatusAssertUpdateSuccessTrim ( ) { org . finra . herd . model . api . xml . NotificationRegistrationKey notificationRegistrationKey = new org . finra . herd . model . api . xml . NotificationRegistrationKey ( NAMESPACE , NOTIFICATION_NAME ) ; notificationRegistrationDaoTestHelper . createBusinessObjectDataNotificationRegistrationEntity ( notificationRegistrationKey , NotificationEventTypeEntity . EventTypesBdata . BUS_OBJCT_DATA_STTS_CHG . name ( ) , org . finra . herd . service . NAMESPACE , org . finra . herd . service . BDEF_NAME , org . finra . herd . service . FORMAT_USAGE_CODE , org . finra . herd . service . FORMAT_FILE_TYPE_CODE , org . finra . herd . service . FORMAT_VERSION , org . finra . herd . service . STORAGE_NAME , org . finra . herd . service . BDATA_STATUS , org . finra . herd . service . BDATA_STATUS , notificationRegistrationDaoTestHelper . getTestJobActions ( ) , NotificationRegistrationStatusEntity . ENABLED ) ; org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateResponse response = notificationRegistrationStatusService . updateNotificationRegistrationStatus ( addWhitespace ( org . finra . herd . service . NAMESPACE ) , addWhitespace ( org . finra . herd . service . NOTIFICATION_NAME ) , new org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateRequest ( addWhitespace ( NotificationRegistrationStatusEntity . DISABLED ) ) ) ; "<AssertPlaceHolder>" ; } addWhitespace ( java . lang . String ) { return java . lang . String . format ( "<sp>%s<sp>" , string ) ; } | org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . NotificationRegistrationStatusUpdateResponse ( notificationRegistrationKey , org . finra . herd . model . jpa . NotificationRegistrationStatusEntity . DISABLED ) , response ) |
should_return_this_if_actual_is_equal_to_expected ( ) { org . fest . assertions . api . BigDecimalAssert returned = assertions . isEqualTo ( actual ) ; "<AssertPlaceHolder>" ; } isEqualTo ( byte ) { bytes . assertEqualTo ( description , actual , expected ) ; return this ; } | org . junit . Assert . assertSame ( returned , assertions ) |
testSpecialCharactersDE ( ) { org . opencastproject . dictionary . regexp . DictionaryServiceImpl service = new org . opencastproject . dictionary . regexp . DictionaryServiceImpl ( ) ; java . lang . String in = "Zwlf<sp>Boxkmpfer<sp>jagten<sp>Victor<sp>quer<sp>ber<sp>den<sp>groen<sp>Sylter<sp>Deich." ; service . setPattern ( "[\\wßäöüÄÖÜ,.!]+" ) ; "<AssertPlaceHolder>" ; } cleanUpText ( java . lang . String ) { org . opencastproject . dictionary . regexp . DictionaryServiceImpl . logger . debug ( "Text<sp>input:<sp>{}" , text ) ; java . util . LinkedList < java . lang . String > words = new java . util . LinkedList < java . lang . String > ( ) ; java . util . regex . Matcher matcher = compilesPattern . matcher ( text ) ; while ( matcher . find ( ) ) { words . add ( matcher . group ( ) ) ; } java . lang . String result = org . apache . commons . lang3 . StringUtils . join ( words , "<sp>" ) ; org . opencastproject . dictionary . regexp . DictionaryServiceImpl . logger . debug ( "Resulting<sp>text:<sp>{}" , result ) ; if ( "" . equals ( result ) ) { return null ; } return new org . opencastproject . metadata . mpeg7 . TextualImpl ( result ) ; } | org . junit . Assert . assertEquals ( in , service . cleanUpText ( in ) . getText ( ) ) |
testDecodeStopAt0 ( ) { byte [ ] encoded = new byte [ ] { 1 , 31 , 26 , 1 , 76 , 0 , 2 , 21 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 18 , 0 , 5 , 0 , 2 , 50 , 0 , 0 } ; org . eclipse . kura . internal . ble . ibeacon . BluetoothLeIBeaconDecoderImpl decoder = new org . eclipse . kura . internal . ble . ibeacon . BluetoothLeIBeaconDecoderImpl ( ) ; org . eclipse . kura . ble . ibeacon . BluetoothLeIBeacon decoded = decoder . decode ( encoded ) ; "<AssertPlaceHolder>" ; } decode ( byte [ ] ) { return org . eclipse . kura . internal . ble . eddystone . BluetoothLeEddystoneDecoderImpl . parseEIRData ( reportData ) ; } | org . junit . Assert . assertNull ( decoded ) |
createRandom ( ) { com . zsmartsystems . zigbee . ExtendedPanId pan1 = com . zsmartsystems . zigbee . ExtendedPanId . createRandom ( ) ; com . zsmartsystems . zigbee . ExtendedPanId pan2 = com . zsmartsystems . zigbee . ExtendedPanId . createRandom ( ) ; "<AssertPlaceHolder>" ; } createRandom ( ) { com . zsmartsystems . zigbee . ExtendedPanId pan1 = com . zsmartsystems . zigbee . ExtendedPanId . createRandom ( ) ; com . zsmartsystems . zigbee . ExtendedPanId pan2 = com . zsmartsystems . zigbee . ExtendedPanId . createRandom ( ) ; org . junit . Assert . assertNotEquals ( pan1 , pan2 ) ; } | org . junit . Assert . assertNotEquals ( pan1 , pan2 ) |
testSearchWithIncludesStarNoRecurse ( ) { java . lang . String methodName = "testSearchWithIncludes" ; org . hl7 . fhir . instance . model . api . IIdType parentParentOrgId ; { ca . uhn . fhir . jpa . dao . dstu2 . Organization org = new ca . uhn . fhir . jpa . dao . dstu2 . Organization ( ) ; org . getNameElement ( ) . setValue ( ( methodName + "_O1Parent" ) ) ; parentParentOrgId = myOrganizationDao . create ( org , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } org . hl7 . fhir . instance . model . api . IIdType parentOrgId ; { ca . uhn . fhir . jpa . dao . dstu2 . Organization org = new ca . uhn . fhir . jpa . dao . dstu2 . Organization ( ) ; org . getNameElement ( ) . setValue ( ( methodName + "_O1Parent" ) ) ; org . setPartOf ( new ca . uhn . fhir . jpa . dao . dstu2 . ResourceReferenceDt ( parentParentOrgId ) ) ; parentOrgId = myOrganizationDao . create ( org , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } org . hl7 . fhir . instance . model . api . IIdType orgId ; { ca . uhn . fhir . jpa . dao . dstu2 . Organization org = new ca . uhn . fhir . jpa . dao . dstu2 . Organization ( ) ; org . getNameElement ( ) . setValue ( ( methodName + "_O1" ) ) ; org . setPartOf ( new ca . uhn . fhir . jpa . dao . dstu2 . ResourceReferenceDt ( parentOrgId ) ) ; orgId = myOrganizationDao . create ( org , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } org . hl7 . fhir . instance . model . api . IIdType patientId ; { ca . uhn . fhir . jpa . dao . dstu2 . Patient patient = new ca . uhn . fhir . jpa . dao . dstu2 . Patient ( ) ; patient . addIdentifier ( ) . setSystem ( "urn:system" ) . setValue ( "001" ) ; patient . addName ( ) . addFamily ( ( ( "Tester_" + methodName ) + "_P1" ) ) . addGiven ( "Joe" ) ; patient . getManagingOrganization ( ) . setReference ( orgId ) ; patientId = myPatientDao . create ( patient , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; } { ca . uhn . fhir . jpa . searchparam . SearchParameterMap params = new ca . uhn . fhir . jpa . searchparam . SearchParameterMap ( ) ; params . add ( Patient . SP_FAMILY , new ca . uhn . fhir . jpa . dao . dstu2 . StringDt ( ( ( "Tester_" + methodName ) + "_P1" ) ) ) ; params . addInclude ( new ca . uhn . fhir . jpa . dao . dstu2 . Include ( "*" ) . asNonRecursive ( ) ) ; java . util . List < org . hl7 . fhir . instance . model . api . IIdType > resources = toUnqualifiedVersionlessIds ( myPatientDao . search ( params ) ) ; "<AssertPlaceHolder>" ; } } search ( ca . uhn . fhir . rest . param . StringParam ) { final ca . uhn . fhir . jaxrs . server . example . List < ca . uhn . fhir . jaxrs . server . example . Patient > result = new ca . uhn . fhir . jaxrs . server . example . LinkedList < ca . uhn . fhir . jaxrs . server . example . Patient > ( ) ; for ( final ca . uhn . fhir . jaxrs . server . example . List < ca . uhn . fhir . jaxrs . server . example . Patient > patientIterator : ca . uhn . fhir . jaxrs . server . example . JaxRsPatientRestProviderDstu3 . patients . values ( ) ) { ca . uhn . fhir . jaxrs . server . example . Patient single = null ; for ( ca . uhn . fhir . jaxrs . server . example . Patient patient : patientIterator ) { if ( ( name == null ) || ( patient . getName ( ) . get ( 0 ) . getFamilyElement ( ) . getValueNotNull ( ) . equals ( name . getValueNotNull ( ) ) ) ) { single = patient ; } } if ( single != null ) { result . add ( single ) ; } } return result ; } | org . junit . Assert . assertThat ( resources , contains ( patientId , orgId ) ) |
testIsCachedRes ( ) { System . out . println ( "Testing<sp>CKANCache.isCachedRes" ) ; cache . setTree ( tree ) ; try { "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } isCachedRes ( java . lang . String , java . lang . String , java . lang . String ) { if ( tree . get ( orgName ) . get ( pkgName ) . contains ( resName ) ) { com . telefonica . iot . cygnus . backends . ckan . CKANCache . LOGGER . debug ( ( ( ( ( ( ( "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 3 + orgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 6 ) + pkgName ) + ",<sp>resName=" ) + resName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 8 ) ) ; return true ; } com . telefonica . iot . cygnus . backends . ckan . CKANCache . LOGGER . debug ( ( ( ( ( ( ( ( "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 4 + "(orgName=" ) + orgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 6 ) + pkgName ) + ",<sp>resName=" ) + resName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 8 ) ) ; java . lang . String ckanURL = "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 7 + pkgName ; java . util . ArrayList < org . apache . http . Header > headers = new java . util . ArrayList ( ) ; headers . add ( new org . apache . http . message . BasicHeader ( "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 1 , apiKey ) ) ; com . telefonica . iot . cygnus . backends . http . JsonResponse res = doRequest ( "GET" , ckanURL , true , headers , null ) ; switch ( res . getStatusCode ( ) ) { case 200 : com . telefonica . iot . cygnus . backends . ckan . CKANCache . LOGGER . debug ( ( ( ( ( "Package<sp>found<sp>in<sp>CKAN,<sp>going<sp>to<sp>update<sp>the<sp>cached<sp>resources<sp>(orgName=" + orgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 6 ) + pkgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 8 ) ) ; org . json . simple . JSONObject result = ( ( org . json . simple . JSONObject ) ( res . getJsonObject ( ) . get ( "result" ) ) ) ; org . json . simple . JSONArray resources = ( ( org . json . simple . JSONArray ) ( result . get ( "resources" ) ) ) ; if ( resources . isEmpty ( ) ) { return false ; } else { com . telefonica . iot . cygnus . backends . ckan . CKANCache . LOGGER . debug ( ( ( ( ( "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 5 + orgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 6 ) + pkgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 8 ) ) ; populateResourcesMap ( resources , orgName , pkgName , true ) ; if ( tree . get ( orgName ) . get ( pkgName ) . contains ( resName ) ) { com . telefonica . iot . cygnus . backends . ckan . CKANCache . LOGGER . debug ( ( ( ( ( ( ( ( "Resource<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" + "(orgName=" ) + orgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 6 ) + pkgName ) + ",<sp>resName=" ) + resName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 8 ) ) ; return true ; } else { com . telefonica . iot . cygnus . backends . ckan . CKANCache . LOGGER . debug ( ( ( ( ( ( ( ( "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" + "(orgName=" ) + orgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 6 ) + pkgName ) + ",<sp>resName=" ) + resName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 8 ) ) ; return false ; } } case 404 : return false ; default : throw new com . telefonica . iot . cygnus . errors . CygnusPersistenceError ( ( ( ( ( ( ( ( ( ( "Could<sp>not<sp>check<sp>if<sp>the<sp>resource<sp>exists<sp>(" + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 0 ) + orgName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 6 ) + pkgName ) + ",<sp>resName=" ) + resName ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 2 ) + ( res . getStatusCode ( ) ) ) + "Resource<sp>not<sp>found<sp>in<sp>the<sp>cache,<sp>once<sp>queried<sp>CKAN<sp>" 8 ) ) ; } | org . junit . Assert . assertTrue ( cache . isCachedRes ( orgName , pkgName , resName ) ) |
testIsIncludeRiskLevels ( ) { System . out . println ( "isIncludeRiskLevels" ) ; mudmap2 . backend . legend . Legend instance = new mudmap2 . backend . legend . Legend ( layer , Legend . Orientation . HORIZONTAL , 500 ) ; "<AssertPlaceHolder>" ; } isIncludeRiskLevels ( ) { return includeRiskLevels ; } | org . junit . Assert . assertFalse ( instance . isIncludeRiskLevels ( ) ) |
testString ( ) { java . lang . String original = new java . lang . String ( "Hello<sp>World" ) ; com . google . gson . JsonElement element = pt . ist . fenixframework . util . JsonConverter . getJsonFor ( original ) ; System . out . println ( ( "String:<sp>" + ( element . toString ( ) ) ) ) ; java . lang . String other = pt . ist . fenixframework . util . JsonConverter . getStringFromJson ( element ) ; "<AssertPlaceHolder>" ; } getStringFromJson ( com . google . gson . JsonElement ) { if ( value . isJsonNull ( ) ) { return null ; } return value . getAsString ( ) ; } | org . junit . Assert . assertEquals ( original , other ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.