input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testUnqualifiedClassName ( ) { java . lang . String expected = "com.jakewharton.test.SomeClass" ; java . lang . String actual = com . actionbarsherlock . internal . ActionBarSherlockCompat . cleanActivityName ( "com.jakewharton.test" , "SomeClass" ) ; "<AssertPlaceHolder>" ; } cleanActivityName ( java . lang . String , java . lang . String ) { if ( ( activityName . charAt ( 0 ) ) == '.' ) { return manifestPackage + activityName ; } if ( ( activityName . indexOf ( '.' , 1 ) ) == ( - 1 ) ) { return ( manifestPackage + "." ) + activityName ; } return activityName ; }
org . junit . Assert . assertThat ( expected , org . hamcrest . CoreMatchers . equalTo ( actual ) )
givenAnIntStreamThenGetTheEvenIntegers ( ) { java . util . List < java . lang . Integer > evenInts = java . util . stream . IntStream . rangeClosed ( 1 , 10 ) . filter ( ( i ) -> ( i % 2 ) == 0 ) . boxed ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . List < java . lang . Integer > expected = java . util . stream . IntStream . of ( 2 , 4 , 6 , 8 , 10 ) . boxed ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } filter ( javax . ws . rs . container . ContainerRequestContext ) { com . baeldung . jersey . server . filter . RestrictedOperationsRequestFilter . LOG . info ( "Restricted<sp>operations<sp>filter" ) ; if ( ( ( ctx . getLanguage ( ) ) != null ) && ( "EN" . equals ( ctx . getLanguage ( ) . getLanguage ( ) ) ) ) { com . baeldung . jersey . server . filter . RestrictedOperationsRequestFilter . LOG . info ( "Aborting<sp>request" ) ; ctx . abortWith ( javax . ws . rs . core . Response . status ( Response . Status . FORBIDDEN ) . entity ( "Cannot<sp>access" ) . build ( ) ) ; } }
org . junit . Assert . assertEquals ( expected , evenInts )
shouldInstrumentES6MemberFunction ( ) { java . lang . String source = "var<sp>x<sp>=<sp>{\n" + ( ( ( "<sp>mounted<sp>()<sp>{\n" + "};" 0 ) + "<sp>}\n" ) + "};" ) ; java . lang . String instrumentedSource = sourceProcessor . instrumentSource ( source ) ; java . lang . String expectedSource = "_$jscoverage[\'test.js\'].lineData[1]++;\n" + ( ( ( ( "var<sp>x<sp>=<sp>{mounted()<sp>{\n" + "<sp>_$jscoverage[\'test.js\'].functionData[0]++;\n" ) + "<sp>_$jscoverage[\'test.js\'].lineData[3]++;\n" ) + "<sp>this.onReady();\n" ) + "}};\n" ) ; "<AssertPlaceHolder>" ; } instrumentSource ( java . lang . String ) { return instrumentSource ( uri , source ) ; }
org . junit . Assert . assertEquals ( expectedSource , instrumentedSource )
shouldNotAllowNegativeBlackMana ( ) { mage . Mana mana = mage . Mana . BlackMana ( ( - 1 ) ) ; "<AssertPlaceHolder>" ; } getBlack ( ) { return black ; }
org . junit . Assert . assertEquals ( 0 , mana . getBlack ( ) )
testReplicationStoreMaxCommandsToTransferBeforeCreateRdb ( ) { com . ctrip . xpipe . redis . keeper . config . KeeperConfig keeperConfig = new com . ctrip . xpipe . redis . keeper . config . DefaultKeeperConfig ( ) ; long value = 10L * ( 1 << 30 ) ; java . lang . System . setProperty ( DefaultKeeperConfig . KEY_REPLICATION_STORE_MAX_COMMANDS_TO_TRANSFER_BEFORE_CREATE_RDB , java . lang . String . valueOf ( value ) ) ; logger . info ( "[testReplicationStoreMaxCommandsToTransferBeforeCreateRdb]{}" , value ) ; "<AssertPlaceHolder>" ; } getReplicationStoreMaxCommandsToTransferBeforeCreateRdb ( ) { return getLongProperty ( com . ctrip . xpipe . redis . keeper . config . DefaultKeeperConfig . KEY_REPLICATION_STORE_MAX_COMMANDS_TO_TRANSFER_BEFORE_CREATE_RDB , 100L ) ; }
org . junit . Assert . assertEquals ( value , keeperConfig . getReplicationStoreMaxCommandsToTransferBeforeCreateRdb ( ) )
testOneFieldMatchesNot ( ) { japicmp . filter . JavadocLikeFieldFilter fieldFilter = new japicmp . filter . JavadocLikeFieldFilter ( "japicmp.Test#field42" ) ; javassist . CtClass ctClass = japicmp . util . CtClassBuilder . create ( ) . name ( "japicmp.Test" ) . addToClassPool ( new javassist . ClassPool ( ) ) ; javassist . CtField ctField = japicmp . util . CtFieldBuilder . create ( ) . name ( "field" ) . addToClass ( ctClass ) ; "<AssertPlaceHolder>" ; } matches ( javassist . CtClass ) { java . lang . String name = ctClass . getName ( ) ; return pattern . matcher ( name ) . matches ( ) ; }
org . junit . Assert . assertThat ( fieldFilter . matches ( ctField ) , org . hamcrest . core . Is . is ( false ) )
testTransform ( ) { "<AssertPlaceHolder>" ; } transform ( java . lang . String ) { java . util . Date date = null ; if ( ( input != null ) && ( ! ( input . trim ( ) . isEmpty ( ) ) ) ) { if ( ( format ) == null ) { for ( java . lang . String fmt : io . lumify . mapping . xform . DateValueTransformer . DEFAULT_DATE_FORMATS ) { try { date = new java . text . SimpleDateFormat ( fmt ) . parse ( input ) ; break ; } catch ( java . text . ParseException pe ) { date = null ; } } } else { try { date = new java . text . SimpleDateFormat ( format ) . parse ( input ) ; } catch ( java . text . ParseException pe ) { date = null ; } } } return date != null ? date . getTime ( ) : null ; }
org . junit . Assert . assertEquals ( expected , xform . transform ( input ) )
testIsCompatible6 ( ) { com . milaboratory . mixcr . basictypes . ClonalSequence c1 = create ( "AAAA" , "AAA" ) ; com . milaboratory . mixcr . basictypes . ClonalSequence c2 = create ( "AA" , "AAAAA" ) ; com . milaboratory . core . mutations . Mutations < com . milaboratory . core . sequence . NucleotideSequence > mutations = com . milaboratory . core . mutations . Mutations . decode ( "DA0I3A" , NucleotideSequence . ALPHABET ) ; "<AssertPlaceHolder>" ; } isCompatible ( com . milaboratory . mixcr . basictypes . ClonalSequence , com . milaboratory . core . mutations . Mutations ) { return isCompatible ( 0 , other , mutations , 0 ) ; }
org . junit . Assert . assertTrue ( c1 . isCompatible ( c2 , mutations ) )
testEquals ( ) { com . verigreen . common . utils . TestReflectionComparer . Sample x = new com . verigreen . common . utils . TestReflectionComparer . Sample ( 1 , "a1" ) ; com . verigreen . common . utils . TestReflectionComparer . Sample y = new com . verigreen . common . utils . TestReflectionComparer . Sample ( 1 , "a2" ) ; "<AssertPlaceHolder>" ; } isEquals ( T , T ) { boolean ret = true ; java . lang . reflect . Method [ ] xMethods = x . getClass ( ) . getMethods ( ) ; for ( java . lang . reflect . Method currXMethod : xMethods ) { java . lang . String currXMethodName = currXMethod . getName ( ) ; if ( currXMethodName . startsWith ( "get" ) ) { try { java . lang . Object currXVal = currXMethod . invoke ( x ) ; java . lang . reflect . Method currYMethod = y . getClass ( ) . getMethod ( currXMethodName ) ; java . lang . Object currYMethodVal = currYMethod . invoke ( y ) ; if ( ! ( com . verigreen . common . utils . ReflectionComparer . isObjEquals ( currXVal , currYMethodVal ) ) ) { ret = false ; break ; } } catch ( java . lang . Throwable thrown ) { throw new com . verigreen . common . exception . LabException ( thrown ) ; } } } return ret ; }
org . junit . Assert . assertTrue ( com . verigreen . common . utils . ReflectionComparer . isEquals ( x , y ) )
testCreateBusinessObjectDataNotificationRegistrationTrimParameters ( ) { notificationRegistrationServiceTestHelper . createDatabaseEntitiesForBusinessObjectDataNotificationRegistrationTesting ( ) ; org . finra . herd . model . api . xml . BusinessObjectDataNotificationRegistration resultBusinessObjectDataNotificationRegistration = businessObjectDataNotificationRegistrationService . createBusinessObjectDataNotificationRegistration ( new org . finra . herd . model . api . xml . BusinessObjectDataNotificationRegistrationCreateRequest ( new org . finra . herd . model . api . xml . NotificationRegistrationKey ( addWhitespace ( org . finra . herd . service . NAMESPACE ) , addWhitespace ( org . finra . herd . service . NOTIFICATION_NAME ) ) , addWhitespace ( NotificationEventTypeEntity . EventTypesBdata . BUS_OBJCT_DATA_STTS_CHG . name ( ) ) , new org . finra . herd . model . api . xml . BusinessObjectDataNotificationFilter ( addWhitespace ( org . finra . herd . service . BDEF_NAMESPACE ) , addWhitespace ( org . finra . herd . service . BDEF_NAME ) , addWhitespace ( org . finra . herd . service . FORMAT_USAGE_CODE ) , addWhitespace ( org . finra . herd . service . FORMAT_FILE_TYPE_CODE ) , FORMAT_VERSION , addWhitespace ( org . finra . herd . service . STORAGE_NAME ) , addWhitespace ( org . finra . herd . service . BDATA_STATUS ) , addWhitespace ( org . finra . herd . service . BDATA_STATUS_2 ) ) , java . util . Arrays . asList ( new org . finra . herd . model . api . xml . JobAction ( addWhitespace ( org . finra . herd . service . JOB_NAMESPACE ) , addWhitespace ( org . finra . herd . service . JOB_NAME ) , addWhitespace ( org . finra . herd . service . CORRELATION_DATA ) ) ) , addWhitespace ( NotificationRegistrationStatusEntity . ENABLED ) ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . BusinessObjectDataNotificationRegistration ( resultBusinessObjectDataNotificationRegistration . getId ( ) , new org . finra . herd . model . api . xml . NotificationRegistrationKey ( NAMESPACE , NOTIFICATION_NAME ) , NotificationEventTypeEntity . EventTypesBdata . BUS_OBJCT_DATA_STTS_CHG . name ( ) , new org . finra . herd . model . api . xml . BusinessObjectDataNotificationFilter ( BDEF_NAMESPACE , BDEF_NAME , FORMAT_USAGE_CODE , FORMAT_FILE_TYPE_CODE , FORMAT_VERSION , STORAGE_NAME , BDATA_STATUS , BDATA_STATUS_2 ) , java . util . Arrays . asList ( new org . finra . herd . model . api . xml . JobAction ( JOB_NAMESPACE , JOB_NAME , addWhitespace ( org . finra . herd . service . CORRELATION_DATA ) ) ) , org . finra . herd . model . jpa . NotificationRegistrationStatusEntity . ENABLED ) , resultBusinessObjectDataNotificationRegistration )
testIterator ( ) { final int cap = 100 ; final java . util . concurrent . BlockingQueue < java . lang . Integer > dbq = new com . conversantmedia . util . concurrent . DisruptorBlockingQueue < java . lang . Integer > ( cap ) ; for ( int i = 0 ; i < cap ; i ++ ) { dbq . offer ( java . lang . Integer . valueOf ( i ) ) ; } int i = 0 ; for ( final java . lang . Integer c : dbq ) { "<AssertPlaceHolder>" ; } } offer ( E ) { if ( super . offer ( e ) ) { queueNotEmptyCondition . signal ( ) ; return true ; } else { queueNotEmptyCondition . signal ( ) ; return false ; } }
org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( ( i ++ ) ) , c )
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . portal . kernel . model . Layout missingLayout = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
org . junit . Assert . assertNull ( missingLayout )
testMappingAerospikeConverter ( ) { org . springframework . data . aerospike . convert . MappingAerospikeConverter mappingAerospikeConverter = new org . springframework . data . aerospike . convert . MappingAerospikeConverter ( new org . springframework . data . aerospike . convert . AerospikeMappingContext ( ) , customConversions , aerospikeTypeAliasAccessor ) ; "<AssertPlaceHolder>" ; } getConversionService ( ) { return conversionService ; }
org . junit . Assert . assertNotNull ( mappingAerospikeConverter . getConversionService ( ) )
testRegister_component_zookeeper_connect_notPresent ( ) { com . hortonworks . streamline . streams . cluster . catalog . Cluster cluster = getTestCluster ( 1L ) ; com . hortonworks . streamline . streams . cluster . register . impl . KafkaServiceRegistrar registrar = initializeServiceRegistrar ( ) ; try { com . hortonworks . streamline . common . Config config = new com . hortonworks . streamline . common . Config ( ) ; config . put ( KafkaServiceRegistrar . PARAM_LISTENERS , "PLAINTEXT://kafka-1:9092" ) ; config . put ( KafkaServiceRegistrar . PARAM_SECURITY_INTER_BROKER_PROTOCOL , "SSL" ) ; registrar . register ( cluster , config , java . util . Collections . emptyList ( ) ) ; org . junit . Assert . fail ( "Should<sp>throw<sp>IllegalArgumentException" ) ; } catch ( java . lang . IllegalArgumentException e ) { com . hortonworks . streamline . streams . cluster . catalog . Service kafkaService = environmentService . getServiceByName ( cluster . getId ( ) , Constants . Kafka . SERVICE_NAME ) ; "<AssertPlaceHolder>" ; } } getId ( ) { return id ; }
org . junit . Assert . assertNull ( kafkaService )
testFirstToken ( ) { org . antlr . v4 . tool . LexerGrammar g = new org . antlr . v4 . tool . LexerGrammar ( ( "lexer<sp>grammar<sp>t;\n" + ( ( ( ( ( ( "ID<sp>:<sp>\'a\'..\'z\'+;\n" + "INT<sp>:<sp>\'0\'..\'9\'+;\n" ) + "SEMI<sp>:<sp>\';\';\n" ) + "ASSIGN<sp>:<sp>\'=\';\n" ) + "PLUS<sp>:<sp>\'+\';\n" ) + "MULT<sp>:<sp>\'*\';\n" ) + "WS<sp>:<sp>\'<sp>\'+;\n" ) ) ) ; org . antlr . v4 . runtime . CharStream input = new org . antlr . v4 . runtime . ANTLRInputStream ( "x<sp>=<sp>3<sp>*<sp>0<sp>+<sp>2<sp>*<sp>0;" ) ; org . antlr . v4 . runtime . LexerInterpreter lexEngine = g . createLexerInterpreter ( input ) ; org . antlr . v4 . runtime . TokenStream tokens = createTokenStream ( lexEngine ) ; java . lang . String result = tokens . LT ( 1 ) . getText ( ) ; java . lang . String expecting = "x" ; "<AssertPlaceHolder>" ; } getText ( ) { if ( ( symbol ) != null ) { return symbol . getText ( ) ; } return null ; }
org . junit . Assert . assertEquals ( expecting , result )
testAlignRtRowAttrsTrailingNulls1 ( ) { org . batfish . question . routes . RouteRowAttribute rra1 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node1" ) . build ( ) ; org . batfish . question . routes . RouteRowAttribute rra2 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node2" ) . build ( ) ; org . batfish . question . routes . RouteRowAttribute rra3 = org . batfish . question . routes . RouteRowAttribute . builder ( ) . setNextHop ( "node3" ) . build ( ) ; java . util . List < java . util . List < org . batfish . question . routes . RouteRowAttribute > > alignedRouteRowattrs = org . batfish . question . routes . RoutesAnswererUtil . alignRouteRowAttributes ( com . google . common . collect . ImmutableList . of ( rra1 , rra2 , rra3 ) , com . google . common . collect . ImmutableList . of ( rra1 ) ) ; java . util . List < java . util . List < org . batfish . question . routes . RouteRowAttribute > > expectedOutput = com . google . common . collect . ImmutableList . of ( com . google . common . collect . Lists . newArrayList ( rra1 , rra1 ) , com . google . common . collect . Lists . newArrayList ( rra2 , null ) , com . google . common . collect . Lists . newArrayList ( rra3 , null ) ) ; "<AssertPlaceHolder>" ; } of ( int ) { return org . batfish . datamodel . IntegerSpace . builder ( ) . including ( com . google . common . collect . Range . singleton ( value ) ) . build ( ) ; }
org . junit . Assert . assertThat ( alignedRouteRowattrs , org . hamcrest . Matchers . equalTo ( expectedOutput ) )
deveObterDataHoraEventoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . evento . cancelamento . NFInfoEventoCancelamento infoEventoCancelamento = new com . fincatto . documentofiscal . nfe310 . classes . evento . cancelamento . NFInfoEventoCancelamento ( ) ; final java . time . ZonedDateTime dataHoraEvento = java . time . ZonedDateTime . of ( java . time . LocalDateTime . from ( java . time . format . DateTimeFormatter . ofPattern ( "yyyy-MM-dd<sp>HH:mm:ss" ) . parse ( "2010-10-10<sp>10:10:10" ) ) , java . time . ZoneId . systemDefault ( ) ) ; infoEventoCancelamento . setDataHoraEvento ( dataHoraEvento ) ; "<AssertPlaceHolder>" ; } getDataHoraEvento ( ) { return this . dataHoraEvento ; }
org . junit . Assert . assertEquals ( dataHoraEvento , infoEventoCancelamento . getDataHoraEvento ( ) )
testSubmitAuditableFutureTaskSetsInstantStopped ( ) { edu . illinois . library . cantaloupe . async . MockCallable < ? > task = new edu . illinois . library . cantaloupe . async . MockCallable ( ) ; edu . illinois . library . cantaloupe . async . AuditableFutureTask < ? > future = new edu . illinois . library . cantaloupe . async . AuditableFutureTask ( task ) ; instance . submit ( future ) ; java . lang . Thread . sleep ( 150 ) ; "<AssertPlaceHolder>" ; } getInstantStopped ( ) { return dateStopped ; }
org . junit . Assert . assertNotNull ( future . getInstantStopped ( ) )
testFindFirstWithoutTypeMatch ( ) { final com . allanbank . mongodb . bson . element . BinaryElement element = new com . allanbank . mongodb . bson . element . BinaryElement ( "foo" , ( ( byte ) ( 1 ) ) , new byte [ ] { 1 , 2 , 3 } ) ; final com . allanbank . mongodb . bson . Element found = element . findFirst ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertSame ( element , found )
getValueFromJsonString_good_case ( ) { java . lang . String jsonString = "{\"deviceId\":\"xxx-device\",\"generationId\":\"111111111111111111\",\"etag\":\"MA==\",\"connectionState\":\"Disconnected\",\"status\":\"Disabled\",\"statusReason\":null,\"connectionStateUpdatedTime\":\"0001-01-01T00:00:00\",\"statusUpdatedTime\":\"0001-01-01T00:00:00\",\"lastActivityTime\":\"0001-01-01T00:00:00\",\"cloudToDeviceMessageCount\":0,\"authentication\":{\"symmetricKey\":{\"primaryKey\":\"AAABBBCCC111222333444000\",\"secondaryKey\":\"111222333444555AAABBBCCC\"}}}" ; java . io . StringReader stringReader = new java . io . StringReader ( jsonString ) ; javax . json . JsonReader jsonReader = javax . json . Json . createReader ( stringReader ) ; javax . json . JsonObject jsonObject = jsonReader . readObject ( ) ; java . lang . String key = "generationId" ; javax . json . JsonString jsonStringObject = jsonObject . getJsonString ( key ) ; java . lang . String expResult = "111111111111111111" ; java . lang . String result = com . microsoft . azure . sdk . iot . provisioning . service . Tools . getValueFromJsonString ( jsonStringObject ) ; "<AssertPlaceHolder>" ; } getValueFromJsonString ( javax . json . JsonString ) { java . lang . String retVal ; if ( jsonString == null ) { retVal = "" ; } else { retVal = jsonString . toString ( ) ; if ( retVal . startsWith ( "\"" ) ) { retVal = retVal . replaceFirst ( "\"" , "" ) ; } if ( retVal . endsWith ( "\"" ) ) { retVal = retVal . substring ( 0 , ( ( retVal . length ( ) ) - 1 ) ) ; } } return retVal ; }
org . junit . Assert . assertEquals ( expResult , result )
testInterpolation2 ( ) { final int sz = 21 ; double [ ] xval = new double [ sz ] ; double [ ] yval = new double [ sz ] ; final double delta = 1.0 / ( sz - 1 ) ; for ( int i = 0 ; i < sz ; i ++ ) { xval [ i ] = ( - 1 ) + ( ( 15 * i ) * delta ) ; yval [ i ] = ( - 20 ) + ( ( 30 * i ) * delta ) ; } org . apache . commons . math3 . analysis . BivariateFunction f = new org . apache . commons . math3 . analysis . BivariateFunction ( ) { public double value ( double x , double y ) { return ( ( ( ( 2 * x ) * x ) - ( ( 3 * y ) * y ) ) + ( ( 4 * x ) * y ) ) - 5 ; } } ; double [ ] [ ] zval = new double [ xval . length ] [ yval . length ] ; for ( int i = 0 ; i < ( xval . length ) ; i ++ ) { for ( int j = 0 ; j < ( yval . length ) ; j ++ ) { zval [ i ] [ j ] = f . value ( xval [ i ] , yval [ j ] ) ; } } org . apache . commons . math3 . analysis . interpolation . BivariateGridInterpolator interpolator = new org . apache . commons . math3 . analysis . interpolation . BicubicSplineInterpolator ( ) ; org . apache . commons . math3 . analysis . BivariateFunction p = interpolator . interpolate ( xval , yval , zval ) ; double x ; double y ; final org . apache . commons . math3 . random . RandomGenerator rng = new org . apache . commons . math3 . random . Well19937c ( 1234567L ) ; final org . apache . commons . math3 . distribution . UniformRealDistribution distX = new org . apache . commons . math3 . distribution . UniformRealDistribution ( rng , xval [ 0 ] , xval [ ( ( xval . length ) - 1 ) ] ) ; final org . apache . commons . math3 . distribution . UniformRealDistribution distY = new org . apache . commons . math3 . distribution . UniformRealDistribution ( rng , yval [ 0 ] , yval [ ( ( yval . length ) - 1 ) ] ) ; final int numSamples = 50 ; final double tol = 251 ; for ( int i = 0 ; i < numSamples ; i ++ ) { x = distX . sample ( ) ; for ( int j = 0 ; j < numSamples ; j ++ ) { y = distY . sample ( ) ; "<AssertPlaceHolder>" ; } } } value ( double , double [ ] ) { validateParameters ( parameters ) ; final double a = parameters [ 0 ] ; final double b = parameters [ 1 ] ; final double c = parameters [ 2 ] ; final double d = parameters [ 3 ] ; final double xMc = x - c ; return a + ( b * ( java . lang . Math . exp ( ( ( ( - xMc ) * xMc ) / ( 2.0 * ( d * d ) ) ) ) ) ) ; }
org . junit . Assert . assertEquals ( f . value ( x , y ) , p . value ( x , y ) , tol )
pasteWithDisabled ( ) { openTestURL ( ) ; com . vaadin . testbench . elements . ComboBoxElement cb = $ ( com . vaadin . testbench . elements . ComboBoxElement . class ) . first ( ) ; cb . click ( ) ; org . openqa . selenium . WebElement input = cb . getInputField ( ) ; org . openqa . selenium . JavascriptExecutor js = ( ( org . openqa . selenium . JavascriptExecutor ) ( getDriver ( ) ) ) ; js . executeScript ( "arguments[0].removeAttribute('disabled')" , input ) ; java . lang . String os = java . lang . System . getProperty ( "os.name" ) . toLowerCase ( ) ; java . lang . String paste ; if ( os . contains ( "windows" ) ) { paste = org . openqa . selenium . Keys . chord ( Keys . CONTROL , "v" ) ; } else if ( os . contains ( "linux" ) ) { paste = org . openqa . selenium . Keys . chord ( Keys . CONTROL , Keys . SHIFT , "v" ) ; } else { paste = org . openqa . selenium . Keys . chord ( Keys . COMMAND , "v" ) ; } input . sendKeys ( paste ) ; "<AssertPlaceHolder>" ; } isPopupOpen ( ) { return isElementPresent ( com . vaadin . testbench . elements . ComboBoxElement . bySuggestionPopup ) ; }
org . junit . Assert . assertFalse ( cb . isPopupOpen ( ) )
testWriteToTable ( ) { helloWorld . writeToTable ( ) ; com . google . cloud . bigtable . data . v2 . models . Row row = com . google . cloud . examples . bigtable . ITHelloWorld . dataClient . readRow ( com . google . cloud . examples . bigtable . ITHelloWorld . tableId , "rowKey0" ) ; "<AssertPlaceHolder>" ; } readRow ( java . lang . String , java . lang . String ) { return com . google . api . gax . rpc . ApiExceptions . callAndTranslateApiException ( readRowAsync ( tableId , com . google . protobuf . ByteString . copyFromUtf8 ( rowKey ) , null ) ) ; }
org . junit . Assert . assertNotNull ( row )
testSha256PackedState ( ) { byte [ ] bytes = new byte [ 130 ] ; for ( int i = 0 ; i < ( bytes . length ) ; i ++ ) { bytes [ i ] = ( ( byte ) ( i ) ) ; } for ( int byteCount = 0 ; byteCount < ( bytes . length ) ; byteCount ++ ) { org . spongycastle . crypto . digests . SHA256Digest digest1 = new org . spongycastle . crypto . digests . SHA256Digest ( ) ; digest1 . update ( bytes , 0 , byteCount ) ; byte [ ] sha256PackedState = toSha256PackedState ( digest1 ) ; org . spongycastle . crypto . digests . SHA256Digest digest2 = ofSha256PackedState ( sha256PackedState , byteCount ) ; byte [ ] hash1 = new byte [ SHA256_LENGTH ] ; byte [ ] hash2 = new byte [ SHA256_LENGTH ] ; digest1 . doFinal ( hash1 , 0 ) ; digest2 . doFinal ( hash2 , 0 ) ; "<AssertPlaceHolder>" ; } } ofSha256PackedState ( byte [ ] , long ) { int xBufOff = ( ( int ) ( byteCount % 4 ) ) ; int xOff = ( ( int ) ( ( byteCount / 4 ) % 16 ) ) ; byte [ ] encodedState = new byte [ 52 + ( xOff * 4 ) ] ; org . spongycastle . util . Pack . intToBigEndian ( xBufOff , encodedState , 4 ) ; org . spongycastle . util . Pack . longToBigEndian ( byteCount , encodedState , 8 ) ; org . spongycastle . util . Pack . intToBigEndian ( xOff , encodedState , 48 ) ; java . lang . System . arraycopy ( packedState , 0 , encodedState , 16 , io . global . common . CryptoUtils . SHA256_LENGTH ) ; java . lang . System . arraycopy ( packedState , io . global . common . CryptoUtils . SHA256_LENGTH , encodedState , 52 , ( xOff * 4 ) ) ; java . lang . System . arraycopy ( packedState , ( ( io . global . common . CryptoUtils . SHA256_LENGTH ) + ( xOff * 4 ) ) , encodedState , 0 , xBufOff ) ; return new org . spongycastle . crypto . digests . SHA256Digest ( encodedState ) ; }
org . junit . Assert . assertArrayEquals ( hash1 , hash2 )
testProxybufProxyOnIgnoredPOJOClass3 ( ) { com . baidu . bjf . remoting . protobuf . Codec < com . baidu . bjf . remoting . protobuf . ignore . IgnoredPOJOClass3 > codec = com . baidu . bjf . remoting . protobuf . ProtobufProxy . create ( com . baidu . bjf . remoting . protobuf . ignore . IgnoredPOJOClass3 . class ) ; com . baidu . bjf . remoting . protobuf . ignore . IgnoredPOJOClass3 pojo = new com . baidu . bjf . remoting . protobuf . ignore . IgnoredPOJOClass3 ( ) ; pojo . name = "abc" ; com . baidu . bjf . remoting . protobuf . ignore . IgnoredPOJOClass3 pojo2 = new com . baidu . bjf . remoting . protobuf . ignore . IgnoredPOJOClass3 ( ) ; pojo2 . name = "abc" ; pojo2 . address = "hello" ; try { byte [ ] encode = codec . encode ( pojo2 ) ; byte [ ] encode2 = codec . encode ( pojo ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } } encode ( T ) { if ( t == null ) { throw new java . lang . RuntimeException ( "target<sp>object<sp>to<sp>encode<sp>is<sp>null." ) ; } int size = size ( t ) ; byte [ ] bytes = new byte [ size ] ; com . google . protobuf . CodedOutputStream out = com . google . protobuf . CodedOutputStream . newInstance ( bytes ) ; writeTo ( t , out ) ; return bytes ; }
org . junit . Assert . assertArrayEquals ( encode , encode2 )
testMkdirNonRecursiveWithExistingDir ( ) { org . apache . hadoop . fs . Path f = getTestRootPath ( org . apache . hadoop . fs . FileContextCreateMkdirBaseTest . fc , "aDir" ) ; org . apache . hadoop . fs . FileContextCreateMkdirBaseTest . fc . mkdir ( f , FileContext . DEFAULT_PERM , false ) ; "<AssertPlaceHolder>" ; } isDir ( org . apache . hadoop . fs . FileContext , org . apache . hadoop . fs . Path ) { try { return fc . getFileStatus ( p ) . isDirectory ( ) ; } catch ( java . io . FileNotFoundException e ) { return false ; } }
org . junit . Assert . assertTrue ( isDir ( org . apache . hadoop . fs . FileContextCreateMkdirBaseTest . fc , f ) )
testStopWordsInQueryUsingPhrase ( ) { java . util . ArrayList < java . lang . String > names = new java . util . ArrayList < java . lang . String > ( java . util . Arrays . asList ( "lin<sp>and<sp>is<sp>angry" ) ) ; edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary dictionary = new edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary ( names ) ; java . util . List < edu . uci . ics . texera . api . span . Span > list = new java . util . ArrayList ( ) ; edu . uci . ics . texera . api . span . Span span = new edu . uci . ics . texera . api . span . Span ( "description" , 25 , 45 , "lin<sp>and<sp>is<sp>angry" , "lin<sp>clooney<sp>is<sp>Angry" ) ; list . add ( span ) ; edu . uci . ics . texera . api . schema . Attribute [ ] schemaAttributes = new edu . uci . ics . texera . api . schema . Attribute [ ( TestConstants . ATTRIBUTES_PEOPLE . length ) + 1 ] ; for ( int count = 0 ; count < ( ( schemaAttributes . length ) - 1 ) ; count ++ ) { schemaAttributes [ count ] = edu . uci . ics . texera . api . constants . test . TestConstants . ATTRIBUTES_PEOPLE [ count ] ; } schemaAttributes [ ( ( schemaAttributes . length ) - 1 ) ] = edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTest . RESULTS_ATTRIBUTE ; edu . uci . ics . texera . api . field . IField [ ] fields1 = new edu . uci . ics . texera . api . field . IField [ ] { new edu . uci . ics . texera . api . field . StringField ( "george<sp>lin<sp>lin" ) , new edu . uci . ics . texera . api . field . StringField ( "lin<sp>clooney" ) , new edu . uci . ics . texera . api . field . IntegerField ( 43 ) , new edu . uci . ics . texera . api . field . DoubleField ( 6.06 ) , new edu . uci . ics . texera . api . field . DateField ( new java . text . SimpleDateFormat ( "MM-dd-yyyy" ) . parse ( "01-13-1973" ) ) , new edu . uci . ics . texera . api . field . TextField ( "Lin<sp>Clooney<sp>is<sp>Short<sp>and<sp>lin<sp>clooney<sp>is<sp>Angry" ) , new edu . uci . ics . texera . api . field . ListField < edu . uci . ics . texera . api . span . Span > ( list ) } ; edu . uci . ics . texera . api . tuple . Tuple tuple1 = new edu . uci . ics . texera . api . tuple . Tuple ( new edu . uci . ics . texera . api . schema . Schema ( schemaAttributes ) , fields1 ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > expectedResults = new java . util . ArrayList < edu . uci . ics . texera . api . tuple . Tuple > ( ) ; expectedResults . add ( tuple1 ) ; java . util . List < java . lang . String > attributeNames = java . util . Arrays . asList ( TestConstants . FIRST_NAME , TestConstants . LAST_NAME , TestConstants . DESCRIPTION ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > returnedResults = edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTestHelper . getQueryResults ( edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTest . PEOPLE_TABLE , dictionary , attributeNames , KeywordMatchingType . PHRASE_INDEXBASED ) ; boolean contains = edu . uci . ics . texera . api . utils . TestUtils . equals ( expectedResults , returnedResults ) ; "<AssertPlaceHolder>" ; } equals ( java . util . List , java . util . List ) { expectedResults = Tuple . Builder . removeIfExists ( expectedResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; exactResults = Tuple . Builder . removeIfExists ( exactResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; if ( ( expectedResults . size ( ) ) != ( exactResults . size ( ) ) ) return false ; return ( expectedResults . containsAll ( exactResults ) ) && ( exactResults . containsAll ( expectedResults ) ) ; }
org . junit . Assert . assertTrue ( contains )
testPropertyReactvityOnFinalField ( ) { java . lang . String str = "rule<sp>R<sp>when\n" + ( ( ( "<sp>$a<sp>:<sp>String(<sp>length<sp>><sp>3<sp>)\n" + "then\n" ) + "<sp>System.out.println($a);\n" ) + "end\n" ) ; org . kie . api . runtime . KieSession ksession = getKieSession ( str ) ; ksession . insert ( "abcd" ) ; ksession . insert ( "xy" ) ; "<AssertPlaceHolder>" ; } fireAllRules ( ) { return 0 ; }
org . junit . Assert . assertEquals ( 1 , ksession . fireAllRules ( ) )
testSkipExcluded ( ) { byte [ ] bytes = new byte [ 100 ] ; java . io . InputStream is = new com . amazonaws . util . LengthCheckInputStream ( new java . io . ByteArrayInputStream ( bytes ) , 90 , com . amazonaws . util . LengthCheckInputStream . EXCLUDE_SKIPPED_BYTES ) ; "<AssertPlaceHolder>" ; com . amazonaws . util . StreamUtils . consumeInputStream ( is ) ; is . close ( ) ; } skip ( long ) { hasBeenAccessed = true ; return super . skip ( n ) ; }
org . junit . Assert . assertTrue ( ( 10 == ( is . skip ( 10 ) ) ) )
testMultiplyByZeroWithoutReduction ( ) { byte [ ] abyte = new byte [ ] { ( ( byte ) ( 65 ) ) , ( ( byte ) ( 255 ) ) } ; byte [ ] bbyte = new byte [ ] { ( ( byte ) ( 0 ) ) } ; byte [ ] expectedByte = new byte [ ] { ( ( byte ) ( 0 ) ) , ( ( byte ) ( 0 ) ) , ( ( byte ) ( 0 ) ) } ; dk . alexandra . fresco . framework . util . StrictBitVector a = new dk . alexandra . fresco . framework . util . StrictBitVector ( abyte ) ; dk . alexandra . fresco . framework . util . StrictBitVector b = new dk . alexandra . fresco . framework . util . StrictBitVector ( bbyte ) ; dk . alexandra . fresco . framework . util . StrictBitVector expected = new dk . alexandra . fresco . framework . util . StrictBitVector ( expectedByte ) ; dk . alexandra . fresco . framework . util . StrictBitVector res = ( ( dk . alexandra . fresco . framework . util . StrictBitVector ) ( multiplyWithoutReduction . invoke ( dk . alexandra . fresco . tools . ot . otextension . RotReceiverImpl . class , a , b ) ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expected , res )
testIntFunction ( ) { v8 . executeVoidScript ( "function<sp>add(x,<sp>y)<sp>{return<sp>x+y;}" ) ; com . eclipsesource . v8 . V8Array parameters = new com . eclipsesource . v8 . V8Array ( v8 ) ; parameters . push ( 7 ) ; parameters . push ( 8 ) ; int result = v8 . executeIntegerFunction ( "add" , parameters ) ; "<AssertPlaceHolder>" ; parameters . close ( ) ; } executeIntegerFunction ( java . lang . String , com . eclipsesource . v8 . V8Array ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertEquals ( 15 , result )
toCompilableType_A$String$List$String ( ) { org . junithelper . core . config . Configuration config = new org . junithelper . core . config . Configuration ( ) ; org . junithelper . core . extractor . TypeNameConverter target = new org . junithelper . core . extractor . TypeNameConverter ( config ) ; java . lang . String packageName = null ; java . lang . String className = "InputStream" ; java . util . List < java . lang . String > importedList = new java . util . ArrayList < java . lang . String > ( ) ; importedList . add ( "java.io.InputStream" ) ; java . lang . String actual = target . toCompilableType ( className , importedList , packageName ) ; java . lang . String expected = "InputStream" ; "<AssertPlaceHolder>" ; } toCompilableType ( java . lang . String , java . util . List , java . lang . String ) { return toCompilableType ( typeName , null , importedList , callerClassPackageName ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testUpdateThreadViewTriggerThreadEtagChange ( ) { org . sagebionetworks . repo . model . discussion . DiscussionThreadBundle threadBundle = threadDao . createThread ( forumId , threadId . toString ( ) , "title" , "messageKey" , userId ) ; threadDao . updateThreadView ( threadId , userId ) ; org . sagebionetworks . repo . model . discussion . DiscussionThreadBundle updated = threadDao . getThread ( threadId , org . sagebionetworks . repo . model . dbo . dao . discussion . DBODiscussionThreadDAOImpl . DEFAULT_FILTER ) ; "<AssertPlaceHolder>" ; } getEtag ( ) { return etag ; }
org . junit . Assert . assertFalse ( threadBundle . getEtag ( ) . equals ( updated . getEtag ( ) ) )
testBlobVar ( ) { byte [ ] [ ] vals = new byte [ ] [ ] { org . apache . hadoop . hbase . util . Bytes . toBytes ( "" ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "22" 4 ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "22" 9 ) , new byte [ ] { ( ( byte ) ( 170 ) ) , ( ( byte ) ( 170 ) ) , ( ( byte ) ( 170 ) ) , ( ( byte ) ( 170 ) ) , ( ( byte ) ( 170 ) ) , ( ( byte ) ( 170 ) ) , ( ( byte ) ( 170 ) ) for ( org . apache . hadoop . hbase . util . Order ord : new org . apache . hadoop . hbase . util . Order [ ] { Order . ASCENDING , Order . DESCENDING } ) { byte [ ] [ ] encoded = new byte [ vals . length ] [ ] ; org . apache . hadoop . hbase . util . PositionedByteRange pbr = new org . apache . hadoop . hbase . util . SimplePositionedMutableByteRange ( ) ; for ( int i = 0 ; i < ( vals . length ) ; i ++ ) { encoded [ i ] = new byte [ org . apache . hadoop . hbase . util . OrderedBytes . blobVarEncodedLength ( vals [ i ] . length ) ] ; org . apache . hadoop . hbase . util . OrderedBytes . encodeBlobVar ( pbr . set ( encoded [ i ] ) , vals [ i ] , ord ) ; } java . util . Arrays . sort ( encoded , Bytes . BYTES_COMPARATOR ) ; byte [ ] [ ] sortedVals = java . util . Arrays . copyOf ( vals , vals . length ) ; if ( ord == ( Order . ASCENDING ) ) java . util . Arrays . sort ( sortedVals , Bytes . BYTES_COMPARATOR ) ; else java . util . Arrays . sort ( sortedVals , java . util . Collections . reverseOrder ( Bytes . BYTES_COMPARATOR ) ) ; for ( int i = 0 ; i < ( sortedVals . length ) ; i ++ ) { pbr . set ( encoded [ i ] ) ; byte [ ] decoded = org . apache . hadoop . hbase . util . OrderedBytes . decodeBlobVar ( pbr ) ; "<AssertPlaceHolder>" ; } } } toString ( org . apache . hadoop . hbase . util . BloomFilterChunk ) { return ( ( ( org . apache . hadoop . hbase . util . BloomFilterUtil . formatStats ( bloomFilter ) ) + ( org . apache . hadoop . hbase . util . BloomFilterUtil . STATS_RECORD_SEP ) ) + "Actual<sp>error<sp>rate:<sp>" ) + ( java . lang . String . format ( "%.8f" , bloomFilter . actualErrorRate ( ) ) ) ; }
org . junit . Assert . assertArrayEquals ( java . lang . String . format ( "22" 7 , java . util . Arrays . toString ( sortedVals [ i ] ) , java . util . Arrays . toString ( decoded ) , ord ) , sortedVals [ i ] , decoded )
testCastFunctionToString ( ) { java . lang . String result = testDialect . getSqlFrom ( org . alfasoftware . morf . sql . SqlUtils . cast ( org . alfasoftware . morf . sql . element . Function . min ( org . alfasoftware . morf . sql . SqlUtils . field ( "field" ) ) ) . asString ( 8 ) ) ; "<AssertPlaceHolder>" ; } expectedStringFunctionCast ( ) { return "CAST(MIN(field)<sp>AS<sp>VARCHAR(8))" ; }
org . junit . Assert . assertEquals ( expectedStringFunctionCast ( ) , result )
testSplit_4 ( ) { java . util . Set < java . util . List < java . lang . Integer > > matchers = new java . util . HashSet ( java . util . Arrays . asList ( java . util . Arrays . asList ( 67 , 112 ) , java . util . Arrays . asList ( 76 , 112 ) ) ) ; org . apache . fontbox . ttf . gsub . GlyphArraySplitter testClass = new org . apache . fontbox . ttf . gsub . GlyphArraySplitterRegexImpl ( matchers ) ; java . util . List < java . lang . Integer > glyphIds = java . util . Arrays . asList ( 94 , 167 , 112 , 91 , 103 ) ; java . util . List < java . util . List < java . lang . Integer > > tokens = testClass . split ( glyphIds ) ; "<AssertPlaceHolder>" ; } split ( java . util . List ) { java . lang . String originalGlyphsAsText = convertGlyphIdsToString ( glyphIds ) ; java . util . List < java . lang . String > tokens = compoundCharacterTokenizer . tokenize ( originalGlyphsAsText ) ; java . util . List < java . util . List < java . lang . Integer > > modifiedGlyphs = new java . util . ArrayList ( ) ; for ( java . lang . String token : tokens ) { modifiedGlyphs . add ( convertGlyphIdsToList ( token ) ) ; } return modifiedGlyphs ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( java . util . Arrays . asList ( 94 , 167 , 112 , 91 , 103 ) ) , tokens )
fromInputStreams_Collection_empty ( ) { try { net . coobird . thumbnailator . Thumbnails . fromInputStreams ( java . util . Collections . < java . io . InputStream > emptyList ( ) ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; throw e ; } } fromInputStreams ( java . lang . Iterable ) { net . coobird . thumbnailator . Thumbnails . checkForNull ( inputStreams , "Cannot<sp>specify<sp>null<sp>for<sp>InputStreams." ) ; net . coobird . thumbnailator . Thumbnails . checkForEmpty ( inputStreams , "Cannot<sp>specify<sp>an<sp>empty<sp>collection<sp>for<sp>InputStreams." ) ; return net . coobird . thumbnailator . Thumbnails . Builder . ofInputStreams ( inputStreams ) ; }
org . junit . Assert . assertEquals ( "Cannot<sp>specify<sp>an<sp>empty<sp>collection<sp>for<sp>InputStreams." , e . getMessage ( ) )
testDeadlock ( ) { payloadService . setEventHelper ( helper ) ; try { helper . addEventPayload ( "source" , "barney" , org . cytoscape . event . StubCyPayloadEvent . class ) ; java . lang . Thread . sleep ( 1100 ) ; System . out . println ( ( "deadlock<sp>payloadService<sp>num<sp>calls:" + ( payloadService . getNumCalls ( ) ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . InterruptedException ie ) { throw new java . lang . RuntimeException ( ie ) ; } } getNumCalls ( ) { return called ; }
org . junit . Assert . assertTrue ( ( ( payloadService . getNumCalls ( ) ) > 1 ) )
getOrCreateIdWithICVFailure ( ) { uid = new net . opentsdb . uid . UniqueId ( client , net . opentsdb . uid . TestUniqueId . table , net . opentsdb . uid . TestUniqueId . kind , 3 ) ; when ( client . get ( net . opentsdb . uid . TestUniqueId . anyGet ( ) ) ) . thenReturn ( com . stumbleupon . async . Deferred . < java . util . ArrayList < net . opentsdb . uid . KeyValue > > fromResult ( null ) ) ; net . opentsdb . uid . HBaseException hbe = net . opentsdb . uid . TestUniqueId . fakeHBaseException ( ) ; when ( client . atomicIncrement ( net . opentsdb . uid . TestUniqueId . incrementForRow ( net . opentsdb . uid . TestUniqueId . MAXID ) ) ) . thenThrow ( hbe ) . thenReturn ( com . stumbleupon . async . Deferred . fromResult ( 5L ) ) ; when ( client . compareAndSet ( net . opentsdb . uid . TestUniqueId . anyPut ( ) , net . opentsdb . uid . TestUniqueId . emptyArray ( ) ) ) . thenReturn ( com . stumbleupon . async . Deferred . fromResult ( true ) ) ; final byte [ ] id = new byte [ ] { 0 , 0 , 5 } ; "<AssertPlaceHolder>" ; verify ( client , times ( 2 ) ) . get ( net . opentsdb . uid . TestUniqueId . anyGet ( ) ) ; verify ( client , times ( 2 ) ) . atomicIncrement ( net . opentsdb . uid . TestUniqueId . incrementForRow ( net . opentsdb . uid . TestUniqueId . MAXID ) ) ; verify ( client , times ( 2 ) ) . compareAndSet ( net . opentsdb . uid . TestUniqueId . anyPut ( ) , net . opentsdb . uid . TestUniqueId . emptyArray ( ) ) ; } getOrCreateId ( java . lang . String ) { short attempt = net . opentsdb . uid . UniqueId . MAX_ATTEMPTS_ASSIGN_ID ; net . opentsdb . uid . HBaseException hbe = null ; while ( ( attempt -- ) > 0 ) { try { return getId ( name ) ; } catch ( net . opentsdb . uid . NoSuchUniqueName e ) { net . opentsdb . uid . UniqueId . LOG . info ( ( ( ( ( "WTF!<sp>Failed<sp>to<sp>CAS<sp>reverse<sp>mapping:<sp>" 8 + ( kind ( ) ) ) + "Failed<sp>to<sp>assign<sp>an<sp>ID<sp>for<sp>kind='" 1 ) + name ) + '\'' ) ) ; } final long id ; byte [ ] row ; try { id = client . atomicIncrement ( new net . opentsdb . uid . AtomicIncrementRequest ( table , net . opentsdb . uid . UniqueId . MAXID_ROW , net . opentsdb . uid . UniqueId . ID_FAMILY , kind ) ) . joinUninterruptibly ( ) ; row = net . opentsdb . uid . Bytes . fromLong ( id ) ; net . opentsdb . uid . UniqueId . LOG . info ( ( ( ( ( ( ( "Got<sp>ID=" + id ) + ",<sp>but<sp>CAS<sp>failed<sp>on<sp>" 2 ) + ( kind ( ) ) ) + "Failed<sp>to<sp>assign<sp>an<sp>ID<sp>for<sp>kind='" 1 ) + name ) + ",<sp>but<sp>CAS<sp>failed<sp>on<sp>" 0 ) ) ; if ( ( row . length ) < ( idWidth ) ) { throw new java . lang . IllegalStateException ( ( ( ( ( ( ( ( "Failed<sp>to<sp>assign<sp>an<sp>ID<sp>for<sp>kind='" 2 + ( row . length ) ) + ",<sp>but<sp>CAS<sp>failed<sp>on<sp>" 5 ) + ( idWidth ) ) + "Failed<sp>to<sp>assign<sp>an<sp>ID<sp>for<sp>kind='" 3 ) + id ) + "WTF!<sp>Failed<sp>to<sp>CAS<sp>reverse<sp>mapping:<sp>" 6 ) + ( java . util . Arrays . toString ( row ) ) ) ) ; } for ( int i = 0 ; i < ( ( row . length ) - ( idWidth ) ) ; i ++ ) { if ( ( row [ i ] ) != 0 ) { final java . lang . String message = ( ( ( "WTF!<sp>Failed<sp>to<sp>CAS<sp>reverse<sp>mapping:<sp>" 2 + ( kind ( ) ) ) + ",<sp>but<sp>CAS<sp>failed<sp>on<sp>" 9 ) + ( idWidth ) ) + "WTF!<sp>Failed<sp>to<sp>CAS<sp>reverse<sp>mapping:<sp>" 9 ; net . opentsdb . uid . UniqueId . LOG . error ( ( "OMG<sp>" + message ) ) ; throw new java . lang . IllegalStateException ( message ) ; } } row = java . util . Arrays . copyOfRange ( row , ( ( row . length ) - ( idWidth ) ) , row . length ) ; } catch ( net . opentsdb . uid . HBaseException e ) { net . opentsdb . uid . UniqueId . LOG . error ( ( ( ( ( ( ( "WTF!<sp>Failed<sp>to<sp>CAS<sp>reverse<sp>mapping:<sp>" 0 + ( java . util . Arrays . toString ( net . opentsdb . uid . UniqueId . MAXID_ROW ) ) ) + "<sp>column='" ) + ( net . opentsdb . uid . UniqueId . fromBytes ( net . opentsdb . uid . UniqueId . ID_FAMILY ) ) ) + ':' ) + ( kind ( ) ) ) + '\'' ) , e ) ; hbe = e ; continue ; } catch ( java . lang . IllegalStateException e ) { throw e ; } catch ( java . lang . Exception e ) { net . opentsdb . uid . UniqueId . LOG . error ( ( ( ( ( ( ( ( "WTF?<sp>Unexpected<sp>exception<sp>type<sp>when<sp>assigning<sp>an<sp>ID," + "Failed<sp>to<sp>assign<sp>an<sp>ID<sp>for<sp>kind='" 0 ) + ( java . util . Arrays . toString ( net . opentsdb . uid . UniqueId . MAXID_ROW ) ) ) + "<sp>column='" ) + ( net . opentsdb . uid . UniqueId . fromBytes ( net . opentsdb . uid . UniqueId . ID_FAMILY ) ) ) + ':' ) + ( kind ( ) ) ) + '\'' ) , e ) ; continue ; } try { final net . opentsdb . uid . PutRequest reverse_mapping = new net . opentsdb . uid . PutRequest ( table , row ,
org . junit . Assert . assertArrayEquals ( id , uid . getOrCreateId ( "foo" ) )
getEnvironmentIsSuccessful ( ) { com . ibm . watson . discovery . v1 . model . GetEnvironmentOptions getOptions = new com . ibm . watson . discovery . v1 . model . GetEnvironmentOptions . Builder ( com . ibm . watson . discovery . v1 . DiscoveryServiceIT . environmentId ) . build ( ) ; com . ibm . watson . discovery . v1 . model . Environment getResponse = discovery . getEnvironment ( getOptions ) . execute ( ) . getResult ( ) ; "<AssertPlaceHolder>" ; } getEnvironmentId ( ) { return environmentId ; }
org . junit . Assert . assertEquals ( com . ibm . watson . discovery . v1 . DiscoveryServiceIT . environmentId , getResponse . getEnvironmentId ( ) )
testReadWithVertexIdPredicate ( ) { java . util . List < org . gradoop . common . model . impl . pojo . Vertex > testVertices = new java . util . ArrayList ( getSocialVertices ( ) ) . subList ( 0 , 3 ) ; org . gradoop . common . model . impl . id . GradoopIdSet ids = org . gradoop . common . model . impl . id . GradoopIdSet . fromExisting ( testVertices . stream ( ) . map ( EPGMIdentifiable :: getId ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ; org . gradoop . storage . impl . hbase . io . HBaseDataSource source = new org . gradoop . storage . impl . hbase . io . HBaseDataSource ( org . gradoop . storage . impl . hbase . io . HBaseDataSinkSourceTest . epgmStores [ storeIndex ] , getConfig ( ) ) ; source = source . applyVertexPredicate ( org . gradoop . storage . common . predicate . query . Query . elements ( ) . fromSets ( ids ) . noFilter ( ) ) ; "<AssertPlaceHolder>" ; org . gradoop . flink . model . impl . epgm . GraphCollection graphCollection = source . getGraphCollection ( ) ; java . util . Collection < org . gradoop . common . model . impl . pojo . GraphHead > loadedGraphHeads = graphCollection . getGraphHeads ( ) . collect ( ) ; java . util . Collection < org . gradoop . common . model . impl . pojo . Vertex > loadedVertices = graphCollection . getVertices ( ) . collect ( ) ; java . util . Collection < org . gradoop . common . model . impl . pojo . Edge > loadedEdges = graphCollection . getEdges ( ) . collect ( ) ; validateEPGMElementCollections ( getSocialGraphHeads ( ) , loadedGraphHeads ) ; validateEPGMElementCollections ( testVertices , loadedVertices ) ; validateEPGMGraphElementCollections ( testVertices , loadedVertices ) ; validateEPGMElementCollections ( getSocialEdges ( ) , loadedEdges ) ; validateEPGMGraphElementCollections ( getSocialEdges ( ) , loadedEdges ) ; } isFilterPushedDown ( ) { return ( ( ( this . graphHeadQuery ) != null ) || ( ( this . vertexQuery ) != null ) ) || ( ( this . edgeQuery ) != null ) ; }
org . junit . Assert . assertTrue ( source . isFilterPushedDown ( ) )
XPTest ( ) { dummyMonster . setXPGain ( 1000 ) ; "<AssertPlaceHolder>" ; } getXPGain ( ) { return xpGain ; }
org . junit . Assert . assertEquals ( 1000 , dummyMonster . getXPGain ( ) )
testInvokeDao ( ) { org . support . project . aop . TestDao method = org . support . project . di . Container . getComp ( org . support . project . aop . TestDao . class ) ; java . lang . String result = method . test ( ) ; org . support . project . aop . IntercepterTest . LOG . info ( result ) ; "<AssertPlaceHolder>" ; } info ( java . lang . Object ) { this . print ( LogLevel . INFO , msg ) ; }
org . junit . Assert . assertEquals ( "test" , result )
testIsDownloadPopupRequiredHasTermsOfAccess ( ) { edu . harvard . iq . dataverse . DatasetVersion dsv1 = new edu . harvard . iq . dataverse . DatasetVersion ( ) ; dsv1 . setVersionState ( DatasetVersion . VersionState . RELEASED ) ; edu . harvard . iq . dataverse . TermsOfUseAndAccess termsOfUseAndAccess = new edu . harvard . iq . dataverse . TermsOfUseAndAccess ( ) ; termsOfUseAndAccess . setTermsOfAccess ( "Terms<sp>of<sp>*Access*<sp>is<sp>different<sp>than<sp>Terms<sp>of<sp>Use" ) ; dsv1 . setTermsOfUseAndAccess ( termsOfUseAndAccess ) ; "<AssertPlaceHolder>" ; } isDownloadPopupRequired ( edu . harvard . iq . dataverse . DatasetVersion ) { if ( datasetVersion == null ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>datasetVersion<sp>is<sp>null." ) ; return false ; } if ( ! ( datasetVersion . isReleased ( ) ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>datasetVersion<sp>has<sp>not<sp>been<sp>released." ) ; return false ; } if ( ( datasetVersion . getTermsOfUseAndAccess ( ) ) != null ) { if ( ( ! ( TermsOfUseAndAccess . License . CC0 . equals ( datasetVersion . getTermsOfUseAndAccess ( ) . getLicense ( ) ) ) ) && ( ! ( ( ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfUse ( ) ) == null ) || ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfUse ( ) . equals ( "" ) ) ) ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>of<sp>license<sp>or<sp>terms<sp>of<sp>use." ) ; return true ; } if ( ( ! ( ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfAccess ( ) ) == null ) ) && ( ! ( datasetVersion . getTermsOfUseAndAccess ( ) . getTermsOfAccess ( ) . equals ( "" ) ) ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>of<sp>terms<sp>of<sp>access." ) ; return true ; } } if ( ( ( ( ( datasetVersion . getDataset ( ) ) != null ) && ( ( datasetVersion . getDataset ( ) . getGuestbook ( ) ) != null ) ) && ( datasetVersion . getDataset ( ) . getGuestbook ( ) . isEnabled ( ) ) ) && ( ( datasetVersion . getDataset ( ) . getGuestbook ( ) . getDataverse ( ) ) != null ) ) { edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>required<sp>because<sp>of<sp>guestbook." ) ; return true ; } edu . harvard . iq . dataverse . util . FileUtil . logger . fine ( "Download<sp>popup<sp>is<sp>not<sp>required." ) ; return false ; }
org . junit . Assert . assertEquals ( true , edu . harvard . iq . dataverse . util . FileUtil . isDownloadPopupRequired ( dsv1 ) )
testDoOCR_File_With_Configs ( ) { net . sourceforge . tess4j . TesseractTest . logger . info ( "doOCR<sp>with<sp>configs" ) ; java . io . File imageFile = new java . io . File ( this . testResourcesDataPath , "eurotext.png" ) ; java . lang . String expResult = "[-0123456789.\n<sp>]+" ; java . util . List < java . lang . String > configs = java . util . Arrays . asList ( "digits" ) ; instance . setConfigs ( configs ) ; java . lang . String result = instance . doOCR ( imageFile ) ; net . sourceforge . tess4j . TesseractTest . logger . info ( result ) ; "<AssertPlaceHolder>" ; instance . setConfigs ( null ) ; } doOCR ( net . sourceforge . tess4j . BufferedImage ) { return doOCR ( bi , null ) ; }
org . junit . Assert . assertTrue ( result . matches ( expResult ) )
whenSubmit_thenSubsequentFormRequestContainsMostRecentTodo ( ) { org . springframework . web . servlet . FlashMap flashMap = mockMvc . perform ( post ( "/sessionattributes/form" ) . param ( "description" , "newtodo" ) ) . andExpect ( status ( ) . is3xxRedirection ( ) ) . andReturn ( ) . getFlashMap ( ) ; org . springframework . test . web . servlet . MvcResult result = mockMvc . perform ( get ( "/sessionattributes/form" ) . sessionAttrs ( flashMap ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( model ( ) . attributeExists ( "todo" ) ) . andReturn ( ) ; com . baeldung . sessionattrs . TodoItem item = ( ( com . baeldung . sessionattrs . TodoItem ) ( result . getModelAndView ( ) . getModel ( ) . get ( "todo" ) ) ) ; "<AssertPlaceHolder>" ; } getDescription ( ) { return description ; }
org . junit . Assert . assertEquals ( "newtodo" , item . getDescription ( ) )
testSubscriber ( ) { final java . util . List < java . lang . Integer > list = new java . util . ArrayList < java . lang . Integer > ( ) ; new com . github . davidmoten . rx2 . internal . flowable . FlowablePassThroughTest . FlowablePassThrough < java . lang . Integer > ( io . reactivex . Flowable . just ( 1 , 2 , 3 ) ) . subscribe ( new org . reactivestreams . Subscriber < java . lang . Integer > ( ) { @ com . github . davidmoten . rx2 . internal . flowable . Override public void onSubscribe ( org . reactivestreams . Subscription s ) { s . request ( Long . MAX_VALUE ) ; } @ com . github . davidmoten . rx2 . internal . flowable . Override public void onNext ( java . lang . Integer t ) { list . add ( t ) ; } @ com . github . davidmoten . rx2 . internal . flowable . Override public void onError ( java . lang . Throwable t ) { } @ com . github . davidmoten . rx2 . internal . flowable . Override public void onComplete ( ) { } } ) ; "<AssertPlaceHolder>" ; } onComplete ( ) { terminated . set ( true ) ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( 1 , 2 , 3 ) , list )
isSubQueryWithLongWithJoinWorking ( ) { if ( isBatoo ( ) ) { return ; } final java . lang . String query = "select<sp>r<sp>from<sp>RegularEntityTwo<sp>r<sp>join<sp>r.regularEntityOne<sp>one<sp>where<sp>one.id<sp>in<sp>" + "(select<sp>sub.id<sp>from<sp>RegularEntityOne<sp>sub<sp>where<sp>sub.stringAttribute<sp>=<sp>'Just<sp>a<sp>String<sp>02')" ; final java . util . List < com . uaihebert . model . test . RegularEntityTwo > resultFromJPQL = jpqlHelper . getListFromJPQL ( query , com . uaihebert . model . test . RegularEntityTwo . class ) ; "<AssertPlaceHolder>" ; final com . uaihebert . uaicriteria . UaiCriteria < com . uaihebert . model . test . RegularEntityTwo > uaiCriteria = createCriteria ( com . uaihebert . model . test . RegularEntityTwo . class ) ; uaiCriteria . innerJoin ( "regularEntityOne" ) ; final com . uaihebert . uaicriteria . UaiCriteria < com . uaihebert . model . test . RegularEntityOne > subQuery = uaiCriteria . subQuery ( "id" , com . uaihebert . model . test . RegularEntityOne . class ) ; subQuery . andEquals ( "stringAttribute" , "Just<sp>a<sp>String<sp>02" ) ; uaiCriteria . andAttributeIn ( "regularEntityOne.id" , subQuery ) ; validateTestLists ( resultFromJPQL , uaiCriteria . getResultList ( ) ) ; } getListFromJPQL ( java . lang . String , java . lang . Class ) { return getListFromJPQL ( query , classToUse , null ) ; }
org . junit . Assert . assertTrue ( ( ( resultFromJPQL . size ( ) ) == 1 ) )
testEquals ( ) { System . out . println ( "testEquals" ) ; team . bus . model . bean . BusStop o1 = new team . bus . model . bean . BusStop ( ) . withId ( 1 ) . withName ( "a" ) ; team . bus . model . bean . BusStop o2 = new team . bus . model . bean . BusStop ( ) . withId ( 1 ) . withName ( "a" ) ; boolean result = o1 . equals ( o2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { team . bus . model . bean . BusStop busStop = ( ( team . bus . model . bean . BusStop ) ( obj ) ) ; if ( obj == null ) return false ; return ( ( this . id ) == ( busStop . id ) ) && ( this . name . equals ( busStop . name ) ) ; }
org . junit . Assert . assertTrue ( result )
havingBody ( ) { final java . lang . String body = "postbody" ; net . jadler . Jadler . onRequest ( ) . havingBodyEqualTo ( body ) . havingBody ( org . hamcrest . Matchers . not ( org . hamcrest . Matchers . isEmptyOrNullString ( ) ) ) . respond ( ) . withStatus ( 201 ) ; final int status = org . apache . http . client . fluent . Executor . newInstance ( ) . execute ( org . apache . http . client . fluent . Request . Post ( jadlerUri ( ) ) . bodyString ( body , null ) ) . handleResponse ( net . jadler . STATUS_RETRIEVER ) ; "<AssertPlaceHolder>" ; } handleResponse ( org . apache . http . HttpResponse ) { return response . getStatusLine ( ) . getStatusCode ( ) ; }
org . junit . Assert . assertThat ( status , org . hamcrest . Matchers . is ( 201 ) )
testSetMaxCapacity_Good ( ) { com . jmethods . catatumbo . impl . LRUCache < java . lang . String , java . lang . String > cache = new com . jmethods . catatumbo . impl . LRUCache ( 2 , 5 ) ; cache . setMaxCapacity ( 20 ) ; "<AssertPlaceHolder>" ; } getMaxCapacity ( ) { return maxCapacity ; }
org . junit . Assert . assertTrue ( ( ( cache . getMaxCapacity ( ) ) == 20 ) )
getEmptyArchivedProcessDataInstances ( ) { final org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder builder = new org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder ( ) . createNewInstance ( "ProcessToArchive" , "1.0" ) ; builder . addActor ( "actor" ) ; builder . addUserTask ( "step" , "actor" ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition processDefinition = deployAndEnableProcessWithActor ( builder . getProcess ( ) , "actor" , user ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance = getProcessAPI ( ) . startProcess ( processDefinition . getId ( ) ) ; final java . util . List < org . bonitasoft . engine . bpm . data . ArchivedDataInstance > archivedDataInstances = getProcessAPI ( ) . getArchivedProcessDataInstances ( processInstance . getId ( ) , 0 , 10 ) ; "<AssertPlaceHolder>" ; disableAndDeleteProcess ( processDefinition ) ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( 0 , archivedDataInstances . size ( ) )
shouldNotExecuteTestInAnyExcludedCategories ( ) { runner . setTestConfigurationSource ( withExcludedGroups ( org . infinitest . testrunner . exampletests . junit4 . Junit4FailingTestsWithCategories . IgnoreMe . class . getName ( ) , org . infinitest . testrunner . exampletests . junit4 . Junit4FailingTestsWithCategories . IgnoreMeToo . class . getName ( ) ) ) ; org . infinitest . testrunner . TestResults results = runner . runTest ( org . infinitest . testrunner . exampletests . junit4 . Junit4FailingTestsWithCategories . class . getName ( ) ) ; "<AssertPlaceHolder>" ; } getName ( ) { return module . getName ( ) ; }
org . junit . Assert . assertThat ( size ( results ) , org . hamcrest . CoreMatchers . is ( 1 ) )
testComparatorReverse ( ) { final java . lang . String p = com . sun . mail . util . logging . CollectorFormatter . class . getName ( ) ; com . sun . mail . util . logging . Properties props = new com . sun . mail . util . logging . Properties ( ) ; props . put ( p . concat ( ".comparator" ) , com . sun . mail . util . logging . SeverityComparator . class . getName ( ) ) ; props . put ( p . concat ( ".comparator.reverse" ) , "true" ) ; com . sun . mail . util . logging . LogManager manager = com . sun . mail . util . logging . LogManager . getLogManager ( ) ; try { read ( manager , props ) ; com . sun . mail . util . logging . CollectorFormatter cf = new com . sun . mail . util . logging . CollectorFormatter ( ) ; com . sun . mail . util . logging . LogRecord first = new com . sun . mail . util . logging . LogRecord ( Level . SEVERE , Level . SEVERE . getName ( ) ) ; com . sun . mail . util . logging . LogRecord second = new com . sun . mail . util . logging . LogRecord ( Level . WARNING , Level . WARNING . getName ( ) ) ; cf . format ( second ) ; cf . format ( first ) ; java . lang . String result = cf . getTail ( ( ( com . sun . mail . util . logging . Handler ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } finally { manager . reset ( ) ; } } getName ( ) { return _file . getName ( ) ; }
org . junit . Assert . assertTrue ( result , result . startsWith ( Level . WARNING . getName ( ) ) )
nullMapValue ( ) { @ org . jboss . msc . value . SuppressWarnings ( "unchecked" ) org . jboss . msc . value . Value < java . util . Map < java . lang . Integer , java . lang . String > > mapValue = new org . jboss . msc . value . MapValue < java . lang . Integer , java . lang . String > ( org . jboss . msc . value . Values . < java . util . Map < java . lang . Integer , java . lang . String > > nullValue ( ) , new org . jboss . msc . value . MapEntry < org . jboss . msc . value . Value < java . lang . Integer > , org . jboss . msc . value . Value < java . lang . String > > ( new org . jboss . msc . value . ImmediateValue < java . lang . Integer > ( 1000 ) , new org . jboss . msc . value . ImmediateValue < java . lang . String > ( "a<sp>thousand" ) ) ) ; try { mapValue . getValue ( ) ; org . junit . Assert . fail ( "NullPointerException<sp>expected" ) ; } catch ( java . lang . NullPointerException e ) { } mapValue = new org . jboss . msc . value . MapValue < java . lang . Integer , java . lang . String > ( org . jboss . msc . value . Values . < java . util . Map < java . lang . Integer , java . lang . String > > nullValue ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { synchronized ( this ) { if ( ( injector ) != null ) return injector . getValue ( ) ; if ( ( instance ) != null ) return instance . getValue ( ) ; } throw new java . lang . IllegalStateException ( "Service<sp>is<sp>not<sp>installed" ) ; }
org . junit . Assert . assertNull ( mapValue . getValue ( ) )
name_without_spaces_is_preserved ( ) { cucumber . runtime . RuntimeOptions options = new cucumber . runtime . RuntimeOptions ( asList ( "--name" , "someName" ) ) ; java . util . regex . Pattern actualPattern = options . getNameFilters ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } pattern ( ) { if ( ( pattern ) == null ) { pattern = java . util . regex . Pattern . compile ( source ) ; } return pattern ; }
org . junit . Assert . assertThat ( actualPattern . pattern ( ) , org . hamcrest . CoreMatchers . is ( "someName" ) )
testGetMinIndexNoInput ( ) { com . twelvemonkeys . imageio . util . ImageReader reader = createReader ( ) ; int num = 0 ; try { num = reader . getMinIndex ( ) ; } catch ( java . lang . IllegalStateException ignore ) { } "<AssertPlaceHolder>" ; reader . dispose ( ) ; } createReader ( ) { return new com . twelvemonkeys . imageio . plugins . bmp . BMPImageReader ( createProvider ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , num )
testComputeTargetsSingleDomain ( ) { final java . lang . String [ ] args = new java . lang . String [ ] { com . spotify . helios . cli . CliParserTest . SUBCOMMAND , "-d" , com . spotify . helios . cli . CliParserTest . DOMAINS [ 0 ] , com . spotify . helios . cli . CliParserTest . SERVICE } ; final com . spotify . helios . cli . CliParser cliParser = new com . spotify . helios . cli . CliParser ( args ) ; final java . util . List < com . spotify . helios . cli . Target > targets = cliParser . getTargets ( ) ; final java . util . List < com . spotify . helios . cli . Target > expectedTargets = com . spotify . helios . cli . Target . from ( com . spotify . helios . cli . CliParserTest . SRV , com . google . common . collect . ImmutableList . of ( com . spotify . helios . cli . CliParserTest . DOMAINS [ 0 ] ) ) ; "<AssertPlaceHolder>" ; } of ( java . util . List ) { return com . spotify . helios . common . descriptors . ExecHealthCheck . newBuilder ( ) . setCommand ( command ) . build ( ) ; }
org . junit . Assert . assertEquals ( expectedTargets , targets )
test1 ( ) { symbolic_examples . symbolic_example_2 . NopolExample ex = new symbolic_examples . symbolic_example_2 . NopolExample ( ) ; "<AssertPlaceHolder>" ; } getMax ( int , int ) { if ( ( b - a ) < 0 ) { return b ; } return a ; }
org . junit . Assert . assertEquals ( 4 , ex . getMax ( 2 , 4 ) )
testCreateMedicationsSectionBuilder ( ) { org . openhealthtools . mdht . uml . cda . builder . SectionBuilder < org . openhealthtools . mdht . uml . cda . hitsp . MedicationsSection > sectionBuilder = org . openhealthtools . mdht . uml . cda . hitsp . builder . HITSPBuilderFactory . createMedicationsSectionBuilder ( ) ; org . openhealthtools . mdht . uml . cda . hitsp . MedicationsSection section = sectionBuilder . buildSection ( ) ; "<AssertPlaceHolder>" ; Diagnostician . INSTANCE . validate ( section ) ; org . openhealthtools . mdht . uml . cda . util . CDAUtil . saveSnippet ( section , System . out ) ; } buildSection ( ) { org . openhealthtools . mdht . uml . cda . Section section = CDAFactory . eINSTANCE . createSection ( ) ; construct ( section ) ; return section ; }
org . junit . Assert . assertNotNull ( section )
testEvaluateThreeIndexVarInstantiate ( ) { final org . eclipse . rdf4j . model . IRI superclass = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 6 ) ; final org . eclipse . rdf4j . model . IRI superclass2 = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 3 ) ; final org . eclipse . rdf4j . model . IRI sub = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 4 ) ; subclass = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 7 ) ; obj = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "uri:obj" ) ; talksTo = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 1 ) ; final org . eclipse . rdf4j . model . IRI howlsAt = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 8 ) ; final org . eclipse . rdf4j . model . IRI subType = org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createIRI ( "uri:subType" ) ; conn . add ( subclass , RDF . TYPE , superclass ) ; conn . add ( subclass2 , RDF . TYPE , superclass2 ) ; conn . add ( obj , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createLiteral ( "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 2 ) ) ; conn . add ( obj2 , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createLiteral ( "label2" ) ) ; conn . add ( sub , howlsAt , superclass ) ; conn . add ( superclass , subType , obj ) ; conn . add ( obj , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createLiteral ( "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 2 ) ) ; conn . add ( obj2 , RDFS . LABEL , org . apache . rya . indexing . external . AccumuloConstantPcjIT . VF . createLiteral ( "label2" ) ) ; final java . lang . String indexSparqlString = "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 5 + ( ( ( ( "wolf" 4 + "wolf" 0 ) + "wolf" 1 ) + "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 1 ) + "wolf" 6 ) ; final java . lang . String indexSparqlString2 = "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 5 + ( ( ( ( ( "wolf" 5 + "wolf" 0 ) + "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" ) + "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 3 ) + "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 0 ) + "wolf" 6 ) ; final java . lang . String indexSparqlString3 = "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 5 + ( ( ( ( "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" + "wolf" 0 ) + "<sp>?wolf<sp><uri:howlsAt><sp>?sheep<sp>.<sp>" ) + "<sp>?sheep<sp><uri:subType><sp>?chicken.<sp>" ) + "wolf" 6 ) ; final java . lang . String queryString = "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 5 + ( ( ( ( ( ( ( ( ( "wolf" 2 + "wolf" 0 ) + "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 5 ) + "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 0 ) + "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 8 ) + "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 3 ) + "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 0 ) + "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 6 ) + "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 7 ) + "wolf" 6 ) ; org . apache . rya . indexing . external . PcjIntegrationTestingUtil . createAndPopulatePcj ( conn , accCon , ( ( tablename ) + 1 ) , indexSparqlString , new java . lang . String [ ] { "dog" , "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 2 , "wolf" 8 } , com . google . common . base . Optional . absent ( ) ) ; org . apache . rya . indexing . external . PcjIntegrationTestingUtil . createAndPopulatePcj ( conn , accCon , ( ( tablename ) + 2 ) , indexSparqlString2 , new java . lang . String [ ] { "o" , "wolf" 9 , "wolf" 7 , "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 9 , "SELECT<sp>?wolf<sp>?sheep<sp>?chicken<sp>" 4 } , com . google . common . base . Optional . absent ( ) ) ; org . apache . rya . indexing . external . PcjIntegrationTestingUtil . createAndPopulatePcj ( conn , accCon , ( ( tablename ) + 3 ) , indexSparqlString3 , new java . lang . String [ ] { "wolf" , "<sp>?e<sp><uri:talksTo><sp>?o<sp>.<sp>" 9 , "wolf" 3 } , com . google . common . base . Optional . absent ( ) ) ; final org . apache . rya . indexing . external . AccumuloConstantPcjIT . CountingResultHandler crh1 = new org . apache . rya . indexing . external . AccumuloConstantPcjIT . CountingResultHandler ( ) ; final org . apache . rya . indexing . external . AccumuloConstantPcjIT . CountingResultHandler crh2 = new org . apache . rya . indexing . external . AccumuloConstantPcjIT . CountingResultHandler ( ) ; conn . prepareTupleQuery ( QueryLanguage . SPARQL , queryString ) . evaluate ( crh1 ) ; org . apache . rya . indexing . external . PcjIntegrationTestingUtil . deleteCoreRyaTables ( accCon , prefix ) ; pcjConn . prepareTupleQuery ( QueryLanguage . SPARQL , queryString ) . evaluate ( crh2 ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return count ; }
org . junit . Assert . assertEquals ( crh1 . getCount ( ) , crh2 . getCount ( ) )
testShouldCatchTimeDesyncIfThresholdExceeded ( ) { when ( msg . isTimeCheck ( ) ) . thenReturn ( true ) ; when ( msg . getTime ( ) ) . thenReturn ( 10000L ) ; context . receiveProbe ( msg ) ; "<AssertPlaceHolder>" ; } getDesyncCount ( ) { return this . desyncCount ; }
org . junit . Assert . assertEquals ( 1 , context . getDesyncCount ( ) )
testSearchForExtensionTwoDeepString ( ) { ca . uhn . fhir . jpa . dao . dstu3 . SearchParameter siblingSp = new ca . uhn . fhir . jpa . dao . dstu3 . SearchParameter ( ) ; siblingSp . addBase ( "Patient" ) ; siblingSp . setCode ( "foobar" ) ; siblingSp . setType ( org . hl7 . fhir . dstu3 . model . Enumerations . SearchParamType . STRING ) ; siblingSp . setTitle ( "FooBar" ) ; siblingSp . setExpression ( "Patient.extension('http://acme.org/foo').extension('http://acme.org/bar')" ) ; siblingSp . setXpathUsage ( org . hl7 . fhir . dstu3 . model . SearchParameter . XPathUsageType . NORMAL ) ; siblingSp . setStatus ( org . hl7 . fhir . dstu3 . model . Enumerations . PublicationStatus . ACTIVE ) ; mySearchParameterDao . create ( siblingSp , mySrd ) ; mySearchParamRegistry . forceRefresh ( ) ; ca . uhn . fhir . jpa . dao . dstu3 . Patient patient = new ca . uhn . fhir . jpa . dao . dstu3 . Patient ( ) ; patient . addName ( ) . setFamily ( "P2" ) ; ca . uhn . fhir . jpa . dao . dstu3 . Extension extParent = patient . addExtension ( ) . setUrl ( "http://acme.org/foo" ) ; extParent . addExtension ( ) . setUrl ( "http://acme.org/bar" ) . setValue ( new ca . uhn . fhir . jpa . dao . dstu3 . StringType ( "HELLOHELLO" ) ) ; org . hl7 . fhir . instance . model . api . IIdType p2id = myPatientDao . create ( patient ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . searchparam . SearchParameterMap map ; ca . uhn . fhir . rest . api . server . IBundleProvider results ; java . util . List < java . lang . String > foundResources ; map = new ca . uhn . fhir . jpa . searchparam . SearchParameterMap ( ) ; map . add ( "foobar" , new ca . uhn . fhir . jpa . dao . dstu3 . StringParam ( "hello" ) ) ; results = myPatientDao . search ( map ) ; foundResources = toUnqualifiedVersionlessIdValues ( results ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return data . contains ( o ) ; }
org . junit . Assert . assertThat ( foundResources , contains ( p2id . getValue ( ) ) )
testCoSignature ( ) { java . util . logging . Logger . getLogger ( "es.gob.afirma" ) . setLevel ( Level . WARNING ) ; final java . security . KeyStore . PrivateKeyEntry pke1 = es . gob . afirma . signers . cadestri . client . TestCAdES . loadKeyEntry ( es . gob . afirma . signers . cadestri . client . TestCAdES . CERT_PATH , es . gob . afirma . signers . cadestri . client . TestCAdES . CERT_ALIAS , es . gob . afirma . signers . cadestri . client . TestCAdES . CERT_PASS ) ; final java . security . KeyStore . PrivateKeyEntry pke3 = es . gob . afirma . signers . cadestri . client . TestCAdES . loadKeyEntry ( es . gob . afirma . signers . cadestri . client . TestCAdES . CERT_PATH3 , es . gob . afirma . signers . cadestri . client . TestCAdES . CERT_ALIAS3 , es . gob . afirma . signers . cadestri . client . TestCAdES . CERT_PASS3 ) ; final es . gob . afirma . core . signers . AOSigner signer = new es . gob . afirma . signers . cadestri . client . AOCAdESTriPhaseSigner ( ) ; java . lang . String prueba ; for ( final java . util . Properties extraParams : es . gob . afirma . signers . cadestri . client . TestCAdES . CADES_MODES ) { for ( final java . lang . String algo : es . gob . afirma . signers . cadestri . client . TestCAdES . ALGOS ) { for ( int i = 0 ; i < ( es . gob . afirma . signers . cadestri . client . TestCAdES . DATA_FILES . length ) ; i ++ ) { if ( ( es . gob . afirma . signers . cadestri . client . TestCAdES . DATA . get ( i ) ) == null ) { continue ; } prueba = ( ( ( ( ( "Cofirma<sp>CAdES<sp>trifasica<sp>del<sp>fichero<sp>" + ( es . gob . afirma . signers . cadestri . client . TestCAdES . DATA_FILES [ i ] ) ) + "<sp>en<sp>modo<sp>'" ) + ( extraParams . getProperty ( "mode" ) ) ) + "'<sp>con<sp>el<sp>algoritmo<sp>':<sp>" ) + algo ) + "'" ; System . out . println ( prueba ) ; final byte [ ] sign1 = es . gob . afirma . signers . cadestri . client . TestCAdES . sign ( signer , es . gob . afirma . signers . cadestri . client . TestCAdES . DATA . get ( i ) , algo , pke1 , extraParams ) ; final byte [ ] sign2 = es . gob . afirma . signers . cadestri . client . TestCAdES . cosign ( signer , sign1 , algo , pke3 , extraParams ) ; final byte [ ] sign3 = es . gob . afirma . signers . cadestri . client . TestCAdES . cosign ( signer , es . gob . afirma . signers . cadestri . client . TestCAdES . DATA . get ( i ) , sign2 , algo , pke3 , extraParams ) ; "<AssertPlaceHolder>" ; final java . io . File saveFile = java . io . File . createTempFile ( ( ( "Cofirma_CAdES_" + algo ) + "-" ) , ".csig" ) ; try ( final java . io . OutputStream os = new java . io . FileOutputStream ( saveFile ) ) { os . write ( sign3 ) ; os . flush ( ) ; } System . out . println ( ( "Temporal<sp>para<sp>comprobacion<sp>manual:<sp>" + ( saveFile . getAbsolutePath ( ) ) ) ) ; } } } } get ( java . lang . String ) { return es . gob . afirma . standalone . ui . preferences . PreferencesManager . preferences . get ( key , es . gob . afirma . standalone . ui . preferences . PreferencesManager . getDefaultPreference ( key ) ) ; }
org . junit . Assert . assertNotNull ( sign3 )
testCalculateDiscount ( ) { com . example . dao . ProductDAO productDAO = new com . example . dummy . ProductDAODummy ( ) ; com . example . service . ProductService productService = new com . example . service . ProductServiceImpl ( productDAO ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( productService )
too_many_characters ( ) { java . io . InputStream infinite = new java . io . InputStream ( ) { @ com . asakusafw . runtime . io . csv . Override public int read ( ) throws java . io . IOException { return 'a' ; } } ; com . asakusafw . runtime . io . csv . CsvConfiguration conf = createConfiguration ( ) ; try ( com . asakusafw . runtime . io . csv . CsvParser parser = new com . asakusafw . runtime . io . csv . CsvParser ( infinite , "testing" , conf ) ) { "<AssertPlaceHolder>" ; org . junit . Assert . fail ( ) ; } catch ( java . io . IOException e ) { } } next ( ) { try { java . lang . Object object = input . readObject ( ) ; next = type . cast ( object ) ; canGet = true ; return true ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . io . IOException ( e ) ; } catch ( java . io . EOFException e ) { next = null ; canGet = true ; return false ; } catch ( java . io . OptionalDataException e ) { if ( e . eof ) { next = null ; canGet = true ; return false ; } throw e ; } }
org . junit . Assert . assertThat ( parser . next ( ) , is ( true ) )
similarity ( ) { System . out . println ( "similarity" ) ; org . aksw . limes . core . io . ls . LinkSpecification ls = new org . aksw . limes . core . io . ls . LinkSpecification ( "tmp_is_met_by(x.beginsAtDateTime|endsAtDateTime,y.b|e)" , 1.0 ) ; org . aksw . limes . core . execution . planning . planner . DynamicPlanner p = new org . aksw . limes . core . execution . planning . planner . DynamicPlanner ( source , target ) ; org . aksw . limes . core . execution . engine . ExecutionEngine e = new org . aksw . limes . core . execution . engine . SimpleExecutionEngine ( source , target , "?x" , "?y" ) ; org . aksw . limes . core . io . mapping . AMapping m = e . execute ( ls , p ) ; System . out . println ( m ) ; org . aksw . limes . core . io . mapping . AMapping m2 = org . aksw . limes . core . io . mapping . MappingFactory . createDefaultMapping ( ) ; for ( org . aksw . limes . core . io . cache . Instance s : source . getAllInstances ( ) ) { for ( org . aksw . limes . core . io . cache . Instance t : target . getAllInstances ( ) ) { org . aksw . limes . core . measures . measure . temporal . allenAlgebra . IsMetByMeasure measure = new org . aksw . limes . core . measures . measure . temporal . allenAlgebra . IsMetByMeasure ( ) ; double sim = measure . getSimilarity ( s , t , "beginsAtDateTime|endsAtDateTime" , "b|e" ) ; if ( sim != 0 ) m2 . add ( s . getUri ( ) , t . getUri ( ) , sim ) ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof org . aksw . limes . core . io . cache . MemoryCache ) { final org . aksw . limes . core . io . cache . MemoryCache other = ( ( org . aksw . limes . core . io . cache . MemoryCache ) ( obj ) ) ; return java . util . Objects . equals ( instanceMap , other . instanceMap ) ; } else { return false ; } }
org . junit . Assert . assertTrue ( m . equals ( m2 ) )
testSSLRequired ( ) { final net . trajano . auth . HttpHeaderAuthModule module = new net . trajano . auth . HttpHeaderAuthModule ( ) ; final javax . security . auth . message . MessagePolicy mockRequestPolicy = mock ( javax . security . auth . message . MessagePolicy . class ) ; when ( mockRequestPolicy . isMandatory ( ) ) . thenReturn ( true ) ; module . initialize ( mockRequestPolicy , null , null , options ) ; final javax . security . auth . message . MessageInfo messageInfo = mock ( javax . security . auth . message . MessageInfo . class ) ; final javax . servlet . http . HttpServletRequest servletRequest = mock ( javax . servlet . http . HttpServletRequest . class ) ; when ( servletRequest . getMethod ( ) ) . thenReturn ( "GET" ) ; when ( servletRequest . isSecure ( ) ) . thenReturn ( false ) ; when ( messageInfo . getRequestMessage ( ) ) . thenReturn ( servletRequest ) ; final javax . servlet . http . HttpServletResponse servletResponse = mock ( javax . servlet . http . HttpServletResponse . class ) ; when ( messageInfo . getResponseMessage ( ) ) . thenReturn ( servletResponse ) ; final javax . security . auth . Subject client = new javax . security . auth . Subject ( ) ; "<AssertPlaceHolder>" ; verify ( servletResponse ) . sendError ( HttpURLConnection . HTTP_FORBIDDEN , "SSL<sp>Required" ) ; } validateRequest ( javax . security . auth . message . MessageInfo , javax . security . auth . Subject , javax . security . auth . Subject ) { final javax . servlet . http . HttpServletRequest req = ( ( javax . servlet . http . HttpServletRequest ) ( messageInfo . getRequestMessage ( ) ) ) ; final javax . servlet . http . HttpServletResponse resp = ( ( javax . servlet . http . HttpServletResponse ) ( messageInfo . getResponseMessage ( ) ) ) ; try { if ( ( ! ( mandatory ) ) && ( ! ( req . isSecure ( ) ) ) ) { return javax . security . auth . message . AuthStatus . SUCCESS ; } if ( ! ( req . isSecure ( ) ) ) { resp . sendError ( HttpURLConnection . HTTP_FORBIDDEN , net . trajano . auth . HttpHeaderAuthModule . R . getString ( "SSLReq" ) ) ; return javax . security . auth . message . AuthStatus . SEND_FAILURE ; } final java . lang . String userName = req . getHeader ( userNameHeader ) ; if ( ( userName == null ) && ( mandatory ) ) { return javax . security . auth . message . AuthStatus . FAILURE ; } else if ( ( userName == null ) && ( ! ( mandatory ) ) ) { return javax . security . auth . message . AuthStatus . SUCCESS ; } handler . handle ( new javax . security . auth . callback . Callback [ ] { new javax . security . auth . message . callback . CallerPrincipalCallback ( client , userName ) , new javax . security . auth . message . callback . GroupPrincipalCallback ( client , groups ( req ) ) } ) ; return javax . security . auth . message . AuthStatus . SUCCESS ; } catch ( java . io . IOException | javax . security . auth . callback . UnsupportedCallbackException e ) { net . trajano . auth . HttpHeaderAuthModule . LOG . throwing ( this . getClass ( ) . getName ( ) , "validateRequest" , e ) ; throw new javax . security . auth . message . AuthException ( e . getMessage ( ) ) ; } }
org . junit . Assert . assertEquals ( AuthStatus . SEND_FAILURE , module . validateRequest ( messageInfo , client , null ) )
testLinspace2 ( ) { org . nd4j . linalg . api . ndarray . INDArray res = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 5 , 5 , DataType . DOUBLE ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 2 , 3 , 4 , 5 } ) ; "<AssertPlaceHolder>" ; } create ( int [ ] , long [ ] , long [ ] , char , org . nd4j . linalg . api . buffer . DataType ) { lombok . val ret = org . nd4j . linalg . factory . Nd4j . INSTANCE . create ( data , shape , strides , order , type , org . nd4j . linalg . factory . Nd4j . getMemoryManager ( ) . getCurrentWorkspace ( ) ) ; org . nd4j . linalg . factory . Nd4j . logCreationIfNecessary ( ret ) ; return ret ; }
org . junit . Assert . assertEquals ( exp , res )
testGetFooterImage ( ) { org . eclipse . swt . graphics . Image image = org . eclipse . nebula . widgets . grid . GridTestUtil . loadImage ( display , Fixture . IMAGE1 ) ; column . setFooterImage ( image ) ; "<AssertPlaceHolder>" ; } getFooterImage ( ) { checkWidget ( ) ; return footerImage ; }
org . junit . Assert . assertSame ( image , column . getFooterImage ( ) )
objects_isNull ( ) { boolean isNull = java . util . Objects . isNull ( null ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( isNull )
write_ValidImage_WriterCanCompress_HasCompressionTypeFromWriter ( ) { javax . imageio . ImageWriteParam iwParam = mock ( javax . imageio . ImageWriteParam . class ) ; javax . imageio . ImageWriter writer = mock ( javax . imageio . ImageWriter . class ) ; javax . imageio . spi . ImageWriterSpi spi = mock ( javax . imageio . spi . ImageWriterSpi . class ) ; when ( iwParam . canWriteCompressed ( ) ) . thenReturn ( true ) ; when ( iwParam . getCompressionTypes ( ) ) . thenReturn ( new java . lang . String [ ] { "FOOBAR" } ) ; when ( writer . getDefaultWriteParam ( ) ) . thenReturn ( iwParam ) ; when ( writer . getOriginatingProvider ( ) ) . thenReturn ( spi ) ; when ( spi . getFormatNames ( ) ) . thenReturn ( new java . lang . String [ ] { "foo" , "FOO" } ) ; when ( spi . getFileSuffixes ( ) ) . thenReturn ( new java . lang . String [ ] { "foo" , "FOO" } ) ; when ( spi . createWriterInstance ( ) ) . thenReturn ( writer ) ; when ( spi . createWriterInstance ( anyObject ( ) ) ) . thenReturn ( writer ) ; javax . imageio . spi . IIORegistry . getDefaultInstance ( ) . registerServiceProvider ( spi ) ; java . io . File outputFile = new java . io . File ( net . coobird . thumbnailator . tasks . io . FileImageSinkTest . TMPDIR , "test.foo" ) ; outputFile . deleteOnExit ( ) ; java . awt . image . BufferedImage imgToWrite = new java . awt . image . BufferedImage ( 100 , 100 , java . awt . image . BufferedImage . TYPE_INT_RGB ) ; net . coobird . thumbnailator . ThumbnailParameter param = mock ( net . coobird . thumbnailator . ThumbnailParameter . class ) ; when ( param . getOutputQuality ( ) ) . thenReturn ( 0.8F ) ; when ( param . getOutputFormatType ( ) ) . thenReturn ( ThumbnailParameter . DEFAULT_FORMAT_TYPE ) ; net . coobird . thumbnailator . tasks . io . FileImageSink sink = new net . coobird . thumbnailator . tasks . io . FileImageSink ( outputFile ) ; sink . setThumbnailParameter ( param ) ; sink . write ( imgToWrite ) ; "<AssertPlaceHolder>" ; verify ( iwParam , atLeastOnce ( ) ) . setCompressionMode ( ImageWriteParam . MODE_EXPLICIT ) ; verify ( iwParam , atLeastOnce ( ) ) . setCompressionType ( "FOOBAR" ) ; verify ( iwParam , atLeastOnce ( ) ) . setCompressionQuality ( 0.8F ) ; verify ( param , atLeastOnce ( ) ) . getOutputQuality ( ) ; verify ( param , atLeastOnce ( ) ) . getOutputFormatType ( ) ; javax . imageio . spi . IIORegistry . getDefaultInstance ( ) . deregisterServiceProvider ( spi ) ; } getSink ( ) { if ( ! ( written ) ) { throw new java . lang . IllegalStateException ( "BufferedImageSink<sp>has<sp>not<sp>been<sp>written<sp>to<sp>yet." ) ; } return img ; }
org . junit . Assert . assertEquals ( outputFile , sink . getSink ( ) )
testOffsetProducesPositiveOutput ( ) { long testValue = 549888460800L ; org . apache . hadoop . hbase . io . hfile . bucket . BucketCache . BucketEntry bucketEntry = new org . apache . hadoop . hbase . io . hfile . bucket . BucketCache . BucketEntry ( testValue , 10 , 10L , true ) ; "<AssertPlaceHolder>" ; } offset ( ) { long o = ( ( long ) ( offsetBase ) ) & 4294967295L ; o += ( ( ( long ) ( offset1 ) ) & 255 ) << 32 ; return o << 8 ; }
org . junit . Assert . assertEquals ( testValue , bucketEntry . offset ( ) )
testEqualsWorksInHashSet ( ) { java . util . Set < org . eclipse . lyo . oslc4j . core . model . Link > setA = new java . util . HashSet < org . eclipse . lyo . oslc4j . core . model . Link > ( ) { { this . add ( new org . eclipse . lyo . oslc4j . core . model . Link ( java . net . URI . create ( org . eclipse . lyo . oslc4j . core . model . LinkTest . URI_A ) , org . eclipse . lyo . oslc4j . core . model . LinkTest . LABEL_A ) ) ; this . add ( new org . eclipse . lyo . oslc4j . core . model . Link ( java . net . URI . create ( org . eclipse . lyo . oslc4j . core . model . LinkTest . URI_B ) , org . eclipse . lyo . oslc4j . core . model . LinkTest . LABEL_B ) ) ; } } ; java . util . Set < org . eclipse . lyo . oslc4j . core . model . Link > setB = new java . util . HashSet < org . eclipse . lyo . oslc4j . core . model . Link > ( ) { { this . add ( new org . eclipse . lyo . oslc4j . core . model . Link ( java . net . URI . create ( org . eclipse . lyo . oslc4j . core . model . LinkTest . URI_B ) , org . eclipse . lyo . oslc4j . core . model . LinkTest . LABEL_B ) ) ; this . add ( new org . eclipse . lyo . oslc4j . core . model . Link ( java . net . URI . create ( org . eclipse . lyo . oslc4j . core . model . LinkTest . URI_A ) , org . eclipse . lyo . oslc4j . core . model . LinkTest . LABEL_A ) ) ; } } ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertThat ( setA , org . hamcrest . CoreMatchers . equalTo ( setB ) )
testGetUserNamespaceAuthorization ( ) { org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey key = new org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey ( USER_ID , NAMESPACE ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorization userNamespaceAuthorization = new org . finra . herd . model . api . xml . UserNamespaceAuthorization ( ID , key , SUPPORTED_NAMESPACE_PERMISSIONS ) ; when ( userNamespaceAuthorizationService . getUserNamespaceAuthorization ( key ) ) . thenReturn ( userNamespaceAuthorization ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorization resultUserNamespaceAuthorization = userNamespaceAuthorizationRestController . getUserNamespaceAuthorization ( key . getUserId ( ) , key . getNamespace ( ) ) ; verify ( userNamespaceAuthorizationService ) . getUserNamespaceAuthorization ( key ) ; verifyNoMoreInteractions ( userNamespaceAuthorizationService ) ; "<AssertPlaceHolder>" ; } getUserNamespaceAuthorization ( org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey ) { validateUserNamespaceAuthorizationKey ( key ) ; org . finra . herd . model . jpa . UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = getUserNamespaceAuthorizationEntity ( key ) ; return createUserNamespaceAuthorizationFromEntity ( userNamespaceAuthorizationEntity ) ; }
org . junit . Assert . assertEquals ( userNamespaceAuthorization , resultUserNamespaceAuthorization )
fetchInTransactionShouldNotTriggerWriteOnCommit ( ) { final java . lang . String key = "fetch" ; final byte [ ] existingContent = "hello" . getBytes ( ) ; this . cut . begin ( ) ; this . cut . write ( key , existingContent ) ; this . cut . commit ( ) ; this . cut . begin ( ) ; this . cut . fetch ( key ) ; this . cut . commit ( ) ; final byte [ ] actual = this . cut . fetch ( key ) ; "<AssertPlaceHolder>" ; } fetch ( java . lang . String ) { try { final byte [ ] fileContent = readFromFile ( getAbsoluteName ( file ) ) ; final byte [ ] txContent = this . txCache . get ( file ) ; if ( fileContent == null ) { return txContent ; } else { if ( txContent == null ) { return fileContent ; } else { return concat ( fileContent , txContent ) ; } } } catch ( java . io . IOException ex ) { throw new java . lang . IllegalStateException ( ( "Cannot<sp>access<sp>file:<sp>" + ( getAbsoluteName ( file ) ) ) , ex ) ; } }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( existingContent ) )
readerUserCanQuery ( ) { dummyLogin . login ( org . nuxeo . ecm . directory . ldap . TestInternalLDAPSessionSecurity . READER_USER ) ; java . util . Map < java . lang . String , java . io . Serializable > filter = new java . util . HashMap ( ) ; filter . put ( "lastName" , "Manager" ) ; org . nuxeo . ecm . core . api . DocumentModelList entries = userDirSession . query ( filter ) ; "<AssertPlaceHolder>" ; dummyLogin . logout ( ) ; } size ( ) { return getCollectedDocumentIds ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , entries . size ( ) )
readWriteStreamMemoryTweets ( ) { final java . io . InputStream stream = org . openimaj . twitter . USMFStatus . class . getResourceAsStream ( "/org/openimaj/twitter/tweets.txt" ) ; final org . openimaj . twitter . collection . TwitterStatusList < org . openimaj . twitter . USMFStatus > status = org . openimaj . twitter . collection . StreamTwitterStatusList . readUSMF ( stream , org . openimaj . twitter . GeneralJSONTwitterRawText . class ) ; final org . openimaj . twitter . collection . TwitterStatusList < org . openimaj . twitter . USMFStatus > memoryLoaded = new org . openimaj . twitter . collection . MemoryTwitterStatusList < org . openimaj . twitter . USMFStatus > ( status ) ; final java . io . File ascii = folder . newFile ( ( ( "twitter" + ( stream . hashCode ( ) ) ) + ".json" ) ) ; org . openimaj . io . IOUtils . writeASCII ( ascii , memoryLoaded ) ; final org . openimaj . twitter . collection . TwitterStatusList < org . openimaj . twitter . USMFStatus > readStatus = org . openimaj . twitter . collection . MemoryTwitterStatusList . read ( ascii ) ; "<AssertPlaceHolder>" ; ascii . delete ( ) ; } equals ( java . lang . Object ) { return ( obj instanceof ch . akuhn . matrix . SparseMatrix ) && ( rows . equals ( ( ( ch . akuhn . matrix . SparseMatrix ) ( obj ) ) . rows ) ) ; }
org . junit . Assert . assertTrue ( memoryLoaded . equals ( readStatus ) )
testGetStaticLabel ( ) { System . out . println ( "getStaticLabel" ) ; kg . apc . jmeter . vizualizers . ResponseCodesPerSecondGui instance = new kg . apc . jmeter . vizualizers . ResponseCodesPerSecondGui ( ) ; java . lang . String result = instance . getStaticLabel ( ) ; "<AssertPlaceHolder>" ; } getStaticLabel ( ) { return kg . apc . jmeter . JMeterPluginsUtils . prefixLabel ( "Response<sp>Codes<sp>per<sp>Second" ) ; }
org . junit . Assert . assertTrue ( ( ( result . length ( ) ) > 0 ) )
testSetName ( ) { java . lang . String name = "name" ; org . opencastproject . feed . impl . CategoryImplTest . instance . setName ( name ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( org . opencastproject . feed . impl . CategoryImplTest . instance . getName ( ) , name )
givenEmployeeList_andNameFilterList_thenObtainFilteredEmployeeList_usingLambdaAndHashSet ( ) { java . util . List < com . baeldung . collection . filtering . Employee > filteredList ; java . util . List < com . baeldung . collection . filtering . Employee > originalList = buildEmployeeList ( ) ; java . util . Set < java . lang . String > nameFilterSet = employeeNameFilter ( ) . stream ( ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; filteredList = originalList . stream ( ) . filter ( ( employee ) -> nameFilterSet . contains ( employee . getName ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
org . junit . Assert . assertThat ( filteredList . size ( ) , org . hamcrest . Matchers . is ( nameFilterSet . size ( ) ) )
testFailures ( ) { com . arjuna . ats . internal . jta . recovery . arjunacore . XARecoveryModule xarm = new com . arjuna . ats . internal . jta . recovery . arjunacore . XARecoveryModule ( ) ; java . lang . Class < ? > [ ] parameterTypes = new java . lang . Class [ 2 ] ; com . arjuna . ats . arjuna . common . Uid u = new com . arjuna . ats . arjuna . common . Uid ( ) ; javax . transaction . xa . Xid x = new com . arjuna . ats . jta . xa . XidImple ( ) ; parameterTypes [ 0 ] = javax . transaction . xa . Xid . class ; parameterTypes [ 1 ] = com . arjuna . ats . arjuna . common . Uid . class ; java . lang . reflect . Method m = xarm . getClass ( ) . getDeclaredMethod ( "addFailure" , parameterTypes ) ; m . setAccessible ( true ) ; java . lang . Object [ ] parameters = new java . lang . Object [ 2 ] ; parameters [ 0 ] = x ; parameters [ 1 ] = u ; m . invoke ( xarm , parameters ) ; parameterTypes = new java . lang . Class [ 1 ] ; parameterTypes [ 0 ] = javax . transaction . xa . Xid . class ; parameters = new java . lang . Object [ 1 ] ; parameters [ 0 ] = x ; m = xarm . getClass ( ) . getDeclaredMethod ( "previousFailure" , parameterTypes ) ; m . setAccessible ( true ) ; com . arjuna . ats . arjuna . common . Uid ret = ( ( com . arjuna . ats . arjuna . common . Uid ) ( m . invoke ( xarm , parameters ) ) ) ; "<AssertPlaceHolder>" ; parameterTypes = new java . lang . Class [ 2 ] ; parameterTypes [ 0 ] = javax . transaction . xa . Xid . class ; parameterTypes [ 1 ] = com . arjuna . ats . arjuna . common . Uid . class ; parameters = new java . lang . Object [ 2 ] ; parameters [ 0 ] = x ; parameters [ 1 ] = u ; m = xarm . getClass ( ) . getDeclaredMethod ( "removeFailure" , parameterTypes ) ; m . setAccessible ( true ) ; m . invoke ( xarm , parameters ) ; m = xarm . getClass ( ) . getDeclaredMethod ( "clearAllFailures" , ( ( java . lang . Class [ ] ) ( null ) ) ) ; m . setAccessible ( true ) ; m . invoke ( xarm , ( ( java . lang . Object [ ] ) ( null ) ) ) ; } invoke ( java . lang . Class , java . lang . Object [ ] ) { resume ( ) ; java . lang . reflect . Method method = lifecycleEventMap . get ( lifecycleEvent ) ; if ( method == null ) { return null ; } try { method . setAccessible ( true ) ; if ( lifecycleEvent == ( org . jboss . narayana . txframework . api . annotation . lifecycle . ba . ConfirmCompleted . class ) ) { return method . invoke ( serviceInvocationMeta . getProxyInstance ( ) , args ) ; } else { return method . invoke ( serviceInvocationMeta . getProxyInstance ( ) ) ; } } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; throw new java . lang . RuntimeException ( ( ( ( ( "Unable<sp>to<sp>invoke<sp>method<sp>'" + ( method . getName ( ) ) ) + "'<sp>on<sp>'" ) + ( serviceInvocationMeta . getServiceClass ( ) . getName ( ) ) ) + "'" ) , e ) ; } finally { org . jboss . narayana . txframework . impl . Participant . suspend ( ) ; } }
org . junit . Assert . assertEquals ( ret , u )
shouldGenerateNewClassIdForEachClass ( ) { final int id = sun . pitest . CodeCoverageStore . registerClass ( "Foo" ) ; final int id2 = sun . pitest . CodeCoverageStore . registerClass ( "Bar" ) ; "<AssertPlaceHolder>" ; } registerClass ( java . lang . String ) { final int id = sun . pitest . CodeCoverageStore . nextId ( ) ; sun . pitest . CodeCoverageStore . invokeQueue . registerClass ( id , className ) ; return id ; }
org . junit . Assert . assertFalse ( ( id == id2 ) )
readData_InvalidTemperatureEvent ( ) { org . mockito . Mockito . when ( filereader . fileExist ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( filereader . readAllLine ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( new java . lang . String [ ] { "1414108436.923000<sp>" , "1414108436.957000<sp>21" } ) ; java . util . List < com . att . aro . core . peripheral . pojo . TemperatureEvent > listTemperatureEvent = traceDataReader . readData ( traceFolder , 0.0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return sessionTable . size ( ) ; }
org . junit . Assert . assertEquals ( 1.0 , listTemperatureEvent . size ( ) , 0 )
testReconstructByDilationGrayscaleC4 ( ) { int width = 16 ; int height = 10 ; ij . process . ByteProcessor mask = new ij . process . ByteProcessor ( 16 , 10 ) ; ij . process . ByteProcessor marker = new ij . process . ByteProcessor ( 16 , 10 ) ; ij . process . ByteProcessor expected = new ij . process . ByteProcessor ( 16 , 10 ) ; int [ ] maskProfile = new int [ ] { 10 , 10 , 40 , 40 , 40 , 40 , 20 , 20 , 30 , 30 , 10 , 10 , 30 , 30 , 0 , 0 } ; int [ ] markerProfile = new int [ ] { 0 , 0 , 0 , 30 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; int [ ] expectedProfile = new int [ ] { 10 , 10 , 30 , 30 , 30 , 30 , 20 , 20 , 20 , 20 , 10 , 10 , 10 , 10 , 0 , 0 } ; for ( int y = 0 ; y < height ; y ++ ) { for ( int x = 0 ; x < width ; x ++ ) { mask . set ( x , y , maskProfile [ x ] ) ; marker . set ( x , y , markerProfile [ x ] ) ; expected . set ( x , y , expectedProfile [ x ] ) ; } } inra . ijpb . morphology . geodrec . GeodesicReconstructionScanning algo = new inra . ijpb . morphology . geodrec . GeodesicReconstructionScanning ( GeodesicReconstructionType . BY_DILATION , 4 ) ; ij . process . ImageProcessor result = algo . applyTo ( marker , mask ) ; for ( int y = 0 ; y < height ; y ++ ) { for ( int x = 0 ; x < width ; x ++ ) { "<AssertPlaceHolder>" ; } } } get ( int , int ) { if ( x < 0 ) return ( ( int ) ( this . value ) ) ; if ( y < 0 ) return ( ( int ) ( this . value ) ) ; if ( x >= ( this . image . getWidth ( ) ) ) return ( ( int ) ( this . value ) ) ; if ( y >= ( this . image . getHeight ( ) ) ) return ( ( int ) ( this . value ) ) ; return this . image . get ( x , y ) ; }
org . junit . Assert . assertEquals ( expectedProfile [ x ] , result . get ( x , y ) )
testLoadComponentRegister ( ) { com . hazelcast . simulator . utils . FileUtils . writeText ( "192.168.1.1,10.10.10.10" , agentsFile ) ; registry = com . hazelcast . simulator . utils . SimulatorUtils . loadComponentRegister ( agentsFile ) ; "<AssertPlaceHolder>" ; } agentCount ( ) { return agents . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , registry . agentCount ( ) )
testDeserializeStringToUnsignedLong ( ) { long expected = java . lang . Long . parseUnsignedLong ( "9223372036854775808" ) ; long result = getMapper ( ) . readValue ( "{\"unsignedLong\":\"9223372036854775808\"}" , discord4j . common . json . UnsignedLongPojo . class ) . unsignedLong ; "<AssertPlaceHolder>" ; } getMapper ( ) { return new com . fasterxml . jackson . databind . ObjectMapper ( ) . setVisibility ( com . fasterxml . jackson . annotation . PropertyAccessor . FIELD , com . fasterxml . jackson . annotation . JsonAutoDetect . Visibility . ANY ) . configure ( com . fasterxml . jackson . databind . DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , true ) . registerModules ( new discord4j . common . jackson . PossibleModule ( ) , new com . fasterxml . jackson . datatype . jdk8 . Jdk8Module ( ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
testCopyFromArrowToCsv ( ) { lombok . val recordsPair = records ( ) ; java . nio . file . Path p = java . nio . file . Files . createTempFile ( "arrowwritetest" , ".arrow" ) ; org . apache . commons . io . FileUtils . write ( p . toFile ( ) , recordsPair . getFirst ( ) ) ; p . toFile ( ) . deleteOnExit ( ) ; org . datavec . arrow . recordreader . ArrowRecordWriter arrowRecordWriter = new org . datavec . arrow . recordreader . ArrowRecordWriter ( recordsPair . getMiddle ( ) ) ; org . datavec . api . split . FileSplit split = new org . datavec . api . split . FileSplit ( p . toFile ( ) ) ; arrowRecordWriter . initialize ( split , new org . datavec . api . split . partition . NumberOfRecordsPartitioner ( ) ) ; arrowRecordWriter . writeBatch ( recordsPair . getRight ( ) ) ; org . datavec . arrow . recordreader . ArrowRecordReader arrowRecordReader = new org . datavec . arrow . recordreader . ArrowRecordReader ( ) ; arrowRecordReader . initialize ( split ) ; org . datavec . api . records . writer . impl . csv . CSVRecordWriter csvRecordWriter = new org . datavec . api . records . writer . impl . csv . CSVRecordWriter ( ) ; java . nio . file . Path p2 = java . nio . file . Files . createTempFile ( "arrowwritetest" , ".csv" ) ; org . apache . commons . io . FileUtils . write ( p2 . toFile ( ) , recordsPair . getFirst ( ) ) ; p . toFile ( ) . deleteOnExit ( ) ; org . datavec . api . split . FileSplit outputCsv = new org . datavec . api . split . FileSplit ( p2 . toFile ( ) ) ; org . datavec . api . records . mapper . RecordMapper mapper = org . datavec . api . records . mapper . RecordMapper . builder ( ) . batchSize ( 10 ) . inputUrl ( split ) . outputUrl ( outputCsv ) . partitioner ( new org . datavec . api . split . partition . NumberOfRecordsPartitioner ( ) ) . recordReader ( arrowRecordReader ) . recordWriter ( csvRecordWriter ) . build ( ) ; mapper . copy ( ) ; org . datavec . api . records . reader . impl . csv . CSVRecordReader recordReader = new org . datavec . api . records . reader . impl . csv . CSVRecordReader ( ) ; recordReader . initialize ( outputCsv ) ; java . util . List < java . util . List < org . datavec . api . writable . Writable > > loadedCSvRecords = recordReader . next ( 10 ) ; "<AssertPlaceHolder>" ; } size ( ) { return objects . size ( ) ; }
org . junit . Assert . assertEquals ( 10 , loadedCSvRecords . size ( ) )
testMaxContentLengthIgnoredForTitle ( ) { java . lang . String title = com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( 8 ) ; _summaryBuilder . setTitle ( title ) ; _summaryBuilder . setMaxContentLength ( 1 ) ; com . liferay . portal . search . summary . Summary summary = _summaryBuilder . build ( ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return _title ; }
org . junit . Assert . assertEquals ( title , summary . getTitle ( ) )
selectExistentUnselectablePartTest ( ) { final org . uberfire . workbench . model . PartDefinition part = getPartDefinition ( false , true ) ; final boolean selected = listBar . selectPart ( part ) ; "<AssertPlaceHolder>" ; verify ( listBar . titleDropDown , never ( ) ) . selectPart ( part ) ; verify ( listBar , never ( ) ) . setupContextMenu ( ) ; verify ( listBar . header ) . setVisible ( false ) ; verify ( listBar ) . resizePanelBody ( ) ; } selectPart ( org . uberfire . workbench . model . PartDefinition ) { if ( ( parts . containsKey ( part ) ) == false ) { return false ; } parts . entrySet ( ) . forEach ( ( e ) -> { if ( e . getKey ( ) . equals ( part ) ) { e . getValue ( ) . show ( ) ; } else { e . getValue ( ) . hide ( ) ; } } ) ; return true ; }
org . junit . Assert . assertTrue ( selected )
dateType ( ) { com . querydsl . core . types . dsl . CaseForEqBuilderTest . Customer c = alias ( com . querydsl . core . types . dsl . CaseForEqBuilderTest . Customer . class , "customer" ) ; com . querydsl . core . types . dsl . DateExpression < java . sql . Date > cases = $ ( c . getAnnualSpending ( ) ) . when ( 1000L ) . then ( new java . sql . Date ( 0 ) ) . otherwise ( new java . sql . Date ( 0 ) ) ; "<AssertPlaceHolder>" ; } otherwise ( com . querydsl . core . types . dsl . Expression ) { caseElements . add ( 0 , new com . querydsl . core . types . dsl . CaseForEqBuilder . CaseElement < D > ( null , otherwise ) ) ; com . querydsl . core . types . dsl . Expression < T > last = null ; for ( com . querydsl . core . types . dsl . CaseForEqBuilder . CaseElement < D > element : caseElements ) { if ( last == null ) { last = com . querydsl . core . types . dsl . Expressions . operation ( ( ( java . lang . Class < T > ) ( type ) ) , Ops . CASE_EQ_ELSE , element . getTarget ( ) ) ; } else { last = com . querydsl . core . types . dsl . Expressions . operation ( ( ( java . lang . Class < T > ) ( type ) ) , Ops . CASE_EQ_WHEN , base , element . getEq ( ) , element . getTarget ( ) , last ) ; } } return createResult ( ( ( java . lang . Class < T > ) ( type ) ) , last ) ; }
org . junit . Assert . assertNotNull ( cases )
workingTreeShouldBeLessThanCacheTree ( ) { org . eclipse . jface . viewers . Viewer viewer = mock ( org . eclipse . jface . viewers . Viewer . class ) ; org . eclipse . egit . ui . internal . synchronize . mapping . GitChangeSetSorter sorter = new org . eclipse . egit . ui . internal . synchronize . mapping . GitChangeSetSorter ( ) ; org . eclipse . egit . ui . internal . synchronize . model . GitModelCache cache = mock ( org . eclipse . egit . ui . internal . synchronize . model . GitModelCache . class ) ; org . eclipse . egit . ui . internal . synchronize . model . GitModelWorkingTree workingTree = mock ( org . eclipse . egit . ui . internal . synchronize . model . GitModelWorkingTree . class ) ; int actual = sorter . compare ( viewer , workingTree , cache ) ; "<AssertPlaceHolder>" ; } compare ( org . eclipse . compare . ITypedElement , org . eclipse . compare . ITypedElement , org . eclipse . compare . ITypedElement ) { if ( actLeft . getType ( ) . equals ( ITypedElement . FOLDER_TYPE ) ) { org . eclipse . compare . structuremergeviewer . DiffNode diffNode = new org . eclipse . compare . structuremergeviewer . DiffNode ( null , org . eclipse . compare . structuremergeviewer . Differencer . CHANGE , actAncestor , actLeft , actRight ) ; org . eclipse . compare . ITypedElement [ ] lc = ( ( org . eclipse . compare . ITypedElement [ ] ) ( ( ( org . eclipse . compare . structuremergeviewer . IStructureComparator ) ( actLeft ) ) . getChildren ( ) ) ) ; org . eclipse . compare . ITypedElement [ ] rc = ( ( org . eclipse . compare . ITypedElement [ ] ) ( ( ( org . eclipse . compare . structuremergeviewer . IStructureComparator ) ( actRight ) ) . getChildren ( ) ) ) ; org . eclipse . compare . ITypedElement [ ] ac = null ; if ( actAncestor != null ) ac = ( ( org . eclipse . compare . ITypedElement [ ] ) ( ( ( org . eclipse . compare . structuremergeviewer . IStructureComparator ) ( actAncestor ) ) . getChildren ( ) ) ) ; int li = 0 ; int ri = 0 ; while ( ( li < ( lc . length ) ) && ( ri < ( rc . length ) ) ) { org . eclipse . compare . ITypedElement ln = lc [ li ] ; org . eclipse . compare . ITypedElement rn = rc [ ri ] ; org . eclipse . compare . ITypedElement an = null ; if ( ac != null ) an = ac [ ri ] ; int compareTo = ln . getName ( ) . compareTo ( rn . getName ( ) ) ; if ( compareTo == 0 ) { if ( ! ( ln . equals ( rn ) ) ) diffNode . add ( compare ( ln , rn , an ) ) ; ++ li ; ++ ri ; } else if ( compareTo < 0 ) { org . eclipse . compare . structuremergeviewer . DiffNode childDiffNode = new org . eclipse . compare . structuremergeviewer . DiffNode ( org . eclipse . compare . structuremergeviewer . Differencer . ADDITION , an , ln , null ) ; diffNode . add ( childDiffNode ) ; if ( ln . getType ( ) . equals ( ITypedElement . FOLDER_TYPE ) ) { org . eclipse . compare . ITypedElement [ ] children = ( ( org . eclipse . compare . ITypedElement [ ] ) ( ( ( org . eclipse . compare . structuremergeviewer . IStructureComparator ) ( ln ) ) . getChildren ( ) ) ) ; if ( ( children != null ) && ( ( children . length ) > 0 ) ) { for ( org . eclipse . compare . ITypedElement child : children ) { childDiffNode . add ( addDirectoryFiles ( child , Differencer . ADDITION ) ) ; } } } ++ li ; } else { org . eclipse . compare . structuremergeviewer . DiffNode childDiffNode = new org . eclipse . compare . structuremergeviewer . DiffNode ( org . eclipse . compare . structuremergeviewer . Differencer . DELETION , an , null , rn ) ; diffNode . add ( childDiffNode ) ; if ( rn . getType ( ) . equals ( ITypedElement . FOLDER_TYPE ) ) { org . eclipse . compare . ITypedElement [ ] children = ( ( org . eclipse . compare . ITypedElement [ ] ) ( ( ( org . eclipse . compare . structuremergeviewer . IStructureComparator ) ( rn ) ) . getChildren ( ) ) ) ; if ( ( children != null ) && ( ( children . length ) > 0 ) ) { for ( org . eclipse . compare . ITypedElement child : children ) { childDiffNode . add ( addDirectoryFiles ( child , Differencer . DELETION ) ) ; } } } ++ ri ; } } while ( li < ( lc . length ) ) { org . eclipse . compare . ITypedElement ln = lc [ li ] ; org . eclipse . compare . ITypedElement an = null ; if ( ac != null ) an = ac [ li ] ; org . eclipse . compare . structuremergeviewer . DiffNode childDiffNode = new org . eclipse . compare . structuremergeviewer . DiffNode ( org . eclipse . compare . structuremergeviewer . Differencer . ADDITION , an , ln , null ) ; diffNode . add ( childDiffNode ) ; if ( ln . getType ( ) . equals ( ITypedElement . FOLDER_TYPE ) ) { org . eclipse . compare . ITypedElement
org . junit . Assert . assertTrue ( ( actual < 0 ) )
testBytes2Long ( ) { long [ ] testVals = new long [ ] { Long . MIN_VALUE , - 1 , 0 , 1 , Long . MAX_VALUE } ; for ( long testVal : testVals ) { byte [ ] convertedBytes = com . tc . util . Conversion . long2Bytes ( testVal ) ; "<AssertPlaceHolder>" ; } } bytes2Long ( byte [ ] ) { return com . tc . util . Conversion . bytes2Long ( bytes , 0 ) ; }
org . junit . Assert . assertTrue ( ( testVal == ( com . tc . util . Conversion . bytes2Long ( convertedBytes ) ) ) )
byRunId ( ) { java . util . List < org . estatio . module . lease . dom . invoicing . InvoiceForLease > result = invoiceForLeaseRepository . findInvoicesByRunId ( org . estatio . module . lease . integtests . invoicing . InvoiceRepository_IntegTest . FindInvoiceRepositoryByRunId . runId ) ; "<AssertPlaceHolder>" ; } size ( ) { assertThat ( linkRepository . findAllForClassHierarchy ( org . estatio . module . link . dom . LinkRepository_Test . Animal . class ) ) . hasSize ( 2 ) ; assertThat ( linkRepository . findAllForClassHierarchy ( org . estatio . module . link . dom . LinkRepository_Test . Mammal . class ) ) . hasSize ( 2 ) ; assertThat ( linkRepository . findAllForClassHierarchy ( org . estatio . module . link . dom . LinkRepository_Test . Lion . class ) ) . hasSize ( 5 ) ; }
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
testGetScriptEngineFactory ( ) { de . mirkosertic . gameengine . event . GameEventManager theEventManager = mock ( de . mirkosertic . gameengine . event . GameEventManager . class ) ; de . mirkosertic . gameengine . core . GameResourceLoader theResourceLoader = mock ( de . mirkosertic . gameengine . core . GameResourceLoader . class ) ; de . mirkosertic . gameengine . scriptengine . LUAScriptEngineFactory theScriptEngineFactory = mock ( de . mirkosertic . gameengine . scriptengine . LUAScriptEngineFactory . class ) ; de . mirkosertic . gameengine . core . GameRuntime theRuntime = new de . mirkosertic . gameengine . core . GameRuntime ( theEventManager , theResourceLoader , theScriptEngineFactory , new de . mirkosertic . gameengine . core . DefaultLogger ( ) ) ; "<AssertPlaceHolder>" ; } getScriptEngineFactory ( ) { return scriptEngineFactory ; }
org . junit . Assert . assertSame ( theScriptEngineFactory , theRuntime . getScriptEngineFactory ( ) )
checkResourceConstraintsNormal ( ) { final java . lang . String contextId = "test#context#Id" ; final java . lang . String uriName = "/context/index.html" ; final java . lang . String methodName = "POST" ; final java . lang . String [ ] mna = new java . lang . String [ ] { methodName } ; final java . security . Principal principal = new javax . security . auth . x500 . X500Principal ( "cn=data" ) ; final java . util . Set < java . security . Principal > principals = new java . util . HashSet < java . security . Principal > ( ) ; final java . util . Set < ? > credentials = new java . util . HashSet < java . lang . String > ( ) ; principals . add ( principal ) ; final javax . security . auth . Subject subject = new javax . security . auth . Subject ( false , principals , credentials , credentials ) ; final javax . security . jacc . WebResourcePermission webPerm = new javax . security . jacc . WebResourcePermission ( uriName , mna ) ; com . ibm . ws . security . authorization . jacc . web . impl . WebSecurityValidatorImpl wsv = new com . ibm . ws . security . authorization . jacc . web . impl . WebSecurityValidatorImpl ( ) ; "<AssertPlaceHolder>" ; } checkResourceConstraints ( java . lang . String , java . lang . Object , java . security . Permission , javax . security . auth . Subject ) { javax . servlet . http . HttpServletRequest req = null ; if ( httpServletRequest != null ) { try { req = ( ( javax . servlet . http . HttpServletRequest ) ( httpServletRequest ) ) ; } catch ( java . lang . ClassCastException cce ) { com . ibm . websphere . ras . Tr . error ( com . ibm . ws . security . authorization . jacc . web . impl . WebSecurityValidatorImpl . tc , "JACC_WEB_SPI_PARAMETER_ERROR" , new java . lang . Object [ ] { httpServletRequest . getClass ( ) . getName ( ) , "checkDataConstraints" , "HttpServletRequest" } ) ; return false ; } } boolean result = false ; try { final java . util . HashMap < java . lang . String , java . lang . Object > ho = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; final javax . security . auth . Subject s = subject ; final java . lang . String cid = contextId ; final java . security . Permission p = webPerm ; final javax . servlet . http . HttpServletRequest r = req ; result = checkResourceConstraints ( cid , r , p , s , ho ) ; } catch ( java . security . PrivilegedActionException e ) { com . ibm . websphere . ras . Tr . error ( com . ibm . ws . security . authorization . jacc . web . impl . WebSecurityValidatorImpl . tc , "JACC_WEB_IMPLIES_FAILURE" , new java . lang . Object [ ] { contextId , e . getException ( ) } ) ; } return result ; }
org . junit . Assert . assertFalse ( wsv . checkResourceConstraints ( contextId , req , webPerm , subject ) )
testCastCharToShort ( ) { int expected = org . stjs . generator . exec . ints . CharToShort . method ( CharToShort . BIG_CHAR ) ; double expectedDouble = ( ( double ) ( expected ) ) ; "<AssertPlaceHolder>" ; } executeAndReturnNumber ( java . lang . Class ) { return executeAndReturnNumber ( clazz , null ) ; }
org . junit . Assert . assertEquals ( expectedDouble , executeAndReturnNumber ( org . stjs . generator . exec . ints . CharToShort . class ) , 0 )
testNoParamMethod ( ) { com . outbrain . ob1k . server . Server server = null ; com . outbrain . ob1k . server . services . SimpleTestService client = null ; try { server = com . outbrain . ob1k . server . BasicServerRpcTest . buildServer ( null ) ; final int port = server . start ( ) . getPort ( ) ; client = buildClientForSimpleTest ( port ) ; try { final java . lang . Integer nextNum = client . nextRandom ( ) . get ( ) ; "<AssertPlaceHolder>" ; } catch ( final java . lang . Exception e ) { org . junit . Assert . fail ( ( "no<sp>params<sp>method<sp>failed.<sp>error:<sp>" + ( e . getMessage ( ) ) ) ) ; } } finally { if ( client != null ) com . outbrain . ob1k . client . Clients . close ( client ) ; if ( server != null ) server . stop ( ) ; } } get ( ) { return credentials ; }
org . junit . Assert . assertTrue ( ( nextNum != null ) )
convertStringToPropertiesTest ( ) { java . lang . String propsStr = "prop1=valA:prop2=valB:prop3=valC" ; java . util . Properties propsExpected = new java . util . Properties ( ) ; propsExpected . put ( "prop1" , "valA" ) ; propsExpected . put ( "prop2" , "valB" ) ; propsExpected . put ( "prop3" , "valC" ) ; java . util . Properties propsActual = org . glassfish . common . util . admin . MapInjectionResolver . convertStringToProperties ( propsStr , ':' ) ; "<AssertPlaceHolder>" ; } convertStringToProperties ( java . lang . String , char ) { final java . util . Properties properties = new java . util . Properties ( ) ; if ( propsString != null ) { org . glassfish . common . util . admin . ParamTokenizer stoken = new org . glassfish . common . util . admin . ParamTokenizer ( propsString , sep ) ; while ( stoken . hasMoreTokens ( ) ) { java . lang . String token = stoken . nextTokenKeepEscapes ( ) ; final org . glassfish . common . util . admin . ParamTokenizer nameTok = new org . glassfish . common . util . admin . ParamTokenizer ( token , '=' ) ; java . lang . String name = null ; java . lang . String value = null ; if ( nameTok . hasMoreTokens ( ) ) name = nameTok . nextToken ( ) . trim ( ) ; if ( nameTok . hasMoreTokens ( ) ) value = nameTok . nextToken ( ) ; if ( name == null ) throw new java . lang . IllegalArgumentException ( org . glassfish . common . util . admin . MapInjectionResolver . localStrings . getLocalString ( "PropertyMissingName" , "Invalid<sp>property<sp>syntax,<sp>missing<sp>property<sp>name" , propsString ) ) ; if ( value == null ) throw new java . lang . IllegalArgumentException ( org . glassfish . common . util . admin . MapInjectionResolver . localStrings . getLocalString ( "PropertyMissingValue" , "Invalid<sp>property<sp>syntax,<sp>missing<sp>property<sp>value" , token ) ) ; if ( nameTok . hasMoreTokens ( ) ) throw new java . lang . IllegalArgumentException ( org . glassfish . common . util . admin . MapInjectionResolver . localStrings . getLocalString ( "PropertyExtraEquals" , "Invalid<sp>property<sp>syntax,<sp>\"=\"<sp>in<sp>value" , token ) ) ; properties . setProperty ( name , value ) ; } } return properties ; }
org . junit . Assert . assertEquals ( propsExpected , propsActual )
testGetInUserCount ( ) { System . out . println ( "getInUserCount" ) ; kg . apc . jmeter . threads . SteppingThreadGroup instance = new kg . apc . jmeter . threads . SteppingThreadGroup ( ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getInUserCount ( ) ; "<AssertPlaceHolder>" ; } getInUserCount ( ) { return getPropertyAsString ( kg . apc . jmeter . threads . SteppingThreadGroup . INC_USER_COUNT ) ; }
org . junit . Assert . assertEquals ( expResult , result )