input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testRfcSyslog ( ) { loadSyslogConfiguration ( "/etc/syslogd-rfc-configuration.xml" ) ; startSyslogdJavaNet ( ) ; m_eventCounter . anticipate ( ) ; java . net . InetAddress address = java . net . InetAddress . getLocalHost ( ) ; byte [ ] bytes = "<34>1<sp>2010-08-19T22:14:15.000Z<sp>localhost<sp>-<sp>-<sp>-<sp>-<sp>foo0:<sp>load<sp>test<sp>0<sp>on<sp>tty1
|
org . junit . Assert . assertEquals ( 1 , m_eventCounter . getCount ( ) )
|
testRandomMediumAccess ( ) { for ( int i = 0 ; i < ( ( buffer . capacity ( ) ) - 2 ) ; i += 3 ) { int value = random . nextInt ( ) ; buffer . setMedium ( i , value ) ; } random . setSeed ( seed ) ; for ( int i = 0 ; i < ( ( buffer . capacity ( ) ) - 2 ) ; i += 3 ) { int value = ( ( random . nextInt ( ) ) << 8 ) > > 8 ; "<AssertPlaceHolder>" ; } } getMedium ( int ) { int value = getUnsignedMedium ( index ) ; if ( ( value & 8388608 ) != 0 ) { value |= - 16777216 ; } return value ; }
|
org . junit . Assert . assertEquals ( value , buffer . getMedium ( i ) )
|
testOnDistortedSine ( ) { int numPoints = 100 ; double [ ] xval = new double [ numPoints ] ; double [ ] yval = new double [ numPoints ] ; double xnoise = 0.1 ; double ynoise = 0.2 ; generateSineData ( xval , yval , xnoise , ynoise ) ; org . apache . commons . math . analysis . interpolation . LoessInterpolator li = new org . apache . commons . math . analysis . interpolation . LoessInterpolator ( 0.3 , 4 , 1.0E-12 ) ; double [ ] res = li . smooth ( xval , yval ) ; double noisyResidualSum = 0 ; double fitResidualSum = 0 ; for ( int i = 0 ; i < numPoints ; ++ i ) { double expected = java . lang . Math . sin ( xval [ i ] ) ; double noisy = yval [ i ] ; double fit = res [ i ] ; noisyResidualSum += java . lang . Math . pow ( ( noisy - expected ) , 2 ) ; fitResidualSum += java . lang . Math . pow ( ( fit - expected ) , 2 ) ; } "<AssertPlaceHolder>" ; } pow ( org . apache . commons . math . complex . Complex , org . apache . commons . math . complex . Complex ) { return org . apache . commons . math . complex . ComplexUtils . exp ( x . multiply ( org . apache . commons . math . complex . ComplexUtils . log ( y ) ) ) ; }
|
org . junit . Assert . assertTrue ( ( fitResidualSum < noisyResidualSum ) )
|
isUserNameAsEmailValid_shouldReturnTrueIfEmailValid ( ) { java . lang . String [ ] valids = new java . lang . String [ ] { "mkyong@yahoo.com" , "mkyong-100@yahoo.com" , "mkyong.100@yahoo.com" , "mkyong111@mkyong.com" , "mkyong-100@mkyong.net" , "mkyong.100@mkyong.com.au" , "mkyong@1.com" , "mkyong@gmail.com.com" , "mk@t-yong.de" } ; for ( java . lang . String email : valids ) { "<AssertPlaceHolder>" ; } } isUserNameAsEmailValid ( java . lang . String ) { return org . apache . commons . validator . routines . EmailValidator . getInstance ( ) . isValid ( username ) ; }
|
org . junit . Assert . assertTrue ( validator . isUserNameAsEmailValid ( email ) )
|
testFixT11AppMessageCracking ( ) { quickfix . fix50 . Email message = new quickfix . fix50 . Email ( ) ; message . getHeader ( ) . setString ( BeginString . FIELD , FixVersions . BEGINSTRING_FIXT11 ) ; message . getHeader ( ) . setString ( SenderCompID . FIELD , "SENDER" ) ; message . getHeader ( ) . setString ( TargetCompID . FIELD , "TARGET" ) ; message . getHeader ( ) . setString ( ApplVerID . FIELD , ApplVerID . FIX50SP2 ) ; quickfix . MessageCracker cracker = new quickfix . MessageCracker ( ) { @ quickfix . SuppressWarnings ( "unused" ) public void onMessage ( quickfix . fix50 . Email email , quickfix . SessionID sessionID ) { ( messageCracked ) ++ ; } } ; cracker . crack ( message , new quickfix . SessionID ( FixVersions . BEGINSTRING_FIXT11 , "SENDER" , "TARGET" ) ) ; "<AssertPlaceHolder>" ; } onMessage ( quickfix . fix42 . NewOrderSingle , quickfix . SessionID ) { java . lang . String senderCompId = message . getHeader ( ) . getString ( SenderCompID . FIELD ) ; java . lang . String targetCompId = message . getHeader ( ) . getString ( TargetCompID . FIELD ) ; java . lang . String clOrdId = message . getString ( ClOrdID . FIELD ) ; java . lang . String symbol = message . getString ( Symbol . FIELD ) ; char side = message . getChar ( Side . FIELD ) ; char ordType = message . getChar ( OrdType . FIELD ) ; double price = 0 ; if ( ordType == ( quickfix . field . OrdType . LIMIT ) ) { price = message . getDouble ( Price . FIELD ) ; } double qty = message . getDouble ( OrderQty . FIELD ) ; char timeInForce = quickfix . field . TimeInForce . DAY ; if ( message . isSetField ( TimeInForce . FIELD ) ) { timeInForce = message . getChar ( TimeInForce . FIELD ) ; } try { if ( timeInForce != ( quickfix . field . TimeInForce . DAY ) ) { throw new java . lang . RuntimeException ( "Unsupported<sp>TIF,<sp>use<sp>Day" ) ; } quickfix . examples . ordermatch . Order order = new quickfix . examples . ordermatch . Order ( clOrdId , symbol , senderCompId , targetCompId , side , ordType , price , ( ( int ) ( qty ) ) ) ; processOrder ( order ) ; } catch ( java . lang . Exception e ) { rejectOrder ( targetCompId , senderCompId , clOrdId , symbol , side , e . getMessage ( ) ) ; } }
|
org . junit . Assert . assertTrue ( ( ( messageCracked ) > 0 ) )
|
multi_classloader_context_Test ( ) { java . net . URL [ ] urls = new java . net . URL [ ] { new java . net . URL ( "file:test-resources/classpath/multi1/beans.jar" ) } ; java . net . URLClassLoader classLoader = new java . net . URLClassLoader ( urls ) ; org . openl . rules . project . instantiation . SimpleProjectEngineFactory < java . lang . Object > factory = new org . openl . rules . project . instantiation . SimpleProjectEngineFactory . SimpleProjectEngineFactoryBuilder ( ) . setClassLoader ( classLoader ) . setProvideRuntimeContext ( true ) . setProject ( "test-resources/classpath/multi2" ) . build ( ) ; java . lang . Object instance = factory . newInstance ( ) ; "<AssertPlaceHolder>" ; } newInstance ( ) { return type . newInstance ( openl . getVm ( ) . getRuntimeEnv ( ) ) ; }
|
org . junit . Assert . assertNotNull ( instance )
|
_1_A$ ( ) { java . lang . String _1 = "foo" ; java . lang . Integer _2 = 123 ; java . lang . Long _3 = 456L ; java . lang . Boolean _4 = false ; com . m3 . scalaflavor4j . Tuple4 < java . lang . String , java . lang . Integer , java . lang . Long , java . lang . Boolean > target = com . m3 . scalaflavor4j . Tuple4 . apply ( _1 , _2 , _3 , _4 ) ; java . lang . String actual = target . _1 ( ) ; java . lang . String expected = "foo" ; "<AssertPlaceHolder>" ; } _1 ( ) { return _1 ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testSetValidationMessage_emptyGroupId ( ) { enableUi ( ) ; "<AssertPlaceHolder>" ; verify ( dialogPage ) . setMessage ( "Provide<sp>Maven<sp>Group<sp>ID." , IMessageProvider . INFORMATION ) ; } setValidationMessage ( org . eclipse . jface . dialogs . DialogPage ) { org . eclipse . core . runtime . IStatus status = validateMavenSettings ( ) ; if ( status . isOK ( ) ) { return true ; } if ( ( org . eclipse . core . runtime . IStatus . ERROR ) == ( status . getSeverity ( ) ) ) { page . setErrorMessage ( status . getMessage ( ) ) ; } else if ( ( org . eclipse . core . runtime . IStatus . WARNING ) == ( status . getSeverity ( ) ) ) { page . setMessage ( status . getMessage ( ) , IMessageProvider . WARNING ) ; } else if ( ( org . eclipse . core . runtime . IStatus . INFO ) == ( status . getSeverity ( ) ) ) { page . setMessage ( status . getMessage ( ) , IMessageProvider . INFORMATION ) ; } return false ; }
|
org . junit . Assert . assertFalse ( ui . setValidationMessage ( dialogPage ) )
|
testInvalidURL ( ) { org . apache . hive . jdbc . HiveDriver driver = new org . apache . hive . jdbc . HiveDriver ( ) ; java . sql . Connection conn = driver . connect ( "jdbc:derby://localhost:10000/default" , new java . util . Properties ( ) ) ; "<AssertPlaceHolder>" ; } connect ( org . apache . hadoop . hive . ql . exec . spark . SparkTran , org . apache . hadoop . hive . ql . exec . spark . SparkTran ) { rootTrans . remove ( child ) ; leafTrans . remove ( parent ) ; if ( ( transGraph . get ( parent ) ) == null ) { transGraph . put ( parent , new java . util . LinkedList < org . apache . hadoop . hive . ql . exec . spark . SparkTran > ( ) ) ; } if ( ( invertedTransGraph . get ( child ) ) == null ) { invertedTransGraph . put ( child , new java . util . LinkedList < org . apache . hadoop . hive . ql . exec . spark . SparkTran > ( ) ) ; } transGraph . get ( parent ) . add ( child ) ; invertedTransGraph . get ( child ) . add ( parent ) ; }
|
org . junit . Assert . assertNull ( conn )
|
testSave ( ) { java . lang . String fileName = "target/test-classes/example-app.json" ; java . lang . String appName = "example-app" ; long lifetime = 3600L ; java . lang . String queue = "default" ; try { int result = org . apache . hadoop . yarn . service . client . TestApiServiceClient . asc . actionSave ( fileName , appName , lifetime , queue ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException | org . apache . hadoop . yarn . exceptions . YarnException e ) { org . junit . Assert . fail ( ) ; } } actionSave ( java . lang . String , java . lang . String , java . lang . Long , java . lang . String ) { int result = EXIT_SUCCESS ; try { org . apache . hadoop . yarn . service . api . records . Service service = loadAppJsonFromLocalFS ( fileName , appName , lifetime , queue ) ; service . setState ( ServiceState . STOPPED ) ; java . lang . String buffer = jsonSerDeser . toJson ( service ) ; com . sun . jersey . api . client . ClientResponse response = getApiClient ( ) . post ( com . sun . jersey . api . client . ClientResponse . class , buffer ) ; result = processResponse ( response ) ; } catch ( java . lang . Exception e ) { org . apache . hadoop . yarn . service . client . ApiServiceClient . LOG . error ( "Fail<sp>to<sp>save<sp>application:<sp>" , e ) ; result = EXIT_EXCEPTION_THROWN ; } return result ; }
|
org . junit . Assert . assertEquals ( org . apache . hadoop . yarn . service . client . EXIT_SUCCESS , result )
|
testParameterizedDoubleDelegation ( ) { org . eclipse . xtend2 . lib . StringConcatenation _builder = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder . append ( "R:<sp>F<true><sp>|<sp>F<false>;" ) ; _builder . newLine ( ) ; _builder . append ( "fragment<sp>F<X>:<sp>f+=ID;" ) ; _builder . newLine ( ) ; final java . lang . String actual = this . toPda ( _builder ) ; org . eclipse . xtend2 . lib . StringConcatenation _builder_1 = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder_1 . append ( "R:" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "start<sp>-><sp>>>F,<sp>>>F" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "<<F<sp>-><sp>stop" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "<<F<sp>-><sp>stop" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( ">>F<sp>-><sp>f+=ID" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( ">>F<sp>-><sp>f+=ID" ) ; _builder_1 . newLine ( ) ; _builder_1 . append ( "\t" ) ; _builder_1 . append ( "f+=ID<sp>-><sp><<F,<sp><<F" ) ; _builder_1 . newLine ( ) ; final java . lang . String expected = _builder_1 . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . Joiner . on ( "\n" ) . join ( getList ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testIntronic ( ) { java . lang . String [ ] legacyVariantStrings = new java . lang . String [ ] { "XXX:IVS3+3C>T" , "XXX:IVS3-3C>T" } ; for ( java . lang . String legacyVariantString : legacyVariantStrings ) { de . charite . compbio . jannovar . hgvs . legacy . LegacyVariant variant = driver . parseLegacyChangeString ( legacyVariantString ) ; "<AssertPlaceHolder>" ; } } toLegacyString ( ) { return com . google . common . base . Joiner . on ( "" ) . join ( location . toLegacyString ( ) , "del" , deletedSeq . toHGVSString ( ) ) ; }
|
org . junit . Assert . assertEquals ( legacyVariantString , variant . toLegacyString ( ) )
|
testRemoveAll ( ) { remove ( "*:*" ) ; final long resize = query ( "*:*" ) ; "<AssertPlaceHolder>" ; } query ( java . lang . String ) { final io . vertigo . dynamo . search . model . SearchQuery searchQuery = io . vertigo . dynamo . search . model . SearchQuery . builder ( io . vertigo . dynamo . collections . ListFilter . of ( query ) ) . build ( ) ; return doQuery ( searchQuery , null ) . getCount ( ) ; }
|
org . junit . Assert . assertEquals ( 0L , resize )
|
toString_A$ ( ) { java . lang . String actual = com . m3 . scalaflavor4j . Tuple3 . apply ( 1 , 2 , 3 ) . toString ( ) ; java . lang . String expected = "(1,2,3)" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( "SInt(" + ( value ) ) + ")" ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testFindAllTestsToUpdate ( ) { il . co . topq . difido . model . execution . MachineNode machine = il . co . topq . report . business . elastic . ExecutionMetaDataGenerator . generateMachineNode ( 2 , 10 ) ; java . util . Set < il . co . topq . difido . model . execution . TestNode > tests = il . co . topq . report . business . elastic . EsControllerIT . controller . getExecutionTests ( machine ) ; java . util . Set < il . co . topq . difido . model . execution . TestNode > clonedTests = il . co . topq . report . business . elastic . EsControllerIT . controller . cloneTests ( tests ) ; il . co . topq . report . business . elastic . EsControllerIT . controller . savedTestsPerExecution . put ( 1 , clonedTests ) ; for ( il . co . topq . difido . model . execution . TestNode test : tests ) { test . addProperty ( "foo" , "bar" ) ; } java . util . Set < il . co . topq . difido . model . execution . TestNode > testsToUpdate = il . co . topq . report . business . elastic . EsControllerIT . controller . findTestsToUpdate ( 1 , tests ) ; "<AssertPlaceHolder>" ; } findTestsToUpdate ( int , java . util . Set ) { if ( ! ( savedTestsPerExecution . containsKey ( executionId ) ) ) { return executionTests ; } final java . util . Set < il . co . topq . difido . model . execution . TestNode > updatedExecutionTests = savedTestsPerExecution . get ( executionId ) ; final java . util . Set < il . co . topq . difido . model . execution . TestNode > testsToUpdate = new java . util . HashSet < il . co . topq . difido . model . execution . TestNode > ( executionTests ) ; testsToUpdate . removeAll ( updatedExecutionTests ) ; il . co . topq . report . business . elastic . ESController . log . trace ( ( "Found<sp>tests<sp>to<sp>update:<sp>" + testsToUpdate ) ) ; return testsToUpdate ; }
|
org . junit . Assert . assertEquals ( 20 , testsToUpdate . size ( ) )
|
testMaybe ( ) { io . vertx . core . Future < java . lang . String > fut = io . vertx . core . Future . future ( ) ; try { io . reactivex . Maybe justMe = io . reactivex . Maybe . just ( "me" ) ; io . reactivex . plugins . RxJavaPlugins . setOnMaybeAssembly ( ( single ) -> justMe ) ; io . reactivex . Maybe < java . lang . String > maybe = io . vertx . reactivex . impl . AsyncResultMaybe . toMaybe ( fut :: setHandler ) ; "<AssertPlaceHolder>" ; } finally { io . reactivex . plugins . RxJavaPlugins . reset ( ) ; } } toMaybe ( java . util . function . Consumer ) { return io . reactivex . plugins . RxJavaPlugins . onAssembly ( new io . vertx . reactivex . impl . AsyncResultMaybe < T > ( subscriptionConsumer ) ) ; }
|
org . junit . Assert . assertSame ( maybe , justMe )
|
testUpdaterBeforeStart ( ) { try ( org . apache . curator . test . TestingServer server = new org . apache . curator . test . TestingServer ( ) ) { server . start ( ) ; java . lang . String payload = "payload" ; org . apache . curator . RetryPolicy retryPolicy = new org . apache . curator . retry . RetryOneTime ( 1 ) ; try ( org . apache . curator . framework . CuratorFramework client = org . apache . curator . framework . CuratorFrameworkFactory . newClient ( server . getConnectString ( ) , retryPolicy ) ) { client . start ( ) ; java . lang . String path = "/xio/watched/node-init" ; client . create ( ) . orSetData ( ) . creatingParentsIfNeeded ( ) . forPath ( path , payload . getBytes ( ) ) ; com . xjeffrose . xio . core . ZkClient zkClient = new com . xjeffrose . xio . core . ZkClient ( server . getConnectString ( ) ) ; java . util . concurrent . atomic . AtomicReference < java . lang . String > result = new java . util . concurrent . atomic . AtomicReference ( ) ; java . util . concurrent . CountDownLatch signal = new java . util . concurrent . CountDownLatch ( 1 ) ; zkClient . registerUpdater ( new com . xjeffrose . xio . core . ConfigurationUpdater ( ) { @ com . xjeffrose . xio . core . Override public java . lang . String getPath ( ) { return path ; } @ com . xjeffrose . xio . core . Override public void update ( byte [ ] data ) { result . set ( new java . lang . String ( data ) ) ; signal . countDown ( ) ; } } ) ; zkClient . start ( ) ; signal . await ( ) ; "<AssertPlaceHolder>" ; zkClient . stop ( ) ; } } } get ( ) { return data ; }
|
org . junit . Assert . assertEquals ( payload , result . get ( ) )
|
debieraEliminarTipoColportor ( ) { mx . edu . um . mateo . colportor . test . TipoColportorControllerTest . log . debug ( "Debiera<sp>eliminar<sp>TipoColportor" ) ; mx . edu . um . mateo . colportor . model . TipoColportor tipoColportor = new mx . edu . um . mateo . colportor . model . TipoColportor ( "test3" , "A" ) ; tipoColportorDao . crea ( tipoColportor ) ; "<AssertPlaceHolder>" ; this . mockMvc . perform ( post ( Constantes . PATH_TIPO_COLPORTOR_ELIMINA ) . param ( "id" , tipoColportor . getId ( ) . toString ( ) ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( flash ( ) . attributeExists ( Constantes . CONTAINSKEY_MESSAGE ) ) . andExpect ( flash ( ) . attribute ( Constantes . CONTAINSKEY_MESSAGE , "tipoColportor.eliminado.message" ) ) ; } getId ( ) { return id ; }
|
org . junit . Assert . assertNotNull ( tipoColportor . getId ( ) )
|
cipherStreamEncryptDecrypt ( ) { org . ccnx . ccn . impl . support . Log . info ( Log . FAC_TEST , "Starting<sp>cipherStreamEncryptDecrypt" ) ; javax . crypto . Cipher c = org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . keys . getSegmentEncryptionCipher ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . name , org . ccnx . ccn . io . CCNSecureInputStreamTest . outputLibrary . getDefaultPublisher ( ) , 0 ) ; java . io . InputStream is = new java . io . ByteArrayInputStream ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . encrData , 0 , org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . encrData . length ) ; is = new org . ccnx . ccn . impl . security . crypto . UnbufferedCipherInputStream ( is , c ) ; byte [ ] cipherText = new byte [ 4096 ] ; int total ; int res ; for ( total = 0 , res = 0 ; ( res >= 0 ) && ( total < 4096 ) ; total += ( res > 0 ) ? res : 0 ) res = is . read ( cipherText , total , ( 4096 - total ) ) ; c = org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . keys . getSegmentDecryptionCipher ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . name , org . ccnx . ccn . io . CCNSecureInputStreamTest . outputLibrary . getDefaultPublisher ( ) , 0 ) ; is = new java . io . ByteArrayInputStream ( cipherText , 0 , total ) ; is = new org . ccnx . ccn . impl . security . crypto . UnbufferedCipherInputStream ( is , c ) ; byte [ ] buf = new byte [ 4096 ] ; for ( total = 0 , res = 0 ; ( res >= 0 ) && ( total < 4096 ) ; total += ( res > 0 ) ? res : 0 ) res = is . read ( buf , total , ( 4096 - total ) ) ; byte [ ] input = new byte [ java . lang . Math . min ( 4096 , org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . encrLength ) ] ; byte [ ] output = new byte [ java . lang . Math . min ( 4096 , total ) ] ; java . lang . System . arraycopy ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . encrData , 0 , input , 0 , input . length ) ; java . lang . System . arraycopy ( buf , 0 , output , 0 , output . length ) ; "<AssertPlaceHolder>" ; org . ccnx . ccn . impl . support . Log . info ( Log . FAC_TEST , "Completed<sp>cipherStreamEncryptDecrypt" ) ; } read ( byte [ ] , int , int ) { if ( null != ( _input ) ) return _input . read ( buf , offset , len ) ; throw new java . io . IOException ( "Descriptor<sp>not<sp>open<sp>for<sp>reading!" ) ; }
|
org . junit . Assert . assertArrayEquals ( input , output )
|
compareNumberOfMatchingPatterns ( ) { org . springframework . messaging . Message < ? > message = ch . rasc . wampspring . method . DestinationPatternsMessageConditionTest . messageTo ( "/foo" ) ; ch . rasc . wampspring . method . DestinationPatternsMessageCondition c1 = ch . rasc . wampspring . method . DestinationPatternsMessageConditionTest . condition ( "/foo" , "/bar" ) ; ch . rasc . wampspring . method . DestinationPatternsMessageCondition c2 = ch . rasc . wampspring . method . DestinationPatternsMessageConditionTest . condition ( "/foo" , "/f*" ) ; ch . rasc . wampspring . method . DestinationPatternsMessageCondition match1 = c1 . getMatchingCondition ( message ) ; ch . rasc . wampspring . method . DestinationPatternsMessageCondition match2 = c2 . getMatchingCondition ( message ) ; "<AssertPlaceHolder>" ; } compareTo ( ch . rasc . wampspring . method . WampMessageMappingInfo , org . springframework . messaging . Message ) { int result = this . messageTypeMessageCondition . compareTo ( other . messageTypeMessageCondition , message ) ; if ( result != 0 ) { return result ; } result = this . destinationConditions . compareTo ( other . destinationConditions , message ) ; if ( result != 0 ) { return result ; } return 0 ; }
|
org . junit . Assert . assertEquals ( 1 , match1 . compareTo ( match2 , message ) )
|
testGetStatus ( ) { when ( applicationEntityService . getByUUIDOrAppId ( anyString ( ) , anyString ( ) ) ) . thenReturn ( generateRunningEntity ( ) ) ; org . apache . eagle . app . service . ApplicationAction applicationAction = mock ( org . apache . eagle . app . service . ApplicationAction . class ) ; org . powermock . api . mockito . PowerMockito . whenNew ( org . apache . eagle . app . service . ApplicationAction . class ) . withArguments ( anyObject ( ) , anyObject ( ) , anyObject ( ) , anyObject ( ) ) . thenReturn ( applicationAction ) ; when ( applicationAction . getStatus ( ) ) . thenReturn ( ApplicationEntity . Status . RUNNING ) ; org . apache . eagle . metadata . model . ApplicationEntity . Status status = applicationManagementService . getStatus ( checkStatusOperation ) ; "<AssertPlaceHolder>" ; } getStatus ( org . apache . eagle . app . service . impl . ApplicationOperations$CheckStatusOperation ) { try { org . apache . eagle . app . service . impl . ApplicationEntity applicationEntity = applicationEntityService . getByUUIDOrAppId ( operation . getUuid ( ) , operation . getAppId ( ) ) ; org . apache . eagle . app . Application application = applicationProviderService . getApplicationProviderByType ( applicationEntity . getDescriptor ( ) . getType ( ) ) . getApplication ( ) ; com . google . common . base . Preconditions . checkArgument ( application . isExecutable ( ) , "Application<sp>is<sp>not<sp>executable" ) ; org . apache . eagle . app . service . impl . ApplicationAction applicationAction = new org . apache . eagle . app . service . impl . ApplicationAction ( application , applicationEntity , config , alertMetadataService ) ; return applicationAction . getStatus ( ) ; } catch ( java . lang . IllegalArgumentException e ) { org . apache . eagle . app . service . impl . ApplicationManagementServiceImpl . LOGGER . error ( "application<sp>id<sp>not<sp>exist" , e ) ; throw e ; } }
|
org . junit . Assert . assertEquals ( ApplicationEntity . Status . RUNNING , status )
|
testDefaultWithGzipFile ( ) { java . io . BufferedReader reader = gzbrf . create ( new org . springframework . core . io . FileSystemResource ( de . langmi . spring . batch . examples . readers . file . gzip . GZipBufferedReaderFactoryTest . PATH_TO_COMPRESSED_TEST_FILE ) , java . nio . charset . Charset . defaultCharset ( ) . name ( ) ) ; "<AssertPlaceHolder>" ; reader . close ( ) ; } create ( org . springframework . core . io . Resource , java . lang . String ) { for ( java . lang . String suffix : gzipSuffixes ) { if ( ( resource . getFilename ( ) . endsWith ( suffix ) ) || ( resource . getDescription ( ) . endsWith ( suffix ) ) ) { return new java . io . BufferedReader ( new java . io . InputStreamReader ( new java . util . zip . GZIPInputStream ( resource . getInputStream ( ) ) , encoding ) ) ; } } return new java . io . BufferedReader ( new java . io . InputStreamReader ( resource . getInputStream ( ) , encoding ) ) ; }
|
org . junit . Assert . assertNotNull ( reader )
|
testDrawWithNullLegendLabels ( ) { org . jfree . data . general . DefaultPieDataset dataset = new org . jfree . data . general . DefaultPieDataset ( ) ; dataset . setValue ( "L1" , 12.0 ) ; dataset . setValue ( "L2" , 11.0 ) ; org . jfree . chart . JFreeChart chart = org . jfree . chart . ChartFactory . createPieChart ( "Test" , dataset , true , false , false ) ; org . jfree . chart . plot . PiePlot plot = ( ( org . jfree . chart . plot . PiePlot ) ( chart . getPlot ( ) ) ) ; plot . setLegendLabelGenerator ( new org . jfree . chart . plot . PiePlotTest . NullLegendLabelGenerator ( ) ) ; boolean success = false ; try { java . awt . image . BufferedImage image = new java . awt . image . BufferedImage ( 200 , 100 , java . awt . image . BufferedImage . TYPE_INT_RGB ) ; java . awt . Graphics2D g2 = image . createGraphics ( ) ; chart . draw ( g2 , new java . awt . geom . Rectangle2D . Double ( 0 , 0 , 200 , 100 ) , null , null ) ; g2 . dispose ( ) ; success = true ; } catch ( java . lang . Exception e ) { success = false ; } "<AssertPlaceHolder>" ; } dispose ( ) { this . myColor . dispose ( ) ; }
|
org . junit . Assert . assertTrue ( success )
|
testPutUndefined ( ) { com . eclipsesource . v8 . utils . V8Map < java . lang . Object > map = new com . eclipsesource . v8 . utils . V8Map < java . lang . Object > ( ) ; com . eclipsesource . v8 . V8Object v1 = new com . eclipsesource . v8 . V8Object ( v8 ) ; map . put ( v1 , com . eclipsesource . v8 . V8 . getUndefined ( ) ) ; "<AssertPlaceHolder>" ; v1 . close ( ) ; map . close ( ) ; } getUndefined ( ) { return com . eclipsesource . v8 . V8 . undefined ; }
|
org . junit . Assert . assertEquals ( com . eclipsesource . v8 . V8 . getUndefined ( ) , map . get ( v1 ) )
|
testToStringEmptyConfigs ( ) { org . eclipse . kura . core . net . NetInterfaceAddressConfigImpl value = createConfig ( ) ; value . setNetConfigs ( new java . util . ArrayList < org . eclipse . kura . net . NetConfig > ( ) ) ; java . lang . String expected = "" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( "]" 1 ) . append ( this . id ) . append ( "]" 0 ) . append ( this . topic ) . append ( ",<sp>qos=" ) . append ( this . qos ) . append ( ",<sp>retain=" ) . append ( this . retain ) . append ( ",<sp>createdOn=" ) . append ( this . createdOn ) . append ( ",<sp>publishedOn=" ) . append ( this . publishedOn ) . append ( ",<sp>publishedMessageId=" ) . append ( this . publishedMessageId ) . append ( ",<sp>confirmedOn=" ) . append ( this . confirmedOn ) . append ( ",<sp>payload=" ) . append ( java . util . Arrays . toString ( this . payload ) ) . append ( ",<sp>priority=" ) . append ( this . priority ) . append ( ",<sp>sessionId=" ) . append ( this . sessionId ) . append ( "]" 2 ) . append ( this . droppedOn ) . append ( "]" ) ; return builder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , value . toString ( ) )
|
messageSentToQueueSuccessfully ( ) { queue . addMessage ( new fish . payara . notification . hipchat . HipchatMessage ( new fish . payara . notification . hipchat . HipchatNotificationEvent ( ) , "subject" , "hello<sp>world" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return mappings . size ( ) ; }
|
org . junit . Assert . assertThat ( queue . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
|
test_equal ( ) { org . omg . CORBA . Any outAny = setup . getClientOrb ( ) . create_any ( ) ; outAny . insert_string ( "foo" ) ; org . omg . CORBA . Any inAny = setup . getClientOrb ( ) . create_any ( ) ; inAny . insert_string ( "bar" ) ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
|
org . junit . Assert . assertFalse ( outAny . equal ( inAny ) )
|
testGetIssuer ( ) { "<AssertPlaceHolder>" ; } getIssuer ( ) { return issuer ; }
|
org . junit . Assert . assertEquals ( issuer , fixture . getIssuer ( ) )
|
shutdownOk ( ) { final int port = org . metricssampler . TCPControllerTestUtil . setupServer ( "shutdown" , "ok" ) ; final java . lang . String response = testee . shutdown ( "localhost" , port ) ; "<AssertPlaceHolder>" ; } shutdown ( java . lang . String , int ) { try { execute ( host , port , "shutdown" ) ; return "Stopped" ; } catch ( final java . net . ConnectException e ) { return "No<sp>daemon<sp>running<sp>on<sp>port<sp>" + port ; } catch ( final java . io . IOException e ) { return "Failed<sp>to<sp>stop:<sp>" + ( e . getMessage ( ) ) ; } }
|
org . junit . Assert . assertEquals ( "Stopped" , response )
|
emptyConstructorSucceed ( ) { tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . X509Attestation x509Attestation = mockit . Deencapsulation . newInstance ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . X509Attestation . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( x509Attestation )
|
insertNotMatchParameterTest ( ) { java . lang . String sql = ( "insert<sp>into<sp>" + ( normaltblTableName ) ) + "<sp>(id,floatCol)<sp>values(?,?)" ; java . util . List < java . lang . Object > param = new java . util . ArrayList < java . lang . Object > ( ) ; param . add ( gmt ) ; try { andorUpdateData ( sql , param ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception ex ) { "<AssertPlaceHolder>" ; } } andorUpdateData ( java . lang . String , java . util . List ) { int rs = 0 ; try { andorPs = andorCon . prepareStatement ( sql ) ; if ( param == null ) { rs = andorPs . executeUpdate ( ) ; } else { for ( int i = 0 ; i < ( param . size ( ) ) ; i ++ ) { andorPs . setObject ( ( i + 1 ) , param . get ( i ) ) ; } rs = andorPs . executeUpdate ( ) ; } } catch ( java . lang . Exception ex ) { throw new com . taobao . tddl . common . exception . TddlRuntimeException ( ex ) ; } finally { } return rs ; }
|
org . junit . Assert . assertNotNull ( ex )
|
testBijhoudingspartijHistorisch ( ) { final java . util . Set < nl . bzk . brp . domain . algemeen . ZoekCriterium > zoekCriteria = new java . util . HashSet ( ) ; nl . bzk . brp . domain . algemeen . ZoekCriterium zoekCriteria1 = new nl . bzk . brp . domain . algemeen . ZoekCriterium ( getAttribuutElement ( Element . PERSOON_SAMENGESTELDENAAM_GESLACHTSNAAMSTAM ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Zoekoptie . VANAF_KLEIN , "WasVla" ) ; nl . bzk . brp . domain . algemeen . ZoekCriterium zoekCriteria2 = new nl . bzk . brp . domain . algemeen . ZoekCriterium ( getAttribuutElement ( Element . PERSOON_BIJHOUDING_PARTIJCODE ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Zoekoptie . EXACT , 347 ) ; zoekCriteria . add ( zoekCriteria1 ) ; zoekCriteria . add ( zoekCriteria2 ) ; nl . bzk . brp . delivery . dataaccess . bevraging . SqlStamementZoekPersoon sql = new nl . bzk . brp . delivery . dataaccess . bevraging . SqlBepaler ( zoekCriteria , 10 , true , null , false ) . maakSql ( ) ; final java . util . List < java . lang . Long > ids = zoekPersoonRepository . zoekPersonen ( sql , postgres ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , ids . size ( ) )
|
testGetTemplatesByClassPK ( ) { com . liferay . dynamic . data . mapping . model . DDMStructure ddmStructure = addStructure ( com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _recordSetClassNameId , com . liferay . portal . kernel . util . StringUtil . randomString ( ) ) ; java . lang . String language = com . liferay . portal . kernel . template . TemplateConstants . LANG_TYPE_FTL ; java . lang . String script = getTestTemplateScript ( language ) ; addTemplate ( 0 , ddmStructure . getStructureId ( ) , com . liferay . portal . kernel . util . StringUtil . randomString ( ) , null , null , language , script , WorkflowConstants . STATUS_ANY ) ; addTemplate ( 0 , ddmStructure . getStructureId ( ) , com . liferay . portal . kernel . util . StringUtil . randomString ( ) , null , null , language , script , WorkflowConstants . STATUS_ANY ) ; addTemplate ( 0 , ddmStructure . getStructureId ( ) , com . liferay . portal . kernel . util . StringUtil . randomString ( ) , null , null , language , script , WorkflowConstants . STATUS_ANY ) ; java . util . List < com . liferay . dynamic . data . mapping . model . DDMTemplate > templates = com . liferay . dynamic . data . mapping . service . DDMTemplateServiceUtil . getTemplatesByClassPK ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , group . getGroupId ( ) , ddmStructure . getStructureId ( ) , com . liferay . dynamic . data . mapping . service . test . DDMTemplateServiceTest . _recordSetClassNameId , WorkflowConstants . STATUS_ANY ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( templates . toString ( ) , 3 , templates . size ( ) )
|
getHostnameIsCorrect ( ) { final java . lang . String iotHubHostname = "test.iothub" ; final java . lang . String deviceId = "test-deviceid" ; final java . lang . String hostname = "test-hostname" ; new mockit . NonStrictExpectations ( ) { { mockIotHubUri . getHostname ( ) ; result = hostname ; } } ; com . microsoft . azure . sdk . iot . device . net . IotHubEventUri eventUri = new com . microsoft . azure . sdk . iot . device . net . IotHubEventUri ( iotHubHostname , deviceId , "" ) ; java . lang . String testHostname = eventUri . getHostname ( ) ; final java . lang . String expectedHostname = hostname ; "<AssertPlaceHolder>" ; } getHostname ( ) { return this . hostname ; }
|
org . junit . Assert . assertThat ( testHostname , org . hamcrest . CoreMatchers . is ( expectedHostname ) )
|
readSimpleString ( ) { this . request . setContentType ( new org . springframework . http . MediaType ( "application" , "x-amf" ) . toString ( ) ) ; this . request . setContent ( serializeToByteArray ( "foo" ) ) ; org . springframework . http . HttpInputMessage inputMessage = new org . springframework . http . server . ServletServerHttpRequest ( this . request ) ; org . springframework . flex . http . AmfHttpMessageConverter converter = new org . springframework . flex . http . AmfHttpMessageConverter ( ) ; java . lang . Object result = converter . read ( java . lang . Object . class , inputMessage ) ; "<AssertPlaceHolder>" ; } serializeToByteArray ( java . lang . Object ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; flex . messaging . io . amf . Amf3Output serializer = new flex . messaging . io . amf . Amf3Output ( new flex . messaging . io . SerializationContext ( ) ) ; serializer . setOutputStream ( out ) ; serializer . writeObject ( data ) ; try { return out . toByteArray ( ) ; } finally { out . close ( ) ; } }
|
org . junit . Assert . assertEquals ( "foo" , result )
|
toArrayWithZeros ( ) { int size = 10 ; java . lang . Integer [ ] control = new java . lang . Integer [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { control [ i ] = ( ( i % 2 ) == 0 ) ? i : 0 ; } edu . ucla . sspace . util . SparseIntArray arr = new edu . ucla . sspace . util . SparseIntArray ( ) ; for ( int i = 0 ; i < size ; i += 2 ) { arr . set ( control [ i ] , i ) ; } java . lang . Integer [ ] test = new java . lang . Integer [ size ] ; arr . toArray ( test ) ; System . out . println ( java . util . Arrays . toString ( control ) ) ; System . out . println ( java . util . Arrays . toString ( test ) ) ; "<AssertPlaceHolder>" ; } equals ( edu . ucla . sspace . vector . Vector , edu . ucla . sspace . vector . Vector ) { if ( ( v1 . length ( ) ) == ( v2 . length ( ) ) ) { int length = v1 . length ( ) ; for ( int i = 0 ; i < length ; ++ i ) { java . lang . Number n1 = v1 . getValue ( i ) ; java . lang . Number n2 = v2 . getValue ( i ) ; if ( ! ( n1 . equals ( n2 ) ) ) return false ; } return true ; } return false ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( control , test ) )
|
testGetSortingInfo ( ) { org . sagebionetworks . repo . model . table . SortItem foo = new org . sagebionetworks . repo . model . table . SortItem ( ) ; foo . setColumn ( "foo" ) ; foo . setDirection ( SortDirection . ASC ) ; org . sagebionetworks . repo . model . table . SortItem barbar = new org . sagebionetworks . repo . model . table . SortItem ( ) ; barbar . setColumn ( "bar<sp>bar" ) ; barbar . setDirection ( SortDirection . DESC ) ; java . util . List < org . sagebionetworks . repo . model . table . SortItem > expected = java . util . Arrays . asList ( foo , barbar ) ; java . util . List < org . sagebionetworks . repo . model . table . SortItem > results = org . sagebionetworks . table . query . util . TableSqlProcessor . getSortingInfo ( ( ( "select<sp>*<sp>from<sp>" + ( tableId ) ) + "<sp>order<sp>by<sp>foo<sp>asc,<sp>\"bar<sp>bar\"<sp>DESC" ) ) ; "<AssertPlaceHolder>" ; } getSortingInfo ( java . lang . String ) { org . sagebionetworks . table . query . model . QuerySpecification model = org . sagebionetworks . table . query . TableQueryParser . parserQuery ( sql ) ; return org . sagebionetworks . table . query . util . TableSqlProcessor . getSortingInfo ( model ) ; }
|
org . junit . Assert . assertEquals ( expected , results )
|
testSimpleP ( ) { java . util . List < ch . qos . logback . core . pattern . parser . Token > tl = new ch . qos . logback . core . pattern . parser . TokenStream ( "%(hello<sp>%class{.4?})" ) . tokenize ( ) ; java . util . List < ch . qos . logback . core . pattern . parser . Token > witness = new java . util . ArrayList < ch . qos . logback . core . pattern . parser . Token > ( ) ; witness . add ( Token . PERCENT_TOKEN ) ; witness . add ( Token . BARE_COMPOSITE_KEYWORD_TOKEN ) ; witness . add ( new ch . qos . logback . core . pattern . parser . Token ( Token . LITERAL , "hello<sp>" ) ) ; witness . add ( Token . PERCENT_TOKEN ) ; witness . add ( new ch . qos . logback . core . pattern . parser . Token ( Token . SIMPLE_KEYWORD , "class" ) ) ; java . util . List < java . lang . String > ol = new java . util . ArrayList < java . lang . String > ( ) ; ol . add ( ".4?" ) ; witness . add ( new ch . qos . logback . core . pattern . parser . Token ( Token . OPTION , ol ) ) ; witness . add ( Token . RIGHT_PARENTHESIS_TOKEN ) ; "<AssertPlaceHolder>" ; } add ( E ) { ea [ last ] = event ; if ( ( ++ ( last ) ) == ( maxSize ) ) last = 0 ; if ( ( numElems ) < ( maxSize ) ) ( numElems ) ++ ; else if ( ( ++ ( first ) ) == ( maxSize ) ) first = 0 ; }
|
org . junit . Assert . assertEquals ( witness , tl )
|
testParseUrlsAddressNull ( ) { "<AssertPlaceHolder>" ; } parseURLs ( java . lang . String , java . util . Map ) { if ( ( address == null ) || ( ( address . length ( ) ) == 0 ) ) { return null ; } java . lang . String [ ] addresses = Constants . REGISTRY_SPLIT_PATTERN . split ( address ) ; if ( ( addresses == null ) || ( ( addresses . length ) == 0 ) ) { return null ; } java . util . List < com . alibaba . dubbo . common . URL > registries = new java . util . ArrayList < com . alibaba . dubbo . common . URL > ( ) ; for ( java . lang . String addr : addresses ) { registries . add ( com . alibaba . dubbo . common . utils . UrlUtils . parseURL ( addr , defaults ) ) ; } return registries ; }
|
org . junit . Assert . assertNull ( com . alibaba . dubbo . common . utils . UrlUtils . parseURLs ( null , null ) )
|
hashIndexTable_remove_deletesMapping_withIndexAbove127 ( ) { com . eclipsesource . json . JsonObject . HashIndexTable indexTable = new com . eclipsesource . json . JsonObject . HashIndexTable ( ) ; indexTable . add ( "name" , 142 ) ; indexTable . remove ( 142 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { int slot = hashSlotFor ( name ) ; return ( ( hashTable [ slot ] ) & 255 ) - 1 ; }
|
org . junit . Assert . assertEquals ( ( - 1 ) , indexTable . get ( "name" ) )
|
intersectSelf ( ) { org . junit . tests . manipulation . FilterTest . NamedFilter a = new org . junit . tests . manipulation . FilterTest . NamedFilter ( "a" ) ; "<AssertPlaceHolder>" ; } intersect ( org . junit . runner . manipulation . Filter ) { return second ; }
|
org . junit . Assert . assertSame ( a , a . intersect ( a ) )
|
testRemove ( ) { com . liferay . changeset . model . ChangesetEntry newChangesetEntry = addChangesetEntry ( ) ; _persistence . remove ( newChangesetEntry ) ; com . liferay . changeset . model . ChangesetEntry existingChangesetEntry = _persistence . fetchByPrimaryKey ( newChangesetEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertNull ( existingChangesetEntry )
|
jsonArraySupport ( ) { addVariable ( "array" , new org . json . JSONArray ( "[1,<sp>2]" ) ) ; int result = evaluate ( "${array[0]<sp>+<sp>array[1]}" , org . apache . shindig . expressions . Integer . class ) ; "<AssertPlaceHolder>" ; } evaluate ( java . lang . String , java . lang . Class ) { javax . el . ValueExpression expr = expressions . parse ( expression , type ) ; return type . cast ( expr . getValue ( context ) ) ; }
|
org . junit . Assert . assertEquals ( 3 , result )
|
shouldClearExistingFacets ( ) { com . couchbase . client . java . search . SearchQuery p = new com . couchbase . client . java . search . SearchQuery ( null , null ) . addFacet ( "A" , com . couchbase . client . java . search . facet . SearchFacet . term ( "field1" , 1 ) ) . clearFacets ( ) . addFacet ( "B" , com . couchbase . client . java . search . facet . SearchFacet . term ( "field2" , 2 ) ) ; com . couchbase . client . java . document . json . JsonObject result = com . couchbase . client . java . document . json . JsonObject . create ( ) ; p . injectParams ( result ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "facets" , com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "B" , com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "field" , "field2" ) . put ( "size" , 2 ) ) ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , V ) { if ( key == null ) { throw new java . lang . NullPointerException ( "Unsupported<sp>null<sp>key" ) ; } if ( ! ( com . couchbase . client . java . document . json . JsonValue . checkType ( value ) ) ) { throw new java . lang . IllegalArgumentException ( "Unsupported<sp>value<sp>type." ) ; } for ( int i = 0 ; i < ( com . couchbase . client . java . datastructures . collections . CouchbaseMap . MAX_OPTIMISTIC_LOCKING_ATTEMPTS ) ; i ++ ) { try { com . couchbase . client . java . subdoc . DocumentFragment < com . couchbase . client . core . message . kv . subdoc . multi . Lookup > current = bucket . lookupIn ( id ) . get ( key ) . execute ( ) ; long returnCas = current . cas ( ) ; java . lang . Object result = null ; if ( current . exists ( key ) ) { result = current . content ( key ) ; } bucket . mutateIn ( id ) . upsert ( key , value , false ) . withCas ( returnCas ) . execute ( ) ; return ( ( V ) ( result ) ) ; } catch ( com . couchbase . client . java . error . CASMismatchException ex ) { } } throw new java . util . ConcurrentModificationException ( ( ( "Couldn't<sp>perform<sp>put<sp>in<sp>less<sp>than<sp>" + ( com . couchbase . client . java . datastructures . collections . CouchbaseMap . MAX_OPTIMISTIC_LOCKING_ATTEMPTS ) ) + "<sp>iterations" ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
shouldReturnFalseForOpenBracket ( ) { boolean start = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isWordStart ( "(" , 0 ) ; "<AssertPlaceHolder>" ; } isWordStart ( java . lang . String , int ) { checkNotNull ( entityName ) ; int length = entityName . length ( ) ; checkElementIndex ( index , length ) ; edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType indexCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , index ) ; if ( ! ( indexCharType . isWordLetter ( ) ) ) { return false ; } if ( index == 0 ) { return true ; } edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType prevCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index - 1 ) ) ; if ( prevCharType != indexCharType ) { return ! ( ( indexCharType == ( EntityNameCharType . LETTER ) ) && ( prevCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) ) ; } if ( indexCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) { boolean hasFollowingCharacter = index < ( length - 1 ) ; return hasFollowingCharacter && ( ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index + 1 ) ) ) == ( EntityNameCharType . LETTER ) ) ; } return false ; }
|
org . junit . Assert . assertEquals ( false , start )
|
testSerialization2 ( ) { org . jfree . chart . renderer . xy . XYBarRenderer r1 = new org . jfree . chart . renderer . xy . XYBarRenderer ( ) ; r1 . setPositiveItemLabelPositionFallback ( new org . jfree . chart . labels . ItemLabelPosition ( ) ) ; org . jfree . chart . renderer . xy . XYBarRenderer r2 = ( ( org . jfree . chart . renderer . xy . XYBarRenderer ) ( org . jfree . chart . TestUtilities . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( r1 , r2 )
|
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . expando . kernel . model . ExpandoTable > expandoTables = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( expandoTables . isEmpty ( ) )
|
testHandleSetxpanded_expand ( ) { org . eclipse . rap . rwt . testfixture . internal . Fixture . fakePhase ( PhaseId . PROCESS_ACTION ) ; handler . handleSet ( new org . eclipse . rap . json . JsonObject ( ) . add ( "expanded" , true ) ) ; "<AssertPlaceHolder>" ; } getExpanded ( ) { checkWidget ( ) ; return expanded ; }
|
org . junit . Assert . assertTrue ( item . getExpanded ( ) )
|
testLocalTime ( ) { org . joda . time . LocalTime original = new org . joda . time . LocalTime ( ) ; com . google . gson . JsonElement element = pt . ist . fenixframework . util . JsonConverter . getJsonFor ( original ) ; System . out . println ( ( "LocalTime:<sp>" + ( element . toString ( ) ) ) ) ; org . joda . time . LocalTime other = pt . ist . fenixframework . util . JsonConverter . getLocalTimeFromJson ( element ) ; "<AssertPlaceHolder>" ; } getLocalTimeFromJson ( com . google . gson . JsonElement ) { if ( value . isJsonNull ( ) ) { return null ; } return new org . joda . time . LocalTime ( value . getAsString ( ) ) ; }
|
org . junit . Assert . assertEquals ( original , other )
|
testComputeIndexMapStart ( ) { int [ ] expectedIndexMap = new int [ ] { - 1 , 2 , 3 , 4 } ; org . apache . avro . Schema designSchema = org . apache . avro . SchemaBuilder . builder ( ) . record ( "Record" ) . prop ( DiSchemaConstants . TALEND6_DYNAMIC_COLUMN_POSITION , "0" ) . prop ( SchemaConstants . INCLUDE_ALL_FIELDS , "true" ) . fields ( ) . name ( "col1" ) . type ( ) . intType ( ) . noDefault ( ) . name ( "col2" ) . type ( ) . stringType ( ) . noDefault ( ) . name ( "col3" ) . type ( ) . intType ( ) . noDefault ( ) . endRecord ( ) ; org . apache . avro . Schema runtimeSchema = org . apache . avro . SchemaBuilder . builder ( ) . record ( "Record" ) . fields ( ) . name ( "col0_1" ) . type ( ) . intType ( ) . noDefault ( ) . name ( "col0_2" ) . type ( ) . intType ( ) . noDefault ( ) . name ( "col1" ) . type ( ) . intType ( ) . noDefault ( ) . name ( "col2" ) . type ( ) . stringType ( ) . noDefault ( ) . name ( "col3" ) . type ( ) . intType ( ) . noDefault ( ) . endRecord ( ) ; org . talend . codegen . enforcer . DynamicIndexMapperByIndex indexMapper = new org . talend . codegen . enforcer . DynamicIndexMapperByIndex ( designSchema ) ; int [ ] actualIndexMap = indexMapper . computeIndexMap ( runtimeSchema ) ; "<AssertPlaceHolder>" ; } computeIndexMap ( org . apache . avro . Schema ) { int [ ] indexMap = new int [ ( designSchemaSize ) + 1 ] ; indexMap [ dynamicFieldPosition ] = DYNAMIC ; for ( int i = 0 ; i < ( designSchemaSize ) ; i ++ ) { org . apache . avro . Schema . Field designField = designFields . get ( i ) ; java . lang . String fieldName = designField . name ( ) ; org . apache . avro . Schema . Field runtimeField = runtimeSchema . getField ( fieldName ) ; if ( i < ( dynamicFieldPosition ) ) { indexMap [ i ] = ( runtimeField != null ) ? runtimeField . pos ( ) : MISSING_DESIGN_FIELD ; } else { indexMap [ ( i + 1 ) ] = ( runtimeField != null ) ? runtimeField . pos ( ) : MISSING_DESIGN_FIELD ; } } return indexMap ; }
|
org . junit . Assert . assertArrayEquals ( expectedIndexMap , actualIndexMap )
|
skipSagaEndedEvent_IfGlobalTxAlreadyFailed ( ) { java . lang . String localTxId1 = java . util . UUID . randomUUID ( ) . toString ( ) ; events . add ( eventOf ( org . apache . servicecomb . pack . alpha . core . SagaStartedEvent , localTxId1 ) ) ; events . add ( eventOf ( org . apache . servicecomb . pack . alpha . core . TxAbortedEvent , localTxId1 ) ) ; org . apache . servicecomb . pack . alpha . core . TxEvent event = eventOf ( org . apache . servicecomb . pack . alpha . core . SagaEndedEvent , localTxId1 ) ; consistentService . handle ( event ) ; "<AssertPlaceHolder>" ; } handle ( org . apache . servicecomb . pack . alpha . core . TxEvent ) { if ( ( types . contains ( event . type ( ) ) ) && ( isGlobalTxAborted ( event ) ) ) { org . apache . servicecomb . pack . alpha . core . TxConsistentService . LOG . info ( "Transaction<sp>event<sp>{}<sp>rejected,<sp>because<sp>its<sp>parent<sp>with<sp>globalTxId<sp>{}<sp>was<sp>already<sp>aborted" , event . type ( ) , event . globalTxId ( ) ) ; return false ; } eventRepository . save ( event ) ; return true ; }
|
org . junit . Assert . assertThat ( events . size ( ) , org . hamcrest . core . Is . is ( 2 ) )
|
includeExcludeRule3Test ( ) { java . lang . String code = "class<sp>A{isA<sp>T1;}trait<sp>T1{isA<sp>T2<sp><-show()>;void<sp>test(){/*T1*/}<sp>}trait<sp>T2{}" ; cruise . umple . compiler . UmpleModel model = getModel ( code ) ; boolean result = false ; try { model . run ( ) ; } catch ( java . lang . Exception e ) { result = e . getMessage ( ) . contains ( "212" ) ; } finally { "<AssertPlaceHolder>" ; cruise . umple . util . SampleFileWriter . destroy ( "traitTest.ump" ) ; } } contains ( java . lang . Object ) { if ( ( parent ) != null ) { return ( super . contains ( obj ) ) || ( parent . contains ( obj ) ) ; } else { return super . contains ( obj ) ; } }
|
org . junit . Assert . assertTrue ( result )
|
testGetUserHomeDir ( ) { "<AssertPlaceHolder>" ; } getUserHomeDir ( ) { final org . esa . beam . util . File home = org . esa . beam . util . SystemUtils . getBeamHomeDir ( ) ; if ( home . exists ( ) ) { try { final java . lang . String context = org . esa . beam . util . SystemUtils . getApplicationContextId ( ) ; final java . util . Properties config = org . esa . beam . util . SystemUtils . loadConfig ( new org . esa . beam . util . File ( home , ( ( "config/" + context ) + ".config" ) ) ) ; final java . lang . String appTmpFolderStr = config . getProperty ( ( context + ".application_tmp_folder" ) ) ; if ( appTmpFolderStr != null ) { final org . esa . beam . util . File appTmpFolder = new org . esa . beam . util . File ( appTmpFolderStr ) ; if ( ! ( appTmpFolder . exists ( ) ) ) appTmpFolder . mkdirs ( ) ; return appTmpFolder ; } } catch ( java . lang . Exception e ) { } } return new org . esa . beam . util . File ( java . lang . System . getProperty ( "user.home" , "." ) ) ; }
|
org . junit . Assert . assertNotNull ( org . esa . beam . util . SystemUtils . getUserHomeDir ( ) )
|
testMissingParameter ( ) { final net . violet . platform . datamodel . Lang frLang = getSiteFrLang ( ) ; final net . violet . platform . api . actions . Action theAction = new net . violet . platform . api . actions . news . Create ( ) ; final net . violet . platform . api . callers . APICaller caller = getPublicApplicationAPICaller ( ) ; final java . util . Map < java . lang . String , java . lang . Object > theParams = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; theParams . put ( Create . LANGUAGE_PARAM , frLang . getIsoCode ( ) ) ; theParams . put ( Create . PRODUCT_PARAM , "inexisting<sp>product<sp>!" ) ; theParams . put ( Create . BODY_PARAM , "inBody<sp>mock" ) ; theParams . put ( Create . TITLE_PARAM , "title<sp>1" ) ; final net . violet . platform . api . actions . ActionParam theActionParam = new net . violet . platform . api . actions . ActionParam ( caller , theParams ) ; final java . lang . Object theResult = theAction . processRequest ( theActionParam ) ; "<AssertPlaceHolder>" ; } put ( K , T ) { this . mMap . put ( theRef , new net . violet . db . cache . CacheReference < K , T > ( theRef , theRecord , this . mReferenceQueue ) ) ; this . mLinkedMap . put ( theRef , theRecord ) ; }
|
org . junit . Assert . assertNotNull ( theResult )
|
importSettings_ModelReinit ( ) { lcc . importSettings ( ) ; verify ( lcc , times ( 1 ) ) . initResolvedSettings ( ) ; "<AssertPlaceHolder>" ; } getFile ( ) { return file ; }
|
org . junit . Assert . assertNull ( model . getFile ( ) )
|
testUserCanConfigureAJob ( ) { com . sonyericsson . hudson . plugins . gerrit . trigger . GerritServer gerritServer = new com . sonyericsson . hudson . plugins . gerrit . trigger . GerritServer ( PluginImpl . DEFAULT_SERVER_NAME ) ; com . sonymobile . tools . gerrit . gerritevents . mock . SshdServerMock . configureFor ( sshd , gerritServer ) ; com . sonyericsson . hudson . plugins . gerrit . trigger . PluginImpl . getInstance ( ) . addServer ( gerritServer ) ; gerritServer . getConfig ( ) . setNumberOfSendingWorkerThreads ( com . sonyericsson . hudson . plugins . gerrit . trigger . LockedDownGerritEventTest . NUMBEROFSENDERTHREADS ) ; ( ( com . sonyericsson . hudson . plugins . gerrit . trigger . config . Config ) ( gerritServer . getConfig ( ) ) ) . setGerritAuthKeyFile ( sshKey . getPrivateKey ( ) ) ; gerritServer . start ( ) ; com . sonyericsson . hudson . plugins . gerrit . trigger . GerritServer otherServer = new com . sonyericsson . hudson . plugins . gerrit . trigger . GerritServer ( "theOtherServer" ) ; com . sonymobile . tools . gerrit . gerritevents . mock . SshdServerMock . configureFor ( sshd , otherServer ) ; com . sonyericsson . hudson . plugins . gerrit . trigger . PluginImpl . getInstance ( ) . addServer ( otherServer ) ; otherServer . getConfig ( ) . setNumberOfSendingWorkerThreads ( com . sonyericsson . hudson . plugins . gerrit . trigger . LockedDownGerritEventTest . NUMBEROFSENDERTHREADS ) ; ( ( com . sonyericsson . hudson . plugins . gerrit . trigger . config . Config ) ( otherServer . getConfig ( ) ) ) . setGerritAuthKeyFile ( sshKey . getPrivateKey ( ) ) ; otherServer . start ( ) ; hudson . model . FreeStyleProject project = new com . sonyericsson . hudson . plugins . gerrit . trigger . mock . TestUtils . JobBuilder ( j ) . name ( projectName ) . silentStartMode ( false ) . serverName ( "theOtherServer" ) . build ( ) ; com . sonyericsson . hudson . plugins . gerrit . trigger . mock . Setup . lockDown ( j ) ; j . getInstance ( ) . setAuthorizationStrategy ( new org . jvnet . hudson . test . MockAuthorizationStrategy ( ) . grant ( Item . READ , Item . DISCOVER ) . everywhere ( ) . toAuthenticated ( ) . grant ( Jenkins . READ , Item . DISCOVER ) . everywhere ( ) . toEveryone ( ) . grant ( Item . CONFIGURE ) . everywhere ( ) . to ( "bob" ) ) ; final org . jvnet . hudson . test . JenkinsRule . WebClient webClient = j . createWebClient ( ) . login ( "bob" , "bob" ) ; com . gargoylesoftware . htmlunit . html . HtmlPage page = webClient . getPage ( project , "configure" ) ; j . submit ( page . getFormByName ( "config" ) ) ; final hudson . model . FreeStyleProject freshJob = j . jenkins . getItem ( projectName , j . jenkins , hudson . model . FreeStyleProject . class ) ; final java . lang . String serverName = com . sonyericsson . hudson . plugins . gerrit . trigger . hudsontrigger . GerritTrigger . getTrigger ( freshJob ) . getServerName ( ) ; "<AssertPlaceHolder>" ; } getServerName ( ) { return serverName ; }
|
org . junit . Assert . assertEquals ( "theOtherServer" , serverName )
|
testConvert ( ) { java . lang . Long personId = 2L ; org . lnu . is . domain . person . Person person = new org . lnu . is . domain . person . Person ( ) ; person . setId ( personId ) ; java . lang . Long educationTypeId = 3L ; org . lnu . is . domain . education . type . EducationType educationType = new org . lnu . is . domain . education . type . EducationType ( ) ; educationType . setId ( educationTypeId ) ; java . lang . Long personPaperId = 4L ; org . lnu . is . domain . person . paper . PersonPaper personPaper = new org . lnu . is . domain . person . paper . PersonPaper ( ) ; personPaper . setId ( personPaperId ) ; java . lang . Long id = 1L ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; org . lnu . is . domain . person . education . PersonEducation expected = new org . lnu . is . domain . person . education . PersonEducation ( ) ; expected . setPerson ( person ) ; expected . setEducationType ( educationType ) ; expected . setPersonPaper ( personPaper ) ; expected . setId ( id ) ; expected . setBegDate ( begDate ) ; expected . setEndDate ( endDate ) ; org . lnu . is . resource . person . education . PersonEducationResource source = new org . lnu . is . resource . person . education . PersonEducationResource ( ) ; source . setPersonId ( personId ) ; source . setEducationTypeId ( educationTypeId ) ; source . setPersonPaperId ( personPaperId ) ; source . setId ( id ) ; source . setBegDate ( begDate ) ; source . setEndDate ( endDate ) ; org . lnu . is . domain . person . education . PersonEducation actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
createFormField ( ) { wizardAction . openNewLiferayModuleWizard ( ) ; wizardAction . newModule . prepareMaven ( project . getName ( ) , com . liferay . ide . ui . module . tests . FORM_FIELD ) ; wizardAction . finish ( ) ; jobAction . waitForNoRunningJobs ( ) ; viewAction . project . openUpdateMavenProjectDialog ( project . getName ( ) ) ; dialogAction . updateMavenProject . selectAll ( ) ; dialogAction . confirm ( ) ; jobAction . waitForUpdateMavenProject ( ) ; "<AssertPlaceHolder>" ; viewAction . project . closeAndDelete ( project . getName ( ) ) ; } visibleFileTry ( java . lang . String [ ] ) { try { return _getProjects ( ) . isVisible ( files ) ; } catch ( java . lang . Exception e ) { _getProjects ( ) . setFocus ( ) ; try { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - 1 ) ) ; _getProjects ( ) . expand ( parents ) ; _getProjects ( ) . contextMenu ( com . liferay . ide . ui . liferay . action . REFRESH , parents ) ; ide . sleep ( 2000 ) ; } catch ( java . lang . Exception e1 ) { } for ( int i = ( files . length ) - 1 ; i > 0 ; i -- ) { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - i ) ) ; org . eclipse . swtbot . swt . finder . widgets . SWTBotTreeItem parent = _getProjects ( ) . getTreeItem ( parents ) ; _getProjects ( ) . expand ( parents ) ; java . lang . String subnode = files [ ( ( files . length ) - i ) ] ; _jobAction . waitForSubnode ( parent , subnode , com . liferay . ide . ui . liferay . action . REFRESH ) ; } return _getProjects ( ) . isVisible ( files ) ; } }
|
org . junit . Assert . assertTrue ( viewAction . project . visibleFileTry ( project . getName ( ) ) )
|
tabletDirWithTableId ( ) { java . lang . String basePath = fs . getDefaultVolume ( ) . getBasePath ( ) ; java . lang . String scheme = fs . getDefaultVolume ( ) . getFileSystem ( ) . getUri ( ) . toURL ( ) . getProtocol ( ) ; org . apache . hadoop . fs . Path expectedBase = new org . apache . hadoop . fs . Path ( ( ( scheme + ":" ) + basePath ) , FileType . TABLE . getDirectory ( ) ) ; java . util . List < java . lang . String > pathsToTest = java . util . Arrays . asList ( "1/default_tablet" , "1/default_tablet/" , "1/t-0000001" ) ; for ( java . lang . String pathToTest : pathsToTest ) { org . apache . hadoop . fs . Path fullPath = fs . getFullPath ( FileType . TABLE , pathToTest ) ; "<AssertPlaceHolder>" ; } } getFullPath ( org . apache . accumulo . core . data . TableId , java . lang . String ) { if ( path . contains ( ":" ) ) return new org . apache . hadoop . fs . Path ( path ) ; if ( path . startsWith ( "../" ) ) path = path . substring ( 2 ) ; else if ( path . startsWith ( "/" ) ) path = ( "/" + ( tableId . canonical ( ) ) ) + path ; else throw new java . lang . IllegalArgumentException ( ( "Unexpected<sp>path<sp>prefix<sp>" + path ) ) ; return getFullPath ( FileType . TABLE , path ) ; }
|
org . junit . Assert . assertEquals ( new org . apache . hadoop . fs . Path ( expectedBase , pathToTest ) , fullPath )
|
testBuildWithDisabledDefaultConstraintsAndOrderBy ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . wave . type . WaveType context = new org . lnu . is . domain . wave . type . WaveType ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "name" , org . lnu . is . pagination . OrderByType . ASC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>WaveType<sp>e<sp>ORDER<sp>BY<sp>e.name<sp>ASC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . wave . type . WaveType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
test_encode_decode ( ) { final de . metas . fresh . ordercheckup . OrderCheckupBarcode barcode = de . metas . fresh . ordercheckup . OrderCheckupBarcode . ofC_OrderLine_ID ( 12345 ) ; final de . metas . fresh . ordercheckup . OrderCheckupBarcode barcodeDecoded = de . metas . fresh . ordercheckup . OrderCheckupBarcode . fromBarcodeString ( barcode . toBarcodeString ( ) ) ; "<AssertPlaceHolder>" ; } toBarcodeString ( ) { return ( ( ( ( version ) + ( de . metas . fresh . ordercheckup . OrderCheckupBarcode . SEPARATOR ) ) + ( adTableId ) ) + ( de . metas . fresh . ordercheckup . OrderCheckupBarcode . SEPARATOR ) ) + ( recordId ) ; }
|
org . junit . Assert . assertEquals ( barcode , barcodeDecoded )
|
testConfiguredProxyAvoidProxyNonProxyHosts ( ) { avoidProxy = true ; httpProxyHost = "foo" ; httpNonProxyHosts = "www.google.com|*.yahoo.com" ; java . lang . String pac = makeProxyPAC ( ) ; java . lang . String expected = "function<sp>FindProxyForURL(url,<sp>host)<sp>{<sp>" + ( ( ( "if<sp>(shExpMatch(host,<sp>'www.google.com'))<sp>{<sp>return<sp>'DIRECT';<sp>}<sp>" + "if<sp>(shExpMatch(host,<sp>'*.yahoo.com'))<sp>{<sp>return<sp>'DIRECT';<sp>}<sp>" ) + "if<sp>(shExpMatch(url,<sp>'*/selenium-server/*'))<sp>" ) + "{<sp>return<sp>'PROXY<sp>localhost:4444;<sp>PROXY<sp>foo';<sp>}<sp>return<sp>'PROXY<sp>foo';<sp>}" ) ; "<AssertPlaceHolder>" ; } makeProxyPAC ( ) { org . openqa . selenium . Capabilities options = org . openqa . selenium . server . browserlaunchers . BrowserOptions . newBrowserOptions ( ) ; options = org . openqa . selenium . browserlaunchers . Proxies . setOnlyProxySeleniumTraffic ( options , proxySeleniumTrafficOnly ) ; options = org . openqa . selenium . browserlaunchers . Proxies . setAvoidProxy ( options , avoidProxy ) ; org . openqa . selenium . browserlaunchers . Proxies . makeProxyPAC ( parentDir , 4444 , httpProxyHost , httpProxyPort , httpNonProxyHosts , options ) ; return readEntirePacFile ( ) ; }
|
org . junit . Assert . assertEquals ( expected , pac )
|
testCompareDynAny ( ) { java . lang . String msg ; java . math . BigDecimal fixedVal ; org . omg . CORBA . Any any = null ; org . omg . CORBA . TypeCode tc = null ; org . omg . DynamicAny . DynFixed dynAny = null ; org . omg . DynamicAny . DynFixed dynAny2 = null ; tc = orb . create_fixed_tc ( ( ( short ) ( 2 ) ) , ( ( short ) ( 1 ) ) ) ; fixedVal = new java . math . BigDecimal ( "1.0" ) ; any = orb . create_any ( ) ; any . insert_fixed ( fixedVal , tc ) ; dynAny = createDynAnyFromAny ( any ) ; dynAny2 = createDynAnyFromAny ( any ) ; msg = "Comparing<sp>two<sp>equal<sp>DynAny<sp>values<sp>using<sp>DynAny::equal<sp>failed" ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
|
org . junit . Assert . assertTrue ( msg , dynAny . equal ( dynAny2 ) )
|
completeSegmentsEmitted ( ) { okio . Buffer sink = new okio . Buffer ( ) ; okio . BufferedSink bufferedSink = new okio . RealBufferedSink ( sink ) ; bufferedSink . writeUtf8 ( okio . TestUtil . repeat ( 'a' , ( ( Segment . SIZE ) * 3 ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return pos ; }
|
org . junit . Assert . assertEquals ( ( ( Segment . SIZE ) * 3 ) , sink . size ( ) )
|
testSemanticPredicateAnalysisStackOverflow ( ) { java . lang . String grammar = "grammar<sp>T;\n" + ( ( ( ( ( "\n" + "options<sp>{\n" ) + "<sp>backtrack=true;\n" ) + "}\n" ) + "\n" ) + "main<sp>:<sp>(\'x\'*)*;\n" ) ; boolean success = rawGenerateAndBuildRecognizer ( "T.g" , grammar , "TParser" , "TLexer" , false ) ; "<AssertPlaceHolder>" ; } rawGenerateAndBuildRecognizer ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { boolean allIsWell = antlr ( grammarFileName , grammarFileName , grammarStr , debug ) ; if ( ! allIsWell ) { return false ; } if ( lexerName != null ) { boolean ok ; if ( parserName != null ) { ok = compile ( ( parserName + ".java" ) ) ; if ( ! ok ) { allIsWell = false ; } } ok = compile ( ( lexerName + ".java" ) ) ; if ( ! ok ) { allIsWell = false ; } } else { boolean ok = compile ( ( parserName + ".java" ) ) ; if ( ! ok ) { allIsWell = false ; } } return allIsWell ; }
|
org . junit . Assert . assertTrue ( success )
|
testIoListToString_large1 ( ) { final com . ericsson . otp . erlang . OtpErlangObject input = org . erlide . util . erlang . OtpErlang . mkList ( new com . ericsson . otp . erlang . OtpErlangString ( "hej" ) , new com . ericsson . otp . erlang . OtpErlangString ( "hoj" ) ) ; final java . lang . String result = org . erlide . util . Util . ioListToString ( input , 4 ) ; final java . lang . String expected = "hejh...<sp><truncated>" ; "<AssertPlaceHolder>" ; } ioListToString ( com . ericsson . otp . erlang . OtpErlangObject , int ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb = org . erlide . util . Util . ioListToStringBuilder ( o , sb , maxLength ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
getsTooltipOnButton ( ) { org . eclipse . swtbot . swt . finder . widgets . SWTBotToolbarRadioButton button = bot . toolbarRadioButtonWithTooltip ( "SWT.RADIO" ) ; java . lang . String toolTipText = button . getToolTipText ( ) ; "<AssertPlaceHolder>" ; } getToolTipText ( ) { return syncExec ( new org . eclipse . swtbot . swt . finder . results . StringResult ( ) { @ org . eclipse . swtbot . swt . finder . widgets . Override public java . lang . String run ( ) { return org . eclipse . swtbot . swt . finder . utils . SWTUtils . getToolTipText ( widget ) ; } } ) ; }
|
org . junit . Assert . assertEquals ( "SWT.RADIO" , toolTipText )
|
testGetTasksOwnedByExpirationDateWithUserStatusDateOneTaskCompleted ( ) { java . lang . String str = "(with<sp>(new<sp>Task())<sp>{<sp>priority<sp>=<sp>55,<sp>taskData<sp>=<sp>(with(<sp>new<sp>TaskData())<sp>{<sp>expirationTime<sp>=<sp>new<sp>Date(<sp>10000000<sp>),<sp>}<sp>),<sp>" ; str += "peopleAssignments<sp>=<sp>(with<sp>(<sp>new<sp>PeopleAssignments()<sp>)<sp>{<sp>potentialOwners<sp>=<sp>[new<sp>User('Bobba<sp>Fet')<sp>],businessAdministrators<sp>=<sp>[<sp>new<sp>User('Administrator')<sp>],<sp>})," ; str += "name<sp>=<sp>'This<sp>is<sp>my<sp>task<sp>name'<sp>})" ; org . kie . api . task . model . Task task = org . jbpm . services . task . impl . factories . TaskFactory . evalTask ( new java . io . StringReader ( str ) ) ; taskService . addTask ( task , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; java . util . List < org . kie . api . task . model . Status > statuses = new java . util . ArrayList < org . kie . api . task . model . Status > ( ) ; statuses . add ( Status . Completed ) ; java . util . Date date = new java . util . Date ( 10000000 ) ; java . util . List < org . kie . api . task . model . TaskSummary > tasks = taskService . getTasksOwnedByExpirationDate ( "Bobba<sp>Fet" , statuses , date ) ; "<AssertPlaceHolder>" ; } size ( ) { return data . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , tasks . size ( ) )
|
getSourceMessageWithLastTimeNUTest ( ) { final long sourceUpdateTime = ( java . lang . System . currentTimeMillis ( ) ) / 1000 ; final net . violet . platform . datamodel . Source source = new net . violet . platform . datamodel . mock . SourceMock ( 8205 , "air.paris.today" , 9 , sourceUpdateTime ) ; final long theLastTime = sourceUpdateTime * 1000 ; final net . violet . platform . datamodel . Subscription theSubscription = new net . violet . platform . datamodel . mock . SubscriptionMock ( 1 , Factories . APPLICATION . findByName ( "net.violet.air" ) , getKowalskyObject ( ) ) ; final java . util . Map < java . lang . String , java . lang . Object > theSettings = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; theSettings . put ( AirHandler . LANGUAGE_SETTING , "fr-FR" ) ; theSettings . put ( AirHandler . SOURCE_SETTING , source . getSource_path ( ) ) ; theSubscription . setSettings ( theSettings ) ; final net . violet . platform . dataobjects . SubscriptionData theSubscriptionData = net . violet . platform . dataobjects . SubscriptionData . getData ( theSubscription ) ; final net . violet . platform . dataobjects . SubscriptionSchedulingData theScheduling = net . violet . platform . dataobjects . SubscriptionSchedulingData . create ( theSubscriptionData , SchedulingType . SCHEDULING_TYPE . Ambiant ) ; theScheduling . createSetting ( AmbiantHandler . LAST_TIME , java . lang . Long . toString ( theLastTime ) ) ; final net . violet . platform . message . application . factories . AirMessageFactory factory = ( ( net . violet . platform . message . application . factories . AirMessageFactory ) ( net . violet . platform . message . application . factories . AbstractMessageFactory . getFactoryByApplication ( theSubscription . getApplication ( ) ) ) ) ; final net . violet . platform . message . MessageDraft theMessage = factory . getSourceMessage ( theScheduling , theLastTime ) ; "<AssertPlaceHolder>" ; } getSourceMessage ( net . violet . platform . daemons . schedulers . AbstractScheduler . MessageProcessUnit , long ) { final net . violet . platform . dataobjects . SubscriptionSchedulingData theSubscriptionSchedulingData = inMessageProcessUnit . get ( ) ; final net . violet . platform . dataobjects . SubscriptionData theSubscription = theSubscriptionSchedulingData . getSubscription ( ) ; final net . violet . platform . dataobjects . SubscriptionSchedulingSettingsData lastTimeSetting = net . violet . platform . dataobjects . SubscriptionSchedulingSettingsData . findBySubscriptionSchedulingAndKey ( theSubscriptionSchedulingData , AmbiantHandler . LAST_TIME ) ; net . violet . platform . message . MessageDraft theMessage = null ; try { final long objectLastUpdate ; if ( ( lastTimeSetting != null ) && ( lastTimeSetting . isValid ( ) ) ) { objectLastUpdate = java . lang . Long . parseLong ( lastTimeSetting . getValue ( ) ) ; } else { objectLastUpdate = 0 ; } final java . lang . String theSourcePath = getAmbiantSourcePath ( theSubscriptionSchedulingData ) ; if ( theSourcePath != null ) { final net . violet . platform . datamodel . Source theSource = Factories . SOURCE . findByPath ( theSourcePath ) ; if ( theSource != null ) { final long sourceLastUpdate = ( theSource . getSource_time ( ) ) * 1000 ; if ( ( ( inMessageProcessUnit . isAdd ( ) ) && ( objectLastUpdate < sourceLastUpdate ) ) || ( ! ( inMessageProcessUnit . isAdd ( ) ) ) ) { theMessage = generateSourceMessage ( theSubscription . getObject ( ) . getReference ( ) , theSource , inMessageProcessUnit . isAdd ( ) ) ; } } } } finally { if ( theMessage != null ) { if ( ( lastTimeSetting == null ) || ( ! ( lastTimeSetting . isValid ( ) ) ) ) { theSubscriptionSchedulingData . createSetting ( AmbiantHandler . LAST_TIME , java . lang . Long . toString ( inLastTime ) ) ; } else { lastTimeSetting . setValue ( java . lang . Long . toString ( inLastTime ) ) ; } } } return theMessage ; }
|
org . junit . Assert . assertNull ( theMessage )
|
testBreadthFirstSearch ( ) { edu . illinois . cs . cogcomp . core . search . GraphSearch < edu . illinois . cs . cogcomp . core . datastructures . Pair < java . lang . Integer , java . lang . Integer > > dfs = new edu . illinois . cs . cogcomp . core . search . BreadthFirstSearch ( ) ; edu . illinois . cs . cogcomp . core . datastructures . Pair < java . lang . Integer , java . lang . Integer > result = dfs . search ( new edu . illinois . cs . cogcomp . core . datastructures . Pair ( 0 , 0 ) , stateManager ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( result , new edu . illinois . cs . cogcomp . core . datastructures . Pair ( 4 , 0 ) )
|
testViewReboot ( ) { org . openntf . domino . Session sess = org . openntf . domino . utils . Factory . getSession ( SessionType . CURRENT ) ; org . openntf . domino . View vw = sess . getDatabase ( "log.nsf" ) . getViews ( ) . get ( 0 ) ; org . openntf . domino . View ret = test ( vw , true ) ; "<AssertPlaceHolder>" ; } test ( T , boolean ) { java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( bos ) ; out . writeObject ( obj ) ; if ( reboot ) doReboot ( ) ; java . io . ByteArrayInputStream bis = new java . io . ByteArrayInputStream ( bos . toByteArray ( ) ) ; java . io . ObjectInput in = null ; in = new java . io . ObjectInputStream ( bis ) ; T ret = ( ( T ) ( in . readObject ( ) ) ) ; org . junit . Assert . assertEquals ( obj , ret ) ; return ret ; }
|
org . junit . Assert . assertFalse ( ( vw == ret ) )
|
shouldReturnZeroAsVersionWhenEmptyDirectoryGiven ( ) { org . cognitor . cassandra . migration . MigrationRepository repository = new org . cognitor . cassandra . migration . MigrationRepository ( "cassandra/migrationtest/empty" ) ; "<AssertPlaceHolder>" ; } getLatestVersion ( ) { if ( migrationScripts . isEmpty ( ) ) { return 0 ; } return migrationScripts . get ( ( ( migrationScripts . size ( ) ) - 1 ) ) . getVersion ( ) ; }
|
org . junit . Assert . assertThat ( repository . getLatestVersion ( ) , org . hamcrest . core . Is . is ( org . hamcrest . CoreMatchers . equalTo ( 0 ) ) )
|
checkComboBox ( ) { com . vaadin . testbench . elements . ComboBoxElement elem = $ ( com . vaadin . testbench . elements . ComboBoxElement . class ) . get ( 0 ) ; java . lang . String expected = ComponentElementGetValue . TEST_STRING_VALUE ; java . lang . String actual = elem . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { java . util . List < org . openqa . selenium . WebElement > selectedElements = findElements ( org . openqa . selenium . By . className ( "v-tree-node-selected" ) ) ; if ( selectedElements . isEmpty ( ) ) { return "" ; } else { return selectedElements . get ( 0 ) . getText ( ) ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
updateProductReview_titleMaxLength ( ) { org . oscm . internal . review . POServiceReview presentationObject = createPresentationObject ( ) ; presentationObject . setTitle ( longText ( ADMValidator . LENGTH_NAME ) ) ; org . oscm . domobjects . ProductReview domainObject = new org . oscm . domobjects . ProductReview ( ) ; org . oscm . internal . assembler . POServiceReviewAssembler . updateProductReview ( domainObject , presentationObject ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return title ; }
|
org . junit . Assert . assertEquals ( ADMValidator . LENGTH_NAME , domainObject . getTitle ( ) . length ( ) )
|
testQueryWithFacets ( ) { java . lang . String table = "testQueryWithFacets" ; org . apache . blur . thrift . TableGen . define ( table ) . cols ( "test" , "string:facet" ) . addRow ( 20 , "r1" , "rec###" , "value-###" ) . build ( getClient ( ) ) ; org . apache . blur . thrift . QueryBuilder qb = org . apache . blur . thrift . QueryBuilder . define ( "*" ) ; for ( int i = 0 ; i < 250 ; i ++ ) { qb . withFacet ( ( "test.facet:" + i ) , Long . MAX_VALUE ) ; } org . apache . blur . thrift . generated . BlurResults resultsRow = qb . run ( table , getClient ( ) ) ; "<AssertPlaceHolder>" ; } getTotalResults ( ) { return iterable . getTotalResults ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , resultsRow . getTotalResults ( ) )
|
testGetCanonicalId ( ) { expect ( mockConnection . getBlobStore ( ) ) . andReturn ( mockStore ) . times ( 3 ) ; expect ( mockStore . getId ( ) ) . andReturn ( de . fiz . akubra . hdfs . HDFSBlobTest . blobStoreUri ) . times ( 2 ) ; expect ( mockConnection . getFileSystem ( ) ) . andReturn ( mockFs ) ; replay ( mockConnection , mockFs , mockStore ) ; de . fiz . akubra . hdfs . HDFSBlob b = new de . fiz . akubra . hdfs . HDFSBlob ( de . fiz . akubra . hdfs . HDFSBlobTest . blobUri , mockConnection ) ; "<AssertPlaceHolder>" ; } getCanonicalId ( ) { return uri ; }
|
org . junit . Assert . assertEquals ( de . fiz . akubra . hdfs . HDFSBlobTest . blobUri , b . getCanonicalId ( ) )
|
testEncodingDecoding ( ) { org . ccnx . ccn . impl . support . Log . info ( Log . FAC_TEST , "Starting<sp>testEncodingDecoding" ) ; byte [ ] [ ] arr = new byte [ 4 ] [ ] ; arr [ 0 ] = baseName . getBytes ( ) ; arr [ 1 ] = subName1 . getBytes ( ) ; arr [ 2 ] = document1 . getBytes ( ) ; arr [ 3 ] = document3 ; org . ccnx . ccn . protocol . ContentName name = new org . ccnx . ccn . protocol . ContentName ( arr ) ; System . out . println ( ( "Encoding<sp>name:<sp>" + name ) ) ; "<AssertPlaceHolder>" ; org . ccnx . ccn . protocol . ContentName tn = new org . ccnx . ccn . protocol . ContentName ( ) ; org . ccnx . ccn . protocol . ContentName bn = new org . ccnx . ccn . protocol . ContentName ( ) ; org . ccnx . ccn . encoding . XMLEncodableTester . encodeDecodeTest ( "ContentName" , name , tn , bn ) ; org . ccnx . ccn . impl . support . Log . info ( Log . FAC_TEST , "Completed<sp>testEncodingDecoding" ) ; } getBytes ( ) { return _byteCommandMarker ; }
|
org . junit . Assert . assertNotNull ( name )
|
testWsPort_shouldBeExportedWithCorrectId ( ) { org . openengsb . core . util . DefaultOsgiUtilsService utilsService = new org . openengsb . core . util . DefaultOsgiUtilsService ( getBundleContext ( ) ) ; org . openengsb . core . api . remote . OutgoingPort serviceWithId = utilsService . getServiceWithId ( org . openengsb . core . api . remote . OutgoingPort . class , "ws-json" , 60000 ) ; "<AssertPlaceHolder>" ; } getServiceWithId ( java . lang . String , java . lang . String , long ) { org . osgi . framework . Filter filter = org . openengsb . core . util . FilterUtils . makeFilter ( className , java . lang . String . format ( "(%s=%s)" , org . osgi . framework . Constants . SERVICE_PID , id ) ) ; return getService ( filter , timeout ) ; }
|
org . junit . Assert . assertNotNull ( serviceWithId )
|
testByteObjNull ( ) { java . lang . Class < com . j256 . ormlite . field . types . ByteObjectTypeTest . LocalByteObj > clazz = com . j256 . ormlite . field . types . ByteObjectTypeTest . LocalByteObj . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . ByteObjectTypeTest . LocalByteObj , java . lang . Object > dao = createDao ( clazz , true ) ; com . j256 . ormlite . field . types . ByteObjectTypeTest . LocalByteObj foo = new com . j256 . ormlite . field . types . ByteObjectTypeTest . LocalByteObj ( ) ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , null , null , null , null , DataType . BYTE_OBJ , com . j256 . ormlite . field . types . ByteObjectTypeTest . BYTE_COLUMN , false , true , false , false , false , false , true , true ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
|
org . junit . Assert . assertEquals ( 1 , dao . create ( new com . j256 . ormlite . field . types . ByteObjectTypeTest . LocalByteObj ( ) ) )
|
ruleIsIntroducedAndEvaluated ( ) { org . junit . rules . TestRuleTest . wasRun = false ; org . junit . runner . JUnitCore . runClasses ( org . junit . rules . TestRuleTest . ExampleTest . class ) ; "<AssertPlaceHolder>" ; } runClasses ( java . lang . Class [ ] ) { return org . junit . runner . JUnitCore . runClasses ( org . junit . runner . JUnitCore . defaultComputer ( ) , classes ) ; }
|
org . junit . Assert . assertTrue ( org . junit . rules . TestRuleTest . wasRun )
|
existingDocumentTerminalFromUI ( ) { org . xwiki . model . reference . DocumentReference documentReference = new org . xwiki . model . reference . DocumentReference ( "xwiki" , java . util . Arrays . asList ( "Main" ) , "WebHome" ) ; com . xpn . xwiki . doc . XWikiDocument document = mock ( com . xpn . xwiki . doc . XWikiDocument . class ) ; when ( document . getDocumentReference ( ) ) . thenReturn ( documentReference ) ; when ( document . isNew ( ) ) . thenReturn ( false ) ; context . setDoc ( document ) ; when ( mockRequest . getParameter ( "tocreate" 0 ) ) . thenReturn ( "X" ) ; when ( mockRequest . getParameter ( "name" ) ) . thenReturn ( "Y" ) ; when ( mockRequest . getParameter ( "tocreate" ) ) . thenReturn ( "terminal" ) ; java . lang . String result = action . render ( context ) ; "<AssertPlaceHolder>" ; verify ( mockURLFactory ) . createURL ( "X" , "Y" , "edit" , "template=&parent=Main.WebHome&title=Y" , null , "xwiki" , context ) ; } render ( com . xpn . xwiki . XWikiContext ) { com . xpn . xwiki . web . XWikiRequest request = context . getRequest ( ) ; java . lang . String path = request . getRequestURI ( ) ; java . lang . String filename = com . xpn . xwiki . util . Util . decodeURI ( path . substring ( ( ( path . lastIndexOf ( "/" ) ) + 1 ) ) , context ) ; try { ( ( com . xpn . xwiki . plugin . charts . ChartingPluginApi ) ( context . getWiki ( ) . getPluginApi ( "charting" , context ) ) ) . outputFile ( filename , context ) ; } catch ( java . io . IOException e ) { throw new com . xpn . xwiki . XWikiException ( com . xpn . xwiki . XWikiException . MODULE_XWIKI_APP , com . xpn . xwiki . XWikiException . ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION , "Exception<sp>while<sp>sending<sp>response" , e ) ; } return null ; }
|
org . junit . Assert . assertNull ( result )
|
builds_should_never_be_building ( ) { fr . norad . visuwall . api . domain . SoftwareProjectId softwareProjectId = new fr . norad . visuwall . api . domain . SoftwareProjectId ( "projectId" ) ; boolean isBuilding = sonar . isBuilding ( softwareProjectId , 1 ) ; "<AssertPlaceHolder>" ; } isBuilding ( fr . norad . visuwall . api . domain . SoftwareProjectId , java . lang . Integer ) { checkConnected ( ) ; checkSoftwareProjectId ( softwareProjectId ) ; return false ; }
|
org . junit . Assert . assertFalse ( isBuilding )
|
testSetBottomId ( ) { edge . setBottomId ( 100 ) ; "<AssertPlaceHolder>" ; } getBottomId ( ) { return this . f1 ; }
|
org . junit . Assert . assertEquals ( 100 , ( ( long ) ( edge . getBottomId ( ) ) ) )
|
testTargetNullForStaticMethod ( ) { final spoon . reflect . factory . Factory factory = spoon . testing . utils . ModelUtils . build ( spoon . test . invocations . testclasses . Bar . class ) ; final spoon . reflect . declaration . CtClass < spoon . test . invocations . testclasses . Bar > barClass = factory . Class ( ) . get ( spoon . test . invocations . testclasses . Bar . class ) ; final spoon . reflect . declaration . CtMethod < ? > staticMethod = barClass . getMethodsByName ( "staticMethod" ) . get ( 0 ) ; final spoon . reflect . reference . CtExecutableReference < ? > reference = factory . Method ( ) . createReference ( staticMethod ) ; try { final spoon . reflect . code . CtInvocation < ? > invocation = factory . Code ( ) . createInvocation ( null , reference ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . NullPointerException e ) { org . junit . Assert . fail ( ) ; } } getTarget ( ) { return target ; }
|
org . junit . Assert . assertNull ( invocation . getTarget ( ) )
|
testSpecEnableCountingNo ( ) { com . hp . hpl . jena . rdf . model . Model m = com . epimorphics . jsonrdf . utils . ModelIOUtils . modelFromTurtle ( ":my<sp>a<sp>api:API;<sp>elda:enableCounting<sp>'no';<sp>api:sparqlEndpoint<sp>:spoo" ) ; com . hp . hpl . jena . rdf . model . Resource root = m . createResource ( m . expandPrefix ( ":my" ) ) ; com . epimorphics . lda . specs . APISpec s = com . epimorphics . lda . apispec . tests . SpecUtil . specFrom ( root ) ; "<AssertPlaceHolder>" ; } getEnableCounting ( ) { return Boolean . FALSE ; }
|
org . junit . Assert . assertEquals ( Boolean . FALSE , s . getEnableCounting ( ) )
|
printWeekdaysZH ( ) { net . time4j . format . TextWidth textWidth = net . time4j . format . TextWidth . ABBREVIATED ; net . time4j . format . OutputContext outputContext = net . time4j . format . OutputContext . FORMAT ; net . time4j . format . CalendarText instance = net . time4j . format . CalendarText . getInstance ( "iso8601" , Locale . SIMPLIFIED_CHINESE ) ; java . lang . String result = instance . getWeekdays ( textWidth , outputContext ) . print ( Weekday . SUNDAY ) ; "<AssertPlaceHolder>" ; } print ( net . time4j . format . TemporalFormatter ) { return printer . print ( this ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( "" ) )
|
testOutputInsertAndDelete ( ) { org . talend . components . snowflake . SnowflakeConnectionTableProperties props = populateOutput ( 100 ) ; readAndCheckRows ( props , 100 ) ; handleRows ( makeRows ( 100 ) , props , TSnowflakeOutputProperties . OutputAction . DELETE ) ; "<AssertPlaceHolder>" ; } readRows ( org . talend . components . salesforce . tsalesforceinput . TSalesforceInputProperties ) { org . talend . components . api . component . runtime . BoundedReader < org . apache . avro . generic . IndexedRecord > reader = createBoundedReader ( inputProps ) ; boolean hasRecord = reader . start ( ) ; java . util . List < org . apache . avro . generic . IndexedRecord > rows = new java . util . ArrayList ( ) ; while ( hasRecord ) { org . apache . avro . generic . IndexedRecord unenforced = reader . getCurrent ( ) ; rows . add ( unenforced ) ; hasRecord = reader . advance ( ) ; } return rows ; }
|
org . junit . Assert . assertEquals ( 0 , readRows ( props ) . size ( ) )
|
testGetAlerts ( ) { try ( com . salesforce . dva . argus . sdk . ArgusService argusService = new com . salesforce . dva . argus . sdk . ArgusService ( getMockedClient ( "/AlertServiceTest.json" ) ) ) { com . salesforce . dva . argus . sdk . AlertService alertService = argusService . getAlertService ( ) ; java . util . List < com . salesforce . dva . argus . sdk . entity . Alert > result = alertService . getAlerts ( false ) ; java . util . List < com . salesforce . dva . argus . sdk . entity . Alert > expected = java . util . Arrays . asList ( new com . salesforce . dva . argus . sdk . entity . Alert [ ] { _constructPersistedAlert ( ) } ) ; "<AssertPlaceHolder>" ; } } _constructPersistedAlert ( ) { com . salesforce . dva . argus . sdk . entity . Alert alert = _constructUnpersistedAlert ( ) ; alert . setCreatedDate ( new java . util . Date ( 1472282830936L ) ) ; alert . setCreatedById ( BigInteger . ONE ) ; alert . setId ( BigInteger . ONE ) ; alert . setModifiedById ( BigInteger . ONE ) ; alert . setModifiedDate ( alert . getCreatedDate ( ) ) ; return alert ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testSerialization1 ( ) { org . jfree . chart . plot . MeterPlot p1 = new org . jfree . chart . plot . MeterPlot ( null ) ; p1 . setDialBackgroundPaint ( new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; p1 . setDialOutlinePaint ( new java . awt . GradientPaint ( 4.0F , 3.0F , java . awt . Color . red , 2.0F , 1.0F , java . awt . Color . blue ) ) ; p1 . setNeedlePaint ( new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; p1 . setTickLabelPaint ( new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; p1 . setTickPaint ( new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; org . jfree . chart . plot . MeterPlot p2 = ( ( org . jfree . chart . plot . MeterPlot ) ( org . jfree . chart . TestUtilities . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( p1 , p2 )
|
testOneFalseFilter ( ) { com . northconcepts . eventbus . EventFilter filter = new com . northconcepts . eventbus . filter . OrFilter ( FALSE_FILTER ) ; "<AssertPlaceHolder>" ; } allow ( com . northconcepts . eventbus . Event , java . lang . Object ) { return true ; }
|
org . junit . Assert . assertFalse ( filter . allow ( event , listener ) )
|
testCalcNormalizedEdgeDistance ( ) { com . graphhopper . util . DistanceCalc2D distanceCalc = new com . graphhopper . util . DistanceCalc2D ( ) ; double distance = distanceCalc . calcNormalizedEdgeDistance ( 0 , 10 , 0 , 0 , 10 , 10 ) ; "<AssertPlaceHolder>" ; } calcNormalizedEdgeDistance ( double , double , double , double , double , double ) { return calcNormalizedEdgeDistanceNew ( r_lat_deg , r_lon_deg , a_lat_deg , a_lon_deg , b_lat_deg , b_lon_deg , false ) ; }
|
org . junit . Assert . assertEquals ( 50 , distance , 0 )
|
getCardsStatusByBoardOnDoubleSnapshotTest ( ) { io . lavagna . service . Map < java . lang . Long , io . lavagna . service . Map < io . lavagna . service . ColumnDefinition , java . lang . Long > > results = statisticsService . getCardsStatusByBoard ( board . getId ( ) , oneMonthAgo ) ; "<AssertPlaceHolder>" ; snapshotStatistics ( ) ; snapshotStatistics ( ) ; results = statisticsService . getCardsStatusByBoard ( board . getId ( ) , oneMonthAgo ) ; verifyResults ( results , 1 , today , ColumnDefinition . OPEN , 1 ) ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
|
shouldValidateInstallmentSchedule ( ) { java . util . List < org . mifos . accounts . loan . util . helpers . RepaymentScheduleInstallment > installments = new java . util . ArrayList < org . mifos . accounts . loan . util . helpers . RepaymentScheduleInstallment > ( ) ; org . mifos . platform . validations . Errors expectedErrors = new org . mifos . platform . validations . Errors ( ) ; java . math . BigDecimal minInstallmentAmount = java . math . BigDecimal . ZERO ; when ( installmentsValidator . validateInstallmentSchedule ( installments , minInstallmentAmount ) ) . thenReturn ( expectedErrors ) ; org . mifos . platform . validations . Errors errors = loanAccountServiceFacade . validateInstallmentSchedule ( new java . util . ArrayList < org . mifos . dto . domain . LoanCreationInstallmentDto > ( ) , minInstallmentAmount ) ; "<AssertPlaceHolder>" ; verify ( installmentsValidator ) . validateInstallmentSchedule ( installments , minInstallmentAmount ) ; } validateInstallmentSchedule ( java . util . List , java . math . BigDecimal ) { org . mifos . application . master . business . MifosCurrency currency = org . mifos . framework . util . helpers . Money . getDefaultCurrency ( ) ; java . util . List < org . mifos . accounts . loan . util . helpers . RepaymentScheduleInstallment > installments = new java . util . ArrayList < org . mifos . accounts . loan . util . helpers . RepaymentScheduleInstallment > ( ) ; for ( org . mifos . dto . domain . LoanCreationInstallmentDto dto : dtoInstallments ) { org . mifos . framework . util . helpers . Money principal = new org . mifos . framework . util . helpers . Money ( currency , dto . getPrincipal ( ) ) ; org . mifos . framework . util . helpers . Money interest = new org . mifos . framework . util . helpers . Money ( currency , dto . getInterest ( ) ) ; org . mifos . framework . util . helpers . Money fees = new org . mifos . framework . util . helpers . Money ( currency , dto . getFees ( ) ) ; org . mifos . framework . util . helpers . Money miscFees = new org . mifos . framework . util . helpers . Money ( currency ) ; org . mifos . framework . util . helpers . Money miscPenalty = new org . mifos . framework . util . helpers . Money ( currency ) ; org . mifos . accounts . loan . util . helpers . RepaymentScheduleInstallment installment = new org . mifos . accounts . loan . util . helpers . RepaymentScheduleInstallment ( dto . getInstallmentNumber ( ) , dto . getDueDate ( ) , principal , interest , fees , miscFees , miscPenalty ) ; installment . setTotalAndTotalValue ( new org . mifos . framework . util . helpers . Money ( currency , dto . getTotal ( ) ) ) ; installments . add ( installment ) ; } return installmentsValidator . validateInstallmentSchedule ( installments , minInstallmentAmount ) ; }
|
org . junit . Assert . assertThat ( errors , org . hamcrest . Matchers . is ( expectedErrors ) )
|
testEmptyString ( ) { java . lang . String emptyString = "" ; org . openscience . cdk . io . MDLReader reader = new org . openscience . cdk . io . MDLReader ( new java . io . StringReader ( emptyString ) , org . openscience . cdk . io . IChemObjectReader . Mode . STRICT ) ; org . openscience . cdk . interfaces . IAtomContainer mol = ( ( org . openscience . cdk . interfaces . IAtomContainer ) ( reader . read ( new org . openscience . cdk . silent . AtomContainer ( ) ) ) ) ; reader . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { add ( new org . openscience . cdk . renderer . elements . path . Close ( ) ) ; }
|
org . junit . Assert . assertNull ( mol )
|
testBackwardsCompatibleUnsaltedAuthenticationInfo ( ) { org . apache . shiro . authc . credential . HashedCredentialsMatcher matcher = new org . apache . shiro . authc . credential . HashedCredentialsMatcher ( org . apache . shiro . crypto . hash . Sha1Hash . ALGORITHM_NAME ) ; final java . lang . String username = "username" ; final java . lang . String password = "password" ; final java . lang . Object hashedPassword = new org . apache . shiro . crypto . hash . Sha1Hash ( password ) . getBytes ( ) ; org . apache . shiro . authc . AuthenticationInfo account = new org . apache . shiro . authc . AuthenticationInfo ( ) { public org . apache . shiro . subject . PrincipalCollection getPrincipals ( ) { return new org . apache . shiro . subject . SimplePrincipalCollection ( username , "realmName" ) ; } public java . lang . Object getCredentials ( ) { return hashedPassword ; } } ; org . apache . shiro . authc . AuthenticationToken token = new org . apache . shiro . authc . UsernamePasswordToken ( "username" , "password" ) ; "<AssertPlaceHolder>" ; } doCredentialsMatch ( org . apache . shiro . authc . AuthenticationToken , org . apache . shiro . authc . AuthenticationInfo ) { org . apache . shiro . authc . credential . PasswordService service = ensurePasswordService ( ) ; java . lang . Object submittedPassword = getSubmittedPassword ( token ) ; java . lang . Object storedCredentials = getStoredPassword ( info ) ; assertStoredCredentialsType ( storedCredentials ) ; if ( storedCredentials instanceof org . apache . shiro . crypto . hash . Hash ) { org . apache . shiro . crypto . hash . Hash hashedPassword = ( ( org . apache . shiro . crypto . hash . Hash ) ( storedCredentials ) ) ; org . apache . shiro . authc . credential . HashingPasswordService hashingService = assertHashingPasswordService ( service ) ; return hashingService . passwordsMatch ( submittedPassword , hashedPassword ) ; } java . lang . String formatted = ( ( java . lang . String ) ( storedCredentials ) ) ; return passwordService . passwordsMatch ( submittedPassword , formatted ) ; }
|
org . junit . Assert . assertTrue ( matcher . doCredentialsMatch ( token , account ) )
|
testFindFromBundleInNoRegion ( ) { this . candidates . add ( serviceReference ( org . eclipse . equinox . region . internal . tests . hook . RegionServiceFindHookTests . BUNDLE_A ) ) ; org . osgi . framework . Bundle stranger = createBundle ( "stranger" ) ; this . bundleFindHook . find ( stranger . getBundleContext ( ) , "" , "" , false , this . candidates ) ; "<AssertPlaceHolder>" ; } size ( ) { return count ; }
|
org . junit . Assert . assertEquals ( 0 , this . candidates . size ( ) )
|
deleteProject ( ) { java . io . File dataDir = tempDir . getRoot ( ) ; when ( settings . getDocumentrDataDir ( ) ) . thenReturn ( dataDir ) ; de . blizzy . documentr . repository . ProjectRepositoryManagerFactory repoManagerFactory = new de . blizzy . documentr . repository . ProjectRepositoryManagerFactory ( ) ; org . powermock . reflect . Whitebox . setInternalState ( repoManagerFactory , lockManager , eventBus ) ; de . blizzy . documentr . repository . GlobalRepositoryManager globalRepoManager = new de . blizzy . documentr . repository . GlobalRepositoryManager ( ) ; org . powermock . reflect . Whitebox . setInternalState ( globalRepoManager , settings , repoManagerFactory , eventBus ) ; globalRepoManager . init ( ) ; globalRepoManager . createProjectCentralRepository ( "project" , de . blizzy . documentr . repository . GlobalRepositoryManagerTest . USER ) ; globalRepoManager . deleteProject ( "project" , de . blizzy . documentr . repository . GlobalRepositoryManagerTest . USER ) ; "<AssertPlaceHolder>" ; } listProjects ( ) { return de . blizzy . documentr . web . Functions . repoManager . listProjects ( ) ; }
|
org . junit . Assert . assertTrue ( globalRepoManager . listProjects ( ) . isEmpty ( ) )
|
testCustomTerminalOperator_Sum ( ) { int sum = com . annimon . stream . Stream . of ( 1 , 2 , 3 , 4 , 5 ) . custom ( new com . annimon . stream . CustomOperators . Sum ( ) ) ; "<AssertPlaceHolder>" ; } custom ( com . annimon . stream . function . Function ) { com . annimon . stream . Objects . requireNonNull ( function ) ; return function . apply ( this ) ; }
|
org . junit . Assert . assertEquals ( 15 , sum )
|
testGetAxesDistLabelsOk ( ) { final net . sf . latexdraw . model . api . shape . Point pt = ShapeFactory . INST . createPoint ( 10.0 , 11.0 ) ; init4getAxes ( ) . setDistLabels ( pt ) ; "<AssertPlaceHolder>" ; } getDistLabels ( ) { return ShapeFactory . INST . createPoint ( getDistLabelsX ( ) , getDistLabelsY ( ) ) ; }
|
org . junit . Assert . assertEquals ( pt , shape . getDistLabels ( ) )
|
testBondOrderAlipF ( ) { org . openscience . cdk . isomorphism . matchers . Expr expr = new org . openscience . cdk . isomorphism . matchers . Expr ( ALIPHATIC_ORDER , 2 ) ; org . openscience . cdk . interfaces . IBond bond = mock ( org . openscience . cdk . interfaces . IBond . class ) ; when ( bond . isAromatic ( ) ) . thenReturn ( true ) ; when ( bond . getOrder ( ) ) . thenReturn ( IBond . Order . DOUBLE ) ; "<AssertPlaceHolder>" ; } matches ( org . openscience . cdk . interfaces . IAtomContainer ) { return matches ( atomContainer , true ) ; }
|
org . junit . Assert . assertFalse ( expr . matches ( bond ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.